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 |
virtual | ~GC () |
GdkGC* | gobj () |
| Provides access to the underlying C GObject.
|
const GdkGC* | gobj () const |
| 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 | set_foreground (const Color& color) |
void | set_background (const Color& color) |
void | set_function (Function function) |
void | set_fill (Fill fill) |
void | set_tile (const Glib::RefPtr<Pixmap>& tile) |
void | set_stipple (const Glib::RefPtr<Pixmap>& stipple) |
void | set_ts_origin (int x, int y) |
void | set_clip_origin (int x, int y) |
void | set_clip_mask (const Glib::RefPtr<Bitmap>& mask) |
void | set_clip_rectangle (Rectangle& rectangle) |
void | set_clip_region (Region& region) |
void | set_subwindow (SubwindowMode mode) |
void | set_exposures (bool exposures) |
void | set_line_attributes (int line_width, LineStyle line_style, CapStyle cap_style, JoinStyle join_style) |
void | set_dashes (int dash_offset, gint8* dash_list, int n) |
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_colormap (const Glib::RefPtr<Colormap>& colormap) |
| Sets the colormap for the GC to the given colormap.
|
Glib::RefPtr<Colormap> | get_colormap () |
| Retrieves the colormap for a given GC, if it exists.
|
void | set_rgb_fg_color (const Color& color) |
| Set the foreground color of a GC using an unallocated color.
|
void | set_rgb_bg_color (const Color& color) |
| Set the background color of a GC using an unallocated color.
|
Glib::RefPtr<Screen> | get_screen () |
| Gets the Gdk::Screen for which gc was created.
|
Glib::RefPtr<const Screen> | get_screen () const |
| Gets the Gdk::Screen for which gc was created.
|
Static Public Member Functions |
Glib::RefPtr<GC> | create () |
Glib::RefPtr<GC> | create (const Glib::RefPtr<Drawable>& drawable) |
Protected Member Functions |
| GC () |
| GC (const Glib::RefPtr<Drawable>& drawable) |
Related Functions |
(Note that these are not member functions.)
|
Glib::RefPtr<Gdk::GC> | wrap (GdkGC* object, bool take_copy=false) |