| Guifications Library Reference Manual |
|---|
GfGCGfGC — GfGC Object API |
GfGC;
GfGCValues;
enum GfCapStyle;
enum GfFill;
enum GfFunction;
enum GfJoinStyle;
enum GfLineStyle;
enum GfSubwindowMode;
enum GfGCValuesMask;
#define gf_cap_style_from_string (str)
#define gf_cap_style_to_string (cap_style, i18n)
#define gf_fill_from_string (str)
#define gf_fill_to_string (fill, i18n)
#define gf_function_from_string (str)
#define gf_function_to_string (function, i18n)
#define gf_join_style_from_string (str)
#define gf_join_style_to_string (join_style, i18n)
#define gf_line_style_from_string (str)
#define gf_line_style_to_string (line_style, i18n)
#define gf_subwindow_mode_from_string (str)
#define gf_subwindow_mode_to_string (mode, i18n)
#define gf_values_mask_from_string (str)
#define gf_values_mask_to_string (mask, i18n)
GfGC* gf_gc_new (GfDrawable *drawable);
GfGC* gf_gc_new_with_values (GfDrawable *drawable,
GfGCValues *values,
GfGCValuesMask mask);
void gf_gc_get_values (GfGC *gc,
GfGCValues *values);
void gf_gc_set_values (GfGC *gc,
GfGCValues *values,
GfGCValuesMask mask);
void gf_gc_set_foreground (GfGC *gc,
const GfColor *color);
void gf_gc_set_background (GfGC *gc,
const GfColor *color);
void gf_gc_set_font (GfGC *gc,
const GfFont *font);
void gf_gc_set_function (GfGC *gc,
GfFunction function);
void gf_gc_set_fill (GfGC *gc,
GfFill fill);
void gf_gc_set_tile (GfGC *gc,
GfDrawable *tile);
void gf_gc_set_stipple (GfGC *gc,
GfDrawable *stipple);
void gf_gc_set_ts_origin (GfGC *gc,
gint x,
gint y);
void gf_gc_set_clip_origin (GfGC *gc,
gint x,
gint y);
void gf_gc_set_clip_mask (GfGC *gc,
GfDrawable *mask);
void gf_gc_set_subwindow (GfGC *gc,
GfSubwindowMode mode);
void gf_gc_set_exposures (GfGC *gc,
gboolean exposures);
void gf_gc_set_line_attributes (GfGC *gc,
gint line_width,
GfLineStyle line_style,
GfCapStyle cap_style,
GfJoinStyle join_style);
void gf_gc_set_colormap (GfGC *gc,
GfColormap *colormap);
GfColormap* gf_gc_get_colormap (const GfGC *gc);
typedef struct {
GfColor foreground;
GfColor background;
GfFont *font;
GfFunction function;
GfFill fill;
GfDrawable *tile;
GfDrawable *stipple;
GfDrawable *clip_mask;
GfSubwindowMode subwindow_mode;
gint ts_x_origin;
gint ts_y_origin;
gint clip_x_origin;
gint clip_y_origin;
gint exposures;
gint line_width;
GfLineStyle line_style;
GfCapStyle cap_style;
GfJoinStyle join_style;
} GfGCValues;
The GfGCValues structure holds a set of values used to create or modify a graphics context.
GfColor foreground; |
The foreground color. Note that #gf_gc_get_values() only sets
the pixel value.
|
GfColor background; |
The background color. Note that #gf_gc_get_values() only sets
the pixel value.
|
GfFont *font; |
The default font. |
GfFunction function; |
The bitwise operation used when drawing. |
GfFill fill; |
The fill style. |
GfDrawable *tile; |
The tile GfDrawable. |
GfDrawable *stipple; |
The stipple GfDrawable. |
GfDrawable *clip_mask; |
The clip mask GfDrawable. |
GfSubwindowMode subwindow_mode; |
The subwindow mode. |
gint ts_x_origin; |
The x origin of the tile or stipple. |
gint ts_y_origin; |
The y origin of the tile or stipple. |
gint clip_x_origin; |
The x origin of the clip mask. |
gint clip_y_origin; |
The y origin of the clip mask. |
gint exposures; |
Whether graphics exposures are enabled. |
gint line_width; |
The line width. |
GfLineStyle line_style; |
The way dashed lines are drawn. |
GfCapStyle cap_style; |
The way the ends of lines are drawn. |
GfJoinStyle join_style; |
The way joins between lines are drawn. |
typedef enum _GfCapStyle {
GF_CAP_NOT_LAST = 0,
GF_CAP_BUTT,
GF_CAP_ROUND,
GF_CAP_PROJECTING
} GfCapStyle;
Determines how the ends of lines are drawn.
GF_CAP_NOT_LAST |
The same as GF_CAP_BUTT for lines of non-zero width. for zero width lines, the final point on the line will not be drawn. |
GF_CAP_BUTT |
The ends of the lines are drawn squared off and extending to the coordinates of the end point. |
GF_CAP_ROUND |
The ends of the lines are drawn as semicircles with the diameter equal to the line width and centered at the end point. |
GF_CAP_PROJECTING |
The ends of the lines are drawn squared off and extending half the width of the line beyond the end point. |
typedef enum _GfFill {
GF_SOLID = 0,
GF_TILED,
GF_STIPPLED,
GF_OPAQUE_STIPPLED
} GfFill;
Decides how primitives are drawn.
GF_SOLID |
Draw with the foreground color. |
GF_TILED |
Draw with a tiled drawable. |
GF_STIPPLED |
Draw using the stipple drawable. Pixels corresponding to bits in the stipple drawable that are set will be drawn in the foreground color; pixels corresponding to bits that are not set will be left untouched. |
GF_OPAQUE_STIPPLED |
Draw using the stipple drawable. Pixels corresponding to bits in the stipple drawable that are set will be drawn in the foreground color; pixels corresponding to bits that are not set will be drawn with the background color. |
typedef enum _GfFunction {
GF_COPY = 0,
GF_INVERT,
GF_XOR,
GF_CLEAR,
GF_AND,
GF_AND_REVERSE,
GF_AND_INVERT,
GF_NOOP,
GF_OR,
GF_EQUIV,
GF_OR_REVERSE,
GF_COPY_INVERT,
GF_OR_INVERT,
GF_NAND,
GF_NOR,
GF_SET
} GfFunction;
Determines how the bit values for the source pixels are combined with the bit values for destination pixels to produce the final result.
GF_COPY |
Copy |
GF_INVERT |
Invert |
GF_XOR |
XOR |
GF_CLEAR |
Clear |
GF_AND |
AND |
GF_AND_REVERSE |
Reverse |
GF_AND_INVERT |
Invert |
GF_NOOP |
No operation |
GF_OR |
OR |
GF_EQUIV |
Equiv |
GF_OR_REVERSE |
OR Reverse |
GF_COPY_INVERT |
Copy Invert |
GF_OR_INVERT |
OR Invert |
GF_NAND |
NAND |
GF_NOR |
NOR |
GF_SET |
SET |
typedef enum _GfJoinStyle {
GF_JOIN_MITER = 0,
GF_JOIN_ROUND,
GF_JOIN_BEVEL
} GfJoinStyle;
Determines how the joins between segments of a polygon are drawn.
GF_JOIN_MITER |
The sides of each line are extended to meet at an angle. |
GF_JOIN_ROUND |
The sides of the two lines are joined by a circular arc. |
GF_JOIN_BEVEL |
The sides of the two lines are joined by a straight line which makes an equal angle with each line. |
typedef enum _GfLineStyle {
GF_LINE_SOLID = 0,
GF_LINE_ON_OFF_DASH,
GF_LINE_DOUBLE_DASH
} GfLineStyle;
Determines how lines are drawn.
GF_LINE_SOLID |
Lines are drawn solid. |
GF_LINE_ON_OFF_DASH |
Even segments are drawn; odd segments are not drawn. |
GF_LINE_DOUBLE_DASH |
Even segments are normally. Odd segments are drawn in the background color if the fill style is GF_SOLID, or in the background color masked by the stipple if the fill style is GF_STIPPLED. |
typedef enum _GfSubwindowMode {
GF_CLIP_BY_CHILDREN = 0,
GF_INCLUDE_INFERIORS = 1
} GfSubwindowMode;
Determines how drawing onto a window will affect child windows of that window.
GF_CLIP_BY_CHILDREN |
Only draw onto the window itself. |
GF_INCLUDE_INFERIORS |
Draw onto the window and child windows. |
typedef enum _GfGCValuesMask {
GF_GC_FOREGROUND = 1 << 0,
GF_GC_BACKGROUND = 1 << 1,
GF_GC_FONT = 1 << 2,
GF_GC_FUNCTION = 1 << 3,
GF_GC_FILL = 1 << 4,
GF_GC_TILE = 1 << 5,
GF_GC_STIPPLE = 1 << 6,
GF_GC_CLIP_MASK = 1 << 7,
GF_GC_SUBWINDOW = 1 << 8,
GF_GC_TS_X_ORIGIN = 1 << 9,
GF_GC_TS_Y_ORIGIN = 1 << 10,
GF_GC_CLIP_X_ORIGIN = 1 << 11,
GF_GC_CLIP_Y_ORIGIN = 1 << 12,
GF_GC_EXPOSURES = 1 << 13,
GF_GC_LINE_WIDTH = 1 << 14,
GF_GC_LINE_STYLE = 1 << 15,
GF_GC_CAP_STYLE = 1 << 16,
GF_GC_JOIN_STYLE = 1 << 17
} GfGCValuesMask;
A set of bit flags used to indicate which fields GfGCValues structure are set.
GF_GC_FOREGROUND |
The foreground is set. |
GF_GC_BACKGROUND |
The background is set. |
GF_GC_FONT |
The font is set. |
GF_GC_FUNCTION |
The function is set. |
GF_GC_FILL |
The fill is set. |
GF_GC_TILE |
The tile is set. |
GF_GC_STIPPLE |
The stipple is set. |
GF_GC_CLIP_MASK |
The clip mask is set. |
GF_GC_SUBWINDOW |
The subwindow mode is set. |
GF_GC_TS_X_ORIGIN |
The ts_x_origin is set. |
GF_GC_TS_Y_ORIGIN |
The ts_y_origin is set. |
GF_GC_CLIP_X_ORIGIN |
The clip_x_origin is set. |
GF_GC_CLIP_Y_ORIGIN |
The clip_y_origin is set. |
GF_GC_EXPOSURES |
The exposures is set. |
GF_GC_LINE_WIDTH |
The line width is set. |
GF_GC_LINE_STYLE |
The line style is set. |
GF_GC_CAP_STYLE |
The cap style is set. |
GF_GC_JOIN_STYLE |
The join style is set. |
#define gf_cap_style_from_string(str)
Gets a GfCapStyle from a string.
Note: str MUST be the untranslated string!
str : |
The string. |
| Returns : | The GfCapStyle from str.
|
#define gf_cap_style_to_string(cap_style, i18n)
Gets a string from a GfCapStyle.
cap_style : |
The GfCapStyle. |
i18n : |
TRUE for the translated version. |
| Returns : |
cap_style as a string.
|
#define gf_fill_from_string(str)
Gets a GfFill from a string.
Note: str MUST be the unstranslated string!
str : |
The string. |
| Returns : | The GfFill. |
#define gf_fill_to_string(fill, i18n)
Gets a string from a GfFill.
fill : |
The GfFill. |
i18n : |
TRUE for the translated version. |
#define gf_function_from_string(str)
Gets a GfFunction from a string.
Note: str MUST be the unstranslated string!
str : |
The string. |
| Returns : | The GfFunction. |
#define gf_function_to_string(function, i18n)
Gets a string from a GfFunction.
function : |
The GfFunction. |
i18n : |
TRUE for the translated version. |
| Returns : |
function as a string.
|
#define gf_join_style_from_string(str)
Gets a GfJoinStyle from a string.
Note: str MUST be the untraslated string!
str : |
The string. |
| Returns : | The GfJoinStyle. |
#define gf_join_style_to_string(join_style, i18n)
Gets a string from a GfJoinStyle.
join_style : |
The GfJoinStyle. |
i18n : |
TRUE for the translated version. |
| Returns : |
join_style as a string.
|
#define gf_line_style_from_string(str)
Gets a GfLineStyle from a string.
Note: str MUST be the untranslated string.
str : |
The string. |
| Returns : | The GfLineStyle. |
#define gf_line_style_to_string(line_style, i18n)
Gets a string from a GfLineStyle.
line_style : |
The GfLineStyle. |
i18n : |
TRUE for the translated version. |
| Returns : |
line_style as a string.
|
#define gf_subwindow_mode_from_string(str)
Gets a GfSubwindowMode from a string.
Note: str MUST be the untranslated string!
str : |
The string. |
| Returns : | The GfSubwindowMode. |
#define gf_subwindow_mode_to_string(mode, i18n)
Gets a string from a GfSubwindowMode.
mode : |
The GfSubwindowMode. |
i18n : |
TRUE for the translated version. |
| Returns : |
mode as a string.
|
#define gf_values_mask_from_string(str)
Gets a GfGCValuesMask from a string.
Note: str MUST be the untranslated string!
str : |
The string. |
| Returns : | The GfGCValuesMask. |
#define gf_values_mask_to_string(mask, i18n)
Gets a string from a GfGCValuesMask.
mask : |
The GfGCValuesMask. |
i18n : |
TRUE for the translated version. |
| Returns : |
mask as a string.
|
GfGC* gf_gc_new (GfDrawable *drawable);
Creates a new GfGC from drawable.
drawable : |
The GfDrawable instance. |
| Returns : | The new GfGC. |
GfGC* gf_gc_new_with_values (GfDrawable *drawable, GfGCValues *values, GfGCValuesMask mask);
Creates a new GfGC from drawable using values.
drawable : |
The GfDrawable instance. |
values : |
The GfGCValues. |
mask : |
The GfGCValuesMask. |
| Returns : | The new GfGC. |
void gf_gc_get_values (GfGC *gc, GfGCValues *values);
Gets the GfGCValues from gc.
gc : |
The GfGC instance. |
values : |
The return address for the GfGCValues. |
void gf_gc_set_values (GfGC *gc, GfGCValues *values, GfGCValuesMask mask);
Sets the GfGCValues for gc.
gc : |
The GfGC instance. |
values : |
The GfGCValues. |
mask : |
The GfGCValuesMask. |
void gf_gc_set_foreground (GfGC *gc, const GfColor *color);
Sets the foreground color for gc.
gc : |
The GfGC instance. |
color : |
The new foreground color. |
void gf_gc_set_background (GfGC *gc, const GfColor *color);
Sets the background color for gc.
gc : |
The GfGC instance. |
color : |
The new background color. |
void gf_gc_set_font (GfGC *gc, const GfFont *font);
Sets the font for gc.
gc : |
The GfGC instance. |
font : |
The new font. |
void gf_gc_set_function (GfGC *gc, GfFunction function);
Sets the function for gc.
gc : |
The GfGC instance. |
function : |
The new function. |
void gf_gc_set_fill (GfGC *gc, GfFill fill);
Sets the fill for gc.
gc : |
The GfGC instance. |
fill : |
The new fill. |
void gf_gc_set_tile (GfGC *gc, GfDrawable *tile);
Sets the tile for gc.
gc : |
The GfGC instance. |
tile : |
The new tile. |
void gf_gc_set_stipple (GfGC *gc, GfDrawable *stipple);
Sets the stiplle for gc.
gc : |
The GfGC instance. |
stipple : |
The new stipple. |
void gf_gc_set_ts_origin (GfGC *gc, gint x, gint y);
Sets the tile/stipple origin for gc.
gc : |
The GfGC instance. |
x : |
The x-coordinate. |
y : |
The y-coordinate. |
void gf_gc_set_clip_origin (GfGC *gc, gint x, gint y);
Sets the clip origin for gc.
gc : |
The GfGC instance. |
x : |
The x-coordinate. |
y : |
The y-coordinate. |
void gf_gc_set_clip_mask (GfGC *gc, GfDrawable *mask);
Sets the clip mask for gc.
gc : |
The GfGC instance. |
mask : |
The new clip mask. |
void gf_gc_set_subwindow (GfGC *gc, GfSubwindowMode mode);
Sets the subwindow mode for gc.
gc : |
The GfGC instance. |
mode : |
The new subwindow mode. |
void gf_gc_set_exposures (GfGC *gc, gboolean exposures);
Sets exposures for gc.
gc : |
The GfGC instance. |
exposures : |
The new exposures. |
void gf_gc_set_line_attributes (GfGC *gc, gint line_width, GfLineStyle line_style, GfCapStyle cap_style, GfJoinStyle join_style);
Sets the line attributes for gc.
gc : |
The GfGC instance. |
line_width : |
The new line width. |
line_style : |
The new line style. |
cap_style : |
The new cap style. |
join_style : |
The new join style. |
void gf_gc_set_colormap (GfGC *gc, GfColormap *colormap);
Sets the colormap for gc.
gc : |
The GfGC instance. |
colormap : |
The new colormap. |
GfColormap* gf_gc_get_colormap (const GfGC *gc);
Gets the colormap for gc.
gc : |
The GfGC instance. |
| Returns : | The colormap for gc.
|
| << GfColormap | GfImage >> |