Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
- Exported types
- Methods
- copy
- getBottomMargin
- getLeftMargin
- getOrientation
- getPageHeight
- getPageWidth
- getPaperHeight
- getPaperSize
- getPaperWidth
- getRightMargin
- getTopMargin
- loadFile
- loadKeyFile
- new
- newFromFile
- newFromGvariant
- newFromKeyFile
- setBottomMargin
- setLeftMargin
- setOrientation
- setPaperSize
- setPaperSizeAndDefaultMargins
- setRightMargin
- setTopMargin
- toFile
- toGvariant
- toKeyFile
A GtkPageSetup object stores the page size, orientation and margins.
The idea is that you can get one of these from the page setup dialog
and then pass it to the PrintOperation
when printing.
The benefit of splitting this out of the PrintSettings
is that
these affect the actual layout of the page, and thus need to be set
long before user prints.
## {print
-margins}
The margins specified in this object are the “print margins”, i.e. the
parts of the page that the printer cannot print on. These are different
from the layout margins that a word processor uses; they are typically
used to determine the minimal size for the layout
margins.
To obtain a PageSetup
use pageSetupNew
to get the defaults,
or use printRunPageSetupDialog
to show the page setup dialog
and receive the resulting page setup.
A page setup dialog
C code
static GtkPrintSettings *settings = NULL; static GtkPageSetup *page_setup = NULL; static void do_page_setup (void) { GtkPageSetup *new_page_setup; if (settings == NULL) settings = gtk_print_settings_new (); new_page_setup = gtk_print_run_page_setup_dialog (GTK_WINDOW (main_window), page_setup, settings); if (page_setup) g_object_unref (page_setup); page_setup = new_page_setup; }
Printing support was added in GTK+ 2.10.
- newtype PageSetup = PageSetup (ManagedPtr PageSetup)
- class GObject o => IsPageSetup o
- toPageSetup :: IsPageSetup o => o -> IO PageSetup
- noPageSetup :: Maybe PageSetup
- data PageSetupCopyMethodInfo
- pageSetupCopy :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> m PageSetup
- data PageSetupGetBottomMarginMethodInfo
- pageSetupGetBottomMargin :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> Unit -> m Double
- data PageSetupGetLeftMarginMethodInfo
- pageSetupGetLeftMargin :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> Unit -> m Double
- data PageSetupGetOrientationMethodInfo
- pageSetupGetOrientation :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> m PageOrientation
- data PageSetupGetPageHeightMethodInfo
- pageSetupGetPageHeight :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> Unit -> m Double
- data PageSetupGetPageWidthMethodInfo
- pageSetupGetPageWidth :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> Unit -> m Double
- data PageSetupGetPaperHeightMethodInfo
- pageSetupGetPaperHeight :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> Unit -> m Double
- data PageSetupGetPaperSizeMethodInfo
- pageSetupGetPaperSize :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> m PaperSize
- data PageSetupGetPaperWidthMethodInfo
- pageSetupGetPaperWidth :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> Unit -> m Double
- data PageSetupGetRightMarginMethodInfo
- pageSetupGetRightMargin :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> Unit -> m Double
- data PageSetupGetTopMarginMethodInfo
- pageSetupGetTopMargin :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> Unit -> m Double
- data PageSetupLoadFileMethodInfo
- pageSetupLoadFile :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> [Char] -> m ()
- data PageSetupLoadKeyFileMethodInfo
- pageSetupLoadKeyFile :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> KeyFile -> Maybe Text -> m ()
- pageSetupNew :: (HasCallStack, MonadIO m) => m PageSetup
- pageSetupNewFromFile :: (HasCallStack, MonadIO m) => [Char] -> m PageSetup
- pageSetupNewFromGvariant :: (HasCallStack, MonadIO m) => GVariant -> m PageSetup
- pageSetupNewFromKeyFile :: (HasCallStack, MonadIO m) => KeyFile -> Maybe Text -> m PageSetup
- data PageSetupSetBottomMarginMethodInfo
- pageSetupSetBottomMargin :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> Double -> Unit -> m ()
- data PageSetupSetLeftMarginMethodInfo
- pageSetupSetLeftMargin :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> Double -> Unit -> m ()
- data PageSetupSetOrientationMethodInfo
- pageSetupSetOrientation :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> PageOrientation -> m ()
- data PageSetupSetPaperSizeMethodInfo
- pageSetupSetPaperSize :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> PaperSize -> m ()
- data PageSetupSetPaperSizeAndDefaultMarginsMethodInfo
- pageSetupSetPaperSizeAndDefaultMargins :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> PaperSize -> m ()
- data PageSetupSetRightMarginMethodInfo
- pageSetupSetRightMargin :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> Double -> Unit -> m ()
- data PageSetupSetTopMarginMethodInfo
- pageSetupSetTopMargin :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> Double -> Unit -> m ()
- data PageSetupToFileMethodInfo
- pageSetupToFile :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> [Char] -> m ()
- data PageSetupToGvariantMethodInfo
- pageSetupToGvariant :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> m GVariant
- data PageSetupToKeyFileMethodInfo
- pageSetupToKeyFile :: (HasCallStack, MonadIO m, IsPageSetup a) => a -> KeyFile -> Text -> m ()
Exported types
GObject PageSetup Source # | |
IsObject PageSetup Source # | |
IsPageSetup PageSetup Source # | |
((~) * info (ResolvePageSetupMethod t PageSetup), MethodInfo * info PageSetup p) => IsLabel t (PageSetup -> p) Source # | |
((~) * info (ResolvePageSetupMethod t PageSetup), MethodInfo * info PageSetup p) => IsLabelProxy t (PageSetup -> p) Source # | |
HasAttributeList * PageSetup Source # | |
type AttributeList PageSetup Source # | |
type SignalList PageSetup Source # | |
class GObject o => IsPageSetup o Source #
toPageSetup :: IsPageSetup o => o -> IO PageSetup Source #
Methods
copy
data PageSetupCopyMethodInfo Source #
((~) * signature (m PageSetup), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupCopyMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> m PageSetup | Returns: a copy of |
Copies a PageSetup
.
Since: 2.10
getBottomMargin
data PageSetupGetBottomMarginMethodInfo Source #
((~) * signature (Unit -> m Double), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupGetBottomMarginMethodInfo a signature Source # | |
pageSetupGetBottomMargin Source #
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> Unit |
|
-> m Double | Returns: the bottom margin |
Gets the bottom margin in units of unit
.
Since: 2.10
getLeftMargin
data PageSetupGetLeftMarginMethodInfo Source #
((~) * signature (Unit -> m Double), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupGetLeftMarginMethodInfo a signature Source # | |
pageSetupGetLeftMargin Source #
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> Unit |
|
-> m Double | Returns: the left margin |
Gets the left margin in units of unit
.
Since: 2.10
getOrientation
data PageSetupGetOrientationMethodInfo Source #
((~) * signature (m PageOrientation), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupGetOrientationMethodInfo a signature Source # | |
pageSetupGetOrientation Source #
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> m PageOrientation | Returns: the page orientation |
Gets the page orientation of the PageSetup
.
Since: 2.10
getPageHeight
data PageSetupGetPageHeightMethodInfo Source #
((~) * signature (Unit -> m Double), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupGetPageHeightMethodInfo a signature Source # | |
pageSetupGetPageHeight Source #
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> Unit |
|
-> m Double | Returns: the page height. |
Returns the page height in units of unit
.
Note that this function takes orientation and
margins into consideration.
See pageSetupGetPaperHeight
.
Since: 2.10
getPageWidth
data PageSetupGetPageWidthMethodInfo Source #
((~) * signature (Unit -> m Double), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupGetPageWidthMethodInfo a signature Source # | |
pageSetupGetPageWidth Source #
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> Unit |
|
-> m Double | Returns: the page width. |
Returns the page width in units of unit
.
Note that this function takes orientation and
margins into consideration.
See pageSetupGetPaperWidth
.
Since: 2.10
getPaperHeight
data PageSetupGetPaperHeightMethodInfo Source #
((~) * signature (Unit -> m Double), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupGetPaperHeightMethodInfo a signature Source # | |
pageSetupGetPaperHeight Source #
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> Unit |
|
-> m Double | Returns: the paper height. |
Returns the paper height in units of unit
.
Note that this function takes orientation, but
not margins into consideration.
See pageSetupGetPageHeight
.
Since: 2.10
getPaperSize
data PageSetupGetPaperSizeMethodInfo Source #
((~) * signature (m PaperSize), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupGetPaperSizeMethodInfo a signature Source # | |
pageSetupGetPaperSize Source #
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> m PaperSize | Returns: the paper size |
Gets the paper size of the PageSetup
.
Since: 2.10
getPaperWidth
data PageSetupGetPaperWidthMethodInfo Source #
((~) * signature (Unit -> m Double), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupGetPaperWidthMethodInfo a signature Source # | |
pageSetupGetPaperWidth Source #
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> Unit |
|
-> m Double | Returns: the paper width. |
Returns the paper width in units of unit
.
Note that this function takes orientation, but
not margins into consideration.
See pageSetupGetPageWidth
.
Since: 2.10
getRightMargin
data PageSetupGetRightMarginMethodInfo Source #
((~) * signature (Unit -> m Double), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupGetRightMarginMethodInfo a signature Source # | |
pageSetupGetRightMargin Source #
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> Unit |
|
-> m Double | Returns: the right margin |
Gets the right margin in units of unit
.
Since: 2.10
getTopMargin
data PageSetupGetTopMarginMethodInfo Source #
((~) * signature (Unit -> m Double), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupGetTopMarginMethodInfo a signature Source # | |
pageSetupGetTopMargin Source #
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> Unit |
|
-> m Double | Returns: the top margin |
Gets the top margin in units of unit
.
Since: 2.10
loadFile
data PageSetupLoadFileMethodInfo Source #
((~) * signature ([Char] -> m ()), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupLoadFileMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> [Char] |
|
-> m () | (Can throw |
Reads the page setup from the file fileName
.
See pageSetupToFile
.
Since: 2.14
loadKeyFile
data PageSetupLoadKeyFileMethodInfo Source #
((~) * signature (KeyFile -> Maybe Text -> m ()), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupLoadKeyFileMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> KeyFile |
|
-> Maybe Text |
|
-> m () | (Can throw |
Reads the page setup from the group groupName
in the key file
keyFile
.
Since: 2.14
new
:: (HasCallStack, MonadIO m) | |
=> m PageSetup | Returns: a new |
Creates a new PageSetup
.
Since: 2.10
newFromFile
:: (HasCallStack, MonadIO m) | |
=> [Char] |
|
-> m PageSetup |
Reads the page setup from the file fileName
. Returns a
new PageSetup
object with the restored page setup,
or Nothing
if an error occurred. See pageSetupToFile
.
Since: 2.12
newFromGvariant
pageSetupNewFromGvariant Source #
:: (HasCallStack, MonadIO m) | |
=> GVariant |
|
-> m PageSetup | Returns: a new |
Desrialize a page setup from an a{sv} variant in
the format produced by pageSetupToGvariant
.
Since: 3.22
newFromKeyFile
setBottomMargin
data PageSetupSetBottomMarginMethodInfo Source #
((~) * signature (Double -> Unit -> m ()), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupSetBottomMarginMethodInfo a signature Source # | |
pageSetupSetBottomMargin Source #
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> Double |
|
-> Unit |
|
-> m () |
Sets the bottom margin of the PageSetup
.
Since: 2.10
setLeftMargin
data PageSetupSetLeftMarginMethodInfo Source #
((~) * signature (Double -> Unit -> m ()), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupSetLeftMarginMethodInfo a signature Source # | |
pageSetupSetLeftMargin Source #
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> Double |
|
-> Unit |
|
-> m () |
Sets the left margin of the PageSetup
.
Since: 2.10
setOrientation
data PageSetupSetOrientationMethodInfo Source #
((~) * signature (PageOrientation -> m ()), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupSetOrientationMethodInfo a signature Source # | |
pageSetupSetOrientation Source #
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> PageOrientation |
|
-> m () |
Sets the page orientation of the PageSetup
.
Since: 2.10
setPaperSize
data PageSetupSetPaperSizeMethodInfo Source #
((~) * signature (PaperSize -> m ()), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupSetPaperSizeMethodInfo a signature Source # | |
pageSetupSetPaperSize Source #
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> PaperSize |
|
-> m () |
Sets the paper size of the PageSetup
without
changing the margins. See
pageSetupSetPaperSizeAndDefaultMargins
.
Since: 2.10
setPaperSizeAndDefaultMargins
data PageSetupSetPaperSizeAndDefaultMarginsMethodInfo Source #
((~) * signature (PaperSize -> m ()), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupSetPaperSizeAndDefaultMarginsMethodInfo a signature Source # | |
pageSetupSetPaperSizeAndDefaultMargins Source #
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> PaperSize |
|
-> m () |
Sets the paper size of the PageSetup
and modifies
the margins according to the new paper size.
Since: 2.10
setRightMargin
data PageSetupSetRightMarginMethodInfo Source #
((~) * signature (Double -> Unit -> m ()), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupSetRightMarginMethodInfo a signature Source # | |
pageSetupSetRightMargin Source #
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> Double |
|
-> Unit |
|
-> m () |
Sets the right margin of the PageSetup
.
Since: 2.10
setTopMargin
data PageSetupSetTopMarginMethodInfo Source #
((~) * signature (Double -> Unit -> m ()), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupSetTopMarginMethodInfo a signature Source # | |
pageSetupSetTopMargin Source #
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> Double |
|
-> Unit |
|
-> m () |
Sets the top margin of the PageSetup
.
Since: 2.10
toFile
data PageSetupToFileMethodInfo Source #
((~) * signature ([Char] -> m ()), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupToFileMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> [Char] |
|
-> m () | (Can throw |
This function saves the information from setup
to fileName
.
Since: 2.12
toGvariant
data PageSetupToGvariantMethodInfo Source #
((~) * signature (m GVariant), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupToGvariantMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> m GVariant | Returns: a new, floating, |
Serialize page setup to an a{sv} variant.
Since: 3.22
toKeyFile
data PageSetupToKeyFileMethodInfo Source #
((~) * signature (KeyFile -> Text -> m ()), MonadIO m, IsPageSetup a) => MethodInfo * PageSetupToKeyFileMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPageSetup a) | |
=> a |
|
-> KeyFile |
|
-> Text |
|
-> m () |
This function adds the page setup from setup
to keyFile
.
Since: 2.12