#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.SimpleAction
(
SimpleAction(..) ,
IsSimpleAction ,
toSimpleAction ,
noSimpleAction ,
simpleActionNew ,
simpleActionNewStateful ,
#if ENABLE_OVERLOADING
SimpleActionSetEnabledMethodInfo ,
#endif
simpleActionSetEnabled ,
#if ENABLE_OVERLOADING
SimpleActionSetStateMethodInfo ,
#endif
simpleActionSetState ,
#if ENABLE_OVERLOADING
SimpleActionSetStateHintMethodInfo ,
#endif
simpleActionSetStateHint ,
#if ENABLE_OVERLOADING
SimpleActionEnabledPropertyInfo ,
#endif
constructSimpleActionEnabled ,
getSimpleActionEnabled ,
setSimpleActionEnabled ,
#if ENABLE_OVERLOADING
simpleActionEnabled ,
#endif
#if ENABLE_OVERLOADING
SimpleActionNamePropertyInfo ,
#endif
constructSimpleActionName ,
getSimpleActionName ,
#if ENABLE_OVERLOADING
simpleActionName ,
#endif
#if ENABLE_OVERLOADING
SimpleActionParameterTypePropertyInfo ,
#endif
constructSimpleActionParameterType ,
getSimpleActionParameterType ,
#if ENABLE_OVERLOADING
simpleActionParameterType ,
#endif
#if ENABLE_OVERLOADING
SimpleActionStatePropertyInfo ,
#endif
constructSimpleActionState ,
getSimpleActionState ,
setSimpleActionState ,
#if ENABLE_OVERLOADING
simpleActionState ,
#endif
#if ENABLE_OVERLOADING
SimpleActionStateTypePropertyInfo ,
#endif
getSimpleActionStateType ,
#if ENABLE_OVERLOADING
simpleActionStateType ,
#endif
C_SimpleActionActivateCallback ,
SimpleActionActivateCallback ,
#if ENABLE_OVERLOADING
SimpleActionActivateSignalInfo ,
#endif
afterSimpleActionActivate ,
genClosure_SimpleActionActivate ,
mk_SimpleActionActivateCallback ,
noSimpleActionActivateCallback ,
onSimpleActionActivate ,
wrap_SimpleActionActivateCallback ,
C_SimpleActionChangeStateCallback ,
SimpleActionChangeStateCallback ,
#if ENABLE_OVERLOADING
SimpleActionChangeStateSignalInfo ,
#endif
afterSimpleActionChangeState ,
genClosure_SimpleActionChangeState ,
mk_SimpleActionChangeStateCallback ,
noSimpleActionChangeStateCallback ,
onSimpleActionChangeState ,
wrap_SimpleActionChangeStateCallback ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GI.GLib.Structs.VariantType as GLib.VariantType
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Action as Gio.Action
newtype SimpleAction = SimpleAction (ManagedPtr SimpleAction)
foreign import ccall "g_simple_action_get_type"
c_g_simple_action_get_type :: IO GType
instance GObject SimpleAction where
gobjectType _ = c_g_simple_action_get_type
class GObject o => IsSimpleAction o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError SimpleAction a) =>
IsSimpleAction a
#endif
instance IsSimpleAction SimpleAction
instance GObject.Object.IsObject SimpleAction
instance Gio.Action.IsAction SimpleAction
toSimpleAction :: (MonadIO m, IsSimpleAction o) => o -> m SimpleAction
toSimpleAction = liftIO . unsafeCastTo SimpleAction
noSimpleAction :: Maybe SimpleAction
noSimpleAction = Nothing
#if ENABLE_OVERLOADING
type family ResolveSimpleActionMethod (t :: Symbol) (o :: *) :: * where
ResolveSimpleActionMethod "activate" o = Gio.Action.ActionActivateMethodInfo
ResolveSimpleActionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSimpleActionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSimpleActionMethod "changeState" o = Gio.Action.ActionChangeStateMethodInfo
ResolveSimpleActionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSimpleActionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSimpleActionMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSimpleActionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSimpleActionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSimpleActionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSimpleActionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSimpleActionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSimpleActionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSimpleActionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSimpleActionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSimpleActionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSimpleActionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSimpleActionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSimpleActionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSimpleActionMethod "getEnabled" o = Gio.Action.ActionGetEnabledMethodInfo
ResolveSimpleActionMethod "getName" o = Gio.Action.ActionGetNameMethodInfo
ResolveSimpleActionMethod "getParameterType" o = Gio.Action.ActionGetParameterTypeMethodInfo
ResolveSimpleActionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSimpleActionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSimpleActionMethod "getState" o = Gio.Action.ActionGetStateMethodInfo
ResolveSimpleActionMethod "getStateHint" o = Gio.Action.ActionGetStateHintMethodInfo
ResolveSimpleActionMethod "getStateType" o = Gio.Action.ActionGetStateTypeMethodInfo
ResolveSimpleActionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSimpleActionMethod "setEnabled" o = SimpleActionSetEnabledMethodInfo
ResolveSimpleActionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSimpleActionMethod "setState" o = SimpleActionSetStateMethodInfo
ResolveSimpleActionMethod "setStateHint" o = SimpleActionSetStateHintMethodInfo
ResolveSimpleActionMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSimpleActionMethod t SimpleAction, O.MethodInfo info SimpleAction p) => O.IsLabelProxy t (SimpleAction -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveSimpleActionMethod t SimpleAction, O.MethodInfo info SimpleAction p) => O.IsLabel t (SimpleAction -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif
type SimpleActionActivateCallback =
Maybe GVariant
-> IO ()
noSimpleActionActivateCallback :: Maybe SimpleActionActivateCallback
noSimpleActionActivateCallback = Nothing
type C_SimpleActionActivateCallback =
Ptr () ->
Ptr GVariant ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_SimpleActionActivateCallback :: C_SimpleActionActivateCallback -> IO (FunPtr C_SimpleActionActivateCallback)
genClosure_SimpleActionActivate :: SimpleActionActivateCallback -> IO Closure
genClosure_SimpleActionActivate cb = do
let cb' = wrap_SimpleActionActivateCallback cb
mk_SimpleActionActivateCallback cb' >>= newCClosure
wrap_SimpleActionActivateCallback ::
SimpleActionActivateCallback ->
C_SimpleActionActivateCallback
wrap_SimpleActionActivateCallback _cb _ parameter _ = do
maybeParameter <-
if parameter == nullPtr
then return Nothing
else do
parameter' <- B.GVariant.newGVariantFromPtr parameter
return $ Just parameter'
_cb maybeParameter
onSimpleActionActivate :: (IsSimpleAction a, MonadIO m) => a -> SimpleActionActivateCallback -> m SignalHandlerId
onSimpleActionActivate obj cb = liftIO $ do
let cb' = wrap_SimpleActionActivateCallback cb
cb'' <- mk_SimpleActionActivateCallback cb'
connectSignalFunPtr obj "activate" cb'' SignalConnectBefore
afterSimpleActionActivate :: (IsSimpleAction a, MonadIO m) => a -> SimpleActionActivateCallback -> m SignalHandlerId
afterSimpleActionActivate obj cb = liftIO $ do
let cb' = wrap_SimpleActionActivateCallback cb
cb'' <- mk_SimpleActionActivateCallback cb'
connectSignalFunPtr obj "activate" cb'' SignalConnectAfter
type SimpleActionChangeStateCallback =
Maybe GVariant
-> IO ()
noSimpleActionChangeStateCallback :: Maybe SimpleActionChangeStateCallback
noSimpleActionChangeStateCallback = Nothing
type C_SimpleActionChangeStateCallback =
Ptr () ->
Ptr GVariant ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_SimpleActionChangeStateCallback :: C_SimpleActionChangeStateCallback -> IO (FunPtr C_SimpleActionChangeStateCallback)
genClosure_SimpleActionChangeState :: SimpleActionChangeStateCallback -> IO Closure
genClosure_SimpleActionChangeState cb = do
let cb' = wrap_SimpleActionChangeStateCallback cb
mk_SimpleActionChangeStateCallback cb' >>= newCClosure
wrap_SimpleActionChangeStateCallback ::
SimpleActionChangeStateCallback ->
C_SimpleActionChangeStateCallback
wrap_SimpleActionChangeStateCallback _cb _ value _ = do
maybeValue <-
if value == nullPtr
then return Nothing
else do
value' <- B.GVariant.newGVariantFromPtr value
return $ Just value'
_cb maybeValue
onSimpleActionChangeState :: (IsSimpleAction a, MonadIO m) => a -> SimpleActionChangeStateCallback -> m SignalHandlerId
onSimpleActionChangeState obj cb = liftIO $ do
let cb' = wrap_SimpleActionChangeStateCallback cb
cb'' <- mk_SimpleActionChangeStateCallback cb'
connectSignalFunPtr obj "change-state" cb'' SignalConnectBefore
afterSimpleActionChangeState :: (IsSimpleAction a, MonadIO m) => a -> SimpleActionChangeStateCallback -> m SignalHandlerId
afterSimpleActionChangeState obj cb = liftIO $ do
let cb' = wrap_SimpleActionChangeStateCallback cb
cb'' <- mk_SimpleActionChangeStateCallback cb'
connectSignalFunPtr obj "change-state" cb'' SignalConnectAfter
getSimpleActionEnabled :: (MonadIO m, IsSimpleAction o) => o -> m Bool
getSimpleActionEnabled obj = liftIO $ getObjectPropertyBool obj "enabled"
setSimpleActionEnabled :: (MonadIO m, IsSimpleAction o) => o -> Bool -> m ()
setSimpleActionEnabled obj val = liftIO $ setObjectPropertyBool obj "enabled" val
constructSimpleActionEnabled :: (IsSimpleAction o) => Bool -> IO (GValueConstruct o)
constructSimpleActionEnabled val = constructObjectPropertyBool "enabled" val
#if ENABLE_OVERLOADING
data SimpleActionEnabledPropertyInfo
instance AttrInfo SimpleActionEnabledPropertyInfo where
type AttrAllowedOps SimpleActionEnabledPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint SimpleActionEnabledPropertyInfo = (~) Bool
type AttrBaseTypeConstraint SimpleActionEnabledPropertyInfo = IsSimpleAction
type AttrGetType SimpleActionEnabledPropertyInfo = Bool
type AttrLabel SimpleActionEnabledPropertyInfo = "enabled"
type AttrOrigin SimpleActionEnabledPropertyInfo = SimpleAction
attrGet _ = getSimpleActionEnabled
attrSet _ = setSimpleActionEnabled
attrConstruct _ = constructSimpleActionEnabled
attrClear _ = undefined
#endif
getSimpleActionName :: (MonadIO m, IsSimpleAction o) => o -> m (Maybe T.Text)
getSimpleActionName obj = liftIO $ getObjectPropertyString obj "name"
constructSimpleActionName :: (IsSimpleAction o) => T.Text -> IO (GValueConstruct o)
constructSimpleActionName val = constructObjectPropertyString "name" (Just val)
#if ENABLE_OVERLOADING
data SimpleActionNamePropertyInfo
instance AttrInfo SimpleActionNamePropertyInfo where
type AttrAllowedOps SimpleActionNamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint SimpleActionNamePropertyInfo = (~) T.Text
type AttrBaseTypeConstraint SimpleActionNamePropertyInfo = IsSimpleAction
type AttrGetType SimpleActionNamePropertyInfo = (Maybe T.Text)
type AttrLabel SimpleActionNamePropertyInfo = "name"
type AttrOrigin SimpleActionNamePropertyInfo = SimpleAction
attrGet _ = getSimpleActionName
attrSet _ = undefined
attrConstruct _ = constructSimpleActionName
attrClear _ = undefined
#endif
getSimpleActionParameterType :: (MonadIO m, IsSimpleAction o) => o -> m (Maybe GLib.VariantType.VariantType)
getSimpleActionParameterType obj = liftIO $ getObjectPropertyBoxed obj "parameter-type" GLib.VariantType.VariantType
constructSimpleActionParameterType :: (IsSimpleAction o) => GLib.VariantType.VariantType -> IO (GValueConstruct o)
constructSimpleActionParameterType val = constructObjectPropertyBoxed "parameter-type" (Just val)
#if ENABLE_OVERLOADING
data SimpleActionParameterTypePropertyInfo
instance AttrInfo SimpleActionParameterTypePropertyInfo where
type AttrAllowedOps SimpleActionParameterTypePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint SimpleActionParameterTypePropertyInfo = (~) GLib.VariantType.VariantType
type AttrBaseTypeConstraint SimpleActionParameterTypePropertyInfo = IsSimpleAction
type AttrGetType SimpleActionParameterTypePropertyInfo = (Maybe GLib.VariantType.VariantType)
type AttrLabel SimpleActionParameterTypePropertyInfo = "parameter-type"
type AttrOrigin SimpleActionParameterTypePropertyInfo = SimpleAction
attrGet _ = getSimpleActionParameterType
attrSet _ = undefined
attrConstruct _ = constructSimpleActionParameterType
attrClear _ = undefined
#endif
getSimpleActionState :: (MonadIO m, IsSimpleAction o) => o -> m (Maybe GVariant)
getSimpleActionState obj = liftIO $ getObjectPropertyVariant obj "state"
setSimpleActionState :: (MonadIO m, IsSimpleAction o) => o -> GVariant -> m ()
setSimpleActionState obj val = liftIO $ setObjectPropertyVariant obj "state" (Just val)
constructSimpleActionState :: (IsSimpleAction o) => GVariant -> IO (GValueConstruct o)
constructSimpleActionState val = constructObjectPropertyVariant "state" (Just val)
#if ENABLE_OVERLOADING
data SimpleActionStatePropertyInfo
instance AttrInfo SimpleActionStatePropertyInfo where
type AttrAllowedOps SimpleActionStatePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint SimpleActionStatePropertyInfo = (~) GVariant
type AttrBaseTypeConstraint SimpleActionStatePropertyInfo = IsSimpleAction
type AttrGetType SimpleActionStatePropertyInfo = (Maybe GVariant)
type AttrLabel SimpleActionStatePropertyInfo = "state"
type AttrOrigin SimpleActionStatePropertyInfo = SimpleAction
attrGet _ = getSimpleActionState
attrSet _ = setSimpleActionState
attrConstruct _ = constructSimpleActionState
attrClear _ = undefined
#endif
getSimpleActionStateType :: (MonadIO m, IsSimpleAction o) => o -> m (Maybe GLib.VariantType.VariantType)
getSimpleActionStateType obj = liftIO $ getObjectPropertyBoxed obj "state-type" GLib.VariantType.VariantType
#if ENABLE_OVERLOADING
data SimpleActionStateTypePropertyInfo
instance AttrInfo SimpleActionStateTypePropertyInfo where
type AttrAllowedOps SimpleActionStateTypePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint SimpleActionStateTypePropertyInfo = (~) ()
type AttrBaseTypeConstraint SimpleActionStateTypePropertyInfo = IsSimpleAction
type AttrGetType SimpleActionStateTypePropertyInfo = (Maybe GLib.VariantType.VariantType)
type AttrLabel SimpleActionStateTypePropertyInfo = "state-type"
type AttrOrigin SimpleActionStateTypePropertyInfo = SimpleAction
attrGet _ = getSimpleActionStateType
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList SimpleAction
type instance O.AttributeList SimpleAction = SimpleActionAttributeList
type SimpleActionAttributeList = ('[ '("enabled", SimpleActionEnabledPropertyInfo), '("name", SimpleActionNamePropertyInfo), '("parameterType", SimpleActionParameterTypePropertyInfo), '("state", SimpleActionStatePropertyInfo), '("stateType", SimpleActionStateTypePropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
simpleActionEnabled :: AttrLabelProxy "enabled"
simpleActionEnabled = AttrLabelProxy
simpleActionName :: AttrLabelProxy "name"
simpleActionName = AttrLabelProxy
simpleActionParameterType :: AttrLabelProxy "parameterType"
simpleActionParameterType = AttrLabelProxy
simpleActionState :: AttrLabelProxy "state"
simpleActionState = AttrLabelProxy
simpleActionStateType :: AttrLabelProxy "stateType"
simpleActionStateType = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
data SimpleActionActivateSignalInfo
instance SignalInfo SimpleActionActivateSignalInfo where
type HaskellCallbackType SimpleActionActivateSignalInfo = SimpleActionActivateCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_SimpleActionActivateCallback cb
cb'' <- mk_SimpleActionActivateCallback cb'
connectSignalFunPtr obj "activate" cb'' connectMode
data SimpleActionChangeStateSignalInfo
instance SignalInfo SimpleActionChangeStateSignalInfo where
type HaskellCallbackType SimpleActionChangeStateSignalInfo = SimpleActionChangeStateCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_SimpleActionChangeStateCallback cb
cb'' <- mk_SimpleActionChangeStateCallback cb'
connectSignalFunPtr obj "change-state" cb'' connectMode
type instance O.SignalList SimpleAction = SimpleActionSignalList
type SimpleActionSignalList = ('[ '("activate", SimpleActionActivateSignalInfo), '("changeState", SimpleActionChangeStateSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_simple_action_new" g_simple_action_new ::
CString ->
Ptr GLib.VariantType.VariantType ->
IO (Ptr SimpleAction)
simpleActionNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Maybe (GLib.VariantType.VariantType)
-> m SimpleAction
simpleActionNew name parameterType = liftIO $ do
name' <- textToCString name
maybeParameterType <- case parameterType of
Nothing -> return nullPtr
Just jParameterType -> do
jParameterType' <- unsafeManagedPtrGetPtr jParameterType
return jParameterType'
result <- g_simple_action_new name' maybeParameterType
checkUnexpectedReturnNULL "simpleActionNew" result
result' <- (wrapObject SimpleAction) result
whenJust parameterType touchManagedPtr
freeMem name'
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_simple_action_new_stateful" g_simple_action_new_stateful ::
CString ->
Ptr GLib.VariantType.VariantType ->
Ptr GVariant ->
IO (Ptr SimpleAction)
simpleActionNewStateful ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Maybe (GLib.VariantType.VariantType)
-> GVariant
-> m SimpleAction
simpleActionNewStateful name parameterType state = liftIO $ do
name' <- textToCString name
maybeParameterType <- case parameterType of
Nothing -> return nullPtr
Just jParameterType -> do
jParameterType' <- unsafeManagedPtrGetPtr jParameterType
return jParameterType'
state' <- unsafeManagedPtrGetPtr state
result <- g_simple_action_new_stateful name' maybeParameterType state'
checkUnexpectedReturnNULL "simpleActionNewStateful" result
result' <- (wrapObject SimpleAction) result
whenJust parameterType touchManagedPtr
touchManagedPtr state
freeMem name'
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_simple_action_set_enabled" g_simple_action_set_enabled ::
Ptr SimpleAction ->
CInt ->
IO ()
simpleActionSetEnabled ::
(B.CallStack.HasCallStack, MonadIO m, IsSimpleAction a) =>
a
-> Bool
-> m ()
simpleActionSetEnabled simple enabled = liftIO $ do
simple' <- unsafeManagedPtrCastPtr simple
let enabled' = (fromIntegral . fromEnum) enabled
g_simple_action_set_enabled simple' enabled'
touchManagedPtr simple
return ()
#if ENABLE_OVERLOADING
data SimpleActionSetEnabledMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSimpleAction a) => O.MethodInfo SimpleActionSetEnabledMethodInfo a signature where
overloadedMethod _ = simpleActionSetEnabled
#endif
foreign import ccall "g_simple_action_set_state" g_simple_action_set_state ::
Ptr SimpleAction ->
Ptr GVariant ->
IO ()
simpleActionSetState ::
(B.CallStack.HasCallStack, MonadIO m, IsSimpleAction a) =>
a
-> GVariant
-> m ()
simpleActionSetState simple value = liftIO $ do
simple' <- unsafeManagedPtrCastPtr simple
value' <- unsafeManagedPtrGetPtr value
g_simple_action_set_state simple' value'
touchManagedPtr simple
touchManagedPtr value
return ()
#if ENABLE_OVERLOADING
data SimpleActionSetStateMethodInfo
instance (signature ~ (GVariant -> m ()), MonadIO m, IsSimpleAction a) => O.MethodInfo SimpleActionSetStateMethodInfo a signature where
overloadedMethod _ = simpleActionSetState
#endif
foreign import ccall "g_simple_action_set_state_hint" g_simple_action_set_state_hint ::
Ptr SimpleAction ->
Ptr GVariant ->
IO ()
simpleActionSetStateHint ::
(B.CallStack.HasCallStack, MonadIO m, IsSimpleAction a) =>
a
-> Maybe (GVariant)
-> m ()
simpleActionSetStateHint simple stateHint = liftIO $ do
simple' <- unsafeManagedPtrCastPtr simple
maybeStateHint <- case stateHint of
Nothing -> return nullPtr
Just jStateHint -> do
jStateHint' <- unsafeManagedPtrGetPtr jStateHint
return jStateHint'
g_simple_action_set_state_hint simple' maybeStateHint
touchManagedPtr simple
whenJust stateHint touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data SimpleActionSetStateHintMethodInfo
instance (signature ~ (Maybe (GVariant) -> m ()), MonadIO m, IsSimpleAction a) => O.MethodInfo SimpleActionSetStateHintMethodInfo a signature where
overloadedMethod _ = simpleActionSetStateHint
#endif