![]() |
Oyranos Color Management System API - Version 0.9.6 |
Option object. More...
#include <oyOption_s.h>


Public Member Functions | |
| OYAPI oyOption_s *OYEXPORT | oyOption_New (oyObject_s object) |
| allocate a new Option object More... | |
| oyOption_Copy | |
| Copy or Reference a Option object. More... | |
| OYAPI int OYEXPORT | oyOption_Release (oyOption_s **option) |
| release and possibly deallocate a oyOption_s object More... | |
| oyOption_s * | oyOption_FromRegistration (const char *registration, oyObject_s object) |
| new option with registration and value filled from DB if available More... | |
| int | oyOption_GetId (oyOption_s *obj) |
| get the identification number of a option More... | |
| const char * | oyOption_GetText (oyOption_s *obj, oyNAME_e type) |
| get a text dump More... | |
| int | oyOption_SetFromText (oyOption_s *obj, const char *text, uint32_t flags) |
| set a option value from a string More... | |
| char * | oyOption_GetValueText (oyOption_s *obj, oyAlloc_f allocateFunc) |
| get value as a text dump More... | |
| const char * | oyOption_GetValueString (oyOption_s *obj, int pos) |
| get a string More... | |
| int | oyOption_SetFromInt (oyOption_s *obj, int32_t integer, int pos, uint32_t flags) |
| set a integer More... | |
| int32_t | oyOption_GetValueInt (oyOption_s *obj, int pos) |
| get a integer More... | |
| int | oyOption_SetFromDouble (oyOption_s *obj, double floating_point, int pos, uint32_t flags) |
| set a double value More... | |
| double | oyOption_GetValueDouble (oyOption_s *obj, int pos) |
| get a double More... | |
| int | oyOption_Clear (oyOption_s *obj) |
| clear a option More... | |
| int | oyOption_SetFromData (oyOption_s *option, oyPointer ptr, size_t size) |
| set value from a data blob More... | |
| oyPointer | oyOption_GetData (oyOption_s *option, size_t *size, oyAlloc_f allocateFunc) |
| get the data blob More... | |
| int | oyOption_SetRegistration (oyOption_s *option, const char *registration) |
| set the registration More... | |
| const char * | oyOption_GetRegistration (oyOption_s *option) |
| get the registration More... | |
| int | oyOption_MoveInStruct (oyOption_s *option, oyStruct_s **oystruct) |
| value filled by a oyStruct_s object More... | |
| oyStruct_s * | oyOption_GetStruct (oyOption_s *option, oyOBJECT_e type) |
| ask for a oyStruct_s object More... | |
| oyVALUETYPE_e | oyOption_GetValueType (oyOption_s *option) |
| Ask for the type of the value. More... | |
| OYAPI int OYEXPORT | oyOption_FromDB (const char *registration, oyOption_s **option, oyObject_s object) |
| new option with registration and value filled from DB if available More... | |
| int | oyOption_SetValueFromDB (oyOption_s *option) |
| Value filled from DB if available. More... | |
Public Member Functions inherited from oyStruct_s | |
| const char * | oyStruct_GetTextFromModule (oyStruct_s *obj, oyNAME_e name_type, uint32_t flags) |
| get object infos from a module More... | |
| const char * | oyStruct_GetText (oyStruct_s *obj, oyNAME_e name_type, uint32_t flags) |
| Get a text dump. More... | |
| oyStruct_RegisterStaticMessageFunc | |
| register a function for verbosity More... | |
| oyStruct_GetInfo | |
| get a additional string from a object More... | |
| const char * | oyStructTypeToText (oyOBJECT_e type) |
| Objects type to small string. More... | |
Data Fields | |
| const oyOBJECT_e | type_ |
| Type of object. More... | |
| oyStruct_Copy_f | copy |
| Copy function. More... | |
| oyStruct_Release_f | release |
| Release function. More... | |
| oyObject_s | oy_ |
| Oyranos internal object. More... | |
Data Fields inherited from oyStruct_s | |
| const oyOBJECT_e | type_ |
| Type of object. More... | |
| oyStruct_Copy_f | copy |
| Copy function. More... | |
| oyStruct_Release_f | release |
| Release function. More... | |
| oyObject_s | oy_ |
| Oyranos internal object. More... | |
Option object.
The id field maps to a oyWidget_s object. Options and widgets are to be queried by the according function / CMM combination.
| int oyOption_Clear | ( | oyOption_s * | obj | ) |
clear a option
Function oyOption_Clear
References oyOBJECT_OPTION_S, and oyValue_u::oyValueRelease().
| oyOption_Copy |
Copy or Reference a Option object.
The function is for copying and for referencing. The reference is the most often used way, which saves resourcs and time.
| [in] | option | Option struct object |
| object | NULL - means reference, the optional object triggers a real copy |
Referenced by oyOptions_s::oyOptions_Add(), and oyOptions_s::oyOptions_Set().
| OYAPI int OYEXPORT oyOption_FromDB | ( | const char * | registration, |
| oyOption_s ** | option, | ||
| oyObject_s | object | ||
| ) |
new option with registration and value filled from DB if available
Function oyOption_FromDB
| registration | no or full qualified registration |
This is merely a wrapper to oyOption_New() and oyOption_SetValueFromDB().
| oyOption_s * oyOption_FromRegistration | ( | const char * | registration, |
| oyObject_s | object | ||
| ) |
new option with registration and value filled from DB if available
Function oyOption_FromRegistration
FIXME value filled from DB if available???
| registration | no or full qualified registration |
| object | the optional object |
References OY_SLASH_C, oyOption_New(), oyOption_Release(), and oyOption_SetRegistration().
Referenced by oyOptions_s::oyOptions_SetDriverContext().
| oyPointer oyOption_GetData | ( | oyOption_s * | option, |
| size_t * | size, | ||
| oyAlloc_f | allocateFunc | ||
| ) |
get the data blob
Function oyOption_GetData
With data size being greater than zero, the returned pointer is owned by the caller.
| [in] | option | the option |
| [out] | size | data size |
| [in] | allocateFunc | user allocator |
References oy_, oyOBJECT_BLOB_S, oyOBJECT_OPTION_S, oyOBJECT_POINTER_S, and oyVAL_STRUCT.
Referenced by oyOptions_s::oyOptions_FindData().
| int oyOption_GetId | ( | oyOption_s * | obj | ) |
get the identification number of a option
Function oyOption_GetId
References oyOBJECT_OPTION_S.
| const char * oyOption_GetRegistration | ( | oyOption_s * | option | ) |
get the registration
Function oyOption_GetRegistration
| [in] | option | the option |
References oyOBJECT_OPTION_S.
Referenced by oyOption_SetValueFromDB(), and oyProfile_s::oyProfile_AddDevice().
| oyStruct_s * oyOption_GetStruct | ( | oyOption_s * | option, |
| oyOBJECT_e | type | ||
| ) |
ask for a oyStruct_s object
Function oyOption_GetStruct
| option | the option |
| type | the Oranos oyOBJECT_e object type |
References oyStruct_s::copy, and oyVAL_STRUCT.
| const char * oyOption_GetText | ( | oyOption_s * | obj, |
| oyNAME_e | type | ||
| ) |
get a text dump
Function oyOption_GetText
Only oyOption_s::value is written.
The type argument should select the following string in return:
| [in,out] | obj | the option |
| type | oyNAME_NICK is equal to an ID |
Iterate into oyOptions_s objects.
References oy_, oyNAME_DESCRIPTION, oyNAME_NAME, oyNAME_NICK, oyObject_GetName(), oyOBJECT_OPTION_S, oyOBJECT_OPTIONS_S, oyObject_SetName(), oyOption_GetValueText(), oyOptions_s::oyOptions_GetText(), oyStruct_s::oyStruct_GetText(), and oyVAL_STRUCT.
Referenced by oyOptions_s::oyOptions_GetText().
| double oyOption_GetValueDouble | ( | oyOption_s * | obj, |
| int | pos | ||
| ) |
get a double
Function oyOption_GetValueDouble
| [in,out] | obj | the option |
| pos | position in a list |
References oyOBJECT_OPTION_S, oyVAL_DOUBLE, and oyVAL_DOUBLE_LIST.
Referenced by oyOptions_s::oyOptions_FindDouble().
| int32_t oyOption_GetValueInt | ( | oyOption_s * | obj, |
| int | pos | ||
| ) |
get a integer
Function oyOption_GetValueInt
| [in,out] | obj | the option |
| pos | position in a list |
| const char * oyOption_GetValueString | ( | oyOption_s * | obj, |
| int | pos | ||
| ) |
get a string
Function oyOption_GetValueString
| obj | the option |
| pos | position in a list |
References oyOBJECT_OPTION_S, oyVAL_STRING, and oyVAL_STRING_LIST.
| char * oyOption_GetValueText | ( | oyOption_s * | obj, |
| oyAlloc_f | allocateFunc | ||
| ) |
get value as a text dump
Function oyOption_GetValueText
| obj | the option |
| allocateFunc | user allocator |
References oyOBJECT_OPTION_S.
Referenced by oyOption_GetText(), oyOptions_s::oyOptions_GetText(), and oyProfile_s::oyProfile_AddDevice().
| oyVALUETYPE_e oyOption_GetValueType | ( | oyOption_s * | option | ) |
Ask for the type of the value.
Function oyOption_GetValueType
| option | the option |
| int oyOption_MoveInStruct | ( | oyOption_s * | option, |
| oyStruct_s ** | oystruct | ||
| ) |
value filled by a oyStruct_s object
Function oyOption_MoveInStruct
| option | the option |
| s | the Oyranos style object |
References oyOBJECT_OPTION_S.
Referenced by oyOptions_s::oyOptions_SetDriverContext().
| OYAPI oyOption_s *OYEXPORT oyOption_New | ( | oyObject_s | object | ) |
allocate a new Option object
Function oyOption_New
References oyOBJECT_OBJECT_S.
Referenced by oyOption_FromRegistration(), and oyProfile_s::oyProfile_AddDevice().
| OYAPI int OYEXPORT oyOption_Release | ( | oyOption_s ** | option | ) |
release and possibly deallocate a oyOption_s object
Function oyOption_Release
| [in,out] | option | Option struct object |
References oyOBJECT_OPTION_S.
Referenced by oyConfig_s::oyConfig_Has(), oyOption_FromRegistration(), oyOptions_s::oyOptions_Add(), oyOptions_s::oyOptions_CopyFrom(), oyOptions_s::oyOptions_CountType(), oyOptions_s::oyOptions_FindData(), oyOptions_s::oyOptions_FindDouble(), oyOptions_s::oyOptions_FindString(), oyOptions_s::oyOptions_GetText(), oyOptions_s::oyOptions_ObserversDisable(), oyOptions_s::oyOptions_ObserversEnable(), oyOptions_s::oyOptions_Set(), oyOptions_s::oyOptions_SetOpts(), and oyOptions_s::oyOptions_SetSource().
| int oyOption_SetFromData | ( | oyOption_s * | option, |
| oyPointer | ptr, | ||
| size_t | size | ||
| ) |
set value from a data blob
Function oyOption_SetFromData
| [in] | option | the option |
| [in] | ptr | data |
| [in] | size | data size |
References oy_, oyOBJECT_BLOB_S, oyOBJECT_OPTION_S, oyOBJECT_POINTER_S, and oyVAL_STRUCT.
Referenced by oyOptions_s::oyOptions_SetDriverContext().
| int oyOption_SetFromDouble | ( | oyOption_s * | obj, |
| double | floating_point, | ||
| int | pos, | ||
| uint32_t | flags | ||
| ) |
set a double value
Function oyOption_SetFromDouble
| [in,out] | obj | the option |
| floating_point | the value | |
| pos | position in a list | |
| flags | unused |
| int oyOption_SetFromInt | ( | oyOption_s * | obj, |
| int32_t | integer, | ||
| int | pos, | ||
| uint32_t | flags | ||
| ) |
set a integer
Function oyOption_SetFromInt
| [in,out] | obj | the option |
| integer | the value | |
| pos | position in a list | |
| flags | unused |
| int oyOption_SetFromText | ( | oyOption_s * | obj, |
| const char * | text, | ||
| uint32_t | flags | ||
| ) |
set a option value from a string
Function oyOption_SetFromText
Update the flags if necessary.
| obj | the option |
| text | the text to set |
| flags | possible is OY_STRING_LIST |
Referenced by oyFilterGraph_s::oyFilterGraph_PrepareContexts(), oyOption_SetValueFromDB(), and oyProfile_s::oyProfile_AddDevice().
| int oyOption_SetRegistration | ( | oyOption_s * | option, |
| const char * | registration | ||
| ) |
set the registration
Function oyOption_SetRegistration
| [in] | option | the option |
| [in] | registration | the option's registration and key name |
References oyOBJECT_OPTION_S.
Referenced by oyOption_FromRegistration(), and oyProfile_s::oyProfile_AddDevice().
| int oyOption_SetValueFromDB | ( | oyOption_s * | option | ) |
Value filled from DB if available.
Function oyOption_SetValueFromDB
| option | the option |
Change the option value only if something was found in the DB.
References oyGetPersistentString(), oyOBJECT_OPTION_S, oyOption_GetRegistration(), oyOption_SetFromText(), and oySCOPE_USER_SYS.
| oyStruct_Copy_f oyOption_s::copy |
Copy function.
| oyObject_s oyOption_s::oy_ |
Oyranos internal object.
Features name and hash. Do not change during object life time.
Referenced by oyOption_GetData(), oyOption_GetText(), oyOption_SetFromData(), and oyOptions_s::oyOptions_GetText().
| oyStruct_Release_f oyOption_s::release |
Release function.
| const oyOBJECT_e oyOption_s::type_ |
Type of object.
The struct type tells Oyranos how to interprete hidden fields.
Referenced by oyOptions_s::oyOptions_FindData(), and oyOptions_s::oyOptions_MoveIn().