Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xgetstandardcolormap(3) [hpux man page]

XGetStandardColormap()													    XGetStandardColormap()

Name
  XGetStandardColormap - get the standard colormap property.

Synopsis
  Status XGetStandardColormap(display, w, cmap_info_return, property)
	Display *display;
	Window w;
	XStandardColormap *colormap_return;
	Atom property;

Arguments
  display   Specifies a connection to an X server; returned from XOpenDisplay().

  w	    Specifies the ID of the window on which the property is set.  This is normally the root window.

  colormap_return
	    Returns the filled colormap information structure.

  property  Specifies  the atom indicating the type of standard colormap desired. The predefined standard colormap atoms are XA_RGB_BEST_MAP,
	    XA_RGB_RED_MAP, XA_RGB_GREEN_MAP, XA_RGB_BLUE_MAP, XA_RGB_DEFAULT_MAP, and XA_RGB_GRAY_MAP.

Returns
  Zero on failure, non-zero on success.

Description
  XGetStandardColormap() is superseded by XGetRGBColormaps() in Release 4.  XGetStandardColormap() gets a property on the  root  window  that
  describes a standard colormap.  XGetStandardColormap() returns zero if it fails, or non-zero if it succeeds.

  See Volume One, Chapter 7, Color, for a complete description of standard colormaps.

Structures
     typedef struct {
	 Colormap colormap;   /* ID of colormap created by XCreateColormap */
	 unsigned long red_max;
	 unsigned long red_mult;
	 unsigned long green_max;
	 unsigned long green_mult;
	 unsigned long blue_max;
	 unsigned long blue_mult;
	 unsigned long base_pixel;
	 VisualID visualid;
	 XID killid;
     } XStandardColormap;

Errors
  BadAtom
  BadWindow

See Also
  XDefaultColormap(),  XDisplayCells(),  XCopyColormapAndFree(),  XCreateColormap(),  XFreeColormap(), XInstallColormap(), XListInstalledCol-
  ormaps(), XSetStandardColormap(), XSetWindowColormap(), XUninstallColormap().

Xlib - Colormaps													    XGetStandardColormap()

Check Out this Related Man Page

XSetStandardColormap(3X11)												XSetStandardColormap(3X11)

Name
       XSetStandardColormap, XGetStandardColormap - set or get standard colormaps

Syntax
       XSetStandardColormap(display, w, colormap, property)
	     Display *display;
	     Window w;
	     XStandardColormap *colormap;
	     Atom property;	/* RGB_BEST_MAP, etc. */

       Status XGetStandardColormap(display, w, colormap_return, property)
	     Display *display;
	     Window w;
	     XStandardColormap *colormap_return;
	     Atom property;	/* RGB_BEST_MAP, etc. */

Arguments
       colormap  Specifies the colormap.

       colormap_return
		 Returns the colormap associated with the specified atom.

       display	 Specifies the connection to the X server.

       property  Specifies the property name.

       w	 Specifies the window.

Description
       The function usually is only used by window managers.  To create a standard colormap, follow this procedure:

       1.   Open a new connection to the same server.

       2.   Grab the server.

       3.   See if the property is on the property list of the root window for the screen.

       4.   If the desired property is not present:

	    o	 Create a colormap (not required for RGB_DEFAULT_MAP)

	    o	 Determine the color capabilities of the display.

	    o	 Call or to allocate cells in the colormap.

	    o	 Call to store appropriate color values in the colormap.

	    o	 Fill in the descriptive members in the structure.

	    o	 Attach the property to the root window.

	    o	 Use to make the resource permanent.

       5.   Ungrab the server.

       can generate and errors.

       The  function  returns the colormap definition associated with the atom supplied as the property argument.  For example, to fetch the stan-
       dard colormap for a display, you use with the following syntax:

       XGetStandardColormap(dpy, DefaultRootWindow(dpy), &cmap, XA_RGB_GRAY_MAP);

       Once you have fetched a standard colormap, you can use it to convert RGB values into pixel values.  For example,  given	an  structure  and
       floating-point RGB coefficients in the range 0.0 to 1.0, you can compose pixel values with the following C expression:

       pixel = base_pixel
	    + ((unsigned long) (0.5 + r * red_max)) * red_mult
	    + ((unsigned long) (0.5 + g * green_max)) * green_mult
	    + ((unsigned long) (0.5 + b * blue_max)) * blue_mult;

       The  use of addition rather than logical OR for composing pixel values permits allocations where the RGB value is not aligned to bit bound-
       aries.

       can generate and errors.

Diagnostics
       The server failed to allocate the requested resource or server memory.

       A value for an Atom argument does not name a defined Atom.

       A value for a Window argument does not name a defined Window.

See Also
       Guide to the Xlib Library

															XSetStandardColormap(3X11)
Man Page