gtksource.print_compositor

Module for [PrintCompositor] class

Types 3

Compose a gtksource.buffer.Buffer for printing.

The gtksource.print_compositor.PrintCompositor object is used to compose a gtksource.buffer.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 _getGType() static nothrow
GType _gType() @property nothrow
PrintCompositor self() nothrowReturns `this`, for use in `with` statements.
PrintCompositorGidBuilder builder() static nothrowGet builder for [gtksource.print_compositor.PrintCompositor] Returns: New builder object
string bodyFontName() @property nothrowGet `bodyFontName` property. Returns: Name of the font used for the text body.
void bodyFontName(string propval) @property nothrowSet `bodyFontName` property. Params: propval = Name of the font used for the text body.
gtksource.buffer.Buffer buffer() @property nothrowGet `buffer` property. Returns: The [gtksource.buffer.Buffer] object to print.
string footerFontName() @property nothrowGet `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) @property nothrowSet `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() @property nothrowGet `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) @property nothrowSet `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() @property nothrowGet `highlightSyntax` property. Returns: Whether to print the document with highlighted syntax.
void highlightSyntax(bool propval) @property nothrowSet `highlightSyntax` property. Params: propval = Whether to print the document with highlighted syntax.
string lineNumbersFontName() @property nothrowGet `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) @property nothrowSet `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() @property nothrowGet `nPages` property. Returns: The number of pages in the document or <code>-1</code> if the document has not been completely paginated.
bool printFooter() @property nothrowGet `printFooter` property. Returns: Whether to print a footer in each page.
void printFooter(bool propval) @property nothrowSet `printFooter` property. Params: propval = Whether to print a footer in each page.
bool printHeader() @property nothrowGet `printHeader` property. Returns: Whether to print a header in each page.
void printHeader(bool propval) @property nothrowSet `printHeader` property. Params: propval = Whether to print a header in each page.
uint printLineNumbers() @property nothrowGet `printLineNumbers` property. Returns: Interval of printed line numbers.
void printLineNumbers(uint propval) @property nothrowSet `printLineNumbers` property. Params: propval = Interval of printed line numbers.
uint tabWidth() @property nothrowGet `tabWidth` property. Returns: Width of a tab character expressed in spaces.
void tabWidth(uint propval) @property nothrowSet `tabWidth` property. Params: propval = Width of a tab character expressed in spaces.
gtk.types.WrapMode wrapMode() @property nothrowGet `wrapMode` property. Returns: Whether to wrap lines never, at word boundaries, or at character boundaries.
void wrapMode(gtk.types.WrapMode propval) @property nothrowSet `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) static nothrowCreates a new print compositor that can be used to print the buffer associated with view.
void drawPage(gtk.print_context.PrintContext context, int pageNr) nothrowDraw page page_nr for printing on the the Cairo context encapsuled in context.
string getBodyFontName() nothrowReturns the name of the font used to print the text body.
double getBottomMargin(gtk.types.Unit unit) nothrowGets the bottom margin in units of unit.
gtksource.buffer.Buffer getBuffer() nothrowGets the [gtksource.buffer.Buffer] associated with the compositor.
string getFooterFontName() nothrowReturns the name of the font used to print the page footer.
string getHeaderFontName() nothrowReturns the name of the font used to print the page header.
bool getHighlightSyntax() nothrowDetermines whether the printed text will be highlighted according to the buffer rules.
double getLeftMargin(gtk.types.Unit unit) nothrowGets the left margin in units of unit.
string getLineNumbersFontName() nothrowReturns the name of the font used to print line numbers on the left margin.
int getNPages() nothrowReturns 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() nothrowReturns the current fraction of the document pagination that has been completed. Returns: a fraction from 0.0 to 1.0 inclusive.
bool getPrintFooter() nothrowDetermines if a footer is set to be printed for each page.
bool getPrintHeader() nothrowDetermines if a header is set to be printed for each page.
uint getPrintLineNumbers() nothrowReturns the interval used for line number printing.
double getRightMargin(gtk.types.Unit unit) nothrowGets the right margin in units of unit.
uint getTabWidth() nothrowReturns the width of tabulation in characters for printed text. Returns: width of tab.
double getTopMargin(gtk.types.Unit unit) nothrowGets the top margin in units of unit.
gtk.types.WrapMode getWrapMode() nothrowGets the line wrapping mode for the printed text. Returns: the line wrap mode.
void ignoreTag(gtk.text_tag.TextTag tag) nothrowSpecifies a tag whose style should be ignored when compositing the document to the printable page.
bool paginate(gtk.print_context.PrintContext context) nothrowPaginate the document associated with the compositor.
void setBodyFontName(string fontName) nothrowSets the default font for the printed text.
void setBottomMargin(double margin, gtk.types.Unit unit) nothrowSets the bottom margin used by compositor.
void setFooterFontName(string fontName = null) nothrowSets the font for printing the page footer.
void setFooterFormat(bool separator, string left = null, string center = null, string right = null) nothrowSee [gtksource.print_compositor.PrintCompositor.setHeaderFormat] for more information about the parameters.
void setHeaderFontName(string fontName = null) nothrowSets the font for printing the page header.
void setHeaderFormat(bool separator, string left = null, string center = null, string right = null) nothrowSets strftime like header format strings, to be printed on the left, center and right of the top of each page.
void setHighlightSyntax(bool highlight) nothrowSets 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) nothrowSets the left margin used by compositor.
void setLineNumbersFontName(string fontName = null) nothrowSets the font for printing line numbers on the left margin.
void setPrintFooter(bool print) nothrowSets whether you want to print a footer in each page.
void setPrintHeader(bool print) nothrowSets whether you want to print a header in each page.
void setPrintLineNumbers(uint interval) nothrowSets the interval for printed line numbers.
void setRightMargin(double margin, gtk.types.Unit unit) nothrowSets the right margin used by compositor.
void setTabWidth(uint width) nothrowSets the width of tabulation in characters for printed text.
void setTopMargin(double margin, gtk.types.Unit unit) nothrowSets the top margin used by compositor.
void setWrapMode(gtk.types.WrapMode wrapMode) nothrowSets 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.

Fluent builder implementation template for gtksource.print_compositor.PrintCompositor

Methods
T bodyFontName(string propval) nothrowSet `bodyFontName` property. Params: propval = Name of the font used for the text body.
T buffer(gtksource.buffer.Buffer propval) nothrowSet `buffer` property. Params: propval = The [gtksource.buffer.Buffer] object to print. Returns: Builder instance for fluent chaining
T footerFontName(string propval) nothrowSet `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) nothrowSet `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) nothrowSet `highlightSyntax` property. Params: propval = Whether to print the document with highlighted syntax.
T lineNumbersFontName(string propval) nothrowSet `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) nothrowSet `printFooter` property. Params: propval = Whether to print a footer in each page.
T printHeader(bool propval) nothrowSet `printHeader` property. Params: propval = Whether to print a header in each page.
T printLineNumbers(uint propval) nothrowSet `printLineNumbers` property. Params: propval = Interval of printed line numbers.
T tabWidth(uint propval) nothrowSet `tabWidth` property. Params: propval = Width of a tab character expressed in spaces.
T wrapMode(gtk.types.WrapMode propval) nothrowSet `wrapMode` property. Params: propval = Whether to wrap lines never, at word boundaries, or at character boundaries.