Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Related Pages  

Nano-X drawing API.
[Nano-X public API]

Functions for actually drawing primitive shapes on the screen. More...

Functions

void GrGetGCInfo (GR_GC_ID gc, GR_GC_INFO *gcip)
 Fills in the specified GR_GC_INFO structure with information regarding the specified graphics context.

GR_GC_ID GrNewGC (void)
 Creates a new graphics context structure.

GR_GC_ID GrCopyGC (GR_GC_ID gc)
 Creates a new graphics context structure and copies the settings from an already existing graphics context.

void GrDestroyGC (GR_GC_ID gc)
 Destroys a graphics context structure.

void GrSetGCClipOrigin (GR_GC_ID gc, int x, int y)
 Sets the X,Y origin of the user clip region in the specified graphics context.

void GrSetGCGraphicsExposure (GR_GC_ID gc, GR_BOOL exposure)
 Controls if GR_EVENT_TYPE_EXPOSURE events are sent as a result of GrCopyArea using the specified graphics context.

void GrClearArea (GR_WINDOW_ID wid, GR_COORD x, GR_COORD y, GR_SIZE width, GR_SIZE height, GR_BOOL exposeflag)
 Clears the specified window by to its background color or pixmap.

void GrSetGCForeground (GR_GC_ID gc, GR_COLOR foreground)
 Changes the foreground colour of the specified graphics context to the specified RGB colour.

void GrSetGCBackground (GR_GC_ID gc, GR_COLOR background)
 Changes the background colour of the specified graphics context to the specified RGB colour.

void GrSetGCForegroundPixelVal (GR_GC_ID gc, GR_PIXELVAL foreground)
 Changes the foreground colour of the specified graphics context to the specified hardware pixel value.

void GrSetGCBackgroundPixelVal (GR_GC_ID gc, GR_PIXELVAL background)
 Changes the background colour of the specified graphics context to the specified hardware pixel value.

void GrSetGCMode (GR_GC_ID gc, int mode)
 Changes the drawing mode (SET, XOR, OR, AND, etc.) of the specified graphics context to the specified mode.

void GrSetGCLineAttributes (GR_GC_ID, int)
 Changes the line style to either SOLID or ON OFF DASHED.

void GrSetGCDash (GR_GC_ID, char *, int)
 FIXME.

void GrSetGCFillMode (GR_GC_ID, int)
 FIXME.

void GrSetGCStipple (GR_GC_ID gc, GR_BITMAP *bitmap, int width, int height)
 FIXME.

void GrSetGCTile (GR_GC_ID gc, GR_WINDOW_ID pixmap, int width, int height)
 FIXME.

void GrSetGCTSOffset (GR_GC_ID gc, int xoff, int yoff)
 FIXME.

void GrSetGCUseBackground (GR_GC_ID gc, GR_BOOL flag)
 Sets the flag which chooses whether or not the background colour is used when drawing bitmaps and text using the specified graphics context to the specified value.

void GrLine (GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x1, GR_COORD y1, GR_COORD x2, GR_COORD y2)
 Draws a line using the specified graphics context on the specified drawable from (x1, y1) to (x2, y2), with coordinates given relative to the drawable.

void GrRect (GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y, GR_SIZE width, GR_SIZE height)
 Draw the boundary of a rectangle of the specified dimensions and position on the specified drawable using the specified graphics context.

void GrFillRect (GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y, GR_SIZE width, GR_SIZE height)
 Draw a filled rectangle of the specified dimensions and position on the specified drawable using the specified graphics context.

void GrEllipse (GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y, GR_SIZE rx, GR_SIZE ry)
 Draws the boundary of ellipse at the specified position using the specified dimensions and graphics context on the specified drawable.

void GrFillEllipse (GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y, GR_SIZE rx, GR_SIZE ry)
 Draws a filled ellipse at the specified position using the specified dimensions and graphics context on the specified drawable.

void GrArc (GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y, GR_SIZE rx, GR_SIZE ry, GR_COORD ax, GR_COORD ay, GR_COORD bx, GR_COORD by, int type)
 Draws an arc with the specified dimensions at the specified position on the specified drawable using the specified graphics context.

void GrArcAngle (GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y, GR_SIZE rx, GR_SIZE ry, GR_COORD angle1, GR_COORD angle2, int type)
 Draws an arc with the specified dimensions at the specified position on the specified drawable using the specified graphics context.

void GrBitmap (GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y, GR_SIZE width, GR_SIZE height, GR_BITMAP *imagebits)
 Draws the monochrome bitmap data provided in the imagebits argument at the specified position on the specified drawable using the specified graphics context.

void GrDrawImageBits (GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y, GR_IMAGE_HDR *pimage)
 Draws the image contained in the specified image structure onto the specified drawable at the specified coordinates using the specified graphics context.

void GrArea (GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y, GR_SIZE width, GR_SIZE height, void *pixels, int pixtype)
 Draws the specified pixel array of the specified size and format onto the specified drawable using the specified graphics context at the specified position.

void GrCopyArea (GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y, GR_SIZE width, GR_SIZE height, GR_DRAW_ID srcid, GR_COORD srcx, GR_COORD srcy, unsigned long op)
 Copies the specified area of the specified size between the specified drawables at the specified positions using the specified graphics context and ROP codes.

void GrReadArea (GR_DRAW_ID id, GR_COORD x, GR_COORD y, GR_SIZE width, GR_SIZE height, GR_PIXELVAL *pixels)
 Reads the pixel data of the specified size from the specified position on the specified drawable into the specified pixel array.

void GrPoint (GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y)
 Draws a point using the specified graphics context at the specified position on the specified drawable.

void GrPoints (GR_DRAW_ID id, GR_GC_ID gc, GR_COUNT count, GR_POINT *pointtable)
 Draws a set of points using the specified graphics context at the positions specified by the point table on the specified drawable.

void GrPoly (GR_DRAW_ID id, GR_GC_ID gc, GR_COUNT count, GR_POINT *pointtable)
 Draws an unfilled polygon on the specified drawable using the specified graphics context.

void GrFillPoly (GR_DRAW_ID id, GR_GC_ID gc, GR_COUNT count, GR_POINT *pointtable)
 Draws a filled polygon on the specified drawable using the specified graphics context.

void GrStretchArea (GR_DRAW_ID dstid, GR_GC_ID gc, GR_COORD dx1, GR_COORD dy1, GR_COORD dx2, GR_COORD dy2, GR_DRAW_ID srcid, GR_COORD sx1, GR_COORD sy1, GR_COORD sx2, GR_COORD sy2, unsigned long op)
 Copies a region from one drawable to another.


Detailed Description

Functions for actually drawing primitive shapes on the screen.


Function Documentation

void GrArc GR_DRAW_ID  id,
GR_GC_ID  gc,
GR_COORD  x,
GR_COORD  y,
GR_SIZE  rx,
GR_SIZE  ry,
GR_COORD  ax,
GR_COORD  ay,
GR_COORD  bx,
GR_COORD  by,
int  type
 

Draws an arc with the specified dimensions at the specified position on the specified drawable using the specified graphics context.

The type specifies the fill type. Possible values include GR_ARC and GR_PIE.

Parameters:
id the ID of the drawable to draw the arc on
gc the graphics context to use when drawing the arc
x the X coordinate to draw the arc at relative to the drawable
y the Y coordinate to draw the arc at relative to the drawable
rx the radius of the arc on the X axis
ry the radius of the arc on the Y axis
ax the X coordinate of the start of the arc relative to the drawable
ay the Y coordinate of the start of the arc relative to the drawable
bx the X coordinate of the end of the arc relative to the drawable
by the Y coordinate of the end of the arc relative to the drawable
type the fill style to use when drawing the arc

void GrArcAngle GR_DRAW_ID  id,
GR_GC_ID  gc,
GR_COORD  x,
GR_COORD  y,
GR_SIZE  rx,
GR_SIZE  ry,
GR_COORD  angle1,
GR_COORD  angle2,
int  type
 

Draws an arc with the specified dimensions at the specified position on the specified drawable using the specified graphics context.

The type specifies the fill type. Possible values include GR_ARC and GR_PIE. This function requires floating point support, and is slightly slower than the GrArc() function which does not require floating point.

Parameters:
id the ID of the drawable to draw the arc on
gc the graphics context to use when drawing the arc
x the X coordinate to draw the arc at relative to the drawable
y the Y coordinate to draw the arc at relative to the drawable
rx the radius of the arc on the X axis
ry the radius of the arc on the Y axis
angle1 the angle of the start of the arc
angle2 the angle of the end of the arc
type the fill style to use when drawing the arc

void GrArea GR_DRAW_ID  id,
GR_GC_ID  gc,
GR_COORD  x,
GR_COORD  y,
GR_SIZE  width,
GR_SIZE  height,
void *  pixels,
int  pixtype
 

Draws the specified pixel array of the specified size and format onto the specified drawable using the specified graphics context at the specified position.

Note that colour conversion is currently only performed when using the GR_PF_RGB format, which is an unsigned long containing RGBX data.

Parameters:
id the ID of the drawable to draw the area onto
gc the ID of the graphics context to use when drawing the area
x the X coordinate to draw the area at relative to the drawable
y the Y coordinate to draw the area at relative to the drawable
width the width of the area
height the height of the area
pixels pointer to an array containing the pixel data
pixtype the format of the pixel data

void GrBitmap GR_DRAW_ID  id,
GR_GC_ID  gc,
GR_COORD  x,
GR_COORD  y,
GR_SIZE  width,
GR_SIZE  height,
GR_BITMAP *  imagebits
 

Draws the monochrome bitmap data provided in the imagebits argument at the specified position on the specified drawable using the specified graphics context.

Note that the bitmap data should be an array of aligned 16 bit words. The usebackground flag in the graphics context specifies whether to draw the background colour wherever a bit value is zero.

Parameters:
id the ID of the drawable to draw the bitmap onto
gc the ID of the graphics context to use when drawing the bitmap
x the X coordinate to draw the bitmap at relative to the drawable
y the Y coordinate to draw the bitmap at relative to the drawable
width the width of the bitmap
height the height of the bitmap
imagebits pointer to the bitmap data

void GrClearArea GR_WINDOW_ID  wid,
GR_COORD  x,
GR_COORD  y,
GR_SIZE  width,
GR_SIZE  height,
GR_BOOL  exposeflag
 

Clears the specified window by to its background color or pixmap.

If exposeflag is non zero, an exposure event is generated for the window after it has been cleared.

Parameters:
wid Window ID.
x X co-ordinate of rectangle to clear.
y Y co-ordinate of rectangle to clear.
width Width of rectangle to clear.
height Height of rectangle to clear.
exposeflag A flag indicating whether to also generate an exposure event.

void GrCopyArea GR_DRAW_ID  id,
GR_GC_ID  gc,
GR_COORD  x,
GR_COORD  y,
GR_SIZE  width,
GR_SIZE  height,
GR_DRAW_ID  srcid,
GR_COORD  srcx,
GR_COORD  srcy,
unsigned long  op
 

Copies the specified area of the specified size between the specified drawables at the specified positions using the specified graphics context and ROP codes.

0 is a sensible default ROP code in most cases.

Parameters:
id the ID of the drawable to copy the area to
gc the ID of the graphics context to use when copying the area
x the X coordinate to copy the area to within the destination drawable
y the Y coordinate to copy the area to within the destination drawable
width the width of the area to copy
height the height of the area to copy
srcid the ID of the drawable to copy the area from
srcx the X coordinate to copy the area from within the source drawable
srcy the Y coordinate to copy the area from within the source drawable
op the ROP codes to pass to the blitter when performing the copy

GR_GC_ID GrCopyGC GR_GC_ID  gc  ) 
 

Creates a new graphics context structure and copies the settings from an already existing graphics context.

Parameters:
gc The already existing graphics context to copy the parameters from.
Returns:
The ID of the newly created graphics context or 0 on error.

void GrDestroyGC GR_GC_ID  gc  ) 
 

Destroys a graphics context structure.

Parameters:
gc the ID of the graphics context structure to destroy

void GrDrawImageBits GR_DRAW_ID  id,
GR_GC_ID  gc,
GR_COORD  x,
GR_COORD  y,
GR_IMAGE_HDR *  pimage
 

Draws the image contained in the specified image structure onto the specified drawable at the specified coordinates using the specified graphics context.

Parameters:
id the ID of the drawable to draw the image onto
gc the ID of the graphics context to use when drawing the image
x the X coordinate to draw the image at relative to the drawable
y the Y coordinate to draw the image at relative to the drawable
pimage pointer to the image structure

void GrEllipse GR_DRAW_ID  id,
GR_GC_ID  gc,
GR_COORD  x,
GR_COORD  y,
GR_SIZE  rx,
GR_SIZE  ry
 

Draws the boundary of ellipse at the specified position using the specified dimensions and graphics context on the specified drawable.

Parameters:
id the ID of the drawable to draw the ellipse on
gc the ID of the graphics context to use when drawing the ellipse
x the X coordinate to draw the ellipse at relative to the drawable
y the Y coordinate to draw the ellipse at relative to the drawable
rx the radius of the ellipse on the X axis
ry the radius of the ellipse on the Y axis

void GrFillEllipse GR_DRAW_ID  id,
GR_GC_ID  gc,
GR_COORD  x,
GR_COORD  y,
GR_SIZE  rx,
GR_SIZE  ry
 

Draws a filled ellipse at the specified position using the specified dimensions and graphics context on the specified drawable.

Parameters:
id the ID of the drawable to draw the filled ellipse on
gc the ID of the graphics context to use when drawing the ellipse
x the X coordinate to draw the ellipse at relative to the drawable
y the Y coordinate to draw the ellipse at relative to the drawable
rx the radius of the ellipse on the X axis
ry the radius of the ellipse on the Y axis

void GrFillPoly GR_DRAW_ID  id,
GR_GC_ID  gc,
GR_COUNT  count,
GR_POINT *  pointtable
 

Draws a filled polygon on the specified drawable using the specified graphics context.

The polygon is specified by an array of point structures. The polygon is automatically closed- the last point need not be the same as the first in order for the polygon to be closed.

Parameters:
id the ID of the drawable to draw the polygon onto
gc the ID of the graphics context to use when drawing the polygon
count the number of points in the point array
pointtable pointer to an array of points describing the polygon

void GrFillRect GR_DRAW_ID  id,
GR_GC_ID  gc,
GR_COORD  x,
GR_COORD  y,
GR_SIZE  width,
GR_SIZE  height
 

Draw a filled rectangle of the specified dimensions and position on the specified drawable using the specified graphics context.

Parameters:
id the ID of the drawable to draw the rectangle on
gc the ID of the graphics context to use when drawing the rectangle
x the X coordinate of the rectangle relative to the drawable
y the Y coordinate of the rectangle relative to the drawable
width the width of the rectangle
height the height of the rectangle

void GrGetGCInfo GR_GC_ID  gc,
GR_GC_INFO gcip
 

Fills in the specified GR_GC_INFO structure with information regarding the specified graphics context.

Parameters:
gc A graphics context.
gcip Pointer to a GR_GC_INFO structure to store the result.

void GrLine GR_DRAW_ID  id,
GR_GC_ID  gc,
GR_COORD  x1,
GR_COORD  y1,
GR_COORD  x2,
GR_COORD  y2
 

Draws a line using the specified graphics context on the specified drawable from (x1, y1) to (x2, y2), with coordinates given relative to the drawable.

Parameters:
id the ID of the drawable to draw the line on
gc the ID of the graphics context to use when drawing the line
x1 the X coordinate of the start of the line relative to the drawable
y1 the Y coordinate of the start of the line relative to the drawable
x2 the X coordinate of the end of the line relative to the drawable
y2 the Y coordinate of the end of the line relative to the drawable

GR_GC_ID GrNewGC void   ) 
 

Creates a new graphics context structure.

The structure is initialised with a set of default parameters.

Returns:
The ID of the newly created graphics context or 0 on error.

void GrPoint GR_DRAW_ID  id,
GR_GC_ID  gc,
GR_COORD  x,
GR_COORD  y
 

Draws a point using the specified graphics context at the specified position on the specified drawable.

Parameters:
id the ID of the drawable to draw a point on
gc the ID of the graphics context to use when drawing the point
x the X coordinate to draw the point at relative to the drawable
y the Y coordinate to draw the point at relative to the drawable

void GrPoints GR_DRAW_ID  id,
GR_GC_ID  gc,
GR_COUNT  count,
GR_POINT *  pointtable
 

Draws a set of points using the specified graphics context at the positions specified by the point table on the specified drawable.

Parameters:
id the ID of the drawable to draw a point on
gc the ID of the graphics context to use when drawing the point
count the number of points in the point table
pointtable pointer to a GR_POINT array which lists the points to draw

void GrPoly GR_DRAW_ID  id,
GR_GC_ID  gc,
GR_COUNT  count,
GR_POINT *  pointtable
 

Draws an unfilled polygon on the specified drawable using the specified graphics context.

The polygon is specified by an array of point structures. The polygon is not automatically closed- if a closed polygon is desired, the last point must be the same as the first.

Parameters:
id the ID of the drawable to draw the polygon onto
gc the ID of the graphics context to use when drawing the polygon
count the number of points in the point array
pointtable pointer to an array of points describing the polygon

void GrReadArea GR_DRAW_ID  id,
GR_COORD  x,
GR_COORD  y,
GR_SIZE  width,
GR_SIZE  height,
GR_PIXELVAL *  pixels
 

Reads the pixel data of the specified size from the specified position on the specified drawable into the specified pixel array.

If the drawable is a window, the data returned will be the pixel values from the relevant position on the screen regardless of whether the window is obscured by other windows. If the window is unmapped, or partially or fully outside a window boundary, black pixel values will be returned.

Parameters:
id the ID of the drawable to read an area from
x the X coordinate to read the area from relative to the drawable
y the Y coordinate to read the area from relative to the drawable
width the width of the area to read
height the height of the area to read
pixels pointer to an area of memory to place the pixel data in

void GrRect GR_DRAW_ID  id,
GR_GC_ID  gc,
GR_COORD  x,
GR_COORD  y,
GR_SIZE  width,
GR_SIZE  height
 

Draw the boundary of a rectangle of the specified dimensions and position on the specified drawable using the specified graphics context.

Parameters:
id the ID of the drawable to draw the rectangle on
gc the ID of the graphics context to use when drawing the rectangle
x the X coordinate of the rectangle relative to the drawable
y the Y coordinate of the rectangle relative to the drawable
width the width of the rectangle
height the height of the rectangle

void GrSetGCBackground GR_GC_ID  gc,
GR_COLOR  background
 

Changes the background colour of the specified graphics context to the specified RGB colour.

Parameters:
gc the ID of the graphics context to set the background colour of
background the RGB colour to use as the new background colour

void GrSetGCBackgroundPixelVal GR_GC_ID  gc,
GR_PIXELVAL  background
 

Changes the background colour of the specified graphics context to the specified hardware pixel value.

Parameters:
gc the ID of the graphics context to set the background colour of
background the GR_PIXELVAL (i.e. hardware pixel value) to use as the new background colour

void GrSetGCClipOrigin GR_GC_ID  gc,
int  xoff,
int  yoff
 

Sets the X,Y origin of the user clip region in the specified graphics context.

Parameters:
gc The ID of the graphics context with user clip region.
xoff New X offset of user clip region.
yoff New Y offset of user clip region.

void GrSetGCDash GR_GC_ID  gc,
char *  dashes,
int  count
 

FIXME.

Parameters:
gc Graphics context ID.
dashes FIXME
count FIXME

Todo:
FIXME document this

void GrSetGCFillMode GR_GC_ID  gc,
int  fillmode
 

FIXME.

Parameters:
gc FIXME
fillmode FIXME

Todo:
FIXME document this

void GrSetGCForeground GR_GC_ID  gc,
GR_COLOR  foreground
 

Changes the foreground colour of the specified graphics context to the specified RGB colour.

Parameters:
gc the ID of the graphics context to set the foreground colour of
foreground the RGB colour to use as the new foreground colour

void GrSetGCForegroundPixelVal GR_GC_ID  gc,
GR_PIXELVAL  foreground
 

Changes the foreground colour of the specified graphics context to the specified hardware pixel value.

Parameters:
gc The ID of the graphics context to set the foreground colour of.
foreground The GR_PIXELVAL (i.e. hardware pixel value) to use as the new foreground colour.

void GrSetGCGraphicsExposure GR_GC_ID  gc,
GR_BOOL  exposure
 

Controls if GR_EVENT_TYPE_EXPOSURE events are sent as a result of GrCopyArea using the specified graphics context.

Parameters:
gc The ID of the graphics context
exposure TRUE to send events, FALSE otherwise.

void GrSetGCLineAttributes GR_GC_ID  gc,
int  linestyle
 

Changes the line style to either SOLID or ON OFF DASHED.

Parameters:
gc the ID of the graphics context to set the drawing mode of
linestyle The new style of the line

void GrSetGCMode GR_GC_ID  gc,
int  mode
 

Changes the drawing mode (SET, XOR, OR, AND, etc.) of the specified graphics context to the specified mode.

Parameters:
gc the ID of the graphics context to set the drawing mode of
mode the new drawing mode

void GrSetGCStipple GR_GC_ID  gc,
GR_BITMAP *  bitmap,
int  width,
int  height
 

FIXME.

Parameters:
gc FIXME
bitmap FIXME
width FIXME
height FIXME

Todo:
FIXME document this

void GrSetGCTile GR_GC_ID  gc,
GR_WINDOW_ID  pixmap,
int  width,
int  height
 

FIXME.

Parameters:
gc FIXME
pixmap FIXME
width FIXME
height FIXME

Todo:
FIXME document this

void GrSetGCTSOffset GR_GC_ID  gc,
int  xoff,
int  yoff
 

FIXME.

Parameters:
gc FIXME
xoff FIXME
yoff FIXME

Todo:
FIXME document this

void GrSetGCUseBackground GR_GC_ID  gc,
GR_BOOL  flag
 

Sets the flag which chooses whether or not the background colour is used when drawing bitmaps and text using the specified graphics context to the specified value.

Parameters:
gc the ID of the graphics context to change the "use background" flag of
flag flag specifying whether to use the background colour or not

void GrStretchArea GR_DRAW_ID  dstid,
GR_GC_ID  gc,
GR_COORD  dx1,
GR_COORD  dy1,
GR_COORD  dx2,
GR_COORD  dy2,
GR_DRAW_ID  srcid,
GR_COORD  sx1,
GR_COORD  sy1,
GR_COORD  sx2,
GR_COORD  sy2,
unsigned long  op
 

Copies a region from one drawable to another.

Can stretch and/or flip the image. The stretch/flip maps (sx1,sy1) in the source to (dx1,dy1) in the destination, and similarly (sx2,sy2) in the source maps to (dx2,dy2) in the destination. Both horizontal and vertical flips are supported.

Note that the bottom and right rows of pixels are excluded - i.e. a target of (0,0)-(2,2) will not draw pixels with y=2 or x=2.

0 is a sensible default ROP code in most cases.

Parameters:
dstid the ID of the drawable to copy the area to
gc the ID of the graphics context to use when copying the area
dx1 the X coordinate of the first point describing the destination area
dy1 the Y coordinate of the first point describing the destination area
dx2 the X coordinate of the second point describing the destination area
dy2 the Y coordinate of the second point describing the destination area
srcid the ID of the drawable to copy the area from
sx1 the X coordinate of the first point describing the source area
sy1 the Y coordinate of the first point describing the source area
sx2 the X coordinate of the second point describing the source area
sy2 the Y coordinate of the second point describing the source area
op the ROP codes to pass to the blitter when performing the copy


Generated on Sun May 18 21:03:06 2003 for Microwindows Nano-X API by doxygen1.3