Function exported by PhAB to apply changes in the resource editor
int apply ( PhABHandle_t phab, int n, void * value )
This function is exported from PhAB in the PhABResExportCommon_t structure.
This function is called from the plugin when resource data changes have to be applied to the selected widget or widgets, for example, when a user clicks the Apply button in the resource editor.
The data value is represented by the parameter pair n and value. How these parameters are passed depends on the data type of the resource. See the description of resource data types for a discussion of how these parameters are passed.
The return value of this function indicates whether PhAB has taken control over the resource data. This prevents memory leaks when the master copy rule applies. When the apply() function returns zero, PhAB has taken the given value and has made it the master copy. When the apply() function returns non zero, PhaB has not made the given value the master copy, it has used the default value instead. In this case the plugin should update its internal structures by freeing any data it allocated for the value and using the default value instead.
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PhABResExportCommon_t, ResPluginFrugalCreateF_t, ResPluginFullCreateF_t.