1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gsv.SourcePrintCompositor;
26 
27 private import glib.ConstructionException;
28 private import glib.Str;
29 private import gobject.ObjectG;
30 private import gsv.SourceBuffer;
31 private import gsv.SourceView;
32 private import gsvc.gsv;
33 public  import gsvc.gsvtypes;
34 private import gtk.PrintContext;
35 
36 
37 /** */
38 public class SourcePrintCompositor : ObjectG
39 {
40 	/** the main Gtk struct */
41 	protected GtkSourcePrintCompositor* gtkSourcePrintCompositor;
42 
43 	/** Get the main Gtk struct */
44 	public GtkSourcePrintCompositor* getSourcePrintCompositorStruct(bool transferOwnership = false)
45 	{
46 		if (transferOwnership)
47 			ownedRef = false;
48 		return gtkSourcePrintCompositor;
49 	}
50 
51 	/** the main Gtk struct as a void* */
52 	protected override void* getStruct()
53 	{
54 		return cast(void*)gtkSourcePrintCompositor;
55 	}
56 
57 	protected override void setStruct(GObject* obj)
58 	{
59 		gtkSourcePrintCompositor = cast(GtkSourcePrintCompositor*)obj;
60 		super.setStruct(obj);
61 	}
62 
63 	/**
64 	 * Sets our main struct and passes it to the parent class.
65 	 */
66 	public this (GtkSourcePrintCompositor* gtkSourcePrintCompositor, bool ownedRef = false)
67 	{
68 		this.gtkSourcePrintCompositor = gtkSourcePrintCompositor;
69 		super(cast(GObject*)gtkSourcePrintCompositor, ownedRef);
70 	}
71 
72 
73 	/** */
74 	public static GType getType()
75 	{
76 		return gtk_source_print_compositor_get_type();
77 	}
78 
79 	/**
80 	 * Creates a new print compositor that can be used to print @buffer.
81 	 *
82 	 * Params:
83 	 *     buffer = the #GtkSourceBuffer to print.
84 	 *
85 	 * Returns: a new print compositor object.
86 	 *
87 	 * Since: 2.2
88 	 *
89 	 * Throws: ConstructionException GTK+ fails to create the object.
90 	 */
91 	public this(SourceBuffer buffer)
92 	{
93 		auto p = gtk_source_print_compositor_new((buffer is null) ? null : buffer.getSourceBufferStruct());
94 		
95 		if(p is null)
96 		{
97 			throw new ConstructionException("null returned by new");
98 		}
99 		
100 		this(cast(GtkSourcePrintCompositor*) p, true);
101 	}
102 
103 	/**
104 	 * Creates a new print compositor that can be used to print the buffer
105 	 * associated with @view.
106 	 * This constructor sets some configuration properties to make the
107 	 * printed output match @view as much as possible.  The properties set are
108 	 * #GtkSourcePrintCompositor:tab-width, #GtkSourcePrintCompositor:highlight-syntax,
109 	 * #GtkSourcePrintCompositor:wrap-mode, #GtkSourcePrintCompositor:body-font-name and
110 	 * #GtkSourcePrintCompositor:print-line-numbers.
111 	 *
112 	 * Params:
113 	 *     view = a #GtkSourceView to get configuration from.
114 	 *
115 	 * Returns: a new print compositor object.
116 	 *
117 	 * Since: 2.2
118 	 *
119 	 * Throws: ConstructionException GTK+ fails to create the object.
120 	 */
121 	public this(SourceView view)
122 	{
123 		auto p = gtk_source_print_compositor_new_from_view((view is null) ? null : view.getSourceViewStruct());
124 		
125 		if(p is null)
126 		{
127 			throw new ConstructionException("null returned by new_from_view");
128 		}
129 		
130 		this(cast(GtkSourcePrintCompositor*) p, true);
131 	}
132 
133 	/**
134 	 * Draw page @page_nr for printing on the the Cairo context encapsuled in @context.
135 	 *
136 	 * This method has been designed to be called in the handler of the #GtkPrintOperation::draw_page signal
137 	 * as shown in the following example:
138 	 *
139 	 * <informalexample><programlisting>
140 	 * // Signal handler for the GtkPrintOperation::draw_page signal
141 	 *
142 	 * static void
143 	 * draw_page (GtkPrintOperation *operation,
144 	 * GtkPrintContext   *context,
145 	 * gint               page_nr,
146 	 * gpointer           user_data)
147 	 * {
148 	 * GtkSourcePrintCompositor *compositor;
149 	 *
150 	 * compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data);
151 	 *
152 	 * gtk_source_print_compositor_draw_page (compositor,
153 	 * context,
154 	 * page_nr);
155 	 * }
156 	 * </programlisting></informalexample>
157 	 *
158 	 * Params:
159 	 *     context = the #GtkPrintContext encapsulating the context information that is required when
160 	 *         drawing the page for printing.
161 	 *     pageNr = the number of the page to print.
162 	 */
163 	public void drawPage(PrintContext context, int pageNr)
164 	{
165 		gtk_source_print_compositor_draw_page(gtkSourcePrintCompositor, (context is null) ? null : context.getPrintContextStruct(), pageNr);
166 	}
167 
168 	/**
169 	 * Returns the name of the font used to print the text body. The returned string
170 	 * must be freed with g_free().
171 	 *
172 	 * Returns: a new string containing the name of the font used to print the
173 	 *     text body.
174 	 *
175 	 * Since: 2.2
176 	 */
177 	public string getBodyFontName()
178 	{
179 		auto retStr = gtk_source_print_compositor_get_body_font_name(gtkSourcePrintCompositor);
180 		
181 		scope(exit) Str.freeString(retStr);
182 		return Str.toString(retStr);
183 	}
184 
185 	/**
186 	 * Gets the bottom margin in units of @unit.
187 	 *
188 	 * Params:
189 	 *     unit = the unit for the return value.
190 	 *
191 	 * Returns: the bottom margin.
192 	 *
193 	 * Since: 2.2
194 	 */
195 	public double getBottomMargin(GtkUnit unit)
196 	{
197 		return gtk_source_print_compositor_get_bottom_margin(gtkSourcePrintCompositor, unit);
198 	}
199 
200 	/**
201 	 * Gets the #GtkSourceBuffer associated with the compositor. The returned
202 	 * object reference is owned by the compositor object and
203 	 * should not be unreferenced.
204 	 *
205 	 * Returns: the #GtkSourceBuffer associated with the compositor.
206 	 *
207 	 * Since: 2.2
208 	 */
209 	public SourceBuffer getBuffer()
210 	{
211 		auto p = gtk_source_print_compositor_get_buffer(gtkSourcePrintCompositor);
212 		
213 		if(p is null)
214 		{
215 			return null;
216 		}
217 		
218 		return ObjectG.getDObject!(SourceBuffer)(cast(GtkSourceBuffer*) p);
219 	}
220 
221 	/**
222 	 * Returns the name of the font used to print the page footer.
223 	 * The returned string must be freed with g_free().
224 	 *
225 	 * Returns: a new string containing the name of the font used to print
226 	 *     the page footer.
227 	 *
228 	 * Since: 2.2
229 	 */
230 	public string getFooterFontName()
231 	{
232 		auto retStr = gtk_source_print_compositor_get_footer_font_name(gtkSourcePrintCompositor);
233 		
234 		scope(exit) Str.freeString(retStr);
235 		return Str.toString(retStr);
236 	}
237 
238 	/**
239 	 * Returns the name of the font used to print the page header.
240 	 * The returned string must be freed with g_free().
241 	 *
242 	 * Returns: a new string containing the name of the font used to print
243 	 *     the page header.
244 	 *
245 	 * Since: 2.2
246 	 */
247 	public string getHeaderFontName()
248 	{
249 		auto retStr = gtk_source_print_compositor_get_header_font_name(gtkSourcePrintCompositor);
250 		
251 		scope(exit) Str.freeString(retStr);
252 		return Str.toString(retStr);
253 	}
254 
255 	/**
256 	 * Determines whether the printed text will be highlighted according to the
257 	 * buffer rules.  Note that highlighting will happen
258 	 * only if the buffer to print has highlighting activated.
259 	 *
260 	 * Returns: %TRUE if the printed output will be highlighted.
261 	 *
262 	 * Since: 2.2
263 	 */
264 	public bool getHighlightSyntax()
265 	{
266 		return gtk_source_print_compositor_get_highlight_syntax(gtkSourcePrintCompositor) != 0;
267 	}
268 
269 	/**
270 	 * Gets the left margin in units of @unit.
271 	 *
272 	 * Params:
273 	 *     unit = the unit for the return value.
274 	 *
275 	 * Returns: the left margin
276 	 *
277 	 * Since: 2.2
278 	 */
279 	public double getLeftMargin(GtkUnit unit)
280 	{
281 		return gtk_source_print_compositor_get_left_margin(gtkSourcePrintCompositor, unit);
282 	}
283 
284 	/**
285 	 * Returns the name of the font used to print line numbers on the left margin.
286 	 * The returned string must be freed with g_free().
287 	 *
288 	 * Returns: a new string containing the name of the font used to print
289 	 *     line numbers on the left margin.
290 	 *
291 	 * Since: 2.2
292 	 */
293 	public string getLineNumbersFontName()
294 	{
295 		auto retStr = gtk_source_print_compositor_get_line_numbers_font_name(gtkSourcePrintCompositor);
296 		
297 		scope(exit) Str.freeString(retStr);
298 		return Str.toString(retStr);
299 	}
300 
301 	/**
302 	 * Returns the number of pages in the document or <code>-1</code> if the
303 	 * document has not been completely paginated.
304 	 *
305 	 * Returns: the number of pages in the document or <code>-1</code> if the
306 	 *     document has not been completely paginated.
307 	 *
308 	 * Since: 2.2
309 	 */
310 	public int getNPages()
311 	{
312 		return gtk_source_print_compositor_get_n_pages(gtkSourcePrintCompositor);
313 	}
314 
315 	/**
316 	 * Returns the current fraction of the document pagination that has been completed.
317 	 *
318 	 * Returns: a fraction from 0.0 to 1.0 inclusive.
319 	 *
320 	 * Since: 2.2
321 	 */
322 	public double getPaginationProgress()
323 	{
324 		return gtk_source_print_compositor_get_pagination_progress(gtkSourcePrintCompositor);
325 	}
326 
327 	/**
328 	 * Determines if a footer is set to be printed for each page.  A
329 	 * footer will be printed if this function returns %TRUE
330 	 * <emphasis>and</emphasis> some format strings have been specified
331 	 * with gtk_source_print_compositor_set_footer_format().
332 	 *
333 	 * Returns: %TRUE if the footer is set to be printed.
334 	 *
335 	 * Since: 2.2
336 	 */
337 	public bool getPrintFooter()
338 	{
339 		return gtk_source_print_compositor_get_print_footer(gtkSourcePrintCompositor) != 0;
340 	}
341 
342 	/**
343 	 * Determines if a header is set to be printed for each page.  A
344 	 * header will be printed if this function returns %TRUE
345 	 * <emphasis>and</emphasis> some format strings have been specified
346 	 * with gtk_source_print_compositor_set_header_format().
347 	 *
348 	 * Returns: %TRUE if the header is set to be printed.
349 	 *
350 	 * Since: 2.2
351 	 */
352 	public bool getPrintHeader()
353 	{
354 		return gtk_source_print_compositor_get_print_header(gtkSourcePrintCompositor) != 0;
355 	}
356 
357 	/**
358 	 * Returns the interval used for line number printing.  If the
359 	 * value is 0, no line numbers will be printed.  The default value is
360 	 * 1 (i.e. numbers printed in all lines).
361 	 *
362 	 * Returns: the interval of printed line numbers.
363 	 *
364 	 * Since: 2.2
365 	 */
366 	public uint getPrintLineNumbers()
367 	{
368 		return gtk_source_print_compositor_get_print_line_numbers(gtkSourcePrintCompositor);
369 	}
370 
371 	/**
372 	 * Gets the right margin in units of @unit.
373 	 *
374 	 * Params:
375 	 *     unit = the unit for the return value.
376 	 *
377 	 * Returns: the right margin.
378 	 *
379 	 * Since: 2.2
380 	 */
381 	public double getRightMargin(GtkUnit unit)
382 	{
383 		return gtk_source_print_compositor_get_right_margin(gtkSourcePrintCompositor, unit);
384 	}
385 
386 	/**
387 	 * Returns the width of tabulation in characters for printed text.
388 	 *
389 	 * Returns: width of tab.
390 	 *
391 	 * Since: 2.2
392 	 */
393 	public uint getTabWidth()
394 	{
395 		return gtk_source_print_compositor_get_tab_width(gtkSourcePrintCompositor);
396 	}
397 
398 	/**
399 	 * Gets the top margin in units of @unit.
400 	 *
401 	 * Params:
402 	 *     unit = the unit for the return value.
403 	 *
404 	 * Returns: the top margin.
405 	 *
406 	 * Since: 2.2
407 	 */
408 	public double getTopMargin(GtkUnit unit)
409 	{
410 		return gtk_source_print_compositor_get_top_margin(gtkSourcePrintCompositor, unit);
411 	}
412 
413 	/**
414 	 * Gets the line wrapping mode for the printed text.
415 	 *
416 	 * Returns: the line wrap mode.
417 	 *
418 	 * Since: 2.2
419 	 */
420 	public GtkWrapMode getWrapMode()
421 	{
422 		return gtk_source_print_compositor_get_wrap_mode(gtkSourcePrintCompositor);
423 	}
424 
425 	/**
426 	 * Paginate the document associated with the @compositor.
427 	 *
428 	 * In order to support non-blocking pagination, document is paginated in small chunks.
429 	 * Each time gtk_source_print_compositor_paginate() is invoked, a chunk of the document
430 	 * is paginated. To paginate the entire document, gtk_source_print_compositor_paginate()
431 	 * must be invoked multiple times.
432 	 * It returns %TRUE if the document has been completely paginated, otherwise it returns %FALSE.
433 	 *
434 	 * This method has been designed to be invoked in the handler of the #GtkPrintOperation::paginate signal,
435 	 * as shown in the following example:
436 	 *
437 	 * <informalexample><programlisting>
438 	 * // Signal handler for the GtkPrintOperation::paginate signal
439 	 *
440 	 * static gboolean
441 	 * paginate (GtkPrintOperation *operation,
442 	 * GtkPrintContext   *context,
443 	 * gpointer           user_data)
444 	 * {
445 	 * GtkSourcePrintCompositor *compositor;
446 	 *
447 	 * compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data);
448 	 *
449 	 * if (gtk_source_print_compositor_paginate (compositor, context))
450 	 * {
451 	 * gint n_pages;
452 	 *
453 	 * n_pages = gtk_source_print_compositor_get_n_pages (compositor);
454 	 * gtk_print_operation_set_n_pages (operation, n_pages);
455 	 *
456 	 * return TRUE;
457 	 * }
458 	 *
459 	 * return FALSE;
460 	 * }
461 	 * </programlisting></informalexample>
462 	 *
463 	 * If you don't need to do pagination in chunks, you can simply do it all in the
464 	 * #GtkPrintOperation::begin-print handler, and set the number of pages from there, like
465 	 * in the following example:
466 	 *
467 	 * <informalexample><programlisting>
468 	 * // Signal handler for the GtkPrintOperation::begin-print signal
469 	 *
470 	 * static void
471 	 * begin_print (GtkPrintOperation *operation,
472 	 * GtkPrintContext   *context,
473 	 * gpointer           user_data)
474 	 * {
475 	 * GtkSourcePrintCompositor *compositor;
476 	 * gint n_pages;
477 	 *
478 	 * compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data);
479 	 *
480 	 * while (!gtk_source_print_compositor_paginate (compositor, context));
481 	 *
482 	 * n_pages = gtk_source_print_compositor_get_n_pages (compositor);
483 	 * gtk_print_operation_set_n_pages (operation, n_pages);
484 	 * }
485 	 * </programlisting></informalexample>
486 	 *
487 	 * Params:
488 	 *     context = the #GtkPrintContext whose parameters (e.g. paper size, print margins, etc.)
489 	 *         are used by the the @compositor to paginate the document.
490 	 *
491 	 * Returns: %TRUE if the document has been completely paginated, %FALSE otherwise.
492 	 *
493 	 * Since: 2.2
494 	 */
495 	public bool paginate(PrintContext context)
496 	{
497 		return gtk_source_print_compositor_paginate(gtkSourcePrintCompositor, (context is null) ? null : context.getPrintContextStruct()) != 0;
498 	}
499 
500 	/**
501 	 * Sets the default font for the printed text.
502 	 *
503 	 * @font_name should be a
504 	 * string representation of a font description Pango can understand.
505 	 * (e.g. &quot;Monospace 10&quot;). See pango_font_description_from_string()
506 	 * for a description of the format of the string representation.
507 	 *
508 	 * This function cannot be called anymore after the first call to the
509 	 * gtk_source_print_compositor_paginate() function.
510 	 *
511 	 * Params:
512 	 *     fontName = the name of the default font for the body text.
513 	 *
514 	 * Since: 2.2
515 	 */
516 	public void setBodyFontName(string fontName)
517 	{
518 		gtk_source_print_compositor_set_body_font_name(gtkSourcePrintCompositor, Str.toStringz(fontName));
519 	}
520 
521 	/**
522 	 * Sets the bottom margin used by @compositor.
523 	 *
524 	 * Params:
525 	 *     margin = the new bottom margin in units of @unit.
526 	 *     unit = the units for @margin.
527 	 *
528 	 * Since: 2.2
529 	 */
530 	public void setBottomMargin(double margin, GtkUnit unit)
531 	{
532 		gtk_source_print_compositor_set_bottom_margin(gtkSourcePrintCompositor, margin, unit);
533 	}
534 
535 	/**
536 	 * Sets the font for printing the page footer. If
537 	 * %NULL is supplied, the default font (i.e. the one being used for the
538 	 * text) will be used instead.
539 	 *
540 	 * @font_name should be a
541 	 * string representation of a font description Pango can understand.
542 	 * (e.g. &quot;Monospace 10&quot;). See pango_font_description_from_string()
543 	 * for a description of the format of the string representation.
544 	 *
545 	 * This function cannot be called anymore after the first call to the
546 	 * gtk_source_print_compositor_paginate() function.
547 	 *
548 	 * Params:
549 	 *     fontName = the name of the font for the footer text, or %NULL.
550 	 *
551 	 * Since: 2.2
552 	 */
553 	public void setFooterFontName(string fontName)
554 	{
555 		gtk_source_print_compositor_set_footer_font_name(gtkSourcePrintCompositor, Str.toStringz(fontName));
556 	}
557 
558 	/**
559 	 * See gtk_source_print_compositor_set_header_format() for more information
560 	 * about the parameters.
561 	 *
562 	 * Params:
563 	 *     separator = %TRUE if you want a separator line to be printed.
564 	 *     left = a format string to print on the left of the footer.
565 	 *     center = a format string to print on the center of the footer.
566 	 *     right = a format string to print on the right of the footer.
567 	 *
568 	 * Since: 2.2
569 	 */
570 	public void setFooterFormat(bool separator, string left, string center, string right)
571 	{
572 		gtk_source_print_compositor_set_footer_format(gtkSourcePrintCompositor, separator, Str.toStringz(left), Str.toStringz(center), Str.toStringz(right));
573 	}
574 
575 	/**
576 	 * Sets the font for printing the page header. If
577 	 * %NULL is supplied, the default font (i.e. the one being used for the
578 	 * text) will be used instead.
579 	 *
580 	 * @font_name should be a
581 	 * string representation of a font description Pango can understand.
582 	 * (e.g. &quot;Monospace 10&quot;). See pango_font_description_from_string()
583 	 * for a description of the format of the string representation.
584 	 *
585 	 * This function cannot be called anymore after the first call to the
586 	 * gtk_source_print_compositor_paginate() function.
587 	 *
588 	 * Params:
589 	 *     fontName = the name of the font for header text, or %NULL.
590 	 *
591 	 * Since: 2.2
592 	 */
593 	public void setHeaderFontName(string fontName)
594 	{
595 		gtk_source_print_compositor_set_header_font_name(gtkSourcePrintCompositor, Str.toStringz(fontName));
596 	}
597 
598 	/**
599 	 * Sets strftime like header format strings, to be printed on the
600 	 * left, center and right of the top of each page.  The strings may
601 	 * include strftime(3) codes which will be expanded at print time.
602 	 * A subset of strftime() codes are accepted, see g_date_time_format()
603 	 * for more details on the accepted format specifiers.
604 	 * Additionally the following format specifiers are accepted:
605 	 * - #N: the page number
606 	 * - #Q: the page count.
607 	 *
608 	 * @separator specifies if a solid line should be drawn to separate
609 	 * the header from the document text.
610 	 *
611 	 * If %NULL is given for any of the three arguments, that particular
612 	 * string will not be printed.
613 	 *
614 	 * For the header to be printed, in
615 	 * addition to specifying format strings, you need to enable header
616 	 * printing with gtk_source_print_compositor_set_print_header().
617 	 *
618 	 * This function cannot be called anymore after the first call to the
619 	 * gtk_source_print_compositor_paginate() function.
620 	 *
621 	 * Params:
622 	 *     separator = %TRUE if you want a separator line to be printed.
623 	 *     left = a format string to print on the left of the header.
624 	 *     center = a format string to print on the center of the header.
625 	 *     right = a format string to print on the right of the header.
626 	 *
627 	 * Since: 2.2
628 	 */
629 	public void setHeaderFormat(bool separator, string left, string center, string right)
630 	{
631 		gtk_source_print_compositor_set_header_format(gtkSourcePrintCompositor, separator, Str.toStringz(left), Str.toStringz(center), Str.toStringz(right));
632 	}
633 
634 	/**
635 	 * Sets whether the printed text will be highlighted according to the
636 	 * buffer rules.  Both color and font style are applied.
637 	 *
638 	 * This function cannot be called anymore after the first call to the
639 	 * gtk_source_print_compositor_paginate() function.
640 	 *
641 	 * Params:
642 	 *     highlight = whether syntax should be highlighted.
643 	 *
644 	 * Since: 2.2
645 	 */
646 	public void setHighlightSyntax(bool highlight)
647 	{
648 		gtk_source_print_compositor_set_highlight_syntax(gtkSourcePrintCompositor, highlight);
649 	}
650 
651 	/**
652 	 * Sets the left margin used by @compositor.
653 	 *
654 	 * Params:
655 	 *     margin = the new left margin in units of @unit.
656 	 *     unit = the units for @margin.
657 	 *
658 	 * Since: 2.2
659 	 */
660 	public void setLeftMargin(double margin, GtkUnit unit)
661 	{
662 		gtk_source_print_compositor_set_left_margin(gtkSourcePrintCompositor, margin, unit);
663 	}
664 
665 	/**
666 	 * Sets the font for printing line numbers on the left margin.  If
667 	 * %NULL is supplied, the default font (i.e. the one being used for the
668 	 * text) will be used instead.
669 	 *
670 	 * @font_name should be a
671 	 * string representation of a font description Pango can understand.
672 	 * (e.g. &quot;Monospace 10&quot;). See pango_font_description_from_string()
673 	 * for a description of the format of the string representation.
674 	 *
675 	 * This function cannot be called anymore after the first call to the
676 	 * gtk_source_print_compositor_paginate() function.
677 	 *
678 	 * Params:
679 	 *     fontName = the name of the font for line numbers, or %NULL.
680 	 *
681 	 * Since: 2.2
682 	 */
683 	public void setLineNumbersFontName(string fontName)
684 	{
685 		gtk_source_print_compositor_set_line_numbers_font_name(gtkSourcePrintCompositor, Str.toStringz(fontName));
686 	}
687 
688 	/**
689 	 * Sets whether you want to print a footer in each page.  The
690 	 * footer consists of three pieces of text and an optional line
691 	 * separator, configurable with
692 	 * gtk_source_print_compositor_set_footer_format().
693 	 *
694 	 * Note that by default the footer format is unspecified, and if it's
695 	 * empty it will not be printed, regardless of this setting.
696 	 *
697 	 * This function cannot be called anymore after the first call to the
698 	 * gtk_source_print_compositor_paginate() function.
699 	 *
700 	 * Params:
701 	 *     print = %TRUE if you want the footer to be printed.
702 	 *
703 	 * Since: 2.2
704 	 */
705 	public void setPrintFooter(bool print)
706 	{
707 		gtk_source_print_compositor_set_print_footer(gtkSourcePrintCompositor, print);
708 	}
709 
710 	/**
711 	 * Sets whether you want to print a header in each page.  The
712 	 * header consists of three pieces of text and an optional line
713 	 * separator, configurable with
714 	 * gtk_source_print_compositor_set_header_format().
715 	 *
716 	 * Note that by default the header format is unspecified, and if it's
717 	 * empty it will not be printed, regardless of this setting.
718 	 *
719 	 * This function cannot be called anymore after the first call to the
720 	 * gtk_source_print_compositor_paginate() function.
721 	 *
722 	 * Params:
723 	 *     print = %TRUE if you want the header to be printed.
724 	 *
725 	 * Since: 2.2
726 	 */
727 	public void setPrintHeader(bool print)
728 	{
729 		gtk_source_print_compositor_set_print_header(gtkSourcePrintCompositor, print);
730 	}
731 
732 	/**
733 	 * Sets the interval for printed line numbers.  If @interval is 0 no
734 	 * numbers will be printed.  If greater than 0, a number will be
735 	 * printed every @interval lines (i.e. 1 will print all line numbers).
736 	 *
737 	 * Maximum accepted value for @interval is 100.
738 	 *
739 	 * This function cannot be called anymore after the first call to the
740 	 * gtk_source_print_compositor_paginate() function.
741 	 *
742 	 * Params:
743 	 *     interval = interval for printed line numbers.
744 	 *
745 	 * Since: 2.2
746 	 */
747 	public void setPrintLineNumbers(uint interval)
748 	{
749 		gtk_source_print_compositor_set_print_line_numbers(gtkSourcePrintCompositor, interval);
750 	}
751 
752 	/**
753 	 * Sets the right margin used by @compositor.
754 	 *
755 	 * Params:
756 	 *     margin = the new right margin in units of @unit.
757 	 *     unit = the units for @margin.
758 	 *
759 	 * Since: 2.2
760 	 */
761 	public void setRightMargin(double margin, GtkUnit unit)
762 	{
763 		gtk_source_print_compositor_set_right_margin(gtkSourcePrintCompositor, margin, unit);
764 	}
765 
766 	/**
767 	 * Sets the width of tabulation in characters for printed text.
768 	 *
769 	 * This function cannot be called anymore after the first call to the
770 	 * gtk_source_print_compositor_paginate() function.
771 	 *
772 	 * Params:
773 	 *     width = width of tab in characters.
774 	 *
775 	 * Since: 2.2
776 	 */
777 	public void setTabWidth(uint width)
778 	{
779 		gtk_source_print_compositor_set_tab_width(gtkSourcePrintCompositor, width);
780 	}
781 
782 	/**
783 	 * Sets the top margin used by @compositor.
784 	 *
785 	 * Params:
786 	 *     margin = the new top margin in units of @unit
787 	 *     unit = the units for @margin
788 	 *
789 	 * Since: 2.2
790 	 */
791 	public void setTopMargin(double margin, GtkUnit unit)
792 	{
793 		gtk_source_print_compositor_set_top_margin(gtkSourcePrintCompositor, margin, unit);
794 	}
795 
796 	/**
797 	 * Sets the line wrapping mode for the printed text.
798 	 *
799 	 * This function cannot be called anymore after the first call to the
800 	 * gtk_source_print_compositor_paginate() function.
801 	 *
802 	 * Params:
803 	 *     wrapMode = a #GtkWrapMode.
804 	 *
805 	 * Since: 2.2
806 	 */
807 	public void setWrapMode(GtkWrapMode wrapMode)
808 	{
809 		gtk_source_print_compositor_set_wrap_mode(gtkSourcePrintCompositor, wrapMode);
810 	}
811 }