void iiSubobj_resetToDefaultImage(SObject* image, bool tlResetProperties, bool tlResetMethods, SObjPropMap* propList, u32 tnPropCount, SObjEventMap* eventList, u32 tnEventCount) { logfunc(__FUNCTION__); if (image) { ////////// // Reset the common settings ////// iiObj_resetToDefaultCommon(image, true, true, propList, tnPropCount, eventList, tnEventCount); ////////// // Set default size and position ////// SetRect(&image->rc, 0, 0, 100, 36); SetRect(&image->rco, 0, 0, 100, 36); SetRect(&image->rcp, 0, 0, 100, 36); // Set the size iObj_setSize(image, 0, 0, 100, 36); ////////// // Set the default values ////// propSetStyle(image, _IMAGE_STYLE_OPAQUE); propSetPictureBmp(image, bmpNoImage); } }
void subhelp_slog(enum csri_logging_severity severity, const char *msg) { if (logfunc) logfunc(appdata, severity, msg); else { fprintf(stderr, msg); fprintf(stderr, "\n"); } }
////////// // // Called to delete the carousel // ////// void iSubobj_deleteCarousel(SObject* carousel, bool tlDeleteSelf, bool tlLeaveRiders, bool tlLeaveObjects) { SObject* rider; SObject* riderNext; logfunc(__FUNCTION__); ////////// // Free common components ////// iObj_deleteCommon(carousel); ////////// // Act on riders ////// if (tlLeaveRiders) { // We just need to orphanize each one ////////// // Note: Orphanizing riders is a potentially precarious thing. They must be known as they are // not maintained in a buffer somewhere. Typically this only occurs when migrating the // last rider from one carousel to another. But regardless, care must be taken to prevent // the orphaned rider from hanging around unused and forgotten. ////// // Get the first rider = carousel->firstChild; // Mark the parent as now being free from children carousel->firstChild = NULL; // Iterate for every rider while (rider) { // Determine the next rider riderNext = (SObject*)rider->ll.next; // Orphanize this rider iLl_orphanize__ll((SLL*)rider); // Move to next rider rider = riderNext; } } else { // They are being deleted iObj_delete(&carousel->firstChild, true, true, true); } ////////// // Free self ////// if (tlDeleteSelf) free(carousel); }
void iiSubobj_resetToDefaultListbox(SObject* listbox, bool tlResetProperties, bool tlResetMethods, SObjPropMap* propList, u32 tnPropCount, SObjEventMap* eventList, u32 tnEventCount) { logfunc(__FUNCTION__); if (listbox) { ////////// // Reset the common settings ////// iiObj_resetToDefaultCommon(listbox, true, true, propList, tnPropCount, eventList, tnEventCount); } }
////////// // // Called to reset the object to its hard defaults. // ////// void iiSubobj_resetToDefaultEmpty(SObject* empty, bool tlResetProperties, bool tlResetMethods, SObjPropMap* propList, u32 tnPropCount, SObjEventMap* eventList, u32 tnEventCount) { logfunc(__FUNCTION__); if (empty) { ////////// // Reset the common settings ////// iiObj_resetToDefaultCommon(empty, true, true, propList, tnPropCount, eventList, tnEventCount); } // No object-specific initialization because empty objects do nothing except exist as placeholders }
void iiSubobj_resetToDefaultToolbar(SObject* toolbar, bool tlResetProperties, bool tlResetMethods, SObjPropMap* propList, u32 tnPropCount, SObjEventMap* eventList, u32 tnEventCount) { logfunc(__FUNCTION__); if (toolbar) { ////////// // Reset the common settings ////// iiObj_resetToDefaultCommon(toolbar, true, true, propList, tnPropCount, eventList, tnEventCount); propSetBackColor(toolbar, toolbarBackColor); propSetBackStyle(toolbar, _BACK_STYLE_TRANSPARENT); } }
////////// // // Called to delete the formset. // ////// void iSubobj_deleteFormset(SObject* formset, bool tlDeleteSelf) { logfunc(__FUNCTION__); ////////// // Free common components ////// iObj_deleteCommon(formset); ////////// // Free self ////// if (tlDeleteSelf) free(formset); }
////////// // // Called to delete the pageFrame. // ////// void iSubobj_deletePageFrame(SObject* pageFrame, bool tlDeleteSelf) { logfunc(__FUNCTION__); ////////// // Free common components ////// iObj_deleteCommon(pageFrame); ////////// // Free self ////// if (tlDeleteSelf) free(pageFrame); }
////////// // // Called to delete the control point. // ////// void iSubobj_deleteControlPoint(SObject* controlPoint, bool tlDeleteSelf) { logfunc(__FUNCTION__); ////////// // Free common components ////// iObj_deleteCommon(controlPoint); ////////// // Free self ////// if (tlDeleteSelf) free(controlPoint); }
////////// // // Called to delete the hyperlink. // ////// void iSubobj_deleteHyperlink(SObject* hyperlink, bool tlDeleteSelf) { logfunc(__FUNCTION__); ////////// // Free common components ////// iObj_deleteCommon(hyperlink); ////////// // Free self ////// if (tlDeleteSelf) free(hyperlink); }
////////// // // Called to delete the collection. // ////// void iSubobj_deleteCollection(SObject* collection, bool tlDeleteSelf) { logfunc(__FUNCTION__); ////////// // Free common components ////// iObj_deleteCommon(collection); ////////// // Free self ////// if (tlDeleteSelf) free(collection); }
////////// // // Called to delete the custom. // ////// void iSubobj_deleteCustom(SObject* custom, bool tlDeleteSelf) { logfunc(__FUNCTION__); ////////// // Free common components ////// iObj_deleteCommon(custom); ////////// // Free self ////// if (tlDeleteSelf) free(custom); }
////////// // // Called to delete the timer. // ////// void iSubobj_deleteTimer(SObject* timer, bool tlDeleteSelf) { logfunc(__FUNCTION__); ////////// // Free common components ////// iObj_deleteCommon(timer); ////////// // Free self ////// if (tlDeleteSelf) free(timer); }
////////// // // Called to delete the shape. // ////// void iSubobj_deleteShape(SObject* shape, bool tlDeleteSelf) { logfunc(__FUNCTION__); ////////// // Free common components ////// iObj_deleteCommon(shape); ////////// // Free self ////// if (tlDeleteSelf) free(shape); }
////////// // // Called to delete the grid. // ////// void iSubobj_deleteGrid(SObject* grid, bool tlDeleteSelf) { logfunc(__FUNCTION__); ////////// // Free common components ////// iObj_deleteCommon(grid); ////////// // Free self ////// if (tlDeleteSelf) free(grid); }
////////// // // Called to delete the subform. // ////// void iSubobj_deleteSubform(SObject* subform, bool tlDeleteSelf) { logfunc(__FUNCTION__); ////////// // Free common components ////// iObj_deleteCommon(subform); ////////// // Free self ////// if (tlDeleteSelf) free(subform); }
////////// // // Called to delete the empty. // ////// void iSubobj_deleteEmpty(SObject* empty, bool tlDeleteSelf) { logfunc(__FUNCTION__); ////////// // Free common components ////// iObj_deleteCommon(empty); ////////// // Free self ////// if (tlDeleteSelf) free(empty); }
////////// // // Called to delete the listbox. // ////// void iSubobj_deleteListbox(SObject* listbox, bool tlDeleteSelf) { logfunc(__FUNCTION__); ////////// // Free common components ////// iObj_deleteCommon(listbox); ////////// // Free self ////// if (tlDeleteSelf) free(listbox); }
////////// // // Called to delete the optGroup. // ////// void iSubobj_deleteOptGroup(SObject* optGroup, bool tlDeleteSelf) { logfunc(__FUNCTION__); ////////// // Free common components ////// iObj_deleteCommon(optGroup); ////////// // Free self ////// if (tlDeleteSelf) free(optGroup); }
////////// // // Called to delete the radio. // ////// void iSubobj_deleteRadio(SObject* radio, bool tlDeleteSelf) { logfunc(__FUNCTION__); ////////// // Free common components ////// iObj_deleteCommon(radio); ////////// // Free self ////// if (tlDeleteSelf) free(radio); }
////////// // // Called to delete the image. // ////// void iSubobj_deleteImage(SObject* image, bool tlDeleteSelf) { logfunc(__FUNCTION__); ////////// // Free common components ////// iObj_deleteCommon(image); ////////// // Free self ////// if (tlDeleteSelf) free(image); }
////////// // // Called to delete the label. // ////// void iSubobj_deleteLabel(SObject* label, bool tlDeleteSelf) { logfunc(__FUNCTION__); ////////// // Free common components ////// iObj_deleteCommon(label); ////////// // Free self ////// if (tlDeleteSelf) free(label); }
////////// // // Called to delete the separator. // ////// void iSubobj_deleteSeparator(SObject* separator, bool tlDeleteSelf) { logfunc(__FUNCTION__); ////////// // Free common components ////// iObj_deleteCommon(separator); ////////// // Free self ////// if (tlDeleteSelf) free(separator); }
////////// // // Called to delete the oleContain. // ////// void iSubobj_deleteOleContain(SObject* oleContain, bool tlDeleteSelf) { logfunc(__FUNCTION__); ////////// // Free common components ////// iObj_deleteCommon(oleContain); ////////// // Free self ////// if (tlDeleteSelf) free(oleContain); }
int qaoed_startlistener(struct qconfig *conf, struct ifst *ifent) { struct threadargs *args; pthread_attr_t atr; args = (struct threadargs *) malloc(sizeof(struct threadargs)); if(args == NULL) { logfunc(conf->log,LOG_ERR, "malloc: %s\n", strerror(errno)); perror("malloc"); return(-1); } args->conf = conf; args->ifentry = ifent; /* Initialize the attributes */ pthread_attr_init(&atr); pthread_attr_setdetachstate(&atr, PTHREAD_CREATE_JOINABLE); /* Start the network listener thread */ if(pthread_create (&ifent->threadID, &atr, (void *)&qaoed_listener,(void *)args) != 0) { logfunc(conf->log,LOG_ERR, "Failed to start network listener for interface %s\n", ifent->ifname); return(-1); } /* Success :) */ return(0); }
void iiSubobj_resetToDefaultRadio(SObject* radio, bool tlResetProperties, bool tlResetMethods, SObjPropMap* propList, u32 tnPropCount, SObjEventMap* eventList, u32 tnEventCount) { logfunc(__FUNCTION__); if (radio) { ////////// // Reset the common settings ////// iiObj_resetToDefaultCommon(radio, true, true, propList, tnPropCount, eventList, tnEventCount); ////////// // Set default size and position ////// SetRect(&radio->rc, 0, 0, 72, 72); SetRect(&radio->rco, 0, 0, 72, 72); SetRect(&radio->rcp, 0, 0, 72, 72); // Set the size iObj_setSize(radio, 0, 0, 72, 72); // Font radio->p.font = iFont_duplicate(gsFontDefault); ////////// // Set the default properties ////// propSetBackColor(radio, whiteColor); propSetForeColor(radio, blackColor); propSetAlignment(radio, _ALIGNMENT_LEFT); propSetStyle(radio, _STYLE_3D); propSetValue_f64(radio, 1.0); propSetValueMinimum(radio, 1.0); propSetValueMaximum(radio, 100.0); propSetValueRoundTo(radio, 1.0f); propSetBackStyle(radio, _BACK_STYLE_OPAQUE); propSetBorderStyle(radio, _BORDER_STYLE_NONE); propSetBorderColor(radio, blackColor); propSetDisabledBackColor(radio, disabledBackColor); propSetDisabledForeColor(radio, disabledForeColor); } }
void iiSubobj_resetToDefaultLabel(SObject* label, bool tlResetProperties, bool tlResetMethods, SObjPropMap* propList, u32 tnPropCount, SObjEventMap* eventList, u32 tnEventCount) { logfunc(__FUNCTION__); if (label) { ////////// // Reset the common settings ////// iiObj_resetToDefaultCommon(label, true, true, propList, tnPropCount, eventList, tnEventCount); ////////// // Set default size and position ////// SetRect(&label->rc, 0, 0, 40, 17); SetRect(&label->rco, 0, 0, 40, 17); SetRect(&label->rcp, 0, 0, 40, 17); // Set the size iObj_setSize(label, 0, 0, 40, 17); // Font iFont_delete(&label->p.font, true); label->p.font = iFont_duplicate(gsFontDefault); ////////// // Set the default colors ////// propSetBackColor(label, whiteColor); propSetForeColor(label, blackColor); ////////// // Set the characteristics ////// propSetAlignment(label, _ALIGNMENT_LEFT); propSetCaption(label, cgcName_label); propSetBackStyle(label, _BACK_STYLE_TRANSPARENT); propSetBorderStyle(label, _BORDER_STYLE_NONE); propSetBorderColor(label, blackColor); propSetDisabledBackColor(label, disabledBackColor); propSetDisabledForeColor(label, disabledForeColor); } }
void iiSubobj_resetToDefaultEditbox(SObject* editbox, bool tlResetProperties, bool tlResetMethods, SObjPropMap* propList, u32 tnPropCount, SObjEventMap* eventList, u32 tnEventCount) { logfunc(__FUNCTION__); if (editbox) { ////////// // Reset the common settings ////// iiObj_resetToDefaultCommon(editbox, true, true, propList, tnPropCount, eventList, tnEventCount); ////////// // Set default size and position ////// SetRect(&editbox->rc, 0, 0, 100, 53); SetRect(&editbox->rco, 0, 0, 100, 53); SetRect(&editbox->rcp, 0, 0, 100, 53); // Set the size iObj_setSize(editbox, 0, 0, 100, 53); // Font editbox->p.font = iFont_duplicate(gsFontDefault); ////////// // Set the defaults ////// propSetBackColor(editbox, whiteColor); propSetForeColor(editbox, blackColor); propSetStyle(editbox, _STYLE_3D); propSetAlignment(editbox, _ALIGNMENT_LEFT); propSetBackStyle(editbox, _BACK_STYLE_OPAQUE); propSetBorderStyle(editbox, _BORDER_STYLE_NONE); propSetBorderColor(editbox, blackColor); propSetSelectedBackColor(editbox, selectedBackColor); propSetSelectedBackColor(editbox, selectedForeColor); propSetDisabledBackColor(editbox, disabledBackColor); propSetDisabledForeColor(editbox, disabledForeColor); iSEM_deleteChain(&editbox->p.sem, true); editbox->p.sem = iSEM_allocate(false); } }
fvalue_t* fvalue_from_string(ftenum_t ftype, char *s, LogFunc logfunc) { fvalue_t *fv; fv = fvalue_new(ftype); if (fv->ftype->val_from_string) { if (fv->ftype->val_from_string(fv, s, logfunc)) { return fv; } } else { logfunc("\"%s\" cannot be converted to %s.", s, ftype_pretty_name(ftype)); } FVALUE_FREE(fv); return NULL; }
fvalue_t* fvalue_from_unparsed(ftenum_t ftype, char *s, gboolean allow_partial_value, LogFunc logfunc) { fvalue_t *fv; fv = fvalue_new(ftype); if (fv->ftype->val_from_unparsed) { if (fv->ftype->val_from_unparsed(fv, s, allow_partial_value, logfunc)) { return fv; } } else { logfunc("\"%s\" cannot be converted to %s.", s, ftype_pretty_name(ftype)); } FVALUE_FREE(fv); return NULL; }