gtksourceviewmm: Gsv::PrintCompositor Class Reference

gtksourceviewmm 3.17.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

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

Compose a Buffer for printing. More...

`#include <gtksourceviewmm/printcompositor.h>`

Inheritance diagram for Gsv::PrintCompositor:
[legend]

## Public Member Functions
virtual | ~PrintCompositor ()
GtkSourcePrintCompositor* | gobj ()
| Provides access to the underlying C GObject. More...
const GtkSourcePrintCompositor* | gobj () const
| Provides access to the underlying C GObject. More...
GtkSourcePrintCompositor* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
Glib::RefPtr< Buffer > | get_buffer ()
| Gets the Buffer associated with the compositor. More...
Glib::RefPtr< const Buffer > | get_buffer () const
| Gets the Buffer associated with the compositor. More...
void | set_tab_width (guint width)
| Sets the width of tabulation in characters for printed text. More...
guint | get_tab_width () const
| Returns the width of tabulation in characters for printed text. More...
void | set_wrap_mode (Gtk::WrapMode wrap_mode)
| Sets the line wrapping mode for the printed text. More...
Gtk::WrapMode | get_wrap_mode () const
| Gets the line wrapping mode for the printed text. More...
void | set_highlight_syntax (bool highlight=true)
| Sets whether the printed text will be highlighted according to the buffer rules. More...
bool | get_highlight_syntax () const
| Determines whether the printed text will be highlighted according to the buffer rules. More...
void | set_print_line_numbers (guint interval=1)
| Sets the interval for printed line numbers. More...
guint | get_print_line_numbers () const
| Returns the interval used for line number printing. More...
void | set_body_font_name (const Glib::ustring& font_name)
| Sets the default font for the printed text. More...
Glib::ustring | get_body_font_name () const
| Returns the name of the font used to print the text body. More...
void | set_line_numbers_font_name (const Glib::ustring& font_name)
| Sets the font for printing line numbers on the left margin. More...
void | set_default_line_numbers_font_name ()
| Sets the default font for printing line numbers on the left margin. More...
Glib::ustring | get_line_numbers_font_name () const
| Returns the name of the font used to print line numbers on the left margin. More...
void | set_header_font_name (const Glib::ustring& font_name)
| Sets the font for printing the page header. More...
void | set_default_header_font_name ()
| Sets the default font for printing the page header. More...
Glib::ustring | get_header_font_name () const
| Returns the name of the font used to print the page header. More...
void | set_footer_font_name (const Glib::ustring& font_name)
| Sets the font for printing the page footer. More...
void | set_default_footer_font_name ()
| Sets the default font for printing the page footer. More...
Glib::ustring | get_footer_font_name () const
| Returns the name of the font used to print the page footer. More...
void | set_top_margin (double margin, Gtk::Unit unit)
| Sets the top margin used by compositor. More...
double | get_top_margin (Gtk::Unit unit) const
| Gets the top margin in units of unit. More...
void | set_bottom_margin (double margin, Gtk::Unit unit)
| Sets the bottom margin used by compositor. More...
double | get_bottom_margin (Gtk::Unit unit) const
| Gets the bottom margin in units of unit. More...
void | set_left_margin (double margin, Gtk::Unit unit)
| Sets the left margin used by compositor. More...
double | get_left_margin (Gtk::Unit unit) const
| Gets the left margin in units of unit. More...
void | set_right_margin (double margin, Gtk::Unit unit)
| Sets the right margin used by compositor. More...
double | get_right_margin (Gtk::Unit unit) const
| Gets the right margin in units of unit. More...
void | set_print_header (bool print=true)
| Sets whether you want to print a header in each page. More...
bool | get_print_header () const
| Determines if a header is set to be printed for each page. More...
void | set_print_footer (bool print=true)
| Sets whether you want to print a footer in each page. More...
bool | get_print_footer () const
| Determines if a footer is set to be printed for each page. More...
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. More...
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. More...
int | get_n_pages () const
| Returns the number of pages in the document or `-1` if the document has not been completely paginated. More...
bool | paginate (const Glib::RefPtr< Gtk::PrintContext >& context)
| Paginate the document associated with the compositor. More...
double | get_pagination_process ()
| Return value: a fraction from 0.0 to 1.0 inclusive. More...
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. More...
Glib::PropertyProxy< Glib::ustring > | property_body_font_name ()
| Name of the font to use for the text body (e.g. More...
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_body_font_name () const
| Name of the font to use for the text body (e.g. More...
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Buffer > > | property_buffer () const
| The GtkSourceBuffer object to print. More...
Glib::PropertyProxy< Glib::ustring > | property_footer_font_name ()
| Name of the font to use for the page footer (e.g. More...
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_footer_font_name () const
| Name of the font to use for the page footer (e.g. More...
Glib::PropertyProxy< Glib::ustring > | property_header_font_name ()
| Name of the font to use for the page header (e.g. More...
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_header_font_name () const
| Name of the font to use for the page header (e.g. More...
Glib::PropertyProxy< bool > | property_highlight_syntax ()
| Whether to print the document with highlighted syntax. More...
Glib::PropertyProxy_ReadOnly< bool > | property_highlight_syntax () const
| Whether to print the document with highlighted syntax. More...
Glib::PropertyProxy< Glib::ustring > | property_line_numbers_font_name ()
| Name of the font to use for the line numbers (e.g. More...
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_line_numbers_font_name () const
| Name of the font to use for the line numbers (e.g. More...
Glib::PropertyProxy_ReadOnly< int > | property_n_pages () const
| The number of pages in the document (-1 means the document has not been completely paginated). More...
Glib::PropertyProxy< bool > | property_print_footer ()
| Whether to print a footer in each page. More...
Glib::PropertyProxy_ReadOnly< bool > | property_print_footer () const
| Whether to print a footer in each page. More...
Glib::PropertyProxy< bool > | property_print_header ()
| Whether to print a header in each page. More...
Glib::PropertyProxy_ReadOnly< bool > | property_print_header () const
| Whether to print a header in each page. More...
Glib::PropertyProxy< guint > | property_print_line_numbers ()
| Interval of printed line numbers (0 means no numbers). More...
Glib::PropertyProxy_ReadOnly< guint > | property_print_line_numbers () const
| Interval of printed line numbers (0 means no numbers). More...
Glib::PropertyProxy< guint > | property_tab_width ()
| Width of a tab character expressed in spaces. More...
Glib::PropertyProxy_ReadOnly< guint > | property_tab_width () const
| Width of a tab character expressed in spaces. More...
Glib::PropertyProxy< Gtk::WrapMode > | property_wrap_mode ()
| Whether to wrap lines never, at word boundaries, or at character boundaries. More...
Glib::PropertyProxy_ReadOnly< Gtk::WrapMode > | property_wrap_mode () const
| Whether to wrap lines never, at word boundaries, or at character boundaries. More...
Public Member Functions inherited from Glib::Object
void * | get_data (const QueryQuark &key)
void | set_data (const Quark &key, void *data)
void | set_data (const Quark &key, void *data, DestroyNotify notify)
void | remove_data (const QueryQuark &quark)
void * | steal_data (const QueryQuark &quark)
Glib::RefPtr< Glib::Object > | wrap (GObject *object, bool take_copy=false)
Public Member Functions inherited from Glib::ObjectBase
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value)
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const
void | set_property (const Glib::ustring &property_name, const PropertyType &value)
void | get_property (const Glib::ustring &property_name, PropertyType &value) const
void | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void > &slot)
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, const sigc::slot< void > &slot)
void | freeze_notify ()
void | thaw_notify ()
virtual void | reference () const
virtual void | unreference () const
GObject * | gobj ()
const GObject * | gobj () const
GObject * | gobj_copy () const
Public Member Functions inherited from sigc::trackable
| trackable ()
| trackable (const trackable &src)
| ~trackable ()
void | add_destroy_notify_callback (void *data, func_destroy_notify func) const
void | notify_callbacks ()
trackable & | operator= (const trackable &src)
void | remove_destroy_notify_callback (void *data) const

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

## Protected Member Functions
| PrintCompositor (const Glib::RefPtr< Buffer >& buffer)
| PrintCompositor (const View& view)
Protected Member Functions inherited from Glib::Object
| Object ()
| Object (const Glib::ConstructParams &construct_params)
| Object (GObject *castitem)
virtual | ~Object ()
Protected Member Functions inherited from Glib::ObjectBase
| ObjectBase ()
| ObjectBase (const char *custom_type_name)
| ObjectBase (const std::type_info &custom_type_info)
virtual | ~ObjectBase ()=0
void | initialize (GObject *castitem)

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

## Additional Inherited Members
Public Types inherited from Glib::Object
typedef void(* | DestroyNotify) (gpointer data)
Public Types inherited from sigc::trackable
typedef internal::func_destroy_notify | func_destroy_notify

## Detailed Description

Compose a Buffer for printing.

Since gtksourceviewmm 2.10:

## Constructor & Destructor Documentation

virtual Gsv::PrintCompositor::~PrintCompositor | ( |  | ) |
| virtual

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

Gsv::PrintCompositor::PrintCompositor | ( | const View& | view | ) |
| explicitprotected

## Member Function Documentation

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:

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:

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);
}

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}

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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

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

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:

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

Provides access to the underlying C GObject.

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

Provides access to the underlying C GObject.

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.

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;
}

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:

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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 Function Documentation

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.