{-# LANGUAGE OverloadedStrings #-}
{-# LINE 2 "./Graphics/UI/Gtk/Printing/PrintContext.chs" #-}
module Graphics.UI.Gtk.Printing.PrintContext (
PrintContext,
PrintContextClass,
castToPrintContext,
toPrintContext,
printContextGetCairoContext,
printContextSetCairoContext,
printContextGetPageSetup,
printContextGetWidth,
printContextGetHeight,
printContextGetDpiX,
printContextGetDpiY,
printContextGetPangoFontmap,
printContextCreatePangoContext,
printContextCreatePangoLayout,
printContextGetHardMargins,
) where
import Control.Monad (liftM)
import Data.IORef (newIORef)
import System.Glib.FFI
import System.Glib.UTFString
import Graphics.UI.Gtk.Types
{-# LINE 83 "./Graphics/UI/Gtk/Printing/PrintContext.chs" #-}
import Graphics.Rendering.Pango.Types
{-# LINE 84 "./Graphics/UI/Gtk/Printing/PrintContext.chs" #-}
import Graphics.Rendering.Pango.BasicTypes
{-# LINE 85 "./Graphics/UI/Gtk/Printing/PrintContext.chs" #-}
import Graphics.Rendering.Cairo.Types
{-# LINE 86 "./Graphics/UI/Gtk/Printing/PrintContext.chs" #-}
{-# LINE 88 "./Graphics/UI/Gtk/Printing/PrintContext.chs" #-}
printContextGetCairoContext :: PrintContextClass self => self
-> IO Cairo
printContextGetCairoContext :: forall self. PrintContextClass self => self -> IO Cairo
printContextGetCairoContext self
self =
(Ptr Cairo -> Cairo) -> IO (Ptr Cairo) -> IO Cairo
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM Ptr Cairo -> Cairo
Cairo (IO (Ptr Cairo) -> IO Cairo) -> IO (Ptr Cairo) -> IO Cairo
forall a b. (a -> b) -> a -> b
$
(\(PrintContext ForeignPtr PrintContext
arg1) -> ForeignPtr PrintContext
-> (Ptr PrintContext -> IO (Ptr Cairo)) -> IO (Ptr Cairo)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr PrintContext
arg1 ((Ptr PrintContext -> IO (Ptr Cairo)) -> IO (Ptr Cairo))
-> (Ptr PrintContext -> IO (Ptr Cairo)) -> IO (Ptr Cairo)
forall a b. (a -> b) -> a -> b
$ \Ptr PrintContext
argPtr1 ->Ptr PrintContext -> IO (Ptr Cairo)
gtk_print_context_get_cairo_context Ptr PrintContext
argPtr1) (self -> PrintContext
forall o. PrintContextClass o => o -> PrintContext
toPrintContext self
self)
printContextSetCairoContext :: PrintContextClass self => self
-> Cairo
-> Double
-> Double
-> IO ()
printContextSetCairoContext :: forall self.
PrintContextClass self =>
self -> Cairo -> Double -> Double -> IO ()
printContextSetCairoContext self
self Cairo
cr Double
dpiX Double
dpiY =
(\(PrintContext ForeignPtr PrintContext
arg1) (Cairo Ptr Cairo
arg2) CDouble
arg3 CDouble
arg4 -> ForeignPtr PrintContext -> (Ptr PrintContext -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr PrintContext
arg1 ((Ptr PrintContext -> IO ()) -> IO ())
-> (Ptr PrintContext -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr PrintContext
argPtr1 ->Ptr PrintContext -> Ptr Cairo -> CDouble -> CDouble -> IO ()
gtk_print_context_set_cairo_context Ptr PrintContext
argPtr1 Ptr Cairo
arg2 CDouble
arg3 CDouble
arg4)
{-# LINE 114 "./Graphics/UI/Gtk/Printing/PrintContext.chs" #-}
(toPrintContext self)
Cairo
cr
(Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
dpiX)
(Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
dpiY)
printContextGetPageSetup :: PrintContextClass self => self
-> IO PageSetup
printContextGetPageSetup :: forall self. PrintContextClass self => self -> IO PageSetup
printContextGetPageSetup self
self =
(ForeignPtr PageSetup -> PageSetup, FinalizerPtr PageSetup)
-> IO (Ptr PageSetup) -> IO PageSetup
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr PageSetup -> PageSetup, FinalizerPtr PageSetup)
forall {a}. (ForeignPtr PageSetup -> PageSetup, FinalizerPtr a)
mkPageSetup (IO (Ptr PageSetup) -> IO PageSetup)
-> IO (Ptr PageSetup) -> IO PageSetup
forall a b. (a -> b) -> a -> b
$
(\(PrintContext ForeignPtr PrintContext
arg1) -> ForeignPtr PrintContext
-> (Ptr PrintContext -> IO (Ptr PageSetup)) -> IO (Ptr PageSetup)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr PrintContext
arg1 ((Ptr PrintContext -> IO (Ptr PageSetup)) -> IO (Ptr PageSetup))
-> (Ptr PrintContext -> IO (Ptr PageSetup)) -> IO (Ptr PageSetup)
forall a b. (a -> b) -> a -> b
$ \Ptr PrintContext
argPtr1 ->Ptr PrintContext -> IO (Ptr PageSetup)
gtk_print_context_get_page_setup Ptr PrintContext
argPtr1)
{-# LINE 127 "./Graphics/UI/Gtk/Printing/PrintContext.chs" #-}
(toPrintContext self)
printContextGetWidth :: PrintContextClass self => self
-> IO Double
printContextGetWidth :: forall self. PrintContextClass self => self -> IO Double
printContextGetWidth self
self =
(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
$
(\(PrintContext ForeignPtr PrintContext
arg1) -> ForeignPtr PrintContext
-> (Ptr PrintContext -> IO CDouble) -> IO CDouble
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr PrintContext
arg1 ((Ptr PrintContext -> IO CDouble) -> IO CDouble)
-> (Ptr PrintContext -> IO CDouble) -> IO CDouble
forall a b. (a -> b) -> a -> b
$ \Ptr PrintContext
argPtr1 ->Ptr PrintContext -> IO CDouble
gtk_print_context_get_width Ptr PrintContext
argPtr1)
{-# LINE 136 "./Graphics/UI/Gtk/Printing/PrintContext.chs" #-}
(toPrintContext self)
printContextGetHeight :: PrintContextClass self => self
-> IO Double
printContextGetHeight :: forall self. PrintContextClass self => self -> IO Double
printContextGetHeight self
self =
(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
$
(\(PrintContext ForeignPtr PrintContext
arg1) -> ForeignPtr PrintContext
-> (Ptr PrintContext -> IO CDouble) -> IO CDouble
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr PrintContext
arg1 ((Ptr PrintContext -> IO CDouble) -> IO CDouble)
-> (Ptr PrintContext -> IO CDouble) -> IO CDouble
forall a b. (a -> b) -> a -> b
$ \Ptr PrintContext
argPtr1 ->Ptr PrintContext -> IO CDouble
gtk_print_context_get_height Ptr PrintContext
argPtr1)
{-# LINE 145 "./Graphics/UI/Gtk/Printing/PrintContext.chs" #-}
(toPrintContext self)
printContextGetDpiX :: PrintContextClass self => self
-> IO Double
printContextGetDpiX :: forall self. PrintContextClass self => self -> IO Double
printContextGetDpiX self
self =
(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
$
(\(PrintContext ForeignPtr PrintContext
arg1) -> ForeignPtr PrintContext
-> (Ptr PrintContext -> IO CDouble) -> IO CDouble
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr PrintContext
arg1 ((Ptr PrintContext -> IO CDouble) -> IO CDouble)
-> (Ptr PrintContext -> IO CDouble) -> IO CDouble
forall a b. (a -> b) -> a -> b
$ \Ptr PrintContext
argPtr1 ->Ptr PrintContext -> IO CDouble
gtk_print_context_get_dpi_x Ptr PrintContext
argPtr1)
{-# LINE 155 "./Graphics/UI/Gtk/Printing/PrintContext.chs" #-}
(toPrintContext self)
printContextGetDpiY :: PrintContextClass self => self
-> IO Double
printContextGetDpiY :: forall self. PrintContextClass self => self -> IO Double
printContextGetDpiY self
self =
(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
$
(\(PrintContext ForeignPtr PrintContext
arg1) -> ForeignPtr PrintContext
-> (Ptr PrintContext -> IO CDouble) -> IO CDouble
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr PrintContext
arg1 ((Ptr PrintContext -> IO CDouble) -> IO CDouble)
-> (Ptr PrintContext -> IO CDouble) -> IO CDouble
forall a b. (a -> b) -> a -> b
$ \Ptr PrintContext
argPtr1 ->Ptr PrintContext -> IO CDouble
gtk_print_context_get_dpi_y Ptr PrintContext
argPtr1)
{-# LINE 164 "./Graphics/UI/Gtk/Printing/PrintContext.chs" #-}
(toPrintContext self)
printContextGetPangoFontmap :: PrintContextClass self => self
-> IO FontMap
printContextGetPangoFontmap :: forall self. PrintContextClass self => self -> IO FontMap
printContextGetPangoFontmap self
self =
(ForeignPtr FontMap -> FontMap, FinalizerPtr FontMap)
-> IO (Ptr FontMap) -> IO FontMap
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr FontMap -> FontMap, FinalizerPtr FontMap)
forall {a}. (ForeignPtr FontMap -> FontMap, FinalizerPtr a)
mkFontMap (IO (Ptr FontMap) -> IO FontMap) -> IO (Ptr FontMap) -> IO FontMap
forall a b. (a -> b) -> a -> b
$
(\(PrintContext ForeignPtr PrintContext
arg1) -> ForeignPtr PrintContext
-> (Ptr PrintContext -> IO (Ptr FontMap)) -> IO (Ptr FontMap)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr PrintContext
arg1 ((Ptr PrintContext -> IO (Ptr FontMap)) -> IO (Ptr FontMap))
-> (Ptr PrintContext -> IO (Ptr FontMap)) -> IO (Ptr FontMap)
forall a b. (a -> b) -> a -> b
$ \Ptr PrintContext
argPtr1 ->Ptr PrintContext -> IO (Ptr FontMap)
gtk_print_context_get_pango_fontmap Ptr PrintContext
argPtr1)
{-# LINE 173 "./Graphics/UI/Gtk/Printing/PrintContext.chs" #-}
(toPrintContext self)
printContextCreatePangoContext :: PrintContextClass self => self
-> IO PangoContext
printContextCreatePangoContext :: forall self. PrintContextClass self => self -> IO PangoContext
printContextCreatePangoContext self
self =
(ForeignPtr PangoContext -> PangoContext,
FinalizerPtr PangoContext)
-> IO (Ptr PangoContext) -> IO PangoContext
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
wrapNewGObject (ForeignPtr PangoContext -> PangoContext,
FinalizerPtr PangoContext)
forall {a}.
(ForeignPtr PangoContext -> PangoContext, FinalizerPtr a)
mkPangoContext (IO (Ptr PangoContext) -> IO PangoContext)
-> IO (Ptr PangoContext) -> IO PangoContext
forall a b. (a -> b) -> a -> b
$
(\(PrintContext ForeignPtr PrintContext
arg1) -> ForeignPtr PrintContext
-> (Ptr PrintContext -> IO (Ptr PangoContext))
-> IO (Ptr PangoContext)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr PrintContext
arg1 ((Ptr PrintContext -> IO (Ptr PangoContext))
-> IO (Ptr PangoContext))
-> (Ptr PrintContext -> IO (Ptr PangoContext))
-> IO (Ptr PangoContext)
forall a b. (a -> b) -> a -> b
$ \Ptr PrintContext
argPtr1 ->Ptr PrintContext -> IO (Ptr PangoContext)
gtk_print_context_create_pango_context Ptr PrintContext
argPtr1)
{-# LINE 182 "./Graphics/UI/Gtk/Printing/PrintContext.chs" #-}
(toPrintContext self)
printContextCreatePangoLayout :: PrintContextClass self => self
-> IO PangoLayout
printContextCreatePangoLayout :: forall self. PrintContextClass self => self -> IO PangoLayout
printContextCreatePangoLayout self
self = do
PangoLayoutRaw
pl <- (ForeignPtr PangoLayoutRaw -> PangoLayoutRaw,
FinalizerPtr PangoLayoutRaw)
-> IO (Ptr PangoLayoutRaw) -> IO PangoLayoutRaw
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
wrapNewGObject (ForeignPtr PangoLayoutRaw -> PangoLayoutRaw,
FinalizerPtr PangoLayoutRaw)
forall {a}.
(ForeignPtr PangoLayoutRaw -> PangoLayoutRaw, FinalizerPtr a)
mkPangoLayoutRaw (IO (Ptr PangoLayoutRaw) -> IO PangoLayoutRaw)
-> IO (Ptr PangoLayoutRaw) -> IO PangoLayoutRaw
forall a b. (a -> b) -> a -> b
$
(\(PrintContext ForeignPtr PrintContext
arg1) -> ForeignPtr PrintContext
-> (Ptr PrintContext -> IO (Ptr PangoLayoutRaw))
-> IO (Ptr PangoLayoutRaw)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr PrintContext
arg1 ((Ptr PrintContext -> IO (Ptr PangoLayoutRaw))
-> IO (Ptr PangoLayoutRaw))
-> (Ptr PrintContext -> IO (Ptr PangoLayoutRaw))
-> IO (Ptr PangoLayoutRaw)
forall a b. (a -> b) -> a -> b
$ \Ptr PrintContext
argPtr1 ->Ptr PrintContext -> IO (Ptr PangoLayoutRaw)
gtk_print_context_create_pango_layout Ptr PrintContext
argPtr1)
{-# LINE 192 "./Graphics/UI/Gtk/Printing/PrintContext.chs" #-}
(toPrintContext self)
PangoString
ps <- DefaultGlibString -> IO PangoString
forall string. GlibString string => string -> IO PangoString
makeNewPangoString (DefaultGlibString
""::DefaultGlibString)
IORef PangoString
psRef <- PangoString -> IO (IORef PangoString)
forall a. a -> IO (IORef a)
newIORef PangoString
ps
PangoLayout -> IO PangoLayout
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (IORef PangoString -> PangoLayoutRaw -> PangoLayout
PangoLayout IORef PangoString
psRef PangoLayoutRaw
pl)
printContextGetHardMargins :: PrintContextClass self => self
-> IO (Maybe (Double, Double, Double, Double))
printContextGetHardMargins :: forall self.
PrintContextClass self =>
self -> IO (Maybe (Double, Double, Double, Double))
printContextGetHardMargins self
self =
(Ptr CDouble -> IO (Maybe (Double, Double, Double, Double)))
-> IO (Maybe (Double, Double, Double, Double))
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CDouble -> IO (Maybe (Double, Double, Double, Double)))
-> IO (Maybe (Double, Double, Double, Double)))
-> (Ptr CDouble -> IO (Maybe (Double, Double, Double, Double)))
-> IO (Maybe (Double, Double, Double, Double))
forall a b. (a -> b) -> a -> b
$ \ Ptr CDouble
topPtr ->
(Ptr CDouble -> IO (Maybe (Double, Double, Double, Double)))
-> IO (Maybe (Double, Double, Double, Double))
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CDouble -> IO (Maybe (Double, Double, Double, Double)))
-> IO (Maybe (Double, Double, Double, Double)))
-> (Ptr CDouble -> IO (Maybe (Double, Double, Double, Double)))
-> IO (Maybe (Double, Double, Double, Double))
forall a b. (a -> b) -> a -> b
$ \ Ptr CDouble
bottomPtr ->
(Ptr CDouble -> IO (Maybe (Double, Double, Double, Double)))
-> IO (Maybe (Double, Double, Double, Double))
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CDouble -> IO (Maybe (Double, Double, Double, Double)))
-> IO (Maybe (Double, Double, Double, Double)))
-> (Ptr CDouble -> IO (Maybe (Double, Double, Double, Double)))
-> IO (Maybe (Double, Double, Double, Double))
forall a b. (a -> b) -> a -> b
$ \ Ptr CDouble
leftPtr ->
(Ptr CDouble -> IO (Maybe (Double, Double, Double, Double)))
-> IO (Maybe (Double, Double, Double, Double))
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CDouble -> IO (Maybe (Double, Double, Double, Double)))
-> IO (Maybe (Double, Double, Double, Double)))
-> (Ptr CDouble -> IO (Maybe (Double, Double, Double, Double)))
-> IO (Maybe (Double, Double, Double, Double))
forall a b. (a -> b) -> a -> b
$ \ Ptr CDouble
rightPtr -> do
Bool
success <- (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
$ (\(PrintContext ForeignPtr PrintContext
arg1) Ptr CDouble
arg2 Ptr CDouble
arg3 Ptr CDouble
arg4 Ptr CDouble
arg5 -> ForeignPtr PrintContext -> (Ptr PrintContext -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr PrintContext
arg1 ((Ptr PrintContext -> IO CInt) -> IO CInt)
-> (Ptr PrintContext -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr PrintContext
argPtr1 ->Ptr PrintContext
-> Ptr CDouble
-> Ptr CDouble
-> Ptr CDouble
-> Ptr CDouble
-> IO CInt
gtk_print_context_get_hard_margins Ptr PrintContext
argPtr1 Ptr CDouble
arg2 Ptr CDouble
arg3 Ptr CDouble
arg4 Ptr CDouble
arg5)
{-# LINE 211 "./Graphics/UI/Gtk/Printing/PrintContext.chs" #-}
(self -> PrintContext
forall o. PrintContextClass o => o -> PrintContext
toPrintContext self
self)
Ptr CDouble
topPtr
Ptr CDouble
bottomPtr
Ptr CDouble
leftPtr
Ptr CDouble
rightPtr
if Bool
success
then do
Double
top <- (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
$ Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
topPtr
Double
bottom <- (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
$ Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
bottomPtr
Double
left <- (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
$ Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
leftPtr
Double
right <- (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
$ Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
rightPtr
Maybe (Double, Double, Double, Double)
-> IO (Maybe (Double, Double, Double, Double))
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe (Double, Double, Double, Double)
-> IO (Maybe (Double, Double, Double, Double)))
-> Maybe (Double, Double, Double, Double)
-> IO (Maybe (Double, Double, Double, Double))
forall a b. (a -> b) -> a -> b
$ (Double, Double, Double, Double)
-> Maybe (Double, Double, Double, Double)
forall a. a -> Maybe a
Just (Double
top, Double
bottom, Double
left, Double
right)
else Maybe (Double, Double, Double, Double)
-> IO (Maybe (Double, Double, Double, Double))
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe (Double, Double, Double, Double)
forall a. Maybe a
Nothing
foreign import ccall safe "gtk_print_context_get_cairo_context"
gtk_print_context_get_cairo_context :: ((Ptr PrintContext) -> (IO (Ptr Cairo)))
foreign import ccall safe "gtk_print_context_set_cairo_context"
gtk_print_context_set_cairo_context :: ((Ptr PrintContext) -> ((Ptr Cairo) -> (CDouble -> (CDouble -> (IO ())))))
foreign import ccall safe "gtk_print_context_get_page_setup"
gtk_print_context_get_page_setup :: ((Ptr PrintContext) -> (IO (Ptr PageSetup)))
foreign import ccall safe "gtk_print_context_get_width"
gtk_print_context_get_width :: ((Ptr PrintContext) -> (IO CDouble))
foreign import ccall safe "gtk_print_context_get_height"
gtk_print_context_get_height :: ((Ptr PrintContext) -> (IO CDouble))
foreign import ccall safe "gtk_print_context_get_dpi_x"
gtk_print_context_get_dpi_x :: ((Ptr PrintContext) -> (IO CDouble))
foreign import ccall safe "gtk_print_context_get_dpi_y"
gtk_print_context_get_dpi_y :: ((Ptr PrintContext) -> (IO CDouble))
foreign import ccall safe "gtk_print_context_get_pango_fontmap"
gtk_print_context_get_pango_fontmap :: ((Ptr PrintContext) -> (IO (Ptr FontMap)))
foreign import ccall safe "gtk_print_context_create_pango_context"
gtk_print_context_create_pango_context :: ((Ptr PrintContext) -> (IO (Ptr PangoContext)))
foreign import ccall safe "gtk_print_context_create_pango_layout"
gtk_print_context_create_pango_layout :: ((Ptr PrintContext) -> (IO (Ptr PangoLayoutRaw)))
foreign import ccall safe "gtk_print_context_get_hard_margins"
gtk_print_context_get_hard_margins :: ((Ptr PrintContext) -> ((Ptr CDouble) -> ((Ptr CDouble) -> ((Ptr CDouble) -> ((Ptr CDouble) -> (IO CInt))))))