Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
XmtAllocColor(3)	   Library Functions Manual	      XmtAllocColor(3)

       XmtAllocColor(),	 XmtAllocWidgetColor(),	XmtFreeColor(),	XmtFreeWidget-
       Color(),	XmtStoreColor(), XmtStoreWidgetColor() - Xmt color  allocation

       #include	<Xmt/Color.h>

       int XmtAllocColor(Widget	w, Colormap colormap, Visual *visual,
		      XmtColorTable colortable,	String colorname, Pixel

       int XmtAllocWidgetColor(Widget w, String	colorname, Pixel

       void XmtFreeColor(Widget	w, Colormap colormap, Pixel color)

       void XmtFreeWidgetColor(Widget w, Pixel color)

       int XmtStoreColor(Widget	w, Colormap colormap, Visual *visual,
		      XmtColorTable colortable,	String colorname, Pixel

       int XmtStoreWidgetColor(Widget w, String	colorname, Pixel colorcell)


	    w	   The widget for which	the color is to	be allocated or	freed.

		   The colormap	in which the color is to be allocated, or None
		   to use the colormap of w.

	    visual The visual of the colormap, used to determine if colors are
		   being allocated for a monochrome display. Pass NULL to  use
		   the visual of w.

		   The	XmtColorTable  in which	symbolic color names should be
		   looked up, or NULL to use the default color	table  of  the

		   The	name of	the color to be	allocated. This	may be a stan-
		   dard	X color	name, or may use one of	the enhanced Xmt color
		   specification schemes.

	    color  For	XmtFreeColor()	and  XmtFreeWidgetColor(), specifies a
		   Pixel value previously  returned  by	 XmtAlloc  Color()  or
		   XmtAllocWidgetColor(), respectively.

		   For	XmtStoreColor()	and XmtStoreWidgetColor(), specifies a
		   read/write color cell in colormap that the application  has
		   previously allocated.

		   For	XmtAllocColor()	 and XmtAllocWidgetColor(), returns an
		   allocated pixel that	contains the specified color.

	    XmtAllocColor(), XmtAllocWidgetColor(), XmtStoreColor()  and  Xmt-
	    StoreWidgetColor()	return	0  upon	successful allocation and non-
	    zero on failure. A return value of 1 means	that  color  name  was
	    unrecognized  or malformed,	and a return value of 2	(for XmtAlloc-
	    Color() and	XmtAllocWidgetColor() only) means that	the  specified
	    colormap was full.

       These  functions	 allocate  and free colors specified with the extended
       Xmt color name syntax. With these functions, colors may be specified by
       name, or	by RGB components, as usual, but may also be specified by sym-
       bolic name, by HSL components, or as HSL	deltas relative	to a  standard
       background  or foreground color.	Xmt color names	may also provide fall-
       back colors for monochrome systems. See Chapter 4, Using	Color, for  an
       explanation of the Xmt color syntax.

       XmtAllocColor()	allocates  a  shared, read-only	color cell in colormap
       and returns it in color_return. This returned color cell	 will  contain
       the  color  specified by	colorname. Xmt AllocWidgetColor() is a simpli-
       fied version of the function that uses a	default	colormap,  visual  and
       colortable-it is	equivalent to calling XmtAllocColor() with a NULL col-
       ormap, visual and color table

       XmtFreeColor() frees a color allocated with XmtAllocColor(),  and  Xmt-
       FreeWidgetColor()  frees	 a color allocated with	XmtAllocWidgetColor().
       Many applications will allocated	colors when  the  start	 up  and  will
       never  need  to free them. If your application allocates	colors dynami-
       cally, however, you may need to free allocated color cells  with	 these

       XmtStoreColor()	and  XmtStoreWidgetColor()  are	 analogs  to XmtAlloc-
       Color() and XmtAllocWidgetColor(), but instead of  allocated  a	shared
       color  cell  in	a  colormap,  they  store the specified	color into the
       already allocated privated read/write color cell, specified  by	color-
       cell.  The application is responsible for allocating this private color
       cell (with XAllocColorCells(), for example) and	for  freeing  it  with

       Many  applications  can	handle	all  of	 their color needs through the
       resource	 database.  Call  XmtRegisterPixelConverter()  to  register  a
       resource	 converter  that  will allow you to use	the extended Xmt color
       specification syntax in your resource files.

       Chapter 4, Using	Color

Xmt				  Motif	Tools		      XmtAllocColor(3)


Want to link to this manual page? Use this URL:

home | help