//-------------------------------------------------------------- void ofxMuiColorPicker::init() { // super class init should have already been called in the constructor def list setObjectType("COLOR_PICKER"); // override the superclass setBoxProperties(defaults->colorPickerBoxProperties); setValue(1,0); // r setValue(1,1); // g setValue(1,2); // b setValue(1,3); // a // set default key binding //keyBind_toggleValue(' '); // custom, just for the button itself (i.e. no clicking on the label) setHitBox(0, 0, defaults->colorPickerWidth, defaults->colorPickerHeight); colorPickerPreview.height = defaults->colorPickerPreviewHeight; // get the little preview-r eyeDropperPreviewPixelWidth = defaults->colorPickerEyeDropperWidth / defaults->colorPickerEyeDropperZoom; eyeDropperPreviewPixelHeight = defaults->colorPickerEyeDropperWidth / defaults->colorPickerEyeDropperZoom; eyeDropperPreview.allocate(eyeDropperPreviewPixelWidth,eyeDropperPreviewPixelHeight,GL_RGB); showEyeDroperPreview = false; setNeedsLayoutUpdate(true); }
//-------------------------------------------------------------- void ofxMuiWindow::init() { setObjectType("WINDOW"); isMinimized = false; _isDragMoveable = true; // setTooltip(""); setBoxProperties(defaults->windowBoxProperties); // draw the min max/ active inactive buttons enableDisableButton = new ofxMuiButton(); enableDisableButton->setButtonIcon(defaults->windowBoxEnableDisableIcon); enableDisableButton->keyBind_toggleValue(defaults->keyboardEnableDisable); // enableDisableButton->setTooltip("Enable/Disable (" + ofToString(defaults->keyboardEnableDisable) + ")"); // enableDisableButton->setTooltipEnabled(true); addChild(enableDisableButton); minMaxButton = new ofxMuiButton(); minMaxButton->setButtonIcon(defaults->windowBoxMinMaxIcon); minMaxButton->keyBind_toggleValue(defaults->keyboardMinMax); // minMaxButton->setTooltip("Minimize/Maximize (" + ofToString(defaults->keyboardMinMax) + ")"); // minMaxButton->setTooltipEnabled(true); addChild(minMaxButton); requestBoxLayout(); }
void AMFTypedObject::read(InputStream* input) { AMFStringUTF8 type; type.read(input); setObjectType(type.getValue()); AMFObject::read(input); }
//-------------------------------------------------------------- void ofxMuiButton::init() { // super class init should have already been called in the constructor def list setObjectType("BUTTON"); roundFrame = defaults->buttonRoundFrame; // override the superclass setBoxProperties(defaults->buttonBoxProperties); buttonType = BUTTON_TYPE_TOGGLE; setButtonIcon(ICON_DEFAULT); setValue(false); // set default key binding keyBind_toggleValue(defaults->keyboardToggle); // custom, just for the button itself (i.e. no clicking on the label) setHitBox(0, 0, defaults->buttonWidth, defaults->buttonHeight); // label->setText(name); // label->enable(); // requestBoxLayout(); }
EmoEditTextIconFormat(const EmoticonsTheme::Token &token) { setObjectType(emoticonsObjectType); QTextFormat::setProperty(IconPath, token.imgPath); QTextFormat::setProperty(IconText, token.text); setToolTip(token.text); }
patrolUnit::patrolUnit(int _x, int _y) :unit(_x, _y) { setObjectType(kWorldObject); currTarget = -1; nodesExpanded = nodesTouched = 0; }
void CSObject::initialize() { // log this event CS_LOG(CSLOGTYPE::CSL_DEBUG, "CSObject::initialize()"); // set all variables to a known value CS_INIT(m_Level); CS_INIT(m_Info); CS_INIT(m_Id); CS_INIT(m_Dead); CS_INIT(m_Children); CS_INIT_STRING(m_Name,"CSObject"); CS_INIT(m_DebugObject); CS_INIT_VECTOR3DF(m_AbsolutePosition, 0, 0, 0); CS_INIT_VECTOR3DF(m_RelativePosition, 0, 0, 0); CS_INIT_VECTOR3DF(m_AbsoluteRotation, 0, 0, 0); CS_INIT_VECTOR3DF(m_RelativeRotation, 0, 0, 0); CS_INIT_VECTOR3DF(m_AbsoluteScale, 1, 1, 1); CS_INIT_VECTOR3DF(m_RelativeScale, 1, 1, 1); CS_INIT_VECTOR3DF(m_PositionOffset, 0, 0, 0); CS_INIT_VECTOR3DF(m_RotationOffset, 0, 0, 0); CS_INIT_VECTOR3DF(m_ScaleOffset,1,1,1); CS_INIT_VECTOR3DF(m_BBOffset,0,0,0); CS_INIT(m_PropertyManager); CS_INIT(m_Shadow); CS_INIT_FLOAT(m_Mass,10); CS_INIT_STRING(m_ActorFileName,CS_DEFAULT); CS_INIT_STRING(m_TextureFileName,CS_DEFAULT); CS_INIT(m_PhysXObject); CS_INIT_BOOL(m_Visible, true); CS_INIT(m_Static); // set the object type for the editors setObjectType(OBJECT_TYPE::CS_TYPE_OBJECT); }
bool BaseObject::init() { setObjectType(ObjectType::BASE_OBJECT); setIsDrag(true); setFileName(""); return true; }
bool CommonObject::init() { setObjectType(ObjectType::COMMON_OBJECT); setTypeName(""); registerWithTouchDispatcher(); return true; }
void MainWindow::enginioFinished(EnginioReply *msg) { if(msg->errorType() != EnginioReply::NoError) { return; } logDebug(QJsonDocument(msg->data()).toJson()); if(msg == m_exportReply) { QJsonArray jsonArray(m_exportReply->data().value("results").toArray()); QByteArray jsonText = QJsonDocument(jsonArray).toJson(); QFile exportFile(m_exportFile->text()); bool ok = exportFile.open(QIODevice::WriteOnly); if(ok) { exportFile.write(jsonText); log(tr("%1 object(s) exported to %2").arg(jsonArray.size()).arg(exportFile.fileName())); } else { logError(tr("Error %1 opening file %2").arg(exportFile.error()).arg(exportFile.fileName())); } } if(msg == m_queryForRemovalReply) { QJsonArray jsonArray(m_queryForRemovalReply->data().value("results").toArray()); foreach(const QJsonValue &v, jsonArray) { QJsonObject removeObject(v.toObject()); setObjectType(&removeObject); m_client->remove(removeObject); }
Sheep::Sheep(SDL_Surface *screen) : IsoMapObject(screen) { setObjectType(MAP_OBJECT_SHEEP); if (imageCache == NULL) initImageCache(); directionChanged(getDirection()); }
rt2DSliceRenderObject::rt2DSliceRenderObject() { setObjectType("OT_2DObject"); setName("2DSlice Renderer"); // initialize!!! m_selectedProp = NULL; m_mousePos.setX(-1); m_mousePos.setY(-1); setupDataObject(); setupPipeline(); }
void tmx::Object::init(pugi::xml_node objectNode) { setName(objectNode.attribute("name").as_string()); setType(objectNode.attribute("type").as_string()); setX(objectNode.attribute("x").as_uint()); setY(objectNode.attribute("y").as_uint()); setWidth(objectNode.attribute("width").as_uint()); setHeight(objectNode.attribute("height").as_uint()); setRotation(objectNode.attribute("rotation").as_uint()); setGid(objectNode.attribute("gid").as_uint()); if(objectNode.child("ellipse")) { setObjectType(ELLIPSE); } else if (objectNode.child("polyline")) { setObjectType(POLYLINE); } else if (objectNode.child("polygon")) { setObjectType(POLYGON); } else { setObjectType(RECT); } }
Object::Object(){ x = 0; y = 0; degree = 0; r = .5; h = 1; s = 1; z = 0; xWidth = 1; yWidth = 1; setObjectType("Object"); }
/** Creates a patrol unit and assigns it numPLocations random locations to patrol. The last location is the unit's starting position to create a loop */ patrolUnit::patrolUnit(int _x, int _y, int numPLocations, unitSimulation* us) :unit(_x, _y) { setObjectType(kWorldObject); currTarget = -1; nodesExpanded = nodesTouched = 0; for (int i=1; i<numPLocations; i++) { int xx, yy; us->getRandomLocation(_x,_y,xx,yy); addPatrolLocation(new unit(xx, yy)); } addPatrolLocation(new unit(_x, _y)); }
bool CircleObject::init() { setIsDrag(false); setObjectType(ObjectType::CIRCLE_OBJECT); setTypeName("CircleObject"); m_drawnode = CCDrawNode::create(); addChild(m_drawnode); registerWithTouchDispatcher(); setBorderColor(ccc4f(1, 0, 0, 1)); setFillColor(ccc4f(0.5, 0.5, 0.5, 0.5)); m_radius = 10; return true; }
//! Constructor rtEPDataObject::rtEPDataObject() : m_currentPhase(-1), m_objTransform(0), m_inPlaneInterval(1.0), m_crossPlaneInterval(1.0), m_surfaceOpacity(1.0), m_pointsOpacity(1.0), m_rep(EP_SURFACE), m_minSliceNum(0), m_maxSliceNum(0), m_showInfoPoints(false) { setObjectType("OT_EPMesh"); m_phaseDataList.clear(); m_objTransform = vtkTransform::New(); m_threadCount = QThread::idealThreadCount(); if (m_threadCount == -1) m_threadCount = 1; setupGUI(); }
Button::Button(string plabel) : Sprite() { label = plabel; status = BUTTON_NORMAL; checkposition = false; // setScale(0.8f); setCollisionMethod(COLLISION_RECT); setObjectType(BUTTON); ostringstream ss1,ss2; image_normal = new Texture(); ss1 << "source/button/" << label << "_normal" <<".tga"; image_normal->Load(ss1.str()); image_pressed = new Texture(); ss2 << "source/button/"<< label << "_pressed" <<".tga"; image_pressed->Load(ss2.str()); callback = NULL; reset(); }
CPath::CPath() { setObjectType(sim_object_path_type); pathContainer=NULL; layer=PATH_LAYER; _explicitHandling=false; _shapingEnabled=false; _initialValuesInitialized=false; _shapingScaling=1.0f; _shapingFollowFullOrientation=false; _shapingConvexHull=false; _shapingSectionClosed=true; _shapingElementMaxLength=0.005f; shapingColor.setDefaultValues(); shapingColor.setColor(0.0f,0.6f,0.0f,AMBIENT_MODE); _mainPropertyLocal=sim_objectspecialproperty_renderable; _pathModifID=0; pathContainer=new CPathCont(); setShapingType(1); _objectName=IDSOGL_PATH; }
//! Constructor rtCathDataObject::rtCathDataObject() : m_tension(0.0), m_continuity(0.0), m_tipValue(0.0), m_endValue(0.0), m_splineThickness(1.0) { setObjectType("OT_Cath"); // Allocate new objects m_splineProperty = vtkProperty::New(); m_pointProperty = vtkProperty::New(); m_tipProperty = vtkProperty::New(); m_splinePropertyDlg = new rtPropertyChooserDialog(m_splineProperty); m_pointPropertyDlg = new rtPropertyChooserDialog(m_pointProperty); m_tipPropertyDlg = new rtPropertyChooserDialog(m_tipProperty); // Build the GUI setupGUI(); // More than enough coils m_max_coils = 128; // Set the default point size. m_pointSize = 10; m_cathGuiSetup.pointSizeSlider->setValue(m_pointSize); pointSizeChanged(m_pointSize); m_eType = ET_MEAN; // Start with no coils... m_coilIDList.clear(); m_currProperty = "None"; m_currColor = NULL; connect(this, SIGNAL(updateCoilTableSignal()), this, SLOT(updateCoilTable()),Qt::QueuedConnection); connect(this, SIGNAL(cathPropsChanged()), this, SLOT(updatePropertyBox())); connect(rtApplication::instance().getObjectManager(), SIGNAL(objectCreated(int)),this,SLOT(updateColorBox())); connect(rtApplication::instance().getObjectManager(), SIGNAL(objectRemoved(int)),this,SLOT(updateColorBox())); connect(rtApplication::instance().getObjectManager(), SIGNAL(objectRenamed(int)),this,SLOT(updateColorBox())); }
//! Constructor rt2DPointDataObject::rt2DPointDataObject() { setObjectType("OT_2DPointBuffer"); setupGUI(); }
//-------------------------------------------------------------- void ofxMuiKnob::init() { setObjectType("KNOB"); setHitBoxWidth(defaults->knobWidth); setHitBoxHeight(defaults->knobHeight); // set default key binding keyBind_increaseValue('='); keyBind_decreaseValue('-'); setBoxProperties(defaults->knobBoxProperties); // set values setValue(0); //setBoundsMin(0.0f); //setBoundsMax(1.0f); //valueLabel->d(); label->enable(); lastKnobAngle = 0.0f; knobAngle = 0.0f; dKnobAngle = 0.0f; zeroAngle = HALF_PI; // up boundaryWedgeAngle = PI/4.0f; innerRadiusPct = 0.60f; outerRadiusPct = 1.00f; innerRadiusW = getHitBoxHalfWidth() * innerRadiusPct; outerRadiusW = getHitBoxHalfWidth() * outerRadiusPct; innerRadiusH = getHitBoxHalfHeight() * innerRadiusPct; outerRadiusH = getHitBoxHalfHeight() * outerRadiusPct; float b = innerRadiusW; float v = b / 6.0f; dialArrow.moveTo(0,-v); dialArrow.lineTo(b,0); dialArrow.lineTo(0,+v); dialArrow.close(); dialArrow.setFilled(false); dialShape.setArcResolution(360); dialRangeShape.setArcResolution(360); dialValueShape.setArcResolution(360); needsRedraw = true; normCtrlDragStartMin = 0.0f; normCtrlDragStartMax = 0.0f; totalDragDelta = ofPoint(0.0f,0.0f); dKnobScaler = 0.01f; smartRotate = false; smoothedCenter = getHitBoxCenter(); smoothedCenterAlpha = 0.95; requestBoxLayout(); }
rtColorFuncRenderObject::rtColorFuncRenderObject() { setObjectType("OT_vtkColorTransferFunction"); setName("Color Transfer Func Renderer"); setupDataObject(); setupPipeline(); }
rtLabelRenderObject::rtLabelRenderObject() { setObjectType("OT_TextLabel"); setName("Simple Label Renderer"); setupDataObject(); setupPipeline(); }
AudioFormat::AudioFormat() : QTextCharFormat() { setObjectType( AudioType ); }
//! Constructor rtImageBufferDataObject::rtImageBufferDataObject() { setObjectType("OT_ImageBuffer"); setupGUI(); }
rewardSeekingUnit::rewardSeekingUnit(int _x, int _y) :rewardUnit(_x, _y) { setObjectType(kWorldObject); }
rewardUnit::rewardUnit(int _x, int _y) :unit(_x, _y) { setObjectType(kIncidentalUnit); }
int main( int argc, char **argv) { char *displays[MAX_VALS]; char *clauses[MAX_CONDS]; char *orderp = NULL; int i; err_code status; int numDisplays = 0; int numClauses = 0; OPEN_LOG("query", LOG_USER); if (!my_config_load()) { LOG(LOG_ERR, "can't initialize configuration"); exit(EXIT_FAILURE); } output = stdout; useLabels = 1; multiline = 0; validate = 1; if (argc == 1) return printUsage(); if (strcasecmp(argv[1], "-l") == 0) { if (argc != 3) return printUsage(); setObjectType(argv[2]); return listOptions(); } for (i = 1; i < argc; i += 2) { if (strcasecmp(argv[i], "-i") == 0) { validate = 0; i--; } else if (strcasecmp(argv[i], "-n") == 0) { useLabels = 0; i--; } else if (strcasecmp(argv[i], "-m") == 0) { multiline = 1; i--; } else if (argc == (i + 1)) { return printUsage(); } else if (strcasecmp(argv[i], "-t") == 0) { setObjectType(argv[i + 1]); } else if (strcasecmp(argv[i], "-d") == 0) { displays[numDisplays++] = argv[i + 1]; } else if (strcasecmp(argv[i], "-f") == 0) { clauses[numClauses++] = argv[i + 1]; } else if (strcasecmp(argv[i], "-o") == 0) { output = fopen(argv[i + 1], "w"); } else if (strcasecmp(argv[i], "-x") == 0) { orderp = argv[i + 1]; } else { // unknown switch return printUsage(); } } checkErr((!isROA) && (!isCRL) && (!isCert) && (!isManifest) && (!isGBR), BAD_OBJECT_TYPE); checkErr(numDisplays == 0, "Need to display something\n"); if (numDisplays == 1 && strcasecmp(displays[0], "all") == 0) numDisplays = addAllFields(displays, 0); displays[numDisplays++] = NULL; clauses[numClauses++] = NULL; status = doQuery(displays, clauses, orderp); if (status == ERR_SCM_NODATA) { LOG(LOG_DEBUG, "%s", err2string(status)); status = 0; } else if (status < 0) { LOG(LOG_ERR, "%s", err2string(status)); } config_unload(); CLOSE_LOG(); return status; }
void processLine(FILE * logf, struct SCRIPT * script, struct TYPING * types, unsigned long location, struct LINE * line){ char * tokens = (char *) calloc(TOKENMAXNB*TOKENSIZE,sizeof(char)); int nbtokens, i, j, index, storobj=-1, valobj=-1; int calldetected; //Detect system calls calldetected = monitorSytemCalls(logf,script,types,location,line); //Parse line nbtokens = decomposeLine(line->line,tokens,TOKENMAXNB,TOKENSIZE); for(i=0;i<nbtokens;i++){ //Monitor string and processing and treat dependency if(!strcasecmp(ACCESS(tokens,i),"Mid") ||!strcasecmp(ACCESS(tokens,i),"Left") ||!strcasecmp(ACCESS(tokens,i),"Ucase") ||!strcasecmp(ACCESS(tokens,i),"Lcase") ||!strcasecmp(ACCESS(tokens,i),"LTrim") ||!strcasecmp(ACCESS(tokens,i),"RTrim") ||!strcasecmp(ACCESS(tokens,i),"Replace")){ int newstor = 0; int obj = isKnownObject(types,ACCESS(tokens,i+1)); if(obj>-1 && i>=2 && ((char *)ACCESS(tokens,i-1))[0]=='='){ int storobj = isKnownObject(types,ACCESS(tokens,i-2)); if(storobj==-1){ newstor = 1, storobj = addNewObject(types,NULL,getObjectNature(types,obj)); addObjectReference(types,storobj,ACCESS(tokens,i-2)); setObjectType(types,storobj,getObjectType(types,obj)); }else{ setObjectNature(types,storobj,getObjectNature(types,obj)); setObjectType(types,storobj,getObjectType(types,obj)); } if(newstor){strcpy_s(types->objects[storobj].ObjectName, NAME_MAX_LENGTH,types->objects[obj].ObjectName);} printLogEntry(logf, types, OP_AFF, storobj, obj); } } //Detect string proceclocal procedure and function calls index = isLocalProcedure(script,ACCESS(tokens,i)); if(index>-1){ //Avoid recursive calls //if((location&0xF0000000)==PROCLEVEL // && index==(location&0x0FFFFFFF)){ if(script->procedureslist[index].beingexecuted){ printf("[+] Block recursive call to procedure %s\n", script->procedureslist[index].name); }else{ script->procedureslist[index].beingexecuted = 1; //No return value, so can not be an affectation startProcedure(logf,script,types,index,line); script->procedureslist[index].beingexecuted = 0; } free(tokens); return; }else{ index = isLocalFunction(script,ACCESS(tokens,i)); if(index>-1){ if(strcmp(ACCESS(tokens,i+1),"=")){//Avoid return values //Avoid recursive calls if(script->functionslist[index].beingexecuted){ printf("[+] Block recursive call to function %s\n", script->functionslist[index].name); }else{ script->functionslist[index].beingexecuted = 1; startFunction(logf,script,types,index,line); script->functionslist[index].beingexecuted = 0; } free(tokens); return; }else{ line->type = AFFECTATION; updateReturnStorage(types, script->functionslist[index].name, ACCESS(tokens,i+2)); free(tokens); return; }//if call or return } } } if(calldetected) return; //Detect affectation of known object for(i=0;i<nbtokens;i++){ if(((char *)ACCESS(tokens,i))[0]=='='||!strcasecmp(ACCESS(tokens,i),"in")){ int maxobj = -1; int maxtype; int nullnat = 0; int newstor = 0; int nbconselem; //Number of consecutive elements must int isarray = 0;//be < 2 except using & and array to concatenate //Either creation or retrieving of store object storobj = isKnownObject(types,ACCESS(tokens,i-1)); if(storobj==-1){ newstor = 1; storobj = addNewObject(types,NULL,0); addObjectReference(types,storobj,ACCESS(tokens,i-1)); }//if unknown maxtype = getObjectType(types,storobj); nbconselem = 0; //Look for significant passing value for(j=i+1;j<nbtokens;j++){ if(!strcasecmp(ACCESS(tokens,j),"Array")){ isarray = 1; j++; }//if if(((char *)ACCESS(tokens,j))[0]=='&'){ nbconselem = 0; }else{ //Checks if access to a static attribute char stataccess[TOKENSIZE+5]; strcpy_s(stataccess,5+TOKENSIZE,ACCESS(tokens,j)); strcat_s(stataccess,5+TOKENSIZE,"."); if(strcasestr(line->line,stataccess)){ nbconselem = 0; }else{ nbconselem++; } }//if if(!isarray && nbconselem>1) break; valobj = isKnownObject(types,ACCESS(tokens,j)); if(valobj>-1){//known objects //Update store type when significant if(getObjectType(types,valobj)>maxtype){ maxtype = getObjectType(types,valobj); maxobj = valobj; } }else if(ClassifyObject(ACCESS(tokens,j),&nullnat)>maxtype){//typed object maxobj = addNewObject(types,ACCESS(tokens,j),nullnat); maxtype = getObjectType(types,maxobj); }//if }//for if(maxobj>-1){ line->type = AFFECTATION; setObjectType(types,storobj,getObjectType(types,maxobj)); setObjectNature(types,storobj,getObjectNature(types,maxobj)); if(newstor){strcpy_s(types->objects[storobj].ObjectName, NAME_MAX_LENGTH,types->objects[maxobj].ObjectName);} printLogEntry(logf, types, OP_AFF, storobj, maxobj); } }//if '=' found }//for free(tokens); }