{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.SimpleAction
(
SimpleAction(..) ,
IsSimpleAction ,
toSimpleAction ,
#if defined(ENABLE_OVERLOADING)
ResolveSimpleActionMethod ,
#endif
simpleActionNew ,
simpleActionNewStateful ,
#if defined(ENABLE_OVERLOADING)
SimpleActionSetEnabledMethodInfo ,
#endif
simpleActionSetEnabled ,
#if defined(ENABLE_OVERLOADING)
SimpleActionSetStateMethodInfo ,
#endif
simpleActionSetState ,
#if defined(ENABLE_OVERLOADING)
SimpleActionSetStateHintMethodInfo ,
#endif
simpleActionSetStateHint ,
#if defined(ENABLE_OVERLOADING)
SimpleActionEnabledPropertyInfo ,
#endif
constructSimpleActionEnabled ,
getSimpleActionEnabled ,
setSimpleActionEnabled ,
#if defined(ENABLE_OVERLOADING)
simpleActionEnabled ,
#endif
#if defined(ENABLE_OVERLOADING)
SimpleActionNamePropertyInfo ,
#endif
constructSimpleActionName ,
getSimpleActionName ,
#if defined(ENABLE_OVERLOADING)
simpleActionName ,
#endif
#if defined(ENABLE_OVERLOADING)
SimpleActionParameterTypePropertyInfo ,
#endif
constructSimpleActionParameterType ,
getSimpleActionParameterType ,
#if defined(ENABLE_OVERLOADING)
simpleActionParameterType ,
#endif
#if defined(ENABLE_OVERLOADING)
SimpleActionStatePropertyInfo ,
#endif
constructSimpleActionState ,
getSimpleActionState ,
setSimpleActionState ,
#if defined(ENABLE_OVERLOADING)
simpleActionState ,
#endif
#if defined(ENABLE_OVERLOADING)
SimpleActionStateTypePropertyInfo ,
#endif
getSimpleActionStateType ,
#if defined(ENABLE_OVERLOADING)
simpleActionStateType ,
#endif
SimpleActionActivateCallback ,
#if defined(ENABLE_OVERLOADING)
SimpleActionActivateSignalInfo ,
#endif
afterSimpleActionActivate ,
onSimpleActionActivate ,
SimpleActionChangeStateCallback ,
#if defined(ENABLE_OVERLOADING)
SimpleActionChangeStateSignalInfo ,
#endif
afterSimpleActionChangeState ,
onSimpleActionChangeState ,
) 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
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Action as Gio.Action
#else
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
#endif
newtype SimpleAction = SimpleAction (SP.ManagedPtr SimpleAction)
deriving (SimpleAction -> SimpleAction -> Bool
(SimpleAction -> SimpleAction -> Bool)
-> (SimpleAction -> SimpleAction -> Bool) -> Eq SimpleAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SimpleAction -> SimpleAction -> Bool
== :: SimpleAction -> SimpleAction -> Bool
$c/= :: SimpleAction -> SimpleAction -> Bool
/= :: SimpleAction -> SimpleAction -> Bool
Eq)
instance SP.ManagedPtrNewtype SimpleAction where
toManagedPtr :: SimpleAction -> ManagedPtr SimpleAction
toManagedPtr (SimpleAction ManagedPtr SimpleAction
p) = ManagedPtr SimpleAction
p
foreign import ccall "g_simple_action_get_type"
c_g_simple_action_get_type :: IO B.Types.GType
instance B.Types.TypedObject SimpleAction where
glibType :: IO GType
glibType = IO GType
c_g_simple_action_get_type
instance B.Types.GObject SimpleAction
class (SP.GObject o, O.IsDescendantOf SimpleAction o) => IsSimpleAction o
instance (SP.GObject o, O.IsDescendantOf SimpleAction o) => IsSimpleAction o
instance O.HasParentTypes SimpleAction
type instance O.ParentTypes SimpleAction = '[GObject.Object.Object, Gio.Action.Action]
toSimpleAction :: (MIO.MonadIO m, IsSimpleAction o) => o -> m SimpleAction
toSimpleAction :: forall (m :: * -> *) o.
(MonadIO m, IsSimpleAction o) =>
o -> m SimpleAction
toSimpleAction = IO SimpleAction -> m SimpleAction
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO SimpleAction -> m SimpleAction)
-> (o -> IO SimpleAction) -> o -> m SimpleAction
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr SimpleAction -> SimpleAction) -> o -> IO SimpleAction
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr SimpleAction -> SimpleAction
SimpleAction
instance B.GValue.IsGValue (Maybe SimpleAction) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_simple_action_get_type
gvalueSet_ :: Ptr GValue -> Maybe SimpleAction -> IO ()
gvalueSet_ Ptr GValue
gv Maybe SimpleAction
P.Nothing = Ptr GValue -> Ptr SimpleAction -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr SimpleAction
forall a. Ptr a
FP.nullPtr :: FP.Ptr SimpleAction)
gvalueSet_ Ptr GValue
gv (P.Just SimpleAction
obj) = SimpleAction -> (Ptr SimpleAction -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr SimpleAction
obj (Ptr GValue -> Ptr SimpleAction -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe SimpleAction)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr SimpleAction)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr SimpleAction)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject SimpleAction ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveSimpleActionMethod (t :: Symbol) (o :: DK.Type) :: DK.Type 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 "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
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.OverloadedMethod info SimpleAction p) => OL.IsLabel t (SimpleAction -> 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 ~ ResolveSimpleActionMethod t SimpleAction, O.OverloadedMethod info SimpleAction p, R.HasField t SimpleAction p) => R.HasField t SimpleAction p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveSimpleActionMethod t SimpleAction, O.OverloadedMethodInfo info SimpleAction) => OL.IsLabel t (O.MethodProxy info SimpleAction) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type SimpleActionActivateCallback =
Maybe GVariant
-> IO ()
type C_SimpleActionActivateCallback =
Ptr SimpleAction ->
Ptr GVariant ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_SimpleActionActivateCallback :: C_SimpleActionActivateCallback -> IO (FunPtr C_SimpleActionActivateCallback)
wrap_SimpleActionActivateCallback ::
GObject a => (a -> SimpleActionActivateCallback) ->
C_SimpleActionActivateCallback
wrap_SimpleActionActivateCallback :: forall a.
GObject a =>
(a -> SimpleActionActivateCallback)
-> C_SimpleActionActivateCallback
wrap_SimpleActionActivateCallback a -> SimpleActionActivateCallback
gi'cb Ptr SimpleAction
gi'selfPtr Ptr GVariant
parameter Ptr ()
_ = do
maybeParameter <-
if Ptr GVariant
parameter Ptr GVariant -> Ptr GVariant -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr GVariant
forall a. Ptr a
FP.nullPtr
then Maybe GVariant -> IO (Maybe GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe GVariant
forall a. Maybe a
Nothing
else do
parameter' <- Ptr GVariant -> IO GVariant
B.GVariant.newGVariantFromPtr Ptr GVariant
parameter
return $ Just parameter'
B.ManagedPtr.withNewObject gi'selfPtr $ \SimpleAction
gi'self -> a -> SimpleActionActivateCallback
gi'cb (SimpleAction -> a
forall a b. Coercible a b => a -> b
Coerce.coerce SimpleAction
gi'self) Maybe GVariant
maybeParameter
onSimpleActionActivate :: (IsSimpleAction a, MonadIO m) => a -> ((?self :: a) => SimpleActionActivateCallback) -> m SignalHandlerId
onSimpleActionActivate :: forall a (m :: * -> *).
(IsSimpleAction a, MonadIO m) =>
a
-> ((?self::a) => SimpleActionActivateCallback)
-> m SignalHandlerId
onSimpleActionActivate a
obj (?self::a) => SimpleActionActivateCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> SimpleActionActivateCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SimpleActionActivateCallback
SimpleActionActivateCallback
cb
let wrapped' :: C_SimpleActionActivateCallback
wrapped' = (a -> SimpleActionActivateCallback)
-> C_SimpleActionActivateCallback
forall a.
GObject a =>
(a -> SimpleActionActivateCallback)
-> C_SimpleActionActivateCallback
wrap_SimpleActionActivateCallback a -> SimpleActionActivateCallback
wrapped
wrapped'' <- C_SimpleActionActivateCallback
-> IO (FunPtr C_SimpleActionActivateCallback)
mk_SimpleActionActivateCallback C_SimpleActionActivateCallback
wrapped'
connectSignalFunPtr obj "activate" wrapped'' SignalConnectBefore Nothing
afterSimpleActionActivate :: (IsSimpleAction a, MonadIO m) => a -> ((?self :: a) => SimpleActionActivateCallback) -> m SignalHandlerId
afterSimpleActionActivate :: forall a (m :: * -> *).
(IsSimpleAction a, MonadIO m) =>
a
-> ((?self::a) => SimpleActionActivateCallback)
-> m SignalHandlerId
afterSimpleActionActivate a
obj (?self::a) => SimpleActionActivateCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> SimpleActionActivateCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SimpleActionActivateCallback
SimpleActionActivateCallback
cb
let wrapped' :: C_SimpleActionActivateCallback
wrapped' = (a -> SimpleActionActivateCallback)
-> C_SimpleActionActivateCallback
forall a.
GObject a =>
(a -> SimpleActionActivateCallback)
-> C_SimpleActionActivateCallback
wrap_SimpleActionActivateCallback a -> SimpleActionActivateCallback
wrapped
wrapped'' <- C_SimpleActionActivateCallback
-> IO (FunPtr C_SimpleActionActivateCallback)
mk_SimpleActionActivateCallback C_SimpleActionActivateCallback
wrapped'
connectSignalFunPtr obj "activate" wrapped'' SignalConnectAfter Nothing
#if defined(ENABLE_OVERLOADING)
data SimpleActionActivateSignalInfo
instance SignalInfo SimpleActionActivateSignalInfo where
type HaskellCallbackType SimpleActionActivateSignalInfo = SimpleActionActivateCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_SimpleActionActivateCallback cb
cb'' <- mk_SimpleActionActivateCallback cb'
connectSignalFunPtr obj "activate" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAction::activate"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAction.html#g:signal:activate"})
#endif
type SimpleActionChangeStateCallback =
Maybe GVariant
-> IO ()
type C_SimpleActionChangeStateCallback =
Ptr SimpleAction ->
Ptr GVariant ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_SimpleActionChangeStateCallback :: C_SimpleActionChangeStateCallback -> IO (FunPtr C_SimpleActionChangeStateCallback)
wrap_SimpleActionChangeStateCallback ::
GObject a => (a -> SimpleActionChangeStateCallback) ->
C_SimpleActionChangeStateCallback
wrap_SimpleActionChangeStateCallback :: forall a.
GObject a =>
(a -> SimpleActionActivateCallback)
-> C_SimpleActionActivateCallback
wrap_SimpleActionChangeStateCallback a -> SimpleActionActivateCallback
gi'cb Ptr SimpleAction
gi'selfPtr Ptr GVariant
value Ptr ()
_ = do
maybeValue <-
if Ptr GVariant
value Ptr GVariant -> Ptr GVariant -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr GVariant
forall a. Ptr a
FP.nullPtr
then Maybe GVariant -> IO (Maybe GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe GVariant
forall a. Maybe a
Nothing
else do
value' <- Ptr GVariant -> IO GVariant
B.GVariant.newGVariantFromPtr Ptr GVariant
value
return $ Just value'
B.ManagedPtr.withNewObject gi'selfPtr $ \SimpleAction
gi'self -> a -> SimpleActionActivateCallback
gi'cb (SimpleAction -> a
forall a b. Coercible a b => a -> b
Coerce.coerce SimpleAction
gi'self) Maybe GVariant
maybeValue
onSimpleActionChangeState :: (IsSimpleAction a, MonadIO m) => a -> ((?self :: a) => SimpleActionChangeStateCallback) -> m SignalHandlerId
onSimpleActionChangeState :: forall a (m :: * -> *).
(IsSimpleAction a, MonadIO m) =>
a
-> ((?self::a) => SimpleActionActivateCallback)
-> m SignalHandlerId
onSimpleActionChangeState a
obj (?self::a) => SimpleActionActivateCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> SimpleActionActivateCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SimpleActionActivateCallback
SimpleActionActivateCallback
cb
let wrapped' :: C_SimpleActionActivateCallback
wrapped' = (a -> SimpleActionActivateCallback)
-> C_SimpleActionActivateCallback
forall a.
GObject a =>
(a -> SimpleActionActivateCallback)
-> C_SimpleActionActivateCallback
wrap_SimpleActionChangeStateCallback a -> SimpleActionActivateCallback
wrapped
wrapped'' <- C_SimpleActionActivateCallback
-> IO (FunPtr C_SimpleActionActivateCallback)
mk_SimpleActionChangeStateCallback C_SimpleActionActivateCallback
wrapped'
connectSignalFunPtr obj "change-state" wrapped'' SignalConnectBefore Nothing
afterSimpleActionChangeState :: (IsSimpleAction a, MonadIO m) => a -> ((?self :: a) => SimpleActionChangeStateCallback) -> m SignalHandlerId
afterSimpleActionChangeState :: forall a (m :: * -> *).
(IsSimpleAction a, MonadIO m) =>
a
-> ((?self::a) => SimpleActionActivateCallback)
-> m SignalHandlerId
afterSimpleActionChangeState a
obj (?self::a) => SimpleActionActivateCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> SimpleActionActivateCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SimpleActionActivateCallback
SimpleActionActivateCallback
cb
let wrapped' :: C_SimpleActionActivateCallback
wrapped' = (a -> SimpleActionActivateCallback)
-> C_SimpleActionActivateCallback
forall a.
GObject a =>
(a -> SimpleActionActivateCallback)
-> C_SimpleActionActivateCallback
wrap_SimpleActionChangeStateCallback a -> SimpleActionActivateCallback
wrapped
wrapped'' <- C_SimpleActionActivateCallback
-> IO (FunPtr C_SimpleActionActivateCallback)
mk_SimpleActionChangeStateCallback C_SimpleActionActivateCallback
wrapped'
connectSignalFunPtr obj "change-state" wrapped'' SignalConnectAfter Nothing
#if defined(ENABLE_OVERLOADING)
data SimpleActionChangeStateSignalInfo
instance SignalInfo SimpleActionChangeStateSignalInfo where
type HaskellCallbackType SimpleActionChangeStateSignalInfo = SimpleActionChangeStateCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_SimpleActionChangeStateCallback cb
cb'' <- mk_SimpleActionChangeStateCallback cb'
connectSignalFunPtr obj "change-state" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAction::change-state"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAction.html#g:signal:changeState"})
#endif
getSimpleActionEnabled :: (MonadIO m, IsSimpleAction o) => o -> m Bool
getSimpleActionEnabled :: forall (m :: * -> *) o.
(MonadIO m, IsSimpleAction o) =>
o -> m Bool
getSimpleActionEnabled 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"
setSimpleActionEnabled :: (MonadIO m, IsSimpleAction o) => o -> Bool -> m ()
setSimpleActionEnabled :: forall (m :: * -> *) o.
(MonadIO m, IsSimpleAction o) =>
o -> Bool -> m ()
setSimpleActionEnabled o
obj Bool
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"enabled" Bool
val
constructSimpleActionEnabled :: (IsSimpleAction o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructSimpleActionEnabled :: forall o (m :: * -> *).
(IsSimpleAction o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructSimpleActionEnabled Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"enabled" Bool
val
#if defined(ENABLE_OVERLOADING)
data SimpleActionEnabledPropertyInfo
instance AttrInfo SimpleActionEnabledPropertyInfo where
type AttrAllowedOps SimpleActionEnabledPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint SimpleActionEnabledPropertyInfo = IsSimpleAction
type AttrSetTypeConstraint SimpleActionEnabledPropertyInfo = (~) Bool
type AttrTransferTypeConstraint SimpleActionEnabledPropertyInfo = (~) Bool
type AttrTransferType SimpleActionEnabledPropertyInfo = Bool
type AttrGetType SimpleActionEnabledPropertyInfo = Bool
type AttrLabel SimpleActionEnabledPropertyInfo = "enabled"
type AttrOrigin SimpleActionEnabledPropertyInfo = SimpleAction
attrGet = getSimpleActionEnabled
attrSet = setSimpleActionEnabled
attrTransfer _ v = do
return v
attrConstruct = constructSimpleActionEnabled
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAction.enabled"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAction.html#g:attr:enabled"
})
#endif
getSimpleActionName :: (MonadIO m, IsSimpleAction o) => o -> m (Maybe T.Text)
getSimpleActionName :: forall (m :: * -> *) o.
(MonadIO m, IsSimpleAction o) =>
o -> m (Maybe Text)
getSimpleActionName o
obj = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe 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"
constructSimpleActionName :: (IsSimpleAction o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructSimpleActionName :: forall o (m :: * -> *).
(IsSimpleAction o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructSimpleActionName Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"name" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
#if defined(ENABLE_OVERLOADING)
data SimpleActionNamePropertyInfo
instance AttrInfo SimpleActionNamePropertyInfo where
type AttrAllowedOps SimpleActionNamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint SimpleActionNamePropertyInfo = IsSimpleAction
type AttrSetTypeConstraint SimpleActionNamePropertyInfo = (~) T.Text
type AttrTransferTypeConstraint SimpleActionNamePropertyInfo = (~) T.Text
type AttrTransferType SimpleActionNamePropertyInfo = T.Text
type AttrGetType SimpleActionNamePropertyInfo = (Maybe T.Text)
type AttrLabel SimpleActionNamePropertyInfo = "name"
type AttrOrigin SimpleActionNamePropertyInfo = SimpleAction
attrGet = getSimpleActionName
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructSimpleActionName
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAction.name"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAction.html#g:attr:name"
})
#endif
getSimpleActionParameterType :: (MonadIO m, IsSimpleAction o) => o -> m (Maybe GLib.VariantType.VariantType)
getSimpleActionParameterType :: forall (m :: * -> *) o.
(MonadIO m, IsSimpleAction o) =>
o -> m (Maybe VariantType)
getSimpleActionParameterType 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
constructSimpleActionParameterType :: (IsSimpleAction o, MIO.MonadIO m) => GLib.VariantType.VariantType -> m (GValueConstruct o)
constructSimpleActionParameterType :: forall o (m :: * -> *).
(IsSimpleAction o, MonadIO m) =>
VariantType -> m (GValueConstruct o)
constructSimpleActionParameterType VariantType
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe VariantType -> IO (GValueConstruct o)
forall a o. GBoxed a => String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBoxed String
"parameter-type" (VariantType -> Maybe VariantType
forall a. a -> Maybe a
P.Just VariantType
val)
#if defined(ENABLE_OVERLOADING)
data SimpleActionParameterTypePropertyInfo
instance AttrInfo SimpleActionParameterTypePropertyInfo where
type AttrAllowedOps SimpleActionParameterTypePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint SimpleActionParameterTypePropertyInfo = IsSimpleAction
type AttrSetTypeConstraint SimpleActionParameterTypePropertyInfo = (~) GLib.VariantType.VariantType
type AttrTransferTypeConstraint SimpleActionParameterTypePropertyInfo = (~) GLib.VariantType.VariantType
type AttrTransferType SimpleActionParameterTypePropertyInfo = GLib.VariantType.VariantType
type AttrGetType SimpleActionParameterTypePropertyInfo = (Maybe GLib.VariantType.VariantType)
type AttrLabel SimpleActionParameterTypePropertyInfo = "parameter-type"
type AttrOrigin SimpleActionParameterTypePropertyInfo = SimpleAction
attrGet = getSimpleActionParameterType
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructSimpleActionParameterType
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAction.parameterType"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAction.html#g:attr:parameterType"
})
#endif
getSimpleActionState :: (MonadIO m, IsSimpleAction o) => o -> m (Maybe GVariant)
getSimpleActionState :: forall (m :: * -> *) o.
(MonadIO m, IsSimpleAction o) =>
o -> m (Maybe GVariant)
getSimpleActionState 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"
setSimpleActionState :: (MonadIO m, IsSimpleAction o) => o -> GVariant -> m ()
setSimpleActionState :: forall (m :: * -> *) o.
(MonadIO m, IsSimpleAction o) =>
o -> GVariant -> m ()
setSimpleActionState o
obj GVariant
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> SimpleActionActivateCallback
forall a. GObject a => a -> String -> SimpleActionActivateCallback
B.Properties.setObjectPropertyVariant o
obj String
"state" (GVariant -> Maybe GVariant
forall a. a -> Maybe a
Just GVariant
val)
constructSimpleActionState :: (IsSimpleAction o, MIO.MonadIO m) => GVariant -> m (GValueConstruct o)
constructSimpleActionState :: forall o (m :: * -> *).
(IsSimpleAction o, MonadIO m) =>
GVariant -> m (GValueConstruct o)
constructSimpleActionState GVariant
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe GVariant -> IO (GValueConstruct o)
forall o. String -> Maybe GVariant -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyVariant String
"state" (GVariant -> Maybe GVariant
forall a. a -> Maybe a
P.Just GVariant
val)
#if defined(ENABLE_OVERLOADING)
data SimpleActionStatePropertyInfo
instance AttrInfo SimpleActionStatePropertyInfo where
type AttrAllowedOps SimpleActionStatePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint SimpleActionStatePropertyInfo = IsSimpleAction
type AttrSetTypeConstraint SimpleActionStatePropertyInfo = (~) GVariant
type AttrTransferTypeConstraint SimpleActionStatePropertyInfo = (~) GVariant
type AttrTransferType SimpleActionStatePropertyInfo = GVariant
type AttrGetType SimpleActionStatePropertyInfo = (Maybe GVariant)
type AttrLabel SimpleActionStatePropertyInfo = "state"
type AttrOrigin SimpleActionStatePropertyInfo = SimpleAction
attrGet = getSimpleActionState
attrSet = setSimpleActionState
attrTransfer _ v = do
return v
attrConstruct = constructSimpleActionState
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAction.state"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAction.html#g:attr:state"
})
#endif
getSimpleActionStateType :: (MonadIO m, IsSimpleAction o) => o -> m (Maybe GLib.VariantType.VariantType)
getSimpleActionStateType :: forall (m :: * -> *) o.
(MonadIO m, IsSimpleAction o) =>
o -> m (Maybe VariantType)
getSimpleActionStateType 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 SimpleActionStateTypePropertyInfo
instance AttrInfo SimpleActionStateTypePropertyInfo where
type AttrAllowedOps SimpleActionStateTypePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint SimpleActionStateTypePropertyInfo = IsSimpleAction
type AttrSetTypeConstraint SimpleActionStateTypePropertyInfo = (~) ()
type AttrTransferTypeConstraint SimpleActionStateTypePropertyInfo = (~) ()
type AttrTransferType SimpleActionStateTypePropertyInfo = ()
type AttrGetType SimpleActionStateTypePropertyInfo = (Maybe GLib.VariantType.VariantType)
type AttrLabel SimpleActionStateTypePropertyInfo = "state-type"
type AttrOrigin SimpleActionStateTypePropertyInfo = SimpleAction
attrGet = getSimpleActionStateType
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAction.stateType"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAction.html#g:attr:stateType"
})
#endif
#if defined(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, DK.Type)])
#endif
#if defined(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 defined(ENABLE_OVERLOADING)
type instance O.SignalList SimpleAction = SimpleActionSignalList
type SimpleActionSignalList = ('[ '("activate", SimpleActionActivateSignalInfo), '("changeState", SimpleActionChangeStateSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> Maybe VariantType -> m SimpleAction
simpleActionNew Text
name Maybe VariantType
parameterType = IO SimpleAction -> m SimpleAction
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SimpleAction -> m SimpleAction)
-> IO SimpleAction -> m SimpleAction
forall a b. (a -> b) -> a -> b
$ do
name' <- Text -> IO CString
textToCString Text
name
maybeParameterType <- case parameterType of
Maybe VariantType
Nothing -> Ptr VariantType -> IO (Ptr VariantType)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr VariantType
forall a. Ptr a
FP.nullPtr
Just VariantType
jParameterType -> do
jParameterType' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
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 defined(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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> Maybe VariantType -> GVariant -> m SimpleAction
simpleActionNewStateful Text
name Maybe VariantType
parameterType GVariant
state = IO SimpleAction -> m SimpleAction
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SimpleAction -> m SimpleAction)
-> IO SimpleAction -> m SimpleAction
forall a b. (a -> b) -> a -> b
$ do
name' <- Text -> IO CString
textToCString Text
name
maybeParameterType <- case parameterType of
Maybe VariantType
Nothing -> Ptr VariantType -> IO (Ptr VariantType)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr VariantType
forall a. Ptr a
FP.nullPtr
Just VariantType
jParameterType -> do
jParameterType' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
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 defined(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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSimpleAction a) =>
a -> Bool -> m ()
simpleActionSetEnabled a
simple Bool
enabled = 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
simple' <- a -> IO (Ptr SimpleAction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
simple
let enabled' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.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
P.fromEnum) Bool
enabled
g_simple_action_set_enabled simple' enabled'
touchManagedPtr simple
return ()
#if defined(ENABLE_OVERLOADING)
data SimpleActionSetEnabledMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSimpleAction a) => O.OverloadedMethod SimpleActionSetEnabledMethodInfo a signature where
overloadedMethod = simpleActionSetEnabled
instance O.OverloadedMethodInfo SimpleActionSetEnabledMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAction.simpleActionSetEnabled",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAction.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSimpleAction a) =>
a -> GVariant -> m ()
simpleActionSetState a
simple 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
simple' <- a -> IO (Ptr SimpleAction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
simple
value' <- unsafeManagedPtrGetPtr value
g_simple_action_set_state simple' value'
touchManagedPtr simple
touchManagedPtr value
return ()
#if defined(ENABLE_OVERLOADING)
data SimpleActionSetStateMethodInfo
instance (signature ~ (GVariant -> m ()), MonadIO m, IsSimpleAction a) => O.OverloadedMethod SimpleActionSetStateMethodInfo a signature where
overloadedMethod = simpleActionSetState
instance O.OverloadedMethodInfo SimpleActionSetStateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAction.simpleActionSetState",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAction.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSimpleAction a) =>
a -> Maybe GVariant -> m ()
simpleActionSetStateHint a
simple Maybe GVariant
stateHint = 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
simple' <- a -> IO (Ptr SimpleAction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
simple
maybeStateHint <- case stateHint 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
jStateHint -> do
jStateHint' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jStateHint
return jStateHint'
g_simple_action_set_state_hint simple' maybeStateHint
touchManagedPtr simple
whenJust stateHint touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data SimpleActionSetStateHintMethodInfo
instance (signature ~ (Maybe (GVariant) -> m ()), MonadIO m, IsSimpleAction a) => O.OverloadedMethod SimpleActionSetStateHintMethodInfo a signature where
overloadedMethod = simpleActionSetStateHint
instance O.OverloadedMethodInfo SimpleActionSetStateHintMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleAction.simpleActionSetStateHint",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SimpleAction.html#v:simpleActionSetStateHint"
})
#endif