<?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">
]>
<!--ENTITY index-Objects-Grouped SYSTEM "objects_grouped.sgml"-->
<refentry id="gtk-Graphics-Contexts">
<refmeta>
<refentrytitle role="top_of_page" id="gtk-Graphics-Contexts.top_of_page">Graphics Contexts</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Graphics Contexts</refname>
<refpurpose>A shared pool of GdkGC objects</refpurpose>
</refnamediv>

<refsynopsisdiv id="gtk-Graphics-Contexts.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

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

<link linkend="GdkGC">GdkGC</link>*              <link linkend="gtk-gc-get">gtk_gc_get</link>                          (<link linkend="gint">gint</link> depth,
                                                         <link linkend="GdkColormap">GdkColormap</link> *colormap,
                                                         <link linkend="GdkGCValues">GdkGCValues</link> *values,
                                                         <link linkend="GdkGCValuesMask">GdkGCValuesMask</link> values_mask);
<link linkend="void">void</link>                <link linkend="gtk-gc-release">gtk_gc_release</link>                      (<link linkend="GdkGC">GdkGC</link> *gc);
</synopsis>
</refsynopsisdiv>









<refsect1 id="gtk-Graphics-Contexts.description" role="desc">
<title role="desc.title">Description</title>
<para>
These functions provide access to a shared pool of <link linkend="GdkGC"><type>GdkGC</type></link> objects.
When a new <link linkend="GdkGC"><type>GdkGC</type></link> is needed, <link linkend="gtk-gc-get"><function>gtk_gc_get()</function></link> is called with the required depth,
colormap and <link linkend="GdkGCValues"><type>GdkGCValues</type></link>. If a <link linkend="GdkGC"><type>GdkGC</type></link> with the required properties already
exists then that is returned. If not, a new <link linkend="GdkGC"><type>GdkGC</type></link> is created.
When the <link linkend="GdkGC"><type>GdkGC</type></link> is no longer needed, <link linkend="gtk-gc-release"><function>gtk_gc_release()</function></link> should be called.
</para>
</refsect1>

<refsect1 id="gtk-Graphics-Contexts.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="gtk-gc-get" role="function">
<title>gtk_gc_get ()</title>
<indexterm zone="gtk-gc-get"><primary sortas="gc_get">gtk_gc_get</primary></indexterm><programlisting><link linkend="GdkGC">GdkGC</link>*              gtk_gc_get                          (<link linkend="gint">gint</link> depth,
                                                         <link linkend="GdkColormap">GdkColormap</link> *colormap,
                                                         <link linkend="GdkGCValues">GdkGCValues</link> *values,
                                                         <link linkend="GdkGCValuesMask">GdkGCValuesMask</link> values_mask);</programlisting>
<para>
Gets a <link linkend="GdkGC"><type>GdkGC</type></link> with the given depth, colormap and <link linkend="GdkGCValues"><type>GdkGCValues</type></link>.
If a <link linkend="GdkGC"><type>GdkGC</type></link> with the given properties already exists then it is returned,
otherwise a new <link linkend="GdkGC"><type>GdkGC</type></link> is created.
The returned <link linkend="GdkGC"><type>GdkGC</type></link> should be released with <link linkend="gtk-gc-release"><function>gtk_gc_release()</function></link> when it is no
longer needed.
</para><variablelist role="params">
<varlistentry><term><parameter>depth</parameter>&#160;:</term>
<listitem><simpara>the depth of the <link linkend="GdkGC"><type>GdkGC</type></link> to create.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>colormap</parameter>&#160;:</term>
<listitem><simpara>the <link linkend="GdkColormap"><type>GdkColormap</type></link> (FIXME: I don't know why this is needed).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>values</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GdkGCValues"><type>GdkGCValues</type></link> struct containing settings for the <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>values_mask</parameter>&#160;:</term>
<listitem><simpara>a set of flags indicating which of the fields in <parameter>values</parameter> has
been set.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a <link linkend="GdkGC"><type>GdkGC</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-gc-release" role="function">
<title>gtk_gc_release ()</title>
<indexterm zone="gtk-gc-release"><primary sortas="gc_release">gtk_gc_release</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_gc_release                      (<link linkend="GdkGC">GdkGC</link> *gc);</programlisting>
<para>
Releases a <link linkend="GdkGC"><type>GdkGC</type></link> allocated using <link linkend="gtk-gc-get"><function>gtk_gc_get()</function></link>.
</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>

</refsect1>




</refentry>
