<!-- ##### SECTION Title ##### -->
GtkSourcePrintCompositor

<!-- ##### SECTION Short_Description ##### -->
Compose a #GtkSourceBuffer for printing.

<!-- ##### SECTION Long_Description ##### -->
<para>
The #GtkSourcePrintCompositor object is used to compose a 
#GtkSourceBuffer for printing.  You can set various configuration options to
customize the printed output. #GtkSourcePrintCompositor is designed to be used with
the high-level printing API of gtk+, i.e. #GtkPrintOperation.
</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 #GtkPageSetup objects. 
If the specified layout margins are smaller than the "print margins", the latter ones are used
as a fallback by the #GtkSourcePrintCompositor 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 #GtkSourcePrintJob is to produce a #GnomePrintJob.  What
this means is that once you get the resulting #GnomePrintJob, you
might reuse the #GtkSourcePrintJob 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
#GtkSourceBuffer you want to print (using
gtk_source_print_job_set_buffer ()).  Besides that, you might
configure word wrapping, font, whether to print hightlighted text as
seen in the #GtkSourceView, line numbers, basic headers and footers.
</para>

<para>
#GtkSourcePrintJob can print basic headers and footers in each page.
You can specify strftime() like strings for text on the left, right
and center of the top and bottom of the page.  You can also make
#GtkSourcePrintJob 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
gtk_source_print_job_set_text_margins().  Whenever #GtkSourcePrintJob
is about to print a new text page, the signal will be emitted.  You
can then get the #GnomePrintContext being used with
gtk_source_print_job_get_print_context() and use Gnome Print functions
directly.  The space you allocate is inside the document margins
defined in the specified #GnomePrintConfig, but outside all print area
used by #GtkSourcePrintJob itself.
</para>

<para>
A quick bootstrap code sequence to get you started using
#GtkSourcePrintJob 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>
-->

<!-- ##### SECTION See_Also ##### -->
<para>
The reference documentation for #GtkSourceBuffer.  You might also want
to check the Printing section of the gtk+ reference
documentation.
</para>

<!-- ##### SECTION Stability_Level ##### -->


<!-- ##### STRUCT GtkSourcePrintCompositor ##### -->
<para>

</para>


<!-- ##### ARG GtkSourcePrintCompositor:body-font-name ##### -->
<para>

</para>

<!-- ##### ARG GtkSourcePrintCompositor:buffer ##### -->
<para>

</para>

<!-- ##### ARG GtkSourcePrintCompositor:footer-font-name ##### -->
<para>

</para>

<!-- ##### ARG GtkSourcePrintCompositor:header-font-name ##### -->
<para>

</para>

<!-- ##### ARG GtkSourcePrintCompositor:highlight-syntax ##### -->
<para>

</para>

<!-- ##### ARG GtkSourcePrintCompositor:line-numbers-font-name ##### -->
<para>

</para>

<!-- ##### ARG GtkSourcePrintCompositor:n-pages ##### -->
<para>

</para>

<!-- ##### ARG GtkSourcePrintCompositor:print-footer ##### -->
<para>

</para>

<!-- ##### ARG GtkSourcePrintCompositor:print-header ##### -->
<para>

</para>

<!-- ##### ARG GtkSourcePrintCompositor:print-line-numbers ##### -->
<para>

</para>

<!-- ##### ARG GtkSourcePrintCompositor:tab-width ##### -->
<para>

</para>

<!-- ##### ARG GtkSourcePrintCompositor:wrap-mode ##### -->
<para>

</para>

<!-- ##### FUNCTION gtk_source_print_compositor_new ##### -->
<para>

</para>

@buffer: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_new_from_view ##### -->
<para>

</para>

@view: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_get_buffer ##### -->
<para>

</para>

@compositor: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_set_tab_width ##### -->
<para>

</para>

@compositor: 
@width: 


<!-- ##### FUNCTION gtk_source_print_compositor_get_tab_width ##### -->
<para>

</para>

@compositor: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_set_wrap_mode ##### -->
<para>

</para>

@compositor: 
@wrap_mode: 


<!-- ##### FUNCTION gtk_source_print_compositor_get_wrap_mode ##### -->
<para>

</para>

@compositor: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_set_highlight_syntax ##### -->
<para>

</para>

@compositor: 
@highlight: 


<!-- ##### FUNCTION gtk_source_print_compositor_get_highlight_syntax ##### -->
<para>

</para>

@compositor: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_set_print_line_numbers ##### -->
<para>

</para>

@compositor: 
@interval: 


<!-- ##### FUNCTION gtk_source_print_compositor_get_print_line_numbers ##### -->
<para>

</para>

@compositor: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_set_body_font_name ##### -->
<para>

</para>

@compositor: 
@font_name: 


<!-- ##### FUNCTION gtk_source_print_compositor_get_body_font_name ##### -->
<para>

</para>

@compositor: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_set_line_numbers_font_name ##### -->
<para>

</para>

@compositor: 
@font_name: 


<!-- ##### FUNCTION gtk_source_print_compositor_get_line_numbers_font_name ##### -->
<para>

</para>

@compositor: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_set_header_font_name ##### -->
<para>

</para>

@compositor: 
@font_name: 


<!-- ##### FUNCTION gtk_source_print_compositor_get_header_font_name ##### -->
<para>

</para>

@compositor: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_set_footer_font_name ##### -->
<para>

</para>

@compositor: 
@font_name: 


<!-- ##### FUNCTION gtk_source_print_compositor_get_footer_font_name ##### -->
<para>

</para>

@compositor: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_get_top_margin ##### -->
<para>

</para>

@compositor: 
@unit: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_set_top_margin ##### -->
<para>

</para>

@compositor: 
@margin: 
@unit: 


<!-- ##### FUNCTION gtk_source_print_compositor_get_bottom_margin ##### -->
<para>

</para>

@compositor: 
@unit: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_set_bottom_margin ##### -->
<para>

</para>

@compositor: 
@margin: 
@unit: 


<!-- ##### FUNCTION gtk_source_print_compositor_get_left_margin ##### -->
<para>

</para>

@compositor: 
@unit: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_set_left_margin ##### -->
<para>

</para>

@compositor: 
@margin: 
@unit: 


<!-- ##### FUNCTION gtk_source_print_compositor_get_right_margin ##### -->
<para>

</para>

@compositor: 
@unit: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_set_right_margin ##### -->
<para>

</para>

@compositor: 
@margin: 
@unit: 


<!-- ##### FUNCTION gtk_source_print_compositor_set_print_header ##### -->
<para>

</para>

@compositor: 
@print: 


<!-- ##### FUNCTION gtk_source_print_compositor_get_print_header ##### -->
<para>

</para>

@compositor: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_set_print_footer ##### -->
<para>

</para>

@compositor: 
@print: 


<!-- ##### FUNCTION gtk_source_print_compositor_get_print_footer ##### -->
<para>

</para>

@compositor: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_set_header_format ##### -->
<para>

</para>

@compositor: 
@separator: 
@left: 
@center: 
@right: 


<!-- ##### FUNCTION gtk_source_print_compositor_set_footer_format ##### -->
<para>

</para>

@compositor: 
@separator: 
@left: 
@center: 
@right: 


<!-- ##### FUNCTION gtk_source_print_compositor_get_n_pages ##### -->
<para>

</para>

@compositor: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_paginate ##### -->
<para>

</para>

@compositor: 
@context: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_get_pagination_progress ##### -->
<para>

</para>

@compositor: 
@Returns: 


<!-- ##### FUNCTION gtk_source_print_compositor_draw_page ##### -->
<para>

</para>

@compositor: 
@context: 
@page_nr: 


