4
4
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
5
5
<title>gimpcontext</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
6
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
7
7
<link rel="start" href="index.html" title="GIMP Library Reference Manual">
8
8
<link rel="up" href="libgimp-general.html" title="Functions not Related to Specific Images">
9
<link rel="prev" href="libgimp-gimp.html" title="gimp">
9
<link rel="prev" href="libgimp-gimpbuffer.html" title="gimpbuffer">
10
10
<link rel="next" href="libgimp-gimpgimprc.html" title="gimpgimprc">
11
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
11
<meta name="generator" content="GTK-Doc V1.8 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
<link rel="part" href="gimpdefinitions.html" title="Part I. GIMP Constants">
14
<link rel="part" href="libgimp.html" title="Part II. GIMP Library">
13
<link rel="part" href="libgimp.html" title="Part I. GIMP Library">
15
14
<link rel="chapter" href="libgimp-general.html" title="Functions not Related to Specific Images">
16
<link rel="chapter" href="libgimp-image.html" title="Manupulating Images and all their Properties">
15
<link rel="chapter" href="libgimp-image.html" title="Manupulating Images and their Properties">
17
16
<link rel="chapter" href="libgimp-data.html" title="Data Objects">
18
17
<link rel="chapter" href="libgimp-selectors.html" title="Controlling the Core's Selection Dialogs">
19
<link rel="part" href="libgimpui.html" title="Part III. GIMP User Interface Library">
18
<link rel="part" href="libgimpui.html" title="Part II. GIMP User Interface Library">
20
19
<link rel="chapter" href="libgimpui-hierarchy.html" title="Object Hierarchy">
20
<link rel="index" href="libgimp-index.html" title="Index">
21
<link rel="index" href="libgimp-index-new-in-2-2.html" title="Index of new symbols in GIMP 2.2">
22
<link rel="index" href="libgimp-index-new-in-2-4.html" title="Index of new symbols in GIMP 2.4">
23
<link rel="index" href="libgimp-index-deprecated.html" title="Index of deprecated symbols">
22
25
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
23
26
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
24
27
<tr valign="middle">
25
<td><a accesskey="p" href="libgimp-gimp.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
28
<td><a accesskey="p" href="libgimp-gimpbuffer.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
26
29
<td><a accesskey="u" href="libgimp-general.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
27
30
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
28
31
<th width="100%" align="center">GIMP Library Reference Manual</th>
29
32
<td><a accesskey="n" href="libgimp-gimpgimprc.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
31
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2548965" class="shortcut">Top</a>
34
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2569853" class="shortcut">Top</a>
33
<a href="#id2547572" class="shortcut">Description</a></nobr></td></tr>
36
<a href="#id2599702" class="shortcut">Description</a></nobr></td></tr>
35
38
<div class="refentry" lang="en">
36
39
<a name="libgimp-gimpcontext"></a><div class="titlepage"></div>
37
40
<div class="refnamediv"><table width="100%"><tr>
40
<a name="id2548965"></a><span class="refentrytitle">gimpcontext</span>
43
<a name="id2569853"></a><span class="refentrytitle">gimpcontext</span>
42
45
<p>gimpcontext — Functions to manipulate a plug-in's context.</p>
52
gboolean <a href="libgimp-gimpcontext.html#gimp-context-push">gimp_context_push</a> (void);
53
gboolean <a href="libgimp-gimpcontext.html#gimp-context-pop">gimp_context_pop</a> (void);
54
gboolean <a href="libgimp-gimpcontext.html#gimp-context-get-foreground">gimp_context_get_foreground</a> (<a
55
href="../libgimpcolor/libgimpcolor-GimpRGB.html#GimpRGB"
56
>GimpRGB</a> *foreground);
57
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-foreground">gimp_context_set_foreground</a> (const <a
58
href="../libgimpcolor/libgimpcolor-GimpRGB.html#GimpRGB"
59
>GimpRGB</a> *foreground);
60
gboolean <a href="libgimp-gimpcontext.html#gimp-context-get-background">gimp_context_get_background</a> (<a
61
href="../libgimpcolor/libgimpcolor-GimpRGB.html#GimpRGB"
62
>GimpRGB</a> *background);
63
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-background">gimp_context_set_background</a> (const <a
64
href="../libgimpcolor/libgimpcolor-GimpRGB.html#GimpRGB"
65
>GimpRGB</a> *background);
66
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-default-colors">gimp_context_set_default_colors</a> (void);
67
gboolean <a href="libgimp-gimpcontext.html#gimp-context-swap-colors">gimp_context_swap_colors</a> (void);
68
gdouble <a href="libgimp-gimpcontext.html#gimp-context-get-opacity">gimp_context_get_opacity</a> (void);
69
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-opacity">gimp_context_set_opacity</a> (gdouble opacity);
70
<a href="libgimp-gimpenums.html#GimpLayerModeEffects">GimpLayerModeEffects</a> <a href="libgimp-gimpcontext.html#gimp-context-get-paint-mode">gimp_context_get_paint_mode</a>
72
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-paint-mode">gimp_context_set_paint_mode</a> (<a href="libgimp-gimpenums.html#GimpLayerModeEffects">GimpLayerModeEffects</a> paint_mode);
73
gchar* <a href="libgimp-gimpcontext.html#gimp-context-get-brush">gimp_context_get_brush</a> (void);
74
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-brush">gimp_context_set_brush</a> (const gchar *name);
75
gchar* <a href="libgimp-gimpcontext.html#gimp-context-get-pattern">gimp_context_get_pattern</a> (void);
76
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-pattern">gimp_context_set_pattern</a> (const gchar *name);
77
gchar* <a href="libgimp-gimpcontext.html#gimp-context-get-gradient">gimp_context_get_gradient</a> (void);
78
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-gradient">gimp_context_set_gradient</a> (const gchar *name);
79
gchar* <a href="libgimp-gimpcontext.html#gimp-context-get-palette">gimp_context_get_palette</a> (void);
80
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-palette">gimp_context_set_palette</a> (const gchar *name);
81
gchar* <a href="libgimp-gimpcontext.html#gimp-context-get-font">gimp_context_get_font</a> (void);
82
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-font">gimp_context_set_font</a> (const gchar *name);
55
gboolean <a href="libgimp-gimpcontext.html#gimp-context-push">gimp_context_push</a> (void);
56
gboolean <a href="libgimp-gimpcontext.html#gimp-context-pop">gimp_context_pop</a> (void);
57
gboolean <a href="libgimp-gimpcontext.html#gimp-context-get-foreground">gimp_context_get_foreground</a> (<a
58
href="../libgimpcolor/libgimpcolor-GimpRGB.html#GimpRGB"
59
>GimpRGB</a> *foreground);
60
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-foreground">gimp_context_set_foreground</a> (const <a
61
href="../libgimpcolor/libgimpcolor-GimpRGB.html#GimpRGB"
62
>GimpRGB</a> *foreground);
63
gboolean <a href="libgimp-gimpcontext.html#gimp-context-get-background">gimp_context_get_background</a> (<a
64
href="../libgimpcolor/libgimpcolor-GimpRGB.html#GimpRGB"
65
>GimpRGB</a> *background);
66
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-background">gimp_context_set_background</a> (const <a
67
href="../libgimpcolor/libgimpcolor-GimpRGB.html#GimpRGB"
68
>GimpRGB</a> *background);
69
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-default-colors">gimp_context_set_default_colors</a> (void);
70
gboolean <a href="libgimp-gimpcontext.html#gimp-context-swap-colors">gimp_context_swap_colors</a> (void);
71
gdouble <a href="libgimp-gimpcontext.html#gimp-context-get-opacity">gimp_context_get_opacity</a> (void);
72
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-opacity">gimp_context_set_opacity</a> (gdouble opacity);
73
<a href="libgimp-gimpenums.html#GimpLayerModeEffects">GimpLayerModeEffects</a> <a href="libgimp-gimpcontext.html#gimp-context-get-paint-mode">gimp_context_get_paint_mode</a> (void);
74
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-paint-mode">gimp_context_set_paint_mode</a> (<a href="libgimp-gimpenums.html#GimpLayerModeEffects">GimpLayerModeEffects</a> paint_mode);
75
gchar* <a href="libgimp-gimpcontext.html#gimp-context-get-brush">gimp_context_get_brush</a> (void);
76
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-brush">gimp_context_set_brush</a> (const gchar *name);
77
gchar* <a href="libgimp-gimpcontext.html#gimp-context-get-pattern">gimp_context_get_pattern</a> (void);
78
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-pattern">gimp_context_set_pattern</a> (const gchar *name);
79
gchar* <a href="libgimp-gimpcontext.html#gimp-context-get-gradient">gimp_context_get_gradient</a> (void);
80
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-gradient">gimp_context_set_gradient</a> (const gchar *name);
81
gchar* <a href="libgimp-gimpcontext.html#gimp-context-get-palette">gimp_context_get_palette</a> (void);
82
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-palette">gimp_context_set_palette</a> (const gchar *name);
83
gchar* <a href="libgimp-gimpcontext.html#gimp-context-get-font">gimp_context_get_font</a> (void);
84
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-font">gimp_context_set_font</a> (const gchar *name);
85
gchar* <a href="libgimp-gimpcontext.html#gimp-context-get-paint-method">gimp_context_get_paint_method</a> (void);
86
gboolean <a href="libgimp-gimpcontext.html#gimp-context-set-paint-method">gimp_context_set_paint_method</a> (const gchar *name);
85
89
<div class="refsect1" lang="en">
86
<a name="id2547572"></a><h2>Description</h2>
90
<a name="id2599702"></a><h2>Description</h2>
88
92
Functions to manipulate a plug-in's context.
91
95
<div class="refsect1" lang="en">
92
<a name="id2532642"></a><h2>Details</h2>
96
<a name="id2558540"></a><h2>Details</h2>
93
97
<div class="refsect2" lang="en">
94
<a name="id2532653"></a><h3>
98
<a name="id2558551"></a><h3>
95
99
<a name="gimp-context-push"></a>gimp_context_push ()</h3>
96
<a class="indexterm" name="id2532667"></a><pre class="programlisting">gboolean gimp_context_push (void);</pre>
100
<a class="indexterm" name="id2558566"></a><pre class="programlisting">gboolean gimp_context_push (void);</pre>
98
102
Pushes a context to the top of the plug-in's context stack.
101
105
This procedure creates a new context by copying the current context.
102
106
This copy becomes the new current context for the calling plug-in
103
until it is popped again.</p>
107
until it is popped again using <a href="libgimp-gimpcontext.html#gimp-context-pop"><code class="function">gimp_context_pop()</code></a>.</p>
107
111
<div class="variablelist"><table border="0">
108
112
<col align="left" valign="top">
111
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
114
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
112
115
<td> TRUE on success.
120
<p class="since">Since GIMP 2.2
121
124
<div class="refsect2" lang="en">
122
<a name="id2532718"></a><h3>
125
<a name="id2558630"></a><h3>
123
126
<a name="gimp-context-pop"></a>gimp_context_pop ()</h3>
124
<a class="indexterm" name="id2532732"></a><pre class="programlisting">gboolean gimp_context_pop (void);</pre>
127
<a class="indexterm" name="id2558645"></a><pre class="programlisting">gboolean gimp_context_pop (void);</pre>
126
129
Pops the topmost context from the plug-in's context stack.
129
This procedure creates a new context and makes it the current
130
context for the calling plug-in.</p>
132
This procedure removes the topmost context from the plug-in's
133
context stack. The context that was active before the corresponding
134
call to <a href="libgimp-gimpcontext.html#gimp-context-push"><code class="function">gimp_context_push()</code></a> becomes the new current context of the
134
139
<div class="variablelist"><table border="0">
135
140
<col align="left" valign="top">
138
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
142
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
139
143
<td> TRUE on success.
148
<p class="since">Since GIMP 2.2
148
152
<div class="refsect2" lang="en">
149
<a name="id2532783"></a><h3>
153
<a name="id2558709"></a><h3>
150
154
<a name="gimp-context-get-foreground"></a>gimp_context_get_foreground ()</h3>
151
<a class="indexterm" name="id2532796"></a><pre class="programlisting">gboolean gimp_context_get_foreground (<a
155
<a class="indexterm" name="id2558723"></a><pre class="programlisting">gboolean gimp_context_get_foreground (<a
152
156
href="../libgimpcolor/libgimpcolor-GimpRGB.html#GimpRGB"
153
157
>GimpRGB</a> *foreground);</pre>
788
762
<col align="left" valign="top">
792
<span class="term"><em class="parameter"><code>name</code></em> :</span></td>
765
<td><span class="term"><em class="parameter"><code>name</code></em> :</span></td>
793
766
<td> The name of the font.
798
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
799
<td> TRUE on success.
770
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
771
<td> TRUE on success.
777
<p class="since">Since GIMP 2.2
781
<div class="refsect2" lang="en">
782
<a name="id2607668"></a><h3>
783
<a name="gimp-context-get-paint-method"></a>gimp_context_get_paint_method ()</h3>
784
<a class="indexterm" name="id2607682"></a><pre class="programlisting">gchar* gimp_context_get_paint_method (void);</pre>
786
Retrieve the currently active paint method.
789
This procedure returns the name of the currently active paint
794
<div class="variablelist"><table border="0">
795
<col align="left" valign="top">
797
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
798
<td> The name of the active paint method.
803
<p class="since">Since GIMP 2.4
807
<div class="refsect2" lang="en">
808
<a name="id2607731"></a><h3>
809
<a name="gimp-context-set-paint-method"></a>gimp_context_set_paint_method ()</h3>
810
<a class="indexterm" name="id2607746"></a><pre class="programlisting">gboolean gimp_context_set_paint_method (const gchar *name);</pre>
812
Set the specified paint method as the active paint method.
815
This procedure allows the active paint method to be set by
816
specifying its name. The name is simply a string which corresponds
817
to one of the names of the available paint methods. If there is no
818
matching method found, this procedure will return an error.
819
Otherwise, the specified method becomes active and will be used in
820
all subsequent paint operations.</p>
824
<div class="variablelist"><table border="0">
825
<col align="left" valign="top">
828
<td><span class="term"><em class="parameter"><code>name</code></em> :</span></td>
829
<td> The name of the paint method.
833
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
834
<td> TRUE on success.
840
<p class="since">Since GIMP 2.4