X11workbench Toolkit  1.0
Graphics Abstraction Layer

Functions

Region WBXImageToRegion (const XImage *pImage)
 Create a Region from an XImage. More...
 
XImage * WBXImageFromRegion (Region rgnSource, int width, int height)
 Create a Region from an XImage. More...
 
int WBXDrawPoint (XImage *pImage, WBGC hGC, int x, int y)
 XImage version for XDrawPoint() More...
 
int WBXDrawPoints (XImage *pImage, WBGC hGC, XPoint *points, int npoints, int mode)
 XImage version for XDrawPoints() More...
 
int WBXDrawLine (XImage *pImage, WBGC hGC, int x1, int y1, int x2, int y2)
 XImage version for XDrawLines() More...
 
int WBXDrawLines (XImage *pImage, WBGC hGC, XPoint *points, int npoints, int mode)
 XImage version for XDrawLine() More...
 
int WBXDrawRectangle (XImage *pImage, WBGC hGC, int x, int y, unsigned int width, unsigned int height)
 XImage version for XDrawRectangle() More...
 
int WBXFillRectangle (XImage *pImage, WBGC hGC, int x, int y, unsigned int width, unsigned int height)
 XImage version for XFillRectangle() More...
 
int WBXDrawArc (XImage *pImage, WBGC hGC, int x, int y, unsigned int width, unsigned int height, int angle1, int angle2)
 XImage version for XDrawArc() More...
 
int WBXFillArc (XImage *pImage, WBGC hGC, int x, int y, unsigned int width, unsigned int height, int angle1, int angle2)
 XImage version for XFillArc() More...
 
int WBXFillPolygon (XImage *pImage, WBGC hGC, XPoint *points, int npoints, int shape, int mode)
 XImage version for XFillPolygon() More...
 
int WBXDrawString (XImage *pImage, WB_FONTC pFont, WBGC hGC, int x, int y, const char *string, int length)
 XImage version for XDrawString() or DTDrawString() More...
 
WBGC WBCreateGC (Display *pDisplay, Drawable dw, unsigned long valuemask, const XGCValues *values)
 Creates a WBGC, wrapper for XCreateGC() More...
 
int WBChangeGC (WBGC hGC, unsigned long valuemask, const XGCValues *values)
 Change a WBGC, a wrapper for XChangeGC() More...
 
Status WBGetGCValues (WBGC hGC, unsigned long valuemask, XGCValues *values)
 Change a WBGC, a wrapper for XGetGCValues() More...
 
unsigned long WBGetGCBGColor (WBGC gc)
 returns the currently assigned background color for a WBGC More...
 
unsigned long WBGetGCFGColor (WBGC gc)
 returns the currently assigned foreground color for a WBGC More...
 
WB_FONTC WBQueryGCFont (WBGC gc)
 return the WB_FONTC object that was assigned to a WBGC More...
 
WB_FONT WBGetGCFont (Display *pDisplay, WBGC gc)
 return a copy of the WB_FONT object that was assigned to a WBGC More...
 
WBGC WBCopyGC (WBGC hGCOrig)
 makes a copy of a WBGC, a more sensible wrapper for XCopyGC() More...
 
int WBCopyGC2 (WBGC hGCOrig, unsigned long valuemask, WBGC hGCDest)
 makes a copy of a WBGC, a wrapper for XCopyGC() More...
 
WBGC WBCopyDrawableGC (Display *pDisplay, Drawable dw, WBGC hGCOrig)
 makes a copy of the specified WBGC for the desired 'Drawable' More...
 
void WBFreeGC (WBGC hGC)
 Free resources for a WBGC, wrapper for XFreeGC() More...
 
GContext WBGContextFromGC (WBGC hGC)
 Free resources for a WBGC, wrapper for XGContextFromGC() More...
 
int WBSetRegion (WBGC hGC, Region rgnClip)
 Assign clipping region, wrapper for XSetRegion() More...
 
int WBSetClipOrigin (WBGC hGC, int clip_x_origin, int clip_y_origin)
 Set clip origin, a wrapper for XSetClipOrigin() More...
 
int WBSetClipMask (WBGC hGC, Pixmap pixmap)
 Set clip mask, a wrapper for XSetClipMask() More...
 
int WBSetFunction (WBGC hGC, int function)
 Set the 'function' for the WBGC, a wrapper for XSetFunction() More...
 
static __inline__ unsigned long WBGetForeground (WBGC hGC)
 Get the (cached) foreground color for a WBGC. More...
 
int WBSetForeground (WBGC hGC, unsigned long foreground)
 Assign foreground color, a wrapper for XSetForeground() More...
 
static __inline__ unsigned long WBGetBackground (WBGC hGC)
 Get the (cached) background color for a WBGC. More...
 
int WBSetBackground (WBGC hGC, unsigned long background)
 Assign background color, a wrapper for XSetBackground() More...
 
int WBSetFont (WBGC hGC, WB_FONTC pFont)
 Assign font to a WBGC, a wrapper for XSetFont() More...
 
int WBSetFontNoCopy (WBGC hGC, WB_FONT pFont)
 Assign font to a WBGC, a wrapper for XSetFont() More...
 
int WBSetLineAttributes (WBGC hGC, unsigned int line_width, int line_style, int cap_style, int join_style)
 Assign font to a WBGC, a wrapper for XSetLineAttributes() More...
 
int WBSetDashes (WBGC hGC, int dash_offset, const char dash_list[], int n)
 Assign font to a WBGC, a wrapper for XSetFont() More...
 

Detailed Description

These functions provide a graphics-related 'Abstraction Layer' API for performance enhancement and cross-platform implementation of the toolkit. Rather than calling X11 library functions directly, you should use these equivalent API functions whenever possible.

Function Documentation

◆ WBChangeGC()

int WBChangeGC ( WBGC  hGC,
unsigned long  valuemask,
const XGCValues *  values 
)

Change a WBGC, a wrapper for XChangeGC()

Parameters
hGCThe WBGC which is to be modified
valuemaskA bitwise mask of values to assign to the new WBGC from 'values'
valuesA pointer to an XGCValues structure describing values to be assigned (may be NULL)
Returns
An integer indicating success or fail

Most of the cached GC values are stored in the 'values' member of the WBGC structure. It is safe to read this structure directly, though you should never assign anything to it without using one of the API functions (such as this one).

See also
WBGC

Header File: window_helper.h

Definition at line 676 of file graphical_api.c.

◆ WBCopyDrawableGC()

WBGC WBCopyDrawableGC ( Display *  pDisplay,
Drawable  dw,
WBGC  hGCOrig 
)

makes a copy of the specified WBGC for the desired 'Drawable'

Parameters
pDisplayA pointer to the 'Display' for the drawable. NULL implies the default display.
dwThe 'Drawable' for which to copy the original WBGC (NULL/None uses the 'default' window)
hGCOrigThe source 'WBGC'
Returns
A copy of the WBGC for the specified 'Drawable'

Makes a copy of the specified WBGC. Useful if you want to make temporary modifications to a WBGC for a particular drawing operation, but don't want to actually modify the original WBGC.

Header File: window_helper.h

Definition at line 1162 of file graphical_api.c.

◆ WBCopyGC()

WBGC WBCopyGC ( WBGC  hGCOrig)

makes a copy of a WBGC, a more sensible wrapper for XCopyGC()

Parameters
hGCOrigThe WBGC which is to be copied
Returns
A copy of the original WBGC

Header File: window_helper.h

Definition at line 905 of file graphical_api.c.

◆ WBCopyGC2()

int WBCopyGC2 ( WBGC  hGCOrig,
unsigned long  valuemask,
WBGC  hGCDest 
)

makes a copy of a WBGC, a wrapper for XCopyGC()

Parameters
hGCOrigThe WBGC which is to be copied
unsignedlong valuemask A bitwise mask of values to assign to the new WBGC from the original
hGCDestThe destination WBGC to copy to
Returns
An integer indicating success or fail

Header File: window_helper.h

Definition at line 958 of file graphical_api.c.

◆ WBCreateGC()

WBGC WBCreateGC ( Display *  pDisplay,
Drawable  dw,
unsigned long  valuemask,
const XGCValues *  values 
)

Creates a WBGC, wrapper for XCreateGC()

Parameters
pDisplayA pointer to the Display, or NULL to use the default Display
Drawabledw The Drawable for which to create the WBGC
valuemaskA bitwise mask of values to assign to the new WBGC from 'values'
valuesA pointer to an XGCValues structure describing values to be assigned (may be NULL)
Returns
A copy of the new WBGC

Most of the cached GC values are stored in the 'values' member of the WBGC structure. It is safe to read this structure directly, though you should never assign anything to it without using one of the API functions.

See also
WBGC

Header File: window_helper.h

Definition at line 565 of file graphical_api.c.

◆ WBFreeGC()

void WBFreeGC ( WBGC  hGC)

Free resources for a WBGC, wrapper for XFreeGC()

Parameters
hGCThe WBGC which is to be freed

Header File: window_helper.h

Definition at line 1218 of file graphical_api.c.

◆ WBGContextFromGC()

GContext WBGContextFromGC ( WBGC  hGC)

Free resources for a WBGC, wrapper for XGContextFromGC()

Parameters
hGCThe WBGC which is to be freed
Returns
a GContext indicating the saved graphics context associated with the WBGC

NOTE: this only preserves those things that XGContextFromGC will preserve; some things are only cached by the WBGC internally

Most of the cached GC values are stored in the 'values' member of the WBGC structure. It is safe to read this structure directly, though you should never assign anything to it without using one of the API functions.

See also
WBGC

Header File: window_helper.h

Definition at line 1291 of file graphical_api.c.

◆ WBGetBackground()

static __inline__ unsigned long WBGetBackground ( WBGC  hGC)
static

Get the (cached) background color for a WBGC.

Parameters
hGCThe WBGC to query the color of
Returns
the backgound color associated with the WBGC

Header File: window_helper.h

Definition at line 3136 of file window_helper.h.

◆ WBGetForeground()

static __inline__ unsigned long WBGetForeground ( WBGC  hGC)
static

Get the (cached) foreground color for a WBGC.

Parameters
hGCThe WBGC to query the color of
Returns
the foreground color associated with the WBGC

Header File: window_helper.h

Definition at line 3105 of file window_helper.h.

◆ WBGetGCBGColor()

unsigned long WBGetGCBGColor ( WBGC  gc)

returns the currently assigned background color for a WBGC

Parameters
gcThe WBGC to be queried
Returns
The currently assigned background color

If the current background color cannot be determined, this function will return the pre-defined color for WHITE on the specified Display and default screen

Header File: window_helper.h

See also
WBGetWindowBGColor()

Definition at line 5886 of file window_helper.c.

◆ WBGetGCFGColor()

unsigned long WBGetGCFGColor ( WBGC  gc)

returns the currently assigned foreground color for a WBGC

Parameters
gcThe WBGC to be queried
Returns
The currently assigned foreground color

If the current foreground color cannot be determined, this function will return the pre-defined color for BLACK on the specified Display and default screen

Header File: window_helper.h

See also
WBGetWindowFGColor()

Definition at line 5857 of file window_helper.c.

◆ WBGetGCFont()

WB_FONT WBGetGCFont ( Display *  pDisplay,
WBGC  gc 
)

return a copy of the WB_FONT object that was assigned to a WBGC

Parameters
pDisplayA pointer to the Display
gcThe WBGC to be queried
Returns
A pointer to a WB_FONT object, or NULL on error. non-NULL values must be freed via WBFreeFont()

Call this function to determine the font that has been assigned to a WBGC, and make a copy of it for subsequent use. If there has been NO font assigned, the system default font information will be returned.

The return value is always a new pointer to a WB_FONT, or NULL on error. The caller must free non-NULL return values via WBFreeFont().

Header File: window_helper.h

See also
WBQueryGCFont()

Definition at line 1314 of file graphical_api.c.

◆ WBGetGCValues()

Status WBGetGCValues ( WBGC  hGC,
unsigned long  valuemask,
XGCValues *  values 
)

Change a WBGC, a wrapper for XGetGCValues()

Parameters
hGCThe WBGC which is to be queried
valuemaskA bitwise mask of values to assign to the new WBGC from 'values'
valuesA pointer to an XGCValues structure describing values to be assigned (may be NULL)
Returns
A Status indicating success or fail

Most of the cached GC values are stored in the 'values' member of the WBGC structure. It is safe to read this structure directly, though you should never assign anything to it without using one of the API functions. This function will conveniently make a copy of that internal structure and write it to the pointer specified by 'values'.

See also
WBGC, WBFreeGC()

Header File: window_helper.h

Definition at line 833 of file graphical_api.c.

◆ WBQueryGCFont()

WB_FONTC WBQueryGCFont ( WBGC  gc)

return the WB_FONTC object that was assigned to a WBGC

Parameters
gcThe WBGC to be queried
Returns
A pointer to a WB_FONTC object, or NULL on error.

Call this function to determine the font that has been assigned to a WBGC. If there has been NO font assigned, the system default font information will be returned. A value of NULL is returned on error, or if no font is assigned.

This function differs from WBGetGCFont() in that it does not create a new copy of an existing GC. Therefore, the return value is only valid within the context of the call to WBQueryGCFont() and should NOT be passed to WBFreeFont().

Header File: window_helper.h

See also
WBGetGCFont()

Definition at line 1304 of file graphical_api.c.

◆ WBSetBackground()

int WBSetBackground ( WBGC  hGC,
unsigned long  background 
)

Assign background color, a wrapper for XSetBackground()

Parameters
hGCThe WBGC to set the background color of
backgroundThe background color
Returns
an integer indicating success or fail

Most of the cached GC values are stored in the 'values' member of the WBGC structure. It is safe to read this structure directly, though you should never assign anything to it without using one of the API functions.

See also
WBGC

Header File: window_helper.h

Definition at line 1490 of file graphical_api.c.

◆ WBSetClipMask()

int WBSetClipMask ( WBGC  hGC,
Pixmap  pixmap 
)

Set clip mask, a wrapper for XSetClipMask()

Parameters
hGCThe WBGC to assign a clipping Region to
pixmapA pixmap containing the clipping mask
Returns
an integer indicating success or fail

Header File: window_helper.h

Definition at line 1436 of file graphical_api.c.

◆ WBSetClipOrigin()

int WBSetClipOrigin ( WBGC  hGC,
int  clip_x_origin,
int  clip_y_origin 
)

Set clip origin, a wrapper for XSetClipOrigin()

Parameters
hGCThe WBGC to assign a clipping Region to
clip_x_originThe 'x' clipping origin
clip_y_originThe 'y' clipping origin
Returns
an integer indicating success or fail

Most of the cached GC values are stored in the 'values' member of the WBGC structure. It is safe to read this structure directly, though you should never assign anything to it without using one of the API functions.

See also
WBGC

Header File: window_helper.h

Definition at line 1422 of file graphical_api.c.

◆ WBSetDashes()

int WBSetDashes ( WBGC  hGC,
int  dash_offset,
const char  dash_list[],
int  n 
)

Assign font to a WBGC, a wrapper for XSetFont()

Parameters
hGCThe WBGC to assign a clipping Region to
dash_offsetThe 'dash offset' for creating dashes
dash_listAn array of 'char' values containing the dash info
nThe number of entries in 'dash_list'
Returns
an integer indicating success or fail

Most of the cached GC values are stored in the 'values' member of the WBGC structure. It is safe to read this structure directly, though you should never assign anything to it without using one of the API functions.

See also
WBGC

Header File: window_helper.h

Definition at line 1582 of file graphical_api.c.

◆ WBSetFont()

int WBSetFont ( WBGC  hGC,
WB_FONTC  pFont 
)

Assign font to a WBGC, a wrapper for XSetFont()

Parameters
hGCThe WBGC to assign a clipping Region to
pFontThe WB_FONTC to assign to the WBGC (makes a copy of it)
Returns
an integer indicating success or fail
See also
WBQueryGCFont(), WBGetGCFont()

Header File: window_helper.h

Definition at line 1503 of file graphical_api.c.

◆ WBSetFontNoCopy()

int WBSetFontNoCopy ( WBGC  hGC,
WB_FONT  pFont 
)

Assign font to a WBGC, a wrapper for XSetFont()

Parameters
hGCThe WBGC to assign a clipping Region to
pFontThe WB_FONT to assign to the WBGC directly without copying
Returns
an integer indicating success or fail

The assigned WB_FONT will be stored directly into the WBGC and not copied first. This means that the WBGC will 'take ownership' of the WB_FONT immediately after making this call. The caller must ensure that it is safe for the WBGC object to own such a WB_FONT.

See also
WBQueryGCFont(), WBGetGCFont()

Header File: window_helper.h

iRet &&

Definition at line 1532 of file graphical_api.c.

◆ WBSetForeground()

int WBSetForeground ( WBGC  hGC,
unsigned long  foreground 
)

Assign foreground color, a wrapper for XSetForeground()

Parameters
hGCThe WBGC to set the foreground color of
foregroundThe foreground color
Returns
an integer indicating success or fail

Most of the cached GC values are stored in the 'values' member of the WBGC structure. It is safe to read this structure directly, though you should never assign anything to it without using one of the API functions.

See also
WBGC

Header File: window_helper.h

Definition at line 1477 of file graphical_api.c.

◆ WBSetFunction()

int WBSetFunction ( WBGC  hGC,
int  function 
)

Set the 'function' for the WBGC, a wrapper for XSetFunction()

Parameters
hGCThe WBGC to assign a clipping Region to
functionThe 'function' for the GC - for more information, see XSetFunction()
Returns
an integer indicating success or fail

Most of the cached GC values are stored in the 'values' member of the WBGC structure. It is safe to read this structure directly, though you should never assign anything to it without using one of the API functions.

See also
WBGC

Header File: window_helper.h

Definition at line 1464 of file graphical_api.c.

◆ WBSetLineAttributes()

int WBSetLineAttributes ( WBGC  hGC,
unsigned int  line_width,
int  line_style,
int  cap_style,
int  join_style 
)

Assign font to a WBGC, a wrapper for XSetLineAttributes()

Parameters
hGCThe WBGC to assign a clipping Region to
line_widthThe line width, in pixels
line_styleThe line style - see XSetLineAttributes()
cap_styleThe cap style - see XSetLineAttributes()
join_styleThe join style - see XSetLineAttributes()
Returns
an integer indicating success or fail

Most of the cached GC values are stored in the 'values' member of the WBGC structure. It is safe to read this structure directly, though you should never assign anything to it without using one of the API functions.

See also
WBGC

Header File: window_helper.h

Definition at line 1565 of file graphical_api.c.

◆ WBSetRegion()

int WBSetRegion ( WBGC  hGC,
Region  rgnClip 
)

Assign clipping region, wrapper for XSetRegion()

Parameters
hGCThe WBGC to assign a clipping Region to
rgnClipThe clipping region to assign to the WBGC
Returns
an integer indicating success or fail

Header File: window_helper.h

Definition at line 1382 of file graphical_api.c.

◆ WBXDrawArc()

int WBXDrawArc ( XImage *  pImage,
WBGC  hGC,
int  x,
int  y,
unsigned int  width,
unsigned int  height,
int  angle1,
int  angle2 
)

XImage version for XDrawArc()

Parameters
pImageA pointer to the XImage to draw to
hGCA WBGC that describes the device context (mostly for line width, clipping, etc.)
xThe origin x of the operation
yThe origin y of the operation
widthThe width of the arc's elipse
heightThe height of the arc's elipse
angle1The starting angle of the arc
angle2The ending angle of the arc
Returns
An integer indicating success or failure

This function draws an arc, similar to XDrawArc(), on the specified XImage, with the specified clipping and context.

The XImage should either have a monochrome (single plane) XYPixmap, or 24-bit color ZPixmap format.

Header File: pixmap_helper.h

Definition at line 2040 of file pixmap_helper.c.

◆ WBXDrawLine()

int WBXDrawLine ( XImage *  pImage,
WBGC  hGC,
int  x1,
int  y1,
int  x2,
int  y2 
)

XImage version for XDrawLines()

Parameters
pImageA pointer to the XImage to draw to
hGCA WBGC that describes the device context (mostly for line width, clipping, etc.)
x1The origin 'x' coordinate of the line
y1The origin 'y' coordinate of the line
x2The final 'x' coordinate of the line
y2The final 'y' coordinate of the line
Returns
An integer indicating success or failure

This function draws a line, similar to XDrawLines(), on the specified XImage, with the specified clipping and context.

The XImage should either have a monochrome (single plane) XYPixmap, or 24-bit color ZPixmap format.

Header File: pixmap_helper.h

Definition at line 1927 of file pixmap_helper.c.

◆ WBXDrawLines()

int WBXDrawLines ( XImage *  pImage,
WBGC  hGC,
XPoint *  points,
int  npoints,
int  mode 
)

XImage version for XDrawLine()

Parameters
pImageA pointer to the XImage to draw to
hGCA WBGC that describes the device context (mostly for line width, clipping, etc.)
pointsA pointer to an array of XPoint structures describing the line vertices
npointsThe number of entries in the 'points' array
modeA constant indicating the coordinate mode, either CoordModeOrigin or CoordModePrevious - see XDrawLines().
Returns
An integer indicating success or failure

This function draws one or more lines, similar to XDrawLines(), on the specified XImage, with the specified clipping and context.

The XImage should either have a monochrome (single plane) XYPixmap, or 24-bit color ZPixmap format.

Header File: pixmap_helper.h

Definition at line 1962 of file pixmap_helper.c.

◆ WBXDrawPoint()

int WBXDrawPoint ( XImage *  pImage,
WBGC  hGC,
int  x,
int  y 
)

XImage version for XDrawPoint()

Parameters
pImageA pointer to the XImage to draw to
hGCA WBGC that describes the device context (mostly for line width, clipping, etc.)
xThe origin 'x' coordinate of the line
yThe origin 'y' coordinate of the line
Returns
An integer indicating success or failure

This function draws a point, similar to XDrawPoint(), on the specified XImage, with the specified clipping and context. A point is always a single pixel.

The XImage should either have a monochrome (single plane) XYPixmap, or 24-bit color ZPixmap format.

Header File: pixmap_helper.h

Definition at line 1850 of file pixmap_helper.c.

◆ WBXDrawPoints()

int WBXDrawPoints ( XImage *  pImage,
WBGC  hGC,
XPoint *  points,
int  npoints,
int  mode 
)

XImage version for XDrawPoints()

Parameters
pImageA pointer to the XImage to draw to
hGCA WBGC that describes the device context (mostly for line width, clipping, etc.)
pointsA pointer to an array of XPoint structures describing the line vertices
npointsThe number of entries in the 'points' array
modeA constant indicating the coordinate mode, either CoordModeOrigin or CoordModePrevious - see XDrawLines().
Returns
An integer indicating success or failure

This function draws one or more points, similar to XDrawPoints(), on the specified XImage, with the specified clipping and context. A point is always a single pixel.

The XImage should either have a monochrome (single plane) XYPixmap, or 24-bit color ZPixmap format.

Header File: pixmap_helper.h

Definition at line 1874 of file pixmap_helper.c.

◆ WBXDrawRectangle()

int WBXDrawRectangle ( XImage *  pImage,
WBGC  hGC,
int  x,
int  y,
unsigned int  width,
unsigned int  height 
)

XImage version for XDrawRectangle()

Parameters
pImageA pointer to the XImage to draw to
hGCA WBGC that describes the device context (mostly for line width, clipping, etc.)
xThe origin x of the operation
yThe origin y of the operation
widthThe width of the rectangle
heightThe height of the rectangle
Returns
An integer indicating success or failure

This function draws a rectangle, similar to XDrawRectangle(), on the specified XImage, with the specified clipping and context.

The XImage should either have a monochrome (single plane) XYPixmap, or 24-bit color ZPixmap format.

Header File: pixmap_helper.h

Definition at line 1985 of file pixmap_helper.c.

◆ WBXDrawString()

int WBXDrawString ( XImage *  pImage,
WB_FONTC  pFont,
WBGC  hGC,
int  x,
int  y,
const char *  string,
int  length 
)

XImage version for XDrawString() or DTDrawString()

Parameters
pImageA pointer to the XImage to draw to
pFontA WB_FONTC to use for rendering text. May be NULL, in which case a default font set (based on the WBGC) will be used
hGCA WBGC that describes the device context (mostly for colors, clipping, etc.)
xThe 'x' coordinate for the text alignment (left)
yThe 'y' coordinate for the text alignment (bottom)
stringA const pointer to a UTF-8 or multi-byte string
lengthThe BYTE LENGTH of the UTF-8 or mult-byte string (not character length)
Returns
An integer indicating success or failure

Use this function in lieu of XDrawString() to draw text to an XImage using the specified font set, graphics context, and clipping, upon the specified 'XImage'. This function is the equivalent of the X11 library's XDrawString(). Internally, it is very similar to DTDrawString().

The XImage should either have a monochrome (single plane) XYPixmap, or 24-bit color ZPixmap format.

Header File: pixmap_helper.h

Definition at line 2107 of file pixmap_helper.c.

◆ WBXFillArc()

int WBXFillArc ( XImage *  pImage,
WBGC  hGC,
int  x,
int  y,
unsigned int  width,
unsigned int  height,
int  angle1,
int  angle2 
)

XImage version for XFillArc()

Parameters
pImageA pointer to the XImage to draw to
hGCA WBGC that describes the device context (mostly for line width, clipping, etc.)
xThe origin x of the operation
yThe origin y of the operation
widthThe width of the arc's elipse
heightThe height of the arc's elipse
angle1The starting angle of the arc
angle2The ending angle of the arc
Returns
An integer indicating success or failure

This function draws a filled arc, similar to XFillArc(), on the specified XImage, with the specified clipping and context.

The XImage should either have a monochrome (single plane) XYPixmap, or 24-bit color ZPixmap format.

Header File: pixmap_helper.h

Definition at line 2071 of file pixmap_helper.c.

◆ WBXFillPolygon()

int WBXFillPolygon ( XImage *  pImage,
WBGC  hGC,
XPoint *  points,
int  npoints,
int  shape,
int  mode 
)

XImage version for XFillPolygon()

Parameters
pImageA pointer to the XImage to draw to
hGCA WBGC that describes the device context (mostly for line width, clipping, etc.)
pointsA pointer to an array of XPoint structures describing the polygon line vertices
npointsThe number of entries in the 'points' array
shapeA constant indicating the general shape, either Convex, Nonconvex, or Complex - see XFillPolygon()
modeA constant indicating the coordinate mode, either CoordModeOrigin or CoordModePrevious - see XFillPolygon().
Returns
An integer indicating success or failure

This function draws a filled polygon, similar to XFillPolygon(), on the specified XImage, with the specified clipping and context.

The XImage should either have a monochrome (single plane) XYPixmap, or 24-bit color ZPixmap format.

Header File: pixmap_helper.h

Definition at line 2078 of file pixmap_helper.c.

◆ WBXFillRectangle()

int WBXFillRectangle ( XImage *  pImage,
WBGC  hGC,
int  x,
int  y,
unsigned int  width,
unsigned int  height 
)

XImage version for XFillRectangle()

Parameters
pImageA pointer to the XImage to draw to
hGCA WBGC that describes the device context (mostly for line width, clipping, etc.)
xThe origin x of the operation
yThe origin y of the operation
widthThe width of the rectangle
heightThe height of the rectangle
Returns
An integer indicating success or failure

This function draws a filled rectangle, similar to XFillRectangle(), on the specified XImage, with the specified clipping and context.

The XImage should either have a monochrome (single plane) XYPixmap, or 24-bit color ZPixmap format.

Header File: pixmap_helper.h

Definition at line 2006 of file pixmap_helper.c.

◆ WBXImageFromRegion()

XImage* WBXImageFromRegion ( Region  rgnSource,
int  width,
int  height 
)

Create a Region from an XImage.

Parameters
pImageThe Region to create an XImage from
widthThe width of the resulting XImage
heightThe height of the resulting XImage
Returns
A valid XImage pointer, or NULL (on error). The caller must use WBXDestroyImage() with the returned value if it is not 'NULL', to free resources.

This function creates an 'XYPixmap' single-plane XImage that contains a '1' bit for every point that is You will need to use WBXDestroyImage() to destroy the XImage returned by this function, rather than XDestroyImage(), to avoid any memory management conflicts.

Header File: pixmap_helper.h

Definition at line 1825 of file pixmap_helper.c.

◆ WBXImageToRegion()

Region WBXImageToRegion ( const XImage *  pImage)

Create a Region from an XImage.

Parameters
pImageA const pointer to the XImage to create a Region from
Returns
A valid Region, or None (on error). The caller must use XDestroyRegion() with the returned value if it is not 'None', to free resources.

This function creates a Region from an XImage, assuming that it consists of a union of every 'non-zero' pixel in the XImage.

Header File: pixmap_helper.h

Definition at line 1801 of file pixmap_helper.c.