Oyranos  git-devel
Oyranos is a full featured Color Management System
Public Member Functions | Data Fields
oyOption_s Struct Reference

Option object. More...

#include <oyOption_s.h>

Inheritance diagram for oyOption_s:
Inheritance graph
Collaboration diagram for oyOption_s:
Collaboration graph

Public Member Functions

OYAPI oyOption_s *OYEXPORT oyOption_New (oyObject_s object)
 allocate a new Option object More...
 
OYAPI oyOption_s *OYEXPORT oyOption_Copy (oyOption_s *option, oyObject_s object)
 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_soyOption_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_SetFromString (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 OY_UNUSED)
 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_soyOption_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...
 
int oyStruct_RegisterStaticMessageFunc (int type, oyStruct_RegisterStaticMessageFunc_f msg, oyStruct_RegisterStaticFreeFunc_f free_func)
 register a function for verbosity More...
 
const char * oyStruct_GetInfo (oyPointer context_object, oyNAME_e type, int flags)
 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...
 

Detailed Description

Option object.

Todo:
include the oyOptions_t_ type for gui elements should be used in a list oyColorTransformOptions_s to form a options set oyOptions_t_ covers as well the UI part which should be separated as of the SimpleToolkitAbstraction project: http://www.oyranos.org/wiki/index.php?title=XML_Plug-in_options As of this architecture change The UI part must be decided to obtain a place. Probably in oyOptions_s? Thus the oyOption_s::name member should be removed.

The id field maps to a oyWidget_s object. Options and widgets are to be queried by the according function / CMM combination.

Version
Oyranos: 0.1.8
Since
2007/00/00 (Oyranos: 0.1.x)
Date
2008/04/14
Examples:
image_display.cpp.

Member Function Documentation

◆ oyOption_Clear()

int oyOption_Clear ( oyOption_s obj)

clear a option

Function oyOption_Clear

Version
Oyranos: 0.1.9
Since
2008/11/27 (Oyranos: 0.1.9)
Date
2008/11/27

◆ oyOption_Copy()

OYAPI oyOption_s *OYEXPORT oyOption_Copy ( oyOption_s option,
oyObject_s  object 
)

Copy or Reference a Option object.

Function oyOption_Copy

The function is for copying and for referencing. The reference is the most often used way, which saves resourcs and time.

Parameters
[in]optionOption struct object
objectNULL - means reference, the optional object triggers a real copy

◆ oyOption_FromDB()

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

Parameters
registrationno or full qualified registration
[out]optionthe result
objectthe optional object
Returns
0 - good, 1 >= error, -1 <= issue(s)
Version
Oyranos: 0.9.6
Date
2014/12/28
Since
2009/01/24 (Oyranos: 0.1.10)

This is merely a wrapper to oyOption_New() and oyOption_SetValueFromDB().

References oyOption_FromRegistration(), oyOption_Release(), oyOption_SetFromString(), and oyOption_SetValueFromDB().

◆ oyOption_FromRegistration()

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???

Parameters
registrationno or full qualified registration
objectthe optional object
Returns
the option
Version
Oyranos: 0.1.10
Since
2009/01/24 (Oyranos: 0.1.10)
Date
2009/01/24

References oyOption_New().

Referenced by oyOption_FromDB(), and oyStructList_s::oyStructList_AddName().

◆ oyOption_GetData()

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.

Parameters
[in]optionthe option
[out]sizedata size
[in]allocateFuncuser allocator
Returns
data
Version
Oyranos: 0.1.10
Since
2009/01/04 (Oyranos: 0.1.10)
Date
2009/07/22

◆ oyOption_GetId()

int oyOption_GetId ( oyOption_s obj)

get the identification number of a option

Function oyOption_GetId

Version
Oyranos: 0.1.8
Since
2008/07/10 (Oyranos: 0.1.8)
Date
2008/07/10

◆ oyOption_GetRegistration()

const char * oyOption_GetRegistration ( oyOption_s option)

get the registration

Function oyOption_GetRegistration

Parameters
[in]optionthe option
Returns
registration
Version
Oyranos: 0.1.10
Since
2010/02/26 (Oyranos: 0.1.10)
Date
2010/02/26

Referenced by oyDeviceToJSON(), oyOption_SetValueFromDB(), and oyProfile_GetWhitePoint().

◆ oyOption_GetStruct()

oyStruct_s * oyOption_GetStruct ( oyOption_s option,
oyOBJECT_e  type 
)

ask for a oyStruct_s object

Function oyOption_GetStruct

Parameters
optionthe option
typethe Oranos oyOBJECT_e object type
Returns
Oyranos struct, as reference if possible
Version
Oyranos: 0.5.0
Date
2012/10/05
Since
2009/03/09 (Oyranos: 0.1.10)

◆ oyOption_GetText()

const char * oyOption_GetText ( oyOption_s obj,
oyNAME_e  type 
)

get a text dump

Only oyOption_s::value is written.

The type argument should select the following string in return:

  • oyNAME_NAME - a readable XFORMS element
  • oyNAME_NICK - the hash ID
  • oyNAME_DESCRIPTION - option registration name with key and without key attributes or value
  • oyNAME_JSON - JSON formatted string supporting nested JSON
Parameters
[in,out]objthe option
typeoyNAME_NICK is equal to an ID
Returns
the text
Version
Oyranos: 0.9.7
Date
2020/03/20
Since
2008/11/02 (Oyranos: 0.1.8)

Iterate into oyOptions_s objects.

◆ oyOption_GetValueDouble()

double oyOption_GetValueDouble ( oyOption_s obj,
int  pos 
)

get a double

Function oyOption_GetValueDouble

Parameters
[in,out]objthe option
posposition in a list;
  • -1: get the count
Returns
double
Version
Oyranos: 0.9.7
Date
2018/05/24
Since
2009/08/03 (Oyranos: 0.1.10)

Referenced by oyProfile_GetWhitePoint().

◆ oyOption_GetValueInt()

int32_t oyOption_GetValueInt ( oyOption_s obj,
int  pos 
)

get a integer

Function oyOption_GetValueInt

Parameters
[in,out]objthe option
posposition in a list
  • -1: get the count
Returns
integer
Version
Oyranos: 0.9.7
Date
2018/05/24
Since
2009/05/04 (Oyranos: 0.1.10)

◆ oyOption_GetValueString()

const char * oyOption_GetValueString ( oyOption_s obj,
int  pos 
)

get a string

Function oyOption_GetValueString

Parameters
objthe option
posposition in a list
Returns
the text
Version
Oyranos: 0.3.0
Since
2011/02/01 (Oyranos: 0.3.0)
Date
2011/02/01

◆ oyOption_GetValueText()

char * oyOption_GetValueText ( oyOption_s obj,
oyAlloc_f  allocateFunc 
)

get value as a text dump

Function oyOption_GetValueText

Parameters
objthe option
allocateFuncuser allocator
Returns
the text
Version
Oyranos: 0.1.9
Since
2008/12/05 (Oyranos: 0.1.9)
Date
2009/08/17

◆ oyOption_GetValueType()

oyVALUETYPE_e oyOption_GetValueType ( oyOption_s option)

Ask for the type of the value.

Function oyOption_GetValueType

Parameters
optionthe option
Returns
value type enum
Version
Oyranos: 0.9.6
Date
2016/05/04
Since
2016/05/04 (Oyranos: 0.9.6)

◆ oyOption_MoveInStruct()

int oyOption_MoveInStruct ( oyOption_s option,
oyStruct_s **  oystruct 
)

value filled by a oyStruct_s object

Function oyOption_MoveInStruct

Parameters
optionthe option
oystructthe Oyranos style object
Returns
error
Version
Oyranos: 0.9.5
Date
2013/08/13
Since
2009/01/28 (Oyranos: 0.1.10)

◆ oyOption_New()

OYAPI oyOption_s *OYEXPORT oyOption_New ( oyObject_s  object)

allocate a new Option object

Function oyOption_New

Referenced by oyOption_FromRegistration().

◆ oyOption_Release()

OYAPI int OYEXPORT oyOption_Release ( oyOption_s **  option)

◆ oyOption_SetFromData()

int oyOption_SetFromData ( oyOption_s option,
oyPointer  ptr,
size_t  size 
)

set value from a data blob

Function oyOption_SetFromData

Parameters
[in]optionthe option
[in]ptrdata
[in]sizedata size
Returns
0 - success, 1 - error
Version
Oyranos: 0.1.10
Since
2009/01/04 (Oyranos: 0.1.10)
Date
2009/01/06

◆ oyOption_SetFromDouble()

int oyOption_SetFromDouble ( oyOption_s obj,
double  floating_point,
int  pos,
uint32_t flags  OY_UNUSED 
)

set a double value

Function oyOption_SetFromDouble

Parameters
[in,out]objthe option
floating_pointthe value
posposition in a list
flagsunused
Returns
0 - success, 1 - error
Version
Oyranos: 0.1.10
Since
2009/08/03 (Oyranos: 0.1.10)
Date
2009/08/03

◆ oyOption_SetFromInt()

int oyOption_SetFromInt ( oyOption_s obj,
int32_t  integer,
int  pos,
uint32_t  flags 
)

set a integer

Function oyOption_SetFromInt

Parameters
[in,out]objthe option
integerthe value
posposition in a list
flagsunused
Returns
0 - success, 1 - error
Version
Oyranos: 0.1.10
Since
2009/05/04 (Oyranos: 0.1.10)
Date
2009/05/04

◆ oyOption_SetFromString()

int oyOption_SetFromString ( oyOption_s obj,
const char *  text,
uint32_t  flags 
)

set a option value from a string

Function oyOption_SetFromString

Update the flags if necessary.

Parameters
objthe option
textthe text to set
flagspossible is OY_STRING_LIST with newline '
' delimiter
Returns
0 - success, 1 - error
Version
Oyranos: 0.2.1
Since
2008/11/25 (Oyranos: 0.1.9)
Date
2011/01/21

Referenced by oyOption_FromDB().

◆ oyOption_SetRegistration()

int oyOption_SetRegistration ( oyOption_s option,
const char *  registration 
)

set the registration

Function oyOption_SetRegistration

Parameters
[in]optionthe option
[in]registrationthe option's registration and key name
Returns
error
Version
Oyranos: 0.1.10
Date
2019/09/20
Since
2009/01/24 (Oyranos: 0.1.10)

◆ oyOption_SetValueFromDB()

int oyOption_SetValueFromDB ( oyOption_s option)

Value filled from DB if available.

Function oyOption_SetValueFromDB

Parameters
optionthe option
Returns
error
Version
Oyranos: 0.1.10
Date
2009/05/25
Since
2009/01/24 (Oyranos: 0.1.10)

Change the option value only if something was found in the DB.

References oyOption_GetRegistration().

Referenced by oyOption_FromDB().

Field Documentation

◆ copy

oyStruct_Copy_f oyOption_s::copy

Copy function.

◆ oy_

oyObject_s oyOption_s::oy_

Oyranos internal object.

Features name and hash. Do not change during object life time.

Referenced by oyStructList_s::oyStructList_AddName(), and oyStructList_s::oyStructList_GetName().

◆ release

oyStruct_Release_f oyOption_s::release

Release function.

◆ type_

const oyOBJECT_e oyOption_s::type_

Type of object.

The struct type tells Oyranos how to interprete hidden fields.