typedef struct { GR_GC_ID gcid; int mode; GR_REGION_ID region; GR_FONT_ID font; GR_COLOR foreground; GR_COLOR background; GR_BOOL usebackground; } GR_GC_INFO; |
The GR_GC_INFO structure is used to retrieve information regarding the current state of a graphics context.
Type | Name | Description |
---|---|---|
GR_GC_ID | gcid | The ID of the graphics context. |
int | mode | The current drawing mode of the GC. |
GR_REGION_ID | region | The current drawing region of the GC. |
GR_FONT_ID | font | The current font for drawing text with the GC. |
GR_COLOR | foreground | The current foreground color for drawing functions using the GC. |
GR_COLOR | background | The current background color for drawing functions using the GC. |
GR_BOOL | usebackground | If GR_TRUE the window background will be drawn when an exposure event occurs. If GR_FALSE the window background will not automatically be drawn. |
The following table shows the drawing modes that are available for use with graphics contexts in nano-X.
Table 3-1. Drawing Modes
Value | Description |
---|---|
GR_MODE_SET | When drawing the graphic output will represent the selected forground color. |
GR_MODE_XOR | When drawing the graphic output will be th XOR of the GC's foreground color and the current color on the drawable. |
GR_MODE_OR | When drawing the graphic output will be th OR of the GC's foreground color and the current color on the drawable. |
GR_MODE_AND | When drawing the graphic output will be th AND of the GC's foreground color and the current color on the drawable. |
GR_MODE_DRAWMASK | Set bits in this mask correspond to GC mode bits that define drawing style. Clear bits of this mask correspond to GC mode bits that have an extended meaning beyond the drawing style. In this table all of the preceding mode bits define drawing style, all of the following bits have an extended meaning. |
GR_MODE_EXCLUDECHILDREN | If this flag is set, then while clipping child windows are excluded from the clip region. Normally the area covered by child windows is clipped when drawing on the parent window. This flag disables the normal clipping action. |