X11 Work Bench Toolkit  1.0
Desktop Settings utilities

Desktop Settings Utilities, to query desktop-defined settings like fonts, colors, mouse click times, etc. More...

Data Structures

struct  __XSETTINGS_DATA_COLOR__
 Structure for storing configuration color information, XSettingsTypeColor. More...
 
struct  _CHXSetting_
 Structure for storing settings information internally. More...
 
struct  _CHXSettings_
 Array wrapper for CHXSetting cache. More...
 

Typedefs

typedef struct
__XSETTINGS_DATA_COLOR__ 
XSETTINGS_DATA_COLOR
 Structure for storing configuration color information, XSettingsTypeColor. More...
 
typedef struct _CHXSetting_ CHXSetting
 Structure for storing settings information internally. More...
 
typedef struct _CHXSettings_ CHXSettings
 Array wrapper for CHXSetting cache. More...
 

Enumerations

enum  XSettingsType { XSettingsTypeInteger = 0, XSettingsTypeString = 1, XSettingsTypeColor = 2 }
 Enumeration for 'XSettingsType' which describes the type of setting being cached. More...
 

Functions

int CHGetResourceString (Display *pDisplay, const char *szIdentifier, char *szData, int cbData)
 Queries desktop resource strings (may become deprecated) More...
 
int CHGetResourceInt (Display *pDisplay, const char *szIdentifier)
 Queryies desktop resource integer values (from strings) (may become deprecated) More...
 
void CHSettingsRefresh (Display *pDisplay)
 refresh the internally cached X settings More...
 
const CHXSettingsCHGetXSettings (Display *pDisplay)
 returns a pointer to the cached X settings More...
 
const CHXSettingCHGetXSetting (Display *pDisplay, const char *szSettingName)
 returns a pointer to a specific X setting entry by name More...
 
int CHGetDoubleClickTime (Display *pDisplay)
 returns default double click time (from X settings) More...
 
int CHGetDoubleClickDistance (Display *pDisplay)
 returns default double click distance (from X settings) More...
 
int CHGetDragThreshold (Display *pDisplay)
 returns default drag threshold (from X settings) More...
 
int CHGetCursorBlink (Display *pDisplay)
 returns default cursor blink 'enable' flag (from X settings) More...
 
int CHGetCursorBlinkTime (Display *pDisplay)
 returns default cursor blink time (from X settings) More...
 
char * CHGetFileMimeType (const char *szFileName)
 Get the MIME type for a particular file name or extension. More...
 
char * CHGetMimeDefaultApp (const char *szMimeType)
 Get the default application for a particular MIME type. More...
 
char * CHGetDesktopFileInfo (const char *szDesktopFile, const char *szInfo)
 Get the default application for a particular MIME type. More...
 
void CHDumpConfig (void)
 dump config information using debug output functions More...
 

Detailed Description

Desktop Settings Utilities, to query desktop-defined settings like fonts, colors, mouse click times, etc.

Typedef Documentation

Structure for storing settings information internally.

This structure is used internally by the Configuration 'helper' functions to cache configuration information obtained from the Window Manager or from the (deprecated) system configuration.

typedef struct _CHXSetting_
{
const char *szName; // pointer to the NAME string within memory that follows CHXSettings::aData
int iType; // The setting type (\ref XSettingsType enumeration)
int iLen; // length (where applicable)
unsigned int uiSerial; // serial # from last XSETTINGS [endian-ized]
union
{
int iData; // The data as an integer value
WB_INT64 llData; // Reserved element, forces 64-bit size
XSETTINGS_DATA_COLOR clrData; // The data as a color value
void *pData; // un-typed pointer to data within string area
char *szData; // 'char' typed pointer to data within string area
} uData; // union of the data alias'

Array wrapper for CHXSetting cache.

This structure wraps the array of CHXSetting structures and any variable length data that it might reference. It is the internal format for the settings array and can be retrieved by calling CHGetXSettings()

typedef struct _CHXSettings_
{
Display *pDisplay; // identifies which display it belongs to (reserved)
int nSettings; // the total number of settings in aData
unsigned int uiSerial; // serial number from last XSETTINGS query
CHXSetting aData[1]; // An array of 'nSettings' \ref CHXSetting structures. Binary and string data directly follows the array.

Structure for storing configuration color information, XSettingsTypeColor.

This structure is part of the X11 Window Manager specification, and is defined here for use by the X11Workbench toolkit.

typedef struct __XSETTINGS_DATA_COLOR__ // also used internally by XSettings
{
unsigned short sRed; // 16-bit RGB value for RED
unsigned short sBlue; // 16-bit RGB value for Blue
unsigned short sGreen; // 16-bit RGB value for Green
unsigned short sAlpha; // 16-bit ALPHA value. If not used, it will be 0xffff

Enumeration Type Documentation

Enumeration for 'XSettingsType' which describes the type of setting being cached.

Enumerator
XSettingsTypeInteger 

The setting is an integer.

XSettingsTypeString 

The setting is a 0-byte terminated ASCII string.

XSettingsTypeColor 

The setting is an RGBA Color stored as XSETTINGS_DATA_COLOR.

Definition at line 329 of file conf_help.h.

Function Documentation

void CHDumpConfig ( void  )

dump config information using debug output functions

Debug function to dump config information using the debug output functions

Header File: conf_help.h

Definition at line 2794 of file conf_help.c.

int CHGetCursorBlink ( Display *  pDisplay)

returns default cursor blink 'enable' flag (from X settings)

Parameters
pDisplayThe Display pointer (NULL for default)
Returns
default cursor blink 'enable' flag (non-zero to enable blink)

Returns the default cursor blink 'enable' flag, zero to disable, non-zero to enable.

Header File: conf_help.h

Definition at line 2264 of file conf_help.c.

int CHGetCursorBlinkTime ( Display *  pDisplay)

returns default cursor blink time (from X settings)

Parameters
pDisplayThe Display pointer (NULL for default)
Returns
default cursor blink time in milliseconds

Returns the default cursor blink time in milliseconds

Header File: conf_help.h

Definition at line 2303 of file conf_help.c.

char* CHGetDesktopFileInfo ( const char *  szDesktopFile,
const char *  szInfo 
)

Get the default application for a particular MIME type.

Parameters
szDesktopFileA const pointer to a character string containing the desktop file name
szInfoA const pointer to a character string containing the tag for the desired information
Returns
'WBAlloc'd pointer to a zero-byte terminated character string containing the desired information

This function will return NULL on error, or a WBAlloc'd pointer to a string. Caller must free any non-NULL pointer returned by this function, using WBFree()

Header File: conf_help.h

Definition at line 2689 of file conf_help.c.

int CHGetDoubleClickDistance ( Display *  pDisplay)

returns default double click distance (from X settings)

Parameters
pDisplayThe Display pointer (NULL for default)
Returns
default double-click 'slop' distance in pixels

Returns double-click 'slop' distance in pixels

Header File: conf_help.h

Definition at line 2186 of file conf_help.c.

int CHGetDoubleClickTime ( Display *  pDisplay)

returns default double click time (from X settings)

Parameters
pDisplayThe Display pointer (NULL for default)
Returns
default double-click time in milliseconds

Returns default double-click time in milliseconds

Header File: conf_help.h

Definition at line 2147 of file conf_help.c.

int CHGetDragThreshold ( Display *  pDisplay)

returns default drag threshold (from X settings)

Parameters
pDisplayThe Display pointer (NULL for default)
Returns
default drag threshold in pixels

Returns default drag threshold in pixels

Header File: conf_help.h

Definition at line 2225 of file conf_help.c.

char* CHGetFileMimeType ( const char *  szFileName)

Get the MIME type for a particular file name or extension.

Parameters
szFileNameA const pointer to a string containing the filename or '.ext' for which to obtain the MIME type
Returns
'WBAlloc'd pointer to a zero-byte terminated character string containing the MIME type

This function will return NULL on error, or a WBAlloc'd pointer to a string. Caller must free any non-NULL pointer returned by this function, using WBFree()

Header File: conf_help.h

Definition at line 2636 of file conf_help.c.

char* CHGetMimeDefaultApp ( const char *  szMimeType)

Get the default application for a particular MIME type.

Parameters
szMimeTypeA const pointer to a character string containing the MIME type
Returns
'WBAlloc'd pointer to a zero-byte terminated character string containing the default application name

In the case of a '.desktop' file name being returned, use CHGetDesktopFileInfo() to obtain the actual path name and other information associated with the application.

This function will return NULL on error, or a WBAlloc'd pointer to a string. Caller must free any non-NULL pointer returned by this function, using WBFree()

Header File: conf_help.h

Definition at line 2658 of file conf_help.c.

int CHGetResourceInt ( Display *  pDisplay,
const char *  szIdentifier 
)

Queryies desktop resource integer values (from strings) (may become deprecated)

Parameters
pDisplayThe Display pointer (NULL for default)
szIdentifierThe item to query
Returns
the queried integer value, or 0 if error or no matching identifier

This queries integer values from the 'Old' resource manager. This function is deprecated. Some window managers may still supporte it, however, so it's worth keeping for now.

Header File: conf_help.h

Definition at line 598 of file conf_help.c.

int CHGetResourceString ( Display *  pDisplay,
const char *  szIdentifier,
char *  szData,
int  cbData 
)

Queries desktop resource strings (may become deprecated)

Parameters
pDisplayDisplay pointer (NULL for default)
szIdentifierThe item to query
szDataOutput buffer
cbDataSize of the output buffer in bytes
Returns
length of string (excluding zero byte) or -1 if error or no matching identifier

This queries string values from the 'Old' resource manager. This function is deprecated. Some window managers may still supporte it, however, so it's worth keeping for now.

Header File: conf_help.h

Definition at line 474 of file conf_help.c.

const CHXSetting* CHGetXSetting ( Display *  pDisplay,
const char *  szSettingName 
)

returns a pointer to a specific X setting entry by name

Parameters
pDisplayThe Display pointer (NULL for default)
szSettingNameThe name of the setting as a 0-byte terminated string
Returns
A const pointer to the cached CHXSetting structure

Use this function to query a specific CHXSetting structure via the setting name

Header File: conf_help.h

Definition at line 1727 of file conf_help.c.

const CHXSettings* CHGetXSettings ( Display *  pDisplay)

returns a pointer to the cached X settings

Parameters
pDisplayThe Display pointer (NULL for default)

Returns a (const) pointer to the CHXSettings structure that wraps the cached X settings

Header File: conf_help.h

void CHSettingsRefresh ( Display *  pDisplay)

refresh the internally cached X settings

Parameters
pDisplayThe Display pointer (NULL for default)

This function will refresh the internally cached X settings using various methods to query the system's parameter storage, some deprecated, some in accordance with the latest window manager specs.

Header File: conf_help.h

Definition at line 1749 of file conf_help.c.