gtksource.print_compositor

Module for [PrintCompositor] class

Types 3

Compose a class@Buffer for printing.

The [gtksource.print_compositor.PrintCompositor] object is used to compose a class@Buffer for printing. You can set various configuration options to customize the printed output. [gtksource.print_compositor.PrintCompositor] is designed to be used with the high-level printing API of gtk+, i.e. [gtk.print_operation.PrintOperation].

The margins specified in this object are the layout margins: they define the blank space bordering the printed area of the pages. They must not be confused with the "print margins", i.e. the parts of the page that the printer cannot print on, defined in the [gtk.page_setup.PageSetup] objects. If the specified layout margins are smaller than the "print margins", the latter ones are used as a fallback by the [gtksource.print_compositor.PrintCompositor] object, so that the printed area is not clipped.

Methods
GType _gType() @property
PrintCompositor self()Returns `this`, for use in `with` statements.
PrintCompositorGidBuilder builder()Get builder for [gtksource.print_compositor.PrintCompositor] Returns: New builder object
string bodyFontName() @propertyGet `bodyFontName` property. Returns: Name of the font used for the text body.
void bodyFontName(string propval) @propertySet `bodyFontName` property. Params: propval = Name of the font used for the text body.
gtksource.buffer.Buffer buffer() @propertyGet `buffer` property. Returns: The `class@Buffer` object to print.
string footerFontName() @propertyGet `footerFontName` property. Returns: Name of the font used to print page footer. If this property is unspecified, the text body font is used.
void footerFontName(string propval) @propertySet `footerFontName` property. Params: propval = Name of the font used to print page footer. If this property is unspecified, the text body font is used.
string headerFontName() @propertyGet `headerFontName` property. Returns: Name of the font used to print page header. If this property is unspecified, the text body font is used.
void headerFontName(string propval) @propertySet `headerFontName` property. Params: propval = Name of the font used to print page header. If this property is unspecified, the text body font is used.
bool highlightSyntax() @propertyGet `highlightSyntax` property. Returns: Whether to print the document with highlighted syntax.
void highlightSyntax(bool propval) @propertySet `highlightSyntax` property. Params: propval = Whether to print the document with highlighted syntax.
string lineNumbersFontName() @propertyGet `lineNumbersFontName` property. Returns: Name of the font used to print line numbers on the left margin. If this property is unspecified, the text body font is used.
void lineNumbersFontName(string propval) @propertySet `lineNumbersFontName` property. Params: propval = Name of the font used to print line numbers on the left margin. If this property is unspecified, the text body font is used.
int nPages() @propertyGet `nPages` property. Returns: The number of pages in the document or <code>-1</code> if the document has not been completely paginated.
bool printFooter() @propertyGet `printFooter` property. Returns: Whether to print a footer in each page.
void printFooter(bool propval) @propertySet `printFooter` property. Params: propval = Whether to print a footer in each page.
bool printHeader() @propertyGet `printHeader` property. Returns: Whether to print a header in each page.
void printHeader(bool propval) @propertySet `printHeader` property. Params: propval = Whether to print a header in each page.
uint printLineNumbers() @propertyGet `printLineNumbers` property. Returns: Interval of printed line numbers.
void printLineNumbers(uint propval) @propertySet `printLineNumbers` property. Params: propval = Interval of printed line numbers.
uint tabWidth() @propertyGet `tabWidth` property. Returns: Width of a tab character expressed in spaces.
void tabWidth(uint propval) @propertySet `tabWidth` property. Params: propval = Width of a tab character expressed in spaces.
gtk.types.WrapMode wrapMode() @propertyGet `wrapMode` property. Returns: Whether to wrap lines never, at word boundaries, or at character boundaries.
void wrapMode(gtk.types.WrapMode propval) @propertySet `wrapMode` property. Params: propval = Whether to wrap lines never, at word boundaries, or at character boundaries.
gtksource.print_compositor.PrintCompositor newFromView(gtksource.view.View view)Creates a new print compositor that can be used to print the buffer associated with view.
void drawPage(gtk.print_context.PrintContext context, int pageNr)Draw page page_nr for printing on the the Cairo context encapsuled in context.
string getBodyFontName()Returns the name of the font used to print the text body.
double getBottomMargin(gtk.types.Unit unit)Gets the bottom margin in units of unit.
gtksource.buffer.Buffer getBuffer()Gets the `classBuffer` associated with the compositor.
string getFooterFontName()Returns the name of the font used to print the page footer.
string getHeaderFontName()Returns the name of the font used to print the page header.
bool getHighlightSyntax()Determines whether the printed text will be highlighted according to the buffer rules.
double getLeftMargin(gtk.types.Unit unit)Gets the left margin in units of unit.
string getLineNumbersFontName()Returns the name of the font used to print line numbers on the left margin.
int getNPages()Returns the number of pages in the document or <code>-1</code> if the document has not been completely paginated. Returns: the number of pages in the document or <code>-1</code> if the document has...
double getPaginationProgress()Returns the current fraction of the document pagination that has been completed. Returns: a fraction from 0.0 to 1.0 inclusive.
bool getPrintFooter()Determines if a footer is set to be printed for each page.
bool getPrintHeader()Determines if a header is set to be printed for each page.
uint getPrintLineNumbers()Returns the interval used for line number printing.
double getRightMargin(gtk.types.Unit unit)Gets the right margin in units of unit.
uint getTabWidth()Returns the width of tabulation in characters for printed text. Returns: width of tab.
double getTopMargin(gtk.types.Unit unit)Gets the top margin in units of unit.
gtk.types.WrapMode getWrapMode()Gets the line wrapping mode for the printed text. Returns: the line wrap mode.
void ignoreTag(gtk.text_tag.TextTag tag)Specifies a tag whose style should be ignored when compositing the document to the printable page.
bool paginate(gtk.print_context.PrintContext context)Paginate the document associated with the compositor.
void setBodyFontName(string fontName)Sets the default font for the printed text.
void setBottomMargin(double margin, gtk.types.Unit unit)Sets the bottom margin used by compositor.
void setFooterFontName(string fontName = null)Sets the font for printing the page footer.
void setFooterFormat(bool separator, string left = null, string center = null, string right = null)See [gtksource.print_compositor.PrintCompositor.setHeaderFormat] for more information about the parameters.
void setHeaderFontName(string fontName = null)Sets the font for printing the page header.
void setHeaderFormat(bool separator, string left = null, string center = null, string right = null)Sets strftime like header format strings, to be printed on the left, center and right of the top of each page.
void setHighlightSyntax(bool highlight)Sets whether the printed text will be highlighted according to the buffer rules. Both color and font style are applied.
void setLeftMargin(double margin, gtk.types.Unit unit)Sets the left margin used by compositor.
void setLineNumbersFontName(string fontName = null)Sets the font for printing line numbers on the left margin.
void setPrintFooter(bool print)Sets whether you want to print a footer in each page.
void setPrintHeader(bool print)Sets whether you want to print a header in each page.
void setPrintLineNumbers(uint interval)Sets the interval for printed line numbers.
void setRightMargin(double margin, gtk.types.Unit unit)Sets the right margin used by compositor.
void setTabWidth(uint width)Sets the width of tabulation in characters for printed text.
void setTopMargin(double margin, gtk.types.Unit unit)Sets the top margin used by compositor.
void setWrapMode(gtk.types.WrapMode wrapMode)Sets the line wrapping mode for the printed text.
Constructors
this(void * ptr, Flag!"Take" take)
this(gtksource.buffer.Buffer buffer)Creates a new print compositor that can be used to print buffer.
Methods
T bodyFontName(string propval)Set `bodyFontName` property. Params: propval = Name of the font used for the text body.
T buffer(gtksource.buffer.Buffer propval)Set `buffer` property. Params: propval = The `class@Buffer` object to print. Returns: Builder instance for fluent chaining
T footerFontName(string propval)Set `footerFontName` property. Params: propval = Name of the font used to print page footer. If this property is unspecified, the text body font is used.
T headerFontName(string propval)Set `headerFontName` property. Params: propval = Name of the font used to print page header. If this property is unspecified, the text body font is used.
T highlightSyntax(bool propval)Set `highlightSyntax` property. Params: propval = Whether to print the document with highlighted syntax.
T lineNumbersFontName(string propval)Set `lineNumbersFontName` property. Params: propval = Name of the font used to print line numbers on the left margin. If this property is unspecified, the text body font is used.
T printFooter(bool propval)Set `printFooter` property. Params: propval = Whether to print a footer in each page.
T printHeader(bool propval)Set `printHeader` property. Params: propval = Whether to print a header in each page.
T printLineNumbers(uint propval)Set `printLineNumbers` property. Params: propval = Interval of printed line numbers.
T tabWidth(uint propval)Set `tabWidth` property. Params: propval = Width of a tab character expressed in spaces.
T wrapMode(gtk.types.WrapMode propval)Set `wrapMode` property. Params: propval = Whether to wrap lines never, at word boundaries, or at character boundaries.

Fluent builder for [gtksource.print_compositor.PrintCompositor]