gtksourceviewmm 3.18.0

Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Symbols | List of all members
Gsv::PrintCompositor Class Reference

Compose a Buffer for printing. More...

`#include <gtksourceviewmm/printcompositor.h>`

Inherits Glib::Object.

## Public Member Functions
| PrintCompositor (PrintCompositor&& src) noexcept
PrintCompositor& | operator= (PrintCompositor&& src) noexcept
| ~PrintCompositor () noexcept override
GtkSourcePrintCompositor* | gobj ()
| Provides access to the underlying C GObject.
const GtkSourcePrintCompositor* | gobj () const
| Provides access to the underlying C GObject.
GtkSourcePrintCompositor* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::RefPtr< Buffer > | get_buffer ()
| Gets the Buffer associated with the compositor.
Glib::RefPtr< const Buffer > | get_buffer () const
| Gets the Buffer associated with the compositor.
void | set_tab_width (guint width)
| Sets the width of tabulation in characters for printed text.
guint | get_tab_width () const
| Returns the width of tabulation in characters for printed text.
void | set_wrap_mode (Gtk::WrapMode wrap_mode)
| Sets the line wrapping mode for the printed text.
Gtk::WrapMode | get_wrap_mode () const
| Gets the line wrapping mode for the printed text.
void | set_highlight_syntax (bool highlight=true)
| Sets whether the printed text will be highlighted according to the buffer rules.
bool | get_highlight_syntax () const
| Determines whether the printed text will be highlighted according to the buffer rules.
void | set_print_line_numbers (guint interval=1)
| Sets the interval for printed line numbers.
guint | get_print_line_numbers () const
| Returns the interval used for line number printing.
void | set_body_font_name (const Glib::ustring& font_name)
| Sets the default font for the printed text.
Glib::ustring | get_body_font_name () const
| Returns the name of the font used to print the text body.
void | set_line_numbers_font_name (const Glib::ustring& font_name)
| Sets the font for printing line numbers on the left margin.
void | set_default_line_numbers_font_name ()
| Sets the default font for printing line numbers on the left margin.
Glib::ustring | get_line_numbers_font_name () const
| Returns the name of the font used to print line numbers on the left margin.
void | set_header_font_name (const Glib::ustring& font_name)
| Sets the font for printing the page header.
void | set_default_header_font_name ()
| Sets the default font for printing the page header.
Glib::ustring | get_header_font_name () const
| Returns the name of the font used to print the page header.
void | set_footer_font_name (const Glib::ustring& font_name)
| Sets the font for printing the page footer.
void | set_default_footer_font_name ()
| Sets the default font for printing the page footer.
Glib::ustring | get_footer_font_name () const
| Returns the name of the font used to print the page footer.
void | set_top_margin (double margin, Gtk::Unit unit)
| Sets the top margin used by compositor.
double | get_top_margin (Gtk::Unit unit) const
| Gets the top margin in units of unit.
void | set_bottom_margin (double margin, Gtk::Unit unit)
| Sets the bottom margin used by compositor.
double | get_bottom_margin (Gtk::Unit unit) const
| Gets the bottom margin in units of unit.
void | set_left_margin (double margin, Gtk::Unit unit)
| Sets the left margin used by compositor.
double | get_left_margin (Gtk::Unit unit) const
| Gets the left margin in units of unit.
void | set_right_margin (double margin, Gtk::Unit unit)
| Sets the right margin used by compositor.
double | get_right_margin (Gtk::Unit unit) const
| Gets the right margin in units of unit.
void | set_print_header (bool print=true)
| Sets whether you want to print a header in each page.
bool | get_print_header () const
| Determines if a header is set to be printed for each page.
void | set_print_footer (bool print=true)
| Sets whether you want to print a footer in each page.
bool | get_print_footer () const
| Determines if a footer is set to be printed for each page.
void | set_header_format (bool separator, const Glib::ustring&left, const Glib::ustring& center, const Glib::ustring&right)
| Sets strftime like header format strings, to be printed on the left, center and right of the top of each page.
void | set_footer_format (bool separator, const Glib::ustring&left, const Glib::ustring& center, const Glib::ustring&right)
| Sets strftime like footer format strings, to be printed on the left, center and right of the top of each page.
int | get_n_pages () const
| Returns the number of pages in the document or `-1` if the document has not been completely paginated.
bool | paginate (const Glib::RefPtr< Gtk::PrintContext >& context)
| Paginate the document associated with the compositor.
double | get_pagination_process ()
| Return value: a fraction from 0.0 to 1.0 inclusive.
void | draw_page (const Glib::RefPtr< Gtk::PrintContext >& context, int page_nr)
| Draw page page_nr for printing on the the Cairo context encapsuled in context.
Glib::PropertyProxy< Glib::ustring > | property_body_font_name ()
| Name of the font to use for the text body (e.g.
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_body_font_name () const
| Name of the font to use for the text body (e.g.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Buffer > > | property_buffer () const
| The GtkSourceBuffer object to print.
Glib::PropertyProxy< Glib::ustring > | property_footer_font_name ()
| Name of the font to use for the page footer (e.g.
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_footer_font_name () const
| Name of the font to use for the page footer (e.g.
Glib::PropertyProxy< Glib::ustring > | property_header_font_name ()
| Name of the font to use for the page header (e.g.
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_header_font_name () const
| Name of the font to use for the page header (e.g.
Glib::PropertyProxy< bool > | property_highlight_syntax ()
| Whether to print the document with highlighted syntax.
Glib::PropertyProxy_ReadOnly< bool > | property_highlight_syntax () const
| Whether to print the document with highlighted syntax.
Glib::PropertyProxy< Glib::ustring > | property_line_numbers_font_name ()
| Name of the font to use for the line numbers (e.g.
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_line_numbers_font_name () const
| Name of the font to use for the line numbers (e.g.
Glib::PropertyProxy_ReadOnly< int > | property_n_pages () const
| The number of pages in the document (-1 means the document has not been completely paginated).
Glib::PropertyProxy< bool > | property_print_footer ()
| Whether to print a footer in each page.
Glib::PropertyProxy_ReadOnly< bool > | property_print_footer () const
| Whether to print a footer in each page.
Glib::PropertyProxy< bool > | property_print_header ()
| Whether to print a header in each page.
Glib::PropertyProxy_ReadOnly< bool > | property_print_header () const
| Whether to print a header in each page.
Glib::PropertyProxy< guint > | property_print_line_numbers ()
| Interval of printed line numbers (0 means no numbers).
Glib::PropertyProxy_ReadOnly< guint > | property_print_line_numbers () const
| Interval of printed line numbers (0 means no numbers).
Glib::PropertyProxy< guint > | property_tab_width ()
| Width of a tab character expressed in spaces.
Glib::PropertyProxy_ReadOnly< guint > | property_tab_width () const
| Width of a tab character expressed in spaces.
Glib::PropertyProxy< Gtk::WrapMode > | property_wrap_mode ()
| Whether to wrap lines never, at word boundaries, or at character boundaries.
Glib::PropertyProxy_ReadOnly< Gtk::WrapMode > | property_wrap_mode () const
| Whether to wrap lines never, at word boundaries, or at character boundaries.

## Static Public Member Functions
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system.
static Glib::RefPtr< PrintCompositor > | create (const Glib::RefPtr< Buffer >& buffer)
| Creates a new print compositor that can be used to print buffer.
static Glib::RefPtr< PrintCompositor > | create (const View& view)
| Creates a new print compositor that can be used to print the buffer associated with view.

## Protected Member Functions
| PrintCompositor (const Glib::RefPtr< Buffer >& buffer)
| PrintCompositor (const View& view)

## Related Symbols
(Note that these are not member symbols.)
Glib::RefPtr< Gsv::PrintCompositor > | wrap (GtkSourcePrintCompositor* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

Compose a Buffer for printing.

Since gtksourceviewmm 2.10

## Constructor & Destructor Documentation

## ◆ PrintCompositor() [1/3]

Gsv::PrintCompositor::PrintCompositor | ( | PrintCompositor&& | src | ) |
| noexcept

## ◆ ~PrintCompositor()

Gsv::PrintCompositor::~PrintCompositor | ( |  | ) |
| override noexcept

## ◆ PrintCompositor() [2/3]

Gsv::PrintCompositor::PrintCompositor | ( | const Glib::RefPtr< Buffer >& | buffer | ) |
| explicit protected

## ◆ PrintCompositor() [3/3]

Gsv::PrintCompositor::PrintCompositor | ( | const View& | view | ) |
| explicit protected

## Member Function Documentation

## ◆ create() [1/2]

static Glib::RefPtr< PrintCompositor > Gsv::PrintCompositor::create | ( | const Glib::RefPtr< Buffer >& | buffer | ) |
| static

Creates a new print compositor that can be used to print buffer.

Parameters

  buffer | the Buffer to print.

Returns
  A new print compositor object.

Since gtksourceviewmm 2.10

## ◆ create() [2/2]

static Glib::RefPtr< PrintCompositor > Gsv::PrintCompositor::create | ( | const View& | view | ) |
| static

Creates a new print compositor that can be used to print the buffer associated with view.

This constructor sets some configuration properties to make the printed output match view as much as possible. The properties set are PrintCompositor::property_tab_width(), PrintCompositor::property_highlight_syntax(), PrintCompositor::property_wrap_mode(), PrintCompositor::property_body_font_name() and PrintCompositor::property_print_line_numbers().

Parameters

  view | A View to get configuration from.

Returns
  A new print compositor object.

Since gtksourceviewmm 2.10

## ◆ draw_page()

void Gsv::PrintCompositor::draw_page | ( | const Glib::RefPtr< Gtk::PrintContext > & | context,
|  | int | page_nr )

Draw page page_nr for printing on the the Cairo context encapsuled in context.

This method has been designed to be called in the handler of the Gtk::PrintOperation::draw_page signal as shown in the following example:

// Signal handler for the Gtk::PrintOperation::draw_page signal.
// Extended with sigc::bind().
static void
draw_page (Glib::RefPtr< Gtk::PrintOperation > operation,
Glib::RefPtr< GtkPrintContext > context,
int page_nr,
Glib::RefPtr< Gsv::PrintCompositor > compositor)
{
compositor->draw_page(context, page_nr);
}
Gsv::PrintCompositor::draw_page
void draw_page(const Glib::RefPtr< Gtk::PrintContext > &context, int page_nr)
Draw page page_nr for printing on the the Cairo context encapsuled in context.

Parameters

  context | The Gtk::PrintContext encapsulating the context information that is required when drawing the page for printing.
  page_nr | The number of the page to print.

newin{2,10}

## ◆ get_body_font_name()

Glib::ustring Gsv::PrintCompositor::get_body_font_name | ( |  | ) | const

Returns the name of the font used to print the text body.

Returns
  A string containing the name of the font used to print the text body.

Since gtksourceviewmm 2.10

## ◆ get_bottom_margin()

double Gsv::PrintCompositor::get_bottom_margin | ( | Gtk::Unit | unit | ) | const

Gets the bottom margin in units of unit.

Parameters

  unit | The unit for the return value.

Returns
  The top margin.

Since gtksourceviewmm 2.10

## ◆ get_buffer() [1/2]

Glib::RefPtr< Buffer > Gsv::PrintCompositor::get_buffer | ( |  | ) |

Gets the Buffer associated with the compositor.

Returns
  The Buffer associated with the compositor.

Since gtksourceviewmm 2.10

## ◆ get_buffer() [2/2]

Glib::RefPtr< const Buffer > Gsv::PrintCompositor::get_buffer | ( |  | ) | const

Gets the Buffer associated with the compositor.

Returns
  The Buffer associated with the compositor.

Since gtksourceviewmm 2.10

## ◆ get_footer_font_name()

Glib::ustring Gsv::PrintCompositor::get_footer_font_name | ( |  | ) | const

Returns the name of the font used to print the page footer.

Returns
  A string containing the name of the font used to print the page footer.

Since gtksourceviewmm 2.10

## ◆ get_header_font_name()

Glib::ustring Gsv::PrintCompositor::get_header_font_name | ( |  | ) | const

Returns the name of the font used to print the page header.

Returns
  A string containing the name of the font used to print the page header.

Since gtksourceviewmm 2.10

## ◆ get_highlight_syntax()

bool Gsv::PrintCompositor::get_highlight_syntax | ( |  | ) | const

Determines whether the printed text will be highlighted according to the buffer rules.

Note that highlighting will happen only if the buffer to print has highlighting activated.

Returns
  `true` if the printed output will be highlighted.

Since gtksourceviewmm 2.10

## ◆ get_left_margin()

double Gsv::PrintCompositor::get_left_margin | ( | Gtk::Unit | unit | ) | const

Gets the left margin in units of unit.

Parameters

  unit | The unit for the return value.

Returns
  The top margin.

Since gtksourceviewmm 2.10

## ◆ get_line_numbers_font_name()

Glib::ustring Gsv::PrintCompositor::get_line_numbers_font_name | ( |  | ) | const

Returns the name of the font used to print line numbers on the left margin.

Returns
  A string containing the name of the font used to print line numbers on the left margin.

Since gtksourceviewmm 2.10

## ◆ get_n_pages()

int Gsv::PrintCompositor::get_n_pages | ( |  | ) | const

Returns the number of pages in the document or `-1` if the document has not been completely paginated.

Returns
  The number of pages in the document or `-1` if the document has not been completely paginated.

Since gtksourceviewmm 2.10

## ◆ get_pagination_process()

double Gsv::PrintCompositor::get_pagination_process | ( |  | ) |

Return value: a fraction from 0.0 to 1.0 inclusive.

Returns
  A fraction from 0.0 to 1.0 inclusive

Since gtksourceviewmm 2.10

## ◆ get_print_footer()

bool Gsv::PrintCompositor::get_print_footer | ( |  | ) | const

Determines if a footer is set to be printed for each page.

A footer will be printed if this function returns `true` and some format strings have been specified with set_footer_format().

Returns
  `true` if the header is set to be printed.

Since gtksourceviewmm 2.10

## ◆ get_print_header()

bool Gsv::PrintCompositor::get_print_header | ( |  | ) | const

Determines if a header is set to be printed for each page.

A header will be printed if this function returns `true` and some format strings have been specified with set_header_format().

Returns
  `true` if the header is set to be printed.

Since gtksourceviewmm 2.10

## ◆ get_print_line_numbers()

guint Gsv::PrintCompositor::get_print_line_numbers | ( |  | ) | const

Returns the interval used for line number printing.

If the value is 0, no line numbers will be printed. The default value is 1 (i.e. numbers printed in all lines).

Returns
  The interval of printed line numbers.

Since gtksourceviewmm 2.10

## ◆ get_right_margin()

double Gsv::PrintCompositor::get_right_margin | ( | Gtk::Unit | unit | ) | const

Gets the right margin in units of unit.

Parameters

  unit | The unit for the return value.

Returns
  The top margin.

Since gtksourceviewmm 2.10

## ◆ get_tab_width()

guint Gsv::PrintCompositor::get_tab_width | ( |  | ) | const

Returns the width of tabulation in characters for printed text.

Returns
  Width of tab.

Since gtksourceviewmm 2.10

## ◆ get_top_margin()

double Gsv::PrintCompositor::get_top_margin | ( | Gtk::Unit | unit | ) | const

Gets the top margin in units of unit.

Parameters

  unit | The unit for the return value.

Returns
  The top margin.

Since gtksourceviewmm 2.10

## ◆ get_type()

static GType Gsv::PrintCompositor::get_type | ( |  | ) |
| static

Get the GType for this class, for use with the underlying GObject type system.

## ◆ get_wrap_mode()

Gtk::WrapMode Gsv::PrintCompositor::get_wrap_mode | ( |  | ) | const

Gets the line wrapping mode for the printed text.

Returns
  The line wrap mode.

Since gtksourceviewmm 2.10

## ◆ gobj() [1/2]

GtkSourcePrintCompositor * Gsv::PrintCompositor::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

## ◆ gobj() [2/2]

const GtkSourcePrintCompositor * Gsv::PrintCompositor::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

## ◆ gobj_copy()

GtkSourcePrintCompositor * Gsv::PrintCompositor::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

## ◆ operator=()

PrintCompositor& Gsv::PrintCompositor::operator= | ( | PrintCompositor&& | src | ) |
| noexcept

## ◆ paginate()

bool Gsv::PrintCompositor::paginate | ( | const Glib::RefPtr< Gtk::PrintContext > & | context | ) |

Paginate the document associated with the compositor.

In order to support non-blocking pagination, document is paginated in small chunks. Each time paginate() is invoked, a chunk of the document is paginated. To paginate the entire document, paginate() must be invoked multiple times. It returns `true` if the document has been completely paginated, otherwise it returns `false`.

This method has been designed to be invoked in the handler of the Gtk::PrintOperation::paginate signal, as shown in the following example:

// Signal handler for the GtkPrintOperation::paginate signal.
// Extended with sigc::bind().
static bool
paginate (Glib::RefPtr<Gtk::PrintOperation> operation,
Glib::RefPtr<Gtk::PrintContext> context,
Glib::RefPtr<Gsv::PrintCompositor> compositor)
{
if (compositor->paginate(context))
{
int n_pages = compositor->get_n_pages();
operation->set_n_pages(n_pages);
return true;
}
return false;
}
Gsv::PrintCompositor::paginate
bool paginate(const Glib::RefPtr< Gtk::PrintContext > &context)
Paginate the document associated with the compositor.

If you don't need to do pagination in chunks, you can simply do it all in the Gtk::PrintOperation::begin-print handler, and set the number of pages from there, like in the following example:

// Signal handler for the Gtk::PrintOperation::begin-print signal
// Extended with sigc::bind().
static void
begin_print (Glib::RefPtr< Gtk::PrintOperation > operation,
Glib::RefPtr< Gtk::PrintContext > context,
Glib::RefPtr< Gsv::PrintCompositor > compositor)
{
while (!compositor->paginate(context));
int n_pages = compositor->get_n_pages();
operation->set_n_pages(n_pages);
}

Parameters

  context | The Gtk::PrintContext whose parameters (e.g. paper size, print margins, etc.) are used by the the compositor to paginate the document.

Returns
  `true` if the document has been completely paginated, `false` otherwise.

Since gtksourceviewmm 2.10

## ◆ property_body_font_name() [1/2]

Glib::PropertyProxy< Glib::ustring > Gsv::PrintCompositor::property_body_font_name | ( |  | ) |

Name of the font to use for the text body (e.g.

'Monospace 10').

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## ◆ property_body_font_name() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gsv::PrintCompositor::property_body_font_name | ( |  | ) | const

Name of the font to use for the text body (e.g.

'Monospace 10').

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ property_buffer()

Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Buffer > > Gsv::PrintCompositor::property_buffer | ( |  | ) | const

The GtkSourceBuffer object to print.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ property_footer_font_name() [1/2]

Glib::PropertyProxy< Glib::ustring > Gsv::PrintCompositor::property_footer_font_name | ( |  | ) |

Name of the font to use for the page footer (e.g.

'Monospace 10').

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## ◆ property_footer_font_name() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gsv::PrintCompositor::property_footer_font_name | ( |  | ) | const

Name of the font to use for the page footer (e.g.

'Monospace 10').

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ property_header_font_name() [1/2]

Glib::PropertyProxy< Glib::ustring > Gsv::PrintCompositor::property_header_font_name | ( |  | ) |

Name of the font to use for the page header (e.g.

'Monospace 10').

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## ◆ property_header_font_name() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gsv::PrintCompositor::property_header_font_name | ( |  | ) | const

Name of the font to use for the page header (e.g.

'Monospace 10').

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ property_highlight_syntax() [1/2]

Glib::PropertyProxy< bool > Gsv::PrintCompositor::property_highlight_syntax | ( |  | ) |

Whether to print the document with highlighted syntax.

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## ◆ property_highlight_syntax() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gsv::PrintCompositor::property_highlight_syntax | ( |  | ) | const

Whether to print the document with highlighted syntax.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ property_line_numbers_font_name() [1/2]

Glib::PropertyProxy< Glib::ustring > Gsv::PrintCompositor::property_line_numbers_font_name | ( |  | ) |

Name of the font to use for the line numbers (e.g.

'Monospace 10').

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## ◆ property_line_numbers_font_name() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gsv::PrintCompositor::property_line_numbers_font_name | ( |  | ) | const

Name of the font to use for the line numbers (e.g.

'Monospace 10').

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ property_n_pages()

Glib::PropertyProxy_ReadOnly< int > Gsv::PrintCompositor::property_n_pages | ( |  | ) | const

The number of pages in the document (-1 means the document has not been completely paginated).

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ property_print_footer() [1/2]

Glib::PropertyProxy< bool > Gsv::PrintCompositor::property_print_footer | ( |  | ) |

Whether to print a footer in each page.

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## ◆ property_print_footer() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gsv::PrintCompositor::property_print_footer | ( |  | ) | const

Whether to print a footer in each page.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ property_print_header() [1/2]

Glib::PropertyProxy< bool > Gsv::PrintCompositor::property_print_header | ( |  | ) |

Whether to print a header in each page.

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## ◆ property_print_header() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gsv::PrintCompositor::property_print_header | ( |  | ) | const

Whether to print a header in each page.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ property_print_line_numbers() [1/2]

Glib::PropertyProxy< guint > Gsv::PrintCompositor::property_print_line_numbers | ( |  | ) |

Interval of printed line numbers (0 means no numbers).

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## ◆ property_print_line_numbers() [2/2]

Glib::PropertyProxy_ReadOnly< guint > Gsv::PrintCompositor::property_print_line_numbers | ( |  | ) | const

Interval of printed line numbers (0 means no numbers).

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ property_tab_width() [1/2]

Glib::PropertyProxy< guint > Gsv::PrintCompositor::property_tab_width | ( |  | ) |

Width of a tab character expressed in spaces.

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## ◆ property_tab_width() [2/2]

Glib::PropertyProxy_ReadOnly< guint > Gsv::PrintCompositor::property_tab_width | ( |  | ) | const

Width of a tab character expressed in spaces.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ property_wrap_mode() [1/2]

Glib::PropertyProxy< Gtk::WrapMode > Gsv::PrintCompositor::property_wrap_mode | ( |  | ) |

Whether to wrap lines never, at word boundaries, or at character boundaries.

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## ◆ property_wrap_mode() [2/2]

Glib::PropertyProxy_ReadOnly< Gtk::WrapMode > Gsv::PrintCompositor::property_wrap_mode | ( |  | ) | const

Whether to wrap lines never, at word boundaries, or at character boundaries.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ set_body_font_name()

void Gsv::PrintCompositor::set_body_font_name | ( | const Glib::ustring & | font_name | ) |

Sets the default font for the printed text.

font_name should be a string representation of a font description Pango can understand. (e.g. "Monospace 10"). See Pango::FontDescription() for a description of the format of the string representation.

This function cannot be called anymore after the first call to the paginate() function.

Parameters

  font_name | The name of the default font for the body text.

Since gtksourceviewmm 2.10

## ◆ set_bottom_margin()

void Gsv::PrintCompositor::set_bottom_margin | ( | double | margin,
|  | Gtk::Unit | unit )

Sets the bottom margin used by compositor.

Parameters

  margin | The new bottom margin in units of unit.
  unit | The units for margin.

Since gtksourceviewmm 2.10

## ◆ set_default_footer_font_name()

void Gsv::PrintCompositor::set_default_footer_font_name | ( |  | ) |

Sets the default font for printing the page footer.

The font to be used will be the same used as used for the text.

This function cannot be called anymore after the first call to the paginate() function.

Since gtksourceviewmm 2.10

## ◆ set_default_header_font_name()

void Gsv::PrintCompositor::set_default_header_font_name | ( |  | ) |

Sets the default font for printing the page header.

The font to be used will be the same used as used for the text.

This function cannot be called anymore after the first call to the paginate() function.

Since gtksourceviewmm 2.10

## ◆ set_default_line_numbers_font_name()

void Gsv::PrintCompositor::set_default_line_numbers_font_name | ( |  | ) |

Sets the default font for printing line numbers on the left margin.

The font to be used will be the same used as used for the text.

This function cannot be called anymore after the first call to the paginate() function.

Since gtksourceviewmm 2.10

## ◆ set_footer_font_name()

void Gsv::PrintCompositor::set_footer_font_name | ( | const Glib::ustring & | font_name | ) |

Sets the font for printing the page footer.

font_name should be a string representation of a font description Pango can understand (e.g. "Monospace 10"). See Pango::FontDescription() for a description of the format of the string representation.

This function cannot be called anymore after the first call to the paginate() function.

Parameters

  font_name | The name of the font for the page footer.

Since gtksourceviewmm 2.10

## ◆ set_footer_format()

void Gsv::PrintCompositor::set_footer_format | ( | bool | separator,
|  | const Glib::ustring & | left,
|  | const Glib::ustring & | center,
|  | const Glib::ustring & | right )

Sets strftime like footer format strings, to be printed on the left, center and right of the top of each page.

The strings may include strftime(3) codes which will be expanded at print time. All strftime(3) codes are accepted, with the addition of N for the page number and Q for the page count.

separator specifies if a solid line should be drawn to separate the footer from the document text.

If empty string is given for any of the three arguments, that particular string will not be printed.

For the footer to be printed, in addition to specifying format strings, you need to enable footer printing with set_print_footer().

This function cannot be called anymore after the first call to the paginate() function.

Parameters

  separator | `true` if you want a separator line to be printed.
  left | A format string to print on the left of the footer.
  center | A format string to print on the center of the footer.
  right | A format string to print on the right of the footer.

Since gtksourceviewmm 2.10

## ◆ set_header_font_name()

void Gsv::PrintCompositor::set_header_font_name | ( | const Glib::ustring & | font_name | ) |

Sets the font for printing the page header.

font_name should be a string representation of a font description Pango can understand (e.g. "Monospace 10"). See Pango::FontDescription() for a description of the format of the string representation.

This function cannot be called anymore after the first call to the paginate() function.

Parameters

  font_name | The name of the font for the page header.

Since gtksourceviewmm 2.10

## ◆ set_header_format()

void Gsv::PrintCompositor::set_header_format | ( | bool | separator,
|  | const Glib::ustring & | left,
|  | const Glib::ustring & | center,
|  | const Glib::ustring & | right )

Sets strftime like header format strings, to be printed on the left, center and right of the top of each page.

The strings may include strftime(3) codes which will be expanded at print time. All strftime(3) codes are accepted, with the addition of N for the page number and Q for the page count.

separator specifies if a solid line should be drawn to separate the header from the document text.

If empty string is given for any of the three arguments, that particular string will not be printed.

For the header to be printed, in addition to specifying format strings, you need to enable header printing with set_print_header().

This function cannot be called anymore after the first call to the paginate() function.

Parameters

  separator | `true` if you want a separator line to be printed.
  left | A format string to print on the left of the header.
  center | A format string to print on the center of the header.
  right | A format string to print on the right of the header.

Since gtksourceviewmm 2.10

## ◆ set_highlight_syntax()

void Gsv::PrintCompositor::set_highlight_syntax | ( | bool | highlight = true | ) |

Sets whether the printed text will be highlighted according to the buffer rules.

Both color and font style are applied. This function cannot be called anymore after the first call to the paginate() function.

Parameters

  highlight | Whether syntax should be highlighted.

Since gtksourceviewmm 2.10

## ◆ set_left_margin()

void Gsv::PrintCompositor::set_left_margin | ( | double | margin,
|  | Gtk::Unit | unit )

Sets the left margin used by compositor.

Parameters

  margin | The new bottom margin in units of unit.
  unit | The units for margin.

Since gtksourceviewmm 2.10

## ◆ set_line_numbers_font_name()

void Gsv::PrintCompositor::set_line_numbers_font_name | ( | const Glib::ustring & | font_name | ) |

Sets the font for printing line numbers on the left margin.

font_name should be a string representation of a font description Pango can understand (e.g. "Monospace 10"). See Pango::FontDescription() for a description of the format of the string representation.

This function cannot be called anymore after the first call to the paginate() function.

Parameters

  font_name | The name of the font for line numbers.

Since gtksourceviewmm 2.10

## ◆ set_print_footer()

void Gsv::PrintCompositor::set_print_footer | ( | bool | print = true | ) |

Sets whether you want to print a footer in each page.

The footer consists of three pieces of text and an optional line separator, configurable with set_header_format().

Note that by default the footer format is unspecified, and if it's empty it will not be printed, regardless of this setting.

This function cannot be called anymore after the first call to the paginate() function.

Parameters

  print | `true` if you want the footer to be printed.

Since gtksourceviewmm 2.10

## ◆ set_print_header()

void Gsv::PrintCompositor::set_print_header | ( | bool | print = true | ) |

Sets whether you want to print a header in each page.

The header consists of three pieces of text and an optional line separator, configurable with set_header_format().

Note that by default the header format is unspecified, and if it's empty it will not be printed, regardless of this setting.

This function cannot be called anymore after the first call to the paginate() function.

Parameters

  print | `true` if you want the header to be printed.

Since gtksourceviewmm 2.10

## ◆ set_print_line_numbers()

void Gsv::PrintCompositor::set_print_line_numbers | ( | guint | interval = 1 | ) |

Sets the interval for printed line numbers.

If interval is 0 no numbers will be printed. If greater than 0, a number will be printed every interval lines (i.e. 1 will print all line numbers).

Maximum accepted value for interval is 100.

This function cannot be called anymore after the first call to the paginate() function.

Parameters

  interval | Interval for printed line numbers.

Since gtksourceviewmm 2.10

## ◆ set_right_margin()

void Gsv::PrintCompositor::set_right_margin | ( | double | margin,
|  | Gtk::Unit | unit )

Sets the right margin used by compositor.

Parameters

  margin | The new bottom margin in units of unit.
  unit | The units for margin.

Since gtksourceviewmm 2.10

## ◆ set_tab_width()

void Gsv::PrintCompositor::set_tab_width | ( | guint | width | ) |

Sets the width of tabulation in characters for printed text.

This function cannot be called anymore after the first call to the paginate() function.

Parameters

  width | Width of tab in characters.

Since gtksourceviewmm 2.10

## ◆ set_top_margin()

void Gsv::PrintCompositor::set_top_margin | ( | double | margin,
|  | Gtk::Unit | unit )

Sets the top margin used by compositor.

Parameters

  margin | The new top margin in units of unit.
  unit | The units for margin.

Since gtksourceviewmm 2.10

## ◆ set_wrap_mode()

void Gsv::PrintCompositor::set_wrap_mode | ( | Gtk::WrapMode | wrap_mode | ) |

Sets the line wrapping mode for the printed text.

This function cannot be called anymore after the first call to the paginate() function.

Parameters

  wrap_mode | A Gtk::WrapMode.

Since gtksourceviewmm 2.10

## Friends And Related Symbol Documentation

## ◆ wrap()

Glib::RefPtr< Gsv::PrintCompositor > wrap | ( | GtkSourcePrintCompositor * | object,
|  | bool | take_copy = false )
| related

A Glib::wrap() method for this object.

Parameters

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns
  A C++ instance that wraps this C instance.