libxcm
Classes | Macros | Functions | Variables
X Color Management Event API's

The observer context can be allocated and setup through XcmeContext_Create. More...

Classes

struct  XcmeContext_s_
 

Macros

#define TIME_DIVIDER   10000
 

Functions

int myXErrorHandler (Display *display, XErrorEvent *e)
 
int XcmMessage (XCME_MSG_e code, const void *context XCM_UNUSED, const char *format,...)
 Function XcmMessage. More...
 
int XcmMessageFuncSet (XcmMessage_f message_func)
 set a message function to customise messages
 
void XcmDebugVariableSet (int *debug)
 set own debug variable
 
char * printfNetColorDesktop (XcmeContext_s *c, int verbose)
 
const char * XcmePrintWindowName (Display *display, Window w)
 return a short window description text
 
void XcmICCprofileGetNameFuncSet (XcmICCprofileGetName_f getName)
 Function XcmICCprofileGetNameFuncSet. More...
 
void XcmICCprofileFromMD5FuncSet (XcmICCprofileGetFromMD5_f fromMD5)
 Function XcmICCprofileFromMD5FuncSet. More...
 
const char * XcmePrintWindowRegions (Display *display, Window w, int always)
 Function XcmePrintWindowRegions. More...
 
void xcmePrintWindowRegions (Display *display, Window w, int always)
 Function xcmePrintWindowRegions. More...
 
int myXErrorHandler (Display *display XCM_UNUSED, XErrorEvent *e XCM_UNUSED)
 
void XcmeSelectInput (XcmeContext_s *c)
 Function XcmeSelectInput. More...
 
XcmeContext_s * XcmeContext_New ()
 Function XcmeContext_New. More...
 
XcmeContext_s * XcmeContext_Create (const char *display_name)
 Function XcmeContext_Create. More...
 
int XcmeErrorHandler (Display *display, XErrorEvent *e)
 
int XcmeContext_Setup2 (XcmeContext_s *c, const char *display_name, int flags XCM_UNUSED)
 Function XcmeContext_Setup2. More...
 
int XcmeContext_Setup (XcmeContext_s *c, const char *display_name)
 Function XcmeContext_Setup. More...
 
char * XcmStringCopy_ (const char *string, void *(allocate_func)(size_t))
 
void XcmStringAdd_ (char **text, const char *append, void *(allocate_func)(size_t), void(dealloc_func)(void *))
 
void xcmeUnrollEdid1_ (void *edid, char **manufacturer, char **mnft, char **model, char **serial, char **vendor, uint32_t *week, uint32_t *year, uint32_t *mnft_id, uint32_t *model_id, double *c, void *(allocate_func)(size_t))
 
int XcmeContext_Release (XcmeContext_s **c)
 Function XcmeContext_Release. More...
 
int XcmeContext_InLoop (XcmeContext_s *c, XEvent *event)
 Function XcmeContext_InLoop. More...
 
Display * XcmeContext_DisplayGet (XcmeContext_s *c)
 Function XcmeContext_DisplayGet. More...
 
int XcmeContext_DisplaySet (XcmeContext_s *c, Display *display)
 Function XcmeContext_DisplaySet. More...
 
int XcmeContext_WindowSet (XcmeContext_s *c, Window window)
 Function xcmeContext_WindowSet. More...
 
time_t xcmTime ()
 
double xcmSeconds ()
 
const char * xcmPrintTime ()
 

Variables

XcmMessage_f XcmMessage_p = XcmMessage
 
int xcm_debug_local_ = 0
 
int * xcm_debug = &xcm_debug_local_
 
XcmICCprofileGetFromMD5_f XcmICCprofileGetFromMD5_p = 0
 
XcmICCprofileGetName_f XcmICCprofileGetName_p = 0
 

Detailed Description

The observer context can be allocated and setup through XcmeContext_Create.

You can pass in a own X11 Display handle through XcmeContext_New(), XcmeContext_DisplaySet() and XcmeContext_Setup(). The events can be processed by passing all XEvents to XcmeContext_InLoop() from inside your X event handling loop. To release allocated resources call XcmeContext_Release(). For a examle look at the xcmsevents application, which is distributed along the sources.

Function Documentation

◆ XcmeContext_Create()

XcmeContext_s* XcmeContext_Create ( const char *  display_name)

Function XcmeContext_Create.

allocate and initialise a event observer context structure

The context is needed to observe colour management events.

Parameters
[in]display_namea valid X11 display name
Returns
the context
Version
libXcm: 0.3.0
Since
2009/00/00 (libXcm: 0.3.0)
Date
2010/10/01

◆ XcmeContext_DisplayGet()

Display* XcmeContext_DisplayGet ( XcmeContext_s *  c)

Function XcmeContext_DisplayGet.

return the Display

Parameters
[in]ca event observer context
Returns
the X11 display
Version
libXcm: 0.3.0
Since
2010/10/01 (libXcm: 0.3.0)
Date
2010/10/01

◆ XcmeContext_DisplaySet()

int XcmeContext_DisplaySet ( XcmeContext_s *  c,
Display *  display 
)

Function XcmeContext_DisplaySet.

set a custom X11 Display

Parameters
[in,out]ca event observer context
[in]displaythe custom X11 display
Returns
error
Version
libXcm: 0.3.0
Since
2010/10/01 (libXcm: 0.3.0)
Date
2010/10/01

◆ XcmeContext_InLoop()

int XcmeContext_InLoop ( XcmeContext_s *  c,
XEvent *  event 
)

Function XcmeContext_InLoop.

check for colour management events

This function needs to be called inside the X11 event loop, to observe the related events and send messages about them.

Parameters
[in,out]ca event observer context
[in]eventa X event handle
Returns
- 0: success
  • -1: nothing to do
  • 1: error
Version
libXcm: 0.3.0
Since
2009/00/00 (libXcm: 0.3.0)
Date
2010/10/01

◆ XcmeContext_New()

XcmeContext_s* XcmeContext_New ( )

Function XcmeContext_New.

allocate a event observer context structure

The context is needed to observe colour management events. After the allocation the context needs initialisation.

Returns
the context
Version
libXcm: 0.3.0
Since
2009/00/00 (libXcm: 0.3.0)
Date
2010/10/01

◆ XcmeContext_Release()

int XcmeContext_Release ( XcmeContext_s **  c)

Function XcmeContext_Release.

clean owned resources

Parameters
[in,out]ca event observer context
Version
libXcm: 0.3.0
Since
2009/00/00 (libXcm: 0.3.0)
Date
2010/10/01

◆ XcmeContext_Setup()

int XcmeContext_Setup ( XcmeContext_s *  c,
const char *  display_name 
)

Function XcmeContext_Setup.

allocate and initialise a event observer context structure

The initialised context is needed for observing colour management events.

Parameters
[in,out]ca event observer context A existing X11 display will be honoured.
[in]display_namea valid X11 display name or NULL; With a existing X11 display inside c, this option will be ignored.
Version
libXcm: 0.4.1
Since
2009/00/00 (libXcm: 0.3.0)
Date
2011/05/06

◆ XcmeContext_Setup2()

int XcmeContext_Setup2 ( XcmeContext_s *  c,
const char *  display_name,
int flags  XCM_UNUSED 
)

Function XcmeContext_Setup2.

allocate and initialise a event observer context structure

The initialised context is needed for observing colour management events. No initial events are sent.

Parameters
[in,out]ca event observer context A existing X11 display will be honoured.
[in]display_namea valid X11 display name or NULL; With a existing X11 display inside c, this option will be ignored.
[in]flagsunused
Version
libXcm: 0.5.0
Since
2011/10/26 (libXcm: 0.5.0)
Date
2011/10/26

◆ XcmeContext_WindowSet()

int XcmeContext_WindowSet ( XcmeContext_s *  c,
Window  window 
)

Function xcmeContext_WindowSet.

set a custom X11 Window

Parameters
[in,out]ca event observer context
[in]windowthe custom X11 window
Returns
error
Version
libXcm: 0.3.0
Since
2010/10/01 (libXcm: 0.3.0)
Date
2010/10/01

◆ XcmePrintWindowRegions()

const char* XcmePrintWindowRegions ( Display *  display,
Window  w,
int  always 
)

Function XcmePrintWindowRegions.

provide info text about window regions

The function informs about _ICC_COLOR_REGIONS atom.

Parameters
[in]displayX display
[in]wX window
[in]alwayssend always a message, even for a empty property
Version
libXcm: 0.4.3
Since
2009/00/00 (libXcm: 0.3.0)
Date
2011/10/01

◆ xcmePrintWindowRegions()

void xcmePrintWindowRegions ( Display *  display,
Window  w,
int  always 
)

Function xcmePrintWindowRegions.

send a message about window regions

The function informs about _ICC_COLOR_REGIONS atom.

Parameters
[in]displayX display
[in]wX window
[in]alwayssend always a message, even for a empty property
Version
libXcm: 0.3.0
Since
2009/00/00 (libXcm: 0.3.0)
Date
2010/10/01

◆ XcmeSelectInput()

void XcmeSelectInput ( XcmeContext_s *  c)

Function XcmeSelectInput.

register windows

Version
libXcm: 0.5.3
Date
2013/01/13
Since
2013/01/13 (libXcm: 0.5.3)

◆ XcmICCprofileFromMD5FuncSet()

void XcmICCprofileFromMD5FuncSet ( XcmICCprofileGetFromMD5_f  fromMD5)

Function XcmICCprofileFromMD5FuncSet.

plugin more informations capabilities for ICC profiles

Parameters
[in]fromMD5a function to resolve a ICC profile in ICC profile paths from a md5 hash sum
Version
libXcm: 0.3.0
Since
2010/10/01 (libXcm: 0.3.0)
Date
2010/10/02

◆ XcmICCprofileGetNameFuncSet()

void XcmICCprofileGetNameFuncSet ( XcmICCprofileGetName_f  getName)

Function XcmICCprofileGetNameFuncSet.

plugin more informations capabilities for ICC profiles

Parameters
[in]getNameget internal and external profile name
Version
libXcm: 0.3.0
Since
2010/10/01 (libXcm: 0.3.0)
Date
2010/10/02

◆ XcmMessage()

int XcmMessage ( XCME_MSG_e  code,
const void *context  XCM_UNUSED,
const char *  format,
  ... 
)

Function XcmMessage.

default message function

Messages are printed out to stdout console text stream.

Returns
- 0: fine
  • 1: error
Version
libXcm: 0.3.0
Since
2008/04/03 (libXcm: 0.3.0)
Date
2010/10/01