{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Interfaces.DebugController
(
DebugController(..) ,
IsDebugController ,
toDebugController ,
#if defined(ENABLE_OVERLOADING)
ResolveDebugControllerMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
DebugControllerGetDebugEnabledMethodInfo,
#endif
debugControllerGetDebugEnabled ,
#if defined(ENABLE_OVERLOADING)
DebugControllerSetDebugEnabledMethodInfo,
#endif
debugControllerSetDebugEnabled ,
#if defined(ENABLE_OVERLOADING)
DebugControllerDebugEnabledPropertyInfo ,
#endif
constructDebugControllerDebugEnabled ,
#if defined(ENABLE_OVERLOADING)
debugControllerDebugEnabled ,
#endif
getDebugControllerDebugEnabled ,
setDebugControllerDebugEnabled ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Initable as Gio.Initable
newtype DebugController = DebugController (SP.ManagedPtr DebugController)
deriving (DebugController -> DebugController -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DebugController -> DebugController -> Bool
$c/= :: DebugController -> DebugController -> Bool
== :: DebugController -> DebugController -> Bool
$c== :: DebugController -> DebugController -> Bool
Eq)
instance SP.ManagedPtrNewtype DebugController where
toManagedPtr :: DebugController -> ManagedPtr DebugController
toManagedPtr (DebugController ManagedPtr DebugController
p) = ManagedPtr DebugController
p
foreign import ccall "g_debug_controller_get_type"
c_g_debug_controller_get_type :: IO B.Types.GType
instance B.Types.TypedObject DebugController where
glibType :: IO GType
glibType = IO GType
c_g_debug_controller_get_type
instance B.Types.GObject DebugController
class (SP.GObject o, O.IsDescendantOf DebugController o) => IsDebugController o
instance (SP.GObject o, O.IsDescendantOf DebugController o) => IsDebugController o
instance O.HasParentTypes DebugController
type instance O.ParentTypes DebugController = '[Gio.Initable.Initable, GObject.Object.Object]
toDebugController :: (MIO.MonadIO m, IsDebugController o) => o -> m DebugController
toDebugController :: forall (m :: * -> *) o.
(MonadIO m, IsDebugController o) =>
o -> m DebugController
toDebugController = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr DebugController -> DebugController
DebugController
instance B.GValue.IsGValue (Maybe DebugController) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_debug_controller_get_type
gvalueSet_ :: Ptr GValue -> Maybe DebugController -> IO ()
gvalueSet_ Ptr GValue
gv Maybe DebugController
P.Nothing = forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (forall a. Ptr a
FP.nullPtr :: FP.Ptr DebugController)
gvalueSet_ Ptr GValue
gv (P.Just DebugController
obj) = forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DebugController
obj (forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe DebugController)
gvalueGet_ Ptr GValue
gv = do
Ptr DebugController
ptr <- forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr DebugController)
if Ptr DebugController
ptr forall a. Eq a => a -> a -> Bool
/= forall a. Ptr a
FP.nullPtr
then forall a. a -> Maybe a
P.Just forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr DebugController -> DebugController
DebugController Ptr DebugController
ptr
else forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Maybe a
P.Nothing
getDebugControllerDebugEnabled :: (MonadIO m, IsDebugController o) => o -> m Bool
getDebugControllerDebugEnabled :: forall (m :: * -> *) o.
(MonadIO m, IsDebugController o) =>
o -> m Bool
getDebugControllerDebugEnabled o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"debug-enabled"
setDebugControllerDebugEnabled :: (MonadIO m, IsDebugController o) => o -> Bool -> m ()
setDebugControllerDebugEnabled :: forall (m :: * -> *) o.
(MonadIO m, IsDebugController o) =>
o -> Bool -> m ()
setDebugControllerDebugEnabled o
obj Bool
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"debug-enabled" Bool
val
constructDebugControllerDebugEnabled :: (IsDebugController o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructDebugControllerDebugEnabled :: forall o (m :: * -> *).
(IsDebugController o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructDebugControllerDebugEnabled Bool
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"debug-enabled" Bool
val
#if defined(ENABLE_OVERLOADING)
data DebugControllerDebugEnabledPropertyInfo
instance AttrInfo DebugControllerDebugEnabledPropertyInfo where
type AttrAllowedOps DebugControllerDebugEnabledPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint DebugControllerDebugEnabledPropertyInfo = IsDebugController
type AttrSetTypeConstraint DebugControllerDebugEnabledPropertyInfo = (~) Bool
type AttrTransferTypeConstraint DebugControllerDebugEnabledPropertyInfo = (~) Bool
type AttrTransferType DebugControllerDebugEnabledPropertyInfo = Bool
type AttrGetType DebugControllerDebugEnabledPropertyInfo = Bool
type AttrLabel DebugControllerDebugEnabledPropertyInfo = "debug-enabled"
type AttrOrigin DebugControllerDebugEnabledPropertyInfo = DebugController
attrGet = getDebugControllerDebugEnabled
attrSet = setDebugControllerDebugEnabled
attrTransfer _ v = do
return v
attrConstruct = constructDebugControllerDebugEnabled
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.DebugController.debugEnabled"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Interfaces-DebugController.html#g:attr:debugEnabled"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DebugController
type instance O.AttributeList DebugController = DebugControllerAttributeList
type DebugControllerAttributeList = ('[ '("debugEnabled", DebugControllerDebugEnabledPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
debugControllerDebugEnabled :: AttrLabelProxy "debugEnabled"
debugControllerDebugEnabled = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveDebugControllerMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveDebugControllerMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDebugControllerMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDebugControllerMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDebugControllerMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDebugControllerMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDebugControllerMethod "init" o = Gio.Initable.InitableInitMethodInfo
ResolveDebugControllerMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDebugControllerMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDebugControllerMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDebugControllerMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDebugControllerMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDebugControllerMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDebugControllerMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDebugControllerMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDebugControllerMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDebugControllerMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDebugControllerMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDebugControllerMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDebugControllerMethod "getDebugEnabled" o = DebugControllerGetDebugEnabledMethodInfo
ResolveDebugControllerMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDebugControllerMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDebugControllerMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDebugControllerMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDebugControllerMethod "setDebugEnabled" o = DebugControllerSetDebugEnabledMethodInfo
ResolveDebugControllerMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDebugControllerMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDebugControllerMethod t DebugController, O.OverloadedMethod info DebugController p) => OL.IsLabel t (DebugController -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveDebugControllerMethod t DebugController, O.OverloadedMethod info DebugController p, R.HasField t DebugController p) => R.HasField t DebugController p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveDebugControllerMethod t DebugController, O.OverloadedMethodInfo info DebugController) => OL.IsLabel t (O.MethodProxy info DebugController) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
foreign import ccall "g_debug_controller_get_debug_enabled" g_debug_controller_get_debug_enabled ::
Ptr DebugController ->
IO CInt
debugControllerGetDebugEnabled ::
(B.CallStack.HasCallStack, MonadIO m, IsDebugController a) =>
a
-> m Bool
debugControllerGetDebugEnabled :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDebugController a) =>
a -> m Bool
debugControllerGetDebugEnabled a
self = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DebugController
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CInt
result <- Ptr DebugController -> IO CInt
g_debug_controller_get_debug_enabled Ptr DebugController
self'
let result' :: Bool
result' = (forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DebugControllerGetDebugEnabledMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDebugController a) => O.OverloadedMethod DebugControllerGetDebugEnabledMethodInfo a signature where
overloadedMethod = debugControllerGetDebugEnabled
instance O.OverloadedMethodInfo DebugControllerGetDebugEnabledMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.DebugController.debugControllerGetDebugEnabled",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Interfaces-DebugController.html#v:debugControllerGetDebugEnabled"
})
#endif
foreign import ccall "g_debug_controller_set_debug_enabled" g_debug_controller_set_debug_enabled ::
Ptr DebugController ->
CInt ->
IO ()
debugControllerSetDebugEnabled ::
(B.CallStack.HasCallStack, MonadIO m, IsDebugController a) =>
a
-> Bool
-> m ()
debugControllerSetDebugEnabled :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDebugController a) =>
a -> Bool -> m ()
debugControllerSetDebugEnabled a
self Bool
debugEnabled = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DebugController
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let debugEnabled' :: CInt
debugEnabled' = (forall a b. (Integral a, Num b) => a -> b
P.fromIntegral forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Enum a => a -> Int
P.fromEnum) Bool
debugEnabled
Ptr DebugController -> CInt -> IO ()
g_debug_controller_set_debug_enabled Ptr DebugController
self' CInt
debugEnabled'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DebugControllerSetDebugEnabledMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsDebugController a) => O.OverloadedMethod DebugControllerSetDebugEnabledMethodInfo a signature where
overloadedMethod = debugControllerSetDebugEnabled
instance O.OverloadedMethodInfo DebugControllerSetDebugEnabledMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.DebugController.debugControllerSetDebugEnabled",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Interfaces-DebugController.html#v:debugControllerSetDebugEnabled"
})
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList DebugController = DebugControllerSignalList
type DebugControllerSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif