![]() |
![]() |
A graphics context encapsulates information about the way things are drawn, such as the foreground color or line width. By using graphics contexts, the number of arguments to each drawing call is greatly reduced, and communication overhead is minimized, since identical arguments do not need to be passed repeatedly.
Public Member Functions | |
Glib::RefPtr<Colormap> | get_colormap () |
Retrieves the colormap for a given GC, if it exists. | |
Glib::RefPtr<const Screen> | get_screen () const |
Gets the Gdk::Screen for which gc was created. | |
Glib::RefPtr<Screen> | get_screen () |
Gets the Gdk::Screen for which gc was created. | |
const GdkGC* | gobj () const |
Provides access to the underlying C GObject. | |
GdkGC* | gobj () |
Provides access to the underlying C GObject. | |
GdkGC* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
void | offset (int x_offset, int y_offset) |
Offset attributes such as the clip and tile-stipple origins of the GC so that drawing at x - x_offset, y - y_offset with the offset GC has the same effect as drawing at x, y with the original GC. | |
void | set_background (const Color& color) |
Sets the background color for a graphics context. | |
void | set_clip_mask (const Glib::RefPtr<Bitmap>& mask) |
Sets the clip mask for a graphics context from a bitmap. | |
void | set_clip_origin (int x, int y) |
Sets the origin of the clip mask. | |
void | set_clip_rectangle (Rectangle& rectangle) |
Sets the clip mask for a graphics context from a rectangle. | |
void | set_clip_region (const Region& region) |
Sets the clip mask for a graphics context from a region structure. | |
void | set_colormap (const Glib::RefPtr<Colormap>& colormap) |
Sets the colormap for the GC to the given colormap. | |
void | set_dashes (int dash_offset, gint8* dash_list, int n) |
Sets the way dashed-lines are drawn. | |
void | set_exposures (bool exposures) |
Sets whether copying non-visible portions of a drawable using this graphics context generate exposure events for the corresponding regions of the destination drawable. | |
void | set_fill (Fill fill) |
Set the fill mode for a graphics context. | |
void | set_foreground (const Color& color) |
Sets the foreground color for a graphics context. | |
void | set_function (Function function) |
Determines how the current pixel values and the pixel values being drawn are combined to produce the final pixel values. | |
void | set_line_attributes (int line_width, LineStyle line_style, CapStyle cap_style, JoinStyle join_style) |
Sets various attributes of how lines are drawn. | |
void | set_rgb_bg_color (const Color& color) |
Set the background color of a GC using an unallocated color. | |
void | set_rgb_fg_color (const Color& color) |
Set the foreground color of a GC using an unallocated color. | |
void | set_stipple (const Glib::RefPtr<Pixmap>& stipple) |
Set the stipple bitmap for a graphics context. | |
void | set_subwindow (SubwindowMode mode) |
Sets how drawing with this GC on a window will affect child windows of that window. | |
void | set_tile (const Glib::RefPtr<Pixmap>& tile) |
Set a tile pixmap for a graphics context. | |
void | set_ts_origin (int x, int y) |
Set the origin when using tiles or stipples with the GC. | |
virtual | ~GC () |
Static Public Member Functions | |
static Glib::RefPtr<GC> | create (const Glib::RefPtr<Drawable>& drawable) |
static Glib::RefPtr<GC> | create () |
Protected Member Functions | |
GC (const Glib::RefPtr<Drawable>& drawable) | |
GC () | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr<Gdk::GC> | wrap (GdkGC* object, bool take_copy=false) |
|
|
|
|
|
|
|
|
|
|
|
Retrieves the colormap for a given GC, if it exists. A GC will have a colormap if the drawable for which it was created has a colormap, or if a colormap was set explicitely with gdk_gc_set_colormap.
|
|
Gets the Gdk::Screen for which gc was created.
|
|
Gets the Gdk::Screen for which gc was created.
|
|
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase. |
|
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase. |
|
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
|
|
Offset attributes such as the clip and tile-stipple origins of the GC so that drawing at x - x_offset, y - y_offset with the offset GC has the same effect as drawing at x, y with the original GC.
|
|
Sets the background color for a graphics context. Note that this function uses color ->pixel, use set_rgb_bg_color() to specify the background color as red, green, blue components.
|
|
Sets the clip mask for a graphics context from a bitmap. The clip mask is interpreted relative to the clip origin. (See set_clip_origin()).
|
|
Sets the origin of the clip mask. The coordinates are interpreted relative to the upper-left corner of the destination drawable of the current operation.
|
|
Sets the clip mask for a graphics context from a rectangle. The clip mask is interpreted relative to the clip origin. (See set_clip_origin()).
|
|
Sets the clip mask for a graphics context from a region structure. The clip mask is interpreted relative to the clip origin. (See set_clip_origin()).
|
|
Sets the colormap for the GC to the given colormap. The depth of the colormap's visual must match the depth of the drawable for which the GC was created.
|
|
Sets the way dashed-lines are drawn. Lines will be drawn with alternating on and off segments of the lengths specified in dash_list . The manner in which the on and off segments are drawn is determined by the line_style value of the GC. (This can be changed with set_line_attributes().) The dash_offset defines the phase of the pattern, specifying how many pixels into the dash-list the pattern should actually begin.
|
|
Sets whether copying non-visible portions of a drawable using this graphics context generate exposure events for the corresponding regions of the destination drawable. (See gdk_draw_drawable()).
|
|
Set the fill mode for a graphics context.
|
|
Sets the foreground color for a graphics context. Note that this function uses color ->pixel, use set_rgb_fg_color() to specify the foreground color as red, green, blue components.
|
|
Determines how the current pixel values and the pixel values being drawn are combined to produce the final pixel values.
|
|
Sets various attributes of how lines are drawn. See the corresponding members of Gdk::GCValues for full explanations of the arguments.
|
|
Set the background color of a GC using an unallocated color. The pixel value for the color will be determined using GdkRGB. If the colormap for the GC has not previously been initialized for GdkRGB, then for pseudo-color colormaps (colormaps with a small modifiable number of colors), a colorcube will be allocated in the colormap. Calling this function for a GC without a colormap is an error.
|
|
Set the foreground color of a GC using an unallocated color. The pixel value for the color will be determined using GdkRGB. If the colormap for the GC has not previously been initialized for GdkRGB, then for pseudo-color colormaps (colormaps with a small modifiable number of colors), a colorcube will be allocated in the colormap. Calling this function for a GC without a colormap is an error.
|
|
Set the stipple bitmap for a graphics context. The stipple will only be used if the fill mode is Gdk::STIPPLED or Gdk::OPAQUE_STIPPLED.
|
|
Sets how drawing with this GC on a window will affect child windows of that window.
|
|
Set a tile pixmap for a graphics context. This will only be used if the fill mode is Gdk::TILED.
|
|
Set the origin when using tiles or stipples with the GC. The tile or stipple will be aligned such that the upper left corner of the tile or stipple will coincide with this point.
|
|
|