<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
<!ENTITY tutorial SYSTEM "lang-tutorial.sgml">
<!ENTITY reference SYSTEM "lang-reference.sgml">
]>
<refentry id="GtkSourcePrintCompositor">
<refmeta>
<refentrytitle role="top_of_page" id="GtkSourcePrintCompositor.top_of_page">GtkSourcePrintCompositor</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTKSOURCEVIEW-2.0 Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GtkSourcePrintCompositor</refname>
<refpurpose>Compose a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link> for printing.</refpurpose>
</refnamediv>

<refsynopsisdiv id="GtkSourcePrintCompositor.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;gtksourceview/gtksourceprintcompositor.h&gt;

                    <link linkend="GtkSourcePrintCompositor-struct">GtkSourcePrintCompositor</link>;
<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> * <link linkend="gtk-source-print-compositor-new">gtk_source_print_compositor_new</link>
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);
<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> * <link linkend="gtk-source-print-compositor-new-from-view">gtk_source_print_compositor_new_from_view</link>
                                                        (<link linkend="GtkSourceView">GtkSourceView</link> *view);
<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *   <link linkend="gtk-source-print-compositor-get-buffer">gtk_source_print_compositor_get_buffer</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);
<link linkend="void">void</link>                <link linkend="gtk-source-print-compositor-set-tab-width">gtk_source_print_compositor_set_tab_width</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="guint">guint</link> width);
<link linkend="guint">guint</link>               <link linkend="gtk-source-print-compositor-get-tab-width">gtk_source_print_compositor_get_tab_width</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);
<link linkend="void">void</link>                <link linkend="gtk-source-print-compositor-set-wrap-mode">gtk_source_print_compositor_set_wrap_mode</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="GtkWrapMode">GtkWrapMode</link> wrap_mode);
<link linkend="GtkWrapMode">GtkWrapMode</link>         <link linkend="gtk-source-print-compositor-get-wrap-mode">gtk_source_print_compositor_get_wrap_mode</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);
<link linkend="void">void</link>                <link linkend="gtk-source-print-compositor-set-highlight-syntax">gtk_source_print_compositor_set_highlight_syntax</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="gboolean">gboolean</link> highlight);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-source-print-compositor-get-highlight-syntax">gtk_source_print_compositor_get_highlight_syntax</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);
<link linkend="void">void</link>                <link linkend="gtk-source-print-compositor-set-print-line-numbers">gtk_source_print_compositor_set_print_line_numbers</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="guint">guint</link> interval);
<link linkend="guint">guint</link>               <link linkend="gtk-source-print-compositor-get-print-line-numbers">gtk_source_print_compositor_get_print_line_numbers</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);
<link linkend="void">void</link>                <link linkend="gtk-source-print-compositor-set-body-font-name">gtk_source_print_compositor_set_body_font_name</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         const <link linkend="gchar">gchar</link> *font_name);
<link linkend="gchar">gchar</link> *             <link linkend="gtk-source-print-compositor-get-body-font-name">gtk_source_print_compositor_get_body_font_name</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);
<link linkend="void">void</link>                <link linkend="gtk-source-print-compositor-set-line-numbers-font-name">gtk_source_print_compositor_set_line_numbers_font_name</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         const <link linkend="gchar">gchar</link> *font_name);
<link linkend="gchar">gchar</link> *             <link linkend="gtk-source-print-compositor-get-line-numbers-font-name">gtk_source_print_compositor_get_line_numbers_font_name</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);
<link linkend="void">void</link>                <link linkend="gtk-source-print-compositor-set-header-font-name">gtk_source_print_compositor_set_header_font_name</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         const <link linkend="gchar">gchar</link> *font_name);
<link linkend="gchar">gchar</link> *             <link linkend="gtk-source-print-compositor-get-header-font-name">gtk_source_print_compositor_get_header_font_name</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);
<link linkend="void">void</link>                <link linkend="gtk-source-print-compositor-set-footer-font-name">gtk_source_print_compositor_set_footer_font_name</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         const <link linkend="gchar">gchar</link> *font_name);
<link linkend="gchar">gchar</link> *             <link linkend="gtk-source-print-compositor-get-footer-font-name">gtk_source_print_compositor_get_footer_font_name</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);
<link linkend="gdouble">gdouble</link>             <link linkend="gtk-source-print-compositor-get-top-margin">gtk_source_print_compositor_get_top_margin</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="GtkUnit">GtkUnit</link> unit);
<link linkend="void">void</link>                <link linkend="gtk-source-print-compositor-set-top-margin">gtk_source_print_compositor_set_top_margin</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="gdouble">gdouble</link> margin,
                                                         <link linkend="GtkUnit">GtkUnit</link> unit);
<link linkend="gdouble">gdouble</link>             <link linkend="gtk-source-print-compositor-get-bottom-margin">gtk_source_print_compositor_get_bottom_margin</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="GtkUnit">GtkUnit</link> unit);
<link linkend="void">void</link>                <link linkend="gtk-source-print-compositor-set-bottom-margin">gtk_source_print_compositor_set_bottom_margin</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="gdouble">gdouble</link> margin,
                                                         <link linkend="GtkUnit">GtkUnit</link> unit);
<link linkend="gdouble">gdouble</link>             <link linkend="gtk-source-print-compositor-get-left-margin">gtk_source_print_compositor_get_left_margin</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="GtkUnit">GtkUnit</link> unit);
<link linkend="void">void</link>                <link linkend="gtk-source-print-compositor-set-left-margin">gtk_source_print_compositor_set_left_margin</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="gdouble">gdouble</link> margin,
                                                         <link linkend="GtkUnit">GtkUnit</link> unit);
<link linkend="gdouble">gdouble</link>             <link linkend="gtk-source-print-compositor-get-right-margin">gtk_source_print_compositor_get_right_margin</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="GtkUnit">GtkUnit</link> unit);
<link linkend="void">void</link>                <link linkend="gtk-source-print-compositor-set-right-margin">gtk_source_print_compositor_set_right_margin</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="gdouble">gdouble</link> margin,
                                                         <link linkend="GtkUnit">GtkUnit</link> unit);
<link linkend="void">void</link>                <link linkend="gtk-source-print-compositor-set-print-header">gtk_source_print_compositor_set_print_header</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="gboolean">gboolean</link> print);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-source-print-compositor-get-print-header">gtk_source_print_compositor_get_print_header</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);
<link linkend="void">void</link>                <link linkend="gtk-source-print-compositor-set-print-footer">gtk_source_print_compositor_set_print_footer</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="gboolean">gboolean</link> print);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-source-print-compositor-get-print-footer">gtk_source_print_compositor_get_print_footer</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);
<link linkend="void">void</link>                <link linkend="gtk-source-print-compositor-set-header-format">gtk_source_print_compositor_set_header_format</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="gboolean">gboolean</link> separator,
                                                         const <link linkend="gchar">gchar</link> *left,
                                                         const <link linkend="gchar">gchar</link> *center,
                                                         const <link linkend="gchar">gchar</link> *right);
<link linkend="void">void</link>                <link linkend="gtk-source-print-compositor-set-footer-format">gtk_source_print_compositor_set_footer_format</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="gboolean">gboolean</link> separator,
                                                         const <link linkend="gchar">gchar</link> *left,
                                                         const <link linkend="gchar">gchar</link> *center,
                                                         const <link linkend="gchar">gchar</link> *right);
<link linkend="gint">gint</link>                <link linkend="gtk-source-print-compositor-get-n-pages">gtk_source_print_compositor_get_n_pages</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-source-print-compositor-paginate">gtk_source_print_compositor_paginate</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="GtkPrintContext">GtkPrintContext</link> *context);
<link linkend="gdouble">gdouble</link>             <link linkend="gtk-source-print-compositor-get-pagination-progress">gtk_source_print_compositor_get_pagination_progress</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);
<link linkend="void">void</link>                <link linkend="gtk-source-print-compositor-draw-page">gtk_source_print_compositor_draw_page</link>
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="GtkPrintContext">GtkPrintContext</link> *context,
                                                         <link linkend="gint">gint</link> page_nr);
</synopsis>
</refsynopsisdiv>

<refsect1 id="GtkSourcePrintCompositor.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----GtkSourcePrintCompositor
</synopsis>
</refsect1>





<refsect1 id="GtkSourcePrintCompositor.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GtkSourcePrintCompositor--body-font-name">body-font-name</link>&quot;           <link linkend="gchar">gchar</link>*                : Read / Write
  &quot;<link linkend="GtkSourcePrintCompositor--buffer">buffer</link>&quot;                   <link linkend="GtkSourceBuffer">GtkSourceBuffer</link>*      : Read / Write / Construct Only
  &quot;<link linkend="GtkSourcePrintCompositor--footer-font-name">footer-font-name</link>&quot;         <link linkend="gchar">gchar</link>*                : Read / Write
  &quot;<link linkend="GtkSourcePrintCompositor--header-font-name">header-font-name</link>&quot;         <link linkend="gchar">gchar</link>*                : Read / Write
  &quot;<link linkend="GtkSourcePrintCompositor--highlight-syntax">highlight-syntax</link>&quot;         <link linkend="gboolean">gboolean</link>              : Read / Write
  &quot;<link linkend="GtkSourcePrintCompositor--line-numbers-font-name">line-numbers-font-name</link>&quot;   <link linkend="gchar">gchar</link>*                : Read / Write
  &quot;<link linkend="GtkSourcePrintCompositor--n-pages">n-pages</link>&quot;                  <link linkend="gint">gint</link>                  : Read
  &quot;<link linkend="GtkSourcePrintCompositor--print-footer">print-footer</link>&quot;             <link linkend="gboolean">gboolean</link>              : Read / Write
  &quot;<link linkend="GtkSourcePrintCompositor--print-header">print-header</link>&quot;             <link linkend="gboolean">gboolean</link>              : Read / Write
  &quot;<link linkend="GtkSourcePrintCompositor--print-line-numbers">print-line-numbers</link>&quot;       <link linkend="guint">guint</link>                 : Read / Write
  &quot;<link linkend="GtkSourcePrintCompositor--tab-width">tab-width</link>&quot;                <link linkend="guint">guint</link>                 : Read / Write
  &quot;<link linkend="GtkSourcePrintCompositor--wrap-mode">wrap-mode</link>&quot;                <link linkend="GtkWrapMode">GtkWrapMode</link>           : Read / Write
</synopsis>
</refsect1>



<refsect1 id="GtkSourcePrintCompositor.description" role="desc">
<title role="desc.title">Description</title>
<para>
The <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link> object is used to compose a
<link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link> for printing.  You can set various configuration options to
customize the printed output. <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link> is designed to be used with
the high-level printing API of gtk+, i.e. <link linkend="GtkPrintOperation"><type>GtkPrintOperation</type></link>.
</para>
<para>
The margins specified in this object are the layout margins: they define the blank space
bordering the printed area of the pages.
They must not be confused with the "print margins", i.e. the parts of the page
that the printer cannot print on, defined in the <link linkend="GtkPageSetup"><type>GtkPageSetup</type></link> objects.
If the specified layout margins are smaller than the "print margins", the latter ones are used
as a fallback by the <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link> object, so that the printed area is not clipped.
</para>
<!--
<para>
Print composition can be done synchronously and asynchronously.  Asynchronous
methods are provided so you can give the user feedback about what's
going on when printing long documents (see the <link
linkend="GtkSourcePrintJob-begin-page">&quot;begin_page&quot;</link>
and <link
linkend="GtkSourcePrintJob-finished">&quot;finished&quot;</link>
signals).
</para>
<para>
The task of a <link linkend="GtkSourcePrintJob"><type>GtkSourcePrintJob</type></link> is to produce a <link linkend="GnomePrintJob"><type>GnomePrintJob</type></link>.  What
this means is that once you get the resulting <link linkend="GnomePrintJob"><type>GnomePrintJob</type></link>, you
might reuse the <link linkend="GtkSourcePrintJob"><type>GtkSourcePrintJob</type></link> to produce another output (with
different configuration options for example) or just unreference it
and forget about it.  The lifetime of the produced object is
independent of that of the producer.
</para>
<para>
Before printing you should <emphasis>at least</emphasis> set the
<link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link> you want to print (using
<link linkend="gtk-source-print-job-set-buffer"><function>gtk_source_print_job_set_buffer()</function></link>).  Besides that, you might
configure word wrapping, font, whether to print hightlighted text as
seen in the <link linkend="GtkSourceView"><type>GtkSourceView</type></link>, line numbers, basic headers and footers.
</para>
<para>
<link linkend="GtkSourcePrintJob"><type>GtkSourcePrintJob</type></link> can print basic headers and footers in each page.
You can specify <link linkend="strftime"><function>strftime()</function></link> like strings for text on the left, right
and center of the top and bottom of the page.  You can also make
<link linkend="GtkSourcePrintJob"><type>GtkSourcePrintJob</type></link> draw a separator line between the text document and
the header and footer.  And you can specify a different font (from
that used for the text document).
</para>
<para>
Customization beyond that is possible, but you have to do the printing
manually.  To do that, you need to connect to the <link
linkend="GtkSourcePrintJob-begin-page">&quot;begin_page&quot;</link>
signal of the job and allocate some space in the page using
<link linkend="gtk-source-print-job-set-text-margins"><function>gtk_source_print_job_set_text_margins()</function></link>.  Whenever <link linkend="GtkSourcePrintJob"><type>GtkSourcePrintJob</type></link>
is about to print a new text page, the signal will be emitted.  You
can then get the <link linkend="GnomePrintContext"><type>GnomePrintContext</type></link> being used with
<link linkend="gtk-source-print-job-get-print-context"><function>gtk_source_print_job_get_print_context()</function></link> and use Gnome Print functions
directly.  The space you allocate is inside the document margins
defined in the specified <link linkend="GnomePrintConfig"><type>GnomePrintConfig</type></link>, but outside all print area
used by <link linkend="GtkSourcePrintJob"><type>GtkSourcePrintJob</type></link> itself.
</para>
<para>
A quick bootstrap code sequence to get you started using
<link linkend="GtkSourcePrintJob"><type>GtkSourcePrintJob</type></link> is given below:
</para>
<informalexample><programlisting>
static GnomePrintJob *
print_source_buffer_from_view (GtkSourceView *view, const gchar *title)
{
	GtkSourcePrintJob *job;
	GnomePrintJob *print_job;
	/* create the job using default print configuration */
	job = gtk_source_print_job_new (NULL);
	/* quickly setup the buffer, font and wrapping */
	gtk_source_print_job_setup_from_view (job, view);
	/* print line numbers every 5 lines, using default font */
	gtk_source_print_job_set_print_numbers (job, 5);
	/* print a header with the title centered */
	gtk_source_print_job_set_header_footer_font (job, "Sans Regular 12.0");
	gtk_source_print_job_set_header_format (job,
	                                        NULL,
	                                        title,
	                                        NULL,
	                                        TRUE);
	gtk_source_print_job_set_print_header (job, TRUE);
	/* print the page number in the page bottom */
	gtk_source_print_job_set_footer_format (job,
	                                        NULL,
	                                        NULL,
	                                        "Page %N of %Q",
	                                        TRUE);
	gtk_source_print_job_set_print_footer (job, TRUE);
	/* print the whole buffer and return the result */
	print_job = gtk_source_print_job_print (job);
	/* job is no longer needed */
	g_object_unref (job);
	return print_job;
}
</programlisting></informalexample>
-->
</refsect1>

<refsect1 id="GtkSourcePrintCompositor.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GtkSourcePrintCompositor-struct" role="struct">
<title>GtkSourcePrintCompositor</title>
<indexterm zone="GtkSourcePrintCompositor-struct"><primary sortas="GtkSourcePrintCompositor">GtkSourcePrintCompositor</primary></indexterm><programlisting>typedef struct _GtkSourcePrintCompositor GtkSourcePrintCompositor;</programlisting>
<para>
</para></refsect2>
<refsect2 id="gtk-source-print-compositor-new" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_new ()</title>
<indexterm zone="gtk-source-print-compositor-new" role="2.2"><primary sortas="gtk_source_print_compositor_new">gtk_source_print_compositor_new</primary></indexterm><programlisting><link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> * gtk_source_print_compositor_new
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);</programlisting>
<para>
Creates a new print compositor that can be used to print <parameter>buffer</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link> to print
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new print compositor object.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-new-from-view" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_new_from_view ()</title>
<indexterm zone="gtk-source-print-compositor-new-from-view" role="2.2"><primary sortas="gtk_source_print_compositor_new_from_view">gtk_source_print_compositor_new_from_view</primary></indexterm><programlisting><link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> * gtk_source_print_compositor_new_from_view
                                                        (<link linkend="GtkSourceView">GtkSourceView</link> *view);</programlisting>
<para>
Creates a new print compositor that can be used to print the buffer
associated with <parameter>view</parameter>.
This constructor sets some configuration properties to make the 
printed output match <parameter>view</parameter> as much as possible.  The properties set are
<link linkend="GtkSourcePrintCompositor--tab-width"><type>"tab-width"</type></link>, <link linkend="GtkSourcePrintCompositor--highlight-syntax"><type>"highlight-syntax"</type></link>, 
<link linkend="GtkSourcePrintCompositor--wrap-mode"><type>"wrap-mode"</type></link>, <link linkend="GtkSourcePrintCompositor--body-font-name"><type>"body-font-name"</type></link> and
<link linkend="GtkSourcePrintCompositor--print-line-numbers"><type>"print-line-numbers"</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>view</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceView"><type>GtkSourceView</type></link> to get configuration from.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new print compositor object.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-get-buffer" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_get_buffer ()</title>
<indexterm zone="gtk-source-print-compositor-get-buffer" role="2.2"><primary sortas="gtk_source_print_compositor_get_buffer">gtk_source_print_compositor_get_buffer</primary></indexterm><programlisting><link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *   gtk_source_print_compositor_get_buffer
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);</programlisting>
<para>
Gets the <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link> associated with the compositor. The returned
object reference is owned by the compositor object and
should not be unreferenced.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link> associated with the compositor.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-set-tab-width" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_set_tab_width ()</title>
<indexterm zone="gtk-source-print-compositor-set-tab-width" role="2.2"><primary sortas="gtk_source_print_compositor_set_tab_width">gtk_source_print_compositor_set_tab_width</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_print_compositor_set_tab_width
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="guint">guint</link> width);</programlisting>
<para>
Sets the width of tabulation in characters for printed text. 
</para>
<para>
This function cannot be called anymore after the first call to the 
<link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&#160;:</term>
<listitem><simpara> width of tab in characters.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-get-tab-width" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_get_tab_width ()</title>
<indexterm zone="gtk-source-print-compositor-get-tab-width" role="2.2"><primary sortas="gtk_source_print_compositor_get_tab_width">gtk_source_print_compositor_get_tab_width</primary></indexterm><programlisting><link linkend="guint">guint</link>               gtk_source_print_compositor_get_tab_width
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);</programlisting>
<para>
Returns the width of tabulation in characters for printed text.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> width of tab.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-set-wrap-mode" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_set_wrap_mode ()</title>
<indexterm zone="gtk-source-print-compositor-set-wrap-mode" role="2.2"><primary sortas="gtk_source_print_compositor_set_wrap_mode">gtk_source_print_compositor_set_wrap_mode</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_print_compositor_set_wrap_mode
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="GtkWrapMode">GtkWrapMode</link> wrap_mode);</programlisting>
<para>
Sets the line wrapping mode for the printed text.
</para>
<para>
This function cannot be called anymore after the first call to the 
<link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>wrap_mode</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkWrapMode"><type>GtkWrapMode</type></link>.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-get-wrap-mode" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_get_wrap_mode ()</title>
<indexterm zone="gtk-source-print-compositor-get-wrap-mode" role="2.2"><primary sortas="gtk_source_print_compositor_get_wrap_mode">gtk_source_print_compositor_get_wrap_mode</primary></indexterm><programlisting><link linkend="GtkWrapMode">GtkWrapMode</link>         gtk_source_print_compositor_get_wrap_mode
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);</programlisting>
<para>
Gets the line wrapping mode for the printed text.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the line wrap mode.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-set-highlight-syntax" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_set_highlight_syntax ()</title>
<indexterm zone="gtk-source-print-compositor-set-highlight-syntax" role="2.2"><primary sortas="gtk_source_print_compositor_set_highlight_syntax">gtk_source_print_compositor_set_highlight_syntax</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_print_compositor_set_highlight_syntax
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="gboolean">gboolean</link> highlight);</programlisting>
<para>
Sets whether the printed text will be highlighted according to the
buffer rules.  Both color and font style are applied.
</para>
<para>
This function cannot be called anymore after the first call to the 
<link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>highlight</parameter>&#160;:</term>
<listitem><simpara> whether syntax should be highlighted.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-get-highlight-syntax" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_get_highlight_syntax ()</title>
<indexterm zone="gtk-source-print-compositor-get-highlight-syntax" role="2.2"><primary sortas="gtk_source_print_compositor_get_highlight_syntax">gtk_source_print_compositor_get_highlight_syntax</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_source_print_compositor_get_highlight_syntax
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);</programlisting>
<para>
Determines whether the printed text will be highlighted according to the
buffer rules.  Note that highlighting will happen
only if the buffer to print has highlighting activated.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the printed output will be highlighted.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-set-print-line-numbers" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_set_print_line_numbers ()</title>
<indexterm zone="gtk-source-print-compositor-set-print-line-numbers" role="2.2"><primary sortas="gtk_source_print_compositor_set_print_line_numbers">gtk_source_print_compositor_set_print_line_numbers</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_print_compositor_set_print_line_numbers
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="guint">guint</link> interval);</programlisting>
<para>
Sets the interval for printed line numbers.  If <parameter>interval</parameter> is 0 no
numbers will be printed.  If greater than 0, a number will be
printed every <parameter>interval</parameter> lines (i.e. 1 will print all line numbers).
</para>
<para>
Maximum accepted value for <parameter>interval</parameter> is 100.
</para>
<para>
This function cannot be called anymore after the first call to the 
<link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>interval</parameter>&#160;:</term>
<listitem><simpara> interval for printed line numbers.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-get-print-line-numbers" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_get_print_line_numbers ()</title>
<indexterm zone="gtk-source-print-compositor-get-print-line-numbers" role="2.2"><primary sortas="gtk_source_print_compositor_get_print_line_numbers">gtk_source_print_compositor_get_print_line_numbers</primary></indexterm><programlisting><link linkend="guint">guint</link>               gtk_source_print_compositor_get_print_line_numbers
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);</programlisting>
<para>
Returns the interval used for line number printing.  If the
value is 0, no line numbers will be printed.  The default value is
1 (i.e. numbers printed in all lines).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the interval of printed line numbers.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-set-body-font-name" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_set_body_font_name ()</title>
<indexterm zone="gtk-source-print-compositor-set-body-font-name" role="2.2"><primary sortas="gtk_source_print_compositor_set_body_font_name">gtk_source_print_compositor_set_body_font_name</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_print_compositor_set_body_font_name
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         const <link linkend="gchar">gchar</link> *font_name);</programlisting>
<para>
Sets the default font for the printed text. 
</para>
<para>
<parameter>font_name</parameter> should be a
string representation of a font description Pango can understand.
(e.g. &quot;Monospace 10&quot;). See <link linkend="pango-font-description-from-string"><function>pango_font_description_from_string()</function></link>
for a description of the format of the string representation. 
</para>
<para>
This function cannot be called anymore after the first call to the 
<link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>font_name</parameter>&#160;:</term>
<listitem><simpara> the name of the default font for the body text.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-get-body-font-name" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_get_body_font_name ()</title>
<indexterm zone="gtk-source-print-compositor-get-body-font-name" role="2.2"><primary sortas="gtk_source_print_compositor_get_body_font_name">gtk_source_print_compositor_get_body_font_name</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             gtk_source_print_compositor_get_body_font_name
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);</programlisting>
<para>
Returns the name of the font used to print the text body. The returned string
must be freed with <link linkend="g-free"><function>g_free()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new string containing the name of the font used to print the 
text body.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-set-line-numbers-font-name" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_set_line_numbers_font_name ()</title>
<indexterm zone="gtk-source-print-compositor-set-line-numbers-font-name" role="2.2"><primary sortas="gtk_source_print_compositor_set_line_numbers_font_name">gtk_source_print_compositor_set_line_numbers_font_name</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_print_compositor_set_line_numbers_font_name
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         const <link linkend="gchar">gchar</link> *font_name);</programlisting>
<para>
Sets the font for printing line numbers on the left margin.  If
<link linkend="NULL--CAPS"><literal>NULL</literal></link> is supplied, the default font (i.e. the one being used for the
text) will be used instead.  
</para>
<para>
<parameter>font_name</parameter> should be a
string representation of a font description Pango can understand.
(e.g. &quot;Monospace 10&quot;). See <link linkend="pango-font-description-from-string"><function>pango_font_description_from_string()</function></link>
for a description of the format of the string representation. 
</para>
<para>
This function cannot be called anymore after the first call to the 
<link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>font_name</parameter>&#160;:</term>
<listitem><simpara> the name of the font for line numbers, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-get-line-numbers-font-name" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_get_line_numbers_font_name ()</title>
<indexterm zone="gtk-source-print-compositor-get-line-numbers-font-name" role="2.2"><primary sortas="gtk_source_print_compositor_get_line_numbers_font_name">gtk_source_print_compositor_get_line_numbers_font_name</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             gtk_source_print_compositor_get_line_numbers_font_name
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);</programlisting>
<para>
Returns the name of the font used to print line numbers on the left margin. 
The returned string must be freed with <link linkend="g-free"><function>g_free()</function></link>)</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new string containing the name of the font used to print 
line numbers on the left margin.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-set-header-font-name" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_set_header_font_name ()</title>
<indexterm zone="gtk-source-print-compositor-set-header-font-name" role="2.2"><primary sortas="gtk_source_print_compositor_set_header_font_name">gtk_source_print_compositor_set_header_font_name</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_print_compositor_set_header_font_name
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         const <link linkend="gchar">gchar</link> *font_name);</programlisting>
<para>
Sets the font for printing the page header. If
<link linkend="NULL--CAPS"><literal>NULL</literal></link> is supplied, the default font (i.e. the one being used for the
text) will be used instead.  
</para>
<para>
<parameter>font_name</parameter> should be a
string representation of a font description Pango can understand.
(e.g. &quot;Monospace 10&quot;). See <link linkend="pango-font-description-from-string"><function>pango_font_description_from_string()</function></link>
for a description of the format of the string representation. 
</para>
<para>
This function cannot be called anymore after the first call to the 
<link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>font_name</parameter>&#160;:</term>
<listitem><simpara> the name of the font for header text, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-get-header-font-name" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_get_header_font_name ()</title>
<indexterm zone="gtk-source-print-compositor-get-header-font-name" role="2.2"><primary sortas="gtk_source_print_compositor_get_header_font_name">gtk_source_print_compositor_get_header_font_name</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             gtk_source_print_compositor_get_header_font_name
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);</programlisting>
<para>
Returns the name of the font used to print the page header. 
The returned string must be freed with <link linkend="g-free"><function>g_free()</function></link>)</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new string containing the name of the font used to print 
the page header.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-set-footer-font-name" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_set_footer_font_name ()</title>
<indexterm zone="gtk-source-print-compositor-set-footer-font-name" role="2.2"><primary sortas="gtk_source_print_compositor_set_footer_font_name">gtk_source_print_compositor_set_footer_font_name</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_print_compositor_set_footer_font_name
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         const <link linkend="gchar">gchar</link> *font_name);</programlisting>
<para>
Sets the font for printing the page footer. If
<link linkend="NULL--CAPS"><literal>NULL</literal></link> is supplied, the default font (i.e. the one being used for the
text) will be used instead.  
</para>
<para>
<parameter>font_name</parameter> should be a
string representation of a font description Pango can understand.
(e.g. &quot;Monospace 10&quot;). See <link linkend="pango-font-description-from-string"><function>pango_font_description_from_string()</function></link>
for a description of the format of the string representation. 
</para>
<para>
This function cannot be called anymore after the first call to the 
<link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>font_name</parameter>&#160;:</term>
<listitem><simpara> the name of the font for the footer text, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-get-footer-font-name" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_get_footer_font_name ()</title>
<indexterm zone="gtk-source-print-compositor-get-footer-font-name" role="2.2"><primary sortas="gtk_source_print_compositor_get_footer_font_name">gtk_source_print_compositor_get_footer_font_name</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             gtk_source_print_compositor_get_footer_font_name
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);</programlisting>
<para>
Returns the name of the font used to print the page footer. 
The returned string must be freed with <link linkend="g-free"><function>g_free()</function></link>)</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new string containing the name of the font used to print 
the page footer.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-get-top-margin" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_get_top_margin ()</title>
<indexterm zone="gtk-source-print-compositor-get-top-margin" role="2.2"><primary sortas="gtk_source_print_compositor_get_top_margin">gtk_source_print_compositor_get_top_margin</primary></indexterm><programlisting><link linkend="gdouble">gdouble</link>             gtk_source_print_compositor_get_top_margin
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="GtkUnit">GtkUnit</link> unit);</programlisting>
<para>
Gets the top margin in units of <parameter>unit</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>unit</parameter>&#160;:</term>
<listitem><simpara> the unit for the return value.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the top margin.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-set-top-margin" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_set_top_margin ()</title>
<indexterm zone="gtk-source-print-compositor-set-top-margin" role="2.2"><primary sortas="gtk_source_print_compositor_set_top_margin">gtk_source_print_compositor_set_top_margin</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_print_compositor_set_top_margin
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="gdouble">gdouble</link> margin,
                                                         <link linkend="GtkUnit">GtkUnit</link> unit);</programlisting>
<para>
Sets the top margin used by <parameter>compositor</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>margin</parameter>&#160;:</term>
<listitem><simpara> the new top margin in units of <parameter>unit</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>unit</parameter>&#160;:</term>
<listitem><simpara> the units for <parameter>margin</parameter>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-get-bottom-margin" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_get_bottom_margin ()</title>
<indexterm zone="gtk-source-print-compositor-get-bottom-margin" role="2.2"><primary sortas="gtk_source_print_compositor_get_bottom_margin">gtk_source_print_compositor_get_bottom_margin</primary></indexterm><programlisting><link linkend="gdouble">gdouble</link>             gtk_source_print_compositor_get_bottom_margin
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="GtkUnit">GtkUnit</link> unit);</programlisting>
<para>
Gets the bottom margin in units of <parameter>unit</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>unit</parameter>&#160;:</term>
<listitem><simpara> the unit for the return value.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the bottom margin.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-set-bottom-margin" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_set_bottom_margin ()</title>
<indexterm zone="gtk-source-print-compositor-set-bottom-margin" role="2.2"><primary sortas="gtk_source_print_compositor_set_bottom_margin">gtk_source_print_compositor_set_bottom_margin</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_print_compositor_set_bottom_margin
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="gdouble">gdouble</link> margin,
                                                         <link linkend="GtkUnit">GtkUnit</link> unit);</programlisting>
<para>
Sets the bottom margin used by <parameter>compositor</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>margin</parameter>&#160;:</term>
<listitem><simpara> the new bottom margin in units of <parameter>unit</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>unit</parameter>&#160;:</term>
<listitem><simpara> the units for <parameter>margin</parameter>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-get-left-margin" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_get_left_margin ()</title>
<indexterm zone="gtk-source-print-compositor-get-left-margin" role="2.2"><primary sortas="gtk_source_print_compositor_get_left_margin">gtk_source_print_compositor_get_left_margin</primary></indexterm><programlisting><link linkend="gdouble">gdouble</link>             gtk_source_print_compositor_get_left_margin
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="GtkUnit">GtkUnit</link> unit);</programlisting>
<para>
Gets the left margin in units of <parameter>unit</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>unit</parameter>&#160;:</term>
<listitem><simpara> the unit for the return value.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the left margin

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-set-left-margin" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_set_left_margin ()</title>
<indexterm zone="gtk-source-print-compositor-set-left-margin" role="2.2"><primary sortas="gtk_source_print_compositor_set_left_margin">gtk_source_print_compositor_set_left_margin</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_print_compositor_set_left_margin
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="gdouble">gdouble</link> margin,
                                                         <link linkend="GtkUnit">GtkUnit</link> unit);</programlisting>
<para>
Sets the left margin used by <parameter>compositor</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>margin</parameter>&#160;:</term>
<listitem><simpara> the new left margin in units of <parameter>unit</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>unit</parameter>&#160;:</term>
<listitem><simpara> the units for <parameter>margin</parameter>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-get-right-margin" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_get_right_margin ()</title>
<indexterm zone="gtk-source-print-compositor-get-right-margin" role="2.2"><primary sortas="gtk_source_print_compositor_get_right_margin">gtk_source_print_compositor_get_right_margin</primary></indexterm><programlisting><link linkend="gdouble">gdouble</link>             gtk_source_print_compositor_get_right_margin
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="GtkUnit">GtkUnit</link> unit);</programlisting>
<para>
Gets the right margin in units of <parameter>unit</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>unit</parameter>&#160;:</term>
<listitem><simpara> the unit for the return value.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the right margin

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-set-right-margin" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_set_right_margin ()</title>
<indexterm zone="gtk-source-print-compositor-set-right-margin" role="2.2"><primary sortas="gtk_source_print_compositor_set_right_margin">gtk_source_print_compositor_set_right_margin</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_print_compositor_set_right_margin
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="gdouble">gdouble</link> margin,
                                                         <link linkend="GtkUnit">GtkUnit</link> unit);</programlisting>
<para>
Sets the right margin used by <parameter>compositor</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>margin</parameter>&#160;:</term>
<listitem><simpara> the new right margin in units of <parameter>unit</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>unit</parameter>&#160;:</term>
<listitem><simpara> the units for <parameter>margin</parameter>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-set-print-header" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_set_print_header ()</title>
<indexterm zone="gtk-source-print-compositor-set-print-header" role="2.2"><primary sortas="gtk_source_print_compositor_set_print_header">gtk_source_print_compositor_set_print_header</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_print_compositor_set_print_header
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="gboolean">gboolean</link> print);</programlisting>
<para>
Sets whether you want to print a header in each page.  The 
header consists of three pieces of text and an optional line
separator, configurable with
<link linkend="gtk-source-print-compositor-set-header-format"><function>gtk_source_print_compositor_set_header_format()</function></link>.
</para>
<para>
Note that by default the header format is unspecified, and if it's
empty it will not be printed, regardless of this setting.
</para>
<para>
This function cannot be called anymore after the first call to the 
<link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>print</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if you want the header to be printed.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-get-print-header" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_get_print_header ()</title>
<indexterm zone="gtk-source-print-compositor-get-print-header" role="2.2"><primary sortas="gtk_source_print_compositor_get_print_header">gtk_source_print_compositor_get_print_header</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_source_print_compositor_get_print_header
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);</programlisting>
<para>
Determines if a header is set to be printed for each page.  A
header will be printed if this function returns <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>
<emphasis>and</emphasis> some format strings have been specified
with <link linkend="gtk-source-print-compositor-set-header-format"><function>gtk_source_print_compositor_set_header_format()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the header is set to be printed.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-set-print-footer" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_set_print_footer ()</title>
<indexterm zone="gtk-source-print-compositor-set-print-footer" role="2.2"><primary sortas="gtk_source_print_compositor_set_print_footer">gtk_source_print_compositor_set_print_footer</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_print_compositor_set_print_footer
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="gboolean">gboolean</link> print);</programlisting>
<para>
Sets whether you want to print a footer in each page.  The 
footer consists of three pieces of text and an optional line
separator, configurable with
<link linkend="gtk-source-print-compositor-set-footer-format"><function>gtk_source_print_compositor_set_footer_format()</function></link>.
</para>
<para>
Note that by default the footer format is unspecified, and if it's
empty it will not be printed, regardless of this setting.
</para>
<para>
This function cannot be called anymore after the first call to the 
<link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>print</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if you want the footer to be printed.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-get-print-footer" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_get_print_footer ()</title>
<indexterm zone="gtk-source-print-compositor-get-print-footer" role="2.2"><primary sortas="gtk_source_print_compositor_get_print_footer">gtk_source_print_compositor_get_print_footer</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_source_print_compositor_get_print_footer
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);</programlisting>
<para>
Determines if a footer is set to be printed for each page.  A
footer will be printed if this function returns <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>
<emphasis>and</emphasis> some format strings have been specified
with <link linkend="gtk-source-print-compositor-set-footer-format"><function>gtk_source_print_compositor_set_footer_format()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the footer is set to be printed.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-set-header-format" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_set_header_format ()</title>
<indexterm zone="gtk-source-print-compositor-set-header-format" role="2.2"><primary sortas="gtk_source_print_compositor_set_header_format">gtk_source_print_compositor_set_header_format</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_print_compositor_set_header_format
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="gboolean">gboolean</link> separator,
                                                         const <link linkend="gchar">gchar</link> *left,
                                                         const <link linkend="gchar">gchar</link> *center,
                                                         const <link linkend="gchar">gchar</link> *right);</programlisting>
<para>
Sets strftime like header format strings, to be printed on the
left, center and right of the top of each page.  The strings may
include strftime(3) codes which will be expanded at print time.
All <link linkend="strftime"><function>strftime()</function></link> codes are accepted, with the addition of <link linkend="N--CAPS"><literal>N</literal></link> for the
page number and <link linkend="Q--CAPS"><literal>Q</literal></link> for the page count.
</para>
<para>
<parameter>separator</parameter> specifies if a solid line should be drawn to separate
the header from the document text.
</para>
<para>
If <link linkend="NULL--CAPS"><literal>NULL</literal></link> is given for any of the three arguments, that particular
string will not be printed.
</para>
<para>
For the header to be printed, in
addition to specifying format strings, you need to enable header
printing with <link linkend="gtk-source-print-compositor-set-print-header"><function>gtk_source_print_compositor_set_print_header()</function></link>.
</para>
<para>
This function cannot be called anymore after the first call to the 
<link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>separator</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if you want a separator line to be printed.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>left</parameter>&#160;:</term>
<listitem><simpara> a format string to print on the left of the header.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>center</parameter>&#160;:</term>
<listitem><simpara> a format string to print on the center of the header.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>right</parameter>&#160;:</term>
<listitem><simpara> a format string to print on the right of the header.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-set-footer-format" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_set_footer_format ()</title>
<indexterm zone="gtk-source-print-compositor-set-footer-format" role="2.2"><primary sortas="gtk_source_print_compositor_set_footer_format">gtk_source_print_compositor_set_footer_format</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_print_compositor_set_footer_format
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="gboolean">gboolean</link> separator,
                                                         const <link linkend="gchar">gchar</link> *left,
                                                         const <link linkend="gchar">gchar</link> *center,
                                                         const <link linkend="gchar">gchar</link> *right);</programlisting>
<para>
Sets strftime like header format strings, to be printed on the
left, center and right of the bottom of each page. The strings may
include strftime(3) codes which will be expanded at print time.
All <link linkend="strftime"><function>strftime()</function></link> codes are accepted, with the addition of <link linkend="N--CAPS"><literal>N</literal></link> for the
page number and <link linkend="Q--CAPS"><literal>Q</literal></link> for the page count.
</para>
<para>
<parameter>separator</parameter> specifies if a solid line should be drawn to separate
the footer from the document text.
</para>
<para>
If <link linkend="NULL--CAPS"><literal>NULL</literal></link> is given for any of the three arguments, that particular
string will not be printed.
</para>
<para>
For the footer to be printed, in
addition to specifying format strings, you need to enable footer
printing with <link linkend="gtk-source-print-compositor-set-print-footer"><function>gtk_source_print_compositor_set_print_footer()</function></link>.
</para>
<para>
This function cannot be called anymore after the first call to the 
<link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>separator</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if you want a separator line to be printed.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>left</parameter>&#160;:</term>
<listitem><simpara> a format string to print on the left of the footer.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>center</parameter>&#160;:</term>
<listitem><simpara> a format string to print on the center of the footer.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>right</parameter>&#160;:</term>
<listitem><simpara> a format string to print on the right of the footer.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-get-n-pages" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_get_n_pages ()</title>
<indexterm zone="gtk-source-print-compositor-get-n-pages" role="2.2"><primary sortas="gtk_source_print_compositor_get_n_pages">gtk_source_print_compositor_get_n_pages</primary></indexterm><programlisting><link linkend="gint">gint</link>                gtk_source_print_compositor_get_n_pages
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);</programlisting>
<para>
Returns the number of pages in the document or <code>-1</code> if the 
document has not been completely paginated.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the number of pages in the document or <code>-1</code> if the 
document has not been completely paginated.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-paginate" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_paginate ()</title>
<indexterm zone="gtk-source-print-compositor-paginate" role="2.2"><primary sortas="gtk_source_print_compositor_paginate">gtk_source_print_compositor_paginate</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_source_print_compositor_paginate
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="GtkPrintContext">GtkPrintContext</link> *context);</programlisting>
<para>
Paginate the document associated with the <parameter>compositor</parameter>.
</para>
<para>
In order to support non-blocking pagination, document is paginated in small chunks.
Each time <link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> is invoked, a chunk of the document 
is paginated. To paginate the entire document, <link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> 
must be invoked multiple times.
It returns <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the document has been completely paginated, otherwise it returns <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>.
</para>
<para>
This method has been designed to be invoked in the handler of the <link linkend="GtkPrintOperation-paginate"><type>"paginate"</type></link> signal,
as shown in the following example:
</para>
<para>
<informalexample><programlisting>
// Signal handler for the GtkPrintOperation::paginate signal

static gboolean
paginate (GtkPrintOperation *operation,
          GtkPrintContext   *context,
          gpointer           user_data)
{
    GtkSourcePrintCompositor *compositor;

    compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data);

    if (gtk_source_print_compositor_paginate (compositor, context))
    {
        gint n_pages;
        
        n_pages = gtk_source_print_compositor_get_n_pages (compositor);
        gtk_print_operation_set_n_pages (operation, n_pages);

        return TRUE;
    }
     
    return FALSE;
}
</programlisting></informalexample>
</para>
<para>
If you don't need to do pagination in chunks, you can simply do it all in the 
<link linkend="GtkPrintOperation-begin-print"><type>"begin-print"</type></link> handler, and set the number of pages from there, like
in the following example:
</para>
<para>
<informalexample><programlisting>
// Signal handler for the GtkPrintOperation::begin-print signal

static void
begin_print (GtkPrintOperation *operation,
             GtkPrintContext   *context,
             gpointer           user_data)
{
    GtkSourcePrintCompositor *compositor;
    gint n_pages;

    compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data);

    while (!gtk_source_print_compositor_paginate (compositor, context));

    n_pages = gtk_source_print_compositor_get_n_pages (compositor);
    gtk_print_operation_set_n_pages (operation, n_pages);
}
</programlisting></informalexample></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>context</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GtkPrintContext"><type>GtkPrintContext</type></link> whose parameters (e.g. paper size, print margins, etc.) 
are used by the the <parameter>compositor</parameter> to paginate the document.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the document has been completely paginated, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-get-pagination-progress" role="function" condition="since:2.2">
<title>gtk_source_print_compositor_get_pagination_progress ()</title>
<indexterm zone="gtk-source-print-compositor-get-pagination-progress" role="2.2"><primary sortas="gtk_source_print_compositor_get_pagination_progress">gtk_source_print_compositor_get_pagination_progress</primary></indexterm><programlisting><link linkend="gdouble">gdouble</link>             gtk_source_print_compositor_get_pagination_progress
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor);</programlisting>
<para>
Returns the current fraction of the document pagination that has been completed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a fraction from 0.0 to 1.0 inclusive

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-print-compositor-draw-page" role="function">
<title>gtk_source_print_compositor_draw_page ()</title>
<indexterm zone="gtk-source-print-compositor-draw-page"><primary sortas="gtk_source_print_compositor_draw_page">gtk_source_print_compositor_draw_page</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_print_compositor_draw_page
                                                        (<link linkend="GtkSourcePrintCompositor">GtkSourcePrintCompositor</link> *compositor,
                                                         <link linkend="GtkPrintContext">GtkPrintContext</link> *context,
                                                         <link linkend="gint">gint</link> page_nr);</programlisting>
<para>
Draw page <parameter>page_nr</parameter> for printing on the the Cairo context encapsuled in <parameter>context</parameter>.
</para>
<para>
This method has been designed to be called in the handler of the <link linkend="GtkPrintOperation-draw-page"><type>"draw_page"</type></link> signal
as shown in the following example:
</para>
<para>
<informalexample><programlisting>
// Signal handler for the GtkPrintOperation::draw_page signal

static void
draw_page (GtkPrintOperation *operation,
           GtkPrintContext   *context,
           gint               page_nr,
           gpointer           user_data)
{
    GtkSourcePrintCompositor *compositor;

    compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data);

    gtk_source_print_compositor_draw_page (compositor, 
                                           context,
                                           page_nr);
}
</programlisting></informalexample></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>compositor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourcePrintCompositor"><type>GtkSourcePrintCompositor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>context</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GtkPrintContext"><type>GtkPrintContext</type></link> encapsulating the context information that is required when 
          drawing the page for printing.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>page_nr</parameter>&#160;:</term>
<listitem><simpara> the number of the page to print.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>
<refsect1 id="GtkSourcePrintCompositor.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkSourcePrintCompositor--body-font-name" role="property"><title>The <literal>&quot;body-font-name&quot;</literal> property</title>
<indexterm zone="GtkSourcePrintCompositor--body-font-name" role="2.2"><primary sortas="GtkSourcePrintCompositor:body-font-name">GtkSourcePrintCompositor:body-font-name</primary></indexterm><programlisting>  &quot;body-font-name&quot;           <link linkend="gchar">gchar</link>*                : Read / Write</programlisting>
<para>
Name of the font used for the text body.
</para>
<para>
Accepted values are strings representing a font description Pango can understand.
(e.g. &quot;Monospace 10&quot;). See <link linkend="pango-font-description-from-string"><function>pango_font_description_from_string()</function></link>
for a description of the format of the string representation. 
</para>
<para>
The value of this property cannot be changed anymore after the first 
call to the <link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><para>Default value: NULL</para>
<para>Since 2.2</para>
</refsect2>
<refsect2 id="GtkSourcePrintCompositor--buffer" role="property"><title>The <literal>&quot;buffer&quot;</literal> property</title>
<indexterm zone="GtkSourcePrintCompositor--buffer" role="2.2"><primary sortas="GtkSourcePrintCompositor:buffer">GtkSourcePrintCompositor:buffer</primary></indexterm><programlisting>  &quot;buffer&quot;                   <link linkend="GtkSourceBuffer">GtkSourceBuffer</link>*      : Read / Write / Construct Only</programlisting>
<para>
The GtkSourceBuffer object to print.</para>
<para>
</para><para>Since 2.2</para>
</refsect2>
<refsect2 id="GtkSourcePrintCompositor--footer-font-name" role="property"><title>The <literal>&quot;footer-font-name&quot;</literal> property</title>
<indexterm zone="GtkSourcePrintCompositor--footer-font-name" role="2.2"><primary sortas="GtkSourcePrintCompositor:footer-font-name">GtkSourcePrintCompositor:footer-font-name</primary></indexterm><programlisting>  &quot;footer-font-name&quot;         <link linkend="gchar">gchar</link>*                : Read / Write</programlisting>
<para>
Name of the font used to print page footer.  
If this property is unspecified, the text body font is used.
</para>
<para>
Accepted values are strings representing a font description Pango can understand.
(e.g. &quot;Monospace 10&quot;). See <link linkend="pango-font-description-from-string"><function>pango_font_description_from_string()</function></link>
for a description of the format of the string representation. 
</para>
<para>
The value of this property cannot be changed anymore after the first 
call to the <link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><para>Default value: NULL</para>
<para>Since 2.2</para>
</refsect2>
<refsect2 id="GtkSourcePrintCompositor--header-font-name" role="property"><title>The <literal>&quot;header-font-name&quot;</literal> property</title>
<indexterm zone="GtkSourcePrintCompositor--header-font-name" role="2.2"><primary sortas="GtkSourcePrintCompositor:header-font-name">GtkSourcePrintCompositor:header-font-name</primary></indexterm><programlisting>  &quot;header-font-name&quot;         <link linkend="gchar">gchar</link>*                : Read / Write</programlisting>
<para>
Name of the font used to print page header.  
If this property is unspecified, the text body font is used.
</para>
<para>
Accepted values are strings representing a font description Pango can understand.
(e.g. &quot;Monospace 10&quot;). See <link linkend="pango-font-description-from-string"><function>pango_font_description_from_string()</function></link>
for a description of the format of the string representation. 
</para>
<para>
The value of this property cannot be changed anymore after the first 
call to the <link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><para>Default value: NULL</para>
<para>Since 2.2</para>
</refsect2>
<refsect2 id="GtkSourcePrintCompositor--highlight-syntax" role="property"><title>The <literal>&quot;highlight-syntax&quot;</literal> property</title>
<indexterm zone="GtkSourcePrintCompositor--highlight-syntax" role="2.2"><primary sortas="GtkSourcePrintCompositor:highlight-syntax">GtkSourcePrintCompositor:highlight-syntax</primary></indexterm><programlisting>  &quot;highlight-syntax&quot;         <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>
Whether to print the document with highlighted syntax.
 
The value of this property cannot be changed anymore after the first 
call to the <link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><para>Default value: TRUE</para>
<para>Since 2.2</para>
</refsect2>
<refsect2 id="GtkSourcePrintCompositor--line-numbers-font-name" role="property"><title>The <literal>&quot;line-numbers-font-name&quot;</literal> property</title>
<indexterm zone="GtkSourcePrintCompositor--line-numbers-font-name" role="2.2"><primary sortas="GtkSourcePrintCompositor:line-numbers-font-name">GtkSourcePrintCompositor:line-numbers-font-name</primary></indexterm><programlisting>  &quot;line-numbers-font-name&quot;   <link linkend="gchar">gchar</link>*                : Read / Write</programlisting>
<para>
Name of the font used to print line numbers on the left margin.  
If this property is unspecified, the text body font is used.
</para>
<para>
Accepted values are strings representing a font description Pango can understand.
(e.g. &quot;Monospace 10&quot;). See <link linkend="pango-font-description-from-string"><function>pango_font_description_from_string()</function></link>
for a description of the format of the string representation. 
</para>
<para>
The value of this property cannot be changed anymore after the first 
call to the <link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><para>Default value: NULL</para>
<para>Since 2.2</para>
</refsect2>
<refsect2 id="GtkSourcePrintCompositor--n-pages" role="property"><title>The <literal>&quot;n-pages&quot;</literal> property</title>
<indexterm zone="GtkSourcePrintCompositor--n-pages" role="2.2"><primary sortas="GtkSourcePrintCompositor:n-pages">GtkSourcePrintCompositor:n-pages</primary></indexterm><programlisting>  &quot;n-pages&quot;                  <link linkend="gint">gint</link>                  : Read</programlisting>
<para>
The number of pages in the document or <code>-1</code> if the 
document has not been completely paginated.</para>
<para>
</para><para>Allowed values: &gt;= -1</para>
<para>Default value: -1</para>
<para>Since 2.2</para>
</refsect2>
<refsect2 id="GtkSourcePrintCompositor--print-footer" role="property"><title>The <literal>&quot;print-footer&quot;</literal> property</title>
<indexterm zone="GtkSourcePrintCompositor--print-footer" role="2.2"><primary sortas="GtkSourcePrintCompositor:print-footer">GtkSourcePrintCompositor:print-footer</primary></indexterm><programlisting>  &quot;print-footer&quot;             <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>
Whether to print a footer in each page.
</para>
<para>
Note that by default the footer format is unspecified, and if it is
unspecified the footer will not be printed, regardless of the value of 
this property.
</para>
<para>
The value of this property cannot be changed anymore after the first 
call to the <link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><para>Default value: FALSE</para>
<para>Since 2.2</para>
</refsect2>
<refsect2 id="GtkSourcePrintCompositor--print-header" role="property"><title>The <literal>&quot;print-header&quot;</literal> property</title>
<indexterm zone="GtkSourcePrintCompositor--print-header" role="2.2"><primary sortas="GtkSourcePrintCompositor:print-header">GtkSourcePrintCompositor:print-header</primary></indexterm><programlisting>  &quot;print-header&quot;             <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>
Whether to print a header in each page.
</para>
<para>
Note that by default the header format is unspecified, and if it is
unspecified the header will not be printed, regardless of the value of 
this property.
</para>
<para>
The value of this property cannot be changed anymore after the first 
call to the <link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><para>Default value: FALSE</para>
<para>Since 2.2</para>
</refsect2>
<refsect2 id="GtkSourcePrintCompositor--print-line-numbers" role="property"><title>The <literal>&quot;print-line-numbers&quot;</literal> property</title>
<indexterm zone="GtkSourcePrintCompositor--print-line-numbers" role="2.2"><primary sortas="GtkSourcePrintCompositor:print-line-numbers">GtkSourcePrintCompositor:print-line-numbers</primary></indexterm><programlisting>  &quot;print-line-numbers&quot;       <link linkend="guint">guint</link>                 : Read / Write</programlisting>
<para>
Interval of printed line numbers. If this property is set to 0 no
numbers will be printed.  If greater than 0, a number will be
printed every "print-line-numbers" lines (i.e. 1 will print all line numbers).
</para>
<para>
The value of this property cannot be changed anymore after the first 
call to the <link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><para>Allowed values: &lt;= 100</para>
<para>Default value: 1</para>
<para>Since 2.2</para>
</refsect2>
<refsect2 id="GtkSourcePrintCompositor--tab-width" role="property"><title>The <literal>&quot;tab-width&quot;</literal> property</title>
<indexterm zone="GtkSourcePrintCompositor--tab-width" role="2.2"><primary sortas="GtkSourcePrintCompositor:tab-width">GtkSourcePrintCompositor:tab-width</primary></indexterm><programlisting>  &quot;tab-width&quot;                <link linkend="guint">guint</link>                 : Read / Write</programlisting>
<para>
Width of a tab character expressed in spaces.
</para>
<para>
The value of this property cannot be changed anymore after the first 
call to the <link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><para>Allowed values: [1,32]</para>
<para>Default value: 8</para>
<para>Since 2.2</para>
</refsect2>
<refsect2 id="GtkSourcePrintCompositor--wrap-mode" role="property"><title>The <literal>&quot;wrap-mode&quot;</literal> property</title>
<indexterm zone="GtkSourcePrintCompositor--wrap-mode" role="2.2"><primary sortas="GtkSourcePrintCompositor:wrap-mode">GtkSourcePrintCompositor:wrap-mode</primary></indexterm><programlisting>  &quot;wrap-mode&quot;                <link linkend="GtkWrapMode">GtkWrapMode</link>           : Read / Write</programlisting>
<para>
Whether to wrap lines never, at word boundaries, or at character boundaries.
</para>
<para>
The value of this property cannot be changed anymore after the first 
call to the <link linkend="gtk-source-print-compositor-paginate"><function>gtk_source_print_compositor_paginate()</function></link> function.</para>
<para>
</para><para>Default value: GTK_WRAP_NONE</para>
<para>Since 2.2</para>
</refsect2>

</refsect1>



<refsect1 id="GtkSourcePrintCompositor.see-also">
<title>See Also</title>
<para>
The reference documentation for <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.  You might also want
to check the Printing section of the gtk+ reference
documentation.
</para>
</refsect1>

</refentry>
