    {-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}

    -- | Copyright  : Will Thompson and Iñaki García Etxebarria
    -- License    : LGPL-2.1
    -- Maintainer : Iñaki García Etxebarria
    --
    -- Accelerator maps are used to define runtime configurable accelerators.
    -- Functions for manipulating them are are usually used by higher level
    -- convenience mechanisms like t'GI.Gtk.Objects.UIManager.UIManager' and are thus considered
    -- “low-level”. You’ll want to use them if you’re manually creating menus that
    -- should have user-configurable accelerators.
    --
    -- An accelerator is uniquely defined by:
    -- * accelerator path
    -- * accelerator key
    -- * accelerator modifiers
    --
    --
    -- The accelerator path must consist of
    -- “\<WINDOWTYPE>\/Category1\/Category2\/...\/Action”, where WINDOWTYPE
    -- should be a unique application-specific identifier that corresponds
    -- to the kind of window the accelerator is being used in, e.g.
    -- “Gimp-Image”, “Abiword-Document” or “Gnumeric-Settings”.
    -- The “Category1\/...\/Action” portion is most appropriately chosen by
    -- the action the accelerator triggers, i.e. for accelerators on menu
    -- items, choose the item’s menu path, e.g. “File\/Save As”,
    -- “Image\/View\/Zoom” or “Edit\/Select All”. So a full valid accelerator
    -- path may look like: “\<Gimp-Toolbox>\/File\/Dialogs\/Tool Options...”.
    --
    -- All accelerators are stored inside one global t'GI.Gtk.Objects.AccelMap.AccelMap' that can
    -- be obtained using 'GI.Gtk.Objects.AccelMap.accelMapGet'. See
    -- [Monitoring changes][monitoring-changes] for additional
    -- details.
    --
    -- = Manipulating accelerators
    --
    -- New accelerators can be added using 'GI.Gtk.Objects.AccelMap.accelMapAddEntry'.
    -- To search for specific accelerator, use 'GI.Gtk.Objects.AccelMap.accelMapLookupEntry'.
    -- Modifications of existing accelerators should be done using
    -- 'GI.Gtk.Objects.AccelMap.accelMapChangeEntry'.
    --
    -- In order to avoid having some accelerators changed, they can be
    -- locked using 'GI.Gtk.Objects.AccelMap.accelMapLockPath'. Unlocking is done using
    -- 'GI.Gtk.Objects.AccelMap.accelMapUnlockPath'.
    --
    -- = Saving and loading accelerator maps
    --
    -- Accelerator maps can be saved to and loaded from some external
    -- resource. For simple saving and loading from file,
    -- 'GI.Gtk.Objects.AccelMap.accelMapSave' and 'GI.Gtk.Objects.AccelMap.accelMapLoad' are provided.
    -- Saving and loading can also be done by providing file descriptor
    -- to 'GI.Gtk.Objects.AccelMap.accelMapSaveFd' and 'GI.Gtk.Objects.AccelMap.accelMapLoadFd'.
    --
    -- = Monitoring changes
    --
    -- t'GI.Gtk.Objects.AccelMap.AccelMap' object is only useful for monitoring changes of
    -- accelerators. By connecting to [AccelMap::changed]("GI.Gtk.Objects.AccelMap#g:signal:changed") signal, one
    -- can monitor changes of all accelerators. It is also possible to
    -- monitor only single accelerator path by using it as a detail of
    -- the [AccelMap::changed]("GI.Gtk.Objects.AccelMap#g:signal:changed") signal.

    #if !defined(__HADDOCK_VERSION__)
    #define ENABLE_OVERLOADING
    #endif

    module GI.Gtk.Objects.AccelMap
        (

    -- * Exported types
        AccelMap(..)                            ,
        IsAccelMap                              ,
        toAccelMap                              ,

     -- * Methods
    -- |
    --
    --  === __Click to display all available methods, including inherited ones__
    -- ==== Methods
    -- [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
    --
    -- ==== Getters
    -- [getData]("GI.GObject.Objects.Object#g:method:getData"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata").
    --
    -- ==== Setters
    -- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

    #if defined(ENABLE_OVERLOADING)
        ResolveAccelMapMethod                   ,
    #endif

    -- ** addEntry #method:addEntry#

        accelMapAddEntry                        ,

    -- ** addFilter #method:addFilter#

        accelMapAddFilter                       ,

    -- ** changeEntry #method:changeEntry#

        accelMapChangeEntry                     ,

    -- ** foreach #method:foreach#

        accelMapForeach                         ,

    -- ** foreachUnfiltered #method:foreachUnfiltered#

        accelMapForeachUnfiltered               ,

    -- ** get #method:get#

        accelMapGet                             ,

    -- ** load #method:load#

        accelMapLoad                            ,

    -- ** loadFd #method:loadFd#

        accelMapLoadFd                          ,

    -- ** loadScanner #method:loadScanner#

        accelMapLoadScanner                     ,

    -- ** lockPath #method:lockPath#

        accelMapLockPath                        ,

    -- ** lookupEntry #method:lookupEntry#

        accelMapLookupEntry                     ,

    -- ** save #method:save#

        accelMapSave                            ,

    -- ** saveFd #method:saveFd#

        accelMapSaveFd                          ,

    -- ** unlockPath #method:unlockPath#

        accelMapUnlockPath                      ,

     -- * Signals

    -- ** changed #signal:changed#

        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 Data.Word as DW
    import qualified Data.Int as DI
    import qualified System.Posix.Types as SPT
    import qualified Foreign.C.Types as FCT

    -- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392
    #if MIN_VERSION_base(4,18,0)
    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

    #else
    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

    #endif

    -- | Memory-managed wrapper type.
    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

    -- | Type class for types which can be safely cast to t'AccelMap', for instance with `toAccelMap`.
    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]

    -- | Cast to t'AccelMap', for types for which this is known to be safe. For general casts, use 'Data.GI.Base.ManagedPtr.castTo'.
    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

    -- | Convert t'AccelMap' to and from t'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
    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 <- 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 /= FP.nullPtr
            then P.Just <$> B.ManagedPtr.newObject AccelMap ptr
            else return 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

    -- signal AccelMap::changed
    -- | Notifies of a change in the global accelerator map.
    -- The path is also used as the detail for the signal,
    -- so it is possible to connect to
    -- changed::@accel_path@.
    --
    -- /Since: 2.4/
    type AccelMapChangedCallback =
        T.Text
        -- ^ /@accelPath@/: the path of the accelerator that changed
        -> Word32
        -- ^ /@accelKey@/: the key value for the new accelerator
        -> [Gdk.Flags.ModifierType]
        -- ^ /@accelMods@/: the modifier mask for the new accelerator
        -> IO ()

    type C_AccelMapChangedCallback =
        Ptr AccelMap ->                         -- object
        CString ->
        Word32 ->
        CUInt ->
        Ptr () ->                               -- user_data
        IO ()

    -- | Generate a function pointer callable from C code, from a `C_AccelMapChangedCallback`.
    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
        accelPath' <- HasCallStack => CString -> IO Text
    CString -> IO Text
    cstringToText CString
    accelPath
        let accelMods' = CUInt -> [ModifierType]
    forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
    wordToGFlags CUInt
    accelMods
        B.ManagedPtr.withNewObject gi'selfPtr $ \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'

    -- | Connect a signal handler for the [changed](#signal:changed) signal, to be run before the default handler.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Signals.on' accelMap #changed callback
    -- @
    --
    -- This signal admits a optional parameter @detail@.
    -- If it's not @Nothing@, we will connect to “@changed::detail@” instead.
    --
    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
        wrapped'' <- C_AccelMapChangedCallback -> IO (FunPtr C_AccelMapChangedCallback)
    mk_AccelMapChangedCallback C_AccelMapChangedCallback
    wrapped'
        connectSignalFunPtr obj "changed" wrapped'' SignalConnectBefore detail

    -- | Connect a signal handler for the [changed](#signal:changed) signal, to be run after the default handler.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Signals.after' accelMap #changed callback
    -- @
    --
    -- This signal admits a optional parameter @detail@.
    -- If it's not @Nothing@, we will connect to “@changed::detail@” instead.
    --
    --
    -- By default the object invoking the signal is not passed to the callback.
    -- If you need to access it, you can use the implit @?self@ parameter.
    -- Note that this requires activating the @ImplicitParams@ GHC extension.
    --
    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
        wrapped'' <- C_AccelMapChangedCallback -> IO (FunPtr C_AccelMapChangedCallback)
    mk_AccelMapChangedCallback C_AccelMapChangedCallback
    wrapped'
        connectSignalFunPtr obj "changed" wrapped'' SignalConnectAfter 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-gtk3-3.0.44/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

    -- method AccelMap::add_entry
    -- method type : MemberFunction
    -- Args: [ Arg
    --           { argCName = "accel_path"
    --           , argType = TBasicType TUTF8
    --           , argCType = Just "const gchar*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "valid accelerator path"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "accel_key"
    --           , argType = TBasicType TUInt
    --           , argCType = Just "guint"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the accelerator key"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "accel_mods"
    --           , argType =
    --               TInterface Name { namespace = "Gdk" , name = "ModifierType" }
    --           , argCType = Just "GdkModifierType"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the accelerator modifiers"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_accel_map_add_entry" gtk_accel_map_add_entry ::
        CString ->                              -- accel_path : TBasicType TUTF8
        Word32 ->                               -- accel_key : TBasicType TUInt
        CUInt ->                                -- accel_mods : TInterface (Name {namespace = "Gdk", name = "ModifierType"})
        IO ()

    -- | Registers a new accelerator with the global accelerator map.
    -- This function should only be called once per /@accelPath@/
    -- with the canonical /@accelKey@/ and /@accelMods@/ for this path.
    -- To change the accelerator during runtime programatically, use
    -- 'GI.Gtk.Objects.AccelMap.accelMapChangeEntry'.
    --
    -- Set /@accelKey@/ and /@accelMods@/ to 0 to request a removal of
    -- the accelerator.
    --
    -- Note that /@accelPath@/ string will be stored in a @/GQuark/@. Therefore, if you
    -- pass a static string, you can save some memory by interning it first with
    -- 'GI.GLib.Functions.internStaticString'.
    accelMapAddEntry ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        T.Text
        -- ^ /@accelPath@/: valid accelerator path
        -> Word32
        -- ^ /@accelKey@/: the accelerator key
        -> [Gdk.Flags.ModifierType]
        -- ^ /@accelMods@/: the accelerator modifiers
        -> 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
        accelPath' <- Text -> IO CString
    textToCString Text
    accelPath
        let accelMods' = [ModifierType] -> CUInt
    forall b a. (Num b, IsGFlag a) => [a] -> b
    gflagsToWord [ModifierType]
    accelMods
        gtk_accel_map_add_entry accelPath' accelKey accelMods'
        freeMem accelPath'
        return ()

    #if defined(ENABLE_OVERLOADING)
    #endif

    -- method AccelMap::add_filter
    -- method type : MemberFunction
    -- Args: [ Arg
    --           { argCName = "filter_pattern"
    --           , argType = TBasicType TUTF8
    --           , argCType = Just "const gchar*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a pattern (see #GPatternSpec)"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_accel_map_add_filter" gtk_accel_map_add_filter ::
        CString ->                              -- filter_pattern : TBasicType TUTF8
        IO ()

    -- | Adds a filter to the global list of accel path filters.
    --
    -- Accel map entries whose accel path matches one of the filters
    -- are skipped by 'GI.Gtk.Objects.AccelMap.accelMapForeach'.
    --
    -- This function is intended for GTK+ modules that create their own
    -- menus, but don’t want them to be saved into the applications accelerator
    -- map dump.
    accelMapAddFilter ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        T.Text
        -- ^ /@filterPattern@/: a pattern (see t'GI.GLib.Structs.PatternSpec.PatternSpec')
        -> 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
        filterPattern' <- Text -> IO CString
    textToCString Text
    filterPattern
        gtk_accel_map_add_filter filterPattern'
        freeMem filterPattern'
        return ()

    #if defined(ENABLE_OVERLOADING)
    #endif

    -- method AccelMap::change_entry
    -- method type : MemberFunction
    -- Args: [ Arg
    --           { argCName = "accel_path"
    --           , argType = TBasicType TUTF8
    --           , argCType = Just "const gchar*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a valid accelerator path"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "accel_key"
    --           , argType = TBasicType TUInt
    --           , argCType = Just "guint"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the new accelerator key"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "accel_mods"
    --           , argType =
    --               TInterface Name { namespace = "Gdk" , name = "ModifierType" }
    --           , argCType = Just "GdkModifierType"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the new accelerator modifiers"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "replace"
    --           , argType = TBasicType TBoolean
    --           , argCType = Just "gboolean"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText =
    --                     Just "%TRUE if other accelerators may be deleted upon conflicts"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TBoolean)
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_accel_map_change_entry" gtk_accel_map_change_entry ::
        CString ->                              -- accel_path : TBasicType TUTF8
        Word32 ->                               -- accel_key : TBasicType TUInt
        CUInt ->                                -- accel_mods : TInterface (Name {namespace = "Gdk", name = "ModifierType"})
        CInt ->                                 -- replace : TBasicType TBoolean
        IO CInt

    -- | Changes the /@accelKey@/ and /@accelMods@/ currently associated with /@accelPath@/.
    -- Due to conflicts with other accelerators, a change may not always be possible,
    -- /@replace@/ indicates whether other accelerators may be deleted to resolve such
    -- conflicts. A change will only occur if all conflicts could be resolved (which
    -- might not be the case if conflicting accelerators are locked). Successful
    -- changes are indicated by a 'P.True' return value.
    --
    -- Note that /@accelPath@/ string will be stored in a @/GQuark/@. Therefore, if you
    -- pass a static string, you can save some memory by interning it first with
    -- 'GI.GLib.Functions.internStaticString'.
    accelMapChangeEntry ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        T.Text
        -- ^ /@accelPath@/: a valid accelerator path
        -> Word32
        -- ^ /@accelKey@/: the new accelerator key
        -> [Gdk.Flags.ModifierType]
        -- ^ /@accelMods@/: the new accelerator modifiers
        -> Bool
        -- ^ /@replace@/: 'P.True' if other accelerators may be deleted upon conflicts
        -> m Bool
        -- ^ __Returns:__ 'P.True' if the accelerator could be changed, 'P.False' otherwise
    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
        accelPath' <- Text -> IO CString
    textToCString Text
    accelPath
        let accelMods' = [ModifierType] -> CUInt
    forall b a. (Num b, IsGFlag a) => [a] -> b
    gflagsToWord [ModifierType]
    accelMods
        let 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
        result <- gtk_accel_map_change_entry accelPath' accelKey accelMods' replace'
        let result' = (CInt -> CInt -> Bool
    forall a. Eq a => a -> a -> Bool
    /= CInt
    0) CInt
    result
        freeMem accelPath'
        return result'

    #if defined(ENABLE_OVERLOADING)
    #endif

    -- method AccelMap::foreach
    -- method type : MemberFunction
    -- Args: [ Arg
    --           { argCName = "data"
    --           , argType = TBasicType TPtr
    --           , argCType = Just "gpointer"
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "data to be passed into @foreach_func"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "foreach_func"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "AccelMapForeach" }
    --           , argCType = Just "GtkAccelMapForeach"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText =
    --                     Just
    --                       "function to be executed for each accel\n               map entry which is not filtered out"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeCall
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_accel_map_foreach" gtk_accel_map_foreach ::
        Ptr () ->                               -- data : TBasicType TPtr
        FunPtr Gtk.Callbacks.C_AccelMapForeach -> -- foreach_func : TInterface (Name {namespace = "Gtk", name = "AccelMapForeach"})
        IO ()

    -- | Loops over the entries in the accelerator map whose accel path
    -- doesn’t match any of the filters added with 'GI.Gtk.Objects.AccelMap.accelMapAddFilter',
    -- and execute /@foreachFunc@/ on each. The signature of /@foreachFunc@/ is
    -- that of t'GI.Gtk.Callbacks.AccelMapForeach', the /@changed@/ parameter indicates whether
    -- this accelerator was changed during runtime (thus, would need
    -- saving during an accelerator map dump).
    accelMapForeach ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Ptr ()
        -- ^ /@data@/: data to be passed into /@foreachFunc@/
        -> Gtk.Callbacks.AccelMapForeach
        -- ^ /@foreachFunc@/: function to be executed for each accel
        --                map entry which is not filtered out
        -> 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
        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)
        gtk_accel_map_foreach data_ foreachFunc'
        safeFreeFunPtr $ castFunPtrToPtr foreachFunc'
        return ()

    #if defined(ENABLE_OVERLOADING)
    #endif

    -- method AccelMap::foreach_unfiltered
    -- method type : MemberFunction
    -- Args: [ Arg
    --           { argCName = "data"
    --           , argType = TBasicType TPtr
    --           , argCType = Just "gpointer"
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "data to be passed into @foreach_func"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "foreach_func"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "AccelMapForeach" }
    --           , argCType = Just "GtkAccelMapForeach"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText =
    --                     Just
    --                       "function to be executed for each accel\n               map entry"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeCall
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_accel_map_foreach_unfiltered" gtk_accel_map_foreach_unfiltered ::
        Ptr () ->                               -- data : TBasicType TPtr
        FunPtr Gtk.Callbacks.C_AccelMapForeach -> -- foreach_func : TInterface (Name {namespace = "Gtk", name = "AccelMapForeach"})
        IO ()

    -- | Loops over all entries in the accelerator map, and execute
    -- /@foreachFunc@/ on each. The signature of /@foreachFunc@/ is that of
    -- t'GI.Gtk.Callbacks.AccelMapForeach', the /@changed@/ parameter indicates whether
    -- this accelerator was changed during runtime (thus, would need
    -- saving during an accelerator map dump).
    accelMapForeachUnfiltered ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Ptr ()
        -- ^ /@data@/: data to be passed into /@foreachFunc@/
        -> Gtk.Callbacks.AccelMapForeach
        -- ^ /@foreachFunc@/: function to be executed for each accel
        --                map entry
        -> 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
        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)
        gtk_accel_map_foreach_unfiltered data_ foreachFunc'
        safeFreeFunPtr $ castFunPtrToPtr foreachFunc'
        return ()

    #if defined(ENABLE_OVERLOADING)
    #endif

    -- method AccelMap::get
    -- method type : MemberFunction
    -- Args: []
    -- Lengths: []
    -- returnType: Just (TInterface Name { namespace = "Gtk" , name = "AccelMap" })
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_accel_map_get" gtk_accel_map_get ::
        IO (Ptr AccelMap)

    -- | Gets the singleton global t'GI.Gtk.Objects.AccelMap.AccelMap' object. This object
    -- is useful only for notification of changes to the accelerator
    -- map via the [changed](#g:signal:changed) signal; it isn’t a parameter to the
    -- other accelerator map functions.
    --
    -- /Since: 2.4/
    accelMapGet ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        m AccelMap
        -- ^ __Returns:__ the global t'GI.Gtk.Objects.AccelMap.AccelMap' object
    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
        result <- IO (Ptr AccelMap)
    gtk_accel_map_get
        checkUnexpectedReturnNULL "accelMapGet" result
        result' <- (newObject AccelMap) result
        return result'

    #if defined(ENABLE_OVERLOADING)
    #endif

    -- method AccelMap::load
    -- method type : MemberFunction
    -- Args: [ Arg
    --           { argCName = "file_name"
    --           , argType = TBasicType TFileName
    --           , argCType = Just "const gchar*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText =
    --                     Just
    --                       "a file containing accelerator specifications,\n  in the GLib file name encoding"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_accel_map_load" gtk_accel_map_load ::
        CString ->                              -- file_name : TBasicType TFileName
        IO ()

    -- | Parses a file previously saved with 'GI.Gtk.Objects.AccelMap.accelMapSave' for
    -- accelerator specifications, and propagates them accordingly.
    accelMapLoad ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        [Char]
        -- ^ /@fileName@/: a file containing accelerator specifications,
        --   in the GLib file name encoding
        -> m ()
    accelMapLoad :: forall (m :: * -> *). (HasCallStack, MonadIO m) => String -> m ()
    accelMapLoad String
    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
        fileName' <- String -> IO CString
    stringToCString String
    fileName
        gtk_accel_map_load fileName'
        freeMem fileName'
        return ()

    #if defined(ENABLE_OVERLOADING)
    #endif

    -- method AccelMap::load_fd
    -- method type : MemberFunction
    -- Args: [ Arg
    --           { argCName = "fd"
    --           , argType = TBasicType TInt
    --           , argCType = Just "gint"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a valid readable file descriptor"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_accel_map_load_fd" gtk_accel_map_load_fd ::
        Int32 ->                                -- fd : TBasicType TInt
        IO ()

    -- | Filedescriptor variant of 'GI.Gtk.Objects.AccelMap.accelMapLoad'.
    --
    -- Note that the file descriptor will not be closed by this function.
    accelMapLoadFd ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Int32
        -- ^ /@fd@/: a valid readable file descriptor
        -> 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

    -- method AccelMap::load_scanner
    -- method type : MemberFunction
    -- Args: [ Arg
    --           { argCName = "scanner"
    --           , argType =
    --               TInterface Name { namespace = "GLib" , name = "Scanner" }
    --           , argCType = Just "GScanner*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText =
    --                     Just
    --                       "a #GScanner which has already been provided with an input file"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_accel_map_load_scanner" gtk_accel_map_load_scanner ::
        Ptr GLib.Scanner.Scanner ->             -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
        IO ()

    -- | t'GI.GLib.Structs.Scanner.Scanner' variant of 'GI.Gtk.Objects.AccelMap.accelMapLoad'.
    accelMapLoadScanner ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        GLib.Scanner.Scanner
        -- ^ /@scanner@/: a t'GI.GLib.Structs.Scanner.Scanner' which has already been provided with an input file
        -> 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
        scanner' <- Scanner -> IO (Ptr Scanner)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Scanner
    scanner
        gtk_accel_map_load_scanner scanner'
        touchManagedPtr scanner
        return ()

    #if defined(ENABLE_OVERLOADING)
    #endif

    -- method AccelMap::lock_path
    -- method type : MemberFunction
    -- Args: [ Arg
    --           { argCName = "accel_path"
    --           , argType = TBasicType TUTF8
    --           , argCType = Just "const gchar*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a valid accelerator path"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_accel_map_lock_path" gtk_accel_map_lock_path ::
        CString ->                              -- accel_path : TBasicType TUTF8
        IO ()

    -- | Locks the given accelerator path. If the accelerator map doesn’t yet contain
    -- an entry for /@accelPath@/, a new one is created.
    --
    -- Locking an accelerator path prevents its accelerator from being changed
    -- during runtime. A locked accelerator path can be unlocked by
    -- 'GI.Gtk.Objects.AccelMap.accelMapUnlockPath'. Refer to 'GI.Gtk.Objects.AccelMap.accelMapChangeEntry'
    -- for information about runtime accelerator changes.
    --
    -- If called more than once, /@accelPath@/ remains locked until
    -- 'GI.Gtk.Objects.AccelMap.accelMapUnlockPath' has been called an equivalent number
    -- of times.
    --
    -- Note that locking of individual accelerator paths is independent from
    -- locking the t'GI.Gtk.Objects.AccelGroup.AccelGroup' containing them. For runtime accelerator
    -- changes to be possible, both the accelerator path and its t'GI.Gtk.Objects.AccelGroup.AccelGroup'
    -- have to be unlocked.
    --
    -- /Since: 2.4/
    accelMapLockPath ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        T.Text
        -- ^ /@accelPath@/: a valid accelerator path
        -> 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
        accelPath' <- Text -> IO CString
    textToCString Text
    accelPath
        gtk_accel_map_lock_path accelPath'
        freeMem accelPath'
        return ()

    #if defined(ENABLE_OVERLOADING)
    #endif

    -- method AccelMap::lookup_entry
    -- method type : MemberFunction
    -- Args: [ Arg
    --           { argCName = "accel_path"
    --           , argType = TBasicType TUTF8
    --           , argCType = Just "const gchar*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a valid accelerator path"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "key"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "AccelKey" }
    --           , argCType = Just "GtkAccelKey*"
    --           , direction = DirectionOut
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText =
    --                     Just "the accelerator key to be filled in (optional)"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = True
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TBoolean)
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_accel_map_lookup_entry" gtk_accel_map_lookup_entry ::
        CString ->                              -- accel_path : TBasicType TUTF8
        Ptr Gtk.AccelKey.AccelKey ->            -- key : TInterface (Name {namespace = "Gtk", name = "AccelKey"})
        IO CInt

    -- | Looks up the accelerator entry for /@accelPath@/ and fills in /@key@/.
    accelMapLookupEntry ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        T.Text
        -- ^ /@accelPath@/: a valid accelerator path
        -> m ((Bool, Gtk.AccelKey.AccelKey))
        -- ^ __Returns:__ 'P.True' if /@accelPath@/ is known, 'P.False' otherwise
    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
        accelPath' <- Text -> IO CString
    textToCString Text
    accelPath
        key <- SP.callocBytes 12 :: IO (Ptr Gtk.AccelKey.AccelKey)
        result <- gtk_accel_map_lookup_entry accelPath' key
        let result' = (CInt -> CInt -> Bool
    forall a. Eq a => a -> a -> Bool
    /= CInt
    0) CInt
    result
        key' <- (wrapPtr Gtk.AccelKey.AccelKey) key
        freeMem accelPath'
        return (result', key')

    #if defined(ENABLE_OVERLOADING)
    #endif

    -- method AccelMap::save
    -- method type : MemberFunction
    -- Args: [ Arg
    --           { argCName = "file_name"
    --           , argType = TBasicType TFileName
    --           , argCType = Just "const gchar*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText =
    --                     Just
    --                       "the name of the file to contain\n  accelerator specifications, in the GLib file name encoding"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_accel_map_save" gtk_accel_map_save ::
        CString ->                              -- file_name : TBasicType TFileName
        IO ()

    -- | Saves current accelerator specifications (accelerator path, key
    -- and modifiers) to /@fileName@/.
    -- The file is written in a format suitable to be read back in by
    -- 'GI.Gtk.Objects.AccelMap.accelMapLoad'.
    accelMapSave ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        [Char]
        -- ^ /@fileName@/: the name of the file to contain
        --   accelerator specifications, in the GLib file name encoding
        -> m ()
    accelMapSave :: forall (m :: * -> *). (HasCallStack, MonadIO m) => String -> m ()
    accelMapSave String
    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
        fileName' <- String -> IO CString
    stringToCString String
    fileName
        gtk_accel_map_save fileName'
        freeMem fileName'
        return ()

    #if defined(ENABLE_OVERLOADING)
    #endif

    -- method AccelMap::save_fd
    -- method type : MemberFunction
    -- Args: [ Arg
    --           { argCName = "fd"
    --           , argType = TBasicType TInt
    --           , argCType = Just "gint"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a valid writable file descriptor"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_accel_map_save_fd" gtk_accel_map_save_fd ::
        Int32 ->                                -- fd : TBasicType TInt
        IO ()

    -- | Filedescriptor variant of 'GI.Gtk.Objects.AccelMap.accelMapSave'.
    --
    -- Note that the file descriptor will not be closed by this function.
    accelMapSaveFd ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Int32
        -- ^ /@fd@/: a valid writable file descriptor
        -> 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

    -- method AccelMap::unlock_path
    -- method type : MemberFunction
    -- Args: [ Arg
    --           { argCName = "accel_path"
    --           , argType = TBasicType TUTF8
    --           , argCType = Just "const gchar*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a valid accelerator path"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_accel_map_unlock_path" gtk_accel_map_unlock_path ::
        CString ->                              -- accel_path : TBasicType TUTF8
        IO ()

    -- | Undoes the last call to 'GI.Gtk.Objects.AccelMap.accelMapLockPath' on this /@accelPath@/.
    -- Refer to 'GI.Gtk.Objects.AccelMap.accelMapLockPath' for information about accelerator path locking.
    --
    -- /Since: 2.4/
    accelMapUnlockPath ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        T.Text
        -- ^ /@accelPath@/: a valid accelerator path
        -> 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
        accelPath' <- Text -> IO CString
    textToCString Text
    accelPath
        gtk_accel_map_unlock_path accelPath'
        freeMem accelPath'
        return ()

    #if defined(ENABLE_OVERLOADING)
    #endif