/usr/share/gtk-doc/html/pygtksourceview2/class-gtksourceprintcompositor2.html is in python-gtksourceview2 2.10.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtksourceview2.PrintCompositor</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="PyGtksourceview2 Reference Manual"><link rel="up" href="index.html" title="PyGtksourceview2 Reference Manual"><link rel="prev" href="class-gtksourcemark2.html" title="gtksourceview2.Mark"><link rel="next" href="class-gtksourcestyle2.html" title="gtksourceview2.Style"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtksourceview2.PrintCompositor</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtksourcemark2.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="class-gtksourcestyle2.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtksourceview2.PrintCompositor"><a name="class-gtksourceprintcompositor2"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtksourceview2.PrintCompositor</h2><p>gtksourceview2.PrintCompositor — Compose a GtkSourceBuffer for printing.</p></div><div class="refsect1" title="Synopsis"><a name="idp5956288"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtksourceview2.PrintCompositor</span></span>(<span class="ooclass"><span class="classname"><a
href="../pygobject/class-gobject.html"
>gobject.GObject</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#constructor-gtksourceprintcompositor2" title="Constructor">gtksourceview2.PrintCompositor</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>buffer</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--draw-page" title="gtksourceview2.PrintCompositor.draw_page">draw_page</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>context</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>page_nr</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--get-body-font-name" title="gtksourceview2.PrintCompositor.get_body_font_name">get_body_font_name</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--get-bottom-margin" title="gtksourceview2.PrintCompositor.get_bottom_margin">get_bottom_margin</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>unit</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--get-buffer" title="gtksourceview2.PrintCompositor.get_buffer">get_buffer</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--get-footer-font-name" title="gtksourceview2.PrintCompositor.get_footer_font_name">get_footer_font_name</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--get-header-font-name" title="gtksourceview2.PrintCompositor.get_header_font_name">get_header_font_name</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--get-highlight-syntax" title="gtksourceview2.PrintCompositor.get_highlight_syntax">get_highlight_syntax</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--get-left-margin" title="gtksourceview2.PrintCompositor.get_left_margin">get_left_margin</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>unit</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--get-line-numbers-font-name" title="gtksourceview2.PrintCompositor.get_line_numbers_font_name">get_line_numbers_font_name</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--get-n-pages" title="gtksourceview2.PrintCompositor.get_n_pages">get_n_pages</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--get-pagination-progress" title="gtksourceview2.PrintCompositor.get_pagination_progress">get_pagination_progress</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--get-print-footer" title="gtksourceview2.PrintCompositor.get_print_footer">get_print_footer</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--get-print-header" title="gtksourceview2.PrintCompositor.get_print_header">get_print_header</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--get_print_line_numbers" title="gtksourceview2.PrintCompositor.get_print_line_numbers">get_print_line_numbers</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--get-right-margin" title="gtksourceview2.PrintCompositor.get_right_margin">get_right_margin</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>unit</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--get-tab-width" title="gtksourceview2.PrintCompositor.get_tab_width">get_tab_width</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--get-top-margin" title="gtksourceview2.PrintCompositor.get_top_margin">get_top_margin</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>unit</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--get-wrap-mode" title="gtksourceview2.PrintCompositor.get_wrap_mode">get_wrap_mode</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">paginate</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>context</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-body-font-name" title="gtksourceview2.PrintCompositor.set_body_font_name">set_body_font_name</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>font_name</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-bottom-margin" title="gtksourceview2.PrintCompositor.set_bottom_margin">set_bottom_margin</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>margin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>unit</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-footer-font-name" title="gtksourceview2.PrintCompositor.set_footer_font_name">set_footer_font_name</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>font_name</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-footer-format" title="gtksourceview2.PrintCompositor.set_footer_format">set_footer_format</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>separator</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>left</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>center</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>right</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-header-font-name" title="gtksourceview2.PrintCompositor.set_header_font_name">set_header_font_name</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>font_name</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-header-format" title="gtksourceview2.PrintCompositor.set_header_format">set_header_format</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>separator</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>left</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>center</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>right</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-highlight-syntax" title="gtksourceview2.PrintCompositor.set_highlight_syntax">set_highlight_syntax</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>highlight</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-left-margin" title="gtksourceview2.PrintCompositor.set_left_margin">set_left_margin</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>margin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>unit</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-line-numbers-font-name" title="gtksourceview2.PrintCompositor.set_line_numbers_font_name">set_line_numbers_font_name</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>font_name</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-print-footer" title="gtksourceview2.PrintCompositor.set_print_footer">set_print_footer</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>print</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-print-header" title="gtksourceview2.PrintCompositor.set_print_header">set_print_header</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>print</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-print-line-numbers" title="gtksourceview2.PrintCompositor.set_print_line_numbers">set_print_line_numbers</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>interval</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-right-margin" title="gtksourceview2.PrintCompositor.set_right_margin">set_right_margin</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>margin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>unit</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-tab-width" title="gtksourceview2.PrintCompositor.set_tab_width">set_tab_width</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-top-margin" title="gtksourceview2.PrintCompositor.set_top_margin">set_top_margin</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>margin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>unit</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-wrap-mode" title="gtksourceview2.PrintCompositor.set_wrap_mode">set_wrap_mode</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>wrap_mode</code></strong></span></span>)</code><br></pre></td></tr></table><pre class="programlisting">
<span class="bold"><strong>Functions</strong></span>
<code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#function-gtksourceprintcompositor2--new-from-view" title="gtksourceview2.print_compositor_new_from_view">gtksourceview2.print_compositor_new_from_view</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>view</code></strong></span></span>)</code></pre></div><div class="refsect1" title="Ancestry"><a name="idp11226768"></a><h2>Ancestry</h2><pre class="synopsis">+-- <a
href="../pygobject/class-gobject.html"
>gobject.GObject</a>
+-- <a class="link" href="class-gtksourceprintcompositor2.html" title="gtksourceview2.PrintCompositor">gtksourceview2.PrintCompositor</a>
</pre></div><div class="refsect1" title="Properties"><a name="idp11230720"></a><h2>Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col width="1in"><col width="1in"><col width="4in"></colgroup><tbody><tr valign="top"><td valign="top">"body-font-name"</td><td valign="top">Read-Write</td><td valign="top">Name of the font used for the text body. Accepted values are strings
representing a font description Pango can understand. (e.g. "Monospace 10"). See
<code class="methodname">pango.FontDescription</code>()
constructor for a description of the format of the string representation.
The value of this property cannot be changed anymore after the firstcall to the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
Default value: <code class="literal">None</code>. Since 2.2.
</td></tr><tr valign="top"><td valign="top">"buffer"</td><td valign="top">Read-Write-Construct</td><td valign="top">The <code class="methodname"><a class="link" href="class-gtksourcebuffer2.html#constructor-gtksourcebuffer2" title="Constructor">gtksourceview2.Buffer</a></code>
object to print. Since 2.2.
</td></tr><tr valign="top"><td valign="top">"footer-font-name"</td><td valign="top">Read-Write</td><td valign="top">Name of the font used to print page footer. If this property is unspecified,
the text body font is used. Accepted values are strings representing a font description
Pango can understand. (e.g. "Monospace 10"). See
<code class="methodname">pango.FontDescription</code>()
constructor for a description of the format of the string representation.
The value of this property cannot be changed anymore after the first callto the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
Default value: <code class="literal">None</code>. Since 2.2.
</td></tr><tr valign="top"><td valign="top">"header-font-name"</td><td valign="top">Read-Write</td><td valign="top">Name of the font used to print page footer. If this property is unspecified,
the text body font is used. Accepted values are strings representing a font description
Pango can understand. (e.g. "Monospace 10"). See
<code class="methodname">pango.FontDescription</code>()
constructor for a description of the format of the string representation.
The value of this property cannot be changed anymore after the first callto the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
Default value: <code class="literal">None</code>. Since 2.2.
</td></tr><tr valign="top"><td valign="top">"highlight-syntax"</td><td valign="top">Read-Write</td><td valign="top">Whether to print the document with highlighted syntax. The value of this
property cannot be changed anymore after the first call to the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
Default value: <code class="literal">True</code>. Since 2.2.
</td></tr><tr valign="top"><td valign="top">"line-numbers-font-name"</td><td valign="top">Read-Write</td><td valign="top">Name of the font used to print page footer. If this property is unspecified,
the text body font is used. Accepted values are strings representing a font description
Pango can understand. (e.g. "Monospace 10"). See
<code class="methodname">pango.FontDescription</code>()
constructor for a description of the format of the string representation.
The value of this property cannot be changed anymore after the first callto the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
Default value: <code class="literal">None</code>. Since 2.2.
</td></tr><tr valign="top"><td valign="top">"n-pages"</td><td valign="top">Read</td><td valign="top">The number of pages in the document or -1 if the document has not been completely paginated.
Allowed values: >= -1. Default value: -1. Since 2.2
</td></tr><tr valign="top"><td valign="top">"print-footer"</td><td valign="top">Read-Write</td><td valign="top">Whether to print a footer in each page. Note that by default the footer format is
unspecified, and if it is unspecified the footer will not be printed, regardless of the value of this property.
The value of this property cannot be changed anymore after the first call to the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
Default value: <code class="literal">False</code>. Since 2.2.
</td></tr><tr valign="top"><td valign="top">"print-header"</td><td valign="top">Read-Write</td><td valign="top">Whether to print a header in each page. Note that by default the header format is
unspecified, and if it is unspecified the header will not be printed, regardless of the value of this property.
The value of this property cannot be changed anymore after the first call to the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
Default value: <code class="literal">False</code>. Since 2.2.
</td></tr><tr valign="top"><td valign="top">"print-line-numbers"</td><td valign="top">Read-Write</td><td valign="top">Interval of printed line numbers. If this property is set to 0 no numbers will be printed.
If greater than 0, a number will be printed every "print-line-numbers" lines (i.e. 1 will print all line numbers).
The value of this property cannot be changed anymore after the first call to the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
Allowed values: <= 100. Default value: 1. Since 2.2.
</td></tr><tr valign="top"><td valign="top">"tab-width"</td><td valign="top">Read-Write</td><td valign="top">Width of a tab character expressed in spaces. The value of this property cannot
be changed anymore after the first call to the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
Allowed values: [1,32]. Default value: 8. Since 2.2.
</td></tr><tr valign="top"><td valign="top">"wrap-mode"</td><td valign="top">Read-Write</td><td valign="top">Whether to wrap lines never, at word boundaries, or at character boundaries.
The value of this property cannot be changed anymore after the first call to the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
Default value: gtk.WRAP_NONE. Since 2.2.
</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="Description"><a name="description-gtktextview"></a><h2>Description</h2><p>
The <code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#constructor-gtksourceprintcompositor2" title="Constructor">gtksourceview2.PrintCompositor</a></code>
object is used to compose a <code class="methodname">gtksourceview2.buffer</code>
for printing. You can set various configuration options to customize the printed output.
<code class="methodname"><a class="link" href="class-gtksourceview2.html#constructor-gtksourceview" title="Constructor">gtksourceview2.PrintCompositor</a></code>
is designed to be used with the high-level printing API of gtk+, i.e.
<code class="methodname">gtk.PrintOperation</code>.
</p><p>
The margins specified in this object are the layout margins: they define the blank space bordering the
printed area of the pages. They must not be confused with the "print margins", i.e. the parts of the
page that the printer cannot print on, defined in the <code class="methodname">gtk.PageSetup</code>
objects. If the specified layout
margins are smaller than the "print margins", the latter ones are used as a fallback by the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#constructor-gtksourceprintcompositor2" title="Constructor">gtksourceview2.PrintCompositor</a></code>
object, so that the printed area is not clipped.
</p></div><div class="refsect1" title="Constructor"><a name="constructor-gtksourceprintcompositor2"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtksourceview2.PrintCompositor</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>buffer</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>buffer</code></strong> :</span></p></td><td>a <a class="link" href="class-gtksourcebuffer2.html" title="gtksourceview2.Buffer"><code class="classname">gtksourceview2.Buffer</code></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <a class="link" href="class-gtksourceprintcompositor2.html" title="gtksourceview2.PrintCompositor"><code class="classname">gtksourceview2.PrintCompositor</code></a>.
</td></tr></tbody></table><p>
Creates a new
<a class="link" href="class-gtksourceprintcompositor2.html" title="gtksourceview2.PrintCompositor"><code class="classname">gtksourceview2.PrintCompositor</code></a>
that can be used to print buffer.
</p></div><div class="refsect1" title="Methods"><a name="idp11305040"></a><h2>Methods</h2><div class="refsect2" title="gtksourceview2.PrintCompositor.draw_page"><a name="method-gtksourceprintcompositor2--draw-page"></a><h3>gtksourceview2.PrintCompositor.draw_page</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">draw_page</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>context</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>page_nr</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>context</code></strong> :</span></p></td><td>the <code class="classname">gtk.PrintContext</code>
encapsulating the context information that is required when drawing the page for printing.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>page_nr</code></strong> :</span></p></td><td>the number of the page to print.</td></tr></tbody></table><p>
The <code class="methodname">draw_page</code>() method draws page <em class="parameter"><code>page_nr</code></em> for printing on the the
Cairo context encapsuled in context. This method has been designed to be called in the handler
of the "draw_page" signal as shown in the following example:
</p><pre class="programlisting">
# Signal handler for the GtkPrintOperation::draw_page signal
def draw_page(operation, context, page_nr, compositor)
compositor.draw_page(context, page_nr)
</pre></div><div class="refsect2" title="gtksourceview2.PrintCompositor.get_body_font_name"><a name="method-gtksourceprintcompositor2--get-body-font-name"></a><h3>gtksourceview2.PrintCompositor.get_body_font_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_body_font_name</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>
a new string containing the name of the font used to print the text body.
</td></tr></tbody></table><p>
The <code class="methodname">get_body_font_name</code>() method returns the name of the font used to print
the text body.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.get_bottom_margin"><a name="method-gtksourceprintcompositor2--get-bottom-margin"></a><h3>gtksourceview2.PrintCompositor.get_bottom_margin</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_bottom_margin</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>unit</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>unit</code></strong> :</span></p></td><td>the unit for the return value.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>
the bottom margin.
</td></tr></tbody></table><p>
The <code class="methodname">get_bottom_margin</code>() method gets the bottom margin
in units of <em class="parameter"><code>unit</code></em>.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.get_buffer"><a name="method-gtksourceprintcompositor2--get-buffer"></a><h3>gtksourceview2.PrintCompositor.get_buffer</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_buffer</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>
the <a class="link" href="class-gtksourcebuffer2.html" title="gtksourceview2.Buffer"><code class="classname">gtksourceview2.Buffer</code></a>
associated with the compositor.
</td></tr></tbody></table><p>
The <code class="methodname">get_buffer</code>() method gets the
<a class="link" href="class-gtksourcebuffer2.html" title="gtksourceview2.Buffer"><code class="classname">gtksourceview2.Buffer</code></a>
associated with the compositor.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.get_footer_font_name"><a name="method-gtksourceprintcompositor2--get-footer-font-name"></a><h3>gtksourceview2.PrintCompositor.get_footer_font_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname"></span>(<span class="methodparam">get_footer_font_name</span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>
a new string containing the name of the font used to print the page footer.
</td></tr></tbody></table><p>
The <code class="methodname">get_footer_font_name</code>() method returns the name of
the font used to print the page footer.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.get_header_font_name"><a name="method-gtksourceprintcompositor2--get-header-font-name"></a><h3>gtksourceview2.PrintCompositor.get_header_font_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_header_font_name</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>
a new string containing the name of the font used to print the page header.
</td></tr></tbody></table><p>
The <code class="methodname">get_header_font_name</code>() method Returns the name
of the font used to print the page header
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.get_highlight_syntax"><a name="method-gtksourceprintcompositor2--get-highlight-syntax"></a><h3>gtksourceview2.PrintCompositor.get_highlight_syntax</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_highlight_syntax</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>
<code class="literal">True</code> if the printed output will be highlighted.
</td></tr></tbody></table><p>
The <code class="methodname">get_highlight_syntax</code>() method determines whether the
printed text will be highlighted according to the buffer rules. Note that highlighting
will happen only if the buffer to print has highlighting activated.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.get_left_margin"><a name="method-gtksourceprintcompositor2--get-left-margin"></a><h3>gtksourceview2.PrintCompositor.get_left_margin</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_left_margin</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>unit</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>unit</code></strong> :</span></p></td><td>the unit for the return value.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>
the left margin
</td></tr></tbody></table><p>
The <code class="methodname">get_left_margin</code>() method gets the left margin
in units of <em class="parameter"><code>unit</code></em>.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.get_line_numbers_font_name"><a name="method-gtksourceprintcompositor2--get-line-numbers-font-name"></a><h3>gtksourceview2.PrintCompositor.get_line_numbers_font_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_line_numbers_font_name</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>
a new string containing the name of the font used to print line numbers on the left margin.
</td></tr></tbody></table><p>
The <code class="methodname">get_line_numbers_font_name</code>() method returns the name
of the font used to print line numbers on the left margin.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.get_n_pages"><a name="method-gtksourceprintcompositor2--get-n-pages"></a><h3>gtksourceview2.PrintCompositor.get_n_pages</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_n_pages</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>
the number of pages in the document or -1 if the document has not been completely paginated.
</td></tr></tbody></table><p>
The <code class="methodname">get_n_pages</code>() method returns the number of pages in
the document or -1 if the document has not been completely paginated.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.get_pagination_progress"><a name="method-gtksourceprintcompositor2--get-pagination-progress"></a><h3>gtksourceview2.PrintCompositor.get_pagination_progress</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_pagination_progress</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>
a fraction from 0.0 to 1.0 inclusive
</td></tr></tbody></table><p>
The <code class="methodname">get_pagination_progress</code>() method returns the current
fraction of the document pagination that has been completed.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.get_print_footer"><a name="method-gtksourceprintcompositor2--get-print-footer"></a><h3>gtksourceview2.PrintCompositor.get_print_footer</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_print_footer</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>
<code class="literal">True</code> if the footer is set to be printed.
</td></tr></tbody></table><p>
The <code class="methodname">get_print_footer</code>() method determines if a footer is
set to be printed for each page. A footer will be printed if this function returns
<code class="literal">True</code> and some format strings have been specified with
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-footer-format" title="gtksourceview2.PrintCompositor.set_footer_format">gtksourceview2.PrintCompositor.set_footer_format</a></code>().
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.get_print_header"><a name="method-gtksourceprintcompositor2--get-print-header"></a><h3>gtksourceview2.PrintCompositor.get_print_header</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_print_header</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>
<code class="literal">True</code> if the header is set to be printed.
</td></tr></tbody></table><p>
The <code class="methodname">get_print_header</code>() method determines if a header is
set to be printed for each page. A header will be printed if this function returns
<code class="literal">True</code> and some format strings have been specified with
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-header-format" title="gtksourceview2.PrintCompositor.set_header_format">gtksourceview2.PrintCompositor.set_header_format</a></code>().
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.get_print_line_numbers"><a name="method-gtksourceprintcompositor2--get_print_line_numbers"></a><h3>gtksourceview2.PrintCompositor.get_print_line_numbers</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_print_line_numbers</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>
the interval of printed line numbers.
</td></tr></tbody></table><p>
The <code class="methodname">get_print_line_numbers</code>() method returns the interval
used for line number printing. If the value is 0, no line numbers will be printed.
The default value is 1 (i.e. numbers printed in all lines).
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.get_right_margin"><a name="method-gtksourceprintcompositor2--get-right-margin"></a><h3>gtksourceview2.PrintCompositor.get_right_margin</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_right_margin</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>unit</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>unit</code></strong> :</span></p></td><td>the unit for the return value.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>
the right margin
</td></tr></tbody></table><p>
The <code class="methodname">get_right_margin</code>() method gets the right
margin in units of <em class="parameter"><code>unit</code></em>.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.get_tab_width"><a name="method-gtksourceprintcompositor2--get-tab-width"></a><h3>gtksourceview2.PrintCompositor.get_tab_width</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_tab_width</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>
width of tab.
</td></tr></tbody></table><p>
The <code class="methodname">get_tab_width</code>() method returns the width of
tabulation in characters for printed text.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.get_top_margin"><a name="method-gtksourceprintcompositor2--get-top-margin"></a><h3>gtksourceview2.PrintCompositor.get_top_margin</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_top_margin</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>unit</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>unit</code></strong> :</span></p></td><td>the unit for the return value.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>
the top margin
</td></tr></tbody></table><p>
The <code class="methodname">get_top_margin</code>() method gets the top
margin in units of <em class="parameter"><code>unit</code></em>.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.get_wrap_mode"><a name="method-gtksourceprintcompositor2--get-wrap-mode"></a><h3>gtksourceview2.PrintCompositor.get_wrap_mode</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_wrap_mode</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>
the line wrap mode.
</td></tr></tbody></table><p>
The <code class="methodname">get_wrap_mode</code>() method gets the line wrapping
mode for the printed text.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.paginate"><a name="method-gtksourceprintcompositor2--paginate"></a><h3>gtksourceview2.PrintCompositor.paginate</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">paginate</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>context</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>context</code></strong> :</span></p></td><td>the <code class="classname">gtk.PrintContext</code>
encapsulating the context information that is required when drawing the page for printing.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>
<code class="literal">True</code> if the document has been completely paginated,
<code class="literal">False</code> otherwise.
</td></tr></tbody></table><p>
The <code class="methodname">paginate</code>() method paginate the document associated with the compositor.
</p><p>
In order to support non-blocking pagination, document is paginated in small chunks. Each time
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>()
is invoked, a chunk of the document is paginated. To paginate the entire document,
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>()
must be invoked multiple times. It returns <code class="literal">True</code> if the document has been
completely paginated, otherwise it returns <code class="literal">False</code>.
</p><p>
This method has been designed to be invoked in the handler of the "paginate" signal, as shown in the following example:
</p><pre class="programlisting">
# Signal handler for the GtkPrintOperation::paginate signal
def paginate(operation, context, compositor)
if compositor.paginate(context):
n_pages = compositor.get_n_pages()
operation.set_n_pages(n_pages)
return True
else:
return False
</pre><p>
If you don't need to do pagination in chunks, you can simply do it all in the
"begin-print" handler, and set the number of pages from there, like in the following example:
</p><pre class="programlisting">
# Signal handler for the GtkPrintOperation::begin-print signal
def begin_print(operation, context, compositor)
while compositor.paginate(context):
n_pages = compositor.get_n_pages()
operation.set_n_pages(n_pages)
</pre></div><div class="refsect2" title="gtksourceview2.PrintCompositor.set_body_font_name"><a name="method-gtksourceprintcompositor2--set-body-font-name"></a><h3>gtksourceview2.PrintCompositor.set_body_font_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_body_font_name</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>font_name</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>font_name</code></strong> :</span></p></td><td>
the name of the default font for the body of text.
</td></tr></tbody></table><p>
The <code class="methodname">set_body_font_name</code>() method sets the default font for the printed text.
<em class="parameter"><code>font_name</code></em> should be a string representation of a font description
Pango can understand. (e.g. "Monospace 10"). See
<code class="methodname">pango.FontDescription</code>()
for a description of the format of the string representation.
This function cannot be called anymore after the first call to the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.set_bottom_margin"><a name="method-gtksourceprintcompositor2--set-bottom-margin"></a><h3>gtksourceview2.PrintCompositor.set_bottom_margin</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_bottom_margin</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>margin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>unit</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>margin</code></strong> :</span></p></td><td>
the new bottom margin in units of <em class="parameter"><code>unit</code></em>
</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>unit</code></strong> :</span></p></td><td>
the units for margin
</td></tr></tbody></table><p>
The <code class="methodname">set_bottom_margin</code>() method sets the bottom margin used by compositor.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.set_footer_font_name"><a name="method-gtksourceprintcompositor2--set-footer-font-name"></a><h3>gtksourceview2.PrintCompositor.set_footer_font_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_footer_font_name</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>font_name</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>font_name</code></strong> :</span></p></td><td>
the name of the default font for the footer text. or <code class="literal">None</code>.
</td></tr></tbody></table><p>
The <code class="methodname">set_footer_font_name</code>() method Sets the font for printing the page footer.
If <code class="literal">None</code> is supplied, the default font (i.e. the one being used for the text) will be used instead.
<em class="parameter"><code>font_name</code></em> should be a string representation of a font description
Pango can understand. (e.g. "Monospace 10"). See
<code class="methodname">pango.FontDescription</code>()
for a description of the format of the string representation.
This function cannot be called anymore after the first call to the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.set_footer_format"><a name="method-gtksourceprintcompositor2--set-footer-format"></a><h3>gtksourceview2.PrintCompositor.set_footer_format</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_footer_format</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>separator</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>left</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>center</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>right</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>separator</code></strong> :</span></p></td><td>
<code class="literal">True</code> if you want a separator line to be printed.
</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>left</code></strong> :</span></p></td><td>
a format string to print on the left of the footer.
</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>center</code></strong> :</span></p></td><td>
a format string to print on the center of the footer.
</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>right</code></strong> :</span></p></td><td>
a format string to print on the right of the footer.
</td></tr></tbody></table><p>
The <code class="methodname">set_footer_format</code>() method sets strftime like header format strings,
to be printed on the left, center and right of the bottom of each page.
The strings may include strftime(3) codes which will be expanded at print time.
All strftime() codes are accepted, with the addition of N for the page number and Q for the page count.
</p><p>
separator specifies if a solid line should be drawn to separate the footer from the document text.
</p><p>
If <code class="literal">None</code> is given for any of the three arguments, that particular string will not be printed.
</p><p>
For the footer to be printed, in addition to specifying format strings, you need to enable footer printing with
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-print-footer" title="gtksourceview2.PrintCompositor.set_print_footer">gtksourceview2.PrintCompositor.set_print_footer</a></code>().
</p><p>
This method cannot be called anymore after the first call to the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.set_header_font_name"><a name="method-gtksourceprintcompositor2--set-header-font-name"></a><h3>gtksourceview2.PrintCompositor.set_header_font_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_header_font_name</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>font_name</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>font_name</code></strong> :</span></p></td><td>
the name of the default font for the footer text. or <code class="literal">None</code>.
</td></tr></tbody></table><p>
The <code class="methodname">set_header_font_name</code>() method Sets the font for printing the page header.
If <code class="literal">None</code> is supplied, the default font (i.e. the one being used for the text) will be used instead.
<em class="parameter"><code>font_name</code></em> should be a string representation of a font description
Pango can understand. (e.g. "Monospace 10"). See
<code class="methodname">pango.FontDescription</code>()
for a description of the format of the string representation.
This function cannot be called anymore after the first call to the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.set_header_format"><a name="method-gtksourceprintcompositor2--set-header-format"></a><h3>gtksourceview2.PrintCompositor.set_header_format</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_header_format</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>separator</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>left</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>center</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>right</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>separator</code></strong> :</span></p></td><td>
<code class="literal">True</code> if you want a separator line to be printed.
</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>left</code></strong> :</span></p></td><td>
a format string to print on the left of the header.
</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>center</code></strong> :</span></p></td><td>
a format string to print on the center of the header.
</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>right</code></strong> :</span></p></td><td>
a format string to print on the right of the header.
</td></tr></tbody></table><p>
The <code class="methodname">set_header_format</code>() method sets strftime like header format strings,
to be printed on the left, center and right of the top of each page.
The strings may include strftime(3) codes which will be expanded at print time.
All strftime() codes are accepted, with the addition of N for the page number and Q for the page count.
</p><p>
separator specifies if a solid line should be drawn to separate the footer from the document text.
</p><p>
If <code class="literal">None</code> is given for any of the three arguments, that particular string will not be printed.
</p><p>
For the header to be printed, in addition to specifying format strings, you need to enable header printing with
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-print-header" title="gtksourceview2.PrintCompositor.set_print_header">gtksourceview2.PrintCompositor.set_print_header</a></code>().
</p><p>
This method cannot be called anymore after the first call to the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.set_highlight_syntax"><a name="method-gtksourceprintcompositor2--set-highlight-syntax"></a><h3>gtksourceview2.PrintCompositor.set_highlight_syntax</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_highlight_syntax</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>highlight</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>highlight</code></strong> :</span></p></td><td>
whether syntax should be highlighted.
</td></tr></tbody></table><p>
The <code class="methodname">set_highlight_syntax</code>() method sets whether the printed
text will be highlighted according to the buffer rules. Both color and font style are applied.
This function cannot be called anymore after the first call to the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.set_left_margin"><a name="method-gtksourceprintcompositor2--set-left-margin"></a><h3>gtksourceview2.PrintCompositor.set_left_margin</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_left_margin</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>margin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>unit</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>margin</code></strong> :</span></p></td><td>
the new left margin in units of <em class="parameter"><code>unit</code></em>
</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>unit</code></strong> :</span></p></td><td>
the units for margin
</td></tr></tbody></table><p>
The <code class="methodname">set_left_margin</code>() method sets the left margin used by compositor.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.set_line_numbers_font_name"><a name="method-gtksourceprintcompositor2--set-line-numbers-font-name"></a><h3>gtksourceview2.PrintCompositor.set_line_numbers_font_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_line_numbers_font_name</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>font_name</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>font_name</code></strong> :</span></p></td><td>
the name of the default font for the line numbers. or <code class="literal">None</code>.
</td></tr></tbody></table><p>
The <code class="methodname">set_line_numbers_font_name</code>() method sets the font for printing the line numbers.
If <code class="literal">None</code> is supplied, the default font (i.e. the one being used for the text) will be used instead.
<em class="parameter"><code>font_name</code></em> should be a string representation of a font description
Pango can understand. (e.g. "Monospace 10"). See
<code class="methodname">pango.FontDescription</code>()
for a description of the format of the string representation.
This function cannot be called anymore after the first call to the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.set_print_footer"><a name="method-gtksourceprintcompositor2--set-print-footer"></a><h3>gtksourceview2.PrintCompositor.set_print_footer</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_print_footer</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>print</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>print</code></strong> :</span></p></td><td>
<code class="literal">True</code> if you want the footer to be printed.
</td></tr></tbody></table><p>
The <code class="methodname">set_print_footer</code> method sets whether you want to print a footer in each page.
The footer consists of three pieces of text and an optional line separator, configurable with
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-footer-format" title="gtksourceview2.PrintCompositor.set_footer_format">gtksourceview2.PrintCompositor.set_footer_format</a></code>().
</p><p>
Note that by default the footer format is unspecified, and if it's empty it will not be printed, regardless of this setting.
</p><p>
This function cannot be called anymore after the first call to the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.set_print_header"><a name="method-gtksourceprintcompositor2--set-print-header"></a><h3>gtksourceview2.PrintCompositor.set_print_header</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_print_header</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>print</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>print</code></strong> :</span></p></td><td>
<code class="literal">True</code> if you want the header to be printed.
</td></tr></tbody></table><p>
The <code class="methodname">set_print_header</code>() method sets whether you want to
print a header in each page. The footer consists of three pieces of text and an optional
line separator, configurable with
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--set-header-format" title="gtksourceview2.PrintCompositor.set_header_format">gtksourceview2.PrintCompositor.set_header_format</a></code>().
</p><p>
Note that by default the header format is unspecified, and if it's empty it will not be printed, regardless of this setting.
</p><p>
This function cannot be called anymore after the first call to the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.set_print_line_numbers"><a name="method-gtksourceprintcompositor2--set-print-line-numbers"></a><h3>gtksourceview2.PrintCompositor.set_print_line_numbers</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_print_line_numbers</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>interval</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>interval</code></strong> :</span></p></td><td>
interval for printed line numbers.
</td></tr></tbody></table><p>
The <code class="methodname">set_print_line_numbers</code>() method sets the interval for printed line numbers.
If interval is 0 no numbers will be printed. If greater than 0, a number will be printed every
interval lines (i.e. 1 will print all line numbers).
</p><p>
Maximum accepted value for interval is 100.
</p><p>
This function cannot be called anymore after the first call to the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.set_right_margin"><a name="method-gtksourceprintcompositor2--set-right-margin"></a><h3>gtksourceview2.PrintCompositor.set_right_margin</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_right_margin</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>margin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>unit</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>margin</code></strong> :</span></p></td><td>
the new left margin in units of <em class="parameter"><code>unit</code></em>
</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>unit</code></strong> :</span></p></td><td>
the units for margin
</td></tr></tbody></table><p>
The <code class="methodname">set_right_margin</code>() method sets the right margin used by compositor.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.set_tab_width"><a name="method-gtksourceprintcompositor2--set-tab-width"></a><h3>gtksourceview2.PrintCompositor.set_tab_width</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_tab_width</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>width</code></strong> :</span></p></td><td>
width of tab.
</td></tr></tbody></table><p>
The <code class="methodname">set_right_margin</code>() method returns the width of tabulation in characters for printed text.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.set_top_margin"><a name="method-gtksourceprintcompositor2--set-top-margin"></a><h3>gtksourceview2.PrintCompositor.set_top_margin</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_top_margin</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>margin</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>unit</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>margin</code></strong> :</span></p></td><td>
the new left margin in units of <em class="parameter"><code>unit</code></em>
</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>unit</code></strong> :</span></p></td><td>
the units for margin
</td></tr></tbody></table><p>
The <code class="methodname">set_top_margin</code>() method sets the top margin used by compositor.
</p></div><div class="refsect2" title="gtksourceview2.PrintCompositor.set_wrap_mode"><a name="method-gtksourceprintcompositor2--set-wrap-mode"></a><h3>gtksourceview2.PrintCompositor.set_wrap_mode</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_wrap_mode</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>wrap_mode</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>wrap_mode</code></strong> :</span></p></td><td>
one of gtk.WRAP_NONE, gtk.WRAP_CHAR, gtk.WRAP_WORD, gtk.WRAP_WORD_CHAR.
</td></tr></tbody></table><p>
The <code class="methodname">set_right_margin</code>() method sets the line wrapping mode for the printed text.
</p><p>
This function cannot be called anymore after the first call to the
<code class="methodname"><a class="link" href="class-gtksourceprintcompositor2.html#method-gtksourceprintcompositor2--paginate" title="gtksourceview2.PrintCompositor.paginate">gtksourceview2.PrintCompositor.paginate</a></code>() method.
</p></div></div><div class="refsect1" title="Functions"><a name="idp12016448"></a><h2>Functions</h2><div class="refsect2" title="gtksourceview2.print_compositor_new_from_view"><a name="function-gtksourceprintcompositor2--new-from-view"></a><h3>gtksourceview2.print_compositor_new_from_view</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtksourceview2.print_compositor_new_from_view</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>wrap_mode</code></strong> :</span></p></td><td>
a <a class="link" href="class-gtksourceview2.html" title="gtksourceview2.View"><code class="classname">gtksourceview2.View</code></a> to get configuration from.
</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a <a class="link" href="class-gtksourceprintcompositor2.html" title="gtksourceview2.PrintCompositor"><code class="classname">gtksourceview2.PrintCompositor</code></a>.</td></tr></tbody></table><p>
The <code class="methodname">print_compositor_new_from_view</code>() function creates a new print
compositor that can be used to print the buffer associated with view. This constructor sets
some configuration properties to make the printed output match view as much as possible.
The properties set are "tab-width", "highlight-syntax", "wrap-mode", "body-font-name" and "print-line-numbers".
</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gtksourcemark2.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="class-gtksourcestyle2.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtksourceview2.Mark </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtksourceview2.Style</td></tr></table></div></body></html>
|