module Graphics.UI.Gtk.Printing.PageSetup (
PageSetup,
PageSetupClass,
castToPageSetup,
toPageSetup,
pageSetupNew,
pageSetupNewFromFile,
pageSetupCopy,
pageSetupGetTopMargin,
pageSetupSetTopMargin,
pageSetupGetBottomMargin,
pageSetupSetBottomMargin,
pageSetupGetLeftMargin,
pageSetupSetLeftMargin,
pageSetupGetRightMargin,
pageSetupSetRightMargin,
pageSetupSetPaperSizeAndDefaultMargins,
pageSetupGetPaperWidth,
pageSetupGetPaperHeight,
pageSetupGetPageWidth,
pageSetupGetPageHeight,
pageSetupLoadFile,
pageSetupToFile,
pageSetupOrientation,
pageSetupPaperSize,
) where
import Control.Monad (liftM)
import System.Glib.FFI
import System.Glib.GError
import System.Glib.Attributes
import System.Glib.UTFString
import Graphics.UI.Gtk.Types
import Graphics.UI.Gtk.Printing.PaperSize (PaperSize(..), mkPaperSize, Unit(..))
import Graphics.UI.Gtk.Printing.PrintSettings (PageOrientation (..))
pageSetupNew :: IO PageSetup
pageSetupNew =
wrapNewGObject mkPageSetup $
gtk_page_setup_new
pageSetupNewFromFile :: GlibString string
=> string
-> IO PageSetup
pageSetupNewFromFile fileName =
propagateGError $ \errorPtr ->
withUTFString fileName $ \fileNamePtr -> do
setupPtr <- gtk_page_setup_new_from_file
fileNamePtr
errorPtr
wrapNewGObject mkPageSetup (return setupPtr)
pageSetupCopy :: PageSetupClass self => self
-> IO PageSetup
pageSetupCopy self =
wrapNewGObject mkPageSetup $
(\(PageSetup arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_page_setup_copy argPtr1)
(toPageSetup self)
pageSetupGetOrientation :: PageSetupClass self => self
-> IO PageOrientation
pageSetupGetOrientation self =
liftM (toEnum . fromIntegral) $
(\(PageSetup arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_page_setup_get_orientation argPtr1)
(toPageSetup self)
pageSetupSetOrientation :: PageSetupClass self => self
-> PageOrientation
-> IO ()
pageSetupSetOrientation self orientation =
(\(PageSetup arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_page_setup_set_orientation argPtr1 arg2)
(toPageSetup self)
((fromIntegral . fromEnum) orientation)
pageSetupGetPaperSize :: PageSetupClass self => self
-> IO PaperSize
pageSetupGetPaperSize self =
(\(PageSetup arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_page_setup_get_paper_size argPtr1)
(toPageSetup self)
>>= mkPaperSize . castPtr
pageSetupSetPaperSize :: PageSetupClass self => self
-> PaperSize
-> IO ()
pageSetupSetPaperSize self size =
(\(PageSetup arg1) (PaperSize arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_page_setup_set_paper_size argPtr1 argPtr2)
(toPageSetup self)
size
pageSetupGetTopMargin :: PageSetupClass self => self
-> Unit
-> IO Double
pageSetupGetTopMargin self unit =
liftM realToFrac $
(\(PageSetup arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_page_setup_get_top_margin argPtr1 arg2)
(toPageSetup self)
((fromIntegral . fromEnum) unit)
pageSetupSetTopMargin :: PageSetupClass self => self
-> Double
-> Unit
-> IO ()
pageSetupSetTopMargin self margin unit =
(\(PageSetup arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->gtk_page_setup_set_top_margin argPtr1 arg2 arg3)
(toPageSetup self)
(realToFrac margin)
((fromIntegral . fromEnum) unit)
pageSetupGetBottomMargin :: PageSetupClass self => self
-> Unit
-> IO Double
pageSetupGetBottomMargin self unit =
liftM realToFrac $
(\(PageSetup arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_page_setup_get_bottom_margin argPtr1 arg2)
(toPageSetup self)
((fromIntegral . fromEnum) unit)
pageSetupSetBottomMargin :: PageSetupClass self => self
-> Double
-> Unit
-> IO ()
pageSetupSetBottomMargin self margin unit =
(\(PageSetup arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->gtk_page_setup_set_bottom_margin argPtr1 arg2 arg3)
(toPageSetup self)
(realToFrac margin)
((fromIntegral . fromEnum) unit)
pageSetupGetLeftMargin :: PageSetupClass self => self
-> Unit
-> IO Double
pageSetupGetLeftMargin self unit =
liftM realToFrac $
(\(PageSetup arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_page_setup_get_left_margin argPtr1 arg2)
(toPageSetup self)
((fromIntegral . fromEnum) unit)
pageSetupSetLeftMargin :: PageSetupClass self => self
-> Double
-> Unit
-> IO ()
pageSetupSetLeftMargin self margin unit =
(\(PageSetup arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->gtk_page_setup_set_left_margin argPtr1 arg2 arg3)
(toPageSetup self)
(realToFrac margin)
((fromIntegral . fromEnum) unit)
pageSetupGetRightMargin :: PageSetupClass self => self
-> Unit
-> IO Double
pageSetupGetRightMargin self unit =
liftM realToFrac $
(\(PageSetup arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_page_setup_get_right_margin argPtr1 arg2)
(toPageSetup self)
((fromIntegral . fromEnum) unit)
pageSetupSetRightMargin :: PageSetupClass self => self
-> Double
-> Unit
-> IO ()
pageSetupSetRightMargin self margin unit =
(\(PageSetup arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->gtk_page_setup_set_right_margin argPtr1 arg2 arg3)
(toPageSetup self)
(realToFrac margin)
((fromIntegral . fromEnum) unit)
pageSetupSetPaperSizeAndDefaultMargins :: PageSetupClass self => self
-> PaperSize
-> IO ()
pageSetupSetPaperSizeAndDefaultMargins self size =
(\(PageSetup arg1) (PaperSize arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_page_setup_set_paper_size_and_default_margins argPtr1 argPtr2)
(toPageSetup self)
size
pageSetupGetPaperWidth :: PageSetupClass self => self
-> Unit
-> IO Double
pageSetupGetPaperWidth self unit =
liftM realToFrac $
(\(PageSetup arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_page_setup_get_paper_width argPtr1 arg2)
(toPageSetup self)
((fromIntegral . fromEnum) unit)
pageSetupGetPaperHeight :: PageSetupClass self => self
-> Unit
-> IO Double
pageSetupGetPaperHeight self unit =
liftM realToFrac $
(\(PageSetup arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_page_setup_get_paper_height argPtr1 arg2)
(toPageSetup self)
((fromIntegral . fromEnum) unit)
pageSetupGetPageWidth :: PageSetupClass self => self
-> Unit
-> IO Double
pageSetupGetPageWidth self unit =
liftM realToFrac $
(\(PageSetup arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_page_setup_get_page_width argPtr1 arg2)
(toPageSetup self)
((fromIntegral . fromEnum) unit)
pageSetupGetPageHeight :: PageSetupClass self => self
-> Unit
-> IO Double
pageSetupGetPageHeight self unit =
liftM realToFrac $
(\(PageSetup arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_page_setup_get_page_height argPtr1 arg2)
(toPageSetup self)
((fromIntegral . fromEnum) unit)
pageSetupLoadFile :: (PageSetupClass self, GlibString string) => self
-> string
-> IO Bool
pageSetupLoadFile self fileName =
liftM toBool $
propagateGError $ \errorPtr ->
withUTFString fileName $ \fileNamePtr ->
(\(PageSetup arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->gtk_page_setup_load_file argPtr1 arg2 arg3)
(toPageSetup self)
fileNamePtr
errorPtr
pageSetupToFile :: (PageSetupClass self, GlibString string) => self
-> string
-> IO Bool
pageSetupToFile self fileName =
liftM toBool $
propagateGError $ \errorPtr ->
withUTFString fileName $ \fileNamePtr ->
(\(PageSetup arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->gtk_page_setup_to_file argPtr1 arg2 arg3)
(toPageSetup self)
fileNamePtr
errorPtr
pageSetupOrientation :: PageSetupClass self => Attr self PageOrientation
pageSetupOrientation = newAttr
pageSetupGetOrientation
pageSetupSetOrientation
pageSetupPaperSize :: PageSetupClass self => Attr self PaperSize
pageSetupPaperSize = newAttr
pageSetupGetPaperSize
pageSetupSetPaperSize
foreign import ccall safe "gtk_page_setup_new"
gtk_page_setup_new :: (IO (Ptr PageSetup))
foreign import ccall safe "gtk_page_setup_new_from_file"
gtk_page_setup_new_from_file :: ((Ptr CChar) -> ((Ptr (Ptr ())) -> (IO (Ptr PageSetup))))
foreign import ccall safe "gtk_page_setup_copy"
gtk_page_setup_copy :: ((Ptr PageSetup) -> (IO (Ptr PageSetup)))
foreign import ccall safe "gtk_page_setup_get_orientation"
gtk_page_setup_get_orientation :: ((Ptr PageSetup) -> (IO CInt))
foreign import ccall safe "gtk_page_setup_set_orientation"
gtk_page_setup_set_orientation :: ((Ptr PageSetup) -> (CInt -> (IO ())))
foreign import ccall safe "gtk_page_setup_get_paper_size"
gtk_page_setup_get_paper_size :: ((Ptr PageSetup) -> (IO (Ptr PaperSize)))
foreign import ccall safe "gtk_page_setup_set_paper_size"
gtk_page_setup_set_paper_size :: ((Ptr PageSetup) -> ((Ptr PaperSize) -> (IO ())))
foreign import ccall safe "gtk_page_setup_get_top_margin"
gtk_page_setup_get_top_margin :: ((Ptr PageSetup) -> (CInt -> (IO CDouble)))
foreign import ccall safe "gtk_page_setup_set_top_margin"
gtk_page_setup_set_top_margin :: ((Ptr PageSetup) -> (CDouble -> (CInt -> (IO ()))))
foreign import ccall safe "gtk_page_setup_get_bottom_margin"
gtk_page_setup_get_bottom_margin :: ((Ptr PageSetup) -> (CInt -> (IO CDouble)))
foreign import ccall safe "gtk_page_setup_set_bottom_margin"
gtk_page_setup_set_bottom_margin :: ((Ptr PageSetup) -> (CDouble -> (CInt -> (IO ()))))
foreign import ccall safe "gtk_page_setup_get_left_margin"
gtk_page_setup_get_left_margin :: ((Ptr PageSetup) -> (CInt -> (IO CDouble)))
foreign import ccall safe "gtk_page_setup_set_left_margin"
gtk_page_setup_set_left_margin :: ((Ptr PageSetup) -> (CDouble -> (CInt -> (IO ()))))
foreign import ccall safe "gtk_page_setup_get_right_margin"
gtk_page_setup_get_right_margin :: ((Ptr PageSetup) -> (CInt -> (IO CDouble)))
foreign import ccall safe "gtk_page_setup_set_right_margin"
gtk_page_setup_set_right_margin :: ((Ptr PageSetup) -> (CDouble -> (CInt -> (IO ()))))
foreign import ccall safe "gtk_page_setup_set_paper_size_and_default_margins"
gtk_page_setup_set_paper_size_and_default_margins :: ((Ptr PageSetup) -> ((Ptr PaperSize) -> (IO ())))
foreign import ccall safe "gtk_page_setup_get_paper_width"
gtk_page_setup_get_paper_width :: ((Ptr PageSetup) -> (CInt -> (IO CDouble)))
foreign import ccall safe "gtk_page_setup_get_paper_height"
gtk_page_setup_get_paper_height :: ((Ptr PageSetup) -> (CInt -> (IO CDouble)))
foreign import ccall safe "gtk_page_setup_get_page_width"
gtk_page_setup_get_page_width :: ((Ptr PageSetup) -> (CInt -> (IO CDouble)))
foreign import ccall safe "gtk_page_setup_get_page_height"
gtk_page_setup_get_page_height :: ((Ptr PageSetup) -> (CInt -> (IO CDouble)))
foreign import ccall safe "gtk_page_setup_load_file"
gtk_page_setup_load_file :: ((Ptr PageSetup) -> ((Ptr CChar) -> ((Ptr (Ptr ())) -> (IO CInt))))
foreign import ccall safe "gtk_page_setup_to_file"
gtk_page_setup_to_file :: ((Ptr PageSetup) -> ((Ptr CChar) -> ((Ptr (Ptr ())) -> (IO CInt))))