New upstream version 3.24.14
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
<link rel="up" href="Printing.html" title="Printing">
|
||||
<link rel="prev" href="Printing.html" title="Printing">
|
||||
<link rel="next" href="GtkPrintContext.html" title="GtkPrintContext">
|
||||
<meta name="generator" content="GTK-Doc V1.29 (XML mode)">
|
||||
<meta name="generator" content="GTK-Doc V1.32.1 (XML mode)">
|
||||
<link rel="stylesheet" href="style.css" type="text/css">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
@ -41,8 +41,8 @@
|
||||
<a name="gtk3-High-level-Printing-API.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">
|
||||
<col width="150px" class="functions_proto_type">
|
||||
<col class="functions_proto_name">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
@ -183,7 +183,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="function_type">
|
||||
<a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperationResult" title="enum GtkPrintOperationResult"><span class="returnvalue">GtkPrintOperationResult</span></a>
|
||||
<a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GtkPrintOperationResult"><span class="returnvalue">GtkPrintOperationResult</span></a>
|
||||
</td>
|
||||
<td class="function_name">
|
||||
<a class="link" href="gtk3-High-level-Printing-API.html#gtk-print-operation-run" title="gtk_print_operation_run ()">gtk_print_operation_run</a> <span class="c_punctuation">()</span>
|
||||
@ -215,7 +215,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="function_type">
|
||||
<a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintStatus" title="enum GtkPrintStatus"><span class="returnvalue">GtkPrintStatus</span></a>
|
||||
<a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GtkPrintStatus"><span class="returnvalue">GtkPrintStatus</span></a>
|
||||
</td>
|
||||
<td class="function_name">
|
||||
<a class="link" href="gtk3-High-level-Printing-API.html#gtk-print-operation-get-status" title="gtk_print_operation_get_status ()">gtk_print_operation_get_status</a> <span class="c_punctuation">()</span>
|
||||
@ -410,7 +410,7 @@
|
||||
<td class="property_flags">Read / Write</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="property_type"><a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintStatus" title="enum GtkPrintStatus"><span class="type">GtkPrintStatus</span></a></td>
|
||||
<td class="property_type"><a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GtkPrintStatus"><span class="type">GtkPrintStatus</span></a></td>
|
||||
<td class="property_name"><a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation--status" title="The “status” property">status</a></td>
|
||||
<td class="property_flags">Read</td>
|
||||
</tr>
|
||||
@ -431,7 +431,7 @@
|
||||
<td class="property_flags">Read / Write</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="property_type"><a class="link" href="GtkPaperSize.html#GtkUnit" title="enum GtkUnit"><span class="type">GtkUnit</span></a></td>
|
||||
<td class="property_type"><a href="https://developer.gnome.org/gtk4/GtkPaperSize.html#GtkUnit"><span class="type">GtkUnit</span></a></td>
|
||||
<td class="property_name"><a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation--unit" title="The “unit” property">unit</a></td>
|
||||
<td class="property_flags">Read / Write</td>
|
||||
</tr>
|
||||
@ -447,9 +447,9 @@
|
||||
<a name="gtk3-High-level-Printing-API.signals"></a><h2>Signals</h2>
|
||||
<div class="informaltable"><table class="informaltable" border="0">
|
||||
<colgroup>
|
||||
<col width="150px" class="signals_return">
|
||||
<col width="300px" class="signals_name">
|
||||
<col width="200px" class="signals_flags">
|
||||
<col width="150px" class="signal_proto_type">
|
||||
<col width="300px" class="signal_proto_name">
|
||||
<col width="200px" class="signal_proto_flags">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
@ -525,41 +525,41 @@
|
||||
<a name="gtk3-High-level-Printing-API.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">
|
||||
<col width="150px" class="other_proto_type">
|
||||
<col class="other_proto_name">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="datatype_keyword">struct</td>
|
||||
<td class="function_name"><a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation-struct" title="struct GtkPrintOperation">GtkPrintOperation</a></td>
|
||||
<td class="function_name"><a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GtkPrintOperation-struct">GtkPrintOperation</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="datatype_keyword">struct</td>
|
||||
<td class="function_name"><a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperationClass" title="struct GtkPrintOperationClass">GtkPrintOperationClass</a></td>
|
||||
<td class="function_name"><a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GtkPrintOperationClass">GtkPrintOperationClass</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="datatype_keyword">enum</td>
|
||||
<td class="function_name"><a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintStatus" title="enum GtkPrintStatus">GtkPrintStatus</a></td>
|
||||
<td class="function_name"><a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GtkPrintStatus">GtkPrintStatus</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="datatype_keyword">enum</td>
|
||||
<td class="function_name"><a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperationAction" title="enum GtkPrintOperationAction">GtkPrintOperationAction</a></td>
|
||||
<td class="function_name"><a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GtkPrintOperationAction">GtkPrintOperationAction</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="datatype_keyword">enum</td>
|
||||
<td class="function_name"><a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperationResult" title="enum GtkPrintOperationResult">GtkPrintOperationResult</a></td>
|
||||
<td class="function_name"><a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GtkPrintOperationResult">GtkPrintOperationResult</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="datatype_keyword">enum</td>
|
||||
<td class="function_name"><a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintError" title="enum GtkPrintError">GtkPrintError</a></td>
|
||||
<td class="function_name"><a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GtkPrintError">GtkPrintError</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="define_keyword">#define</td>
|
||||
<td class="function_name"><a class="link" href="gtk3-High-level-Printing-API.html#GTK-PRINT-ERROR:CAPS" title="GTK_PRINT_ERROR">GTK_PRINT_ERROR</a></td>
|
||||
<td class="function_name"><a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GTK-PRINT-ERROR:CAPS">GTK_PRINT_ERROR</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="datatype_keyword"> </td>
|
||||
<td class="function_name"><a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperationPreview-struct" title="GtkPrintOperationPreview">GtkPrintOperationPreview</a></td>
|
||||
<td class="function_name"><a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GtkPrintOperationPreview-struct">GtkPrintOperationPreview</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
@ -649,34 +649,34 @@ and render the page on the provided <a class="link" href="GtkPrintContext.html"
|
||||
26
|
||||
27
|
||||
28</pre></td>
|
||||
<td class="listing_code"><pre class="programlisting"><span class="keyword">static</span><span class="normal"> </span><span class="usertype">GtkPrintSettings</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">settings </span><span class="symbol">=</span><span class="normal"> NULL</span><span class="symbol">;</span>
|
||||
<td class="listing_code"><pre class="programlisting"><span class="k">static</span> <span class="n">GtkPrintSettings</span> <span class="o">*</span><span class="n">settings</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
|
||||
|
||||
<span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
|
||||
<span class="function">do_print</span><span class="normal"> </span><span class="symbol">(</span><span class="type">void</span><span class="symbol">)</span>
|
||||
<span class="cbracket">{</span>
|
||||
<span class="normal"> </span><span class="usertype">GtkPrintOperation</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">print</span><span class="symbol">;</span>
|
||||
<span class="normal"> </span><span class="usertype">GtkPrintOperationResult</span><span class="normal"> res</span><span class="symbol">;</span>
|
||||
<span class="k">static</span> <span class="kt">void</span>
|
||||
<span class="nf">do_print</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
|
||||
<span class="p">{</span>
|
||||
<span class="n">GtkPrintOperation</span> <span class="o">*</span><span class="n">print</span><span class="p">;</span>
|
||||
<span class="n">GtkPrintOperationResult</span> <span class="n">res</span><span class="p">;</span>
|
||||
|
||||
<span class="normal"> print </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gtk3-High-level-Printing-API.html#gtk-print-operation-new">gtk_print_operation_new</a></span><span class="normal"> </span><span class="symbol">();</span>
|
||||
<span class="n">print</span> <span class="o">=</span> <span class="n">gtk_print_operation_new</span> <span class="p">();</span>
|
||||
|
||||
<span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">settings </span><span class="symbol">!=</span><span class="normal"> NULL</span><span class="symbol">)</span>
|
||||
<span class="normal"> </span><span class="function"><a href="gtk3-High-level-Printing-API.html#gtk-print-operation-set-print-settings">gtk_print_operation_set_print_settings</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">print</span><span class="symbol">,</span><span class="normal"> settings</span><span class="symbol">);</span>
|
||||
<span class="k">if</span> <span class="p">(</span><span class="n">settings</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span>
|
||||
<span class="n">gtk_print_operation_set_print_settings</span> <span class="p">(</span><span class="n">print</span><span class="p">,</span> <span class="n">settings</span><span class="p">);</span>
|
||||
|
||||
<span class="normal"> </span><span class="function">g_signal_connect</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">print</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"begin_print"</span><span class="symbol">,</span><span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">begin_print</span><span class="symbol">),</span><span class="normal"> NULL</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span><span class="function">g_signal_connect</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">print</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"draw_page"</span><span class="symbol">,</span><span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">draw_page</span><span class="symbol">),</span><span class="normal"> NULL</span><span class="symbol">);</span>
|
||||
<span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">print</span><span class="p">,</span> <span class="s">"begin_print"</span><span class="p">,</span> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">begin_print</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
|
||||
<span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">print</span><span class="p">,</span> <span class="s">"draw_page"</span><span class="p">,</span> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">draw_page</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
|
||||
|
||||
<span class="normal"> res </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gtk3-High-level-Printing-API.html#gtk-print-operation-run">gtk_print_operation_run</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">print</span><span class="symbol">,</span><span class="normal"> <a href="gtk3-High-level-Printing-API.html#GTK-PRINT-OPERATION-ACTION-PRINT-DIALOG:CAPS">GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG</a></span><span class="symbol">,</span>
|
||||
<span class="normal"> </span><span class="function">GTK_WINDOW</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">main_window</span><span class="symbol">),</span><span class="normal"> NULL</span><span class="symbol">);</span>
|
||||
<span class="n">res</span> <span class="o">=</span> <span class="n">gtk_print_operation_run</span> <span class="p">(</span><span class="n">print</span><span class="p">,</span> <span class="n">GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG</span><span class="p">,</span>
|
||||
<span class="n">GTK_WINDOW</span> <span class="p">(</span><span class="n">main_window</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
|
||||
|
||||
<span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">res </span><span class="symbol">==</span><span class="normal"> <a href="gtk3-High-level-Printing-API.html#GTK-PRINT-OPERATION-RESULT-APPLY:CAPS">GTK_PRINT_OPERATION_RESULT_APPLY</a></span><span class="symbol">)</span>
|
||||
<span class="normal"> </span><span class="cbracket">{</span>
|
||||
<span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">settings </span><span class="symbol">!=</span><span class="normal"> NULL</span><span class="symbol">)</span>
|
||||
<span class="normal"> </span><span class="function">g_object_unref</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">settings</span><span class="symbol">);</span>
|
||||
<span class="normal"> settings </span><span class="symbol">=</span><span class="normal"> </span><span class="function">g_object_ref</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="gtk3-High-level-Printing-API.html#gtk-print-operation-get-print-settings">gtk_print_operation_get_print_settings</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">print</span><span class="symbol">));</span>
|
||||
<span class="normal"> </span><span class="cbracket">}</span>
|
||||
<span class="k">if</span> <span class="p">(</span><span class="n">res</span> <span class="o">==</span> <span class="n">GTK_PRINT_OPERATION_RESULT_APPLY</span><span class="p">)</span>
|
||||
<span class="p">{</span>
|
||||
<span class="k">if</span> <span class="p">(</span><span class="n">settings</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span>
|
||||
<span class="n">g_object_unref</span> <span class="p">(</span><span class="n">settings</span><span class="p">);</span>
|
||||
<span class="n">settings</span> <span class="o">=</span> <span class="n">g_object_ref</span> <span class="p">(</span><span class="n">gtk_print_operation_get_print_settings</span> <span class="p">(</span><span class="n">print</span><span class="p">));</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="normal"> </span><span class="function">g_object_unref</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">print</span><span class="symbol">);</span>
|
||||
<span class="cbracket">}</span></pre></td>
|
||||
<span class="n">g_object_unref</span> <span class="p">(</span><span class="n">print</span><span class="p">);</span>
|
||||
<span class="p">}</span></pre></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -745,7 +745,7 @@ some platforms may not allow asynchronous operation.</p>
|
||||
gtk_print_operation_get_error (<em class="parameter"><code><a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation"><span class="type">GtkPrintOperation</span></a> *op</code></em>,
|
||||
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
|
||||
<p>Call this when the result of a print operation is
|
||||
<a class="link" href="gtk3-High-level-Printing-API.html#GTK-PRINT-OPERATION-RESULT-ERROR:CAPS"><code class="literal">GTK_PRINT_OPERATION_RESULT_ERROR</code></a>, either as returned by
|
||||
<a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GTK-PRINT-OPERATION-RESULT-ERROR:CAPS"><code class="literal">GTK_PRINT_OPERATION_RESULT_ERROR</code></a>, either as returned by
|
||||
<a class="link" href="gtk3-High-level-Printing-API.html#gtk-print-operation-run" title="gtk_print_operation_run ()"><code class="function">gtk_print_operation_run()</code></a>, or in the <a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation-done" title="The “done” signal"><span class="type">“done”</span></a> signal
|
||||
handler. The returned <span class="type">GError</span> will contain more details on what went wrong.</p>
|
||||
<div class="refsect3">
|
||||
@ -989,11 +989,11 @@ gtk_print_operation_get_n_pages_to_print
|
||||
(<em class="parameter"><code><a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation"><span class="type">GtkPrintOperation</span></a> *op</code></em>);</pre>
|
||||
<p>Returns the number of pages that will be printed.</p>
|
||||
<p>Note that this value is set during print preparation phase
|
||||
(<a class="link" href="gtk3-High-level-Printing-API.html#GTK-PRINT-STATUS-PREPARING:CAPS"><code class="literal">GTK_PRINT_STATUS_PREPARING</code></a>), so this function should never be
|
||||
called before the data generation phase (<a class="link" href="gtk3-High-level-Printing-API.html#GTK-PRINT-STATUS-GENERATING-DATA:CAPS"><code class="literal">GTK_PRINT_STATUS_GENERATING_DATA</code></a>).
|
||||
(<a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GTK-PRINT-STATUS-PREPARING:CAPS"><code class="literal">GTK_PRINT_STATUS_PREPARING</code></a>), so this function should never be
|
||||
called before the data generation phase (<a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GTK-PRINT-STATUS-GENERATING-DATA:CAPS"><code class="literal">GTK_PRINT_STATUS_GENERATING_DATA</code></a>).
|
||||
You can connect to the <a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation-status-changed" title="The “status-changed” signal"><span class="type">“status-changed”</span></a> signal
|
||||
and call <a class="link" href="gtk3-High-level-Printing-API.html#gtk-print-operation-get-n-pages-to-print" title="gtk_print_operation_get_n_pages_to_print ()"><code class="function">gtk_print_operation_get_n_pages_to_print()</code></a> when
|
||||
print status is <a class="link" href="gtk3-High-level-Printing-API.html#GTK-PRINT-STATUS-GENERATING-DATA:CAPS"><code class="literal">GTK_PRINT_STATUS_GENERATING_DATA</code></a>.
|
||||
print status is <a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GTK-PRINT-STATUS-GENERATING-DATA:CAPS"><code class="literal">GTK_PRINT_STATUS_GENERATING_DATA</code></a>.
|
||||
This is typically used to track the progress of print operation.</p>
|
||||
<div class="refsect3">
|
||||
<a name="gtk-print-operation-get-n-pages-to-print.parameters"></a><h4>Parameters</h4>
|
||||
@ -1092,7 +1092,7 @@ imageable area (i.e. inside the margins).</p>
|
||||
<a name="gtk-print-operation-set-unit"></a><h3>gtk_print_operation_set_unit ()</h3>
|
||||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||||
gtk_print_operation_set_unit (<em class="parameter"><code><a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation"><span class="type">GtkPrintOperation</span></a> *op</code></em>,
|
||||
<em class="parameter"><code><a class="link" href="GtkPaperSize.html#GtkUnit" title="enum GtkUnit"><span class="type">GtkUnit</span></a> unit</code></em>);</pre>
|
||||
<em class="parameter"><code><a href="https://developer.gnome.org/gtk4/GtkPaperSize.html#GtkUnit"><span class="type">GtkUnit</span></a> unit</code></em>);</pre>
|
||||
<p>Sets up the transformation for the cairo context obtained from
|
||||
<a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a> in such a way that distances are measured in
|
||||
units of <em class="parameter"><code>unit</code></em>
|
||||
@ -1264,9 +1264,9 @@ gtk_print_operation_set_custom_tab_label
|
||||
<hr>
|
||||
<div class="refsect2">
|
||||
<a name="gtk-print-operation-run"></a><h3>gtk_print_operation_run ()</h3>
|
||||
<pre class="programlisting"><a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperationResult" title="enum GtkPrintOperationResult"><span class="returnvalue">GtkPrintOperationResult</span></a>
|
||||
<pre class="programlisting"><a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GtkPrintOperationResult"><span class="returnvalue">GtkPrintOperationResult</span></a>
|
||||
gtk_print_operation_run (<em class="parameter"><code><a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation"><span class="type">GtkPrintOperation</span></a> *op</code></em>,
|
||||
<em class="parameter"><code><a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperationAction" title="enum GtkPrintOperationAction"><span class="type">GtkPrintOperationAction</span></a> action</code></em>,
|
||||
<em class="parameter"><code><a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GtkPrintOperationAction"><span class="type">GtkPrintOperationAction</span></a> action</code></em>,
|
||||
<em class="parameter"><code><a class="link" href="GtkWindow.html" title="GtkWindow"><span class="type">GtkWindow</span></a> *parent</code></em>,
|
||||
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
|
||||
<p>Runs the print operation, by first letting the user modify
|
||||
@ -1322,41 +1322,41 @@ the print succeeds or fails).</p>
|
||||
33
|
||||
34
|
||||
35</pre></td>
|
||||
<td class="listing_code"><pre class="programlisting"><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">settings </span><span class="symbol">!=</span><span class="normal"> NULL</span><span class="symbol">)</span>
|
||||
<span class="normal"> </span><span class="function"><a href="gtk3-High-level-Printing-API.html#gtk-print-operation-set-print-settings">gtk_print_operation_set_print_settings</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">print</span><span class="symbol">,</span><span class="normal"> settings</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span>
|
||||
<span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">page_setup </span><span class="symbol">!=</span><span class="normal"> NULL</span><span class="symbol">)</span>
|
||||
<span class="normal"> </span><span class="function"><a href="gtk3-High-level-Printing-API.html#gtk-print-operation-set-default-page-setup">gtk_print_operation_set_default_page_setup</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">print</span><span class="symbol">,</span><span class="normal"> page_setup</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span>
|
||||
<span class="function">g_signal_connect</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">print</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"begin-print"</span><span class="symbol">,</span><span class="normal"> </span>
|
||||
<span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">begin_print</span><span class="symbol">),</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">data</span><span class="symbol">);</span>
|
||||
<span class="function">g_signal_connect</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">print</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"draw-page"</span><span class="symbol">,</span><span class="normal"> </span>
|
||||
<span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">draw_page</span><span class="symbol">),</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">data</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span>
|
||||
<span class="normal">res </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gtk3-High-level-Printing-API.html#gtk-print-operation-run">gtk_print_operation_run</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">print</span><span class="symbol">,</span><span class="normal"> </span>
|
||||
<span class="normal"> GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG</span><span class="symbol">,</span><span class="normal"> </span>
|
||||
<span class="normal"> parent</span><span class="symbol">,</span><span class="normal"> </span>
|
||||
<span class="normal"> </span><span class="symbol">&</span><span class="normal">error</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span>
|
||||
<span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">res </span><span class="symbol">==</span><span class="normal"> <a href="gtk3-High-level-Printing-API.html#GTK-PRINT-OPERATION-RESULT-ERROR:CAPS">GTK_PRINT_OPERATION_RESULT_ERROR</a></span><span class="symbol">)</span>
|
||||
<span class="normal"> </span><span class="cbracket">{</span>
|
||||
<span class="normal"> error_dialog </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkMessageDialog.html#gtk-message-dialog-new">gtk_message_dialog_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_WINDOW</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">parent</span><span class="symbol">),</span>
|
||||
<span class="normal"> <a href="GtkDialog.html#GTK-DIALOG-DESTROY-WITH-PARENT:CAPS">GTK_DIALOG_DESTROY_WITH_PARENT</a></span><span class="symbol">,</span>
|
||||
<span class="normal"> <a href="GtkMessageDialog.html#GTK-MESSAGE-ERROR:CAPS">GTK_MESSAGE_ERROR</a></span><span class="symbol">,</span>
|
||||
<span class="normal"> <a href="GtkMessageDialog.html#GTK-BUTTONS-CLOSE:CAPS">GTK_BUTTONS_CLOSE</a></span><span class="symbol">,</span>
|
||||
<span class="normal"> </span><span class="string">"Error printing file:</span><span class="specialchar">\n</span><span class="string">%s"</span><span class="symbol">,</span>
|
||||
<span class="normal"> error</span><span class="symbol">-></span><span class="normal">message</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span><span class="function">g_signal_connect</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">error_dialog</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"response"</span><span class="symbol">,</span><span class="normal"> </span>
|
||||
<span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="GtkWidget.html#gtk-widget-destroy">gtk_widget_destroy</a></span><span class="symbol">),</span><span class="normal"> NULL</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span><span class="function"><a href="GtkWidget.html#gtk-widget-show">gtk_widget_show</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">error_dialog</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span><span class="function">g_error_free</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">error</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span><span class="cbracket">}</span>
|
||||
<span class="keyword">else</span><span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">res </span><span class="symbol">==</span><span class="normal"> <a href="gtk3-High-level-Printing-API.html#GTK-PRINT-OPERATION-RESULT-APPLY:CAPS">GTK_PRINT_OPERATION_RESULT_APPLY</a></span><span class="symbol">)</span>
|
||||
<span class="normal"> </span><span class="cbracket">{</span>
|
||||
<span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">settings </span><span class="symbol">!=</span><span class="normal"> NULL</span><span class="symbol">)</span>
|
||||
<span class="function">g_object_unref</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">settings</span><span class="symbol">);</span>
|
||||
<span class="normal"> settings </span><span class="symbol">=</span><span class="normal"> </span><span class="function">g_object_ref</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="gtk3-High-level-Printing-API.html#gtk-print-operation-get-print-settings">gtk_print_operation_get_print_settings</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">print</span><span class="symbol">));</span>
|
||||
<span class="normal"> </span><span class="cbracket">}</span></pre></td>
|
||||
<td class="listing_code"><pre class="programlisting"><span class="k">if</span> <span class="p">(</span><span class="n">settings</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span>
|
||||
<span class="n">gtk_print_operation_set_print_settings</span> <span class="p">(</span><span class="n">print</span><span class="p">,</span> <span class="n">settings</span><span class="p">);</span>
|
||||
|
||||
<span class="k">if</span> <span class="p">(</span><span class="n">page_setup</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span>
|
||||
<span class="n">gtk_print_operation_set_default_page_setup</span> <span class="p">(</span><span class="n">print</span><span class="p">,</span> <span class="n">page_setup</span><span class="p">);</span>
|
||||
|
||||
<span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">print</span><span class="p">,</span> <span class="s">"begin-print"</span><span class="p">,</span>
|
||||
<span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">begin_print</span><span class="p">),</span> <span class="o">&</span><span class="n">data</span><span class="p">);</span>
|
||||
<span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">print</span><span class="p">,</span> <span class="s">"draw-page"</span><span class="p">,</span>
|
||||
<span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">draw_page</span><span class="p">),</span> <span class="o">&</span><span class="n">data</span><span class="p">);</span>
|
||||
|
||||
<span class="n">res</span> <span class="o">=</span> <span class="n">gtk_print_operation_run</span> <span class="p">(</span><span class="n">print</span><span class="p">,</span>
|
||||
<span class="n">GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG</span><span class="p">,</span>
|
||||
<span class="n">parent</span><span class="p">,</span>
|
||||
<span class="o">&</span><span class="n">error</span><span class="p">);</span>
|
||||
|
||||
<span class="k">if</span> <span class="p">(</span><span class="n">res</span> <span class="o">==</span> <span class="n">GTK_PRINT_OPERATION_RESULT_ERROR</span><span class="p">)</span>
|
||||
<span class="p">{</span>
|
||||
<span class="n">error_dialog</span> <span class="o">=</span> <span class="n">gtk_message_dialog_new</span> <span class="p">(</span><span class="n">GTK_WINDOW</span> <span class="p">(</span><span class="n">parent</span><span class="p">),</span>
|
||||
<span class="n">GTK_DIALOG_DESTROY_WITH_PARENT</span><span class="p">,</span>
|
||||
<span class="n">GTK_MESSAGE_ERROR</span><span class="p">,</span>
|
||||
<span class="n">GTK_BUTTONS_CLOSE</span><span class="p">,</span>
|
||||
<span class="s">"Error printing file:</span><span class="se">\n</span><span class="s">%s"</span><span class="p">,</span>
|
||||
<span class="n">error</span><span class="o">-></span><span class="n">message</span><span class="p">);</span>
|
||||
<span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">error_dialog</span><span class="p">,</span> <span class="s">"response"</span><span class="p">,</span>
|
||||
<span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">gtk_widget_destroy</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
|
||||
<span class="n">gtk_widget_show</span> <span class="p">(</span><span class="n">error_dialog</span><span class="p">);</span>
|
||||
<span class="n">g_error_free</span> <span class="p">(</span><span class="n">error</span><span class="p">);</span>
|
||||
<span class="p">}</span>
|
||||
<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">res</span> <span class="o">==</span> <span class="n">GTK_PRINT_OPERATION_RESULT_APPLY</span><span class="p">)</span>
|
||||
<span class="p">{</span>
|
||||
<span class="k">if</span> <span class="p">(</span><span class="n">settings</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span>
|
||||
<span class="n">g_object_unref</span> <span class="p">(</span><span class="n">settings</span><span class="p">);</span>
|
||||
<span class="n">settings</span> <span class="o">=</span> <span class="n">g_object_ref</span> <span class="p">(</span><span class="n">gtk_print_operation_get_print_settings</span> <span class="p">(</span><span class="n">print</span><span class="p">));</span>
|
||||
<span class="p">}</span></pre></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -1400,11 +1400,11 @@ given <a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation"
|
||||
<div class="refsect3">
|
||||
<a name="gtk-print-operation-run.returns"></a><h4>Returns</h4>
|
||||
<p> the result of the print operation. A return value of
|
||||
<a class="link" href="gtk3-High-level-Printing-API.html#GTK-PRINT-OPERATION-RESULT-APPLY:CAPS"><code class="literal">GTK_PRINT_OPERATION_RESULT_APPLY</code></a> indicates that the printing was
|
||||
<a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GTK-PRINT-OPERATION-RESULT-APPLY:CAPS"><code class="literal">GTK_PRINT_OPERATION_RESULT_APPLY</code></a> indicates that the printing was
|
||||
completed successfully. In this case, it is a good idea to obtain
|
||||
the used print settings with <a class="link" href="gtk3-High-level-Printing-API.html#gtk-print-operation-get-print-settings" title="gtk_print_operation_get_print_settings ()"><code class="function">gtk_print_operation_get_print_settings()</code></a>
|
||||
and store them for reuse with the next print operation. A value of
|
||||
<a class="link" href="gtk3-High-level-Printing-API.html#GTK-PRINT-OPERATION-RESULT-IN-PROGRESS:CAPS"><code class="literal">GTK_PRINT_OPERATION_RESULT_IN_PROGRESS</code></a> means the operation is running
|
||||
<a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GTK-PRINT-OPERATION-RESULT-IN-PROGRESS:CAPS"><code class="literal">GTK_PRINT_OPERATION_RESULT_IN_PROGRESS</code></a> means the operation is running
|
||||
asynchronously, and will emit the <a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation-done" title="The “done” signal"><span class="type">“done”</span></a> signal when
|
||||
done.</p>
|
||||
</div>
|
||||
@ -1494,7 +1494,7 @@ be used for drawing page in another thread.</p>
|
||||
<hr>
|
||||
<div class="refsect2">
|
||||
<a name="gtk-print-operation-get-status"></a><h3>gtk_print_operation_get_status ()</h3>
|
||||
<pre class="programlisting"><a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintStatus" title="enum GtkPrintStatus"><span class="returnvalue">GtkPrintStatus</span></a>
|
||||
<pre class="programlisting"><a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GtkPrintStatus"><span class="returnvalue">GtkPrintStatus</span></a>
|
||||
gtk_print_operation_get_status (<em class="parameter"><code><a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation"><span class="type">GtkPrintOperation</span></a> *op</code></em>);</pre>
|
||||
<p>Returns the status of the print operation.
|
||||
Also see <a class="link" href="gtk3-High-level-Printing-API.html#gtk-print-operation-get-status-string" title="gtk_print_operation_get_status_string ()"><code class="function">gtk_print_operation_get_status_string()</code></a>.</p>
|
||||
@ -1557,8 +1557,8 @@ of the print operation</p>
|
||||
<pre class="programlisting"><span class="returnvalue">gboolean</span>
|
||||
gtk_print_operation_is_finished (<em class="parameter"><code><a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation"><span class="type">GtkPrintOperation</span></a> *op</code></em>);</pre>
|
||||
<p>A convenience function to find out if the print operation
|
||||
is finished, either successfully (<a class="link" href="gtk3-High-level-Printing-API.html#GTK-PRINT-STATUS-FINISHED:CAPS"><code class="literal">GTK_PRINT_STATUS_FINISHED</code></a>)
|
||||
or unsuccessfully (<a class="link" href="gtk3-High-level-Printing-API.html#GTK-PRINT-STATUS-FINISHED-ABORTED:CAPS"><code class="literal">GTK_PRINT_STATUS_FINISHED_ABORTED</code></a>).</p>
|
||||
is finished, either successfully (<a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GTK-PRINT-STATUS-FINISHED:CAPS"><code class="literal">GTK_PRINT_STATUS_FINISHED</code></a>)
|
||||
or unsuccessfully (<a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GTK-PRINT-STATUS-FINISHED-ABORTED:CAPS"><code class="literal">GTK_PRINT_STATUS_FINISHED_ABORTED</code></a>).</p>
|
||||
<p>Note: when you enable print status tracking the print operation
|
||||
can be in a non-finished state even after done has been called, as
|
||||
the operation status then tracks the print job status on the printer.</p>
|
||||
@ -2009,376 +2009,13 @@ be associated with the print context.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="refsect1">
|
||||
<a name="gtk3-High-level-Printing-API.other_details"></a><h2>Types and Values</h2>
|
||||
<div class="refsect2">
|
||||
<a name="GtkPrintOperation-struct"></a><h3>struct GtkPrintOperation</h3>
|
||||
<pre class="programlisting">struct GtkPrintOperation;</pre>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="refsect2">
|
||||
<a name="GtkPrintOperationClass"></a><h3>struct GtkPrintOperationClass</h3>
|
||||
<pre class="programlisting">struct GtkPrintOperationClass {
|
||||
GObjectClass parent_class;
|
||||
|
||||
|
||||
void (*done) (GtkPrintOperation *operation,
|
||||
GtkPrintOperationResult result);
|
||||
void (*begin_print) (GtkPrintOperation *operation,
|
||||
GtkPrintContext *context);
|
||||
gboolean (*paginate) (GtkPrintOperation *operation,
|
||||
GtkPrintContext *context);
|
||||
void (*request_page_setup) (GtkPrintOperation *operation,
|
||||
GtkPrintContext *context,
|
||||
gint page_nr,
|
||||
GtkPageSetup *setup);
|
||||
void (*draw_page) (GtkPrintOperation *operation,
|
||||
GtkPrintContext *context,
|
||||
gint page_nr);
|
||||
void (*end_print) (GtkPrintOperation *operation,
|
||||
GtkPrintContext *context);
|
||||
void (*status_changed) (GtkPrintOperation *operation);
|
||||
|
||||
GtkWidget *(*create_custom_widget) (GtkPrintOperation *operation);
|
||||
void (*custom_widget_apply) (GtkPrintOperation *operation,
|
||||
GtkWidget *widget);
|
||||
|
||||
gboolean (*preview) (GtkPrintOperation *operation,
|
||||
GtkPrintOperationPreview *preview,
|
||||
GtkPrintContext *context,
|
||||
GtkWindow *parent);
|
||||
|
||||
void (*update_custom_widget) (GtkPrintOperation *operation,
|
||||
GtkWidget *widget,
|
||||
GtkPageSetup *setup,
|
||||
GtkPrintSettings *settings);
|
||||
};
|
||||
</pre>
|
||||
<div class="refsect3">
|
||||
<a name="GtkPrintOperationClass.members"></a><h4>Members</h4>
|
||||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||||
<colgroup>
|
||||
<col width="300px" class="struct_members_name">
|
||||
<col class="struct_members_description">
|
||||
<col width="200px" class="struct_members_annotations">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="struct_member_name"><p><em class="structfield"><code><a name="GtkPrintOperationClass.done"></a>done</code></em> ()</p></td>
|
||||
<td class="struct_member_description"><p>Signal emitted when the print operation run has finished
|
||||
doing everything required for printing.</p></td>
|
||||
<td class="struct_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="struct_member_name"><p><em class="structfield"><code><a name="GtkPrintOperationClass.begin-print"></a>begin_print</code></em> ()</p></td>
|
||||
<td class="struct_member_description"><p>Signal emitted after the user has finished changing
|
||||
print settings in the dialog, before the actual rendering starts.</p></td>
|
||||
<td class="struct_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="struct_member_name"><p><em class="structfield"><code><a name="GtkPrintOperationClass.paginate"></a>paginate</code></em> ()</p></td>
|
||||
<td class="struct_member_description"><p>Signal emitted after the “begin-print” signal, but
|
||||
before the actual rendering starts.</p></td>
|
||||
<td class="struct_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="struct_member_name"><p><em class="structfield"><code><a name="GtkPrintOperationClass.request-page-setup"></a>request_page_setup</code></em> ()</p></td>
|
||||
<td class="struct_member_description"><p>Emitted once for every page that is printed,
|
||||
to give the application a chance to modify the page setup.</p></td>
|
||||
<td class="struct_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="struct_member_name"><p><em class="structfield"><code><a name="GtkPrintOperationClass.draw-page"></a>draw_page</code></em> ()</p></td>
|
||||
<td class="struct_member_description"><p>Signal emitted for every page that is printed.</p></td>
|
||||
<td class="struct_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="struct_member_name"><p><em class="structfield"><code><a name="GtkPrintOperationClass.end-print"></a>end_print</code></em> ()</p></td>
|
||||
<td class="struct_member_description"><p>Signal emitted after all pages have been rendered.</p></td>
|
||||
<td class="struct_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="struct_member_name"><p><em class="structfield"><code><a name="GtkPrintOperationClass.status-changed"></a>status_changed</code></em> ()</p></td>
|
||||
<td class="struct_member_description"><p>Emitted at between the various phases of the print
|
||||
operation.</p></td>
|
||||
<td class="struct_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="struct_member_name"><p><em class="structfield"><code><a name="GtkPrintOperationClass.create-custom-widget"></a>create_custom_widget</code></em> ()</p></td>
|
||||
<td class="struct_member_description"><p>Signal emitted when displaying the print dialog.</p></td>
|
||||
<td class="struct_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="struct_member_name"><p><em class="structfield"><code><a name="GtkPrintOperationClass.custom-widget-apply"></a>custom_widget_apply</code></em> ()</p></td>
|
||||
<td class="struct_member_description"><p>Signal emitted right before “begin-print” if
|
||||
you added a custom widget in the “create-custom-widget” handler.</p></td>
|
||||
<td class="struct_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="struct_member_name"><p><em class="structfield"><code><a name="GtkPrintOperationClass.preview"></a>preview</code></em> ()</p></td>
|
||||
<td class="struct_member_description"><p>Signal emitted when a preview is requested from the
|
||||
native dialog.</p></td>
|
||||
<td class="struct_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="struct_member_name"><p><em class="structfield"><code><a name="GtkPrintOperationClass.update-custom-widget"></a>update_custom_widget</code></em> ()</p></td>
|
||||
<td class="struct_member_description"><p>Emitted after change of selected printer.</p></td>
|
||||
<td class="struct_member_annotations"> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="refsect2">
|
||||
<a name="GtkPrintStatus"></a><h3>enum GtkPrintStatus</h3>
|
||||
<p>The status gives a rough indication of the completion of a running
|
||||
print operation.</p>
|
||||
<div class="refsect3">
|
||||
<a name="GtkPrintStatus.members"></a><h4>Members</h4>
|
||||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||||
<colgroup>
|
||||
<col width="300px" class="enum_members_name">
|
||||
<col class="enum_members_description">
|
||||
<col width="200px" class="enum_members_annotations">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-STATUS-INITIAL:CAPS"></a>GTK_PRINT_STATUS_INITIAL</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>The printing has not started yet; this
|
||||
status is set initially, and while the print dialog is shown.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-STATUS-PREPARING:CAPS"></a>GTK_PRINT_STATUS_PREPARING</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>This status is set while the begin-print
|
||||
signal is emitted and during pagination.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-STATUS-GENERATING-DATA:CAPS"></a>GTK_PRINT_STATUS_GENERATING_DATA</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>This status is set while the
|
||||
pages are being rendered.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-STATUS-SENDING-DATA:CAPS"></a>GTK_PRINT_STATUS_SENDING_DATA</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>The print job is being sent off to the
|
||||
printer.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-STATUS-PENDING:CAPS"></a>GTK_PRINT_STATUS_PENDING</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>The print job has been sent to the printer,
|
||||
but is not printed for some reason, e.g. the printer may be stopped.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-STATUS-PENDING-ISSUE:CAPS"></a>GTK_PRINT_STATUS_PENDING_ISSUE</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>Some problem has occurred during
|
||||
printing, e.g. a paper jam.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-STATUS-PRINTING:CAPS"></a>GTK_PRINT_STATUS_PRINTING</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>The printer is processing the print job.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-STATUS-FINISHED:CAPS"></a>GTK_PRINT_STATUS_FINISHED</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>The printing has been completed successfully.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-STATUS-FINISHED-ABORTED:CAPS"></a>GTK_PRINT_STATUS_FINISHED_ABORTED</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>The printing has been aborted.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="refsect2">
|
||||
<a name="GtkPrintOperationAction"></a><h3>enum GtkPrintOperationAction</h3>
|
||||
<p>The <em class="parameter"><code>action</code></em>
|
||||
parameter to <a class="link" href="gtk3-High-level-Printing-API.html#gtk-print-operation-run" title="gtk_print_operation_run ()"><code class="function">gtk_print_operation_run()</code></a>
|
||||
determines what action the print operation should perform.</p>
|
||||
<div class="refsect3">
|
||||
<a name="GtkPrintOperationAction.members"></a><h4>Members</h4>
|
||||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||||
<colgroup>
|
||||
<col width="300px" class="enum_members_name">
|
||||
<col class="enum_members_description">
|
||||
<col width="200px" class="enum_members_annotations">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-OPERATION-ACTION-PRINT-DIALOG:CAPS"></a>GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>Show the print dialog.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-OPERATION-ACTION-PRINT:CAPS"></a>GTK_PRINT_OPERATION_ACTION_PRINT</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>Start to print without showing
|
||||
the print dialog, based on the current print settings.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-OPERATION-ACTION-PREVIEW:CAPS"></a>GTK_PRINT_OPERATION_ACTION_PREVIEW</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>Show the print preview.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-OPERATION-ACTION-EXPORT:CAPS"></a>GTK_PRINT_OPERATION_ACTION_EXPORT</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>Export to a file. This requires
|
||||
the export-filename property to be set.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="refsect2">
|
||||
<a name="GtkPrintOperationResult"></a><h3>enum GtkPrintOperationResult</h3>
|
||||
<p>A value of this type is returned by <a class="link" href="gtk3-High-level-Printing-API.html#gtk-print-operation-run" title="gtk_print_operation_run ()"><code class="function">gtk_print_operation_run()</code></a>.</p>
|
||||
<div class="refsect3">
|
||||
<a name="GtkPrintOperationResult.members"></a><h4>Members</h4>
|
||||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||||
<colgroup>
|
||||
<col width="300px" class="enum_members_name">
|
||||
<col class="enum_members_description">
|
||||
<col width="200px" class="enum_members_annotations">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-OPERATION-RESULT-ERROR:CAPS"></a>GTK_PRINT_OPERATION_RESULT_ERROR</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>An error has occurred.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-OPERATION-RESULT-APPLY:CAPS"></a>GTK_PRINT_OPERATION_RESULT_APPLY</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>The print settings should be stored.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-OPERATION-RESULT-CANCEL:CAPS"></a>GTK_PRINT_OPERATION_RESULT_CANCEL</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>The print operation has been canceled,
|
||||
the print settings should not be stored.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-OPERATION-RESULT-IN-PROGRESS:CAPS"></a>GTK_PRINT_OPERATION_RESULT_IN_PROGRESS</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>The print operation is not complete
|
||||
yet. This value will only be returned when running asynchronously.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="refsect2">
|
||||
<a name="GtkPrintError"></a><h3>enum GtkPrintError</h3>
|
||||
<p>Error codes that identify various errors that can occur while
|
||||
using the GTK+ printing support.</p>
|
||||
<div class="refsect3">
|
||||
<a name="GtkPrintError.members"></a><h4>Members</h4>
|
||||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||||
<colgroup>
|
||||
<col width="300px" class="enum_members_name">
|
||||
<col class="enum_members_description">
|
||||
<col width="200px" class="enum_members_annotations">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-ERROR-GENERAL:CAPS"></a>GTK_PRINT_ERROR_GENERAL</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>An unspecified error occurred.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-ERROR-INTERNAL-ERROR:CAPS"></a>GTK_PRINT_ERROR_INTERNAL_ERROR</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>An internal error occurred.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-ERROR-NOMEM:CAPS"></a>GTK_PRINT_ERROR_NOMEM</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>A memory allocation failed.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="enum_member_name"><p><a name="GTK-PRINT-ERROR-INVALID-FILE:CAPS"></a>GTK_PRINT_ERROR_INVALID_FILE</p></td>
|
||||
<td class="enum_member_description">
|
||||
<p>An error occurred while loading a page setup
|
||||
or paper size from a key file.</p>
|
||||
</td>
|
||||
<td class="enum_member_annotations"> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="refsect2">
|
||||
<a name="GTK-PRINT-ERROR:CAPS"></a><h3>GTK_PRINT_ERROR</h3>
|
||||
<pre class="programlisting">#define GTK_PRINT_ERROR gtk_print_error_quark ()
|
||||
</pre>
|
||||
<p>The error domain for <a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintError" title="enum GtkPrintError"><span class="type">GtkPrintError</span></a> errors.</p>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="refsect2">
|
||||
<a name="GtkPrintOperationPreview-struct"></a><h3>GtkPrintOperationPreview</h3>
|
||||
<pre class="programlisting">typedef struct _GtkPrintOperationPreview GtkPrintOperationPreview;</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="refsect1">
|
||||
<a name="gtk3-High-level-Printing-API.property-details"></a><h2>Property Details</h2>
|
||||
<div class="refsect2">
|
||||
<a name="GtkPrintOperation--allow-async"></a><h3>The <code class="literal">“allow-async”</code> property</h3>
|
||||
<pre class="programlisting"> “allow-async” <span class="type">gboolean</span></pre>
|
||||
<p>Determines whether the print operation may run asynchronously or not.</p>
|
||||
<p>Some systems don't support asynchronous printing, but those that do
|
||||
will return <a class="link" href="gtk3-High-level-Printing-API.html#GTK-PRINT-OPERATION-RESULT-IN-PROGRESS:CAPS"><code class="literal">GTK_PRINT_OPERATION_RESULT_IN_PROGRESS</code></a> as the status, and
|
||||
will return <a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GTK-PRINT-OPERATION-RESULT-IN-PROGRESS:CAPS"><code class="literal">GTK_PRINT_OPERATION_RESULT_IN_PROGRESS</code></a> as the status, and
|
||||
emit the <a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation-done" title="The “done” signal"><span class="type">“done”</span></a> signal when the operation is actually
|
||||
|
||||
done.</p>
|
||||
@ -2386,7 +2023,8 @@ done.</p>
|
||||
|
||||
is unlikely to change). On other platforms, all actions except for
|
||||
|
||||
<a class="link" href="gtk3-High-level-Printing-API.html#GTK-PRINT-OPERATION-ACTION-EXPORT:CAPS"><code class="literal">GTK_PRINT_OPERATION_ACTION_EXPORT</code></a> support asynchronous operation.</p>
|
||||
<a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GTK-PRINT-OPERATION-ACTION-EXPORT:CAPS"><code class="literal">GTK_PRINT_OPERATION_ACTION_EXPORT</code></a> support asynchronous operation.</p>
|
||||
<p>Owner: GtkPrintOperation</p>
|
||||
<p>Flags: Read / Write</p>
|
||||
<p>Default value: FALSE</p>
|
||||
<p class="since">Since: 2.10</p>
|
||||
@ -2400,6 +2038,7 @@ is unlikely to change). On other platforms, all actions except for
|
||||
|
||||
the user will be able to select to print only the current page.</p>
|
||||
<p>Note that this only makes sense for pre-paginated documents.</p>
|
||||
<p>Owner: GtkPrintOperation</p>
|
||||
<p>Flags: Read / Write</p>
|
||||
<p>Allowed values: >= -1</p>
|
||||
<p>Default value: -1</p>
|
||||
@ -2412,6 +2051,7 @@ the user will be able to select to print only the current page.</p>
|
||||
<p>Used as the label of the tab containing custom widgets.
|
||||
Note that this property may be ignored on some platforms.</p>
|
||||
<p>If this is <code class="literal">NULL</code>, GTK+ uses a default label.</p>
|
||||
<p>Owner: GtkPrintOperation</p>
|
||||
<p>Flags: Read / Write</p>
|
||||
<p>Default value: NULL</p>
|
||||
<p class="since">Since: 2.10</p>
|
||||
@ -2424,6 +2064,7 @@ Note that this property may be ignored on some platforms.</p>
|
||||
<p>This page setup will be used by <a class="link" href="gtk3-High-level-Printing-API.html#gtk-print-operation-run" title="gtk_print_operation_run ()"><code class="function">gtk_print_operation_run()</code></a>,
|
||||
but it can be overridden on a per-page basis by connecting
|
||||
to the <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> signal.</p>
|
||||
<p>Owner: GtkPrintOperation</p>
|
||||
<p>Flags: Read / Write</p>
|
||||
<p class="since">Since: 2.10</p>
|
||||
</div>
|
||||
@ -2432,6 +2073,7 @@ to the <a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation
|
||||
<a name="GtkPrintOperation--embed-page-setup"></a><h3>The <code class="literal">“embed-page-setup”</code> property</h3>
|
||||
<pre class="programlisting"> “embed-page-setup” <span class="type">gboolean</span></pre>
|
||||
<p>If <code class="literal">TRUE</code>, page size combo box and orientation combo box are embedded into page setup page.</p>
|
||||
<p>Owner: GtkPrintOperation</p>
|
||||
<p>Flags: Read / Write</p>
|
||||
<p>Default value: FALSE</p>
|
||||
<p class="since">Since: 2.18</p>
|
||||
@ -2450,6 +2092,7 @@ Currently, PDF is the only supported format.</p>
|
||||
by letting the user pick the “Print to PDF” item from the
|
||||
|
||||
list of printers in the print dialog.</p>
|
||||
<p>Owner: GtkPrintOperation</p>
|
||||
<p>Flags: Read / Write</p>
|
||||
<p>Default value: NULL</p>
|
||||
<p class="since">Since: 2.10</p>
|
||||
@ -2461,6 +2104,7 @@ list of printers in the print dialog.</p>
|
||||
<p>Determines whether there is a selection in your application.
|
||||
This can allow your application to print the selection.
|
||||
This is typically used to make a "Selection" button sensitive.</p>
|
||||
<p>Owner: GtkPrintOperation</p>
|
||||
<p>Flags: Read / Write</p>
|
||||
<p>Default value: FALSE</p>
|
||||
<p class="since">Since: 2.18</p>
|
||||
@ -2475,6 +2119,7 @@ applications like eggcups). </p>
|
||||
<p>If you don't set a job name, GTK+ picks a default one
|
||||
|
||||
by numbering successive print jobs.</p>
|
||||
<p>Owner: GtkPrintOperation</p>
|
||||
<p>Flags: Read / Write</p>
|
||||
<p>Default value: ""</p>
|
||||
<p class="since">Since: 2.10</p>
|
||||
@ -2498,6 +2143,7 @@ the user chooses to print all pages, the last ::draw-page signal
|
||||
|
||||
will be for page <em class="parameter"><code>n_pages</code></em>
|
||||
- 1.</p>
|
||||
<p>Owner: GtkPrintOperation</p>
|
||||
<p>Flags: Read / Write</p>
|
||||
<p>Allowed values: >= -1</p>
|
||||
<p>Default value: -1</p>
|
||||
@ -2509,12 +2155,13 @@ will be for page <em class="parameter"><code>n_pages</code></em>
|
||||
<pre class="programlisting"> “n-pages-to-print” <span class="type">gint</span></pre>
|
||||
<p>The number of pages that will be printed.</p>
|
||||
<p>Note that this value is set during print preparation phase
|
||||
(<a class="link" href="gtk3-High-level-Printing-API.html#GTK-PRINT-STATUS-PREPARING:CAPS"><code class="literal">GTK_PRINT_STATUS_PREPARING</code></a>), so this value should never be
|
||||
get before the data generation phase (<a class="link" href="gtk3-High-level-Printing-API.html#GTK-PRINT-STATUS-GENERATING-DATA:CAPS"><code class="literal">GTK_PRINT_STATUS_GENERATING_DATA</code></a>).
|
||||
(<a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GTK-PRINT-STATUS-PREPARING:CAPS"><code class="literal">GTK_PRINT_STATUS_PREPARING</code></a>), so this value should never be
|
||||
get before the data generation phase (<a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GTK-PRINT-STATUS-GENERATING-DATA:CAPS"><code class="literal">GTK_PRINT_STATUS_GENERATING_DATA</code></a>).
|
||||
You can connect to the <a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation-status-changed" title="The “status-changed” signal"><span class="type">“status-changed”</span></a> signal
|
||||
and call <a class="link" href="gtk3-High-level-Printing-API.html#gtk-print-operation-get-n-pages-to-print" title="gtk_print_operation_get_n_pages_to_print ()"><code class="function">gtk_print_operation_get_n_pages_to_print()</code></a> when
|
||||
print status is <a class="link" href="gtk3-High-level-Printing-API.html#GTK-PRINT-STATUS-GENERATING-DATA:CAPS"><code class="literal">GTK_PRINT_STATUS_GENERATING_DATA</code></a>.
|
||||
print status is <a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GTK-PRINT-STATUS-GENERATING-DATA:CAPS"><code class="literal">GTK_PRINT_STATUS_GENERATING_DATA</code></a>.
|
||||
This is typically used to track the progress of print operation.</p>
|
||||
<p>Owner: GtkPrintOperation</p>
|
||||
<p>Flags: Read</p>
|
||||
<p>Allowed values: >= -1</p>
|
||||
<p>Default value: -1</p>
|
||||
@ -2530,6 +2177,7 @@ This is typically used to track the progress of print operation.</p>
|
||||
print settings from a previous print operation, see
|
||||
|
||||
<a class="link" href="gtk3-High-level-Printing-API.html#gtk-print-operation-run" title="gtk_print_operation_run ()"><code class="function">gtk_print_operation_run()</code></a>.</p>
|
||||
<p>Owner: GtkPrintOperation</p>
|
||||
<p>Flags: Read / Write</p>
|
||||
<p class="since">Since: 2.10</p>
|
||||
</div>
|
||||
@ -2540,6 +2188,7 @@ print settings from a previous print operation, see
|
||||
<p>Determines whether to show a progress dialog during the
|
||||
|
||||
print operation.</p>
|
||||
<p>Owner: GtkPrintOperation</p>
|
||||
<p>Flags: Read / Write</p>
|
||||
<p>Default value: FALSE</p>
|
||||
<p class="since">Since: 2.10</p>
|
||||
@ -2547,8 +2196,9 @@ print operation.</p>
|
||||
<hr>
|
||||
<div class="refsect2">
|
||||
<a name="GtkPrintOperation--status"></a><h3>The <code class="literal">“status”</code> property</h3>
|
||||
<pre class="programlisting"> “status” <a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintStatus" title="enum GtkPrintStatus"><span class="type">GtkPrintStatus</span></a></pre>
|
||||
<pre class="programlisting"> “status” <a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GtkPrintStatus"><span class="type">GtkPrintStatus</span></a></pre>
|
||||
<p>The status of the print operation.</p>
|
||||
<p>Owner: GtkPrintOperation</p>
|
||||
<p>Flags: Read</p>
|
||||
<p>Default value: GTK_PRINT_STATUS_INITIAL</p>
|
||||
<p class="since">Since: 2.10</p>
|
||||
@ -2565,6 +2215,7 @@ status e.g. in a <a class="link" href="GtkStatusbar.html" title="GtkStatusbar"><
|
||||
<p>See the <a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation--status" title="The “status” property"><span class="type">“status”</span></a> property for a status value that
|
||||
|
||||
is suitable for programmatic use.</p>
|
||||
<p>Owner: GtkPrintOperation</p>
|
||||
<p>Flags: Read</p>
|
||||
<p>Default value: ""</p>
|
||||
<p class="since">Since: 2.10</p>
|
||||
@ -2575,6 +2226,7 @@ is suitable for programmatic use.</p>
|
||||
<pre class="programlisting"> “support-selection” <span class="type">gboolean</span></pre>
|
||||
<p>If <code class="literal">TRUE</code>, the print operation will support print of selection.
|
||||
This allows the print dialog to show a "Selection" button.</p>
|
||||
<p>Owner: GtkPrintOperation</p>
|
||||
<p>Flags: Read / Write</p>
|
||||
<p>Default value: FALSE</p>
|
||||
<p class="since">Since: 2.18</p>
|
||||
@ -2594,6 +2246,7 @@ issues, and when the print job actually reaches the printer.
|
||||
However, this is often implemented using polling, and should
|
||||
|
||||
not be enabled unless needed.</p>
|
||||
<p>Owner: GtkPrintOperation</p>
|
||||
<p>Flags: Read / Write</p>
|
||||
<p>Default value: FALSE</p>
|
||||
<p class="since">Since: 2.10</p>
|
||||
@ -2601,12 +2254,13 @@ not be enabled unless needed.</p>
|
||||
<hr>
|
||||
<div class="refsect2">
|
||||
<a name="GtkPrintOperation--unit"></a><h3>The <code class="literal">“unit”</code> property</h3>
|
||||
<pre class="programlisting"> “unit” <a class="link" href="GtkPaperSize.html#GtkUnit" title="enum GtkUnit"><span class="type">GtkUnit</span></a></pre>
|
||||
<pre class="programlisting"> “unit” <a href="https://developer.gnome.org/gtk4/GtkPaperSize.html#GtkUnit"><span class="type">GtkUnit</span></a></pre>
|
||||
<p>The transformation for the cairo context obtained from
|
||||
<a class="link" href="GtkPrintContext.html" title="GtkPrintContext"><span class="type">GtkPrintContext</span></a> is set up in such a way that distances
|
||||
|
||||
are measured in units of <em class="parameter"><code>unit</code></em>
|
||||
.</p>
|
||||
<p>Owner: GtkPrintOperation</p>
|
||||
<p>Flags: Read / Write</p>
|
||||
<p>Default value: GTK_UNIT_NONE</p>
|
||||
<p class="since">Since: 2.10</p>
|
||||
@ -2626,6 +2280,7 @@ depending on page orientation and the number of pages per sheet).
|
||||
Otherwise, the origin is at the top left corner of the imageable
|
||||
|
||||
area (i.e. inside the margins).</p>
|
||||
<p>Owner: GtkPrintOperation</p>
|
||||
<p>Flags: Read / Write</p>
|
||||
<p>Default value: FALSE</p>
|
||||
<p class="since">Since: 2.10</p>
|
||||
@ -2774,7 +2429,7 @@ later time.</p>
|
||||
<a name="GtkPrintOperation-done"></a><h3>The <code class="literal">“done”</code> signal</h3>
|
||||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||||
user_function (<a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation"><span class="type">GtkPrintOperation</span></a> *operation,
|
||||
<a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperationResult" title="enum GtkPrintOperationResult"><span class="type">GtkPrintOperationResult</span></a> result,
|
||||
<a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GtkPrintOperationResult"><span class="type">GtkPrintOperationResult</span></a> result,
|
||||
<span class="type">gpointer</span> user_data)</pre>
|
||||
<p>Emitted when the print operation run has finished doing
|
||||
everything required for printing. </p>
|
||||
@ -2782,7 +2437,7 @@ everything required for printing. </p>
|
||||
gives you information about what happened during the run.
|
||||
|
||||
If <em class="parameter"><code>result</code></em>
|
||||
is <a class="link" href="gtk3-High-level-Printing-API.html#GTK-PRINT-OPERATION-RESULT-ERROR:CAPS"><code class="literal">GTK_PRINT_OPERATION_RESULT_ERROR</code></a> then you can call
|
||||
is <a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GTK-PRINT-OPERATION-RESULT-ERROR:CAPS"><code class="literal">GTK_PRINT_OPERATION_RESULT_ERROR</code></a> then you can call
|
||||
<a class="link" href="gtk3-High-level-Printing-API.html#gtk-print-operation-get-error" title="gtk_print_operation_get_error ()"><code class="function">gtk_print_operation_get_error()</code></a> for more information.</p>
|
||||
<p>If you enabled print status tracking then
|
||||
|
||||
@ -2874,44 +2529,44 @@ from <em class="parameter"><code>context</code></em>
|
||||
36
|
||||
37
|
||||
38</pre></td>
|
||||
<td class="listing_code"><pre class="programlisting"><span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
|
||||
<span class="function">draw_page</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GtkPrintOperation</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">operation</span><span class="symbol">,</span>
|
||||
<span class="normal"> </span><span class="usertype">GtkPrintContext</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">context</span><span class="symbol">,</span>
|
||||
<span class="normal"> </span><span class="usertype">gint</span><span class="normal"> page_nr</span><span class="symbol">,</span>
|
||||
<span class="normal"> </span><span class="usertype">gpointer</span><span class="normal"> user_data</span><span class="symbol">)</span>
|
||||
<span class="cbracket">{</span>
|
||||
<span class="normal"> </span><span class="usertype">cairo_t</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">cr</span><span class="symbol">;</span>
|
||||
<span class="normal"> </span><span class="usertype">PangoLayout</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">layout</span><span class="symbol">;</span>
|
||||
<span class="normal"> </span><span class="usertype">gdouble</span><span class="normal"> width</span><span class="symbol">,</span><span class="normal"> text_height</span><span class="symbol">;</span>
|
||||
<span class="normal"> </span><span class="usertype">gint</span><span class="normal"> layout_height</span><span class="symbol">;</span>
|
||||
<span class="normal"> </span><span class="usertype">PangoFontDescription</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">desc</span><span class="symbol">;</span>
|
||||
<td class="listing_code"><pre class="programlisting"><span class="k">static</span> <span class="kt">void</span>
|
||||
<span class="nf">draw_page</span> <span class="p">(</span><span class="n">GtkPrintOperation</span> <span class="o">*</span><span class="n">operation</span><span class="p">,</span>
|
||||
<span class="n">GtkPrintContext</span> <span class="o">*</span><span class="n">context</span><span class="p">,</span>
|
||||
<span class="n">gint</span> <span class="n">page_nr</span><span class="p">,</span>
|
||||
<span class="n">gpointer</span> <span class="n">user_data</span><span class="p">)</span>
|
||||
<span class="p">{</span>
|
||||
<span class="n">cairo_t</span> <span class="o">*</span><span class="n">cr</span><span class="p">;</span>
|
||||
<span class="n">PangoLayout</span> <span class="o">*</span><span class="n">layout</span><span class="p">;</span>
|
||||
<span class="n">gdouble</span> <span class="n">width</span><span class="p">,</span> <span class="n">text_height</span><span class="p">;</span>
|
||||
<span class="n">gint</span> <span class="n">layout_height</span><span class="p">;</span>
|
||||
<span class="n">PangoFontDescription</span> <span class="o">*</span><span class="n">desc</span><span class="p">;</span>
|
||||
|
||||
<span class="normal"> cr </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkPrintContext.html#gtk-print-context-get-cairo-context">gtk_print_context_get_cairo_context</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">context</span><span class="symbol">);</span>
|
||||
<span class="normal"> width </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkPrintContext.html#gtk-print-context-get-width">gtk_print_context_get_width</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">context</span><span class="symbol">);</span>
|
||||
<span class="n">cr</span> <span class="o">=</span> <span class="n">gtk_print_context_get_cairo_context</span> <span class="p">(</span><span class="n">context</span><span class="p">);</span>
|
||||
<span class="n">width</span> <span class="o">=</span> <span class="n">gtk_print_context_get_width</span> <span class="p">(</span><span class="n">context</span><span class="p">);</span>
|
||||
|
||||
<span class="normal"> </span><span class="function"><a href="/usr/share/gtk-doc/html/cairo/cairo-Paths.html#cairo-rectangle">cairo_rectangle</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">cr</span><span class="symbol">,</span><span class="normal"> </span><span class="number">0</span><span class="symbol">,</span><span class="normal"> </span><span class="number">0</span><span class="symbol">,</span><span class="normal"> width</span><span class="symbol">,</span><span class="normal"> HEADER_HEIGHT</span><span class="symbol">);</span>
|
||||
<span class="n">cairo_rectangle</span> <span class="p">(</span><span class="n">cr</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">width</span><span class="p">,</span> <span class="n">HEADER_HEIGHT</span><span class="p">);</span>
|
||||
|
||||
<span class="normal"> </span><span class="function"><a href="/usr/share/gtk-doc/html/cairo/cairo-cairo-t.html#cairo-set-source-rgb">cairo_set_source_rgb</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">cr</span><span class="symbol">,</span><span class="normal"> </span><span class="number">0.8</span><span class="symbol">,</span><span class="normal"> </span><span class="number">0.8</span><span class="symbol">,</span><span class="normal"> </span><span class="number">0.8</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span><span class="function"><a href="/usr/share/gtk-doc/html/cairo/cairo-cairo-t.html#cairo-fill">cairo_fill</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">cr</span><span class="symbol">);</span>
|
||||
<span class="n">cairo_set_source_rgb</span> <span class="p">(</span><span class="n">cr</span><span class="p">,</span> <span class="mf">0.8</span><span class="p">,</span> <span class="mf">0.8</span><span class="p">,</span> <span class="mf">0.8</span><span class="p">);</span>
|
||||
<span class="n">cairo_fill</span> <span class="p">(</span><span class="n">cr</span><span class="p">);</span>
|
||||
|
||||
<span class="normal"> layout </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkPrintContext.html#gtk-print-context-create-pango-layout">gtk_print_context_create_pango_layout</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">context</span><span class="symbol">);</span>
|
||||
<span class="n">layout</span> <span class="o">=</span> <span class="n">gtk_print_context_create_pango_layout</span> <span class="p">(</span><span class="n">context</span><span class="p">);</span>
|
||||
|
||||
<span class="normal"> desc </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="https://developer.gnome.org/pango/pango-Fonts.html#pango-font-description-from-string">pango_font_description_from_string</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"sans 14"</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span><span class="function"><a href="https://developer.gnome.org/pango/pango-Layout-Objects.html#pango-layout-set-font-description">pango_layout_set_font_description</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">layout</span><span class="symbol">,</span><span class="normal"> desc</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span><span class="function"><a href="https://developer.gnome.org/pango/pango-Fonts.html#pango-font-description-free">pango_font_description_free</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">desc</span><span class="symbol">);</span>
|
||||
<span class="n">desc</span> <span class="o">=</span> <span class="n">pango_font_description_from_string</span> <span class="p">(</span><span class="s">"sans 14"</span><span class="p">);</span>
|
||||
<span class="n">pango_layout_set_font_description</span> <span class="p">(</span><span class="n">layout</span><span class="p">,</span> <span class="n">desc</span><span class="p">);</span>
|
||||
<span class="n">pango_font_description_free</span> <span class="p">(</span><span class="n">desc</span><span class="p">);</span>
|
||||
|
||||
<span class="normal"> </span><span class="function"><a href="https://developer.gnome.org/pango/pango-Layout-Objects.html#pango-layout-set-text">pango_layout_set_text</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">layout</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"some text"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">-</span><span class="number">1</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span><span class="function"><a href="https://developer.gnome.org/pango/pango-Layout-Objects.html#pango-layout-set-width">pango_layout_set_width</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">layout</span><span class="symbol">,</span><span class="normal"> width </span><span class="symbol">*</span><span class="normal"> <a href="https://developer.gnome.org/pango/pango-Glyph-Storage.html#PANGO-SCALE:CAPS">PANGO_SCALE</a></span><span class="symbol">);</span>
|
||||
<span class="normal"> </span><span class="function"><a href="https://developer.gnome.org/pango/pango-Layout-Objects.html#pango-layout-set-alignment">pango_layout_set_alignment</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">layout</span><span class="symbol">,</span><span class="normal"> <a href="https://developer.gnome.org/pango/pango-Layout-Objects.html#PANGO-ALIGN-CENTER:CAPS">PANGO_ALIGN_CENTER</a></span><span class="symbol">);</span>
|
||||
<span class="n">pango_layout_set_text</span> <span class="p">(</span><span class="n">layout</span><span class="p">,</span> <span class="s">"some text"</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
|
||||
<span class="n">pango_layout_set_width</span> <span class="p">(</span><span class="n">layout</span><span class="p">,</span> <span class="n">width</span> <span class="o">*</span> <span class="n">PANGO_SCALE</span><span class="p">);</span>
|
||||
<span class="n">pango_layout_set_alignment</span> <span class="p">(</span><span class="n">layout</span><span class="p">,</span> <span class="n">PANGO_ALIGN_CENTER</span><span class="p">);</span>
|
||||
|
||||
<span class="normal"> </span><span class="function"><a href="https://developer.gnome.org/pango/pango-Layout-Objects.html#pango-layout-get-size">pango_layout_get_size</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">layout</span><span class="symbol">,</span><span class="normal"> NULL</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">layout_height</span><span class="symbol">);</span>
|
||||
<span class="normal"> text_height </span><span class="symbol">=</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">gdouble</span><span class="symbol">)</span><span class="normal">layout_height </span><span class="symbol">/</span><span class="normal"> <a href="https://developer.gnome.org/pango/pango-Glyph-Storage.html#PANGO-SCALE:CAPS">PANGO_SCALE</a></span><span class="symbol">;</span>
|
||||
<span class="n">pango_layout_get_size</span> <span class="p">(</span><span class="n">layout</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="o">&</span><span class="n">layout_height</span><span class="p">);</span>
|
||||
<span class="n">text_height</span> <span class="o">=</span> <span class="p">(</span><span class="n">gdouble</span><span class="p">)</span><span class="n">layout_height</span> <span class="o">/</span> <span class="n">PANGO_SCALE</span><span class="p">;</span>
|
||||
|
||||
<span class="normal"> </span><span class="function"><a href="/usr/share/gtk-doc/html/cairo/cairo-Paths.html#cairo-move-to">cairo_move_to</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">cr</span><span class="symbol">,</span><span class="normal"> width </span><span class="symbol">/</span><span class="normal"> </span><span class="number">2</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">HEADER_HEIGHT </span><span class="symbol">-</span><span class="normal"> text_height</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">/</span><span class="normal"> </span><span class="number">2</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span><span class="function"><a href="https://developer.gnome.org/pango/pango-Cairo-Rendering.html#pango-cairo-show-layout">pango_cairo_show_layout</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">cr</span><span class="symbol">,</span><span class="normal"> layout</span><span class="symbol">);</span>
|
||||
<span class="n">cairo_move_to</span> <span class="p">(</span><span class="n">cr</span><span class="p">,</span> <span class="n">width</span> <span class="o">/</span> <span class="mi">2</span><span class="p">,</span> <span class="p">(</span><span class="n">HEADER_HEIGHT</span> <span class="o">-</span> <span class="n">text_height</span><span class="p">)</span> <span class="o">/</span> <span class="mi">2</span><span class="p">);</span>
|
||||
<span class="n">pango_cairo_show_layout</span> <span class="p">(</span><span class="n">cr</span><span class="p">,</span> <span class="n">layout</span><span class="p">);</span>
|
||||
|
||||
<span class="normal"> </span><span class="function">g_object_unref</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">layout</span><span class="symbol">);</span>
|
||||
<span class="cbracket">}</span></pre></td>
|
||||
<span class="n">g_object_unref</span> <span class="p">(</span><span class="n">layout</span><span class="p">);</span>
|
||||
<span class="p">}</span></pre></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -3184,7 +2839,7 @@ done to <em class="parameter"><code>setup</code></em>
|
||||
user_function (<a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintOperation"><span class="type">GtkPrintOperation</span></a> *operation,
|
||||
<span class="type">gpointer</span> user_data)</pre>
|
||||
<p>Emitted at between the various phases of the print operation.
|
||||
See <a class="link" href="gtk3-High-level-Printing-API.html#GtkPrintStatus" title="enum GtkPrintStatus"><span class="type">GtkPrintStatus</span></a> for the phases that are being discriminated.
|
||||
See <a href="https://developer.gnome.org/gtk4/gtk4-High-level-Printing-API.html#GtkPrintStatus"><span class="type">GtkPrintStatus</span></a> for the phases that are being discriminated.
|
||||
Use <a class="link" href="gtk3-High-level-Printing-API.html#gtk-print-operation-get-status" title="gtk_print_operation_get_status ()"><code class="function">gtk_print_operation_get_status()</code></a> to find out the current
|
||||
status.</p>
|
||||
<div class="refsect3">
|
||||
@ -3359,6 +3014,6 @@ before the first page is rendered.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<hr>Generated by GTK-Doc V1.29</div>
|
||||
<hr>Generated by GTK-Doc V1.32.1</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user