665 lines
37 KiB
HTML
665 lines
37 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||
<html>
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||
<title>GtkPrintContext: GTK+ 3 Reference Manual</title>
|
||
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
|
||
<link rel="home" href="index.html" title="GTK+ 3 Reference Manual">
|
||
<link rel="up" href="Printing.html" title="Printing">
|
||
<link rel="prev" href="gtk3-High-level-Printing-API.html" title="GtkPrintOperation">
|
||
<link rel="next" href="GtkPrintSettings.html" title="GtkPrintSettings">
|
||
<meta name="generator" content="GTK-Doc V1.25.1 (XML mode)">
|
||
<link rel="stylesheet" href="style.css" type="text/css">
|
||
</head>
|
||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
|
||
<td width="100%" align="left" class="shortcuts">
|
||
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
|
||
<a href="#GtkPrintContext.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span>
|
||
<a href="#GtkPrintContext.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
|
||
</td>
|
||
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
|
||
<td><a accesskey="u" href="Printing.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
|
||
<td><a accesskey="p" href="gtk3-High-level-Printing-API.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
|
||
<td><a accesskey="n" href="GtkPrintSettings.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
|
||
</tr></table>
|
||
<div class="refentry">
|
||
<a name="GtkPrintContext"></a><div class="titlepage"></div>
|
||
<div class="refnamediv"><table width="100%"><tr>
|
||
<td valign="top">
|
||
<h2><span class="refentrytitle"><a name="GtkPrintContext.top_of_page"></a>GtkPrintContext</span></h2>
|
||
<p>GtkPrintContext — Encapsulates context for drawing pages</p>
|
||
</td>
|
||
<td class="gallery_image" valign="top" align="right"></td>
|
||
</tr></table></div>
|
||
<div class="refsect1">
|
||
<a name="GtkPrintContext.functions"></a><h2>Functions</h2>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="functions_return">
|
||
<col class="functions_name">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">cairo_t</span> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkPrintContext.html#gtk-print-context-get-cairo-context" title="gtk_print_context_get_cairo_context ()">gtk_print_context_get_cairo_context</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkPrintContext.html#gtk-print-context-set-cairo-context" title="gtk_print_context_set_cairo_context ()">gtk_print_context_set_cairo_context</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<a class="link" href="GtkPageSetup.html" title="GtkPageSetup"><span class="returnvalue">GtkPageSetup</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkPrintContext.html#gtk-print-context-get-page-setup" title="gtk_print_context_get_page_setup ()">gtk_print_context_get_page_setup</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<a href="../glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkPrintContext.html#gtk-print-context-get-width" title="gtk_print_context_get_width ()">gtk_print_context_get_width</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<a href="../glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkPrintContext.html#gtk-print-context-get-height" title="gtk_print_context_get_height ()">gtk_print_context_get_height</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<a href="../glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkPrintContext.html#gtk-print-context-get-dpi-x" title="gtk_print_context_get_dpi_x ()">gtk_print_context_get_dpi_x</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<a href="../glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkPrintContext.html#gtk-print-context-get-dpi-y" title="gtk_print_context_get_dpi_y ()">gtk_print_context_get_dpi_y</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<a href="../pango/pango-Fonts.html#PangoFontMap-struct"><span class="returnvalue">PangoFontMap</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkPrintContext.html#gtk-print-context-get-pango-fontmap" title="gtk_print_context_get_pango_fontmap ()">gtk_print_context_get_pango_fontmap</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<a href="../pango/pango-Text-Processing.html#PangoContext-struct"><span class="returnvalue">PangoContext</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkPrintContext.html#gtk-print-context-create-pango-context" title="gtk_print_context_create_pango_context ()">gtk_print_context_create_pango_context</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<a href="../pango/pango-Layout-Objects.html#PangoLayout-struct"><span class="returnvalue">PangoLayout</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkPrintContext.html#gtk-print-context-create-pango-layout" title="gtk_print_context_create_pango_layout ()">gtk_print_context_create_pango_layout</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkPrintContext.html#gtk-print-context-get-hard-margins" title="gtk_print_context_get_hard_margins ()">gtk_print_context_get_hard_margins</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="GtkPrintContext.other"></a><h2>Types and Values</h2>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="name">
|
||
<col class="description">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="datatype_keyword"> </td>
|
||
<td class="function_name"><a class="link" href="GtkPrintContext.html#GtkPrintContext-struct" title="GtkPrintContext">GtkPrintContext</a></td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="GtkPrintContext.object-hierarchy"></a><h2>Object Hierarchy</h2>
|
||
<pre class="screen"> <a href="../gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
|
||
<span class="lineart">╰──</span> GtkPrintContext
|
||
</pre>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="GtkPrintContext.includes"></a><h2>Includes</h2>
|
||
<pre class="synopsis">#include <gtk/gtk.h>
|
||
</pre>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="GtkPrintContext.description"></a><h2>Description</h2>
|
||
<p>A GtkPrintContext encapsulates context information that is required when
|
||
drawing pages for printing, such as the cairo context and important
|
||
parameters like page size and resolution. It also lets you easily
|
||
create <a href="../pango/pango-Layout-Objects.html#PangoLayout-struct"><span class="type">PangoLayout</span></a> and <a href="../pango/pango-Text-Processing.html#PangoContext-struct"><span class="type">PangoContext</span></a> objects that match the font metrics
|
||
of the cairo surface.</p>
|
||
<p>GtkPrintContext objects gets passed to the <a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation-begin-print" title="The “begin-print” signal"><span class="type">“begin-print”</span></a>,
|
||
<a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation-end-print" title="The “end-print” signal"><span class="type">“end-print”</span></a>, <a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation-request-page-setup" title="The “request-page-setup” signal"><span class="type">“request-page-setup”</span></a> and
|
||
<a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation-draw-page" title="The “draw-page” signal"><span class="type">“draw-page”</span></a> signals on the <a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation"><span class="type">GtkPrintOperation</span></a>.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.3.17.3.7.4"></a><h4>Using GtkPrintContext in a <a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation-draw-page" title="The “draw-page” signal"><span class="type">“draw-page”</span></a> callback</h4>
|
||
<div class="informalexample">
|
||
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
|
||
<tbody>
|
||
<tr>
|
||
<td class="listing_lines" align="right"><pre>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</pre></td>
|
||
<td class="listing_code"><pre class="programlisting"><span class="gtkdoc kwb">static void</span>
|
||
<span class="function">draw_page</span> <span class="gtkdoc opt">(</span>GtkPrintOperation <span class="gtkdoc opt">*</span>operation<span class="gtkdoc opt">,</span>
|
||
GtkPrintContext <span class="gtkdoc opt">*</span>context<span class="gtkdoc opt">,</span>
|
||
<span class="gtkdoc kwb">int</span> page_nr<span class="gtkdoc opt">)</span>
|
||
<span class="gtkdoc opt">{</span>
|
||
cairo_t <span class="gtkdoc opt">*</span>cr<span class="gtkdoc opt">;</span>
|
||
PangoLayout <span class="gtkdoc opt">*</span>layout<span class="gtkdoc opt">;</span>
|
||
PangoFontDescription <span class="gtkdoc opt">*</span>desc<span class="gtkdoc opt">;</span>
|
||
|
||
cr <span class="gtkdoc opt">=</span> <span class="function"><a href="GtkPrintContext.html#gtk-print-context-get-cairo-context">gtk_print_context_get_cairo_context</a></span> <span class="gtkdoc opt">(</span>context<span class="gtkdoc opt">);</span>
|
||
|
||
<span class="gtkdoc slc">// Draw a red rectangle, as wide as the paper (inside the margins)</span>
|
||
<span class="function">cairo_set_source_rgb</span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> <span class="number">1.0</span><span class="gtkdoc opt">,</span> <span class="number">0</span><span class="gtkdoc opt">,</span> <span class="number">0</span><span class="gtkdoc opt">);</span>
|
||
<span class="function">cairo_rectangle</span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> <span class="number">0</span><span class="gtkdoc opt">,</span> <span class="number">0</span><span class="gtkdoc opt">,</span> <span class="function"><a href="GtkPrintContext.html#gtk-print-context-get-width">gtk_print_context_get_width</a></span> <span class="gtkdoc opt">(</span>context<span class="gtkdoc opt">),</span> <span class="number">50</span><span class="gtkdoc opt">);</span>
|
||
|
||
<span class="function">cairo_fill</span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">);</span>
|
||
|
||
<span class="gtkdoc slc">// Draw some lines</span>
|
||
<span class="function">cairo_move_to</span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> <span class="number">20</span><span class="gtkdoc opt">,</span> <span class="number">10</span><span class="gtkdoc opt">);</span>
|
||
<span class="function">cairo_line_to</span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> <span class="number">40</span><span class="gtkdoc opt">,</span> <span class="number">20</span><span class="gtkdoc opt">);</span>
|
||
<span class="function">cairo_arc</span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> <span class="number">60</span><span class="gtkdoc opt">,</span> <span class="number">60</span><span class="gtkdoc opt">,</span> <span class="number">20</span><span class="gtkdoc opt">,</span> <span class="number">0</span><span class="gtkdoc opt">,</span> M_PI<span class="gtkdoc opt">);</span>
|
||
<span class="function">cairo_line_to</span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> <span class="number">80</span><span class="gtkdoc opt">,</span> <span class="number">20</span><span class="gtkdoc opt">);</span>
|
||
|
||
<span class="function">cairo_set_source_rgb</span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> <span class="number">0</span><span class="gtkdoc opt">,</span> <span class="number">0</span><span class="gtkdoc opt">,</span> <span class="number">0</span><span class="gtkdoc opt">);</span>
|
||
<span class="function">cairo_set_line_width</span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> <span class="number">5</span><span class="gtkdoc opt">);</span>
|
||
<span class="function">cairo_set_line_cap</span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> CAIRO_LINE_CAP_ROUND<span class="gtkdoc opt">);</span>
|
||
<span class="function">cairo_set_line_join</span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> CAIRO_LINE_JOIN_ROUND<span class="gtkdoc opt">);</span>
|
||
|
||
<span class="function">cairo_stroke</span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">);</span>
|
||
|
||
<span class="gtkdoc slc">// Draw some text</span>
|
||
layout <span class="gtkdoc opt">=</span> <span class="function">gtk_print_context_create_layout</span> <span class="gtkdoc opt">(</span>context<span class="gtkdoc opt">);</span>
|
||
<span class="function"><a href="../pango/pango-Layout-Objects.html#pango-layout-set-text">pango_layout_set_text</a></span> <span class="gtkdoc opt">(</span>layout<span class="gtkdoc opt">,</span> <span class="string">"Hello World! Printing is easy"</span><span class="gtkdoc opt">, -</span><span class="number">1</span><span class="gtkdoc opt">);</span>
|
||
desc <span class="gtkdoc opt">=</span> <span class="function"><a href="../pango/pango-Fonts.html#pango-font-description-from-string">pango_font_description_from_string</a></span> <span class="gtkdoc opt">(</span><span class="string">"sans 28"</span><span class="gtkdoc opt">);</span>
|
||
<span class="function"><a href="../pango/pango-Layout-Objects.html#pango-layout-set-font-description">pango_layout_set_font_description</a></span> <span class="gtkdoc opt">(</span>layout<span class="gtkdoc opt">,</span> desc<span class="gtkdoc opt">);</span>
|
||
<span class="function"><a href="../pango/pango-Fonts.html#pango-font-description-free">pango_font_description_free</a></span> <span class="gtkdoc opt">(</span>desc<span class="gtkdoc opt">);</span>
|
||
|
||
<span class="function">cairo_move_to</span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> <span class="number">30</span><span class="gtkdoc opt">,</span> <span class="number">20</span><span class="gtkdoc opt">);</span>
|
||
<span class="function"><a href="../pango/pango-Cairo-Rendering.html#pango-cairo-layout-path">pango_cairo_layout_path</a></span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> layout<span class="gtkdoc opt">);</span>
|
||
|
||
<span class="gtkdoc slc">// Font Outline</span>
|
||
<span class="function">cairo_set_source_rgb</span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> <span class="number">0.93</span><span class="gtkdoc opt">,</span> <span class="number">1.0</span><span class="gtkdoc opt">,</span> <span class="number">0.47</span><span class="gtkdoc opt">);</span>
|
||
<span class="function">cairo_set_line_width</span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> <span class="number">0.5</span><span class="gtkdoc opt">);</span>
|
||
<span class="function">cairo_stroke_preserve</span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">);</span>
|
||
|
||
<span class="gtkdoc slc">// Font Fill</span>
|
||
<span class="function">cairo_set_source_rgb</span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> <span class="number">0</span><span class="gtkdoc opt">,</span> <span class="number">0.0</span><span class="gtkdoc opt">,</span> <span class="number">1.0</span><span class="gtkdoc opt">);</span>
|
||
<span class="function">cairo_fill</span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">);</span>
|
||
|
||
<span class="function"><a href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span> <span class="gtkdoc opt">(</span>layout<span class="gtkdoc opt">);</span>
|
||
<span class="gtkdoc opt">}</span></pre></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
<p></p>
|
||
<p>Printing support was added in GTK+ 2.10.</p>
|
||
</div>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="GtkPrintContext.functions_details"></a><h2>Functions</h2>
|
||
<div class="refsect2">
|
||
<a name="gtk-print-context-get-cairo-context"></a><h3>gtk_print_context_get_cairo_context ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">cairo_t</span> *
|
||
gtk_print_context_get_cairo_context (<em class="parameter"><code><a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a> *context</code></em>);</pre>
|
||
<p>Obtains the cairo context that is associated with the
|
||
<a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a>.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-get-cairo-context.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>context</p></td>
|
||
<td class="parameter_description"><p>a <a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-get-cairo-context.returns"></a><h4>Returns</h4>
|
||
<p> the cairo context of <em class="parameter"><code>context</code></em>
|
||
. </p>
|
||
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
|
||
</div>
|
||
<p class="since">Since: 2.10</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-print-context-set-cairo-context"></a><h3>gtk_print_context_set_cairo_context ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_print_context_set_cairo_context (<em class="parameter"><code><a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a> *context</code></em>,
|
||
<em class="parameter"><code><span class="type">cairo_t</span> *cr</code></em>,
|
||
<em class="parameter"><code><span class="type">double</span> dpi_x</code></em>,
|
||
<em class="parameter"><code><span class="type">double</span> dpi_y</code></em>);</pre>
|
||
<p>Sets a new cairo context on a print context. </p>
|
||
<p>This function is intended to be used when implementing
|
||
an internal print preview, it is not needed for printing,
|
||
since GTK+ itself creates a suitable cairo context in that
|
||
case.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-set-cairo-context.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>context</p></td>
|
||
<td class="parameter_description"><p>a <a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>cr</p></td>
|
||
<td class="parameter_description"><p>the cairo context</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>dpi_x</p></td>
|
||
<td class="parameter_description"><p>the horizontal resolution to use with <em class="parameter"><code>cr</code></em>
|
||
</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>dpi_y</p></td>
|
||
<td class="parameter_description"><p>the vertical resolution to use with <em class="parameter"><code>cr</code></em>
|
||
</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<p class="since">Since: 2.10</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-print-context-get-page-setup"></a><h3>gtk_print_context_get_page_setup ()</h3>
|
||
<pre class="programlisting"><a class="link" href="GtkPageSetup.html" title="GtkPageSetup"><span class="returnvalue">GtkPageSetup</span></a> *
|
||
gtk_print_context_get_page_setup (<em class="parameter"><code><a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a> *context</code></em>);</pre>
|
||
<p>Obtains the <a class="link" href="GtkPageSetup.html" title="GtkPageSetup"><span class="type">GtkPageSetup</span></a> that determines the page
|
||
dimensions of the <a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a>.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-get-page-setup.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>context</p></td>
|
||
<td class="parameter_description"><p>a <a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-get-page-setup.returns"></a><h4>Returns</h4>
|
||
<p> the page setup of <em class="parameter"><code>context</code></em>
|
||
. </p>
|
||
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
|
||
</div>
|
||
<p class="since">Since: 2.10</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-print-context-get-width"></a><h3>gtk_print_context_get_width ()</h3>
|
||
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a>
|
||
gtk_print_context_get_width (<em class="parameter"><code><a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a> *context</code></em>);</pre>
|
||
<p>Obtains the width of the <a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a>, in pixels.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-get-width.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>context</p></td>
|
||
<td class="parameter_description"><p>a <a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-get-width.returns"></a><h4>Returns</h4>
|
||
<p> the width of <em class="parameter"><code>context</code></em>
|
||
</p>
|
||
</div>
|
||
<p class="since">Since: 2.10</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-print-context-get-height"></a><h3>gtk_print_context_get_height ()</h3>
|
||
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a>
|
||
gtk_print_context_get_height (<em class="parameter"><code><a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a> *context</code></em>);</pre>
|
||
<p>Obtains the height of the <a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a>, in pixels.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-get-height.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>context</p></td>
|
||
<td class="parameter_description"><p>a <a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-get-height.returns"></a><h4>Returns</h4>
|
||
<p> the height of <em class="parameter"><code>context</code></em>
|
||
</p>
|
||
</div>
|
||
<p class="since">Since: 2.10</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-print-context-get-dpi-x"></a><h3>gtk_print_context_get_dpi_x ()</h3>
|
||
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a>
|
||
gtk_print_context_get_dpi_x (<em class="parameter"><code><a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a> *context</code></em>);</pre>
|
||
<p>Obtains the horizontal resolution of the <a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a>,
|
||
in dots per inch.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-get-dpi-x.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>context</p></td>
|
||
<td class="parameter_description"><p>a <a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-get-dpi-x.returns"></a><h4>Returns</h4>
|
||
<p> the horizontal resolution of <em class="parameter"><code>context</code></em>
|
||
</p>
|
||
</div>
|
||
<p class="since">Since: 2.10</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-print-context-get-dpi-y"></a><h3>gtk_print_context_get_dpi_y ()</h3>
|
||
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a>
|
||
gtk_print_context_get_dpi_y (<em class="parameter"><code><a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a> *context</code></em>);</pre>
|
||
<p>Obtains the vertical resolution of the <a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a>,
|
||
in dots per inch.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-get-dpi-y.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>context</p></td>
|
||
<td class="parameter_description"><p>a <a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-get-dpi-y.returns"></a><h4>Returns</h4>
|
||
<p> the vertical resolution of <em class="parameter"><code>context</code></em>
|
||
</p>
|
||
</div>
|
||
<p class="since">Since: 2.10</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-print-context-get-pango-fontmap"></a><h3>gtk_print_context_get_pango_fontmap ()</h3>
|
||
<pre class="programlisting"><a href="../pango/pango-Fonts.html#PangoFontMap-struct"><span class="returnvalue">PangoFontMap</span></a> *
|
||
gtk_print_context_get_pango_fontmap (<em class="parameter"><code><a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a> *context</code></em>);</pre>
|
||
<p>Returns a <a href="../pango/pango-Fonts.html#PangoFontMap-struct"><span class="type">PangoFontMap</span></a> that is suitable for use
|
||
with the <a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a>.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-get-pango-fontmap.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>context</p></td>
|
||
<td class="parameter_description"><p>a <a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-get-pango-fontmap.returns"></a><h4>Returns</h4>
|
||
<p> the font map of <em class="parameter"><code>context</code></em>
|
||
. </p>
|
||
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
|
||
</div>
|
||
<p class="since">Since: 2.10</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-print-context-create-pango-context"></a><h3>gtk_print_context_create_pango_context ()</h3>
|
||
<pre class="programlisting"><a href="../pango/pango-Text-Processing.html#PangoContext-struct"><span class="returnvalue">PangoContext</span></a> *
|
||
gtk_print_context_create_pango_context
|
||
(<em class="parameter"><code><a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a> *context</code></em>);</pre>
|
||
<p>Creates a new <a href="../pango/pango-Text-Processing.html#PangoContext-struct"><span class="type">PangoContext</span></a> that can be used with the
|
||
<a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a>.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-create-pango-context.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>context</p></td>
|
||
<td class="parameter_description"><p>a <a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-create-pango-context.returns"></a><h4>Returns</h4>
|
||
<p> a new Pango context for <em class="parameter"><code>context</code></em>
|
||
. </p>
|
||
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
|
||
</div>
|
||
<p class="since">Since: 2.10</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-print-context-create-pango-layout"></a><h3>gtk_print_context_create_pango_layout ()</h3>
|
||
<pre class="programlisting"><a href="../pango/pango-Layout-Objects.html#PangoLayout-struct"><span class="returnvalue">PangoLayout</span></a> *
|
||
gtk_print_context_create_pango_layout (<em class="parameter"><code><a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a> *context</code></em>);</pre>
|
||
<p>Creates a new <a href="../pango/pango-Layout-Objects.html#PangoLayout-struct"><span class="type">PangoLayout</span></a> that is suitable for use
|
||
with the <a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a>.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-create-pango-layout.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>context</p></td>
|
||
<td class="parameter_description"><p>a <a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-create-pango-layout.returns"></a><h4>Returns</h4>
|
||
<p> a new Pango layout for <em class="parameter"><code>context</code></em>
|
||
. </p>
|
||
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
|
||
</div>
|
||
<p class="since">Since: 2.10</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-print-context-get-hard-margins"></a><h3>gtk_print_context_get_hard_margins ()</h3>
|
||
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
|
||
gtk_print_context_get_hard_margins (<em class="parameter"><code><a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a> *context</code></em>,
|
||
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *top</code></em>,
|
||
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *bottom</code></em>,
|
||
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *left</code></em>,
|
||
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *right</code></em>);</pre>
|
||
<p>Obtains the hardware printer margins of the <a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a>, in units.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-get-hard-margins.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>context</p></td>
|
||
<td class="parameter_description"><p>a <a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>top</p></td>
|
||
<td class="parameter_description"><p> top hardware printer margin. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>bottom</p></td>
|
||
<td class="parameter_description"><p> bottom hardware printer margin. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>left</p></td>
|
||
<td class="parameter_description"><p> left hardware printer margin. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>right</p></td>
|
||
<td class="parameter_description"><p> right hardware printer margin. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-print-context-get-hard-margins.returns"></a><h4>Returns</h4>
|
||
<p> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the hard margins were retrieved</p>
|
||
</div>
|
||
<p class="since">Since: 2.20</p>
|
||
</div>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="GtkPrintContext.other_details"></a><h2>Types and Values</h2>
|
||
<div class="refsect2">
|
||
<a name="GtkPrintContext-struct"></a><h3>GtkPrintContext</h3>
|
||
<pre class="programlisting">typedef struct _GtkPrintContext GtkPrintContext;</pre>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="footer">
|
||
<hr>Generated by GTK-Doc V1.25.1</div>
|
||
</body>
|
||
</html> |