Main Page Widgets Namespaces Book

# Gdk::GC Class Reference

Inheritance diagram for Gdk::GC:

[legend]
List of all members.

## Public Methods

virtual | ~GC ()
GdkGC* | gobj ()
const GdkGC* | gobj () const
GdkGC* | gobj_copy ()
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 (GdkRegion* 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.

## Static Public Methods

Glib::RefPtr<GC> | create ()
Glib::RefPtr<GC> | create (const Glib::RefPtr<Drawable>& drawable)

## Protected Methods

| 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)

## Constructor & Destructor Documentation

virtual Gdk::GC::~GC | ( |  | ) | `[virtual]`

Gdk::GC::GC | ( |  | ) | `[protected]`

Gdk::GC::GC | ( | const Glib::RefPtr<Drawable>& | drawable | ) | `[explicit, protected]`

## Member Function Documentation

Glib::RefPtr<GC> Gdk::GC::create | ( | const Glib::RefPtr<Drawable>& | drawable | ) | `[static]`

Glib::RefPtr<GC> Gdk::GC::create | ( |  | ) | `[static]`

Glib::RefPtr<Colormap> Gdk::GC::get_colormap | ( |  | ) |

| 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.

const GdkGC* Gdk::GC::gobj | ( |  | ) | const`[inline]`

| Reimplemented from Glib::ObjectBase.

GdkGC* Gdk::GC::gobj | ( |  | ) | `[inline]`

| Reimplemented from Glib::ObjectBase.

GdkGC* Gdk::GC::gobj_copy | ( |  | ) |

void Gdk::GC::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.

Parameters:

  x_offset | Amount by which to offset the GC in the X direction.
  y_offset | Amount by which to offset the GC in the Y direction.

void Gdk::GC::set_background | ( | const Color& | color | ) |

void Gdk::GC::set_clip_mask | ( | const Glib::RefPtr<Bitmap>& | mask | ) |

void Gdk::GC::set_clip_origin | ( | int | x,
|  | int | y
| ) |

void Gdk::GC::set_clip_rectangle | ( | Rectangle& | rectangle | ) |

void Gdk::GC::set_clip_region | ( | GdkRegion* | region | ) |

void Gdk::GC::set_colormap | ( | const Glib::RefPtr<Colormap>& | colormap | ) |

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.

Parameters:

  colormap | A Gdk::Colormap.

void Gdk::GC::set_dashes | ( | int | dash_offset,
|  | gint8* | dash_list,
|  | int | n
| ) |

void Gdk::GC::set_exposures | ( | bool | exposures | ) |

void Gdk::GC::set_fill | ( | Fill | fill | ) |

void Gdk::GC::set_foreground | ( | const Color& | color | ) |

void Gdk::GC::set_function | ( | Function | function | ) |

void Gdk::GC::set_line_attributes | ( | int | line_width,
|  | LineStyle | line_style,
|  | CapStyle | cap_style,
|  | JoinStyle | join_style
| ) |

void Gdk::GC::set_rgb_bg_color | ( | const Color& | color | ) |

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.

Parameters:

  color | An unallocated Gdk::Color.

void Gdk::GC::set_rgb_fg_color | ( | const Color& | color | ) |

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.

Parameters:

  color | An unallocated Gdk::Color.

void Gdk::GC::set_stipple | ( | const Glib::RefPtr<Pixmap>& | stipple | ) |

void Gdk::GC::set_subwindow | ( | SubwindowMode | mode | ) |

void Gdk::GC::set_tile | ( | const Glib::RefPtr<Pixmap>& | tile | ) |

void Gdk::GC::set_ts_origin | ( | int | x,
|  | int | y
| ) |

## Friends And Related Function Documentation

Glib::RefPtr<Gdk::GC> wrap | ( | GdkGC* | object,
|  | bool | take_copy = false
| ) | `[related]`

The documentation for this class was generated from the following file:

- gc.h