PrintCompositor

open class PrintCompositor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Compose a class@Buffer for printing.

The GtkSourcePrintCompositor object is used to compose a class@Buffer for printing. You can set various configuration options to customize the printed output. GtkSourcePrintCompositor is designed to be used with the high-level printing API of gtk+, i.e. class@Gtk.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 class@Gtk.PageSetup objects. If the specified layout margins are smaller than the "print margins", the latter ones are used as a fallback by the GtkSourcePrintCompositor object, so that the printed area is not clipped.

Skipped during bindings generation

  • method footer-font-name: Property TypeInfo of getter and setter do not match

  • method header-font-name: Property TypeInfo of getter and setter do not match

  • method line-numbers-font-name: Property TypeInfo of getter and setter do not match

Constructors

Link copied to clipboard
constructor(buffer: Buffer)

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

constructor(view: View)

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

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Name of the font used for the text body.

Link copied to clipboard
open val buffer: Buffer

The class@Buffer object to print.

Link copied to clipboard
val gtksourcePrintCompositorPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

Whether to print the document with highlighted syntax.

Link copied to clipboard
open val nPages: Int

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

Link copied to clipboard

Whether to print a footer in each page.

Link copied to clipboard

Whether to print a header in each page.

Link copied to clipboard
open var printLineNumbers: <Error class: unknown class>

Interval of printed line numbers.

Link copied to clipboard
open var tabWidth: <Error class: unknown class>

Width of a tab character expressed in spaces.

Link copied to clipboard
open var wrapMode: <Error class: unknown class>

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

Functions

Link copied to clipboard
open fun drawPage(context: <Error class: unknown class>, pageNr: Int)

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

Link copied to clipboard

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

Link copied to clipboard
open fun getBottomMargin(unit: <Error class: unknown class>): Double

Gets the bottom margin in units of @unit.

Link copied to clipboard
open fun getBuffer(): Buffer

Gets the class@Buffer associated with the compositor.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard
open fun getLeftMargin(unit: <Error class: unknown class>): Double

Gets the left margin in units of @unit.

Link copied to clipboard

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

Link copied to clipboard
open fun getNPages(): Int

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

Link copied to clipboard

Returns the current fraction of the document pagination that has been completed.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard
open fun getPrintLineNumbers(): <Error class: unknown class>

Returns the interval used for line number printing.

Link copied to clipboard
open fun getRightMargin(unit: <Error class: unknown class>): Double

Gets the right margin in units of @unit.

Link copied to clipboard
open fun getTabWidth(): <Error class: unknown class>

Returns the width of tabulation in characters for printed text.

Link copied to clipboard
open fun getTopMargin(unit: <Error class: unknown class>): Double

Gets the top margin in units of @unit.

Link copied to clipboard
open fun getWrapMode(): <Error class: unknown class>

Gets the line wrapping mode for the printed text.

Link copied to clipboard
open fun ignoreTag(tag: <Error class: unknown class>)

Specifies a tag whose style should be ignored when compositing the document to the printable page.

Link copied to clipboard
open fun paginate(context: <Error class: unknown class>): Boolean

Paginate the document associated with the @compositor.

Link copied to clipboard
open fun setBodyFontName(fontName: String)

Sets the default font for the printed text.

Link copied to clipboard
open fun setBottomMargin(margin: Double, unit: <Error class: unknown class>)

Sets the bottom margin used by @compositor.

Link copied to clipboard
open fun setFooterFontName(fontName: String? = null)

Sets the font for printing the page footer.

Link copied to clipboard
open fun setFooterFormat(separator: Boolean, left: String? = null, center: String? = null, right: String? = null)

See method@PrintCompositor.set_header_format for more information about the parameters.

Link copied to clipboard
open fun setHeaderFontName(fontName: String? = null)

Sets the font for printing the page header.

Link copied to clipboard
open fun setHeaderFormat(separator: Boolean, left: String? = null, center: String? = null, right: String? = null)

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

Link copied to clipboard
open fun setHighlightSyntax(highlight: Boolean)

Sets whether the printed text will be highlighted according to the buffer rules. Both color and font style are applied.

Link copied to clipboard
open fun setLeftMargin(margin: Double, unit: <Error class: unknown class>)

Sets the left margin used by @compositor.

Link copied to clipboard
open fun setLineNumbersFontName(fontName: String? = null)

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

Link copied to clipboard
open fun setPrintFooter(print: Boolean)

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

Link copied to clipboard
open fun setPrintHeader(print: Boolean)

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

Link copied to clipboard
open fun setPrintLineNumbers(interval: <Error class: unknown class>)

Sets the interval for printed line numbers.

Link copied to clipboard
open fun setRightMargin(margin: Double, unit: <Error class: unknown class>)

Sets the right margin used by @compositor.

Link copied to clipboard
open fun setTabWidth(width: <Error class: unknown class>)

Sets the width of tabulation in characters for printed text.

Link copied to clipboard
open fun setTopMargin(margin: Double, unit: <Error class: unknown class>)

Sets the top margin used by @compositor.

Link copied to clipboard
open fun setWrapMode(wrapMode: <Error class: unknown class>)

Sets the line wrapping mode for the printed text.