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