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