{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Interfaces.Action
(
Action(..) ,
IsAction ,
toAction ,
#if defined(ENABLE_OVERLOADING)
ResolveActionMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ActionActivateMethodInfo ,
#endif
actionActivate ,
#if defined(ENABLE_OVERLOADING)
ActionChangeStateMethodInfo ,
#endif
actionChangeState ,
#if defined(ENABLE_OVERLOADING)
ActionGetEnabledMethodInfo ,
#endif
actionGetEnabled ,
#if defined(ENABLE_OVERLOADING)
ActionGetNameMethodInfo ,
#endif
actionGetName ,
#if defined(ENABLE_OVERLOADING)
ActionGetParameterTypeMethodInfo ,
#endif
actionGetParameterType ,
#if defined(ENABLE_OVERLOADING)
ActionGetStateMethodInfo ,
#endif
actionGetState ,
#if defined(ENABLE_OVERLOADING)
ActionGetStateHintMethodInfo ,
#endif
actionGetStateHint ,
#if defined(ENABLE_OVERLOADING)
ActionGetStateTypeMethodInfo ,
#endif
actionGetStateType ,
actionNameIsValid ,
actionParseDetailedName ,
actionPrintDetailedName ,
#if defined(ENABLE_OVERLOADING)
ActionEnabledPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
actionEnabled ,
#endif
getActionEnabled ,
#if defined(ENABLE_OVERLOADING)
ActionNamePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
actionName ,
#endif
getActionName ,
#if defined(ENABLE_OVERLOADING)
ActionParameterTypePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
actionParameterType ,
#endif
getActionParameterType ,
#if defined(ENABLE_OVERLOADING)
ActionStatePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
actionState ,
#endif
getActionState ,
#if defined(ENABLE_OVERLOADING)
ActionStateTypePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
actionStateType ,
#endif
getActionStateType ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Structs.VariantType as GLib.VariantType
import qualified GI.GObject.Objects.Object as GObject.Object
#else
import qualified GI.GLib.Structs.VariantType as GLib.VariantType
import qualified GI.GObject.Objects.Object as GObject.Object
#endif
newtype Action = Action (SP.ManagedPtr Action)
deriving (Action -> Action -> Bool
(Action -> Action -> Bool)
-> (Action -> Action -> Bool) -> Eq Action
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Action -> Action -> Bool
== :: Action -> Action -> Bool
$c/= :: Action -> Action -> Bool
/= :: Action -> Action -> Bool
Eq)
instance SP.ManagedPtrNewtype Action where
toManagedPtr :: Action -> ManagedPtr Action
toManagedPtr (Action ManagedPtr Action
p) = ManagedPtr Action
p
foreign import ccall "g_action_get_type"
c_g_action_get_type :: IO B.Types.GType
instance B.Types.TypedObject Action where
glibType :: IO GType
glibType = IO GType
c_g_action_get_type
instance B.Types.GObject Action
class (SP.GObject o, O.IsDescendantOf Action o) => IsAction o
instance (SP.GObject o, O.IsDescendantOf Action o) => IsAction o
instance O.HasParentTypes Action
type instance O.ParentTypes Action = '[GObject.Object.Object]
toAction :: (MIO.MonadIO m, IsAction o) => o -> m Action
toAction :: forall (m :: * -> *) o. (MonadIO m, IsAction o) => o -> m Action
toAction = IO Action -> m Action
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Action -> m Action) -> (o -> IO Action) -> o -> m Action
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Action -> Action) -> o -> IO Action
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Action -> Action
Action
instance B.GValue.IsGValue (Maybe Action) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_action_get_type
gvalueSet_ :: Ptr GValue -> Maybe Action -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Action
P.Nothing = Ptr GValue -> Ptr Action -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Action
forall a. Ptr a
FP.nullPtr :: FP.Ptr Action)
gvalueSet_ Ptr GValue
gv (P.Just Action
obj) = Action -> (Ptr Action -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Action
obj (Ptr GValue -> Ptr Action -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Action)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr Action)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Action)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject Action ptr
else return P.Nothing
getActionEnabled :: (MonadIO m, IsAction o) => o -> m Bool
getActionEnabled :: forall (m :: * -> *) o. (MonadIO m, IsAction o) => o -> m Bool
getActionEnabled o
obj = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"enabled"
#if defined(ENABLE_OVERLOADING)
data ActionEnabledPropertyInfo
instance AttrInfo ActionEnabledPropertyInfo where
type AttrAllowedOps ActionEnabledPropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint ActionEnabledPropertyInfo = IsAction
type AttrSetTypeConstraint ActionEnabledPropertyInfo = (~) ()
type AttrTransferTypeConstraint ActionEnabledPropertyInfo = (~) ()
type AttrTransferType ActionEnabledPropertyInfo = ()
type AttrGetType ActionEnabledPropertyInfo = Bool
type AttrLabel ActionEnabledPropertyInfo = "enabled"
type AttrOrigin ActionEnabledPropertyInfo = Action
attrGet = getActionEnabled
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Action.enabled"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Action.html#g:attr:enabled"
})
#endif
getActionName :: (MonadIO m, IsAction o) => o -> m T.Text
getActionName :: forall (m :: * -> *) o. (MonadIO m, IsAction o) => o -> m Text
getActionName o
obj = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getActionName" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"name"
#if defined(ENABLE_OVERLOADING)
data ActionNamePropertyInfo
instance AttrInfo ActionNamePropertyInfo where
type AttrAllowedOps ActionNamePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint ActionNamePropertyInfo = IsAction
type AttrSetTypeConstraint ActionNamePropertyInfo = (~) ()
type AttrTransferTypeConstraint ActionNamePropertyInfo = (~) ()
type AttrTransferType ActionNamePropertyInfo = ()
type AttrGetType ActionNamePropertyInfo = T.Text
type AttrLabel ActionNamePropertyInfo = "name"
type AttrOrigin ActionNamePropertyInfo = Action
attrGet = getActionName
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Action.name"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Action.html#g:attr:name"
})
#endif
getActionParameterType :: (MonadIO m, IsAction o) => o -> m (Maybe GLib.VariantType.VariantType)
getActionParameterType :: forall (m :: * -> *) o.
(MonadIO m, IsAction o) =>
o -> m (Maybe VariantType)
getActionParameterType o
obj = IO (Maybe VariantType) -> m (Maybe VariantType)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe VariantType) -> m (Maybe VariantType))
-> IO (Maybe VariantType) -> m (Maybe VariantType)
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr VariantType -> VariantType)
-> IO (Maybe VariantType)
forall a b.
(GObject a, GBoxed b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyBoxed o
obj String
"parameter-type" ManagedPtr VariantType -> VariantType
GLib.VariantType.VariantType
#if defined(ENABLE_OVERLOADING)
data ActionParameterTypePropertyInfo
instance AttrInfo ActionParameterTypePropertyInfo where
type AttrAllowedOps ActionParameterTypePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint ActionParameterTypePropertyInfo = IsAction
type AttrSetTypeConstraint ActionParameterTypePropertyInfo = (~) ()
type AttrTransferTypeConstraint ActionParameterTypePropertyInfo = (~) ()
type AttrTransferType ActionParameterTypePropertyInfo = ()
type AttrGetType ActionParameterTypePropertyInfo = (Maybe GLib.VariantType.VariantType)
type AttrLabel ActionParameterTypePropertyInfo = "parameter-type"
type AttrOrigin ActionParameterTypePropertyInfo = Action
attrGet = getActionParameterType
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Action.parameterType"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Action.html#g:attr:parameterType"
})
#endif
getActionState :: (MonadIO m, IsAction o) => o -> m (Maybe GVariant)
getActionState :: forall (m :: * -> *) o.
(MonadIO m, IsAction o) =>
o -> m (Maybe GVariant)
getActionState o
obj = IO (Maybe GVariant) -> m (Maybe GVariant)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe GVariant) -> m (Maybe GVariant))
-> IO (Maybe GVariant) -> m (Maybe GVariant)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe GVariant)
forall a. GObject a => a -> String -> IO (Maybe GVariant)
B.Properties.getObjectPropertyVariant o
obj String
"state"
#if defined(ENABLE_OVERLOADING)
data ActionStatePropertyInfo
instance AttrInfo ActionStatePropertyInfo where
type AttrAllowedOps ActionStatePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint ActionStatePropertyInfo = IsAction
type AttrSetTypeConstraint ActionStatePropertyInfo = (~) ()
type AttrTransferTypeConstraint ActionStatePropertyInfo = (~) ()
type AttrTransferType ActionStatePropertyInfo = ()
type AttrGetType ActionStatePropertyInfo = (Maybe GVariant)
type AttrLabel ActionStatePropertyInfo = "state"
type AttrOrigin ActionStatePropertyInfo = Action
attrGet = getActionState
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Action.state"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Action.html#g:attr:state"
})
#endif
getActionStateType :: (MonadIO m, IsAction o) => o -> m (Maybe GLib.VariantType.VariantType)
getActionStateType :: forall (m :: * -> *) o.
(MonadIO m, IsAction o) =>
o -> m (Maybe VariantType)
getActionStateType o
obj = IO (Maybe VariantType) -> m (Maybe VariantType)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe VariantType) -> m (Maybe VariantType))
-> IO (Maybe VariantType) -> m (Maybe VariantType)
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr VariantType -> VariantType)
-> IO (Maybe VariantType)
forall a b.
(GObject a, GBoxed b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyBoxed o
obj String
"state-type" ManagedPtr VariantType -> VariantType
GLib.VariantType.VariantType
#if defined(ENABLE_OVERLOADING)
data ActionStateTypePropertyInfo
instance AttrInfo ActionStateTypePropertyInfo where
type AttrAllowedOps ActionStateTypePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint ActionStateTypePropertyInfo = IsAction
type AttrSetTypeConstraint ActionStateTypePropertyInfo = (~) ()
type AttrTransferTypeConstraint ActionStateTypePropertyInfo = (~) ()
type AttrTransferType ActionStateTypePropertyInfo = ()
type AttrGetType ActionStateTypePropertyInfo = (Maybe GLib.VariantType.VariantType)
type AttrLabel ActionStateTypePropertyInfo = "state-type"
type AttrOrigin ActionStateTypePropertyInfo = Action
attrGet = getActionStateType
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Action.stateType"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Action.html#g:attr:stateType"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Action
type instance O.AttributeList Action = ActionAttributeList
type ActionAttributeList = ('[ '("enabled", ActionEnabledPropertyInfo), '("name", ActionNamePropertyInfo), '("parameterType", ActionParameterTypePropertyInfo), '("state", ActionStatePropertyInfo), '("stateType", ActionStateTypePropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
actionEnabled :: AttrLabelProxy "enabled"
actionEnabled = AttrLabelProxy
actionName :: AttrLabelProxy "name"
actionName = AttrLabelProxy
actionParameterType :: AttrLabelProxy "parameterType"
actionParameterType = AttrLabelProxy
actionState :: AttrLabelProxy "state"
actionState = AttrLabelProxy
actionStateType :: AttrLabelProxy "stateType"
actionStateType = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveActionMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveActionMethod "activate" o = ActionActivateMethodInfo
ResolveActionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveActionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveActionMethod "changeState" o = ActionChangeStateMethodInfo
ResolveActionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveActionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveActionMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveActionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveActionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveActionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveActionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveActionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveActionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveActionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveActionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveActionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveActionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveActionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveActionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveActionMethod "getEnabled" o = ActionGetEnabledMethodInfo
ResolveActionMethod "getName" o = ActionGetNameMethodInfo
ResolveActionMethod "getParameterType" o = ActionGetParameterTypeMethodInfo
ResolveActionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveActionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveActionMethod "getState" o = ActionGetStateMethodInfo
ResolveActionMethod "getStateHint" o = ActionGetStateHintMethodInfo
ResolveActionMethod "getStateType" o = ActionGetStateTypeMethodInfo
ResolveActionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveActionMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveActionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveActionMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveActionMethod t Action, O.OverloadedMethod info Action p) => OL.IsLabel t (Action -> 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 ~ ResolveActionMethod t Action, O.OverloadedMethod info Action p, R.HasField t Action p) => R.HasField t Action p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveActionMethod t Action, O.OverloadedMethodInfo info Action) => OL.IsLabel t (O.MethodProxy info Action) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
foreign import ccall "g_action_activate" g_action_activate ::
Ptr Action ->
Ptr GVariant ->
IO ()
actionActivate ::
(B.CallStack.HasCallStack, MonadIO m, IsAction a) =>
a
-> Maybe (GVariant)
-> m ()
actionActivate :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAction a) =>
a -> Maybe GVariant -> m ()
actionActivate a
action Maybe GVariant
parameter = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
action' <- a -> IO (Ptr Action)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
action
maybeParameter <- case parameter of
Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
Just GVariant
jParameter -> do
jParameter' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jParameter
return jParameter'
g_action_activate action' maybeParameter
touchManagedPtr action
whenJust parameter touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data ActionActivateMethodInfo
instance (signature ~ (Maybe (GVariant) -> m ()), MonadIO m, IsAction a) => O.OverloadedMethod ActionActivateMethodInfo a signature where
overloadedMethod = actionActivate
instance O.OverloadedMethodInfo ActionActivateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Action.actionActivate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Action.html#v:actionActivate"
})
#endif
foreign import ccall "g_action_change_state" g_action_change_state ::
Ptr Action ->
Ptr GVariant ->
IO ()
actionChangeState ::
(B.CallStack.HasCallStack, MonadIO m, IsAction a) =>
a
-> GVariant
-> m ()
actionChangeState :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAction a) =>
a -> GVariant -> m ()
actionChangeState a
action GVariant
value = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
action' <- a -> IO (Ptr Action)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
action
value' <- unsafeManagedPtrGetPtr value
g_action_change_state action' value'
touchManagedPtr action
touchManagedPtr value
return ()
#if defined(ENABLE_OVERLOADING)
data ActionChangeStateMethodInfo
instance (signature ~ (GVariant -> m ()), MonadIO m, IsAction a) => O.OverloadedMethod ActionChangeStateMethodInfo a signature where
overloadedMethod = actionChangeState
instance O.OverloadedMethodInfo ActionChangeStateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Action.actionChangeState",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Action.html#v:actionChangeState"
})
#endif
foreign import ccall "g_action_get_enabled" g_action_get_enabled ::
Ptr Action ->
IO CInt
actionGetEnabled ::
(B.CallStack.HasCallStack, MonadIO m, IsAction a) =>
a
-> m Bool
actionGetEnabled :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAction a) =>
a -> m Bool
actionGetEnabled a
action = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
action' <- a -> IO (Ptr Action)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
action
result <- g_action_get_enabled action'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr action
return result'
#if defined(ENABLE_OVERLOADING)
data ActionGetEnabledMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAction a) => O.OverloadedMethod ActionGetEnabledMethodInfo a signature where
overloadedMethod = actionGetEnabled
instance O.OverloadedMethodInfo ActionGetEnabledMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Action.actionGetEnabled",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Action.html#v:actionGetEnabled"
})
#endif
foreign import ccall "g_action_get_name" g_action_get_name ::
Ptr Action ->
IO CString
actionGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsAction a) =>
a
-> m T.Text
actionGetName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAction a) =>
a -> m Text
actionGetName a
action = IO Text -> m Text
forall a. IO a -> m a
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
action' <- a -> IO (Ptr Action)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
action
result <- g_action_get_name action'
checkUnexpectedReturnNULL "actionGetName" result
result' <- cstringToText result
touchManagedPtr action
return result'
#if defined(ENABLE_OVERLOADING)
data ActionGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAction a) => O.OverloadedMethod ActionGetNameMethodInfo a signature where
overloadedMethod = actionGetName
instance O.OverloadedMethodInfo ActionGetNameMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Action.actionGetName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Action.html#v:actionGetName"
})
#endif
foreign import ccall "g_action_get_parameter_type" g_action_get_parameter_type ::
Ptr Action ->
IO (Ptr GLib.VariantType.VariantType)
actionGetParameterType ::
(B.CallStack.HasCallStack, MonadIO m, IsAction a) =>
a
-> m (Maybe GLib.VariantType.VariantType)
actionGetParameterType :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAction a) =>
a -> m (Maybe VariantType)
actionGetParameterType a
action = IO (Maybe VariantType) -> m (Maybe VariantType)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe VariantType) -> m (Maybe VariantType))
-> IO (Maybe VariantType) -> m (Maybe VariantType)
forall a b. (a -> b) -> a -> b
$ do
action' <- a -> IO (Ptr Action)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
action
result <- g_action_get_parameter_type action'
maybeResult <- convertIfNonNull result $ \Ptr VariantType
result' -> do
result'' <- ((ManagedPtr VariantType -> VariantType)
-> Ptr VariantType -> IO VariantType
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr VariantType -> VariantType
GLib.VariantType.VariantType) Ptr VariantType
result'
return result''
touchManagedPtr action
return maybeResult
#if defined(ENABLE_OVERLOADING)
data ActionGetParameterTypeMethodInfo
instance (signature ~ (m (Maybe GLib.VariantType.VariantType)), MonadIO m, IsAction a) => O.OverloadedMethod ActionGetParameterTypeMethodInfo a signature where
overloadedMethod = actionGetParameterType
instance O.OverloadedMethodInfo ActionGetParameterTypeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Action.actionGetParameterType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Action.html#v:actionGetParameterType"
})
#endif
foreign import ccall "g_action_get_state" g_action_get_state ::
Ptr Action ->
IO (Ptr GVariant)
actionGetState ::
(B.CallStack.HasCallStack, MonadIO m, IsAction a) =>
a
-> m (Maybe GVariant)
actionGetState :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAction a) =>
a -> m (Maybe GVariant)
actionGetState a
action = IO (Maybe GVariant) -> m (Maybe GVariant)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe GVariant) -> m (Maybe GVariant))
-> IO (Maybe GVariant) -> m (Maybe GVariant)
forall a b. (a -> b) -> a -> b
$ do
action' <- a -> IO (Ptr Action)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
action
result <- g_action_get_state action'
maybeResult <- convertIfNonNull result $ \Ptr GVariant
result' -> do
result'' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
result'
return result''
touchManagedPtr action
return maybeResult
#if defined(ENABLE_OVERLOADING)
data ActionGetStateMethodInfo
instance (signature ~ (m (Maybe GVariant)), MonadIO m, IsAction a) => O.OverloadedMethod ActionGetStateMethodInfo a signature where
overloadedMethod = actionGetState
instance O.OverloadedMethodInfo ActionGetStateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Action.actionGetState",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Action.html#v:actionGetState"
})
#endif
foreign import ccall "g_action_get_state_hint" g_action_get_state_hint ::
Ptr Action ->
IO (Ptr GVariant)
actionGetStateHint ::
(B.CallStack.HasCallStack, MonadIO m, IsAction a) =>
a
-> m (Maybe GVariant)
actionGetStateHint :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAction a) =>
a -> m (Maybe GVariant)
actionGetStateHint a
action = IO (Maybe GVariant) -> m (Maybe GVariant)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe GVariant) -> m (Maybe GVariant))
-> IO (Maybe GVariant) -> m (Maybe GVariant)
forall a b. (a -> b) -> a -> b
$ do
action' <- a -> IO (Ptr Action)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
action
result <- g_action_get_state_hint action'
maybeResult <- convertIfNonNull result $ \Ptr GVariant
result' -> do
result'' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
result'
return result''
touchManagedPtr action
return maybeResult
#if defined(ENABLE_OVERLOADING)
data ActionGetStateHintMethodInfo
instance (signature ~ (m (Maybe GVariant)), MonadIO m, IsAction a) => O.OverloadedMethod ActionGetStateHintMethodInfo a signature where
overloadedMethod = actionGetStateHint
instance O.OverloadedMethodInfo ActionGetStateHintMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Action.actionGetStateHint",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Action.html#v:actionGetStateHint"
})
#endif
foreign import ccall "g_action_get_state_type" g_action_get_state_type ::
Ptr Action ->
IO (Ptr GLib.VariantType.VariantType)
actionGetStateType ::
(B.CallStack.HasCallStack, MonadIO m, IsAction a) =>
a
-> m (Maybe GLib.VariantType.VariantType)
actionGetStateType :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAction a) =>
a -> m (Maybe VariantType)
actionGetStateType a
action = IO (Maybe VariantType) -> m (Maybe VariantType)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe VariantType) -> m (Maybe VariantType))
-> IO (Maybe VariantType) -> m (Maybe VariantType)
forall a b. (a -> b) -> a -> b
$ do
action' <- a -> IO (Ptr Action)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
action
result <- g_action_get_state_type action'
maybeResult <- convertIfNonNull result $ \Ptr VariantType
result' -> do
result'' <- ((ManagedPtr VariantType -> VariantType)
-> Ptr VariantType -> IO VariantType
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr VariantType -> VariantType
GLib.VariantType.VariantType) Ptr VariantType
result'
return result''
touchManagedPtr action
return maybeResult
#if defined(ENABLE_OVERLOADING)
data ActionGetStateTypeMethodInfo
instance (signature ~ (m (Maybe GLib.VariantType.VariantType)), MonadIO m, IsAction a) => O.OverloadedMethod ActionGetStateTypeMethodInfo a signature where
overloadedMethod = actionGetStateType
instance O.OverloadedMethodInfo ActionGetStateTypeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Action.actionGetStateType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Action.html#v:actionGetStateType"
})
#endif
foreign import ccall "g_action_name_is_valid" g_action_name_is_valid ::
CString ->
IO CInt
actionNameIsValid ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m Bool
actionNameIsValid :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Bool
actionNameIsValid Text
actionName = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
actionName' <- Text -> IO CString
textToCString Text
actionName
result <- g_action_name_is_valid actionName'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
freeMem actionName'
return result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_action_parse_detailed_name" g_action_parse_detailed_name ::
CString ->
Ptr CString ->
Ptr (Ptr GVariant) ->
Ptr (Ptr GError) ->
IO CInt
actionParseDetailedName ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m ((T.Text, Maybe GVariant))
actionParseDetailedName :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m (Text, Maybe GVariant)
actionParseDetailedName Text
detailedName = IO (Text, Maybe GVariant) -> m (Text, Maybe GVariant)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Text, Maybe GVariant) -> m (Text, Maybe GVariant))
-> IO (Text, Maybe GVariant) -> m (Text, Maybe GVariant)
forall a b. (a -> b) -> a -> b
$ do
detailedName' <- Text -> IO CString
textToCString Text
detailedName
actionName <- callocMem :: IO (Ptr CString)
targetValue <- callocMem :: IO (Ptr (Ptr GVariant))
onException (do
_ <- propagateGError $ g_action_parse_detailed_name detailedName' actionName targetValue
actionName' <- peek actionName
actionName'' <- cstringToText actionName'
freeMem actionName'
targetValue' <- peek targetValue
maybeTargetValue' <- convertIfNonNull targetValue' $ \Ptr GVariant
targetValue'' -> do
targetValue''' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
targetValue''
return targetValue'''
freeMem detailedName'
freeMem actionName
freeMem targetValue
return (actionName'', maybeTargetValue')
) (do
freeMem detailedName'
freeMem actionName
freeMem targetValue
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_action_print_detailed_name" g_action_print_detailed_name ::
CString ->
Ptr GVariant ->
IO CString
actionPrintDetailedName ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Maybe (GVariant)
-> m T.Text
actionPrintDetailedName :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> Maybe GVariant -> m Text
actionPrintDetailedName Text
actionName Maybe GVariant
targetValue = IO Text -> m Text
forall a. IO a -> m a
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
actionName' <- Text -> IO CString
textToCString Text
actionName
maybeTargetValue <- case targetValue of
Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
Just GVariant
jTargetValue -> do
jTargetValue' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jTargetValue
return jTargetValue'
result <- g_action_print_detailed_name actionName' maybeTargetValue
checkUnexpectedReturnNULL "actionPrintDetailedName" result
result' <- cstringToText result
freeMem result
whenJust targetValue touchManagedPtr
freeMem actionName'
return result'
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Action = ActionSignalList
type ActionSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif