Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
- Exported types
- Methods
- drawPage
- getBodyFontName
- getBottomMargin
- getBuffer
- getFooterFontName
- getHeaderFontName
- getHighlightSyntax
- getLeftMargin
- getLineNumbersFontName
- getNPages
- getPaginationProgress
- getPrintFooter
- getPrintHeader
- getPrintLineNumbers
- getRightMargin
- getTabWidth
- getTopMargin
- getWrapMode
- ignoreTag
- new
- newFromView
- paginate
- setBodyFontName
- setBottomMargin
- setFooterFontName
- setFooterFormat
- setHeaderFontName
- setHeaderFormat
- setHighlightSyntax
- setLeftMargin
- setLineNumbersFontName
- setPrintFooter
- setPrintHeader
- setPrintLineNumbers
- setRightMargin
- setTabWidth
- setTopMargin
- setWrapMode
- Properties
Compose a [classbuffer
] for printing.
The GtkSourcePrintCompositor
object is used to compose a [classbuffer
]
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. 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 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.
Synopsis
- newtype PrintCompositor = PrintCompositor (ManagedPtr PrintCompositor)
- class (GObject o, IsDescendantOf PrintCompositor o) => IsPrintCompositor o
- toPrintCompositor :: (MonadIO m, IsPrintCompositor o) => o -> m PrintCompositor
- printCompositorDrawPage :: (HasCallStack, MonadIO m, IsPrintCompositor a, IsPrintContext b) => a -> b -> Int32 -> m ()
- printCompositorGetBodyFontName :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> m Text
- printCompositorGetBottomMargin :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> Unit -> m Double
- printCompositorGetBuffer :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> m Buffer
- printCompositorGetFooterFontName :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> m Text
- printCompositorGetHeaderFontName :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> m Text
- printCompositorGetHighlightSyntax :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> m Bool
- printCompositorGetLeftMargin :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> Unit -> m Double
- printCompositorGetLineNumbersFontName :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> m Text
- printCompositorGetNPages :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> m Int32
- printCompositorGetPaginationProgress :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> m Double
- printCompositorGetPrintFooter :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> m Bool
- printCompositorGetPrintHeader :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> m Bool
- printCompositorGetPrintLineNumbers :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> m Word32
- printCompositorGetRightMargin :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> Unit -> m Double
- printCompositorGetTabWidth :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> m Word32
- printCompositorGetTopMargin :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> Unit -> m Double
- printCompositorGetWrapMode :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> m WrapMode
- printCompositorIgnoreTag :: (HasCallStack, MonadIO m, IsPrintCompositor a, IsTextTag b) => a -> b -> m ()
- printCompositorNew :: (HasCallStack, MonadIO m, IsBuffer a) => a -> m PrintCompositor
- printCompositorNewFromView :: (HasCallStack, MonadIO m, IsView a) => a -> m PrintCompositor
- printCompositorPaginate :: (HasCallStack, MonadIO m, IsPrintCompositor a, IsPrintContext b) => a -> b -> m Bool
- printCompositorSetBodyFontName :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> Text -> m ()
- printCompositorSetBottomMargin :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> Double -> Unit -> m ()
- printCompositorSetFooterFontName :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> Maybe Text -> m ()
- printCompositorSetFooterFormat :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> Bool -> Maybe Text -> Maybe Text -> Maybe Text -> m ()
- printCompositorSetHeaderFontName :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> Maybe Text -> m ()
- printCompositorSetHeaderFormat :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> Bool -> Maybe Text -> Maybe Text -> Maybe Text -> m ()
- printCompositorSetHighlightSyntax :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> Bool -> m ()
- printCompositorSetLeftMargin :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> Double -> Unit -> m ()
- printCompositorSetLineNumbersFontName :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> Maybe Text -> m ()
- printCompositorSetPrintFooter :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> Bool -> m ()
- printCompositorSetPrintHeader :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> Bool -> m ()
- printCompositorSetPrintLineNumbers :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> Word32 -> m ()
- printCompositorSetRightMargin :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> Double -> Unit -> m ()
- printCompositorSetTabWidth :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> Word32 -> m ()
- printCompositorSetTopMargin :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> Double -> Unit -> m ()
- printCompositorSetWrapMode :: (HasCallStack, MonadIO m, IsPrintCompositor a) => a -> WrapMode -> m ()
- constructPrintCompositorBodyFontName :: (IsPrintCompositor o, MonadIO m) => Text -> m (GValueConstruct o)
- getPrintCompositorBodyFontName :: (MonadIO m, IsPrintCompositor o) => o -> m (Maybe Text)
- setPrintCompositorBodyFontName :: (MonadIO m, IsPrintCompositor o) => o -> Text -> m ()
- constructPrintCompositorBuffer :: (IsPrintCompositor o, MonadIO m, IsBuffer a) => a -> m (GValueConstruct o)
- getPrintCompositorBuffer :: (MonadIO m, IsPrintCompositor o) => o -> m Buffer
- clearPrintCompositorFooterFontName :: (MonadIO m, IsPrintCompositor o) => o -> m ()
- constructPrintCompositorFooterFontName :: (IsPrintCompositor o, MonadIO m) => Text -> m (GValueConstruct o)
- getPrintCompositorFooterFontName :: (MonadIO m, IsPrintCompositor o) => o -> m (Maybe Text)
- setPrintCompositorFooterFontName :: (MonadIO m, IsPrintCompositor o) => o -> Text -> m ()
- clearPrintCompositorHeaderFontName :: (MonadIO m, IsPrintCompositor o) => o -> m ()
- constructPrintCompositorHeaderFontName :: (IsPrintCompositor o, MonadIO m) => Text -> m (GValueConstruct o)
- getPrintCompositorHeaderFontName :: (MonadIO m, IsPrintCompositor o) => o -> m (Maybe Text)
- setPrintCompositorHeaderFontName :: (MonadIO m, IsPrintCompositor o) => o -> Text -> m ()
- constructPrintCompositorHighlightSyntax :: (IsPrintCompositor o, MonadIO m) => Bool -> m (GValueConstruct o)
- getPrintCompositorHighlightSyntax :: (MonadIO m, IsPrintCompositor o) => o -> m Bool
- setPrintCompositorHighlightSyntax :: (MonadIO m, IsPrintCompositor o) => o -> Bool -> m ()
- clearPrintCompositorLineNumbersFontName :: (MonadIO m, IsPrintCompositor o) => o -> m ()
- constructPrintCompositorLineNumbersFontName :: (IsPrintCompositor o, MonadIO m) => Text -> m (GValueConstruct o)
- getPrintCompositorLineNumbersFontName :: (MonadIO m, IsPrintCompositor o) => o -> m (Maybe Text)
- setPrintCompositorLineNumbersFontName :: (MonadIO m, IsPrintCompositor o) => o -> Text -> m ()
- getPrintCompositorNPages :: (MonadIO m, IsPrintCompositor o) => o -> m Int32
- constructPrintCompositorPrintFooter :: (IsPrintCompositor o, MonadIO m) => Bool -> m (GValueConstruct o)
- getPrintCompositorPrintFooter :: (MonadIO m, IsPrintCompositor o) => o -> m Bool
- setPrintCompositorPrintFooter :: (MonadIO m, IsPrintCompositor o) => o -> Bool -> m ()
- constructPrintCompositorPrintHeader :: (IsPrintCompositor o, MonadIO m) => Bool -> m (GValueConstruct o)
- getPrintCompositorPrintHeader :: (MonadIO m, IsPrintCompositor o) => o -> m Bool
- setPrintCompositorPrintHeader :: (MonadIO m, IsPrintCompositor o) => o -> Bool -> m ()
- constructPrintCompositorPrintLineNumbers :: (IsPrintCompositor o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getPrintCompositorPrintLineNumbers :: (MonadIO m, IsPrintCompositor o) => o -> m Word32
- setPrintCompositorPrintLineNumbers :: (MonadIO m, IsPrintCompositor o) => o -> Word32 -> m ()
- constructPrintCompositorTabWidth :: (IsPrintCompositor o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getPrintCompositorTabWidth :: (MonadIO m, IsPrintCompositor o) => o -> m Word32
- setPrintCompositorTabWidth :: (MonadIO m, IsPrintCompositor o) => o -> Word32 -> m ()
- constructPrintCompositorWrapMode :: (IsPrintCompositor o, MonadIO m) => WrapMode -> m (GValueConstruct o)
- getPrintCompositorWrapMode :: (MonadIO m, IsPrintCompositor o) => o -> m WrapMode
- setPrintCompositorWrapMode :: (MonadIO m, IsPrintCompositor o) => o -> WrapMode -> m ()
Exported types
newtype PrintCompositor Source #
Memory-managed wrapper type.
PrintCompositor (ManagedPtr PrintCompositor) |
Instances
class (GObject o, IsDescendantOf PrintCompositor o) => IsPrintCompositor o Source #
Type class for types which can be safely cast to PrintCompositor
, for instance with toPrintCompositor
.
Instances
(GObject o, IsDescendantOf PrintCompositor o) => IsPrintCompositor o Source # | |
Defined in GI.GtkSource.Objects.PrintCompositor |
toPrintCompositor :: (MonadIO m, IsPrintCompositor o) => o -> m PrintCompositor Source #
Cast to PrintCompositor
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, drawPage, forceFloating, freezeNotify, getv, ignoreTag, isFloating, notify, notifyByPspec, paginate, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getBodyFontName, getBottomMargin, getBuffer, getData, getFooterFontName, getHeaderFontName, getHighlightSyntax, getLeftMargin, getLineNumbersFontName, getNPages, getPaginationProgress, getPrintFooter, getPrintHeader, getPrintLineNumbers, getProperty, getQdata, getRightMargin, getTabWidth, getTopMargin, getWrapMode.
Setters
setBodyFontName, setBottomMargin, setData, setDataFull, setFooterFontName, setFooterFormat, setHeaderFontName, setHeaderFormat, setHighlightSyntax, setLeftMargin, setLineNumbersFontName, setPrintFooter, setPrintHeader, setPrintLineNumbers, setProperty, setRightMargin, setTabWidth, setTopMargin, setWrapMode.
drawPage
printCompositorDrawPage Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a, IsPrintContext b) | |
=> a |
|
-> b |
|
-> Int32 |
|
-> m () |
Draw page pageNr
for printing on the the Cairo context encapsuled in context
.
This method has been designed to be called in the handler of the signalgtk
.PrintOperation[draw_page] signal
as shown in the following example:
c code
// Signal handler for the GtkPrintOperation::draw_page signal static void draw_page (GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, gpointer user_data) { GtkSourcePrintCompositor *compositor; compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data); gtk_source_print_compositor_draw_page (compositor, context, page_nr); }
getBodyFontName
printCompositorGetBodyFontName Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> m Text | Returns: a new string containing the name of the font used to print the text body. |
Returns the name of the font used to print the text body.
The returned string must be freed with free
.
getBottomMargin
printCompositorGetBottomMargin Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> Unit |
|
-> m Double | Returns: the bottom margin. |
Gets the bottom margin in units of unit
.
getBuffer
printCompositorGetBuffer Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> m Buffer | Returns: the |
Gets the [classbuffer
] associated with the compositor.
The returned object reference is owned by the compositor object and should not be unreferenced.
getFooterFontName
printCompositorGetFooterFontName Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> m Text | Returns: a new string containing the name of the font used to print the page footer. |
Returns the name of the font used to print the page footer.
The returned string must be freed with free
.
getHeaderFontName
printCompositorGetHeaderFontName Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> m Text | Returns: a new string containing the name of the font used to print the page header. |
Returns the name of the font used to print the page header.
The returned string must be freed with free
.
getHighlightSyntax
printCompositorGetHighlightSyntax Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> m Bool | Returns: |
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.
getLeftMargin
printCompositorGetLeftMargin Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> Unit |
|
-> m Double | Returns: the left margin |
Gets the left margin in units of unit
.
getLineNumbersFontName
printCompositorGetLineNumbersFontName Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> m Text | Returns: a new string containing the name of the font used to print line numbers on the left margin. |
Returns the name of the font used to print line numbers on the left margin.
The returned string must be freed with free
.
getNPages
printCompositorGetNPages Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> m Int32 | 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 not been completely paginated.
getPaginationProgress
printCompositorGetPaginationProgress Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> m Double | Returns: a fraction from 0.0 to 1.0 inclusive. |
Returns the current fraction of the document pagination that has been completed.
getPrintFooter
printCompositorGetPrintFooter Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> m Bool | Returns: |
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 [methodprintCompositor
.set_footer_format].
getPrintHeader
printCompositorGetPrintHeader Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> m Bool | Returns: |
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 [methodprintCompositor
.set_header_format].
getPrintLineNumbers
printCompositorGetPrintLineNumbers Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> m Word32 | Returns: the interval of printed line numbers. |
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).
getRightMargin
printCompositorGetRightMargin Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> Unit |
|
-> m Double | Returns: the right margin. |
Gets the right margin in units of unit
.
getTabWidth
printCompositorGetTabWidth Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> m Word32 | Returns: width of tab. |
Returns the width of tabulation in characters for printed text.
getTopMargin
printCompositorGetTopMargin Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> Unit |
|
-> m Double | Returns: the top margin. |
Gets the top margin in units of unit
.
getWrapMode
printCompositorGetWrapMode Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> m WrapMode | Returns: the line wrap mode. |
Gets the line wrapping mode for the printed text.
ignoreTag
printCompositorIgnoreTag Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a, IsTextTag b) | |
=> a |
|
-> b |
|
-> m () |
Specifies a tag whose style should be ignored when compositing the document to the printable page.
Since: 5.2
new
:: (HasCallStack, MonadIO m, IsBuffer a) | |
=> a |
|
-> m PrintCompositor | Returns: a new print compositor object. |
Creates a new print compositor that can be used to print buffer
.
newFromView
printCompositorNewFromView Source #
:: (HasCallStack, MonadIO m, IsView a) | |
=> a |
|
-> m PrintCompositor | Returns: a new print compositor object. |
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
[propertyprintCompositor
:tab-width], [propertyprintCompositor
:highlight-syntax],
[propertyprintCompositor
:wrap-mode], [propertyprintCompositor
:body-font-name] and
[propertyprintCompositor
:print-line-numbers].
paginate
printCompositorPaginate Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a, IsPrintContext b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: |
Paginate the document associated with the compositor
.
In order to support non-blocking pagination, document is paginated in small chunks.
Each time [methodprintCompositor
.paginate] is invoked, a chunk of the document
is paginated. To paginate the entire document, [methodprintCompositor
.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 PrintOperation::paginate signal, as shown in the following example:
c code
// Signal handler for the GtkPrintOperation::paginate signal static gboolean paginate (GtkPrintOperation *operation, GtkPrintContext *context, gpointer user_data) { GtkSourcePrintCompositor *compositor; compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data); if (gtk_source_print_compositor_paginate (compositor, context)) { gint n_pages; n_pages = gtk_source_print_compositor_get_n_pages (compositor); gtk_print_operation_set_n_pages (operation, n_pages); return TRUE; } return FALSE; }
If you don't need to do pagination in chunks, you can simply do it all in the PrintOperation::beginPrint handler, and set the number of pages from there, like in the following example:
c code
// Signal handler for the GtkPrintOperation::begin-print signal static void begin_print (GtkPrintOperation *operation, GtkPrintContext *context, gpointer user_data) { GtkSourcePrintCompositor *compositor; gint n_pages; compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data); while (!gtk_source_print_compositor_paginate (compositor, context)); n_pages = gtk_source_print_compositor_get_n_pages (compositor); gtk_print_operation_set_n_pages (operation, n_pages); }
setBodyFontName
printCompositorSetBodyFontName Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the default font for the printed text.
fontName
should be a
string representation of a font description Pango can understand.
(e.g. "Monospace 10"). See [funcpango
.FontDescription.from_string]
for a description of the format of the string representation.
This function cannot be called anymore after the first call to the
[methodprintCompositor
.paginate] function.
setBottomMargin
printCompositorSetBottomMargin Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> Double |
|
-> Unit |
|
-> m () |
Sets the bottom margin used by compositor
.
setFooterFontName
printCompositorSetFooterFontName Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Sets the font for printing the page footer.
If Nothing
is supplied, the default font (i.e. the one being used for the
text) will be used instead.
fontName
should be a
string representation of a font description Pango can understand.
(e.g. "Monospace 10"). See [funcpango
.FontDescription.from_string]
for a description of the format of the string representation.
This function cannot be called anymore after the first call to the
[methodprintCompositor
.paginate] function.
setFooterFormat
printCompositorSetFooterFormat Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> Bool |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> m () |
See [methodprintCompositor
.set_header_format] for more information
about the parameters.
setHeaderFontName
printCompositorSetHeaderFontName Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Sets the font for printing the page header.
If Nothing
is supplied, the default font (i.e. the one being used for the
text) will be used instead.
fontName
should be a
string representation of a font description Pango can understand.
(e.g. "Monospace 10"). See [funcpango
.FontDescription.from_string]
for a description of the format of the string representation.
This function cannot be called anymore after the first call to the
[methodprintCompositor
.paginate] function.
setHeaderFormat
printCompositorSetHeaderFormat Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> Bool |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> m () |
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.
A subset of strftime()
codes are accepted, see dateTimeFormat
for more details on the accepted format specifiers.
Additionally the following format specifiers are accepted:
N
: the page numberQ
: the page count.
separator
specifies if a solid line should be drawn to separate
the header from the document text.
If Nothing
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 [methodprintCompositor
.set_print_header].
This function cannot be called anymore after the first call to the
[methodprintCompositor
.paginate] function.
setHighlightSyntax
printCompositorSetHighlightSyntax Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> Bool |
|
-> m () |
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
[methodprintCompositor
.paginate] function.
setLeftMargin
printCompositorSetLeftMargin Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> Double |
|
-> Unit |
|
-> m () |
Sets the left margin used by compositor
.
setLineNumbersFontName
printCompositorSetLineNumbersFontName Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Sets the font for printing line numbers on the left margin.
If Nothing
is supplied, the default font (i.e. the one being used for the
text) will be used instead.
fontName
should be a
string representation of a font description Pango can understand.
(e.g. "Monospace 10"). See [funcpango
.FontDescription.from_string]
for a description of the format of the string representation.
This function cannot be called anymore after the first call to the
[methodprintCompositor
.paginate] function.
setPrintFooter
printCompositorSetPrintFooter Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> Bool |
|
-> m () |
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
[methodprintCompositor
.set_footer_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
[methodprintCompositor
.paginate] function.
setPrintHeader
printCompositorSetPrintHeader Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> Bool |
|
-> m () |
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 [methodprintCompositor
.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
[methodprintCompositor
.paginate] function.
setPrintLineNumbers
printCompositorSetPrintLineNumbers Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> Word32 |
|
-> m () |
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
[methodprintCompositor
.paginate] function.
setRightMargin
printCompositorSetRightMargin Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> Double |
|
-> Unit |
|
-> m () |
Sets the right margin used by compositor
.
setTabWidth
printCompositorSetTabWidth Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> Word32 |
|
-> m () |
Sets the width of tabulation in characters for printed text.
This function cannot be called anymore after the first call to the
[methodprintCompositor
.paginate] function.
setTopMargin
printCompositorSetTopMargin Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> Double |
|
-> Unit |
|
-> m () |
Sets the top margin used by compositor
.
setWrapMode
printCompositorSetWrapMode Source #
:: (HasCallStack, MonadIO m, IsPrintCompositor a) | |
=> a |
|
-> WrapMode |
|
-> m () |
Sets the line wrapping mode for the printed text.
This function cannot be called anymore after the first call to the
[methodprintCompositor
.paginate] function.
Properties
bodyFontName
Name of the font used for the text body.
Accepted values are strings representing a font description Pango can understand.
(e.g. "Monospace 10"). See [funcpango
.FontDescription.from_string]
for a description of the format of the string representation.
The value of this property cannot be changed anymore after the first
call to the [methodprintCompositor
.paginate] function.
constructPrintCompositorBodyFontName :: (IsPrintCompositor o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “body-font-name
” property. This is rarely needed directly, but it is used by new
.
getPrintCompositorBodyFontName :: (MonadIO m, IsPrintCompositor o) => o -> m (Maybe Text) Source #
Get the value of the “body-font-name
” property.
When overloading is enabled, this is equivalent to
get
printCompositor #bodyFontName
setPrintCompositorBodyFontName :: (MonadIO m, IsPrintCompositor o) => o -> Text -> m () Source #
Set the value of the “body-font-name
” property.
When overloading is enabled, this is equivalent to
set
printCompositor [ #bodyFontName:=
value ]
buffer
The [classbuffer
] object to print.
constructPrintCompositorBuffer :: (IsPrintCompositor o, MonadIO m, IsBuffer a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “buffer
” property. This is rarely needed directly, but it is used by new
.
getPrintCompositorBuffer :: (MonadIO m, IsPrintCompositor o) => o -> m Buffer Source #
Get the value of the “buffer
” property.
When overloading is enabled, this is equivalent to
get
printCompositor #buffer
footerFontName
Name of the font used to print page footer. If this property is unspecified, the text body font is used.
Accepted values are strings representing a font description Pango can understand.
(e.g. "Monospace 10"). See [funcpango
.FontDescription.from_string]
for a description of the format of the string representation.
The value of this property cannot be changed anymore after the first
call to the [methodprintCompositor
.paginate] function.
clearPrintCompositorFooterFontName :: (MonadIO m, IsPrintCompositor o) => o -> m () Source #
Set the value of the “footer-font-name
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#footerFontName
constructPrintCompositorFooterFontName :: (IsPrintCompositor o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “footer-font-name
” property. This is rarely needed directly, but it is used by new
.
getPrintCompositorFooterFontName :: (MonadIO m, IsPrintCompositor o) => o -> m (Maybe Text) Source #
Get the value of the “footer-font-name
” property.
When overloading is enabled, this is equivalent to
get
printCompositor #footerFontName
setPrintCompositorFooterFontName :: (MonadIO m, IsPrintCompositor o) => o -> Text -> m () Source #
Set the value of the “footer-font-name
” property.
When overloading is enabled, this is equivalent to
set
printCompositor [ #footerFontName:=
value ]
headerFontName
Name of the font used to print page header. If this property is unspecified, the text body font is used.
Accepted values are strings representing a font description Pango can understand.
(e.g. "Monospace 10"). See [funcpango
.FontDescription.from_string]
for a description of the format of the string representation.
The value of this property cannot be changed anymore after the first
call to the [methodprintCompositor
.paginate] function.
clearPrintCompositorHeaderFontName :: (MonadIO m, IsPrintCompositor o) => o -> m () Source #
Set the value of the “header-font-name
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#headerFontName
constructPrintCompositorHeaderFontName :: (IsPrintCompositor o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “header-font-name
” property. This is rarely needed directly, but it is used by new
.
getPrintCompositorHeaderFontName :: (MonadIO m, IsPrintCompositor o) => o -> m (Maybe Text) Source #
Get the value of the “header-font-name
” property.
When overloading is enabled, this is equivalent to
get
printCompositor #headerFontName
setPrintCompositorHeaderFontName :: (MonadIO m, IsPrintCompositor o) => o -> Text -> m () Source #
Set the value of the “header-font-name
” property.
When overloading is enabled, this is equivalent to
set
printCompositor [ #headerFontName:=
value ]
highlightSyntax
Whether to print the document with highlighted syntax.
The value of this property cannot be changed anymore after the first
call to the [methodprintCompositor
.paginate] function.
constructPrintCompositorHighlightSyntax :: (IsPrintCompositor o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “highlight-syntax
” property. This is rarely needed directly, but it is used by new
.
getPrintCompositorHighlightSyntax :: (MonadIO m, IsPrintCompositor o) => o -> m Bool Source #
Get the value of the “highlight-syntax
” property.
When overloading is enabled, this is equivalent to
get
printCompositor #highlightSyntax
setPrintCompositorHighlightSyntax :: (MonadIO m, IsPrintCompositor o) => o -> Bool -> m () Source #
Set the value of the “highlight-syntax
” property.
When overloading is enabled, this is equivalent to
set
printCompositor [ #highlightSyntax:=
value ]
lineNumbersFontName
Name of the font used to print line numbers on the left margin. If this property is unspecified, the text body font is used.
Accepted values are strings representing a font description Pango can understand.
(e.g. "Monospace 10"). See [funcpango
.FontDescription.from_string]
for a description of the format of the string representation.
The value of this property cannot be changed anymore after the first
call to the [methodprintCompositor
.paginate] function.
clearPrintCompositorLineNumbersFontName :: (MonadIO m, IsPrintCompositor o) => o -> m () Source #
Set the value of the “line-numbers-font-name
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#lineNumbersFontName
constructPrintCompositorLineNumbersFontName :: (IsPrintCompositor o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “line-numbers-font-name
” property. This is rarely needed directly, but it is used by new
.
getPrintCompositorLineNumbersFontName :: (MonadIO m, IsPrintCompositor o) => o -> m (Maybe Text) Source #
Get the value of the “line-numbers-font-name
” property.
When overloading is enabled, this is equivalent to
get
printCompositor #lineNumbersFontName
setPrintCompositorLineNumbersFontName :: (MonadIO m, IsPrintCompositor o) => o -> Text -> m () Source #
Set the value of the “line-numbers-font-name
” property.
When overloading is enabled, this is equivalent to
set
printCompositor [ #lineNumbersFontName:=
value ]
nPages
The number of pages in the document or <code>-1</code> if the document has not been completely paginated.
getPrintCompositorNPages :: (MonadIO m, IsPrintCompositor o) => o -> m Int32 Source #
Get the value of the “n-pages
” property.
When overloading is enabled, this is equivalent to
get
printCompositor #nPages
printFooter
Whether to print a footer in each page.
Note that by default the footer format is unspecified, and if it is unspecified the footer will not be printed, regardless of the value of this property.
The value of this property cannot be changed anymore after the first
call to the [methodprintCompositor
.paginate] function.
constructPrintCompositorPrintFooter :: (IsPrintCompositor o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “print-footer
” property. This is rarely needed directly, but it is used by new
.
getPrintCompositorPrintFooter :: (MonadIO m, IsPrintCompositor o) => o -> m Bool Source #
Get the value of the “print-footer
” property.
When overloading is enabled, this is equivalent to
get
printCompositor #printFooter
setPrintCompositorPrintFooter :: (MonadIO m, IsPrintCompositor o) => o -> Bool -> m () Source #
Set the value of the “print-footer
” property.
When overloading is enabled, this is equivalent to
set
printCompositor [ #printFooter:=
value ]
printHeader
Whether to print a header in each page.
Note that by default the header format is unspecified, and if it is unspecified the header will not be printed, regardless of the value of this property.
The value of this property cannot be changed anymore after the first
call to the [methodprintCompositor
.paginate] function.
constructPrintCompositorPrintHeader :: (IsPrintCompositor o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “print-header
” property. This is rarely needed directly, but it is used by new
.
getPrintCompositorPrintHeader :: (MonadIO m, IsPrintCompositor o) => o -> m Bool Source #
Get the value of the “print-header
” property.
When overloading is enabled, this is equivalent to
get
printCompositor #printHeader
setPrintCompositorPrintHeader :: (MonadIO m, IsPrintCompositor o) => o -> Bool -> m () Source #
Set the value of the “print-header
” property.
When overloading is enabled, this is equivalent to
set
printCompositor [ #printHeader:=
value ]
printLineNumbers
Interval of printed line numbers.
If this property is set to 0 no numbers will be printed. If greater than 0, a number will be printed every "print-line-numbers" lines (i.e. 1 will print all line numbers).
The value of this property cannot be changed anymore after the first
call to the [methodprintCompositor
.paginate] function.
constructPrintCompositorPrintLineNumbers :: (IsPrintCompositor o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “print-line-numbers
” property. This is rarely needed directly, but it is used by new
.
getPrintCompositorPrintLineNumbers :: (MonadIO m, IsPrintCompositor o) => o -> m Word32 Source #
Get the value of the “print-line-numbers
” property.
When overloading is enabled, this is equivalent to
get
printCompositor #printLineNumbers
setPrintCompositorPrintLineNumbers :: (MonadIO m, IsPrintCompositor o) => o -> Word32 -> m () Source #
Set the value of the “print-line-numbers
” property.
When overloading is enabled, this is equivalent to
set
printCompositor [ #printLineNumbers:=
value ]
tabWidth
Width of a tab character expressed in spaces.
The value of this property cannot be changed anymore after the first
call to the [methodprintCompositor
.paginate] function.
constructPrintCompositorTabWidth :: (IsPrintCompositor o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “tab-width
” property. This is rarely needed directly, but it is used by new
.
getPrintCompositorTabWidth :: (MonadIO m, IsPrintCompositor o) => o -> m Word32 Source #
Get the value of the “tab-width
” property.
When overloading is enabled, this is equivalent to
get
printCompositor #tabWidth
setPrintCompositorTabWidth :: (MonadIO m, IsPrintCompositor o) => o -> Word32 -> m () Source #
Set the value of the “tab-width
” property.
When overloading is enabled, this is equivalent to
set
printCompositor [ #tabWidth:=
value ]
wrapMode
Whether to wrap lines never, at word boundaries, or at character boundaries.
The value of this property cannot be changed anymore after the first
call to the [methodprintCompositor
.paginate] function.
constructPrintCompositorWrapMode :: (IsPrintCompositor o, MonadIO m) => WrapMode -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “wrap-mode
” property. This is rarely needed directly, but it is used by new
.
getPrintCompositorWrapMode :: (MonadIO m, IsPrintCompositor o) => o -> m WrapMode Source #
Get the value of the “wrap-mode
” property.
When overloading is enabled, this is equivalent to
get
printCompositor #wrapMode
setPrintCompositorWrapMode :: (MonadIO m, IsPrintCompositor o) => o -> WrapMode -> m () Source #
Set the value of the “wrap-mode
” property.
When overloading is enabled, this is equivalent to
set
printCompositor [ #wrapMode:=
value ]