gtksourceviewmm
2.10.3
|
Compose a SourceBuffer for printing. More...
#include <gtksourceviewmm/sourceprintcompositor.h>
Public Member Functions | |
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< SourceBuffer > | get_buffer () |
Gets the SourceBuffer associated with the compositor. | |
Glib::RefPtr< const SourceBuffer > | get_buffer () const |
Gets the SourceBuffer 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< SourceBuffer > > | 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 Glib::RefPtr < SourcePrintCompositor > | create (const Glib::RefPtr< SourceBuffer >& buffer) |
Creates a new print compositor that can be used to print buffer. | |
static Glib::RefPtr < SourcePrintCompositor > | create (const SourceView& view) |
Creates a new print compositor that can be used to print the buffer associated with view. | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr < gtksourceview::SourcePrintCompositor > | wrap (GtkSourcePrintCompositor* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
Compose a SourceBuffer for printing.
static Glib::RefPtr<SourcePrintCompositor> gtksourceview::SourcePrintCompositor::create | ( | const Glib::RefPtr< SourceBuffer >& | buffer | ) | [static] |
Creates a new print compositor that can be used to print buffer.
buffer | the SourceBuffer to print. |
static Glib::RefPtr<SourcePrintCompositor> gtksourceview::SourcePrintCompositor::create | ( | const SourceView& | 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 SourcePrintCompositor::property_tab_width(), SourcePrintCompositor::property_highlight_syntax(), SourcePrintCompositor::property_wrap_mode(), SourcePrintCompositor::property_body_font_name() and SourcePrintCompositor::property_print_line_numbers().
view | A SourceView to get configuration from. |
Return value: a new print compositor object.
void gtksourceview::SourcePrintCompositor::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< gtksourceview::SourcePrintCompositor > compositor) { compositor->draw_page(context, page_nr); }
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 gtksourceview::SourcePrintCompositor::get_body_font_name | ( | ) | const |
Returns the name of the font used to print the text body.
double gtksourceview::SourcePrintCompositor::get_bottom_margin | ( | Gtk::Unit | unit | ) | const |
Gets the bottom margin in units of unit.
unit | The unit for the return value. |
Glib::RefPtr<SourceBuffer> gtksourceview::SourcePrintCompositor::get_buffer | ( | ) |
Gets the SourceBuffer associated with the compositor.
Glib::RefPtr<const SourceBuffer> gtksourceview::SourcePrintCompositor::get_buffer | ( | ) | const |
Gets the SourceBuffer associated with the compositor.
Glib::ustring gtksourceview::SourcePrintCompositor::get_footer_font_name | ( | ) | const |
Returns the name of the font used to print the page footer.
Glib::ustring gtksourceview::SourcePrintCompositor::get_header_font_name | ( | ) | const |
Returns the name of the font used to print the page header.
bool gtksourceview::SourcePrintCompositor::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.
true
if the printed output will be highlighted.double gtksourceview::SourcePrintCompositor::get_left_margin | ( | Gtk::Unit | unit | ) | const |
Gets the left margin in units of unit.
unit | The unit for the return value. |
Glib::ustring gtksourceview::SourcePrintCompositor::get_line_numbers_font_name | ( | ) | const |
Returns the name of the font used to print line numbers on the left margin.
int gtksourceview::SourcePrintCompositor::get_n_pages | ( | ) | const |
Returns the number of pages in the document or -1
if the document has not been completely paginated.
-1
if the document has not been completely paginated.double gtksourceview::SourcePrintCompositor::get_pagination_process | ( | ) |
Return value: a fraction from 0.0 to 1.0 inclusive.
bool gtksourceview::SourcePrintCompositor::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().
true
if the header is set to be printed.bool gtksourceview::SourcePrintCompositor::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().
true
if the header is set to be printed.guint gtksourceview::SourcePrintCompositor::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).
double gtksourceview::SourcePrintCompositor::get_right_margin | ( | Gtk::Unit | unit | ) | const |
Gets the right margin in units of unit.
unit | The unit for the return value. |
guint gtksourceview::SourcePrintCompositor::get_tab_width | ( | ) | const |
Returns the width of tabulation in characters for printed text.
double gtksourceview::SourcePrintCompositor::get_top_margin | ( | Gtk::Unit | unit | ) | const |
Gets the top margin in units of unit.
unit | The unit for the return value. |
Gtk::WrapMode gtksourceview::SourcePrintCompositor::get_wrap_mode | ( | ) | const |
Gets the line wrapping mode for the printed text.
bool gtksourceview::SourcePrintCompositor::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<gtksourceview::SourcePrintCompositor> 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< gtksourceview::SourcePrintCompositor > compositor) { while (!compositor->paginate(context)); int n_pages = compositor->get_n_pages(); operation->set_n_pages(n_pages); }
context | The Gtk::PrintContext whose parameters (e.g. paper size, print margins, etc.) are used by the the compositor to paginate the document. |
true
if the document has been completely paginated, false
otherwise.Glib::PropertyProxy<Glib::ustring> gtksourceview::SourcePrintCompositor::property_body_font_name | ( | ) |
Name of the font to use for the text body (e.g.
'Monospace 10').
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<Glib::ustring> gtksourceview::SourcePrintCompositor::property_body_font_name | ( | ) | const |
Name of the font to use for the text body (e.g.
'Monospace 10').
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<SourceBuffer> > gtksourceview::SourcePrintCompositor::property_buffer | ( | ) | const |
The GtkSourceBuffer object to print.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Glib::ustring> gtksourceview::SourcePrintCompositor::property_footer_font_name | ( | ) |
Name of the font to use for the page footer (e.g.
'Monospace 10').
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<Glib::ustring> gtksourceview::SourcePrintCompositor::property_footer_font_name | ( | ) | const |
Name of the font to use for the page footer (e.g.
'Monospace 10').
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Glib::ustring> gtksourceview::SourcePrintCompositor::property_header_font_name | ( | ) |
Name of the font to use for the page header (e.g.
'Monospace 10').
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<Glib::ustring> gtksourceview::SourcePrintCompositor::property_header_font_name | ( | ) | const |
Name of the font to use for the page header (e.g.
'Monospace 10').
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> gtksourceview::SourcePrintCompositor::property_highlight_syntax | ( | ) |
Whether to print the document with highlighted syntax.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<bool> gtksourceview::SourcePrintCompositor::property_highlight_syntax | ( | ) | const |
Whether to print the document with highlighted syntax.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Glib::ustring> gtksourceview::SourcePrintCompositor::property_line_numbers_font_name | ( | ) |
Name of the font to use for the line numbers (e.g.
'Monospace 10').
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<Glib::ustring> gtksourceview::SourcePrintCompositor::property_line_numbers_font_name | ( | ) | const |
Name of the font to use for the line numbers (e.g.
'Monospace 10').
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<int> gtksourceview::SourcePrintCompositor::property_n_pages | ( | ) | const |
The number of pages in the document (-1 means the document has not been completely paginated).
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> gtksourceview::SourcePrintCompositor::property_print_footer | ( | ) |
Whether to print a footer in each page.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<bool> gtksourceview::SourcePrintCompositor::property_print_footer | ( | ) | const |
Whether to print a footer in each page.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> gtksourceview::SourcePrintCompositor::property_print_header | ( | ) |
Whether to print a header in each page.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<bool> gtksourceview::SourcePrintCompositor::property_print_header | ( | ) | const |
Whether to print a header in each page.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<guint> gtksourceview::SourcePrintCompositor::property_print_line_numbers | ( | ) |
Interval of printed line numbers (0 means no numbers).
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<guint> gtksourceview::SourcePrintCompositor::property_print_line_numbers | ( | ) | const |
Interval of printed line numbers (0 means no numbers).
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<guint> gtksourceview::SourcePrintCompositor::property_tab_width | ( | ) |
Width of a tab character expressed in spaces.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<guint> gtksourceview::SourcePrintCompositor::property_tab_width | ( | ) | const |
Width of a tab character expressed in spaces.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Gtk::WrapMode> gtksourceview::SourcePrintCompositor::property_wrap_mode | ( | ) |
Whether to wrap lines never, at word boundaries, or at character boundaries.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<Gtk::WrapMode> gtksourceview::SourcePrintCompositor::property_wrap_mode | ( | ) | const |
Whether to wrap lines never, at word boundaries, or at character boundaries.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
void gtksourceview::SourcePrintCompositor::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.
font_name | The name of the default font for the body text. |
void gtksourceview::SourcePrintCompositor::set_bottom_margin | ( | double | margin, |
Gtk::Unit | unit | ||
) |
Sets the bottom margin used by compositor.
margin | The new bottom margin in units of unit. |
unit | The units for margin. |
void gtksourceview::SourcePrintCompositor::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.
void gtksourceview::SourcePrintCompositor::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.
void gtksourceview::SourcePrintCompositor::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.
void gtksourceview::SourcePrintCompositor::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.
font_name | The name of the font for the page footer. |
void gtksourceview::SourcePrintCompositor::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.
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. |
void gtksourceview::SourcePrintCompositor::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.
font_name | The name of the font for the page header. |
void gtksourceview::SourcePrintCompositor::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.
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. |
void gtksourceview::SourcePrintCompositor::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.
highlight | Whether syntax should be highlighted. |
void gtksourceview::SourcePrintCompositor::set_left_margin | ( | double | margin, |
Gtk::Unit | unit | ||
) |
Sets the left margin used by compositor.
margin | The new bottom margin in units of unit. |
unit | The units for margin. |
void gtksourceview::SourcePrintCompositor::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.
font_name | The name of the font for line numbers. |
void gtksourceview::SourcePrintCompositor::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.
true if you want the footer to be printed. |
void gtksourceview::SourcePrintCompositor::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.
true if you want the header to be printed. |
void gtksourceview::SourcePrintCompositor::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.
interval | Interval for printed line numbers. |
void gtksourceview::SourcePrintCompositor::set_right_margin | ( | double | margin, |
Gtk::Unit | unit | ||
) |
Sets the right margin used by compositor.
margin | The new bottom margin in units of unit. |
unit | The units for margin. |
void gtksourceview::SourcePrintCompositor::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.
width | Width of tab in characters. |
void gtksourceview::SourcePrintCompositor::set_top_margin | ( | double | margin, |
Gtk::Unit | unit | ||
) |
Sets the top margin used by compositor.
margin | The new top margin in units of unit. |
unit | The units for margin. |
void gtksourceview::SourcePrintCompositor::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.
wrap_mode | A Gtk::WrapMode. |
Glib::RefPtr< gtksourceview::SourcePrintCompositor > wrap | ( | GtkSourcePrintCompositor * | object, |
bool | take_copy = false |
||
) | [related] |
A Glib::wrap() method for this object.
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. |