<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="gdk-Graphics-Contexts">
<refmeta>
<refentrytitle role="top_of_page" id="gdk-Graphics-Contexts.top_of_page">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 id="gdk-Graphics-Contexts.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>
<anchor id="GdkGC"/>
<synopsis>

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

                    <link linkend="GdkGC-struct">GdkGC</link>;
                    <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="GdkScreen">GdkScreen</link> *         <link linkend="gdk-gc-get-screen">gdk_gc_get_screen</link>                   (<link linkend="GdkGC">GdkGC</link> *gc);
<link linkend="GdkGC">GdkGC</link> *             <link linkend="gdk-gc-ref">gdk_gc_ref</link>                          (<link linkend="GdkGC">GdkGC</link> *gc);
<link linkend="void">void</link>                <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>
<link linkend="void">void</link>                <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);
<link linkend="void">void</link>                <link linkend="gdk-gc-get-values">gdk_gc_get_values</link>                   (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="GdkGCValues">GdkGCValues</link> *values);
<link linkend="void">void</link>                <link linkend="gdk-gc-set-foreground">gdk_gc_set_foreground</link>               (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         const <link linkend="GdkColor">GdkColor</link> *color);
<link linkend="void">void</link>                <link linkend="gdk-gc-set-background">gdk_gc_set_background</link>               (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         const <link linkend="GdkColor">GdkColor</link> *color);
<link linkend="void">void</link>                <link linkend="gdk-gc-set-rgb-fg-color">gdk_gc_set_rgb_fg_color</link>             (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         const <link linkend="GdkColor">GdkColor</link> *color);
<link linkend="void">void</link>                <link linkend="gdk-gc-set-rgb-bg-color">gdk_gc_set_rgb_bg_color</link>             (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         const <link linkend="GdkColor">GdkColor</link> *color);
<link linkend="void">void</link>                <link linkend="gdk-gc-set-font">gdk_gc_set_font</link>                     (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="GdkFont">GdkFont</link> *font);
<link linkend="void">void</link>                <link linkend="gdk-gc-set-function">gdk_gc_set_function</link>                 (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="GdkFunction">GdkFunction</link> function);
<link linkend="void">void</link>                <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>;
<link linkend="void">void</link>                <link linkend="gdk-gc-set-tile">gdk_gc_set_tile</link>                     (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="GdkPixmap">GdkPixmap</link> *tile);
<link linkend="void">void</link>                <link linkend="gdk-gc-set-stipple">gdk_gc_set_stipple</link>                  (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="GdkPixmap">GdkPixmap</link> *stipple);
<link linkend="void">void</link>                <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);
<link linkend="void">void</link>                <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);
<link linkend="void">void</link>                <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);
<link linkend="void">void</link>                <link linkend="gdk-gc-set-clip-rectangle">gdk_gc_set_clip_rectangle</link>           (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         const <link linkend="GdkRectangle">GdkRectangle</link> *rectangle);
<link linkend="void">void</link>                <link linkend="gdk-gc-set-clip-region">gdk_gc_set_clip_region</link>              (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         const <link linkend="GdkRegion">GdkRegion</link> *region);
<link linkend="void">void</link>                <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>;
<link linkend="void">void</link>                <link linkend="gdk-gc-set-exposures">gdk_gc_set_exposures</link>                (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="gboolean">gboolean</link> exposures);
<link linkend="void">void</link>                <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>;
<link linkend="void">void</link>                <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);
<link linkend="void">void</link>                <link linkend="gdk-gc-copy">gdk_gc_copy</link>                         (<link linkend="GdkGC">GdkGC</link> *dst_gc,
                                                         <link linkend="GdkGC">GdkGC</link> *src_gc);
<link linkend="void">void</link>                <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);
<link linkend="void">void</link>                <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 id="gdk-Graphics-Contexts.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----GdkGC
</synopsis>
</refsect1>








<refsect1 id="gdk-Graphics-Contexts.description" role="desc">
<title role="desc.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"><function>gdk_gc_new_with_values()</function></link>,
or can be set one-by-one using functions such
as <link linkend="gdk-gc-set-foreground"><function>gdk_gc_set_foreground()</function></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 id="gdk-Graphics-Contexts.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GdkGC-struct" role="struct">
<title>GdkGC</title>
<indexterm zone="GdkGC-struct"><primary sortas="GC">GdkGC</primary></indexterm><programlisting>typedef struct _GdkGC GdkGC;</programlisting>
<para>
The <link linkend="GdkGC"><type>GdkGC</type></link> structure represents a graphics context.
It is an opaque structure with no user-visible
elements.
</para></refsect2>
<refsect2 id="GdkGCValues" role="struct">
<title>GdkGCValues</title>
<indexterm zone="GdkGCValues"><primary sortas="GCValues">GdkGCValues</primary></indexterm><programlisting>typedef struct {
  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;
} GdkGCValues;
</programlisting>
<para>
The <link linkend="GdkGCValues"><type>GdkGCValues</type></link> structure holds a set of values used
to create or modify a graphics context.
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="GdkColor">GdkColor</link>&#160;<structfield>foreground</structfield>;</term>
<listitem><simpara>the foreground color. Note that <link linkend="gdk-gc-get-values"><function>gdk_gc_get_values()</function></link>
  only sets the pixel value.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GdkColor">GdkColor</link>&#160;<structfield>background</structfield>;</term>
<listitem><simpara>the background color. Note that <link linkend="gdk-gc-get-values"><function>gdk_gc_get_values()</function></link>
  only sets the pixel value.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GdkFont">GdkFont</link>&#160;*<structfield>font</structfield>;</term>
<listitem><simpara>the default font.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GdkFunction">GdkFunction</link>&#160;<structfield>function</structfield>;</term>
<listitem><simpara>the bitwise operation used when drawing.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GdkFill">GdkFill</link>&#160;<structfield>fill</structfield>;</term>
<listitem><simpara>the fill style.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GdkPixmap">GdkPixmap</link>&#160;*<structfield>tile</structfield>;</term>
<listitem><simpara>the tile pixmap.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GdkPixmap">GdkPixmap</link>&#160;*<structfield>stipple</structfield>;</term>
<listitem><simpara>the stipple bitmap.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GdkPixmap">GdkPixmap</link>&#160;*<structfield>clip_mask</structfield>;</term>
<listitem><simpara>the clip mask bitmap.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GdkSubwindowMode">GdkSubwindowMode</link>&#160;<structfield>subwindow_mode</structfield>;</term>
<listitem><simpara>the subwindow mode.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="gint">gint</link>&#160;<structfield>ts_x_origin</structfield>;</term>
<listitem><simpara>the x origin of the tile or stipple.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="gint">gint</link>&#160;<structfield>ts_y_origin</structfield>;</term>
<listitem><simpara>the y origin of the tile or stipple.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="gint">gint</link>&#160;<structfield>clip_x_origin</structfield>;</term>
<listitem><simpara>the x origin of the clip mask.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="gint">gint</link>&#160;<structfield>clip_y_origin</structfield>;</term>
<listitem><simpara>the y origin of the clip mask.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="gint">gint</link>&#160;<structfield>graphics_exposures</structfield>;</term>
<listitem><simpara>whether graphics exposures are enabled.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="gint">gint</link>&#160;<structfield>line_width</structfield>;</term>
<listitem><simpara>the line width.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GdkLineStyle">GdkLineStyle</link>&#160;<structfield>line_style</structfield>;</term>
<listitem><simpara>the way dashed lines are drawn.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GdkCapStyle">GdkCapStyle</link>&#160;<structfield>cap_style</structfield>;</term>
<listitem><simpara>the way the ends of lines are drawn.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GdkJoinStyle">GdkJoinStyle</link>&#160;<structfield>join_style</structfield>;</term>
<listitem><simpara>the way joins between lines are drawn.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GdkGCValuesMask" role="enum">
<title>enum GdkGCValuesMask</title>
<indexterm zone="GdkGCValuesMask"><primary sortas="GCValuesMask">GdkGCValuesMask</primary></indexterm><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"><type>GdkGCValues</type></link> structure are set.
</para><variablelist role="enum">
<varlistentry id="GDK-GC-FOREGROUND--CAPS" role="constant">
<term><literal>GDK_GC_FOREGROUND</literal></term>
<listitem><simpara>the <parameter>foreground</parameter> is set.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-GC-BACKGROUND--CAPS" role="constant">
<term><literal>GDK_GC_BACKGROUND</literal></term>
<listitem><simpara>the <parameter>background</parameter> is set.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-GC-FONT--CAPS" role="constant">
<term><literal>GDK_GC_FONT</literal></term>
<listitem><simpara>the <parameter>font</parameter> is set.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-GC-FUNCTION--CAPS" role="constant">
<term><literal>GDK_GC_FUNCTION</literal></term>
<listitem><simpara>the <parameter>function</parameter> is set.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-GC-FILL--CAPS" role="constant">
<term><literal>GDK_GC_FILL</literal></term>
<listitem><simpara>the <parameter>fill</parameter> is set.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-GC-TILE--CAPS" role="constant">
<term><literal>GDK_GC_TILE</literal></term>
<listitem><simpara>the <parameter>tile</parameter> is set.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-GC-STIPPLE--CAPS" role="constant">
<term><literal>GDK_GC_STIPPLE</literal></term>
<listitem><simpara>the <parameter>stipple</parameter> is set.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-GC-CLIP-MASK--CAPS" role="constant">
<term><literal>GDK_GC_CLIP_MASK</literal></term>
<listitem><simpara>the <parameter>clip_mask</parameter> is set.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-GC-SUBWINDOW--CAPS" role="constant">
<term><literal>GDK_GC_SUBWINDOW</literal></term>
<listitem><simpara>the <parameter>subwindow_mode</parameter> is set.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-GC-TS-X-ORIGIN--CAPS" role="constant">
<term><literal>GDK_GC_TS_X_ORIGIN</literal></term>
<listitem><simpara>the <parameter>ts_x_origin</parameter> is set.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-GC-TS-Y-ORIGIN--CAPS" role="constant">
<term><literal>GDK_GC_TS_Y_ORIGIN</literal></term>
<listitem><simpara>the <parameter>ts_y_origin</parameter> is set.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-GC-CLIP-X-ORIGIN--CAPS" role="constant">
<term><literal>GDK_GC_CLIP_X_ORIGIN</literal></term>
<listitem><simpara>the <parameter>clip_x_origin</parameter> is set.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-GC-CLIP-Y-ORIGIN--CAPS" role="constant">
<term><literal>GDK_GC_CLIP_Y_ORIGIN</literal></term>
<listitem><simpara>the <parameter>clip_y_origin</parameter> is set.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-GC-EXPOSURES--CAPS" role="constant">
<term><literal>GDK_GC_EXPOSURES</literal></term>
<listitem><simpara>the <parameter>graphics_exposures</parameter> is set.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-GC-LINE-WIDTH--CAPS" role="constant">
<term><literal>GDK_GC_LINE_WIDTH</literal></term>
<listitem><simpara>the <parameter>line_width</parameter> is set.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-GC-LINE-STYLE--CAPS" role="constant">
<term><literal>GDK_GC_LINE_STYLE</literal></term>
<listitem><simpara>the <parameter>line_style</parameter> is set.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-GC-CAP-STYLE--CAPS" role="constant">
<term><literal>GDK_GC_CAP_STYLE</literal></term>
<listitem><simpara>the <parameter>cap_style</parameter> is set.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-GC-JOIN-STYLE--CAPS" role="constant">
<term><literal>GDK_GC_JOIN_STYLE</literal></term>
<listitem><simpara>the <parameter>join_style</parameter> is set.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GdkFunction" role="enum">
<title>enum GdkFunction</title>
<indexterm zone="GdkFunction"><primary sortas="Function">GdkFunction</primary></indexterm><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 <link linkend="GDK-COPY--CAPS"><literal>GDK_COPY</literal></link>, <link linkend="GDK-XOR--CAPS"><literal>GDK_XOR</literal></link> and <link linkend="GDK-INVERT--CAPS"><literal>GDK_INVERT</literal></link> are generally
useful. For bitmaps, <link linkend="GDK-AND--CAPS"><literal>GDK_AND</literal></link> and <link linkend="GDK-OR--CAPS"><literal>GDK_OR</literal></link> are also useful.
</para><variablelist role="enum">
<varlistentry id="GDK-COPY--CAPS" role="constant">
<term><literal>GDK_COPY</literal></term>
<listitem><simpara><literal>dst = src</literal>
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-INVERT--CAPS" role="constant">
<term><literal>GDK_INVERT</literal></term>
<listitem><simpara><literal>dst = NOT dst</literal>
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-XOR--CAPS" role="constant">
<term><literal>GDK_XOR</literal></term>
<listitem><simpara><literal>dst = src XOR dst</literal>
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-CLEAR--CAPS" role="constant">
<term><literal>GDK_CLEAR</literal></term>
<listitem><simpara><literal>dst = 0</literal>
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-AND--CAPS" role="constant">
<term><literal>GDK_AND</literal></term>
<listitem><simpara><literal>dst = dst AND src</literal>
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-AND-REVERSE--CAPS" role="constant">
<term><literal>GDK_AND_REVERSE</literal></term>
<listitem><simpara><literal>dst = src AND (NOT dst)</literal>
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-AND-INVERT--CAPS" role="constant">
<term><literal>GDK_AND_INVERT</literal></term>
<listitem><simpara><literal>dst = (NOT src) AND dst</literal>
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-NOOP--CAPS" role="constant">
<term><literal>GDK_NOOP</literal></term>
<listitem><simpara><literal>dst = dst</literal>
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-OR--CAPS" role="constant">
<term><literal>GDK_OR</literal></term>
<listitem><simpara><literal>dst = src OR dst</literal>
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-EQUIV--CAPS" role="constant">
<term><literal>GDK_EQUIV</literal></term>
<listitem><simpara><literal>dst = (NOT src) XOR dst</literal>
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-OR-REVERSE--CAPS" role="constant">
<term><literal>GDK_OR_REVERSE</literal></term>
<listitem><simpara><literal>dst = src OR (NOT dst)</literal>
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-COPY-INVERT--CAPS" role="constant">
<term><literal>GDK_COPY_INVERT</literal></term>
<listitem><simpara><literal>dst = NOT src</literal>
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-OR-INVERT--CAPS" role="constant">
<term><literal>GDK_OR_INVERT</literal></term>
<listitem><simpara><literal>dst = (NOT src) OR dst</literal>
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-NAND--CAPS" role="constant">
<term><literal>GDK_NAND</literal></term>
<listitem><simpara><literal>dst = (NOT src) OR (NOT dst)</literal>
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-NOR--CAPS" role="constant">
<term><literal>GDK_NOR</literal></term>
<listitem><simpara><literal>dst = (NOT src) AND (NOT dst)</literal>
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-SET--CAPS" role="constant">
<term><literal>GDK_SET</literal></term>
<listitem><simpara><literal>dst = 1</literal>
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-new" role="function">
<title>gdk_gc_new ()</title>
<indexterm zone="gdk-gc-new"><primary sortas="gc_new">gdk_gc_new</primary></indexterm><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>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drawable</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkDrawable"><type>GdkDrawable</type></link>. The created GC must always be used
  with drawables of the same depth as this one.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the new graphics context.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-new-with-values" role="function">
<title>gdk_gc_new_with_values ()</title>
<indexterm zone="gdk-gc-new-with-values"><primary sortas="gc_new_with_values">gdk_gc_new_with_values</primary></indexterm><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>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drawable</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkDrawable"><type>GdkDrawable</type></link>. The created GC must always be used
  with drawables of the same depth as this one.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>values</parameter>&#160;:</term>
<listitem><simpara> a structure containing initial values for the GC.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>values_mask</parameter>&#160;:</term>
<listitem><simpara> a bit mask indicating which fields in <parameter>values</parameter>
  are set.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the new graphics context.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-get-screen" role="function" condition="since:2.2">
<title>gdk_gc_get_screen ()</title>
<indexterm zone="gdk-gc-get-screen" role="2.2"><primary sortas="gc_get_screen">gdk_gc_get_screen</primary></indexterm><programlisting><link linkend="GdkScreen">GdkScreen</link> *         gdk_gc_get_screen                   (<link linkend="GdkGC">GdkGC</link> *gc);</programlisting>
<para>
Gets the <link linkend="GdkScreen"><type>GdkScreen</type></link> for which <parameter>gc</parameter> was created</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="GdkScreen"><type>GdkScreen</type></link> for <parameter>gc</parameter>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gdk-gc-ref" role="function" condition="deprecated:">
<title>gdk_gc_ref ()</title>
<indexterm zone="gdk-gc-ref" role="deprecated"><primary sortas="gc_ref">gdk_gc_ref</primary></indexterm><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"><function>g_object_ref()</function></link> instead.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the gc.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-unref" role="function" condition="deprecated:Use g_object_unref() instead.">
<title>gdk_gc_unref ()</title>
<indexterm zone="gdk-gc-unref" role="deprecated"><primary sortas="gc_unref">gdk_gc_unref</primary></indexterm><programlisting><link linkend="void">void</link>                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. Use <link linkend="g-object-unref"><function>g_object_unref()</function></link> instead.</para></warning>
<para>
Decrement the reference count of <parameter>gc</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-destroy" role="macro" condition="deprecated:Use g_object_unref() instead">
<title>gdk_gc_destroy</title>
<indexterm zone="gdk-gc-destroy" role="deprecated"><primary sortas="gc_destroy">gdk_gc_destroy</primary></indexterm><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. Use <link linkend="g-object-unref"><function>g_object_unref()</function></link> instead</para></warning>
<para>
This function is obsolete and should not be used.
</para></refsect2>
<refsect2 id="gdk-gc-set-values" role="function">
<title>gdk_gc_set_values ()</title>
<indexterm zone="gdk-gc-set-values"><primary sortas="gc_set_values">gdk_gc_set_values</primary></indexterm><programlisting><link linkend="void">void</link>                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><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>values</parameter>&#160;:</term>
<listitem><simpara> struct containing the new values
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>values_mask</parameter>&#160;:</term>
<listitem><simpara> mask indicating which struct fields are to be used
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-get-values" role="function">
<title>gdk_gc_get_values ()</title>
<indexterm zone="gdk-gc-get-values"><primary sortas="gc_get_values">gdk_gc_get_values</primary></indexterm><programlisting><link linkend="void">void</link>                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. Note that 
only the pixel values of the <parameter>values->foreground</parameter> and <parameter>values->background</parameter>
are filled, use <link linkend="gdk-colormap-query-color"><function>gdk_colormap_query_color()</function></link> to obtain the rgb values
if you need them.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara>  a <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>values</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GdkGCValues"><type>GdkGCValues</type></link> structure in which to store the results.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-set-foreground" role="function">
<title>gdk_gc_set_foreground ()</title>
<indexterm zone="gdk-gc-set-foreground"><primary sortas="gc_set_foreground">gdk_gc_set_foreground</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_gc_set_foreground               (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         const <link linkend="GdkColor">GdkColor</link> *color);</programlisting>
<para>
Sets the foreground color for a graphics context.
Note that this function uses <parameter>color->pixel</parameter>, use 
<link linkend="gdk-gc-set-rgb-fg-color"><function>gdk_gc_set_rgb_fg_color()</function></link> to specify the foreground 
color as red, green, blue components.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>color</parameter>&#160;:</term>
<listitem><simpara> the new foreground color.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-set-background" role="function">
<title>gdk_gc_set_background ()</title>
<indexterm zone="gdk-gc-set-background"><primary sortas="gc_set_background">gdk_gc_set_background</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_gc_set_background               (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         const <link linkend="GdkColor">GdkColor</link> *color);</programlisting>
<para>
Sets the background color for a graphics context.
Note that this function uses <parameter>color->pixel</parameter>, use 
<link linkend="gdk-gc-set-rgb-bg-color"><function>gdk_gc_set_rgb_bg_color()</function></link> to specify the background 
color as red, green, blue components.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>color</parameter>&#160;:</term>
<listitem><simpara> the new background color.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-set-rgb-fg-color" role="function">
<title>gdk_gc_set_rgb_fg_color ()</title>
<indexterm zone="gdk-gc-set-rgb-fg-color"><primary sortas="gc_set_rgb_fg_color">gdk_gc_set_rgb_fg_color</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_gc_set_rgb_fg_color             (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         const <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><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>color</parameter>&#160;:</term>
<listitem><simpara> an unallocated <link linkend="GdkColor"><type>GdkColor</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-set-rgb-bg-color" role="function">
<title>gdk_gc_set_rgb_bg_color ()</title>
<indexterm zone="gdk-gc-set-rgb-bg-color"><primary sortas="gc_set_rgb_bg_color">gdk_gc_set_rgb_bg_color</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_gc_set_rgb_bg_color             (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         const <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><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>color</parameter>&#160;:</term>
<listitem><simpara> an unallocated <link linkend="GdkColor"><type>GdkColor</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-set-font" role="function" condition="deprecated:">
<title>gdk_gc_set_font ()</title>
<indexterm zone="gdk-gc-set-font" role="deprecated"><primary sortas="gc_set_font">gdk_gc_set_font</primary></indexterm><programlisting><link linkend="void">void</link>                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 <link linkend="NULL--CAPS"><literal>NULL</literal></link>.)</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>font</parameter>&#160;:</term>
<listitem><simpara> the new font. 
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-set-function" role="function">
<title>gdk_gc_set_function ()</title>
<indexterm zone="gdk-gc-set-function"><primary sortas="gc_set_function">gdk_gc_set_function</primary></indexterm><programlisting><link linkend="void">void</link>                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>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>function</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GdkFunction"><type>GdkFunction</type></link> to use
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-set-fill" role="function">
<title>gdk_gc_set_fill ()</title>
<indexterm zone="gdk-gc-set-fill"><primary sortas="gc_set_fill">gdk_gc_set_fill</primary></indexterm><programlisting><link linkend="void">void</link>                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>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>fill</parameter>&#160;:</term>
<listitem><simpara> the new fill mode.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GdkFill" role="enum">
<title>enum GdkFill</title>
<indexterm zone="GdkFill"><primary sortas="Fill">GdkFill</primary></indexterm><programlisting>typedef enum
{
  GDK_SOLID,
  GDK_TILED,
  GDK_STIPPLED,
  GDK_OPAQUE_STIPPLED
} GdkFill;
</programlisting>
<para>
Determines how primitives are drawn.
</para><variablelist role="enum">
<varlistentry id="GDK-SOLID--CAPS" role="constant">
<term><literal>GDK_SOLID</literal></term>
<listitem><simpara>draw with the foreground color.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-TILED--CAPS" role="constant">
<term><literal>GDK_TILED</literal></term>
<listitem><simpara>draw with a tiled pixmap.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-STIPPLED--CAPS" role="constant">
<term><literal>GDK_STIPPLED</literal></term>
<listitem><simpara>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.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-OPAQUE-STIPPLED--CAPS" role="constant">
<term><literal>GDK_OPAQUE_STIPPLED</literal></term>
<listitem><simpara>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.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-set-tile" role="function">
<title>gdk_gc_set_tile ()</title>
<indexterm zone="gdk-gc-set-tile"><primary sortas="gc_set_tile">gdk_gc_set_tile</primary></indexterm><programlisting><link linkend="void">void</link>                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 <link linkend="GDK-TILED--CAPS"><literal>GDK_TILED</literal></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara>  a <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tile</parameter>&#160;:</term>
<listitem><simpara>  the new tile pixmap.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-set-stipple" role="function">
<title>gdk_gc_set_stipple ()</title>
<indexterm zone="gdk-gc-set-stipple"><primary sortas="gc_set_stipple">gdk_gc_set_stipple</primary></indexterm><programlisting><link linkend="void">void</link>                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
<link linkend="GDK-STIPPLED--CAPS"><literal>GDK_STIPPLED</literal></link> or <link linkend="GDK-OPAQUE-STIPPLED--CAPS"><literal>GDK_OPAQUE_STIPPLED</literal></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>stipple</parameter>&#160;:</term>
<listitem><simpara> the new stipple bitmap.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-set-ts-origin" role="function">
<title>gdk_gc_set_ts_origin ()</title>
<indexterm zone="gdk-gc-set-ts-origin"><primary sortas="gc_set_ts_origin">gdk_gc_set_ts_origin</primary></indexterm><programlisting><link linkend="void">void</link>                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>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara>  a <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&#160;:</term>
<listitem><simpara> the x-coordinate of the origin.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&#160;:</term>
<listitem><simpara> the y-coordinate of the origin.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-set-clip-origin" role="function">
<title>gdk_gc_set_clip_origin ()</title>
<indexterm zone="gdk-gc-set-clip-origin"><primary sortas="gc_set_clip_origin">gdk_gc_set_clip_origin</primary></indexterm><programlisting><link linkend="void">void</link>                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>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&#160;:</term>
<listitem><simpara> the x-coordinate of the origin.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&#160;:</term>
<listitem><simpara> the y-coordinate of the origin.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-set-clip-mask" role="function">
<title>gdk_gc_set_clip_mask ()</title>
<indexterm zone="gdk-gc-set-clip-mask"><primary sortas="gc_set_clip_mask">gdk_gc_set_clip_mask</primary></indexterm><programlisting><link linkend="void">void</link>                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"><function>gdk_gc_set_clip_origin()</function></link>).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mask</parameter>&#160;:</term>
<listitem><simpara> a bitmap.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-set-clip-rectangle" role="function">
<title>gdk_gc_set_clip_rectangle ()</title>
<indexterm zone="gdk-gc-set-clip-rectangle"><primary sortas="gc_set_clip_rectangle">gdk_gc_set_clip_rectangle</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_gc_set_clip_rectangle           (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         const <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"><function>gdk_gc_set_clip_origin()</function></link>).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>rectangle</parameter>&#160;:</term>
<listitem><simpara> the rectangle to clip to.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-set-clip-region" role="function">
<title>gdk_gc_set_clip_region ()</title>
<indexterm zone="gdk-gc-set-clip-region"><primary sortas="gc_set_clip_region">gdk_gc_set_clip_region</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_gc_set_clip_region              (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         const <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"><function>gdk_gc_set_clip_origin()</function></link>).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>region</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GdkRegion"><type>GdkRegion</type></link>. 
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-set-subwindow" role="function">
<title>gdk_gc_set_subwindow ()</title>
<indexterm zone="gdk-gc-set-subwindow"><primary sortas="gc_set_subwindow">gdk_gc_set_subwindow</primary></indexterm><programlisting><link linkend="void">void</link>                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>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mode</parameter>&#160;:</term>
<listitem><simpara> the subwindow mode.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GdkSubwindowMode" role="enum">
<title>enum GdkSubwindowMode</title>
<indexterm zone="GdkSubwindowMode"><primary sortas="SubwindowMode">GdkSubwindowMode</primary></indexterm><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><variablelist role="enum">
<varlistentry id="GDK-CLIP-BY-CHILDREN--CAPS" role="constant">
<term><literal>GDK_CLIP_BY_CHILDREN</literal></term>
<listitem><simpara>only draw onto the window itself.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-INCLUDE-INFERIORS--CAPS" role="constant">
<term><literal>GDK_INCLUDE_INFERIORS</literal></term>
<listitem><simpara>draw onto the window and child windows.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-set-exposures" role="function">
<title>gdk_gc_set_exposures ()</title>
<indexterm zone="gdk-gc-set-exposures"><primary sortas="gc_set_exposures">gdk_gc_set_exposures</primary></indexterm><programlisting><link linkend="void">void</link>                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"><function>gdk_draw_drawable()</function></link>).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>exposures</parameter>&#160;:</term>
<listitem><simpara> if <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>, exposure events will be generated.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-set-line-attributes" role="function">
<title>gdk_gc_set_line_attributes ()</title>
<indexterm zone="gdk-gc-set-line-attributes"><primary sortas="gc_set_line_attributes">gdk_gc_set_line_attributes</primary></indexterm><programlisting><link linkend="void">void</link>                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"><type>GdkGCValues</type></link> for full
explanations of the arguments.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>line_width</parameter>&#160;:</term>
<listitem><simpara> the width of lines.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>line_style</parameter>&#160;:</term>
<listitem><simpara> the dash-style for lines.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cap_style</parameter>&#160;:</term>
<listitem><simpara> the manner in which the ends of lines are drawn.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>join_style</parameter>&#160;:</term>
<listitem><simpara> the in which lines are joined together.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GdkLineStyle" role="enum">
<title>enum GdkLineStyle</title>
<indexterm zone="GdkLineStyle"><primary sortas="LineStyle">GdkLineStyle</primary></indexterm><programlisting>typedef enum
{
  GDK_LINE_SOLID,
  GDK_LINE_ON_OFF_DASH,
  GDK_LINE_DOUBLE_DASH
} GdkLineStyle;
</programlisting>
<para>
Determines how lines are drawn.
</para><variablelist role="enum">
<varlistentry id="GDK-LINE-SOLID--CAPS" role="constant">
<term><literal>GDK_LINE_SOLID</literal></term>
<listitem><simpara>lines are drawn solid.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-LINE-ON-OFF-DASH--CAPS" role="constant">
<term><literal>GDK_LINE_ON_OFF_DASH</literal></term>
<listitem><simpara>even segments are drawn; odd segments are not drawn.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-LINE-DOUBLE-DASH--CAPS" role="constant">
<term><literal>GDK_LINE_DOUBLE_DASH</literal></term>
<listitem><simpara>even segments are normally. Odd segments are drawn
  in the background color if the fill style is <link linkend="GDK-SOLID--CAPS"><literal>GDK_SOLID</literal></link>, or in the background
  color masked by the stipple if the fill style is <link linkend="GDK-STIPPLED--CAPS"><literal>GDK_STIPPLED</literal></link>.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GdkCapStyle" role="enum">
<title>enum GdkCapStyle</title>
<indexterm zone="GdkCapStyle"><primary sortas="CapStyle">GdkCapStyle</primary></indexterm><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><variablelist role="enum">
<varlistentry id="GDK-CAP-NOT-LAST--CAPS" role="constant">
<term><literal>GDK_CAP_NOT_LAST</literal></term>
<listitem><simpara>the same as <link linkend="GDK-CAP-BUTT--CAPS"><literal>GDK_CAP_BUTT</literal></link> for lines of non-zero width.
       for zero width lines, the final point on the line will not be drawn.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-CAP-BUTT--CAPS" role="constant">
<term><literal>GDK_CAP_BUTT</literal></term>
<listitem><simpara>the ends of the lines are drawn squared off and extending
       to the coordinates of the end point.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-CAP-ROUND--CAPS" role="constant">
<term><literal>GDK_CAP_ROUND</literal></term>
<listitem><simpara>the ends of the lines are drawn as semicircles with the
       diameter equal to the line width and centered at the end point.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-CAP-PROJECTING--CAPS" role="constant">
<term><literal>GDK_CAP_PROJECTING</literal></term>
<listitem><simpara>the ends of the lines are drawn squared off and extending
       half the width of the line beyond the end point.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GdkJoinStyle" role="enum">
<title>enum GdkJoinStyle</title>
<indexterm zone="GdkJoinStyle"><primary sortas="JoinStyle">GdkJoinStyle</primary></indexterm><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><variablelist role="enum">
<varlistentry id="GDK-JOIN-MITER--CAPS" role="constant">
<term><literal>GDK_JOIN_MITER</literal></term>
<listitem><simpara>the sides of each line are extended to meet at an angle.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-JOIN-ROUND--CAPS" role="constant">
<term><literal>GDK_JOIN_ROUND</literal></term>
<listitem><simpara>the sides of the two lines are joined by a circular arc.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-JOIN-BEVEL--CAPS" role="constant">
<term><literal>GDK_JOIN_BEVEL</literal></term>
<listitem><simpara>the sides of the two lines are joined by a straight line which
       makes an equal angle with each line.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-set-dashes" role="function">
<title>gdk_gc_set_dashes ()</title>
<indexterm zone="gdk-gc-set-dashes"><primary sortas="gc_set_dashes">gdk_gc_set_dashes</primary></indexterm><programlisting><link linkend="void">void</link>                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"><function>gdk_gc_set_line_attributes()</function></link>.)
</para>
<para>
The <parameter>dash_offset</parameter> defines the phase of the pattern, 
specifying how many pixels into the dash-list the pattern 
should actually begin.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dash_offset</parameter>&#160;:</term>
<listitem><simpara> the phase of the dash pattern.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dash_list</parameter>&#160;:</term>
<listitem><simpara> an array of dash lengths.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n</parameter>&#160;:</term>
<listitem><simpara> the number of elements in <parameter>dash_list</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-copy" role="function">
<title>gdk_gc_copy ()</title>
<indexterm zone="gdk-gc-copy"><primary sortas="gc_copy">gdk_gc_copy</primary></indexterm><programlisting><link linkend="void">void</link>                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>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>dst_gc</parameter>&#160;:</term>
<listitem><simpara> the destination graphics context.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>src_gc</parameter>&#160;:</term>
<listitem><simpara> the source graphics context.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-set-colormap" role="function">
<title>gdk_gc_set_colormap ()</title>
<indexterm zone="gdk-gc-set-colormap"><primary sortas="gc_set_colormap">gdk_gc_set_colormap</primary></indexterm><programlisting><link linkend="void">void</link>                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><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>colormap</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkColormap"><type>GdkColormap</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-get-colormap" role="function">
<title>gdk_gc_get_colormap ()</title>
<indexterm zone="gdk-gc-get-colormap"><primary sortas="gc_get_colormap">gdk_gc_get_colormap</primary></indexterm><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><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the colormap of <parameter>gc</parameter>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if <parameter>gc</parameter> doesn't have one.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-gc-offset" role="function">
<title>gdk_gc_offset ()</title>
<indexterm zone="gdk-gc-offset"><primary sortas="gc_offset">gdk_gc_offset</primary></indexterm><programlisting><link linkend="void">void</link>                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><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x_offset</parameter>&#160;:</term>
<listitem><simpara> amount by which to offset the GC in the X direction
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y_offset</parameter>&#160;:</term>
<listitem><simpara> amount by which to offset the GC in the Y direction
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
