#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Pango.Structs.Analysis
(
Analysis(..) ,
newZeroAnalysis ,
noAnalysis ,
#if ENABLE_OVERLOADING
analysis_extraAttrs ,
#endif
clearAnalysisExtraAttrs ,
getAnalysisExtraAttrs ,
setAnalysisExtraAttrs ,
#if ENABLE_OVERLOADING
analysis_flags ,
#endif
getAnalysisFlags ,
setAnalysisFlags ,
#if ENABLE_OVERLOADING
analysis_font ,
#endif
clearAnalysisFont ,
getAnalysisFont ,
setAnalysisFont ,
#if ENABLE_OVERLOADING
analysis_gravity ,
#endif
getAnalysisGravity ,
setAnalysisGravity ,
#if ENABLE_OVERLOADING
analysis_langEngine ,
#endif
clearAnalysisLangEngine ,
getAnalysisLangEngine ,
setAnalysisLangEngine ,
#if ENABLE_OVERLOADING
analysis_language ,
#endif
clearAnalysisLanguage ,
getAnalysisLanguage ,
setAnalysisLanguage ,
#if ENABLE_OVERLOADING
analysis_level ,
#endif
getAnalysisLevel ,
setAnalysisLevel ,
#if ENABLE_OVERLOADING
analysis_script ,
#endif
getAnalysisScript ,
setAnalysisScript ,
#if ENABLE_OVERLOADING
analysis_shapeEngine ,
#endif
clearAnalysisShapeEngine ,
getAnalysisShapeEngine ,
setAnalysisShapeEngine ,
) 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.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.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import {-# SOURCE #-} qualified GI.Pango.Objects.EngineLang as Pango.EngineLang
import {-# SOURCE #-} qualified GI.Pango.Objects.EngineShape as Pango.EngineShape
import {-# SOURCE #-} qualified GI.Pango.Objects.Font as Pango.Font
import {-# SOURCE #-} qualified GI.Pango.Structs.Language as Pango.Language
newtype Analysis = Analysis (ManagedPtr Analysis)
instance WrappedPtr Analysis where
wrappedPtrCalloc = callocBytes 48
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 48 >=> wrapPtr Analysis)
wrappedPtrFree = Just ptr_to_g_free
newZeroAnalysis :: MonadIO m => m Analysis
newZeroAnalysis = liftIO $ wrappedPtrCalloc >>= wrapPtr Analysis
instance tag ~ 'AttrSet => Constructible Analysis tag where
new _ attrs = do
o <- newZeroAnalysis
GI.Attributes.set o attrs
return o
noAnalysis :: Maybe Analysis
noAnalysis = Nothing
getAnalysisShapeEngine :: MonadIO m => Analysis -> m (Maybe Pango.EngineShape.EngineShape)
getAnalysisShapeEngine s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO (Ptr Pango.EngineShape.EngineShape)
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- (newObject Pango.EngineShape.EngineShape) val'
return val''
return result
setAnalysisShapeEngine :: MonadIO m => Analysis -> Ptr Pango.EngineShape.EngineShape -> m ()
setAnalysisShapeEngine s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: Ptr Pango.EngineShape.EngineShape)
clearAnalysisShapeEngine :: MonadIO m => Analysis -> m ()
clearAnalysisShapeEngine s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (FP.nullPtr :: Ptr Pango.EngineShape.EngineShape)
#if ENABLE_OVERLOADING
data AnalysisShapeEngineFieldInfo
instance AttrInfo AnalysisShapeEngineFieldInfo where
type AttrAllowedOps AnalysisShapeEngineFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint AnalysisShapeEngineFieldInfo = (~) (Ptr Pango.EngineShape.EngineShape)
type AttrBaseTypeConstraint AnalysisShapeEngineFieldInfo = (~) Analysis
type AttrGetType AnalysisShapeEngineFieldInfo = Maybe Pango.EngineShape.EngineShape
type AttrLabel AnalysisShapeEngineFieldInfo = "shape_engine"
type AttrOrigin AnalysisShapeEngineFieldInfo = Analysis
attrGet _ = getAnalysisShapeEngine
attrSet _ = setAnalysisShapeEngine
attrConstruct = undefined
attrClear _ = clearAnalysisShapeEngine
analysis_shapeEngine :: AttrLabelProxy "shapeEngine"
analysis_shapeEngine = AttrLabelProxy
#endif
getAnalysisLangEngine :: MonadIO m => Analysis -> m (Maybe Pango.EngineLang.EngineLang)
getAnalysisLangEngine s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO (Ptr Pango.EngineLang.EngineLang)
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- (newObject Pango.EngineLang.EngineLang) val'
return val''
return result
setAnalysisLangEngine :: MonadIO m => Analysis -> Ptr Pango.EngineLang.EngineLang -> m ()
setAnalysisLangEngine s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: Ptr Pango.EngineLang.EngineLang)
clearAnalysisLangEngine :: MonadIO m => Analysis -> m ()
clearAnalysisLangEngine s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (FP.nullPtr :: Ptr Pango.EngineLang.EngineLang)
#if ENABLE_OVERLOADING
data AnalysisLangEngineFieldInfo
instance AttrInfo AnalysisLangEngineFieldInfo where
type AttrAllowedOps AnalysisLangEngineFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint AnalysisLangEngineFieldInfo = (~) (Ptr Pango.EngineLang.EngineLang)
type AttrBaseTypeConstraint AnalysisLangEngineFieldInfo = (~) Analysis
type AttrGetType AnalysisLangEngineFieldInfo = Maybe Pango.EngineLang.EngineLang
type AttrLabel AnalysisLangEngineFieldInfo = "lang_engine"
type AttrOrigin AnalysisLangEngineFieldInfo = Analysis
attrGet _ = getAnalysisLangEngine
attrSet _ = setAnalysisLangEngine
attrConstruct = undefined
attrClear _ = clearAnalysisLangEngine
analysis_langEngine :: AttrLabelProxy "langEngine"
analysis_langEngine = AttrLabelProxy
#endif
getAnalysisFont :: MonadIO m => Analysis -> m (Maybe Pango.Font.Font)
getAnalysisFont s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO (Ptr Pango.Font.Font)
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- (newObject Pango.Font.Font) val'
return val''
return result
setAnalysisFont :: MonadIO m => Analysis -> Ptr Pango.Font.Font -> m ()
setAnalysisFont s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: Ptr Pango.Font.Font)
clearAnalysisFont :: MonadIO m => Analysis -> m ()
clearAnalysisFont s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (FP.nullPtr :: Ptr Pango.Font.Font)
#if ENABLE_OVERLOADING
data AnalysisFontFieldInfo
instance AttrInfo AnalysisFontFieldInfo where
type AttrAllowedOps AnalysisFontFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint AnalysisFontFieldInfo = (~) (Ptr Pango.Font.Font)
type AttrBaseTypeConstraint AnalysisFontFieldInfo = (~) Analysis
type AttrGetType AnalysisFontFieldInfo = Maybe Pango.Font.Font
type AttrLabel AnalysisFontFieldInfo = "font"
type AttrOrigin AnalysisFontFieldInfo = Analysis
attrGet _ = getAnalysisFont
attrSet _ = setAnalysisFont
attrConstruct = undefined
attrClear _ = clearAnalysisFont
analysis_font :: AttrLabelProxy "font"
analysis_font = AttrLabelProxy
#endif
getAnalysisLevel :: MonadIO m => Analysis -> m Word8
getAnalysisLevel s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO Word8
return val
setAnalysisLevel :: MonadIO m => Analysis -> Word8 -> m ()
setAnalysisLevel s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (val :: Word8)
#if ENABLE_OVERLOADING
data AnalysisLevelFieldInfo
instance AttrInfo AnalysisLevelFieldInfo where
type AttrAllowedOps AnalysisLevelFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint AnalysisLevelFieldInfo = (~) Word8
type AttrBaseTypeConstraint AnalysisLevelFieldInfo = (~) Analysis
type AttrGetType AnalysisLevelFieldInfo = Word8
type AttrLabel AnalysisLevelFieldInfo = "level"
type AttrOrigin AnalysisLevelFieldInfo = Analysis
attrGet _ = getAnalysisLevel
attrSet _ = setAnalysisLevel
attrConstruct = undefined
attrClear _ = undefined
analysis_level :: AttrLabelProxy "level"
analysis_level = AttrLabelProxy
#endif
getAnalysisGravity :: MonadIO m => Analysis -> m Word8
getAnalysisGravity s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 25) :: IO Word8
return val
setAnalysisGravity :: MonadIO m => Analysis -> Word8 -> m ()
setAnalysisGravity s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 25) (val :: Word8)
#if ENABLE_OVERLOADING
data AnalysisGravityFieldInfo
instance AttrInfo AnalysisGravityFieldInfo where
type AttrAllowedOps AnalysisGravityFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint AnalysisGravityFieldInfo = (~) Word8
type AttrBaseTypeConstraint AnalysisGravityFieldInfo = (~) Analysis
type AttrGetType AnalysisGravityFieldInfo = Word8
type AttrLabel AnalysisGravityFieldInfo = "gravity"
type AttrOrigin AnalysisGravityFieldInfo = Analysis
attrGet _ = getAnalysisGravity
attrSet _ = setAnalysisGravity
attrConstruct = undefined
attrClear _ = undefined
analysis_gravity :: AttrLabelProxy "gravity"
analysis_gravity = AttrLabelProxy
#endif
getAnalysisFlags :: MonadIO m => Analysis -> m Word8
getAnalysisFlags s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 26) :: IO Word8
return val
setAnalysisFlags :: MonadIO m => Analysis -> Word8 -> m ()
setAnalysisFlags s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 26) (val :: Word8)
#if ENABLE_OVERLOADING
data AnalysisFlagsFieldInfo
instance AttrInfo AnalysisFlagsFieldInfo where
type AttrAllowedOps AnalysisFlagsFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint AnalysisFlagsFieldInfo = (~) Word8
type AttrBaseTypeConstraint AnalysisFlagsFieldInfo = (~) Analysis
type AttrGetType AnalysisFlagsFieldInfo = Word8
type AttrLabel AnalysisFlagsFieldInfo = "flags"
type AttrOrigin AnalysisFlagsFieldInfo = Analysis
attrGet _ = getAnalysisFlags
attrSet _ = setAnalysisFlags
attrConstruct = undefined
attrClear _ = undefined
analysis_flags :: AttrLabelProxy "flags"
analysis_flags = AttrLabelProxy
#endif
getAnalysisScript :: MonadIO m => Analysis -> m Word8
getAnalysisScript s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 27) :: IO Word8
return val
setAnalysisScript :: MonadIO m => Analysis -> Word8 -> m ()
setAnalysisScript s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 27) (val :: Word8)
#if ENABLE_OVERLOADING
data AnalysisScriptFieldInfo
instance AttrInfo AnalysisScriptFieldInfo where
type AttrAllowedOps AnalysisScriptFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint AnalysisScriptFieldInfo = (~) Word8
type AttrBaseTypeConstraint AnalysisScriptFieldInfo = (~) Analysis
type AttrGetType AnalysisScriptFieldInfo = Word8
type AttrLabel AnalysisScriptFieldInfo = "script"
type AttrOrigin AnalysisScriptFieldInfo = Analysis
attrGet _ = getAnalysisScript
attrSet _ = setAnalysisScript
attrConstruct = undefined
attrClear _ = undefined
analysis_script :: AttrLabelProxy "script"
analysis_script = AttrLabelProxy
#endif
getAnalysisLanguage :: MonadIO m => Analysis -> m (Maybe Pango.Language.Language)
getAnalysisLanguage s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 32) :: IO (Ptr Pango.Language.Language)
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- (newBoxed Pango.Language.Language) val'
return val''
return result
setAnalysisLanguage :: MonadIO m => Analysis -> Ptr Pango.Language.Language -> m ()
setAnalysisLanguage s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (val :: Ptr Pango.Language.Language)
clearAnalysisLanguage :: MonadIO m => Analysis -> m ()
clearAnalysisLanguage s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (FP.nullPtr :: Ptr Pango.Language.Language)
#if ENABLE_OVERLOADING
data AnalysisLanguageFieldInfo
instance AttrInfo AnalysisLanguageFieldInfo where
type AttrAllowedOps AnalysisLanguageFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint AnalysisLanguageFieldInfo = (~) (Ptr Pango.Language.Language)
type AttrBaseTypeConstraint AnalysisLanguageFieldInfo = (~) Analysis
type AttrGetType AnalysisLanguageFieldInfo = Maybe Pango.Language.Language
type AttrLabel AnalysisLanguageFieldInfo = "language"
type AttrOrigin AnalysisLanguageFieldInfo = Analysis
attrGet _ = getAnalysisLanguage
attrSet _ = setAnalysisLanguage
attrConstruct = undefined
attrClear _ = clearAnalysisLanguage
analysis_language :: AttrLabelProxy "language"
analysis_language = AttrLabelProxy
#endif
getAnalysisExtraAttrs :: MonadIO m => Analysis -> m ([Ptr ()])
getAnalysisExtraAttrs s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 40) :: IO (Ptr (GSList (Ptr ())))
val' <- unpackGSList val
return val'
setAnalysisExtraAttrs :: MonadIO m => Analysis -> Ptr (GSList (Ptr ())) -> m ()
setAnalysisExtraAttrs s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 40) (val :: Ptr (GSList (Ptr ())))
clearAnalysisExtraAttrs :: MonadIO m => Analysis -> m ()
clearAnalysisExtraAttrs s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 40) (FP.nullPtr :: Ptr (GSList (Ptr ())))
#if ENABLE_OVERLOADING
data AnalysisExtraAttrsFieldInfo
instance AttrInfo AnalysisExtraAttrsFieldInfo where
type AttrAllowedOps AnalysisExtraAttrsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint AnalysisExtraAttrsFieldInfo = (~) (Ptr (GSList (Ptr ())))
type AttrBaseTypeConstraint AnalysisExtraAttrsFieldInfo = (~) Analysis
type AttrGetType AnalysisExtraAttrsFieldInfo = [Ptr ()]
type AttrLabel AnalysisExtraAttrsFieldInfo = "extra_attrs"
type AttrOrigin AnalysisExtraAttrsFieldInfo = Analysis
attrGet _ = getAnalysisExtraAttrs
attrSet _ = setAnalysisExtraAttrs
attrConstruct = undefined
attrClear _ = clearAnalysisExtraAttrs
analysis_extraAttrs :: AttrLabelProxy "extraAttrs"
analysis_extraAttrs = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList Analysis
type instance O.AttributeList Analysis = AnalysisAttributeList
type AnalysisAttributeList = ('[ '("shapeEngine", AnalysisShapeEngineFieldInfo), '("langEngine", AnalysisLangEngineFieldInfo), '("font", AnalysisFontFieldInfo), '("level", AnalysisLevelFieldInfo), '("gravity", AnalysisGravityFieldInfo), '("flags", AnalysisFlagsFieldInfo), '("script", AnalysisScriptFieldInfo), '("language", AnalysisLanguageFieldInfo), '("extraAttrs", AnalysisExtraAttrsFieldInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
type family ResolveAnalysisMethod (t :: Symbol) (o :: *) :: * where
ResolveAnalysisMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAnalysisMethod t Analysis, O.MethodInfo info Analysis p) => O.IsLabelProxy t (Analysis -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveAnalysisMethod t Analysis, O.MethodInfo info Analysis p) => O.IsLabel t (Analysis -> 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
#endif