#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Interfaces.ActionMap
(
ActionMap(..) ,
noActionMap ,
IsActionMap ,
toActionMap ,
#if ENABLE_OVERLOADING
ActionMapAddActionMethodInfo ,
#endif
actionMapAddAction ,
#if ENABLE_OVERLOADING
ActionMapAddActionEntriesMethodInfo ,
#endif
actionMapAddActionEntries ,
#if ENABLE_OVERLOADING
ActionMapLookupActionMethodInfo ,
#endif
actionMapLookupAction ,
#if ENABLE_OVERLOADING
ActionMapRemoveActionMethodInfo ,
#endif
actionMapRemoveAction ,
) 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.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Action as Gio.Action
import {-# SOURCE #-} qualified GI.Gio.Structs.ActionEntry as Gio.ActionEntry
newtype ActionMap = ActionMap (ManagedPtr ActionMap)
noActionMap :: Maybe ActionMap
noActionMap = Nothing
#if ENABLE_OVERLOADING
type instance O.SignalList ActionMap = ActionMapSignalList
type ActionMapSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_action_map_get_type"
c_g_action_map_get_type :: IO GType
instance GObject ActionMap where
gobjectType _ = c_g_action_map_get_type
class GObject o => IsActionMap o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError ActionMap a) =>
IsActionMap a
#endif
instance IsActionMap ActionMap
instance GObject.Object.IsObject ActionMap
toActionMap :: (MonadIO m, IsActionMap o) => o -> m ActionMap
toActionMap = liftIO . unsafeCastTo ActionMap
#if ENABLE_OVERLOADING
instance O.HasAttributeList ActionMap
type instance O.AttributeList ActionMap = ActionMapAttributeList
type ActionMapAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
type family ResolveActionMapMethod (t :: Symbol) (o :: *) :: * where
ResolveActionMapMethod "addAction" o = ActionMapAddActionMethodInfo
ResolveActionMapMethod "addActionEntries" o = ActionMapAddActionEntriesMethodInfo
ResolveActionMapMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveActionMapMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveActionMapMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveActionMapMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveActionMapMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveActionMapMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveActionMapMethod "lookupAction" o = ActionMapLookupActionMethodInfo
ResolveActionMapMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveActionMapMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveActionMapMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveActionMapMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveActionMapMethod "removeAction" o = ActionMapRemoveActionMethodInfo
ResolveActionMapMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveActionMapMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveActionMapMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveActionMapMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveActionMapMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveActionMapMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveActionMapMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveActionMapMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveActionMapMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveActionMapMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveActionMapMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveActionMapMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveActionMapMethod t ActionMap, O.MethodInfo info ActionMap p) => O.IsLabelProxy t (ActionMap -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveActionMapMethod t ActionMap, O.MethodInfo info ActionMap p) => O.IsLabel t (ActionMap -> 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
foreign import ccall "g_action_map_add_action" g_action_map_add_action ::
Ptr ActionMap ->
Ptr Gio.Action.Action ->
IO ()
actionMapAddAction ::
(B.CallStack.HasCallStack, MonadIO m, IsActionMap a, Gio.Action.IsAction b) =>
a
-> b
-> m ()
actionMapAddAction actionMap action = liftIO $ do
actionMap' <- unsafeManagedPtrCastPtr actionMap
action' <- unsafeManagedPtrCastPtr action
g_action_map_add_action actionMap' action'
touchManagedPtr actionMap
touchManagedPtr action
return ()
#if ENABLE_OVERLOADING
data ActionMapAddActionMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsActionMap a, Gio.Action.IsAction b) => O.MethodInfo ActionMapAddActionMethodInfo a signature where
overloadedMethod _ = actionMapAddAction
#endif
foreign import ccall "g_action_map_add_action_entries" g_action_map_add_action_entries ::
Ptr ActionMap ->
Ptr Gio.ActionEntry.ActionEntry ->
Int32 ->
Ptr () ->
IO ()
actionMapAddActionEntries ::
(B.CallStack.HasCallStack, MonadIO m, IsActionMap a) =>
a
-> [Gio.ActionEntry.ActionEntry]
-> Ptr ()
-> m ()
actionMapAddActionEntries actionMap entries userData = liftIO $ do
let nEntries = fromIntegral $ length entries
actionMap' <- unsafeManagedPtrCastPtr actionMap
entries' <- mapM unsafeManagedPtrGetPtr entries
entries'' <- packBlockArray 64 entries'
g_action_map_add_action_entries actionMap' entries'' nEntries userData
touchManagedPtr actionMap
mapM_ touchManagedPtr entries
freeMem entries''
return ()
#if ENABLE_OVERLOADING
data ActionMapAddActionEntriesMethodInfo
instance (signature ~ ([Gio.ActionEntry.ActionEntry] -> Ptr () -> m ()), MonadIO m, IsActionMap a) => O.MethodInfo ActionMapAddActionEntriesMethodInfo a signature where
overloadedMethod _ = actionMapAddActionEntries
#endif
foreign import ccall "g_action_map_lookup_action" g_action_map_lookup_action ::
Ptr ActionMap ->
CString ->
IO (Ptr Gio.Action.Action)
actionMapLookupAction ::
(B.CallStack.HasCallStack, MonadIO m, IsActionMap a) =>
a
-> T.Text
-> m Gio.Action.Action
actionMapLookupAction actionMap actionName = liftIO $ do
actionMap' <- unsafeManagedPtrCastPtr actionMap
actionName' <- textToCString actionName
result <- g_action_map_lookup_action actionMap' actionName'
checkUnexpectedReturnNULL "actionMapLookupAction" result
result' <- (newObject Gio.Action.Action) result
touchManagedPtr actionMap
freeMem actionName'
return result'
#if ENABLE_OVERLOADING
data ActionMapLookupActionMethodInfo
instance (signature ~ (T.Text -> m Gio.Action.Action), MonadIO m, IsActionMap a) => O.MethodInfo ActionMapLookupActionMethodInfo a signature where
overloadedMethod _ = actionMapLookupAction
#endif
foreign import ccall "g_action_map_remove_action" g_action_map_remove_action ::
Ptr ActionMap ->
CString ->
IO ()
actionMapRemoveAction ::
(B.CallStack.HasCallStack, MonadIO m, IsActionMap a) =>
a
-> T.Text
-> m ()
actionMapRemoveAction actionMap actionName = liftIO $ do
actionMap' <- unsafeManagedPtrCastPtr actionMap
actionName' <- textToCString actionName
g_action_map_remove_action actionMap' actionName'
touchManagedPtr actionMap
freeMem actionName'
return ()
#if ENABLE_OVERLOADING
data ActionMapRemoveActionMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsActionMap a) => O.MethodInfo ActionMapRemoveActionMethodInfo a signature where
overloadedMethod _ = actionMapRemoveAction
#endif