-- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte -- License : LGPL-2.1 -- Maintainer : Iñaki García Etxebarria #if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__)) #define ENABLE_OVERLOADING #endif module GI.GObject.Functions ( -- * Methods -- ** boxedCopy #method:boxedCopy# boxedCopy , -- ** boxedFree #method:boxedFree# boxedFree , -- ** enumCompleteTypeInfo #method:enumCompleteTypeInfo# enumCompleteTypeInfo , -- ** enumGetValue #method:enumGetValue# enumGetValue , -- ** enumGetValueByName #method:enumGetValueByName# enumGetValueByName , -- ** enumGetValueByNick #method:enumGetValueByNick# enumGetValueByNick , -- ** enumRegisterStatic #method:enumRegisterStatic# enumRegisterStatic , -- ** enumToString #method:enumToString# enumToString , -- ** flagsCompleteTypeInfo #method:flagsCompleteTypeInfo# flagsCompleteTypeInfo , -- ** flagsGetFirstValue #method:flagsGetFirstValue# flagsGetFirstValue , -- ** flagsGetValueByName #method:flagsGetValueByName# flagsGetValueByName , -- ** flagsGetValueByNick #method:flagsGetValueByNick# flagsGetValueByNick , -- ** flagsRegisterStatic #method:flagsRegisterStatic# flagsRegisterStatic , -- ** flagsToString #method:flagsToString# flagsToString , -- ** gtypeGetType #method:gtypeGetType# gtypeGetType , -- ** paramSpecBoolean #method:paramSpecBoolean# paramSpecBoolean , -- ** paramSpecBoxed #method:paramSpecBoxed# paramSpecBoxed , -- ** paramSpecChar #method:paramSpecChar# paramSpecChar , -- ** paramSpecDouble #method:paramSpecDouble# paramSpecDouble , -- ** paramSpecEnum #method:paramSpecEnum# paramSpecEnum , -- ** paramSpecFlags #method:paramSpecFlags# paramSpecFlags , -- ** paramSpecFloat #method:paramSpecFloat# paramSpecFloat , -- ** paramSpecGtype #method:paramSpecGtype# paramSpecGtype , -- ** paramSpecInt #method:paramSpecInt# paramSpecInt , -- ** paramSpecInt64 #method:paramSpecInt64# paramSpecInt64 , -- ** paramSpecLong #method:paramSpecLong# paramSpecLong , -- ** paramSpecObject #method:paramSpecObject# paramSpecObject , -- ** paramSpecParam #method:paramSpecParam# paramSpecParam , -- ** paramSpecPointer #method:paramSpecPointer# paramSpecPointer , -- ** paramSpecString #method:paramSpecString# paramSpecString , -- ** paramSpecUchar #method:paramSpecUchar# paramSpecUchar , -- ** paramSpecUint #method:paramSpecUint# paramSpecUint , -- ** paramSpecUint64 #method:paramSpecUint64# paramSpecUint64 , -- ** paramSpecUlong #method:paramSpecUlong# paramSpecUlong , -- ** paramSpecUnichar #method:paramSpecUnichar# paramSpecUnichar , -- ** paramSpecVariant #method:paramSpecVariant# paramSpecVariant , -- ** paramTypeRegisterStatic #method:paramTypeRegisterStatic# paramTypeRegisterStatic , -- ** paramValueConvert #method:paramValueConvert# paramValueConvert , -- ** paramValueDefaults #method:paramValueDefaults# paramValueDefaults , -- ** paramValueSetDefault #method:paramValueSetDefault# paramValueSetDefault , -- ** paramValueValidate #method:paramValueValidate# paramValueValidate , -- ** paramValuesCmp #method:paramValuesCmp# paramValuesCmp , -- ** pointerTypeRegisterStatic #method:pointerTypeRegisterStatic# pointerTypeRegisterStatic , -- ** signalAccumulatorFirstWins #method:signalAccumulatorFirstWins# signalAccumulatorFirstWins , -- ** signalAccumulatorTrueHandled #method:signalAccumulatorTrueHandled# signalAccumulatorTrueHandled , -- ** signalAddEmissionHook #method:signalAddEmissionHook# signalAddEmissionHook , -- ** signalChainFromOverridden #method:signalChainFromOverridden# signalChainFromOverridden , -- ** signalConnectClosure #method:signalConnectClosure# signalConnectClosure , -- ** signalConnectClosureById #method:signalConnectClosureById# signalConnectClosureById , -- ** signalEmitv #method:signalEmitv# signalEmitv , -- ** signalGetInvocationHint #method:signalGetInvocationHint# signalGetInvocationHint , -- ** signalHandlerBlock #method:signalHandlerBlock# signalHandlerBlock , -- ** signalHandlerDisconnect #method:signalHandlerDisconnect# signalHandlerDisconnect , -- ** signalHandlerFind #method:signalHandlerFind# signalHandlerFind , -- ** signalHandlerIsConnected #method:signalHandlerIsConnected# signalHandlerIsConnected , -- ** signalHandlerUnblock #method:signalHandlerUnblock# signalHandlerUnblock , -- ** signalHandlersBlockMatched #method:signalHandlersBlockMatched# signalHandlersBlockMatched , -- ** signalHandlersDestroy #method:signalHandlersDestroy# signalHandlersDestroy , -- ** signalHandlersDisconnectMatched #method:signalHandlersDisconnectMatched# signalHandlersDisconnectMatched , -- ** signalHandlersUnblockMatched #method:signalHandlersUnblockMatched# signalHandlersUnblockMatched , -- ** signalHasHandlerPending #method:signalHasHandlerPending# signalHasHandlerPending , -- ** signalListIds #method:signalListIds# signalListIds , -- ** signalLookup #method:signalLookup# signalLookup , -- ** signalName #method:signalName# signalName , -- ** signalOverrideClassClosure #method:signalOverrideClassClosure# signalOverrideClassClosure , -- ** signalParseName #method:signalParseName# signalParseName , -- ** signalQuery #method:signalQuery# signalQuery , -- ** signalRemoveEmissionHook #method:signalRemoveEmissionHook# signalRemoveEmissionHook , -- ** signalStopEmission #method:signalStopEmission# signalStopEmission , -- ** signalStopEmissionByName #method:signalStopEmissionByName# signalStopEmissionByName , -- ** signalTypeCclosureNew #method:signalTypeCclosureNew# signalTypeCclosureNew , -- ** sourceSetClosure #method:sourceSetClosure# sourceSetClosure , -- ** sourceSetDummyCallback #method:sourceSetDummyCallback# sourceSetDummyCallback , -- ** strdupValueContents #method:strdupValueContents# strdupValueContents , -- ** typeAddClassPrivate #method:typeAddClassPrivate# typeAddClassPrivate , -- ** typeAddInstancePrivate #method:typeAddInstancePrivate# typeAddInstancePrivate , -- ** typeAddInterfaceDynamic #method:typeAddInterfaceDynamic# typeAddInterfaceDynamic , -- ** typeAddInterfaceStatic #method:typeAddInterfaceStatic# typeAddInterfaceStatic , -- ** typeCheckClassIsA #method:typeCheckClassIsA# typeCheckClassIsA , -- ** typeCheckInstance #method:typeCheckInstance# typeCheckInstance , -- ** typeCheckInstanceIsA #method:typeCheckInstanceIsA# typeCheckInstanceIsA , -- ** typeCheckInstanceIsFundamentallyA #method:typeCheckInstanceIsFundamentallyA# typeCheckInstanceIsFundamentallyA , -- ** typeCheckIsValueType #method:typeCheckIsValueType# typeCheckIsValueType , -- ** typeCheckValue #method:typeCheckValue# typeCheckValue , -- ** typeCheckValueHolds #method:typeCheckValueHolds# typeCheckValueHolds , -- ** typeChildren #method:typeChildren# typeChildren , -- ** typeDefaultInterfacePeek #method:typeDefaultInterfacePeek# typeDefaultInterfacePeek , -- ** typeDefaultInterfaceRef #method:typeDefaultInterfaceRef# typeDefaultInterfaceRef , -- ** typeDefaultInterfaceUnref #method:typeDefaultInterfaceUnref# typeDefaultInterfaceUnref , -- ** typeDepth #method:typeDepth# typeDepth , -- ** typeEnsure #method:typeEnsure# typeEnsure , -- ** typeFreeInstance #method:typeFreeInstance# typeFreeInstance , -- ** typeFromName #method:typeFromName# typeFromName , -- ** typeFundamental #method:typeFundamental# typeFundamental , -- ** typeFundamentalNext #method:typeFundamentalNext# typeFundamentalNext , -- ** typeGetInstanceCount #method:typeGetInstanceCount# typeGetInstanceCount , -- ** typeGetPlugin #method:typeGetPlugin# typeGetPlugin , -- ** typeGetQdata #method:typeGetQdata# typeGetQdata , -- ** typeGetTypeRegistrationSerial #method:typeGetTypeRegistrationSerial# typeGetTypeRegistrationSerial , -- ** typeInit #method:typeInit# typeInit , -- ** typeInitWithDebugFlags #method:typeInitWithDebugFlags# typeInitWithDebugFlags , -- ** typeInterfaces #method:typeInterfaces# typeInterfaces , -- ** typeIsA #method:typeIsA# typeIsA , -- ** typeName #method:typeName# typeName , -- ** typeNameFromClass #method:typeNameFromClass# typeNameFromClass , -- ** typeNameFromInstance #method:typeNameFromInstance# typeNameFromInstance , -- ** typeNextBase #method:typeNextBase# typeNextBase , -- ** typeParent #method:typeParent# typeParent , -- ** typeQname #method:typeQname# typeQname , -- ** typeQuery #method:typeQuery# typeQuery , -- ** typeRegisterDynamic #method:typeRegisterDynamic# typeRegisterDynamic , -- ** typeRegisterFundamental #method:typeRegisterFundamental# typeRegisterFundamental , -- ** typeRegisterStatic #method:typeRegisterStatic# typeRegisterStatic , -- ** typeSetQdata #method:typeSetQdata# typeSetQdata , -- ** typeTestFlags #method:typeTestFlags# typeTestFlags , ) 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 qualified GI.GLib.Callbacks as GLib.Callbacks import qualified GI.GLib.Structs.Source as GLib.Source import qualified GI.GLib.Structs.VariantType as GLib.VariantType import qualified GI.GObject.Callbacks as GObject.Callbacks import {-# SOURCE #-} qualified GI.GObject.Flags as GObject.Flags import {-# SOURCE #-} qualified GI.GObject.Interfaces.TypePlugin as GObject.TypePlugin import {-# SOURCE #-} qualified GI.GObject.Objects.Object as GObject.Object import {-# SOURCE #-} qualified GI.GObject.Structs.EnumClass as GObject.EnumClass import {-# SOURCE #-} qualified GI.GObject.Structs.EnumValue as GObject.EnumValue import {-# SOURCE #-} qualified GI.GObject.Structs.FlagsClass as GObject.FlagsClass import {-# SOURCE #-} qualified GI.GObject.Structs.FlagsValue as GObject.FlagsValue import {-# SOURCE #-} qualified GI.GObject.Structs.InterfaceInfo as GObject.InterfaceInfo import {-# SOURCE #-} qualified GI.GObject.Structs.ParamSpecTypeInfo as GObject.ParamSpecTypeInfo import {-# SOURCE #-} qualified GI.GObject.Structs.SignalInvocationHint as GObject.SignalInvocationHint import {-# SOURCE #-} qualified GI.GObject.Structs.SignalQuery as GObject.SignalQuery import {-# SOURCE #-} qualified GI.GObject.Structs.TypeClass as GObject.TypeClass import {-# SOURCE #-} qualified GI.GObject.Structs.TypeFundamentalInfo as GObject.TypeFundamentalInfo import {-# SOURCE #-} qualified GI.GObject.Structs.TypeInfo as GObject.TypeInfo import {-# SOURCE #-} qualified GI.GObject.Structs.TypeInstance as GObject.TypeInstance import {-# SOURCE #-} qualified GI.GObject.Structs.TypeInterface as GObject.TypeInterface import {-# SOURCE #-} qualified GI.GObject.Structs.TypeQuery as GObject.TypeQuery -- function g_type_test_flags -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "flags" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_type_test_flags" g_type_test_flags :: CGType -> -- type : TBasicType TGType Word32 -> -- flags : TBasicType TUInt IO CInt -- | /No description available in the introspection data./ typeTestFlags :: (B.CallStack.HasCallStack, MonadIO m) => GType -> Word32 -> m Bool typeTestFlags :: GType -> Word32 -> m Bool typeTestFlags type_ :: GType type_ flags :: Word32 flags = 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 let type_' :: CGType type_' = GType -> CGType gtypeToCGType GType type_ CInt result <- CGType -> Word32 -> IO CInt g_type_test_flags CGType type_' Word32 flags let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function g_type_set_qdata -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GType" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "quark" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GQuark id to identify the data" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "data" -- , argType = TBasicType TPtr -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "the data" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_type_set_qdata" g_type_set_qdata :: CGType -> -- type : TBasicType TGType Word32 -> -- quark : TBasicType TUInt32 Ptr () -> -- data : TBasicType TPtr IO () -- | Attaches arbitrary data to a type. typeSetQdata :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@type@/: a t'GType' -> Word32 -- ^ /@quark@/: a @/GQuark/@ id to identify the data -> Ptr () -- ^ /@data@/: the data -> m () typeSetQdata :: GType -> Word32 -> Ptr () -> m () typeSetQdata type_ :: GType type_ quark :: Word32 quark data_ :: Ptr () data_ = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let type_' :: CGType type_' = GType -> CGType gtypeToCGType GType type_ CGType -> Word32 -> Ptr () -> IO () g_type_set_qdata CGType type_' Word32 quark Ptr () data_ () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_type_register_static -- Args: [ Arg -- { argCName = "parent_type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "type from which this type will be derived" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "type_name" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "0-terminated string used as the name of the new type" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "info" -- , argType = -- TInterface Name { namespace = "GObject" , name = "TypeInfo" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#GTypeInfo structure for this type" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "flags" -- , argType = -- TInterface Name { namespace = "GObject" , name = "TypeFlags" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "bitwise combination of #GTypeFlags values" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TGType) -- throws : False -- Skip return : False foreign import ccall "g_type_register_static" g_type_register_static :: CGType -> -- parent_type : TBasicType TGType CString -> -- type_name : TBasicType TUTF8 Ptr GObject.TypeInfo.TypeInfo -> -- info : TInterface (Name {namespace = "GObject", name = "TypeInfo"}) CUInt -> -- flags : TInterface (Name {namespace = "GObject", name = "TypeFlags"}) IO CGType -- | Registers /@typeName@/ as the name of a new static type derived from -- /@parentType@/. The type system uses the information contained in the -- t'GI.GObject.Structs.TypeInfo.TypeInfo' structure pointed to by /@info@/ to manage the type and its -- instances (if not abstract). The value of /@flags@/ determines the nature -- (e.g. abstract or not) of the type. typeRegisterStatic :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@parentType@/: type from which this type will be derived -> T.Text -- ^ /@typeName@/: 0-terminated string used as the name of the new type -> GObject.TypeInfo.TypeInfo -- ^ /@info@/: t'GI.GObject.Structs.TypeInfo.TypeInfo' structure for this type -> [GObject.Flags.TypeFlags] -- ^ /@flags@/: bitwise combination of t'GI.GObject.Flags.TypeFlags' values -> m GType -- ^ __Returns:__ the new type identifier typeRegisterStatic :: GType -> Text -> TypeInfo -> [TypeFlags] -> m GType typeRegisterStatic parentType :: GType parentType typeName :: Text typeName info :: TypeInfo info flags :: [TypeFlags] flags = IO GType -> m GType forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO GType -> m GType) -> IO GType -> m GType forall a b. (a -> b) -> a -> b $ do let parentType' :: CGType parentType' = GType -> CGType gtypeToCGType GType parentType CString typeName' <- Text -> IO CString textToCString Text typeName Ptr TypeInfo info' <- TypeInfo -> IO (Ptr TypeInfo) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr TypeInfo info let flags' :: CUInt flags' = [TypeFlags] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [TypeFlags] flags CGType result <- CGType -> CString -> Ptr TypeInfo -> CUInt -> IO CGType g_type_register_static CGType parentType' CString typeName' Ptr TypeInfo info' CUInt flags' let result' :: GType result' = CGType -> GType GType CGType result TypeInfo -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr TypeInfo info CString -> IO () forall a. Ptr a -> IO () freeMem CString typeName' GType -> IO GType forall (m :: * -> *) a. Monad m => a -> m a return GType result' -- function g_type_register_fundamental -- Args: [ Arg -- { argCName = "type_id" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a predefined type identifier" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "type_name" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "0-terminated string used as the name of the new type" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "info" -- , argType = -- TInterface Name { namespace = "GObject" , name = "TypeInfo" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#GTypeInfo structure for this type" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "finfo" -- , argType = -- TInterface -- Name { namespace = "GObject" , name = "TypeFundamentalInfo" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#GTypeFundamentalInfo structure for this type" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "flags" -- , argType = -- TInterface Name { namespace = "GObject" , name = "TypeFlags" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "bitwise combination of #GTypeFlags values" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TGType) -- throws : False -- Skip return : False foreign import ccall "g_type_register_fundamental" g_type_register_fundamental :: CGType -> -- type_id : TBasicType TGType CString -> -- type_name : TBasicType TUTF8 Ptr GObject.TypeInfo.TypeInfo -> -- info : TInterface (Name {namespace = "GObject", name = "TypeInfo"}) Ptr GObject.TypeFundamentalInfo.TypeFundamentalInfo -> -- finfo : TInterface (Name {namespace = "GObject", name = "TypeFundamentalInfo"}) CUInt -> -- flags : TInterface (Name {namespace = "GObject", name = "TypeFlags"}) IO CGType -- | Registers /@typeId@/ as the predefined identifier and /@typeName@/ as the -- name of a fundamental type. If /@typeId@/ is already registered, or a -- type named /@typeName@/ is already registered, the behaviour is undefined. -- The type system uses the information contained in the t'GI.GObject.Structs.TypeInfo.TypeInfo' structure -- pointed to by /@info@/ and the t'GI.GObject.Structs.TypeFundamentalInfo.TypeFundamentalInfo' structure pointed to by -- /@finfo@/ to manage the type and its instances. The value of /@flags@/ determines -- additional characteristics of the fundamental type. typeRegisterFundamental :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@typeId@/: a predefined type identifier -> T.Text -- ^ /@typeName@/: 0-terminated string used as the name of the new type -> GObject.TypeInfo.TypeInfo -- ^ /@info@/: t'GI.GObject.Structs.TypeInfo.TypeInfo' structure for this type -> GObject.TypeFundamentalInfo.TypeFundamentalInfo -- ^ /@finfo@/: t'GI.GObject.Structs.TypeFundamentalInfo.TypeFundamentalInfo' structure for this type -> [GObject.Flags.TypeFlags] -- ^ /@flags@/: bitwise combination of t'GI.GObject.Flags.TypeFlags' values -> m GType -- ^ __Returns:__ the predefined type identifier typeRegisterFundamental :: GType -> Text -> TypeInfo -> TypeFundamentalInfo -> [TypeFlags] -> m GType typeRegisterFundamental typeId :: GType typeId typeName :: Text typeName info :: TypeInfo info finfo :: TypeFundamentalInfo finfo flags :: [TypeFlags] flags = IO GType -> m GType forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO GType -> m GType) -> IO GType -> m GType forall a b. (a -> b) -> a -> b $ do let typeId' :: CGType typeId' = GType -> CGType gtypeToCGType GType typeId CString typeName' <- Text -> IO CString textToCString Text typeName Ptr TypeInfo info' <- TypeInfo -> IO (Ptr TypeInfo) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr TypeInfo info Ptr TypeFundamentalInfo finfo' <- TypeFundamentalInfo -> IO (Ptr TypeFundamentalInfo) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr TypeFundamentalInfo finfo let flags' :: CUInt flags' = [TypeFlags] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [TypeFlags] flags CGType result <- CGType -> CString -> Ptr TypeInfo -> Ptr TypeFundamentalInfo -> CUInt -> IO CGType g_type_register_fundamental CGType typeId' CString typeName' Ptr TypeInfo info' Ptr TypeFundamentalInfo finfo' CUInt flags' let result' :: GType result' = CGType -> GType GType CGType result TypeInfo -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr TypeInfo info TypeFundamentalInfo -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr TypeFundamentalInfo finfo CString -> IO () forall a. Ptr a -> IO () freeMem CString typeName' GType -> IO GType forall (m :: * -> *) a. Monad m => a -> m a return GType result' -- function g_type_register_dynamic -- Args: [ Arg -- { argCName = "parent_type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "type from which this type will be derived" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "type_name" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "0-terminated string used as the name of the new type" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "plugin" -- , argType = -- TInterface Name { namespace = "GObject" , name = "TypePlugin" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "#GTypePlugin structure to retrieve the #GTypeInfo from" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "flags" -- , argType = -- TInterface Name { namespace = "GObject" , name = "TypeFlags" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "bitwise combination of #GTypeFlags values" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TGType) -- throws : False -- Skip return : False foreign import ccall "g_type_register_dynamic" g_type_register_dynamic :: CGType -> -- parent_type : TBasicType TGType CString -> -- type_name : TBasicType TUTF8 Ptr GObject.TypePlugin.TypePlugin -> -- plugin : TInterface (Name {namespace = "GObject", name = "TypePlugin"}) CUInt -> -- flags : TInterface (Name {namespace = "GObject", name = "TypeFlags"}) IO CGType -- | Registers /@typeName@/ as the name of a new dynamic type derived from -- /@parentType@/. The type system uses the information contained in the -- t'GI.GObject.Interfaces.TypePlugin.TypePlugin' structure pointed to by /@plugin@/ to manage the type and its -- instances (if not abstract). The value of /@flags@/ determines the nature -- (e.g. abstract or not) of the type. typeRegisterDynamic :: (B.CallStack.HasCallStack, MonadIO m, GObject.TypePlugin.IsTypePlugin a) => GType -- ^ /@parentType@/: type from which this type will be derived -> T.Text -- ^ /@typeName@/: 0-terminated string used as the name of the new type -> a -- ^ /@plugin@/: t'GI.GObject.Interfaces.TypePlugin.TypePlugin' structure to retrieve the t'GI.GObject.Structs.TypeInfo.TypeInfo' from -> [GObject.Flags.TypeFlags] -- ^ /@flags@/: bitwise combination of t'GI.GObject.Flags.TypeFlags' values -> m GType -- ^ __Returns:__ the new type identifier or @/G_TYPE_INVALID/@ if registration failed typeRegisterDynamic :: GType -> Text -> a -> [TypeFlags] -> m GType typeRegisterDynamic parentType :: GType parentType typeName :: Text typeName plugin :: a plugin flags :: [TypeFlags] flags = IO GType -> m GType forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO GType -> m GType) -> IO GType -> m GType forall a b. (a -> b) -> a -> b $ do let parentType' :: CGType parentType' = GType -> CGType gtypeToCGType GType parentType CString typeName' <- Text -> IO CString textToCString Text typeName Ptr TypePlugin plugin' <- a -> IO (Ptr TypePlugin) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a plugin let flags' :: CUInt flags' = [TypeFlags] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [TypeFlags] flags CGType result <- CGType -> CString -> Ptr TypePlugin -> CUInt -> IO CGType g_type_register_dynamic CGType parentType' CString typeName' Ptr TypePlugin plugin' CUInt flags' let result' :: GType result' = CGType -> GType GType CGType result a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a plugin CString -> IO () forall a. Ptr a -> IO () freeMem CString typeName' GType -> IO GType forall (m :: * -> *) a. Monad m => a -> m a return GType result' -- function g_type_query -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#GType of a static, classed type" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "query" -- , argType = -- TInterface Name { namespace = "GObject" , name = "TypeQuery" } -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "a user provided structure that is\n filled in with constant values upon success" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_type_query" g_type_query :: CGType -> -- type : TBasicType TGType Ptr GObject.TypeQuery.TypeQuery -> -- query : TInterface (Name {namespace = "GObject", name = "TypeQuery"}) IO () -- | Queries the type system for information about a specific type. -- This function will fill in a user-provided structure to hold -- type-specific information. If an invalid t'GType' is passed in, the -- /@type@/ member of the t'GI.GObject.Structs.TypeQuery.TypeQuery' is 0. All members filled into the -- t'GI.GObject.Structs.TypeQuery.TypeQuery' structure should be considered constant and have to be -- left untouched. typeQuery :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@type@/: t'GType' of a static, classed type -> m (GObject.TypeQuery.TypeQuery) typeQuery :: GType -> m TypeQuery typeQuery type_ :: GType type_ = IO TypeQuery -> m TypeQuery forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO TypeQuery -> m TypeQuery) -> IO TypeQuery -> m TypeQuery forall a b. (a -> b) -> a -> b $ do let type_' :: CGType type_' = GType -> CGType gtypeToCGType GType type_ Ptr TypeQuery query <- Int -> IO (Ptr TypeQuery) forall a. Int -> IO (Ptr a) callocBytes 24 :: IO (Ptr GObject.TypeQuery.TypeQuery) CGType -> Ptr TypeQuery -> IO () g_type_query CGType type_' Ptr TypeQuery query TypeQuery query' <- ((ManagedPtr TypeQuery -> TypeQuery) -> Ptr TypeQuery -> IO TypeQuery forall a. (HasCallStack, WrappedPtr a) => (ManagedPtr a -> a) -> Ptr a -> IO a wrapPtr ManagedPtr TypeQuery -> TypeQuery GObject.TypeQuery.TypeQuery) Ptr TypeQuery query TypeQuery -> IO TypeQuery forall (m :: * -> *) a. Monad m => a -> m a return TypeQuery query' -- function g_type_qname -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "type to return quark of type name for" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt32) -- throws : False -- Skip return : False foreign import ccall "g_type_qname" g_type_qname :: CGType -> -- type : TBasicType TGType IO Word32 -- | Get the corresponding quark of the type IDs name. typeQname :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@type@/: type to return quark of type name for -> m Word32 -- ^ __Returns:__ the type names quark or 0 typeQname :: GType -> m Word32 typeQname type_ :: GType type_ = 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 let type_' :: CGType type_' = GType -> CGType gtypeToCGType GType type_ Word32 result <- CGType -> IO Word32 g_type_qname CGType type_' Word32 -> IO Word32 forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function g_type_parent -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the derived type" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TGType) -- throws : False -- Skip return : False foreign import ccall "g_type_parent" g_type_parent :: CGType -> -- type : TBasicType TGType IO CGType -- | Return the direct parent type of the passed in type. If the passed -- in type has no parent, i.e. is a fundamental type, 0 is returned. typeParent :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@type@/: the derived type -> m GType -- ^ __Returns:__ the parent type typeParent :: GType -> m GType typeParent type_ :: GType type_ = IO GType -> m GType forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO GType -> m GType) -> IO GType -> m GType forall a b. (a -> b) -> a -> b $ do let type_' :: CGType type_' = GType -> CGType gtypeToCGType GType type_ CGType result <- CGType -> IO CGType g_type_parent CGType type_' let result' :: GType result' = CGType -> GType GType CGType result GType -> IO GType forall (m :: * -> *) a. Monad m => a -> m a return GType result' -- function g_type_next_base -- Args: [ Arg -- { argCName = "leaf_type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "descendant of @root_type and the type to be returned" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "root_type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "immediate parent of the returned type" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TGType) -- throws : False -- Skip return : False foreign import ccall "g_type_next_base" g_type_next_base :: CGType -> -- leaf_type : TBasicType TGType CGType -> -- root_type : TBasicType TGType IO CGType -- | Given a /@leafType@/ and a /@rootType@/ which is contained in its -- anchestry, return the type that /@rootType@/ is the immediate parent -- of. In other words, this function determines the type that is -- derived directly from /@rootType@/ which is also a base class of -- /@leafType@/. Given a root type and a leaf type, this function can -- be used to determine the types and order in which the leaf type is -- descended from the root type. typeNextBase :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@leafType@/: descendant of /@rootType@/ and the type to be returned -> GType -- ^ /@rootType@/: immediate parent of the returned type -> m GType -- ^ __Returns:__ immediate child of /@rootType@/ and anchestor of /@leafType@/ typeNextBase :: GType -> GType -> m GType typeNextBase leafType :: GType leafType rootType :: GType rootType = IO GType -> m GType forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO GType -> m GType) -> IO GType -> m GType forall a b. (a -> b) -> a -> b $ do let leafType' :: CGType leafType' = GType -> CGType gtypeToCGType GType leafType let rootType' :: CGType rootType' = GType -> CGType gtypeToCGType GType rootType CGType result <- CGType -> CGType -> IO CGType g_type_next_base CGType leafType' CGType rootType' let result' :: GType result' = CGType -> GType GType CGType result GType -> IO GType forall (m :: * -> *) a. Monad m => a -> m a return GType result' -- function g_type_name_from_instance -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "TypeInstance" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_type_name_from_instance" g_type_name_from_instance :: Ptr GObject.TypeInstance.TypeInstance -> -- instance : TInterface (Name {namespace = "GObject", name = "TypeInstance"}) IO CString -- | /No description available in the introspection data./ typeNameFromInstance :: (B.CallStack.HasCallStack, MonadIO m) => GObject.TypeInstance.TypeInstance -> m T.Text typeNameFromInstance :: TypeInstance -> m Text typeNameFromInstance instance_ :: TypeInstance instance_ = 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 TypeInstance instance_' <- TypeInstance -> IO (Ptr TypeInstance) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr TypeInstance instance_ CString result <- Ptr TypeInstance -> IO CString g_type_name_from_instance Ptr TypeInstance instance_' Text -> CString -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "typeNameFromInstance" CString result Text result' <- HasCallStack => CString -> IO Text CString -> IO Text cstringToText CString result TypeInstance -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr TypeInstance instance_ Text -> IO Text forall (m :: * -> *) a. Monad m => a -> m a return Text result' -- function g_type_name_from_class -- Args: [ Arg -- { argCName = "g_class" -- , argType = -- TInterface Name { namespace = "GObject" , name = "TypeClass" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_type_name_from_class" g_type_name_from_class :: Ptr GObject.TypeClass.TypeClass -> -- g_class : TInterface (Name {namespace = "GObject", name = "TypeClass"}) IO CString -- | /No description available in the introspection data./ typeNameFromClass :: (B.CallStack.HasCallStack, MonadIO m) => GObject.TypeClass.TypeClass -> m T.Text typeNameFromClass :: TypeClass -> m Text typeNameFromClass gClass :: TypeClass gClass = 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 TypeClass gClass' <- TypeClass -> IO (Ptr TypeClass) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr TypeClass gClass CString result <- Ptr TypeClass -> IO CString g_type_name_from_class Ptr TypeClass gClass' Text -> CString -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "typeNameFromClass" CString result Text result' <- HasCallStack => CString -> IO Text CString -> IO Text cstringToText CString result TypeClass -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr TypeClass gClass Text -> IO Text forall (m :: * -> *) a. Monad m => a -> m a return Text result' -- function g_type_name -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "type to return name for" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_type_name" g_type_name :: CGType -> -- type : TBasicType TGType IO CString -- | Get the unique name that is assigned to a type ID. Note that this -- function (like all other GType API) cannot cope with invalid type -- IDs. @/G_TYPE_INVALID/@ may be passed to this function, as may be any -- other validly registered type ID, but randomized type IDs should -- not be passed in and will most likely lead to a crash. typeName :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@type@/: type to return name for -> m T.Text -- ^ __Returns:__ static type name or 'P.Nothing' typeName :: GType -> m Text typeName type_ :: GType type_ = 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 let type_' :: CGType type_' = GType -> CGType gtypeToCGType GType type_ CString result <- CGType -> IO CString g_type_name CGType type_' Text -> CString -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "typeName" CString result 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' -- function g_type_is_a -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "type to check anchestry for" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "is_a_type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "possible anchestor of @type or interface that @type\n could conform to" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_type_is_a" g_type_is_a :: CGType -> -- type : TBasicType TGType CGType -> -- is_a_type : TBasicType TGType IO CInt -- | If /@isAType@/ is a derivable type, check whether /@type@/ is a -- descendant of /@isAType@/. If /@isAType@/ is an interface, check -- whether /@type@/ conforms to it. typeIsA :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@type@/: type to check anchestry for -> GType -- ^ /@isAType@/: possible anchestor of /@type@/ or interface that /@type@/ -- could conform to -> m Bool -- ^ __Returns:__ 'P.True' if /@type@/ is a /@isAType@/ typeIsA :: GType -> GType -> m Bool typeIsA type_ :: GType type_ isAType :: GType isAType = 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 let type_' :: CGType type_' = GType -> CGType gtypeToCGType GType type_ let isAType' :: CGType isAType' = GType -> CGType gtypeToCGType GType isAType CInt result <- CGType -> CGType -> IO CInt g_type_is_a CGType type_' CGType isAType' let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function g_type_interfaces -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the type to list interface types for" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "n_interfaces" -- , argType = TBasicType TUInt -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "location to store the length of\n the returned array, or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "n_interfaces" -- , argType = TBasicType TUInt -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "location to store the length of\n the returned array, or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TCArray False (-1) 1 (TBasicType TGType)) -- throws : False -- Skip return : False foreign import ccall "g_type_interfaces" g_type_interfaces :: CGType -> -- type : TBasicType TGType Ptr Word32 -> -- n_interfaces : TBasicType TUInt IO (Ptr CGType) -- | Return a newly allocated and 0-terminated array of type IDs, listing -- the interface types that /@type@/ conforms to. typeInterfaces :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@type@/: the type to list interface types for -> m [GType] -- ^ __Returns:__ Newly allocated -- and 0-terminated array of interface types, free with 'GI.GLib.Functions.free' typeInterfaces :: GType -> m [GType] typeInterfaces type_ :: GType type_ = IO [GType] -> m [GType] forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [GType] -> m [GType]) -> IO [GType] -> m [GType] forall a b. (a -> b) -> a -> b $ do let type_' :: CGType type_' = GType -> CGType gtypeToCGType GType type_ Ptr Word32 nInterfaces <- IO (Ptr Word32) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Word32) Ptr CGType result <- CGType -> Ptr Word32 -> IO (Ptr CGType) g_type_interfaces CGType type_' Ptr Word32 nInterfaces Word32 nInterfaces' <- Ptr Word32 -> IO Word32 forall a. Storable a => Ptr a -> IO a peek Ptr Word32 nInterfaces Text -> Ptr CGType -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "typeInterfaces" Ptr CGType result [GType] result' <- ((CGType -> GType) -> Word32 -> Ptr CGType -> IO [GType] forall a b c. (Integral a, Storable b) => (b -> c) -> a -> Ptr b -> IO [c] unpackMapStorableArrayWithLength CGType -> GType GType Word32 nInterfaces') Ptr CGType result Ptr CGType -> IO () forall a. Ptr a -> IO () freeMem Ptr CGType result Ptr Word32 -> IO () forall a. Ptr a -> IO () freeMem Ptr Word32 nInterfaces [GType] -> IO [GType] forall (m :: * -> *) a. Monad m => a -> m a return [GType] result' -- function g_type_init_with_debug_flags -- Args: [ Arg -- { argCName = "debug_flags" -- , argType = -- TInterface Name { namespace = "GObject" , name = "TypeDebugFlags" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "bitwise combination of #GTypeDebugFlags values for\n debugging purposes" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_type_init_with_debug_flags" g_type_init_with_debug_flags :: CUInt -> -- debug_flags : TInterface (Name {namespace = "GObject", name = "TypeDebugFlags"}) IO () {-# DEPRECATED typeInitWithDebugFlags ["(Since version 2.36)","the type system is now initialised automatically"] #-} -- | This function used to initialise the type system with debugging -- flags. Since GLib 2.36, the type system is initialised automatically -- and this function does nothing. -- -- If you need to enable debugging features, use the GOBJECT_DEBUG -- environment variable. typeInitWithDebugFlags :: (B.CallStack.HasCallStack, MonadIO m) => [GObject.Flags.TypeDebugFlags] -- ^ /@debugFlags@/: bitwise combination of t'GI.GObject.Flags.TypeDebugFlags' values for -- debugging purposes -> m () typeInitWithDebugFlags :: [TypeDebugFlags] -> m () typeInitWithDebugFlags debugFlags :: [TypeDebugFlags] debugFlags = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let debugFlags' :: CUInt debugFlags' = [TypeDebugFlags] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [TypeDebugFlags] debugFlags CUInt -> IO () g_type_init_with_debug_flags CUInt debugFlags' () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_type_init -- Args: [] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_type_init" g_type_init :: IO () {-# DEPRECATED typeInit ["(Since version 2.36)","the type system is now initialised automatically"] #-} -- | This function used to initialise the type system. Since GLib 2.36, -- the type system is initialised automatically and this function does -- nothing. typeInit :: (B.CallStack.HasCallStack, MonadIO m) => m () typeInit :: m () typeInit = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do IO () g_type_init () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_type_get_type_registration_serial -- Args: [] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "g_type_get_type_registration_serial" g_type_get_type_registration_serial :: IO Word32 -- | Returns an opaque serial number that represents the state of the set -- of registered types. Any time a type is registered this serial changes, -- which means you can cache information based on type lookups (such as -- 'GI.GObject.Functions.typeFromName') and know if the cache is still valid at a later -- time by comparing the current serial with the one at the type lookup. -- -- /Since: 2.36/ typeGetTypeRegistrationSerial :: (B.CallStack.HasCallStack, MonadIO m) => m Word32 -- ^ __Returns:__ An unsigned int, representing the state of type registrations typeGetTypeRegistrationSerial :: m Word32 typeGetTypeRegistrationSerial = 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 Word32 result <- IO Word32 g_type_get_type_registration_serial Word32 -> IO Word32 forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function g_type_get_qdata -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GType" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "quark" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GQuark id to identify the data" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TPtr) -- throws : False -- Skip return : False foreign import ccall "g_type_get_qdata" g_type_get_qdata :: CGType -> -- type : TBasicType TGType Word32 -> -- quark : TBasicType TUInt32 IO (Ptr ()) -- | Obtains data which has previously been attached to /@type@/ -- with 'GI.GObject.Functions.typeSetQdata'. -- -- Note that this does not take subtyping into account; data -- attached to one type with 'GI.GObject.Functions.typeSetQdata' cannot -- be retrieved from a subtype using 'GI.GObject.Functions.typeGetQdata'. typeGetQdata :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@type@/: a t'GType' -> Word32 -- ^ /@quark@/: a @/GQuark/@ id to identify the data -> m (Ptr ()) -- ^ __Returns:__ the data, or 'P.Nothing' if no data was found typeGetQdata :: GType -> Word32 -> m (Ptr ()) typeGetQdata type_ :: GType type_ quark :: Word32 quark = IO (Ptr ()) -> m (Ptr ()) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ()) forall a b. (a -> b) -> a -> b $ do let type_' :: CGType type_' = GType -> CGType gtypeToCGType GType type_ Ptr () result <- CGType -> Word32 -> IO (Ptr ()) g_type_get_qdata CGType type_' Word32 quark Ptr () -> IO (Ptr ()) forall (m :: * -> *) a. Monad m => a -> m a return Ptr () result -- function g_type_get_plugin -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#GType to retrieve the plugin for" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "GObject" , name = "TypePlugin" }) -- throws : False -- Skip return : False foreign import ccall "g_type_get_plugin" g_type_get_plugin :: CGType -> -- type : TBasicType TGType IO (Ptr GObject.TypePlugin.TypePlugin) -- | Returns the t'GI.GObject.Interfaces.TypePlugin.TypePlugin' structure for /@type@/. typeGetPlugin :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@type@/: t'GType' to retrieve the plugin for -> m GObject.TypePlugin.TypePlugin -- ^ __Returns:__ the corresponding plugin -- if /@type@/ is a dynamic type, 'P.Nothing' otherwise typeGetPlugin :: GType -> m TypePlugin typeGetPlugin type_ :: GType type_ = IO TypePlugin -> m TypePlugin forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO TypePlugin -> m TypePlugin) -> IO TypePlugin -> m TypePlugin forall a b. (a -> b) -> a -> b $ do let type_' :: CGType type_' = GType -> CGType gtypeToCGType GType type_ Ptr TypePlugin result <- CGType -> IO (Ptr TypePlugin) g_type_get_plugin CGType type_' Text -> Ptr TypePlugin -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "typeGetPlugin" Ptr TypePlugin result TypePlugin result' <- ((ManagedPtr TypePlugin -> TypePlugin) -> Ptr TypePlugin -> IO TypePlugin forall a. (HasCallStack, WrappedPtr a) => (ManagedPtr a -> a) -> Ptr a -> IO a newPtr ManagedPtr TypePlugin -> TypePlugin GObject.TypePlugin.TypePlugin) Ptr TypePlugin result TypePlugin -> IO TypePlugin forall (m :: * -> *) a. Monad m => a -> m a return TypePlugin result' -- function g_type_get_instance_count -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GType" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "g_type_get_instance_count" g_type_get_instance_count :: CGType -> -- type : TBasicType TGType IO Int32 -- | Returns the number of instances allocated of the particular type; -- this is only available if GLib is built with debugging support and -- the instance_count debug flag is set (by setting the GOBJECT_DEBUG -- variable to include instance-count). -- -- /Since: 2.44/ typeGetInstanceCount :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@type@/: a t'GType' -> m Int32 -- ^ __Returns:__ the number of instances allocated of the given type; -- if instance counts are not available, returns 0. typeGetInstanceCount :: GType -> m Int32 typeGetInstanceCount type_ :: GType type_ = 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 let type_' :: CGType type_' = GType -> CGType gtypeToCGType GType type_ Int32 result <- CGType -> IO Int32 g_type_get_instance_count CGType type_' Int32 -> IO Int32 forall (m :: * -> *) a. Monad m => a -> m a return Int32 result -- function g_type_fundamental_next -- Args: [] -- Lengths: [] -- returnType: Just (TBasicType TGType) -- throws : False -- Skip return : False foreign import ccall "g_type_fundamental_next" g_type_fundamental_next :: IO CGType -- | Returns the next free fundamental type id which can be used to -- register a new fundamental type with 'GI.GObject.Functions.typeRegisterFundamental'. -- The returned type ID represents the highest currently registered -- fundamental type identifier. typeFundamentalNext :: (B.CallStack.HasCallStack, MonadIO m) => m GType -- ^ __Returns:__ the next available fundamental type ID to be registered, -- or 0 if the type system ran out of fundamental type IDs typeFundamentalNext :: m GType typeFundamentalNext = IO GType -> m GType forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO GType -> m GType) -> IO GType -> m GType forall a b. (a -> b) -> a -> b $ do CGType result <- IO CGType g_type_fundamental_next let result' :: GType result' = CGType -> GType GType CGType result GType -> IO GType forall (m :: * -> *) a. Monad m => a -> m a return GType result' -- function g_type_fundamental -- Args: [ Arg -- { argCName = "type_id" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "valid type ID" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TGType) -- throws : False -- Skip return : False foreign import ccall "g_type_fundamental" g_type_fundamental :: CGType -> -- type_id : TBasicType TGType IO CGType -- | Internal function, used to extract the fundamental type ID portion. -- Use @/G_TYPE_FUNDAMENTAL()/@ instead. typeFundamental :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@typeId@/: valid type ID -> m GType -- ^ __Returns:__ fundamental type ID typeFundamental :: GType -> m GType typeFundamental typeId :: GType typeId = IO GType -> m GType forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO GType -> m GType) -> IO GType -> m GType forall a b. (a -> b) -> a -> b $ do let typeId' :: CGType typeId' = GType -> CGType gtypeToCGType GType typeId CGType result <- CGType -> IO CGType g_type_fundamental CGType typeId' let result' :: GType result' = CGType -> GType GType CGType result GType -> IO GType forall (m :: * -> *) a. Monad m => a -> m a return GType result' -- function g_type_from_name -- Args: [ Arg -- { argCName = "name" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "type name to lookup" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TGType) -- throws : False -- Skip return : False foreign import ccall "g_type_from_name" g_type_from_name :: CString -> -- name : TBasicType TUTF8 IO CGType -- | Lookup the type ID from a given type name, returning 0 if no type -- has been registered under this name (this is the preferred method -- to find out by name whether a specific type has been registered -- yet). typeFromName :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@name@/: type name to lookup -> m GType -- ^ __Returns:__ corresponding type ID or 0 typeFromName :: Text -> m GType typeFromName name :: Text name = IO GType -> m GType forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO GType -> m GType) -> IO GType -> m GType forall a b. (a -> b) -> a -> b $ do CString name' <- Text -> IO CString textToCString Text name CGType result <- CString -> IO CGType g_type_from_name CString name' let result' :: GType result' = CGType -> GType GType CGType result CString -> IO () forall a. Ptr a -> IO () freeMem CString name' GType -> IO GType forall (m :: * -> *) a. Monad m => a -> m a return GType result' -- function g_type_free_instance -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "TypeInstance" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an instance of a type" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_type_free_instance" g_type_free_instance :: Ptr GObject.TypeInstance.TypeInstance -> -- instance : TInterface (Name {namespace = "GObject", name = "TypeInstance"}) IO () -- | Frees an instance of a type, returning it to the instance pool for -- the type, if there is one. -- -- Like @/g_type_create_instance()/@, this function is reserved for -- implementors of fundamental types. typeFreeInstance :: (B.CallStack.HasCallStack, MonadIO m) => GObject.TypeInstance.TypeInstance -- ^ /@instance@/: an instance of a type -> m () typeFreeInstance :: TypeInstance -> m () typeFreeInstance instance_ :: TypeInstance instance_ = 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 TypeInstance instance_' <- TypeInstance -> IO (Ptr TypeInstance) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr TypeInstance instance_ Ptr TypeInstance -> IO () g_type_free_instance Ptr TypeInstance instance_' TypeInstance -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr TypeInstance instance_ () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_type_ensure -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GType" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_type_ensure" g_type_ensure :: CGType -> -- type : TBasicType TGType IO () -- | Ensures that the indicated /@type@/ has been registered with the -- type system, and its @/_class_init()/@ method has been run. -- -- In theory, simply calling the type\'s @/_get_type()/@ method (or using -- the corresponding macro) is supposed take care of this. However, -- @/_get_type()/@ methods are often marked @/G_GNUC_CONST/@ for performance -- reasons, even though this is technically incorrect (since -- @/G_GNUC_CONST/@ requires that the function not have side effects, -- which @/_get_type()/@ methods do on the first call). As a result, if -- you write a bare call to a @/_get_type()/@ macro, it may get optimized -- out by the compiler. Using 'GI.GObject.Functions.typeEnsure' guarantees that the -- type\'s @/_get_type()/@ method is called. -- -- /Since: 2.34/ typeEnsure :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@type@/: a t'GType' -> m () typeEnsure :: GType -> m () typeEnsure type_ :: GType type_ = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let type_' :: CGType type_' = GType -> CGType gtypeToCGType GType type_ CGType -> IO () g_type_ensure CGType type_' () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_type_depth -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GType" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "g_type_depth" g_type_depth :: CGType -> -- type : TBasicType TGType IO Word32 -- | Returns the length of the ancestry of the passed in type. This -- includes the type itself, so that e.g. a fundamental type has depth 1. typeDepth :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@type@/: a t'GType' -> m Word32 -- ^ __Returns:__ the depth of /@type@/ typeDepth :: GType -> m Word32 typeDepth type_ :: GType type_ = 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 let type_' :: CGType type_' = GType -> CGType gtypeToCGType GType type_ Word32 result <- CGType -> IO Word32 g_type_depth CGType type_' Word32 -> IO Word32 forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function g_type_default_interface_unref -- Args: [ Arg -- { argCName = "g_iface" -- , argType = -- TInterface Name { namespace = "GObject" , name = "TypeInterface" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the default vtable\n structure for a interface, as returned by g_type_default_interface_ref()" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_type_default_interface_unref" g_type_default_interface_unref :: Ptr GObject.TypeInterface.TypeInterface -> -- g_iface : TInterface (Name {namespace = "GObject", name = "TypeInterface"}) IO () -- | Decrements the reference count for the type corresponding to the -- interface default vtable /@gIface@/. If the type is dynamic, then -- when no one is using the interface and all references have -- been released, the finalize function for the interface\'s default -- vtable (the /@classFinalize@/ member of t'GI.GObject.Structs.TypeInfo.TypeInfo') will be called. -- -- /Since: 2.4/ typeDefaultInterfaceUnref :: (B.CallStack.HasCallStack, MonadIO m) => GObject.TypeInterface.TypeInterface -- ^ /@gIface@/: the default vtable -- structure for a interface, as returned by 'GI.GObject.Functions.typeDefaultInterfaceRef' -> m () typeDefaultInterfaceUnref :: TypeInterface -> m () typeDefaultInterfaceUnref gIface :: TypeInterface gIface = 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 TypeInterface gIface' <- TypeInterface -> IO (Ptr TypeInterface) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr TypeInterface gIface Ptr TypeInterface -> IO () g_type_default_interface_unref Ptr TypeInterface gIface' TypeInterface -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr TypeInterface gIface () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_type_default_interface_ref -- Args: [ Arg -- { argCName = "g_type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an interface type" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "GObject" , name = "TypeInterface" }) -- throws : False -- Skip return : False foreign import ccall "g_type_default_interface_ref" g_type_default_interface_ref :: CGType -> -- g_type : TBasicType TGType IO (Ptr GObject.TypeInterface.TypeInterface) -- | Increments the reference count for the interface type /@gType@/, -- and returns the default interface vtable for the type. -- -- If the type is not currently in use, then the default vtable -- for the type will be created and initalized by calling -- the base interface init and default vtable init functions for -- the type (the /@baseInit@/ and /@classInit@/ members of t'GI.GObject.Structs.TypeInfo.TypeInfo'). -- Calling 'GI.GObject.Functions.typeDefaultInterfaceRef' is useful when you -- want to make sure that signals and properties for an interface -- have been installed. -- -- /Since: 2.4/ typeDefaultInterfaceRef :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@gType@/: an interface type -> m GObject.TypeInterface.TypeInterface -- ^ __Returns:__ the default -- vtable for the interface; call 'GI.GObject.Functions.typeDefaultInterfaceUnref' -- when you are done using the interface. typeDefaultInterfaceRef :: GType -> m TypeInterface typeDefaultInterfaceRef gType :: GType gType = IO TypeInterface -> m TypeInterface forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO TypeInterface -> m TypeInterface) -> IO TypeInterface -> m TypeInterface forall a b. (a -> b) -> a -> b $ do let gType' :: CGType gType' = GType -> CGType gtypeToCGType GType gType Ptr TypeInterface result <- CGType -> IO (Ptr TypeInterface) g_type_default_interface_ref CGType gType' Text -> Ptr TypeInterface -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "typeDefaultInterfaceRef" Ptr TypeInterface result TypeInterface result' <- ((ManagedPtr TypeInterface -> TypeInterface) -> Ptr TypeInterface -> IO TypeInterface forall a. (HasCallStack, WrappedPtr a) => (ManagedPtr a -> a) -> Ptr a -> IO a newPtr ManagedPtr TypeInterface -> TypeInterface GObject.TypeInterface.TypeInterface) Ptr TypeInterface result TypeInterface -> IO TypeInterface forall (m :: * -> *) a. Monad m => a -> m a return TypeInterface result' -- function g_type_default_interface_peek -- Args: [ Arg -- { argCName = "g_type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an interface type" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "GObject" , name = "TypeInterface" }) -- throws : False -- Skip return : False foreign import ccall "g_type_default_interface_peek" g_type_default_interface_peek :: CGType -> -- g_type : TBasicType TGType IO (Ptr GObject.TypeInterface.TypeInterface) -- | If the interface type /@gType@/ is currently in use, returns its -- default interface vtable. -- -- /Since: 2.4/ typeDefaultInterfacePeek :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@gType@/: an interface type -> m GObject.TypeInterface.TypeInterface -- ^ __Returns:__ the default -- vtable for the interface, or 'P.Nothing' if the type is not currently -- in use typeDefaultInterfacePeek :: GType -> m TypeInterface typeDefaultInterfacePeek gType :: GType gType = IO TypeInterface -> m TypeInterface forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO TypeInterface -> m TypeInterface) -> IO TypeInterface -> m TypeInterface forall a b. (a -> b) -> a -> b $ do let gType' :: CGType gType' = GType -> CGType gtypeToCGType GType gType Ptr TypeInterface result <- CGType -> IO (Ptr TypeInterface) g_type_default_interface_peek CGType gType' Text -> Ptr TypeInterface -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "typeDefaultInterfacePeek" Ptr TypeInterface result TypeInterface result' <- ((ManagedPtr TypeInterface -> TypeInterface) -> Ptr TypeInterface -> IO TypeInterface forall a. (HasCallStack, WrappedPtr a) => (ManagedPtr a -> a) -> Ptr a -> IO a newPtr ManagedPtr TypeInterface -> TypeInterface GObject.TypeInterface.TypeInterface) Ptr TypeInterface result TypeInterface -> IO TypeInterface forall (m :: * -> *) a. Monad m => a -> m a return TypeInterface result' -- function g_type_children -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the parent type" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "n_children" -- , argType = TBasicType TUInt -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "location to store the length of\n the returned array, or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "n_children" -- , argType = TBasicType TUInt -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "location to store the length of\n the returned array, or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TCArray False (-1) 1 (TBasicType TGType)) -- throws : False -- Skip return : False foreign import ccall "g_type_children" g_type_children :: CGType -> -- type : TBasicType TGType Ptr Word32 -> -- n_children : TBasicType TUInt IO (Ptr CGType) -- | Return a newly allocated and 0-terminated array of type IDs, listing -- the child types of /@type@/. typeChildren :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@type@/: the parent type -> m [GType] -- ^ __Returns:__ Newly allocated -- and 0-terminated array of child types, free with 'GI.GLib.Functions.free' typeChildren :: GType -> m [GType] typeChildren type_ :: GType type_ = IO [GType] -> m [GType] forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [GType] -> m [GType]) -> IO [GType] -> m [GType] forall a b. (a -> b) -> a -> b $ do let type_' :: CGType type_' = GType -> CGType gtypeToCGType GType type_ Ptr Word32 nChildren <- IO (Ptr Word32) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Word32) Ptr CGType result <- CGType -> Ptr Word32 -> IO (Ptr CGType) g_type_children CGType type_' Ptr Word32 nChildren Word32 nChildren' <- Ptr Word32 -> IO Word32 forall a. Storable a => Ptr a -> IO a peek Ptr Word32 nChildren Text -> Ptr CGType -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "typeChildren" Ptr CGType result [GType] result' <- ((CGType -> GType) -> Word32 -> Ptr CGType -> IO [GType] forall a b c. (Integral a, Storable b) => (b -> c) -> a -> Ptr b -> IO [c] unpackMapStorableArrayWithLength CGType -> GType GType Word32 nChildren') Ptr CGType result Ptr CGType -> IO () forall a. Ptr a -> IO () freeMem Ptr CGType result Ptr Word32 -> IO () forall a. Ptr a -> IO () freeMem Ptr Word32 nChildren [GType] -> IO [GType] forall (m :: * -> *) a. Monad m => a -> m a return [GType] result' -- function g_type_check_value_holds -- Args: [ Arg -- { argCName = "value" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Value" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_type_check_value_holds" g_type_check_value_holds :: Ptr GValue -> -- value : TInterface (Name {namespace = "GObject", name = "Value"}) CGType -> -- type : TBasicType TGType IO CInt -- | /No description available in the introspection data./ typeCheckValueHolds :: (B.CallStack.HasCallStack, MonadIO m) => GValue -> GType -> m Bool typeCheckValueHolds :: GValue -> GType -> m Bool typeCheckValueHolds value :: GValue value type_ :: GType type_ = 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 GValue value' <- GValue -> IO (Ptr GValue) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GValue value let type_' :: CGType type_' = GType -> CGType gtypeToCGType GType type_ CInt result <- Ptr GValue -> CGType -> IO CInt g_type_check_value_holds Ptr GValue value' CGType type_' let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result GValue -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr GValue value Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function g_type_check_value -- Args: [ Arg -- { argCName = "value" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Value" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_type_check_value" g_type_check_value :: Ptr GValue -> -- value : TInterface (Name {namespace = "GObject", name = "Value"}) IO CInt -- | /No description available in the introspection data./ typeCheckValue :: (B.CallStack.HasCallStack, MonadIO m) => GValue -> m Bool typeCheckValue :: GValue -> m Bool typeCheckValue value :: GValue value = 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 GValue value' <- GValue -> IO (Ptr GValue) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GValue value CInt result <- Ptr GValue -> IO CInt g_type_check_value Ptr GValue value' let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result GValue -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr GValue value Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function g_type_check_is_value_type -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_type_check_is_value_type" g_type_check_is_value_type :: CGType -> -- type : TBasicType TGType IO CInt -- | /No description available in the introspection data./ typeCheckIsValueType :: (B.CallStack.HasCallStack, MonadIO m) => GType -> m Bool typeCheckIsValueType :: GType -> m Bool typeCheckIsValueType type_ :: GType type_ = 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 let type_' :: CGType type_' = GType -> CGType gtypeToCGType GType type_ CInt result <- CGType -> IO CInt g_type_check_is_value_type CGType type_' let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function g_type_check_instance_is_fundamentally_a -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "TypeInstance" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "fundamental_type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_type_check_instance_is_fundamentally_a" g_type_check_instance_is_fundamentally_a :: Ptr GObject.TypeInstance.TypeInstance -> -- instance : TInterface (Name {namespace = "GObject", name = "TypeInstance"}) CGType -> -- fundamental_type : TBasicType TGType IO CInt -- | /No description available in the introspection data./ typeCheckInstanceIsFundamentallyA :: (B.CallStack.HasCallStack, MonadIO m) => GObject.TypeInstance.TypeInstance -> GType -> m Bool typeCheckInstanceIsFundamentallyA :: TypeInstance -> GType -> m Bool typeCheckInstanceIsFundamentallyA instance_ :: TypeInstance instance_ fundamentalType :: GType fundamentalType = 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 TypeInstance instance_' <- TypeInstance -> IO (Ptr TypeInstance) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr TypeInstance instance_ let fundamentalType' :: CGType fundamentalType' = GType -> CGType gtypeToCGType GType fundamentalType CInt result <- Ptr TypeInstance -> CGType -> IO CInt g_type_check_instance_is_fundamentally_a Ptr TypeInstance instance_' CGType fundamentalType' let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result TypeInstance -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr TypeInstance instance_ Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function g_type_check_instance_is_a -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "TypeInstance" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "iface_type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_type_check_instance_is_a" g_type_check_instance_is_a :: Ptr GObject.TypeInstance.TypeInstance -> -- instance : TInterface (Name {namespace = "GObject", name = "TypeInstance"}) CGType -> -- iface_type : TBasicType TGType IO CInt -- | /No description available in the introspection data./ typeCheckInstanceIsA :: (B.CallStack.HasCallStack, MonadIO m) => GObject.TypeInstance.TypeInstance -> GType -> m Bool typeCheckInstanceIsA :: TypeInstance -> GType -> m Bool typeCheckInstanceIsA instance_ :: TypeInstance instance_ ifaceType :: GType ifaceType = 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 TypeInstance instance_' <- TypeInstance -> IO (Ptr TypeInstance) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr TypeInstance instance_ let ifaceType' :: CGType ifaceType' = GType -> CGType gtypeToCGType GType ifaceType CInt result <- Ptr TypeInstance -> CGType -> IO CInt g_type_check_instance_is_a Ptr TypeInstance instance_' CGType ifaceType' let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result TypeInstance -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr TypeInstance instance_ Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function g_type_check_instance -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "TypeInstance" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a valid #GTypeInstance structure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_type_check_instance" g_type_check_instance :: Ptr GObject.TypeInstance.TypeInstance -> -- instance : TInterface (Name {namespace = "GObject", name = "TypeInstance"}) IO CInt -- | Private helper function to aid implementation of the -- @/G_TYPE_CHECK_INSTANCE()/@ macro. typeCheckInstance :: (B.CallStack.HasCallStack, MonadIO m) => GObject.TypeInstance.TypeInstance -- ^ /@instance@/: a valid t'GI.GObject.Structs.TypeInstance.TypeInstance' structure -> m Bool -- ^ __Returns:__ 'P.True' if /@instance@/ is valid, 'P.False' otherwise typeCheckInstance :: TypeInstance -> m Bool typeCheckInstance instance_ :: TypeInstance instance_ = 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 TypeInstance instance_' <- TypeInstance -> IO (Ptr TypeInstance) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr TypeInstance instance_ CInt result <- Ptr TypeInstance -> IO CInt g_type_check_instance Ptr TypeInstance instance_' let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result TypeInstance -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr TypeInstance instance_ Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function g_type_check_class_is_a -- Args: [ Arg -- { argCName = "g_class" -- , argType = -- TInterface Name { namespace = "GObject" , name = "TypeClass" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "is_a_type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_type_check_class_is_a" g_type_check_class_is_a :: Ptr GObject.TypeClass.TypeClass -> -- g_class : TInterface (Name {namespace = "GObject", name = "TypeClass"}) CGType -> -- is_a_type : TBasicType TGType IO CInt -- | /No description available in the introspection data./ typeCheckClassIsA :: (B.CallStack.HasCallStack, MonadIO m) => GObject.TypeClass.TypeClass -> GType -> m Bool typeCheckClassIsA :: TypeClass -> GType -> m Bool typeCheckClassIsA gClass :: TypeClass gClass isAType :: GType isAType = 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 TypeClass gClass' <- TypeClass -> IO (Ptr TypeClass) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr TypeClass gClass let isAType' :: CGType isAType' = GType -> CGType gtypeToCGType GType isAType CInt result <- Ptr TypeClass -> CGType -> IO CInt g_type_check_class_is_a Ptr TypeClass gClass' CGType isAType' let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result TypeClass -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr TypeClass gClass Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function g_type_add_interface_static -- Args: [ Arg -- { argCName = "instance_type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#GType value of an instantiable type" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "interface_type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#GType value of an interface type" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "info" -- , argType = -- TInterface Name { namespace = "GObject" , name = "InterfaceInfo" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "#GInterfaceInfo structure for this\n (@instance_type, @interface_type) combination" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_type_add_interface_static" g_type_add_interface_static :: CGType -> -- instance_type : TBasicType TGType CGType -> -- interface_type : TBasicType TGType Ptr GObject.InterfaceInfo.InterfaceInfo -> -- info : TInterface (Name {namespace = "GObject", name = "InterfaceInfo"}) IO () -- | Adds the static /@interfaceType@/ to /@instantiableType@/. -- The information contained in the t'GI.GObject.Structs.InterfaceInfo.InterfaceInfo' structure -- pointed to by /@info@/ is used to manage the relationship. typeAddInterfaceStatic :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@instanceType@/: t'GType' value of an instantiable type -> GType -- ^ /@interfaceType@/: t'GType' value of an interface type -> GObject.InterfaceInfo.InterfaceInfo -- ^ /@info@/: t'GI.GObject.Structs.InterfaceInfo.InterfaceInfo' structure for this -- (/@instanceType@/, /@interfaceType@/) combination -> m () typeAddInterfaceStatic :: GType -> GType -> InterfaceInfo -> m () typeAddInterfaceStatic instanceType :: GType instanceType interfaceType :: GType interfaceType info :: InterfaceInfo info = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let instanceType' :: CGType instanceType' = GType -> CGType gtypeToCGType GType instanceType let interfaceType' :: CGType interfaceType' = GType -> CGType gtypeToCGType GType interfaceType Ptr InterfaceInfo info' <- InterfaceInfo -> IO (Ptr InterfaceInfo) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr InterfaceInfo info CGType -> CGType -> Ptr InterfaceInfo -> IO () g_type_add_interface_static CGType instanceType' CGType interfaceType' Ptr InterfaceInfo info' InterfaceInfo -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr InterfaceInfo info () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_type_add_interface_dynamic -- Args: [ Arg -- { argCName = "instance_type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#GType value of an instantiable type" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "interface_type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#GType value of an interface type" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "plugin" -- , argType = -- TInterface Name { namespace = "GObject" , name = "TypePlugin" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "#GTypePlugin structure to retrieve the #GInterfaceInfo from" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_type_add_interface_dynamic" g_type_add_interface_dynamic :: CGType -> -- instance_type : TBasicType TGType CGType -> -- interface_type : TBasicType TGType Ptr GObject.TypePlugin.TypePlugin -> -- plugin : TInterface (Name {namespace = "GObject", name = "TypePlugin"}) IO () -- | Adds the dynamic /@interfaceType@/ to /@instantiableType@/. The information -- contained in the t'GI.GObject.Interfaces.TypePlugin.TypePlugin' structure pointed to by /@plugin@/ -- is used to manage the relationship. typeAddInterfaceDynamic :: (B.CallStack.HasCallStack, MonadIO m, GObject.TypePlugin.IsTypePlugin a) => GType -- ^ /@instanceType@/: t'GType' value of an instantiable type -> GType -- ^ /@interfaceType@/: t'GType' value of an interface type -> a -- ^ /@plugin@/: t'GI.GObject.Interfaces.TypePlugin.TypePlugin' structure to retrieve the t'GI.GObject.Structs.InterfaceInfo.InterfaceInfo' from -> m () typeAddInterfaceDynamic :: GType -> GType -> a -> m () typeAddInterfaceDynamic instanceType :: GType instanceType interfaceType :: GType interfaceType plugin :: a plugin = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let instanceType' :: CGType instanceType' = GType -> CGType gtypeToCGType GType instanceType let interfaceType' :: CGType interfaceType' = GType -> CGType gtypeToCGType GType interfaceType Ptr TypePlugin plugin' <- a -> IO (Ptr TypePlugin) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a plugin CGType -> CGType -> Ptr TypePlugin -> IO () g_type_add_interface_dynamic CGType instanceType' CGType interfaceType' Ptr TypePlugin plugin' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a plugin () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_type_add_instance_private -- Args: [ Arg -- { argCName = "class_type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "private_size" -- , argType = TBasicType TUInt64 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "g_type_add_instance_private" g_type_add_instance_private :: CGType -> -- class_type : TBasicType TGType Word64 -> -- private_size : TBasicType TUInt64 IO Int32 -- | /No description available in the introspection data./ typeAddInstancePrivate :: (B.CallStack.HasCallStack, MonadIO m) => GType -> Word64 -> m Int32 typeAddInstancePrivate :: GType -> CGType -> m Int32 typeAddInstancePrivate classType :: GType classType privateSize :: CGType privateSize = 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 let classType' :: CGType classType' = GType -> CGType gtypeToCGType GType classType Int32 result <- CGType -> CGType -> IO Int32 g_type_add_instance_private CGType classType' CGType privateSize Int32 -> IO Int32 forall (m :: * -> *) a. Monad m => a -> m a return Int32 result -- function g_type_add_class_private -- Args: [ Arg -- { argCName = "class_type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "GType of an classed type" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "private_size" -- , argType = TBasicType TUInt64 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "size of private structure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_type_add_class_private" g_type_add_class_private :: CGType -> -- class_type : TBasicType TGType Word64 -> -- private_size : TBasicType TUInt64 IO () -- | Registers a private class structure for a classed type; -- when the class is allocated, the private structures for -- the class and all of its parent types are allocated -- sequentially in the same memory block as the public -- structures, and are zero-filled. -- -- This function should be called in the -- type\'s @/get_type()/@ function after the type is registered. -- The private structure can be retrieved using the -- @/G_TYPE_CLASS_GET_PRIVATE()/@ macro. -- -- /Since: 2.24/ typeAddClassPrivate :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@classType@/: GType of an classed type -> Word64 -- ^ /@privateSize@/: size of private structure -> m () typeAddClassPrivate :: GType -> CGType -> m () typeAddClassPrivate classType :: GType classType privateSize :: CGType privateSize = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let classType' :: CGType classType' = GType -> CGType gtypeToCGType GType classType CGType -> CGType -> IO () g_type_add_class_private CGType classType' CGType privateSize () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_strdup_value_contents -- Args: [ Arg -- { argCName = "value" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Value" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#GValue which contents are to be described." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_strdup_value_contents" g_strdup_value_contents :: Ptr GValue -> -- value : TInterface (Name {namespace = "GObject", name = "Value"}) IO CString -- | Return a newly allocated string, which describes the contents of a -- t'GI.GObject.Structs.Value.Value'. The main purpose of this function is to describe t'GI.GObject.Structs.Value.Value' -- contents for debugging output, the way in which the contents are -- described may change between different GLib versions. strdupValueContents :: (B.CallStack.HasCallStack, MonadIO m) => GValue -- ^ /@value@/: t'GI.GObject.Structs.Value.Value' which contents are to be described. -> m T.Text -- ^ __Returns:__ Newly allocated string. strdupValueContents :: GValue -> m Text strdupValueContents value :: GValue value = 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 GValue value' <- GValue -> IO (Ptr GValue) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GValue value CString result <- Ptr GValue -> IO CString g_strdup_value_contents Ptr GValue value' Text -> CString -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "strdupValueContents" CString result Text result' <- HasCallStack => CString -> IO Text CString -> IO Text cstringToText CString result CString -> IO () forall a. Ptr a -> IO () freeMem CString result GValue -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr GValue value Text -> IO Text forall (m :: * -> *) a. Monad m => a -> m a return Text result' -- function g_source_set_dummy_callback -- Args: [ Arg -- { argCName = "source" -- , argType = -- TInterface Name { namespace = "GLib" , name = "Source" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the source" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_source_set_dummy_callback" g_source_set_dummy_callback :: Ptr GLib.Source.Source -> -- source : TInterface (Name {namespace = "GLib", name = "Source"}) IO () -- | Sets a dummy callback for /@source@/. The callback will do nothing, and -- if the source expects a t'P.Bool' return value, it will return 'P.True'. -- (If the source expects any other type of return value, it will return -- a 0\/'P.Nothing' value; whatever 'GI.GObject.Structs.Value.valueInit' initializes a t'GI.GObject.Structs.Value.Value' to for -- that type.) -- -- If the source is not one of the standard GLib types, the -- /@closureCallback@/ and /@closureMarshal@/ fields of the t'GI.GLib.Structs.SourceFuncs.SourceFuncs' -- structure must have been filled in with pointers to appropriate -- functions. sourceSetDummyCallback :: (B.CallStack.HasCallStack, MonadIO m) => GLib.Source.Source -- ^ /@source@/: the source -> m () sourceSetDummyCallback :: Source -> m () sourceSetDummyCallback source :: Source source = 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 Source source' <- Source -> IO (Ptr Source) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Source source Ptr Source -> IO () g_source_set_dummy_callback Ptr Source source' Source -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Source source () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_source_set_closure -- Args: [ Arg -- { argCName = "source" -- , argType = -- TInterface Name { namespace = "GLib" , name = "Source" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the source" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "closure" -- , argType = TGClosure Nothing -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GClosure" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_source_set_closure" g_source_set_closure :: Ptr GLib.Source.Source -> -- source : TInterface (Name {namespace = "GLib", name = "Source"}) Ptr (GClosure ()) -> -- closure : TGClosure Nothing IO () -- | Set the callback for a source as a t'GI.GObject.Structs.Closure.Closure'. -- -- If the source is not one of the standard GLib types, the /@closureCallback@/ -- and /@closureMarshal@/ fields of the t'GI.GLib.Structs.SourceFuncs.SourceFuncs' structure must have been -- filled in with pointers to appropriate functions. sourceSetClosure :: (B.CallStack.HasCallStack, MonadIO m) => GLib.Source.Source -- ^ /@source@/: the source -> GClosure a -- ^ /@closure@/: a t'GI.GObject.Structs.Closure.Closure' -> m () sourceSetClosure :: Source -> GClosure a -> m () sourceSetClosure source :: Source source closure :: GClosure a closure = 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 Source source' <- Source -> IO (Ptr Source) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Source source Ptr (GClosure ()) closure' <- GClosure a -> IO (Ptr (GClosure ())) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr GClosure a closure Ptr Source -> Ptr (GClosure ()) -> IO () g_source_set_closure Ptr Source source' Ptr (GClosure ()) closure' Source -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Source source GClosure a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr GClosure a closure () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_signal_type_cclosure_new -- Args: [ Arg -- { argCName = "itype" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the #GType identifier of an interface or classed type" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "struct_offset" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the offset of the member function of @itype's class\n structure which is to be invoked by the new closure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TGClosure Nothing) -- throws : False -- Skip return : False foreign import ccall "g_signal_type_cclosure_new" g_signal_type_cclosure_new :: CGType -> -- itype : TBasicType TGType Word32 -> -- struct_offset : TBasicType TUInt IO (Ptr (GClosure ())) -- | Creates a new closure which invokes the function found at the offset -- /@structOffset@/ in the class structure of the interface or classed type -- identified by /@itype@/. signalTypeCclosureNew :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@itype@/: the t'GType' identifier of an interface or classed type -> Word32 -- ^ /@structOffset@/: the offset of the member function of /@itype@/\'s class -- structure which is to be invoked by the new closure -> m (GClosure a) -- ^ __Returns:__ a floating reference to a new t'GI.GObject.Structs.CClosure.CClosure' signalTypeCclosureNew :: GType -> Word32 -> m (GClosure a) signalTypeCclosureNew itype :: GType itype structOffset :: Word32 structOffset = IO (GClosure a) -> m (GClosure a) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (GClosure a) -> m (GClosure a)) -> IO (GClosure a) -> m (GClosure a) forall a b. (a -> b) -> a -> b $ do let itype' :: CGType itype' = GType -> CGType gtypeToCGType GType itype Ptr (GClosure ()) result <- CGType -> Word32 -> IO (Ptr (GClosure ())) g_signal_type_cclosure_new CGType itype' Word32 structOffset Text -> Ptr (GClosure ()) -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "signalTypeCclosureNew" Ptr (GClosure ()) result GClosure a result' <- (Ptr (GClosure a) -> IO (GClosure a) forall a. Ptr (GClosure a) -> IO (GClosure a) B.GClosure.newGClosureFromPtr (Ptr (GClosure a) -> IO (GClosure a)) -> (Ptr (GClosure ()) -> Ptr (GClosure a)) -> Ptr (GClosure ()) -> IO (GClosure a) forall b c a. (b -> c) -> (a -> b) -> a -> c . Ptr (GClosure ()) -> Ptr (GClosure a) forall a b. Ptr a -> Ptr b FP.castPtr) Ptr (GClosure ()) result GClosure a -> IO (GClosure a) forall (m :: * -> *) a. Monad m => a -> m a return GClosure a result' -- function g_signal_stop_emission_by_name -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Object" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the object whose signal handlers you wish to stop." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "detailed_signal" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a string of the form \"signal-name::detail\"." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_signal_stop_emission_by_name" g_signal_stop_emission_by_name :: Ptr GObject.Object.Object -> -- instance : TInterface (Name {namespace = "GObject", name = "Object"}) CString -> -- detailed_signal : TBasicType TUTF8 IO () -- | Stops a signal\'s current emission. -- -- This is just like 'GI.GObject.Functions.signalStopEmission' except it will look up the -- signal id for you. signalStopEmissionByName :: (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) => a -- ^ /@instance@/: the object whose signal handlers you wish to stop. -> T.Text -- ^ /@detailedSignal@/: a string of the form \"signal-name[detail](#signal:detail)\". -> m () signalStopEmissionByName :: a -> Text -> m () signalStopEmissionByName instance_ :: a instance_ detailedSignal :: Text detailedSignal = 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 Object instance_' <- a -> IO (Ptr Object) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a instance_ CString detailedSignal' <- Text -> IO CString textToCString Text detailedSignal Ptr Object -> CString -> IO () g_signal_stop_emission_by_name Ptr Object instance_' CString detailedSignal' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a instance_ CString -> IO () forall a. Ptr a -> IO () freeMem CString detailedSignal' () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_signal_stop_emission -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Object" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the object whose signal handlers you wish to stop." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "signal_id" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the signal identifier, as returned by g_signal_lookup()." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "detail" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the detail which the signal was emitted with." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_signal_stop_emission" g_signal_stop_emission :: Ptr GObject.Object.Object -> -- instance : TInterface (Name {namespace = "GObject", name = "Object"}) Word32 -> -- signal_id : TBasicType TUInt Word32 -> -- detail : TBasicType TUInt32 IO () -- | Stops a signal\'s current emission. -- -- This will prevent the default method from running, if the signal was -- 'GI.GObject.Flags.SignalFlagsRunLast' and you connected normally (i.e. without the \"after\" -- flag). -- -- Prints a warning if used on a signal which isn\'t being emitted. signalStopEmission :: (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) => a -- ^ /@instance@/: the object whose signal handlers you wish to stop. -> Word32 -- ^ /@signalId@/: the signal identifier, as returned by 'GI.GObject.Functions.signalLookup'. -> Word32 -- ^ /@detail@/: the detail which the signal was emitted with. -> m () signalStopEmission :: a -> Word32 -> Word32 -> m () signalStopEmission instance_ :: a instance_ signalId :: Word32 signalId detail :: Word32 detail = 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 Object instance_' <- a -> IO (Ptr Object) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a instance_ Ptr Object -> Word32 -> Word32 -> IO () g_signal_stop_emission Ptr Object instance_' Word32 signalId Word32 detail a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a instance_ () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_signal_remove_emission_hook -- Args: [ Arg -- { argCName = "signal_id" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the id of the signal" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "hook_id" -- , argType = TBasicType TULong -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the id of the emission hook, as returned by\n g_signal_add_emission_hook()" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_signal_remove_emission_hook" g_signal_remove_emission_hook :: Word32 -> -- signal_id : TBasicType TUInt CULong -> -- hook_id : TBasicType TULong IO () -- | Deletes an emission hook. signalRemoveEmissionHook :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@signalId@/: the id of the signal -> CULong -- ^ /@hookId@/: the id of the emission hook, as returned by -- 'GI.GObject.Functions.signalAddEmissionHook' -> m () signalRemoveEmissionHook :: Word32 -> CULong -> m () signalRemoveEmissionHook signalId :: Word32 signalId hookId :: CULong hookId = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do Word32 -> CULong -> IO () g_signal_remove_emission_hook Word32 signalId CULong hookId () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_signal_query -- Args: [ Arg -- { argCName = "signal_id" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The signal id of the signal to query information for." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "query" -- , argType = -- TInterface Name { namespace = "GObject" , name = "SignalQuery" } -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "A user provided structure that is\n filled in with constant values upon success." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_signal_query" g_signal_query :: Word32 -> -- signal_id : TBasicType TUInt Ptr GObject.SignalQuery.SignalQuery -> -- query : TInterface (Name {namespace = "GObject", name = "SignalQuery"}) IO () -- | Queries the signal system for in-depth information about a -- specific signal. This function will fill in a user-provided -- structure to hold signal-specific information. If an invalid -- signal id is passed in, the /@signalId@/ member of the t'GI.GObject.Structs.SignalQuery.SignalQuery' -- is 0. All members filled into the t'GI.GObject.Structs.SignalQuery.SignalQuery' structure should -- be considered constant and have to be left untouched. signalQuery :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@signalId@/: The signal id of the signal to query information for. -> m (GObject.SignalQuery.SignalQuery) signalQuery :: Word32 -> m SignalQuery signalQuery signalId :: Word32 signalId = IO SignalQuery -> m SignalQuery forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO SignalQuery -> m SignalQuery) -> IO SignalQuery -> m SignalQuery forall a b. (a -> b) -> a -> b $ do Ptr SignalQuery query <- Int -> IO (Ptr SignalQuery) forall a. Int -> IO (Ptr a) callocBytes 56 :: IO (Ptr GObject.SignalQuery.SignalQuery) Word32 -> Ptr SignalQuery -> IO () g_signal_query Word32 signalId Ptr SignalQuery query SignalQuery query' <- ((ManagedPtr SignalQuery -> SignalQuery) -> Ptr SignalQuery -> IO SignalQuery forall a. (HasCallStack, WrappedPtr a) => (ManagedPtr a -> a) -> Ptr a -> IO a wrapPtr ManagedPtr SignalQuery -> SignalQuery GObject.SignalQuery.SignalQuery) Ptr SignalQuery query SignalQuery -> IO SignalQuery forall (m :: * -> *) a. Monad m => a -> m a return SignalQuery query' -- function g_signal_parse_name -- Args: [ Arg -- { argCName = "detailed_signal" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a string of the form \"signal-name::detail\"." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "itype" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The interface/instance type that introduced \"signal-name\"." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "signal_id_p" -- , argType = TBasicType TUInt -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Location to store the signal id." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "detail_p" -- , argType = TBasicType TUInt32 -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Location to store the detail quark." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "force_detail_quark" -- , argType = TBasicType TBoolean -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "%TRUE forces creation of a #GQuark for the detail." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_signal_parse_name" g_signal_parse_name :: CString -> -- detailed_signal : TBasicType TUTF8 CGType -> -- itype : TBasicType TGType Ptr Word32 -> -- signal_id_p : TBasicType TUInt Ptr Word32 -> -- detail_p : TBasicType TUInt32 CInt -> -- force_detail_quark : TBasicType TBoolean IO CInt -- | Internal function to parse a signal name into its /@signalId@/ -- and /@detail@/ quark. signalParseName :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@detailedSignal@/: a string of the form \"signal-name[detail](#signal:detail)\". -> GType -- ^ /@itype@/: The interface\/instance type that introduced \"signal-name\". -> Bool -- ^ /@forceDetailQuark@/: 'P.True' forces creation of a @/GQuark/@ for the detail. -> m ((Bool, Word32, Word32)) -- ^ __Returns:__ Whether the signal name could successfully be parsed and /@signalIdP@/ and /@detailP@/ contain valid return values. signalParseName :: Text -> GType -> Bool -> m (Bool, Word32, Word32) signalParseName detailedSignal :: Text detailedSignal itype :: GType itype forceDetailQuark :: Bool forceDetailQuark = IO (Bool, Word32, Word32) -> m (Bool, Word32, Word32) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Bool, Word32, Word32) -> m (Bool, Word32, Word32)) -> IO (Bool, Word32, Word32) -> m (Bool, Word32, Word32) forall a b. (a -> b) -> a -> b $ do CString detailedSignal' <- Text -> IO CString textToCString Text detailedSignal let itype' :: CGType itype' = GType -> CGType gtypeToCGType GType itype Ptr Word32 signalIdP <- IO (Ptr Word32) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Word32) Ptr Word32 detailP <- IO (Ptr Word32) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Word32) let forceDetailQuark' :: CInt forceDetailQuark' = (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 forceDetailQuark CInt result <- CString -> CGType -> Ptr Word32 -> Ptr Word32 -> CInt -> IO CInt g_signal_parse_name CString detailedSignal' CGType itype' Ptr Word32 signalIdP Ptr Word32 detailP CInt forceDetailQuark' let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result Word32 signalIdP' <- Ptr Word32 -> IO Word32 forall a. Storable a => Ptr a -> IO a peek Ptr Word32 signalIdP Word32 detailP' <- Ptr Word32 -> IO Word32 forall a. Storable a => Ptr a -> IO a peek Ptr Word32 detailP CString -> IO () forall a. Ptr a -> IO () freeMem CString detailedSignal' Ptr Word32 -> IO () forall a. Ptr a -> IO () freeMem Ptr Word32 signalIdP Ptr Word32 -> IO () forall a. Ptr a -> IO () freeMem Ptr Word32 detailP (Bool, Word32, Word32) -> IO (Bool, Word32, Word32) forall (m :: * -> *) a. Monad m => a -> m a return (Bool result', Word32 signalIdP', Word32 detailP') -- function g_signal_override_class_closure -- Args: [ Arg -- { argCName = "signal_id" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the signal id" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "instance_type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the instance type on which to override the class closure\n for the signal." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "class_closure" -- , argType = TGClosure Nothing -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the closure." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_signal_override_class_closure" g_signal_override_class_closure :: Word32 -> -- signal_id : TBasicType TUInt CGType -> -- instance_type : TBasicType TGType Ptr (GClosure ()) -> -- class_closure : TGClosure Nothing IO () -- | Overrides the class closure (i.e. the default handler) for the given signal -- for emissions on instances of /@instanceType@/. /@instanceType@/ must be derived -- from the type to which the signal belongs. -- -- See 'GI.GObject.Functions.signalChainFromOverridden' and -- @/g_signal_chain_from_overridden_handler()/@ for how to chain up to the -- parent class closure from inside the overridden one. signalOverrideClassClosure :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@signalId@/: the signal id -> GType -- ^ /@instanceType@/: the instance type on which to override the class closure -- for the signal. -> GClosure a -- ^ /@classClosure@/: the closure. -> m () signalOverrideClassClosure :: Word32 -> GType -> GClosure a -> m () signalOverrideClassClosure signalId :: Word32 signalId instanceType :: GType instanceType classClosure :: GClosure a classClosure = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let instanceType' :: CGType instanceType' = GType -> CGType gtypeToCGType GType instanceType Ptr (GClosure ()) classClosure' <- GClosure a -> IO (Ptr (GClosure ())) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr GClosure a classClosure Word32 -> CGType -> Ptr (GClosure ()) -> IO () g_signal_override_class_closure Word32 signalId CGType instanceType' Ptr (GClosure ()) classClosure' GClosure a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr GClosure a classClosure () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_signal_name -- Args: [ Arg -- { argCName = "signal_id" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the signal's identifying number." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_signal_name" g_signal_name :: Word32 -> -- signal_id : TBasicType TUInt IO CString -- | Given the signal\'s identifier, finds its name. -- -- Two different signals may have the same name, if they have differing types. signalName :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@signalId@/: the signal\'s identifying number. -> m T.Text -- ^ __Returns:__ the signal name, or 'P.Nothing' if the signal number was invalid. signalName :: Word32 -> m Text signalName signalId :: Word32 signalId = 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 CString result <- Word32 -> IO CString g_signal_name Word32 signalId Text -> CString -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "signalName" CString result 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' -- function g_signal_lookup -- Args: [ Arg -- { argCName = "name" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the signal's name." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "itype" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the type that the signal operates on." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "g_signal_lookup" g_signal_lookup :: CString -> -- name : TBasicType TUTF8 CGType -> -- itype : TBasicType TGType IO Word32 -- | Given the name of the signal and the type of object it connects to, gets -- the signal\'s identifying integer. Emitting the signal by number is -- somewhat faster than using the name each time. -- -- Also tries the ancestors of the given type. -- -- See @/g_signal_new()/@ for details on allowed signal names. signalLookup :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@name@/: the signal\'s name. -> GType -- ^ /@itype@/: the type that the signal operates on. -> m Word32 -- ^ __Returns:__ the signal\'s identifying number, or 0 if no signal was found. signalLookup :: Text -> GType -> m Word32 signalLookup name :: Text name itype :: GType itype = 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 CString name' <- Text -> IO CString textToCString Text name let itype' :: CGType itype' = GType -> CGType gtypeToCGType GType itype Word32 result <- CString -> CGType -> IO Word32 g_signal_lookup CString name' CGType itype' CString -> IO () forall a. Ptr a -> IO () freeMem CString name' Word32 -> IO Word32 forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function g_signal_list_ids -- Args: [ Arg -- { argCName = "itype" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Instance or interface type." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "n_ids" -- , argType = TBasicType TUInt -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "Location to store the number of signal ids for @itype." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "n_ids" -- , argType = TBasicType TUInt -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "Location to store the number of signal ids for @itype." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TCArray False (-1) 1 (TBasicType TUInt)) -- throws : False -- Skip return : False foreign import ccall "g_signal_list_ids" g_signal_list_ids :: CGType -> -- itype : TBasicType TGType Ptr Word32 -> -- n_ids : TBasicType TUInt IO (Ptr Word32) -- | Lists the signals by id that a certain instance or interface type -- created. Further information about the signals can be acquired through -- 'GI.GObject.Functions.signalQuery'. signalListIds :: (B.CallStack.HasCallStack, MonadIO m) => GType -- ^ /@itype@/: Instance or interface type. -> m [Word32] -- ^ __Returns:__ Newly allocated array of signal IDs. signalListIds :: GType -> m [Word32] signalListIds itype :: GType itype = 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 let itype' :: CGType itype' = GType -> CGType gtypeToCGType GType itype Ptr Word32 nIds <- IO (Ptr Word32) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Word32) Ptr Word32 result <- CGType -> Ptr Word32 -> IO (Ptr Word32) g_signal_list_ids CGType itype' Ptr Word32 nIds Word32 nIds' <- Ptr Word32 -> IO Word32 forall a. Storable a => Ptr a -> IO a peek Ptr Word32 nIds Text -> Ptr Word32 -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "signalListIds" Ptr Word32 result [Word32] result' <- (Word32 -> Ptr Word32 -> IO [Word32] forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b] unpackStorableArrayWithLength Word32 nIds') Ptr Word32 result Ptr Word32 -> IO () forall a. Ptr a -> IO () freeMem Ptr Word32 result Ptr Word32 -> IO () forall a. Ptr a -> IO () freeMem Ptr Word32 nIds [Word32] -> IO [Word32] forall (m :: * -> *) a. Monad m => a -> m a return [Word32] result' -- function g_signal_has_handler_pending -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Object" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the object whose signal handlers are sought." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "signal_id" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the signal id." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "detail" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the detail." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "may_be_blocked" -- , argType = TBasicType TBoolean -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "whether blocked handlers should count as match." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_signal_has_handler_pending" g_signal_has_handler_pending :: Ptr GObject.Object.Object -> -- instance : TInterface (Name {namespace = "GObject", name = "Object"}) Word32 -> -- signal_id : TBasicType TUInt Word32 -> -- detail : TBasicType TUInt32 CInt -> -- may_be_blocked : TBasicType TBoolean IO CInt -- | Returns whether there are any handlers connected to /@instance@/ for the -- given signal id and detail. -- -- If /@detail@/ is 0 then it will only match handlers that were connected -- without detail. If /@detail@/ is non-zero then it will match handlers -- connected both without detail and with the given detail. This is -- consistent with how a signal emitted with /@detail@/ would be delivered -- to those handlers. -- -- Since 2.46 this also checks for a non-default class closure being -- installed, as this is basically always what you want. -- -- One example of when you might use this is when the arguments to the -- signal are difficult to compute. A class implementor may opt to not -- emit the signal if no one is attached anyway, thus saving the cost -- of building the arguments. signalHasHandlerPending :: (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) => a -- ^ /@instance@/: the object whose signal handlers are sought. -> Word32 -- ^ /@signalId@/: the signal id. -> Word32 -- ^ /@detail@/: the detail. -> Bool -- ^ /@mayBeBlocked@/: whether blocked handlers should count as match. -> m Bool -- ^ __Returns:__ 'P.True' if a handler is connected to the signal, 'P.False' -- otherwise. signalHasHandlerPending :: a -> Word32 -> Word32 -> Bool -> m Bool signalHasHandlerPending instance_ :: a instance_ signalId :: Word32 signalId detail :: Word32 detail mayBeBlocked :: Bool mayBeBlocked = 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 Object instance_' <- a -> IO (Ptr Object) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a instance_ let mayBeBlocked' :: CInt mayBeBlocked' = (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 mayBeBlocked CInt result <- Ptr Object -> Word32 -> Word32 -> CInt -> IO CInt g_signal_has_handler_pending Ptr Object instance_' Word32 signalId Word32 detail CInt mayBeBlocked' let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a instance_ Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function g_signal_handlers_unblock_matched -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Object" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The instance to unblock handlers from." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "mask" -- , argType = -- TInterface -- Name { namespace = "GObject" , name = "SignalMatchType" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Mask indicating which of @signal_id, @detail, @closure, @func\n and/or @data the handlers have to match." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "signal_id" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Signal the handlers have to be connected to." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "detail" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "Signal detail the handlers have to be connected to." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "closure" -- , argType = TGClosure Nothing -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "The closure the handlers will invoke." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "func" -- , argType = TBasicType TPtr -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "The C closure callback of the handlers (useless for non-C closures)." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "data" -- , argType = TBasicType TPtr -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "The closure data of the handlers' closures." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "g_signal_handlers_unblock_matched" g_signal_handlers_unblock_matched :: Ptr GObject.Object.Object -> -- instance : TInterface (Name {namespace = "GObject", name = "Object"}) CUInt -> -- mask : TInterface (Name {namespace = "GObject", name = "SignalMatchType"}) Word32 -> -- signal_id : TBasicType TUInt Word32 -> -- detail : TBasicType TUInt32 Ptr (GClosure ()) -> -- closure : TGClosure Nothing Ptr () -> -- func : TBasicType TPtr Ptr () -> -- data : TBasicType TPtr IO Word32 -- | Unblocks all handlers on an instance that match a certain selection -- criteria. The criteria mask is passed as an OR-ed combination of -- t'GI.GObject.Flags.SignalMatchType' flags, and the criteria values are passed as arguments. -- Passing at least one of the 'GI.GObject.Flags.SignalMatchTypeClosure', 'GI.GObject.Flags.SignalMatchTypeFunc' -- or 'GI.GObject.Flags.SignalMatchTypeData' match flags is required for successful matches. -- If no handlers were found, 0 is returned, the number of unblocked handlers -- otherwise. The match criteria should not apply to any handlers that are -- not currently blocked. signalHandlersUnblockMatched :: (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) => a -- ^ /@instance@/: The instance to unblock handlers from. -> [GObject.Flags.SignalMatchType] -- ^ /@mask@/: Mask indicating which of /@signalId@/, /@detail@/, /@closure@/, /@func@/ -- and\/or /@data@/ the handlers have to match. -> Word32 -- ^ /@signalId@/: Signal the handlers have to be connected to. -> Word32 -- ^ /@detail@/: Signal detail the handlers have to be connected to. -> Maybe (GClosure b) -- ^ /@closure@/: The closure the handlers will invoke. -> Ptr () -- ^ /@func@/: The C closure callback of the handlers (useless for non-C closures). -> Ptr () -- ^ /@data@/: The closure data of the handlers\' closures. -> m Word32 -- ^ __Returns:__ The number of handlers that matched. signalHandlersUnblockMatched :: a -> [SignalMatchType] -> Word32 -> Word32 -> Maybe (GClosure b) -> Ptr () -> Ptr () -> m Word32 signalHandlersUnblockMatched instance_ :: a instance_ mask :: [SignalMatchType] mask signalId :: Word32 signalId detail :: Word32 detail closure :: Maybe (GClosure b) closure func :: Ptr () func data_ :: Ptr () data_ = 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 Object instance_' <- a -> IO (Ptr Object) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a instance_ let mask' :: CUInt mask' = [SignalMatchType] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [SignalMatchType] mask Ptr (GClosure ()) maybeClosure <- case Maybe (GClosure b) closure of Nothing -> Ptr (GClosure ()) -> IO (Ptr (GClosure ())) forall (m :: * -> *) a. Monad m => a -> m a return Ptr (GClosure ()) forall a. Ptr a nullPtr Just jClosure :: GClosure b jClosure -> do Ptr (GClosure ()) jClosure' <- GClosure b -> IO (Ptr (GClosure ())) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr GClosure b jClosure Ptr (GClosure ()) -> IO (Ptr (GClosure ())) forall (m :: * -> *) a. Monad m => a -> m a return Ptr (GClosure ()) jClosure' Word32 result <- Ptr Object -> CUInt -> Word32 -> Word32 -> Ptr (GClosure ()) -> Ptr () -> Ptr () -> IO Word32 g_signal_handlers_unblock_matched Ptr Object instance_' CUInt mask' Word32 signalId Word32 detail Ptr (GClosure ()) maybeClosure Ptr () func Ptr () data_ a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a instance_ Maybe (GClosure b) -> (GClosure b -> IO ()) -> IO () forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe (GClosure b) closure GClosure b -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Word32 -> IO Word32 forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function g_signal_handlers_disconnect_matched -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Object" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The instance to remove handlers from." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "mask" -- , argType = -- TInterface -- Name { namespace = "GObject" , name = "SignalMatchType" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Mask indicating which of @signal_id, @detail, @closure, @func\n and/or @data the handlers have to match." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "signal_id" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Signal the handlers have to be connected to." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "detail" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "Signal detail the handlers have to be connected to." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "closure" -- , argType = TGClosure Nothing -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "The closure the handlers will invoke." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "func" -- , argType = TBasicType TPtr -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "The C closure callback of the handlers (useless for non-C closures)." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "data" -- , argType = TBasicType TPtr -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "The closure data of the handlers' closures." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "g_signal_handlers_disconnect_matched" g_signal_handlers_disconnect_matched :: Ptr GObject.Object.Object -> -- instance : TInterface (Name {namespace = "GObject", name = "Object"}) CUInt -> -- mask : TInterface (Name {namespace = "GObject", name = "SignalMatchType"}) Word32 -> -- signal_id : TBasicType TUInt Word32 -> -- detail : TBasicType TUInt32 Ptr (GClosure ()) -> -- closure : TGClosure Nothing Ptr () -> -- func : TBasicType TPtr Ptr () -> -- data : TBasicType TPtr IO Word32 -- | Disconnects all handlers on an instance that match a certain -- selection criteria. The criteria mask is passed as an OR-ed -- combination of t'GI.GObject.Flags.SignalMatchType' flags, and the criteria values are -- passed as arguments. Passing at least one of the -- 'GI.GObject.Flags.SignalMatchTypeClosure', 'GI.GObject.Flags.SignalMatchTypeFunc' or -- 'GI.GObject.Flags.SignalMatchTypeData' match flags is required for successful -- matches. If no handlers were found, 0 is returned, the number of -- disconnected handlers otherwise. signalHandlersDisconnectMatched :: (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) => a -- ^ /@instance@/: The instance to remove handlers from. -> [GObject.Flags.SignalMatchType] -- ^ /@mask@/: Mask indicating which of /@signalId@/, /@detail@/, /@closure@/, /@func@/ -- and\/or /@data@/ the handlers have to match. -> Word32 -- ^ /@signalId@/: Signal the handlers have to be connected to. -> Word32 -- ^ /@detail@/: Signal detail the handlers have to be connected to. -> Maybe (GClosure b) -- ^ /@closure@/: The closure the handlers will invoke. -> Ptr () -- ^ /@func@/: The C closure callback of the handlers (useless for non-C closures). -> Ptr () -- ^ /@data@/: The closure data of the handlers\' closures. -> m Word32 -- ^ __Returns:__ The number of handlers that matched. signalHandlersDisconnectMatched :: a -> [SignalMatchType] -> Word32 -> Word32 -> Maybe (GClosure b) -> Ptr () -> Ptr () -> m Word32 signalHandlersDisconnectMatched instance_ :: a instance_ mask :: [SignalMatchType] mask signalId :: Word32 signalId detail :: Word32 detail closure :: Maybe (GClosure b) closure func :: Ptr () func data_ :: Ptr () data_ = 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 Object instance_' <- a -> IO (Ptr Object) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a instance_ let mask' :: CUInt mask' = [SignalMatchType] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [SignalMatchType] mask Ptr (GClosure ()) maybeClosure <- case Maybe (GClosure b) closure of Nothing -> Ptr (GClosure ()) -> IO (Ptr (GClosure ())) forall (m :: * -> *) a. Monad m => a -> m a return Ptr (GClosure ()) forall a. Ptr a nullPtr Just jClosure :: GClosure b jClosure -> do Ptr (GClosure ()) jClosure' <- GClosure b -> IO (Ptr (GClosure ())) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr GClosure b jClosure Ptr (GClosure ()) -> IO (Ptr (GClosure ())) forall (m :: * -> *) a. Monad m => a -> m a return Ptr (GClosure ()) jClosure' Word32 result <- Ptr Object -> CUInt -> Word32 -> Word32 -> Ptr (GClosure ()) -> Ptr () -> Ptr () -> IO Word32 g_signal_handlers_disconnect_matched Ptr Object instance_' CUInt mask' Word32 signalId Word32 detail Ptr (GClosure ()) maybeClosure Ptr () func Ptr () data_ a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a instance_ Maybe (GClosure b) -> (GClosure b -> IO ()) -> IO () forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe (GClosure b) closure GClosure b -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Word32 -> IO Word32 forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function g_signal_handlers_destroy -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Object" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The instance whose signal handlers are destroyed" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_signal_handlers_destroy" g_signal_handlers_destroy :: Ptr GObject.Object.Object -> -- instance : TInterface (Name {namespace = "GObject", name = "Object"}) IO () -- | Destroy all signal handlers of a type instance. This function is -- an implementation detail of the t'GI.GObject.Objects.Object.Object' dispose implementation, -- and should not be used outside of the type system. signalHandlersDestroy :: (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) => a -- ^ /@instance@/: The instance whose signal handlers are destroyed -> m () signalHandlersDestroy :: a -> m () signalHandlersDestroy instance_ :: a instance_ = 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 Object instance_' <- a -> IO (Ptr Object) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a instance_ Ptr Object -> IO () g_signal_handlers_destroy Ptr Object instance_' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a instance_ () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_signal_handlers_block_matched -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Object" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The instance to block handlers from." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "mask" -- , argType = -- TInterface -- Name { namespace = "GObject" , name = "SignalMatchType" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Mask indicating which of @signal_id, @detail, @closure, @func\n and/or @data the handlers have to match." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "signal_id" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Signal the handlers have to be connected to." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "detail" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "Signal detail the handlers have to be connected to." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "closure" -- , argType = TGClosure Nothing -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "The closure the handlers will invoke." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "func" -- , argType = TBasicType TPtr -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "The C closure callback of the handlers (useless for non-C closures)." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "data" -- , argType = TBasicType TPtr -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "The closure data of the handlers' closures." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "g_signal_handlers_block_matched" g_signal_handlers_block_matched :: Ptr GObject.Object.Object -> -- instance : TInterface (Name {namespace = "GObject", name = "Object"}) CUInt -> -- mask : TInterface (Name {namespace = "GObject", name = "SignalMatchType"}) Word32 -> -- signal_id : TBasicType TUInt Word32 -> -- detail : TBasicType TUInt32 Ptr (GClosure ()) -> -- closure : TGClosure Nothing Ptr () -> -- func : TBasicType TPtr Ptr () -> -- data : TBasicType TPtr IO Word32 -- | Blocks all handlers on an instance that match a certain selection criteria. -- The criteria mask is passed as an OR-ed combination of t'GI.GObject.Flags.SignalMatchType' -- flags, and the criteria values are passed as arguments. -- Passing at least one of the 'GI.GObject.Flags.SignalMatchTypeClosure', 'GI.GObject.Flags.SignalMatchTypeFunc' -- or 'GI.GObject.Flags.SignalMatchTypeData' match flags is required for successful matches. -- If no handlers were found, 0 is returned, the number of blocked handlers -- otherwise. signalHandlersBlockMatched :: (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) => a -- ^ /@instance@/: The instance to block handlers from. -> [GObject.Flags.SignalMatchType] -- ^ /@mask@/: Mask indicating which of /@signalId@/, /@detail@/, /@closure@/, /@func@/ -- and\/or /@data@/ the handlers have to match. -> Word32 -- ^ /@signalId@/: Signal the handlers have to be connected to. -> Word32 -- ^ /@detail@/: Signal detail the handlers have to be connected to. -> Maybe (GClosure b) -- ^ /@closure@/: The closure the handlers will invoke. -> Ptr () -- ^ /@func@/: The C closure callback of the handlers (useless for non-C closures). -> Ptr () -- ^ /@data@/: The closure data of the handlers\' closures. -> m Word32 -- ^ __Returns:__ The number of handlers that matched. signalHandlersBlockMatched :: a -> [SignalMatchType] -> Word32 -> Word32 -> Maybe (GClosure b) -> Ptr () -> Ptr () -> m Word32 signalHandlersBlockMatched instance_ :: a instance_ mask :: [SignalMatchType] mask signalId :: Word32 signalId detail :: Word32 detail closure :: Maybe (GClosure b) closure func :: Ptr () func data_ :: Ptr () data_ = 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 Object instance_' <- a -> IO (Ptr Object) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a instance_ let mask' :: CUInt mask' = [SignalMatchType] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [SignalMatchType] mask Ptr (GClosure ()) maybeClosure <- case Maybe (GClosure b) closure of Nothing -> Ptr (GClosure ()) -> IO (Ptr (GClosure ())) forall (m :: * -> *) a. Monad m => a -> m a return Ptr (GClosure ()) forall a. Ptr a nullPtr Just jClosure :: GClosure b jClosure -> do Ptr (GClosure ()) jClosure' <- GClosure b -> IO (Ptr (GClosure ())) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr GClosure b jClosure Ptr (GClosure ()) -> IO (Ptr (GClosure ())) forall (m :: * -> *) a. Monad m => a -> m a return Ptr (GClosure ()) jClosure' Word32 result <- Ptr Object -> CUInt -> Word32 -> Word32 -> Ptr (GClosure ()) -> Ptr () -> Ptr () -> IO Word32 g_signal_handlers_block_matched Ptr Object instance_' CUInt mask' Word32 signalId Word32 detail Ptr (GClosure ()) maybeClosure Ptr () func Ptr () data_ a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a instance_ Maybe (GClosure b) -> (GClosure b -> IO ()) -> IO () forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe (GClosure b) closure GClosure b -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Word32 -> IO Word32 forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function g_signal_handler_unblock -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Object" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The instance to unblock the signal handler of." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "handler_id" -- , argType = TBasicType TULong -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Handler id of the handler to be unblocked." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_signal_handler_unblock" g_signal_handler_unblock :: Ptr GObject.Object.Object -> -- instance : TInterface (Name {namespace = "GObject", name = "Object"}) CULong -> -- handler_id : TBasicType TULong IO () -- | Undoes the effect of a previous 'GI.GObject.Functions.signalHandlerBlock' call. A -- blocked handler is skipped during signal emissions and will not be -- invoked, unblocking it (for exactly the amount of times it has been -- blocked before) reverts its \"blocked\" state, so the handler will be -- recognized by the signal system and is called upon future or -- currently ongoing signal emissions (since the order in which -- handlers are called during signal emissions is deterministic, -- whether the unblocked handler in question is called as part of a -- currently ongoing emission depends on how far that emission has -- proceeded yet). -- -- The /@handlerId@/ has to be a valid id of a signal handler that is -- connected to a signal of /@instance@/ and is currently blocked. signalHandlerUnblock :: (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) => a -- ^ /@instance@/: The instance to unblock the signal handler of. -> CULong -- ^ /@handlerId@/: Handler id of the handler to be unblocked. -> m () signalHandlerUnblock :: a -> CULong -> m () signalHandlerUnblock instance_ :: a instance_ handlerId :: CULong handlerId = 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 Object instance_' <- a -> IO (Ptr Object) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a instance_ Ptr Object -> CULong -> IO () g_signal_handler_unblock Ptr Object instance_' CULong handlerId a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a instance_ () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_signal_handler_is_connected -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Object" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The instance where a signal handler is sought." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "handler_id" -- , argType = TBasicType TULong -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the handler ID." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_signal_handler_is_connected" g_signal_handler_is_connected :: Ptr GObject.Object.Object -> -- instance : TInterface (Name {namespace = "GObject", name = "Object"}) CULong -> -- handler_id : TBasicType TULong IO CInt -- | Returns whether /@handlerId@/ is the ID of a handler connected to /@instance@/. signalHandlerIsConnected :: (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) => a -- ^ /@instance@/: The instance where a signal handler is sought. -> CULong -- ^ /@handlerId@/: the handler ID. -> m Bool -- ^ __Returns:__ whether /@handlerId@/ identifies a handler connected to /@instance@/. signalHandlerIsConnected :: a -> CULong -> m Bool signalHandlerIsConnected instance_ :: a instance_ handlerId :: CULong handlerId = 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 Object instance_' <- a -> IO (Ptr Object) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a instance_ CInt result <- Ptr Object -> CULong -> IO CInt g_signal_handler_is_connected Ptr Object instance_' CULong handlerId let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a instance_ Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function g_signal_handler_find -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Object" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The instance owning the signal handler to be found." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "mask" -- , argType = -- TInterface -- Name { namespace = "GObject" , name = "SignalMatchType" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Mask indicating which of @signal_id, @detail, @closure, @func\n and/or @data the handler has to match." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "signal_id" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Signal the handler has to be connected to." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "detail" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "Signal detail the handler has to be connected to." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "closure" -- , argType = TGClosure Nothing -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "The closure the handler will invoke." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "func" -- , argType = TBasicType TPtr -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "The C closure callback of the handler (useless for non-C closures)." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "data" -- , argType = TBasicType TPtr -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "The closure data of the handler's closure." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TULong) -- throws : False -- Skip return : False foreign import ccall "g_signal_handler_find" g_signal_handler_find :: Ptr GObject.Object.Object -> -- instance : TInterface (Name {namespace = "GObject", name = "Object"}) CUInt -> -- mask : TInterface (Name {namespace = "GObject", name = "SignalMatchType"}) Word32 -> -- signal_id : TBasicType TUInt Word32 -> -- detail : TBasicType TUInt32 Ptr (GClosure ()) -> -- closure : TGClosure Nothing Ptr () -> -- func : TBasicType TPtr Ptr () -> -- data : TBasicType TPtr IO CULong -- | Finds the first signal handler that matches certain selection criteria. -- The criteria mask is passed as an OR-ed combination of t'GI.GObject.Flags.SignalMatchType' -- flags, and the criteria values are passed as arguments. -- The match /@mask@/ has to be non-0 for successful matches. -- If no handler was found, 0 is returned. signalHandlerFind :: (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) => a -- ^ /@instance@/: The instance owning the signal handler to be found. -> [GObject.Flags.SignalMatchType] -- ^ /@mask@/: Mask indicating which of /@signalId@/, /@detail@/, /@closure@/, /@func@/ -- and\/or /@data@/ the handler has to match. -> Word32 -- ^ /@signalId@/: Signal the handler has to be connected to. -> Word32 -- ^ /@detail@/: Signal detail the handler has to be connected to. -> Maybe (GClosure b) -- ^ /@closure@/: The closure the handler will invoke. -> Ptr () -- ^ /@func@/: The C closure callback of the handler (useless for non-C closures). -> Ptr () -- ^ /@data@/: The closure data of the handler\'s closure. -> m CULong -- ^ __Returns:__ A valid non-0 signal handler id for a successful match. signalHandlerFind :: a -> [SignalMatchType] -> Word32 -> Word32 -> Maybe (GClosure b) -> Ptr () -> Ptr () -> m CULong signalHandlerFind instance_ :: a instance_ mask :: [SignalMatchType] mask signalId :: Word32 signalId detail :: Word32 detail closure :: Maybe (GClosure b) closure func :: Ptr () func data_ :: Ptr () data_ = IO CULong -> m CULong forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO CULong -> m CULong) -> IO CULong -> m CULong forall a b. (a -> b) -> a -> b $ do Ptr Object instance_' <- a -> IO (Ptr Object) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a instance_ let mask' :: CUInt mask' = [SignalMatchType] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [SignalMatchType] mask Ptr (GClosure ()) maybeClosure <- case Maybe (GClosure b) closure of Nothing -> Ptr (GClosure ()) -> IO (Ptr (GClosure ())) forall (m :: * -> *) a. Monad m => a -> m a return Ptr (GClosure ()) forall a. Ptr a nullPtr Just jClosure :: GClosure b jClosure -> do Ptr (GClosure ()) jClosure' <- GClosure b -> IO (Ptr (GClosure ())) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr GClosure b jClosure Ptr (GClosure ()) -> IO (Ptr (GClosure ())) forall (m :: * -> *) a. Monad m => a -> m a return Ptr (GClosure ()) jClosure' CULong result <- Ptr Object -> CUInt -> Word32 -> Word32 -> Ptr (GClosure ()) -> Ptr () -> Ptr () -> IO CULong g_signal_handler_find Ptr Object instance_' CUInt mask' Word32 signalId Word32 detail Ptr (GClosure ()) maybeClosure Ptr () func Ptr () data_ a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a instance_ Maybe (GClosure b) -> (GClosure b -> IO ()) -> IO () forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe (GClosure b) closure GClosure b -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr CULong -> IO CULong forall (m :: * -> *) a. Monad m => a -> m a return CULong result -- function g_signal_handler_disconnect -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Object" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The instance to remove the signal handler from." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "handler_id" -- , argType = TBasicType TULong -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Handler id of the handler to be disconnected." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_signal_handler_disconnect" g_signal_handler_disconnect :: Ptr GObject.Object.Object -> -- instance : TInterface (Name {namespace = "GObject", name = "Object"}) CULong -> -- handler_id : TBasicType TULong IO () -- | Disconnects a handler from an instance so it will not be called during -- any future or currently ongoing emissions of the signal it has been -- connected to. The /@handlerId@/ becomes invalid and may be reused. -- -- The /@handlerId@/ has to be a valid signal handler id, connected to a -- signal of /@instance@/. signalHandlerDisconnect :: (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) => a -- ^ /@instance@/: The instance to remove the signal handler from. -> CULong -- ^ /@handlerId@/: Handler id of the handler to be disconnected. -> m () signalHandlerDisconnect :: a -> CULong -> m () signalHandlerDisconnect instance_ :: a instance_ handlerId :: CULong handlerId = 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 Object instance_' <- a -> IO (Ptr Object) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a instance_ Ptr Object -> CULong -> IO () g_signal_handler_disconnect Ptr Object instance_' CULong handlerId a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a instance_ () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_signal_handler_block -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Object" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The instance to block the signal handler of." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "handler_id" -- , argType = TBasicType TULong -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Handler id of the handler to be blocked." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_signal_handler_block" g_signal_handler_block :: Ptr GObject.Object.Object -> -- instance : TInterface (Name {namespace = "GObject", name = "Object"}) CULong -> -- handler_id : TBasicType TULong IO () -- | Blocks a handler of an instance so it will not be called during any -- signal emissions unless it is unblocked again. Thus \"blocking\" a -- signal handler means to temporarily deactive it, a signal handler -- has to be unblocked exactly the same amount of times it has been -- blocked before to become active again. -- -- The /@handlerId@/ has to be a valid signal handler id, connected to a -- signal of /@instance@/. signalHandlerBlock :: (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) => a -- ^ /@instance@/: The instance to block the signal handler of. -> CULong -- ^ /@handlerId@/: Handler id of the handler to be blocked. -> m () signalHandlerBlock :: a -> CULong -> m () signalHandlerBlock instance_ :: a instance_ handlerId :: CULong handlerId = 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 Object instance_' <- a -> IO (Ptr Object) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a instance_ Ptr Object -> CULong -> IO () g_signal_handler_block Ptr Object instance_' CULong handlerId a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a instance_ () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_signal_get_invocation_hint -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Object" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the instance to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "GObject" , name = "SignalInvocationHint" }) -- throws : False -- Skip return : False foreign import ccall "g_signal_get_invocation_hint" g_signal_get_invocation_hint :: Ptr GObject.Object.Object -> -- instance : TInterface (Name {namespace = "GObject", name = "Object"}) IO (Ptr GObject.SignalInvocationHint.SignalInvocationHint) -- | Returns the invocation hint of the innermost signal emission of instance. signalGetInvocationHint :: (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) => a -- ^ /@instance@/: the instance to query -> m GObject.SignalInvocationHint.SignalInvocationHint -- ^ __Returns:__ the invocation hint of the innermost signal emission. signalGetInvocationHint :: a -> m SignalInvocationHint signalGetInvocationHint instance_ :: a instance_ = IO SignalInvocationHint -> m SignalInvocationHint forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO SignalInvocationHint -> m SignalInvocationHint) -> IO SignalInvocationHint -> m SignalInvocationHint forall a b. (a -> b) -> a -> b $ do Ptr Object instance_' <- a -> IO (Ptr Object) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a instance_ Ptr SignalInvocationHint result <- Ptr Object -> IO (Ptr SignalInvocationHint) g_signal_get_invocation_hint Ptr Object instance_' Text -> Ptr SignalInvocationHint -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "signalGetInvocationHint" Ptr SignalInvocationHint result SignalInvocationHint result' <- ((ManagedPtr SignalInvocationHint -> SignalInvocationHint) -> Ptr SignalInvocationHint -> IO SignalInvocationHint forall a. (HasCallStack, WrappedPtr a) => (ManagedPtr a -> a) -> Ptr a -> IO a newPtr ManagedPtr SignalInvocationHint -> SignalInvocationHint GObject.SignalInvocationHint.SignalInvocationHint) Ptr SignalInvocationHint result a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a instance_ SignalInvocationHint -> IO SignalInvocationHint forall (m :: * -> *) a. Monad m => a -> m a return SignalInvocationHint result' -- function g_signal_emitv -- Args: [ Arg -- { argCName = "instance_and_params" -- , argType = -- TCArray -- False -- (-1) -- (-1) -- (TInterface Name { namespace = "GObject" , name = "Value" }) -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "argument list for the signal emission.\n The first element in the array is a #GValue for the instance the signal\n is being emitted on. The rest are any arguments to be passed to the signal." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "signal_id" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the signal id" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "detail" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the detail" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "return_value" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Value" } -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Location to\nstore the return value of the signal emission. This must be provided if the\nspecified signal returns a value, but may be ignored otherwise." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_signal_emitv" g_signal_emitv :: Ptr GValue -> -- instance_and_params : TCArray False (-1) (-1) (TInterface (Name {namespace = "GObject", name = "Value"})) Word32 -> -- signal_id : TBasicType TUInt Word32 -> -- detail : TBasicType TUInt32 Ptr GValue -> -- return_value : TInterface (Name {namespace = "GObject", name = "Value"}) IO () -- | Emits a signal. -- -- Note that 'GI.GObject.Functions.signalEmitv' doesn\'t change /@returnValue@/ if no handlers are -- connected, in contrast to @/g_signal_emit()/@ and @/g_signal_emit_valist()/@. signalEmitv :: (B.CallStack.HasCallStack, MonadIO m) => [GValue] -- ^ /@instanceAndParams@/: argument list for the signal emission. -- The first element in the array is a t'GI.GObject.Structs.Value.Value' for the instance the signal -- is being emitted on. The rest are any arguments to be passed to the signal. -> Word32 -- ^ /@signalId@/: the signal id -> Word32 -- ^ /@detail@/: the detail -> m (GValue) signalEmitv :: [GValue] -> Word32 -> Word32 -> m GValue signalEmitv instanceAndParams :: [GValue] instanceAndParams signalId :: Word32 signalId detail :: Word32 detail = IO GValue -> m GValue forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO GValue -> m GValue) -> IO GValue -> m GValue forall a b. (a -> b) -> a -> b $ do [Ptr GValue] instanceAndParams' <- (GValue -> IO (Ptr GValue)) -> [GValue] -> IO [Ptr GValue] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM GValue -> IO (Ptr GValue) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr [GValue] instanceAndParams Ptr GValue instanceAndParams'' <- Int -> [Ptr GValue] -> IO (Ptr GValue) forall a. Int -> [Ptr a] -> IO (Ptr a) packBlockArray 24 [Ptr GValue] instanceAndParams' Ptr GValue returnValue <- Int -> IO (Ptr GValue) forall a. BoxedObject a => Int -> IO (Ptr a) callocBoxedBytes 24 :: IO (Ptr GValue) Ptr GValue -> Word32 -> Word32 -> Ptr GValue -> IO () g_signal_emitv Ptr GValue instanceAndParams'' Word32 signalId Word32 detail Ptr GValue returnValue GValue returnValue' <- ((ManagedPtr GValue -> GValue) -> Ptr GValue -> IO GValue forall a. (HasCallStack, BoxedObject a) => (ManagedPtr a -> a) -> Ptr a -> IO a wrapBoxed ManagedPtr GValue -> GValue GValue) Ptr GValue returnValue (GValue -> IO ()) -> [GValue] -> IO () forall (t :: * -> *) (m :: * -> *) a b. (Foldable t, Monad m) => (a -> m b) -> t a -> m () mapM_ GValue -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr [GValue] instanceAndParams Ptr GValue -> IO () forall a. Ptr a -> IO () freeMem Ptr GValue instanceAndParams'' GValue -> IO GValue forall (m :: * -> *) a. Monad m => a -> m a return GValue returnValue' -- function g_signal_connect_closure_by_id -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Object" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the instance to connect to." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "signal_id" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the id of the signal." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "detail" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the detail." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "closure" -- , argType = TGClosure Nothing -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the closure to connect." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "after" -- , argType = TBasicType TBoolean -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "whether the handler should be called before or after the\n default handler of the signal." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TULong) -- throws : False -- Skip return : False foreign import ccall "g_signal_connect_closure_by_id" g_signal_connect_closure_by_id :: Ptr GObject.Object.Object -> -- instance : TInterface (Name {namespace = "GObject", name = "Object"}) Word32 -> -- signal_id : TBasicType TUInt Word32 -> -- detail : TBasicType TUInt32 Ptr (GClosure ()) -> -- closure : TGClosure Nothing CInt -> -- after : TBasicType TBoolean IO CULong -- | Connects a closure to a signal for a particular object. signalConnectClosureById :: (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) => a -- ^ /@instance@/: the instance to connect to. -> Word32 -- ^ /@signalId@/: the id of the signal. -> Word32 -- ^ /@detail@/: the detail. -> GClosure b -- ^ /@closure@/: the closure to connect. -> Bool -- ^ /@after@/: whether the handler should be called before or after the -- default handler of the signal. -> m CULong -- ^ __Returns:__ the handler ID (always greater than 0 for successful connections) signalConnectClosureById :: a -> Word32 -> Word32 -> GClosure b -> Bool -> m CULong signalConnectClosureById instance_ :: a instance_ signalId :: Word32 signalId detail :: Word32 detail closure :: GClosure b closure after :: Bool after = IO CULong -> m CULong forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO CULong -> m CULong) -> IO CULong -> m CULong forall a b. (a -> b) -> a -> b $ do Ptr Object instance_' <- a -> IO (Ptr Object) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a instance_ Ptr (GClosure ()) closure' <- GClosure b -> IO (Ptr (GClosure ())) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr GClosure b closure let after' :: CInt after' = (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 after CULong result <- Ptr Object -> Word32 -> Word32 -> Ptr (GClosure ()) -> CInt -> IO CULong g_signal_connect_closure_by_id Ptr Object instance_' Word32 signalId Word32 detail Ptr (GClosure ()) closure' CInt after' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a instance_ GClosure b -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr GClosure b closure CULong -> IO CULong forall (m :: * -> *) a. Monad m => a -> m a return CULong result -- function g_signal_connect_closure -- Args: [ Arg -- { argCName = "instance" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Object" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the instance to connect to." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "detailed_signal" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a string of the form \"signal-name::detail\"." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "closure" -- , argType = TGClosure Nothing -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the closure to connect." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "after" -- , argType = TBasicType TBoolean -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "whether the handler should be called before or after the\n default handler of the signal." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TULong) -- throws : False -- Skip return : False foreign import ccall "g_signal_connect_closure" g_signal_connect_closure :: Ptr GObject.Object.Object -> -- instance : TInterface (Name {namespace = "GObject", name = "Object"}) CString -> -- detailed_signal : TBasicType TUTF8 Ptr (GClosure ()) -> -- closure : TGClosure Nothing CInt -> -- after : TBasicType TBoolean IO CULong -- | Connects a closure to a signal for a particular object. signalConnectClosure :: (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) => a -- ^ /@instance@/: the instance to connect to. -> T.Text -- ^ /@detailedSignal@/: a string of the form \"signal-name[detail](#signal:detail)\". -> GClosure b -- ^ /@closure@/: the closure to connect. -> Bool -- ^ /@after@/: whether the handler should be called before or after the -- default handler of the signal. -> m CULong -- ^ __Returns:__ the handler ID (always greater than 0 for successful connections) signalConnectClosure :: a -> Text -> GClosure b -> Bool -> m CULong signalConnectClosure instance_ :: a instance_ detailedSignal :: Text detailedSignal closure :: GClosure b closure after :: Bool after = IO CULong -> m CULong forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO CULong -> m CULong) -> IO CULong -> m CULong forall a b. (a -> b) -> a -> b $ do Ptr Object instance_' <- a -> IO (Ptr Object) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a instance_ CString detailedSignal' <- Text -> IO CString textToCString Text detailedSignal Ptr (GClosure ()) closure' <- GClosure b -> IO (Ptr (GClosure ())) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr GClosure b closure let after' :: CInt after' = (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 after CULong result <- Ptr Object -> CString -> Ptr (GClosure ()) -> CInt -> IO CULong g_signal_connect_closure Ptr Object instance_' CString detailedSignal' Ptr (GClosure ()) closure' CInt after' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a instance_ GClosure b -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr GClosure b closure CString -> IO () forall a. Ptr a -> IO () freeMem CString detailedSignal' CULong -> IO CULong forall (m :: * -> *) a. Monad m => a -> m a return CULong result -- function g_signal_chain_from_overridden -- Args: [ Arg -- { argCName = "instance_and_params" -- , argType = -- TCArray -- False -- (-1) -- (-1) -- (TInterface Name { namespace = "GObject" , name = "Value" }) -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the argument list of the signal emission.\n The first element in the array is a #GValue for the instance the signal\n is being emitted on. The rest are any arguments to be passed to the signal." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "return_value" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Value" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Location for the return value." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_signal_chain_from_overridden" g_signal_chain_from_overridden :: Ptr GValue -> -- instance_and_params : TCArray False (-1) (-1) (TInterface (Name {namespace = "GObject", name = "Value"})) Ptr GValue -> -- return_value : TInterface (Name {namespace = "GObject", name = "Value"}) IO () -- | Calls the original class closure of a signal. This function should only -- be called from an overridden class closure; see -- 'GI.GObject.Functions.signalOverrideClassClosure' and -- @/g_signal_override_class_handler()/@. signalChainFromOverridden :: (B.CallStack.HasCallStack, MonadIO m) => [GValue] -- ^ /@instanceAndParams@/: the argument list of the signal emission. -- The first element in the array is a t'GI.GObject.Structs.Value.Value' for the instance the signal -- is being emitted on. The rest are any arguments to be passed to the signal. -> GValue -- ^ /@returnValue@/: Location for the return value. -> m () signalChainFromOverridden :: [GValue] -> GValue -> m () signalChainFromOverridden instanceAndParams :: [GValue] instanceAndParams returnValue :: GValue returnValue = 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 GValue] instanceAndParams' <- (GValue -> IO (Ptr GValue)) -> [GValue] -> IO [Ptr GValue] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM GValue -> IO (Ptr GValue) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr [GValue] instanceAndParams Ptr GValue instanceAndParams'' <- Int -> [Ptr GValue] -> IO (Ptr GValue) forall a. Int -> [Ptr a] -> IO (Ptr a) packBlockArray 24 [Ptr GValue] instanceAndParams' Ptr GValue returnValue' <- GValue -> IO (Ptr GValue) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GValue returnValue Ptr GValue -> Ptr GValue -> IO () g_signal_chain_from_overridden Ptr GValue instanceAndParams'' Ptr GValue returnValue' (GValue -> IO ()) -> [GValue] -> IO () forall (t :: * -> *) (m :: * -> *) a b. (Foldable t, Monad m) => (a -> m b) -> t a -> m () mapM_ GValue -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr [GValue] instanceAndParams GValue -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr GValue returnValue Ptr GValue -> IO () forall a. Ptr a -> IO () freeMem Ptr GValue instanceAndParams'' () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function g_signal_add_emission_hook -- Args: [ Arg -- { argCName = "signal_id" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the signal identifier, as returned by g_signal_lookup()." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "detail" -- , argType = TBasicType TUInt32 --