gdk.GC.GC Class Reference

Inheritance diagram for gdk.GC.GC:

gobject.ObjectG.ObjectG List of all members.

Public Member Functions

GdkGCgetGCStruct ()
 this (GdkGC *gdkGC)
 Sets our main struct and passes it to the parent class.
 this (Drawable drawable)
 Create a new graphics context with default values.
 this (Drawable drawable, GdkGCValues *values, GdkGCValuesMask valuesMask)
 Create a new GC with the given initial values.
Screen getScreen ()
 Gets the GdkScreen for which gc was created gc: a GdkGC.
GC ref ()
 Warning gdk_gc_ref is deprecated and should not be used in newly-written code.
void unref ()
 Warning gdk_gc_unref is deprecated and should not be used in newly-written code.
void setValues (GdkGCValues *values, GdkGCValuesMask valuesMask)
 Sets attributes of a graphics context in bulk.
void getValues (GdkGCValues *values)
 Retrieves the current values from a graphics context.
void setForeground (Color color)
 Sets the foreground color for a graphics context.
void setBackground (Color color)
 Sets the background color for a graphics context.
void setRgbFgColor (Color color)
 Set the foreground color of a GC using an unallocated color.
void setRgbBgColor (Color color)
 Set the background color of a GC using an unallocated color.
void setFont (Font font)
 Warning gdk_gc_set_font is deprecated and should not be used in newly-written code.
void setFunction (GdkFunction funct)
 Determines how the current pixel values and the pixel values being drawn are combined to produce the final pixel values.
void setFill (GdkFill fill)
 Set the fill mode for a graphics context.
void setTile (Pixmap tile)
 Set a tile pixmap for a graphics context.
void setStipple (Pixmap stipple)
 Set the stipple bitmap for a graphics context.
void setTsOrigin (int x, int y)
 Set the origin when using tiles or stipples with the GC.
void setClipOrigin (int x, int y)
 Sets the origin of the clip mask.
void setClipMask (Bitmap mask)
 Sets the clip mask for a graphics context from a bitmap.
void setClipRectangle (GdkRectangle *rectangle)
 Sets the clip mask for a graphics context from a rectangle.
void setClipRegion (Region region)
 Sets the clip mask for a graphics context from a region structure.
void setSubwindow (GdkSubwindowMode mode)
 Sets how drawing with this GC on a window will affect child windows of that window.
void setExposures (int 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 setLineAttributes (int lineWidth, GdkLineStyle lineStyle, GdkCapStyle capStyle, GdkJoinStyle joinStyle)
 Sets various attributes of how lines are drawn.
void setDashes (int dashOffset, byte[] dashList, int n)
 Sets the way dashed-lines are drawn.
void copy (GC srcGc)
 Copy the set of values from one graphics context onto another graphics context.
void setColormap (Colormap colormap)
 Sets the colormap for the GC to the given colormap.
Colormap getColormap ()
 Retrieves the colormap for a given GC, if it exists.
void offset (int xOffset, int yOffset)
 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.

Protected Member Functions

void * getStruct ()
 the main Gtk struct as a void*

Protected Attributes

GdkGCgdkGC
 the main Gtk struct

Constructor & Destructor Documentation

gdk.GC.GC.this ( GdkGC gdkGC  ) 

Sets our main struct and passes it to the parent class.

gdk.GC.GC.this ( Drawable  drawable  ) 

Create a new graphics context with default values.

drawable: a GdkDrawable. The created GC must always be used with drawables of the same depth as this one. Returns: the new graphics context.

gdk.GC.GC.this ( Drawable  drawable,
GdkGCValues values,
GdkGCValuesMask  valuesMask 
)

Create a new GC with the given initial values.

drawable: a GdkDrawable. The created GC must always be used with drawables of the same depth as this one. values: a structure containing initial values for the GC. values_mask: a bit mask indicating which fields in values are set. Returns: the new graphics context.


Member Function Documentation

void gdk.GC.GC.copy ( GC  srcGc  ) 

Copy the set of values from one graphics context onto another graphics context.

dst_gc: the destination graphics context. src_gc: the source graphics context.

Colormap gdk.GC.GC.getColormap (  ) 

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. gc: a GdkGC Returns: the colormap of gc, or NULL if gc doesn't have one.

GdkGC* gdk.GC.GC.getGCStruct (  ) 

Screen gdk.GC.GC.getScreen (  ) 

Gets the GdkScreen for which gc was created gc: a GdkGC.

Returns: the GdkScreen for gc. Since 2.2

void* gdk.GC.GC.getStruct (  )  [protected]

the main Gtk struct as a void*

Reimplemented from gobject.ObjectG.ObjectG.

void gdk.GC.GC.getValues ( GdkGCValues values  ) 

Retrieves the current values from a graphics context.

Note that only the pixel values of the values->foreground and values->background are filled, use gdk_colormap_query_color() to obtain the rgb values if you need them. gc: a GdkGC. values: the GdkGCValues structure in which to store the results.

void gdk.GC.GC.offset ( int  xOffset,
int  yOffset 
)

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.

gc: a GdkGC 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

GC gdk.GC.GC.ref (  ) 

Warning gdk_gc_ref is deprecated and should not be used in newly-written code.

Deprecated function; use g_object_ref() instead. gc: a GdkGC Returns: the gc.

void gdk.GC.GC.setBackground ( Color  color  ) 

Sets the background color for a graphics context.

Note that this function uses color->pixel, use gdk_gc_set_rgb_bg_color() to specify the background color as red, green, blue components. gc: a GdkGC. color: the new background color.

void gdk.GC.GC.setClipMask ( Bitmap  mask  ) 

Sets the clip mask for a graphics context from a bitmap.

The clip mask is interpreted relative to the clip origin. (See gdk_gc_set_clip_origin()). gc: the GdkGC. mask: a bitmap.

void gdk.GC.GC.setClipOrigin ( int  x,
int  y 
)

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. gc: a GdkGC. x: the x-coordinate of the origin. y: the y-coordinate of the origin.

void gdk.GC.GC.setClipRectangle ( GdkRectangle rectangle  ) 

Sets the clip mask for a graphics context from a rectangle.

The clip mask is interpreted relative to the clip origin. (See gdk_gc_set_clip_origin()). gc: a GdkGC. rectangle: the rectangle to clip to.

void gdk.GC.GC.setClipRegion ( Region  region  ) 

Sets the clip mask for a graphics context from a region structure.

The clip mask is interpreted relative to the clip origin. (See gdk_gc_set_clip_origin()). gc: a GdkGC. region: the GdkRegion.

void gdk.GC.GC.setColormap ( 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. gc: a GdkGC colormap: a GdkColormap

void gdk.GC.GC.setDashes ( int  dashOffset,
byte[]  dashList,
int  n 
)

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 gdk_gc_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. gc: a GdkGC. dash_offset: the phase of the dash pattern. dash_list: an array of dash lengths. n: the number of elements in dash_list.

void gdk.GC.GC.setExposures ( int  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.

(See gdk_draw_drawable()). gc: a GdkGC. exposures: if TRUE, exposure events will be generated.

void gdk.GC.GC.setFill ( GdkFill  fill  ) 

Set the fill mode for a graphics context.

gc: a GdkGC. fill: the new fill mode.

void gdk.GC.GC.setFont ( Font  font  ) 

Warning gdk_gc_set_font is deprecated and should not be used in newly-written code.

Sets the font for a graphics context. (Note that all text-drawing functions in GDK take a font argument; the value set here is used when that argument is NULL.) gc: a GdkGC. font: the new font.

void gdk.GC.GC.setForeground ( Color  color  ) 

Sets the foreground color for a graphics context.

Note that this function uses color->pixel, use gdk_gc_set_rgb_fg_color() to specify the foreground color as red, green, blue components. gc: a GdkGC. color: the new foreground color.

void gdk.GC.GC.setFunction ( GdkFunction  funct  ) 

Determines how the current pixel values and the pixel values being drawn are combined to produce the final pixel values.

gc: a GdkGC. function: the GdkFunction to use

void gdk.GC.GC.setLineAttributes ( int  lineWidth,
GdkLineStyle  lineStyle,
GdkCapStyle  capStyle,
GdkJoinStyle  joinStyle 
)

Sets various attributes of how lines are drawn.

See the corresponding members of GdkGCValues for full explanations of the arguments. gc: a GdkGC. line_width: the width of lines. line_style: the dash-style for lines. cap_style: the manner in which the ends of lines are drawn. join_style: the in which lines are joined together.

void gdk.GC.GC.setRgbBgColor ( 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. gc: a GdkGC color: an unallocated GdkColor.

void gdk.GC.GC.setRgbFgColor ( 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. gc: a GdkGC color: an unallocated GdkColor.

void gdk.GC.GC.setStipple ( Pixmap  stipple  ) 

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. gc: a GdkGC. stipple: the new stipple bitmap.

void gdk.GC.GC.setSubwindow ( GdkSubwindowMode  mode  ) 

Sets how drawing with this GC on a window will affect child windows of that window.

gc: a GdkGC. mode: the subwindow mode.

void gdk.GC.GC.setTile ( Pixmap  tile  ) 

Set a tile pixmap for a graphics context.

This will only be used if the fill mode is GDK_TILED. gc: a GdkGC. tile: the new tile pixmap.

void gdk.GC.GC.setTsOrigin ( int  x,
int  y 
)

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. gc: a GdkGC. x: the x-coordinate of the origin. y: the y-coordinate of the origin.

void gdk.GC.GC.setValues ( GdkGCValues values,
GdkGCValuesMask  valuesMask 
)

Sets attributes of a graphics context in bulk.

For each flag set in values_mask, the corresponding field will be read from values and set as the new value for gc. If you're only setting a few values on gc, calling individual "setter" functions is likely more convenient. gc: a GdkGC values: struct containing the new values values_mask: mask indicating which struct fields are to be used

void gdk.GC.GC.unref (  ) 

Warning gdk_gc_unref is deprecated and should not be used in newly-written code.

Use g_object_unref() instead. Decrement the reference count of gc. gc: a GdkGC


Member Data Documentation

GdkGC* gdk.GC.GC.gdkGC [protected]

the main Gtk struct


SourceForge.net Logo DSource.org Logo digitalmars.com Logo