Jump to content

GPIGuide - Graphics Orders: Difference between revisions

From EDM2
 
(3 intermediate revisions by the same user not shown)
Line 486: Line 486:


===End Area===
===End Area===
This order indicates the end of a set of primitives that define an area boundary.
====Syntax====
;End Area (GEAR)
: X'60' (LEN, DATA[LEN])
====Parameters====
;LEN (GLENGTH1)
: Length of following data. It is normally 0.
;DATA[LEN] (GBIT8)
: Reserved value, must be 0.
===End Element===
===End Element===
This order identifies the end of a set of primitives that define an element.
====Syntax====
;End Element (GEEL)
: X'49' (RES)
====Parameters====
;RES (GBIT8)
: Reserved value, must be 0.
===End Image===
===End Image===
This order identifies the end of an image definition.
====Syntax====
;End Image (GEIMG)
: X'93' (LEN, DATA[LEN])
====Parameters====
;LEN (GLENGTH1)
: Length of following data. It is normally 0.
;DATA[LEN] (GBIT8)
: Reserved value, must be 0.
===End of Symbol Definition===
===End of Symbol Definition===
This order indicates the end of a set of orders defining a graphics symbol.
====Syntax====
;End of Symbol Definition (GESD)
: X'FF'
====Remarks====
This order is only valid in the context of symbol definitions.
===End Path===
===End Path===
This order ends the definition of a path.
====Syntax====
;End Path (GEPTH)
: X'7F' (RES)
====Parameters====
;RES (GBIT8)
: Reserved value, must be 0.
===End Prolog===
===End Prolog===
This order indicates the end of the prolog of a segment.
====Syntax====
;End Prolog (GEPROL)
: X'3E' (RES)
====Parameters====
;RES (GBIT8)
: Reserved value, must be 0.
===Escape===
===Escape===
This order provides facilities for registered and unregistered escape functions.
====Syntax====
;Escape (GESCP)
: X'D5' (LEN, TYPE, RID, PARMS)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;TYPE (GBIT8)
: Type identifier:
:; 80
:: Registered value
:; Other
:: All other values are unregistered.
;RID (GBIT8)
: Registered identifier:
:; 01
:: Set pel.
:; 02
:: BITBLT function.
:; 03
:: Flood fill function.
:; 04
:: Draw bits function.
;PARMS (GSTR)
: Parameters of escape.
===Extended Escape===
===Extended Escape===
This order provides facilities for registered and unregistered escape functions.
====Syntax====
;Extended Escape (GEESCP)
: X'FED5' (LEN, TYPE, RID, PARMS)
====Parameters====
;LEN (GLENGTH2)
: Length of following data.
;TYPE (GBIT8)
: Type identifier:
:; 0x80
:: Registered value
:; Other
:: All other values are unregistered.
;RID (GUCHAR)
: Registered identifier.
: No registered extended escapes are used by the OS/2* operating system.
;PARMS (GSTR)
: Parameters of escape.
===Fill Path===
===Fill Path===
This order fills the interior of the specified path.
====Syntax====
;Fill Path (GFPTH)
: X'D7' (LEN, FLAGS, RES, PTHID)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
:; 0x06
:: Only valid value.
;FLAGS
: Extra functions:
:; RES1 (GBIT1)
:: Reserved value, must be 0.
:; INSIDE (GBIT1)
:: Values:
::: 0 Alternate mode
::: 1 Winding mode.
:; MOD (GBIT1)
:: Values:
::: 0 Do not modify before filling
::: 1 Modify path before filling.
:; RES2 (GBIT5)
:: Reserved value, must be 0.
;RES (GBIT8)
: Reserved value, must be 0.
;PTHID (GLONG)
: Path identifier.
:; 0x00000001-0xFFFFFFFF
:: Valid path identifiers.
===Fillet at Given Position/Fillet at Current Position===
===Fillet at Given Position/Fillet at Current Position===
These orders draw a curved line tangential to a specified set of straight lines, at the given position or at the current position.
====Syntax====
;Fillet at Given Position (GFLT)
: X'C5' (LEN, P0, P1, P2, PN)
;Fillet at Current Position (GCFLT)
: X'85' (LEN, P1, P2, PN)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;P0 (GPOINT)
: Coordinate data of line start.
: This parameter is only present in a Fillet at Given Position order.
;P1 (GPOINT)
: Coordinate data of first line end.
;P2 (GPOINT)
: Coordinate data of second line end.
;PN (GPOINT)
: Coordinate data of final line end.
===Full Arc at Given Position/Full Arc at Current Position===
===Full Arc at Given Position/Full Arc at Current Position===
This order constructs a full circle or an ellipse, with the center at a given position.
====Syntax====
;Full Arc at Given Position (GFARC)
: X'C7' (LEN, P0, M)
;Full Arc at Current Position (GCFARC)
: X'87' (LEN, M)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;P0 (GPOINT)
: Coordinate data of the center of the circle/ellipse.
: This parameter is only present in a Full Arc at Given Position order.
;M (GROFUFS)
: Multiplier.
===Image Data===
===Image Data===
This order provides bit data for an image.
====Syntax====
;Image Data (GIMD)
: X'92' (LEN, DATA[LEN])
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;DATA[LEN] (GBIT8)
: Image data.
===Label===
===Label===
This order is used to label an element within a segment.
====Syntax====
;Label (GLBL)
: X'D3' (LEN, LDATA)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
:; 0x04
:: Only valid value.
;LDATA (GLONG)
: Label value.
===Line at Given Position/Line at Current Position===
===Line at Given Position/Line at Current Position===
This order defines one or more connected straight lines, drawn from the given position.
====Syntax====
;Line at Given Position (GLINE)
: X'C1' (LEN, P0, P1, PN)
;Line at Current Position (GCLINE)
: X'81' (LEN, P1, PN)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;P0 (GPOINT)
: Coordinate data of line start.
: This parameter is only present in a Line at Given Position order.
;P1 (GPOINT)
: Coordinate data of first line end.
;PN (GPOINT)
: Coordinate data of final line end.
===Marker at Given Position/Marker at Current Position===
===Marker at Given Position/Marker at Current Position===
This order draws the current marker symbol at one or more positions starting from a given position.
====Syntax====
;Marker at Given Position (GMRK)
: X'C2' (LEN, P0, P1, PN)
;Marker at Current Position (GCMRK)
: X'82' (LEN, P1, PN)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;P0 (GPOINT)
: Coordinate data of first marker.
;P1 (GPOINT)
: Coordinate data of second marker.
;PN (GPOINT)
: Coordinate data of final marker.
===Modify Path===
===Modify Path===
This order modifies the path according to the value of the mode.
====Syntax====
;Modify Path (GMPTH)
: X'D8' (LEN, MODE, RES, PTHID)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
:; 0x06
:: Only valid value.
;MODE (GBIT8)
: Mode of path modification:
:; 0x06
:: Stroke the path
:; Other
:: All other values are reserved.
;RES (GBIT8)
: Reserved value, must be 0.
;PTHID (GLONG)
: Path identifier.
:; 0x00000001-0xFFFFFFFF
:: Valid path identifiers.
===No-Operation===
===No-Operation===
This order is a no-operation.
====Syntax====
;No-Operation (GNOP1)
: X'00'
===Outline Path===
===Outline Path===
====Syntax====
;Outline Path (GOPTH)
: X'D9' (LEN, FLAGS, RES, PTHID)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;FLAGS (GBIT8)
: Function flags:
:; 0x00
:: Only valid value.
;RES (GBIT8)
: Reserved value, must be 0.
;PTHID (GLONG)
: Path identifier.
:; 1
:: Only valid value.
===Partial Arc at Given Position/Partial Arc at Current Position===
===Partial Arc at Given Position/Partial Arc at Current Position===
This order draws a line from a given position to the start of an arc, and then draws the arc.
====Syntax====
;Partial Arc at Given Position (GPARC)
: X'E3' (LEN, P0, P1, M, START, SWEEP)
;Partial Arc at Current Position (GCPARC)
: X'A3' (LEN, P1, M, START, SWEEP)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;P0 (GPOINT)
: Coordinate data of start of line.
: This parameter is only present in a Partial Arc at Given Position order.
;P1 (GPOINT)
: Coordinate data of center of arc.
;M (GROFUFS)
: Multiplier.
;START (GROF)
: Start angle.
;SWEEP (GROF)
: Sweep angle.
===Polygons===
===Polygons===
This order defines a set of polygons, which are optionally filled.
====Syntax====
;Polygons (GPOLYS)
: X'F3' (LEN, FLAGS, COUNT, POLYS)
====Parameters====
;LEN (GLENGTH2)
: Length of following data.
;FLAGS
: Internal flags.
:; INSIDE (GBIT1)
:: Mode shading:
::: 0 Alternate mode.
::: 1 Winding mode.
:; MODEL (GBIT1)
:: Drawing model:
::: 0 The fill is inclusive of bottom right.
::: 1 The fill is exclusive of bottom right.
:; RES2 (GBIT6)
:: Reserved value, must be 0.
;COUNT (GUSHORT)
: Number of polygons.
;POLYS (GPOLYS)
: Array of polygons.
====Remarks====
This order draws a set of polygons. For the first polygon the current position is the first point. For all subsequent polygons all points which define the polygon are given explicitly. The polygons are automatically closed if necessary. The current position is set to the last point specified.
===Pop===
===Pop===
This order enables data to be popped from the Segment Call Stack.
====Syntax====
;Pop (GPOP)
: X'3F' (RES)
====Parameters====
;RES (GBIT8)
: Reserved value, must be 0.
====Remarks====
The data is placed into an attribute or Drawing Process Control.
===Relative Line at Given Position/Relative Line at Current Position===
===Relative Line at Given Position/Relative Line at Current Position===
These orders define one or more connected straight lines, at the given position or at the current position.
====Syntax====
;Relative Line at Given Position (GRLINE)
: X'E1' (LEN, P0, OFF0, OFF1, OFFN)
;Relative Line at Current Position (GCRLINE)
: X'A1' (LEN, OFF0, OFF1, OFFN)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;P0 (GPOINT)
: Coordinate data of line start.
: This parameter is only present in a Relative Line at Given Position order.
;OFF0 (GDELPOINT)
: Offset data for first point.
: This offset is to the first line end, relative to its start point.
;OFF1 (GDELPOINT)
: Offset data for second point.
: This offset is to the second line end, relative to the first line end.
;OFFN (GDELPOINT)
: Offset data for final point.
: This offset is to the nth line end, relative to the n-1th line end.
====Remarks====
The end point of each line is given as an offset from the start of the line, rather than as absolute coordinates.
===Segment Characteristics===
===Segment Characteristics===
This order provides the facility to set architected or user-defined characteristics for a segment.
====Syntax====
;Segment Characteristics (GSGCH)
: X'04' (LEN, CBIT8, PARMS)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;CBIT8 (GUCHAR)
: Identification code for characteristics:
:; 0x00-0x7F
:: Reserved for architected characteristics.
:; 0x80-0xFF
:: Reserved for user-defined characteristics.
;PARMS (GSTR)
: Parameters of characteristics.
====Remarks====
The order is only valid in a root-segment prolog.
===Set Arc Parameters/Push and Set Arc Parameters===
===Set Arc Parameters/Push and Set Arc Parameters===
These orders set, or push and set, the values of the current arc parameters.
====Syntax====
;Set Arc Parameters (GSAP)
: X'22' (LEN, P, Q, R, S)
;Push and Set Arc Parameters (GPSAP)
: X'62' (LEN, P, Q, R, S)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;P (GROSOL)
: P-parameter of arc transform.
;Q (GROSOL)
: Q-parameter of arc transform.
;R (GROSOL)
: R-parameter of arc transform.
;S (GROSOL)
: S-parameter of arc transform.
====Remarks====
The values of the current arc parameters are pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the current arc parameters to the values specified in the order.
The value of these parameters determines the shape of subsequent orders drawn using Arc at a Given Position/Arc at Current Position or Full Arc at Given Position/Full Arc at Current Position or Partial Arc at Given Position/Partial Arc at Current Position.
===Set Background Color/Push and Set Background Color===
===Set Background Color/Push and Set Background Color===
These orders set, or push and set, the value of the current background color attribute.
====Syntax====
;Set Background Color (GSBCOL)
: X'25' (LEN, COLOR)
;Push and Set Background Color (GPSBCOL)
: X'65' (LEN, COLOR)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
:; 0x02
:: Only valid value.
;COLOR (GBIT16)
: Color-table index: Except for the special values, the values 0x0000 through 0xnnnn are allowed color indexes; that is, as many values as are allowed by the size of the LCT.
: Special Values
:; 0x0000
:: Drawing default
:; 0x0007
:: White
:; 0x0008
:: Black
:; 0xFF00
:: Drawing default
:; 0xFF0x
:: Color indexes 0x000n, where n is in the range 1 through 7.
:; 0xFF08
:: Color index 0 (reset color).
===Set Background Indexed Color/Push and Set Background Indexed Color===
===Set Background Indexed Color/Push and Set Background Indexed Color===
These orders set, or push and set, the value of the current background color attribute.
====Syntax====
;Set Background Indexed Color (GSBICOL)
: X'A7' (LEN, FLAGS, INDEX)
;Push and Set Background Indexed Color (GPSBICOL)
: X'E7' (LEN, FLAGS, INDEX)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
:; 0x04
:: Only valid value.
;FLAGS
: Values:
:; DEFAULT (GBIT1)
:: Options:
::: 0 Use specified INDEX
::: 1 Use drawing default color.
:; SPEC (GBIT1)
:: Options:
::: 0 Use index directly
::: 1 Special value.
:; RES (GBIT6)
:: Reserved value, must be 0.
;INDEX (GINDEX3)
: Value for color index.
: The value is a direct index into the current color table or a special value. The special values are:
:; 1
:: Black
:; 2
:: White
:; 4
:: All ones
:; 5
:: All zeros.
====Remarks====
The value of the current background color attribute is pushed on to the stack by the Push and Set order only. Both orders then set the current background color attribute to the value specified in the order.
===Set Background Mix/Push and Set Background Mix===
===Set Background Mix/Push and Set Background Mix===
These orders set, or push and set, the value of the current background mix attribute.
====Syntax====
;Set Background Mix (GSBMX)
: X'0D' (MODE)
;Push and Set Background Mix (GPSBMX)
: X'4D' (MODE)
====Parameters====
;MODE (GBIT8)
: Mix-mode value:
:; 0x00
:: Drawing default
:; 0x01
:: OR
:; 0x02
:: Overpaint
:; 0x03
:: Reserved
:; 0x04
:: Exclusive-OR
:; 0x05
:: Leave Alone
:; 0x06
:: AND
:; 0x07
:: Subtract
:; 0x08
:: Source AND (inverse destination)
:; 0x09
:: All zeros
:; 0x0A
:: Inverse (source OR destination)
:; 0x0B
:: Inverse (source XOR destination)
:; 0x0C
:: Inverse destination
:; 0x0D
:: Source OR (inverse destination)
:; 0x0E
:: Inverse source
:; 0x0F
:: (Inverse source) OR destination
:; 0x10
:: Inverse (source AND destination)
:; 0x11
:: All ones.
====Remarks====
The value of the current background mix attribute is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the current background mix attribute to the value specified in the order.
===Set Character Angle/Push and Set Character Angle===
===Set Character Angle/Push and Set Character Angle===
These orders set, or push and set, the value of the current character angle attribute.
====Syntax====
;Set Character Angle (GSCA)
: X'34' (LEN, AX, AY)
;Push and Set Character Angle (GPSCA)
: X'74' (LEN, AX, AY)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;AX (GROSOL)
: X coordinate of point.
: This point defines the angle of the character string.
;AY (GROSOL)
: Y coordinate of point.
: This point defines the angle of the character string.
====Remarks====
The value of the current character angle attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current character angle to the value specified in the order.
===Set Character Break Extra/Push and Set Character Break Extra===
===Set Character Break Extra/Push and Set Character Break Extra===
These orders set, or push and set, the value of the current character break extra attribute.
====Syntax====
;Set Character Break Extra (GSCBE)
: X'05' (LEN, FLAGS, RES2, INC)
;Push and Set Character Break Extra (GPSCBE)
: X'45' (LEN, FLAGS, RES2, INC)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;FLAGS
: Values as follows:
:; DEFAULT (GBIT1)
:: Values as follows:
::: B"0" Set to specified value.
::: B"1" Set to drawing default.
:; RES1 (GBIT7)
:: Reserved value, must be 0.
;RES2 (GUNDF1)
: Reserved value, must be 0.
;INC (GROF)
: Increment.
====Remarks====
The value of the current character break extra attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current character break extra attribute to the value specified in the order.
===Set Character Cell/Push and Set Character Cell===
===Set Character Cell/Push and Set Character Cell===
===Set Character Direction/Push and Set Character Direction===
These orders set, or push and set, the value of the current character cell-size attribute.
 
====Syntax====
;Set Character Cell (GSCC)
: X'33' (LEN, CELLX, CELLY, CELLXF, CELLYF, FLAGS, RES)
;Push and Set Character Cell (GPSCC)
: X'03' (LEN, CELLX, CELLY, CELLXF, CELLYF, FLAGS, RES)
 
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;CELLX (GROSOL)
: X part of character cell-size attribute.
;CELLY (GROSOL)
: Y part of character cell-size attribute.
;CELLXF (GUSHORT)
: Fractional X part of character cell-size attribute.
: This parameter is optional.
;CELLYF (GUSHORT)
: Fractional Y part of character cell-size attribute.
: This parameter must be present if CELLXF parameter is present.
;FLAGS
: Internal flags.
: This parameter is optional.
:; NOTDEFLT (GBIT1)
:: Values:
::: 0 A cell size of zero sets drawing default
::: 1 A cell size of zero sets to zero.
:; RES (GBIT7)
:: Reserved.
::; 0000000
::: Only valid value.
;RES (GBIT8)
: Reserved value, must be 0.
: This parameter must be present if FLAGS parameter is present.
 
====Remarks====
The value of the current character cell-size attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current character cell-size attribute to the value in the order.
 
===Set Character Extra/Push and Set Character Extra===
===Set Character Extra/Push and Set Character Extra===
====Syntax====
;Set Character Extra (GSCE)
: X'17' (LEN, FLAGS, RES2, INC)
;Push and Set Character Extra (GPSCE)
: X'57' (LEN, FLAGS, RES2, INC)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;FLAGS
: Values as follows:
:; DEFAULT (GBIT1)
:: Values as follows:
::: B"0" Set to specified value.
::: B"1" Set to drawing default.
:; RES1 (GBIT7)
:: Reserved value, must be 0.
;RES2 (GUNDF1)
: Reserved value, must be 0.
;INC (GROF)
: Increment.
====Remarks====
The value of the current character extra attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders set the value of the current character extra attribute to the value specified in the order.
===Set Character Precision/Push and Set Character Precision===
===Set Character Precision/Push and Set Character Precision===
====Syntax====
;Set Character Precision (GSCR)
: X'39' (PREC)
;Push and Set Character Precision (GPSCR)
: X'79' (PREC)
====Parameters====
;PREC (GBIT8)
: Value for character-precision attribute:
: All other values are reserved.
:; 0x00
:: Drawing default
:; 0x01
:: String precision
:; 0x02
:: Character precision
:; 0x03
:: Stroke precision
====Remarks====
The value of the current character precision attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current character precision attribute to the value in the order.
===Set Character Set/Push and Set Character Set===
===Set Character Set/Push and Set Character Set===
====Syntax====
;Set Character Set (GSCS)
: X'38' (LCID)
;Push and Set Character Set (GPSCS)
: X'78' (LCID)
====Parameters====
;LCID (GUCHAR)
: Local identifier (LCID) for the character set:
:; 0x00
:: Drawing default
:; 0x01-0xFE
:: Lcid for the symbol set
:; 0xFF
:: Special character set.
====Remarks====
The value of the current character-set attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current character-set attribute to the value in the order.
===Set Character Shear/Push and Set Character Shear===
===Set Character Shear/Push and Set Character Shear===
====Syntax====
;Set Character Shear (GSCH)
: X'35' (LEN, HX, HY)
;Push and Set Character Shear (GPSCH)
: X'75' (LEN, HX, HY)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;HX (GROSOL)
: Dividend of shear ratio.
;HY (GROSOL)
: Divisor of shear ratio.
====Remarks====
When HX and HY are both 0, the drawing default is set. The value of the current character shear attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current character shear attribute to the value in the order.
===Set Clip Path===
===Set Clip Path===
===Set Color/Push and Set Color===
 
===Set Current Position/Push and Set Current Position===
====Syntax====
;Set Clip Path (GSCPTH)
: X'B4' (LEN, FLAGS, RES, PTHID)
 
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;FLAGS
: Extra functions:
:; RES (GBIT1)
:: Reserved value, must be 0.
:; FILL (GBIT1)
:: Values:
::: 0 Alternate mode
::: 1 Winding mode.
:; INTER (GBIT1)
:: Values:
::: 0 Set to specified path
::: 1 Set to intersection of specified and current clip path.
:; RES2 (GBIT5)
:: Reserved value, must be 0.
;RES (GBIT8)
: Reserved.
:; 0x00
:: Only valid value.
;PTHID (GLONG)
: Path identifier.
:; 0x00000000
:: No clipping.
:; 0x00000001-0xFFFFFFFF
:: Path identifier.
 
===Set Extended Color/Push and Set Extended Color===
===Set Extended Color/Push and Set Extended Color===
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
:; 0x02
:: Only valid value.
;COLOR (GBIT16)
: Color-table index. Except for the special values, the values 0x0000 through 0xnnnn are allowed color indexes; that is, as many values as are allowed by the size of the LCT.
: Special Values
:; 0x0000
:: Drawing default
:; 0x0007
:: White
:; 0x0008
:: Black
:; 0xFF00
:: Drawing default
:; 0xFF0n
:: Color indexes 0x000n, where n is in the range 1 through 7.
:; 0xFF08
:: Color index 0 (reset color).
====Remarks====
The value of the current extended color attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current extended color attribute to the value in the order.
===Set Fractional Line Width/Push and Set Fractional Line Width===
===Set Fractional Line Width/Push and Set Fractional Line Width===
====Syntax====
;Set Fractional Line Width (GSFLW)
: X'11' (LEN, LINEWIDTH)
;Push and Set Fractional Line Width (GPSFLW)
: X'51' (LEN, LINEWIDTH)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
:; 0x02
:: Only valid value.
;LINEWIDTH (GROUFS)
: Value for the line-width attribute.
: The nonzero value is an integral and fractional multiplier of the normal line width:
:; 0x0000
:: Drawing default
:; 0x0001-0xFFFF
:: Multiplier of normal line width.
====Remarks====
The value of the current line-width attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current line-width attribute to the value in the order.
===Set Indexed Color/Push and Set Indexed Color===
===Set Indexed Color/Push and Set Indexed Color===
====Syntax====
;Set Indexed Color (GSICOL)
: X'A6' (LEN, FLAGS, INDEX)
;Push and Set Indexed Color (GPSICOL)
: X'E6' (LEN, FLAGS, INDEX)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
:; 0x04
:: Only valid value.
;FLAGS
: Values:
:; DEFAULT (GBIT1)
:: Options:
::: 0 Use specified index
::: 1 Use drawing default color.
:; SPEC (GBIT1)
:: Options:
::: 0 Use index directly
::: 1 Special value.
:; RES (GBIT6)
:: Reserved value, must be 0.
;INDEX (GINDEX3)
: Value for color index.
: The value is a direct index into the current color table or a special value.
: The table can be the standard table, or one loaded by the user. The special values are:
:; 1
:: Black
:; 2
:: White
:; 4
:: All ones
:; 5
:: All zeros.
====Remarks====
The value of the current color attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current color attribute to the value in the order.
===Set Individual Attribute/Push and Set Individual Attribute===
===Set Individual Attribute/Push and Set Individual Attribute===
====Syntax====
;Set Individual Attribute (GSIA)
: X'14' (LEN, ATYPE, PTYPE, FLAG1, VAL)
;Push and Set Individual Attribute (GPSIA)
: X'54' (LEN, ATYPE, PTYPE, FLAG1, VAL)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;ATYPE (GBIT8)
: Attribute type:
:; 0x1
:: Color
:; 0x2
:: Background color
:; 0x3
:: Mix
:; 0x4
:: Background Mix
:; Other
:: All other values are reserved.
;PTYPE (GBIT8)
: Primitive type:
:; 0x1
:: Line
:; 0x2
:: Character
:; 0x3
:: Marker
:; 0x4
:: Pattern
:; 0x5
:: Image
:; Other
:: All other values are reserved.
;FLAG1
: Values:
:; DEFAULT (GBIT1)
:: Options:
::: 0 Use specified value
::: 1 Use drawing default color.
:; SPEC (GBIT1)
:: Options:
::: 0 Use value directly
::: 1 Special Value.
:; RES (GBIT6)
:: Reserved value, must be 0.
;VAL (GINDATT)
: Color index value.
: For colors, the value is a direct index into the current color table or a special value.
: The table can be the standard table, or one loaded by the user. The special values are:
:; 1
:: Black
:; 2
:: White
:; 4
:: All ones
:; 5
:: All zeros.
====Remarks====
The value of the current attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the individual attribute to the value in the order.
===Set Line End/Push and Set Line End===
===Set Line End/Push and Set Line End===
====Syntax====
;Set Line End (GSLE)
: X'1A' (LINEEND)
;Push and Set Line End (GPSLE)
: X'5A' (LINEEND)
====Parameters====
;LINEEND (GBIT8)
: Value for the line-end attribute:
:; 0x00
:: Drawing default
:; 0x01
:: Flat
:; 0x02
:: Square
:; 0x03
:: Round
:; Other
:: Reserved values.
====Remarks====
The value of the current line-end attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current line-end attribute to the value in the order.
===Set Line Join/Push and Set Line Join===
===Set Line Join/Push and Set Line Join===
====Syntax====
;Set Line Join (GSLJ)
: X'1B' (LINEJOIN)
;Push and Set Line Join (GPSLJ)
: X'5B' (LINEJOIN)
====Parameters====
;LINEJOIN (GBIT8)
: Value for line-join attribute:
:; 0x00
:: Drawing default
:; 0x01
:: Bevel
:; 0x02
:: Round
:; 0x03
:: Miter
:; Other
:: Reserved values.
====Remarks====
The value of the current line-join attribute is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the value of the current line-join attribute to the value in the order.
===Set Line Type/Push and Set Line Type===
===Set Line Type/Push and Set Line Type===
====Syntax====
;Set Line Type (GSLT)
: X'18' (LINETYPE)
;Push and Set Line Type (GPSLT)
: X'58' (LINETYPE)
====Parameters====
;LINETYPE (GBIT8)
: Value for line-type attribute.
: The value is an index into a notational line-type table:
:; 0x00
:: Drawing default
:; 0x01
:: Dotted line
:; 0x02
:: Short dashed line
:; 0x03
:: Dash-dot line
:; 0x04
:: Double dotted line
:; 0x05
:: Long dashed line
:; 0x06
:: Dash-double-dot line
:; 0x07
:: Solid line
:; 0x08
:: Invisible line
:; Other
:: Reserved values.
====Remarks====
The value of the current line-type attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current line-type attribute to the value in the order.
===Set Line Width/Push and Set Line Width===
===Set Line Width/Push and Set Line Width===
===Set Marker Cell/Push and Set Marker Cell===
 
====Syntax====
;Set Line Width (GSLW)
: X'19' (LINEWIDTH)
;Push and Set Line Width (GPSLW)
: X'59' (LINEWIDTH)
 
====Parameters====
;LINEWIDTH (GBIT8)
: Value for line-width attribute:
:; 0x00
:: Drawing default
:; 0x01-0xFF
:: Integral multiplier of normal line width.
 
====Remarks====
The value of the current line-width attribute is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the value of the current line-width attribute to the value in the order.
 
===Set Marker Precision/Push and Set Marker Precision===
===Set Marker Precision/Push and Set Marker Precision===
====Syntax====
;Set Marker Precision (GSMP)
: X'3B' (PREC)
;Push and Set Marker Precision (GPSMP)
: X'7B' (PREC)
====Parameters====
;PREC (GBIT8)
: Value for marker-precision attribute:
:; 0x00
:: Drawing default
:; 0x01
:: String precision
:; 0x02
:: Character precision
:; 0x03
:: Stroke precision
:; Other
:: Reserved values.
====Remarks====
The value of the current marker-precision attribute is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the value of the current-marker precision attribute to the value in the order.
===Set Marker Set/Push and Set Marker Set===
===Set Marker Set/Push and Set Marker Set===
====Syntax====
;Set Marker Set (GSMS)
: X'3C' (LCID)
;Push and Set Marker Set (GPSMS)
: X'7C' (LCID)
====Parameters====
;LCID (GUCHAR)
: Local identifier (LCID) for the marker set:
:; 0x00
:: Drawing default
:; 0x01-0xFE
:: LCID for the coded font
:; 0xFF
:: Special marker set.
====Remarks====
The value of the current marker symbol-set attribute is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the value of the current marker symbol-set attribute to the value in the order.
===Set Marker Symbol/Push and Set Marker Symbol===
===Set Marker Symbol/Push and Set Marker Symbol===
====Syntax====
;Set Marker Symbol (GSMT)
: X'29' (N)
;Push and Set Marker Symbol (GPSMT)
: X'69' (N)
====Parameters====
;N (GBIT8)
: Value of marker symbol code point. Special marker set
: When this is selected (lcid = 0xFF), the values are:
:: 0x00
::: Drawing default
:: 0x01
::: Cross
:: 0x02
::: Plus
:: 0x03
::: Diamond
:: 0x04
::: Square
:: 0x05
::: 6-point star
:: 0x06
::: 8-point star
:: 0x07
::: Filled diamond
:: 0x08
::: Filled square
:: 0x09
::: Dot
:: 0x0A
::: Small circle
:: 0x40
::: Blank
:: Other
::: Reserved values.
: Marker set
: Values are as follows for any other set:
:: 0x00
::: Drawing default
:: 0x01-0xFF
::: These are the code points into the current marker set.
====Remarks====
The value of the current marker symbol attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current marker symbol attribute to the value in the order.
===Set Mix/Push and Set Mix===
===Set Mix/Push and Set Mix===
====Syntax====
;Set Mix (GSMX)
: X'0C' (MODE)
;Push and Set Mix (GPSMX)
: X'4C' (MODE)
====Parameters====
;MODE (GBIT8)
: Mix-mode value:
:; 0x00
:: Drawing default
:; 0x01
:: OR
:; 0x02
:: Overpaint
:; 0x03
:: Reserved
:; 0x04
:: Exclusive-OR
:; 0x05
:: Leave alone
:; 0x06
:: AND
:; 0x07
:: Subtract
:; 0x08
:: Source AND (inverse destination)
:; 0x09
:: All zeros
:; 0x0A
:: Inverse (source OR destination)
:; 0x0B
:: Inverse (source XOR destination)
:; 0x0C
:: Inverse destination
:; 0x0D
:: Source OR (inverse destination)
:; 0x0E
:: Inverse source
:; 0x0F
:: (Inverse source) OR destination
:; 0x10
:: Inverse (source AND destination)
:; 0x11
:: All ones.
:; Other
:: Reserved values.
====Remarks====
The value of the current mix attribute is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the value of the current mix attribute to the value in the order.
===Set Model Transform/Push and Set Model Transform===
===Set Model Transform/Push and Set Model Transform===
===Set Pattern Reference Point/Push and Set Pattern Reference Point===
 
===Set Pattern Set/Push and Set Pattern Set===
====Syntax====
;Set Model Transform (GSTM)
: X'24' (LEN, RES, FLAGS, MASK, MX[LEN])
;Push and Set Model Transform (GPSTM)
: X'64' (LEN, RES, FLAGS, MASK, MX[LEN])
 
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;RES (GBIT8)
: Reserved value, must be 0.
;FLAGS
: Values:
:; RES (GBIT6)
:: Reserved value, must be 0.
:; CM (GBIT2)
:: Matrix control bits:
::: B"00" Unity matrix
::: B"01" Concatenate after
::: B"10" Concatenate before
::: B"11" Overwrite.
;MASK (GBIT16)
: Load mask.
;MX[LEN] (GROSOL)
: Matrix values.
: The matrix size is based on the number of bits set in MASK.
 
====Remarks====
The value of the current model transform is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set values in the current model transform as specified in the order.
 
===Set Pattern Symbol/Push and Set Pattern Symbol===
===Set Pattern Symbol/Push and Set Pattern Symbol===
====Syntax====
;Set Pattern Symbol (GSPT)
: X'28' (PATT)
;Push and Set Pattern Symbol (GPSPT)
: X'09' (PATT)
====Parameters====
;PATT (GBIT8)
: Value for pattern-symbol attribute.
: Special pattern set
: When this is selected (lcid = 0xFF), the values are:
:: 0x00
::: Drawing default
:: 0x01-0x08
::: Density one through density eight (decreasing)
:: 0x09
::: Vertical lines
:: 0x0A
::: Horizontal lines
:: 0x0B
::: Diagonal lines 1 (bottom-left to top-right)
:: 0x0C
::: Diagonal lines 2 (bottom-left to top-right)
:: 0x0D
::: Diagonal lines 1 (top-left to bottom-right)
:: 0x0E
::: Diagonal lines 2 (top-left to bottom-right)
:: 0x0F
::: No shading
:: 0x10
::: Solid shading
:: 0x40
::: Blank.
:: Other
::: Reserved values.
: Pattern set
: Values are as follows for any other set:
:: 0x00
::: Drawing default
:: 0x01-0xFF
::: These are the code points into the current pattern set.
====Remarks====
The value of the current pattern-symbol attribute is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the value of the current pattern-symbol attribute to the value in the order.
===Set Pick Identifier/Push and Set Pick Identifier===
===Set Pick Identifier/Push and Set Pick Identifier===
====Syntax====
;Set Pick Identifier (GSPIK)
: X'43' (LEN, PKID)
;Push and Set Pick Identifier (GPSPIK)
: X'23' (LEN, PKID)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;PKID (GLONG)
: Pick identifier.
====Remarks====
The value of the current pick identifier is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the value of the current pick identifier to the value in the order.
===Set Segment Boundary===
===Set Segment Boundary===
====Syntax====
;Set Segment Boundary (GSSB)
: X'32' (LEN, RES, MASK, BB[LEN])
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;RES (GBIT8)
: Reserved value, must be 0.
;MASK
: Values:
:; RES1 (GBIT2)
:: Reserved value, must be 0.
:; XL (GBIT1)
:: X left limit.
::: 0 Not included in list of BB values
::: 1 Is included in list of BB values.
:; XR (GBIT1)
:: X right limit.
::: 0 Not included in list of BB values
::: 1 Is included in list of BB values.
:; YB (GBIT1)
:: Y bottom limit.
::: 0 Not included in list of BB values
::: 1 Is included in list of BB values.
:; YT (GBIT1)
:: Y top limit.
::: 0 Not included in list of BB values
::: 1 Is included in list of BB values.
:; RES2 (GBIT2)
:: Reserved value, must be 0.
;BB[LEN] (GROSOL)
: Boundary values.
====Remarks====
The order is only valid in a root-segment prolog.
===Set Stroke Line Width/Push and Set Stroke Line Width===
===Set Stroke Line Width/Push and Set Stroke Line Width===
====Syntax====
;Set Stroke Line Width (GSSLW)
: X'15' (LEN, FLAGS, RES, STRWIDTH)
;Push and Set Stroke Line Width (GPSSLW)
: X'55' (LEN, FLAGS, RES, STRWIDTH)
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;FLAGS
:; DEFLT (GBIT1)
:: Values:
::: 0 Set to value
::: 1 Set to drawing default.
:; RES (GBIT7)
:: Reserved value, must be 0.
;RES (GBIT8)
: Reserved value, must be 0.
;STRWIDTH (GROSOL)
: Value for stroke width.
===Set Text Alignment/Push and Set Text Alignment===
===Set Text Alignment/Push and Set Text Alignment===
====Parameters====
;ALIGN (GBIT8)
: Value for text-alignment attribute:
:; 0x00
:: Drawing default. The alignment assumed depends on the current character direction:
::: Left to right Top alignment.
::: Top to bottom Left alignment.
::: Right to left Top alignment.
::: Bottom to top Top alignment.
:; 0x01
:: Top Alignment. The string is aligned on the top edge of its top character.
:; 0x02
:: Cap Alignment. The string is aligned on the cap line.
:; 0x03
:: Half Alignment. The string is aligned on the half line.
:; 0x04
:: Base Alignment. The string is aligned on the base line.
:; 0x05
:: Bottom Alignment. The string is aligned on the bottom edge of its bottom character.
:; 0x06
:: Bottom Alignment. The string is aligned on the bottom edge of its bottom character.
:; 0xFF
:: Standard alignment. The alignment assumed depends on the current character direction:
::: Left to right Bottom alignment.
::: Top to bottom Top alignment.
::: Right to left Bottom alignment.
::: Bottom to top Bottom alignment.
====Remarks====
The value of the current text alignment attribute is pushed on to the Segment Call stack by the Push and Set order only. Both orders set the value of the current text alignment attribute to the value specified in the order.
===Set Viewing Transform===
===Set Viewing Transform===
====Syntax====
;Set Viewing Transform (GSTV)
: X'31' (LEN, RES, FLAGS, MASK, MX[LEN])
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;RES (GBIT8)
: Reserved value, must be 0.
;FLAGS
: Values:
:; RES1 (GBIT5)
:: Reserved value, must be 0.
:; CONTROL (GBIT1)
:: Values:
::: 0 Concatenate before drawing default
::: 1 Concatenate before the current viewing transform.
:; RES2 (GBIT2)
:: Reserved value, must be 0.
;MASK (GBIT16)
: Load mask.
;MX[LEN] (GROSOL)
: Matrix values.
===Set Viewing Window/Push and Set Viewing Window===
===Set Viewing Window/Push and Set Viewing Window===
====Syntax====
;Set Viewing Window (GSVW)
: X'27' (LEN, FLAG, MASK, WW[LEN])
;Push and Set Viewing Window (GPSVW)
: X'67' (LEN, FLAG, MASK, WW[LEN])
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;FLAG
: Values:
:; REPLACE (GBIT1)
:: Values:
::: 0 Intersect with current window
::: 1 Replace current with new window.
:; RES (GBIT7)
:: Reserved value, must be 0.
;MASK
: Values:
:; RES1 (GBIT2)
:: Reserved value, must be 0.
:; XL (GBIT1)
:: X left limit.
::: 0 Not included in list of WW values
::: 1 Is included in list of WW values.
:; XR (GBIT1)
:: X right limit.
::: 0 Not included in list of WW values
::: 1 Is included in list of WW values.
:; YB (GBIT1)
:: Y bottom limit.
::: 0 Not included in list of WW values
::: 1 Is included in list of WW values.
:; YT (GBIT1)
:: Y top limit.
::: 0 Not included in list of WW values
::: 1 Is included in list of WW values.
:; RES2 (GBIT2)
:: Reserved value, must be 0.
;WW[LEN] (GROSOL)
: Window values.
====Remarks====
The value of the current viewing window is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the current viewing window using the values in the order.
===Sharp Fillet at Given Position/Sharp Fillet at Current Position===
===Sharp Fillet at Given Position/Sharp Fillet at Current Position===


[[Category:WorkToDo]]
====Syntax====
;Sharp Fillet at Given Position (GSFLT)
: X'E4' (LEN, P0, P1, P2, P3, P4, PN-1, PN, S1, S2, SN/2)
;Sharp Fillet at Current Position (GCSFLT)
: X'A4' (LEN, P1, P2, P3, P4, PN-1, PN, S1, S2, SN/2)
 
====Parameters====
;LEN (GLENGTH1)
: Length of following data.
;P0 (GPOINT)
: Coordinate data of first curve start.
: This parameter is only present in a Sharp Fillet at Given Position order.
;P1 (GPOINT)
: Coordinate data of first curve control point.
;P2 (GPOINT)
: Coordinate data of first curve end.
;P3 (GPOINT)
: Coordinate data of second curve control point.
;P4 (GPOINT)
: Coordinate data of second curve end.
;PN-1 (GPOINT)
: Coordinate data of last curve control point.
;PN (GPOINT)
: Coordinate data of last curve end.
;S1 (GROF)
: Sharpness specification of first curve.
;S2 (GROF)
: Sharpness specification of second curve.
;SN/2 (GROF)
: Sharpness specification of last curve.
 
====Remarks====
Further points are used in groups of two to form a polycurve.

Latest revision as of 03:47, 7 April 2025

Reprint Courtesy of International Business Machines Corporation, © International Business Machines Corporation

GPI Guide and Reference
  1. How to Use the GPI Guide and Reference
  2. Graphics Functions
  3. Data Types
  4. Graphics Orders
  5. Graphics Orders Data Types
  6. Errors
  7. Area and Polygon Primitives
  8. Bit Maps
  9. Creating and Drawing Retained Graphics
  10. Character String Primitives
  11. Clipping and Boundary Determination
  12. Color and Mix Attributes
  13. Correlation
  14. Coordinate Spaces and Transformations
  15. Editing Retained Graphics and Graphics Segments
  16. Fonts
  17. Graphics Attributes
  18. Line and Arc Primitives
  19. Marker Primitives
  20. Matrix Multiplication
  21. Metafiles
  22. Print Job Submission and Manipulation
  23. Presentation Spaces and Device Contexts
  24. Paths
  25. Regions
  26. Notices
  27. Glossary

This section describes the format of the graphics orders.

Graphics orders are used in the following circumstances:

  • Using GpiGetData or GpiPutData functions for bulk transfer of part or all of graphics segment data (unless this is simply being copied without being changed).
  • Editing segments with GpiQueryElement and GpiElement.
  • Generating metafiles (other than through the Presentation Manager API), or examining their contents. The data part of Graphics Data structured fields within the metafile (see "Metafile Data Format" in the Presentation Manager Programming Reference) consists of graphics orders.

When primitive or attribute functions (plus certain other functions) are specified at the programming interface, and the drawing mode (see GpiSetDrawingMode) is set to drawandretain, graphics orders are constructed and placed in the current graphics segment. One API call often causes a single order to be generated. Sometimes, however, several orders are necessary: an example of this is where a GpiPolyLine call is issued, which specifies more strokes than there is room for, in a single order.

In either case, the order or orders generated by a single API call comprise a single element, unless the application specifically starts an element using the GpiBeginElement function. In this case the element consists of all of the orders generated between this and the following GpiEndElement function. A GpiQueryElement function returns the orders that comprise an element; the application may edit these, and return them to the segment with GpiElement. The Begin Element - End Element orders that surround a multi-order element in the segment are never passed between the application and the system on GpiQueryElement and GpiElement functions. No double word or word alignment can be assumed for orders either within segments or during editing

Introduction to Graphics Orders

In the retain and draw-and-retain drawing modes, specific GPI functions (primitive-drawing and attribute-setting functions, plus some others) cause graphics orders to be stored in the current segment. A graphics order is a sequence of one or more bytes of data that describe a graphics function. There is typically a one-to-one correspondence between a GPI function and a graphics order. You do not need to understand the various formats and contents of the graphics orders, unless:

  • You are using GpiGetData or GpiPutData for bulk transfer of data that you want to edit.
  • You are simply copying data from one segment to another.
  • You are using GpiElement to add data to a segment, or GpiQueryElement to retrieve data from a segment.
  • You are examining the contents of a metafile.

Both the graphics orders and the metafile structure are described in the Presentation Manager. This appendix describes the header file PMORD.H, which has been provided to allow you to manipulate the graphics orders more easily.

The Graphics-Orders Header File (PMORD.H)

A set of helper constants, macros, and structures has been provided to help you decode and encode graphics orders. These items are defined in the header file PMORD.H.

There are four types of graphics orders. The first byte of each order, regardless of the graphics-order type, is the order code itself, which either partially or completely describes what follows. Depending on the order type, the graphics order can contain further information.

The four types of graphics order are:

1-Byte Order
The 1-byte order comprises a single byte:
   BYTE 1 : order code.
2-Byte Order
The 2-byte order consists of two bytes:
   BYTE 1 : order code
   BYTE 2 : associated value.
Long Order
The long order can comprise up to 257 bytes of information:
   BYTE 1     : order code
   BYTE 2     : length of order (0 to 255)
   BYTE 3-257 : associated value bytes depending on the order code.
There is a special long order (Escape) where:
   BYTE 3     : escape type
   BYTE 4     : escape identifier
   BYTE 5-257 : associated value bytes depending on the escape identifier.
Very Long Order
The very long order can comprise up to 65537 bytes of information:
   BYTE 1       : order code
   BYTE 2       : order qualifier
   BYTE 3       : length of order (most significant byte)
   BYTE 4       : length of order (least significant byte - length of order is 0 to 65535)
   BYTE 5-65537 : associated value bytes depending on the order qualifier.
There is a special very long order (Escape) where:
   BYTE 5       : escape type
   BYTE 6       : escape identifier
   BYTE 7-65537 : associated value bytes depending on the escape identifier.

Decoding Graphics Orders

The recommended way of decoding a buffer of graphics orders (in C language) is to use a pointer to address the first byte of the buffer, and then retrieve the graphics order it contains. To discover which of the four types of order you have, use the following macros:

  • BYTE_ORDER (1-byte order)
  • SHORT_ORDER (2-byte order)
  • LONG_ORDER (long order)
  • VLONG_ORDER (very long order).

These macros are defined in the header file PMORD.H. Each macro processes a single byte of data and returns a Boolean value (zero or nonzero). A zero value means that the order is not of that type. When you know the graphics-order type, you can establish the length of the order, and add the length to the pointer. You can then retrieve the next order in the buffer, and repeat the process until all data has been retrieved.

You can decode the graphics-order data itself by providing a routine for each of the order types, or a routine for each individual order:

  • For a 1-byte graphic order, the decoding routine should simply return a length of 1.
  • For a 2-byte graphic order, the decoding routine can use the overlay structure ORDER to decode the data. The routine should return a length of 2.
  • For a long order, the decoding routine can use the overlay structure LORDER to decode the data. The length of the data is a variable value.
  • For a very long order, the decoding routine can use the overlay structure VORDER to decode the data. The length of the data is a variable value.

The overlay structures ORDER, LORDER, and VORDER are defined in the header file PMORD.H.

You can build graphics orders using the same structures and order types that are used for decoding graphics orders.

Naming Conventions

The names of the graphics-order codes are in the form OCODE_Gxxx. The Gxxx abbreviation is the name of the individual order, and can be used for types, structures, and constants directly related to that order. In the header file, there is a comment on the same line as each of the orders that describes the order. For example, the Begin Area order (GBAR) is described in the header file as follows:

#define OCODE_GBAR     0x68  /* Begin area    */
#define GBAR_BOUNDARY  0xC0

Note:

In some structures, an S or an L is added to the name to differentiate between the short-coordinate form (16-bit) and the long-coordinate form (32-bit). For example, the Set Arc Parameters order (GSAP) is as follows:

#define OCODE_GSAP     0x22
#define OCODE_GPSAP    0x62

  typedef struct _ORDERS_GSAP {
    SHORT  p;
    SHORT  q;
    SHORT  r;
    SHORT  s;
  } ORDERS_GSAP;

  typedef struct _ORDERL_GSAP {
    LONG   p;
    LONG   q;
    LONG   r;
    LONG   s;
  } ORDERL_GSAP;

In this example, the structures ORDERS_GSAP and ORDERL_GSAP are shared by GSAP (set arc parameters) and GPSAP (push and set arc parameters). As a rule, there is structure sharing between the set and push-and-set forms of graphics orders.

There is structure-sharing between the current-position and the given-position forms of some orders. For example, the orders GCARC (arc at current position) and GARC (arc at given position) share a structure.

Arc at a Given Position/Arc at Current Position

Syntax
This order constructs an arc starting at a given position.
Arc at a Given Position (GARC)
X'C6' (LEN, P0, P1, P2)
Arc at Current Position (GCARC)
X'86' (LEN, P1, P2) 
Parameters
LEN (GLENGTH1)
Length of following data.
P0 (GPOINT)
Coordinate data of start point.
This parameter is only present in a Arc at a Given Position order.
P1 (GPOINT)
Coordinate data of intermediate point.
P2 (GPOINT)
Coordinate data of end point.

Begin Area

Syntax
This order indicates the start of a set of primitives that define an area boundary.
Begin Area (GBAR)
X'68' (FLAGS)
Parameters
FLAGS
Internal flags.
RES1 (GBIT1)
Reserved for migration:
1 Only valid value.
BOUNDARY (GBIT1)
Boundary-line draw indicator:
0 Do not draw boundary lines
1 Draw boundary lines.
INSIDE (GBIT1)
Mode shading:
0 Alternate mode
1 Winding mode.
RES2 (GBIT5)
Reserved value, must be 0.

Begin Element

Syntax
This order indicates the beginning of a set of primitives that define an element.
Begin Element (GBEL)
X'D2' (LEN, TYPE, DESCR)
Parameters
LEN (GLENGTH1)
Length of following data.
TYPE (GLONG)
Element type code.
Possible values are described in the following list:
0x0000FD01 Line bundle
0x0000FD02 Character bundle
0x0000FD03 Marker bundle
0x0000FD04 Area bundle
0x0000FD05 Image bundle
0x00000007 Call segment
0x00000081 Polyline
0x00000085 Polyfillet
0x000000A4 Polyfillet sharp
0x000000A5 Polyspline
0x00000082 Polymarker
0x00000087 Full arc
0x00000091 Image
0x000000B1 Character string at current position
0x000000F1 Character string at given position
0x81xxxxxx-0xFFxxxxxx Indicates user defined elements
Other Reserved values.
DESCR (GUNDF)
Element description data.
This is optional.

Begin Image at Given Position/Begin Image at Current Position

Syntax
These orders identify the start of an image definition at a given position or at the current position.
Begin Image at Given Position (GBIMG)
X'D1' (LEN, P0, FORMAT, RES, WIDTH, HEIGHT)
Begin Image at Current Position (GCBIMG)
X'91' (LEN, FORMAT, RES, WIDTH, HEIGHT)
Parameters
LEN (GLENGTH1)
Length of following data.
0x06 Only valid value.
P0 (GPOINT)
Point at which the image is to be placed.
This parameter is only present in a Begin Image at Given Position order.
FORMAT (GBIT8)
Format of the image data.
0x00 One bit in the data represents one image point on the usable area.
RES (GBIT8)
Reserved.:0x00 Only valid value.
WIDTH (GUSHORT370)
Width of the image data.
This is the width in pels.
0x00-0x07 Valid range of values.
HEIGHT (GUSHORT370)
Height of the image data.
This is the height in pels.

Begin Path

Syntax
This order sets the drawing process into path state.
Begin Path (GBPTH)
X'D0' (LEN, RES, PTHID)
Parameters
LEN (GLENGTH1)
Length of following data.
0x06 Only valid value.
RES (GBIT16)
Reserved.
0x0000 Only valid value.
PTHID (GLONG)
Path identifier.
0x00000001-0xFFFFFFFF Valid path identifiers.

Bezier Curve at Given Position/Bezier Curve at Current Poition

Syntax
This order generates a curve that starts at a given position.

Bezier Curve at Given Position (GBEZ)

X'E5' (LEN, P0, P1, P2, P3, P4, P5, P6, PN-2, PN-1, PN)

Bezier Curve at Current Poition (GCBEZ)

X'A5' (LEN, P1, P2, P3, P4, P5, P6, PN-2, PN-1, PN)
Parameters
LEN (GLENGTH1)
Length of following data.
P0 (GPOINT)
Coordinate data of first curve start.
This parameter is only present in a Bezier Curve at Given Position order.
P1 (GPOINT)
Coordinate data of first curve, first control point.
P2 (GPOINT)
Coordinate data of first curve, second control point.
P3 (GPOINT)
Coordinate data of first curve end.
P4 (GPOINT)
Coordinate data of second curve, first control point.
P5 (GPOINT)
Coordinate data of second curve, second control point
P6 (GPOINT)
Coordinate data of second curve end.
PN-2 (GPOINT)
Coordinate data of final curve, first control point
PN-1 (GPOINT)
Coordinate data of final curve, second control point
PN (GPOINT)
Coordinate data of final curve end.

Bitblt

Syntax

This order copies a rectangle of a bit map into DOCS.

Bitblt (GBBLT)

X'D6' (LEN, FLAGS, MIX, BMID, TRANS, P1, P2, SOURCE1X, SOURCE1Y, SOURCE2X, SOURCE2Y)

Parameters
LEN (GLENGTH1)
Length of following data.
FLAGS (GBIT16)
Reserved.
0x0000
Only valid value.
MIX (GBIT16)
Mix mode.
Values are:
0x00CC
Source.
0x00C0
Source and pattern.
0x00CA
Source where pattern1.
0x000C
Source where pattern0.
0x00E2
Pattern where source1.
0x00B8
Pattern where source0.
Other
Reserved values.
BMID (GHBITMAP)
Bit-map identifier.
TRANS (GBIT32)
Transfer mode.
Values are:
0x00000000
OR
0x01000000
AND
0x02000000
Ignore
Other
Reserved values.
P1 (GPOINT)
Target rectangle bottom-left corner.
P2 (GPOINT)
Target rectangle top-right corner.
SOURCE1X (GLONG)
Source rectangle bottom-left corner, x-coordinate.
SOURCE1Y (GLONG)
Source rectangle bottom-left corner, y-coordinate.
SOURCE2X (GLONG)
Source rectangle top-right corner, x-coordinate.
SOURCE2Y (GLONG)
Source rectangle top-right corner, y-coordinate.

Box at Given Position/Box at Current Position

This order defines a box with square or round corners, drawn with its first corner at a given position.

Syntax

Box at Given Position (GBOX)
X'C0' (LEN, CONTROL, RES, P0, P1, HAXIS, VAXIS)
Box at Current Position (GCBOX)
X'80' (LEN, CONTROL, RES, P1, HAXIS, VAXIS)

Parameters

LEN (GLENGTH1)
Length of following data.
CONTROL
Internal flags.
RES1 (GBIT1)
Reserved value, must be 0.
FILL (GBIT1)
Values:
0 No fill
1 Fill.
BOUNDARY (GBIT1)
Values:
0 No boundary
1 Boundary.
RES2 (GBIT5)
Reserved value, must be 0.
RES (GBIT8)
Reserved value, must be 0.
P0 (GPOINT)
Coordinate data of box origin.
This parameter is only present in a Box at Given Position order.
P1 (GPOINT)
Coordinate data of box corner.
HAXIS (GROSOL)
Length of horizontal axis of ellipse.
VAXIS (GROSOL)
Length of vertical axis of ellipse.

Call Segment

This order calls one segment from another.

Syntax

Call Segment (GCALLS)
X'07' (LEN, RES, SEGNAME)

Parameters

LEN (GLENGTH1)
Length of following data.
0x06
Only valid value.
RES (GBIT16)
Reserved value, must be 0.
SEGNAME (GLONG)
Name of segment that is to be called.
The name cannot be 0.

Character String at Given Position/Character String at Current Position

These orders draw a character string at a given position or at the current position.

Syntax

Character String at Given Position (GCHST)
X'C3' (LEN, P0, CP)
Character String at Current Position (GCCHST)
X'83' (LEN, CP)

Parameters

LEN (GLENGTH1)
Length of following data.
P0 (GPOINT)
Point at which the character string is to be placed.
This parameter is only present in a Character String at Given Position order.
CP (GSTR)
Code points of each character in the string.

Character String Extended at Given Position/Character String Extended at Current Position

This order defines a character string to be drawn at a given position.

Syntax

Character String Extended at Given Position (GCHSTE)
X'FEF0' (LEN1, P0, FLAGS, RES, P1, P2, LEN2, CP, PAD, VECT)
Character String Extended at Current Position (GCCHSTE)
X'FEB0' (LEN1, FLAGS, RES, P1, P2, LEN2, CP, PAD, VECT)

Parameters

LEN1 (GLENGTH2)
Length of following data.
P0 (GPOINT)
Point at which the character string is to be placed.
This parameter is only present in a Character String Extended at Given Position order.
FLAGS
Extra functions:
RECT (GBIT1)
Values:
0 Do not draw background rectangle
1 Draw background rectangle.
CLIP (GBIT1)
Values:
0 Do not clip to rectangle
1 Clip to rectangle.
RES1 (GBIT1)
Reserved value, must be 0.
LVCP (GBIT1)
Values:
0 Move current position
1 Leave current position.
RES2 (GBIT4)
Reserved value, must be 0.
RES (GBIT8)
Reserved value, must be 0.
P1 (GPOINT)
Coordinate data of rectangle corner.
P2 (GPOINT)
Coordinate data of rectangle corner.
LEN2 (GLENGTH2)
Length of code-point data.
CP (GSTR)
Code-point data.
PAD (GBIT8)
Pad byte.
Only needs to be included if CP is an odd number of bytes.
VECT (GROSOL)
IN (0) Vector of character increments.
VECT is a vector of n elements, where n is the number of code points present in the CP parameter.

Character String Move at Given Position/Character String Move at Current Position

This order draws a character string starting from a given position and moves the current position to the end of the string.

Syntax

Character String Move at Given Position (GCHSTM)
X'F1' (LEN, P0, CP)
Character String Move at Current Position (GCCHSTM)
X'B1' (LEN, CP)

Parameters

LEN (GLENGTH1)
Length of following data.
P0 (GPOINT)
Point at which the character string is to be placed.
This parameter is only present in a Character String Move at Given Position order.
CP (GSTR)
Code points of each character in the string.

Close Figure

This order delimits the end of a closed figure.

Syntax

Close Figure (GCLFIG)
X'7D' (RES)

Parameters

RES (GBIT8)
Reserved value, must be 0.

Comment

This order enables data to be stored within a segment.

Syntax

Comment (GCOMT)
X'01' (LEN, DATA[LEN])

Parameters

LEN (GLENGTH1)
Length of following data.
DATA[LEN] (GBIT8)
Comment data.

Remarks

This order is treated as a no-operation.

End Area

This order indicates the end of a set of primitives that define an area boundary.

Syntax

End Area (GEAR)
X'60' (LEN, DATA[LEN])

Parameters

LEN (GLENGTH1)
Length of following data. It is normally 0.
DATA[LEN] (GBIT8)
Reserved value, must be 0.

End Element

This order identifies the end of a set of primitives that define an element.

Syntax

End Element (GEEL)
X'49' (RES)

Parameters

RES (GBIT8)
Reserved value, must be 0.

End Image

This order identifies the end of an image definition.

Syntax

End Image (GEIMG)
X'93' (LEN, DATA[LEN])

Parameters

LEN (GLENGTH1)
Length of following data. It is normally 0.
DATA[LEN] (GBIT8)
Reserved value, must be 0.

End of Symbol Definition

This order indicates the end of a set of orders defining a graphics symbol.

Syntax

End of Symbol Definition (GESD)
X'FF'

Remarks

This order is only valid in the context of symbol definitions.

End Path

This order ends the definition of a path.

Syntax

End Path (GEPTH)
X'7F' (RES)

Parameters

RES (GBIT8)
Reserved value, must be 0.

End Prolog

This order indicates the end of the prolog of a segment.

Syntax

End Prolog (GEPROL)
X'3E' (RES)

Parameters

RES (GBIT8)
Reserved value, must be 0.

Escape

This order provides facilities for registered and unregistered escape functions.

Syntax

Escape (GESCP)
X'D5' (LEN, TYPE, RID, PARMS)

Parameters

LEN (GLENGTH1)
Length of following data.
TYPE (GBIT8)
Type identifier:
80
Registered value
Other
All other values are unregistered.
RID (GBIT8)
Registered identifier:
01
Set pel.
02
BITBLT function.
03
Flood fill function.
04
Draw bits function.
PARMS (GSTR)
Parameters of escape.

Extended Escape

This order provides facilities for registered and unregistered escape functions.

Syntax

Extended Escape (GEESCP)
X'FED5' (LEN, TYPE, RID, PARMS)

Parameters

LEN (GLENGTH2)
Length of following data.
TYPE (GBIT8)
Type identifier:
0x80
Registered value
Other
All other values are unregistered.
RID (GUCHAR)
Registered identifier.
No registered extended escapes are used by the OS/2* operating system.
PARMS (GSTR)
Parameters of escape.

Fill Path

This order fills the interior of the specified path.

Syntax

Fill Path (GFPTH)
X'D7' (LEN, FLAGS, RES, PTHID)

Parameters

LEN (GLENGTH1)
Length of following data.
0x06
Only valid value.
FLAGS
Extra functions:
RES1 (GBIT1)
Reserved value, must be 0.
INSIDE (GBIT1)
Values:
0 Alternate mode
1 Winding mode.
MOD (GBIT1)
Values:
0 Do not modify before filling
1 Modify path before filling.
RES2 (GBIT5)
Reserved value, must be 0.
RES (GBIT8)
Reserved value, must be 0.
PTHID (GLONG)
Path identifier.
0x00000001-0xFFFFFFFF
Valid path identifiers.

Fillet at Given Position/Fillet at Current Position

These orders draw a curved line tangential to a specified set of straight lines, at the given position or at the current position.

Syntax

Fillet at Given Position (GFLT)
X'C5' (LEN, P0, P1, P2, PN)
Fillet at Current Position (GCFLT)
X'85' (LEN, P1, P2, PN)

Parameters

LEN (GLENGTH1)
Length of following data.
P0 (GPOINT)
Coordinate data of line start.
This parameter is only present in a Fillet at Given Position order.
P1 (GPOINT)
Coordinate data of first line end.
P2 (GPOINT)
Coordinate data of second line end.
PN (GPOINT)
Coordinate data of final line end.

Full Arc at Given Position/Full Arc at Current Position

This order constructs a full circle or an ellipse, with the center at a given position.

Syntax

Full Arc at Given Position (GFARC)
X'C7' (LEN, P0, M)
Full Arc at Current Position (GCFARC)
X'87' (LEN, M)

Parameters

LEN (GLENGTH1)
Length of following data.
P0 (GPOINT)
Coordinate data of the center of the circle/ellipse.
This parameter is only present in a Full Arc at Given Position order.
M (GROFUFS)
Multiplier.

Image Data

This order provides bit data for an image.

Syntax

Image Data (GIMD)
X'92' (LEN, DATA[LEN])

Parameters

LEN (GLENGTH1)
Length of following data.
DATA[LEN] (GBIT8)
Image data.

Label

This order is used to label an element within a segment.

Syntax

Label (GLBL)
X'D3' (LEN, LDATA)

Parameters

LEN (GLENGTH1)
Length of following data.
0x04
Only valid value.
LDATA (GLONG)
Label value.

Line at Given Position/Line at Current Position

This order defines one or more connected straight lines, drawn from the given position.

Syntax

Line at Given Position (GLINE)
X'C1' (LEN, P0, P1, PN)
Line at Current Position (GCLINE)
X'81' (LEN, P1, PN)

Parameters

LEN (GLENGTH1)
Length of following data.
P0 (GPOINT)
Coordinate data of line start.
This parameter is only present in a Line at Given Position order.
P1 (GPOINT)
Coordinate data of first line end.
PN (GPOINT)
Coordinate data of final line end.

Marker at Given Position/Marker at Current Position

This order draws the current marker symbol at one or more positions starting from a given position.

Syntax

Marker at Given Position (GMRK)
X'C2' (LEN, P0, P1, PN)
Marker at Current Position (GCMRK)
X'82' (LEN, P1, PN)

Parameters

LEN (GLENGTH1)
Length of following data.
P0 (GPOINT)
Coordinate data of first marker.
P1 (GPOINT)
Coordinate data of second marker.
PN (GPOINT)
Coordinate data of final marker.

Modify Path

This order modifies the path according to the value of the mode.

Syntax

Modify Path (GMPTH)
X'D8' (LEN, MODE, RES, PTHID)

Parameters

LEN (GLENGTH1)
Length of following data.
0x06
Only valid value.
MODE (GBIT8)
Mode of path modification:
0x06
Stroke the path
Other
All other values are reserved.
RES (GBIT8)
Reserved value, must be 0.
PTHID (GLONG)
Path identifier.
0x00000001-0xFFFFFFFF
Valid path identifiers.

No-Operation

This order is a no-operation.

Syntax

No-Operation (GNOP1)
X'00'

Outline Path

Syntax

Outline Path (GOPTH)
X'D9' (LEN, FLAGS, RES, PTHID)

Parameters

LEN (GLENGTH1)
Length of following data.
FLAGS (GBIT8)
Function flags:
0x00
Only valid value.
RES (GBIT8)
Reserved value, must be 0.
PTHID (GLONG)
Path identifier.
1
Only valid value.

Partial Arc at Given Position/Partial Arc at Current Position

This order draws a line from a given position to the start of an arc, and then draws the arc.

Syntax

Partial Arc at Given Position (GPARC)
X'E3' (LEN, P0, P1, M, START, SWEEP)
Partial Arc at Current Position (GCPARC)
X'A3' (LEN, P1, M, START, SWEEP)

Parameters

LEN (GLENGTH1)
Length of following data.
P0 (GPOINT)
Coordinate data of start of line.
This parameter is only present in a Partial Arc at Given Position order.
P1 (GPOINT)
Coordinate data of center of arc.
M (GROFUFS)
Multiplier.
START (GROF)
Start angle.
SWEEP (GROF)
Sweep angle.

Polygons

This order defines a set of polygons, which are optionally filled.

Syntax

Polygons (GPOLYS)
X'F3' (LEN, FLAGS, COUNT, POLYS)

Parameters

LEN (GLENGTH2)
Length of following data.
FLAGS
Internal flags.
INSIDE (GBIT1)
Mode shading:
0 Alternate mode.
1 Winding mode.
MODEL (GBIT1)
Drawing model:
0 The fill is inclusive of bottom right.
1 The fill is exclusive of bottom right.
RES2 (GBIT6)
Reserved value, must be 0.
COUNT (GUSHORT)
Number of polygons.
POLYS (GPOLYS)
Array of polygons.

Remarks

This order draws a set of polygons. For the first polygon the current position is the first point. For all subsequent polygons all points which define the polygon are given explicitly. The polygons are automatically closed if necessary. The current position is set to the last point specified.

Pop

This order enables data to be popped from the Segment Call Stack.

Syntax

Pop (GPOP)
X'3F' (RES)

Parameters

RES (GBIT8)
Reserved value, must be 0.

Remarks

The data is placed into an attribute or Drawing Process Control.

Relative Line at Given Position/Relative Line at Current Position

These orders define one or more connected straight lines, at the given position or at the current position.

Syntax

Relative Line at Given Position (GRLINE)
X'E1' (LEN, P0, OFF0, OFF1, OFFN)
Relative Line at Current Position (GCRLINE)
X'A1' (LEN, OFF0, OFF1, OFFN)

Parameters

LEN (GLENGTH1)
Length of following data.
P0 (GPOINT)
Coordinate data of line start.
This parameter is only present in a Relative Line at Given Position order.
OFF0 (GDELPOINT)
Offset data for first point.
This offset is to the first line end, relative to its start point.
OFF1 (GDELPOINT)
Offset data for second point.
This offset is to the second line end, relative to the first line end.
OFFN (GDELPOINT)
Offset data for final point.
This offset is to the nth line end, relative to the n-1th line end.

Remarks

The end point of each line is given as an offset from the start of the line, rather than as absolute coordinates.

Segment Characteristics

This order provides the facility to set architected or user-defined characteristics for a segment.

Syntax

Segment Characteristics (GSGCH)
X'04' (LEN, CBIT8, PARMS)

Parameters

LEN (GLENGTH1)
Length of following data.
CBIT8 (GUCHAR)
Identification code for characteristics:
0x00-0x7F
Reserved for architected characteristics.
0x80-0xFF
Reserved for user-defined characteristics.
PARMS (GSTR)
Parameters of characteristics.

Remarks

The order is only valid in a root-segment prolog.

Set Arc Parameters/Push and Set Arc Parameters

These orders set, or push and set, the values of the current arc parameters.

Syntax

Set Arc Parameters (GSAP)
X'22' (LEN, P, Q, R, S)
Push and Set Arc Parameters (GPSAP)
X'62' (LEN, P, Q, R, S)

Parameters

LEN (GLENGTH1)
Length of following data.
P (GROSOL)
P-parameter of arc transform.
Q (GROSOL)
Q-parameter of arc transform.
R (GROSOL)
R-parameter of arc transform.
S (GROSOL)
S-parameter of arc transform.

Remarks

The values of the current arc parameters are pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the current arc parameters to the values specified in the order. The value of these parameters determines the shape of subsequent orders drawn using Arc at a Given Position/Arc at Current Position or Full Arc at Given Position/Full Arc at Current Position or Partial Arc at Given Position/Partial Arc at Current Position.

Set Background Color/Push and Set Background Color

These orders set, or push and set, the value of the current background color attribute.

Syntax

Set Background Color (GSBCOL)
X'25' (LEN, COLOR)
Push and Set Background Color (GPSBCOL)
X'65' (LEN, COLOR)

Parameters

LEN (GLENGTH1)
Length of following data.
0x02
Only valid value.
COLOR (GBIT16)
Color-table index: Except for the special values, the values 0x0000 through 0xnnnn are allowed color indexes; that is, as many values as are allowed by the size of the LCT.
Special Values
0x0000
Drawing default
0x0007
White
0x0008
Black
0xFF00
Drawing default
0xFF0x
Color indexes 0x000n, where n is in the range 1 through 7.
0xFF08
Color index 0 (reset color).

Set Background Indexed Color/Push and Set Background Indexed Color

These orders set, or push and set, the value of the current background color attribute.

Syntax

Set Background Indexed Color (GSBICOL)
X'A7' (LEN, FLAGS, INDEX)
Push and Set Background Indexed Color (GPSBICOL)
X'E7' (LEN, FLAGS, INDEX)

Parameters

LEN (GLENGTH1)
Length of following data.
0x04
Only valid value.
FLAGS
Values:
DEFAULT (GBIT1)
Options:
0 Use specified INDEX
1 Use drawing default color.
SPEC (GBIT1)
Options:
0 Use index directly
1 Special value.
RES (GBIT6)
Reserved value, must be 0.
INDEX (GINDEX3)
Value for color index.
The value is a direct index into the current color table or a special value. The special values are:
1
Black
2
White
4
All ones
5
All zeros.

Remarks

The value of the current background color attribute is pushed on to the stack by the Push and Set order only. Both orders then set the current background color attribute to the value specified in the order.

Set Background Mix/Push and Set Background Mix

These orders set, or push and set, the value of the current background mix attribute.

Syntax

Set Background Mix (GSBMX)
X'0D' (MODE)
Push and Set Background Mix (GPSBMX)
X'4D' (MODE)

Parameters

MODE (GBIT8)
Mix-mode value:
0x00
Drawing default
0x01
OR
0x02
Overpaint
0x03
Reserved
0x04
Exclusive-OR
0x05
Leave Alone
0x06
AND
0x07
Subtract
0x08
Source AND (inverse destination)
0x09
All zeros
0x0A
Inverse (source OR destination)
0x0B
Inverse (source XOR destination)
0x0C
Inverse destination
0x0D
Source OR (inverse destination)
0x0E
Inverse source
0x0F
(Inverse source) OR destination
0x10
Inverse (source AND destination)
0x11
All ones.

Remarks

The value of the current background mix attribute is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the current background mix attribute to the value specified in the order.

Set Character Angle/Push and Set Character Angle

These orders set, or push and set, the value of the current character angle attribute.

Syntax

Set Character Angle (GSCA)
X'34' (LEN, AX, AY)
Push and Set Character Angle (GPSCA)
X'74' (LEN, AX, AY)

Parameters

LEN (GLENGTH1)
Length of following data.
AX (GROSOL)
X coordinate of point.
This point defines the angle of the character string.
AY (GROSOL)
Y coordinate of point.
This point defines the angle of the character string.

Remarks

The value of the current character angle attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current character angle to the value specified in the order.

Set Character Break Extra/Push and Set Character Break Extra

These orders set, or push and set, the value of the current character break extra attribute.

Syntax

Set Character Break Extra (GSCBE)
X'05' (LEN, FLAGS, RES2, INC)
Push and Set Character Break Extra (GPSCBE)
X'45' (LEN, FLAGS, RES2, INC)

Parameters

LEN (GLENGTH1)
Length of following data.
FLAGS
Values as follows:
DEFAULT (GBIT1)
Values as follows:
B"0" Set to specified value.
B"1" Set to drawing default.
RES1 (GBIT7)
Reserved value, must be 0.
RES2 (GUNDF1)
Reserved value, must be 0.
INC (GROF)
Increment.

Remarks

The value of the current character break extra attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current character break extra attribute to the value specified in the order.

Set Character Cell/Push and Set Character Cell

These orders set, or push and set, the value of the current character cell-size attribute.

Syntax

Set Character Cell (GSCC)
X'33' (LEN, CELLX, CELLY, CELLXF, CELLYF, FLAGS, RES)
Push and Set Character Cell (GPSCC)
X'03' (LEN, CELLX, CELLY, CELLXF, CELLYF, FLAGS, RES)

Parameters

LEN (GLENGTH1)
Length of following data.
CELLX (GROSOL)
X part of character cell-size attribute.
CELLY (GROSOL)
Y part of character cell-size attribute.
CELLXF (GUSHORT)
Fractional X part of character cell-size attribute.
This parameter is optional.
CELLYF (GUSHORT)
Fractional Y part of character cell-size attribute.
This parameter must be present if CELLXF parameter is present.
FLAGS
Internal flags.
This parameter is optional.
NOTDEFLT (GBIT1)
Values:
0 A cell size of zero sets drawing default
1 A cell size of zero sets to zero.
RES (GBIT7)
Reserved.
0000000
Only valid value.
RES (GBIT8)
Reserved value, must be 0.
This parameter must be present if FLAGS parameter is present.

Remarks

The value of the current character cell-size attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current character cell-size attribute to the value in the order.

Set Character Extra/Push and Set Character Extra

Syntax

Set Character Extra (GSCE)
X'17' (LEN, FLAGS, RES2, INC)
Push and Set Character Extra (GPSCE)
X'57' (LEN, FLAGS, RES2, INC)

Parameters

LEN (GLENGTH1)
Length of following data.
FLAGS
Values as follows:
DEFAULT (GBIT1)
Values as follows:
B"0" Set to specified value.
B"1" Set to drawing default.
RES1 (GBIT7)
Reserved value, must be 0.
RES2 (GUNDF1)
Reserved value, must be 0.
INC (GROF)
Increment.

Remarks

The value of the current character extra attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders set the value of the current character extra attribute to the value specified in the order.

Set Character Precision/Push and Set Character Precision

Syntax

Set Character Precision (GSCR)
X'39' (PREC)
Push and Set Character Precision (GPSCR)
X'79' (PREC)

Parameters

PREC (GBIT8)
Value for character-precision attribute:
All other values are reserved.
0x00
Drawing default
0x01
String precision
0x02
Character precision
0x03
Stroke precision

Remarks

The value of the current character precision attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current character precision attribute to the value in the order.

Set Character Set/Push and Set Character Set

Syntax

Set Character Set (GSCS)
X'38' (LCID)
Push and Set Character Set (GPSCS)
X'78' (LCID)

Parameters

LCID (GUCHAR)
Local identifier (LCID) for the character set:
0x00
Drawing default
0x01-0xFE
Lcid for the symbol set
0xFF
Special character set.

Remarks

The value of the current character-set attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current character-set attribute to the value in the order.

Set Character Shear/Push and Set Character Shear

Syntax

Set Character Shear (GSCH)
X'35' (LEN, HX, HY)
Push and Set Character Shear (GPSCH)
X'75' (LEN, HX, HY)

Parameters

LEN (GLENGTH1)
Length of following data.
HX (GROSOL)
Dividend of shear ratio.
HY (GROSOL)
Divisor of shear ratio.

Remarks

When HX and HY are both 0, the drawing default is set. The value of the current character shear attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current character shear attribute to the value in the order.

Set Clip Path

Syntax

Set Clip Path (GSCPTH)
X'B4' (LEN, FLAGS, RES, PTHID)

Parameters

LEN (GLENGTH1)
Length of following data.
FLAGS
Extra functions:
RES (GBIT1)
Reserved value, must be 0.
FILL (GBIT1)
Values:
0 Alternate mode
1 Winding mode.
INTER (GBIT1)
Values:
0 Set to specified path
1 Set to intersection of specified and current clip path.
RES2 (GBIT5)
Reserved value, must be 0.
RES (GBIT8)
Reserved.
0x00
Only valid value.
PTHID (GLONG)
Path identifier.
0x00000000
No clipping.
0x00000001-0xFFFFFFFF
Path identifier.

Set Extended Color/Push and Set Extended Color

Parameters

LEN (GLENGTH1)
Length of following data.
0x02
Only valid value.
COLOR (GBIT16)
Color-table index. Except for the special values, the values 0x0000 through 0xnnnn are allowed color indexes; that is, as many values as are allowed by the size of the LCT.
Special Values
0x0000
Drawing default
0x0007
White
0x0008
Black
0xFF00
Drawing default
0xFF0n
Color indexes 0x000n, where n is in the range 1 through 7.
0xFF08
Color index 0 (reset color).

Remarks

The value of the current extended color attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current extended color attribute to the value in the order.

Set Fractional Line Width/Push and Set Fractional Line Width

Syntax

Set Fractional Line Width (GSFLW)
X'11' (LEN, LINEWIDTH)
Push and Set Fractional Line Width (GPSFLW)
X'51' (LEN, LINEWIDTH)

Parameters

LEN (GLENGTH1)
Length of following data.
0x02
Only valid value.
LINEWIDTH (GROUFS)
Value for the line-width attribute.
The nonzero value is an integral and fractional multiplier of the normal line width:
0x0000
Drawing default
0x0001-0xFFFF
Multiplier of normal line width.

Remarks

The value of the current line-width attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current line-width attribute to the value in the order.

Set Indexed Color/Push and Set Indexed Color

Syntax

Set Indexed Color (GSICOL)
X'A6' (LEN, FLAGS, INDEX)
Push and Set Indexed Color (GPSICOL)
X'E6' (LEN, FLAGS, INDEX)

Parameters

LEN (GLENGTH1)
Length of following data.
0x04
Only valid value.
FLAGS
Values:
DEFAULT (GBIT1)
Options:
0 Use specified index
1 Use drawing default color.
SPEC (GBIT1)
Options:
0 Use index directly
1 Special value.
RES (GBIT6)
Reserved value, must be 0.
INDEX (GINDEX3)
Value for color index.
The value is a direct index into the current color table or a special value.
The table can be the standard table, or one loaded by the user. The special values are:
1
Black
2
White
4
All ones
5
All zeros.

Remarks

The value of the current color attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current color attribute to the value in the order.

Set Individual Attribute/Push and Set Individual Attribute

Syntax

Set Individual Attribute (GSIA)
X'14' (LEN, ATYPE, PTYPE, FLAG1, VAL)
Push and Set Individual Attribute (GPSIA)
X'54' (LEN, ATYPE, PTYPE, FLAG1, VAL)

Parameters

LEN (GLENGTH1)
Length of following data.
ATYPE (GBIT8)
Attribute type:
0x1
Color
0x2
Background color
0x3
Mix
0x4
Background Mix
Other
All other values are reserved.
PTYPE (GBIT8)
Primitive type:
0x1
Line
0x2
Character
0x3
Marker
0x4
Pattern
0x5
Image
Other
All other values are reserved.
FLAG1
Values:
DEFAULT (GBIT1)
Options:
0 Use specified value
1 Use drawing default color.
SPEC (GBIT1)
Options:
0 Use value directly
1 Special Value.
RES (GBIT6)
Reserved value, must be 0.
VAL (GINDATT)
Color index value.
For colors, the value is a direct index into the current color table or a special value.
The table can be the standard table, or one loaded by the user. The special values are:
1
Black
2
White
4
All ones
5
All zeros.

Remarks

The value of the current attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the individual attribute to the value in the order.

Set Line End/Push and Set Line End

Syntax

Set Line End (GSLE)
X'1A' (LINEEND)
Push and Set Line End (GPSLE)
X'5A' (LINEEND)

Parameters

LINEEND (GBIT8)
Value for the line-end attribute:
0x00
Drawing default
0x01
Flat
0x02
Square
0x03
Round
Other
Reserved values.

Remarks

The value of the current line-end attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current line-end attribute to the value in the order.

Set Line Join/Push and Set Line Join

Syntax

Set Line Join (GSLJ)
X'1B' (LINEJOIN)
Push and Set Line Join (GPSLJ)
X'5B' (LINEJOIN)

Parameters

LINEJOIN (GBIT8)
Value for line-join attribute:
0x00
Drawing default
0x01
Bevel
0x02
Round
0x03
Miter
Other
Reserved values.

Remarks

The value of the current line-join attribute is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the value of the current line-join attribute to the value in the order.

Set Line Type/Push and Set Line Type

Syntax

Set Line Type (GSLT)
X'18' (LINETYPE)
Push and Set Line Type (GPSLT)
X'58' (LINETYPE)

Parameters

LINETYPE (GBIT8)
Value for line-type attribute.
The value is an index into a notational line-type table:
0x00
Drawing default
0x01
Dotted line
0x02
Short dashed line
0x03
Dash-dot line
0x04
Double dotted line
0x05
Long dashed line
0x06
Dash-double-dot line
0x07
Solid line
0x08
Invisible line
Other
Reserved values.

Remarks

The value of the current line-type attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current line-type attribute to the value in the order.

Set Line Width/Push and Set Line Width

Syntax

Set Line Width (GSLW)
X'19' (LINEWIDTH)
Push and Set Line Width (GPSLW)
X'59' (LINEWIDTH)

Parameters

LINEWIDTH (GBIT8)
Value for line-width attribute:
0x00
Drawing default
0x01-0xFF
Integral multiplier of normal line width.

Remarks

The value of the current line-width attribute is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the value of the current line-width attribute to the value in the order.

Set Marker Precision/Push and Set Marker Precision

Syntax

Set Marker Precision (GSMP)
X'3B' (PREC)
Push and Set Marker Precision (GPSMP)
X'7B' (PREC)

Parameters

PREC (GBIT8)
Value for marker-precision attribute:
0x00
Drawing default
0x01
String precision
0x02
Character precision
0x03
Stroke precision
Other
Reserved values.

Remarks

The value of the current marker-precision attribute is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the value of the current-marker precision attribute to the value in the order.

Set Marker Set/Push and Set Marker Set

Syntax

Set Marker Set (GSMS)
X'3C' (LCID)
Push and Set Marker Set (GPSMS)
X'7C' (LCID)

Parameters

LCID (GUCHAR)
Local identifier (LCID) for the marker set:
0x00
Drawing default
0x01-0xFE
LCID for the coded font
0xFF
Special marker set.

Remarks

The value of the current marker symbol-set attribute is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the value of the current marker symbol-set attribute to the value in the order.

Set Marker Symbol/Push and Set Marker Symbol

Syntax

Set Marker Symbol (GSMT)
X'29' (N)
Push and Set Marker Symbol (GPSMT)
X'69' (N)

Parameters

N (GBIT8)
Value of marker symbol code point. Special marker set
When this is selected (lcid = 0xFF), the values are:
0x00
Drawing default
0x01
Cross
0x02
Plus
0x03
Diamond
0x04
Square
0x05
6-point star
0x06
8-point star
0x07
Filled diamond
0x08
Filled square
0x09
Dot
0x0A
Small circle
0x40
Blank
Other
Reserved values.
Marker set
Values are as follows for any other set:
0x00
Drawing default
0x01-0xFF
These are the code points into the current marker set.

Remarks

The value of the current marker symbol attribute is pushed on to the Segment Call Stack by the Push and Set order only. Both orders then set the value of the current marker symbol attribute to the value in the order.

Set Mix/Push and Set Mix

Syntax

Set Mix (GSMX)
X'0C' (MODE)
Push and Set Mix (GPSMX)
X'4C' (MODE)

Parameters

MODE (GBIT8)
Mix-mode value:
0x00
Drawing default
0x01
OR
0x02
Overpaint
0x03
Reserved
0x04
Exclusive-OR
0x05
Leave alone
0x06
AND
0x07
Subtract
0x08
Source AND (inverse destination)
0x09
All zeros
0x0A
Inverse (source OR destination)
0x0B
Inverse (source XOR destination)
0x0C
Inverse destination
0x0D
Source OR (inverse destination)
0x0E
Inverse source
0x0F
(Inverse source) OR destination
0x10
Inverse (source AND destination)
0x11
All ones.
Other
Reserved values.

Remarks

The value of the current mix attribute is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the value of the current mix attribute to the value in the order.

Set Model Transform/Push and Set Model Transform

Syntax

Set Model Transform (GSTM)
X'24' (LEN, RES, FLAGS, MASK, MX[LEN])
Push and Set Model Transform (GPSTM)
X'64' (LEN, RES, FLAGS, MASK, MX[LEN])

Parameters

LEN (GLENGTH1)
Length of following data.
RES (GBIT8)
Reserved value, must be 0.
FLAGS
Values:
RES (GBIT6)
Reserved value, must be 0.
CM (GBIT2)
Matrix control bits:
B"00" Unity matrix
B"01" Concatenate after
B"10" Concatenate before
B"11" Overwrite.
MASK (GBIT16)
Load mask.
MX[LEN] (GROSOL)
Matrix values.
The matrix size is based on the number of bits set in MASK.

Remarks

The value of the current model transform is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set values in the current model transform as specified in the order.

Set Pattern Symbol/Push and Set Pattern Symbol

Syntax

Set Pattern Symbol (GSPT)
X'28' (PATT)
Push and Set Pattern Symbol (GPSPT)
X'09' (PATT)

Parameters

PATT (GBIT8)
Value for pattern-symbol attribute.
Special pattern set
When this is selected (lcid = 0xFF), the values are:
0x00
Drawing default
0x01-0x08
Density one through density eight (decreasing)
0x09
Vertical lines
0x0A
Horizontal lines
0x0B
Diagonal lines 1 (bottom-left to top-right)
0x0C
Diagonal lines 2 (bottom-left to top-right)
0x0D
Diagonal lines 1 (top-left to bottom-right)
0x0E
Diagonal lines 2 (top-left to bottom-right)
0x0F
No shading
0x10
Solid shading
0x40
Blank.
Other
Reserved values.
Pattern set
Values are as follows for any other set:
0x00
Drawing default
0x01-0xFF
These are the code points into the current pattern set.

Remarks

The value of the current pattern-symbol attribute is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the value of the current pattern-symbol attribute to the value in the order.

Set Pick Identifier/Push and Set Pick Identifier

Syntax

Set Pick Identifier (GSPIK)
X'43' (LEN, PKID)
Push and Set Pick Identifier (GPSPIK)
X'23' (LEN, PKID)

Parameters

LEN (GLENGTH1)
Length of following data.
PKID (GLONG)
Pick identifier.

Remarks

The value of the current pick identifier is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the value of the current pick identifier to the value in the order.

Set Segment Boundary

Syntax

Set Segment Boundary (GSSB)
X'32' (LEN, RES, MASK, BB[LEN])

Parameters

LEN (GLENGTH1)
Length of following data.
RES (GBIT8)
Reserved value, must be 0.
MASK
Values:
RES1 (GBIT2)
Reserved value, must be 0.
XL (GBIT1)
X left limit.
0 Not included in list of BB values
1 Is included in list of BB values.
XR (GBIT1)
X right limit.
0 Not included in list of BB values
1 Is included in list of BB values.
YB (GBIT1)
Y bottom limit.
0 Not included in list of BB values
1 Is included in list of BB values.
YT (GBIT1)
Y top limit.
0 Not included in list of BB values
1 Is included in list of BB values.
RES2 (GBIT2)
Reserved value, must be 0.
BB[LEN] (GROSOL)
Boundary values.

Remarks

The order is only valid in a root-segment prolog.

Set Stroke Line Width/Push and Set Stroke Line Width

Syntax

Set Stroke Line Width (GSSLW)
X'15' (LEN, FLAGS, RES, STRWIDTH)
Push and Set Stroke Line Width (GPSSLW)
X'55' (LEN, FLAGS, RES, STRWIDTH)

Parameters

LEN (GLENGTH1)
Length of following data.
FLAGS
DEFLT (GBIT1)
Values:
0 Set to value
1 Set to drawing default.
RES (GBIT7)
Reserved value, must be 0.
RES (GBIT8)
Reserved value, must be 0.
STRWIDTH (GROSOL)
Value for stroke width.

Set Text Alignment/Push and Set Text Alignment

Parameters

ALIGN (GBIT8)
Value for text-alignment attribute:
0x00
Drawing default. The alignment assumed depends on the current character direction:
Left to right Top alignment.
Top to bottom Left alignment.
Right to left Top alignment.
Bottom to top Top alignment.
0x01
Top Alignment. The string is aligned on the top edge of its top character.
0x02
Cap Alignment. The string is aligned on the cap line.
0x03
Half Alignment. The string is aligned on the half line.
0x04
Base Alignment. The string is aligned on the base line.
0x05
Bottom Alignment. The string is aligned on the bottom edge of its bottom character.
0x06
Bottom Alignment. The string is aligned on the bottom edge of its bottom character.
0xFF
Standard alignment. The alignment assumed depends on the current character direction:
Left to right Bottom alignment.
Top to bottom Top alignment.
Right to left Bottom alignment.
Bottom to top Bottom alignment.

Remarks

The value of the current text alignment attribute is pushed on to the Segment Call stack by the Push and Set order only. Both orders set the value of the current text alignment attribute to the value specified in the order.

Set Viewing Transform

Syntax

Set Viewing Transform (GSTV)
X'31' (LEN, RES, FLAGS, MASK, MX[LEN])

Parameters

LEN (GLENGTH1)
Length of following data.
RES (GBIT8)
Reserved value, must be 0.
FLAGS
Values:
RES1 (GBIT5)
Reserved value, must be 0.
CONTROL (GBIT1)
Values:
0 Concatenate before drawing default
1 Concatenate before the current viewing transform.
RES2 (GBIT2)
Reserved value, must be 0.
MASK (GBIT16)
Load mask.
MX[LEN] (GROSOL)
Matrix values.

Set Viewing Window/Push and Set Viewing Window

Syntax

Set Viewing Window (GSVW)
X'27' (LEN, FLAG, MASK, WW[LEN])
Push and Set Viewing Window (GPSVW)
X'67' (LEN, FLAG, MASK, WW[LEN])

Parameters

LEN (GLENGTH1)
Length of following data.
FLAG
Values:
REPLACE (GBIT1)
Values:
0 Intersect with current window
1 Replace current with new window.
RES (GBIT7)
Reserved value, must be 0.
MASK
Values:
RES1 (GBIT2)
Reserved value, must be 0.
XL (GBIT1)
X left limit.
0 Not included in list of WW values
1 Is included in list of WW values.
XR (GBIT1)
X right limit.
0 Not included in list of WW values
1 Is included in list of WW values.
YB (GBIT1)
Y bottom limit.
0 Not included in list of WW values
1 Is included in list of WW values.
YT (GBIT1)
Y top limit.
0 Not included in list of WW values
1 Is included in list of WW values.
RES2 (GBIT2)
Reserved value, must be 0.
WW[LEN] (GROSOL)
Window values.

Remarks

The value of the current viewing window is pushed on to the Segment Call stack by the Push and Set order only. Both orders then set the current viewing window using the values in the order.

Sharp Fillet at Given Position/Sharp Fillet at Current Position

Syntax

Sharp Fillet at Given Position (GSFLT)
X'E4' (LEN, P0, P1, P2, P3, P4, PN-1, PN, S1, S2, SN/2)
Sharp Fillet at Current Position (GCSFLT)
X'A4' (LEN, P1, P2, P3, P4, PN-1, PN, S1, S2, SN/2)

Parameters

LEN (GLENGTH1)
Length of following data.
P0 (GPOINT)
Coordinate data of first curve start.
This parameter is only present in a Sharp Fillet at Given Position order.
P1 (GPOINT)
Coordinate data of first curve control point.
P2 (GPOINT)
Coordinate data of first curve end.
P3 (GPOINT)
Coordinate data of second curve control point.
P4 (GPOINT)
Coordinate data of second curve end.
PN-1 (GPOINT)
Coordinate data of last curve control point.
PN (GPOINT)
Coordinate data of last curve end.
S1 (GROF)
Sharpness specification of first curve.
S2 (GROF)
Sharpness specification of second curve.
SN/2 (GROF)
Sharpness specification of last curve.

Remarks

Further points are used in groups of two to form a polycurve.