Class Index | Cross Index | Namespace Index |
Gdk GC (Graphics Context) Handle
Contained in: global
Derived from:
Gdk_Handle
Derived by:
none
#include <gtk--/gc.h>
public function member index: |
||
Gdk_GC | (); | |
Gdk_GC | (GdkGC* gc); | |
Gdk_GC | (const Gdk_GC& gc); | |
Gdk_GC | (Gdk_Drawable& drawable); | |
void | copy | (Gdk_GC& src); |
void | create | (Gdk_Drawable const& drawable); |
Gdk_Font | get_font | (); |
void | get_values | (GdkGCValues& values); |
Gdk_GC& | operator = | (const Gdk_GC&); |
void | release | (); |
void | set_background | (const Gdk_Color& c); |
void | set_cap_style | (GdkCapStyle cap_style); |
void | set_clip_mask | (Gdk_Bitmap& mask); |
void | set_clip_mask | (); |
void | set_clip_origin | (gint x, gint y); |
void | set_clip_rectangle | (const Gdk_Rectangle& rect); |
void | set_clip_rectangle | (gint x, gint y, gint w, gint h); |
void | set_clip_region | (Gdk_Region& region); |
void | set_dashes | (gint size); |
void | set_dashes | (gint on, gint off); |
void | set_dashes | (gint dash_offset, gint8 dash_list[], gint dash_list_length); |
void | set_exposures | (bool exp); |
void | set_fill | (GdkFill fill); |
void | set_font | (const Gdk_Font& font); |
void | set_foreground | (const Gdk_Color& c); |
void | set_function | (GdkFunction func); |
void | set_join_style | (GdkJoinStyle join_style); |
void | set_line_attributes | (gint line_width, GdkLineStyle line_style=GDK_LINE_SOLID, GdkCapStyle cap_style=GDK_CAP_BUTT, GdkJoinStyle join_style=GDK_JOIN_MITER); |
void | set_line_style | (GdkLineStyle line_style); |
void | set_line_width | (gint line_width); |
void | set_noclip | (); |
void | set_stipple | (Gdk_Pixmap& stip); |
void | set_subwindow | (GdkSubwindowMode mode); |
void | set_tile | (Gdk_Pixmap& tile); |
void | set_ts_origin | (gint x, gint y); |
~Gdk_GC | (); | |
protected function member index: |
||
void | ref | (); |
void | unref | (); |
private function member index: |
||
void | destroy | (); |
For understanding Graphics Contexts you should read chapter 10 of
Gtk+/Gnome Application Development
(>500K) by Havoc Pennington
or chapter 7 of "Xlib -- C Language X Interface" from the X Consortium.
The new GC refers to the same Graphics Context on the server side.
Allocate a remote gc object based on this drawable.
This copies all properties of one remote GC to another GC on the server.Both, source handle and destination (this) handle, have to be connected to remote Graphics Contexts when calling this method.
Allocate a remote gc object based on this drawable.If the GC Handle is already connected to a remote Graphics Context, then this connection will be released.
If the drawable handle is not connected to a remote drawable, then the GC handle is unconnected after this call.
This is very dangerous and should probably be removed. Nuke the GC and make this copy invalid.
Font will not be initialized if there is no current font.
GdkGCValues is defined as struct _GdkGCValues in gdk/gdktypes.h
Caps are the ends of lines. GdkCapStyle is an enum.Valid values for cap_style are: GDK_CAP_NOT_LAST, GDK_CAP_BUTT, GDK_CAP_ROUND, GDK_CAP_PROJECTING.
GDK_CAP_NOT_LAST is equal to GDK_CAP_BUTT, except for lines with width 0, in which case the Pixel at the end point given is not drawn.
GDK_CAP_BUTT is for lines with suare ends.
GDK_CAP_ROUND causes lines to have filled half circles attached to their end points.
Lines drawn with GDK_CAP_PROJECTING continue beyond their end points for a distance equal to their half width. Line ends are square.
Only bits set to 1 in this mask will be drawn.
This method sets the clipping mask and the clipping origin for you so that only pixels inside this rectangle are drawn.
This method calls the rectangle constructor for you before calling void set_clip_rectangle (const Gdk_Rectangle &rect).
On and off will have the same size. size is given in Pixels.
Use this method if you want dotted lines (choose a smaller value for an than for off). on and off are given in Pixels.
The ons and offs of a dashed line do not have to be the same all the time. With this method you can produce dash-dot lines (or dash-dot-dot or dash-dash-dot-longdash-dash-dot or whatever you like).The dash_list is a vector of length dash_list_length. The elements of dash_list specify the length of the on/off dashes in pixels. dash_list[0], dash_list[2] ... specify the on dashes, the other values are for the off dashes. After dash_list[dash_list_length-1], dash_list[0] is again used.
dash_offset sets the pixel number with which lines are supposed to start. Usually you will set this to 0.
Constraints: dash_list_length>0, dash_list[i]>0 for all i.
exp is a boolean value.If it is set to true, and copy_area is told to copy an area from a window that is currently obscured, then the XServer sends expose events to the obscured window so that the obscured contents is redrawn by the application. This contents is then used in the copy.
GdkFill is an enum defined in gdk/gdktypes.h.The default fill style is GDK_SOLID. When it is set, the drawing commands do what you expect.
If you want to learn about the other fill styles (GDK_SOLID, GDK_TILED, GDK_STIPPLED, GDK_OPAQUE_STIPPLED), you should read chapter 10 of Gtk+/Gnome Application Development (>500K) by Havoc Pennington or chapter 7 of "Xlib -- C Language X Interface" from the X Consortium.
GdkFunction is an enum defined in gdk/gdktypes.h. It specifies how Pixels are set in a drawable.Common values: GDK_COPY, GDK_INVERT, GDK_XOR.
Join styles describe how lines sharing a common end point and drawn in the same drawing request connect with each other.GdkJoinStyle is an enum. valid values for join_style are: GDK_JOIN_MITER, GDK_JOIN_ROUND, GDK_JOIN_BEVEL.
GDK_JOIN_MITER: Lines which form an angle of more than 11 degrees are continued beyond the endpoint until their outer edges meet. Only the intersection set of the two continued lines is drawn. Lines with a smaller angle are joint as with GDK_JOIN_BEVEL.
GDK_JOIN_ROUND: The lines join in a circle with diameter line_width.
GDK_JOIN_BEVEL: The lines end as with CapButt and then the triangle left on the outer edge is filled.
See set_line_width, set_line_style, set_cap_style, set_join_style for an explanation of the arguments.
Lines can be drawn in a number of diffent fashions.GdkLineStyle is an enum. Valid values for line_style are: GDK_LINE_SOLID, GDK_LINE_ON_OFF_DASH, GDK_LINE_DOUBLE_DASH.
Lines with line_style GDK_LINE_SOLID are just a plain lines.
GDK_LINE_ON_OFF_DASH produces dashed lines. The Pixels inside the dashes are drawn in the foreground color, while the Pixels between the dashes are left untouched. The cap style applies to all ends of all dashes.
GDK_LINE_DOUBLE_DASH produces dashed lines where the Pixels inside the dashes are drawn in the foreground color while the Pixels between the dashes are drawn in the background color.
line_width is given in Pixels.0 is a special value for a line width of one Pixel. Lines with line_width set to 0 are usually drawn with hardware acceleration, and the exact pixels set can be different depending on the hardware in use and the direction in that the line is drawn.
This cannot happen for lines with line_width>0. For further info, see chapter 7 of "Xlib -- C Language X Interface" from the X Consortium.
This has an effect only for the GDK_STIPPLED and GDK_OPAQUE_STIPPLED fill styles (set with set_fill). stip must have a depth of 1, it is a bitmap.
GdkSubwindowMode is an enum. Subwindow modes: GDK_CLIP_BY_CHILDREN, GDK_INCLUDE_INFERIORS.
This has an effect only if the fill style of this GC is set to GDK_TILED with set_fill.
This has an effect for fill styles (see set_fill) different from GDK_SOLID. It sets the origin of the first tile or stiple. Tiles and stiples are copied everywhere so that they cover every Pixel.