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

FreeBSD Manual Pages

  
 
  

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

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

SYNOPSIS
     #include <Xmt/Color.h>

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

     int XmtAllocWidgetColor(Widget w, String colorname, Pixel *color_return)

     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 colorcell)

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

ARGUMENTS
     INPUTS

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

	  colormap
		 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 be-
		 ing allocated for a monochrome display. Pass NULL  to	use  the
		 visual of w.

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

	  colorname
		 The name of the color to be allocated. This may be a standard X
		 color name, or may use one of the enhanced Xmt color specifica-
		 tion schemes.

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

	  colorcell
		 For  XmtStoreColor()  and  XmtStoreWidgetColor(),  specifies  a
		 read/write color cell in colormap that the application has pre-
		 viously allocated.
     OUTPUTS

	  color_return
		 For XmtAllocColor() and XmtAllocWidgetColor(), returns an allo-
		 cated pixel that contains the specified color.
     RETURNS

	  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  XmtAllocColor()  and  XmtAl-
	  locWidgetColor() only) means that the specified colormap was full.

DESCRIPTION
     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 symbolic name,
     by  HSL  components,  or as HSL deltas relative to a standard background or
     foreground color. Xmt color names may  also  provide  fallback  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 simplified version of
     the function that uses a default  colormap,  visual  and  colortable-it  is
     equivalent  to  calling  XmtAllocColor()  with  a NULL colormap, 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 dynamically,  however,  you
     may need to free allocated color cells with these functions.

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

USAGE
     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.

SEE ALSO
     Chapter 4, Using Color
     XmtRegisterPixelConverter().

Xmt				   Motif Tools			XmtAllocColor(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=XmtStoreWidgetColor&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help