{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Pango.Structs.FontDescription
(
FontDescription(..) ,
noFontDescription ,
#if defined(ENABLE_OVERLOADING)
ResolveFontDescriptionMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
FontDescriptionBetterMatchMethodInfo ,
#endif
fontDescriptionBetterMatch ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionCopyMethodInfo ,
#endif
fontDescriptionCopy ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionCopyStaticMethodInfo ,
#endif
fontDescriptionCopyStatic ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionEqualMethodInfo ,
#endif
fontDescriptionEqual ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionFreeMethodInfo ,
#endif
fontDescriptionFree ,
fontDescriptionFromString ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionGetFamilyMethodInfo ,
#endif
fontDescriptionGetFamily ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionGetGravityMethodInfo ,
#endif
fontDescriptionGetGravity ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionGetSetFieldsMethodInfo ,
#endif
fontDescriptionGetSetFields ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionGetSizeMethodInfo ,
#endif
fontDescriptionGetSize ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionGetSizeIsAbsoluteMethodInfo,
#endif
fontDescriptionGetSizeIsAbsolute ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionGetStretchMethodInfo ,
#endif
fontDescriptionGetStretch ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionGetStyleMethodInfo ,
#endif
fontDescriptionGetStyle ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionGetVariantMethodInfo ,
#endif
fontDescriptionGetVariant ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionGetVariationsMethodInfo ,
#endif
fontDescriptionGetVariations ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionGetWeightMethodInfo ,
#endif
fontDescriptionGetWeight ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionHashMethodInfo ,
#endif
fontDescriptionHash ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionMergeMethodInfo ,
#endif
fontDescriptionMerge ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionMergeStaticMethodInfo ,
#endif
fontDescriptionMergeStatic ,
fontDescriptionNew ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionSetAbsoluteSizeMethodInfo,
#endif
fontDescriptionSetAbsoluteSize ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionSetFamilyMethodInfo ,
#endif
fontDescriptionSetFamily ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionSetFamilyStaticMethodInfo,
#endif
fontDescriptionSetFamilyStatic ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionSetGravityMethodInfo ,
#endif
fontDescriptionSetGravity ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionSetSizeMethodInfo ,
#endif
fontDescriptionSetSize ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionSetStretchMethodInfo ,
#endif
fontDescriptionSetStretch ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionSetStyleMethodInfo ,
#endif
fontDescriptionSetStyle ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionSetVariantMethodInfo ,
#endif
fontDescriptionSetVariant ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionSetVariationsMethodInfo ,
#endif
fontDescriptionSetVariations ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionSetVariationsStaticMethodInfo,
#endif
fontDescriptionSetVariationsStatic ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionSetWeightMethodInfo ,
#endif
fontDescriptionSetWeight ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionToFilenameMethodInfo ,
#endif
fontDescriptionToFilename ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionToStringMethodInfo ,
#endif
fontDescriptionToString ,
#if defined(ENABLE_OVERLOADING)
FontDescriptionUnsetFieldsMethodInfo ,
#endif
fontDescriptionUnsetFields ,
) 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.ManagedPtr as B.ManagedPtr
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 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 {-# SOURCE #-} qualified GI.Pango.Enums as Pango.Enums
import {-# SOURCE #-} qualified GI.Pango.Flags as Pango.Flags
newtype FontDescription = FontDescription (ManagedPtr FontDescription)
deriving (FontDescription -> FontDescription -> Bool
(FontDescription -> FontDescription -> Bool)
-> (FontDescription -> FontDescription -> Bool)
-> Eq FontDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FontDescription -> FontDescription -> Bool
$c/= :: FontDescription -> FontDescription -> Bool
== :: FontDescription -> FontDescription -> Bool
$c== :: FontDescription -> FontDescription -> Bool
Eq)
foreign import ccall "pango_font_description_get_type" c_pango_font_description_get_type ::
IO GType
instance BoxedObject FontDescription where
boxedType :: FontDescription -> IO GType
boxedType _ = IO GType
c_pango_font_description_get_type
instance B.GValue.IsGValue FontDescription where
toGValue :: FontDescription -> IO GValue
toGValue o :: FontDescription
o = do
GType
gtype <- IO GType
c_pango_font_description_get_type
FontDescription -> (Ptr FontDescription -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr FontDescription
o (GType
-> (GValue -> Ptr FontDescription -> IO ())
-> Ptr FontDescription
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr FontDescription -> IO ()
forall a. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
fromGValue :: GValue -> IO FontDescription
fromGValue gv :: GValue
gv = do
Ptr FontDescription
ptr <- GValue -> IO (Ptr FontDescription)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr FontDescription)
(ManagedPtr FontDescription -> FontDescription)
-> Ptr FontDescription -> IO FontDescription
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr FontDescription -> FontDescription
FontDescription Ptr FontDescription
ptr
noFontDescription :: Maybe FontDescription
noFontDescription :: Maybe FontDescription
noFontDescription = Maybe FontDescription
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList FontDescription
type instance O.AttributeList FontDescription = FontDescriptionAttributeList
type FontDescriptionAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "pango_font_description_new" pango_font_description_new ::
IO (Ptr FontDescription)
fontDescriptionNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m FontDescription
fontDescriptionNew :: m FontDescription
fontDescriptionNew = IO FontDescription -> m FontDescription
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FontDescription -> m FontDescription)
-> IO FontDescription -> m FontDescription
forall a b. (a -> b) -> a -> b
$ do
Ptr FontDescription
result <- IO (Ptr FontDescription)
pango_font_description_new
Text -> Ptr FontDescription -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fontDescriptionNew" Ptr FontDescription
result
FontDescription
result' <- ((ManagedPtr FontDescription -> FontDescription)
-> Ptr FontDescription -> IO FontDescription
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr FontDescription -> FontDescription
FontDescription) Ptr FontDescription
result
FontDescription -> IO FontDescription
forall (m :: * -> *) a. Monad m => a -> m a
return FontDescription
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "pango_font_description_better_match" pango_font_description_better_match ::
Ptr FontDescription ->
Ptr FontDescription ->
Ptr FontDescription ->
IO CInt
fontDescriptionBetterMatch ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> Maybe (FontDescription)
-> FontDescription
-> m Bool
fontDescriptionBetterMatch :: FontDescription
-> Maybe FontDescription -> FontDescription -> m Bool
fontDescriptionBetterMatch desc :: FontDescription
desc oldMatch :: Maybe FontDescription
oldMatch newMatch :: FontDescription
newMatch = 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 FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
Ptr FontDescription
maybeOldMatch <- case Maybe FontDescription
oldMatch of
Nothing -> Ptr FontDescription -> IO (Ptr FontDescription)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FontDescription
forall a. Ptr a
nullPtr
Just jOldMatch :: FontDescription
jOldMatch -> do
Ptr FontDescription
jOldMatch' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
jOldMatch
Ptr FontDescription -> IO (Ptr FontDescription)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FontDescription
jOldMatch'
Ptr FontDescription
newMatch' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
newMatch
CInt
result <- Ptr FontDescription
-> Ptr FontDescription -> Ptr FontDescription -> IO CInt
pango_font_description_better_match Ptr FontDescription
desc' Ptr FontDescription
maybeOldMatch Ptr FontDescription
newMatch'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
Maybe FontDescription -> (FontDescription -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe FontDescription
oldMatch FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
newMatch
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data FontDescriptionBetterMatchMethodInfo
instance (signature ~ (Maybe (FontDescription) -> FontDescription -> m Bool), MonadIO m) => O.MethodInfo FontDescriptionBetterMatchMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionBetterMatch
#endif
foreign import ccall "pango_font_description_copy" pango_font_description_copy ::
Ptr FontDescription ->
IO (Ptr FontDescription)
fontDescriptionCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> m (Maybe FontDescription)
fontDescriptionCopy :: FontDescription -> m (Maybe FontDescription)
fontDescriptionCopy desc :: FontDescription
desc = IO (Maybe FontDescription) -> m (Maybe FontDescription)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe FontDescription) -> m (Maybe FontDescription))
-> IO (Maybe FontDescription) -> m (Maybe FontDescription)
forall a b. (a -> b) -> a -> b
$ do
Ptr FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
Ptr FontDescription
result <- Ptr FontDescription -> IO (Ptr FontDescription)
pango_font_description_copy Ptr FontDescription
desc'
Maybe FontDescription
maybeResult <- Ptr FontDescription
-> (Ptr FontDescription -> IO FontDescription)
-> IO (Maybe FontDescription)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr FontDescription
result ((Ptr FontDescription -> IO FontDescription)
-> IO (Maybe FontDescription))
-> (Ptr FontDescription -> IO FontDescription)
-> IO (Maybe FontDescription)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr FontDescription
result' -> do
FontDescription
result'' <- ((ManagedPtr FontDescription -> FontDescription)
-> Ptr FontDescription -> IO FontDescription
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr FontDescription -> FontDescription
FontDescription) Ptr FontDescription
result'
FontDescription -> IO FontDescription
forall (m :: * -> *) a. Monad m => a -> m a
return FontDescription
result''
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
Maybe FontDescription -> IO (Maybe FontDescription)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe FontDescription
maybeResult
#if defined(ENABLE_OVERLOADING)
data FontDescriptionCopyMethodInfo
instance (signature ~ (m (Maybe FontDescription)), MonadIO m) => O.MethodInfo FontDescriptionCopyMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionCopy
#endif
foreign import ccall "pango_font_description_copy_static" pango_font_description_copy_static ::
Ptr FontDescription ->
IO (Ptr FontDescription)
fontDescriptionCopyStatic ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> m (Maybe FontDescription)
fontDescriptionCopyStatic :: FontDescription -> m (Maybe FontDescription)
fontDescriptionCopyStatic desc :: FontDescription
desc = IO (Maybe FontDescription) -> m (Maybe FontDescription)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe FontDescription) -> m (Maybe FontDescription))
-> IO (Maybe FontDescription) -> m (Maybe FontDescription)
forall a b. (a -> b) -> a -> b
$ do
Ptr FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
Ptr FontDescription
result <- Ptr FontDescription -> IO (Ptr FontDescription)
pango_font_description_copy_static Ptr FontDescription
desc'
Maybe FontDescription
maybeResult <- Ptr FontDescription
-> (Ptr FontDescription -> IO FontDescription)
-> IO (Maybe FontDescription)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr FontDescription
result ((Ptr FontDescription -> IO FontDescription)
-> IO (Maybe FontDescription))
-> (Ptr FontDescription -> IO FontDescription)
-> IO (Maybe FontDescription)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr FontDescription
result' -> do
FontDescription
result'' <- ((ManagedPtr FontDescription -> FontDescription)
-> Ptr FontDescription -> IO FontDescription
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr FontDescription -> FontDescription
FontDescription) Ptr FontDescription
result'
FontDescription -> IO FontDescription
forall (m :: * -> *) a. Monad m => a -> m a
return FontDescription
result''
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
Maybe FontDescription -> IO (Maybe FontDescription)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe FontDescription
maybeResult
#if defined(ENABLE_OVERLOADING)
data FontDescriptionCopyStaticMethodInfo
instance (signature ~ (m (Maybe FontDescription)), MonadIO m) => O.MethodInfo FontDescriptionCopyStaticMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionCopyStatic
#endif
foreign import ccall "pango_font_description_equal" pango_font_description_equal ::
Ptr FontDescription ->
Ptr FontDescription ->
IO CInt
fontDescriptionEqual ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> FontDescription
-> m Bool
fontDescriptionEqual :: FontDescription -> FontDescription -> m Bool
fontDescriptionEqual desc1 :: FontDescription
desc1 desc2 :: FontDescription
desc2 = 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 FontDescription
desc1' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc1
Ptr FontDescription
desc2' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc2
CInt
result <- Ptr FontDescription -> Ptr FontDescription -> IO CInt
pango_font_description_equal Ptr FontDescription
desc1' Ptr FontDescription
desc2'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc1
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc2
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data FontDescriptionEqualMethodInfo
instance (signature ~ (FontDescription -> m Bool), MonadIO m) => O.MethodInfo FontDescriptionEqualMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionEqual
#endif
foreign import ccall "pango_font_description_free" pango_font_description_free ::
Ptr FontDescription ->
IO ()
fontDescriptionFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> m ()
fontDescriptionFree :: FontDescription -> m ()
fontDescriptionFree desc :: FontDescription
desc = 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 FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
Ptr FontDescription -> IO ()
pango_font_description_free Ptr FontDescription
desc'
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FontDescriptionFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo FontDescriptionFreeMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionFree
#endif
foreign import ccall "pango_font_description_get_family" pango_font_description_get_family ::
Ptr FontDescription ->
IO CString
fontDescriptionGetFamily ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> m (Maybe T.Text)
fontDescriptionGetFamily :: FontDescription -> m (Maybe Text)
fontDescriptionGetFamily desc :: FontDescription
desc = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
CString
result <- Ptr FontDescription -> IO CString
pango_font_description_get_family Ptr FontDescription
desc'
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \result' :: CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data FontDescriptionGetFamilyMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m) => O.MethodInfo FontDescriptionGetFamilyMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionGetFamily
#endif
foreign import ccall "pango_font_description_get_gravity" pango_font_description_get_gravity ::
Ptr FontDescription ->
IO CUInt
fontDescriptionGetGravity ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> m Pango.Enums.Gravity
fontDescriptionGetGravity :: FontDescription -> m Gravity
fontDescriptionGetGravity desc :: FontDescription
desc = IO Gravity -> m Gravity
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Gravity -> m Gravity) -> IO Gravity -> m Gravity
forall a b. (a -> b) -> a -> b
$ do
Ptr FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
CUInt
result <- Ptr FontDescription -> IO CUInt
pango_font_description_get_gravity Ptr FontDescription
desc'
let result' :: Gravity
result' = (Int -> Gravity
forall a. Enum a => Int -> a
toEnum (Int -> Gravity) -> (CUInt -> Int) -> CUInt -> Gravity
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
Gravity -> IO Gravity
forall (m :: * -> *) a. Monad m => a -> m a
return Gravity
result'
#if defined(ENABLE_OVERLOADING)
data FontDescriptionGetGravityMethodInfo
instance (signature ~ (m Pango.Enums.Gravity), MonadIO m) => O.MethodInfo FontDescriptionGetGravityMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionGetGravity
#endif
foreign import ccall "pango_font_description_get_set_fields" pango_font_description_get_set_fields ::
Ptr FontDescription ->
IO CUInt
fontDescriptionGetSetFields ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> m [Pango.Flags.FontMask]
fontDescriptionGetSetFields :: FontDescription -> m [FontMask]
fontDescriptionGetSetFields desc :: FontDescription
desc = IO [FontMask] -> m [FontMask]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [FontMask] -> m [FontMask]) -> IO [FontMask] -> m [FontMask]
forall a b. (a -> b) -> a -> b
$ do
Ptr FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
CUInt
result <- Ptr FontDescription -> IO CUInt
pango_font_description_get_set_fields Ptr FontDescription
desc'
let result' :: [FontMask]
result' = CUInt -> [FontMask]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
[FontMask] -> IO [FontMask]
forall (m :: * -> *) a. Monad m => a -> m a
return [FontMask]
result'
#if defined(ENABLE_OVERLOADING)
data FontDescriptionGetSetFieldsMethodInfo
instance (signature ~ (m [Pango.Flags.FontMask]), MonadIO m) => O.MethodInfo FontDescriptionGetSetFieldsMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionGetSetFields
#endif
foreign import ccall "pango_font_description_get_size" pango_font_description_get_size ::
Ptr FontDescription ->
IO Int32
fontDescriptionGetSize ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> m Int32
fontDescriptionGetSize :: FontDescription -> m Int32
fontDescriptionGetSize desc :: FontDescription
desc = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
Int32
result <- Ptr FontDescription -> IO Int32
pango_font_description_get_size Ptr FontDescription
desc'
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data FontDescriptionGetSizeMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.MethodInfo FontDescriptionGetSizeMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionGetSize
#endif
foreign import ccall "pango_font_description_get_size_is_absolute" pango_font_description_get_size_is_absolute ::
Ptr FontDescription ->
IO CInt
fontDescriptionGetSizeIsAbsolute ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> m Bool
fontDescriptionGetSizeIsAbsolute :: FontDescription -> m Bool
fontDescriptionGetSizeIsAbsolute desc :: FontDescription
desc = 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 FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
CInt
result <- Ptr FontDescription -> IO CInt
pango_font_description_get_size_is_absolute Ptr FontDescription
desc'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data FontDescriptionGetSizeIsAbsoluteMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo FontDescriptionGetSizeIsAbsoluteMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionGetSizeIsAbsolute
#endif
foreign import ccall "pango_font_description_get_stretch" pango_font_description_get_stretch ::
Ptr FontDescription ->
IO CUInt
fontDescriptionGetStretch ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> m Pango.Enums.Stretch
fontDescriptionGetStretch :: FontDescription -> m Stretch
fontDescriptionGetStretch desc :: FontDescription
desc = IO Stretch -> m Stretch
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Stretch -> m Stretch) -> IO Stretch -> m Stretch
forall a b. (a -> b) -> a -> b
$ do
Ptr FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
CUInt
result <- Ptr FontDescription -> IO CUInt
pango_font_description_get_stretch Ptr FontDescription
desc'
let result' :: Stretch
result' = (Int -> Stretch
forall a. Enum a => Int -> a
toEnum (Int -> Stretch) -> (CUInt -> Int) -> CUInt -> Stretch
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
Stretch -> IO Stretch
forall (m :: * -> *) a. Monad m => a -> m a
return Stretch
result'
#if defined(ENABLE_OVERLOADING)
data FontDescriptionGetStretchMethodInfo
instance (signature ~ (m Pango.Enums.Stretch), MonadIO m) => O.MethodInfo FontDescriptionGetStretchMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionGetStretch
#endif
foreign import ccall "pango_font_description_get_style" pango_font_description_get_style ::
Ptr FontDescription ->
IO CUInt
fontDescriptionGetStyle ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> m Pango.Enums.Style
fontDescriptionGetStyle :: FontDescription -> m Style
fontDescriptionGetStyle desc :: FontDescription
desc = IO Style -> m Style
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Style -> m Style) -> IO Style -> m Style
forall a b. (a -> b) -> a -> b
$ do
Ptr FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
CUInt
result <- Ptr FontDescription -> IO CUInt
pango_font_description_get_style Ptr FontDescription
desc'
let result' :: Style
result' = (Int -> Style
forall a. Enum a => Int -> a
toEnum (Int -> Style) -> (CUInt -> Int) -> CUInt -> Style
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
Style -> IO Style
forall (m :: * -> *) a. Monad m => a -> m a
return Style
result'
#if defined(ENABLE_OVERLOADING)
data FontDescriptionGetStyleMethodInfo
instance (signature ~ (m Pango.Enums.Style), MonadIO m) => O.MethodInfo FontDescriptionGetStyleMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionGetStyle
#endif
foreign import ccall "pango_font_description_get_variant" pango_font_description_get_variant ::
Ptr FontDescription ->
IO CUInt
fontDescriptionGetVariant ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> m Pango.Enums.Variant
fontDescriptionGetVariant :: FontDescription -> m Variant
fontDescriptionGetVariant desc :: FontDescription
desc = IO Variant -> m Variant
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Variant -> m Variant) -> IO Variant -> m Variant
forall a b. (a -> b) -> a -> b
$ do
Ptr FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
CUInt
result <- Ptr FontDescription -> IO CUInt
pango_font_description_get_variant Ptr FontDescription
desc'
let result' :: Variant
result' = (Int -> Variant
forall a. Enum a => Int -> a
toEnum (Int -> Variant) -> (CUInt -> Int) -> CUInt -> Variant
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
Variant -> IO Variant
forall (m :: * -> *) a. Monad m => a -> m a
return Variant
result'
#if defined(ENABLE_OVERLOADING)
data FontDescriptionGetVariantMethodInfo
instance (signature ~ (m Pango.Enums.Variant), MonadIO m) => O.MethodInfo FontDescriptionGetVariantMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionGetVariant
#endif
foreign import ccall "pango_font_description_get_variations" pango_font_description_get_variations ::
Ptr FontDescription ->
IO CString
fontDescriptionGetVariations ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> m (Maybe T.Text)
fontDescriptionGetVariations :: FontDescription -> m (Maybe Text)
fontDescriptionGetVariations desc :: FontDescription
desc = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
CString
result <- Ptr FontDescription -> IO CString
pango_font_description_get_variations Ptr FontDescription
desc'
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \result' :: CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data FontDescriptionGetVariationsMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m) => O.MethodInfo FontDescriptionGetVariationsMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionGetVariations
#endif
foreign import ccall "pango_font_description_get_weight" pango_font_description_get_weight ::
Ptr FontDescription ->
IO CUInt
fontDescriptionGetWeight ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> m Pango.Enums.Weight
fontDescriptionGetWeight :: FontDescription -> m Weight
fontDescriptionGetWeight desc :: FontDescription
desc = IO Weight -> m Weight
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Weight -> m Weight) -> IO Weight -> m Weight
forall a b. (a -> b) -> a -> b
$ do
Ptr FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
CUInt
result <- Ptr FontDescription -> IO CUInt
pango_font_description_get_weight Ptr FontDescription
desc'
let result' :: Weight
result' = (Int -> Weight
forall a. Enum a => Int -> a
toEnum (Int -> Weight) -> (CUInt -> Int) -> CUInt -> Weight
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
Weight -> IO Weight
forall (m :: * -> *) a. Monad m => a -> m a
return Weight
result'
#if defined(ENABLE_OVERLOADING)
data FontDescriptionGetWeightMethodInfo
instance (signature ~ (m Pango.Enums.Weight), MonadIO m) => O.MethodInfo FontDescriptionGetWeightMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionGetWeight
#endif
foreign import ccall "pango_font_description_hash" pango_font_description_hash ::
Ptr FontDescription ->
IO Word32
fontDescriptionHash ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> m Word32
fontDescriptionHash :: FontDescription -> m Word32
fontDescriptionHash desc :: FontDescription
desc = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
Word32
result <- Ptr FontDescription -> IO Word32
pango_font_description_hash Ptr FontDescription
desc'
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data FontDescriptionHashMethodInfo
instance (signature ~ (m Word32), MonadIO m) => O.MethodInfo FontDescriptionHashMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionHash
#endif
foreign import ccall "pango_font_description_merge" pango_font_description_merge ::
Ptr FontDescription ->
Ptr FontDescription ->
CInt ->
IO ()
fontDescriptionMerge ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> Maybe (FontDescription)
-> Bool
-> m ()
fontDescriptionMerge :: FontDescription -> Maybe FontDescription -> Bool -> m ()
fontDescriptionMerge desc :: FontDescription
desc descToMerge :: Maybe FontDescription
descToMerge replaceExisting :: Bool
replaceExisting = 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 FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
Ptr FontDescription
maybeDescToMerge <- case Maybe FontDescription
descToMerge of
Nothing -> Ptr FontDescription -> IO (Ptr FontDescription)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FontDescription
forall a. Ptr a
nullPtr
Just jDescToMerge :: FontDescription
jDescToMerge -> do
Ptr FontDescription
jDescToMerge' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
jDescToMerge
Ptr FontDescription -> IO (Ptr FontDescription)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FontDescription
jDescToMerge'
let replaceExisting' :: CInt
replaceExisting' = (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
replaceExisting
Ptr FontDescription -> Ptr FontDescription -> CInt -> IO ()
pango_font_description_merge Ptr FontDescription
desc' Ptr FontDescription
maybeDescToMerge CInt
replaceExisting'
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
Maybe FontDescription -> (FontDescription -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe FontDescription
descToMerge FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FontDescriptionMergeMethodInfo
instance (signature ~ (Maybe (FontDescription) -> Bool -> m ()), MonadIO m) => O.MethodInfo FontDescriptionMergeMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionMerge
#endif
foreign import ccall "pango_font_description_merge_static" pango_font_description_merge_static ::
Ptr FontDescription ->
Ptr FontDescription ->
CInt ->
IO ()
fontDescriptionMergeStatic ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> FontDescription
-> Bool
-> m ()
fontDescriptionMergeStatic :: FontDescription -> FontDescription -> Bool -> m ()
fontDescriptionMergeStatic desc :: FontDescription
desc descToMerge :: FontDescription
descToMerge replaceExisting :: Bool
replaceExisting = 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 FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
Ptr FontDescription
descToMerge' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
descToMerge
let replaceExisting' :: CInt
replaceExisting' = (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
replaceExisting
Ptr FontDescription -> Ptr FontDescription -> CInt -> IO ()
pango_font_description_merge_static Ptr FontDescription
desc' Ptr FontDescription
descToMerge' CInt
replaceExisting'
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
descToMerge
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FontDescriptionMergeStaticMethodInfo
instance (signature ~ (FontDescription -> Bool -> m ()), MonadIO m) => O.MethodInfo FontDescriptionMergeStaticMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionMergeStatic
#endif
foreign import ccall "pango_font_description_set_absolute_size" pango_font_description_set_absolute_size ::
Ptr FontDescription ->
CDouble ->
IO ()
fontDescriptionSetAbsoluteSize ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> Double
-> m ()
fontDescriptionSetAbsoluteSize :: FontDescription -> Double -> m ()
fontDescriptionSetAbsoluteSize desc :: FontDescription
desc size :: Double
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 FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
let size' :: CDouble
size' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
size
Ptr FontDescription -> CDouble -> IO ()
pango_font_description_set_absolute_size Ptr FontDescription
desc' CDouble
size'
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FontDescriptionSetAbsoluteSizeMethodInfo
instance (signature ~ (Double -> m ()), MonadIO m) => O.MethodInfo FontDescriptionSetAbsoluteSizeMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionSetAbsoluteSize
#endif
foreign import ccall "pango_font_description_set_family" pango_font_description_set_family ::
Ptr FontDescription ->
CString ->
IO ()
fontDescriptionSetFamily ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> T.Text
-> m ()
fontDescriptionSetFamily :: FontDescription -> Text -> m ()
fontDescriptionSetFamily desc :: FontDescription
desc family :: Text
family = 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 FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
CString
family' <- Text -> IO CString
textToCString Text
family
Ptr FontDescription -> CString -> IO ()
pango_font_description_set_family Ptr FontDescription
desc' CString
family'
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
family'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FontDescriptionSetFamilyMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m) => O.MethodInfo FontDescriptionSetFamilyMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionSetFamily
#endif
foreign import ccall "pango_font_description_set_family_static" pango_font_description_set_family_static ::
Ptr FontDescription ->
CString ->
IO ()
fontDescriptionSetFamilyStatic ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> T.Text
-> m ()
fontDescriptionSetFamilyStatic :: FontDescription -> Text -> m ()
fontDescriptionSetFamilyStatic desc :: FontDescription
desc family :: Text
family = 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 FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
CString
family' <- Text -> IO CString
textToCString Text
family
Ptr FontDescription -> CString -> IO ()
pango_font_description_set_family_static Ptr FontDescription
desc' CString
family'
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
family'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FontDescriptionSetFamilyStaticMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m) => O.MethodInfo FontDescriptionSetFamilyStaticMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionSetFamilyStatic
#endif
foreign import ccall "pango_font_description_set_gravity" pango_font_description_set_gravity ::
Ptr FontDescription ->
CUInt ->
IO ()
fontDescriptionSetGravity ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> Pango.Enums.Gravity
-> m ()
fontDescriptionSetGravity :: FontDescription -> Gravity -> m ()
fontDescriptionSetGravity desc :: FontDescription
desc gravity :: Gravity
gravity = 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 FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
let gravity' :: CUInt
gravity' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Gravity -> Int) -> Gravity -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Gravity -> Int
forall a. Enum a => a -> Int
fromEnum) Gravity
gravity
Ptr FontDescription -> CUInt -> IO ()
pango_font_description_set_gravity Ptr FontDescription
desc' CUInt
gravity'
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FontDescriptionSetGravityMethodInfo
instance (signature ~ (Pango.Enums.Gravity -> m ()), MonadIO m) => O.MethodInfo FontDescriptionSetGravityMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionSetGravity
#endif
foreign import ccall "pango_font_description_set_size" pango_font_description_set_size ::
Ptr FontDescription ->
Int32 ->
IO ()
fontDescriptionSetSize ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> Int32
-> m ()
fontDescriptionSetSize :: FontDescription -> Int32 -> m ()
fontDescriptionSetSize desc :: FontDescription
desc size :: Int32
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 FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
Ptr FontDescription -> Int32 -> IO ()
pango_font_description_set_size Ptr FontDescription
desc' Int32
size
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FontDescriptionSetSizeMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m) => O.MethodInfo FontDescriptionSetSizeMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionSetSize
#endif
foreign import ccall "pango_font_description_set_stretch" pango_font_description_set_stretch ::
Ptr FontDescription ->
CUInt ->
IO ()
fontDescriptionSetStretch ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> Pango.Enums.Stretch
-> m ()
fontDescriptionSetStretch :: FontDescription -> Stretch -> m ()
fontDescriptionSetStretch desc :: FontDescription
desc stretch :: Stretch
stretch = 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 FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
let stretch' :: CUInt
stretch' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Stretch -> Int) -> Stretch -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Stretch -> Int
forall a. Enum a => a -> Int
fromEnum) Stretch
stretch
Ptr FontDescription -> CUInt -> IO ()
pango_font_description_set_stretch Ptr FontDescription
desc' CUInt
stretch'
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FontDescriptionSetStretchMethodInfo
instance (signature ~ (Pango.Enums.Stretch -> m ()), MonadIO m) => O.MethodInfo FontDescriptionSetStretchMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionSetStretch
#endif
foreign import ccall "pango_font_description_set_style" pango_font_description_set_style ::
Ptr FontDescription ->
CUInt ->
IO ()
fontDescriptionSetStyle ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> Pango.Enums.Style
-> m ()
fontDescriptionSetStyle :: FontDescription -> Style -> m ()
fontDescriptionSetStyle desc :: FontDescription
desc style :: Style
style = 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 FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
let style' :: CUInt
style' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Style -> Int) -> Style -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Style -> Int
forall a. Enum a => a -> Int
fromEnum) Style
style
Ptr FontDescription -> CUInt -> IO ()
pango_font_description_set_style Ptr FontDescription
desc' CUInt
style'
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FontDescriptionSetStyleMethodInfo
instance (signature ~ (Pango.Enums.Style -> m ()), MonadIO m) => O.MethodInfo FontDescriptionSetStyleMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionSetStyle
#endif
foreign import ccall "pango_font_description_set_variant" pango_font_description_set_variant ::
Ptr FontDescription ->
CUInt ->
IO ()
fontDescriptionSetVariant ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> Pango.Enums.Variant
-> m ()
fontDescriptionSetVariant :: FontDescription -> Variant -> m ()
fontDescriptionSetVariant desc :: FontDescription
desc variant :: Variant
variant = 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 FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
let variant' :: CUInt
variant' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Variant -> Int) -> Variant -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Variant -> Int
forall a. Enum a => a -> Int
fromEnum) Variant
variant
Ptr FontDescription -> CUInt -> IO ()
pango_font_description_set_variant Ptr FontDescription
desc' CUInt
variant'
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FontDescriptionSetVariantMethodInfo
instance (signature ~ (Pango.Enums.Variant -> m ()), MonadIO m) => O.MethodInfo FontDescriptionSetVariantMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionSetVariant
#endif
foreign import ccall "pango_font_description_set_variations" pango_font_description_set_variations ::
Ptr FontDescription ->
CString ->
IO ()
fontDescriptionSetVariations ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> T.Text
-> m ()
fontDescriptionSetVariations :: FontDescription -> Text -> m ()
fontDescriptionSetVariations desc :: FontDescription
desc settings :: Text
settings = 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 FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
CString
settings' <- Text -> IO CString
textToCString Text
settings
Ptr FontDescription -> CString -> IO ()
pango_font_description_set_variations Ptr FontDescription
desc' CString
settings'
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
settings'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FontDescriptionSetVariationsMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m) => O.MethodInfo FontDescriptionSetVariationsMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionSetVariations
#endif
foreign import ccall "pango_font_description_set_variations_static" pango_font_description_set_variations_static ::
Ptr FontDescription ->
CString ->
IO ()
fontDescriptionSetVariationsStatic ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> T.Text
-> m ()
fontDescriptionSetVariationsStatic :: FontDescription -> Text -> m ()
fontDescriptionSetVariationsStatic desc :: FontDescription
desc settings :: Text
settings = 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 FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
CString
settings' <- Text -> IO CString
textToCString Text
settings
Ptr FontDescription -> CString -> IO ()
pango_font_description_set_variations_static Ptr FontDescription
desc' CString
settings'
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
settings'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FontDescriptionSetVariationsStaticMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m) => O.MethodInfo FontDescriptionSetVariationsStaticMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionSetVariationsStatic
#endif
foreign import ccall "pango_font_description_set_weight" pango_font_description_set_weight ::
Ptr FontDescription ->
CUInt ->
IO ()
fontDescriptionSetWeight ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> Pango.Enums.Weight
-> m ()
fontDescriptionSetWeight :: FontDescription -> Weight -> m ()
fontDescriptionSetWeight desc :: FontDescription
desc weight :: Weight
weight = 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 FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
let weight' :: CUInt
weight' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Weight -> Int) -> Weight -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Weight -> Int
forall a. Enum a => a -> Int
fromEnum) Weight
weight
Ptr FontDescription -> CUInt -> IO ()
pango_font_description_set_weight Ptr FontDescription
desc' CUInt
weight'
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FontDescriptionSetWeightMethodInfo
instance (signature ~ (Pango.Enums.Weight -> m ()), MonadIO m) => O.MethodInfo FontDescriptionSetWeightMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionSetWeight
#endif
foreign import ccall "pango_font_description_to_filename" pango_font_description_to_filename ::
Ptr FontDescription ->
IO CString
fontDescriptionToFilename ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> m T.Text
fontDescriptionToFilename :: FontDescription -> m Text
fontDescriptionToFilename desc :: FontDescription
desc = 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 FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
CString
result <- Ptr FontDescription -> IO CString
pango_font_description_to_filename Ptr FontDescription
desc'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fontDescriptionToFilename" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data FontDescriptionToFilenameMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo FontDescriptionToFilenameMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionToFilename
#endif
foreign import ccall "pango_font_description_to_string" pango_font_description_to_string ::
Ptr FontDescription ->
IO CString
fontDescriptionToString ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> m T.Text
fontDescriptionToString :: FontDescription -> m Text
fontDescriptionToString desc :: FontDescription
desc = 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 FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
CString
result <- Ptr FontDescription -> IO CString
pango_font_description_to_string Ptr FontDescription
desc'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fontDescriptionToString" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data FontDescriptionToStringMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo FontDescriptionToStringMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionToString
#endif
foreign import ccall "pango_font_description_unset_fields" pango_font_description_unset_fields ::
Ptr FontDescription ->
CUInt ->
IO ()
fontDescriptionUnsetFields ::
(B.CallStack.HasCallStack, MonadIO m) =>
FontDescription
-> [Pango.Flags.FontMask]
-> m ()
fontDescriptionUnsetFields :: FontDescription -> [FontMask] -> m ()
fontDescriptionUnsetFields desc :: FontDescription
desc toUnset :: [FontMask]
toUnset = 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 FontDescription
desc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
desc
let toUnset' :: CUInt
toUnset' = [FontMask] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [FontMask]
toUnset
Ptr FontDescription -> CUInt -> IO ()
pango_font_description_unset_fields Ptr FontDescription
desc' CUInt
toUnset'
FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontDescription
desc
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FontDescriptionUnsetFieldsMethodInfo
instance (signature ~ ([Pango.Flags.FontMask] -> m ()), MonadIO m) => O.MethodInfo FontDescriptionUnsetFieldsMethodInfo FontDescription signature where
overloadedMethod = fontDescriptionUnsetFields
#endif
foreign import ccall "pango_font_description_from_string" pango_font_description_from_string ::
CString ->
IO (Ptr FontDescription)
fontDescriptionFromString ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m FontDescription
fontDescriptionFromString :: Text -> m FontDescription
fontDescriptionFromString str :: Text
str = IO FontDescription -> m FontDescription
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FontDescription -> m FontDescription)
-> IO FontDescription -> m FontDescription
forall a b. (a -> b) -> a -> b
$ do
CString
str' <- Text -> IO CString
textToCString Text
str
Ptr FontDescription
result <- CString -> IO (Ptr FontDescription)
pango_font_description_from_string CString
str'
Text -> Ptr FontDescription -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fontDescriptionFromString" Ptr FontDescription
result
FontDescription
result' <- ((ManagedPtr FontDescription -> FontDescription)
-> Ptr FontDescription -> IO FontDescription
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr FontDescription -> FontDescription
FontDescription) Ptr FontDescription
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
str'
FontDescription -> IO FontDescription
forall (m :: * -> *) a. Monad m => a -> m a
return FontDescription
result'
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveFontDescriptionMethod (t :: Symbol) (o :: *) :: * where
ResolveFontDescriptionMethod "betterMatch" o = FontDescriptionBetterMatchMethodInfo
ResolveFontDescriptionMethod "copy" o = FontDescriptionCopyMethodInfo
ResolveFontDescriptionMethod "copyStatic" o = FontDescriptionCopyStaticMethodInfo
ResolveFontDescriptionMethod "equal" o = FontDescriptionEqualMethodInfo
ResolveFontDescriptionMethod "free" o = FontDescriptionFreeMethodInfo
ResolveFontDescriptionMethod "hash" o = FontDescriptionHashMethodInfo
ResolveFontDescriptionMethod "merge" o = FontDescriptionMergeMethodInfo
ResolveFontDescriptionMethod "mergeStatic" o = FontDescriptionMergeStaticMethodInfo
ResolveFontDescriptionMethod "toFilename" o = FontDescriptionToFilenameMethodInfo
ResolveFontDescriptionMethod "toString" o = FontDescriptionToStringMethodInfo
ResolveFontDescriptionMethod "unsetFields" o = FontDescriptionUnsetFieldsMethodInfo
ResolveFontDescriptionMethod "getFamily" o = FontDescriptionGetFamilyMethodInfo
ResolveFontDescriptionMethod "getGravity" o = FontDescriptionGetGravityMethodInfo
ResolveFontDescriptionMethod "getSetFields" o = FontDescriptionGetSetFieldsMethodInfo
ResolveFontDescriptionMethod "getSize" o = FontDescriptionGetSizeMethodInfo
ResolveFontDescriptionMethod "getSizeIsAbsolute" o = FontDescriptionGetSizeIsAbsoluteMethodInfo
ResolveFontDescriptionMethod "getStretch" o = FontDescriptionGetStretchMethodInfo
ResolveFontDescriptionMethod "getStyle" o = FontDescriptionGetStyleMethodInfo
ResolveFontDescriptionMethod "getVariant" o = FontDescriptionGetVariantMethodInfo
ResolveFontDescriptionMethod "getVariations" o = FontDescriptionGetVariationsMethodInfo
ResolveFontDescriptionMethod "getWeight" o = FontDescriptionGetWeightMethodInfo
ResolveFontDescriptionMethod "setAbsoluteSize" o = FontDescriptionSetAbsoluteSizeMethodInfo
ResolveFontDescriptionMethod "setFamily" o = FontDescriptionSetFamilyMethodInfo
ResolveFontDescriptionMethod "setFamilyStatic" o = FontDescriptionSetFamilyStaticMethodInfo
ResolveFontDescriptionMethod "setGravity" o = FontDescriptionSetGravityMethodInfo
ResolveFontDescriptionMethod "setSize" o = FontDescriptionSetSizeMethodInfo
ResolveFontDescriptionMethod "setStretch" o = FontDescriptionSetStretchMethodInfo
ResolveFontDescriptionMethod "setStyle" o = FontDescriptionSetStyleMethodInfo
ResolveFontDescriptionMethod "setVariant" o = FontDescriptionSetVariantMethodInfo
ResolveFontDescriptionMethod "setVariations" o = FontDescriptionSetVariationsMethodInfo
ResolveFontDescriptionMethod "setVariationsStatic" o = FontDescriptionSetVariationsStaticMethodInfo
ResolveFontDescriptionMethod "setWeight" o = FontDescriptionSetWeightMethodInfo
ResolveFontDescriptionMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFontDescriptionMethod t FontDescription, O.MethodInfo info FontDescription p) => OL.IsLabel t (FontDescription -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif