XmeGetColorObjData — access ColorObject desktop and pixel data
#include <Xm/ColorObjP.h>
Boolean XmeGetColorObjData
(*screen, *coloruse, *pixel_set, pixel_set_size, *active, *inactive, *primary, *secondary, *text);typedef struct { Pixel fg; Pixel bg; Pixel ts; Pixel bs; Pixel sc; } XmPixelSet; |
The Motif library creates and maintains a ColorObject at application initialization time (first VendorShell creation) which holds color information coming from a Color Server running on the desktop (see Color Server protocol, documented as part of the new revision of the X/Open XCSA specification).
This ColorObject is not directly available to programmers, but an API is provided to access most of the information it contains.
The ColorObject itself makes use of this information internally to default most color setting for the Motif widgets (e.g. it will add *background: <PIXEL> in the in memory resource database for the application)
This function returns color information maintained by the ColorObject in Motif, which comes from the color server using the Color Server protocol (see above sections) The color_use possible returned values are:
enum { XmCO_BLACK_WHITE, XmCO_LOW_COLOR, XmCO_MEDIUM_COLOR, XmCO_HIGH_COLOR }; |
which correspond to the type of monitor in use by the desktop.
There is a maximum of 8 pixel sets returned. Each pixel set consists of the five fundamental motif colors maintained by the ColorObject for this screen: background, foreground, top_shadow_color, bottom_shadow_color, and select_color.
The function also returns the color set id number used by the ColorObject.
screen | X screen passed in | |
color_use | colorUse type enum returned | |
pixel_set | Pixel sets returned (allocated by caller) | |
pixel_set_size | Size of pixel sets array (max used by function) | |
active, inactive, primary, secondary, text | Returned color set ids. |
False if the color server is not running, if the useColorObj XmScreen resource is set to False, or if the screen number is out of the range managed by the color server; otherwise True.
XmPixelSet is used to specify the pixel allocated by the Color Server.
The information returned by this function depends on the presence of an active Color Server.
This function is affected by the resources set on the Color Server and useColorObj on XmScreen.
None.
None.
On return, one can use:
primary_background = pixelSet[primary_id].bg; |