#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Pango.Structs.EngineInfo
(
EngineInfo(..) ,
newZeroEngineInfo ,
noEngineInfo ,
clearEngineInfoEngineType ,
#if ENABLE_OVERLOADING
engineInfo_engineType ,
#endif
getEngineInfoEngineType ,
setEngineInfoEngineType ,
clearEngineInfoId ,
#if ENABLE_OVERLOADING
engineInfo_id ,
#endif
getEngineInfoId ,
setEngineInfoId ,
#if ENABLE_OVERLOADING
engineInfo_nScripts ,
#endif
getEngineInfoNScripts ,
setEngineInfoNScripts ,
clearEngineInfoRenderType ,
#if ENABLE_OVERLOADING
engineInfo_renderType ,
#endif
getEngineInfoRenderType ,
setEngineInfoRenderType ,
clearEngineInfoScripts ,
#if ENABLE_OVERLOADING
engineInfo_scripts ,
#endif
getEngineInfoScripts ,
setEngineInfoScripts ,
) 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.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.Structs.EngineScriptInfo as Pango.EngineScriptInfo
newtype EngineInfo = EngineInfo (ManagedPtr EngineInfo)
instance WrappedPtr EngineInfo where
wrappedPtrCalloc = callocBytes 40
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 40 >=> wrapPtr EngineInfo)
wrappedPtrFree = Just ptr_to_g_free
newZeroEngineInfo :: MonadIO m => m EngineInfo
newZeroEngineInfo = liftIO $ wrappedPtrCalloc >>= wrapPtr EngineInfo
instance tag ~ 'AttrSet => Constructible EngineInfo tag where
new _ attrs = do
o <- newZeroEngineInfo
GI.Attributes.set o attrs
return o
noEngineInfo :: Maybe EngineInfo
noEngineInfo = Nothing
getEngineInfoId :: MonadIO m => EngineInfo -> m (Maybe T.Text)
getEngineInfoId s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setEngineInfoId :: MonadIO m => EngineInfo -> CString -> m ()
setEngineInfoId s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: CString)
clearEngineInfoId :: MonadIO m => EngineInfo -> m ()
clearEngineInfoId s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data EngineInfoIdFieldInfo
instance AttrInfo EngineInfoIdFieldInfo where
type AttrAllowedOps EngineInfoIdFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint EngineInfoIdFieldInfo = (~) CString
type AttrBaseTypeConstraint EngineInfoIdFieldInfo = (~) EngineInfo
type AttrGetType EngineInfoIdFieldInfo = Maybe T.Text
type AttrLabel EngineInfoIdFieldInfo = "id"
type AttrOrigin EngineInfoIdFieldInfo = EngineInfo
attrGet _ = getEngineInfoId
attrSet _ = setEngineInfoId
attrConstruct = undefined
attrClear _ = clearEngineInfoId
engineInfo_id :: AttrLabelProxy "id"
engineInfo_id = AttrLabelProxy
#endif
getEngineInfoEngineType :: MonadIO m => EngineInfo -> m (Maybe T.Text)
getEngineInfoEngineType s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setEngineInfoEngineType :: MonadIO m => EngineInfo -> CString -> m ()
setEngineInfoEngineType s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: CString)
clearEngineInfoEngineType :: MonadIO m => EngineInfo -> m ()
clearEngineInfoEngineType s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data EngineInfoEngineTypeFieldInfo
instance AttrInfo EngineInfoEngineTypeFieldInfo where
type AttrAllowedOps EngineInfoEngineTypeFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint EngineInfoEngineTypeFieldInfo = (~) CString
type AttrBaseTypeConstraint EngineInfoEngineTypeFieldInfo = (~) EngineInfo
type AttrGetType EngineInfoEngineTypeFieldInfo = Maybe T.Text
type AttrLabel EngineInfoEngineTypeFieldInfo = "engine_type"
type AttrOrigin EngineInfoEngineTypeFieldInfo = EngineInfo
attrGet _ = getEngineInfoEngineType
attrSet _ = setEngineInfoEngineType
attrConstruct = undefined
attrClear _ = clearEngineInfoEngineType
engineInfo_engineType :: AttrLabelProxy "engineType"
engineInfo_engineType = AttrLabelProxy
#endif
getEngineInfoRenderType :: MonadIO m => EngineInfo -> m (Maybe T.Text)
getEngineInfoRenderType s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setEngineInfoRenderType :: MonadIO m => EngineInfo -> CString -> m ()
setEngineInfoRenderType s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: CString)
clearEngineInfoRenderType :: MonadIO m => EngineInfo -> m ()
clearEngineInfoRenderType s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data EngineInfoRenderTypeFieldInfo
instance AttrInfo EngineInfoRenderTypeFieldInfo where
type AttrAllowedOps EngineInfoRenderTypeFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint EngineInfoRenderTypeFieldInfo = (~) CString
type AttrBaseTypeConstraint EngineInfoRenderTypeFieldInfo = (~) EngineInfo
type AttrGetType EngineInfoRenderTypeFieldInfo = Maybe T.Text
type AttrLabel EngineInfoRenderTypeFieldInfo = "render_type"
type AttrOrigin EngineInfoRenderTypeFieldInfo = EngineInfo
attrGet _ = getEngineInfoRenderType
attrSet _ = setEngineInfoRenderType
attrConstruct = undefined
attrClear _ = clearEngineInfoRenderType
engineInfo_renderType :: AttrLabelProxy "renderType"
engineInfo_renderType = AttrLabelProxy
#endif
getEngineInfoScripts :: MonadIO m => EngineInfo -> m (Maybe Pango.EngineScriptInfo.EngineScriptInfo)
getEngineInfoScripts s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO (Ptr Pango.EngineScriptInfo.EngineScriptInfo)
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- (newPtr Pango.EngineScriptInfo.EngineScriptInfo) val'
return val''
return result
setEngineInfoScripts :: MonadIO m => EngineInfo -> Ptr Pango.EngineScriptInfo.EngineScriptInfo -> m ()
setEngineInfoScripts s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (val :: Ptr Pango.EngineScriptInfo.EngineScriptInfo)
clearEngineInfoScripts :: MonadIO m => EngineInfo -> m ()
clearEngineInfoScripts s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (FP.nullPtr :: Ptr Pango.EngineScriptInfo.EngineScriptInfo)
#if ENABLE_OVERLOADING
data EngineInfoScriptsFieldInfo
instance AttrInfo EngineInfoScriptsFieldInfo where
type AttrAllowedOps EngineInfoScriptsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint EngineInfoScriptsFieldInfo = (~) (Ptr Pango.EngineScriptInfo.EngineScriptInfo)
type AttrBaseTypeConstraint EngineInfoScriptsFieldInfo = (~) EngineInfo
type AttrGetType EngineInfoScriptsFieldInfo = Maybe Pango.EngineScriptInfo.EngineScriptInfo
type AttrLabel EngineInfoScriptsFieldInfo = "scripts"
type AttrOrigin EngineInfoScriptsFieldInfo = EngineInfo
attrGet _ = getEngineInfoScripts
attrSet _ = setEngineInfoScripts
attrConstruct = undefined
attrClear _ = clearEngineInfoScripts
engineInfo_scripts :: AttrLabelProxy "scripts"
engineInfo_scripts = AttrLabelProxy
#endif
getEngineInfoNScripts :: MonadIO m => EngineInfo -> m Int32
getEngineInfoNScripts s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 32) :: IO Int32
return val
setEngineInfoNScripts :: MonadIO m => EngineInfo -> Int32 -> m ()
setEngineInfoNScripts s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (val :: Int32)
#if ENABLE_OVERLOADING
data EngineInfoNScriptsFieldInfo
instance AttrInfo EngineInfoNScriptsFieldInfo where
type AttrAllowedOps EngineInfoNScriptsFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint EngineInfoNScriptsFieldInfo = (~) Int32
type AttrBaseTypeConstraint EngineInfoNScriptsFieldInfo = (~) EngineInfo
type AttrGetType EngineInfoNScriptsFieldInfo = Int32
type AttrLabel EngineInfoNScriptsFieldInfo = "n_scripts"
type AttrOrigin EngineInfoNScriptsFieldInfo = EngineInfo
attrGet _ = getEngineInfoNScripts
attrSet _ = setEngineInfoNScripts
attrConstruct = undefined
attrClear _ = undefined
engineInfo_nScripts :: AttrLabelProxy "nScripts"
engineInfo_nScripts = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList EngineInfo
type instance O.AttributeList EngineInfo = EngineInfoAttributeList
type EngineInfoAttributeList = ('[ '("id", EngineInfoIdFieldInfo), '("engineType", EngineInfoEngineTypeFieldInfo), '("renderType", EngineInfoRenderTypeFieldInfo), '("scripts", EngineInfoScriptsFieldInfo), '("nScripts", EngineInfoNScriptsFieldInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
type family ResolveEngineInfoMethod (t :: Symbol) (o :: *) :: * where
ResolveEngineInfoMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveEngineInfoMethod t EngineInfo, O.MethodInfo info EngineInfo p) => OL.IsLabel t (EngineInfo -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif