You may return to the Cvo Object Documenation Index from this document. This document contains the following sections describing the Cvo_Pixmap object:
Cvo_Pixmap
Cvo_BasicObject
#include
<Cvo/Pixmap.h++>
new
Cvo_Pixmap ( { Cvo_Window | Cvo_Pixmap } *drawable,
int width,
int height,
[ int depth ] )
The Cvo_Pixmap object is an off screen drawing region which can later be copied into a visual object or another Cvo_Pixmap. A Cvo_Pixmap requires the proposed destination drawable to gain information such as the X Display and depth. The depth may be overridden when a Cvo_Pixmap is created. Further, a pixel width and height are specified at creation time.
This object defines the following member functions in addition to those defined by its parent and ancestor objects.
Resize (
int width,
int height,
[ BOOL copy ] )
Change the size of the pixmap to be width x height pixels.
If copy is not given, or is True
, the pixels from the old
pixmap will be copied into the new pixmap.
AllowPartials (
)
Normally when a pixmap is resized a new pixmap is generated. Calling this member function allows the Cvo_Pixmap object to not reallocate the Cvo_Pixmap when it is made smaller.
These functions return the basic foreground and background colors of the object. This does not take into account sunkenness or sensivity.
These functions return the actual color being used for the foreground and background of the the window.
Functions dealing with text and fonts are:
Cvo_TextAttribute *TextAttribute (
)
This function returns the basic text attribute used in this window.
Cvo_TextAttribute *NewTextAttribute (
)
This function is used to create a new text attribute.
DrawString (
int x,
int y,
char *string,
[ int length ] )
DrawString (
int x,
int y,
wchar_t *string,
int length )
ImageString (
int x,
int y,
char *string,
[ int length ] )
ImageString (
int x,
int y,
wchar_t *string,
int length )
These functions are used to draw the text pointed to by string,
which is either NULL
terminated or length characters long, at
the position (x,y). (x,y) refer to the upper left corner of
the first glyph.
The DrawString()
version only affects the pixels of the letters
themselves (i.e overstrike mode) while the ImageString()
version
affects the background as well.
StringWidth (
{ char | wchar_t } *string,
[ int length ] )
StringHeight (
{ char | wchar_t } *string,
[ int length ] )
These functions return the number of pixels which would be needed if
string were to be drawn. If string is not NULL
terminated, then length should specify how many characters are in
string.
StringExtents (
{ char | wchar_t } *string,
[ int length ],
XRectangle ink,
[ XRectangle logical ] )
This function returns the bounding boxes around the actual space
which will be affected by string if it were to be drawn and the
amount of space that must be reserved. The ink value will
contain the amount of space affected. If given, the logical value
contains the amount of space required. If string is not NULL
terminated, then length specifies the number of characters in
string.
DrawStrings (
int mode,
int x,
int y,
int width,
int height,
{ char | wchar_t } *string,
[ int length ] )
This function draws multiple strings separated by newlines. The
strings should be contained in string, which is either NULL
terminated or length characters long. Each line is drawn below
the previous line. Vertically the lines are centered between y and y
+ height. Horizontally the lines are either centered, left justified
or right justified depending on mode. If mode is Cvo_LEFT_JUSTIFY
it will be left justified, if it is Cvo_RIGHT_JUSTIFY
the lines
will be right justified, otherwise the lines are centered.
StringsExtents (
{ char | wchar_t } *string,
int length,
XRectangle logical )
This function returns, in logical, the bounding box around the newline separated lines defined in string. The argument length should contain the number of characters in string.
Functions used to draw chamfers and other decorations are:
These functions draw a chamfer whose upper left inside corner is located at (x,y) and whose interior size is width x height. If these values are missing, or all are zero, the chamfer is drawn around the edges of the window. The width of the chamfer is amount. If color is specified, it is the base color used for the chamfer, otherwise the background color is used.
DrawRaisedChamfer()
draws a chamfer which makes the interior of
the window appear raised. DrawLoweredChamfer()
draws a chamfer
which makes the interior of the window appear sunken.
DrawEtchedChamfer()
draws an etched area around the specified area.
ClearChamfer (
int amount,
[ int x, int y, int width, int height ] )
This function clears the chamfer drawn by one of the above three chamfer drawing functions.
DrawArrow (
int dir,
int x,
int y,
int width,
[ int height ] )
DrawUpArrow (
int x,
int y,
int width,
[ int height ] )
DrawDownArrow (
int x,
int y,
int width,
[ int height ] )
DrawLeftArrow (
int x,
int y,
int width,
[ int height ] )
DrawRightArrow (
int x,
int y,
int width,
[ int height ] )
These functions draw an arrow at (x,y) on the current object. The
width argument is necessary, and if the optional height
argument is missing, width is used in its place. For
DrawArrow()
, the directions available:
Cvo_NORTH
Cvo_SOUTH
Cvo_EAST
Cvo_WEST
Functions dealing with the Graphics Context (please see the standard X11 documentation for more details on the arguments for these functions):
GC Gc (
)
Return the default X Graphics Context.
GC SaveGC (
)
Return a copy of the Graphics Context.
RestoreGC (
GC gc )
Restore the Graphics Context from the previously saved value gc.
SetArcMode (
int arc_mode )
SetClipMask (
Pixmap clip_mask )
SetClipOrigin (
int clip_x_origin,
int clip_y_origin )
SetClipRectangles (
int clip_x_origin,
int clip_y_origin,
XRectangle rectangles[ ],
int nrects,
int ordering )
Note that this function does not adjust the value in rectangles, so these must be specified with X's idea of origin as opposed to Cvo's.
SetDashes (
int dash_offset,
char dash_list[ ],
int n )
SetFillRule (
int fill_rule )
SetFillStyle (
int fill_style )
This function also may change the stipple and fill style of the Graphics Context to allow "color" to be represented on a monochrome workstation.
This function does not affect the fill style or stipple.
SetFunction (
int function )
SetGraphicsExposures (
BOOL graphics_exposures )
SetLineAttributes (
unsigned int line_width,
int line_style,
int cap_style,
int join_style )
SetPlaneMask (
unsigned long plane_mask )
SetRegion (
Region r )
SetStipple (
Pixmap stipple )
SetSubwindowMode (
int subwindow_mode )
SetTile (
Pixmap tile )
SetTSOrigin (
int ts_x_origin,
int ts_y_origin )
Functions which allow access to standard Xlib functions (Please see the standard X11 documentation for more details on the arguments of these functions):
DrawLine (
int x1,
int y1,
int x2,
int y2 )
DrawPoint (
int x,
int y )
DrawArc (
int x,
int y,
int width,
int height,
int angle1,
int angle2 )
DrawRectangle (
int x,
int y,
int width,
int height )
FillArc (
int x,
int y,
int width,
int height,
int angle1,
int angle2 )
FillRectangle (
int x,
int y,
int width,
int height )
ClearArea (
int x,
int y,
int width,
int height )
ClearWindow (
)
This only clears the usable area of the window. It will not affect the chamfers or pads.
CopyArea (
int src_x,
int src_y,
int width,
int height,
int dest_x,
int dest_y )
This fucntion assumes both the source and the destination are the current window.
CopyAreaTo (
Cvo_Pixmap *dst,
[ int x, int y, int w, int h, int dx, int dy ] )
CopyAreaTo (
Cvo_Window *dst,
[ int x, int y, int w, int h, int dx, int dy ] )
Copy the Pixmap to dst.
Optional (x, y) specify the source location in the Pixmap. These default to zero.
Optional (w,y) specify the size of the area to copy. These default to the width and height of the source or destination, whichever is smaller.
Optional (dx,dy) specify the destination location in dst. These default to zero.
CopyAreaFrom (
Cvo_Pixmap *src,
[ int x, int y, int w, int h, int dx, int dy ] )
CopyAreaFrom (
Cvo_Window *src,
[ int x, int y, int w, int h, int dx, int dy ] )
These functions copy from src into the Pixmap.
Optional (x, y) specify the source location in src. These default to zero.
Optional (w,y) specify the size of the area to copy. These default to the width and height of the source or destination, whichever is smaller.
Optional (dx,dy) specify the destination location in the Pixmap. These default to zero.
CopyInPixmap (
Pixmap p,
int x,
int y,
int w,
int h )
This function copies an area internally in a Pixmap, p. The source area starts at (0,0), and is of size w x h pixels. It is copied to the location (x,y) in p.
PutImage (
XImage *im,
[ int x, int y ],
int dx,
int dy,
int w,
int h )
This function copies an area from the XImage im to the Pixmap. The source area starts at (x,y) if specified, (0,0) otherwise. The area copied is of size w x h pixels. The destination is (dx,dy).
See the example source code for an example of how to use this object.
See the legend for information about the conventions used in this documentation.