{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Structs.PaperSize
(
PaperSize(..) ,
#if defined(ENABLE_OVERLOADING)
ResolvePaperSizeMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
PaperSizeCopyMethodInfo ,
#endif
paperSizeCopy ,
#if defined(ENABLE_OVERLOADING)
PaperSizeFreeMethodInfo ,
#endif
paperSizeFree ,
paperSizeGetDefault ,
#if defined(ENABLE_OVERLOADING)
PaperSizeGetDefaultBottomMarginMethodInfo,
#endif
paperSizeGetDefaultBottomMargin ,
#if defined(ENABLE_OVERLOADING)
PaperSizeGetDefaultLeftMarginMethodInfo ,
#endif
paperSizeGetDefaultLeftMargin ,
#if defined(ENABLE_OVERLOADING)
PaperSizeGetDefaultRightMarginMethodInfo,
#endif
paperSizeGetDefaultRightMargin ,
#if defined(ENABLE_OVERLOADING)
PaperSizeGetDefaultTopMarginMethodInfo ,
#endif
paperSizeGetDefaultTopMargin ,
#if defined(ENABLE_OVERLOADING)
PaperSizeGetDisplayNameMethodInfo ,
#endif
paperSizeGetDisplayName ,
#if defined(ENABLE_OVERLOADING)
PaperSizeGetHeightMethodInfo ,
#endif
paperSizeGetHeight ,
#if defined(ENABLE_OVERLOADING)
PaperSizeGetNameMethodInfo ,
#endif
paperSizeGetName ,
paperSizeGetPaperSizes ,
#if defined(ENABLE_OVERLOADING)
PaperSizeGetPpdNameMethodInfo ,
#endif
paperSizeGetPpdName ,
#if defined(ENABLE_OVERLOADING)
PaperSizeGetWidthMethodInfo ,
#endif
paperSizeGetWidth ,
#if defined(ENABLE_OVERLOADING)
PaperSizeIsCustomMethodInfo ,
#endif
paperSizeIsCustom ,
#if defined(ENABLE_OVERLOADING)
PaperSizeIsEqualMethodInfo ,
#endif
paperSizeIsEqual ,
#if defined(ENABLE_OVERLOADING)
PaperSizeIsIppMethodInfo ,
#endif
paperSizeIsIpp ,
paperSizeNew ,
paperSizeNewCustom ,
paperSizeNewFromGvariant ,
paperSizeNewFromIpp ,
paperSizeNewFromKeyFile ,
paperSizeNewFromPpd ,
#if defined(ENABLE_OVERLOADING)
PaperSizeSetSizeMethodInfo ,
#endif
paperSizeSetSize ,
#if defined(ENABLE_OVERLOADING)
PaperSizeToGvariantMethodInfo ,
#endif
paperSizeToGvariant ,
#if defined(ENABLE_OVERLOADING)
PaperSizeToKeyFileMethodInfo ,
#endif
paperSizeToKeyFile ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GLib.Structs.KeyFile as GLib.KeyFile
import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
newtype PaperSize = PaperSize (SP.ManagedPtr PaperSize)
deriving (PaperSize -> PaperSize -> Bool
(PaperSize -> PaperSize -> Bool)
-> (PaperSize -> PaperSize -> Bool) -> Eq PaperSize
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PaperSize -> PaperSize -> Bool
$c/= :: PaperSize -> PaperSize -> Bool
== :: PaperSize -> PaperSize -> Bool
$c== :: PaperSize -> PaperSize -> Bool
Eq)
instance SP.ManagedPtrNewtype PaperSize where
toManagedPtr :: PaperSize -> ManagedPtr PaperSize
toManagedPtr (PaperSize ManagedPtr PaperSize
p) = ManagedPtr PaperSize
p
foreign import ccall "gtk_paper_size_get_type" c_gtk_paper_size_get_type ::
IO GType
type instance O.ParentTypes PaperSize = '[]
instance O.HasParentTypes PaperSize
instance B.Types.TypedObject PaperSize where
glibType :: IO GType
glibType = IO GType
c_gtk_paper_size_get_type
instance B.Types.GBoxed PaperSize
instance B.GValue.IsGValue PaperSize where
toGValue :: PaperSize -> IO GValue
toGValue PaperSize
o = do
GType
gtype <- IO GType
c_gtk_paper_size_get_type
PaperSize -> (Ptr PaperSize -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr PaperSize
o (GType
-> (GValue -> Ptr PaperSize -> IO ()) -> Ptr PaperSize -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr PaperSize -> IO ()
forall a. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
fromGValue :: GValue -> IO PaperSize
fromGValue GValue
gv = do
Ptr PaperSize
ptr <- GValue -> IO (Ptr PaperSize)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr PaperSize)
(ManagedPtr PaperSize -> PaperSize)
-> Ptr PaperSize -> IO PaperSize
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr PaperSize -> PaperSize
PaperSize Ptr PaperSize
ptr
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList PaperSize
type instance O.AttributeList PaperSize = PaperSizeAttributeList
type PaperSizeAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_paper_size_new" gtk_paper_size_new ::
CString ->
IO (Ptr PaperSize)
paperSizeNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Maybe (T.Text)
-> m PaperSize
paperSizeNew :: Maybe Text -> m PaperSize
paperSizeNew Maybe Text
name = IO PaperSize -> m PaperSize
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PaperSize -> m PaperSize) -> IO PaperSize -> m PaperSize
forall a b. (a -> b) -> a -> b
$ do
Ptr CChar
maybeName <- case Maybe Text
name of
Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just Text
jName -> do
Ptr CChar
jName' <- Text -> IO (Ptr CChar)
textToCString Text
jName
Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jName'
Ptr PaperSize
result <- Ptr CChar -> IO (Ptr PaperSize)
gtk_paper_size_new Ptr CChar
maybeName
Text -> Ptr PaperSize -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"paperSizeNew" Ptr PaperSize
result
PaperSize
result' <- ((ManagedPtr PaperSize -> PaperSize)
-> Ptr PaperSize -> IO PaperSize
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr PaperSize -> PaperSize
PaperSize) Ptr PaperSize
result
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeName
PaperSize -> IO PaperSize
forall (m :: * -> *) a. Monad m => a -> m a
return PaperSize
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_paper_size_new_custom" gtk_paper_size_new_custom ::
CString ->
CString ->
CDouble ->
CDouble ->
CUInt ->
IO (Ptr PaperSize)
paperSizeNewCustom ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> T.Text
-> Double
-> Double
-> Gtk.Enums.Unit
-> m PaperSize
paperSizeNewCustom :: Text -> Text -> Double -> Double -> Unit -> m PaperSize
paperSizeNewCustom Text
name Text
displayName Double
width Double
height Unit
unit = IO PaperSize -> m PaperSize
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PaperSize -> m PaperSize) -> IO PaperSize -> m PaperSize
forall a b. (a -> b) -> a -> b
$ do
Ptr CChar
name' <- Text -> IO (Ptr CChar)
textToCString Text
name
Ptr CChar
displayName' <- Text -> IO (Ptr CChar)
textToCString Text
displayName
let width' :: CDouble
width' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
width
let height' :: CDouble
height' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
height
let unit' :: CUInt
unit' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Unit -> Int) -> Unit -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Unit -> Int
forall a. Enum a => a -> Int
fromEnum) Unit
unit
Ptr PaperSize
result <- Ptr CChar
-> Ptr CChar -> CDouble -> CDouble -> CUInt -> IO (Ptr PaperSize)
gtk_paper_size_new_custom Ptr CChar
name' Ptr CChar
displayName' CDouble
width' CDouble
height' CUInt
unit'
Text -> Ptr PaperSize -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"paperSizeNewCustom" Ptr PaperSize
result
PaperSize
result' <- ((ManagedPtr PaperSize -> PaperSize)
-> Ptr PaperSize -> IO PaperSize
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr PaperSize -> PaperSize
PaperSize) Ptr PaperSize
result
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
name'
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
displayName'
PaperSize -> IO PaperSize
forall (m :: * -> *) a. Monad m => a -> m a
return PaperSize
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_paper_size_new_from_gvariant" gtk_paper_size_new_from_gvariant ::
Ptr GVariant ->
IO (Ptr PaperSize)
paperSizeNewFromGvariant ::
(B.CallStack.HasCallStack, MonadIO m) =>
GVariant
-> m PaperSize
paperSizeNewFromGvariant :: GVariant -> m PaperSize
paperSizeNewFromGvariant GVariant
variant = IO PaperSize -> m PaperSize
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PaperSize -> m PaperSize) -> IO PaperSize -> m PaperSize
forall a b. (a -> b) -> a -> b
$ do
Ptr GVariant
variant' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
variant
Ptr PaperSize
result <- Ptr GVariant -> IO (Ptr PaperSize)
gtk_paper_size_new_from_gvariant Ptr GVariant
variant'
Text -> Ptr PaperSize -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"paperSizeNewFromGvariant" Ptr PaperSize
result
PaperSize
result' <- ((ManagedPtr PaperSize -> PaperSize)
-> Ptr PaperSize -> IO PaperSize
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr PaperSize -> PaperSize
PaperSize) Ptr PaperSize
result
GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GVariant
variant
PaperSize -> IO PaperSize
forall (m :: * -> *) a. Monad m => a -> m a
return PaperSize
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_paper_size_new_from_ipp" gtk_paper_size_new_from_ipp ::
CString ->
CDouble ->
CDouble ->
IO (Ptr PaperSize)
paperSizeNewFromIpp ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Double
-> Double
-> m PaperSize
paperSizeNewFromIpp :: Text -> Double -> Double -> m PaperSize
paperSizeNewFromIpp Text
ippName Double
width Double
height = IO PaperSize -> m PaperSize
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PaperSize -> m PaperSize) -> IO PaperSize -> m PaperSize
forall a b. (a -> b) -> a -> b
$ do
Ptr CChar
ippName' <- Text -> IO (Ptr CChar)
textToCString Text
ippName
let width' :: CDouble
width' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
width
let height' :: CDouble
height' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
height
Ptr PaperSize
result <- Ptr CChar -> CDouble -> CDouble -> IO (Ptr PaperSize)
gtk_paper_size_new_from_ipp Ptr CChar
ippName' CDouble
width' CDouble
height'
Text -> Ptr PaperSize -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"paperSizeNewFromIpp" Ptr PaperSize
result
PaperSize
result' <- ((ManagedPtr PaperSize -> PaperSize)
-> Ptr PaperSize -> IO PaperSize
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr PaperSize -> PaperSize
PaperSize) Ptr PaperSize
result
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
ippName'
PaperSize -> IO PaperSize
forall (m :: * -> *) a. Monad m => a -> m a
return PaperSize
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_paper_size_new_from_key_file" gtk_paper_size_new_from_key_file ::
Ptr GLib.KeyFile.KeyFile ->
CString ->
Ptr (Ptr GError) ->
IO (Ptr PaperSize)
paperSizeNewFromKeyFile ::
(B.CallStack.HasCallStack, MonadIO m) =>
GLib.KeyFile.KeyFile
-> Maybe (T.Text)
-> m PaperSize
paperSizeNewFromKeyFile :: KeyFile -> Maybe Text -> m PaperSize
paperSizeNewFromKeyFile KeyFile
keyFile Maybe Text
groupName = IO PaperSize -> m PaperSize
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PaperSize -> m PaperSize) -> IO PaperSize -> m PaperSize
forall a b. (a -> b) -> a -> b
$ do
Ptr KeyFile
keyFile' <- KeyFile -> IO (Ptr KeyFile)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr KeyFile
keyFile
Ptr CChar
maybeGroupName <- case Maybe Text
groupName of
Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just Text
jGroupName -> do
Ptr CChar
jGroupName' <- Text -> IO (Ptr CChar)
textToCString Text
jGroupName
Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jGroupName'
IO PaperSize -> IO () -> IO PaperSize
forall a b. IO a -> IO b -> IO a
onException (do
Ptr PaperSize
result <- (Ptr (Ptr GError) -> IO (Ptr PaperSize)) -> IO (Ptr PaperSize)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr PaperSize)) -> IO (Ptr PaperSize))
-> (Ptr (Ptr GError) -> IO (Ptr PaperSize)) -> IO (Ptr PaperSize)
forall a b. (a -> b) -> a -> b
$ Ptr KeyFile -> Ptr CChar -> Ptr (Ptr GError) -> IO (Ptr PaperSize)
gtk_paper_size_new_from_key_file Ptr KeyFile
keyFile' Ptr CChar
maybeGroupName
Text -> Ptr PaperSize -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"paperSizeNewFromKeyFile" Ptr PaperSize
result
PaperSize
result' <- ((ManagedPtr PaperSize -> PaperSize)
-> Ptr PaperSize -> IO PaperSize
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr PaperSize -> PaperSize
PaperSize) Ptr PaperSize
result
KeyFile -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr KeyFile
keyFile
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeGroupName
PaperSize -> IO PaperSize
forall (m :: * -> *) a. Monad m => a -> m a
return PaperSize
result'
) (do
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeGroupName
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_paper_size_new_from_ppd" gtk_paper_size_new_from_ppd ::
CString ->
CString ->
CDouble ->
CDouble ->
IO (Ptr PaperSize)
paperSizeNewFromPpd ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> T.Text
-> Double
-> Double
-> m PaperSize
paperSizeNewFromPpd :: Text -> Text -> Double -> Double -> m PaperSize
paperSizeNewFromPpd Text
ppdName Text
ppdDisplayName Double
width Double
height = IO PaperSize -> m PaperSize
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PaperSize -> m PaperSize) -> IO PaperSize -> m PaperSize
forall a b. (a -> b) -> a -> b
$ do
Ptr CChar
ppdName' <- Text -> IO (Ptr CChar)
textToCString Text
ppdName
Ptr CChar
ppdDisplayName' <- Text -> IO (Ptr CChar)
textToCString Text
ppdDisplayName
let width' :: CDouble
width' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
width
let height' :: CDouble
height' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
height
Ptr PaperSize
result <- Ptr CChar -> Ptr CChar -> CDouble -> CDouble -> IO (Ptr PaperSize)
gtk_paper_size_new_from_ppd Ptr CChar
ppdName' Ptr CChar
ppdDisplayName' CDouble
width' CDouble
height'
Text -> Ptr PaperSize -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"paperSizeNewFromPpd" Ptr PaperSize
result
PaperSize
result' <- ((ManagedPtr PaperSize -> PaperSize)
-> Ptr PaperSize -> IO PaperSize
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr PaperSize -> PaperSize
PaperSize) Ptr PaperSize
result
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
ppdName'
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
ppdDisplayName'
PaperSize -> IO PaperSize
forall (m :: * -> *) a. Monad m => a -> m a
return PaperSize
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_paper_size_copy" gtk_paper_size_copy ::
Ptr PaperSize ->
IO (Ptr PaperSize)
paperSizeCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
PaperSize
-> m PaperSize
paperSizeCopy :: PaperSize -> m PaperSize
paperSizeCopy PaperSize
other = IO PaperSize -> m PaperSize
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PaperSize -> m PaperSize) -> IO PaperSize -> m PaperSize
forall a b. (a -> b) -> a -> b
$ do
Ptr PaperSize
other' <- PaperSize -> IO (Ptr PaperSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PaperSize
other
Ptr PaperSize
result <- Ptr PaperSize -> IO (Ptr PaperSize)
gtk_paper_size_copy Ptr PaperSize
other'
Text -> Ptr PaperSize -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"paperSizeCopy" Ptr PaperSize
result
PaperSize
result' <- ((ManagedPtr PaperSize -> PaperSize)
-> Ptr PaperSize -> IO PaperSize
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr PaperSize -> PaperSize
PaperSize) Ptr PaperSize
result
PaperSize -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PaperSize
other
PaperSize -> IO PaperSize
forall (m :: * -> *) a. Monad m => a -> m a
return PaperSize
result'
#if defined(ENABLE_OVERLOADING)
data PaperSizeCopyMethodInfo
instance (signature ~ (m PaperSize), MonadIO m) => O.MethodInfo PaperSizeCopyMethodInfo PaperSize signature where
overloadedMethod = paperSizeCopy
#endif
foreign import ccall "gtk_paper_size_free" gtk_paper_size_free ::
Ptr PaperSize ->
IO ()
paperSizeFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
PaperSize
-> m ()
paperSizeFree :: PaperSize -> m ()
paperSizeFree PaperSize
size = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr PaperSize
size' <- PaperSize -> IO (Ptr PaperSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PaperSize
size
Ptr PaperSize -> IO ()
gtk_paper_size_free Ptr PaperSize
size'
PaperSize -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PaperSize
size
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PaperSizeFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo PaperSizeFreeMethodInfo PaperSize signature where
overloadedMethod = paperSizeFree
#endif
foreign import ccall "gtk_paper_size_get_default_bottom_margin" gtk_paper_size_get_default_bottom_margin ::
Ptr PaperSize ->
CUInt ->
IO CDouble
paperSizeGetDefaultBottomMargin ::
(B.CallStack.HasCallStack, MonadIO m) =>
PaperSize
-> Gtk.Enums.Unit
-> m Double
paperSizeGetDefaultBottomMargin :: PaperSize -> Unit -> m Double
paperSizeGetDefaultBottomMargin PaperSize
size Unit
unit = IO Double -> m Double
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Double -> m Double) -> IO Double -> m Double
forall a b. (a -> b) -> a -> b
$ do
Ptr PaperSize
size' <- PaperSize -> IO (Ptr PaperSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PaperSize
size
let unit' :: CUInt
unit' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Unit -> Int) -> Unit -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Unit -> Int
forall a. Enum a => a -> Int
fromEnum) Unit
unit
CDouble
result <- Ptr PaperSize -> CUInt -> IO CDouble
gtk_paper_size_get_default_bottom_margin Ptr PaperSize
size' CUInt
unit'
let result' :: Double
result' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
result
PaperSize -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PaperSize
size
Double -> IO Double
forall (m :: * -> *) a. Monad m => a -> m a
return Double
result'
#if defined(ENABLE_OVERLOADING)
data PaperSizeGetDefaultBottomMarginMethodInfo
instance (signature ~ (Gtk.Enums.Unit -> m Double), MonadIO m) => O.MethodInfo PaperSizeGetDefaultBottomMarginMethodInfo PaperSize signature where
overloadedMethod = paperSizeGetDefaultBottomMargin
#endif
foreign import ccall "gtk_paper_size_get_default_left_margin" gtk_paper_size_get_default_left_margin ::
Ptr PaperSize ->
CUInt ->
IO CDouble
paperSizeGetDefaultLeftMargin ::
(B.CallStack.HasCallStack, MonadIO m) =>
PaperSize
-> Gtk.Enums.Unit
-> m Double
paperSizeGetDefaultLeftMargin :: PaperSize -> Unit -> m Double
paperSizeGetDefaultLeftMargin PaperSize
size Unit
unit = IO Double -> m Double
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Double -> m Double) -> IO Double -> m Double
forall a b. (a -> b) -> a -> b
$ do
Ptr PaperSize
size' <- PaperSize -> IO (Ptr PaperSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PaperSize
size
let unit' :: CUInt
unit' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Unit -> Int) -> Unit -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Unit -> Int
forall a. Enum a => a -> Int
fromEnum) Unit
unit
CDouble
result <- Ptr PaperSize -> CUInt -> IO CDouble
gtk_paper_size_get_default_left_margin Ptr PaperSize
size' CUInt
unit'
let result' :: Double
result' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
result
PaperSize -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PaperSize
size
Double -> IO Double
forall (m :: * -> *) a. Monad m => a -> m a
return Double
result'
#if defined(ENABLE_OVERLOADING)
data PaperSizeGetDefaultLeftMarginMethodInfo
instance (signature ~ (Gtk.Enums.Unit -> m Double), MonadIO m) => O.MethodInfo PaperSizeGetDefaultLeftMarginMethodInfo PaperSize signature where
overloadedMethod = paperSizeGetDefaultLeftMargin
#endif
foreign import ccall "gtk_paper_size_get_default_right_margin" gtk_paper_size_get_default_right_margin ::
Ptr PaperSize ->
CUInt ->
IO CDouble
paperSizeGetDefaultRightMargin ::
(B.CallStack.HasCallStack, MonadIO m) =>
PaperSize
-> Gtk.Enums.Unit
-> m Double
paperSizeGetDefaultRightMargin :: PaperSize -> Unit -> m Double
paperSizeGetDefaultRightMargin PaperSize
size Unit
unit = IO Double -> m Double
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Double -> m Double) -> IO Double -> m Double
forall a b. (a -> b) -> a -> b
$ do
Ptr PaperSize
size' <- PaperSize -> IO (Ptr PaperSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PaperSize
size
let unit' :: CUInt
unit' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Unit -> Int) -> Unit -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Unit -> Int
forall a. Enum a => a -> Int
fromEnum) Unit
unit
CDouble
result <- Ptr PaperSize -> CUInt -> IO CDouble
gtk_paper_size_get_default_right_margin Ptr PaperSize
size' CUInt
unit'
let result' :: Double
result' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
result
PaperSize -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PaperSize
size
Double -> IO Double
forall (m :: * -> *) a. Monad m => a -> m a
return Double
result'
#if defined(ENABLE_OVERLOADING)
data PaperSizeGetDefaultRightMarginMethodInfo
instance (signature ~ (Gtk.Enums.Unit -> m Double), MonadIO m) => O.MethodInfo PaperSizeGetDefaultRightMarginMethodInfo PaperSize signature where
overloadedMethod = paperSizeGetDefaultRightMargin
#endif
foreign import ccall "gtk_paper_size_get_default_top_margin" gtk_paper_size_get_default_top_margin ::
Ptr PaperSize ->
CUInt ->
IO CDouble
paperSizeGetDefaultTopMargin ::
(B.CallStack.HasCallStack, MonadIO m) =>
PaperSize
-> Gtk.Enums.Unit
-> m Double
paperSizeGetDefaultTopMargin :: PaperSize -> Unit -> m Double
paperSizeGetDefaultTopMargin PaperSize
size Unit
unit = IO Double -> m Double
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Double -> m Double) -> IO Double -> m Double
forall a b. (a -> b) -> a -> b
$ do
Ptr PaperSize
size' <- PaperSize -> IO (Ptr PaperSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PaperSize
size
let unit' :: CUInt
unit' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Unit -> Int) -> Unit -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Unit -> Int
forall a. Enum a => a -> Int
fromEnum) Unit
unit
CDouble
result <- Ptr PaperSize -> CUInt -> IO CDouble
gtk_paper_size_get_default_top_margin Ptr PaperSize
size' CUInt
unit'
let result' :: Double
result' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
result
PaperSize -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PaperSize
size
Double -> IO Double
forall (m :: * -> *) a. Monad m => a -> m a
return Double
result'
#if defined(ENABLE_OVERLOADING)
data PaperSizeGetDefaultTopMarginMethodInfo
instance (signature ~ (Gtk.Enums.Unit -> m Double), MonadIO m) => O.MethodInfo PaperSizeGetDefaultTopMarginMethodInfo PaperSize signature where
overloadedMethod = paperSizeGetDefaultTopMargin
#endif
foreign import ccall "gtk_paper_size_get_display_name" gtk_paper_size_get_display_name ::
Ptr PaperSize ->
IO CString
paperSizeGetDisplayName ::
(B.CallStack.HasCallStack, MonadIO m) =>
PaperSize
-> m T.Text
paperSizeGetDisplayName :: PaperSize -> m Text
paperSizeGetDisplayName PaperSize
size = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr PaperSize
size' <- PaperSize -> IO (Ptr PaperSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PaperSize
size
Ptr CChar
result <- Ptr PaperSize -> IO (Ptr CChar)
gtk_paper_size_get_display_name Ptr PaperSize
size'
Text -> Ptr CChar -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"paperSizeGetDisplayName" Ptr CChar
result
Text
result' <- HasCallStack => Ptr CChar -> IO Text
Ptr CChar -> IO Text
cstringToText Ptr CChar
result
PaperSize -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PaperSize
size
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data PaperSizeGetDisplayNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo PaperSizeGetDisplayNameMethodInfo PaperSize signature where
overloadedMethod = paperSizeGetDisplayName
#endif
foreign import ccall "gtk_paper_size_get_height" gtk_paper_size_get_height ::
Ptr PaperSize ->
CUInt ->
IO CDouble
paperSizeGetHeight ::
(B.CallStack.HasCallStack, MonadIO m) =>
PaperSize
-> Gtk.Enums.Unit
-> m Double
paperSizeGetHeight :: PaperSize -> Unit -> m Double
paperSizeGetHeight PaperSize
size Unit
unit = IO Double -> m Double
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Double -> m Double) -> IO Double -> m Double
forall a b. (a -> b) -> a -> b
$ do
Ptr PaperSize
size' <- PaperSize -> IO (Ptr PaperSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PaperSize
size
let unit' :: CUInt
unit' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Unit -> Int) -> Unit -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Unit -> Int
forall a. Enum a => a -> Int
fromEnum) Unit
unit
CDouble
result <- Ptr PaperSize -> CUInt -> IO CDouble
gtk_paper_size_get_height Ptr PaperSize
size' CUInt
unit'
let result' :: Double
result' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
result
PaperSize -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PaperSize
size
Double -> IO Double
forall (m :: * -> *) a. Monad m => a -> m a
return Double
result'
#if defined(ENABLE_OVERLOADING)
data PaperSizeGetHeightMethodInfo
instance (signature ~ (Gtk.Enums.Unit -> m Double), MonadIO m) => O.MethodInfo PaperSizeGetHeightMethodInfo PaperSize signature where
overloadedMethod = paperSizeGetHeight
#endif
foreign import ccall "gtk_paper_size_get_name" gtk_paper_size_get_name ::
Ptr PaperSize ->
IO CString
paperSizeGetName ::
(B.CallStack.HasCallStack, MonadIO m) =>
PaperSize
-> m T.Text
paperSizeGetName :: PaperSize -> m Text
paperSizeGetName PaperSize
size = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr PaperSize
size' <- PaperSize -> IO (Ptr PaperSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PaperSize
size
Ptr CChar
result <- Ptr PaperSize -> IO (Ptr CChar)
gtk_paper_size_get_name Ptr PaperSize
size'
Text -> Ptr CChar -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"paperSizeGetName" Ptr CChar
result
Text
result' <- HasCallStack => Ptr CChar -> IO Text
Ptr CChar -> IO Text
cstringToText Ptr CChar
result
PaperSize -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PaperSize
size
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data PaperSizeGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo PaperSizeGetNameMethodInfo PaperSize signature where
overloadedMethod = paperSizeGetName
#endif
foreign import ccall "gtk_paper_size_get_ppd_name" gtk_paper_size_get_ppd_name ::
Ptr PaperSize ->
IO CString
paperSizeGetPpdName ::
(B.CallStack.HasCallStack, MonadIO m) =>
PaperSize
-> m T.Text
paperSizeGetPpdName :: PaperSize -> m Text
paperSizeGetPpdName PaperSize
size = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr PaperSize
size' <- PaperSize -> IO (Ptr PaperSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PaperSize
size
Ptr CChar
result <- Ptr PaperSize -> IO (Ptr CChar)
gtk_paper_size_get_ppd_name Ptr PaperSize
size'
Text -> Ptr CChar -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"paperSizeGetPpdName" Ptr CChar
result
Text
result' <- HasCallStack => Ptr CChar -> IO Text
Ptr CChar -> IO Text
cstringToText Ptr CChar
result
PaperSize -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PaperSize
size
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data PaperSizeGetPpdNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo PaperSizeGetPpdNameMethodInfo PaperSize signature where
overloadedMethod = paperSizeGetPpdName
#endif
foreign import ccall "gtk_paper_size_get_width" gtk_paper_size_get_width ::
Ptr PaperSize ->
CUInt ->
IO CDouble
paperSizeGetWidth ::
(B.CallStack.HasCallStack, MonadIO m) =>
PaperSize
-> Gtk.Enums.Unit
-> m Double
paperSizeGetWidth :: PaperSize -> Unit -> m Double
paperSizeGetWidth PaperSize
size Unit
unit = IO Double -> m Double
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Double -> m Double) -> IO Double -> m Double
forall a b. (a -> b) -> a -> b
$ do
Ptr PaperSize
size' <- PaperSize -> IO (Ptr PaperSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PaperSize
size
let unit' :: CUInt
unit' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Unit -> Int) -> Unit -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Unit -> Int
forall a. Enum a => a -> Int
fromEnum) Unit
unit
CDouble
result <- Ptr PaperSize -> CUInt -> IO CDouble
gtk_paper_size_get_width Ptr PaperSize
size' CUInt
unit'
let result' :: Double
result' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
result
PaperSize -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PaperSize
size
Double -> IO Double
forall (m :: * -> *) a. Monad m => a -> m a
return Double
result'
#if defined(ENABLE_OVERLOADING)
data PaperSizeGetWidthMethodInfo
instance (signature ~ (Gtk.Enums.Unit -> m Double), MonadIO m) => O.MethodInfo PaperSizeGetWidthMethodInfo PaperSize signature where
overloadedMethod = paperSizeGetWidth
#endif
foreign import ccall "gtk_paper_size_is_custom" gtk_paper_size_is_custom ::
Ptr PaperSize ->
IO CInt
paperSizeIsCustom ::
(B.CallStack.HasCallStack, MonadIO m) =>
PaperSize
-> m Bool
paperSizeIsCustom :: PaperSize -> m Bool
paperSizeIsCustom PaperSize
size = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr PaperSize
size' <- PaperSize -> IO (Ptr PaperSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PaperSize
size
CInt
result <- Ptr PaperSize -> IO CInt
gtk_paper_size_is_custom Ptr PaperSize
size'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
PaperSize -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PaperSize
size
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data PaperSizeIsCustomMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo PaperSizeIsCustomMethodInfo PaperSize signature where
overloadedMethod = paperSizeIsCustom
#endif
foreign import ccall "gtk_paper_size_is_equal" gtk_paper_size_is_equal ::
Ptr PaperSize ->
Ptr PaperSize ->
IO CInt
paperSizeIsEqual ::
(B.CallStack.HasCallStack, MonadIO m) =>
PaperSize
-> PaperSize
-> m Bool
paperSizeIsEqual :: PaperSize -> PaperSize -> m Bool
paperSizeIsEqual PaperSize
size1 PaperSize
size2 = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr PaperSize
size1' <- PaperSize -> IO (Ptr PaperSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PaperSize
size1
Ptr PaperSize
size2' <- PaperSize -> IO (Ptr PaperSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PaperSize
size2
CInt
result <- Ptr PaperSize -> Ptr PaperSize -> IO CInt
gtk_paper_size_is_equal Ptr PaperSize
size1' Ptr PaperSize
size2'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
PaperSize -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PaperSize
size1
PaperSize -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PaperSize
size2
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data PaperSizeIsEqualMethodInfo
instance (signature ~ (PaperSize -> m Bool), MonadIO m) => O.MethodInfo PaperSizeIsEqualMethodInfo PaperSize signature where
overloadedMethod = paperSizeIsEqual
#endif
foreign import ccall "gtk_paper_size_is_ipp" gtk_paper_size_is_ipp ::
Ptr PaperSize ->
IO CInt
paperSizeIsIpp ::
(B.CallStack.HasCallStack, MonadIO m) =>
PaperSize
-> m Bool
paperSizeIsIpp :: PaperSize -> m Bool
paperSizeIsIpp PaperSize
size = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr PaperSize
size' <- PaperSize -> IO (Ptr PaperSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PaperSize
size
CInt
result <- Ptr PaperSize -> IO CInt
gtk_paper_size_is_ipp Ptr PaperSize
size'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
PaperSize -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PaperSize
size
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data PaperSizeIsIppMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo PaperSizeIsIppMethodInfo PaperSize signature where
overloadedMethod = paperSizeIsIpp
#endif
foreign import ccall "gtk_paper_size_set_size" gtk_paper_size_set_size ::
Ptr PaperSize ->
CDouble ->
CDouble ->
CUInt ->
IO ()
paperSizeSetSize ::
(B.CallStack.HasCallStack, MonadIO m) =>
PaperSize
-> Double
-> Double
-> Gtk.Enums.Unit
-> m ()
paperSizeSetSize :: PaperSize -> Double -> Double -> Unit -> m ()
paperSizeSetSize PaperSize
size Double
width Double
height Unit
unit = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr PaperSize
size' <- PaperSize -> IO (Ptr PaperSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PaperSize
size
let width' :: CDouble
width' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
width
let height' :: CDouble
height' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
height
let unit' :: CUInt
unit' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Unit -> Int) -> Unit -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Unit -> Int
forall a. Enum a => a -> Int
fromEnum) Unit
unit
Ptr PaperSize -> CDouble -> CDouble -> CUInt -> IO ()
gtk_paper_size_set_size Ptr PaperSize
size' CDouble
width' CDouble
height' CUInt
unit'
PaperSize -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PaperSize
size
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PaperSizeSetSizeMethodInfo
instance (signature ~ (Double -> Double -> Gtk.Enums.Unit -> m ()), MonadIO m) => O.MethodInfo PaperSizeSetSizeMethodInfo PaperSize signature where
overloadedMethod = paperSizeSetSize
#endif
foreign import ccall "gtk_paper_size_to_gvariant" gtk_paper_size_to_gvariant ::
Ptr PaperSize ->
IO (Ptr GVariant)
paperSizeToGvariant ::
(B.CallStack.HasCallStack, MonadIO m) =>
PaperSize
-> m GVariant
paperSizeToGvariant :: PaperSize -> m GVariant
paperSizeToGvariant PaperSize
paperSize = IO GVariant -> m GVariant
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GVariant -> m GVariant) -> IO GVariant -> m GVariant
forall a b. (a -> b) -> a -> b
$ do
Ptr PaperSize
paperSize' <- PaperSize -> IO (Ptr PaperSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PaperSize
paperSize
Ptr GVariant
result <- Ptr PaperSize -> IO (Ptr GVariant)
gtk_paper_size_to_gvariant Ptr PaperSize
paperSize'
Text -> Ptr GVariant -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"paperSizeToGvariant" Ptr GVariant
result
GVariant
result' <- Ptr GVariant -> IO GVariant
B.GVariant.newGVariantFromPtr Ptr GVariant
result
PaperSize -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PaperSize
paperSize
GVariant -> IO GVariant
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
result'
#if defined(ENABLE_OVERLOADING)
data PaperSizeToGvariantMethodInfo
instance (signature ~ (m GVariant), MonadIO m) => O.MethodInfo PaperSizeToGvariantMethodInfo PaperSize signature where
overloadedMethod = paperSizeToGvariant
#endif
foreign import ccall "gtk_paper_size_to_key_file" gtk_paper_size_to_key_file ::
Ptr PaperSize ->
Ptr GLib.KeyFile.KeyFile ->
CString ->
IO ()
paperSizeToKeyFile ::
(B.CallStack.HasCallStack, MonadIO m) =>
PaperSize
-> GLib.KeyFile.KeyFile
-> T.Text
-> m ()
paperSizeToKeyFile :: PaperSize -> KeyFile -> Text -> m ()
paperSizeToKeyFile PaperSize
size KeyFile
keyFile Text
groupName = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr PaperSize
size' <- PaperSize -> IO (Ptr PaperSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PaperSize
size
Ptr KeyFile
keyFile' <- KeyFile -> IO (Ptr KeyFile)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr KeyFile
keyFile
Ptr CChar
groupName' <- Text -> IO (Ptr CChar)
textToCString Text
groupName
Ptr PaperSize -> Ptr KeyFile -> Ptr CChar -> IO ()
gtk_paper_size_to_key_file Ptr PaperSize
size' Ptr KeyFile
keyFile' Ptr CChar
groupName'
PaperSize -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PaperSize
size
KeyFile -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr KeyFile
keyFile
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
groupName'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PaperSizeToKeyFileMethodInfo
instance (signature ~ (GLib.KeyFile.KeyFile -> T.Text -> m ()), MonadIO m) => O.MethodInfo PaperSizeToKeyFileMethodInfo PaperSize signature where
overloadedMethod = paperSizeToKeyFile
#endif
foreign import ccall "gtk_paper_size_get_default" gtk_paper_size_get_default ::
IO CString
paperSizeGetDefault ::
(B.CallStack.HasCallStack, MonadIO m) =>
m T.Text
paperSizeGetDefault :: m Text
paperSizeGetDefault = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr CChar
result <- IO (Ptr CChar)
gtk_paper_size_get_default
Text -> Ptr CChar -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"paperSizeGetDefault" Ptr CChar
result
Text
result' <- HasCallStack => Ptr CChar -> IO Text
Ptr CChar -> IO Text
cstringToText Ptr CChar
result
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_paper_size_get_paper_sizes" gtk_paper_size_get_paper_sizes ::
CInt ->
IO (Ptr (GList (Ptr PaperSize)))
paperSizeGetPaperSizes ::
(B.CallStack.HasCallStack, MonadIO m) =>
Bool
-> m [PaperSize]
paperSizeGetPaperSizes :: Bool -> m [PaperSize]
paperSizeGetPaperSizes Bool
includeCustom = IO [PaperSize] -> m [PaperSize]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [PaperSize] -> m [PaperSize])
-> IO [PaperSize] -> m [PaperSize]
forall a b. (a -> b) -> a -> b
$ do
let includeCustom' :: CInt
includeCustom' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
includeCustom
Ptr (GList (Ptr PaperSize))
result <- CInt -> IO (Ptr (GList (Ptr PaperSize)))
gtk_paper_size_get_paper_sizes CInt
includeCustom'
[Ptr PaperSize]
result' <- Ptr (GList (Ptr PaperSize)) -> IO [Ptr PaperSize]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr PaperSize))
result
[PaperSize]
result'' <- (Ptr PaperSize -> IO PaperSize)
-> [Ptr PaperSize] -> IO [PaperSize]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr PaperSize -> PaperSize)
-> Ptr PaperSize -> IO PaperSize
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr PaperSize -> PaperSize
PaperSize) [Ptr PaperSize]
result'
Ptr (GList (Ptr PaperSize)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr PaperSize))
result
[PaperSize] -> IO [PaperSize]
forall (m :: * -> *) a. Monad m => a -> m a
return [PaperSize]
result''
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolvePaperSizeMethod (t :: Symbol) (o :: *) :: * where
ResolvePaperSizeMethod "copy" o = PaperSizeCopyMethodInfo
ResolvePaperSizeMethod "free" o = PaperSizeFreeMethodInfo
ResolvePaperSizeMethod "isCustom" o = PaperSizeIsCustomMethodInfo
ResolvePaperSizeMethod "isEqual" o = PaperSizeIsEqualMethodInfo
ResolvePaperSizeMethod "isIpp" o = PaperSizeIsIppMethodInfo
ResolvePaperSizeMethod "toGvariant" o = PaperSizeToGvariantMethodInfo
ResolvePaperSizeMethod "toKeyFile" o = PaperSizeToKeyFileMethodInfo
ResolvePaperSizeMethod "getDefaultBottomMargin" o = PaperSizeGetDefaultBottomMarginMethodInfo
ResolvePaperSizeMethod "getDefaultLeftMargin" o = PaperSizeGetDefaultLeftMarginMethodInfo
ResolvePaperSizeMethod "getDefaultRightMargin" o = PaperSizeGetDefaultRightMarginMethodInfo
ResolvePaperSizeMethod "getDefaultTopMargin" o = PaperSizeGetDefaultTopMarginMethodInfo
ResolvePaperSizeMethod "getDisplayName" o = PaperSizeGetDisplayNameMethodInfo
ResolvePaperSizeMethod "getHeight" o = PaperSizeGetHeightMethodInfo
ResolvePaperSizeMethod "getName" o = PaperSizeGetNameMethodInfo
ResolvePaperSizeMethod "getPpdName" o = PaperSizeGetPpdNameMethodInfo
ResolvePaperSizeMethod "getWidth" o = PaperSizeGetWidthMethodInfo
ResolvePaperSizeMethod "setSize" o = PaperSizeSetSizeMethodInfo
ResolvePaperSizeMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolvePaperSizeMethod t PaperSize, O.MethodInfo info PaperSize p) => OL.IsLabel t (PaperSize -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif