~inkscape.dev/inkscape-devlibs/devlibs-gtk3

« back to all changes in this revision

Viewing changes to share/gtk-doc/html/gdk2/gdk2-Pango-Interaction.html

  • Committer: JazzyNico
  • Date: 2013-01-21 10:11:05 UTC
  • Revision ID: nicoduf@yahoo.fr-20130121101105-i8d8slkq9ng4olx8
Adding gtk2 libraries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
2
<html>
 
3
<head>
 
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 
5
<title>Pango Interaction</title>
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
 
7
<link rel="home" href="index.html" title="GDK 2 Reference Manual">
 
8
<link rel="up" href="reference.html" title="API Reference">
 
9
<link rel="prev" href="gdk2-Input-Devices.html" title="Input Devices">
 
10
<link rel="next" href="gdk2-Cairo-Interaction.html" title="Cairo Interaction">
 
11
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 
12
<link rel="stylesheet" href="style.css" type="text/css">
 
13
</head>
 
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">
 
16
<tr valign="middle">
 
17
<td><a accesskey="p" href="gdk2-Input-Devices.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
 
18
<td><a accesskey="u" href="reference.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">GDK 2 Reference Manual</th>
 
21
<td><a accesskey="n" href="gdk2-Cairo-Interaction.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
 
22
</tr>
 
23
<tr><td colspan="5" class="shortcuts">
 
24
<a href="#gdk2-Pango-Interaction.synopsis" class="shortcut">Top</a>
 
25
                   | 
 
26
                  <a href="#gdk2-Pango-Interaction.description" class="shortcut">Description</a>
 
27
                   | 
 
28
                  <a href="#gdk2-Pango-Interaction.object-hierarchy" class="shortcut">Object Hierarchy</a>
 
29
                   | 
 
30
                  <a href="#gdk2-Pango-Interaction.properties" class="shortcut">Properties</a>
 
31
</td></tr>
 
32
</table>
 
33
<div class="refentry">
 
34
<a name="gdk2-Pango-Interaction"></a><div class="titlepage"></div>
 
35
<div class="refnamediv"><table width="100%"><tr>
 
36
<td valign="top">
 
37
<h2><span class="refentrytitle"><a name="gdk2-Pango-Interaction.top_of_page"></a>Pango Interaction</span></h2>
 
38
<p>Pango Interaction — Using Pango in GDK</p>
 
39
</td>
 
40
<td valign="top" align="right"></td>
 
41
</tr></table></div>
 
42
<div class="refsynopsisdiv">
 
43
<a name="gdk2-Pango-Interaction.synopsis"></a><h2>Synopsis</h2>
 
44
<a name="GdkPangoRenderer"></a><pre class="synopsis">
 
45
#include &lt;gdk/gdk.h&gt;
 
46
 
 
47
struct              <a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer-struct" title="struct GdkPangoRenderer">GdkPangoRenderer</a>;
 
48
struct              <a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRendererClass" title="struct GdkPangoRendererClass">GdkPangoRendererClass</a>;
 
49
<a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#PangoRenderer"><span class="returnvalue">PangoRenderer</span></a> *     <a class="link" href="gdk2-Pango-Interaction.html#gdk-pango-renderer-new" title="gdk_pango_renderer_new ()">gdk_pango_renderer_new</a>              (<em class="parameter"><code><a class="link" href="GdkScreen.html" title="GdkScreen"><span class="type">GdkScreen</span></a> *screen</code></em>);
 
50
<a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#PangoRenderer"><span class="returnvalue">PangoRenderer</span></a> *     <a class="link" href="gdk2-Pango-Interaction.html#gdk-pango-renderer-get-default" title="gdk_pango_renderer_get_default ()">gdk_pango_renderer_get_default</a>      (<em class="parameter"><code><a class="link" href="GdkScreen.html" title="GdkScreen"><span class="type">GdkScreen</span></a> *screen</code></em>);
 
51
<span class="returnvalue">void</span>                <a class="link" href="gdk2-Pango-Interaction.html#gdk-pango-renderer-set-drawable" title="gdk_pango_renderer_set_drawable ()">gdk_pango_renderer_set_drawable</a>     (<em class="parameter"><code><a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> *gdk_renderer</code></em>,
 
52
                                                         <em class="parameter"><code><a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> *drawable</code></em>);
 
53
<span class="returnvalue">void</span>                <a class="link" href="gdk2-Pango-Interaction.html#gdk-pango-renderer-set-gc" title="gdk_pango_renderer_set_gc ()">gdk_pango_renderer_set_gc</a>           (<em class="parameter"><code><a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> *gdk_renderer</code></em>,
 
54
                                                         <em class="parameter"><code><a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>);
 
55
<span class="returnvalue">void</span>                <a class="link" href="gdk2-Pango-Interaction.html#gdk-pango-renderer-set-stipple" title="gdk_pango_renderer_set_stipple ()">gdk_pango_renderer_set_stipple</a>      (<em class="parameter"><code><a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> *gdk_renderer</code></em>,
 
56
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#PangoRenderPart"><span class="type">PangoRenderPart</span></a> part</code></em>,
 
57
                                                         <em class="parameter"><code><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkBitmap" title="GdkBitmap"><span class="type">GdkBitmap</span></a> *stipple</code></em>);
 
58
<span class="returnvalue">void</span>                <a class="link" href="gdk2-Pango-Interaction.html#gdk-pango-renderer-set-override-color" title="gdk_pango_renderer_set_override_color ()">gdk_pango_renderer_set_override_color</a>
 
59
                                                        (<em class="parameter"><code><a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> *gdk_renderer</code></em>,
 
60
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#PangoRenderPart"><span class="type">PangoRenderPart</span></a> part</code></em>,
 
61
                                                         <em class="parameter"><code>const <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *color</code></em>);
 
62
<a href="/usr/share/gtk-doc/html/pango/pango-Text-Processing.html#PangoContext"><span class="returnvalue">PangoContext</span></a> *      <a class="link" href="gdk2-Pango-Interaction.html#gdk-pango-context-get" title="gdk_pango_context_get ()">gdk_pango_context_get</a>               (<em class="parameter"><code><span class="type">void</span></code></em>);
 
63
<a href="/usr/share/gtk-doc/html/pango/pango-Text-Processing.html#PangoContext"><span class="returnvalue">PangoContext</span></a> *      <a class="link" href="gdk2-Pango-Interaction.html#gdk-pango-context-get-for-screen" title="gdk_pango_context_get_for_screen ()">gdk_pango_context_get_for_screen</a>    (<em class="parameter"><code><a class="link" href="GdkScreen.html" title="GdkScreen"><span class="type">GdkScreen</span></a> *screen</code></em>);
 
64
<span class="returnvalue">void</span>                <a class="link" href="gdk2-Pango-Interaction.html#gdk-pango-context-set-colormap" title="gdk_pango_context_set_colormap ()">gdk_pango_context_set_colormap</a>      (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/pango/pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a> *context</code></em>,
 
65
                                                         <em class="parameter"><code><a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a> *colormap</code></em>);
 
66
struct              <a class="link" href="gdk2-Pango-Interaction.html#GdkPangoAttrEmbossed" title="struct GdkPangoAttrEmbossed">GdkPangoAttrEmbossed</a>;
 
67
struct              <a class="link" href="gdk2-Pango-Interaction.html#GdkPangoAttrEmbossColor" title="struct GdkPangoAttrEmbossColor">GdkPangoAttrEmbossColor</a>;
 
68
struct              <a class="link" href="gdk2-Pango-Interaction.html#GdkPangoAttrStipple" title="struct GdkPangoAttrStipple">GdkPangoAttrStipple</a>;
 
69
<a href="/usr/share/gtk-doc/html/pango/pango-Text-Attributes.html#PangoAttribute"><span class="returnvalue">PangoAttribute</span></a> *    <a class="link" href="gdk2-Pango-Interaction.html#gdk-pango-attr-emboss-color-new" title="gdk_pango_attr_emboss_color_new ()">gdk_pango_attr_emboss_color_new</a>     (<em class="parameter"><code>const <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *color</code></em>);
 
70
<a href="/usr/share/gtk-doc/html/pango/pango-Text-Attributes.html#PangoAttribute"><span class="returnvalue">PangoAttribute</span></a> *    <a class="link" href="gdk2-Pango-Interaction.html#gdk-pango-attr-embossed-new" title="gdk_pango_attr_embossed_new ()">gdk_pango_attr_embossed_new</a>         (<em class="parameter"><code><span class="type">gboolean</span> embossed</code></em>);
 
71
<a href="/usr/share/gtk-doc/html/pango/pango-Text-Attributes.html#PangoAttribute"><span class="returnvalue">PangoAttribute</span></a> *    <a class="link" href="gdk2-Pango-Interaction.html#gdk-pango-attr-stipple-new" title="gdk_pango_attr_stipple_new ()">gdk_pango_attr_stipple_new</a>          (<em class="parameter"><code><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkBitmap" title="GdkBitmap"><span class="type">GdkBitmap</span></a> *stipple</code></em>);
 
72
<a class="link" href="gdk2-Points-Rectangles-and-Regions.html#GdkRegion" title="GdkRegion"><span class="returnvalue">GdkRegion</span></a> *         <a class="link" href="gdk2-Pango-Interaction.html#gdk-pango-layout-get-clip-region" title="gdk_pango_layout_get_clip_region ()">gdk_pango_layout_get_clip_region</a>    (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> *layout</code></em>,
 
73
                                                         <em class="parameter"><code><span class="type">gint</span> x_origin</code></em>,
 
74
                                                         <em class="parameter"><code><span class="type">gint</span> y_origin</code></em>,
 
75
                                                         <em class="parameter"><code>const <span class="type">gint</span> *index_ranges</code></em>,
 
76
                                                         <em class="parameter"><code><span class="type">gint</span> n_ranges</code></em>);
 
77
<a class="link" href="gdk2-Points-Rectangles-and-Regions.html#GdkRegion" title="GdkRegion"><span class="returnvalue">GdkRegion</span></a> *         <a class="link" href="gdk2-Pango-Interaction.html#gdk-pango-layout-line-get-clip-region" title="gdk_pango_layout_line_get_clip_region ()">gdk_pango_layout_line_get_clip_region</a>
 
78
                                                        (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#PangoLayoutLine"><span class="type">PangoLayoutLine</span></a> *line</code></em>,
 
79
                                                         <em class="parameter"><code><span class="type">gint</span> x_origin</code></em>,
 
80
                                                         <em class="parameter"><code><span class="type">gint</span> y_origin</code></em>,
 
81
                                                         <em class="parameter"><code>const <span class="type">gint</span> *index_ranges</code></em>,
 
82
                                                         <em class="parameter"><code><span class="type">gint</span> n_ranges</code></em>);
 
83
</pre>
 
84
</div>
 
85
<div class="refsect1">
 
86
<a name="gdk2-Pango-Interaction.object-hierarchy"></a><h2>Object Hierarchy</h2>
 
87
<pre class="synopsis">
 
88
  GObject
 
89
   +----<a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#PangoRenderer">PangoRenderer</a>
 
90
         +----GdkPangoRenderer
 
91
</pre>
 
92
</div>
 
93
<div class="refsect1">
 
94
<a name="gdk2-Pango-Interaction.properties"></a><h2>Properties</h2>
 
95
<pre class="synopsis">
 
96
  "<a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer--screen" title='The "screen" property'>screen</a>"                   <a class="link" href="GdkScreen.html" title="GdkScreen"><span class="type">GdkScreen</span></a>*            : Read / Write / Construct Only
 
97
</pre>
 
98
</div>
 
99
<div class="refsect1">
 
100
<a name="gdk2-Pango-Interaction.description"></a><h2>Description</h2>
 
101
<p>
 
102
Pango is the text layout system used by GDK and GTK+. The functions
 
103
and types in this section are used to render Pango objects to GDK.
 
104
drawables, and also extend the set of Pango attributes to include
 
105
stippling and embossing.
 
106
</p>
 
107
<p>
 
108
Creating a <a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> object is the first step in rendering text,
 
109
and requires getting a handle to a <a href="/usr/share/gtk-doc/html/pango/pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a>. For GTK+ programs,
 
110
you'll usually want to use <a href="http://developer.gnome.org/gtk2/GtkWidget.html#gtk-widget-get-pango-context"><code class="function">gtk_widget_get_pango_context()</code></a>, or
 
111
<a href="http://developer.gnome.org/gtk2/GtkWidget.html#gtk-widget-create-pango-layout"><code class="function">gtk_widget_create_pango_layout()</code></a>, rather than using the lowlevel
 
112
<a class="link" href="gdk2-Pango-Interaction.html#gdk-pango-context-get-for-screen" title="gdk_pango_context_get_for_screen ()"><code class="function">gdk_pango_context_get_for_screen()</code></a>. Once you have a <a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a>, you
 
113
can set the text and attributes of it with Pango functions like
 
114
<a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#pango-layout-set-text"><code class="function">pango_layout_set_text()</code></a> and get its size with <a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#pango-layout-get-size"><code class="function">pango_layout_get_size()</code></a>.
 
115
(Note that Pango uses a fixed point system internally, so converting
 
116
between Pango units and pixels using PANGO_SCALE or the <a href="/usr/share/gtk-doc/html/pango/pango-Glyph-Storage.html#PANGO-PIXELS:CAPS"><code class="function">PANGO_PIXELS()</code></a> macro.)
 
117
</p>
 
118
<p>
 
119
Rendering a Pango layout is done most simply with <a class="link" href="gdk2-Drawing-Primitives.html#gdk-draw-layout" title="gdk_draw_layout ()"><code class="function">gdk_draw_layout()</code></a>;
 
120
you can also draw pieces of the layout with <a class="link" href="gdk2-Drawing-Primitives.html#gdk-draw-layout" title="gdk_draw_layout ()"><code class="function">gdk_draw_layout()</code></a> or
 
121
<a class="link" href="gdk2-Drawing-Primitives.html#gdk-draw-glyphs" title="gdk_draw_glyphs ()"><code class="function">gdk_draw_glyphs()</code></a>. <a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> is a subclass of <a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#PangoRenderer"><span class="type">PangoRenderer</span></a>
 
122
that is used internally to implement these functions. Using it
 
123
directly or subclassing it can be useful in some cases. See the
 
124
<a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> documentation for details.
 
125
</p>
 
126
<div class="example">
 
127
<a name="rotated-example"></a><p class="title"><b>Example 8. Using <a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> to draw transformed text</b></p>
 
128
<div class="example-contents">
 
129
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
 
130
    <tbody>
 
131
      <tr>
 
132
        <td class="listing_lines" align="right"><pre>1
 
133
2
 
134
3
 
135
4
 
136
5
 
137
6
 
138
7
 
139
8
 
140
9
 
141
10
 
142
11
 
143
12
 
144
13
 
145
14
 
146
15
 
147
16
 
148
17
 
149
18
 
150
19
 
151
20
 
152
21
 
153
22
 
154
23
 
155
24
 
156
25
 
157
26
 
158
27
 
159
28
 
160
29
 
161
30
 
162
31
 
163
32
 
164
33
 
165
34
 
166
35
 
167
36
 
168
37
 
169
38
 
170
39
 
171
40
 
172
41
 
173
42
 
174
43
 
175
44
 
176
45
 
177
46
 
178
47
 
179
48
 
180
49
 
181
50
 
182
51
 
183
52
 
184
53
 
185
54
 
186
55
 
187
56
 
188
57
 
189
58
 
190
59
 
191
60
 
192
61
 
193
62
 
194
63
 
195
64</pre></td>
 
196
        <td class="listing_code"><pre class="programlisting"><span class="preproc">#define</span><span class="normal"> RADIUS </span><span class="number">100</span>
 
197
<span class="preproc">#define</span><span class="normal"> N_WORDS </span><span class="number">10</span>
 
198
<span class="preproc">#define</span><span class="normal"> FONT </span><span class="string">"Sans Bold 18"</span>
 
199
<span class="usertype">GdkScreen</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">screen </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gdk2-Drawing-Primitives.html#gdk-drawable-get-screen">gdk_drawable_get_screen</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">drawable</span><span class="symbol">);</span>
 
200
<span class="usertype">PangoRenderer</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">renderer</span><span class="symbol">;</span>
 
201
<span class="usertype">GdkGC</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">gc</span><span class="symbol">;</span>
 
202
<span class="usertype">PangoMatrix</span><span class="normal"> matrix </span><span class="symbol">=</span><span class="normal"> <a href="/usr/share/gtk-doc/html/pango/pango-Glyph-Storage.html#PANGO-MATRIX-INIT:CAPS">PANGO_MATRIX_INIT</a></span><span class="symbol">;</span>
 
203
<span class="usertype">PangoContext</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">context</span><span class="symbol">;</span>
 
204
<span class="usertype">PangoLayout</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">layout</span><span class="symbol">;</span>
 
205
<span class="usertype">PangoFontDescription</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">desc</span><span class="symbol">;</span>
 
206
<span class="type">double</span><span class="normal"> device_radius</span><span class="symbol">;</span>
 
207
<span class="type">int</span><span class="normal"> width</span><span class="symbol">,</span><span class="normal"> height</span><span class="symbol">;</span>
 
208
<span class="type">int</span><span class="normal"> i</span><span class="symbol">;</span>
 
209
<span class="comment">/* Get the default renderer for the screen, and set it up for drawing  */</span>
 
210
<span class="normal">renderer </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gdk2-Pango-Interaction.html#gdk-pango-renderer-get-default">gdk_pango_renderer_get_default</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">screen</span><span class="symbol">);</span>
 
211
<span class="function"><a href="gdk2-Pango-Interaction.html#gdk-pango-renderer-set-drawable">gdk_pango_renderer_set_drawable</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GDK_PANGO_RENDERER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">renderer</span><span class="symbol">),</span><span class="normal"> drawable</span><span class="symbol">);</span>
 
212
<span class="normal">gc </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gdk2-Graphics-Contexts.html#gdk-gc-new">gdk_gc_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">drawable</span><span class="symbol">);</span>
 
213
<span class="function"><a href="gdk2-Pango-Interaction.html#gdk-pango-renderer-set-gc">gdk_pango_renderer_set_gc</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GDK_PANGO_RENDERER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">renderer</span><span class="symbol">),</span><span class="normal"> gc</span><span class="symbol">);</span>
 
214
<span class="comment">/* Set up a transformation matrix so that the user space coordinates for</span>
 
215
<span class="comment"> * where we are drawing are [-RADIUS, RADIUS], [-RADIUS, RADIUS]</span>
 
216
<span class="comment"> * We first center, then change the scale */</span>
 
217
<span class="function"><a href="gdk2-Drawing-Primitives.html#gdk-drawable-get-size">gdk_drawable_get_size</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">drawable</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&amp;</span><span class="normal">width</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&amp;</span><span class="normal">height</span><span class="symbol">);</span>
 
218
<span class="normal">device_radius </span><span class="symbol">=</span><span class="normal"> </span><span class="function">MIN</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">width</span><span class="symbol">,</span><span class="normal"> height</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">/</span><span class="normal"> </span><span class="number">2</span><span class="symbol">.;</span>
 
219
<span class="function"><a href="/usr/share/gtk-doc/html/pango/pango-Glyph-Storage.html#pango-matrix-translate">pango_matrix_translate</a></span><span class="normal"> </span><span class="symbol">(&amp;</span><span class="normal">matrix</span><span class="symbol">,</span>
 
220
<span class="normal">                        device_radius </span><span class="symbol">+</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">width </span><span class="symbol">-</span><span class="normal"> </span><span class="number">2</span><span class="normal"> </span><span class="symbol">*</span><span class="normal"> device_radius</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">/</span><span class="normal"> </span><span class="number">2</span><span class="symbol">,</span>
 
221
<span class="normal">                        device_radius </span><span class="symbol">+</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">height </span><span class="symbol">-</span><span class="normal"> </span><span class="number">2</span><span class="normal"> </span><span class="symbol">*</span><span class="normal"> device_radius</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">/</span><span class="normal"> </span><span class="number">2</span><span class="symbol">);</span>
 
222
<span class="function"><a href="/usr/share/gtk-doc/html/pango/pango-Glyph-Storage.html#pango-matrix-scale">pango_matrix_scale</a></span><span class="normal"> </span><span class="symbol">(&amp;</span><span class="normal">matrix</span><span class="symbol">,</span><span class="normal"> device_radius </span><span class="symbol">/</span><span class="normal"> RADIUS</span><span class="symbol">,</span><span class="normal"> device_radius </span><span class="symbol">/</span><span class="normal"> RADIUS</span><span class="symbol">);</span>
 
223
<span class="comment">/* Create a PangoLayout, set the font and text */</span>
 
224
<span class="normal">context </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gdk2-Pango-Interaction.html#gdk-pango-context-get-for-screen">gdk_pango_context_get_for_screen</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">screen</span><span class="symbol">);</span>
 
225
<span class="normal">layout </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#pango-layout-new">pango_layout_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">context</span><span class="symbol">);</span>
 
226
<span class="function"><a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#pango-layout-set-text">pango_layout_set_text</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">layout</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Text"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">-</span><span class="number">1</span><span class="symbol">);</span>
 
227
<span class="normal">desc </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="/usr/share/gtk-doc/html/pango/pango-Fonts.html#pango-font-description-from-string">pango_font_description_from_string</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">FONT</span><span class="symbol">);</span>
 
228
<span class="function"><a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#pango-layout-set-font-description">pango_layout_set_font_description</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">layout</span><span class="symbol">,</span><span class="normal"> desc</span><span class="symbol">);</span>
 
229
<span class="function"><a href="/usr/share/gtk-doc/html/pango/pango-Fonts.html#pango-font-description-free">pango_font_description_free</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">desc</span><span class="symbol">);</span>
 
230
<span class="comment">/* Draw the layout N_WORDS times in a circle */</span>
 
231
<span class="keyword">for</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">i </span><span class="symbol">=</span><span class="normal"> </span><span class="number">0</span><span class="symbol">;</span><span class="normal"> i </span><span class="symbol">&lt;</span><span class="normal"> N_WORDS</span><span class="symbol">;</span><span class="normal"> i</span><span class="symbol">++)</span>
 
232
<span class="normal">  </span><span class="cbracket">{</span>
 
233
<span class="normal">    </span><span class="usertype">GdkColor</span><span class="normal"> color</span><span class="symbol">;</span>
 
234
<span class="normal">    </span><span class="usertype">PangoMatrix</span><span class="normal"> rotated_matrix </span><span class="symbol">=</span><span class="normal"> matrix</span><span class="symbol">;</span>
 
235
<span class="normal">    </span><span class="type">int</span><span class="normal"> width</span><span class="symbol">,</span><span class="normal"> height</span><span class="symbol">;</span>
 
236
<span class="normal">    </span><span class="type">double</span><span class="normal"> angle </span><span class="symbol">=</span><span class="normal"> </span><span class="symbol">(</span><span class="number">360</span><span class="symbol">.</span><span class="normal"> </span><span class="symbol">*</span><span class="normal"> i</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">/</span><span class="normal"> N_WORDS</span><span class="symbol">;</span>
 
237
<span class="normal">    </span><span class="comment">/* Gradient from red at angle == 60 to blue at angle == 300 */</span>
 
238
<span class="normal">    color</span><span class="symbol">.</span><span class="normal">red   </span><span class="symbol">=</span><span class="normal"> </span><span class="number">65535</span><span class="normal"> </span><span class="symbol">*</span><span class="normal"> </span><span class="symbol">(</span><span class="number">1</span><span class="normal"> </span><span class="symbol">+</span><span class="normal"> </span><span class="function">cos</span><span class="normal"> </span><span class="symbol">((</span><span class="normal">angle </span><span class="symbol">-</span><span class="normal"> </span><span class="number">60</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">*</span><span class="normal"> M_PI </span><span class="symbol">/</span><span class="normal"> </span><span class="number">180</span><span class="symbol">.))</span><span class="normal"> </span><span class="symbol">/</span><span class="normal"> </span><span class="number">2</span><span class="symbol">;</span>
 
239
<span class="normal">    color</span><span class="symbol">.</span><span class="normal">green </span><span class="symbol">=</span><span class="normal"> </span><span class="number">0</span><span class="symbol">;</span>
 
240
<span class="normal">    color</span><span class="symbol">.</span><span class="normal">blue  </span><span class="symbol">=</span><span class="normal"> </span><span class="number">65535</span><span class="normal">  </span><span class="symbol">-</span><span class="normal"> color</span><span class="symbol">.</span><span class="normal">red</span><span class="symbol">;</span>
 
241
<span class="normal">    </span><span class="function"><a href="gdk2-Pango-Interaction.html#gdk-pango-renderer-set-override-color">gdk_pango_renderer_set_override_color</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GDK_PANGO_RENDERER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">renderer</span><span class="symbol">),</span>
 
242
<span class="normal">                                           <a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#PANGO-RENDER-PART-FOREGROUND:CAPS">PANGO_RENDER_PART_FOREGROUND</a></span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&amp;</span><span class="normal">color</span><span class="symbol">);</span>
 
243
<span class="normal">    </span><span class="function"><a href="/usr/share/gtk-doc/html/pango/pango-Glyph-Storage.html#pango-matrix-rotate">pango_matrix_rotate</a></span><span class="normal"> </span><span class="symbol">(&amp;</span><span class="normal">rotated_matrix</span><span class="symbol">,</span><span class="normal"> angle</span><span class="symbol">);</span>
 
244
<span class="normal">    </span><span class="function"><a href="/usr/share/gtk-doc/html/pango/pango-Text-Processing.html#pango-context-set-matrix">pango_context_set_matrix</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">context</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&amp;</span><span class="normal">rotated_matrix</span><span class="symbol">);</span>
 
245
<span class="normal">    </span><span class="comment">/* Inform Pango to re-layout the text with the new transformation matrix */</span>
 
246
<span class="normal">    </span><span class="function"><a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#pango-layout-context-changed">pango_layout_context_changed</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">layout</span><span class="symbol">);</span>
 
247
<span class="normal">    </span><span class="function"><a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#pango-layout-get-size">pango_layout_get_size</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">layout</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&amp;</span><span class="normal">width</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&amp;</span><span class="normal">height</span><span class="symbol">);</span>
 
248
<span class="normal">    </span><span class="function"><a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#pango-renderer-draw-layout">pango_renderer_draw_layout</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">renderer</span><span class="symbol">,</span><span class="normal"> layout</span><span class="symbol">,</span>
 
249
<span class="normal">                                </span><span class="symbol">-</span><span class="normal"> width </span><span class="symbol">/</span><span class="normal"> </span><span class="number">2</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">-</span><span class="normal"> RADIUS </span><span class="symbol">*</span><span class="normal"> <a href="/usr/share/gtk-doc/html/pango/pango-Glyph-Storage.html#PANGO-SCALE:CAPS">PANGO_SCALE</a></span><span class="symbol">);</span>
 
250
<span class="normal">  </span><span class="cbracket">}</span>
 
251
<span class="comment">/* Clean up default renderer, since it is shared */</span>
 
252
<span class="function"><a href="gdk2-Pango-Interaction.html#gdk-pango-renderer-set-override-color">gdk_pango_renderer_set_override_color</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GDK_PANGO_RENDERER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">renderer</span><span class="symbol">),</span>
 
253
<span class="normal">                                       <a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#PANGO-RENDER-PART-FOREGROUND:CAPS">PANGO_RENDER_PART_FOREGROUND</a></span><span class="symbol">,</span><span class="normal"> <a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
 
254
<span class="function"><a href="gdk2-Pango-Interaction.html#gdk-pango-renderer-set-drawable">gdk_pango_renderer_set_drawable</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GDK_PANGO_RENDERER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">renderer</span><span class="symbol">),</span><span class="normal"> <a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
 
255
<span class="function"><a href="gdk2-Pango-Interaction.html#gdk-pango-renderer-set-gc">gdk_pango_renderer_set_gc</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GDK_PANGO_RENDERER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">renderer</span><span class="symbol">),</span><span class="normal"> <a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
 
256
<span class="comment">/* free the objects we created */</span>
 
257
<span class="function">g_object_unref</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">layout</span><span class="symbol">);</span>
 
258
<span class="function">g_object_unref</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">context</span><span class="symbol">);</span>
 
259
<span class="function">g_object_unref</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">gc</span><span class="symbol">);</span></pre></td>
 
260
      </tr>
 
261
    </tbody>
 
262
  </table>
 
263
</div>
 
264
 
 
265
</div>
 
266
<br class="example-break"><div class="figure">
 
267
<a name="idp24397744"></a><p class="title"><b>Figure 1. Output of <a class="xref" href="gdk2-Pango-Interaction.html#rotated-example" title="Example 8. Using GdkPangoRenderer to draw transformed text">Example 8, “Using <span class="type">GdkPangoRenderer</span> to draw transformed text”</a></b></p>
 
268
<div class="figure-contents"><div><img src="rotated-text.png" alt="Output of"></div></div>
 
269
</div>
 
270
<br class="figure-break">
 
271
</div>
 
272
<div class="refsect1">
 
273
<a name="gdk2-Pango-Interaction.details"></a><h2>Details</h2>
 
274
<div class="refsect2">
 
275
<a name="GdkPangoRenderer-struct"></a><h3>struct GdkPangoRenderer</h3>
 
276
<pre class="programlisting">struct GdkPangoRenderer;</pre>
 
277
<p>
 
278
<a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> is a subclass of <a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#PangoRenderer"><span class="type">PangoRenderer</span></a> used for rendering
 
279
Pango objects into GDK drawables. The default renderer for a particular
 
280
screen is obtained with <a class="link" href="gdk2-Pango-Interaction.html#gdk-pango-renderer-get-default" title="gdk_pango_renderer_get_default ()"><code class="function">gdk_pango_renderer_get_default()</code></a>; Pango
 
281
functions like <a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#pango-renderer-draw-layout"><code class="function">pango_renderer_draw_layout()</code></a> and
 
282
<a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#pango-renderer-draw-layout-line"><code class="function">pango_renderer_draw_layout_line()</code></a> are then used to draw objects with
 
283
the renderer.
 
284
</p>
 
285
<p>
 
286
In most simple cases, applications can just use <a class="link" href="gdk2-Drawing-Primitives.html#gdk-draw-layout" title="gdk_draw_layout ()"><code class="function">gdk_draw_layout()</code></a>, and
 
287
don't need to directly use <a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> at all. Using the
 
288
<a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> directly is most useful when working with a
 
289
transformation such as a rotation, because the Pango drawing functions
 
290
take user space coordinates (coordinates before the transformation)
 
291
instead of device coordinates.
 
292
</p>
 
293
<p>
 
294
In certain cases it can be useful to subclass <a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a>. Examples
 
295
of reasons to do this are to add handling of custom attributes by
 
296
overriding 'prepare_run' or to do custom drawing of embedded objects
 
297
by overriding 'draw_shape'.
 
298
</p>
 
299
<p class="since">Since 2.6</p>
 
300
</div>
 
301
<hr>
 
302
<div class="refsect2">
 
303
<a name="GdkPangoRendererClass"></a><h3>struct GdkPangoRendererClass</h3>
 
304
<pre class="programlisting">struct GdkPangoRendererClass {
 
305
};
 
306
</pre>
 
307
<p>
 
308
<a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> is the class structure for <a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a>.
 
309
</p>
 
310
<p class="since">Since 2.6</p>
 
311
</div>
 
312
<hr>
 
313
<div class="refsect2">
 
314
<a name="gdk-pango-renderer-new"></a><h3>gdk_pango_renderer_new ()</h3>
 
315
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#PangoRenderer"><span class="returnvalue">PangoRenderer</span></a> *     gdk_pango_renderer_new              (<em class="parameter"><code><a class="link" href="GdkScreen.html" title="GdkScreen"><span class="type">GdkScreen</span></a> *screen</code></em>);</pre>
 
316
<p>
 
317
Creates a new <a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#PangoRenderer"><span class="type">PangoRenderer</span></a> for <em class="parameter"><code>screen</code></em>. Normally you can use the
 
318
results of <a class="link" href="gdk2-Pango-Interaction.html#gdk-pango-renderer-get-default" title="gdk_pango_renderer_get_default ()"><code class="function">gdk_pango_renderer_get_default()</code></a> rather than creating a new
 
319
renderer.
 
320
</p>
 
321
<div class="variablelist"><table border="0" class="variablelist">
 
322
<colgroup>
 
323
<col align="left" valign="top">
 
324
<col>
 
325
</colgroup>
 
326
<tbody>
 
327
<tr>
 
328
<td><p><span class="term"><em class="parameter"><code>screen</code></em> :</span></p></td>
 
329
<td>a <a class="link" href="GdkScreen.html" title="GdkScreen"><span class="type">GdkScreen</span></a>
 
330
</td>
 
331
</tr>
 
332
<tr>
 
333
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
334
<td>a newly created <a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#PangoRenderer"><span class="type">PangoRenderer</span></a>. Free with <code class="function">g_object_unref()</code>.</td>
 
335
</tr>
 
336
</tbody>
 
337
</table></div>
 
338
<p class="since">Since 2.6</p>
 
339
</div>
 
340
<hr>
 
341
<div class="refsect2">
 
342
<a name="gdk-pango-renderer-get-default"></a><h3>gdk_pango_renderer_get_default ()</h3>
 
343
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#PangoRenderer"><span class="returnvalue">PangoRenderer</span></a> *     gdk_pango_renderer_get_default      (<em class="parameter"><code><a class="link" href="GdkScreen.html" title="GdkScreen"><span class="type">GdkScreen</span></a> *screen</code></em>);</pre>
 
344
<p>
 
345
Gets the default <a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#PangoRenderer"><span class="type">PangoRenderer</span></a> for a screen. This default renderer
 
346
is shared by all users of the display, so properties such as the color
 
347
or transformation matrix set for the renderer may be overwritten
 
348
by functions such as <a class="link" href="gdk2-Drawing-Primitives.html#gdk-draw-layout" title="gdk_draw_layout ()"><code class="function">gdk_draw_layout()</code></a>.
 
349
</p>
 
350
<p>
 
351
Before using the renderer, you need to call <a class="link" href="gdk2-Pango-Interaction.html#gdk-pango-renderer-set-drawable" title="gdk_pango_renderer_set_drawable ()"><code class="function">gdk_pango_renderer_set_drawable()</code></a>
 
352
and <a class="link" href="gdk2-Pango-Interaction.html#gdk-pango-renderer-set-gc" title="gdk_pango_renderer_set_gc ()"><code class="function">gdk_pango_renderer_set_gc()</code></a> to set the drawable and graphics context
 
353
to use for drawing.
 
354
</p>
 
355
<div class="variablelist"><table border="0" class="variablelist">
 
356
<colgroup>
 
357
<col align="left" valign="top">
 
358
<col>
 
359
</colgroup>
 
360
<tbody>
 
361
<tr>
 
362
<td><p><span class="term"><em class="parameter"><code>screen</code></em> :</span></p></td>
 
363
<td>a <a class="link" href="GdkScreen.html" title="GdkScreen"><span class="type">GdkScreen</span></a>
 
364
</td>
 
365
</tr>
 
366
<tr>
 
367
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
368
<td>the default <a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#PangoRenderer"><span class="type">PangoRenderer</span></a> for <em class="parameter"><code>screen</code></em>. The
 
369
renderer is owned by GTK+ and will be kept around until the
 
370
screen is closed.</td>
 
371
</tr>
 
372
</tbody>
 
373
</table></div>
 
374
<p class="since">Since 2.6</p>
 
375
</div>
 
376
<hr>
 
377
<div class="refsect2">
 
378
<a name="gdk-pango-renderer-set-drawable"></a><h3>gdk_pango_renderer_set_drawable ()</h3>
 
379
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_pango_renderer_set_drawable     (<em class="parameter"><code><a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> *gdk_renderer</code></em>,
 
380
                                                         <em class="parameter"><code><a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> *drawable</code></em>);</pre>
 
381
<p>
 
382
Sets the drawable the renderer draws to.
 
383
</p>
 
384
<div class="variablelist"><table border="0" class="variablelist">
 
385
<colgroup>
 
386
<col align="left" valign="top">
 
387
<col>
 
388
</colgroup>
 
389
<tbody>
 
390
<tr>
 
391
<td><p><span class="term"><em class="parameter"><code>gdk_renderer</code></em> :</span></p></td>
 
392
<td>a <a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a>
 
393
</td>
 
394
</tr>
 
395
<tr>
 
396
<td><p><span class="term"><em class="parameter"><code>drawable</code></em> :</span></p></td>
 
397
<td>the new target drawable, or <a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
 
398
</td>
 
399
</tr>
 
400
</tbody>
 
401
</table></div>
 
402
<p class="since">Since 2.6</p>
 
403
</div>
 
404
<hr>
 
405
<div class="refsect2">
 
406
<a name="gdk-pango-renderer-set-gc"></a><h3>gdk_pango_renderer_set_gc ()</h3>
 
407
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_pango_renderer_set_gc           (<em class="parameter"><code><a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> *gdk_renderer</code></em>,
 
408
                                                         <em class="parameter"><code><a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>);</pre>
 
409
<p>
 
410
Sets the GC the renderer draws with. Note that the GC must not be
 
411
modified until it is unset by calling the function again with
 
412
<a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> for the <em class="parameter"><code>gc</code></em> parameter, since GDK may make internal copies
 
413
of the GC which won't be updated to follow changes to the
 
414
original GC.
 
415
</p>
 
416
<div class="variablelist"><table border="0" class="variablelist">
 
417
<colgroup>
 
418
<col align="left" valign="top">
 
419
<col>
 
420
</colgroup>
 
421
<tbody>
 
422
<tr>
 
423
<td><p><span class="term"><em class="parameter"><code>gdk_renderer</code></em> :</span></p></td>
 
424
<td>a <a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a>
 
425
</td>
 
426
</tr>
 
427
<tr>
 
428
<td><p><span class="term"><em class="parameter"><code>gc</code></em> :</span></p></td>
 
429
<td>the new GC to use for drawing, or <a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
 
430
</td>
 
431
</tr>
 
432
</tbody>
 
433
</table></div>
 
434
<p class="since">Since 2.6</p>
 
435
</div>
 
436
<hr>
 
437
<div class="refsect2">
 
438
<a name="gdk-pango-renderer-set-stipple"></a><h3>gdk_pango_renderer_set_stipple ()</h3>
 
439
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_pango_renderer_set_stipple      (<em class="parameter"><code><a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> *gdk_renderer</code></em>,
 
440
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#PangoRenderPart"><span class="type">PangoRenderPart</span></a> part</code></em>,
 
441
                                                         <em class="parameter"><code><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkBitmap" title="GdkBitmap"><span class="type">GdkBitmap</span></a> *stipple</code></em>);</pre>
 
442
<p>
 
443
Sets the stipple for one render part (foreground, background, underline,
 
444
etc.) Note that this is overwritten when iterating through the individual
 
445
styled runs of a <a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> or <a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#PangoLayoutLine"><span class="type">PangoLayoutLine</span></a>. This function is thus
 
446
only useful when you call low level functions like <a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#pango-renderer-draw-glyphs"><code class="function">pango_renderer_draw_glyphs()</code></a>
 
447
directly, or in the 'prepare_run' virtual function of a subclass of
 
448
<a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a>.
 
449
</p>
 
450
<div class="variablelist"><table border="0" class="variablelist">
 
451
<colgroup>
 
452
<col align="left" valign="top">
 
453
<col>
 
454
</colgroup>
 
455
<tbody>
 
456
<tr>
 
457
<td><p><span class="term"><em class="parameter"><code>gdk_renderer</code></em> :</span></p></td>
 
458
<td>a <a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a>
 
459
</td>
 
460
</tr>
 
461
<tr>
 
462
<td><p><span class="term"><em class="parameter"><code>part</code></em> :</span></p></td>
 
463
<td>the part to render with the stipple</td>
 
464
</tr>
 
465
<tr>
 
466
<td><p><span class="term"><em class="parameter"><code>stipple</code></em> :</span></p></td>
 
467
<td>the new stipple value.</td>
 
468
</tr>
 
469
</tbody>
 
470
</table></div>
 
471
<p class="since">Since 2.6</p>
 
472
</div>
 
473
<hr>
 
474
<div class="refsect2">
 
475
<a name="gdk-pango-renderer-set-override-color"></a><h3>gdk_pango_renderer_set_override_color ()</h3>
 
476
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_pango_renderer_set_override_color
 
477
                                                        (<em class="parameter"><code><a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a> *gdk_renderer</code></em>,
 
478
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/pango/pango-pango-renderer.html#PangoRenderPart"><span class="type">PangoRenderPart</span></a> part</code></em>,
 
479
                                                         <em class="parameter"><code>const <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *color</code></em>);</pre>
 
480
<p>
 
481
Sets the color for a particular render part (foreground,
 
482
background, underline, etc.), overriding any attributes on the layouts
 
483
renderered with this renderer.
 
484
</p>
 
485
<div class="variablelist"><table border="0" class="variablelist">
 
486
<colgroup>
 
487
<col align="left" valign="top">
 
488
<col>
 
489
</colgroup>
 
490
<tbody>
 
491
<tr>
 
492
<td><p><span class="term"><em class="parameter"><code>gdk_renderer</code></em> :</span></p></td>
 
493
<td>a <a class="link" href="gdk2-Pango-Interaction.html#GdkPangoRenderer"><span class="type">GdkPangoRenderer</span></a>
 
494
</td>
 
495
</tr>
 
496
<tr>
 
497
<td><p><span class="term"><em class="parameter"><code>part</code></em> :</span></p></td>
 
498
<td>the part to render to set the color of</td>
 
499
</tr>
 
500
<tr>
 
501
<td><p><span class="term"><em class="parameter"><code>color</code></em> :</span></p></td>
 
502
<td>the color to use, or <a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> to unset a previously
 
503
set override color. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
 
504
</td>
 
505
</tr>
 
506
</tbody>
 
507
</table></div>
 
508
<p class="since">Since 2.6</p>
 
509
</div>
 
510
<hr>
 
511
<div class="refsect2">
 
512
<a name="gdk-pango-context-get"></a><h3>gdk_pango_context_get ()</h3>
 
513
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/pango/pango-Text-Processing.html#PangoContext"><span class="returnvalue">PangoContext</span></a> *      gdk_pango_context_get               (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 
514
<p>
 
515
Creates a <a href="/usr/share/gtk-doc/html/pango/pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a> for the default GDK screen.
 
516
</p>
 
517
<p>
 
518
The context must be freed when you're finished with it.
 
519
</p>
 
520
<p>
 
521
When using GTK+, normally you should use <a href="http://developer.gnome.org/gtk2/GtkWidget.html#gtk-widget-get-pango-context"><code class="function">gtk_widget_get_pango_context()</code></a>
 
522
instead of this function, to get the appropriate context for
 
523
the widget you intend to render text onto.
 
524
</p>
 
525
<p>
 
526
The newly created context will have the default font options (see
 
527
<a href="/usr/share/gtk-doc/html/cairo/cairo-cairo-font-options-t.html#cairo-font-options-t"><span class="type">cairo_font_options_t</span></a>) for the default screen; if these options
 
528
change it will not be updated. Using <a href="http://developer.gnome.org/gtk2/GtkWidget.html#gtk-widget-get-pango-context"><code class="function">gtk_widget_get_pango_context()</code></a>
 
529
is more convenient if you want to keep a context around and track
 
530
changes to the screen's font rendering settings.
 
531
</p>
 
532
<div class="variablelist"><table border="0" class="variablelist">
 
533
<colgroup>
 
534
<col align="left" valign="top">
 
535
<col>
 
536
</colgroup>
 
537
<tbody><tr>
 
538
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
539
<td>a new <a href="/usr/share/gtk-doc/html/pango/pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a> for the default display</td>
 
540
</tr></tbody>
 
541
</table></div>
 
542
</div>
 
543
<hr>
 
544
<div class="refsect2">
 
545
<a name="gdk-pango-context-get-for-screen"></a><h3>gdk_pango_context_get_for_screen ()</h3>
 
546
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/pango/pango-Text-Processing.html#PangoContext"><span class="returnvalue">PangoContext</span></a> *      gdk_pango_context_get_for_screen    (<em class="parameter"><code><a class="link" href="GdkScreen.html" title="GdkScreen"><span class="type">GdkScreen</span></a> *screen</code></em>);</pre>
 
547
<p>
 
548
Creates a <a href="/usr/share/gtk-doc/html/pango/pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a> for <em class="parameter"><code>screen</code></em>.
 
549
</p>
 
550
<p>
 
551
The context must be freed when you're finished with it.
 
552
</p>
 
553
<p>
 
554
When using GTK+, normally you should use <a href="http://developer.gnome.org/gtk2/GtkWidget.html#gtk-widget-get-pango-context"><code class="function">gtk_widget_get_pango_context()</code></a>
 
555
instead of this function, to get the appropriate context for
 
556
the widget you intend to render text onto.
 
557
</p>
 
558
<p>
 
559
The newly created context will have the default font options
 
560
(see <a href="/usr/share/gtk-doc/html/cairo/cairo-cairo-font-options-t.html#cairo-font-options-t"><span class="type">cairo_font_options_t</span></a>) for the screen; if these options
 
561
change it will not be updated. Using <a href="http://developer.gnome.org/gtk2/GtkWidget.html#gtk-widget-get-pango-context"><code class="function">gtk_widget_get_pango_context()</code></a>
 
562
is more convenient if you want to keep a context around and track
 
563
changes to the screen's font rendering settings.
 
564
</p>
 
565
<div class="variablelist"><table border="0" class="variablelist">
 
566
<colgroup>
 
567
<col align="left" valign="top">
 
568
<col>
 
569
</colgroup>
 
570
<tbody>
 
571
<tr>
 
572
<td><p><span class="term"><em class="parameter"><code>screen</code></em> :</span></p></td>
 
573
<td>the <a class="link" href="GdkScreen.html" title="GdkScreen"><span class="type">GdkScreen</span></a> for which the context is to be created.</td>
 
574
</tr>
 
575
<tr>
 
576
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
577
<td>a new <a href="/usr/share/gtk-doc/html/pango/pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a> for <em class="parameter"><code>screen</code></em>
 
578
</td>
 
579
</tr>
 
580
</tbody>
 
581
</table></div>
 
582
<p class="since">Since 2.2</p>
 
583
</div>
 
584
<hr>
 
585
<div class="refsect2">
 
586
<a name="gdk-pango-context-set-colormap"></a><h3>gdk_pango_context_set_colormap ()</h3>
 
587
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_pango_context_set_colormap      (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/pango/pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a> *context</code></em>,
 
588
                                                         <em class="parameter"><code><a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a> *colormap</code></em>);</pre>
 
589
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
590
<h3 class="title">Warning</h3>
 
591
<p><code class="literal">gdk_pango_context_set_colormap</code> is deprecated and should not be used in newly-written code.</p>
 
592
</div>
 
593
<p>
 
594
This function used to set the colormap to be used for drawing with
 
595
<em class="parameter"><code>context</code></em>. The colormap is now always derived from the graphics
 
596
context used for drawing, so calling this function is no longer
 
597
necessary.
 
598
</p>
 
599
<div class="variablelist"><table border="0" class="variablelist">
 
600
<colgroup>
 
601
<col align="left" valign="top">
 
602
<col>
 
603
</colgroup>
 
604
<tbody>
 
605
<tr>
 
606
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
607
<td>a <a href="/usr/share/gtk-doc/html/pango/pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a>
 
608
</td>
 
609
</tr>
 
610
<tr>
 
611
<td><p><span class="term"><em class="parameter"><code>colormap</code></em> :</span></p></td>
 
612
<td>a <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a>
 
613
</td>
 
614
</tr>
 
615
</tbody>
 
616
</table></div>
 
617
</div>
 
618
<hr>
 
619
<div class="refsect2">
 
620
<a name="GdkPangoAttrEmbossed"></a><h3>struct GdkPangoAttrEmbossed</h3>
 
621
<pre class="programlisting">struct GdkPangoAttrEmbossed {
 
622
  PangoAttribute attr;
 
623
  gboolean embossed;
 
624
};
 
625
</pre>
 
626
<p>
 
627
A Pango text attribute containing a embossed bitmap to be used when
 
628
rendering the text.
 
629
</p>
 
630
<div class="variablelist"><table border="0" class="variablelist">
 
631
<colgroup>
 
632
<col align="left" valign="top">
 
633
<col>
 
634
</colgroup>
 
635
<tbody>
 
636
<tr>
 
637
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/pango/pango-Text-Attributes.html#PangoAttribute"><span class="type">PangoAttribute</span></a> <em class="structfield"><code><a name="GdkPangoAttrEmbossed.attr"></a>attr</code></em>;</span></p></td>
 
638
<td>the <a href="/usr/share/gtk-doc/html/pango/pango-Text-Attributes.html#PangoAttribute"><span class="type">PangoAttribute</span></a>.</td>
 
639
</tr>
 
640
<tr>
 
641
<td><p><span class="term"><span class="type">gboolean</span> <em class="structfield"><code><a name="GdkPangoAttrEmbossed.embossed"></a>embossed</code></em>;</span></p></td>
 
642
<td>the embossed bitmap.</td>
 
643
</tr>
 
644
</tbody>
 
645
</table></div>
 
646
</div>
 
647
<hr>
 
648
<div class="refsect2">
 
649
<a name="GdkPangoAttrEmbossColor"></a><h3>struct GdkPangoAttrEmbossColor</h3>
 
650
<pre class="programlisting">struct GdkPangoAttrEmbossColor {
 
651
  PangoAttribute attr;
 
652
  PangoColor color;
 
653
};
 
654
</pre>
 
655
<p>
 
656
A Pango text attribute specifying the color to emboss text with.
 
657
</p>
 
658
<div class="variablelist"><table border="0" class="variablelist">
 
659
<colgroup>
 
660
<col align="left" valign="top">
 
661
<col>
 
662
</colgroup>
 
663
<tbody>
 
664
<tr>
 
665
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/pango/pango-Text-Attributes.html#PangoAttribute"><span class="type">PangoAttribute</span></a> <em class="structfield"><code><a name="GdkPangoAttrEmbossColor.attr"></a>attr</code></em>;</span></p></td>
 
666
<td>the <a href="/usr/share/gtk-doc/html/pango/pango-Text-Attributes.html#PangoAttribute"><span class="type">PangoAttribute</span></a>
 
667
</td>
 
668
</tr>
 
669
<tr>
 
670
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/pango/pango-Text-Attributes.html#PangoColor"><span class="type">PangoColor</span></a> <em class="structfield"><code><a name="GdkPangoAttrEmbossColor.color"></a>color</code></em>;</span></p></td>
 
671
<td>the color</td>
 
672
</tr>
 
673
</tbody>
 
674
</table></div>
 
675
</div>
 
676
<hr>
 
677
<div class="refsect2">
 
678
<a name="GdkPangoAttrStipple"></a><h3>struct GdkPangoAttrStipple</h3>
 
679
<pre class="programlisting">struct GdkPangoAttrStipple {
 
680
  PangoAttribute attr;
 
681
  GdkBitmap *stipple;
 
682
};
 
683
</pre>
 
684
<p>
 
685
A Pango text attribute containing a stipple bitmap to be used when
 
686
rendering the text.
 
687
</p>
 
688
<div class="variablelist"><table border="0" class="variablelist">
 
689
<colgroup>
 
690
<col align="left" valign="top">
 
691
<col>
 
692
</colgroup>
 
693
<tbody>
 
694
<tr>
 
695
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/pango/pango-Text-Attributes.html#PangoAttribute"><span class="type">PangoAttribute</span></a> <em class="structfield"><code><a name="GdkPangoAttrStipple.attr"></a>attr</code></em>;</span></p></td>
 
696
<td>the <a href="/usr/share/gtk-doc/html/pango/pango-Text-Attributes.html#PangoAttribute"><span class="type">PangoAttribute</span></a>.</td>
 
697
</tr>
 
698
<tr>
 
699
<td><p><span class="term"><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkBitmap" title="GdkBitmap"><span class="type">GdkBitmap</span></a> *<em class="structfield"><code><a name="GdkPangoAttrStipple.stipple"></a>stipple</code></em>;</span></p></td>
 
700
<td>the stipple bitmap.</td>
 
701
</tr>
 
702
</tbody>
 
703
</table></div>
 
704
</div>
 
705
<hr>
 
706
<div class="refsect2">
 
707
<a name="gdk-pango-attr-emboss-color-new"></a><h3>gdk_pango_attr_emboss_color_new ()</h3>
 
708
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/pango/pango-Text-Attributes.html#PangoAttribute"><span class="returnvalue">PangoAttribute</span></a> *    gdk_pango_attr_emboss_color_new     (<em class="parameter"><code>const <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *color</code></em>);</pre>
 
709
<p>
 
710
Creates a new attribute specifying the color to emboss text with.
 
711
</p>
 
712
<div class="variablelist"><table border="0" class="variablelist">
 
713
<colgroup>
 
714
<col align="left" valign="top">
 
715
<col>
 
716
</colgroup>
 
717
<tbody>
 
718
<tr>
 
719
<td><p><span class="term"><em class="parameter"><code>color</code></em> :</span></p></td>
 
720
<td>a GdkColor representing the color to emboss with</td>
 
721
</tr>
 
722
<tr>
 
723
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
724
<td>new <a href="/usr/share/gtk-doc/html/pango/pango-Text-Attributes.html#PangoAttribute"><span class="type">PangoAttribute</span></a>
 
725
</td>
 
726
</tr>
 
727
</tbody>
 
728
</table></div>
 
729
<p class="since">Since 2.12</p>
 
730
</div>
 
731
<hr>
 
732
<div class="refsect2">
 
733
<a name="gdk-pango-attr-embossed-new"></a><h3>gdk_pango_attr_embossed_new ()</h3>
 
734
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/pango/pango-Text-Attributes.html#PangoAttribute"><span class="returnvalue">PangoAttribute</span></a> *    gdk_pango_attr_embossed_new         (<em class="parameter"><code><span class="type">gboolean</span> embossed</code></em>);</pre>
 
735
<p>
 
736
Creates a new attribute flagging a region as embossed or not.
 
737
</p>
 
738
<div class="variablelist"><table border="0" class="variablelist">
 
739
<colgroup>
 
740
<col align="left" valign="top">
 
741
<col>
 
742
</colgroup>
 
743
<tbody>
 
744
<tr>
 
745
<td><p><span class="term"><em class="parameter"><code>embossed</code></em> :</span></p></td>
 
746
<td>if the region should be embossed</td>
 
747
</tr>
 
748
<tr>
 
749
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
750
<td>new <a href="/usr/share/gtk-doc/html/pango/pango-Text-Attributes.html#PangoAttribute"><span class="type">PangoAttribute</span></a>
 
751
</td>
 
752
</tr>
 
753
</tbody>
 
754
</table></div>
 
755
</div>
 
756
<hr>
 
757
<div class="refsect2">
 
758
<a name="gdk-pango-attr-stipple-new"></a><h3>gdk_pango_attr_stipple_new ()</h3>
 
759
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/pango/pango-Text-Attributes.html#PangoAttribute"><span class="returnvalue">PangoAttribute</span></a> *    gdk_pango_attr_stipple_new          (<em class="parameter"><code><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkBitmap" title="GdkBitmap"><span class="type">GdkBitmap</span></a> *stipple</code></em>);</pre>
 
760
<p>
 
761
Creates a new attribute containing a stipple bitmap to be used when
 
762
rendering the text.
 
763
</p>
 
764
<div class="variablelist"><table border="0" class="variablelist">
 
765
<colgroup>
 
766
<col align="left" valign="top">
 
767
<col>
 
768
</colgroup>
 
769
<tbody>
 
770
<tr>
 
771
<td><p><span class="term"><em class="parameter"><code>stipple</code></em> :</span></p></td>
 
772
<td>a bitmap to be set as stipple</td>
 
773
</tr>
 
774
<tr>
 
775
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
776
<td>new <a href="/usr/share/gtk-doc/html/pango/pango-Text-Attributes.html#PangoAttribute"><span class="type">PangoAttribute</span></a>
 
777
</td>
 
778
</tr>
 
779
</tbody>
 
780
</table></div>
 
781
</div>
 
782
<hr>
 
783
<div class="refsect2">
 
784
<a name="gdk-pango-layout-get-clip-region"></a><h3>gdk_pango_layout_get_clip_region ()</h3>
 
785
<pre class="programlisting"><a class="link" href="gdk2-Points-Rectangles-and-Regions.html#GdkRegion" title="GdkRegion"><span class="returnvalue">GdkRegion</span></a> *         gdk_pango_layout_get_clip_region    (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> *layout</code></em>,
 
786
                                                         <em class="parameter"><code><span class="type">gint</span> x_origin</code></em>,
 
787
                                                         <em class="parameter"><code><span class="type">gint</span> y_origin</code></em>,
 
788
                                                         <em class="parameter"><code>const <span class="type">gint</span> *index_ranges</code></em>,
 
789
                                                         <em class="parameter"><code><span class="type">gint</span> n_ranges</code></em>);</pre>
 
790
<p>
 
791
Obtains a clip region which contains the areas where the given ranges
 
792
of text would be drawn. <em class="parameter"><code>x_origin</code></em> and <em class="parameter"><code>y_origin</code></em> are the same position
 
793
you would pass to <a class="link" href="gdk2-Drawing-Primitives.html#gdk-draw-layout-line" title="gdk_draw_layout_line ()"><code class="function">gdk_draw_layout_line()</code></a>. <em class="parameter"><code>index_ranges</code></em> should contain
 
794
ranges of bytes in the layout's text.
 
795
</p>
 
796
<p>
 
797
Note that the regions returned correspond to logical extents of the text
 
798
ranges, not ink extents. So the drawn layout may in fact touch areas out of
 
799
the clip region.  The clip region is mainly useful for highlightling parts
 
800
of text, such as when text is selected.
 
801
</p>
 
802
<div class="variablelist"><table border="0" class="variablelist">
 
803
<colgroup>
 
804
<col align="left" valign="top">
 
805
<col>
 
806
</colgroup>
 
807
<tbody>
 
808
<tr>
 
809
<td><p><span class="term"><em class="parameter"><code>layout</code></em> :</span></p></td>
 
810
<td>a <a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a>
 
811
</td>
 
812
</tr>
 
813
<tr>
 
814
<td><p><span class="term"><em class="parameter"><code>x_origin</code></em> :</span></p></td>
 
815
<td>X pixel where you intend to draw the layout with this clip</td>
 
816
</tr>
 
817
<tr>
 
818
<td><p><span class="term"><em class="parameter"><code>y_origin</code></em> :</span></p></td>
 
819
<td>Y pixel where you intend to draw the layout with this clip</td>
 
820
</tr>
 
821
<tr>
 
822
<td><p><span class="term"><em class="parameter"><code>index_ranges</code></em> :</span></p></td>
 
823
<td>array of byte indexes into the layout, where even members of array are start indexes and odd elements are end indexes</td>
 
824
</tr>
 
825
<tr>
 
826
<td><p><span class="term"><em class="parameter"><code>n_ranges</code></em> :</span></p></td>
 
827
<td>number of ranges in <em class="parameter"><code>index_ranges</code></em>, i.e. half the size of <em class="parameter"><code>index_ranges</code></em>
 
828
</td>
 
829
</tr>
 
830
<tr>
 
831
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
832
<td>a clip region containing the given ranges</td>
 
833
</tr>
 
834
</tbody>
 
835
</table></div>
 
836
</div>
 
837
<hr>
 
838
<div class="refsect2">
 
839
<a name="gdk-pango-layout-line-get-clip-region"></a><h3>gdk_pango_layout_line_get_clip_region ()</h3>
 
840
<pre class="programlisting"><a class="link" href="gdk2-Points-Rectangles-and-Regions.html#GdkRegion" title="GdkRegion"><span class="returnvalue">GdkRegion</span></a> *         gdk_pango_layout_line_get_clip_region
 
841
                                                        (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#PangoLayoutLine"><span class="type">PangoLayoutLine</span></a> *line</code></em>,
 
842
                                                         <em class="parameter"><code><span class="type">gint</span> x_origin</code></em>,
 
843
                                                         <em class="parameter"><code><span class="type">gint</span> y_origin</code></em>,
 
844
                                                         <em class="parameter"><code>const <span class="type">gint</span> *index_ranges</code></em>,
 
845
                                                         <em class="parameter"><code><span class="type">gint</span> n_ranges</code></em>);</pre>
 
846
<p>
 
847
Obtains a clip region which contains the areas where the given
 
848
ranges of text would be drawn. <em class="parameter"><code>x_origin</code></em> and <em class="parameter"><code>y_origin</code></em> are the same
 
849
position you would pass to <a class="link" href="gdk2-Drawing-Primitives.html#gdk-draw-layout-line" title="gdk_draw_layout_line ()"><code class="function">gdk_draw_layout_line()</code></a>. <em class="parameter"><code>index_ranges</code></em>
 
850
should contain ranges of bytes in the layout's text. The clip
 
851
region will include space to the left or right of the line (to the
 
852
layout bounding box) if you have indexes above or below the indexes
 
853
contained inside the line. This is to draw the selection all the way
 
854
to the side of the layout. However, the clip region is in line coordinates,
 
855
not layout coordinates.
 
856
</p>
 
857
<p>
 
858
Note that the regions returned correspond to logical extents of the text
 
859
ranges, not ink extents. So the drawn line may in fact touch areas out of
 
860
the clip region.  The clip region is mainly useful for highlightling parts
 
861
of text, such as when text is selected.
 
862
</p>
 
863
<div class="variablelist"><table border="0" class="variablelist">
 
864
<colgroup>
 
865
<col align="left" valign="top">
 
866
<col>
 
867
</colgroup>
 
868
<tbody>
 
869
<tr>
 
870
<td><p><span class="term"><em class="parameter"><code>line</code></em> :</span></p></td>
 
871
<td>a <a href="/usr/share/gtk-doc/html/pango/pango-Layout-Objects.html#PangoLayoutLine"><span class="type">PangoLayoutLine</span></a>
 
872
</td>
 
873
</tr>
 
874
<tr>
 
875
<td><p><span class="term"><em class="parameter"><code>x_origin</code></em> :</span></p></td>
 
876
<td>X pixel where you intend to draw the layout line with this clip</td>
 
877
</tr>
 
878
<tr>
 
879
<td><p><span class="term"><em class="parameter"><code>y_origin</code></em> :</span></p></td>
 
880
<td>baseline pixel where you intend to draw the layout line with this clip</td>
 
881
</tr>
 
882
<tr>
 
883
<td><p><span class="term"><em class="parameter"><code>index_ranges</code></em> :</span></p></td>
 
884
<td>array of byte indexes into the layout, where even members of array are start indexes and odd elements are end indexes</td>
 
885
</tr>
 
886
<tr>
 
887
<td><p><span class="term"><em class="parameter"><code>n_ranges</code></em> :</span></p></td>
 
888
<td>number of ranges in <em class="parameter"><code>index_ranges</code></em>, i.e. half the size of <em class="parameter"><code>index_ranges</code></em>
 
889
</td>
 
890
</tr>
 
891
<tr>
 
892
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
893
<td>a clip region containing the given ranges</td>
 
894
</tr>
 
895
</tbody>
 
896
</table></div>
 
897
</div>
 
898
</div>
 
899
<div class="refsect1">
 
900
<a name="gdk2-Pango-Interaction.property-details"></a><h2>Property Details</h2>
 
901
<div class="refsect2">
 
902
<a name="GdkPangoRenderer--screen"></a><h3>The <code class="literal">"screen"</code> property</h3>
 
903
<pre class="programlisting">  "screen"                   <a class="link" href="GdkScreen.html" title="GdkScreen"><span class="type">GdkScreen</span></a>*            : Read / Write / Construct Only</pre>
 
904
<p>the GdkScreen for the renderer.</p>
 
905
</div>
 
906
</div>
 
907
</div>
 
908
<div class="footer">
 
909
<hr>
 
910
          Generated by GTK-Doc V1.18</div>
 
911
</body>
 
912
</html>
 
 
b'\\ No newline at end of file'