    {-# LINE 2 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}
    -- -*-haskell-*-
    -- GIMP Toolkit (GTK) Widget PaperSize
    --
    -- Author : Andy Stewart
    --
    -- Created: 28 Mar 2010
    --
    -- Copyright (C) 2010 Andy Stewart
    --
    -- This library is free software; you can redistribute it and/or
    -- modify it under the terms of the GNU Lesser General Public
    -- License as published by the Free Software Foundation; either
    -- version 2.1 of the License, or (at your option) any later version.
    --
    -- This library is distributed in the hope that it will be useful,
    -- but WITHOUT ANY WARRANTY; without even the implied warranty of
    -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -- Lesser General Public License for more details.
    --
    -- |
    -- Maintainer : gtk2hs-users@lists.sourceforge.net
    -- Stability : provisional
    -- Portability : portable (depends on GHC)
    --
    -- Support for named paper sizes
    --
    module Graphics.UI.Gtk.Printing.PaperSize (

    -- * Detail
    --
    -- | 'PaperSize' handles paper sizes. It uses the
    -- standard called \"PWG 5101.1-2002 PWG: Standard for Media Standardized
    -- Names\" to name the paper sizes (and to get the data for the page sizes). In
    -- addition to standard paper sizes, 'PaperSize' allows
    -- to construct custom paper sizes with arbitrary dimensions.
    --
    -- The 'PaperSize' object stores not only the
    -- dimensions (width and height) of a paper size and its name, it also provides
    -- default print margins.
    --
    -- Printing support has been added in Gtk+ 2.10.

    -- * Types
      PaperSize(..),
      mkPaperSize,

    -- * Enums
      Unit(..),

    -- * Constructors
      paperSizeNew,
      paperSizeNewFromPpd,
      paperSizeNewCustom,

    -- * Methods
      paperSizeCopy,
      paperSizeIsEqual,
      paperSizeGetName,
      paperSizeGetDisplayName,
      paperSizeGetPpdName,
      paperSizeGetWidth,
      paperSizeGetHeight,
      paperSizeIsCustom,
      paperSizeSetSize,
      paperSizeGetDefaultTopMargin,
      paperSizeGetDefaultBottomMargin,
      paperSizeGetDefaultLeftMargin,
      paperSizeGetDefaultRightMargin,
      paperSizeGetDefault,

      paperSizeGetPaperSizes,

      ) where

    import Control.Monad (liftM)

    import System.Glib.FFI
    import System.Glib.UTFString
    import System.Glib.GList

    {-# LINE 85 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}

    --------------------
    -- Types
    newtype PaperSize = PaperSize (ForeignPtr (PaperSize))
    {-# LINE 89 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}

    --------------------
    -- Enums
    data Unit = UnitNone
              | UnitPoints
              | UnitInch
              | UnitMm
              deriving (Int -> Unit
    Unit -> Int
    Unit -> [Unit]
    Unit -> Unit
    Unit -> Unit -> [Unit]
    Unit -> Unit -> Unit -> [Unit]
    (Unit -> Unit)
    -> (Unit -> Unit)
    -> (Int -> Unit)
    -> (Unit -> Int)
    -> (Unit -> [Unit])
    -> (Unit -> Unit -> [Unit])
    -> (Unit -> Unit -> [Unit])
    -> (Unit -> Unit -> Unit -> [Unit])
    -> Enum Unit
    forall a.
    (a -> a)
    -> (a -> a)
    -> (Int -> a)
    -> (a -> Int)
    -> (a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> a -> [a])
    -> Enum a
    $csucc :: Unit -> Unit
    succ :: Unit -> Unit
    $cpred :: Unit -> Unit
    pred :: Unit -> Unit
    $ctoEnum :: Int -> Unit
    toEnum :: Int -> Unit
    $cfromEnum :: Unit -> Int
    fromEnum :: Unit -> Int
    $cenumFrom :: Unit -> [Unit]
    enumFrom :: Unit -> [Unit]
    $cenumFromThen :: Unit -> Unit -> [Unit]
    enumFromThen :: Unit -> Unit -> [Unit]
    $cenumFromTo :: Unit -> Unit -> [Unit]
    enumFromTo :: Unit -> Unit -> [Unit]
    $cenumFromThenTo :: Unit -> Unit -> Unit -> [Unit]
    enumFromThenTo :: Unit -> Unit -> Unit -> [Unit]
    Enum,Unit
    Unit -> Unit -> Bounded Unit
    forall a. a -> a -> Bounded a
    $cminBound :: Unit
    minBound :: Unit
    $cmaxBound :: Unit
    maxBound :: Unit
    Bounded,Unit -> Unit -> Bool
    (Unit -> Unit -> Bool) -> (Unit -> Unit -> Bool) -> Eq Unit
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Unit -> Unit -> Bool
    == :: Unit -> Unit -> Bool
    $c/= :: Unit -> Unit -> Bool
    /= :: Unit -> Unit -> Bool
    Eq,Int -> Unit -> ShowS
    [Unit] -> ShowS
    Unit -> String
    (Int -> Unit -> ShowS)
    -> (Unit -> String) -> ([Unit] -> ShowS) -> Show Unit
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Unit -> ShowS
    showsPrec :: Int -> Unit -> ShowS
    $cshow :: Unit -> String
    show :: Unit -> String
    $cshowList :: [Unit] -> ShowS
    showList :: [Unit] -> ShowS
    Show)

    {-# LINE 93 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}

    --------------------
    -- Constructors

    mkPaperSize :: Ptr PaperSize -> IO PaperSize
    mkPaperSize pPtr = do
      size <- newForeignPtr pPtr paper_size_free
      return (PaperSize size)

    foreign import ccall unsafe "&gtk_paper_size_free"
      paper_size_free :: FinalizerPtr PaperSize

    -- | Creates a new 'PaperSize' object by parsing a PWG
    -- 5101.1-2002 paper name.
    --
    -- If @name@ is Nothing, the default paper size is returned, see 'paperSizeGetDefault'.
    --
    -- * Available since Gtk+ version 2.10
    --
    paperSizeNew :: GlibString string
     => Maybe string -- ^ @name@ - a paper size name, or 'Nothing'
     -> IO PaperSize
    paperSizeNew :: forall string. GlibString string => Maybe string -> IO PaperSize
    paperSizeNew Maybe string
    name =
      (string -> (Ptr CChar -> IO PaperSize) -> IO PaperSize)
    -> Maybe string -> (Ptr CChar -> IO PaperSize) -> IO PaperSize
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith string -> (Ptr CChar -> IO PaperSize) -> IO PaperSize
    forall a. string -> (Ptr CChar -> IO a) -> IO a
    forall s a. GlibString s => s -> (Ptr CChar -> IO a) -> IO a
    withUTFString Maybe string
    name ((Ptr CChar -> IO PaperSize) -> IO PaperSize)
    -> (Ptr CChar -> IO PaperSize) -> IO PaperSize
    forall a b. (a -> b) -> a -> b
    $ \Ptr CChar
    namePtr ->
      Ptr CChar -> IO (Ptr PaperSize)
    gtk_paper_size_new
    {-# LINE 119 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}
        namePtr
      IO (Ptr PaperSize)
    -> (Ptr PaperSize -> IO PaperSize) -> IO PaperSize
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= Ptr PaperSize -> IO PaperSize
    mkPaperSize

    -- | Creates a new 'PaperSize' object by using PPD
    -- information.
    --
    -- If @ppdName@ is not a recognized PPD paper name, @ppdDisplayName@,
    -- @width@ and @height@ are used to construct a custom 'PaperSize' object.
    --
    -- * Available since Gtk+ version 2.10
    --
    paperSizeNewFromPpd :: GlibString string
     => string -- ^ @ppdName@ - a PPD paper name
     -> string -- ^ @ppdDisplayName@ - the corresponding human-readable name
     -> Double -- ^ @width@ - the paper width, in points
     -> Double -- ^ @height@ - the paper height in points
     -> IO PaperSize
    paperSizeNewFromPpd :: forall string.
    GlibString string =>
    string -> string -> Double -> Double -> IO PaperSize
    paperSizeNewFromPpd string
    ppdName string
    ppdDisplayName Double
    width Double
    height =
      string -> (Ptr CChar -> IO PaperSize) -> IO PaperSize
    forall a. string -> (Ptr CChar -> IO a) -> IO a
    forall s a. GlibString s => s -> (Ptr CChar -> IO a) -> IO a
    withUTFString string
    ppdDisplayName ((Ptr CChar -> IO PaperSize) -> IO PaperSize)
    -> (Ptr CChar -> IO PaperSize) -> IO PaperSize
    forall a b. (a -> b) -> a -> b
    $ \Ptr CChar
    ppdDisplayNamePtr ->
      string -> (Ptr CChar -> IO PaperSize) -> IO PaperSize
    forall a. string -> (Ptr CChar -> IO a) -> IO a
    forall s a. GlibString s => s -> (Ptr CChar -> IO a) -> IO a
    withUTFString string
    ppdName ((Ptr CChar -> IO PaperSize) -> IO PaperSize)
    -> (Ptr CChar -> IO PaperSize) -> IO PaperSize
    forall a b. (a -> b) -> a -> b
    $ \Ptr CChar
    ppdNamePtr ->
      Ptr CChar -> Ptr CChar -> CDouble -> CDouble -> IO (Ptr PaperSize)
    gtk_paper_size_new_from_ppd
    {-# LINE 140 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}
        ppdNamePtr
        Ptr CChar
    ppdDisplayNamePtr
        (Double -> CDouble
    forall a b. (Real a, Fractional b) => a -> b
    realToFrac Double
    width)
        (Double -> CDouble
    forall a b. (Real a, Fractional b) => a -> b
    realToFrac Double
    height)
      IO (Ptr PaperSize)
    -> (Ptr PaperSize -> IO PaperSize) -> IO PaperSize
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= Ptr PaperSize -> IO PaperSize
    mkPaperSize

    -- | Creates a new 'PaperSize' object with the given
    -- parameters.
    --
    -- * Available since Gtk+ version 2.10
    --
    paperSizeNewCustom :: GlibString string
     => string -- ^ @name@ - the paper name
     -> string -- ^ @displayName@ - the human-readable name
     -> Double -- ^ @width@ - the paper width, in units of @unit@
     -> Double -- ^ @height@ - the paper height, in units of @unit@
     -> Unit -- ^ @unit@ - the unit for @width@ and @height@
     -> IO PaperSize
    paperSizeNewCustom :: forall string.
    GlibString string =>
    string -> string -> Double -> Double -> Unit -> IO PaperSize
    paperSizeNewCustom string
    name string
    displayName Double
    width Double
    height Unit
    unit =
      string -> (Ptr CChar -> IO PaperSize) -> IO PaperSize
    forall a. string -> (Ptr CChar -> IO a) -> IO a
    forall s a. GlibString s => s -> (Ptr CChar -> IO a) -> IO a
    withUTFString string
    displayName ((Ptr CChar -> IO PaperSize) -> IO PaperSize)
    -> (Ptr CChar -> IO PaperSize) -> IO PaperSize
    forall a b. (a -> b) -> a -> b
    $ \Ptr CChar
    displayNamePtr ->
      string -> (Ptr CChar -> IO PaperSize) -> IO PaperSize
    forall a. string -> (Ptr CChar -> IO a) -> IO a
    forall s a. GlibString s => s -> (Ptr CChar -> IO a) -> IO a
    withUTFString string
    name ((Ptr CChar -> IO PaperSize) -> IO PaperSize)
    -> (Ptr CChar -> IO PaperSize) -> IO PaperSize
    forall a b. (a -> b) -> a -> b
    $ \Ptr CChar
    namePtr ->
      Ptr CChar
    -> Ptr CChar -> CDouble -> CDouble -> CInt -> IO (Ptr PaperSize)
    gtk_paper_size_new_custom
    {-# LINE 162 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}
        namePtr
        Ptr CChar
    displayNamePtr
        (Double -> CDouble
    forall a b. (Real a, Fractional b) => a -> b
    realToFrac Double
    width)
        (Double -> CDouble
    forall a b. (Real a, Fractional b) => a -> b
    realToFrac Double
    height)
        ((Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Int -> CInt) -> (Unit -> Int) -> Unit -> CInt
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Unit -> Int
    forall a. Enum a => a -> Int
    fromEnum) Unit
    unit)
      IO (Ptr PaperSize)
    -> (Ptr PaperSize -> IO PaperSize) -> IO PaperSize
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= Ptr PaperSize -> IO PaperSize
    mkPaperSize

    --------------------
    -- Methods

    -- | Copies an existing 'PaperSize'.
    --
    -- * Available since Gtk+ version 2.10
    --
    paperSizeCopy :: PaperSize
     -> IO PaperSize -- ^ returns a copy of @other@
    paperSizeCopy :: PaperSize -> IO PaperSize
    paperSizeCopy PaperSize
    self =
      (\(PaperSize ForeignPtr PaperSize
    arg1) -> ForeignPtr PaperSize
    -> (Ptr PaperSize -> IO (Ptr PaperSize)) -> IO (Ptr PaperSize)
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr PaperSize
    arg1 ((Ptr PaperSize -> IO (Ptr PaperSize)) -> IO (Ptr PaperSize))
    -> (Ptr PaperSize -> IO (Ptr PaperSize)) -> IO (Ptr PaperSize)
    forall a b. (a -> b) -> a -> b
    $ \Ptr PaperSize
    argPtr1 ->Ptr PaperSize -> IO (Ptr PaperSize)
    gtk_paper_size_copy Ptr PaperSize
    argPtr1) PaperSize
    self IO (Ptr PaperSize)
    -> (Ptr PaperSize -> IO PaperSize) -> IO PaperSize
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= Ptr PaperSize -> IO PaperSize
    mkPaperSize

    -- | Compares two 'PaperSize' objects.
    --
    -- * Available since Gtk+ version 2.10
    --
    paperSizeIsEqual :: PaperSize
     -> PaperSize -- ^ @size2@ - another 'PaperSize' object
     -> IO Bool -- ^ returns @True@, if @size1@ and @size2@ represent
                 -- the same paper size
    paperSizeIsEqual :: PaperSize -> PaperSize -> IO Bool
    paperSizeIsEqual PaperSize
    self PaperSize
    size2 =
      (CInt -> Bool) -> IO CInt -> IO Bool
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CInt -> Bool
    forall a. (Eq a, Num a) => a -> Bool
    toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
    forall a b. (a -> b) -> a -> b
    $
      (\(PaperSize ForeignPtr PaperSize
    arg1) (PaperSize ForeignPtr PaperSize
    arg2) -> ForeignPtr PaperSize -> (Ptr PaperSize -> IO CInt) -> IO CInt
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr PaperSize
    arg1 ((Ptr PaperSize -> IO CInt) -> IO CInt)
    -> (Ptr PaperSize -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr PaperSize
    argPtr1 ->ForeignPtr PaperSize -> (Ptr PaperSize -> IO CInt) -> IO CInt
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr PaperSize
    arg2 ((Ptr PaperSize -> IO CInt) -> IO CInt)
    -> (Ptr PaperSize -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr PaperSize
    argPtr2 ->Ptr PaperSize -> Ptr PaperSize -> IO CInt
    gtk_paper_size_is_equal Ptr PaperSize
    argPtr1 Ptr PaperSize
    argPtr2)
    {-# LINE 193 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}
        self
        PaperSize
    size2

    -- | Gets the name of the 'PaperSize'.
    --
    -- * Available since Gtk+ version 2.10
    --
    paperSizeGetName :: GlibString string => PaperSize
     -> IO string -- ^ returns the name of @size@
    paperSizeGetName :: forall string. GlibString string => PaperSize -> IO string
    paperSizeGetName PaperSize
    self =
      (\(PaperSize ForeignPtr PaperSize
    arg1) -> ForeignPtr PaperSize
    -> (Ptr PaperSize -> IO (Ptr CChar)) -> IO (Ptr CChar)
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr PaperSize
    arg1 ((Ptr PaperSize -> IO (Ptr CChar)) -> IO (Ptr CChar))
    -> (Ptr PaperSize -> IO (Ptr CChar)) -> IO (Ptr CChar)
    forall a b. (a -> b) -> a -> b
    $ \Ptr PaperSize
    argPtr1 ->Ptr PaperSize -> IO (Ptr CChar)
    gtk_paper_size_get_name Ptr PaperSize
    argPtr1)
    {-# LINE 204 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}
        self
      IO (Ptr CChar) -> (Ptr CChar -> IO string) -> IO string
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= Ptr CChar -> IO string
    forall s. GlibString s => Ptr CChar -> IO s
    peekUTFString

    -- | Gets the human-readable name of the 'PaperSize'.
    --
    -- * Available since Gtk+ version 2.10
    --
    paperSizeGetDisplayName :: GlibString string => PaperSize
     -> IO string -- ^ returns the human-readable name of @size@
    paperSizeGetDisplayName :: forall string. GlibString string => PaperSize -> IO string
    paperSizeGetDisplayName PaperSize
    self =
      (\(PaperSize ForeignPtr PaperSize
    arg1) -> ForeignPtr PaperSize
    -> (Ptr PaperSize -> IO (Ptr CChar)) -> IO (Ptr CChar)
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr PaperSize
    arg1 ((Ptr PaperSize -> IO (Ptr CChar)) -> IO (Ptr CChar))
    -> (Ptr PaperSize -> IO (Ptr CChar)) -> IO (Ptr CChar)
    forall a b. (a -> b) -> a -> b
    $ \Ptr PaperSize
    argPtr1 ->Ptr PaperSize -> IO (Ptr CChar)
    gtk_paper_size_get_display_name Ptr PaperSize
    argPtr1)
    {-# LINE 215 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}
        self
      IO (Ptr CChar) -> (Ptr CChar -> IO string) -> IO string
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= Ptr CChar -> IO string
    forall s. GlibString s => Ptr CChar -> IO s
    peekUTFString

    -- | Gets the PPD name of the 'PaperSize', which may be
    --
    -- * Available since Gtk+ version 2.10
    --
    paperSizeGetPpdName :: GlibString string => PaperSize
     -> IO (Maybe string) -- ^ returns the PPD name of @size@, or 'Nothing'
    paperSizeGetPpdName :: forall string. GlibString string => PaperSize -> IO (Maybe string)
    paperSizeGetPpdName PaperSize
    self =
      (\(PaperSize ForeignPtr PaperSize
    arg1) -> ForeignPtr PaperSize
    -> (Ptr PaperSize -> IO (Ptr CChar)) -> IO (Ptr CChar)
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr PaperSize
    arg1 ((Ptr PaperSize -> IO (Ptr CChar)) -> IO (Ptr CChar))
    -> (Ptr PaperSize -> IO (Ptr CChar)) -> IO (Ptr CChar)
    forall a b. (a -> b) -> a -> b
    $ \Ptr PaperSize
    argPtr1 ->Ptr PaperSize -> IO (Ptr CChar)
    gtk_paper_size_get_ppd_name Ptr PaperSize
    argPtr1)
    {-# LINE 226 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}
        self
      IO (Ptr CChar)
    -> (Ptr CChar -> IO (Maybe string)) -> IO (Maybe string)
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= Ptr CChar -> IO (Maybe string)
    forall s. GlibString s => Ptr CChar -> IO (Maybe s)
    maybePeekUTFString

    -- | Gets the paper width of the 'PaperSize', in units
    -- of @unit@.
    --
    -- * Available since Gtk+ version 2.10
    --
    paperSizeGetWidth :: PaperSize
     -> Unit -- ^ @unit@ - the unit for the return value
     -> IO Double -- ^ returns the paper width
    paperSizeGetWidth :: PaperSize -> Unit -> IO Double
    paperSizeGetWidth PaperSize
    self Unit
    unit =
      (CDouble -> Double) -> IO CDouble -> IO Double
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CDouble -> Double
    forall a b. (Real a, Fractional b) => a -> b
    realToFrac (IO CDouble -> IO Double) -> IO CDouble -> IO Double
    forall a b. (a -> b) -> a -> b
    $
      (\(PaperSize ForeignPtr PaperSize
    arg1) CInt
    arg2 -> ForeignPtr PaperSize -> (Ptr PaperSize -> IO CDouble) -> IO CDouble
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr PaperSize
    arg1 ((Ptr PaperSize -> IO CDouble) -> IO CDouble)
    -> (Ptr PaperSize -> IO CDouble) -> IO CDouble
    forall a b. (a -> b) -> a -> b
    $ \Ptr PaperSize
    argPtr1 ->Ptr PaperSize -> CInt -> IO CDouble
    gtk_paper_size_get_width Ptr PaperSize
    argPtr1 CInt
    arg2)
    {-# LINE 240 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}
        self
        ((Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Int -> CInt) -> (Unit -> Int) -> Unit -> CInt
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Unit -> Int
    forall a. Enum a => a -> Int
    fromEnum) Unit
    unit)

    -- | Gets the paper height of the 'PaperSize', in units
    -- of @unit@.
    --
    -- * Available since Gtk+ version 2.10
    --
    paperSizeGetHeight :: PaperSize
     -> Unit -- ^ @unit@ - the unit for the return value
     -> IO Double -- ^ returns the paper height
    paperSizeGetHeight :: PaperSize -> Unit -> IO Double
    paperSizeGetHeight PaperSize
    self Unit
    unit =
      (CDouble -> Double) -> IO CDouble -> IO Double
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CDouble -> Double
    forall a b. (Real a, Fractional b) => a -> b
    realToFrac (IO CDouble -> IO Double) -> IO CDouble -> IO Double
    forall a b. (a -> b) -> a -> b
    $
      (\(PaperSize ForeignPtr PaperSize
    arg1) CInt
    arg2 -> ForeignPtr PaperSize -> (Ptr PaperSize -> IO CDouble) -> IO CDouble
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr PaperSize
    arg1 ((Ptr PaperSize -> IO CDouble) -> IO CDouble)
    -> (Ptr PaperSize -> IO CDouble) -> IO CDouble
    forall a b. (a -> b) -> a -> b
    $ \Ptr PaperSize
    argPtr1 ->Ptr PaperSize -> CInt -> IO CDouble
    gtk_paper_size_get_height Ptr PaperSize
    argPtr1 CInt
    arg2)
    {-# LINE 254 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}
        self
        ((Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Int -> CInt) -> (Unit -> Int) -> Unit -> CInt
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Unit -> Int
    forall a. Enum a => a -> Int
    fromEnum) Unit
    unit)

    -- | Returns @True@ if @size@ is not a standard paper size.
    --
    paperSizeIsCustom :: PaperSize
     -> IO Bool -- ^ returns whether @size@ is a custom paper size.
    paperSizeIsCustom :: PaperSize -> IO Bool
    paperSizeIsCustom PaperSize
    self =
      (CInt -> Bool) -> IO CInt -> IO Bool
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CInt -> Bool
    forall a. (Eq a, Num a) => a -> Bool
    toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
    forall a b. (a -> b) -> a -> b
    $
      (\(PaperSize ForeignPtr PaperSize
    arg1) -> ForeignPtr PaperSize -> (Ptr PaperSize -> IO CInt) -> IO CInt
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr PaperSize
    arg1 ((Ptr PaperSize -> IO CInt) -> IO CInt)
    -> (Ptr PaperSize -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr PaperSize
    argPtr1 ->Ptr PaperSize -> IO CInt
    gtk_paper_size_is_custom Ptr PaperSize
    argPtr1)
    {-# LINE 264 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}
        self

    -- | Changes the dimensions of a @size@ to @width@ x @height@.
    --
    -- * Available since Gtk+ version 2.10
    --
    paperSizeSetSize :: PaperSize
     -> Double -- ^ @width@ - the new width in units of @unit@
     -> Double -- ^ @height@ - the new height in units of @unit@
     -> Unit -- ^ @unit@ - the unit for @width@ and @height@
     -> IO ()
    paperSizeSetSize :: PaperSize -> Double -> Double -> Unit -> IO ()
    paperSizeSetSize PaperSize
    self Double
    width Double
    height Unit
    unit =
      (\(PaperSize ForeignPtr PaperSize
    arg1) CDouble
    arg2 CDouble
    arg3 CInt
    arg4 -> ForeignPtr PaperSize -> (Ptr PaperSize -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr PaperSize
    arg1 ((Ptr PaperSize -> IO ()) -> IO ())
    -> (Ptr PaperSize -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr PaperSize
    argPtr1 ->Ptr PaperSize -> CDouble -> CDouble -> CInt -> IO ()
    gtk_paper_size_set_size Ptr PaperSize
    argPtr1 CDouble
    arg2 CDouble
    arg3 CInt
    arg4)
    {-# LINE 277 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}
        self
        (Double -> CDouble
    forall a b. (Real a, Fractional b) => a -> b
    realToFrac Double
    width)
        (Double -> CDouble
    forall a b. (Real a, Fractional b) => a -> b
    realToFrac Double
    height)
        ((Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Int -> CInt) -> (Unit -> Int) -> Unit -> CInt
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Unit -> Int
    forall a. Enum a => a -> Int
    fromEnum) Unit
    unit)

    -- | Gets the default top margin for the 'PaperSize'.
    --
    -- * Available since Gtk+ version 2.10
    --
    paperSizeGetDefaultTopMargin :: PaperSize
     -> Unit -- ^ @unit@ - the unit for the return value
     -> IO Double -- ^ returns the default top margin
    paperSizeGetDefaultTopMargin :: PaperSize -> Unit -> IO Double
    paperSizeGetDefaultTopMargin PaperSize
    self Unit
    unit =
      (CDouble -> Double) -> IO CDouble -> IO Double
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CDouble -> Double
    forall a b. (Real a, Fractional b) => a -> b
    realToFrac (IO CDouble -> IO Double) -> IO CDouble -> IO Double
    forall a b. (a -> b) -> a -> b
    $
      (\(PaperSize ForeignPtr PaperSize
    arg1) CInt
    arg2 -> ForeignPtr PaperSize -> (Ptr PaperSize -> IO CDouble) -> IO CDouble
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr PaperSize
    arg1 ((Ptr PaperSize -> IO CDouble) -> IO CDouble)
    -> (Ptr PaperSize -> IO CDouble) -> IO CDouble
    forall a b. (a -> b) -> a -> b
    $ \Ptr PaperSize
    argPtr1 ->Ptr PaperSize -> CInt -> IO CDouble
    gtk_paper_size_get_default_top_margin Ptr PaperSize
    argPtr1 CInt
    arg2)
    {-# LINE 292 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}
        self
        ((Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Int -> CInt) -> (Unit -> Int) -> Unit -> CInt
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Unit -> Int
    forall a. Enum a => a -> Int
    fromEnum) Unit
    unit)

    -- | Gets the default bottom margin for the 'PaperSize'.
    --
    -- * Available since Gtk+ version 2.10
    --
    paperSizeGetDefaultBottomMargin :: PaperSize
     -> Unit -- ^ @unit@ - the unit for the return value
     -> IO Double -- ^ returns the default bottom margin
    paperSizeGetDefaultBottomMargin :: PaperSize -> Unit -> IO Double
    paperSizeGetDefaultBottomMargin PaperSize
    self Unit
    unit =
      (CDouble -> Double) -> IO CDouble -> IO Double
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CDouble -> Double
    forall a b. (Real a, Fractional b) => a -> b
    realToFrac (IO CDouble -> IO Double) -> IO CDouble -> IO Double
    forall a b. (a -> b) -> a -> b
    $
      (\(PaperSize ForeignPtr PaperSize
    arg1) CInt
    arg2 -> ForeignPtr PaperSize -> (Ptr PaperSize -> IO CDouble) -> IO CDouble
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr PaperSize
    arg1 ((Ptr PaperSize -> IO CDouble) -> IO CDouble)
    -> (Ptr PaperSize -> IO CDouble) -> IO CDouble
    forall a b. (a -> b) -> a -> b
    $ \Ptr PaperSize
    argPtr1 ->Ptr PaperSize -> CInt -> IO CDouble
    gtk_paper_size_get_default_bottom_margin Ptr PaperSize
    argPtr1 CInt
    arg2)
    {-# LINE 305 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}
        self
        ((Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Int -> CInt) -> (Unit -> Int) -> Unit -> CInt
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Unit -> Int
    forall a. Enum a => a -> Int
    fromEnum) Unit
    unit)

    -- | Gets the default left margin for the 'PaperSize'.
    --
    -- * Available since Gtk+ version 2.10
    --
    paperSizeGetDefaultLeftMargin :: PaperSize
     -> Unit -- ^ @unit@ - the unit for the return value
     -> IO Double -- ^ returns the default left margin
    paperSizeGetDefaultLeftMargin :: PaperSize -> Unit -> IO Double
    paperSizeGetDefaultLeftMargin PaperSize
    self Unit
    unit =
      (CDouble -> Double) -> IO CDouble -> IO Double
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CDouble -> Double
    forall a b. (Real a, Fractional b) => a -> b
    realToFrac (IO CDouble -> IO Double) -> IO CDouble -> IO Double
    forall a b. (a -> b) -> a -> b
    $
      (\(PaperSize ForeignPtr PaperSize
    arg1) CInt
    arg2 -> ForeignPtr PaperSize -> (Ptr PaperSize -> IO CDouble) -> IO CDouble
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr PaperSize
    arg1 ((Ptr PaperSize -> IO CDouble) -> IO CDouble)
    -> (Ptr PaperSize -> IO CDouble) -> IO CDouble
    forall a b. (a -> b) -> a -> b
    $ \Ptr PaperSize
    argPtr1 ->Ptr PaperSize -> CInt -> IO CDouble
    gtk_paper_size_get_default_left_margin Ptr PaperSize
    argPtr1 CInt
    arg2)
    {-# LINE 318 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}
        self
        ((Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Int -> CInt) -> (Unit -> Int) -> Unit -> CInt
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Unit -> Int
    forall a. Enum a => a -> Int
    fromEnum) Unit
    unit)

    -- | Gets the default right margin for the 'PaperSize'.
    --
    -- * Available since Gtk+ version 2.10
    --
    paperSizeGetDefaultRightMargin :: PaperSize
     -> Unit -- ^ @unit@ - the unit for the return value
     -> IO Double -- ^ returns the default right margin
    paperSizeGetDefaultRightMargin :: PaperSize -> Unit -> IO Double
    paperSizeGetDefaultRightMargin PaperSize
    self Unit
    unit =
      (CDouble -> Double) -> IO CDouble -> IO Double
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CDouble -> Double
    forall a b. (Real a, Fractional b) => a -> b
    realToFrac (IO CDouble -> IO Double) -> IO CDouble -> IO Double
    forall a b. (a -> b) -> a -> b
    $
      (\(PaperSize ForeignPtr PaperSize
    arg1) CInt
    arg2 -> ForeignPtr PaperSize -> (Ptr PaperSize -> IO CDouble) -> IO CDouble
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr PaperSize
    arg1 ((Ptr PaperSize -> IO CDouble) -> IO CDouble)
    -> (Ptr PaperSize -> IO CDouble) -> IO CDouble
    forall a b. (a -> b) -> a -> b
    $ \Ptr PaperSize
    argPtr1 ->Ptr PaperSize -> CInt -> IO CDouble
    gtk_paper_size_get_default_right_margin Ptr PaperSize
    argPtr1 CInt
    arg2)
    {-# LINE 331 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}
        self
        ((Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Int -> CInt) -> (Unit -> Int) -> Unit -> CInt
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Unit -> Int
    forall a. Enum a => a -> Int
    fromEnum) Unit
    unit)

    -- | Returns the name of the default paper size, which depends on the current
    -- locale.
    --
    -- * Available since Gtk+ version 2.10
    --
    paperSizeGetDefault :: GlibString string
     => IO string -- ^ returns the name of the default paper size.
    paperSizeGetDefault :: forall string. GlibString string => IO string
    paperSizeGetDefault =
      IO (Ptr CChar)
    gtk_paper_size_get_default
    {-# LINE 343 "./Graphics/UI/Gtk/Printing/PaperSize.chs" #-}
      >>= peekUTFString

    -- | Creates a list of known paper sizes.
    --
    -- * Available since Gtk+ version 2.12
    --
    paperSizeGetPaperSizes ::
        Bool -- ^ @includeCustom@ - whether to include custom
                                -- paper sizes as defined in the page setup dialog
     -> IO [PaperSize]
    paperSizeGetPaperSizes :: Bool -> IO [PaperSize]
    paperSizeGetPaperSizes Bool
    includeCustom = do
      glist <- CInt -> IO (Ptr ())
    gtk_paper_size_get_paper_sizes (Bool -> CInt
    forall a. Num a => Bool -> a
    fromBool Bool
    includeCustom)
      list <- fromGList glist
      mapM mkPaperSize list

    foreign import ccall safe "gtk_paper_size_new"
      gtk_paper_size_new :: ((Ptr CChar) -> (IO (Ptr PaperSize)))

    foreign import ccall safe "gtk_paper_size_new_from_ppd"
      gtk_paper_size_new_from_ppd :: ((Ptr CChar) -> ((Ptr CChar) -> (CDouble -> (CDouble -> (IO (Ptr PaperSize))))))

    foreign import ccall safe "gtk_paper_size_new_custom"
      gtk_paper_size_new_custom :: ((Ptr CChar) -> ((Ptr CChar) -> (CDouble -> (CDouble -> (CInt -> (IO (Ptr PaperSize)))))))

    foreign import ccall safe "gtk_paper_size_copy"
      gtk_paper_size_copy :: ((Ptr PaperSize) -> (IO (Ptr PaperSize)))

    foreign import ccall safe "gtk_paper_size_is_equal"
      gtk_paper_size_is_equal :: ((Ptr PaperSize) -> ((Ptr PaperSize) -> (IO CInt)))

    foreign import ccall safe "gtk_paper_size_get_name"
      gtk_paper_size_get_name :: ((Ptr PaperSize) -> (IO (Ptr CChar)))

    foreign import ccall safe "gtk_paper_size_get_display_name"
      gtk_paper_size_get_display_name :: ((Ptr PaperSize) -> (IO (Ptr CChar)))

    foreign import ccall safe "gtk_paper_size_get_ppd_name"
      gtk_paper_size_get_ppd_name :: ((Ptr PaperSize) -> (IO (Ptr CChar)))

    foreign import ccall safe "gtk_paper_size_get_width"
      gtk_paper_size_get_width :: ((Ptr PaperSize) -> (CInt -> (IO CDouble)))

    foreign import ccall safe "gtk_paper_size_get_height"
      gtk_paper_size_get_height :: ((Ptr PaperSize) -> (CInt -> (IO CDouble)))

    foreign import ccall safe "gtk_paper_size_is_custom"
      gtk_paper_size_is_custom :: ((Ptr PaperSize) -> (IO CInt))

    foreign import ccall safe "gtk_paper_size_set_size"
      gtk_paper_size_set_size :: ((Ptr PaperSize) -> (CDouble -> (CDouble -> (CInt -> (IO ())))))

    foreign import ccall safe "gtk_paper_size_get_default_top_margin"
      gtk_paper_size_get_default_top_margin :: ((Ptr PaperSize) -> (CInt -> (IO CDouble)))

    foreign import ccall safe "gtk_paper_size_get_default_bottom_margin"
      gtk_paper_size_get_default_bottom_margin :: ((Ptr PaperSize) -> (CInt -> (IO CDouble)))

    foreign import ccall safe "gtk_paper_size_get_default_left_margin"
      gtk_paper_size_get_default_left_margin :: ((Ptr PaperSize) -> (CInt -> (IO CDouble)))

    foreign import ccall safe "gtk_paper_size_get_default_right_margin"
      gtk_paper_size_get_default_right_margin :: ((Ptr PaperSize) -> (CInt -> (IO CDouble)))

    foreign import ccall safe "gtk_paper_size_get_default"
      gtk_paper_size_get_default :: (IO (Ptr CChar))

    foreign import ccall safe "gtk_paper_size_get_paper_sizes"
      gtk_paper_size_get_paper_sizes :: (CInt -> (IO (Ptr ())))