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

    -- | Copyright  : Will Thompson and Iñaki García Etxebarria
    -- License    : LGPL-2.1
    -- Maintainer : Iñaki García Etxebarria
    --
    -- Manages and looks up recently used files.
    --
    -- Each recently used file is identified by its URI, and has meta-data
    -- associated to it, like the names and command lines of the applications
    -- that have registered it, the number of time each application has
    -- registered the same file, the mime type of the file and whether
    -- the file should be displayed only by the applications that have
    -- registered it.
    --
    -- The recently used files list is per user.
    --
    -- @GtkRecentManager@ acts like a database of all the recently
    -- used files. You can create new @GtkRecentManager@ objects, but
    -- it is more efficient to use the default manager created by GTK.
    --
    -- Adding a new recently used file is as simple as:
    --
    --
    -- === /c code/
    -- >GtkRecentManager *manager;
    -- >
    -- >manager = gtk_recent_manager_get_default ();
    -- >gtk_recent_manager_add_item (manager, file_uri);
    --
    --
    -- The @GtkRecentManager@ will try to gather all the needed information
    -- from the file itself through GIO.
    --
    -- Looking up the meta-data associated with a recently used file
    -- given its URI requires calling 'GI.Gtk.Objects.RecentManager.recentManagerLookupItem':
    --
    --
    -- === /c code/
    -- >GtkRecentManager *manager;
    -- >GtkRecentInfo *info;
    -- >GError *error = NULL;
    -- >
    -- >manager = gtk_recent_manager_get_default ();
    -- >info = gtk_recent_manager_lookup_item (manager, file_uri, &error);
    -- >if (error)
    -- >  {
    -- >    g_warning ("Could not find the file: %s", error->message);
    -- >    g_error_free (error);
    -- >  }
    -- >else
    -- > {
    -- >   // Use the info object
    -- >   gtk_recent_info_unref (info);
    -- > }
    --
    --
    -- In order to retrieve the list of recently used files, you can use
    -- 'GI.Gtk.Objects.RecentManager.recentManagerGetItems', which returns a list of
    -- t'GI.Gtk.Structs.RecentInfo.RecentInfo'.
    --
    -- Note that the maximum age of the recently used files list is
    -- controllable through the [Settings:gtkRecentFilesMaxAge]("GI.Gtk.Objects.Settings#g:attr:gtkRecentFilesMaxAge")
    -- property.

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

    module GI.Gtk.Objects.RecentManager
        (

    -- * Exported types
        RecentManager(..)                       ,
        IsRecentManager                         ,
        toRecentManager                         ,

     -- * Methods
    -- |
    --
    --  === __Click to display all available methods, including inherited ones__
    -- ==== Methods
    -- [addFull]("GI.Gtk.Objects.RecentManager#g:method:addFull"), [addItem]("GI.Gtk.Objects.RecentManager#g:method:addItem"), [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"), [hasItem]("GI.Gtk.Objects.RecentManager#g:method:hasItem"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [lookupItem]("GI.Gtk.Objects.RecentManager#g:method:lookupItem"), [moveItem]("GI.Gtk.Objects.RecentManager#g:method:moveItem"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [purgeItems]("GI.Gtk.Objects.RecentManager#g:method:purgeItems"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [removeItem]("GI.Gtk.Objects.RecentManager#g:method:removeItem"), [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"), [getItems]("GI.Gtk.Objects.RecentManager#g:method:getItems"), [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)
        ResolveRecentManagerMethod              ,
    #endif

    -- ** addFull #method:addFull#

    #if defined(ENABLE_OVERLOADING)
        RecentManagerAddFullMethodInfo          ,
    #endif
        recentManagerAddFull                    ,

    -- ** addItem #method:addItem#

    #if defined(ENABLE_OVERLOADING)
        RecentManagerAddItemMethodInfo          ,
    #endif
        recentManagerAddItem                    ,

    -- ** getDefault #method:getDefault#

        recentManagerGetDefault                 ,

    -- ** getItems #method:getItems#

    #if defined(ENABLE_OVERLOADING)
        RecentManagerGetItemsMethodInfo         ,
    #endif
        recentManagerGetItems                   ,

    -- ** hasItem #method:hasItem#

    #if defined(ENABLE_OVERLOADING)
        RecentManagerHasItemMethodInfo          ,
    #endif
        recentManagerHasItem                    ,

    -- ** lookupItem #method:lookupItem#

    #if defined(ENABLE_OVERLOADING)
        RecentManagerLookupItemMethodInfo       ,
    #endif
        recentManagerLookupItem                 ,

    -- ** moveItem #method:moveItem#

    #if defined(ENABLE_OVERLOADING)
        RecentManagerMoveItemMethodInfo         ,
    #endif
        recentManagerMoveItem                   ,

    -- ** new #method:new#

        recentManagerNew                        ,

    -- ** purgeItems #method:purgeItems#

    #if defined(ENABLE_OVERLOADING)
        RecentManagerPurgeItemsMethodInfo       ,
    #endif
        recentManagerPurgeItems                 ,

    -- ** removeItem #method:removeItem#

    #if defined(ENABLE_OVERLOADING)
        RecentManagerRemoveItemMethodInfo       ,
    #endif
        recentManagerRemoveItem                 ,

     -- * Properties

    -- ** filename #attr:filename#
    -- | The full path to the file to be used to store and read the
    -- recently used resources list

    #if defined(ENABLE_OVERLOADING)
        RecentManagerFilenamePropertyInfo       ,
    #endif
        constructRecentManagerFilename          ,
        getRecentManagerFilename                ,
    #if defined(ENABLE_OVERLOADING)
        recentManagerFilename                   ,
    #endif

    -- ** size #attr:size#
    -- | The size of the recently used resources list.

    #if defined(ENABLE_OVERLOADING)
        RecentManagerSizePropertyInfo           ,
    #endif
        getRecentManagerSize                    ,
    #if defined(ENABLE_OVERLOADING)
        recentManagerSize                       ,
    #endif

     -- * Signals

    -- ** changed #signal:changed#

        RecentManagerChangedCallback            ,
    #if defined(ENABLE_OVERLOADING)
        RecentManagerChangedSignalInfo          ,
    #endif
        afterRecentManagerChanged               ,
        onRecentManagerChanged                  ,

        ) 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.DateTime as GLib.DateTime
    import qualified GI.GObject.Objects.Object as GObject.Object
    import qualified GI.Gio.Interfaces.AppInfo as Gio.AppInfo
    import qualified GI.Gio.Interfaces.Icon as Gio.Icon
    import {-# SOURCE #-} qualified GI.Gtk.Structs.RecentData as Gtk.RecentData
    import {-# SOURCE #-} qualified GI.Gtk.Structs.RecentInfo as Gtk.RecentInfo

    #else
    import qualified GI.GObject.Objects.Object as GObject.Object
    import {-# SOURCE #-} qualified GI.Gtk.Structs.RecentData as Gtk.RecentData
    import {-# SOURCE #-} qualified GI.Gtk.Structs.RecentInfo as Gtk.RecentInfo

    #endif

    -- | Memory-managed wrapper type.
    newtype RecentManager = RecentManager (SP.ManagedPtr RecentManager)
        deriving (RecentManager -> RecentManager -> Bool
    (RecentManager -> RecentManager -> Bool)
    -> (RecentManager -> RecentManager -> Bool) -> Eq RecentManager
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: RecentManager -> RecentManager -> Bool
    == :: RecentManager -> RecentManager -> Bool
    $c/= :: RecentManager -> RecentManager -> Bool
    /= :: RecentManager -> RecentManager -> Bool
    Eq)

    instance SP.ManagedPtrNewtype RecentManager where
        toManagedPtr :: RecentManager -> ManagedPtr RecentManager
    toManagedPtr (RecentManager ManagedPtr RecentManager
    p) = ManagedPtr RecentManager
    p

    foreign import ccall "gtk_recent_manager_get_type"
        c_gtk_recent_manager_get_type :: IO B.Types.GType

    instance B.Types.TypedObject RecentManager where
        glibType :: IO GType
    glibType = IO GType
    c_gtk_recent_manager_get_type

    instance B.Types.GObject RecentManager

    -- | Type class for types which can be safely cast to t'RecentManager', for instance with `toRecentManager`.
    class (SP.GObject o, O.IsDescendantOf RecentManager o) => IsRecentManager o
    instance (SP.GObject o, O.IsDescendantOf RecentManager o) => IsRecentManager o

    instance O.HasParentTypes RecentManager
    type instance O.ParentTypes RecentManager = '[GObject.Object.Object]

    -- | Cast to t'RecentManager', for types for which this is known to be safe. For general casts, use 'Data.GI.Base.ManagedPtr.castTo'.
    toRecentManager :: (MIO.MonadIO m, IsRecentManager o) => o -> m RecentManager
    toRecentManager :: forall (m :: * -> *) o.
    (MonadIO m, IsRecentManager o) =>
    o -> m RecentManager
    toRecentManager = IO RecentManager -> m RecentManager
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    MIO.liftIO (IO RecentManager -> m RecentManager)
    -> (o -> IO RecentManager) -> o -> m RecentManager
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (ManagedPtr RecentManager -> RecentManager)
    -> o -> IO RecentManager
    forall o o'.
    (HasCallStack, ManagedPtrNewtype o, TypedObject o,
     ManagedPtrNewtype o', TypedObject o') =>
    (ManagedPtr o' -> o') -> o -> IO o'
    B.ManagedPtr.unsafeCastTo ManagedPtr RecentManager -> RecentManager
    RecentManager

    -- | Convert t'RecentManager' 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 RecentManager) where
        gvalueGType_ :: IO GType
    gvalueGType_ = IO GType
    c_gtk_recent_manager_get_type
        gvalueSet_ :: Ptr GValue -> Maybe RecentManager -> IO ()
    gvalueSet_ Ptr GValue
    gv Maybe RecentManager
    P.Nothing = Ptr GValue -> Ptr RecentManager -> IO ()
    forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
    B.GValue.set_object Ptr GValue
    gv (Ptr RecentManager
    forall a. Ptr a
    FP.nullPtr :: FP.Ptr RecentManager)
        gvalueSet_ Ptr GValue
    gv (P.Just RecentManager
    obj) = RecentManager -> (Ptr RecentManager -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    B.ManagedPtr.withManagedPtr RecentManager
    obj (Ptr GValue -> Ptr RecentManager -> IO ()
    forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
    B.GValue.set_object Ptr GValue
    gv)
        gvalueGet_ :: Ptr GValue -> IO (Maybe RecentManager)
    gvalueGet_ Ptr GValue
    gv = do
            ptr <- Ptr GValue -> IO (Ptr RecentManager)
    forall a. GObject a => Ptr GValue -> IO (Ptr a)
    B.GValue.get_object Ptr GValue
    gv :: IO (FP.Ptr RecentManager)
            if ptr /= FP.nullPtr
            then P.Just <$> B.ManagedPtr.newObject RecentManager ptr
            else return P.Nothing

    #if defined(ENABLE_OVERLOADING)
    type family ResolveRecentManagerMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
        ResolveRecentManagerMethod "addFull" o = RecentManagerAddFullMethodInfo
        ResolveRecentManagerMethod "addItem" o = RecentManagerAddItemMethodInfo
        ResolveRecentManagerMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
        ResolveRecentManagerMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
        ResolveRecentManagerMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
        ResolveRecentManagerMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
        ResolveRecentManagerMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
        ResolveRecentManagerMethod "hasItem" o = RecentManagerHasItemMethodInfo
        ResolveRecentManagerMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
        ResolveRecentManagerMethod "lookupItem" o = RecentManagerLookupItemMethodInfo
        ResolveRecentManagerMethod "moveItem" o = RecentManagerMoveItemMethodInfo
        ResolveRecentManagerMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
        ResolveRecentManagerMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
        ResolveRecentManagerMethod "purgeItems" o = RecentManagerPurgeItemsMethodInfo
        ResolveRecentManagerMethod "ref" o = GObject.Object.ObjectRefMethodInfo
        ResolveRecentManagerMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
        ResolveRecentManagerMethod "removeItem" o = RecentManagerRemoveItemMethodInfo
        ResolveRecentManagerMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
        ResolveRecentManagerMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
        ResolveRecentManagerMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
        ResolveRecentManagerMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
        ResolveRecentManagerMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
        ResolveRecentManagerMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
        ResolveRecentManagerMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
        ResolveRecentManagerMethod "getItems" o = RecentManagerGetItemsMethodInfo
        ResolveRecentManagerMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
        ResolveRecentManagerMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
        ResolveRecentManagerMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
        ResolveRecentManagerMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
        ResolveRecentManagerMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
        ResolveRecentManagerMethod l o = O.MethodResolutionFailed l o

    instance (info ~ ResolveRecentManagerMethod t RecentManager, O.OverloadedMethod info RecentManager p) => OL.IsLabel t (RecentManager -> 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 ~ ResolveRecentManagerMethod t RecentManager, O.OverloadedMethod info RecentManager p, R.HasField t RecentManager p) => R.HasField t RecentManager p where
        getField = O.overloadedMethod @info

    #endif

    instance (info ~ ResolveRecentManagerMethod t RecentManager, O.OverloadedMethodInfo info RecentManager) => OL.IsLabel t (O.MethodProxy info RecentManager) where
    #if MIN_VERSION_base(4,10,0)
        fromLabel = O.MethodProxy
    #else
        fromLabel _ = O.MethodProxy
    #endif

    #endif

    -- signal RecentManager::changed
    -- | Emitted when the current recently used resources manager changes
    -- its contents.
    --
    -- This can happen either by calling 'GI.Gtk.Objects.RecentManager.recentManagerAddItem'
    -- or by another application.
    type RecentManagerChangedCallback =
        IO ()

    type C_RecentManagerChangedCallback =
        Ptr RecentManager ->                    -- object
        Ptr () ->                               -- user_data
        IO ()

    -- | Generate a function pointer callable from C code, from a `C_RecentManagerChangedCallback`.
    foreign import ccall "wrapper"
        mk_RecentManagerChangedCallback :: C_RecentManagerChangedCallback -> IO (FunPtr C_RecentManagerChangedCallback)

    wrap_RecentManagerChangedCallback ::
        GObject a => (a -> RecentManagerChangedCallback) ->
        C_RecentManagerChangedCallback
    wrap_RecentManagerChangedCallback :: forall a.
    GObject a =>
    (a -> IO ()) -> C_RecentManagerChangedCallback
    wrap_RecentManagerChangedCallback a -> IO ()
    gi'cb Ptr RecentManager
    gi'selfPtr Ptr ()
    _ = do
        Ptr RecentManager -> (RecentManager -> IO ()) -> IO ()
    forall o b.
    (HasCallStack, GObject o) =>
    Ptr o -> (o -> IO b) -> IO b
    B.ManagedPtr.withNewObject Ptr RecentManager
    gi'selfPtr ((RecentManager -> IO ()) -> IO ())
    -> (RecentManager -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \RecentManager
    gi'self -> a -> IO ()
    gi'cb (RecentManager -> a
    forall a b. Coercible a b => a -> b
    Coerce.coerce RecentManager
    gi'self)

    -- | 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' recentManager #changed callback
    -- @
    --
    --
    onRecentManagerChanged :: (IsRecentManager a, MonadIO m) => a -> ((?self :: a) => RecentManagerChangedCallback) -> m SignalHandlerId
    onRecentManagerChanged :: forall a (m :: * -> *).
    (IsRecentManager a, MonadIO m) =>
    a -> ((?self::a) => IO ()) -> m SignalHandlerId
    onRecentManagerChanged a
    obj (?self::a) => IO ()
    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 -> IO ()
    wrapped a
    self = let ?self = a
    ?self::a
    self in IO ()
    (?self::a) => IO ()
    cb
        let wrapped' :: C_RecentManagerChangedCallback
    wrapped' = (a -> IO ()) -> C_RecentManagerChangedCallback
    forall a.
    GObject a =>
    (a -> IO ()) -> C_RecentManagerChangedCallback
    wrap_RecentManagerChangedCallback a -> IO ()
    wrapped
        wrapped'' <- C_RecentManagerChangedCallback
    -> IO (FunPtr C_RecentManagerChangedCallback)
    mk_RecentManagerChangedCallback C_RecentManagerChangedCallback
    wrapped'
        connectSignalFunPtr obj "changed" wrapped'' SignalConnectBefore Nothing

    -- | 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' recentManager #changed callback
    -- @
    --
    --
    --
    -- 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.
    --
    afterRecentManagerChanged :: (IsRecentManager a, MonadIO m) => a -> ((?self :: a) => RecentManagerChangedCallback) -> m SignalHandlerId
    afterRecentManagerChanged :: forall a (m :: * -> *).
    (IsRecentManager a, MonadIO m) =>
    a -> ((?self::a) => IO ()) -> m SignalHandlerId
    afterRecentManagerChanged a
    obj (?self::a) => IO ()
    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 -> IO ()
    wrapped a
    self = let ?self = a
    ?self::a
    self in IO ()
    (?self::a) => IO ()
    cb
        let wrapped' :: C_RecentManagerChangedCallback
    wrapped' = (a -> IO ()) -> C_RecentManagerChangedCallback
    forall a.
    GObject a =>
    (a -> IO ()) -> C_RecentManagerChangedCallback
    wrap_RecentManagerChangedCallback a -> IO ()
    wrapped
        wrapped'' <- C_RecentManagerChangedCallback
    -> IO (FunPtr C_RecentManagerChangedCallback)
    mk_RecentManagerChangedCallback C_RecentManagerChangedCallback
    wrapped'
        connectSignalFunPtr obj "changed" wrapped'' SignalConnectAfter Nothing

    #if defined(ENABLE_OVERLOADING)
    data RecentManagerChangedSignalInfo
    instance SignalInfo RecentManagerChangedSignalInfo where
        type HaskellCallbackType RecentManagerChangedSignalInfo = RecentManagerChangedCallback
        connectSignal obj cb connectMode detail = do
            let cb' = wrap_RecentManagerChangedCallback cb
            cb'' <- mk_RecentManagerChangedCallback cb'
            connectSignalFunPtr obj "changed" cb'' connectMode detail
        dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.RecentManager::changed"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-RecentManager.html#g:signal:changed"})

    #endif

    -- VVV Prop "filename"
       -- Type: TBasicType TUTF8
       -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
       -- Nullable: (Nothing,Nothing)

    -- | Get the value of the “@filename@” property.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' recentManager #filename
    -- @
    getRecentManagerFilename :: (MonadIO m, IsRecentManager o) => o -> m (Maybe T.Text)
    getRecentManagerFilename :: forall (m :: * -> *) o.
    (MonadIO m, IsRecentManager o) =>
    o -> m (Maybe Text)
    getRecentManagerFilename o
    obj = IO (Maybe Text) -> m (Maybe Text)
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    MIO.liftIO (IO (Maybe Text) -> m (Maybe Text))
    -> IO (Maybe Text) -> m (Maybe Text)
    forall a b. (a -> b) -> a -> b
    $ o -> String -> IO (Maybe Text)
    forall a. GObject a => a -> String -> IO (Maybe Text)
    B.Properties.getObjectPropertyString o
    obj String
    "filename"

    -- | Construct a t'GValueConstruct' with valid value for the “@filename@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
    constructRecentManagerFilename :: (IsRecentManager o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
    constructRecentManagerFilename :: forall o (m :: * -> *).
    (IsRecentManager o, MonadIO m) =>
    Text -> m (GValueConstruct o)
    constructRecentManagerFilename Text
    val = IO (GValueConstruct o) -> m (GValueConstruct o)
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
    -> IO (GValueConstruct o) -> m (GValueConstruct o)
    forall a b. (a -> b) -> a -> b
    $ do
        IO (GValueConstruct o) -> IO (GValueConstruct o)
    forall a. IO a -> IO a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
    -> IO (GValueConstruct o) -> IO (GValueConstruct o)
    forall a b. (a -> b) -> a -> b
    $ String -> Maybe Text -> IO (GValueConstruct o)
    forall o. String -> Maybe Text -> IO (GValueConstruct o)
    B.Properties.constructObjectPropertyString String
    "filename" (Text -> Maybe Text
    forall a. a -> Maybe a
    P.Just Text
    val)

    #if defined(ENABLE_OVERLOADING)
    data RecentManagerFilenamePropertyInfo
    instance AttrInfo RecentManagerFilenamePropertyInfo where
        type AttrAllowedOps RecentManagerFilenamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
        type AttrBaseTypeConstraint RecentManagerFilenamePropertyInfo = IsRecentManager
        type AttrSetTypeConstraint RecentManagerFilenamePropertyInfo = (~) T.Text
        type AttrTransferTypeConstraint RecentManagerFilenamePropertyInfo = (~) T.Text
        type AttrTransferType RecentManagerFilenamePropertyInfo = T.Text
        type AttrGetType RecentManagerFilenamePropertyInfo = (Maybe T.Text)
        type AttrLabel RecentManagerFilenamePropertyInfo = "filename"
        type AttrOrigin RecentManagerFilenamePropertyInfo = RecentManager
        attrGet = getRecentManagerFilename
        attrSet = undefined
        attrPut = undefined
        attrTransfer _ v = do
            return v
        attrConstruct = constructRecentManagerFilename
        attrClear = undefined
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.RecentManager.filename"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-RecentManager.html#g:attr:filename"
            })
    #endif

    -- VVV Prop "size"
       -- Type: TBasicType TInt
       -- Flags: [PropertyReadable]
       -- Nullable: (Nothing,Nothing)

    -- | Get the value of the “@size@” property.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' recentManager #size
    -- @
    getRecentManagerSize :: (MonadIO m, IsRecentManager o) => o -> m Int32
    getRecentManagerSize :: forall (m :: * -> *) o.
    (MonadIO m, IsRecentManager o) =>
    o -> m Int32
    getRecentManagerSize o
    obj = IO Int32 -> m Int32
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    MIO.liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
    forall a b. (a -> b) -> a -> b
    $ o -> String -> IO Int32
    forall a. GObject a => a -> String -> IO Int32
    B.Properties.getObjectPropertyInt32 o
    obj String
    "size"

    #if defined(ENABLE_OVERLOADING)
    data RecentManagerSizePropertyInfo
    instance AttrInfo RecentManagerSizePropertyInfo where
        type AttrAllowedOps RecentManagerSizePropertyInfo = '[ 'AttrGet]
        type AttrBaseTypeConstraint RecentManagerSizePropertyInfo = IsRecentManager
        type AttrSetTypeConstraint RecentManagerSizePropertyInfo = (~) ()
        type AttrTransferTypeConstraint RecentManagerSizePropertyInfo = (~) ()
        type AttrTransferType RecentManagerSizePropertyInfo = ()
        type AttrGetType RecentManagerSizePropertyInfo = Int32
        type AttrLabel RecentManagerSizePropertyInfo = "size"
        type AttrOrigin RecentManagerSizePropertyInfo = RecentManager
        attrGet = getRecentManagerSize
        attrSet = undefined
        attrPut = undefined
        attrTransfer _ = undefined
        attrConstruct = undefined
        attrClear = undefined
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.RecentManager.size"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-RecentManager.html#g:attr:size"
            })
    #endif

    #if defined(ENABLE_OVERLOADING)
    instance O.HasAttributeList RecentManager
    type instance O.AttributeList RecentManager = RecentManagerAttributeList
    type RecentManagerAttributeList = ('[ '("filename", RecentManagerFilenamePropertyInfo), '("size", RecentManagerSizePropertyInfo)] :: [(Symbol, DK.Type)])
    #endif

    #if defined(ENABLE_OVERLOADING)
    recentManagerFilename :: AttrLabelProxy "filename"
    recentManagerFilename = AttrLabelProxy

    recentManagerSize :: AttrLabelProxy "size"
    recentManagerSize = AttrLabelProxy

    #endif

    #if defined(ENABLE_OVERLOADING)
    type instance O.SignalList RecentManager = RecentManagerSignalList
    type RecentManagerSignalList = ('[ '("changed", RecentManagerChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])

    #endif

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

    foreign import ccall "gtk_recent_manager_new" gtk_recent_manager_new ::
        IO (Ptr RecentManager)

    -- | Creates a new recent manager object.
    --
    -- Recent manager objects are used to handle the list of recently used
    -- resources. A @GtkRecentManager@ object monitors the recently used
    -- resources list, and emits the [RecentManager::changed]("GI.Gtk.Objects.RecentManager#g:signal:changed")
    -- signal each time something inside the list changes.
    --
    -- @GtkRecentManager@ objects are expensive: be sure to create them
    -- only when needed. You should use 'GI.Gtk.Objects.RecentManager.recentManagerGetDefault'
    -- instead.
    recentManagerNew ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        m RecentManager
        -- ^ __Returns:__ A newly created @GtkRecentManager@ object
    recentManagerNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m RecentManager
    recentManagerNew  = IO RecentManager -> m RecentManager
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO RecentManager -> m RecentManager)
    -> IO RecentManager -> m RecentManager
    forall a b. (a -> b) -> a -> b
    $ do
        result <- IO (Ptr RecentManager)
    gtk_recent_manager_new
        checkUnexpectedReturnNULL "recentManagerNew" result
        result' <- (wrapObject RecentManager) result
        return result'

    #if defined(ENABLE_OVERLOADING)
    #endif

    -- method RecentManager::add_full
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "manager"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "RecentManager" }
    --           , argCType = Just "GtkRecentManager*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GtkRecentManager`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "uri"
    --           , argType = TBasicType TUTF8
    --           , argCType = Just "const char*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a valid URI" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "recent_data"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "RecentData" }
    --           , argCType = Just "const GtkRecentData*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "metadata of the resource"
    --                 , 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_recent_manager_add_full" gtk_recent_manager_add_full ::
        Ptr RecentManager ->                    -- manager : TInterface (Name {namespace = "Gtk", name = "RecentManager"})
        CString ->                              -- uri : TBasicType TUTF8
        Ptr Gtk.RecentData.RecentData ->        -- recent_data : TInterface (Name {namespace = "Gtk", name = "RecentData"})
        IO CInt

    -- | Adds a new resource, pointed by /@uri@/, into the recently used
    -- resources list, using the metadata specified inside the
    -- @GtkRecentData@ passed in /@recentData@/.
    --
    -- The passed URI will be used to identify this resource inside the
    -- list.
    --
    -- In order to register the new recently used resource, metadata about
    -- the resource must be passed as well as the URI; the metadata is
    -- stored in a @GtkRecentData@, which must contain the MIME
    -- type of the resource pointed by the URI; the name of the application
    -- that is registering the item, and a command line to be used when
    -- launching the item.
    --
    -- Optionally, a @GtkRecentData@ might contain a UTF-8 string
    -- to be used when viewing the item instead of the last component of
    -- the URI; a short description of the item; whether the item should
    -- be considered private - that is, should be displayed only by the
    -- applications that have registered it.
    recentManagerAddFull ::
        (B.CallStack.HasCallStack, MonadIO m, IsRecentManager a) =>
        a
        -- ^ /@manager@/: a @GtkRecentManager@
        -> T.Text
        -- ^ /@uri@/: a valid URI
        -> Gtk.RecentData.RecentData
        -- ^ /@recentData@/: metadata of the resource
        -> m Bool
        -- ^ __Returns:__ 'P.True' if the new item was successfully added to the
        --   recently used resources list, 'P.False' otherwise
    recentManagerAddFull :: forall (m :: * -> *) a.
    (HasCallStack, MonadIO m, IsRecentManager a) =>
    a -> Text -> RecentData -> m Bool
    recentManagerAddFull a
    manager Text
    uri RecentData
    recentData = 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
        manager' <- a -> IO (Ptr RecentManager)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    manager
        uri' <- textToCString uri
        recentData' <- unsafeManagedPtrGetPtr recentData
        result <- gtk_recent_manager_add_full manager' uri' recentData'
        let result' = (CInt -> CInt -> Bool
    forall a. Eq a => a -> a -> Bool
    /= CInt
    0) CInt
    result
        touchManagedPtr manager
        touchManagedPtr recentData
        freeMem uri'
        return result'

    #if defined(ENABLE_OVERLOADING)
    data RecentManagerAddFullMethodInfo
    instance (signature ~ (T.Text -> Gtk.RecentData.RecentData -> m Bool), MonadIO m, IsRecentManager a) => O.OverloadedMethod RecentManagerAddFullMethodInfo a signature where
        overloadedMethod = recentManagerAddFull

    instance O.OverloadedMethodInfo RecentManagerAddFullMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.RecentManager.recentManagerAddFull",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-RecentManager.html#v:recentManagerAddFull"
            })

    #endif

    -- method RecentManager::add_item
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "manager"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "RecentManager" }
    --           , argCType = Just "GtkRecentManager*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GtkRecentManager`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "uri"
    --           , argType = TBasicType TUTF8
    --           , argCType = Just "const char*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a valid URI" , 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_recent_manager_add_item" gtk_recent_manager_add_item ::
        Ptr RecentManager ->                    -- manager : TInterface (Name {namespace = "Gtk", name = "RecentManager"})
        CString ->                              -- uri : TBasicType TUTF8
        IO CInt

    -- | Adds a new resource, pointed by /@uri@/, into the recently used
    -- resources list.
    --
    -- This function automatically retrieves some of the needed
    -- metadata and setting other metadata to common default values;
    -- it then feeds the data to 'GI.Gtk.Objects.RecentManager.recentManagerAddFull'.
    --
    -- See 'GI.Gtk.Objects.RecentManager.recentManagerAddFull' if you want to explicitly
    -- define the metadata for the resource pointed by /@uri@/.
    recentManagerAddItem ::
        (B.CallStack.HasCallStack, MonadIO m, IsRecentManager a) =>
        a
        -- ^ /@manager@/: a @GtkRecentManager@
        -> T.Text
        -- ^ /@uri@/: a valid URI
        -> m Bool
        -- ^ __Returns:__ 'P.True' if the new item was successfully added
        --   to the recently used resources list
    recentManagerAddItem :: forall (m :: * -> *) a.
    (HasCallStack, MonadIO m, IsRecentManager a) =>
    a -> Text -> m Bool
    recentManagerAddItem a
    manager Text
    uri = 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
        manager' <- a -> IO (Ptr RecentManager)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    manager
        uri' <- textToCString uri
        result <- gtk_recent_manager_add_item manager' uri'
        let result' = (CInt -> CInt -> Bool
    forall a. Eq a => a -> a -> Bool
    /= CInt
    0) CInt
    result
        touchManagedPtr manager
        freeMem uri'
        return result'

    #if defined(ENABLE_OVERLOADING)
    data RecentManagerAddItemMethodInfo
    instance (signature ~ (T.Text -> m Bool), MonadIO m, IsRecentManager a) => O.OverloadedMethod RecentManagerAddItemMethodInfo a signature where
        overloadedMethod = recentManagerAddItem

    instance O.OverloadedMethodInfo RecentManagerAddItemMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.RecentManager.recentManagerAddItem",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-RecentManager.html#v:recentManagerAddItem"
            })

    #endif

    -- method RecentManager::get_items
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "manager"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "RecentManager" }
    --           , argCType = Just "GtkRecentManager*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GtkRecentManager`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just
    --               (TGList
    --                  (TInterface Name { namespace = "Gtk" , name = "RecentInfo" }))
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_recent_manager_get_items" gtk_recent_manager_get_items ::
        Ptr RecentManager ->                    -- manager : TInterface (Name {namespace = "Gtk", name = "RecentManager"})
        IO (Ptr (GList (Ptr Gtk.RecentInfo.RecentInfo)))

    -- | Gets the list of recently used resources.
    recentManagerGetItems ::
        (B.CallStack.HasCallStack, MonadIO m, IsRecentManager a) =>
        a
        -- ^ /@manager@/: a @GtkRecentManager@
        -> m [Gtk.RecentInfo.RecentInfo]
        -- ^ __Returns:__ a list of
        --   newly allocated @GtkRecentInfo objects@. Use
        --   'GI.Gtk.Structs.RecentInfo.recentInfoUnref' on each item inside the list, and then
        --   free the list itself using @/g_list_free()/@.
    recentManagerGetItems :: forall (m :: * -> *) a.
    (HasCallStack, MonadIO m, IsRecentManager a) =>
    a -> m [RecentInfo]
    recentManagerGetItems a
    manager = IO [RecentInfo] -> m [RecentInfo]
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO [RecentInfo] -> m [RecentInfo])
    -> IO [RecentInfo] -> m [RecentInfo]
    forall a b. (a -> b) -> a -> b
    $ do
        manager' <- a -> IO (Ptr RecentManager)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    manager
        result <- gtk_recent_manager_get_items manager'
        result' <- unpackGList result
        result'' <- mapM (wrapBoxed Gtk.RecentInfo.RecentInfo) result'
        g_list_free result
        touchManagedPtr manager
        return result''

    #if defined(ENABLE_OVERLOADING)
    data RecentManagerGetItemsMethodInfo
    instance (signature ~ (m [Gtk.RecentInfo.RecentInfo]), MonadIO m, IsRecentManager a) => O.OverloadedMethod RecentManagerGetItemsMethodInfo a signature where
        overloadedMethod = recentManagerGetItems

    instance O.OverloadedMethodInfo RecentManagerGetItemsMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.RecentManager.recentManagerGetItems",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-RecentManager.html#v:recentManagerGetItems"
            })

    #endif

    -- method RecentManager::has_item
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "manager"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "RecentManager" }
    --           , argCType = Just "GtkRecentManager*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GtkRecentManager`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "uri"
    --           , argType = TBasicType TUTF8
    --           , argCType = Just "const char*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a URI" , 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_recent_manager_has_item" gtk_recent_manager_has_item ::
        Ptr RecentManager ->                    -- manager : TInterface (Name {namespace = "Gtk", name = "RecentManager"})
        CString ->                              -- uri : TBasicType TUTF8
        IO CInt

    -- | Checks whether there is a recently used resource registered
    -- with /@uri@/ inside the recent manager.
    recentManagerHasItem ::
        (B.CallStack.HasCallStack, MonadIO m, IsRecentManager a) =>
        a
        -- ^ /@manager@/: a @GtkRecentManager@
        -> T.Text
        -- ^ /@uri@/: a URI
        -> m Bool
        -- ^ __Returns:__ 'P.True' if the resource was found, 'P.False' otherwise
    recentManagerHasItem :: forall (m :: * -> *) a.
    (HasCallStack, MonadIO m, IsRecentManager a) =>
    a -> Text -> m Bool
    recentManagerHasItem a
    manager Text
    uri = 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
        manager' <- a -> IO (Ptr RecentManager)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    manager
        uri' <- textToCString uri
        result <- gtk_recent_manager_has_item manager' uri'
        let result' = (CInt -> CInt -> Bool
    forall a. Eq a => a -> a -> Bool
    /= CInt
    0) CInt
    result
        touchManagedPtr manager
        freeMem uri'
        return result'

    #if defined(ENABLE_OVERLOADING)
    data RecentManagerHasItemMethodInfo
    instance (signature ~ (T.Text -> m Bool), MonadIO m, IsRecentManager a) => O.OverloadedMethod RecentManagerHasItemMethodInfo a signature where
        overloadedMethod = recentManagerHasItem

    instance O.OverloadedMethodInfo RecentManagerHasItemMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.RecentManager.recentManagerHasItem",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-RecentManager.html#v:recentManagerHasItem"
            })

    #endif

    -- method RecentManager::lookup_item
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "manager"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "RecentManager" }
    --           , argCType = Just "GtkRecentManager*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GtkRecentManager`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "uri"
    --           , argType = TBasicType TUTF8
    --           , argCType = Just "const char*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a URI" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TInterface Name { namespace = "Gtk" , name = "RecentInfo" })
    -- throws : True
    -- Skip return : False

    foreign import ccall "gtk_recent_manager_lookup_item" gtk_recent_manager_lookup_item ::
        Ptr RecentManager ->                    -- manager : TInterface (Name {namespace = "Gtk", name = "RecentManager"})
        CString ->                              -- uri : TBasicType TUTF8
        Ptr (Ptr GError) ->                     -- error
        IO (Ptr Gtk.RecentInfo.RecentInfo)

    -- | Searches for a URI inside the recently used resources list, and
    -- returns a @GtkRecentInfo@ containing information about the resource
    -- like its MIME type, or its display name.
    recentManagerLookupItem ::
        (B.CallStack.HasCallStack, MonadIO m, IsRecentManager a) =>
        a
        -- ^ /@manager@/: a @GtkRecentManager@
        -> T.Text
        -- ^ /@uri@/: a URI
        -> m (Maybe Gtk.RecentInfo.RecentInfo)
        -- ^ __Returns:__ a @GtkRecentInfo@ containing information
        --   about the resource pointed by /@uri@/, or 'P.Nothing' if the URI was
        --   not registered in the recently used resources list. Free with
        --   'GI.Gtk.Structs.RecentInfo.recentInfoUnref'. /(Can throw 'Data.GI.Base.GError.GError')/
    recentManagerLookupItem :: forall (m :: * -> *) a.
    (HasCallStack, MonadIO m, IsRecentManager a) =>
    a -> Text -> m (Maybe RecentInfo)
    recentManagerLookupItem a
    manager Text
    uri = IO (Maybe RecentInfo) -> m (Maybe RecentInfo)
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO (Maybe RecentInfo) -> m (Maybe RecentInfo))
    -> IO (Maybe RecentInfo) -> m (Maybe RecentInfo)
    forall a b. (a -> b) -> a -> b
    $ do
        manager' <- a -> IO (Ptr RecentManager)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    manager
        uri' <- textToCString uri
        onException (do
            result <- propagateGError $ gtk_recent_manager_lookup_item manager' uri'
            maybeResult <- convertIfNonNull result $ \Ptr RecentInfo
    result' -> do
                result'' <- ((ManagedPtr RecentInfo -> RecentInfo)
    -> Ptr RecentInfo -> IO RecentInfo
    forall a.
    (HasCallStack, GBoxed a) =>
    (ManagedPtr a -> a) -> Ptr a -> IO a
    wrapBoxed ManagedPtr RecentInfo -> RecentInfo
    Gtk.RecentInfo.RecentInfo) Ptr RecentInfo
    result'
                return result''
            touchManagedPtr manager
            freeMem uri'
            return maybeResult
         ) (do
            freeMem uri'
         )

    #if defined(ENABLE_OVERLOADING)
    data RecentManagerLookupItemMethodInfo
    instance (signature ~ (T.Text -> m (Maybe Gtk.RecentInfo.RecentInfo)), MonadIO m, IsRecentManager a) => O.OverloadedMethod RecentManagerLookupItemMethodInfo a signature where
        overloadedMethod = recentManagerLookupItem

    instance O.OverloadedMethodInfo RecentManagerLookupItemMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.RecentManager.recentManagerLookupItem",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-RecentManager.html#v:recentManagerLookupItem"
            })

    #endif

    -- method RecentManager::move_item
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "manager"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "RecentManager" }
    --           , argCType = Just "GtkRecentManager*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GtkRecentManager`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "uri"
    --           , argType = TBasicType TUTF8
    --           , argCType = Just "const char*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the URI of a recently used resource"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "new_uri"
    --           , argType = TBasicType TUTF8
    --           , argCType = Just "const char*"
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText =
    --                     Just
    --                       "the new URI of the recently used resource, or\n   %NULL to remove the item pointed by @uri in the list"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TBoolean)
    -- throws : True
    -- Skip return : False

    foreign import ccall "gtk_recent_manager_move_item" gtk_recent_manager_move_item ::
        Ptr RecentManager ->                    -- manager : TInterface (Name {namespace = "Gtk", name = "RecentManager"})
        CString ->                              -- uri : TBasicType TUTF8
        CString ->                              -- new_uri : TBasicType TUTF8
        Ptr (Ptr GError) ->                     -- error
        IO CInt

    -- | Changes the location of a recently used resource from /@uri@/ to /@newUri@/.
    --
    -- Please note that this function will not affect the resource pointed
    -- by the URIs, but only the URI used in the recently used resources list.
    recentManagerMoveItem ::
        (B.CallStack.HasCallStack, MonadIO m, IsRecentManager a) =>
        a
        -- ^ /@manager@/: a @GtkRecentManager@
        -> T.Text
        -- ^ /@uri@/: the URI of a recently used resource
        -> Maybe (T.Text)
        -- ^ /@newUri@/: the new URI of the recently used resource, or
        --    'P.Nothing' to remove the item pointed by /@uri@/ in the list
        -> m ()
        -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
    recentManagerMoveItem :: forall (m :: * -> *) a.
    (HasCallStack, MonadIO m, IsRecentManager a) =>
    a -> Text -> Maybe Text -> m ()
    recentManagerMoveItem a
    manager Text
    uri Maybe Text
    newUri = 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
        manager' <- a -> IO (Ptr RecentManager)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    manager
        uri' <- textToCString uri
        maybeNewUri <- case newUri of
            Maybe Text
    Nothing -> CString -> IO CString
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CString
    forall a. Ptr a
    FP.nullPtr
            Just Text
    jNewUri -> do
                jNewUri' <- Text -> IO CString
    textToCString Text
    jNewUri
                return jNewUri'
        onException (do
            _ <- propagateGError $ gtk_recent_manager_move_item manager' uri' maybeNewUri
            touchManagedPtr manager
            freeMem uri'
            freeMem maybeNewUri
            return ()
         ) (do
            freeMem uri'
            freeMem maybeNewUri
         )

    #if defined(ENABLE_OVERLOADING)
    data RecentManagerMoveItemMethodInfo
    instance (signature ~ (T.Text -> Maybe (T.Text) -> m ()), MonadIO m, IsRecentManager a) => O.OverloadedMethod RecentManagerMoveItemMethodInfo a signature where
        overloadedMethod = recentManagerMoveItem

    instance O.OverloadedMethodInfo RecentManagerMoveItemMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.RecentManager.recentManagerMoveItem",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-RecentManager.html#v:recentManagerMoveItem"
            })

    #endif

    -- method RecentManager::purge_items
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "manager"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "RecentManager" }
    --           , argCType = Just "GtkRecentManager*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GtkRecentManager`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TInt)
    -- throws : True
    -- Skip return : False

    foreign import ccall "gtk_recent_manager_purge_items" gtk_recent_manager_purge_items ::
        Ptr RecentManager ->                    -- manager : TInterface (Name {namespace = "Gtk", name = "RecentManager"})
        Ptr (Ptr GError) ->                     -- error
        IO Int32

    -- | Purges every item from the recently used resources list.
    recentManagerPurgeItems ::
        (B.CallStack.HasCallStack, MonadIO m, IsRecentManager a) =>
        a
        -- ^ /@manager@/: a @GtkRecentManager@
        -> m Int32
        -- ^ __Returns:__ the number of items that have been removed from the
        --   recently used resources list /(Can throw 'Data.GI.Base.GError.GError')/
    recentManagerPurgeItems :: forall (m :: * -> *) a.
    (HasCallStack, MonadIO m, IsRecentManager a) =>
    a -> m Int32
    recentManagerPurgeItems a
    manager = IO Int32 -> m Int32
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
    forall a b. (a -> b) -> a -> b
    $ do
        manager' <- a -> IO (Ptr RecentManager)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    manager
        onException (do
            result <- propagateGError $ gtk_recent_manager_purge_items manager'
            touchManagedPtr manager
            return result
         ) (do
            return ()
         )

    #if defined(ENABLE_OVERLOADING)
    data RecentManagerPurgeItemsMethodInfo
    instance (signature ~ (m Int32), MonadIO m, IsRecentManager a) => O.OverloadedMethod RecentManagerPurgeItemsMethodInfo a signature where
        overloadedMethod = recentManagerPurgeItems

    instance O.OverloadedMethodInfo RecentManagerPurgeItemsMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.RecentManager.recentManagerPurgeItems",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-RecentManager.html#v:recentManagerPurgeItems"
            })

    #endif

    -- method RecentManager::remove_item
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "manager"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "RecentManager" }
    --           , argCType = Just "GtkRecentManager*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GtkRecentManager`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "uri"
    --           , argType = TBasicType TUTF8
    --           , argCType = Just "const char*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the URI of the item you wish to remove"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TBoolean)
    -- throws : True
    -- Skip return : False

    foreign import ccall "gtk_recent_manager_remove_item" gtk_recent_manager_remove_item ::
        Ptr RecentManager ->                    -- manager : TInterface (Name {namespace = "Gtk", name = "RecentManager"})
        CString ->                              -- uri : TBasicType TUTF8
        Ptr (Ptr GError) ->                     -- error
        IO CInt

    -- | Removes a resource pointed by /@uri@/ from the recently used resources
    -- list handled by a recent manager.
    recentManagerRemoveItem ::
        (B.CallStack.HasCallStack, MonadIO m, IsRecentManager a) =>
        a
        -- ^ /@manager@/: a @GtkRecentManager@
        -> T.Text
        -- ^ /@uri@/: the URI of the item you wish to remove
        -> m ()
        -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
    recentManagerRemoveItem :: forall (m :: * -> *) a.
    (HasCallStack, MonadIO m, IsRecentManager a) =>
    a -> Text -> m ()
    recentManagerRemoveItem a
    manager Text
    uri = 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
        manager' <- a -> IO (Ptr RecentManager)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    manager
        uri' <- textToCString uri
        onException (do
            _ <- propagateGError $ gtk_recent_manager_remove_item manager' uri'
            touchManagedPtr manager
            freeMem uri'
            return ()
         ) (do
            freeMem uri'
         )

    #if defined(ENABLE_OVERLOADING)
    data RecentManagerRemoveItemMethodInfo
    instance (signature ~ (T.Text -> m ()), MonadIO m, IsRecentManager a) => O.OverloadedMethod RecentManagerRemoveItemMethodInfo a signature where
        overloadedMethod = recentManagerRemoveItem

    instance O.OverloadedMethodInfo RecentManagerRemoveItemMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.RecentManager.recentManagerRemoveItem",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-RecentManager.html#v:recentManagerRemoveItem"
            })

    #endif

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

    foreign import ccall "gtk_recent_manager_get_default" gtk_recent_manager_get_default ::
        IO (Ptr RecentManager)

    -- | Gets a unique instance of @GtkRecentManager@ that you can share
    -- in your application without caring about memory management.
    recentManagerGetDefault ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        m RecentManager
        -- ^ __Returns:__ A unique @GtkRecentManager@. Do not ref or
        --   unref it.
    recentManagerGetDefault :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m RecentManager
    recentManagerGetDefault  = IO RecentManager -> m RecentManager
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO RecentManager -> m RecentManager)
    -> IO RecentManager -> m RecentManager
    forall a b. (a -> b) -> a -> b
    $ do
        result <- IO (Ptr RecentManager)
    gtk_recent_manager_get_default
        checkUnexpectedReturnNULL "recentManagerGetDefault" result
        result' <- (newObject RecentManager) result
        return result'

    #if defined(ENABLE_OVERLOADING)
    #endif