Oyranos  git-devel
Oyranos is a full featured Color Management System
Data Structures | Macros | Typedefs | Enumerations | Functions
Generic Objects

Basic objects to make all higher level object types happy. More...

Collaboration diagram for Generic Objects:

Data Structures

struct  oyHash_s
 A cache entry. More...
 
struct  oyList_s
 a pointer list More...
 
struct  oyName_s
 Oyranos Name structure. More...
 
struct  oyObject_s
 Oyranos structure baseThe base object of Oyranos object system is self contained. It can be handled by the belonging function set. Complex objects for user interaction should almost all be derived from this struct.
The memory management can be controlled by the user and will affect internal and derived data. More...
 
struct  oyObserver_s
 Oyranos object observers. More...
 
struct  oyPointer_s
 custom pointer More...
 
struct  oyStruct_s
 Oyranos base structure. More...
 
struct  oyStructList_s
 a pointer list More...
 

Macros

#define oyOBJECT_MAX_CUSTOM   1024
 
#define oyOBJECT_MAX_STRUCT   300
 

Typedefs

typedef struct oyObject_s_ * oyObject_s
 

Enumerations

enum  oyOBJECT_e { ,
  oyOBJECT_OBJECT_S, oyOBJECT_MONITOR_S, oyOBJECT_NAMED_COLOR_S, oyOBJECT_NAMED_COLORS_S,
  oyOBJECT_PROFILE_S, oyOBJECT_PROFILE_TAG_S, oyOBJECT_PROFILES_S, oyOBJECT_OPTION_S,
  oyOBJECT_OPTIONS_S, oyOBJECT_RECTANGLE_S, oyOBJECT_IMAGE_S, oyOBJECT_ARRAY2D_S,
  oyOBJECT_CONNECTOR_S = 20, oyOBJECT_CONNECTOR_IMAGING_S, oyOBJECT_CONNECTOR_MAX_S, oyOBJECT_FILTER_PLUG_S = 30,
  oyOBJECT_FILTER_PLUGS_S, oyOBJECT_FILTER_SOCKET_S, oyOBJECT_FILTER_CORE_S, oyOBJECT_FILTER_CORES_S,
  oyOBJECT_FILTER_NODE_S, oyOBJECT_FILTER_NODES_S, oyOBJECT_FILTER_GRAPH_S, oyOBJECT_PIXEL_ACCESS_S,
  oyOBJECT_CONVERSION_S, oyOBJECT_CMM_HANDLE_S = 50, oyOBJECT_POINTER_S, oyOBJECT_CMM_INFO_S,
  oyOBJECT_CMM_API_S, oyOBJECT_CMM_APIS_S, oyOBJECT_CMM_API_FILTER_S, oyOBJECT_CMM_API1_S,
  oyOBJECT_CMM_API2_S, oyOBJECT_CMM_API3_S, oyOBJECT_CMM_API4_S, oyOBJECT_CMM_API5_S,
  oyOBJECT_CMM_API6_S, oyOBJECT_CMM_API7_S, oyOBJECT_CMM_DATA_TYPES_S, oyOBJECT_CMM_API8_S,
  oyOBJECT_CMM_API9_S, oyOBJECT_CMM_API10_S, oyOBJECT_CMM_UI_S, oyOBJECT_CMM_OBJECT_TYPE_S,
  oyOBJECT_CMM_API_FILTERS_S, oyOBJECT_CMM_API_MAX, oyOBJECT_ICON_S = 80, oyOBJECT_MODULE_S,
  oyOBJECT_EXTERNFUNC_S, oyOBJECT_NAME_S, oyOBJECT_COMP_S_, oyOBJECT_FILE_LIST_S_,
  oyOBJECT_HASH_S, oyOBJECT_STRUCT_LIST_S, oyOBJECT_BLOB_S, oyOBJECT_CONFIG_S,
  oyOBJECT_CONFIGS_S, oyOBJECT_UI_HANDLER_S, oyOBJECT_FORMS_ARGS_S, oyOBJECT_CALLBACK_S,
  oyOBJECT_OBSERVER_S, oyOBJECT_CONF_DOMAIN_S, oyOBJECT_INFO_STATIC_S, oyOBJECT_LIST_S,
  oyOBJECT_LIS_S, oyOBJECT_JOB_S, oyOBJECT_DB_API_S, oyOBJECT_MONITOR_HOOKS_S = 120,
  oyOBJECT_MONITOR_HOOKS2_S = 122, oyOBJECT_MONITOR_HOOKS3_S = 123
}
 Oyranos structure type. More...
 
enum  oySIGNAL_e { ,
  oySIGNAL_CONNECTED, oySIGNAL_RELEASED, oySIGNAL_DATA_CHANGED, oySIGNAL_STORAGE_CHANGED,
  oySIGNAL_INCOMPATIBLE_DATA, oySIGNAL_INCOMPATIBLE_OPTION, oySIGNAL_INCOMPATIBLE_CONTEXT, oySIGNAL_INCOMPLETE_GRAPH,
  oySIGNAL_VISITED, oySIGNAL_USER1 = 20, oySIGNAL_USER2, oySIGNAL_USER3
}
 observer signalsThe signal types are similiar to the graph event enum oyCONNECTOR_EVENT_e. More...
 
enum  oyNAME_e { oyNAME_NAME, oyNAME_NICK, oyNAME_DESCRIPTION }
 Information levelMessages consist of text, which contains information depending on the purpose. The information provider obtains with this enum a brief request, what to put into a information request. More...
 

Functions

oyObject_s oyObject_New (const char *name)
 object management More...
 
oyObject_s oyObject_NewWithAllocators (oyAlloc_f allocateFunc, oyDeAlloc_f deallocateFunc, const char *name)
 object management More...
 
oyObject_s oyObject_NewFrom (oyObject_s object, const char *name)
 object management More...
 
oyObject_s oyObject_Copy (oyObject_s object)
 object management More...
 
int oyObject_Release (oyObject_s *obj)
 release an Oyranos object More...
 
oyObject_s oyObject_SetParent (oyObject_s o, oyOBJECT_e type, oyPointer parent)
 custom object memory managersNormally a sub object should not know about its parent structure, but follow a hierarchical design. We break this here to allow the observation of all objects including the parents structures as a feature in oyObject_s. Then we just need a list of all oyObject_s objects and have an overview. This facility is intented to work even without debugging tools. More...
 
int oyObject_SetName (oyObject_s object, const char *text, oyNAME_e type)
 object naming More...
 
int oyObject_SetNames (oyObject_s object, const char *nick, const char *name, const char *description)
 object naming More...
 
int oyObject_CopyNames (oyObject_s dest, oyObject_s src)
 object naming More...
 
const oyChar * oyObject_GetName (const oyObject_s obj, oyNAME_e type)
 object get names More...
 
int oyObject_Lock (oyObject_s object, const char *marker, int line)
 Lock a object. More...
 
int oyObject_UnLock (oyObject_s object, const char *marker, int line)
 Unlock a object. More...
 
int oyObject_UnSetLocking (oyObject_s object, const char *marker, int line)
 remove a object's lock pointer More...
 
int oyObject_GetRefCount (oyObject_s obj)
 get the identification number of a object More...
 
int oyObject_UnRef (oyObject_s obj)
 decrease the ref counter and return the above zero ref value More...
 
OYAPI oyAlloc_f OYEXPORT oyObject_GetAlloc (oyObject_s object)
 get objects allocator More...
 
OYAPI oyDeAlloc_f OYEXPORT oyObject_GetDeAlloc (oyObject_s object)
 get objects deallocator More...
 
int oyObject_GetId (oyObject_s object)
 get the identification number of a object More...
 
OYAPI const char *OYEXPORT oyObject_Show (oyObject_s object)
 Print object informations. More...
 
void oyObjectTreePrint (int flags, const char *comment)
 Print the current object trees to stderr.Probably the most simple and still useful function from the Object tree debug APIs. It prints to stderr with OY_DEBUG_OBJECTS/oy_debug_objects set. More...
 

Detailed Description

Basic objects to make all higher level object types happy.

Macro Definition Documentation

◆ oyOBJECT_MAX_CUSTOM

#define oyOBJECT_MAX_CUSTOM   1024

keep a custom object type below this number

Version
Oyranos: 0.9.7
Date
2020/02/22
Since
2020/02/22 (Oyranos: 0.9.7)

◆ oyOBJECT_MAX_STRUCT

#define oyOBJECT_MAX_STRUCT   300

keep a custom object type below this number

Version
Oyranos: 0.9.7
Date
2020/02/23
Since
2020/02/23 (Oyranos: 0.9.7)

Typedef Documentation

◆ oyObject_s

typedef struct oyObject_s_* oyObject_s

Declare oyObject_s Globally

Enumeration Type Documentation

◆ oyNAME_e

enum oyNAME_e

Information levelMessages consist of text, which contains information depending on the purpose. The information provider obtains with this enum a brief request, what to put into a information request.

Version
Oyranos: 0.1.8
Since
2007/10/00 (Oyranos: 0.1.8)
Date
2007/10/00
Enumerator
oyNAME_NAME 

a short text describing the object or information in some few words; e.g. "ICC Color Profile"

oyNAME_NICK 

a very short text of few letters, very likely one word; e.g. "ICC"

oyNAME_DESCRIPTION 

Some sentences as useful in help texts and other richer representations.

◆ oyOBJECT_e

enum oyOBJECT_e

Oyranos structure type.

Version
Oyranos: 0.1.8
Since
2007/11/22 (Oyranos: 0.1.x)
Date
2008/07/31
Enumerator
oyOBJECT_OBJECT_S 

oyObject_s

oyOBJECT_MONITOR_S 

oyMonitor_s

oyOBJECT_NAMED_COLOR_S 

oyNamedColor_s

oyOBJECT_NAMED_COLORS_S 

oyNamedColors_s

oyOBJECT_PROFILE_S 

oyProfile_s

oyOBJECT_PROFILE_TAG_S 

oyProfileTag_s

oyOBJECT_PROFILES_S 

oyProfiles_s

oyOBJECT_OPTION_S 

oyOption_s

oyOBJECT_OPTIONS_S 

oyOptions_s

oyOBJECT_RECTANGLE_S 

oyRectangle_s

oyOBJECT_IMAGE_S 

oyImage_s

oyOBJECT_ARRAY2D_S 

oyArray2d_s

oyOBJECT_CONNECTOR_S 

oyConnector_s

oyOBJECT_CONNECTOR_IMAGING_S 

oyConnectorImaging_s

oyOBJECT_CONNECTOR_MAX_S 

not defined

oyOBJECT_FILTER_PLUG_S 

oyFilterPlug_s

oyOBJECT_FILTER_PLUGS_S 

oyFilterPlugs_s

oyOBJECT_FILTER_SOCKET_S 

oyFilterSocket_s

oyOBJECT_FILTER_CORE_S 

oyFilterCore_s

oyOBJECT_FILTER_CORES_S 

oyFilterCores_s

oyOBJECT_FILTER_NODE_S 

oyFilterNode_s

oyOBJECT_FILTER_NODES_S 

oyFilterNodes_s

oyOBJECT_FILTER_GRAPH_S 

oyFilterGraph_s

oyOBJECT_PIXEL_ACCESS_S 

oyPixelAccess_s

oyOBJECT_CONVERSION_S 

oyConversion_s

oyOBJECT_CMM_HANDLE_S 

oyCMMhandle_s

oyOBJECT_POINTER_S 

oyPointer_s

oyOBJECT_CMM_INFO_S 

oyCMMinfo_s

oyOBJECT_CMM_API_S 

oyCMMapi_s

oyOBJECT_CMM_APIS_S 

oyCMMapis_s

oyOBJECT_CMM_API_FILTER_S 

oyCMMapiFilter_s

oyOBJECT_CMM_API1_S 

oyCMMapi1_s

oyOBJECT_CMM_API2_S 

oyCMMapi2_s

oyOBJECT_CMM_API3_S 

oyCMMapi3_s

oyOBJECT_CMM_API4_S 

oyCMMapi4_s

oyOBJECT_CMM_API5_S 

oyCMMapi5_s

oyOBJECT_CMM_API6_S 

oyCMMapi6_s

oyOBJECT_CMM_API7_S 

oyCMMapi7_s

oyOBJECT_CMM_DATA_TYPES_S 

oyCMMDataTypes_s

oyOBJECT_CMM_API8_S 

oyCMMapi8_s

oyOBJECT_CMM_API9_S 

oyCMMapi9_s

oyOBJECT_CMM_API10_S 

oyCMMapi10_s

oyOBJECT_CMM_UI_S 

oyCMMui_s

oyOBJECT_CMM_OBJECT_TYPE_S 

oyCMMobjectType_s

oyOBJECT_CMM_API_FILTERS_S 

oyCMMapiFilters_s

oyOBJECT_CMM_API_MAX 

not defined

oyOBJECT_ICON_S 

oyIcon_s

oyOBJECT_MODULE_S 

oyModule_s

oyOBJECT_EXTERNFUNC_S 

oyExternFunc_s

oyOBJECT_NAME_S 

oyName_s

oyOBJECT_COMP_S_ 

oyComp_s_

oyOBJECT_FILE_LIST_S_ 

oyFileList_s_

oyOBJECT_HASH_S 

oyHash_s

oyOBJECT_STRUCT_LIST_S 

oyStructList_s

oyOBJECT_BLOB_S 

oyBlob_s

oyOBJECT_CONFIG_S 

oyConfig_s

oyOBJECT_CONFIGS_S 

oyConfigs_s

oyOBJECT_UI_HANDLER_S 

oyUiHandler_s

oyOBJECT_FORMS_ARGS_S 

oyFormsArgs_s

oyOBJECT_CALLBACK_S 

oyCallback_s

oyOBJECT_OBSERVER_S 

oyObserver_s

oyOBJECT_CONF_DOMAIN_S 

oyConfDomain_s

oyOBJECT_INFO_STATIC_S 

oyObjectInfoStatic_s

oyOBJECT_LIST_S 

oyList_s

oyOBJECT_LIS_S 

oyLis_s dummy

oyOBJECT_JOB_S 

oyJob_s dummy

oyOBJECT_DB_API_S 

oyDbAPI_s

oyOBJECT_MONITOR_HOOKS_S 

oyMonitorHooks_s

oyOBJECT_MONITOR_HOOKS2_S 

oyMonitorHooks2_s

oyOBJECT_MONITOR_HOOKS3_S 

oyMonitorHooks3_s

◆ oySIGNAL_e

enum oySIGNAL_e

observer signalsThe signal types are similiar to the graph event enum oyCONNECTOR_EVENT_e.

See also
oySignalToString()
Version
Oyranos: 0.9.7
Date
2020/02/26
Since
2009/10/26 (Oyranos: 0.1.10)
Enumerator
oySIGNAL_CONNECTED 

connection established

oySIGNAL_RELEASED 

released the connection

oySIGNAL_DATA_CHANGED 

call to update image views

oySIGNAL_STORAGE_CHANGED 

new data accessors

oySIGNAL_INCOMPATIBLE_DATA 

can not process image

oySIGNAL_INCOMPATIBLE_OPTION 

can not handle option

oySIGNAL_INCOMPATIBLE_CONTEXT 

can not handle profile

oySIGNAL_INCOMPLETE_GRAPH 

can not completely process

oySIGNAL_VISITED 

just accessed

oySIGNAL_USER1 

user signal type

oySIGNAL_USER2 

user signal type

oySIGNAL_USER3 

more signal types are possible

Function Documentation

◆ oyObject_Copy()

oyObject_s oyObject_Copy ( oyObject_s  object)

object management

Parameters
[in]objectthe object
Since
Oyranos: version 0.1.8
Date
november 2007 (API 0.1.8)

◆ oyObject_CopyNames()

int oyObject_CopyNames ( oyObject_s  dest,
oyObject_s  src 
)

object naming

Parameters
[in]destthe object to modify
[in]srcthe object to take names from
Version
Oyranos: 0.3.0
Since
2011/01/31 (Oyranos: 0.3.0)
Date
2011/01/31

References oyNAME_DESCRIPTION, oyNAME_NAME, oyNAME_NICK, oyObject_GetName(), oyOBJECT_OBJECT_S, and oyObject_SetNames().

◆ oyObject_GetAlloc()

OYAPI oyAlloc_f OYEXPORT oyObject_GetAlloc ( oyObject_s  object)

get objects allocator

Function oyObject_GetAlloc

Parameters
objectthe object
Returns
the allocator function
Version
Oyranos: 0.9.5
Since
2013/06/14 (Oyranos: 0.9.5)
Date
2013/06/14

Referenced by oyPixelAccess_s::oyPixelAccess_Show().

◆ oyObject_GetDeAlloc()

OYAPI oyDeAlloc_f OYEXPORT oyObject_GetDeAlloc ( oyObject_s  object)

get objects deallocator

Function oyObject_GetDeAlloc

Parameters
objectthe object
Returns
the deallocator function
Version
Oyranos: 0.9.5
Since
2013/06/14 (Oyranos: 0.9.5)
Date
2013/06/14

Referenced by oyPixelAccess_s::oyPixelAccess_Show().

◆ oyObject_GetId()

int oyObject_GetId ( oyObject_s  object)

get the identification number of a object

Function oyObject_GetId

Version
Oyranos: 0.9.6
Date
2016/04/06
Since
2008/07/10 (Oyranos: 0.1.8)

References oy_debug_objects, OY_DEBUG_OBJECTS, oyObject_Show(), oyStruct_s::oyStructTypeToText(), and oyStruct_s::type_.

Referenced by oyObject_UnRef().

◆ oyObject_GetName()

const oyChar* oyObject_GetName ( const oyObject_s  obj,
oyNAME_e  type 
)

object get names

Function oyObject_GetName

Parameters
[in]objthe object
[in]typename type
Returns
the text
Since
Oyranos: version 0.1.8
Date
2007/11/00 (API 0.1.8)
Examples:
image_display.cpp.

References oyNAME_DESCRIPTION, oyName_get_(), oyOBJECT_OBJECT_S, and oyOptions_s::oyOptions_FindString().

Referenced by oyObject_CopyNames(), oyPointer_s::oyPointer_LookUpFromObject(), and oyStructList_s::oyStructList_GetName().

◆ oyObject_GetRefCount()

int oyObject_GetRefCount ( oyObject_s  obj)

get the identification number of a object

Function oyObject_GetRefCount

Version
Oyranos: 0.1.10
Since
2009/02/19 (Oyranos: 0.1.10)
Date
2009/02/19

References oyOBJECT_OBJECT_S.

◆ oyObject_Lock()

int oyObject_Lock ( oyObject_s  object,
const char *  marker,
int  line 
)

Lock a object.

Function oyObject_Lock

See also
oyThreadLockingSet
Parameters
[in]objectthe object
[in]markerdebug hints, e.g. FILE
[in]linesource line number, e.g. LINE
Returns
error
Since
Oyranos: version 0.1.8
Date
2008/01/22 (API 0.1.8)

References oyOBJECT_OBJECT_S.

Referenced by oyObject_UnRef().

◆ oyObject_New()

oyObject_s oyObject_New ( const char *  name)

object management

Parameters
nameinitial track ID passed to oyObject_Track()
Version
Oyranos: 0.9.7
Date
2020/01/16
Since
2007/11/00 (Oyranos: 0.1.8)

References oyObject_NewWithAllocators().

◆ oyObject_NewFrom()

oyObject_s oyObject_NewFrom ( oyObject_s  object,
const char *  name 
)

object management

Parameters
[in]objectthe object
[in]namea debug string containing the parent class
Version
Oyranos: 0.9.7
Since
2007/12/17 (Oyranos: 0.1.8)
Date
2020/01/16

References oyOBJECT_OBJECT_S.

Referenced by oyFormsArgs_s::oyFormsArgs_New().

◆ oyObject_NewWithAllocators()

oyObject_s oyObject_NewWithAllocators ( oyAlloc_f  allocateFunc,
oyDeAlloc_f  deallocateFunc,
const char *  name 
)

object management

Version
Oyranos: 0.9.7
Date
2020/01/16
Since
2007/11/00 (Oyranos: 0.1.8)

Referenced by oyObject_New().

◆ oyObject_Release()

int oyObject_Release ( oyObject_s obj)

release an Oyranos object

Since
Oyranos: version 0.1.8
Date
november 2007 (API 0.1.8)

References oyOBJECT_OBJECT_S.

◆ oyObject_SetName()

int oyObject_SetName ( oyObject_s  object,
const char *  text,
oyNAME_e  type 
)

object naming

Parameters
[in]objectthe object
[in]textthe name to set
[in]typethe kind of name
Returns
0 == success, > 0 error, < 0 issue
Version
Oyranos: 0.3.0
Date
2011/04/09
Since
2007/11/00 (API 0.1.8)

References oyNAME_DESCRIPTION, and oyOBJECT_OBJECT_S.

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

◆ oyObject_SetNames()

int oyObject_SetNames ( oyObject_s  object,
const char *  nick,
const char *  name,
const char *  description 
)

object naming

Parameters
[in]objectthe object
[in]nickshort name, about 1-4 letters
[in]namethe name should fit into usual labels
[in]descriptionthe description
Returns
0 == success, > 0 error, < 0 issue
Since
Oyranos: version 0.1.8
Date
november 2007 (API 0.1.8)
Examples:
oyranos_cmm_oJPG.c.

References oyNAME_DESCRIPTION, oyNAME_NAME, oyNAME_NICK, oyOBJECT_OBJECT_S, and oyObject_SetName().

Referenced by oyObject_CopyNames().

◆ oyObject_SetParent()

oyObject_s oyObject_SetParent ( oyObject_s  o,
oyOBJECT_e  type,
oyPointer  parent 
)

custom object memory managersNormally a sub object should not know about its parent structure, but follow a hierarchical design. We break this here to allow the observation of all objects including the parents structures as a feature in oyObject_s. Then we just need a list of all oyObject_s objects and have an overview. This facility is intented to work even without debugging tools.

Each inheritent initialiser should call this function separately during normal object allocation and class initialisation.

Parameters
[in]othe object to modify
[in]typethe parents struct type
[in]parenta pointer to the parent struct
Version
Oyranos: 0.3.0
Date
2011/02/02
Since
2007/11/00 (API 0.1.8)

◆ oyObject_Show()

OYAPI const char* OYEXPORT oyObject_Show ( oyObject_s  object)

Print object informations.

Function oyObject_Show

Version
Oyranos: 0.9.6
Date
2016/04/06
Since
2016/04/06 (Oyranos: 0.9.6)

Referenced by oyObject_GetId().

◆ oyObject_UnLock()

int oyObject_UnLock ( oyObject_s  object,
const char *  marker,
int  line 
)

Unlock a object.

Function oyObject_UnLock

See also
oyThreadLockingSet
Parameters
[in]objectthe object
[in]markerdebug hints, e.g. FILE
[in]linesource line number, e.g. LINE
Returns
error
Since
Oyranos: version 0.1.8
Date
2008/01/22 (API 0.1.8)

References oyOBJECT_OBJECT_S.

◆ oyObject_UnRef()

int oyObject_UnRef ( oyObject_s  obj)

decrease the ref counter and return the above zero ref value

Function oyObject_UnRef

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

References oy_debug, oy_debug_objects, oyObject_GetId(), oyObject_Lock(), oyOBJECT_OBJECT_S, and oyStruct_s::oyStructTypeToText().

◆ oyObject_UnSetLocking()

int oyObject_UnSetLocking ( oyObject_s  object,
const char *  marker,
int  line 
)

remove a object's lock pointer

Function oyObject_UnSetLocking

See also
oyThreadLockingSet
Parameters
[in]objectthe object
[in]markerdebug hints, e.g. FILE
[in]linesource line number, e.g. LINE
Returns
error
Since
Oyranos: version 0.1.8
Date
2008/01/22 (API 0.1.8)

References oyOBJECT_OBJECT_S.

◆ oyObjectTreePrint()

void oyObjectTreePrint ( int  flags,
const char *  comment 
)

Print the current object trees to stderr.Probably the most simple and still useful function from the Object tree debug APIs. It prints to stderr with OY_DEBUG_OBJECTS/oy_debug_objects set.

Parameters
flagsuse 15 for all flags
  • 0x01 show a graph
  • 0x02 include more object details
  • 0x04 skip cmm caches to show a more functional graph
  • 0x08 include unconnected objects
commenta title comment for the graph; optional
Version
Oyranos: 0.9.7
Date
2019/10/15
Since
2016/04/16 (Oyranos: 0.9.6)

References oy_debug_objects.