void LessMediaQuery::process(Stylesheet &s) { MediaQuery* query = s.createMediaQuery(); query->setSelector(*getSelector()); getContext()->processValue(query->getSelector()); LessStylesheet::process(*query, *parent->getContext()); }
bool SociContainer::isTable(void) { StdString t = getSelector(); if(t.length() == 0) return true; if(t[0] == '{') return true; return false; }
void MediaQueryRuleset::process(Stylesheet &s, Selector* prefix, ProcessingContext &context) { MediaQuery* query; Ruleset* target; Selector selector; #ifdef WITH_LIBGLOG VLOG(2) << "Processing Less Ruleset: " << getSelector().toString(); #endif query = s.createMediaQuery(); selector = getSelector(); context.interpolate(selector); if (query->getSelector().size() > 0) { selector.pop_front(); query->getSelector().push_back(Token(" ", Token::WHITESPACE)); query->getSelector().push_back(Token("and", Token::IDENTIFIER)); query->getSelector().insert(query->getSelector().end(), selector.begin(), selector.end()); } else query->setSelector(selector); if (prefix != NULL) { target = query->createRuleset(); target->setSelector(*prefix); #ifdef WITH_LIBGLOG VLOG(3) << "Interpolating selector " << target->getSelector().toString(); #endif context.interpolate(target->getSelector()); insert(NULL, *target, context); } else insert(NULL, *query, context); }
StdString SociContainer::selectorToQuery(void) { StdString q = getSelector(); if(q.length() == 0) return q; if(q[0] == '{' && q != "{}" && q.length() > 1) q = "select * from "+ q.substr(1, q.length()-2); else q = mQuery; return q; }
CCAction * SFCallFuncO::ccAction(void) { CCObject * pTargetCallback = getTargetCallback(); CCString * pSelector = getSelector(); if (!pTargetCallback || !pSelector) { CNLog("error"); return NULL; } CNSelectorDelegate * pCallback = dynamic_cast<CNSelectorDelegate *>(pTargetCallback); if (!pCallback) { CNLog("cannot get selector: %s", pSelector->getCString()); return NULL; } SEL_CallFuncO selector = pCallback->getSelectorO(pSelector->getCString()); if (!selector) { CNLog("no such selector: %s", pSelector->getCString()); return NULL; } return CCCallFuncO::actionWithTarget(pTargetCallback, selector, m_pObject); }
int main(void) { int cam_mode,cam_x1,cam_y1,cam_width,cam_heigth,cam_zx,cam_zy; if(getSelector() == 0) return; char c; int i;//buff_length; //int wait_cam; //defining the position of the several inputs and outputs (motors are outputs) in the respective SFR //the SFR are programed as structures, so accessing to an input/output implies only acessing to the field of the structure corresponding to the SFR that was //assigned to that input/output (see epuck_ports.h and p30f6014.h to understand the SFR assignment) e_init_port(); e_init_motors(); //important to enable uart interface e_init_uart1(); e_init_ad_scan(ALL_ADC); e_calibrate_ir(); //initial configuration of the camera cam_x1=(ARRAY_WIDTH/Z_WIDTH-WIDTH)/2; cam_y1=(ARRAY_HEIGHT/Z_HEIGHT-HEIGHT)/2; cam_width=WIDTH; cam_heigth=HEIGHT; cam_zx=Z_WIDTH; cam_zy=Z_HEIGHT; cam_mode=MODE; if(cam_mode==GREY_SCALE_MODE) cam_size=cam_width*cam_heigth; else cam_size=cam_width*cam_heigth*2; //not waiting for camera wait_cam=0; e_activate_agenda(updateFlag, 500);//500//1000 e_activate_agenda(readValues, 10); e_start_agendas_processing(); keepFinding = 0; e_set_led(4,1); keepFinding = 1; int s = getSelector(); while(s==getSelector()); /*while(1){ sprintf(b1,"%i\n",e_get_calibrated_prox(S_FRONT_LEFT)); e_send_uart1_char(b1,10); while(e_uart1_sending()); }*/ while(1){ while(keepFinding) { if(!cameraOn) { startCamera(); correctRobot(); } while(!captura()); //e_send_uart1_char(buffer,buff_length); //while(e_uart1_sending()); if(cameraOn > 5) processaImagem(); cameraOn++; } if(cameraOn) stopCamera(); while(!flag); flag = 0; sendInputs(); readOrder(); readOrder(); e_set_speed_left(speedLeft); e_set_speed_right(speedRight); e_set_led(4,0); } return 0; }