To use the functions defined in this section, you should include the header
file
<X11/Xmu/Drawing.h
>
and link against the libXmu library.
void XmuDrawRoundedRectangle(Display *dpy, Drawable draw, GC gc, int x, int y, int w, int h, int ew, int eh);
void XmuDrawRoundedRectangle(Display *dpy, Drawable draw, GC gc, int x, int y, int w, int h, int ew, int eh);
| specifies the connection to the X server |
| specifies the drawable |
| specifies the GC |
| specifies the upper left x coordinate |
| specifies the upper left y coordinate |
| specifies the rectangle width |
| specifies the rectangle height |
| specifies the corner width |
| specifies the corner height |
This function draws a rounded rectangle, where x, y, w, h are the dimensions of the overall rectangle, and ew and eh are the sizes of a bounding box that the corners are drawn inside of; ew should be no more than half of w, and eh should be no more than half of h. The current GC line attributes control all attributes of the line.
void XmuFillRoundedRectangle(Display *dpy, Drawable draw, GC gc, int x, int y, int w, int h, int ew, int eh);
void XmuFillRoundedRectangle(Display *dpy, Drawable draw, GC gc, int x, int y, int w, int h, int ew, int eh);
| specifies the connection to the X server |
| specifies the drawable |
| specifies the GC |
| specifies the upper left x coordinate |
| specifies the upper left y coordinate |
| specifies the rectangle width |
| specifies the rectangle height |
| specifies the corner width |
| specifies the corner height |
This function draws a filled rounded rectangle, where x, y, w, h are the dimensions of the overall rectangle, and ew and eh are the sizes of a bounding box that the corners are drawn inside of; ew should be no more than half of w, and eh should be no more than half of h. The current GC fill settings control all attributes of the fill contents.
XmuDrawLogo(Display *dpy, Drawable drawable, GC gcFore, GC gcBack, int x, int y, unsigned int width, unsigned int height);
XmuDrawLogo(Display *dpy, Drawable drawable, GC gcFore, GC gcBack, int x, int y, unsigned int width, unsigned int height);
| specifies the connection to the X server |
| specifies the drawable |
| specifies the foreground GC |
| specifies the background GC |
| specifies the upper left x coordinate |
| specifies the upper left y coordinate |
| specifies the logo width |
| specifies the logo height |
This function draws the “official” X Window System logo (Figure 1, “The X Logo”). The bounding box of the logo in the drawable is given by x, y, width, and height. The logo itself is filled using gcFore, and the rest of the rectangle is filled using gcBack.
Pixmap XmuCreateStippledPixmap(Screen *screen, Pixel fore, Pixel back, unsigned int depth);
Pixmap XmuCreateStippledPixmap(Screen *screen, Pixel fore, Pixel back, unsigned int depth);
| specifies the screen the pixmap is created on |
| specifies the foreground pixel value |
| specifies the background pixel value |
| specifies the depth of the pixmap |
This function creates a two pixel by one pixel stippled pixmap of specified
depth on the specified screen. The pixmap is cached so that multiple
requests share the same pixmap. The pixmap should be freed with
XmuReleaseStippledPixmap
to maintain correct reference counts.
void XmuReleaseStippledPixmap(Screen *screen, Pixmap pixmap);
void XmuReleaseStippledPixmap(Screen *screen, Pixmap pixmap);
| specifies the screen the pixmap was created on |
| specifies the pixmap to free |
This function frees a pixmap created with
XmuCreateStippledPixmap
.
int XmuReadBitmapData(FILE *fstream, unsigned int *width, unsigned int *height, unsigned char **datap, int *x_hot, int *y_hot);
int XmuReadBitmapData(FILE *fstream, unsigned int *width, unsigned int *height, unsigned char **datap, int *x_hot, int *y_hot);
| specifies the stream to read from |
| returns the width of the bitmap |
| returns the height of the bitmap |
| returns the parsed bitmap data |
| returns the x coordinate of the hotspot |
| returns the y coordinate of the hotspot |
This function reads a standard bitmap file description from the specified
stream, and returns the parsed data in a format suitable for passing to
XCreateBitmapFromData
.
The return value of the function has the same
interpretation as the return value for
XReadBitmapFile
.
int XmuReadBitmapDataFromFile(const char *filename, unsigned int *width, unsigned int *height, unsigned char **datap, int *x_hot, int *y_hot);
int XmuReadBitmapDataFromFile(const char *filename, unsigned int *width, unsigned int *height, unsigned char **datap, int *x_hot, int *y_hot);
| specifies the file to read from |
| returns the width of the bitmap |
| returns the height of the bitmap |
| returns the parsed bitmap data |
| returns the x coordinate of the hotspot |
| returns the y coordinate of the hotspot |
This function reads a standard bitmap file description from the specified
file, and returns the parsed data in a format suitable for passing to
XCreateBitmapFromData
.
The return value of the function has the same
interpretation as the return value for
XReadBitmapFile
.
Pixmap XmuLocateBitmapFile(Screen *screen, const char *name, char *srcname, int srcnamelen, int *widthp, int *heightp, int *xhotp, int *yhotp);
Pixmap XmuLocateBitmapFile(Screen *screen, const char *name, char *srcname, int srcnamelen, int *widthp, int *heightp, int *xhotp, int *yhotp);
| specifies the screen the pixmap is created on |
| specifies the file to read from |
| returns the full filename of the bitmap |
| specifies the length of the srcname buffer |
| returns the width of the bitmap |
| returns the height of the bitmap |
| returns the x coordinate of the hotspot |
| returns the y coordinate of the hotspot |
This function reads a file in standard bitmap file format, using
XReadBitmapFile
,
and returns the created bitmap. The filename may be
absolute, or relative to the global resource named
bitmapFilePath
with class
BitmapFilePath. If the resource is not defined, the default value is the
build symbol BITMAPDIR, which is typically
"/usr/include/X11/bitmaps
".
If srcnamelen
is greater than zero and
srcname
is not NULL,
the null terminated filename will be copied into
srcname
. The size and hotspot of the bitmap are
also returned.
Pixmap XmuCreatePixmapFromBitmap(Display *dpy, Drawable d, Pixmap bitmap, unsigned int width, unsigned int height, unsigned int depth, unsigned long fore, unsigned long back);
Pixmap XmuCreatePixmapFromBitmap(Display *dpy, Drawable d, Pixmap bitmap, unsigned int width, unsigned int height, unsigned int depth, unsigned long fore, unsigned long back);
| specifies the connection to the X server |
| specifies the screen the pixmap is created on |
| specifies the bitmap source |
| specifies the width of the pixmap |
| specifies the height of the pixmap |
| specifies the depth of the pixmap |
| specifies the foreground pixel value |
| specifies the background pixel value |
This function creates a pixmap of the specified width, height, and depth, on
the same screen as the specified drawable, and then performs an
XCopyPlane
from the specified bitmap to the pixmap,
using the specified foreground and background pixel values.
The created pixmap is returned.