{-# LANGUAGE 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 ,
noAccelMap ,
#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
C_AccelMapChangedCallback ,
afterAccelMapChanged ,
genClosure_AccelMapChanged ,
mk_AccelMapChangedCallback ,
noAccelMapChangedCallback ,
onAccelMapChanged ,
wrap_AccelMapChangedCallback ,
) 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.GClosure as B.GClosure
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.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
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 GHC.OverloadedLabels as OL
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 (ManagedPtr AccelMap)
deriving (AccelMap -> AccelMap -> Bool
(AccelMap -> AccelMap -> Bool)
-> (AccelMap -> AccelMap -> Bool) -> Eq AccelMap
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccelMap -> AccelMap -> Bool
$c/= :: AccelMap -> AccelMap -> Bool
== :: AccelMap -> AccelMap -> Bool
$c== :: AccelMap -> AccelMap -> Bool
Eq)
foreign import ccall "gtk_accel_map_get_type"
c_gtk_accel_map_get_type :: IO GType
instance GObject AccelMap where
gobjectType :: IO GType
gobjectType = IO GType
c_gtk_accel_map_get_type
instance B.GValue.IsGValue AccelMap where
toGValue :: AccelMap -> IO GValue
toGValue o :: AccelMap
o = do
GType
gtype <- IO GType
c_gtk_accel_map_get_type
AccelMap -> (Ptr AccelMap -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr AccelMap
o (GType
-> (GValue -> Ptr AccelMap -> IO ()) -> Ptr AccelMap -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr AccelMap -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO AccelMap
fromGValue gv :: GValue
gv = do
Ptr AccelMap
ptr <- GValue -> IO (Ptr AccelMap)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr AccelMap)
(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
class (GObject o, O.IsDescendantOf AccelMap o) => IsAccelMap o
instance (GObject o, O.IsDescendantOf AccelMap o) => IsAccelMap o
instance O.HasParentTypes AccelMap
type instance O.ParentTypes AccelMap = '[GObject.Object.Object]
toAccelMap :: (MonadIO m, IsAccelMap o) => o -> m AccelMap
toAccelMap :: o -> m AccelMap
toAccelMap = IO AccelMap -> m AccelMap
forall (m :: * -> *) a. MonadIO m => IO a -> m a
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, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr AccelMap -> AccelMap
AccelMap
noAccelMap :: Maybe AccelMap
noAccelMap :: Maybe AccelMap
noAccelMap = Maybe AccelMap
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveAccelMapMethod (t :: Symbol) (o :: *) :: * 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.MethodInfo 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
#endif
type AccelMapChangedCallback =
T.Text
-> Word32
-> [Gdk.Flags.ModifierType]
-> IO ()
noAccelMapChangedCallback :: Maybe AccelMapChangedCallback
noAccelMapChangedCallback :: Maybe AccelMapChangedCallback
noAccelMapChangedCallback = Maybe AccelMapChangedCallback
forall a. Maybe a
Nothing
type C_AccelMapChangedCallback =
Ptr () ->
CString ->
Word32 ->
CUInt ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_AccelMapChangedCallback :: C_AccelMapChangedCallback -> IO (FunPtr C_AccelMapChangedCallback)
genClosure_AccelMapChanged :: MonadIO m => AccelMapChangedCallback -> m (GClosure C_AccelMapChangedCallback)
genClosure_AccelMapChanged :: AccelMapChangedCallback -> m (GClosure C_AccelMapChangedCallback)
genClosure_AccelMapChanged cb :: AccelMapChangedCallback
cb = IO (GClosure C_AccelMapChangedCallback)
-> m (GClosure C_AccelMapChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_AccelMapChangedCallback)
-> m (GClosure C_AccelMapChangedCallback))
-> IO (GClosure C_AccelMapChangedCallback)
-> m (GClosure C_AccelMapChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_AccelMapChangedCallback
cb' = AccelMapChangedCallback -> C_AccelMapChangedCallback
wrap_AccelMapChangedCallback AccelMapChangedCallback
cb
C_AccelMapChangedCallback -> IO (FunPtr C_AccelMapChangedCallback)
mk_AccelMapChangedCallback C_AccelMapChangedCallback
cb' IO (FunPtr C_AccelMapChangedCallback)
-> (FunPtr C_AccelMapChangedCallback
-> IO (GClosure C_AccelMapChangedCallback))
-> IO (GClosure C_AccelMapChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_AccelMapChangedCallback
-> IO (GClosure C_AccelMapChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_AccelMapChangedCallback ::
AccelMapChangedCallback ->
C_AccelMapChangedCallback
wrap_AccelMapChangedCallback :: AccelMapChangedCallback -> C_AccelMapChangedCallback
wrap_AccelMapChangedCallback _cb :: AccelMapChangedCallback
_cb _ accelPath :: CString
accelPath accelKey :: Word32
accelKey accelMods :: CUInt
accelMods _ = 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
AccelMapChangedCallback
_cb Text
accelPath' Word32
accelKey [ModifierType]
accelMods'
onAccelMapChanged :: (IsAccelMap a, MonadIO m) => a -> P.Maybe T.Text -> AccelMapChangedCallback -> m SignalHandlerId
onAccelMapChanged :: a -> Maybe Text -> AccelMapChangedCallback -> m SignalHandlerId
onAccelMapChanged obj :: a
obj detail :: Maybe Text
detail cb :: AccelMapChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
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 cb' :: C_AccelMapChangedCallback
cb' = AccelMapChangedCallback -> C_AccelMapChangedCallback
wrap_AccelMapChangedCallback AccelMapChangedCallback
cb
FunPtr C_AccelMapChangedCallback
cb'' <- C_AccelMapChangedCallback -> IO (FunPtr C_AccelMapChangedCallback)
mk_AccelMapChangedCallback C_AccelMapChangedCallback
cb'
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 "changed" FunPtr C_AccelMapChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
detail
afterAccelMapChanged :: (IsAccelMap a, MonadIO m) => a -> P.Maybe T.Text -> AccelMapChangedCallback -> m SignalHandlerId
afterAccelMapChanged :: a -> Maybe Text -> AccelMapChangedCallback -> m SignalHandlerId
afterAccelMapChanged obj :: a
obj detail :: Maybe Text
detail cb :: AccelMapChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
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 cb' :: C_AccelMapChangedCallback
cb' = AccelMapChangedCallback -> C_AccelMapChangedCallback
wrap_AccelMapChangedCallback AccelMapChangedCallback
cb
FunPtr C_AccelMapChangedCallback
cb'' <- C_AccelMapChangedCallback -> IO (FunPtr C_AccelMapChangedCallback)
mk_AccelMapChangedCallback C_AccelMapChangedCallback
cb'
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 "changed" FunPtr C_AccelMapChangedCallback
cb'' 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
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList AccelMap
type instance O.AttributeList AccelMap = AccelMapAttributeList
type AccelMapAttributeList = ('[ ] :: [(Symbol, *)])
#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, *)])
#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 :: Text -> Word32 -> [ModifierType] -> m ()
accelMapAddEntry accelPath :: Text
accelPath accelKey :: Word32
accelKey accelMods :: [ModifierType]
accelMods = IO () -> m ()
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 (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 :: Text -> m ()
accelMapAddFilter filterPattern :: Text
filterPattern = IO () -> m ()
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 (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 :: Text -> Word32 -> [ModifierType] -> Bool -> m Bool
accelMapChangeEntry accelPath :: Text
accelPath accelKey :: Word32
accelKey accelMods :: [ModifierType]
accelMods replace :: Bool
replace = IO Bool -> m Bool
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
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
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
/= 0) CInt
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
accelPath'
Bool -> IO Bool
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 :: Ptr () -> AccelMapForeach -> m ()
accelMapForeach data_ :: Ptr ()
data_ foreachFunc :: AccelMapForeach
foreachFunc = IO () -> m ()
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 (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 :: Ptr () -> AccelMapForeach -> m ()
accelMapForeachUnfiltered data_ :: Ptr ()
data_ foreachFunc :: AccelMapForeach
foreachFunc = IO () -> m ()
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 (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 :: m AccelMap
accelMapGet = IO AccelMap -> m AccelMap
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 "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 (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 :: [Char] -> m ()
accelMapLoad fileName :: [Char]
fileName = IO () -> m ()
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 (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 :: Int32 -> m ()
accelMapLoadFd fd :: Int32
fd = IO () -> m ()
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 (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 :: Scanner -> m ()
accelMapLoadScanner scanner :: Scanner
scanner = IO () -> m ()
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 (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 :: Text -> m ()
accelMapLockPath accelPath :: Text
accelPath = IO () -> m ()
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 (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 :: Text -> m (Bool, AccelKey)
accelMapLookupEntry accelPath :: Text
accelPath = IO (Bool, AccelKey) -> m (Bool, AccelKey)
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)
callocBytes 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
/= 0) CInt
result
AccelKey
key' <- ((ManagedPtr AccelKey -> AccelKey) -> Ptr AccelKey -> IO AccelKey
forall a.
(HasCallStack, WrappedPtr 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 (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 :: [Char] -> m ()
accelMapSave fileName :: [Char]
fileName = IO () -> m ()
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 (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 :: Int32 -> m ()
accelMapSaveFd fd :: Int32
fd = IO () -> m ()
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 (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 :: Text -> m ()
accelMapUnlockPath accelPath :: Text
accelPath = IO () -> m ()
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 (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif