{-# LANGUAGE TypeApplications #-}
#if !defined(__HADDOCK_VERSION__)
#define ENABLE_OVERLOADING
#endif
module GI.Pango.Objects.Context
(
Context(..) ,
IsContext ,
toContext ,
#if defined(ENABLE_OVERLOADING)
ResolveContextMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ContextChangedMethodInfo ,
#endif
contextChanged ,
#if defined(ENABLE_OVERLOADING)
ContextGetBaseDirMethodInfo ,
#endif
contextGetBaseDir ,
#if defined(ENABLE_OVERLOADING)
ContextGetBaseGravityMethodInfo ,
#endif
contextGetBaseGravity ,
#if defined(ENABLE_OVERLOADING)
ContextGetFontDescriptionMethodInfo ,
#endif
contextGetFontDescription ,
#if defined(ENABLE_OVERLOADING)
ContextGetFontMapMethodInfo ,
#endif
contextGetFontMap ,
#if defined(ENABLE_OVERLOADING)
ContextGetGravityMethodInfo ,
#endif
contextGetGravity ,
#if defined(ENABLE_OVERLOADING)
ContextGetGravityHintMethodInfo ,
#endif
contextGetGravityHint ,
#if defined(ENABLE_OVERLOADING)
ContextGetLanguageMethodInfo ,
#endif
contextGetLanguage ,
#if defined(ENABLE_OVERLOADING)
ContextGetMatrixMethodInfo ,
#endif
contextGetMatrix ,
#if defined(ENABLE_OVERLOADING)
ContextGetMetricsMethodInfo ,
#endif
contextGetMetrics ,
#if defined(ENABLE_OVERLOADING)
ContextGetRoundGlyphPositionsMethodInfo ,
#endif
contextGetRoundGlyphPositions ,
#if defined(ENABLE_OVERLOADING)
ContextGetSerialMethodInfo ,
#endif
contextGetSerial ,
#if defined(ENABLE_OVERLOADING)
ContextListFamiliesMethodInfo ,
#endif
contextListFamilies ,
#if defined(ENABLE_OVERLOADING)
ContextLoadFontMethodInfo ,
#endif
contextLoadFont ,
#if defined(ENABLE_OVERLOADING)
ContextLoadFontsetMethodInfo ,
#endif
contextLoadFontset ,
contextNew ,
#if defined(ENABLE_OVERLOADING)
ContextSetBaseDirMethodInfo ,
#endif
contextSetBaseDir ,
#if defined(ENABLE_OVERLOADING)
ContextSetBaseGravityMethodInfo ,
#endif
contextSetBaseGravity ,
#if defined(ENABLE_OVERLOADING)
ContextSetFontDescriptionMethodInfo ,
#endif
contextSetFontDescription ,
#if defined(ENABLE_OVERLOADING)
ContextSetFontMapMethodInfo ,
#endif
contextSetFontMap ,
#if defined(ENABLE_OVERLOADING)
ContextSetGravityHintMethodInfo ,
#endif
contextSetGravityHint ,
#if defined(ENABLE_OVERLOADING)
ContextSetLanguageMethodInfo ,
#endif
contextSetLanguage ,
#if defined(ENABLE_OVERLOADING)
ContextSetMatrixMethodInfo ,
#endif
contextSetMatrix ,
#if defined(ENABLE_OVERLOADING)
ContextSetRoundGlyphPositionsMethodInfo ,
#endif
contextSetRoundGlyphPositions ,
) 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.GHashTable as B.GHT
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.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
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 GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Interfaces.ListModel as Gio.ListModel
import qualified GI.HarfBuzz.Structs.FeatureT as HarfBuzz.FeatureT
import qualified GI.Pango.Callbacks as Pango.Callbacks
import {-# SOURCE #-} qualified GI.Pango.Enums as Pango.Enums
import {-# SOURCE #-} qualified GI.Pango.Flags as Pango.Flags
import {-# SOURCE #-} qualified GI.Pango.Objects.Coverage as Pango.Coverage
import {-# SOURCE #-} qualified GI.Pango.Objects.Font as Pango.Font
import {-# SOURCE #-} qualified GI.Pango.Objects.FontFace as Pango.FontFace
import {-# SOURCE #-} qualified GI.Pango.Objects.FontFamily as Pango.FontFamily
import {-# SOURCE #-} qualified GI.Pango.Objects.FontMap as Pango.FontMap
import {-# SOURCE #-} qualified GI.Pango.Objects.Fontset as Pango.Fontset
import {-# SOURCE #-} qualified GI.Pango.Structs.FontDescription as Pango.FontDescription
import {-# SOURCE #-} qualified GI.Pango.Structs.FontMetrics as Pango.FontMetrics
import {-# SOURCE #-} qualified GI.Pango.Structs.Language as Pango.Language
import {-# SOURCE #-} qualified GI.Pango.Structs.Matrix as Pango.Matrix
import {-# SOURCE #-} qualified GI.Pango.Structs.Rectangle as Pango.Rectangle
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Pango.Enums as Pango.Enums
import {-# SOURCE #-} qualified GI.Pango.Objects.Font as Pango.Font
import {-# SOURCE #-} qualified GI.Pango.Objects.FontFamily as Pango.FontFamily
import {-# SOURCE #-} qualified GI.Pango.Objects.FontMap as Pango.FontMap
import {-# SOURCE #-} qualified GI.Pango.Objects.Fontset as Pango.Fontset
import {-# SOURCE #-} qualified GI.Pango.Structs.FontDescription as Pango.FontDescription
import {-# SOURCE #-} qualified GI.Pango.Structs.FontMetrics as Pango.FontMetrics
import {-# SOURCE #-} qualified GI.Pango.Structs.Language as Pango.Language
import {-# SOURCE #-} qualified GI.Pango.Structs.Matrix as Pango.Matrix
#endif
newtype Context = Context (SP.ManagedPtr Context)
deriving (Context -> Context -> Bool
(Context -> Context -> Bool)
-> (Context -> Context -> Bool) -> Eq Context
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Context -> Context -> Bool
== :: Context -> Context -> Bool
$c/= :: Context -> Context -> Bool
/= :: Context -> Context -> Bool
Eq)
instance SP.ManagedPtrNewtype Context where
toManagedPtr :: Context -> ManagedPtr Context
toManagedPtr (Context ManagedPtr Context
p) = ManagedPtr Context
p
foreign import ccall "pango_context_get_type"
c_pango_context_get_type :: IO B.Types.GType
instance B.Types.TypedObject Context where
glibType :: IO GType
glibType = IO GType
c_pango_context_get_type
instance B.Types.GObject Context
class (SP.GObject o, O.IsDescendantOf Context o) => IsContext o
instance (SP.GObject o, O.IsDescendantOf Context o) => IsContext o
instance O.HasParentTypes Context
type instance O.ParentTypes Context = '[GObject.Object.Object]
toContext :: (MIO.MonadIO m, IsContext o) => o -> m Context
toContext :: forall (m :: * -> *) o. (MonadIO m, IsContext o) => o -> m Context
toContext = IO Context -> m Context
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Context -> m Context) -> (o -> IO Context) -> o -> m Context
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Context -> Context) -> o -> IO Context
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Context -> Context
Context
instance B.GValue.IsGValue (Maybe Context) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_pango_context_get_type
gvalueSet_ :: Ptr GValue -> Maybe Context -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Context
P.Nothing = Ptr GValue -> Ptr Context -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Context
forall a. Ptr a
FP.nullPtr :: FP.Ptr Context)
gvalueSet_ Ptr GValue
gv (P.Just Context
obj) = Context -> (Ptr Context -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Context
obj (Ptr GValue -> Ptr Context -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Context)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr Context)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Context)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject Context ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveContextMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveContextMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveContextMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveContextMethod "changed" o = ContextChangedMethodInfo
ResolveContextMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveContextMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveContextMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveContextMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveContextMethod "listFamilies" o = ContextListFamiliesMethodInfo
ResolveContextMethod "loadFont" o = ContextLoadFontMethodInfo
ResolveContextMethod "loadFontset" o = ContextLoadFontsetMethodInfo
ResolveContextMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveContextMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveContextMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveContextMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveContextMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveContextMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveContextMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveContextMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveContextMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveContextMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveContextMethod "getBaseDir" o = ContextGetBaseDirMethodInfo
ResolveContextMethod "getBaseGravity" o = ContextGetBaseGravityMethodInfo
ResolveContextMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveContextMethod "getFontDescription" o = ContextGetFontDescriptionMethodInfo
ResolveContextMethod "getFontMap" o = ContextGetFontMapMethodInfo
ResolveContextMethod "getGravity" o = ContextGetGravityMethodInfo
ResolveContextMethod "getGravityHint" o = ContextGetGravityHintMethodInfo
ResolveContextMethod "getLanguage" o = ContextGetLanguageMethodInfo
ResolveContextMethod "getMatrix" o = ContextGetMatrixMethodInfo
ResolveContextMethod "getMetrics" o = ContextGetMetricsMethodInfo
ResolveContextMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveContextMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveContextMethod "getRoundGlyphPositions" o = ContextGetRoundGlyphPositionsMethodInfo
ResolveContextMethod "getSerial" o = ContextGetSerialMethodInfo
ResolveContextMethod "setBaseDir" o = ContextSetBaseDirMethodInfo
ResolveContextMethod "setBaseGravity" o = ContextSetBaseGravityMethodInfo
ResolveContextMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveContextMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveContextMethod "setFontDescription" o = ContextSetFontDescriptionMethodInfo
ResolveContextMethod "setFontMap" o = ContextSetFontMapMethodInfo
ResolveContextMethod "setGravityHint" o = ContextSetGravityHintMethodInfo
ResolveContextMethod "setLanguage" o = ContextSetLanguageMethodInfo
ResolveContextMethod "setMatrix" o = ContextSetMatrixMethodInfo
ResolveContextMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveContextMethod "setRoundGlyphPositions" o = ContextSetRoundGlyphPositionsMethodInfo
ResolveContextMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveContextMethod t Context, O.OverloadedMethod info Context p) => OL.IsLabel t (Context -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveContextMethod t Context, O.OverloadedMethod info Context p, R.HasField t Context p) => R.HasField t Context p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveContextMethod t Context, O.OverloadedMethodInfo info Context) => OL.IsLabel t (O.MethodProxy info Context) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Context
type instance O.AttributeList Context = ContextAttributeList
type ContextAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Context = ContextSignalList
type ContextSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "pango_context_new" pango_context_new ::
IO (Ptr Context)
contextNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Context
contextNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Context
contextNew = IO Context -> m Context
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Context -> m Context) -> IO Context -> m Context
forall a b. (a -> b) -> a -> b
$ do
result <- IO (Ptr Context)
pango_context_new
checkUnexpectedReturnNULL "contextNew" result
result' <- (wrapObject Context) result
return result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "pango_context_changed" pango_context_changed ::
Ptr Context ->
IO ()
contextChanged ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> m ()
contextChanged :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> m ()
contextChanged a
context = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
pango_context_changed context'
touchManagedPtr context
return ()
#if defined(ENABLE_OVERLOADING)
data ContextChangedMethodInfo
instance (signature ~ (m ()), MonadIO m, IsContext a) => O.OverloadedMethod ContextChangedMethodInfo a signature where
overloadedMethod = contextChanged
instance O.OverloadedMethodInfo ContextChangedMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextChanged",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextChanged"
})
#endif
foreign import ccall "pango_context_get_base_dir" pango_context_get_base_dir ::
Ptr Context ->
IO CUInt
contextGetBaseDir ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> m Pango.Enums.Direction
contextGetBaseDir :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> m Direction
contextGetBaseDir a
context = IO Direction -> m Direction
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Direction -> m Direction) -> IO Direction -> m Direction
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
result <- pango_context_get_base_dir context'
let result' = (Int -> Direction
forall a. Enum a => Int -> a
toEnum (Int -> Direction) -> (CUInt -> Int) -> CUInt -> Direction
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
touchManagedPtr context
return result'
#if defined(ENABLE_OVERLOADING)
data ContextGetBaseDirMethodInfo
instance (signature ~ (m Pango.Enums.Direction), MonadIO m, IsContext a) => O.OverloadedMethod ContextGetBaseDirMethodInfo a signature where
overloadedMethod = contextGetBaseDir
instance O.OverloadedMethodInfo ContextGetBaseDirMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextGetBaseDir",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextGetBaseDir"
})
#endif
foreign import ccall "pango_context_get_base_gravity" pango_context_get_base_gravity ::
Ptr Context ->
IO CUInt
contextGetBaseGravity ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> m Pango.Enums.Gravity
contextGetBaseGravity :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> m Gravity
contextGetBaseGravity a
context = IO Gravity -> m Gravity
forall a. IO a -> m a
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
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
result <- pango_context_get_base_gravity context'
let 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
touchManagedPtr context
return result'
#if defined(ENABLE_OVERLOADING)
data ContextGetBaseGravityMethodInfo
instance (signature ~ (m Pango.Enums.Gravity), MonadIO m, IsContext a) => O.OverloadedMethod ContextGetBaseGravityMethodInfo a signature where
overloadedMethod = contextGetBaseGravity
instance O.OverloadedMethodInfo ContextGetBaseGravityMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextGetBaseGravity",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextGetBaseGravity"
})
#endif
foreign import ccall "pango_context_get_font_description" pango_context_get_font_description ::
Ptr Context ->
IO (Ptr Pango.FontDescription.FontDescription)
contextGetFontDescription ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> m (Maybe Pango.FontDescription.FontDescription)
contextGetFontDescription :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> m (Maybe FontDescription)
contextGetFontDescription a
context = IO (Maybe FontDescription) -> m (Maybe FontDescription)
forall a. IO a -> m a
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
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
result <- pango_context_get_font_description context'
maybeResult <- convertIfNonNull result $ \Ptr FontDescription
result' -> do
result'' <- ((ManagedPtr FontDescription -> FontDescription)
-> Ptr FontDescription -> IO FontDescription
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr FontDescription -> FontDescription
Pango.FontDescription.FontDescription) Ptr FontDescription
result'
return result''
touchManagedPtr context
return maybeResult
#if defined(ENABLE_OVERLOADING)
data ContextGetFontDescriptionMethodInfo
instance (signature ~ (m (Maybe Pango.FontDescription.FontDescription)), MonadIO m, IsContext a) => O.OverloadedMethod ContextGetFontDescriptionMethodInfo a signature where
overloadedMethod = contextGetFontDescription
instance O.OverloadedMethodInfo ContextGetFontDescriptionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextGetFontDescription",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextGetFontDescription"
})
#endif
foreign import ccall "pango_context_get_font_map" pango_context_get_font_map ::
Ptr Context ->
IO (Ptr Pango.FontMap.FontMap)
contextGetFontMap ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> m (Maybe Pango.FontMap.FontMap)
contextGetFontMap :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> m (Maybe FontMap)
contextGetFontMap a
context = IO (Maybe FontMap) -> m (Maybe FontMap)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe FontMap) -> m (Maybe FontMap))
-> IO (Maybe FontMap) -> m (Maybe FontMap)
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
result <- pango_context_get_font_map context'
maybeResult <- convertIfNonNull result $ \Ptr FontMap
result' -> do
result'' <- ((ManagedPtr FontMap -> FontMap) -> Ptr FontMap -> IO FontMap
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr FontMap -> FontMap
Pango.FontMap.FontMap) Ptr FontMap
result'
return result''
touchManagedPtr context
return maybeResult
#if defined(ENABLE_OVERLOADING)
data ContextGetFontMapMethodInfo
instance (signature ~ (m (Maybe Pango.FontMap.FontMap)), MonadIO m, IsContext a) => O.OverloadedMethod ContextGetFontMapMethodInfo a signature where
overloadedMethod = contextGetFontMap
instance O.OverloadedMethodInfo ContextGetFontMapMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextGetFontMap",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextGetFontMap"
})
#endif
foreign import ccall "pango_context_get_gravity" pango_context_get_gravity ::
Ptr Context ->
IO CUInt
contextGetGravity ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> m Pango.Enums.Gravity
contextGetGravity :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> m Gravity
contextGetGravity a
context = IO Gravity -> m Gravity
forall a. IO a -> m a
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
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
result <- pango_context_get_gravity context'
let 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
touchManagedPtr context
return result'
#if defined(ENABLE_OVERLOADING)
data ContextGetGravityMethodInfo
instance (signature ~ (m Pango.Enums.Gravity), MonadIO m, IsContext a) => O.OverloadedMethod ContextGetGravityMethodInfo a signature where
overloadedMethod = contextGetGravity
instance O.OverloadedMethodInfo ContextGetGravityMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextGetGravity",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextGetGravity"
})
#endif
foreign import ccall "pango_context_get_gravity_hint" pango_context_get_gravity_hint ::
Ptr Context ->
IO CUInt
contextGetGravityHint ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> m Pango.Enums.GravityHint
contextGetGravityHint :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> m GravityHint
contextGetGravityHint a
context = IO GravityHint -> m GravityHint
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GravityHint -> m GravityHint)
-> IO GravityHint -> m GravityHint
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
result <- pango_context_get_gravity_hint context'
let result' = (Int -> GravityHint
forall a. Enum a => Int -> a
toEnum (Int -> GravityHint) -> (CUInt -> Int) -> CUInt -> GravityHint
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
touchManagedPtr context
return result'
#if defined(ENABLE_OVERLOADING)
data ContextGetGravityHintMethodInfo
instance (signature ~ (m Pango.Enums.GravityHint), MonadIO m, IsContext a) => O.OverloadedMethod ContextGetGravityHintMethodInfo a signature where
overloadedMethod = contextGetGravityHint
instance O.OverloadedMethodInfo ContextGetGravityHintMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextGetGravityHint",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextGetGravityHint"
})
#endif
foreign import ccall "pango_context_get_language" pango_context_get_language ::
Ptr Context ->
IO (Ptr Pango.Language.Language)
contextGetLanguage ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> m Pango.Language.Language
contextGetLanguage :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> m Language
contextGetLanguage a
context = IO Language -> m Language
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Language -> m Language) -> IO Language -> m Language
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
result <- pango_context_get_language context'
checkUnexpectedReturnNULL "contextGetLanguage" result
result' <- (newBoxed Pango.Language.Language) result
touchManagedPtr context
return result'
#if defined(ENABLE_OVERLOADING)
data ContextGetLanguageMethodInfo
instance (signature ~ (m Pango.Language.Language), MonadIO m, IsContext a) => O.OverloadedMethod ContextGetLanguageMethodInfo a signature where
overloadedMethod = contextGetLanguage
instance O.OverloadedMethodInfo ContextGetLanguageMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextGetLanguage",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextGetLanguage"
})
#endif
foreign import ccall "pango_context_get_matrix" pango_context_get_matrix ::
Ptr Context ->
IO (Ptr Pango.Matrix.Matrix)
contextGetMatrix ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> m (Maybe Pango.Matrix.Matrix)
contextGetMatrix :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> m (Maybe Matrix)
contextGetMatrix a
context = IO (Maybe Matrix) -> m (Maybe Matrix)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Matrix) -> m (Maybe Matrix))
-> IO (Maybe Matrix) -> m (Maybe Matrix)
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
result <- pango_context_get_matrix context'
maybeResult <- convertIfNonNull result $ \Ptr Matrix
result' -> do
result'' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Matrix -> Matrix
Pango.Matrix.Matrix) Ptr Matrix
result'
return result''
touchManagedPtr context
return maybeResult
#if defined(ENABLE_OVERLOADING)
data ContextGetMatrixMethodInfo
instance (signature ~ (m (Maybe Pango.Matrix.Matrix)), MonadIO m, IsContext a) => O.OverloadedMethod ContextGetMatrixMethodInfo a signature where
overloadedMethod = contextGetMatrix
instance O.OverloadedMethodInfo ContextGetMatrixMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextGetMatrix",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextGetMatrix"
})
#endif
foreign import ccall "pango_context_get_metrics" pango_context_get_metrics ::
Ptr Context ->
Ptr Pango.FontDescription.FontDescription ->
Ptr Pango.Language.Language ->
IO (Ptr Pango.FontMetrics.FontMetrics)
contextGetMetrics ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> Maybe (Pango.FontDescription.FontDescription)
-> Maybe (Pango.Language.Language)
-> m Pango.FontMetrics.FontMetrics
contextGetMetrics :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> Maybe FontDescription -> Maybe Language -> m FontMetrics
contextGetMetrics a
context Maybe FontDescription
desc Maybe Language
language = IO FontMetrics -> m FontMetrics
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FontMetrics -> m FontMetrics)
-> IO FontMetrics -> m FontMetrics
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
maybeDesc <- case desc of
Maybe FontDescription
Nothing -> Ptr FontDescription -> IO (Ptr FontDescription)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FontDescription
forall a. Ptr a
FP.nullPtr
Just FontDescription
jDesc -> do
jDesc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
jDesc
return jDesc'
maybeLanguage <- case language of
Maybe Language
Nothing -> Ptr Language -> IO (Ptr Language)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Language
forall a. Ptr a
FP.nullPtr
Just Language
jLanguage -> do
jLanguage' <- Language -> IO (Ptr Language)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Language
jLanguage
return jLanguage'
result <- pango_context_get_metrics context' maybeDesc maybeLanguage
checkUnexpectedReturnNULL "contextGetMetrics" result
result' <- (wrapBoxed Pango.FontMetrics.FontMetrics) result
touchManagedPtr context
whenJust desc touchManagedPtr
whenJust language touchManagedPtr
return result'
#if defined(ENABLE_OVERLOADING)
data ContextGetMetricsMethodInfo
instance (signature ~ (Maybe (Pango.FontDescription.FontDescription) -> Maybe (Pango.Language.Language) -> m Pango.FontMetrics.FontMetrics), MonadIO m, IsContext a) => O.OverloadedMethod ContextGetMetricsMethodInfo a signature where
overloadedMethod = contextGetMetrics
instance O.OverloadedMethodInfo ContextGetMetricsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextGetMetrics",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextGetMetrics"
})
#endif
foreign import ccall "pango_context_get_round_glyph_positions" pango_context_get_round_glyph_positions ::
Ptr Context ->
IO CInt
contextGetRoundGlyphPositions ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> m Bool
contextGetRoundGlyphPositions :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> m Bool
contextGetRoundGlyphPositions a
context = IO Bool -> m Bool
forall a. IO a -> m a
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
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
result <- pango_context_get_round_glyph_positions context'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr context
return result'
#if defined(ENABLE_OVERLOADING)
data ContextGetRoundGlyphPositionsMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsContext a) => O.OverloadedMethod ContextGetRoundGlyphPositionsMethodInfo a signature where
overloadedMethod = contextGetRoundGlyphPositions
instance O.OverloadedMethodInfo ContextGetRoundGlyphPositionsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextGetRoundGlyphPositions",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextGetRoundGlyphPositions"
})
#endif
foreign import ccall "pango_context_get_serial" pango_context_get_serial ::
Ptr Context ->
IO Word32
contextGetSerial ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> m Word32
contextGetSerial :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> m Word32
contextGetSerial a
context = IO Word32 -> m Word32
forall a. IO a -> m a
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
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
result <- pango_context_get_serial context'
touchManagedPtr context
return result
#if defined(ENABLE_OVERLOADING)
data ContextGetSerialMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsContext a) => O.OverloadedMethod ContextGetSerialMethodInfo a signature where
overloadedMethod = contextGetSerial
instance O.OverloadedMethodInfo ContextGetSerialMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextGetSerial",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextGetSerial"
})
#endif
foreign import ccall "pango_context_list_families" pango_context_list_families ::
Ptr Context ->
Ptr (Ptr (Ptr Pango.FontFamily.FontFamily)) ->
Ptr Int32 ->
IO ()
contextListFamilies ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> m ([Pango.FontFamily.FontFamily])
contextListFamilies :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> m [FontFamily]
contextListFamilies a
context = IO [FontFamily] -> m [FontFamily]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [FontFamily] -> m [FontFamily])
-> IO [FontFamily] -> m [FontFamily]
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
families <- callocMem :: IO (Ptr (Ptr (Ptr Pango.FontFamily.FontFamily)))
nFamilies <- allocMem :: IO (Ptr Int32)
pango_context_list_families context' families nFamilies
nFamilies' <- peek nFamilies
families' <- peek families
families'' <- (unpackPtrArrayWithLength nFamilies') families'
families''' <- mapM (newObject Pango.FontFamily.FontFamily) families''
freeMem families'
touchManagedPtr context
freeMem families
freeMem nFamilies
return families'''
#if defined(ENABLE_OVERLOADING)
data ContextListFamiliesMethodInfo
instance (signature ~ (m ([Pango.FontFamily.FontFamily])), MonadIO m, IsContext a) => O.OverloadedMethod ContextListFamiliesMethodInfo a signature where
overloadedMethod = contextListFamilies
instance O.OverloadedMethodInfo ContextListFamiliesMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextListFamilies",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextListFamilies"
})
#endif
foreign import ccall "pango_context_load_font" pango_context_load_font ::
Ptr Context ->
Ptr Pango.FontDescription.FontDescription ->
IO (Ptr Pango.Font.Font)
contextLoadFont ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> Pango.FontDescription.FontDescription
-> m (Maybe Pango.Font.Font)
contextLoadFont :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> FontDescription -> m (Maybe Font)
contextLoadFont a
context FontDescription
desc = IO (Maybe Font) -> m (Maybe Font)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Font) -> m (Maybe Font))
-> IO (Maybe Font) -> m (Maybe Font)
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
desc' <- unsafeManagedPtrGetPtr desc
result <- pango_context_load_font context' desc'
maybeResult <- convertIfNonNull result $ \Ptr Font
result' -> do
result'' <- ((ManagedPtr Font -> Font) -> Ptr Font -> IO Font
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Font -> Font
Pango.Font.Font) Ptr Font
result'
return result''
touchManagedPtr context
touchManagedPtr desc
return maybeResult
#if defined(ENABLE_OVERLOADING)
data ContextLoadFontMethodInfo
instance (signature ~ (Pango.FontDescription.FontDescription -> m (Maybe Pango.Font.Font)), MonadIO m, IsContext a) => O.OverloadedMethod ContextLoadFontMethodInfo a signature where
overloadedMethod = contextLoadFont
instance O.OverloadedMethodInfo ContextLoadFontMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextLoadFont",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextLoadFont"
})
#endif
foreign import ccall "pango_context_load_fontset" pango_context_load_fontset ::
Ptr Context ->
Ptr Pango.FontDescription.FontDescription ->
Ptr Pango.Language.Language ->
IO (Ptr Pango.Fontset.Fontset)
contextLoadFontset ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> Pango.FontDescription.FontDescription
-> Pango.Language.Language
-> m (Maybe Pango.Fontset.Fontset)
contextLoadFontset :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> FontDescription -> Language -> m (Maybe Fontset)
contextLoadFontset a
context FontDescription
desc Language
language = IO (Maybe Fontset) -> m (Maybe Fontset)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Fontset) -> m (Maybe Fontset))
-> IO (Maybe Fontset) -> m (Maybe Fontset)
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
desc' <- unsafeManagedPtrGetPtr desc
language' <- unsafeManagedPtrGetPtr language
result <- pango_context_load_fontset context' desc' language'
maybeResult <- convertIfNonNull result $ \Ptr Fontset
result' -> do
result'' <- ((ManagedPtr Fontset -> Fontset) -> Ptr Fontset -> IO Fontset
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Fontset -> Fontset
Pango.Fontset.Fontset) Ptr Fontset
result'
return result''
touchManagedPtr context
touchManagedPtr desc
touchManagedPtr language
return maybeResult
#if defined(ENABLE_OVERLOADING)
data ContextLoadFontsetMethodInfo
instance (signature ~ (Pango.FontDescription.FontDescription -> Pango.Language.Language -> m (Maybe Pango.Fontset.Fontset)), MonadIO m, IsContext a) => O.OverloadedMethod ContextLoadFontsetMethodInfo a signature where
overloadedMethod = contextLoadFontset
instance O.OverloadedMethodInfo ContextLoadFontsetMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextLoadFontset",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextLoadFontset"
})
#endif
foreign import ccall "pango_context_set_base_dir" pango_context_set_base_dir ::
Ptr Context ->
CUInt ->
IO ()
contextSetBaseDir ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> Pango.Enums.Direction
-> m ()
contextSetBaseDir :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> Direction -> m ()
contextSetBaseDir a
context Direction
direction = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
let direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Direction -> Int) -> Direction -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Direction -> Int
forall a. Enum a => a -> Int
fromEnum) Direction
direction
pango_context_set_base_dir context' direction'
touchManagedPtr context
return ()
#if defined(ENABLE_OVERLOADING)
data ContextSetBaseDirMethodInfo
instance (signature ~ (Pango.Enums.Direction -> m ()), MonadIO m, IsContext a) => O.OverloadedMethod ContextSetBaseDirMethodInfo a signature where
overloadedMethod = contextSetBaseDir
instance O.OverloadedMethodInfo ContextSetBaseDirMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextSetBaseDir",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextSetBaseDir"
})
#endif
foreign import ccall "pango_context_set_base_gravity" pango_context_set_base_gravity ::
Ptr Context ->
CUInt ->
IO ()
contextSetBaseGravity ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> Pango.Enums.Gravity
-> m ()
contextSetBaseGravity :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> Gravity -> m ()
contextSetBaseGravity a
context Gravity
gravity = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
let 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
pango_context_set_base_gravity context' gravity'
touchManagedPtr context
return ()
#if defined(ENABLE_OVERLOADING)
data ContextSetBaseGravityMethodInfo
instance (signature ~ (Pango.Enums.Gravity -> m ()), MonadIO m, IsContext a) => O.OverloadedMethod ContextSetBaseGravityMethodInfo a signature where
overloadedMethod = contextSetBaseGravity
instance O.OverloadedMethodInfo ContextSetBaseGravityMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextSetBaseGravity",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextSetBaseGravity"
})
#endif
foreign import ccall "pango_context_set_font_description" pango_context_set_font_description ::
Ptr Context ->
Ptr Pango.FontDescription.FontDescription ->
IO ()
contextSetFontDescription ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> Maybe (Pango.FontDescription.FontDescription)
-> m ()
contextSetFontDescription :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> Maybe FontDescription -> m ()
contextSetFontDescription a
context Maybe FontDescription
desc = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
maybeDesc <- case desc of
Maybe FontDescription
Nothing -> Ptr FontDescription -> IO (Ptr FontDescription)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FontDescription
forall a. Ptr a
FP.nullPtr
Just FontDescription
jDesc -> do
jDesc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
jDesc
return jDesc'
pango_context_set_font_description context' maybeDesc
touchManagedPtr context
whenJust desc touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data ContextSetFontDescriptionMethodInfo
instance (signature ~ (Maybe (Pango.FontDescription.FontDescription) -> m ()), MonadIO m, IsContext a) => O.OverloadedMethod ContextSetFontDescriptionMethodInfo a signature where
overloadedMethod = contextSetFontDescription
instance O.OverloadedMethodInfo ContextSetFontDescriptionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextSetFontDescription",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextSetFontDescription"
})
#endif
foreign import ccall "pango_context_set_font_map" pango_context_set_font_map ::
Ptr Context ->
Ptr Pango.FontMap.FontMap ->
IO ()
contextSetFontMap ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a, Pango.FontMap.IsFontMap b) =>
a
-> Maybe (b)
-> m ()
contextSetFontMap :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsContext a, IsFontMap b) =>
a -> Maybe b -> m ()
contextSetFontMap a
context Maybe b
fontMap = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
maybeFontMap <- case fontMap of
Maybe b
Nothing -> Ptr FontMap -> IO (Ptr FontMap)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FontMap
forall a. Ptr a
FP.nullPtr
Just b
jFontMap -> do
jFontMap' <- b -> IO (Ptr FontMap)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jFontMap
return jFontMap'
pango_context_set_font_map context' maybeFontMap
touchManagedPtr context
whenJust fontMap touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data ContextSetFontMapMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsContext a, Pango.FontMap.IsFontMap b) => O.OverloadedMethod ContextSetFontMapMethodInfo a signature where
overloadedMethod = contextSetFontMap
instance O.OverloadedMethodInfo ContextSetFontMapMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextSetFontMap",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextSetFontMap"
})
#endif
foreign import ccall "pango_context_set_gravity_hint" pango_context_set_gravity_hint ::
Ptr Context ->
CUInt ->
IO ()
contextSetGravityHint ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> Pango.Enums.GravityHint
-> m ()
contextSetGravityHint :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> GravityHint -> m ()
contextSetGravityHint a
context GravityHint
hint = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
let hint' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (GravityHint -> Int) -> GravityHint -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GravityHint -> Int
forall a. Enum a => a -> Int
fromEnum) GravityHint
hint
pango_context_set_gravity_hint context' hint'
touchManagedPtr context
return ()
#if defined(ENABLE_OVERLOADING)
data ContextSetGravityHintMethodInfo
instance (signature ~ (Pango.Enums.GravityHint -> m ()), MonadIO m, IsContext a) => O.OverloadedMethod ContextSetGravityHintMethodInfo a signature where
overloadedMethod = contextSetGravityHint
instance O.OverloadedMethodInfo ContextSetGravityHintMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextSetGravityHint",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextSetGravityHint"
})
#endif
foreign import ccall "pango_context_set_language" pango_context_set_language ::
Ptr Context ->
Ptr Pango.Language.Language ->
IO ()
contextSetLanguage ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> Maybe (Pango.Language.Language)
-> m ()
contextSetLanguage :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> Maybe Language -> m ()
contextSetLanguage a
context Maybe Language
language = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
maybeLanguage <- case language of
Maybe Language
Nothing -> Ptr Language -> IO (Ptr Language)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Language
forall a. Ptr a
FP.nullPtr
Just Language
jLanguage -> do
jLanguage' <- Language -> IO (Ptr Language)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Language
jLanguage
return jLanguage'
pango_context_set_language context' maybeLanguage
touchManagedPtr context
whenJust language touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data ContextSetLanguageMethodInfo
instance (signature ~ (Maybe (Pango.Language.Language) -> m ()), MonadIO m, IsContext a) => O.OverloadedMethod ContextSetLanguageMethodInfo a signature where
overloadedMethod = contextSetLanguage
instance O.OverloadedMethodInfo ContextSetLanguageMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextSetLanguage",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextSetLanguage"
})
#endif
foreign import ccall "pango_context_set_matrix" pango_context_set_matrix ::
Ptr Context ->
Ptr Pango.Matrix.Matrix ->
IO ()
contextSetMatrix ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> Maybe (Pango.Matrix.Matrix)
-> m ()
contextSetMatrix :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> Maybe Matrix -> m ()
contextSetMatrix a
context Maybe Matrix
matrix = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
maybeMatrix <- case matrix of
Maybe Matrix
Nothing -> Ptr Matrix -> IO (Ptr Matrix)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Matrix
forall a. Ptr a
FP.nullPtr
Just Matrix
jMatrix -> do
jMatrix' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
jMatrix
return jMatrix'
pango_context_set_matrix context' maybeMatrix
touchManagedPtr context
whenJust matrix touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data ContextSetMatrixMethodInfo
instance (signature ~ (Maybe (Pango.Matrix.Matrix) -> m ()), MonadIO m, IsContext a) => O.OverloadedMethod ContextSetMatrixMethodInfo a signature where
overloadedMethod = contextSetMatrix
instance O.OverloadedMethodInfo ContextSetMatrixMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextSetMatrix",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextSetMatrix"
})
#endif
foreign import ccall "pango_context_set_round_glyph_positions" pango_context_set_round_glyph_positions ::
Ptr Context ->
CInt ->
IO ()
contextSetRoundGlyphPositions ::
(B.CallStack.HasCallStack, MonadIO m, IsContext a) =>
a
-> Bool
-> m ()
contextSetRoundGlyphPositions :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> Bool -> m ()
contextSetRoundGlyphPositions a
context Bool
roundPositions = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
let roundPositions' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.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
P.fromEnum) Bool
roundPositions
pango_context_set_round_glyph_positions context' roundPositions'
touchManagedPtr context
return ()
#if defined(ENABLE_OVERLOADING)
data ContextSetRoundGlyphPositionsMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsContext a) => O.OverloadedMethod ContextSetRoundGlyphPositionsMethodInfo a signature where
overloadedMethod = contextSetRoundGlyphPositions
instance O.OverloadedMethodInfo ContextSetRoundGlyphPositionsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Context.contextSetRoundGlyphPositions",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Objects-Context.html#v:contextSetRoundGlyphPositions"
})
#endif