void GrFillEllipse( GStateHandle gstate, /* GState to draw to */ sword left, /* Bounds of bounding rectangle */ sword top, sword right, sword bottom);
Draw a filled ellipse. The ellipse's dimensions are defined by its bounding box.
Include: graphics.h
void GrFillPath( GStateHandle gstate, /* GState to draw to */ RegionFillRule rule); /* ODD_EVEN or WINDING */
Fill an area whose outline is defined by the GState's path.
Include: graphics.h
void GrFillPolygon( GStateHandle gstate, /* GState to draw to */ RegionFillRule windingRule, /* ODD_EVEN or WINDING */ const Point * points, /* array of points in polygon */ word numPoints); /* number of points in array */
This routine draws a filled polygon. The polygon is defined by the passed array of points.
Include: graphics.h
void GrFillRect( GStateHandle gstate, /* GState to draw to */ sword left, /* bounds of rectangle */ sword top, sword right, sword bottom);
Draw a filled rectangle.
Include: graphics.h
void GrFillRectTo( GStateHandle gstate, /* GState to draw to */ sword x, /* opposite corner of rectangle */ sword y);
Draw a filled rectangle. The current position will define one of the corners.
Include: graphics.h
void GrFillRoundRect( GStateHandle gstate, /* GState to draw to */ sword left, /* bounds of rectangle */ sword top, sword right, sword bottom word cornerRadius); /* radius of corner rounding */
Draw a filled rounded rectangle.
Include: graphics.h
void GrFillRoundRectTo( GStateHandle gstate, /* GState to draw to */ sword x, /* opposite corner of rectangle */ sword y word cornerRadius); /* radius of corner roundings */
Draw a filled rounded rectangle, using the current position to define one corner of the bounding rectangle.
Include: graphics.h
Boolean GrFindNearestPointsize( /* If false, then FontID invalid */ FontID id, /* fond ID */ dword sizeSHL16, /* point size */ TextStyle styles, /* style */ TextStyle * styleFound, /* buffer for style */ dword * sizeFoundSHL16); /* buffer for size */
Find the nearest available point size for a font. If the font passed in
id
exists, then
styleFound
will point to the styles available and
sizeFoundSHL16
will point to the nearest point size to that passed. If the font is not found, the return valued will be
true
.
Include: font.h
dword GrFontMetrics( GStateHandle gstate, /* subject GState */ GFM_info info); /* Type of information to return */
Get metrics information about a font. It returns the requested information based on the
info
parameter.
Structures:
typedef enum /* word */ { GFMI_HEIGHT, /* return = val << 16 */ GFMI_MEAN, /* return = val << 16 */ GFMI_DESCENT, /* return = val << 16 */ GFMI_BASELINE, /* return = val << 16 */ GFMI_LEADING, /* return = val << 16 */ GFMI_AVERAGE_WIDTH, /* return = val << 16 */ GFMI_ASCENT, /* return = val << 16 */ GFMI_MAX_WIDTH, /* return = val << 16 */ GFMI_MAX_ADJUSTED_HEIGHT, /* return = val << 16 */ GFMI_UNDER_POS, /* return = val << 16 */ GFMI_UNDER_THICKNESS, /* return = val << 16 */ GFMI_ABOVE_BOX, /* return = val << 16 */ GFMI_ACCENT, /* return = val << 16 */ GFMI_MANUFACTURER, /* return = val */ GFMI_KERN_COUNT, /* return = Char */ GFMI_FIRST_CHAR, /* return = Char */ GFMI_LAST_CHAR, /* return = FontMaker */ GFMI_DEFAULT_CHAR, /* return = Char */ GFMI_STRIKE_POS, /* return = Char */ GFMI_BELOW_BOX, /* return = Char */ GFMI_HEIGHT_ROUNDED /* return = Char */ GFMI_DESCENT_ROUNDED, /* return = Char */ GFMI_BASELINE_ROUNDED, /* return = Char */ GFMI_LEADING_ROUNDED, /* return = Char */ GFMI_AVERAGE_WIDTH_ROUNDED, /* return = Char */ GFMI_ASCENT_ROUNDED, /* return = Char */ GFMI_MAX_WIDTH_ROUNDED, /* return = Char */ GFMI_MAX_ADJUSTED_HEIGHT_ROUNDED, /* ret = Char */ GFMI_UNDER_POS_ROUNDED, /* return = Char */ GFMI_UNDER_THICKNESS_ROUNDED, /* return = Char */ GFMI_ABOVE_BOX_ROUNDED, /* return = Char */ GFMI_ACCENT_ROUNDED=, /* return = Char */ GFMI_STRIKE_POS_ROUNDED, /* return = Char */ GFMI_BELOW_BOX_ROUNDED /* return = Char */ } GFM_info;
Include: font.h
RGBColorAsDWord GrGetAreaColor( GStateHandle gstate); /* GState of which to get color */
Get the color which is being used to fill areas.
Include: graphics.h
ColorMapMode GrGetAreaColorMap( GStateHandle gstate); /* GState of which to get area color map */
Get the mapping mode used for filling areas with unavailable colors.
Include: graphics.h
SysDrawMask GrGetAreaMask( GStateHandle gstate, /* GState of which to get mask */ DrawMask * dm); /* buffer for returned mask */
Get the draw mask used when filling areas. The dm argument should point to a buffer capable of holding at least eight bytes to get the bit-pattern of the mask; otherwise dm should be NULL. The returned buffer is the 8x8 bit pattern: each byte represents a row of the pattern, and the bytes are ordered from top row to bottom.
Include: graphics.h
GraphicPattern GrGetAreaPattern( GStateHandle gstate, /* GState of area pattern */ const MemHandle * customPattern, /* pointer to handle of block for * returned custom pattern */
word * customSize); /* pointer to size of returned * buffer */
Get the area pattern used when filling areas.
Include: graphics.h
MemHandle GrGetBitmap( GStateHandle gstate, /* GState containing bitmap */ sword x, /* bitmap origin */ sword y, word width, /* bitmap width and height */ word height, XYSize * sizeCopied); /* buffer for returned size */
Dump an area of the display to a bitmap. The handle of a block containing the bitmap is returned; the
sizeCopied
pointer points to the actual size of the bitmap successfully copied.
Include: graphics.h
BitmapMode GrGetBitmapMode( GStateHandle gstate); /* GState containing bitmap */
Get mode bits for an editable bitmap.
Include: graphics.h
XYValueAsDWord GrGetBitmapRes( const Bitmap * bm); /* pointer to the bitmap */
Get the resolution of a bitmap.
Include: graphics.h
XYValueAsDWord GrGetBitmapSize( const Bitmap * bm); /* pointer to the bitmap */
Get the dimensions, in points, of a bitmap.
Include: graphics.h
MemHandle GrGetClipRegion( GStateHandle gstate, /* subject GState */ RegionFillRule rule); /* ODD_EVEN or WINDING */
Get the current clip region. A null handle (zero) will be returned if no clip paths are se for the GState.
Include: graphics.h
XYValueAsDWord GrGetCurPos( GStateHandle gstate); /* subject GState */
Get the current pen position.
Include: graphics.h
void GrGetCurPosWWFixed( GStateHandle gstate, /* subject GState */ PointWWFixed *cp); /* buffer in which to return cur. pos. */
Get the current pen position.
Include: graphics.h
FontID GrGetDefFontID( dword * sizeSHL16); /* pointer to buffer for returned size */
Get the system default font (including size).
Include: font.h
GStateHandle GrGetExclusive( GeodeHandle videoDriver);
Use this routine to find out which GState, if any, has grabbed the video exclusive.
Include: graphics.h
FontID GrGetFont( GStateHandle gstate, /* subject GState */ WWFixedAsDWord * pointSize); /* pointer to buffer for * returned point size */
Get the passed GState's current font, including point size.
Include: graphics.h
FontID GrGetFontName( FontID id, /* ID of font */ const char * name); /* buffer for returned name string */
Get the string name of a font. Note that if the returned
FontID
is zero, then the font was not found. The name string buffer should be a least FID_NAME_LEN in size.
Include: font.h
FontWeight GrGetFontWeight( GStateHandle gstate); /* GState containing the font */
Get the current font weight set for the passed GState.
Include: font.h
FontWidth GrGetFontWidth( GStateHandle gstate); /* GState containing the font */
Get the current font width set for the passed GState.
Include: font.h
void GrGetGStringBounds( GStringHandle source, /* GString to be checked */ GStateHandle dest, /* handle of GState to use */ GSControl flags, /* GSControl flags */ Rectangle * bounds); /* returned bounds of GState */
This routine returns the coordinate bounds of the
source
GString drawn at the current position in the GString. The
dest
GState will be used if passed; to have no GState restrictions, pass a null handle. The bounds of the smallest containing rectangle will be returned in the structure pointed to by
bounds
.
Include: gstring.h
void GrGetGStringBoundsDWord( Handle gstring, /* GString to be checked */ GStateHandle gstate, /* handle of GState to use */ GSControl flags, /* GSControl flags */ RectDWord * bounds); /* returned bounds of GState */
This routine behaves as
GrGetGStringBounds()
, but has been alterred to work with 32-bit graphics spaces.
This routine returns the coordinate bounds of aGString drawn at the current position in the GString. The
gstate
GState will be used if passed; to have no GState restrictions, pass a null handle. The bounds of the smallest containing rectangle will be returned in the structure pointed to by
bounds
.
Include: gstring.h
GStringElement GrGetGStringElement( GStateHandle gstate, /* handle of GString's GState */ void * buffer, /* pointer to return buffer */ word bufSize, /* size of return buffer */ word * elementSize, /* size of GString element */ void ** pointerAfterData); /* pointer to pointer to * next element in GString */
Extract the next element from a graphics string. The opcode is returned explicitly. The routine's data can be returned in a buffer.
Include: gstring.h
XYValueAsDWord GrGetHugeBitmapSize( VMFileHandle vmFile, VMBlockHandle vmBlk);
Returns the dimensions (horizontal and vertical) of the passed huge bitmap, as referenced by a VM block and file.
Include: graphics.h
void GrGetInfo( GStateHandle gstate, /* GState to get information about */ GrInfoTypes type, /* type of information to get */ void * data); /* buffer for returned information */
Get the private data, window handle, or pen position associated with the GState.
Structures:
typedef enum { GIT_PRIVATE_DATA, GIT_WINDOW, GIT_PEN_POS } GrInfoType
Include: graphics.h
RGBColorAsDWord GrGetLineColor( GStateHandle gstate); /* subject GState */
Get the color used when drawing lines.
Include: graphics.h
ColorMapMode GrGetLineColorMap( GStateHandle gstate); /* subject GState */
Get the mode used when drawing lines in an unavailable color.
Include: graphics.h
LineEnd GrGetLineEnd( GStateHandle gstate); /* subject GState */
Get the end used when drawing lines.
Include: graphics.h
LineJoin GrGetLineJoin( GStateHandle gstate); /* subject GState */
Get the join used when drawing corners.
Include: graphics.h
SysDrawMask GrGetLineMask( GStateHandle gstate, /* subject GState */ DrawMask * dm); /* buffer for returned custom mask */
Get the drawing mask used when drawing lines. The dm argument should point to a buffer capable of holding at least eight bytes to get the bit-pattern of the mask; otherwise dm should be NULL. The returned buffer is the 8x8 bit pattern: each byte represents a row of the pattern, and the bytes are ordered from top row to bottom.
Include: graphics.h
LineStyle GrGetLineStyle( GStateHandle gstate); /* subject GState */
Get the style, or "dottedness," used when drawing lines.
Include: graphics.h
WWFixedAsDWord GrGetLineWidth( GStateHandle gstate); /* subject GState */
Get the current line width.
Include: graphics.h
void GrGetMaskBounds( GStateHandle gstate, /* subject GState */ Rectangle * bounds); /* buffer for returned bounds */
Get the 16-bit bounds of the current clip rectangle.
Include: graphics.h
void GrGetMaskBoundsDWord( GStateHandle gstate, /* subject GState */ RectDWord * bounds); /* buffer for returned bounds */
Get the 16-bit bounds of the current clip rectangle, accurate to a fraction of a point.
Include: graphics.h
WWFixedAsDWord GrGetMiterLimit( GStateHandle gstate); /* subject GState */
Get the miter limit to use when drawing mitered corners.
Include: graphics.h
MixMode GrGetMixMode( GStateHandle gstate); /* subject GState */
Get the current mixing mode.
Include: graphics.h
MemHandle GrGetPalette( GStateHandle gstate, /* subject GState */ GetPalType flag, /* GPT_ACTIVE, GPT_CUSTOM, or * GPT_DEFAULT */
word * numEntries); /* number of entries in block */
Return all or part of the window's color lookup table. This routine returns the handle of a block containing all the returned palette entries.
Include: graphics.h
MemHandle GrGetPath( GStateHandle gstate, /* subject GState */ GetPathType ptype); /* Which path to retrieve */
Returns handle to block containing path data. Either the current path, the clipping path, or the window clipping path may be retrieved.
Include: graphics.h
Boolean GrGetPathBounds( GStateHandle gstate, /* subject GState */ GetPathType ptype, Rectangle * bounds); /* buffer for returned bounds */
Returns the rectangular bounds that encompass the current path as it would be filled. A
true
return value indicates an error occurred or there was no path for the GState.
Include: graphics.h
Boolean GrGetPathBoundsDWord( GStateHandle gstate, /* subject GState */ GetPathType ptype, RectDWord * bounds); /* buffer for returned bounds */
Returns the rectangular bounds that encompass the current path as it would be filled. A
true
return value indicates an error occurred or there was no path for the GState.
Include: graphics.h
MemHandle GrGetPathPoints( GStateHandle gstate, /* subject GState */ word resolution); /* dots per inch */
Returns a series of points that fall along the current path. The returned points are in document coordinates.
Include: graphics.h
MemHandle GrGetPathRegion( GStateHandle gstate, /* subject GState */ RegionFillRule rule); /* ODD_EVEN or WINDING */
Get the region enclosed by a path.
Include: graphics.h
RGBColorAsDWord GrGetPoint( GStateHandle gstate, /* subject GState */ sword x, /* coordinates of pixel */ sword y);
Get the color of the pixel corresponding to the specified coordinates.
Include: graphics.h
word GrGetPtrRegBounds( /* Returns size of Region data struct. */ const Region * reg, /* pointer to region */ Rectangle * bounds); /* returned bounds of region */
Get the bounds of the passed region.
Include: graphics.h
ScriptAttrAsWord GrGetSubscriptAttr( GStateHandle gstate); /* subject GState */
Get the GState's subscript drawing attributes. The high byte of the return value is the percentage of the font size for the subscript; the low byte is the percentage of the font size from the top at which the character gets drawn.
Include: font.h
ScriptAttrAsWord GrGetSuperscriptAttr( GStateHandle gstate); /* subject GState */
Get the GState's superscript drawing attributes. The high byte of the return value is the percentage of the font size for the superscript; the low byte is the percentage of the font size from the bottom at which the character gets drawn.
Include: font.h
Boolean GrGetTextBounds( GStateHandle gstate, /* subject GState */ const char * str, /* text string */ word xpos, /* position where text would be drawn */ word ypos, word count, /* max number of characters to check */ Rectangle * bounds); /* returned bounding rectangle */
Get the bounds required to draw the passed text. If the passed
count
argument is zero, the string is assumed to be null-terminated.
Include: graphics.h
RGBColorAsDWord GrGetTextColor( GStateHandle gstate); /* subject GState */
Get the color used when drawing text.
Include: graphics.h
ColorMapMode GrGetTextColorMap( GStateHandle gstate); /* subject GState */
Get the mode used when drawing text in an unavailable color.
Include: graphics.h
SystemDrawMask GrGetTextMask( GStateHandle gstate, /* subject GState */ DrawMask * dm); /* returned custom mask, if any */
Get the draw mask used when drawing text.The dm argument should point to a buffer capable of holding at least eight bytes to get the bit-pattern of the mask; otherwise dm should be NULL. The returned buffer is the 8x8 bit pattern: each byte represents a row of the pattern, and the bytes are ordered from top row to bottom.
Include: graphics.h
TextMode GrGetTextMode( GStateHandle gstate); /* subject GState */
Get the text mode, including information about the vertical offset used when drawing text.
Include: graphics.h
GraphicPattern GrGetTextPattern( GStateHandle gstate, /* subject GState */ const MemHandle * customPattern, /* pointer to returned handle * of block containing the * returned pattern */
word * customSize); /* size of returned block */
Get the graphics pattern used when drawing text.
Include: graphics.h
WWFixedAsDWord GrGetTextSpacePad( GStateHandle gstate); /* subject GState */
Get the space pad used when drawing strings of text.
Include: graphics.h
TextStyle GrGetTextStyle( GStateHandle gstate); /* subject GState */
Get the style used when drawing text.
Include: graphics.h
word GrGetTrackKern( GStateHandle gstate); /* subject GState */
Get the track kerning used when drawing strings of text.
Include: graphics.h
void GrGetTransform( GStateHandle gstate, /* subject GState */ TransMatrix * tm); /* pointer to returned TransMatrix */
Get the current coordinate transformation, expressed as a matrix.
Include: graphics.h
void GrGetWinBounds( GStateHandle gstate, /* subject GState */ Rectangle * bounds); /* returned window bounds */
Get the bounds of the GState's associated window.
Include: graphics.h
void GrGetWinBoundsDWord( GStateHandle gstate, /* subject GState */ RectDWord * bounds); /* returned window bounds */
Get the bounds of the GState's associated window, accurate to a fraction of a point.
Include: graphics.h
WindowHandle GrGetWinHandle( GStateHandle gstate); /* subject GState */
Get the handle of the GState's associated window.
Include: graphics.h
GStateHandle GrGrabExclusive( GeodeHandle videoDriver, /* NULL for default */ GStateHandle gstate); /* subject GState */
Start drawing exclusively to a video driver.
Include: graphics.h
void GrInitDefaultTransform( GStateHandle gstate); /* subject GState */
Initialize the GState's default transformation to hold the value of the current transformation.
Include: graphics.h
void GrInvalRect( GStateHandle gstate, /* subject GState */ sword left, /* bounds to be invalidated */ sword top, sword right, sword bottom);
Invalidate the passed rectangular area. This area will be redrawn.
Include: graphics.h
void GrInvalRectDWord( GStateHandle gstate, /* subject GState */ const RectDWord * bounds); /* bounds to be invalidated */
Invalidate the passed rectangular area. This area will be redrawn.
Include: graphics.h
void GrLabel( GStringHandle gstate, /* subject GState */ word label); /* label to write to GString */
Write the passed label into the passed GString.
Include: gstring.h
GStringHandle GrLoadGString( Handle han, /* handle of GString source */ GStringType hanType, /* handle type */ word vmBlock); /* if VM file, handle of VM block */
Load a graphics string from a file. Used with stream, VM, and pointer addressed GStrings.
When done with the GString, you may free it via
GrDestroyGString()
.
Include: gstring.h
RGBColorAsDWord GrMapColorIndex( GStateHandle gstate, /* GState to use for mapping */ Color c); /* source color to be mapped */
Map a color index to its RGB equivalent using the color mapping scheme of the passed GState.
Include: graphics.h
RGBColorAsDWord GrMapColorRGB( GStateHandle gstate, /* GState to use for mapping */ word red, /* RGB values to map */ word green, word blue);
Map an RGB color to an index.
Include: graphics.h
void GrMoveReg( Region * reg, /* pointer to region */ sword xOffset, /* amount to shift horizontally */ sword yOffset); /* amount to shift vertically */
Moves a region a given amount. Note that this operation affects only the region's data structure. The region must be redrawn or used in some other way for the changes to have any visible effect.
Include: graphics.h
void GrMoveTo( GStateHandle gstate, /* subject GState */ sword x, /* new absolute pen position */ sword y);
Change the pen position.
Include: graphics.h
void GrMoveToWWFixed( GStateHandle gstate, WWFixedAsDWord x, WWFixedAsDWord y);
This routine changes the pen position very precisely.
void GrMulDWFixed( const DWFixed * i, /* first number */ const DWFixed * j, /* second number */ DWFixed * result); /* pointer to returned result */
Multiply two fixed point numbers.
Include: graphics.h
WWFixedAsDWord GrMulWWFixed( WWFixedAsDWord i, /* first number */ WWFixedAsDWord j); /* second number */
Multiply two fixed point numbers.
Include: graphics.h
void GrNewPage( GStateHandle gstate, PageEndCommand pageEndCommand);
Begin drawing a new page. Normally used when printing documents.
Include: graphics.h
void GrNullOp( GStateHandle gstate); /* subject GState */
Write a null operation element to a GString.
Include: graphics.h
void GrParseGString( GStateHandle gstate, GStateHandle gstringToDraw, GSControl flags, Boolean (*callback) /* TRUE to stop */ (void *element));
This routine traverses a GString, calling a callback function on each GStringElement encountered.
Include: gstring.h
WWFixedAsDWord GrQuickArcSine( WWFixedAsDWord deltaYDivDistance, /* delta y / distance */ word origDeltaX); /* original delta x */
Compute a fixed point arcsine. Angles are given in degrees counterclockwise of the positive x axis.
Include: graphics.h
WWFixedAsDWord GrQuickCosine( WWFixedAsDWord angle); /* angle to cosine */
Compute a fixed point cosine. Angles are given in degrees counterclockwise of the positive x axis.
Include: graphics.h
WWFixedAsDWord GrQuickSine( WWFixedAsDWord angle); /* angle to sine */
Compute a fixed point sine. Angles are given in degrees counterclockwise of the positive x axis.
Include: graphics.h
WWFixedAsDWord GrQuickTangent( WWFixedAsDWord angle); /* angle to tangent */
Compute a fixed point tangent. Angles are given in degrees counterclockwise of the positive x axis.
Include: graphics.h
void GrReleaseExclusive( /* TRUE if system had to force a redraw */ GeodeHandle videoDriver, /* handle of video driver */ GStateHandle gstate, /* GState that was drawing */ Rectangle *bounds); /* Bounds of aborted drawings */
Stop drawing exclusively to a video driver.
Include: graphics.h
void GrRelMoveTo( GStateHandle gstate, /* subject GState */ WWFixedAsDWord x, /* offsets to new pen position */ WWFixedAsDWord y);
Change the pen position to coordinate expressed relative to the current position.
Include: graphics.h
void GrRestoreState( GStateHandle gstate); /* subject GState */
Restore the values of a saved GState.
Include: graphics.h
void GrSaveState( GStateHandle gstate); /* subject GState */
Save the values of a GState, so that they may be restored by
GrRestoreState()
.
Include: graphics.h
void GrSDivDWFByWWF( const DWFixed * dividend, const WWFixed * divisor, DWFixed * quotient) /* returned value */
Divide two fixed point numbers.
Include: graphics.h
WWFixedAsDWord GrSDivWWFixed( WWFixedAsDWord dividend, WWFixedAsDWord divisor)
Divide two fixed point numbers.
Include: graphics.h
void GrSetAreaAttr( GStateHandle gstate, /* subject GState */ const AreaAttr * aa); /* AreaAttr structure */
Set all of the attributes used when filling areas.
Include: graphics.h
void GrSetAreaColor( GStateHandle gstate, /* GState to set color for */ ColorFlag flag, /* flag of how to set color */ word redOrIndex, /* color index or red RGB value */ word green, /* green RGB value or zero */ word blue); /* blue RGB value or zero */
Set the color to use when filling areas. The flag parameter may be CF_RGB (to set RGB values), CF_INDEX (to set a palette index), CF_GRAY, or CF_SAME.
Include: graphics.h
void GrSetAreaColorMap( GStateHandle gstate, /* subject GState */ ColorMapMode colorMap); /* color mapping mode */
Set mode to use when trying to fill an area with an unavailable color.
Include: graphics.h
void GrSetAreaMaskCustom( GStateHandle gstate, /* subject GState */ const DrawMask * dm); /* pointer to new custom mask */
Set the drawing mask to use when filling areas.
Include: graphics.h
void GrSetAreaMaskSys( GStateHandle gstate, /* subject GState */ SystemDrawMask sysDM); /* new system area mask */
Set the drawing mask to use when filling areas.
Include: graphics.h
void GrSetAreaPattern( GStateHandle gstate, /* subject GState */ GraphicPattern pattern); /* new pattern */
Set the graphics pattern to use when filling areas.
Include: graphics.h
void GrSetBitmapMode( GStateHandle gstate, /* subject GState */ word flags, /* BM_EDIT_MASK or BM_CLUSTERED_DITHER */ MemHandle colorCorr); /* handle of ColorTransfer */
Set the bitmap editing mode. This allows the editing of a bitmap's mask, or turning on clustered dithering.
Include: graphics.h
Boolean GrSetBitmapRes( GStateHandle gstate, /* subject GState */ word xRes, /* new resolutions */ word yRes);
Set a complex bitmap's resolution.
Include: graphics.h
void GrSetClipPath( GStateHandle gstate, /* subject GState */ PathCombineType params, /* how paths should be combined */ RegionFillRule rule); /* ODD_EVEN or WINDING */
Restrict the clipping region by intersecting it with the passed path.
Include: graphics.h
void GrSetClipRect( GStateHandle gstate, /* subject GState */ PathCombineType flags, /* how paths should be combined */ sword left, /* bounds of clipping rectangle */ sword top, sword right, sword bottom);
Restrict the clipping region by intersecting it with the passed rectangle.
Include: graphics.h
void GrSetCustomAreaPattern( GStateHandle gstate, /* subject GState */ GraphicPattern pattern, /* new area pattern */ const void * patternData, /* pointer to pattern data */ word patternSize); /* size of pattern data buffer */
Set the graphics pattern to use when filling areas.
Include: graphics.h
void GrSetCustomTextPattern( GStateHandle gstate, /* subject GState */ GraphicPattern pattern, /* new pattern */ const void * patternData ); /* pointer to pattern data */
Set the graphic pattern used when drawing text.
Include: graphics.h
void GrSetDefaultTransform( GStateHandle gstate); /* subject GState */
Replace the current coordinate transformation with the default transformation.
Include: graphics.h
void GrSetFont( GStateHandle gstate, /* subject GState */ FontID id, /* new font ID */ WWFixedAsDWord pointSize); /* new point size */
Set the font to use when drawing text.
Include: graphics.h
void GrSetFontWeight( GStateHandle gstate, /* subject GState */ FontWeight weight); /* new font weight */
Set the font weight to use when drawing text.
Include: font.h
void GrSetFontWidth( GStateHandle gstate, /* subject GState */ FontWidth width); /* new font width */
Set the font width to use when drawing text.
Include: font.h
void GrSetGStringBounds( Handle gstate, /* GState or GString handle */ sword left, /* new bounds of GString */ sword top, sword right, sword bottom);
Optimization routine which allows you to set bounds values for a GString. This bounds information will be returned by
GrGetGStringBounds()
whenever that routine is called upon the affected GString.
Include: graphics.h
void GrSetGStringPos( GStateHandle gstate, /* subject GState */ GStringSetPosType type, /* how to set position */ word skip); /* number of elements to skip */
Set a graphics strings' "playing position." Using this routine, it is possible to draw only selected elements of a GString.
Structures:
typedef ByteEnum GStringSetPosType; /* GSSPT_SKIP, GSSPT_RELATIVE, GSSPT_BEGINNING, GSSPT_END */
Include: gstring.h
void GrSetLineAttr( GStateHandle gstate, /* subject GState */ const LineAttr * la); /* new line attributes */
Set all attributes to use when drawing lines and corners.
Include: graphics.h
void GrSetLineColor( GStateHandle gstate, /* subject GState */ ColorFlag flag, /* color flag */ word redOrIndex, /* new index or red RGB value */ word green, /* new green RGB value or zero */ word blue); /* new blue RGB value or zero */
Set the color to use when drawing lines.
Include: graphics.h
void GrSetLineColorMap( GStateHandle gstate, /* subject GState */ ColorMapMode colorMap); /* new color map mode for lines */
Set the mode to use when trying to draw lines in an unavailable color.
Include: graphics.h
void GrSetLineEnd( GStateHandle gstate, /* subject GState */ LineEnd end); /* new line end specification */
Set the end to use when drawing lines.
Include: graphics.h
void GrSetLineJoin( GStateHandle gstate, /* subject GState */ LineJoin join); /* new line join specification */
Set the line join to use when drawing corners.
Include: graphics.h
void GrSetLineMaskCustom( GStateHandle gstate, /* subject GState */ const DrawMask * dm); /* new line draw mask */
Set the drawing mask used when drawing lines.
Include: graphics.h
void GrSetLineMaskSys( GStateHandle gstate, /* subject GState */ SystemDrawMask sysDM); /* the new system line mask */
Set the drawing mask used when drawing lines.
Include: graphics.h
void GrSetLineStyle( GStateHandle gstate, /* subject GState */ LineStyle style, /* new line style */ word skipDistance, /* skip distance to first pair */ const DashPairArray * dpa, /* dash definition */ word numPairs); /* number of pairs */
Set the style, or "dottedness," to use when drawing lines.
Include: graphics.h
void GrSetLineWidth( GStateHandle gstate, /* subject GState */ WWFixedAsDWord width); /* new line width */
Set the line width to use when drawing lines.
Include: graphics.h
void GrSetMiterLimit( GStateHandle gstate, /* subject GState */ WWFixedAsDWord limit); /* new miter limit */
Set the miter limit to use when drawing mitered corners.
Include: graphics.h
void GrSetMixMode( GStateHandle gstate, /* subject GState */ MixMode mode); /* new mix mode */
Set the GState's mix mode, used to determine what happens when something is drawn on top of an existing drawing.
Include: graphics.h
void GrSetNullTransform( GStateHandle gstate); /* subject GState */
Clear the coordinate transformation. Most applications will actually want to replace the coordinate transformation with the default transformation using
GrSetDefaultTransform()
.
Include: graphics.h
void GrSetPalette( GStateHandle gstate, /* subject GState */ SetPalType type, /* SPT_DEFAULT or SPT_CUSTOM */ const RGBValue *buffer, /* array of palette entries */ word index, /* First element to change */ word numEntries); /* number of entries in array */
Set one or more entries in a palette, a window's color lookup table.
Include: graphics.h
void GrSetPaletteEntry( GStateHandle gstate, /* subject GState */ word index, /* index in palette to set */ word red, /* new RGB color values for entry */ word green, word blue);
Set one entry in a palette, a GState's color lookup table.
Include: graphics.h
void GrSetPrivateData( GStateHandle gstate, /* subject GState */ word dataAX, /* data to set */ word dataBX, word dataCX, word dataDX);
Set the private data for a GState.
Include: graphics.h
void GrSetStrokePath( GStateHandle gstate); /* subject GState */
Replace a GState's path with the path resulting from stroking the original path. Note that this stroked path may be drawn, but may not be used for clipping.
Include: graphics.h
void GrSetSubscriptAttr( GStateHandle gstate, /* subject GState */ ScriptAttrAsWord attrs); /* new subscript percentages */
Get the attributes used when drawing subscript characters.
Include: font.h
void GrSetSuperscriptAttr( GStateHandle gstate, /* subject GState */ ScriptAttrAsWord attrs); /* new superscript percentages */
Get the attributes used when drawing superscript characters.
Include: font.h
void GrSetTextAttr( GStateHandle gstate, /* subject GState */ const TextAttr * ta); /* pointer to text attributes */
Set all attributes used when drawing characters and text strings.
Include: graphics.h
void GrSetTextColor( GStateHandle gstate, /* subject GState */ ColorFlag flag, /* color flag */ word redOrIndex, /* palette index or red RGB value */ word green, /* green RGB value or zero */ word blue); /* blue RGB value or zero */
Set the color used when drawing text.
Include: graphics.h
void GrSetTextColorMap( GStateHandle gstate, /* subject GState */ ColorMapMode colorMap); /* new color mapping mode */
Set the mode used when trying to draw text in an unavailable color.
Include: graphics.h
void GrSetTextMaskCustom( GStateHandle gstate, /* subject GState */ const DrawMask * dm); /* pointer to custom mask */
Set the drawing mask used when drawing text.
Include: graphics.h
void GrSetTextMaskSys( GStateHandle gstate, /* subject GState */ SystemDrawMask sysDM); /* new system draw mask */
Set the drawing mask used when drawing text.
Include: graphics.h
void GrSetTextMode( GStateHandle gstate, /* subject GState */ TextMode bitsToSet, /* TextMode flags to set */ TextMode bitsToClear); /* TextMode flags to clear */
Set the text mode associated with a GState. Using this routine, it is possible to change the vertical offset used when drawing text.
Include: graphics.h
void GrSetTextPattern( GStateHandle gstate, /* subject GState */ GraphicPattern pattern); /* new graphic pattern for text */
Set the graphic pattern used when drawing text.
Include: graphics.h
void GrSetTextSpacePad( GStateHandle gstate, /* subject GState */ WWFixedAsDWord padding); /* new space padding */
Set the space pad used when drawing text strings.
Include: graphics.h
void GrSetTextStyle( GStateHandle gstate, /* subject GState */ TextStyle bitsToSet, /* TextStyle flags to set */ TextStyle bitsToClear); /* TextStyle flags to clear */
Set the style to use when drawing text.
Include: graphics.h
void GrSetTrackKern( GStateHandle gstate, /* subject GState */ word tk); /* degree of track kerning */
Set the track kerning to use when drawing text strings.
Include: graphics.h
void GrSetTransform( GStateHandle gstate, /* subject GState */ const TransMatrix * tm); /* new transformation matrix */
Set the GState's coordinate transformation.
Include: graphics.h
void GrSetVMFile( GStateHandle gstate, /* subject GState */ VMFileHandle vmFile); /* new transformation matrix */
with certain kinds of bitmaps and GStrings).
Include: graphics.h
void GrSetWinClipPath( GStateHandle gstate, /* subject GState */ PathCombineType params, /* how paths are combined */ RegionFillRule rule); /* ODD_EVEN or WINDING */
Restrict the window's clipping region by intersecting it with the passed path.
Include: graphics.h
void GrSetWinClipRect( GStateHandle gstate, /* subject GState */ PathCombineType flags, /* how paths are combined */ sword left, /* new clipping rectangle bounds */ sword top, sword right, sword bottom);
Restrict the window's clipping region by intersecting it with the passed rectangle.
Include: graphics.h
WWFixedAsDWord GrSqrRootWWFixed( WWFixedAsDWord i); /* number to get the square root of */
Compute the square root of a fixed point number.
Include: graphics.h
Boolean GrTestPath( GStateHandle gstate, /* subject GState */ GetPathType ptype); /* Type of path to check for */
Determine whether the GState has a path of the specified type.
Include: graphics.h
Boolean GrTestPointInPath( GStateHandle gstate, /* subject GState */ word xPos, /* point to test */ word yPos, RegionFillRule rule); /* ODD_EVEN or WINDING */
Determine whether the passed point falls in the interior of the GState's path.
Include: graphics.h
Boolean GrTestPointInPolygon( GStateHandle gstate, /* subject GState */ RegionFillRule rule, /* ODD_EVEN or WINDING */ Point * list, /* array of points in polygon */ word numPoints, /* number of points in array */ sword xCoord, /* coordinates of point to test */ sword yCoord);
Determine whether the passed point lies in the interior of the passed polygon.
Include: graphics.h
Boolean GrTestPointInReg( const Region * reg, /* pointer to region */ sword x, /* coordinates of point to test */ sword y, Rectangle *boundingRect); /* returned bounding rectangle, * if point in region */
Determine whether a point lies within the passed region. If the point is not in the region, the return value is
true
.
Include: graphics.h
TestRectReturnType GrTestRectInMask( GStateHandle gstate, sword left, sword top, sword right, sword bottom);
This routine determines whether the passed rectangular area falls within the clipping region.
Structures:
typedef ByteEnum TestRectReturnType; TRRT_OUT, /* rectangle completely out of region */ TRRT_PARTIAL, /* rectangle partially in region */ TRRT_IN /* rectangle completely in region */
Include: graphics.h
TestRectReturnType GrTestRectInReg( const Region * reg /* pointer to region */ sword left, /* bounds of rectangle to be tested */ sword top, sword right, sword bottom);
Determine whether a rectangle lies within the passed region.
Structures:
typedef ByteEnum TestRectReturnType; TRRT_OUT, /* rectangle completely out of region */ TRRT_PARTIAL, /* rectangle partially in region */ TRRT_IN /* rectangle completely in region */
Include: graphics.h
word GrTextWidth( GStateHandle gstate, /* subject GState */ const Chars * str, /* text string to check */ word size); /* maximum number of * characters to check */
Compute the space the passed text string would require in a line of text. Use
GrGetTextBounds()
to determine the area necessary to render the text.
Include: graphics.h
WWFixedAsDWord GrTextWidthWWFixed( /* returns width << 16 */ GStateHandle gstate, /* subject GState */ const Chars * str, /* text string to check */ word size) /* maximum number of * characters to check */
Compute the spacing the passed text string would require in a line of text, accurate to a fraction of a point. Use
GrGetTextBounds()
to determine the area necessary to render the text.
Include: graphics.h
XYValueAsDWord GrTransform( GStateHandle gstate, /* subject GState */ sword xCoord, /* coordinates to transform */ sword yCoord);
Apply the device's transformation to the passed point.
Include: graphics.h
void GrTransformDWFixed( GStateHandle gstate, /* subject GState */ PointDWFixed * coord); /* coordinates to transform */
Apply the device's transformation to the passed point.
Include: graphics.h
void GrTransformDWord( GStateHandle gstate, /* subject GState */ sdword xCoord, /* coordinates to transform */ sdword yCoord, PointDWord * deviceCoordinates); /* pointer to returned devide coordinates */
Apply the device's transormation to the passed point.
Include: graphics.h
void GrTransformWWFixed( GStateHandle gstate, /* subject GState */ WWFixedAsDWord xPos, /* coordinates to transform */ WWFixedAsDWord yPos, PointWWFixed * deviceCoordinates); /* pointer to returned devide coordinates */
Apply the device's transormation to the passed point.
Include: graphics.h
WWFixedAsDWord GrUDivWWFixed( WWFixedAsDWord dividend, WWFixedAsDWord divisor);
Compute an unsigned division of two fixed point numbers.
Include: graphics.h
VMBlockHandle GrUncompactBitmap( VMFileHandle srcFile, VMBlockHandle srcBlock, VMFileHandle destFile);
This routine uncompacts the data of a huge bitmap.
XYValueAsDWord GrUnTransformCoord( GStateHandle gstate, /* subject GState */ sword xCoord, /* coordinates to untransform */ sword yCoord);
Apply the reverse of the device's transformation to the passed point.
Include: graphics.h
void GrUnTransCoordDWFixed( GStateHandle gstate, /* subject GState */ PointDWFixed * coord); /* coordinates to untransform */
Apply the reverse of the device's transformation to the passed point.
Include: graphics.h
void GrUnTransformExtCoord( GStateHandle gstate, /* subject GState */ sdword xCoord, /* coordinates to untransform */ sdword yCoord, PointDWord * documentCoordinates); /* pointer to returned devide coordinates *
Apply the reverse of the device's transformation to the passed point.
Include: graphics.h
void GrUnTransCoordWWFixed( GStateHandle gstate, /* subject GState */ WWFixedAsDWord xPos, /* coordinates to untransform */ WWFixedAsDWord yPos, PointWWFixed * documentCoordinates); /* pointer to returned devide coordinates *
Apply the reverse of the device's transformation to the passed point.
Include: graphics.h
#define GSApplyRotation(angle_f) \ GR_APPLY_ROTATION,GOC_WWF(angle_f
This
GString
creation macro applies a passed
WWFixed
value angle to the coordinate transformation.
Include: gstring.h
#define GSApplyScale(x_f,y_f) \ GR_APPLY_SCALE,GOC_WWF(x_f),GOC_WWF(y_f)
This
GString
creation macro applies the passed scale (defined in terms of two
WWFixed
numbers, one each for the
x
and
y
scale factors) to the coordinate transformation.
Include: gstring.h
#define GSApplyTransform(e11_f,e12_f,e21_f,e22_f,e31_df,e32_df) \ GR_APPLY_TRANSFORM,GOC_WWF(e11_f),GOC_WWF(e12_f), \ GOC_WWF(e21_f),GOC_WWF(e22_f), \ GOC_DWF(e31_df), GOC_DWF(e32_df)
This
GString
creation macro applies the passed translation matrix to the coordinate transformation. The translation matrix is determined in terms of six of its elements, four defined by
WWFixed
values and two by
DWFixed
values.
Include: gstring.h
#define GSApplyTranslation(x_f,y_f) \ GR_APPLY_TRANSLATION,GOC_WWF(x_f),GOC_WWF(y_f)
This
GString
creation macro applies the passed translation (defined in terms of two
WWFixed
numbers, one each for the
x
and
y
translations) to the coordinate transformation.
Include: gstring.h
#define GSApplyTranslationDWord(x_sdw,y_sdw) \ GR_APPLY_TRANSLATION_DWORD,GOC_SDW(x_sdw), GOC_SDW(y_sdw)
This
GString
creation macro applies a large translation (defined in terms of two dword-sized values, one each for the
x
and
y
translations) to the transformation.
Include: gstring.h
#define GSBeginPath(flags) GR_BEGIN_PATH,(flags)
This
GString
creation macro signals that the drawing commands that follow, up until the next
GSEndPath()
, describe a path. It takes one argument, a
PathCombineType
.
Include: gstring.h
#define GSBrushPolyline(width_b,height_b,pts_b) \ GR_BRUSH_POLYLINE, GOC_WORD(pts_b), (width_b), (height_b)
This
GString
creation macro brushes a polyline. It takes three arguments: a word containing the number of points in the polyline and the byte-size width and height of the brush rectangle. Following this macro should appear the points of the polyline, each point passed via a GOC_POINT macro.
Include: gstring.h
#define GSCloseSubPath() GR_CLOSE_SUB_PATH
This
GString
creation macro geometrically closes the currently open path. You must still use
GSEndPath()
to signal that you are done defining the path.
Include: gstring.h
#define GSComment(size_b) \ GR_COMMENT, GOC_WORD(size_b
This
GString
creation macro signals the start of a comment within the GString. It takes one argument, the length of the comment in bytes. Following this macro you should place the comment data.
Include: gstring.h
#define GSCreatePalette() GR_CREATE_PALETTE
This
GString
creation macro creates a custom palette.
Include: gstring.h
#define GSDestroyPalette() GR_DESTROY_PALETTE
This
GString
creation macro destroys the custom palette, if any.
Include: gstring.h
#define GSDrawArc(close_enum,x1_w,y1_w,x2_w,y2_w,ang1_w,ang2_w) \ GR_DRAW_ARC,GOC_WORD(close_enum), \ GOC_SW(x1_w), GOC_SW(y1_w), \ GOC_SW(x2_w), GOC_SW(y2_w), \ GOC_SW(ang1_w),GOC_SW(ang2_w)
This
GString
creation macro draws an arc. It takes several arguments. First it takes an
ArcCloseType
value. Next it takes the boundaries of the arc's base ellipse. Finally, it takes starting and ending angles for the arc.
Include: gstring.h
#define GSDrawArc3Point(close, x1, y1, x2, y2, x3, y3) \ GR_DRAW_ARC_3POINT,GOC_WORD(close),GOC_WWF(x1), \ GOC_WWF(y1), GOC_WWF(x2), GOC_WWF(y2), \ GOC_WWF(x3), GOC_WWF(y3)
This
GString
creation macro draws a three-point arc. It takes several arguments: an
ArcCloseType
and the coordinates of the three points defining the arc, each expressed as a
WWFixed
value.
Include: gstring.h
#define GSDrawArc3Point(close, x1, y1, x2, y2, x3, y3) \ GR_DRAW_ARC_3POINT,GOC_WORD(close),GOC_WWF(x1), \ GOC_WWF(y1), GOC_WWF(x2), GOC_WWF(y2), \ GOC_WWF(x3), GOC_WWF(y3)
This
GString
creation macro draws a three-point arc with the current position acting as one of the endpoints. It takes several arguments: an
ArcCloseType
and the coordinates of the remaining defining points of the arc, each expressed as a
WWFixed
value.
Include: gstring.h
#define GSDrawBitmap(x_w,y_w,w_w) \ GR_DRAW_BITMAP, GOC_SW(x_w), \ GOC_SW(y_w), GOC_WORD(w_w)
This
GString
creation macro draws a bitmap. It takes three arguments: the coordinates at which to draw the bitmap and the size of the bitmap's data. This macro should be followed by the bitmap's data: a
Bitmap
structure and the mask and color data for the bitmap.
Include: gstring.h
#define GSDrawBitmapAtCP(bsize_w) \ GR_DRAW_BITMAP_CP, GOC_WORD(bsize_w)
This
GString
creation macro draws a bitmap at the current position. It takes one argument, the size of the bitmap data in bytes. This macro should be followed by the bitmap's data: a
Bitmap
structure and the mask and color data for the bitmap.
Include: gstring.h
#define GSDrawBitmapOptr(x_w,y_w,o_ptr) \ GR_DRAW_BITMAP_OPTR,GOC_SW(x_w), \ GOC_SW(y_w),GOC_OPTR(o_ptr)
This
GString
creation macro draws a bitmap at the passed coordinates; the data for said bitmap should be stored in a chunk referenced by the passed optr.
Include: gstring.h
#define GSDrawCBitmap(x_w,y_w,slice1size_w,totalSize) \ GR_DRAW_BITMAP,GOC_SW(x_w), GOC_SW(y_w), \ GOC_WORD(slice1size_w)
This
GString
creation macro draws a complex bitmap. It takes four arguments: the
x
and
y
coordinates at which to draw the bitmap, the size of one slice of the bitmap's mask and color data, and the total size of the bitmap's data. This macro should be followed by the bitmap's data: a
CBitmap
structure followed by the mask, color, and any other associated data.
Include: gstring.h
#define GSDrawChar(c,x1_w,y1_w) \ GR_DRAW_CHAR,(c),GOC_SW(x1_w),GOC_SW(y1_w)
This
GString
creation macro draws a text character. It takes three arguments: the
Chars
value of the character and the
x
and
y
coordinates at which to draw the character.
Include: gstring.h
#define GSDrawCharAtCP(c) \ GR_DRAW_CHAR_CP,(c)
This
GString
creation macro draws a single character at the current position. It takes one argument, the
Chars
value of the character to draw.
Include: gstring.h
#define GSDrawCurve(x1_sw,y1_sw,x2_sw,y2_sw,x3_sw,y3_sw,x4_sw,y4_sw) \ GR_DRAW_CURVE,GOC_SW(x1_sw),GOC_SW(y1_sw), \ GOC_SW(x2_sw),GOC_SW(y2_sw), \ GOC_SW(x3_sw),GOC_SW(y3_sw),GOC_SW(x4_sw),GOC_SW(y4_sw)
This
GString
creation macro draws a Bezier curve. It takes eight arguments consisting of the coordinates for the curve's anchor and control points.
Include: gstring.h
#define GSDrawCurveTo(x2_sw,y2_sw,x3_sw,y3_sw,x4_sw,y4_sw) \ GR_DRAW_CURVE_TO,GOC_SW(x2_sw),GOC_SW(y2_sw), \ GOC_SW(x3_sw),GOC_SW(y3_sw), \ GOC_SW(x4_sw),GOC_SW(y4_sw)
This
GString
creation macro draws a Bezier curve, using the current position as one endpoint. It takes six arugments, the coordinates of the remaining anchor and control points.
Include: gstring.h
#define GSDrawEllipse(x1_w,y1_w,x2_w,y2_w) \ GR_DRAW_ELLIPSE,GOC_SW(x1_w),GOC_SW(y1_w), \ GOC_SW(x2_w),GOC_SW(y2_w)
This
GString
creation macro draws an ellipse with bounds defined by the passed coordinates.
Include: gstring.h
#define GSDrawHLine(x1_w,y1_w,x2_w) \ GR_DRAW_HLINE,GOC_SW(x1_w), \ GOC_SW(y1_w),GOC_SW(x2_w)
This
GString
creation macro draws a horizontal line. It takes three word-length arguments: the coordinates of the first endpoint and the
x
coordinate of the second endpoint.
Include: gstring.h
#define GSDrawHLineTo(x2_w) \ GR_DRAW_HLINE_TO,GOC_SW(x2_w)
This
GString
creation macro draws a horizontal line from the current position to the passed
x
coordinate.
Include: gstring.h
#define GSDrawLine(x1_w,y1_w,x2_w,y2_w) \ GR_DRAW_LINE,GOC_SW(x1_w),GOC_SW(y1_w), \ GOC_SW(x2_w),GOC_SW(y2_w)
This
GString
creation macro draws a line between the two passed points. The points are defined in terms of their
x
and
y
coordinates, passed as word values.
Include: gstring.h
#define GSDrawLineTo(x2_w,y2_w) \ GR_DRAW_LINE_TO,GOC_SW(x2_w),GOC_SW(y2_w)
This
GString
creation macro draws a line from the current postion to the passed point. The endpoint of the line is passed via two words describing its
x
and
y
coordinates.
Include: gstring.h
#define GSDrawPath() GR_DRAW_PATH
This
GString
creation macro draws the current path.
Include: gstring.h
#define GSDrawPoint(x1_w,y1_w) \ GR_DRAW_POINT,GOC_SW(x1_w),GOC_SW(y1_w)
This
GString
creation macro draws a dot at the passed coordinates.
Include: gstring.h
#define GSDrawPointAtCP() \ GR_DRAW_POINT_CP
This
GString
creation macro draws a dot at the current drawing position.
Include: gstring.h
#define GSDrawPolygon(count_w) \ GR_DRAW_POLYGON,GOC_WORD(count_w)
This
GString
creation macro draws the outline of a polygon. It takes one argument, the number of points in the polygon. Follow the macro with the points of the polygon, each passed via a GOC_POINT macro.
Include: gstring.h
#define GSDrawPolyline(count_w) \ GR_DRAW_POLYLINE,GOC_WORD(count_w)
This
GString
creation macro draws a polyline--a spline with corners. The macro takes one argument: the number of points in the polyline. The point data should follow the macro, each point passed via a GOC_POINT macro.
Include: gstring.h
#define GSDrawRect(x1_w,y1_w,x2_w,y2_w) \ GR_DRAW_RECT,GOC_SW(x1_w),GOC_SW(y1_w), \ GOC_SW(x2_w),GOC_SW(y2_w)
This
GString
creation macro draws a rectangle with bounds defined by the passed coordinates, each coordinate a word-length value.
Include: gstring.h
#define GSDrawRectTo(x2_w,y2_w) \ GR_DRAW_RECT_TO,GOC_SW(x2_w),GOC_SW(y2_w)
This
GString
creation macro draws a rectangle with one corner at the current position and the other corner at the point defined by the passed coordinates.
Include: gstring.h
#define GSDrawRelArc3PointTo(close, x2, y2, x3, y3) \ GR_DRAW_REL_ARC_3POINT_TO,GOC_WORD(close), \ GOC_WWF(x2), GOC_WWF(y2), GOC_WWF(x3), GOC_WWF(y3)
This
GString
creation macro draws a three-point arc with the current position acting as one endpoint and the other points coordinates specified as offsets from the coordinates of the current position. In addition to these offsets, this macro has one more argument: an
ArcCloseType
.
Include: gstring.h
#define GSDrawRelCurveTo(x2_sw,y2_sw,x3_sw,y3_sw,x4_sw,y4_sw) \ GR_DRAW_REL_CURVE_TO,GOC_SW(x2_sw),GOC_SW(y2_sw), \ GOC_SW(x3_sw),GOC_SW(y3_sw), \ GOC_SW(x4_sw),GOC_SW(y4_sw)
This
GString
creation macro draws a Bezier curve. It uses the current position as one endpoint of the curve; it takes six arguments: the coordinates of the other points of the curve expressed as offsets from the coordinates of the current position.
Include: gstring.h
#define GSDrawRoundRect(x1_w,y1_w,x2_w,y2_w,r_w) \ GR_DRAW_ROUND_RECT,GOC_WORD(r_w), \ GOC_SW(x1_w),GOC_SW(y1_w), \ GOC_SW(x2_w),GOC_SW(y2_w)
This
GString
creation macro draws a rounded rectangle with bounds specified by its first four arguments and corner radius specified by its final argument. All arguments are word-length values except the radius, which is a word.
Include: gstring.h
#define GSDrawRoundRectTo(x2_w,y2_w,r_w) \ GR_DRAW_ROUND_RECT_TO,GOC_WORD(r_w), \ GOC_SW(x2_w),GOC_SW(y2_w)
This
GString
creation macro draws a rounded rect with bounds defined by the coordinates of the current position and the coordinates of the passed point; the corner radius is specified by the macro's last argument.
Include: gstring.h
#define GSDrawSpline(count_w) \ GR_DRAW_SPLINE,GOC_WORD(count_w)
This
GString
creation macro draws a spline. It takes one argument, the number of points in the spline. Follow this macro with the list of points for the spline; each point should be defined by means of a GOC_POINT macro.
Include: gstring.h
#define GSDrawSplineTo(count_w) \ GR_DRAW_SPLINE_TO,GOC_WORD(count_w)
This
GString
creation macro draws a spline using the current postion as one endpoint. It takes one argument, the number of points in the spline. Follow this macro with the list of points for the spline; each point should be defined by means of a GOC_POINT macro.
Include: gstring.h
#define GSDrawText(x1_w,y1_w) \ GR_DRAW_TEXT,GOC_SW(x1_w),GOC_SW(y1_w)
This
GString
creation macro draws a string of text. Follow the macro with the string of text like so:
GSDrawText(10,10),"foo",
Include: gstring.h
#define GSDrawTextAtCP() GR_DRAW_TEXT_CP
This
GString
creation macro draws a string of text at the current position. Follow the macro with the text to draw like so:
GSDrawTextAtCP(),"bar",
Include: gstring.h
#define GSDrawTextOptr(x_w,y_w,o_ptr) \ GR_DRAW_TEXT_OPTR, GOC_SW(x_w), \ GOC_SW(y_w),GOC_OPTR(o_ptr)
This
GString
creation macro draws a string of text. It takes three arguments: the
x
and
y
coordinates at which to start drawing the text and an optr to the chunk in which the text is stored.
Include: gstring.h
#define GSDrawVLine(x1_w,y1_w,y2_w) \ GR_DRAW_VLINE,GOC_SW(x1_w), \ GOC_SW(y1_w),GOC_SW(y2_w)
This
GString
creation macro draws a vertical line. It takes three arguments: the coordinates of the first endpoint and the
y
coordinate of the second endpoint.
Include: gstring.h
#define GSDrawVLineTo(y2_w) \ GR_DRAW_VLINE_TO,GOC_SW(y2_w)
This
GString
creation macro draws a vertical line from the current position to the passed
y
coordinate.
Include: gstring.h
#define GSEndPath() GR_END_PATH
This
GString
creation macro signals the end of path-defining commands; from here on, drawing commands will draw instead of specifying path strokes.
Include: gstring.h
#define GSEndString() \ GR_END_GSTRING
This
GString
definition macro marks the end of a graphics string.
Include: gstring.h
#define GSEscape(esc_w,size_w) \ GR_ESCAPE,GOC_WORD(esc_w),GOC_WORD(size_w)
This
GString
creation macro inserts an escape code into the GString. The macro's first argument is a word-length escape code. The second argument is the size of any additional escape code data which follows, in bytes. Following this macro, you may place any amount of additional data to associate with the escape code.
Include: gstring.h
#define GSFillArc(close_enum,x1_w,y1_w,x2_w,y2_w,ang1_w,ang2_w) \ GR_FILL_ARC,GOC_WORD(close_enum), \ GOC_SW(x1_w),GOC_SW(y1_w), \ GOC_SW(x2_w),GOC_SW(y2_w),GOC_SW(ang1_w), \ GOC_SW(ang2_w)
This
GString
creation macro draws a filled arc. It takes several arguments: an
ArcCloseType
value, the bounding coordinates of the arc's base ellipse, and the arc's starting and ending angles.
Include: gstring.h
#define GSFillArc3Point(close, x1, y1, x2, y2, x3, y3) \ GR_FILL_ARC_3POINT,GOC_WORD(close),GOC_WWF(x1), GOC_WWF(y1),\ GOC_WWF(x2), GOC_WWF(y2), GOC_WWF(x3), GOC_WWF(y3)
This
GString
creation macro fills a three-point arc. It takes several arguments: an
ArcCloseType
and the coordinates of the points defining the arc.
Include: gstring.h
#define GSFillArc3PointTo(close, x2, y2, x3, y3) \ GR_FILL_ARC_3POINT_TO,GOC_WORD(close), \ GOC_WWF(x2), GOC_WWF(y2), GOC_WWF(x3), GOC_WWF(y3)
This
GString
creation macro fills a three-point arc. The current position acts as one of the arc's endpoints, with the macro's arguments specifying the coordinates of the other points. The macro has one other argument: an
ArcCloseType
.
Include: gstring.h
#define GSFillBitmap(x_w,y_w,bsize_w) \ GR_FILL_BITMAP,GOC_SW(x_w), \ GOC_SW(y_w),GOC_WORD(bsize_w)
This
GString
creation macro draws a bitmap using the area-filling color. It will draw the bitmap at the passed coordinates; the macro's final argument is the size of the bitmap's data. Following the macro you should place the bitmap's data: first a Bitmap structure, then a number of bytes containing the mask and color values for the bitmap.
Include: gstring.h
#define GSFillBitmapAtCP(bsize_w) \ GR_FILL_BITMAP_CP, GOC_WORD(bsize_w)
This
GString
creation macro draws a bitmap using the area-filling color at the current position. It takes one argument, the size of the bitmap's data. Following the macro you should place the bitmap's data: first a Bitmap structure, then a number of bytes containing the mask and color values for the bitmap.
Include: gstring.h
#define GSFillBitmapOptr(x_w,y_w,o_ptr) \ GR_FILL_BITMAP_OPTR,GOC_SW(x_w),GOC_SW(y_w),GOC_OPTR(o_ptr)
This
GString
creation macro draws a bitmap using the area-filling color. It does so at the passed coordinates; the bitmap's data should be stored in the chunk referenced by the passed optr.
Include: gstring.h
#define GSFillEllipse(x1_w,y1_w,x2_w,y2_w) \ GR_FILL_ELLIPSE,GOC_SW(x1_w),GOC_SW(y1_w), \ GOC_SW(x2_w),GOC_SW(y2_w)
This
GString
creation macro draws a filled ellipse. It takes four arguments, the bounding coordinates of the ellipse.
Include: gstring.h
#define GSFillPath(region_fill_rule) \ GR_FILL_PATH,(region_fill_rule)
This
GString
creation macro fills the current path using the passed
RegionFillRule
value.
Include: gstring.h
#define GSFillPolygon(count_w,fillrule_enum) \ GR_FILL_POLYGON,GOC_WORD(count_w),(fillrule_enum)
This
GString
creation macro draws a filled polygon. It takes two arguments, the number of points in the polygon and a
RegionFillRule
value. This macro should be followed by the points of the polygon, each passed via a GOC_POINT macro.
Include: gstring.h
#define GSFillRect(x1_w,y1_w,x2_w,y2_w) \ GR_FILL_RECT,GOC_SW(x1_w),GOC_SW(y1_w), \ GOC_SW(x2_w),GOC_SW(y2_w)
This
GString
creation macro draws a filled rectangle. The macro takes four arguments, the bounds of the rectangle.
Include: gstring.h
#define GSFillRectTo(x2_w,y2_w) \ GR_FILL_RECT_TO ,GOC_SW(x2_w),GOC_SW(y2_w)
This
GString
creation macro draws a filled rectangle with the current position defining one corner and the opposite corner defined by the passed coordinates.
 It takes five arguments; the first four give the bounding coordinates of the rectangle; the final argument is the corner radius.
Include: gstring.h
#define GSFillRoundRectTo(x2_w,y2_w,r_w) \ GR_FILL_ROUND_RECT_TO,GOC_WORD(r_w),GOC_SW(x2_w), GOC_SW(y2_w)
This
GString
creation macro draws a filled rounded rectangle. The rectangle's bounding coordinates are defined by the the current position and the two passed coordinates; its corner radius is defined by the macro's final argument.
Include: gstring.h
#define GSInitDefaultTransform() \ GR_INIT_DEFAULT_TRANSFORM
This
GString
creation macro initializes the GState's default transformation to hold the value of the current coordinate transformation.
Include: gstring.h
#define GSLabel(w) \ GR_LABEL, GOC_WORD(w)
This
GString
definition macro creates a label in the GString. This macro takes one argument, a word which acts as the label's token. By passing GSC_LABEL to
GrDrawGString()
or another GString-traversing command, you may use this label as something analogous to the label used by a goto command.
Include: gstring.h
#define GSMoveTo(x1_w,y1_w) \ GR_MOVE_TO, GOC_SW(x1_w), GOC_SW(y1_w)
This
GString
creation macro updates the current position to the passed coordinates.
Include: gstring.h
#define GSNewPage(pageEndCommand) \ GR_NEW_PAGE,(pageEndCommand)
This
GString
creation macro signals the end of a page. The
pageEndCommand
argument should be a
PageEndCommand
value.
Include: gstring.h
#define GSNullOp() GR_NULL_OP
This
GString
creation macro inserts a null-operation element into the GString.
Include: gstring.h
#define GSRelMoveTo(x1_wwf,y1_wwf) \ GR_REL_MOVE_TO, GOC_WWF(x1_wwf),GOC_WWF(y1_wwf)
This
GString
creation macro updates the current position to a set of coordinates specified as offsets from those of the old current position.
Include: gstring.h
#define GSRestoreState() \ GR_RESTORE_STATE
This
GString
creation macro causes a GState saved by
GSSaveState()
to be restored.
Include: gstring.h
#define GSRestoreTransform() \ GR_RESTORE_TRANSFORM
This
GString
creation macro restores a transformation matrix previously saved via
GSSaveTransform()
.
Include: gstring.h
#define GSSaveState()\ GR_SAVE_STATE
This
GString
creation macro causes the GState to be saved so that it may be restored by a subsequent
GSRestoreState()
.
Include: gstring.h
#define GSSaveTransform() \ GR_SAVE_TRANSFORM
This
GString
creation macro saves the current tranformation matrix which may be retrieved by means of a
GSRestoreTransform()
.
Include: gstring.h
#define GSSetAreaAttr(r,g,b,mode,mask) \ GR_SET_AREA_ATTR,(CF_RGB),(r),(g),(b),(mask),(mode)
This
GString
creation macro sets the
AreaAttr
value to use when filling areas. It takes several arguments: the red, green, and blue components of the color; the
ColorMapMode
to use when trying to draw in an unavailable color, and the mask to use.
Include: gstring.h
#define GSSetAreaColor(r,g,b) GR_SET_AREA_COLOR,(r),(g),(b)
This
GString
creation macro specifies a new area-filling color in terms of its red, green, and blue components.
Include: gstring.h
#define GSSetAreaColorIndex(index) GR_SET_AREA_COLOR_INDEX,(index)
This
GString
creation macro specifies the new area-filling color by means of its index in the palette.
Include: gstring.h
#define GSSetAreaColorMap(mode) GR_SET_AREA_COLOR_MAP,(mode)
This
GString
creation macro sets the
ColorMapMode
to use when trying to fill an area using an unavailable color.
Include: gstring.h
#define GSSetAreaMask(index) GR_SET_AREA_MASK, (index)
This
GString
creation macro sets the mask to use when filling areas.
Include: gstring.h
#define GSSetAreaPattern(pattern) \ GR_SET_AREA_PATTERN,GOC_PATTERN(pattern)
This
GString
creation macro sets the
GraphicPattern
to use when filling areas.
Include: gstring.h
#define GSSetClipPath(flags) GR_SET_CLIP_PATH,(flags)
This
GString
creation macro combines the current path with the clipping path using the passed
PathCombineType
.
Include: gstring.h
#define GSSetClipRect(path,rl_sw,rt_sw,rr_sw,rb_sw) \ GR_SET_CLIP_RECT,GOC_SW(rl_sw), \ GOC_SW(rt_sw),GOC_SW(rr_sw),GOC_SW(rb_sw)
This
GString
creation macro sets a clipping rectangle. It takes five arguments: a
PathCombineType
and the bounding coordinates of the rectangle.
Include: gstring.h
#define GSSetCustomAreaMask(m1,m2,m3,m4,m5,m6,m7,m8) \ GR_SET_CUSTOM_AREA_MASK, (m1), (m2), (m3), (m4), (m5), (m6), (m7), (m8)
This
GString
creation macro specifies a custom bitmask to use when filling areas. It takes eight arguments, each a byte representing the pixels of one row.
Include: gstring.h
#define GSSetCustomAreaPattern(pattern,size) \ GR_SET_CUSTOM_AREA_PATTERN, GOC_PATTERN(pattern),GOC_WORD(size)
This
GString
creation macro sets up a custom pattern to use when filling areas. It takes two arguments: a
GraphicPattern
value and the size of the pattern's data. Following this macro should appear the pattern's data.
Include: gstring.h
#define GSSetCustomLineMask(m1,m2,m3,m4,m5,m6,m7,m8) \ GR_SET_CUSTOM_LINE_MASK, (m1), (m2), (m3), (m4), (m5), (m6), (m7), \ (m8)
This
GString
creation macro specifies a new bitmap to use as the mask when drawing lines. It takes eight arguments, each a byte representing the pixels one one row.
Include: gstring.h
#define GSSetCustomLineStyle(index,count) \ GR_SET_CUSTOM_LINE_STYLE,(index),(count)
This
GString
creation macro sets a custom style, or "dottedness," to use when drawing lines. It takes two arguments: the first is the index into the pattern to use, the second is the number of dash pairs in the line style. Following this macro should appear a
DashPairArray
containing the line style's data.
Include: gstring.h
#define GSSetCustomTextMask(m1,m2,m3,m4,m5,m6,m7,m8) \ GR_SET_CUSTOM_TEXT_MASK, (m1), (m2), (m3), (m4), (m5), (m6), (m7), (m8)
This
GString
creation macro specifies a custom bitmask to use when rendering text. It takes eight arguments, each a byte representing one row of pixel data.
Include: gstring.h
#define GSSetCustomTextPattern(pattern,size) \ GR_SET_CUSTOM_TEXT_PATTERN,GOC_PATTERN(pattern), GOC_WORD(size)
This
GString
creation macro sets a custom pattern to use when rendering text. It takes two arguments: a
GraphicPattern
value and the size of the pattern's data. Following this macro should appear the pattern's data.
Include: gstring.h
#define GSSetDefaultTransform() \ GR_SET_DEFAULT_TRANSFORM
This
GString
creation macro replaces the current coordinate transformation with the default coordinate transformation.
Include: gstring.h
#define GSSetFont(id,size_wbf) \ GR_SET_FONT,GOC_WBF(size_wbf),GOC_WORD(id)
This
GString
creation macro sets the font to use when rendering text. It takes two arguments: a
FontID
and a pointsize, expressed as a
WBFixed
number.
Include: gstring.h
#define GSSetFontWeight(weight) GR_SET_FONT_WEIGHT,GOC_WORD(weight)
This
GString
creation macro sets the
FontWeight
to use when rendering text.
Include: gstring.h
#define GSSetFontWidth(width) GR_SET_FONT_WIDTH,GOC_WORD(width)
This
GString
creation macro sets the
FontWidth
to use when rendering text.
Include: gstring.h
#define GSSetGStringBounds(x1_w,y1_w,x2_w,y2_w) \ GR_SET_GSTRING_BOUNDS,GOC_SW(x1_w),GOC_SW(y1_w), \ GOC_SW(x2_w),GOC_SW(y2_w)
This
GString
creation macro is useful for optimizations. When drawing your
GString
, the graphics system will take time to traverse your
GString
and determine its drawing bounds. If you compute those bounds ahead of time, you may pass them as arguments to this macro--if the graphics system encounters this
GString
element, it won't bother to traverse the rest of the
GString
, but will use the pre-computed values. Thus, if you use this
GString
element, you should place it at the beginning of your
GString
. The macro takes four word-length arguments, the coordinates of the bounds of the
GString
.
Include: gstring.h
#define GSSetLineAttr(r,g,b,mode,mask,width,end,join,style) \ GR_SET_LINE_ATTR,(CF_RGB),(r),(g),(b),(mask),(mode),(end),(join), \ (style) ,GOC_WWF(width)
This
GString
creation macro sets the
LineAttr
to use when drawing lines. It takes several arguments: the red, green, and blue components of the color to use; the ColorMapMode to use when trying to draw in an unavailable color, the drawing mask to use, the width, the
LineEnd
, the
LineJoin
, and the
LineStyle
.
Include: gstring.h
#define GSSetLineColor(r,g,b) GR_SET_LINE_COLOR,(r),(g),(b)
This
GString
creation macro sets the line-drawing color in terms of its red, green, and blue components.
Include: gstring.h
#define GSSetLineColorIndex(color) GR_SET_LINE_COLOR_INDEX, (color)
This
GString
creation macro sets the line-drawing color by specifying which entry in the palette to use.
Include: gstring.h
#define GSSetLineColorMap(mode) GR_SET_LINE_COLOR_MAP,(mode)
This
GString
creation macro sets the
ColorMapMode
to use when trying to draw lines with an unavailable color.
Include: gstring.h
#define GSSetLineEnd(end) \ GR_SET_LINE_END,(end)
This
GString
creation macro sets the
LineEnd
value to use when drawing endpoints of lines.
Include: gstring.h
#define GSSetLineJoin(join) \ GR_SET_LINE_JOIN,(join)
This
GString
creation macro sets the
LineJoin
value to use when drawing corners in polylines, polygons, and rectangles.
Include: gstring.h
#define GSSetLineMask(index) GR_SET_LINE_MASK, (index)
This
GString
creation macro sets the mask to use when drawing lines.
Include: gstring.h
#define GSSetLineStyle(style,index) \ GR_SET_LINE_STYLE,(style),(index)
This
GString
creation macro sets the style, or "dottedness," to use when drawing lines.
Include: gstring.h
#define GSSetLineWidth(width_wwf) \ GR_SET_LINE_WIDTH, GOC_WWF(width_wwf)
This
GString
creation macro sets the width to use when drawing lines. It takes a single argument, the width expressed as a
WWFixed
number.
Include: gstring.h
#define GSSetMiterLimit(limit_wwf) \ GR_SET_MITER_LIMIT, GOC_WWF(limit_wwf)
This
GString
creation macro sets the miter limit to use when drawing mitered corners of rectangles, polylines, and polygons. This miter limit is expressed as a
WWFixed
value.
Include: gstring.h
#define GSSetMixMode(mode) GR_SET_MIX_MODE, (mode)
This
GString
creation macro sets the mix mode to use when drawing on top of existing drawings.
Include: gstring.h
#define GSSetNullPath() GR_SET_NULL_PATH
This
GString
creation macro clears the current path.
Include: gstring.h
#define GSSetNullTransform() \ GR_SET_NULL_TRANSFORM
This
GString
creation macro nullifies the coordinate transformation.
Include: gstring.h
#define GSSetPalette(entry_count) GR_SET_PALETTE,(entry),(count)
This
GString
creation macro allows you to change several palette colors at once. It takes two arguments: the index of the first color entry to change, and the number of entries to change. Follow this macro with trios of bytes, each triplet specifying the red, green, and blue components of the colors.
#define GSSetPaletteEntry(entry,r,g,b) \ GR_SET_PALETTE_ENTRY GOC_WORD(entry),(r), (g),(b)
This
GString
creation macro changes a single entry in a custom palette. It takes four arguments: the index number of the entry and the red, green, and blue components of the new color for this entry.
Include: gstring.h
#define GSSetStrokePath() GR_SET_STROKE_PATH
This
GString
creation macro replaces the current path with the path which results from stroking the current path with the current line attributes. This new path may be drawn, but may not be used for clipping.
Include: gstring.h
#define GSSetSubscriptAttr(pos,size) \ GR_SET_SUBSCRIPT_ATTR,(pos),(size)
This
GString
creation macro sets the vertical offset and size to use when rendering subscript text.
Include: gstring.h
#define GSSetSuperscriptAttr(pos,size) \ GR_SET_SUPERSCRIPT_ATTR,(pos),(size)
This
GString
creation macro sets the vertical offset and size to use when rendering superscript text.
Include: gstring.h
#define GSSetTextAttr(cflag,r,g,b,mask,sSet,sReset,mSet,mReset, sPad,id,pSize,trk Krn,fWeight,fWidth) \
GR_SET_TEXT_ATTR,(cflag),(r),(g),(b),(mask),(sSet), \ (sReset),(mSet),(mReset),GOC_WWF(sPad), \ GOC_WORD(id), GOC_WWF(pSize),GOC_SW(trkKrn),(fWeight),(fWidth)
This
GString
creation macro sets the
TextAttr
structure to use when rendering text. It takes several arguments: the four components of a
ColorQuad
, a drawing mask,
TextStyle
flags to set and clear,
TextMode
flags to set and clear, a spacing pad, a
FontID
, a pointsize expressed as a
WWFixed
number, a track kerning value, a
FontWeight
, and a
FontWidth
.
Include: gstring.h
#define GSSetTextColor(r,g,b) GR_SET_TEXT_COLOR,(r),(g),(b)
This
GString
creation macro sets the text-rendering color by means of red, green, and blue component values.
Include: gstring.h
#define GSSetTextColorIndex(index) GR_SET_TEXT_COLOR_INDEX,(index)
This
GString
creation macro specifies the text-rendering color as an index of the palette.
Include: gstring.h
#define GSSetTextColorMap(mode) GR_SET_TEXT_COLOR_MAP,(mode)
This
GString
creation macro sets the
ColorMapMode
to use when trying to render text in an unavailable color.
Include: gstring.h
#define GSSetTextMask(index) GR_SET_TEXT_MASK, (index)
This
GString
creation macro specifies the mask to use when rendering text.
Include: gstring.h
#define GSSetTextMode(set,reset) \ GR_SET_TEXT_MODE,(set),(reset)
This
GString
creation macro sets and clears
TextMode
flags. It takes two arguments: the flags to set and the flags to clear.
Include: gstring.h
#define GSSetTextPattern(pattern) \ GR_SET_TEXT_PATTERN,GOC_PATTERN(pattern)
This
GString
creation macro sets the
GraphicPattern
to use when rendering text.
Include: gstring.h
#define GSSetTextSpacePad(pad_wbf) \ GR_SET_TEXT_SPACE_PAD, GOC_WBF(pad_wbf)
This
GString
creation macro specifies the space pad to use when rendering text. It takes one argument: the space padding value, expressed as a
WBFixed
number.
Include: gstring.h
#define GSSetTextStyle(set,reset) \ GR_SET_TEXT_STYLE,(set),(reset)
This
GString
creation macro changes the
TextStyle
flags to use when drawing text. It takes two arguments, the flags to set and the flags to clear.
Include: gstring.h
#define GSSetTrackKern(degree) GR_SET_TRACK_KERN, GOC_SW(degree)
This
GString
creation macro sets the track kerning value to use when rendering text strings.
Include: gstring.h
#define GSSetTransform(e11_f,e12_f,e21_f,e22_f,e31_df,e32_df) \ GR_SET_TRANSFORM,GOC_WWF(e11_f), \ GOC_WWF(e12_f),GOC_WWF(e21_f), \ GOC_WWF(e22_f),GOC_DWF(e31_df),GOC_DWF(e32_df)
This
GString
creation macro sets the coordinate transformation. The new transformation is defined in terms of the elements of a transformation matrix, four
WWFixed
values and two
DWFixed
values.
Include: gstring.h
#define GSSetWinClipPath(flags) GR_SET_WIN_CLIP_PATH,(flags)
This
GString
creation macro combines the current path with the window clipping path, using the passed
PathCombineType
.
Include: gstring.h
#define GSSetWinClipRect(path,rl_sw,rt_sw,rr_sw,rb_sw) \ GR_SET_WIN_CLIP_RECT,GOC_SW(rl_sw), \ GOC_SW(rt_sw),GOC_SW(rr_sw),GOC_SW(rb_sw)
This
GString
creation macro combines a rectangle with the existing window clipping path. It takes five arguments: a
PathCombineType
and the bounding coordinates of the rectangle.
Include: gstring.h
word HAL_COUNT( dword val);
This macro is provided for use with
HugeArrayLock()
. It extracts the lower word of the
HugeArrayLock()
return value. This is the number of elements in the Huge Array block after the locked one (counting that locked one).
word HAL_PREV( dword val);
This macro is provided for use with
HugeArrayLock()
. It extracts the upper word of the
HugeArrayLock()
return value. This is the number of elements in the Huge Array block before the locked one (counting that locked one).
void HandleModifyOwner( MemHandle mh, /* Handle of block to modify */ GeodeHandle owner); /* Handle of block's new owner */
This routine changes the owner of the indicated global memory block. Note that this routine can be called only by a thread belonging to the block's original owner; that is, you can only use this routine to transfer ownership of a block from yourself to some other geode.
Include: heap.h
Never Use Situations:
Never use this unless the block already belongs to you and you are giving up ownership.
See Also: MemGetInfo()
,
MemModifyFlags()
,
MemModifyOtherInfo()
.
void HandleP( MemHandle mh); /* Handle of block to grab */
If several different threads will be accessing the same global memory block, they need to make sure their activities will not conflict. The way they do that is to use synchronization routines to get control of a block.
HandleP()
is part of one set of synchronization routines.
If the threads are using this family of routines, then whenever a thread needs access to the block in question, it can call
HandleP()
. This routine checks whether any thread has grabbed the block with
HandleP()
(or
MemPLock()
). If no thread has the block, it grabs the block for the calling thread and returns (it does not lock the block on the global heap). If a thread has the block,
HandleP()
puts the thread on a priority queue and sleeps. When the block is free for it to take, it awakens, grabs the block, and returns.When the thread is done with the block, it should release it with
MemUnlockV()
or
HandleV()
.
Include: heap.h
Tips and Tricks: If you will be locking the block after you grab it, use the routine
MemPLock()
(which calls
HandleP()
and then locks the block with
MemLock()
). You can find out if the block is being accessed by looking at the
HM_otherInfo
word (with
MemGetInfo()
). If
HM_otherInfo
equals one, the block is not grabbed; if it equals zero, it is grabbed, but no threads are queued; otherwise, it equals the handle of the first thread queued.
Be Sure To: Make sure that all threads accessing the block use
HandleP()
and/or
MemPLock()
to access the block. The routines use the
HM_otherInfo
field of the handle table entry; do not alter this field. Release the block with
HandleV()
or
MemUnlockV()
when you are done with it.
Warnings: If a thread calls
HandleP()
when it already has control of the block, it will deadlock;
HandleP()
will put the thread to sleep until the thread releases the block, but the thread will not be able to release the block because it's sleeping.
MemThreadGrab()
avoids this conflict. If you try to grab a non-sharable block owned by another thread,
HandleP()
will fatal-error.
See Also: MemThreadGrab()
,
MemThreadGrabNB()
,
MemThreadRelease()
,
HandleV()
,
HandleP()
,
MemPLock()
,
MemUnlockV()
.
optr HandleToOptr( Handle han;
This macro casts any handle to an optr, leaving the chunk handle portion of the resultant optr to be zero.
See Also: ConstructOptr()
,
OptrToHandle()
,
OptrToChunk()
.
void HandleV( MemHandle mh); /* Handle of block to grab */
HandleV()
is part of a set of synchronization routines. If several different threads will be accessing the same global memory block, they need to make sure their activities will not conflict. The way they do that is to use synchronization routines to get control of a block.
HandleV()
is part of one set of synchronization routines.
If a block is being accessed via these synchronization routines, then a thread will not access a block until it has "grabbed" it with
HandleP()
or
MemPLock()
. When a thread is done with the block, it can release it for use by the other threads by calling
HandleV()
. Note that
HandleV()
does not unlock the block; it just changes the block's semaphore so other threads can grab it.
Include: heap.h
Tips and Tricks: If you need to unlock the thread just before releasing it, use the routine
MemUnlockV()
, which first unlocks the thread, and then calls
HandleV()
to release it. You can find out if the block is being accessed by looking at the
HM_otherInfo
word (with
MemGetInfo()
). If
HM_otherInfo
equals one, the block is not grabbed; if it equals zero, it is grabbed, but no threads are queued; otherwise, it equals the handle of the first thread queued.
Be Sure To: Make sure that all threads accessing the block use
HandleP()
or
MemPLock()
to access the thread. The routines use the
HM_otherInfo
field of the handle table entry; do not alter this field.
Warnings: Do not use this on a block unless you have grabbed it. The routine does not check to see that you have grabbed the thread; it just clears the semaphore and returns.
See Also: MemThreadGrab()
,
MemThreadGrabNB()
,
MemThreadRelease()
,
HandleV()
,
HandleP()
,
MemPLock()
,
MemUnlockV()
.
void HelpSendHelpNotification( word HelpType, const char *contextname, const char *filename);
Use this routine to bring up on-line help on the fly or to dynamically change the context presently showing in on-line help.
dword HugeArrayAppend( VMFileHandle file, VMBlockhandle vmBlock, /* Handle of directory block */ word numElem, /* # of elements to add to end of * array */
const void * initData); /* Copy into new element(s) */
This routine appends one or more elements to a Huge Array. If
initData
is a null pointer, the elements will be uninitialized.
If the Huge Array contains variable sized elements, this routine will append a single element; this element will be
numElem
bytes long. The single element will be initialized to hold
initData
.
If the Huge Array contains constant-sized elements, then initData will be treated as an array of element-sized structures. initData [0] will be the initial value of the first element, initData [1] will be the initial value of the second, and so on.
The return value is the element number of the element added. If more than one element was added; this will be the number of the first element added.
Include: hugearr.h
void HugeArrayCompressBlocks( VMFileHandle vmFile, /* File containing Huge Array */ VMBlockHandle vmBlock); /* handle of directory block */
This routine compacts a Huge Array, resizing every block to be just as large as necessary to accommodate its elements. It does not change any of the data in the Huge Array.
Include: hugearr.h
word HugeArrayContract( void ** elemPtr, /* **elemPtr is first element to * delete */
word numElem); /* # of elements to delete */
Delete a number of elements starting at an address in a Huge Array. The routine will fix up the pointer so it points to the first element after the deleted elements. The routine automatically locks and unlocks Huge Array blocks as necessary.
Include: hugearr.h
VMBlockhandle HugeArrayCreate( VMFileHandle vmFile, /* Create in this VM file */ word elemSize, /* Pass zero for variable-size * elements */
word headerSize); /* Pass zero for default header */
This routine creates and initializes a Huge Array in the specified file. It returns the handle of the Huge Array's directory block.
Include: hugearr.h
void HugeArrayDelete( VMFileHandle vmFile, VMBlockHandle vmBlock, /* handle of directory block */ word numElem, /* # of elements to delete */ dword elemNum); /* Index of first element to delete */
This routine deletes one or more elements from a Huge Array. It contracts and frees blocks as necessary.
Include: hugearr.h
void HugeArrayDirty( const void * elemPtr); /* Element in dirty block */
This routine marks a block in a Huge Array as dirty. The routine is passed a pointer to anywhere in a dirty element; that element's block will be dirtied.
Include: hugearr.h
Warnings: Be sure to call this routine before you unlock the element; otherwise, the block may be discarded before you can dirty it.
void HugeArrayDestroy( VMFileHandle vmFile, VMBlockHandle vmBlock); /* Handle of directory block */
This routine destroys a HugeArray by freeing all of its blocks.
Include: hugearr.h
Boolean HugeArrayEnum( VMFileHandle vmFile, /* subject to override */ VMBlockHandle vmBlock, /* Handle of the Huge Array's directory * block */
Boolean _pascal (*callback) ( /* return true to stop */ void * element, /* element to examine */ void * enumData), dword startElement, /* first element to examine */ dword count, /* examine this many elements */ void * enumData; /* this pointer is passed to callback * routine */
This routine lets you examine a sequence of elements in a Huge Array.
HugeArrayEnum()
is passed six arguments. The first two are a file handle and block handle; these specify the Huge Array to be examined. The third is a pointer to a Boolean callback routine. The fourth argument is the index of the first element to be examined (remember, the first element in the Huge Array has an index of zero). The fifth argument is the number of elements to examine, or -1 to examine through the last element. The sixth argument is a pointer which is passed unchanged to the callback routine; you can use this to pass data to the callback routine, or to keep track of a scratch space.
The callback routine, which must be declared _pascal, itself takes two arguments. The first is a pointer to an element in the huge array. The callback routine will be called once for each element in the specified range; each time, the first argument will point to the element being examined. The second argument is the pointer that was passed as the final argument to
HugeArrayEnum()
. The callback routine can make
HugeArrayEnum()
abort by returning
true
; this is useful if you need to search for a specific element. Otherwise, the callback routine should return
false
. If the callback routine aborts the enumeration,
HugeArrayEnum()
returns
true
; otherwise, it returns
false
.
HugeArrayEnum()
is guaranteed to examine the elements in numerical order, beginning with
startElement
. The routine will automatically stop with the last element, even if
count
elements have not been enumerated. However, the starting element must be the index of an element in the array.
Include: hugearr.h
Warnings: The callback routine may not allocate, free, or resize any elements in the Huge Array. All it should do is examine or change ( without resizing) a single element.
The starting element must be an element in the array. If you pass a starting index which is out-of-bounds, the results are undefined.
word HugeArrayExpand( void ** elemPtr, /* **elemPtr is element at location * where new elements will be * created */
word numElem, /* # of elements to insert */ const void * initData); /* Copy this into each new * element */
This routine inserts a number of elements at a specified location in a HugeArray. The element pointed to will be shifted so it comes after the newly-created elements. The pointer will be fixed up to point to the first new element. The data pointed to by initData will be copied into each new element. If initData is null, the new elements will be uninitialized.
If the elements are of variable size, this routine will insert a single element; this element will be
numElem
bytes long.
Include: hugearr.h
dword HugeArrayGetCount( VMFileHandle vmFile, VMBlockHandle vmBlock); /* Handle of directory block */
This routine returns the number of elements in a Huge Array.
Include: hugearr.h
void HugeArrayInsert( VMFileHandle vmFile, VMBlockHandle vmBlock, /* Handle of directory block */ word numElem, /* # of elements to insert */ dword elemNum, /* Index of first new element */ const void * initData); /* Copy this into each new element */
This routine inserts one or more elements in the midst of a Huge Array. The first new element will have index
elemNum
; thus, the element which previously had that index will now come after the new elements. The data pointed to by
initData
will be copied into each new element. If
initData
is null, the new elements will be uninitialized.
If the elements are of variable size, this routine will insert a single element; this element will be
numElem
bytes long.
Include: heap.h
dword HugeArrayLock( VMFileHandle vmFile, VMBlockhandle vmBlock, /* Handle of directory block */ dword elemNum, /* Element to lock */ void ** elemPtr, /* Pointer to element is written here */ word * elemSize);
This routine locks an element in a Huge Array. It writes the element's address to
*elemPtr
. The dword returned indicates how many elements come before and after the element in that blok The upper word indicates how many elements come before the locked one, counting the locked element; the lower word indicates how many elements come after the locked element, again counting the locked one. If an error occured, then the lower word of the return value will be zero.
The routine also writes the size of the locked element (in bytes) to
*elemSize
. You may examine or change all the other elements in the block without making further calls to
HugeArrayLock()
.
Include: heap.h
See Also: HAL_COUNT()
,
HAL_PREV()
.
word HugeArrayNext( void ** elemPtr, word * size);
This routine increments a pointer to an element in a HugeArray to point to
the next element. If the element was the last element in its block,
HugeArrayNext()
will unlock its block and lock the next one.
The routine writes the pointer to *elemPtr; it returns the number
of elements which come after the newly-locked one in its block, counting
the newly-locked element. If this routine is passed a pointer to the last
element in a HugeArray, it returns zero and elemPtr will point
to the last element.
If the elements are variable-sized, then the word pointed to by size will be updated to reflect the size of the newly-locked element; otherwise, the value will be undefined.
Include: heap.h
Warnings: This routine may unlock the block containing the passed element. Therefore, if you need to mark the block as dirty, do so before making this call.
word HugeArrayPrev( void ** elemPtr1, /* indicates current element */ void ** elemPtr2, word * size);
This routine decrements a pointer to an element in a HugeArray to point to
the previous element. If the element was the first element in its block,
HugeArrayPrev()
will unlock its block and lock the previous
one. The routine writes the pointer to *elemPtr1, and writes a
pointer to the first element in the block in *elemPtr2
. It
returns the number of elements which come before the newly-locked one in
its block, counting the newly-locked element. If this routine is passed a
pointer to the first element in a HugeArray, it returns zero and
*elemPtr1 will point to the first element.
If the elements are variable-sized, then the word pointed to by size will be updated to reflect the size of the newly-locked element; otherwise, the value will be undefined.
Include: hugearr.h
Warnings: This routine may unlock the block containing the passed element. Therefore, if you need to mark the block as dirty, do so before making this call.
void HugeArrayReplace( VMFileHandle file, VMBlockHandle vmblock, /* Handle of directory block */ word numElem, /* # of elements to replace */ dword elemNum, /* First element to replace */ const void * initData); /* Copy this into each element
This routine replaces one or more elements with copies of the passed data. If initData is null, the elements will be filled with null bytes.
If the elements are of variable size, a single element will be resized; its new size will be
numElem
bytes long.
Include: hugearr.h
See Also: HugeArrayResize()
.
void HugeArrayResize( VMFileHandle vmFile, VMBlockHandle vmBlock, /* Handle of directory block */ dword elemNum, /* Resize this element */ word newSize); /* New size in bytes */
This routine resizes an element in a Huge Array. The array must contain variable-sized elements. If the new size is larger than the old, the extra space will be zero-initialized. If it is smaller, the element will be truncated.
Include: hugearr.h
void HugeArrayUnlock( void * elemPtr);
This routine unlocks the block of a HugeArray which contains the passed element.
Include: hugearr.h
Warnings: If you have changed any of the elements in the block, be sure to call
HugeArrayDirty()
before
you unlock the block; otherwise the block might be discarded.
IACPConnection IACPConnect( GeodeToken *list, IACPConnectFlags flags, MemHandle appLaunchBlock, optr client, word *numServers);
This routine establishes a connection between a client object (by default the calling thread's application object) and one or more servers registered with the indicated list.
The
client
argument should be
NullOptr
unless the IACPCF_CLIENT_OD_SPECIFIED flag is set in the flags parameter.
Include: iacp.goh
MemHandle IACPCreateDefaultLaunchBlock( word appMode);
This routine creates a memory block holding an
AppLaunchBlock
structure suitable for passing to
IACPConnect()
. The two valid values to pass in
appMode
are
MSG_GEN_PROCESS_OPEN_APPLICATION
and
MSG_GEN_PROCESS_OPEN_ENGINE
.
Include: iacp.goh
void IACPFinishConnect( IACPConnection connection, optr server);
Finishes a connection made to a server which had to change from non-interactible to interactible.
Include: iacp.goh
word IACPGetServerNumber( IACPConnection connection, optr server);
This routine retrieves the server number for a particular server in a particular connection. It returns the server number.
Include: iacp.goh
void IACPLostConnection( optr oself, IACPConnection connection);
This routine is called by IACP server objects to handle when a client closes a connection.
Include: iacp.goh
| HugeArrayPrev() ... | ImpexExportToMetafile() ...
void IACPProcessMessage( optr oself, EventHandle msgToSend, TravelOption topt, EventHandle completionMsg);
This is a utility routine to dispatch an encapsulated message handed to an object by an IACP connection.
Include: iacp.goh
void IACPRegisterDocument( optr server, word disk, dword fileID);
This routine registers an open document and the server object for it.
This routine is to be used only by servers, not by clients, and should only be used by the creator of the document. There is no provision for using IACP to connect to a server that is not the creator of the document in question.
Include: iacp.goh
void IACPRegisterServer( GeodeToken *list, optr server, IACPServerMode mode, IACPServerFlags flags);
This routine registers an object as a server for the IACP server list specified by the passed token.
Include: iacp.goh
word IACPSendMessage( IACPConnection connection, EventHandle msgToSend, TravelOption topt, EventHandle completionMsg, IACPSide side);
This routine sends the message event via IACP to all the objects on the other side of an IACP connection.
Include: iacp.goh
word IACPSendMessageAndWait( IACPConnection connection, EventHandle msgToSend, TravelOption topt, IACPSide side);
This routine sends a recorded message to all the objects on the
other side of an IACP connection, and waits until
the other application responds that it has received the message via
IACP. This does not mean the message has been handled by the other
application, only that the other application was given the EventHandle
and
will try to deal with it. This is useful when passing volatile data.
Include: iacp.goh
word IACPSendMessageToServer( IACPConnection connection, EventHandle msgToSend, TravelOption topt, EventHandle completionMsg, word serverNum);
This routine sends a message to a specific server on the other side of an IACP connection.
Include: iacp.goh
void IACPShutdown( IACPConnection connection, optr serverOD);
This routine removes a server or client from an IACP connection.
Include: iacp.goh
void IACPShutdownAll( optr obj);
This calls IACPShutdown()
for all connections to which the passed object is a party. It's
primarily used by GenApplicationClass
when the application
is exiting.
Include: iacp.goh
void IACPUnregisterDocument( optr server, word disk, dword fileID);
This routine unregisters an open document and the server object for it.
Include: iacp.goh
void IACPUnregisterServer( GeodeToken *token, optr object);
This removes the specified server object from the indicated IACP server list.
Include: iacp.goh
TransError ImpexCreateTempFile( char * buffer, word fileType, FileHandle * file, MemHandle * errorString);
This routine creates and opens a unique temporary file to be used by translation libraries for file importing and exporting. The routine is called only by translation libraries.
The routine is passed the following arguments:
buffer
fileType
file
*file
.
errString
ImpexCreateTempFile
fails with error condition
TE_CUSTOM it will allocate a block containing an error string.
It will write the block's handle to *errString
.
It is the caller's responsibility to free this block when it's
done with it.
If ImpexCreateTempFile
is successful, it returns
TE_NO_ERROR (which equals zero). If it fails, it returns a member
of the TransferErrors
enumerated type (usually TE_METAFILE_CREATION_ERROR).
When you're done with the temporary file, call FileClose()
.
Include: impex.goh
Warnings: If you close this file, the system may delete it at any time. Ordinarily you should close it with ImpexDeleteTempFile() , which deletes the file immediately.
If the routine does not fail with condition TE_CUSTOM, *errString
may contain a random value. Do not use *errString
if the routine did not return TE_CUSTOM.
TransError ImpexDeleteTempFile( const char * buffer, FileHandle tempFile, word fileType);
This routine closes, then deletes, a temporary file which was created by ImpexCreateTempFile() . It is passed the following arguments:
buffer
tempFile
fileType
errString
ImpexDeleteTempFile
fails with error condition
TE_CUSTOM it will allocate a block containing an error string.
It will write the block's handle to *errString
.
It is the caller's responsibility to free this block when it's
done with it.
ImpexDeleteTempFile()
closes the specified file,
then deletes it. If it is successful, it returns TE_NO_ERROR (i.e.
zero); otherwise, it returns an appropriate member of the TransError
enumerated type.
Include: impex.goh
Warnings: If the routine does not fail with condition
TE_CUSTOM, *errString
may contain a random value.
Do not use *errString
if the routine did not return
TE_CUSTOM.
TransError ImpexExportToMetafile( Handle xlatLib, VMFileHandle xferFile, FileHandle metafile, dword xferFormat, word arg1, word arg2, MemHandle * errString);
This routine is used by translation libraries. The routine calls an intermediate translation library to finish translating a given file into the GEOS Metafile format.
Include: impex.goh
Warnings: If the routine does not fail with condition TE_CUSTOM,
*errString
may contain a random value. Do not use
*errString
if the routine did not return TE_CUSTOM.
void ImpexImportExportCompleted( ImpexTranslationParams * itParams);
The application should send this message when it is finished importing or exporting data. The routine will send an appropriate acknowledgment message to the ImportControl or ExportControl object, depending on the settings of
ITP_impexOD
and ITP
_returnMsg
.
If the application has just finished an import, it should not have changed the
ImpexTranslationParams
structure. If it had just finished preparing data for export, it should have set the ITP
_transferVMChain
field to contain the handle of the head of the VM chain.
Warnings: This routine, in essence, informs the ImportControl or ExportControl object that the application is finished with the transfer file. The ImportControl will respond by destroying the transfer file; the ExportControl will call the appropriate translation library to produce an output file. Therefore, an application should not call this routine until it is absolutely finished with the transfer file.
TransError ImpexExportToMetafile( Handle xlatLib, VMFileHandle xferFile, FileHandle metafile, dword * xferFormat, word arg1, word arg2, MemHandle * errString);
This routine is used by translation libraries. The routine calls an intermediate translation library to translate a given file from the GEOS Metafile format to an intermediate format.
Include: impex.goh
Warnings: If the routine does not fail with condition TE_CUSTOM,
*errString
may contain a random value. Do not use
*errString
if the routine did not return TE_CUSTOM.
void InitFileCommit(void);
This routine commits any changes to the GEOS.INI file, removing and replacing its stored backup. It ensures that no other threads are working on the file during the commit operation.
Include: initfile.h
void InitFileDeleteCategory( const char *category);
This routine deletes the specified category, along with all its entries, from the GEOS.INI file. Pass it the following:
category
Include: initfile.h
void InitFileDeleteEntry( const char *category, const char *key);
This routine deletes an entry in the GEOS.INI file. Pass it the following:
category
key
Include: initfile.h
void InitFileDeleteStringSection( const char * category, const char * key, word stringNum);
This routine deletes the specified string section from the given blob in the GEOS.INI file. Pass it the following:
category
key
stringNum
Include: initfile.h
Boolean InitFileEnumStringSection( const char * category, const char * key, InitFileReadFlags flags, Boolean _pascal (*callback) (const char * stringSection, word sectionNum, void * enumData), void * enumdata);
This routine enumerates a particular blob, allowing a callback routine to process each of the string sections in it. The routine will stop processing either after the last string section or when the callback routine returns
true
.
Pass this routine the following:
category
key
flags
InitFileReadFlags
indicating the method of character conversion upon reading (upcase all, downcase all, do not change).
callback
InitFileEnumStringSection()
does not use it.
This routine returns a Boolean value. It returns
true
if the callback routine halted the enumeration by returning
true
; otherwise, it returns
false
.
Callback Routine:
The callback routine may do anything it wants with the string section it receives. It must be declared _pascal. It must return a Boolean value: If it returns
true
,
InitFileEnumStringSection()
will stop processing the blob. If it returns
false
, processing will continue to the next string section, if any. The callback will receive the following parameters:
stringSection
sectionNum
enumData
InitFileEnumStringSection()
.Include: initfile.h
dword InitFileGetTimeLastModified(void);
This routine returns the time when the GEOS.INI file was last modified. The returned time is the value of the system counter when the file was last written.
Include: initfile.h
void InitFileMakeCanonicKeyCategory( char *keyCat, const TCHAR *src);
Converts a SBCS/DBCS (depending on GEOS version) string to an ASCIIX string without special INI characters. This is used to convert any type of string to one suitable for use as an INI file key or category.
Pass:
Include: initfile.h
Version: This routine is available on builds 4 or greater of the Nokia 9000i Communicator (see the Versions chapter for more information).
Boolean InitFileReadBoolean( const char * category, const char * key, Boolean * bool);
This routine reads a Boolean entry in the GEOS.INI file, copying it into a passed buffer. It returns the first instance of the category/key combination it encounters, searching the local INI file first. Thus, local settings will always override system or network settings.
This routine is used for reading data written with
InitFileWriteBoolean()
. Pass it the following parameters:
category
key
bool
The function's return value will be
true
if an error occurs or if the entry could not be found; it will be
false
otherwise.
Warnings: The return value of this function is
not
the Boolean stored in the GEOS.INI file. That value is returned in the Boolean pointed to by
bool
.
Include: initfile.h
Boolean InitFileReadDataBlock( const char * category, const char * key, MemHandle * block, word * dataSize);
This routine reads an entry in the GEOS.INI file, allocating a new block and copying the data into it. The routine returns the first instance of the category/key combination it encounters, searching the local INI file first. Thus, local settings will always override system or network settings.
This routine is used for reading data written with
InitFileWriteData()
. Pass it the following parameters:
category
key
block
dataSize
The function's return value will be
true
if an error occurs or if the entry could not be found; it will be
false
otherwise.
Include: initfile.h
Boolean InitFileReadDataBuffer( const char * category, const char * key, void * buffer, word bufSize, word * dataSize);
This routine reads an entry in the GEOS.INI file, copying it into a passed buffer. It returns the first instance of the category/key combination it encounters, searching the local INI file first. Thus, local settings will always override system or network settings.
This routine is used for reading data written with
InitFileWriteData()
. Pass it the following parameters:
category
key
buffer
bufSize
InitFileReadDataBlock()
.
dataSize
The function's return value will be
true
if an error occurs or if the entry could not be found; it will be
false
otherwise.
Include: initfile.h
Boolean InitFileReadInteger( const char * category, const char * key, word * i);
This routine reads an integer entry in the GEOS.INI file, copying it into the passed variable. It returns the first instance of the category/key combination it encounters, searching the local INI file first. Thus, local settings will always override system or network settings.
This routine is used for reading data written with
InitFileWriteInteger()
. Pass it the following parameters:
category
key
i
The function's return value will be
true
if an error occurs or if the entry could not be found; it will be
false
otherwise.
Include: initfile.h
Boolean InitFileReadStringBlock( const char * category, const char * key, MemHandle * block, InitFileReadFlags flags, word * dataSize);
This routine reads a string entry in the GEOS.INI file, allocates a new block on the global heap, and copies the read string into the new block. It returns the first instance of the category/key combination it encounters, searching the local INI file first. Thus, local settings will always override system or network settings.
This routine is used for reading data written with
InitFileWriteString()
. Pass it the following parameters:
category
key
block
flags
InitFileReadFlags
indicating the method of character conversion upon reading (upcase all, downcase all, do not change).
dataSize
The function's return value will be
true
if an error occurs or if the entry could not be found; it will be
false
otherwise.
Include: initfile.h
Boolean InitFileReadStringBuffer( const char * category, const char * key, char * buffer, InitFileReadFlags flags, word * dataSize);
This routine reads a string entry in the GEOS.INI file, copying it into a passed, locked buffer. It returns the first instance of the category/key combination it encounters, searching the local INI file first. Thus, local settings will always override system or network settings.
This routine is used for reading data written with
InitFileWriteString()
. Pass it the following parameters:
category
key
buffer
InitFileReadStringBlock()
.
flags
InitFileReadFlags
indicating the size of the passed buffer as well as the method of character conversion upon reading (upcase all, downcase all, do not change).
dataSize
The function's return value will be
true
if an error occurs or if the entry could not be found; it will be
false
otherwise.
Include: initfile.h
Boolean InitFileReadStringSectionBlock( const char * category, const char * key, word section, MemHandle * block, InitFileReadFlags flags, word * dataSize);
This routine reads a string section from the specified entry in the GEOS.INI file, allocates a new block on the global heap, and copies the read string section into the new block. It returns the first instance of the category/key combination it encounters, searching the local INI file first. Thus, local settings will always override system or network settings.
This routine is used for reading data written with
InitFileWriteString()
or
InitFileWriteStringSection()
. Pass it the following parameters:
category
key
section
block
flags
InitFileReadFlags
indicating the method of character conversion upon reading (upcase all, downcase all, do not change).
dataSize
The function's return value will be
true
if an error occurs or if the entry could not be found; it will be
false
otherwise.
Include: initfile.h
Boolean InitFileReadStringSectionBuffer( const char * category, const char * key, word section, char * buffer, InitFileReadFlags flags, word * dataSize);
This routine reads a string section from the specified entry in the GEOS.INI file, copying it into a passed, locked buffer. It returns the indicated section in the first instance of the category/key combination it encounters, searching the local INI file first. Thus, local settings will always override system or network settings.
This routine is used for reading data written with
InitFileWriteStringSection()
. Pass it the following parameters:
category
key
section
buffer
InitFileReadStringSectionBlock()
.
flags
InitFileReadFlags
indicating the size of the passed buffer as well as the method of character conversion upon reading (upcase all, downcase all, do not change).
dataSize
The function's return value will be
true
if an error occurs or if the entry could not be found; it will be
false
otherwise.
Include: initfile.h
Boolean InitFileRevert(void);
This routine restores the GEOS.INI file from its saved backup version. It ensures that no other thread is operating on the file while it is being restored. This function returns an error flag:
true
represents an error in restoring the file;
false
indicates success.
Include: initfile.h
Boolean InitFileSave(void);
This routine saves the GEOS.INI file synchronously by updating the backup file to be the current version. (
InitFileCommit()
actually overwrites the GEOS.INI file itself.) It ensures that no other thread is operating on the file while it is being written out. This function returns an error flag:
true
represents an error in trying to save the file;
false
indicates success.
Include: initfile.h
void InitFileWriteBoolean( const char * category, const char * key, Boolean bool);
This integer writes a Boolean value into the specified category and key of the local GEOS.INI file. The Boolean will appear as "true" or "false" if the user looks at GEOS.INI with a text editor, but it will be an actual Boolean value to GEOS. Pass this routine the following:
category
key
category
into which the data should be written.
bool
Once written, the Boolean value can be read with
InitFileReadBoolean()
.
Include: initfile.h
void InitFileWriteData( const char *category, const char *key, const void *buffer, word bufSize);
This routine writes a given piece of data to the local GEOS.INI file. Pass it the following:
category
key
category
into which the data should be written.
buffer
bufSize
Once data has been written to the INI file, it can be read with
InitFileReadDataBlock()
or
InitFileReadDataBuffer()
.
Include: initfile.h
void InitFileWriteInteger( const char *category, const char *key, word value);
This routine writes an integer into the category and key specified for the local GEOS.INI file. Pass the following:
category
key
category
into which the data should be written.
value
The integer, once written, can be read with
InitFileReadInteger()
.
Include: initfile.h
void InitFileWriteString( const char *category, const char *key, const char *str);
This routine writes an entire string into the category and key specified for the local GEOS.INI file. Pass it the following:
category
key
category
into which the data should be written.
str
To read a string written with this routine, use
InitFileReadStringBlock()
or
InitFileReadStringBuffer()
.
Include: initfile.h
void InitFileWriteStringSection( const char *category, const char *key, const char *string);
This routine appends a string section onto the blob specified by the
category
and
key
parameters. The string section will become part of the blob and will be its last section. The section may not contain any carriage returns or line feeds. Pass this routine the following:
category
key
category
into which the data should be written.
string
Once written, the segment may be read with
InitFileReadStringSectionBlock()
or
InitFileReadStringSectionBuffer()
.
Include: initfile.h
void InkDBGetDisplayInfo( InkDBDisplayInfo * retVal, VMFileHandle fh);
This routine returns the dword ID of the note or folder which is presently being displayed by the Ink Database. It also returns the ID of the parent folder, and the page number, if applicable.
Structures: It returns this information by filling in an
InkDBDisplayInfo
structure:
typedef struct { dword IDBDI_currentDisplay; dword IDBDI_parentFolder; word IDBDI_pageNumber; } InkDBDisplayInfo;
Include: pen.goh
dword InkDBGetHeadFolder( VMFileHandle fh);
This routine returns the dword ID of the head folder of an Ink Database file.
Include: pen.goh
void InkDBInit( VMFileHandle fh);
This routine takes a new Ink Database file. It initializes the file for use, creating all needed maps and a top-level folder.
Include: pen.goh
void InkDBSetDisplayInfo( VMFileHandle fh, dword ofh, /* Parent Folder dword ID# */ dword note, /* ID# of note or folder to display */ word page); /* If displaying note, page # to display*/
This routine sets the display information for an Ink Database file. This routine sets the user's location in the database. The caller must supply the dword ID number of the note or folder to display, the parent folder (0 if displaying the top level folder), and the page number to display if displaying a note.
Include: pen.goh
dword InkFolderCreateSubFolder( dword tag, /* ID# of parent folder (0 for top-level) */ VMFileHandle fh); /* Handle of Ink DB file */
This routine creates a subfolder within the passed folder. The new folder is automatically added to it's parent's chunk array. The return value is new folder's dword ID number.
Include: pen.goh
void InkFolderDelete( dword tag, /* ID# of folder */ VMFileHandle fh); /* Handle of Ink DB file */
This routine removes an Ink Database folder.
Include: pen.goh
word InkFolderDepthFirstTraverse( dword rfldr, /* ID# of folder at root of search tree */ VMFileHandle fh, /* Handle of Ink DB file */ Boolean _pascal (*callback)( /* far ptr to callback routine */ dword fldr, VMFileHandle fh, word * info),
word * info); /* Extra data to pass to callback */
This routine does a depth-first traversal of a folder tree. The callback routine, which must be declared _pascal, can halt the search by returning true , in which case the search routine will immediately return true ; otherwise the search will return false .
Include: pen.goh
void InkFolderDisplayChildInList( dword fldr, /* ID# of folder */ VMFileHandle fh, /* Handle of Ink DB file */ optr list, /* GenDynamicList */ word entry, /* entry number of child to display */ Boolean displayFolders); /* Include monikers in count, * return their monikers */
This routine requests that a dynamic list display the name of one of a folder's children. It is normally called in an applications
GDLI_queryMsg
handler.
Include: pen.goh
Boolean InkFolderDisplayChildInfo( /* true if folder; else note */ dword fldr, /* ID# of folder */ VMFileHandle fh, /* Handle of Ink DB file */ word entry, /* entry number of child */ dword * childID); /* Pointer to returned child ID # */
This routine returns information about one of a folder's children. The explicit return value will be true if the child is a folder, false if the child is a note. In addition, the passed dword pointer will point to the child's dword ID number.
Include: pen.goh
word InkFolderDisplayChildInList( dword fldr, /* ID# of folder */ VMFileHandle fh, /* Handle of Ink DB file */ dword note); /* ID# of child note or folder */
This routine returns the passed note or folder's entry number within its passed parent folder.
Include: pen.goh
DBGroupAndItem InkFolderGetContents( dword tag, /* ID# of folder */ VMFileHandle fh, /* Handle of Ink DB file */ DBGroupAndItem * subFolders); /* pointer to return value */);
This routine returns the contents of a folder. It returns two chunk arrays, each of which is filled with dword ID numbers of the folder's children. The explicitly returned array holds the numbers of the folder's child notes. The routine also fills in a pointer with a DB item holding a chunk array with the ID numbers of the subfolders.
Include: pen.goh
dword InkFolderGetNumChildren( /* Subfolders:Notes */ dword fldr, /* ID# of folder */ VMFileHandle fh); /* Handle of Ink DB file */
This message returns the number of children the Ink Database folder has. The high word of the return value holds the number of sub folders; the low word holds the number of notes.
Include: pen.goh
void InkFolderMove( dword fldr, /* ID# of folder to move */ dword pfldr);/* ID# of new parent folder */
This routine moves an Ink Database folder to a new location in the folder tree.
Include: pen.goh
void InkFolderSetTitle( dword tag, /* ID# of folder */ VMFileHandle fh, /* Handle of Ink DB file */ const char * name); /* Text object */);
This routine renames an Ink Database folder. The passed name should be null-terminated.
Include: pen.goh
void InkFolderSetTitleFromTextObject( dword tag, /* ID# of folder */ FileHandle fh, /* Handle of Ink DB file */ optr text); /* Text object */);
This routine sets the name of the passed Ink Database folder from the contents of the passed VisText object.
Include: pen.goh
void InkGetDocPageInfo( PageSizeReport * psr, /* Structure to fill with return value */ VMFileHandle fh);
This routine returns the dword ID of the head folder of an Ink Database file.
Include: pen.goh
GStateHandle InkGetDocCustomGString( VMFileHandle dbfh);
This routine returns the custom GString associated with the passed Ink Database file. Note that this custom background will only be used if the document's basic
InkBackgroundType
is IBT_CUSTOM. (This may be determined using the
InkSetDocGString()
routine.
Include: pen.goh
InkBackgroundType InkGetDocGString( VMFileHandle dbfh);
This routine returns the standard GString to use as a background picture with the passed Ink Database file. If the returned background type is custom, be sure to also call
InkGetDocCustomGString()
.
Include: pen.goh
dword InkGetParentFolder( dword tag, /* ID# of folder or note */ VMFileHandle fh); /* Handle of Ink DB file */
This message returns the dword ID of the passed Ink Database note or folder.
Include: pen.goh
word InkGetTitle( dword tag, /* ID# of folder or note */ VMFileHandle fh, /* Handle of Ink DB file */ char * dest); /* should be INK_DB_MAX_TITLE_SIZE +1 */);
This message fills the passed text buffer with the folder's or note's title, a null-terminated string. The routine's explicit return value is the length of the string (including the terminator).
Include: pen.goh
dword InkNoteCopyMoniker( dword title, /* ID# of parent folder */ optr list, /* Output list */ word type, /* 1: text note * 0: ink note * -1: folder */
word entry); /* Handle of Ink DB file */
This routine copies the icon nd title into the VisMoniker.
Include: pen.goh
dword InkNoteCreate( dword tag, /* ID# of parent folder */ VMFileHandle fh); /* Handle of Ink DB file */
This routine creates a note and adds it to the passed folder's child list. The new note's dword ID is returned.
Include: pen.goh
word InkNoteCreatePage( dword tag, /* ID# of note */ VMFileHandle fh, /* Handle of Ink DB file */ word page); /* Page number to insert before, * CA_NULL_ELEMENT to append */
This routine creates a new page within a note. It returns the new page number.
Include: pen.goh
void InkNoteDelete( dword tag, /* ID# of note */ VMFileHandle fh); /* Handle of Ink DB file */
This message deletes the passed note. All references to the note are deleted.
Include: pen.goh
ChunkHandle InkNoteFindByKeywords( /* Return value is chunk array with elements: * FindNoteHeader * -dword tag- * -dword tag- * etc... */
VMFileHandle fh, char * strings, /* strings to match (separated by * whitespace or commas), can contain * C_WILDCARD or C_SINGLE_WILDCARD */
word opt, /* true to match all keywords; * false to match at least one keyword */
This routine returns a chunk array containing the dword ID numbers of all notes whose keywords match the passed search string, preceded by the number of matching notes. If no such notes are found, then the returned handle will be NULL.
Note that this routine will only return about 20K notes; if there are more that match, only the first 20K will be returned.
Include: pen.goh
ChunkHandle InkNoteFindByTitle( /* Return value is chunk array with elements: * FindNoteHeader * -dword tag- * -dword tag- * etc... */
const char * string, /* string to match (can contain C_WILDCARD * or C_SINGLE_WILDCARD */
SearchOptions opt, /* Search options */ Boolean Body, /* true if you want to look in the body * of text notes */
VMFileHandle fh); /* Handle of Ink DB file */
This routine returns a chunk array containing the dword ID numbers of all notes whose titles match the passed search string, preceded by the number of matching notes. If no such notes are found, then the returned handle will be NULL.
Note that this routine will only return about 20K notes; if there are more that match, only the first 20K will be returned.
Include: pen.goh
dword InkNoteGetCreationDate( dword tag, /* ID# of note */ VMFileHandle fh); /* Handle of Ink DB file */
This routine gets a note's creation date.
Include: pen.goh
void InkNoteGetKeywords( dword tag, /* ID# of note */ VMFileHandle fh, /* Handle of Ink DB file */ char * text); /* String to hold return value */);
This routine fills the passed buffer with the note's keywords. The target buffer should be of atleast length INK_DB_MAX_NOTE_KEYWORDS_SIZE +1. The string will be null-terminated.
Include: pen.goh
dword InkNoteGetModificationDate( dword tag, /* ID# of note */ VMFileHandle fh); /* Handle of Ink DB file */
This routine gets a note's modification date.
Include: pen.goh
NoteType InkNoteGetNoteType( /* 0: Ink, 1: Text */ dword tag, /* ID# of note */ VMFileHandle fh); /* Handle of Ink DB file */
This routine gets a note's
NoteType
: NT_INK or NT_TEXT.
Include: pen.goh
word InkNoteGetNumPages( dword tag); /* ID# of note */
This routine returns the number of pages within the passed note.
Include: pen.goh
DBGroupAndItem InkNoteGetPages( dword tag, /* ID# of note */ VMFileHandle fh); /* Handle of Ink DB file */
This routine returns a DB group and item containing a chunk array. The chunk array contains the page information of the note, either compressed pen data or text. Each array element holds one page of data.
Include: pen.goh
void InkNoteLoadPage( dword tag, /* ID# of note */ VMFileHandle fh, /* Handle of Ink DB file */ word page, /* Page number */ optr obj, /* an Ink or VisText object */ word type); /* note type 0: ink, 1: text */
This routine loads a visual object (Ink or Text) with the contents of the passed Ink Database page. Be sure to load only the correct type of data into an object.
Include: pen.goh
void InkNoteMove( dword tag, /* ID# of note */ dword pfolder, /* ID# of new parent folder */ VMFileHandle fh); /* Handle of Ink DB file */
This message moves the passed note to a new location. All references to the note are suitably altered.
Include: pen.goh
void InkNoteSavePage( dword tag, /* ID# of note */ VMFileHandle fh, /* Handle of Ink DB file */ word page, /* Page number */ optr obj, /* an Ink or VisText object */ word type); /* note type 0: ink, 1: text */
This routine saves the contents of a visual object (Ink or Text) to the passed Ink Database page.
Include: pen.goh
void InkNoteSendKeywordsToTextObject( dword tag, /* ID# of note */ VMFileHandle fh, /* Handle of Ink DB file */ optr text); /* Text object to set */);
This message replaces the passed VisText object's text with the keywords from the passed folder or note of an Ink Database file.
Include: pen.goh
void InkNoteSetKeywords( dword tag, /* ID# of note */ VMFileHandle fh, /* Handle of Ink DB file */ const char * text); /* Keyword string */);
This message sets an Ink Database note's keywords. The passed string should be null-terminated.
Include: pen.goh
void InkNoteSetKeywordsFromTextObject( dword tag, /* ID# of note */ VMFileHandle fh, /* Handle of Ink DB file */ optr * text); /* Text object */);
This message sets an Ink Database note's keywords by copying them from the passed text object.
Include: pen.goh
void InkNoteSetModificationDate( word tdft1, /* First two words of */ word tdft2, /* TimerDateAndTime structure */ dword note, /* ID# of note */ FileHandle fh); /* Handle of Ink DB file */
This routine sets a note's modification date.
Include: pen.goh
void InkNoteSetNoteType( dword tag, /* ID# of note */ VMFileHandle fh, /* Handle of Ink DB file */ NoteType nt); /* NT_INK or NT_TEXT */
This routine sets a note's type: text or ink.
Include: pen.goh
void InkNoteSetTitle( dword tag, /* ID# of note */ VMFileHandle fh, /* Handle of Ink DB file */ const char * name); /* Text object */);
This message renames an Ink Database note. The passed name should be null-terminated. The string may be up to INK_DB_MAX_NOTE_KEYWORDS_SIZE +1 in length.
Include: pen.goh
void InkNoteSetTitleFromTextObject( dword tag, /* ID# of note */ FileHandle fh, /* Handle of Ink DB file */ optr text); /* Text object */);
This message sets the name of the passed Ink Database note from the contents of the passed VisText object.
Include: pen.goh
void InkSendTitleToTextObject( dword tag, /* ID# of folder or note */ VMFileHandle fh, /* Handle of Ink DB file */ optr to); /* Text object to set */);
This message replaces the passed VisText object's text with the name from the passed folder or note of an Ink Database file.
Include: pen.goh
void InkSetDocCustomGString( VMFileHandle dbfh, Handle gstring);
This routine sets the custom GString to use as a background for the passed Ink Database file. Note that this custom background will only be used if the document's basic
InkBackgroundType
is IBT_CUSTOM. (Set this using the
InkSetDocGString()
routine.)
Include: pen.goh
void InkSetDocGString( VMFileHandle dbfh, InkBackgroundType type);
This routine sets the standard GString to use as a background picture with the passed Ink Database file. If the passed background type is custom, be sure to also call
InkSetDocCustomGString()
.
Include: pen.goh
void InkSetDocPageInfo( PageSizeReport * psr, VMFileHandle fh);
Set the page information for an Ink Database file.
Include: pen.goh
word IntegerOf( WWFixedAsDWord wwf)
This macro returns the integral portion of a
WWFixedAsDWord
value.
Include: geos.h
int LocalIsAlphaNumeric( int __C);
This routine returns true if the passed character is alphanumeric.
Warnings: If you pass a char to this routine, beware: the routine takes an integer, and if the passed value gets sign-extended, the result may not be what you expect.
Include: localize.h
int isalpha( int __C);
This routine returns true if the passed character is alphabetic.
Warnings: If you pass a char to this routine, beware: the routine takes an integer, and if the passed value gets sign-extended, the result may not be what you expect.
Include: localize.h
int iscntrl( int __C);
This routine returns true if the passed character is a control character.
Warnings: If you pass a char to this routine, beware: the routine takes an integer, and if the passed value gets sign-extended, the result may not be what you expect.
Include: localize.h
int isdigit( int __c);
This routine returns true if the passed character is a decimal digit.
Warnings: If you pass a char to this routine, beware: the routine takes an integer, and if the passed value gets sign-extended, the result may not be what you expect.
Include: localize.h
int isgraph( wint __C);
This routine returns true if the passed character is displayable.
Warnings: If you pass a char to this routine, beware: the routine takes an integer, and if the passed value gets sign-extended, the result may not be what you expect.
Include: localize.h
int islower( int __C);
This routine returns true if the passed character is a lower case alphabetic character.
Warnings: If you pass a char to this routine, beware: the routine takes an integer, and if the passed value gets sign-extended, the result may not be what you expect.
Include: localize.h
int isprint( int __C);
This routine returns true if the passed character is printable (i.e. takes up a space when printing).
Warnings: If you pass a char to this routine, beware: the routine takes an integer, and if the passed value gets sign-extended, the result may not be what you expect.
Include: localize.h
int ispunct( int __c);
This routine returns true if the passed character is a punctuation mark.
Warnings: If you pass a char to this routine, beware: the routine takes an integer, and if the passed value gets sign-extended, the result may not be what you expect.
Include: localize.h
int isspace( int __c);
This routine returns true if the passed character is whitespace.
Warnings: If you pass a char to this routine, beware: the routine takes an integer, and if the passed value gets sign-extended, the result may not be what you expect.
Include: localize.h
int isupper( int __c);
This routine returns true if the passed character is an upper case alphabetic character.
Warnings: If you pass a char to this routine, beware: the routine takes an integer, and if the passed value gets sign-extended, the result may not be what you expect.
Include: localize.h
int isxdigit( int __C);
This routine returns true if the passed character is a hexadecimal digit.
Warnings: If you pass a char to this routine, beware: the routine takes an integer, and if the passed value gets sign-extended, the result may not be what you expect.
Include: localize.h
ChunkHandle LMemAlloc( MemHandle mh, /* Handle of block containing heap */ word chunkSize); /* Size of new chunk in bytes */
This routine allocates a new chunk in the LMem heap. The heap must be locked or fixed. It allocates a chunk, expanding the chunk table if enccessary, and returns the chunk's handle. The chunk is not zero-initialized. If the chunk could not be allocated, it returns a null handle. Chunks are dword-aligned, so the chunk's actual size may be slightly larger than you request.
Include: lmem.h
Be Sure To: Lock the block on the global heap (unless the block is fixed).
Warnings: The heap may be compacted; thus, all pointers to chunks are invalidated. If LMF_NO_EXPAND is not set, the heap may be resized (and thus moved), thus invalidating all pointers to that block. Even fixed blocks can be resized and moved.
See Also: LMemDeref()
,
LMemReAlloc()
.
void LMemContract( MemHandle mh); /* Handle of LMem heap */
This routine contracts an LMem heap; that is, it deletes all the free chunks, moves all the used chunks to the beginning of the heap (right after the chunk handle table), and resizes the block to free the unused space at the end. It's a good idea to call this routine if you have just freed a lot of chunks, since that will free up some of the global heap. The LMem heap is guaranteed not to move; however, all pointers to chunks will be invalidated.
Be Sure To: Lock the block on the global heap (if it isn't fixed).
Include: lmem.h
void LMemDeleteAt( optr chunk, /* Chunk to resize */ word deleteOffset, /* Offset within chunk of first * byte to be deleted */
word deleteCount); /* # of bytes to delete */
This routine deletes a specified number of bytes from inside a chunk. It is guaranteed not to cause the heap to be resized or compacted; thus, pointers to other chunks remain valid.