1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>Graphics Contexts</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
7
<link rel="home" href="index.html" title="GTK+ 2 Reference Manual">
8
<link rel="up" href="gtkbase.html" title="Part II. GTK+ Core Reference">
9
<link rel="prev" href="gtk-Standard-Enumerations.html" title="Standard Enumerations">
10
<link rel="next" href="GtkStyle.html" title="Styles">
11
<meta name="generator" content="GTK-Doc V1.18.1 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17
<td><a accesskey="p" href="gtk-Standard-Enumerations.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18
<td><a accesskey="u" href="gtkbase.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20
<th width="100%" align="center">GTK+ 2 Reference Manual</th>
21
<td><a accesskey="n" href="GtkStyle.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23
<tr><td colspan="5" class="shortcuts">
24
<a href="#gtk-Graphics-Contexts.synopsis" class="shortcut">Top</a>
26
<a href="#gtk-Graphics-Contexts.description" class="shortcut">Description</a>
29
<div class="refentry">
30
<a name="gtk-Graphics-Contexts"></a><div class="titlepage"></div>
31
<div class="refnamediv"><table width="100%"><tr>
33
<h2><span class="refentrytitle"><a name="gtk-Graphics-Contexts.top_of_page"></a>Graphics Contexts</span></h2>
34
<p>Graphics Contexts — A shared pool of GdkGC objects</p>
36
<td valign="top" align="right"></td>
38
<div class="refsynopsisdiv">
39
<a name="gtk-Graphics-Contexts.synopsis"></a><h2>Synopsis</h2>
40
<pre class="synopsis">
41
#include <gtk/gtk.h>
43
<a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGC"><span class="returnvalue">GdkGC</span></a> * <a class="link" href="gtk-Graphics-Contexts.html#gtk-gc-get" title="gtk_gc_get ()">gtk_gc_get</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> depth</code></em>,
44
<em class="parameter"><code><a href="http://library.gnome.org/devel/gdk3/gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a> *colormap</code></em>,
45
<em class="parameter"><code><a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGCValues"><span class="type">GdkGCValues</span></a> *values</code></em>,
46
<em class="parameter"><code><a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGCValuesMask"><span class="type">GdkGCValuesMask</span></a> values_mask</code></em>);
47
<span class="returnvalue">void</span> <a class="link" href="gtk-Graphics-Contexts.html#gtk-gc-release" title="gtk_gc_release ()">gtk_gc_release</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>);
50
<div class="refsect1">
51
<a name="gtk-Graphics-Contexts.description"></a><h2>Description</h2>
53
These functions provide access to a shared pool of <a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> objects.
54
When a new <a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> is needed, <a class="link" href="gtk-Graphics-Contexts.html#gtk-gc-get" title="gtk_gc_get ()"><code class="function">gtk_gc_get()</code></a> is called with the required depth,
55
colormap and <a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGCValues"><span class="type">GdkGCValues</span></a>. If a <a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> with the required properties already
56
exists then that is returned. If not, a new <a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> is created.
57
When the <a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> is no longer needed, <a class="link" href="gtk-Graphics-Contexts.html#gtk-gc-release" title="gtk_gc_release ()"><code class="function">gtk_gc_release()</code></a> should be called.
60
<div class="refsect1">
61
<a name="gtk-Graphics-Contexts.details"></a><h2>Details</h2>
62
<div class="refsect2">
63
<a name="gtk-gc-get"></a><h3>gtk_gc_get ()</h3>
64
<pre class="programlisting"><a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGC"><span class="returnvalue">GdkGC</span></a> * gtk_gc_get (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> depth</code></em>,
65
<em class="parameter"><code><a href="http://library.gnome.org/devel/gdk3/gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a> *colormap</code></em>,
66
<em class="parameter"><code><a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGCValues"><span class="type">GdkGCValues</span></a> *values</code></em>,
67
<em class="parameter"><code><a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGCValuesMask"><span class="type">GdkGCValuesMask</span></a> values_mask</code></em>);</pre>
69
Gets a <a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> with the given depth, colormap and <a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGCValues"><span class="type">GdkGCValues</span></a>.
70
If a <a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> with the given properties already exists then it is returned,
71
otherwise a new <a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> is created.
72
The returned <a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> should be released with <a class="link" href="gtk-Graphics-Contexts.html#gtk-gc-release" title="gtk_gc_release ()"><code class="function">gtk_gc_release()</code></a> when it is no
75
<div class="variablelist"><table border="0" class="variablelist">
77
<col align="left" valign="top">
82
<td><p><span class="term"><em class="parameter"><code>depth</code></em> :</span></p></td>
83
<td>the depth of the <a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> to create.</td>
86
<td><p><span class="term"><em class="parameter"><code>colormap</code></em> :</span></p></td>
87
<td>the <a href="http://library.gnome.org/devel/gdk3/gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a> (FIXME: I don't know why this is needed).</td>
90
<td><p><span class="term"><em class="parameter"><code>values</code></em> :</span></p></td>
91
<td>a <a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGCValues"><span class="type">GdkGCValues</span></a> struct containing settings for the <a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a>.</td>
94
<td><p><span class="term"><em class="parameter"><code>values_mask</code></em> :</span></p></td>
95
<td>a set of flags indicating which of the fields in <em class="parameter"><code>values</code></em> has
99
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
100
<td>a <a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a>.</td>
106
<div class="refsect2">
107
<a name="gtk-gc-release"></a><h3>gtk_gc_release ()</h3>
108
<pre class="programlisting"><span class="returnvalue">void</span> gtk_gc_release (<em class="parameter"><code><a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>);</pre>
110
Releases a <a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> allocated using <a class="link" href="gtk-Graphics-Contexts.html#gtk-gc-get" title="gtk_gc_get ()"><code class="function">gtk_gc_get()</code></a>.
112
<div class="variablelist"><table border="0" class="variablelist">
114
<col align="left" valign="top">
118
<td><p><span class="term"><em class="parameter"><code>gc</code></em> :</span></p></td>
119
<td>a <a href="http://library.gnome.org/devel/gdk3/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a>.</td>
127
Generated by GTK-Doc V1.18.1</div>
b'\\ No newline at end of file'