{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.AccelMap
(
AccelMap(..) ,
IsAccelMap ,
toAccelMap ,
#if defined(ENABLE_OVERLOADING)
ResolveAccelMapMethod ,
#endif
accelMapAddEntry ,
accelMapAddFilter ,
accelMapChangeEntry ,
accelMapForeach ,
accelMapForeachUnfiltered ,
accelMapGet ,
accelMapLoad ,
accelMapLoadFd ,
accelMapLoadScanner ,
accelMapLockPath ,
accelMapLookupEntry ,
accelMapSave ,
accelMapSaveFd ,
accelMapUnlockPath ,
AccelMapChangedCallback ,
#if defined(ENABLE_OVERLOADING)
AccelMapChangedSignalInfo ,
#endif
afterAccelMapChanged ,
onAccelMapChanged ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified GI.GLib.Structs.Scanner as GLib.Scanner
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Flags as Gdk.Flags
import qualified GI.Gtk.Callbacks as Gtk.Callbacks
import {-# SOURCE #-} qualified GI.Gtk.Structs.AccelKey as Gtk.AccelKey
newtype AccelMap = AccelMap (SP.ManagedPtr AccelMap)
deriving (AccelMap -> AccelMap -> Bool
(AccelMap -> AccelMap -> Bool)
-> (AccelMap -> AccelMap -> Bool) -> Eq AccelMap
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AccelMap -> AccelMap -> Bool
== :: AccelMap -> AccelMap -> Bool
$c/= :: AccelMap -> AccelMap -> Bool
/= :: AccelMap -> AccelMap -> Bool
Eq)
instance SP.ManagedPtrNewtype AccelMap where
toManagedPtr :: AccelMap -> ManagedPtr AccelMap
toManagedPtr (AccelMap ManagedPtr AccelMap
p) = ManagedPtr AccelMap
p
foreign import ccall "gtk_accel_map_get_type"
c_gtk_accel_map_get_type :: IO B.Types.GType
instance B.Types.TypedObject AccelMap where
glibType :: IO GType
glibType = IO GType
c_gtk_accel_map_get_type
instance B.Types.GObject AccelMap
class (SP.GObject o, O.IsDescendantOf AccelMap o) => IsAccelMap o
instance (SP.GObject o, O.IsDescendantOf AccelMap o) => IsAccelMap o
instance O.HasParentTypes AccelMap
type instance O.ParentTypes AccelMap = '[GObject.Object.Object]
toAccelMap :: (MIO.MonadIO m, IsAccelMap o) => o -> m AccelMap
toAccelMap :: forall (m :: * -> *) o.
(MonadIO m, IsAccelMap o) =>
o -> m AccelMap
toAccelMap = IO AccelMap -> m AccelMap
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO AccelMap -> m AccelMap)
-> (o -> IO AccelMap) -> o -> m AccelMap
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr AccelMap -> AccelMap) -> o -> IO AccelMap
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr AccelMap -> AccelMap
AccelMap
instance B.GValue.IsGValue (Maybe AccelMap) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_accel_map_get_type
gvalueSet_ :: Ptr GValue -> Maybe AccelMap -> IO ()
gvalueSet_ Ptr GValue
gv Maybe AccelMap
P.Nothing = Ptr GValue -> Ptr AccelMap -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr AccelMap
forall a. Ptr a
FP.nullPtr :: FP.Ptr AccelMap)
gvalueSet_ Ptr GValue
gv (P.Just AccelMap
obj) = AccelMap -> (Ptr AccelMap -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr AccelMap
obj (Ptr GValue -> Ptr AccelMap -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe AccelMap)
gvalueGet_ Ptr GValue
gv = do
Ptr AccelMap
ptr <- Ptr GValue -> IO (Ptr AccelMap)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr AccelMap)
if Ptr AccelMap
ptr Ptr AccelMap -> Ptr AccelMap -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr AccelMap
forall a. Ptr a
FP.nullPtr
then AccelMap -> Maybe AccelMap
forall a. a -> Maybe a
P.Just (AccelMap -> Maybe AccelMap) -> IO AccelMap -> IO (Maybe AccelMap)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr AccelMap -> AccelMap) -> Ptr AccelMap -> IO AccelMap
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr AccelMap -> AccelMap
AccelMap Ptr AccelMap
ptr
else Maybe AccelMap -> IO (Maybe AccelMap)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe AccelMap
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveAccelMapMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveAccelMapMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveAccelMapMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveAccelMapMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveAccelMapMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveAccelMapMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveAccelMapMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveAccelMapMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveAccelMapMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveAccelMapMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveAccelMapMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveAccelMapMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveAccelMapMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveAccelMapMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveAccelMapMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveAccelMapMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveAccelMapMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveAccelMapMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveAccelMapMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveAccelMapMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveAccelMapMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveAccelMapMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveAccelMapMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveAccelMapMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAccelMapMethod t AccelMap, O.OverloadedMethod info AccelMap p) => OL.IsLabel t (AccelMap -> 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 ~ ResolveAccelMapMethod t AccelMap, O.OverloadedMethod info AccelMap p, R.HasField t AccelMap p) => R.HasField t AccelMap p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveAccelMapMethod t AccelMap, O.OverloadedMethodInfo info AccelMap) => OL.IsLabel t (O.MethodProxy info AccelMap) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type AccelMapChangedCallback =
T.Text
-> Word32
-> [Gdk.Flags.ModifierType]
-> IO ()
type C_AccelMapChangedCallback =
Ptr AccelMap ->
CString ->
Word32 ->
CUInt ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_AccelMapChangedCallback :: C_AccelMapChangedCallback -> IO (FunPtr C_AccelMapChangedCallback)
wrap_AccelMapChangedCallback ::
GObject a => (a -> AccelMapChangedCallback) ->
C_AccelMapChangedCallback
wrap_AccelMapChangedCallback :: forall a.
GObject a =>
(a -> AccelMapChangedCallback) -> C_AccelMapChangedCallback
wrap_AccelMapChangedCallback a -> AccelMapChangedCallback
gi'cb Ptr AccelMap
gi'selfPtr CString
accelPath Word32
accelKey CUInt
accelMods Ptr ()
_ = do
Text
accelPath' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
accelPath
let accelMods' :: [ModifierType]
accelMods' = CUInt -> [ModifierType]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
accelMods
Ptr AccelMap -> (AccelMap -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr AccelMap
gi'selfPtr ((AccelMap -> IO ()) -> IO ()) -> (AccelMap -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \AccelMap
gi'self -> a -> AccelMapChangedCallback
gi'cb (AccelMap -> a
forall a b. Coercible a b => a -> b
Coerce.coerce AccelMap
gi'self) Text
accelPath' Word32
accelKey [ModifierType]
accelMods'
onAccelMapChanged :: (IsAccelMap a, MonadIO m) => a -> P.Maybe T.Text -> ((?self :: a) => AccelMapChangedCallback) -> m SignalHandlerId
onAccelMapChanged :: forall a (m :: * -> *).
(IsAccelMap a, MonadIO m) =>
a
-> Maybe Text
-> ((?self::a) => AccelMapChangedCallback)
-> m SignalHandlerId
onAccelMapChanged a
obj Maybe Text
detail (?self::a) => AccelMapChangedCallback
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 -> AccelMapChangedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => AccelMapChangedCallback
AccelMapChangedCallback
cb
let wrapped' :: C_AccelMapChangedCallback
wrapped' = (a -> AccelMapChangedCallback) -> C_AccelMapChangedCallback
forall a.
GObject a =>
(a -> AccelMapChangedCallback) -> C_AccelMapChangedCallback
wrap_AccelMapChangedCallback a -> AccelMapChangedCallback
wrapped
FunPtr C_AccelMapChangedCallback
wrapped'' <- C_AccelMapChangedCallback -> IO (FunPtr C_AccelMapChangedCallback)
mk_AccelMapChangedCallback C_AccelMapChangedCallback
wrapped'
a
-> Text
-> FunPtr C_AccelMapChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"changed" FunPtr C_AccelMapChangedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
detail
afterAccelMapChanged :: (IsAccelMap a, MonadIO m) => a -> P.Maybe T.Text -> ((?self :: a) => AccelMapChangedCallback) -> m SignalHandlerId
afterAccelMapChanged :: forall a (m :: * -> *).
(IsAccelMap a, MonadIO m) =>
a
-> Maybe Text
-> ((?self::a) => AccelMapChangedCallback)
-> m SignalHandlerId
afterAccelMapChanged a
obj Maybe Text
detail (?self::a) => AccelMapChangedCallback
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 -> AccelMapChangedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => AccelMapChangedCallback
AccelMapChangedCallback
cb
let wrapped' :: C_AccelMapChangedCallback
wrapped' = (a -> AccelMapChangedCallback) -> C_AccelMapChangedCallback
forall a.
GObject a =>
(a -> AccelMapChangedCallback) -> C_AccelMapChangedCallback
wrap_AccelMapChangedCallback a -> AccelMapChangedCallback
wrapped
FunPtr C_AccelMapChangedCallback
wrapped'' <- C_AccelMapChangedCallback -> IO (FunPtr C_AccelMapChangedCallback)
mk_AccelMapChangedCallback C_AccelMapChangedCallback
wrapped'
a
-> Text
-> FunPtr C_AccelMapChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"changed" FunPtr C_AccelMapChangedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
detail
#if defined(ENABLE_OVERLOADING)
data AccelMapChangedSignalInfo
instance SignalInfo AccelMapChangedSignalInfo where
type HaskellCallbackType AccelMapChangedSignalInfo = AccelMapChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_AccelMapChangedCallback cb
cb'' <- mk_AccelMapChangedCallback cb'
connectSignalFunPtr obj "changed" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.AccelMap::changed"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-AccelMap.html#g:signal:changed"})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList AccelMap
type instance O.AttributeList AccelMap = AccelMapAttributeList
type AccelMapAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList AccelMap = AccelMapSignalList
type AccelMapSignalList = ('[ '("changed", AccelMapChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "gtk_accel_map_add_entry" gtk_accel_map_add_entry ::
CString ->
Word32 ->
CUInt ->
IO ()
accelMapAddEntry ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Word32
-> [Gdk.Flags.ModifierType]
-> m ()
accelMapAddEntry :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> Word32 -> [ModifierType] -> m ()
accelMapAddEntry Text
accelPath Word32
accelKey [ModifierType]
accelMods = 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
CString
accelPath' <- Text -> IO CString
textToCString Text
accelPath
let accelMods' :: CUInt
accelMods' = [ModifierType] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ModifierType]
accelMods
CString -> Word32 -> CUInt -> IO ()
gtk_accel_map_add_entry CString
accelPath' Word32
accelKey CUInt
accelMods'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
accelPath'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_accel_map_add_filter" gtk_accel_map_add_filter ::
CString ->
IO ()
accelMapAddFilter ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m ()
accelMapAddFilter :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m ()
accelMapAddFilter Text
filterPattern = 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
CString
filterPattern' <- Text -> IO CString
textToCString Text
filterPattern
CString -> IO ()
gtk_accel_map_add_filter CString
filterPattern'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filterPattern'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_accel_map_change_entry" gtk_accel_map_change_entry ::
CString ->
Word32 ->
CUInt ->
CInt ->
IO CInt
accelMapChangeEntry ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Word32
-> [Gdk.Flags.ModifierType]
-> Bool
-> m Bool
accelMapChangeEntry :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> Word32 -> [ModifierType] -> Bool -> m Bool
accelMapChangeEntry Text
accelPath Word32
accelKey [ModifierType]
accelMods Bool
replace = 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
CString
accelPath' <- Text -> IO CString
textToCString Text
accelPath
let accelMods' :: CUInt
accelMods' = [ModifierType] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ModifierType]
accelMods
let replace' :: CInt
replace' = (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
replace
CInt
result <- CString -> Word32 -> CUInt -> CInt -> IO CInt
gtk_accel_map_change_entry CString
accelPath' Word32
accelKey CUInt
accelMods' CInt
replace'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
accelPath'
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_accel_map_foreach" gtk_accel_map_foreach ::
Ptr () ->
FunPtr Gtk.Callbacks.C_AccelMapForeach ->
IO ()
accelMapForeach ::
(B.CallStack.HasCallStack, MonadIO m) =>
Ptr ()
-> Gtk.Callbacks.AccelMapForeach
-> m ()
accelMapForeach :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Ptr () -> AccelMapForeach -> m ()
accelMapForeach Ptr ()
data_ AccelMapForeach
foreachFunc = 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
FunPtr C_AccelMapForeach
foreachFunc' <- C_AccelMapForeach -> IO (FunPtr C_AccelMapForeach)
Gtk.Callbacks.mk_AccelMapForeach (Maybe (Ptr (FunPtr C_AccelMapForeach))
-> AccelMapForeach -> C_AccelMapForeach
Gtk.Callbacks.wrap_AccelMapForeach Maybe (Ptr (FunPtr C_AccelMapForeach))
forall a. Maybe a
Nothing AccelMapForeach
foreachFunc)
Ptr () -> FunPtr C_AccelMapForeach -> IO ()
gtk_accel_map_foreach Ptr ()
data_ FunPtr C_AccelMapForeach
foreachFunc'
Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_AccelMapForeach -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_AccelMapForeach
foreachFunc'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_accel_map_foreach_unfiltered" gtk_accel_map_foreach_unfiltered ::
Ptr () ->
FunPtr Gtk.Callbacks.C_AccelMapForeach ->
IO ()
accelMapForeachUnfiltered ::
(B.CallStack.HasCallStack, MonadIO m) =>
Ptr ()
-> Gtk.Callbacks.AccelMapForeach
-> m ()
accelMapForeachUnfiltered :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Ptr () -> AccelMapForeach -> m ()
accelMapForeachUnfiltered Ptr ()
data_ AccelMapForeach
foreachFunc = 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
FunPtr C_AccelMapForeach
foreachFunc' <- C_AccelMapForeach -> IO (FunPtr C_AccelMapForeach)
Gtk.Callbacks.mk_AccelMapForeach (Maybe (Ptr (FunPtr C_AccelMapForeach))
-> AccelMapForeach -> C_AccelMapForeach
Gtk.Callbacks.wrap_AccelMapForeach Maybe (Ptr (FunPtr C_AccelMapForeach))
forall a. Maybe a
Nothing AccelMapForeach
foreachFunc)
Ptr () -> FunPtr C_AccelMapForeach -> IO ()
gtk_accel_map_foreach_unfiltered Ptr ()
data_ FunPtr C_AccelMapForeach
foreachFunc'
Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_AccelMapForeach -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_AccelMapForeach
foreachFunc'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_accel_map_get" gtk_accel_map_get ::
IO (Ptr AccelMap)
accelMapGet ::
(B.CallStack.HasCallStack, MonadIO m) =>
m AccelMap
accelMapGet :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m AccelMap
accelMapGet = IO AccelMap -> m AccelMap
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AccelMap -> m AccelMap) -> IO AccelMap -> m AccelMap
forall a b. (a -> b) -> a -> b
$ do
Ptr AccelMap
result <- IO (Ptr AccelMap)
gtk_accel_map_get
Text -> Ptr AccelMap -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"accelMapGet" Ptr AccelMap
result
AccelMap
result' <- ((ManagedPtr AccelMap -> AccelMap) -> Ptr AccelMap -> IO AccelMap
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr AccelMap -> AccelMap
AccelMap) Ptr AccelMap
result
AccelMap -> IO AccelMap
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return AccelMap
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_accel_map_load" gtk_accel_map_load ::
CString ->
IO ()
accelMapLoad ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Char]
-> m ()
accelMapLoad :: forall (m :: * -> *). (HasCallStack, MonadIO m) => [Char] -> m ()
accelMapLoad [Char]
fileName = 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
CString
fileName' <- [Char] -> IO CString
stringToCString [Char]
fileName
CString -> IO ()
gtk_accel_map_load CString
fileName'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
fileName'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_accel_map_load_fd" gtk_accel_map_load_fd ::
Int32 ->
IO ()
accelMapLoadFd ::
(B.CallStack.HasCallStack, MonadIO m) =>
Int32
-> m ()
accelMapLoadFd :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Int32 -> m ()
accelMapLoadFd Int32
fd = 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
Int32 -> IO ()
gtk_accel_map_load_fd Int32
fd
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_accel_map_load_scanner" gtk_accel_map_load_scanner ::
Ptr GLib.Scanner.Scanner ->
IO ()
accelMapLoadScanner ::
(B.CallStack.HasCallStack, MonadIO m) =>
GLib.Scanner.Scanner
-> m ()
accelMapLoadScanner :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Scanner -> m ()
accelMapLoadScanner Scanner
scanner = 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
Ptr Scanner
scanner' <- Scanner -> IO (Ptr Scanner)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Scanner
scanner
Ptr Scanner -> IO ()
gtk_accel_map_load_scanner Ptr Scanner
scanner'
Scanner -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Scanner
scanner
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_accel_map_lock_path" gtk_accel_map_lock_path ::
CString ->
IO ()
accelMapLockPath ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m ()
accelMapLockPath :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m ()
accelMapLockPath Text
accelPath = 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
CString
accelPath' <- Text -> IO CString
textToCString Text
accelPath
CString -> IO ()
gtk_accel_map_lock_path CString
accelPath'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
accelPath'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_accel_map_lookup_entry" gtk_accel_map_lookup_entry ::
CString ->
Ptr Gtk.AccelKey.AccelKey ->
IO CInt
accelMapLookupEntry ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m ((Bool, Gtk.AccelKey.AccelKey))
accelMapLookupEntry :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m (Bool, AccelKey)
accelMapLookupEntry Text
accelPath = IO (Bool, AccelKey) -> m (Bool, AccelKey)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, AccelKey) -> m (Bool, AccelKey))
-> IO (Bool, AccelKey) -> m (Bool, AccelKey)
forall a b. (a -> b) -> a -> b
$ do
CString
accelPath' <- Text -> IO CString
textToCString Text
accelPath
Ptr AccelKey
key <- Int -> IO (Ptr AccelKey)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
12 :: IO (Ptr Gtk.AccelKey.AccelKey)
CInt
result <- CString -> Ptr AccelKey -> IO CInt
gtk_accel_map_lookup_entry CString
accelPath' Ptr AccelKey
key
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
AccelKey
key' <- ((ManagedPtr AccelKey -> AccelKey) -> Ptr AccelKey -> IO AccelKey
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr AccelKey -> AccelKey
Gtk.AccelKey.AccelKey) Ptr AccelKey
key
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
accelPath'
(Bool, AccelKey) -> IO (Bool, AccelKey)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', AccelKey
key')
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_accel_map_save" gtk_accel_map_save ::
CString ->
IO ()
accelMapSave ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Char]
-> m ()
accelMapSave :: forall (m :: * -> *). (HasCallStack, MonadIO m) => [Char] -> m ()
accelMapSave [Char]
fileName = 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
CString
fileName' <- [Char] -> IO CString
stringToCString [Char]
fileName
CString -> IO ()
gtk_accel_map_save CString
fileName'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
fileName'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_accel_map_save_fd" gtk_accel_map_save_fd ::
Int32 ->
IO ()
accelMapSaveFd ::
(B.CallStack.HasCallStack, MonadIO m) =>
Int32
-> m ()
accelMapSaveFd :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Int32 -> m ()
accelMapSaveFd Int32
fd = 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
Int32 -> IO ()
gtk_accel_map_save_fd Int32
fd
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_accel_map_unlock_path" gtk_accel_map_unlock_path ::
CString ->
IO ()
accelMapUnlockPath ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m ()
accelMapUnlockPath :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m ()
accelMapUnlockPath Text
accelPath = 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
CString
accelPath' <- Text -> IO CString
textToCString Text
accelPath
CString -> IO ()
gtk_accel_map_unlock_path CString
accelPath'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
accelPath'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif