<refentry id="gdk-Graphics-Contexts">
<refmeta>
<refentrytitle>Graphics Contexts</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Graphics Contexts</refname><refpurpose>objects to encapsulate drawing properties.</refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>
<synopsis>

#include &lt;gdk/gdk.h&gt;


struct      <link linkend="GdkGC">GdkGC</link>;
struct      <link linkend="GdkGCValues">GdkGCValues</link>;
enum        <link linkend="GdkGCValuesMask">GdkGCValuesMask</link>;
enum        <link linkend="GdkFunction">GdkFunction</link>;
<link linkend="GdkGC">GdkGC</link>*      <link linkend="gdk-gc-new">gdk_gc_new</link>                      (<link linkend="GdkDrawable">GdkDrawable</link> *drawable);
<link linkend="GdkGC">GdkGC</link>*      <link linkend="gdk-gc-new-with-values">gdk_gc_new_with_values</link>          (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGCValues">GdkGCValues</link> *values,
                                             <link linkend="GdkGCValuesMask">GdkGCValuesMask</link> values_mask);
<link linkend="GdkGC">GdkGC</link>*      <link linkend="gdk-gc-ref">gdk_gc_ref</link>                      (<link linkend="GdkGC">GdkGC</link> *gc);
void        <link linkend="gdk-gc-unref">gdk_gc_unref</link>                    (<link linkend="GdkGC">GdkGC</link> *gc);
#define     <link linkend="gdk-gc-destroy">gdk_gc_destroy</link>
void        <link linkend="gdk-gc-set-values">gdk_gc_set_values</link>               (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkGCValues">GdkGCValues</link> *values,
                                             <link linkend="GdkGCValuesMask">GdkGCValuesMask</link> values_mask);
void        <link linkend="gdk-gc-get-values">gdk_gc_get_values</link>               (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkGCValues">GdkGCValues</link> *values);
void        <link linkend="gdk-gc-set-foreground">gdk_gc_set_foreground</link>           (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkColor">GdkColor</link> *color);
void        <link linkend="gdk-gc-set-background">gdk_gc_set_background</link>           (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkColor">GdkColor</link> *color);
void        <link linkend="gdk-gc-set-rgb-fg-color">gdk_gc_set_rgb_fg_color</link>         (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkColor">GdkColor</link> *color);
void        <link linkend="gdk-gc-set-rgb-bg-color">gdk_gc_set_rgb_bg_color</link>         (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkColor">GdkColor</link> *color);
void        <link linkend="gdk-gc-set-font">gdk_gc_set_font</link>                 (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkFont">GdkFont</link> *font);
void        <link linkend="gdk-gc-set-function">gdk_gc_set_function</link>             (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkFunction">GdkFunction</link> function);
void        <link linkend="gdk-gc-set-fill">gdk_gc_set_fill</link>                 (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkFill">GdkFill</link> fill);
enum        <link linkend="GdkFill">GdkFill</link>;
void        <link linkend="gdk-gc-set-tile">gdk_gc_set_tile</link>                 (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkPixmap">GdkPixmap</link> *tile);
void        <link linkend="gdk-gc-set-stipple">gdk_gc_set_stipple</link>              (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkPixmap">GdkPixmap</link> *stipple);
void        <link linkend="gdk-gc-set-ts-origin">gdk_gc_set_ts_origin</link>            (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y);
void        <link linkend="gdk-gc-set-clip-origin">gdk_gc_set_clip_origin</link>          (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y);
void        <link linkend="gdk-gc-set-clip-mask">gdk_gc_set_clip_mask</link>            (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkBitmap">GdkBitmap</link> *mask);
void        <link linkend="gdk-gc-set-clip-rectangle">gdk_gc_set_clip_rectangle</link>       (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkRectangle">GdkRectangle</link> *rectangle);
void        <link linkend="gdk-gc-set-clip-region">gdk_gc_set_clip_region</link>          (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkRegion">GdkRegion</link> *region);
void        <link linkend="gdk-gc-set-subwindow">gdk_gc_set_subwindow</link>            (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkSubwindowMode">GdkSubwindowMode</link> mode);
enum        <link linkend="GdkSubwindowMode">GdkSubwindowMode</link>;
void        <link linkend="gdk-gc-set-exposures">gdk_gc_set_exposures</link>            (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gboolean">gboolean</link> exposures);
void        <link linkend="gdk-gc-set-line-attributes">gdk_gc_set_line_attributes</link>      (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> line_width,
                                             <link linkend="GdkLineStyle">GdkLineStyle</link> line_style,
                                             <link linkend="GdkCapStyle">GdkCapStyle</link> cap_style,
                                             <link linkend="GdkJoinStyle">GdkJoinStyle</link> join_style);
enum        <link linkend="GdkLineStyle">GdkLineStyle</link>;
enum        <link linkend="GdkCapStyle">GdkCapStyle</link>;
enum        <link linkend="GdkJoinStyle">GdkJoinStyle</link>;
void        <link linkend="gdk-gc-set-dashes">gdk_gc_set_dashes</link>               (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> dash_offset,
                                             <link linkend="gint8">gint8</link> dash_list[],
                                             <link linkend="gint">gint</link> n);
void        <link linkend="gdk-gc-copy">gdk_gc_copy</link>                     (<link linkend="GdkGC">GdkGC</link> *dst_gc,
                                             <link linkend="GdkGC">GdkGC</link> *src_gc);
void        <link linkend="gdk-gc-set-colormap">gdk_gc_set_colormap</link>             (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkColormap">GdkColormap</link> *colormap);
<link linkend="GdkColormap">GdkColormap</link>* <link linkend="gdk-gc-get-colormap">gdk_gc_get_colormap</link>            (<link linkend="GdkGC">GdkGC</link> *gc);
void        <link linkend="gdk-gc-offset">gdk_gc_offset</link>                   (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x_offset,
                                             <link linkend="gint">gint</link> y_offset);


</synopsis>
</refsynopsisdiv>





<refsect1>
<title>Description</title>
<para>
All drawing operations in GDK take a 
<firstterm>graphics context</firstterm> (GC) argument. 
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.
</para>
<para>
Most values of a graphics context can be set at
creation time by using <link linkend="gdk-gc-new-with-values">gdk_gc_new_with_values</link>(),
or can be set one-by-one using functions such
as <link linkend="gdk-gc-set-foreground">gdk_gc_set_foreground</link>(). A few of the values
in the GC, such as the dash pattern, can only
be set by the latter method.
</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="GdkGC">struct GdkGC</title>
<programlisting>struct GdkGC
{
  GObject parent_instance;

  gint clip_x_origin;
  gint clip_y_origin;
  gint ts_x_origin;
  gint ts_y_origin;

  GdkColormap *colormap;
};
</programlisting>
<para>
The <link linkend="GdkGC">GdkGC</link> structure represents a graphics context.
It is an opaque structure with no user-visible
elements.
</para></refsect2>
<refsect2>
<title><anchor id="GdkGCValues">struct GdkGCValues</title>
<programlisting>struct GdkGCValues
{
  GdkColor	    foreground;
  GdkColor	    background;
  GdkFont	   *font;
  GdkFunction	    function;
  GdkFill	    fill;
  GdkPixmap	   *tile;
  GdkPixmap	   *stipple;
  GdkPixmap	   *clip_mask;
  GdkSubwindowMode  subwindow_mode;
  gint		    ts_x_origin;
  gint		    ts_y_origin;
  gint		    clip_x_origin;
  gint		    clip_y_origin;
  gint		    graphics_exposures;
  gint		    line_width;
  GdkLineStyle	    line_style;
  GdkCapStyle	    cap_style;
  GdkJoinStyle	    join_style;
};
</programlisting>
<para>
The <link linkend="GdkGCValues">GdkGCValues</link> structure holds a set of values used
to create or modify a graphics context.
</para><informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><link linkend="GdkColor">GdkColor</link> <structfield>foreground</structfield></entry>
<entry>the foreground color.
</entry>
</row>
<row>
<entry><link linkend="GdkColor">GdkColor</link> <structfield>background</structfield></entry>
<entry>the background color.
</entry>
</row>
<row>
<entry><link linkend="GdkFont">GdkFont</link> *<structfield>font</structfield></entry>
<entry>the default font.
</entry>
</row>
<row>
<entry><link linkend="GdkFunction">GdkFunction</link> <structfield>function</structfield></entry>
<entry>the bitwise operation used when drawing.
</entry>
</row>
<row>
<entry><link linkend="GdkFill">GdkFill</link> <structfield>fill</structfield></entry>
<entry>the fill style.
</entry>
</row>
<row>
<entry><link linkend="GdkPixmap">GdkPixmap</link> *<structfield>tile</structfield></entry>
<entry>the tile pixmap.
</entry>
</row>
<row>
<entry><link linkend="GdkPixmap">GdkPixmap</link> *<structfield>stipple</structfield></entry>
<entry>the stipple bitmap.
</entry>
</row>
<row>
<entry><link linkend="GdkPixmap">GdkPixmap</link> *<structfield>clip_mask</structfield></entry>
<entry>the clip mask bitmap.
</entry>
</row>
<row>
<entry><link linkend="GdkSubwindowMode">GdkSubwindowMode</link> <structfield>subwindow_mode</structfield></entry>
<entry>the subwindow mode.
</entry>
</row>
<row>
<entry><link linkend="gint">gint</link> <structfield>ts_x_origin</structfield></entry>
<entry>the x origin of the tile or stipple.
</entry>
</row>
<row>
<entry><link linkend="gint">gint</link> <structfield>ts_y_origin</structfield></entry>
<entry>the y origin of the tile or stipple.
</entry>
</row>
<row>
<entry><link linkend="gint">gint</link> <structfield>clip_x_origin</structfield></entry>
<entry>the x origin of the clip mask.
</entry>
</row>
<row>
<entry><link linkend="gint">gint</link> <structfield>clip_y_origin</structfield></entry>
<entry>the y origin of the clip mask.
</entry>
</row>
<row>
<entry><link linkend="gint">gint</link> <structfield>graphics_exposures</structfield></entry>
<entry>whether graphics exposures are enabled.
</entry>
</row>
<row>
<entry><link linkend="gint">gint</link> <structfield>line_width</structfield></entry>
<entry>the line width.
</entry>
</row>
<row>
<entry><link linkend="GdkLineStyle">GdkLineStyle</link> <structfield>line_style</structfield></entry>
<entry>the way dashed lines are drawn.
</entry>
</row>
<row>
<entry><link linkend="GdkCapStyle">GdkCapStyle</link> <structfield>cap_style</structfield></entry>
<entry>the way the ends of lines are drawn.
</entry>
</row>
<row>
<entry><link linkend="GdkJoinStyle">GdkJoinStyle</link> <structfield>join_style</structfield></entry>
<entry>the way joins between lines are drawn.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GdkGCValuesMask">enum GdkGCValuesMask</title>
<programlisting>typedef enum
{
  GDK_GC_FOREGROUND    = 1 &lt;&lt; 0,
  GDK_GC_BACKGROUND    = 1 &lt;&lt; 1,
  GDK_GC_FONT	       = 1 &lt;&lt; 2,
  GDK_GC_FUNCTION      = 1 &lt;&lt; 3,
  GDK_GC_FILL	       = 1 &lt;&lt; 4,
  GDK_GC_TILE	       = 1 &lt;&lt; 5,
  GDK_GC_STIPPLE       = 1 &lt;&lt; 6,
  GDK_GC_CLIP_MASK     = 1 &lt;&lt; 7,
  GDK_GC_SUBWINDOW     = 1 &lt;&lt; 8,
  GDK_GC_TS_X_ORIGIN   = 1 &lt;&lt; 9,
  GDK_GC_TS_Y_ORIGIN   = 1 &lt;&lt; 10,
  GDK_GC_CLIP_X_ORIGIN = 1 &lt;&lt; 11,
  GDK_GC_CLIP_Y_ORIGIN = 1 &lt;&lt; 12,
  GDK_GC_EXPOSURES     = 1 &lt;&lt; 13,
  GDK_GC_LINE_WIDTH    = 1 &lt;&lt; 14,
  GDK_GC_LINE_STYLE    = 1 &lt;&lt; 15,
  GDK_GC_CAP_STYLE     = 1 &lt;&lt; 16,
  GDK_GC_JOIN_STYLE    = 1 &lt;&lt; 17
} GdkGCValuesMask;
</programlisting>
<para>
A set of bit flags used to indicate which fields
<link linkend="GdkGCValues">GdkGCValues</link> structure are set.
</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>GDK_GC_FOREGROUND</literal></entry>
<entry>the <parameter>foreground</parameter> is set.
</entry>
</row>
<row>
<entry><literal>GDK_GC_BACKGROUND</literal></entry>
<entry>the <parameter>background</parameter> is set.
</entry>
</row>
<row>
<entry><literal>GDK_GC_FONT</literal></entry>
<entry>the <parameter>font</parameter> is set.
</entry>
</row>
<row>
<entry><literal>GDK_GC_FUNCTION</literal></entry>
<entry>the <parameter>function</parameter> is set.
</entry>
</row>
<row>
<entry><literal>GDK_GC_FILL</literal></entry>
<entry>the <parameter>fill</parameter> is set.
</entry>
</row>
<row>
<entry><literal>GDK_GC_TILE</literal></entry>
<entry>the <parameter>tile</parameter> is set.
</entry>
</row>
<row>
<entry><literal>GDK_GC_STIPPLE</literal></entry>
<entry>the <parameter>stipple</parameter> is set.
</entry>
</row>
<row>
<entry><literal>GDK_GC_CLIP_MASK</literal></entry>
<entry>the <parameter>clip_mask</parameter> is set.
</entry>
</row>
<row>
<entry><literal>GDK_GC_SUBWINDOW</literal></entry>
<entry>the <parameter>subwindow_mode</parameter> is set.
</entry>
</row>
<row>
<entry><literal>GDK_GC_TS_X_ORIGIN</literal></entry>
<entry>the <parameter>ts_x_origin</parameter> is set.
</entry>
</row>
<row>
<entry><literal>GDK_GC_TS_Y_ORIGIN</literal></entry>
<entry>the <parameter>ts_y_origin</parameter> is set.
</entry>
</row>
<row>
<entry><literal>GDK_GC_CLIP_X_ORIGIN</literal></entry>
<entry>the <parameter>clip_x_origin</parameter> is set.
</entry>
</row>
<row>
<entry><literal>GDK_GC_CLIP_Y_ORIGIN</literal></entry>
<entry>the <parameter>clip_y_origin</parameter> is set.
</entry>
</row>
<row>
<entry><literal>GDK_GC_EXPOSURES</literal></entry>
<entry>the <parameter>graphics_exposures</parameter> is set.
</entry>
</row>
<row>
<entry><literal>GDK_GC_LINE_WIDTH</literal></entry>
<entry>the <parameter>line_width</parameter> is set.
</entry>
</row>
<row>
<entry><literal>GDK_GC_LINE_STYLE</literal></entry>
<entry>the <parameter>line_style</parameter> is set.
</entry>
</row>
<row>
<entry><literal>GDK_GC_CAP_STYLE</literal></entry>
<entry>the <parameter>cap_style</parameter> is set.
</entry>
</row>
<row>
<entry><literal>GDK_GC_JOIN_STYLE</literal></entry>
<entry>the <parameter>join_style</parameter> is set.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GdkFunction">enum GdkFunction</title>
<programlisting>typedef enum
{
  GDK_COPY,
  GDK_INVERT,
  GDK_XOR,
  GDK_CLEAR,
  GDK_AND,
  GDK_AND_REVERSE,
  GDK_AND_INVERT,
  GDK_NOOP,
  GDK_OR,
  GDK_EQUIV,
  GDK_OR_REVERSE,
  GDK_COPY_INVERT,
  GDK_OR_INVERT,
  GDK_NAND,
  GDK_NOR,
  GDK_SET
} GdkFunction;
</programlisting>
<para>
Determines how the bit values for the source pixels are combined with
the bit values for destination pixels to produce the final result. The
sixteen values here correspond to the 16 different possible 2x2 truth
tables.  Only a couple of these values are usually useful; for colored
images, only <literal>GDK_COPY</literal>, <literal>GDK_XOR</literal> and <literal>GDK_INVERT</literal> are generally
useful. For bitmaps, <literal>GDK_AND</literal> and <literal>GDK_OR</literal> are also useful.
</para></refsect2>
<refsect2>
<title><anchor id="gdk-gc-new">gdk_gc_new ()</title>
<programlisting><link linkend="GdkGC">GdkGC</link>*      gdk_gc_new                      (<link linkend="GdkDrawable">GdkDrawable</link> *drawable);</programlisting>
<para>
Create a new graphics context with default values. 
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDrawable">GdkDrawable</link>. The created GC must always be used
 with drawables of the same depth as this one.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the new graphics context.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-new-with-values">gdk_gc_new_with_values ()</title>
<programlisting><link linkend="GdkGC">GdkGC</link>*      gdk_gc_new_with_values          (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGCValues">GdkGCValues</link> *values,
                                             <link linkend="GdkGCValuesMask">GdkGCValuesMask</link> values_mask);</programlisting>
<para>
Create a new GC with the given initial values.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDrawable">GdkDrawable</link>. The created GC must always be used
 with drawables of the same depth as this one.
</entry></row>
<row><entry align="right"><parameter>values</parameter>&nbsp;:</entry>
<entry>a structure containing initial values for the GC.
</entry></row>
<row><entry align="right"><parameter>values_mask</parameter>&nbsp;:</entry>
<entry>a bit mask indicating which fields in <parameter>values</parameter>
   are set.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the new graphics context.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-ref">gdk_gc_ref ()</title>
<programlisting><link linkend="GdkGC">GdkGC</link>*      gdk_gc_ref                      (<link linkend="GdkGC">GdkGC</link> *gc);</programlisting>
<warning>
<para>
<literal>gdk_gc_ref</literal> is deprecated and should not be used in newly-written code.
</para>
</warning>
<para>
Deprecated function; use <link linkend="g-object-ref">g_object_ref</link>() instead.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkGC">GdkGC</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> the gc.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-unref">gdk_gc_unref ()</title>
<programlisting>void        gdk_gc_unref                    (<link linkend="GdkGC">GdkGC</link> *gc);</programlisting>
<warning>
<para>
<literal>gdk_gc_unref</literal> is deprecated and should not be used in newly-written code.
</para>
</warning>
<para>
Deprecated function; use <link linkend="g-object-unref">g_object_unref</link>() instead.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkGC">GdkGC</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-destroy">gdk_gc_destroy</title>
<programlisting>#define gdk_gc_destroy                 gdk_gc_unref
</programlisting>
<warning>
<para>
<literal>gdk_gc_destroy</literal> is deprecated and should not be used in newly-written code.
</para>
</warning>
<para>
Identical to <link linkend="gdk-gc-unref">gdk_gc_unref</link>(). This function is obsolete
and should not be used.
</para></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-values">gdk_gc_set_values ()</title>
<programlisting>void        gdk_gc_set_values               (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkGCValues">GdkGCValues</link> *values,
                                             <link linkend="GdkGCValuesMask">GdkGCValuesMask</link> values_mask);</programlisting>
<para>
Sets attributes of a graphics context in bulk. For each flag set in
<parameter>values_mask</parameter>, the corresponding field will be read from <parameter>values</parameter> and
set as the new value for <parameter>gc</parameter>. If you're only setting a few values
on <parameter>gc</parameter>, calling individual "setter" functions is likely more
convenient.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkGC">GdkGC</link>
</entry></row>
<row><entry align="right"><parameter>values</parameter>&nbsp;:</entry>
<entry> struct containing the new values
</entry></row>
<row><entry align="right"><parameter>values_mask</parameter>&nbsp;:</entry>
<entry> mask indicating which struct fields are to be used
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-get-values">gdk_gc_get_values ()</title>
<programlisting>void        gdk_gc_get_values               (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkGCValues">GdkGCValues</link> *values);</programlisting>
<para>
Retrieves the current values from a graphics context.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>values</parameter>&nbsp;:</entry>
<entry>the <link linkend="GdkGCValues">GdkGCValues</link> structure in which to store the results.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-foreground">gdk_gc_set_foreground ()</title>
<programlisting>void        gdk_gc_set_foreground           (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkColor">GdkColor</link> *color);</programlisting>
<para>
Sets the foreground color for a graphics context.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>color</parameter>&nbsp;:</entry>
<entry>the new foreground color.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-background">gdk_gc_set_background ()</title>
<programlisting>void        gdk_gc_set_background           (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkColor">GdkColor</link> *color);</programlisting>
<para>
Sets the background color for a graphics context.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>color</parameter>&nbsp;:</entry>
<entry>the new background color.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-rgb-fg-color">gdk_gc_set_rgb_fg_color ()</title>
<programlisting>void        gdk_gc_set_rgb_fg_color         (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkColor">GdkColor</link> *color);</programlisting>
<para>
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.
</para>
<para>
Calling this function for a GC without a colormap is an error.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkGC">GdkGC</link>
</entry></row>
<row><entry align="right"><parameter>color</parameter>&nbsp;:</entry>
<entry> an unallocated <link linkend="GdkColor">GdkColor</link>.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-rgb-bg-color">gdk_gc_set_rgb_bg_color ()</title>
<programlisting>void        gdk_gc_set_rgb_bg_color         (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkColor">GdkColor</link> *color);</programlisting>
<para>
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.
</para>
<para>
Calling this function for a GC without a colormap is an error.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkGC">GdkGC</link>
</entry></row>
<row><entry align="right"><parameter>color</parameter>&nbsp;:</entry>
<entry> an unallocated <link linkend="GdkColor">GdkColor</link>.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-font">gdk_gc_set_font ()</title>
<programlisting>void        gdk_gc_set_font                 (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkFont">GdkFont</link> *font);</programlisting>
<warning>
<para>
<literal>gdk_gc_set_font</literal> is deprecated and should not be used in newly-written code.
</para>
</warning>
<para>
Sets the font for a graphics context. (Note that
all text-drawing functions in GDK take a <parameter>font</parameter>
argument; the value set here is used when that
argument is <literal>NULL</literal>.)
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>font</parameter>&nbsp;:</entry>
<entry>the new font.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-function">gdk_gc_set_function ()</title>
<programlisting>void        gdk_gc_set_function             (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkFunction">GdkFunction</link> function);</programlisting>
<para>
Determines how the current pixel values and the
pixel values being drawn are combined to produce
the final pixel values.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>function</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-fill">gdk_gc_set_fill ()</title>
<programlisting>void        gdk_gc_set_fill                 (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkFill">GdkFill</link> fill);</programlisting>
<para>
Set the fill mode for a graphics context.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>fill</parameter>&nbsp;:</entry>
<entry>the new fill mode.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GdkFill">enum GdkFill</title>
<programlisting>typedef enum
{
  GDK_SOLID,
  GDK_TILED,
  GDK_STIPPLED,
  GDK_OPAQUE_STIPPLED
} GdkFill;
</programlisting>
<para>
Determines how primitives are drawn.
</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>GDK_SOLID</literal></entry>
<entry>draw with the foreground color.
</entry>
</row>
<row>
<entry><literal>GDK_TILED</literal></entry>
<entry>draw with a tiled pixmap.
</entry>
</row>
<row>
<entry><literal>GDK_STIPPLED</literal></entry>
<entry>draw using the stipple bitmap. Pixels corresponding
  to bits in the stipple bitmap that are set will be drawn in the
  foreground color; pixels corresponding to bits that are
  not set will be left untouched.
</entry>
</row>
<row>
<entry><literal>GDK_OPAQUE_STIPPLED</literal></entry>
<entry>draw using the stipple bitmap. Pixels corresponding
  to bits in the stipple bitmap that are set will be drawn in the
  foreground color; pixels corresponding to bits that are
  not set will be drawn with the background color.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-tile">gdk_gc_set_tile ()</title>
<programlisting>void        gdk_gc_set_tile                 (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkPixmap">GdkPixmap</link> *tile);</programlisting>
<para>
Set a tile pixmap for a graphics context.
This will only be used if the fill mode
is <literal>GDK_TILED</literal>.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>tile</parameter>&nbsp;:</entry>
<entry>the new tile pixmap.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-stipple">gdk_gc_set_stipple ()</title>
<programlisting>void        gdk_gc_set_stipple              (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkPixmap">GdkPixmap</link> *stipple);</programlisting>
<para>
Set the stipple bitmap for a graphics context. The
stipple will only be used if the fill mode is
<literal>GDK_STIPPLED</literal> or <literal>GDK_OPAQUE_STIPPLED</literal>.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>stipple</parameter>&nbsp;:</entry>
<entry>the new stipple bitmap.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-ts-origin">gdk_gc_set_ts_origin ()</title>
<programlisting>void        gdk_gc_set_ts_origin            (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y);</programlisting>
<para>
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.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
<entry>the x-coordinate of the origin.
</entry></row>
<row><entry align="right"><parameter>y</parameter>&nbsp;:</entry>
<entry>the y-coordinate of the origin.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-clip-origin">gdk_gc_set_clip_origin ()</title>
<programlisting>void        gdk_gc_set_clip_origin          (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y);</programlisting>
<para>
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.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
<entry>the x-coordinate of the origin.
</entry></row>
<row><entry align="right"><parameter>y</parameter>&nbsp;:</entry>
<entry>the y-coordinate of the origin.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-clip-mask">gdk_gc_set_clip_mask ()</title>
<programlisting>void        gdk_gc_set_clip_mask            (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkBitmap">GdkBitmap</link> *mask);</programlisting>
<para>
Sets the clip mask for a graphics context from a bitmap.
The clip mask is interpreted relative to the clip
origin. (See <link linkend="gdk-gc-set-clip-origin">gdk_gc_set_clip_origin</link>()).
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>the <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>mask</parameter>&nbsp;:</entry>
<entry>a bitmap.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-clip-rectangle">gdk_gc_set_clip_rectangle ()</title>
<programlisting>void        gdk_gc_set_clip_rectangle       (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkRectangle">GdkRectangle</link> *rectangle);</programlisting>
<para>
Sets the clip mask for a graphics context from a
rectangle. The clip mask is interpreted relative to the clip
origin. (See <link linkend="gdk-gc-set-clip-origin">gdk_gc_set_clip_origin</link>()).

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>rectangle</parameter>&nbsp;:</entry>
<entry>the rectangle to clip to.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-clip-region">gdk_gc_set_clip_region ()</title>
<programlisting>void        gdk_gc_set_clip_region          (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkRegion">GdkRegion</link> *region);</programlisting>
<para>
Sets the clip mask for a graphics context from a region structure.
The clip mask is interpreted relative to the clip origin. (See
<link linkend="gdk-gc-set-clip-origin">gdk_gc_set_clip_origin</link>()).
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>region</parameter>&nbsp;:</entry>
<entry>the <link linkend="GdkRegion">GdkRegion</link>.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-subwindow">gdk_gc_set_subwindow ()</title>
<programlisting>void        gdk_gc_set_subwindow            (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkSubwindowMode">GdkSubwindowMode</link> mode);</programlisting>
<para>
Sets how drawing with this GC on a window will affect child
windows of that window. 
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>mode</parameter>&nbsp;:</entry>
<entry>the subwindow mode.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GdkSubwindowMode">enum GdkSubwindowMode</title>
<programlisting>typedef enum
{
  GDK_CLIP_BY_CHILDREN	= 0,
  GDK_INCLUDE_INFERIORS = 1
} GdkSubwindowMode;
</programlisting>
<para>
Determines how drawing onto a window will affect child
windows of that window. 
</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>GDK_CLIP_BY_CHILDREN</literal></entry>
<entry>only draw onto the window itself.
</entry>
</row>
<row>
<entry><literal>GDK_INCLUDE_INFERIORS</literal></entry>
<entry>draw onto the window and child windows.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-exposures">gdk_gc_set_exposures ()</title>
<programlisting>void        gdk_gc_set_exposures            (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gboolean">gboolean</link> exposures);</programlisting>
<para>
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 <link linkend="gdk-draw-drawable">gdk_draw_drawable</link>()).
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>exposures</parameter>&nbsp;:</entry>
<entry>if <literal>TRUE</literal>, exposure events will be generated.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-line-attributes">gdk_gc_set_line_attributes ()</title>
<programlisting>void        gdk_gc_set_line_attributes      (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> line_width,
                                             <link linkend="GdkLineStyle">GdkLineStyle</link> line_style,
                                             <link linkend="GdkCapStyle">GdkCapStyle</link> cap_style,
                                             <link linkend="GdkJoinStyle">GdkJoinStyle</link> join_style);</programlisting>
<para>
Sets various attributes of how lines are drawn. See
the corresponding members of <link linkend="GdkGCValues">GdkGCValues</link> for full
explanations of the arguments.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>line_width</parameter>&nbsp;:</entry>
<entry>the width of lines.
</entry></row>
<row><entry align="right"><parameter>line_style</parameter>&nbsp;:</entry>
<entry>the dash-style for lines.
</entry></row>
<row><entry align="right"><parameter>cap_style</parameter>&nbsp;:</entry>
<entry>the manner in which the ends of lines are drawn.
</entry></row>
<row><entry align="right"><parameter>join_style</parameter>&nbsp;:</entry>
<entry>the in which lines are joined together.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GdkLineStyle">enum GdkLineStyle</title>
<programlisting>typedef enum
{
  GDK_LINE_SOLID,
  GDK_LINE_ON_OFF_DASH,
  GDK_LINE_DOUBLE_DASH
} GdkLineStyle;
</programlisting>
<para>
Determines how lines are drawn.
</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>GDK_LINE_SOLID</literal></entry>
<entry>lines are drawn solid.
</entry>
</row>
<row>
<entry><literal>GDK_LINE_ON_OFF_DASH</literal></entry>
<entry>even segments are drawn; odd segments are not drawn.
</entry>
</row>
<row>
<entry><literal>GDK_LINE_DOUBLE_DASH</literal></entry>
<entry>even segments are normally. Odd segments are drawn
  in the background color if the fill style is <literal>GDK_SOLID</literal>, or in the background
  color masked by the stipple if the fill style is <literal>GDK_STIPPLED</literal>.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GdkCapStyle">enum GdkCapStyle</title>
<programlisting>typedef enum
{
  GDK_CAP_NOT_LAST,
  GDK_CAP_BUTT,
  GDK_CAP_ROUND,
  GDK_CAP_PROJECTING
} GdkCapStyle;
</programlisting>
<para>
Determines how the end of lines are drawn.
</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>GDK_CAP_NOT_LAST</literal></entry>
<entry>the same as <literal>GDK_CAP_BUTT</literal> for lines of non-zero width.
       for zero width lines, the final point on the line will not be drawn.
</entry>
</row>
<row>
<entry><literal>GDK_CAP_BUTT</literal></entry>
<entry>the ends of the lines are drawn squared off and extending
       to the coordinates of the end point.
</entry>
</row>
<row>
<entry><literal>GDK_CAP_ROUND</literal></entry>
<entry>the ends of the lines are drawn as semicircles with the
       diameter equal to the line width and centered at the end point.
</entry>
</row>
<row>
<entry><literal>GDK_CAP_PROJECTING</literal></entry>
<entry>the ends of the lines are drawn squared off and extending
       half the width of the line beyond the end point.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GdkJoinStyle">enum GdkJoinStyle</title>
<programlisting>typedef enum
{
  GDK_JOIN_MITER,
  GDK_JOIN_ROUND,
  GDK_JOIN_BEVEL
} GdkJoinStyle;
</programlisting>
<para>
Determines how the joins between segments of a polygon are drawn.
</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>GDK_JOIN_MITER</literal></entry>
<entry>the sides of each line are extended to meet at an angle.
</entry>
</row>
<row>
<entry><literal>GDK_JOIN_ROUND</literal></entry>
<entry>the sides of the two lines are joined by a circular arc.
</entry>
</row>
<row>
<entry><literal>GDK_JOIN_BEVEL</literal></entry>
<entry>the sides of the two lines are joined by a straight line which
       makes an equal angle with each line.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-dashes">gdk_gc_set_dashes ()</title>
<programlisting>void        gdk_gc_set_dashes               (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> dash_offset,
                                             <link linkend="gint8">gint8</link> dash_list[],
                                             <link linkend="gint">gint</link> n);</programlisting>
<para>
Sets the way dashed-lines are drawn. Lines will be
drawn with alternating on and off segments of the
lengths specified in <parameter>dash_list</parameter>. The manner in
which the on and off segments are drawn is determined
by the <parameter>line_style</parameter> value of the GC. (This can
be changed with <link linkend="gdk-gc-set-line-attributes">gdk_gc_set_line_attributes</link>())
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>dash_offset</parameter>&nbsp;:</entry>
<entry>the
</entry></row>
<row><entry align="right"><parameter>dash_list</parameter>&nbsp;:</entry>
<entry>an array of dash lengths.
</entry></row>
<row><entry align="right"><parameter>n</parameter>&nbsp;:</entry>
<entry>the number of elements in <parameter>dash_list</parameter>.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-copy">gdk_gc_copy ()</title>
<programlisting>void        gdk_gc_copy                     (<link linkend="GdkGC">GdkGC</link> *dst_gc,
                                             <link linkend="GdkGC">GdkGC</link> *src_gc);</programlisting>
<para>
Copy the set of values from one graphics context
onto another graphics context.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>dst_gc</parameter>&nbsp;:</entry>
<entry>the destination graphics context.
</entry></row>
<row><entry align="right"><parameter>src_gc</parameter>&nbsp;:</entry>
<entry>the source graphics context.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-set-colormap">gdk_gc_set_colormap ()</title>
<programlisting>void        gdk_gc_set_colormap             (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkColormap">GdkColormap</link> *colormap);</programlisting>
<para>
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.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkGC">GdkGC</link>
</entry></row>
<row><entry align="right"><parameter>colormap</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkColormap">GdkColormap</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-get-colormap">gdk_gc_get_colormap ()</title>
<programlisting><link linkend="GdkColormap">GdkColormap</link>* gdk_gc_get_colormap            (<link linkend="GdkGC">GdkGC</link> *gc);</programlisting>
<para>
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.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkGC">GdkGC</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> 
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-gc-offset">gdk_gc_offset ()</title>
<programlisting>void        gdk_gc_offset                   (<link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x_offset,
                                             <link linkend="gint">gint</link> y_offset);</programlisting>
<para>
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.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkGC">GdkGC</link>
</entry></row>
<row><entry align="right"><parameter>x_offset</parameter>&nbsp;:</entry>
<entry> amount by which to offset the GC in the X direction
</entry></row>
<row><entry align="right"><parameter>y_offset</parameter>&nbsp;:</entry>
<entry> amount by which to offset the GC in the Y direction
</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>




</refentry>
