{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
-}

module GI.Gio.Callbacks
    ( 

 -- * Signals
-- ** ActionEntryActivateFieldCallback #signal:ActionEntryActivateFieldCallback#
    ActionEntryActivateFieldCallback        ,
    ActionEntryActivateFieldCallback_WithClosures,
    C_ActionEntryActivateFieldCallback      ,
    drop_closures_ActionEntryActivateFieldCallback,
    dynamic_ActionEntryActivateFieldCallback,
    genClosure_ActionEntryActivateFieldCallback,
    mk_ActionEntryActivateFieldCallback     ,
    noActionEntryActivateFieldCallback      ,
    noActionEntryActivateFieldCallback_WithClosures,
    wrap_ActionEntryActivateFieldCallback   ,


-- ** ActionEntryChangeStateFieldCallback #signal:ActionEntryChangeStateFieldCallback#
    ActionEntryChangeStateFieldCallback     ,
    ActionEntryChangeStateFieldCallback_WithClosures,
    C_ActionEntryChangeStateFieldCallback   ,
    drop_closures_ActionEntryChangeStateFieldCallback,
    dynamic_ActionEntryChangeStateFieldCallback,
    genClosure_ActionEntryChangeStateFieldCallback,
    mk_ActionEntryChangeStateFieldCallback  ,
    noActionEntryChangeStateFieldCallback   ,
    noActionEntryChangeStateFieldCallback_WithClosures,
    wrap_ActionEntryChangeStateFieldCallback,


-- ** AsyncReadyCallback #signal:AsyncReadyCallback#
    AsyncReadyCallback                      ,
    AsyncReadyCallback_WithClosures         ,
    C_AsyncReadyCallback                    ,
    drop_closures_AsyncReadyCallback        ,
    dynamic_AsyncReadyCallback              ,
    genClosure_AsyncReadyCallback           ,
    mk_AsyncReadyCallback                   ,
    noAsyncReadyCallback                    ,
    noAsyncReadyCallback_WithClosures       ,
    wrap_AsyncReadyCallback                 ,


-- ** BusAcquiredCallback #signal:BusAcquiredCallback#
    BusAcquiredCallback                     ,
    BusAcquiredCallback_WithClosures        ,
    C_BusAcquiredCallback                   ,
    drop_closures_BusAcquiredCallback       ,
    dynamic_BusAcquiredCallback             ,
    genClosure_BusAcquiredCallback          ,
    mk_BusAcquiredCallback                  ,
    noBusAcquiredCallback                   ,
    noBusAcquiredCallback_WithClosures      ,
    wrap_BusAcquiredCallback                ,


-- ** BusNameAcquiredCallback #signal:BusNameAcquiredCallback#
    BusNameAcquiredCallback                 ,
    BusNameAcquiredCallback_WithClosures    ,
    C_BusNameAcquiredCallback               ,
    drop_closures_BusNameAcquiredCallback   ,
    dynamic_BusNameAcquiredCallback         ,
    genClosure_BusNameAcquiredCallback      ,
    mk_BusNameAcquiredCallback              ,
    noBusNameAcquiredCallback               ,
    noBusNameAcquiredCallback_WithClosures  ,
    wrap_BusNameAcquiredCallback            ,


-- ** BusNameAppearedCallback #signal:BusNameAppearedCallback#
    BusNameAppearedCallback                 ,
    BusNameAppearedCallback_WithClosures    ,
    C_BusNameAppearedCallback               ,
    drop_closures_BusNameAppearedCallback   ,
    dynamic_BusNameAppearedCallback         ,
    genClosure_BusNameAppearedCallback      ,
    mk_BusNameAppearedCallback              ,
    noBusNameAppearedCallback               ,
    noBusNameAppearedCallback_WithClosures  ,
    wrap_BusNameAppearedCallback            ,


-- ** BusNameLostCallback #signal:BusNameLostCallback#
    BusNameLostCallback                     ,
    BusNameLostCallback_WithClosures        ,
    C_BusNameLostCallback                   ,
    drop_closures_BusNameLostCallback       ,
    dynamic_BusNameLostCallback             ,
    genClosure_BusNameLostCallback          ,
    mk_BusNameLostCallback                  ,
    noBusNameLostCallback                   ,
    noBusNameLostCallback_WithClosures      ,
    wrap_BusNameLostCallback                ,


-- ** BusNameVanishedCallback #signal:BusNameVanishedCallback#
    BusNameVanishedCallback                 ,
    BusNameVanishedCallback_WithClosures    ,
    C_BusNameVanishedCallback               ,
    drop_closures_BusNameVanishedCallback   ,
    dynamic_BusNameVanishedCallback         ,
    genClosure_BusNameVanishedCallback      ,
    mk_BusNameVanishedCallback              ,
    noBusNameVanishedCallback               ,
    noBusNameVanishedCallback_WithClosures  ,
    wrap_BusNameVanishedCallback            ,


-- ** CancellableSourceFunc #signal:CancellableSourceFunc#
    C_CancellableSourceFunc                 ,
    CancellableSourceFunc                   ,
    CancellableSourceFunc_WithClosures      ,
    drop_closures_CancellableSourceFunc     ,
    dynamic_CancellableSourceFunc           ,
    genClosure_CancellableSourceFunc        ,
    mk_CancellableSourceFunc                ,
    noCancellableSourceFunc                 ,
    noCancellableSourceFunc_WithClosures    ,
    wrap_CancellableSourceFunc              ,


-- ** DBusInterfaceGetPropertyFunc #signal:DBusInterfaceGetPropertyFunc#
    C_DBusInterfaceGetPropertyFunc          ,
    DBusInterfaceGetPropertyFunc            ,
    DBusInterfaceGetPropertyFunc_WithClosures,
    drop_closures_DBusInterfaceGetPropertyFunc,
    dynamic_DBusInterfaceGetPropertyFunc    ,
    genClosure_DBusInterfaceGetPropertyFunc ,
    mk_DBusInterfaceGetPropertyFunc         ,
    noDBusInterfaceGetPropertyFunc          ,
    noDBusInterfaceGetPropertyFunc_WithClosures,
    wrap_DBusInterfaceGetPropertyFunc       ,


-- ** DBusInterfaceMethodCallFunc #signal:DBusInterfaceMethodCallFunc#
    C_DBusInterfaceMethodCallFunc           ,
    DBusInterfaceMethodCallFunc             ,
    DBusInterfaceMethodCallFunc_WithClosures,
    drop_closures_DBusInterfaceMethodCallFunc,
    dynamic_DBusInterfaceMethodCallFunc     ,
    genClosure_DBusInterfaceMethodCallFunc  ,
    mk_DBusInterfaceMethodCallFunc          ,
    noDBusInterfaceMethodCallFunc           ,
    noDBusInterfaceMethodCallFunc_WithClosures,
    wrap_DBusInterfaceMethodCallFunc        ,


-- ** DBusInterfaceSetPropertyFunc #signal:DBusInterfaceSetPropertyFunc#
    C_DBusInterfaceSetPropertyFunc          ,
    DBusInterfaceSetPropertyFunc            ,
    DBusInterfaceSetPropertyFunc_WithClosures,
    drop_closures_DBusInterfaceSetPropertyFunc,
    dynamic_DBusInterfaceSetPropertyFunc    ,
    genClosure_DBusInterfaceSetPropertyFunc ,
    mk_DBusInterfaceSetPropertyFunc         ,
    noDBusInterfaceSetPropertyFunc          ,
    noDBusInterfaceSetPropertyFunc_WithClosures,
    wrap_DBusInterfaceSetPropertyFunc       ,


-- ** DBusMessageFilterFunction #signal:DBusMessageFilterFunction#
    C_DBusMessageFilterFunction             ,
    DBusMessageFilterFunction               ,
    DBusMessageFilterFunction_WithClosures  ,
    drop_closures_DBusMessageFilterFunction ,
    dynamic_DBusMessageFilterFunction       ,
    genClosure_DBusMessageFilterFunction    ,
    mk_DBusMessageFilterFunction            ,
    noDBusMessageFilterFunction             ,
    noDBusMessageFilterFunction_WithClosures,
    wrap_DBusMessageFilterFunction          ,


-- ** DBusProxyTypeFunc #signal:DBusProxyTypeFunc#
    C_DBusProxyTypeFunc                     ,
    DBusProxyTypeFunc                       ,
    DBusProxyTypeFunc_WithClosures          ,
    drop_closures_DBusProxyTypeFunc         ,
    dynamic_DBusProxyTypeFunc               ,
    genClosure_DBusProxyTypeFunc            ,
    mk_DBusProxyTypeFunc                    ,
    noDBusProxyTypeFunc                     ,
    noDBusProxyTypeFunc_WithClosures        ,
    wrap_DBusProxyTypeFunc                  ,


-- ** DBusSignalCallback #signal:DBusSignalCallback#
    C_DBusSignalCallback                    ,
    DBusSignalCallback                      ,
    DBusSignalCallback_WithClosures         ,
    drop_closures_DBusSignalCallback        ,
    dynamic_DBusSignalCallback              ,
    genClosure_DBusSignalCallback           ,
    mk_DBusSignalCallback                   ,
    noDBusSignalCallback                    ,
    noDBusSignalCallback_WithClosures       ,
    wrap_DBusSignalCallback                 ,


-- ** DBusSubtreeDispatchFunc #signal:DBusSubtreeDispatchFunc#
    C_DBusSubtreeDispatchFunc               ,
    DBusSubtreeDispatchFunc                 ,
    DBusSubtreeDispatchFunc_WithClosures    ,
    drop_closures_DBusSubtreeDispatchFunc   ,
    dynamic_DBusSubtreeDispatchFunc         ,
    genClosure_DBusSubtreeDispatchFunc      ,
    mk_DBusSubtreeDispatchFunc              ,
    noDBusSubtreeDispatchFunc               ,
    noDBusSubtreeDispatchFunc_WithClosures  ,
    wrap_DBusSubtreeDispatchFunc            ,


-- ** DBusSubtreeIntrospectFunc #signal:DBusSubtreeIntrospectFunc#
    C_DBusSubtreeIntrospectFunc             ,
    DBusSubtreeIntrospectFunc               ,
    DBusSubtreeIntrospectFunc_WithClosures  ,
    drop_closures_DBusSubtreeIntrospectFunc ,
    dynamic_DBusSubtreeIntrospectFunc       ,
    genClosure_DBusSubtreeIntrospectFunc    ,
    mk_DBusSubtreeIntrospectFunc            ,
    noDBusSubtreeIntrospectFunc             ,
    noDBusSubtreeIntrospectFunc_WithClosures,
    wrap_DBusSubtreeIntrospectFunc          ,


-- ** DatagramBasedSourceFunc #signal:DatagramBasedSourceFunc#
    C_DatagramBasedSourceFunc               ,
    DatagramBasedSourceFunc                 ,
    DatagramBasedSourceFunc_WithClosures    ,
    drop_closures_DatagramBasedSourceFunc   ,
    dynamic_DatagramBasedSourceFunc         ,
    genClosure_DatagramBasedSourceFunc      ,
    mk_DatagramBasedSourceFunc              ,
    noDatagramBasedSourceFunc               ,
    noDatagramBasedSourceFunc_WithClosures  ,
    wrap_DatagramBasedSourceFunc            ,


-- ** DesktopAppLaunchCallback #signal:DesktopAppLaunchCallback#
    C_DesktopAppLaunchCallback              ,
    DesktopAppLaunchCallback                ,
    DesktopAppLaunchCallback_WithClosures   ,
    drop_closures_DesktopAppLaunchCallback  ,
    dynamic_DesktopAppLaunchCallback        ,
    genClosure_DesktopAppLaunchCallback     ,
    mk_DesktopAppLaunchCallback             ,
    noDesktopAppLaunchCallback              ,
    noDesktopAppLaunchCallback_WithClosures ,
    wrap_DesktopAppLaunchCallback           ,


-- ** FileMeasureProgressCallback #signal:FileMeasureProgressCallback#
    C_FileMeasureProgressCallback           ,
    FileMeasureProgressCallback             ,
    FileMeasureProgressCallback_WithClosures,
    drop_closures_FileMeasureProgressCallback,
    dynamic_FileMeasureProgressCallback     ,
    genClosure_FileMeasureProgressCallback  ,
    mk_FileMeasureProgressCallback          ,
    noFileMeasureProgressCallback           ,
    noFileMeasureProgressCallback_WithClosures,
    wrap_FileMeasureProgressCallback        ,


-- ** FileProgressCallback #signal:FileProgressCallback#
    C_FileProgressCallback                  ,
    FileProgressCallback                    ,
    FileProgressCallback_WithClosures       ,
    drop_closures_FileProgressCallback      ,
    dynamic_FileProgressCallback            ,
    genClosure_FileProgressCallback         ,
    mk_FileProgressCallback                 ,
    noFileProgressCallback                  ,
    noFileProgressCallback_WithClosures     ,
    wrap_FileProgressCallback               ,


-- ** FileReadMoreCallback #signal:FileReadMoreCallback#
    C_FileReadMoreCallback                  ,
    FileReadMoreCallback                    ,
    dynamic_FileReadMoreCallback            ,
    genClosure_FileReadMoreCallback         ,
    mk_FileReadMoreCallback                 ,
    noFileReadMoreCallback                  ,
    wrap_FileReadMoreCallback               ,


-- ** IOSchedulerJobFunc #signal:IOSchedulerJobFunc#
    C_IOSchedulerJobFunc                    ,
    IOSchedulerJobFunc                      ,
    IOSchedulerJobFunc_WithClosures         ,
    drop_closures_IOSchedulerJobFunc        ,
    dynamic_IOSchedulerJobFunc              ,
    genClosure_IOSchedulerJobFunc           ,
    mk_IOSchedulerJobFunc                   ,
    noIOSchedulerJobFunc                    ,
    noIOSchedulerJobFunc_WithClosures       ,
    wrap_IOSchedulerJobFunc                 ,


-- ** PollableSourceFunc #signal:PollableSourceFunc#
    C_PollableSourceFunc                    ,
    PollableSourceFunc                      ,
    PollableSourceFunc_WithClosures         ,
    drop_closures_PollableSourceFunc        ,
    dynamic_PollableSourceFunc              ,
    genClosure_PollableSourceFunc           ,
    mk_PollableSourceFunc                   ,
    noPollableSourceFunc                    ,
    noPollableSourceFunc_WithClosures       ,
    wrap_PollableSourceFunc                 ,


-- ** ReallocFunc #signal:ReallocFunc#
    C_ReallocFunc                           ,
    ReallocFunc                             ,
    dynamic_ReallocFunc                     ,
    genClosure_ReallocFunc                  ,
    mk_ReallocFunc                          ,
    noReallocFunc                           ,
    wrap_ReallocFunc                        ,


-- ** SettingsBindGetMapping #signal:SettingsBindGetMapping#
    C_SettingsBindGetMapping                ,
    SettingsBindGetMapping                  ,
    SettingsBindGetMapping_WithClosures     ,
    drop_closures_SettingsBindGetMapping    ,
    dynamic_SettingsBindGetMapping          ,
    genClosure_SettingsBindGetMapping       ,
    mk_SettingsBindGetMapping               ,
    noSettingsBindGetMapping                ,
    noSettingsBindGetMapping_WithClosures   ,
    wrap_SettingsBindGetMapping             ,


-- ** SettingsBindSetMapping #signal:SettingsBindSetMapping#
    C_SettingsBindSetMapping                ,
    SettingsBindSetMapping                  ,
    SettingsBindSetMapping_WithClosures     ,
    drop_closures_SettingsBindSetMapping    ,
    dynamic_SettingsBindSetMapping          ,
    genClosure_SettingsBindSetMapping       ,
    mk_SettingsBindSetMapping               ,
    noSettingsBindSetMapping                ,
    noSettingsBindSetMapping_WithClosures   ,
    wrap_SettingsBindSetMapping             ,


-- ** SettingsGetMapping #signal:SettingsGetMapping#
    C_SettingsGetMapping                    ,
    SettingsGetMapping                      ,
    SettingsGetMapping_WithClosures         ,
    drop_closures_SettingsGetMapping        ,
    dynamic_SettingsGetMapping              ,
    genClosure_SettingsGetMapping           ,
    mk_SettingsGetMapping                   ,
    noSettingsGetMapping                    ,
    noSettingsGetMapping_WithClosures       ,
    wrap_SettingsGetMapping                 ,


-- ** SimpleAsyncThreadFunc #signal:SimpleAsyncThreadFunc#
    C_SimpleAsyncThreadFunc                 ,
    SimpleAsyncThreadFunc                   ,
    dynamic_SimpleAsyncThreadFunc           ,
    genClosure_SimpleAsyncThreadFunc        ,
    mk_SimpleAsyncThreadFunc                ,
    noSimpleAsyncThreadFunc                 ,
    wrap_SimpleAsyncThreadFunc              ,


-- ** SocketSourceFunc #signal:SocketSourceFunc#
    C_SocketSourceFunc                      ,
    SocketSourceFunc                        ,
    SocketSourceFunc_WithClosures           ,
    drop_closures_SocketSourceFunc          ,
    dynamic_SocketSourceFunc                ,
    genClosure_SocketSourceFunc             ,
    mk_SocketSourceFunc                     ,
    noSocketSourceFunc                      ,
    noSocketSourceFunc_WithClosures         ,
    wrap_SocketSourceFunc                   ,


-- ** TaskThreadFunc #signal:TaskThreadFunc#
    C_TaskThreadFunc                        ,
    TaskThreadFunc                          ,
    dynamic_TaskThreadFunc                  ,
    genClosure_TaskThreadFunc               ,
    mk_TaskThreadFunc                       ,
    noTaskThreadFunc                        ,
    wrap_TaskThreadFunc                     ,


-- ** VfsFileLookupFunc #signal:VfsFileLookupFunc#
    C_VfsFileLookupFunc                     ,
    VfsFileLookupFunc                       ,
    VfsFileLookupFunc_WithClosures          ,
    drop_closures_VfsFileLookupFunc         ,
    dynamic_VfsFileLookupFunc               ,
    genClosure_VfsFileLookupFunc            ,
    mk_VfsFileLookupFunc                    ,
    noVfsFileLookupFunc                     ,
    noVfsFileLookupFunc_WithClosures        ,
    wrap_VfsFileLookupFunc                  ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP

import qualified GI.GLib.Flags as GLib.Flags
import qualified GI.GLib.Structs.VariantType as GLib.VariantType
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Interfaces.DatagramBased as Gio.DatagramBased
import {-# SOURCE #-} qualified GI.Gio.Interfaces.File as Gio.File
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.DBusConnection as Gio.DBusConnection
import {-# SOURCE #-} qualified GI.Gio.Objects.DBusMessage as Gio.DBusMessage
import {-# SOURCE #-} qualified GI.Gio.Objects.DBusMethodInvocation as Gio.DBusMethodInvocation
import {-# SOURCE #-} qualified GI.Gio.Objects.DBusObjectManagerClient as Gio.DBusObjectManagerClient
import {-# SOURCE #-} qualified GI.Gio.Objects.DesktopAppInfo as Gio.DesktopAppInfo
import {-# SOURCE #-} qualified GI.Gio.Objects.SimpleAction as Gio.SimpleAction
import {-# SOURCE #-} qualified GI.Gio.Objects.SimpleAsyncResult as Gio.SimpleAsyncResult
import {-# SOURCE #-} qualified GI.Gio.Objects.Socket as Gio.Socket
import {-# SOURCE #-} qualified GI.Gio.Objects.Task as Gio.Task
import {-# SOURCE #-} qualified GI.Gio.Objects.Vfs as Gio.Vfs
import {-# SOURCE #-} qualified GI.Gio.Structs.DBusInterfaceInfo as Gio.DBusInterfaceInfo
import {-# SOURCE #-} qualified GI.Gio.Structs.DBusInterfaceVTable as Gio.DBusInterfaceVTable
import {-# SOURCE #-} qualified GI.Gio.Structs.IOSchedulerJob as Gio.IOSchedulerJob

-- callback VfsFileLookupFunc
--          -> Callable {returnType = Just (TInterface (Name {namespace = "Gio", name = "File"})), returnMayBeNull = False, returnTransfer = TransferEverything, returnDocumentation = Documentation {rawDocText = Just "a #GFile for @identifier.", sinceVersion = Nothing}, args = [Arg {argCName = "vfs", argType = TInterface (Name {namespace = "Gio", name = "Vfs"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GVfs", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "identifier", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the identifier to lookup a #GFile for. This can either\n    be an URI or a parse name as returned by g_file_get_parse_name()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to the function", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "This function type is used by g_vfs_register_uri_scheme() to make it\npossible for a client to associate an URI scheme to a different #GFile\nimplementation.\n\nThe client should return a reference to the new file that has been\ncreated for @uri, or %NULL to continue with the default implementation.", sinceVersion = Just "2.50"}}
type C_VfsFileLookupFunc =
    Ptr Gio.Vfs.Vfs ->
    CString ->
    Ptr () ->
    IO (Ptr Gio.File.File)

-- Args : [Arg {argCName = "vfs", argType = TInterface (Name {namespace = "Gio", name = "Vfs"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GVfs", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "identifier", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the identifier to lookup a #GFile for. This can either\n    be an URI or a parse name as returned by g_file_get_parse_name()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to the function", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "File"}))
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_VfsFileLookupFunc :: FunPtr C_VfsFileLookupFunc -> C_VfsFileLookupFunc

dynamic_VfsFileLookupFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.Vfs.IsVfs a) =>
    FunPtr C_VfsFileLookupFunc
    -> a
    {- ^ /@vfs@/: a 'GI.Gio.Objects.Vfs.Vfs' -}
    -> T.Text
    {- ^ /@identifier@/: the identifier to lookup a 'GI.Gio.Interfaces.File.File' for. This can either
    be an URI or a parse name as returned by 'GI.Gio.Interfaces.File.fileGetParseName' -}
    -> Ptr ()
    {- ^ /@userData@/: user data passed to the function -}
    -> m Gio.File.File
    {- ^ __Returns:__ a 'GI.Gio.Interfaces.File.File' for /@identifier@/. -}
dynamic_VfsFileLookupFunc __funPtr vfs identifier userData = liftIO $ do
    vfs' <- unsafeManagedPtrCastPtr vfs
    identifier' <- textToCString identifier
    result <- (__dynamic_C_VfsFileLookupFunc __funPtr) vfs' identifier' userData
    checkUnexpectedReturnNULL "vfsFileLookupFunc" result
    result' <- (wrapObject Gio.File.File) result
    touchManagedPtr vfs
    freeMem identifier'
    return result'

foreign import ccall "wrapper"
    mk_VfsFileLookupFunc :: C_VfsFileLookupFunc -> IO (FunPtr C_VfsFileLookupFunc)

type VfsFileLookupFunc =
    Gio.Vfs.Vfs ->
    T.Text ->
    IO Gio.File.File

noVfsFileLookupFunc :: Maybe VfsFileLookupFunc
noVfsFileLookupFunc = Nothing

type VfsFileLookupFunc_WithClosures =
    Gio.Vfs.Vfs ->
    T.Text ->
    Ptr () ->
    IO Gio.File.File

noVfsFileLookupFunc_WithClosures :: Maybe VfsFileLookupFunc_WithClosures
noVfsFileLookupFunc_WithClosures = Nothing

drop_closures_VfsFileLookupFunc :: VfsFileLookupFunc -> VfsFileLookupFunc_WithClosures
drop_closures_VfsFileLookupFunc _f vfs identifier _ = _f vfs identifier

genClosure_VfsFileLookupFunc :: VfsFileLookupFunc -> IO Closure
genClosure_VfsFileLookupFunc cb = do
    let cb' = drop_closures_VfsFileLookupFunc cb
    let cb'' = wrap_VfsFileLookupFunc Nothing cb'
    mk_VfsFileLookupFunc cb'' >>= newCClosure


wrap_VfsFileLookupFunc ::
    Maybe (Ptr (FunPtr C_VfsFileLookupFunc)) ->
    VfsFileLookupFunc_WithClosures ->
    Ptr Gio.Vfs.Vfs ->
    CString ->
    Ptr () ->
    IO (Ptr Gio.File.File)
wrap_VfsFileLookupFunc funptrptr _cb vfs identifier userData = do
    vfs' <- (newObject Gio.Vfs.Vfs) vfs
    identifier' <- cstringToText identifier
    result <- _cb  vfs' identifier' userData
    maybeReleaseFunPtr funptrptr
    result' <- B.ManagedPtr.disownObject result
    return result'


-- callback TaskThreadFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "task", argType = TInterface (Name {namespace = "Gio", name = "Task"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GTask", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "source_object", argType = TInterface (Name {namespace = "GObject", name = "Object"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "@task's source object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "task_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "@task's task data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "@task's #GCancellable, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The prototype for a task function to be run in a thread via\ng_task_run_in_thread() or g_task_run_in_thread_sync().\n\nIf the return-on-cancel flag is set on @task, and @cancellable gets\ncancelled, then the #GTask will be completed immediately (as though\ng_task_return_error_if_cancelled() had been called), without\nwaiting for the task function to complete. However, the task\nfunction will continue running in its thread in the background. The\nfunction therefore needs to be careful about how it uses\nexternally-visible state in this case. See\ng_task_set_return_on_cancel() for more details.\n\nOther than in that case, @task will be completed when the\n#GTaskThreadFunc returns, not when it calls a\n`g_task_return_` function.", sinceVersion = Just "2.36"}}
type C_TaskThreadFunc =
    Ptr Gio.Task.Task ->
    Ptr GObject.Object.Object ->
    Ptr () ->
    Ptr Gio.Cancellable.Cancellable ->
    IO ()

-- Args : [Arg {argCName = "task", argType = TInterface (Name {namespace = "Gio", name = "Task"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GTask", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "source_object", argType = TInterface (Name {namespace = "GObject", name = "Object"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "@task's source object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "task_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "@task's task data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "@task's #GCancellable, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TaskThreadFunc :: FunPtr C_TaskThreadFunc -> C_TaskThreadFunc

dynamic_TaskThreadFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.Task.IsTask a, GObject.Object.IsObject b, Gio.Cancellable.IsCancellable c) =>
    FunPtr C_TaskThreadFunc
    -> a
    {- ^ /@task@/: the 'GI.Gio.Objects.Task.Task' -}
    -> b
    {- ^ /@sourceObject@/: /@task@/\'s source object -}
    -> Ptr ()
    {- ^ /@taskData@/: /@task@/\'s task data -}
    -> Maybe (c)
    {- ^ /@cancellable@/: /@task@/\'s 'GI.Gio.Objects.Cancellable.Cancellable', or 'Nothing' -}
    -> m ()
dynamic_TaskThreadFunc __funPtr task sourceObject taskData cancellable = liftIO $ do
    task' <- unsafeManagedPtrCastPtr task
    sourceObject' <- unsafeManagedPtrCastPtr sourceObject
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    (__dynamic_C_TaskThreadFunc __funPtr) task' sourceObject' taskData maybeCancellable
    touchManagedPtr task
    touchManagedPtr sourceObject
    whenJust cancellable touchManagedPtr
    return ()

foreign import ccall "wrapper"
    mk_TaskThreadFunc :: C_TaskThreadFunc -> IO (FunPtr C_TaskThreadFunc)

type TaskThreadFunc =
    Gio.Task.Task ->
    GObject.Object.Object ->
    Ptr () ->
    Maybe Gio.Cancellable.Cancellable ->
    IO ()

noTaskThreadFunc :: Maybe TaskThreadFunc
noTaskThreadFunc = Nothing

genClosure_TaskThreadFunc :: TaskThreadFunc -> IO Closure
genClosure_TaskThreadFunc cb = do
    let cb' = wrap_TaskThreadFunc Nothing cb
    mk_TaskThreadFunc cb' >>= newCClosure


wrap_TaskThreadFunc ::
    Maybe (Ptr (FunPtr C_TaskThreadFunc)) ->
    TaskThreadFunc ->
    Ptr Gio.Task.Task ->
    Ptr GObject.Object.Object ->
    Ptr () ->
    Ptr Gio.Cancellable.Cancellable ->
    IO ()
wrap_TaskThreadFunc funptrptr _cb task sourceObject taskData cancellable = do
    task' <- (newObject Gio.Task.Task) task
    sourceObject' <- (newObject GObject.Object.Object) sourceObject
    maybeCancellable <-
        if cancellable == nullPtr
        then return Nothing
        else do
            cancellable' <- (newObject Gio.Cancellable.Cancellable) cancellable
            return $ Just cancellable'
    _cb  task' sourceObject' taskData maybeCancellable
    maybeReleaseFunPtr funptrptr


-- callback SocketSourceFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "it should return %FALSE if the source should be removed.", sinceVersion = Nothing}, args = [Arg {argCName = "socket", argType = TInterface (Name {namespace = "Gio", name = "Socket"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GSocket", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "condition", argType = TInterface (Name {namespace = "GLib", name = "IOCondition"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the current condition at the source fired.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data passed in by the user.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "This is the function type of the callback used for the #GSource\nreturned by g_socket_create_source().", sinceVersion = Just "2.22"}}
type C_SocketSourceFunc =
    Ptr Gio.Socket.Socket ->
    CUInt ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "socket", argType = TInterface (Name {namespace = "Gio", name = "Socket"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GSocket", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "condition", argType = TInterface (Name {namespace = "GLib", name = "IOCondition"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the current condition at the source fired.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data passed in by the user.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_SocketSourceFunc :: FunPtr C_SocketSourceFunc -> C_SocketSourceFunc

dynamic_SocketSourceFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.Socket.IsSocket a) =>
    FunPtr C_SocketSourceFunc
    -> a
    {- ^ /@socket@/: the 'GI.Gio.Objects.Socket.Socket' -}
    -> [GLib.Flags.IOCondition]
    {- ^ /@condition@/: the current condition at the source fired. -}
    -> Ptr ()
    {- ^ /@userData@/: data passed in by the user. -}
    -> m Bool
    {- ^ __Returns:__ it should return 'False' if the source should be removed. -}
dynamic_SocketSourceFunc __funPtr socket condition userData = liftIO $ do
    socket' <- unsafeManagedPtrCastPtr socket
    let condition' = gflagsToWord condition
    result <- (__dynamic_C_SocketSourceFunc __funPtr) socket' condition' userData
    let result' = (/= 0) result
    touchManagedPtr socket
    return result'

foreign import ccall "wrapper"
    mk_SocketSourceFunc :: C_SocketSourceFunc -> IO (FunPtr C_SocketSourceFunc)

type SocketSourceFunc =
    Gio.Socket.Socket ->
    [GLib.Flags.IOCondition] ->
    IO Bool

noSocketSourceFunc :: Maybe SocketSourceFunc
noSocketSourceFunc = Nothing

type SocketSourceFunc_WithClosures =
    Gio.Socket.Socket ->
    [GLib.Flags.IOCondition] ->
    Ptr () ->
    IO Bool

noSocketSourceFunc_WithClosures :: Maybe SocketSourceFunc_WithClosures
noSocketSourceFunc_WithClosures = Nothing

drop_closures_SocketSourceFunc :: SocketSourceFunc -> SocketSourceFunc_WithClosures
drop_closures_SocketSourceFunc _f socket condition _ = _f socket condition

genClosure_SocketSourceFunc :: SocketSourceFunc -> IO Closure
genClosure_SocketSourceFunc cb = do
    let cb' = drop_closures_SocketSourceFunc cb
    let cb'' = wrap_SocketSourceFunc Nothing cb'
    mk_SocketSourceFunc cb'' >>= newCClosure


wrap_SocketSourceFunc ::
    Maybe (Ptr (FunPtr C_SocketSourceFunc)) ->
    SocketSourceFunc_WithClosures ->
    Ptr Gio.Socket.Socket ->
    CUInt ->
    Ptr () ->
    IO CInt
wrap_SocketSourceFunc funptrptr _cb socket condition userData = do
    socket' <- (newObject Gio.Socket.Socket) socket
    let condition' = wordToGFlags condition
    result <- _cb  socket' condition' userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback SimpleAsyncThreadFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "res", argType = TInterface (Name {namespace = "Gio", name = "SimpleAsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSimpleAsyncResult.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object", argType = TInterface (Name {namespace = "GObject", name = "Object"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GObject.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional #GCancellable object, %NULL to ignore.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Simple thread function that runs an asynchronous operation and\nchecks for cancellation.", sinceVersion = Nothing}}
type C_SimpleAsyncThreadFunc =
    Ptr Gio.SimpleAsyncResult.SimpleAsyncResult ->
    Ptr GObject.Object.Object ->
    Ptr Gio.Cancellable.Cancellable ->
    IO ()

-- Args : [Arg {argCName = "res", argType = TInterface (Name {namespace = "Gio", name = "SimpleAsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSimpleAsyncResult.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object", argType = TInterface (Name {namespace = "GObject", name = "Object"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GObject.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional #GCancellable object, %NULL to ignore.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_SimpleAsyncThreadFunc :: FunPtr C_SimpleAsyncThreadFunc -> C_SimpleAsyncThreadFunc

dynamic_SimpleAsyncThreadFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.SimpleAsyncResult.IsSimpleAsyncResult a, GObject.Object.IsObject b, Gio.Cancellable.IsCancellable c) =>
    FunPtr C_SimpleAsyncThreadFunc
    -> a
    {- ^ /@res@/: a 'GI.Gio.Objects.SimpleAsyncResult.SimpleAsyncResult'. -}
    -> b
    {- ^ /@object@/: a 'GI.GObject.Objects.Object.Object'. -}
    -> Maybe (c)
    {- ^ /@cancellable@/: optional 'GI.Gio.Objects.Cancellable.Cancellable' object, 'Nothing' to ignore. -}
    -> m ()
dynamic_SimpleAsyncThreadFunc __funPtr res object cancellable = liftIO $ do
    res' <- unsafeManagedPtrCastPtr res
    object' <- unsafeManagedPtrCastPtr object
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    (__dynamic_C_SimpleAsyncThreadFunc __funPtr) res' object' maybeCancellable
    touchManagedPtr res
    touchManagedPtr object
    whenJust cancellable touchManagedPtr
    return ()

foreign import ccall "wrapper"
    mk_SimpleAsyncThreadFunc :: C_SimpleAsyncThreadFunc -> IO (FunPtr C_SimpleAsyncThreadFunc)

type SimpleAsyncThreadFunc =
    Gio.SimpleAsyncResult.SimpleAsyncResult ->
    GObject.Object.Object ->
    Maybe Gio.Cancellable.Cancellable ->
    IO ()

noSimpleAsyncThreadFunc :: Maybe SimpleAsyncThreadFunc
noSimpleAsyncThreadFunc = Nothing

genClosure_SimpleAsyncThreadFunc :: SimpleAsyncThreadFunc -> IO Closure
genClosure_SimpleAsyncThreadFunc cb = do
    let cb' = wrap_SimpleAsyncThreadFunc Nothing cb
    mk_SimpleAsyncThreadFunc cb' >>= newCClosure


wrap_SimpleAsyncThreadFunc ::
    Maybe (Ptr (FunPtr C_SimpleAsyncThreadFunc)) ->
    SimpleAsyncThreadFunc ->
    Ptr Gio.SimpleAsyncResult.SimpleAsyncResult ->
    Ptr GObject.Object.Object ->
    Ptr Gio.Cancellable.Cancellable ->
    IO ()
wrap_SimpleAsyncThreadFunc funptrptr _cb res object cancellable = do
    res' <- (newObject Gio.SimpleAsyncResult.SimpleAsyncResult) res
    object' <- (newObject GObject.Object.Object) object
    maybeCancellable <-
        if cancellable == nullPtr
        then return Nothing
        else do
            cancellable' <- (newObject Gio.Cancellable.Cancellable) cancellable
            return $ Just cancellable'
    _cb  res' object' maybeCancellable
    maybeReleaseFunPtr funptrptr


-- callback SettingsGetMapping
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if the conversion succeeded, %FALSE in case of an error", sinceVersion = Nothing}, args = [Arg {argCName = "value", argType = TVariant, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GVariant to map, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TBasicType TPtr, direction = DirectionOut, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the result of the mapping", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the user data that was passed to\ng_settings_get_mapped()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The type of the function that is used to convert from a value stored\nin a #GSettings to a value that is useful to the application.\n\nIf the value is successfully mapped, the result should be stored at\n@result and %TRUE returned.  If mapping fails (for example, if @value\nis not in the right format) then %FALSE should be returned.\n\nIf @value is %NULL then it means that the mapping function is being\ngiven a \"last chance\" to successfully return a valid value.  %TRUE\nmust be returned in this case.", sinceVersion = Nothing}}
type C_SettingsGetMapping =
    Ptr GVariant ->
    Ptr (Ptr ()) ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "value", argType = TVariant, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GVariant to map, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TBasicType TPtr, direction = DirectionOut, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the result of the mapping", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the user data that was passed to\ng_settings_get_mapped()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_SettingsGetMapping :: FunPtr C_SettingsGetMapping -> C_SettingsGetMapping

dynamic_SettingsGetMapping ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SettingsGetMapping
    -> GVariant
    {- ^ /@value@/: the 'GVariant' to map, or 'Nothing' -}
    -> Ptr ()
    {- ^ /@userData@/: the user data that was passed to
'GI.Gio.Objects.Settings.settingsGetMapped' -}
    -> m (Bool,(Ptr ()))
    {- ^ __Returns:__ 'True' if the conversion succeeded, 'False' in case of an error -}
dynamic_SettingsGetMapping __funPtr value userData = liftIO $ do
    value' <- unsafeManagedPtrGetPtr value
    result_ <- allocMem :: IO (Ptr (Ptr ()))
    result <- (__dynamic_C_SettingsGetMapping __funPtr) value' result_ userData
    let result' = (/= 0) result
    result_' <- peek result_
    touchManagedPtr value
    freeMem result_
    return (result', result_')

foreign import ccall "wrapper"
    mk_SettingsGetMapping :: C_SettingsGetMapping -> IO (FunPtr C_SettingsGetMapping)

type SettingsGetMapping =
    GVariant ->
    IO (Bool,(Ptr ()))

noSettingsGetMapping :: Maybe SettingsGetMapping
noSettingsGetMapping = Nothing

type SettingsGetMapping_WithClosures =
    GVariant ->
    Ptr () ->
    IO (Bool,(Ptr ()))

noSettingsGetMapping_WithClosures :: Maybe SettingsGetMapping_WithClosures
noSettingsGetMapping_WithClosures = Nothing

drop_closures_SettingsGetMapping :: SettingsGetMapping -> SettingsGetMapping_WithClosures
drop_closures_SettingsGetMapping _f value _ = _f value

genClosure_SettingsGetMapping :: SettingsGetMapping -> IO Closure
genClosure_SettingsGetMapping cb = do
    let cb' = drop_closures_SettingsGetMapping cb
    let cb'' = wrap_SettingsGetMapping Nothing cb'
    mk_SettingsGetMapping cb'' >>= newCClosure


wrap_SettingsGetMapping ::
    Maybe (Ptr (FunPtr C_SettingsGetMapping)) ->
    SettingsGetMapping_WithClosures ->
    Ptr GVariant ->
    Ptr (Ptr ()) ->
    Ptr () ->
    IO CInt
wrap_SettingsGetMapping funptrptr _cb value result_ userData = do
    value' <- newGVariantFromPtr value
    (result, outresult_) <- _cb  value' userData
    poke result_ outresult_
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback SettingsBindSetMapping
--          -> Callable {returnType = Just TVariant, returnMayBeNull = False, returnTransfer = TransferEverything, returnDocumentation = Documentation {rawDocText = Just "a new #GVariant holding the data from @value,\n    or %NULL in case of an error", sinceVersion = Nothing}, args = [Arg {argCName = "value", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GValue containing the property value to map", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "expected_type", argType = TInterface (Name {namespace = "GLib", name = "VariantType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GVariantType to create", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data that was specified when the binding was created", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The type for the function that is used to convert an object property\nvalue to a #GVariant for storing it in #GSettings.", sinceVersion = Nothing}}
type C_SettingsBindSetMapping =
    Ptr GValue ->
    Ptr GLib.VariantType.VariantType ->
    Ptr () ->
    IO (Ptr GVariant)

-- Args : [Arg {argCName = "value", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GValue containing the property value to map", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "expected_type", argType = TInterface (Name {namespace = "GLib", name = "VariantType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GVariantType to create", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data that was specified when the binding was created", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just TVariant
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_SettingsBindSetMapping :: FunPtr C_SettingsBindSetMapping -> C_SettingsBindSetMapping

dynamic_SettingsBindSetMapping ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SettingsBindSetMapping
    -> GValue
    {- ^ /@value@/: a 'GI.GObject.Structs.Value.Value' containing the property value to map -}
    -> GLib.VariantType.VariantType
    {- ^ /@expectedType@/: the 'GI.GLib.Structs.VariantType.VariantType' to create -}
    -> Ptr ()
    {- ^ /@userData@/: user data that was specified when the binding was created -}
    -> m GVariant
    {- ^ __Returns:__ a new 'GVariant' holding the data from /@value@/,
    or 'Nothing' in case of an error -}
dynamic_SettingsBindSetMapping __funPtr value expectedType userData = liftIO $ do
    value' <- unsafeManagedPtrGetPtr value
    expectedType' <- unsafeManagedPtrGetPtr expectedType
    result <- (__dynamic_C_SettingsBindSetMapping __funPtr) value' expectedType' userData
    checkUnexpectedReturnNULL "settingsBindSetMapping" result
    result' <- wrapGVariantPtr result
    touchManagedPtr value
    touchManagedPtr expectedType
    return result'

foreign import ccall "wrapper"
    mk_SettingsBindSetMapping :: C_SettingsBindSetMapping -> IO (FunPtr C_SettingsBindSetMapping)

type SettingsBindSetMapping =
    GValue ->
    GLib.VariantType.VariantType ->
    IO GVariant

noSettingsBindSetMapping :: Maybe SettingsBindSetMapping
noSettingsBindSetMapping = Nothing

type SettingsBindSetMapping_WithClosures =
    GValue ->
    GLib.VariantType.VariantType ->
    Ptr () ->
    IO GVariant

noSettingsBindSetMapping_WithClosures :: Maybe SettingsBindSetMapping_WithClosures
noSettingsBindSetMapping_WithClosures = Nothing

drop_closures_SettingsBindSetMapping :: SettingsBindSetMapping -> SettingsBindSetMapping_WithClosures
drop_closures_SettingsBindSetMapping _f value expectedType _ = _f value expectedType

genClosure_SettingsBindSetMapping :: SettingsBindSetMapping -> IO Closure
genClosure_SettingsBindSetMapping cb = do
    let cb' = drop_closures_SettingsBindSetMapping cb
    let cb'' = wrap_SettingsBindSetMapping Nothing cb'
    mk_SettingsBindSetMapping cb'' >>= newCClosure


wrap_SettingsBindSetMapping ::
    Maybe (Ptr (FunPtr C_SettingsBindSetMapping)) ->
    SettingsBindSetMapping_WithClosures ->
    Ptr GValue ->
    Ptr GLib.VariantType.VariantType ->
    Ptr () ->
    IO (Ptr GVariant)
wrap_SettingsBindSetMapping funptrptr _cb value expectedType userData = do
    value' <- (newBoxed GValue) value
    expectedType' <- (newBoxed GLib.VariantType.VariantType) expectedType
    result <- _cb  value' expectedType' userData
    maybeReleaseFunPtr funptrptr
    result' <- B.GVariant.disownGVariant result
    return result'


-- callback SettingsBindGetMapping
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if the conversion succeeded, %FALSE in case of an error", sinceVersion = Nothing}, args = [Arg {argCName = "value", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for the property value", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "variant", argType = TVariant, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GVariant", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data that was specified when the binding was created", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The type for the function that is used to convert from #GSettings to\nan object property. The @value is already initialized to hold values\nof the appropriate type.", sinceVersion = Nothing}}
type C_SettingsBindGetMapping =
    Ptr GValue ->
    Ptr GVariant ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "value", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for the property value", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "variant", argType = TVariant, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GVariant", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data that was specified when the binding was created", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_SettingsBindGetMapping :: FunPtr C_SettingsBindGetMapping -> C_SettingsBindGetMapping

dynamic_SettingsBindGetMapping ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SettingsBindGetMapping
    -> GValue
    {- ^ /@value@/: return location for the property value -}
    -> GVariant
    {- ^ /@variant@/: the 'GVariant' -}
    -> Ptr ()
    {- ^ /@userData@/: user data that was specified when the binding was created -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the conversion succeeded, 'False' in case of an error -}
dynamic_SettingsBindGetMapping __funPtr value variant userData = liftIO $ do
    value' <- unsafeManagedPtrGetPtr value
    variant' <- unsafeManagedPtrGetPtr variant
    result <- (__dynamic_C_SettingsBindGetMapping __funPtr) value' variant' userData
    let result' = (/= 0) result
    touchManagedPtr value
    touchManagedPtr variant
    return result'

foreign import ccall "wrapper"
    mk_SettingsBindGetMapping :: C_SettingsBindGetMapping -> IO (FunPtr C_SettingsBindGetMapping)

type SettingsBindGetMapping =
    GValue ->
    GVariant ->
    IO Bool

noSettingsBindGetMapping :: Maybe SettingsBindGetMapping
noSettingsBindGetMapping = Nothing

type SettingsBindGetMapping_WithClosures =
    GValue ->
    GVariant ->
    Ptr () ->
    IO Bool

noSettingsBindGetMapping_WithClosures :: Maybe SettingsBindGetMapping_WithClosures
noSettingsBindGetMapping_WithClosures = Nothing

drop_closures_SettingsBindGetMapping :: SettingsBindGetMapping -> SettingsBindGetMapping_WithClosures
drop_closures_SettingsBindGetMapping _f value variant _ = _f value variant

genClosure_SettingsBindGetMapping :: SettingsBindGetMapping -> IO Closure
genClosure_SettingsBindGetMapping cb = do
    let cb' = drop_closures_SettingsBindGetMapping cb
    let cb'' = wrap_SettingsBindGetMapping Nothing cb'
    mk_SettingsBindGetMapping cb'' >>= newCClosure


wrap_SettingsBindGetMapping ::
    Maybe (Ptr (FunPtr C_SettingsBindGetMapping)) ->
    SettingsBindGetMapping_WithClosures ->
    Ptr GValue ->
    Ptr GVariant ->
    Ptr () ->
    IO CInt
wrap_SettingsBindGetMapping funptrptr _cb value variant userData = do
    value' <- (newBoxed GValue) value
    variant' <- newGVariantFromPtr variant
    result <- _cb  value' variant' userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback ReallocFunc
--          -> Callable {returnType = Just (TBasicType TPtr), returnMayBeNull = True, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "a pointer to the reallocated memory", sinceVersion = Nothing}, args = [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "memory block to reallocate", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "size", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "size to reallocate @data to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Changes the size of the memory block pointed to by @data to\n@size bytes.\n\nThe function should have the same semantics as realloc().", sinceVersion = Nothing}}
type C_ReallocFunc =
    Ptr () ->
    Word64 ->
    IO (Ptr ())

-- Args : [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "memory block to reallocate", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "size", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "size to reallocate @data to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TPtr)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_ReallocFunc :: FunPtr C_ReallocFunc -> C_ReallocFunc

dynamic_ReallocFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_ReallocFunc
    -> Ptr ()
    {- ^ /@data@/: memory block to reallocate -}
    -> Word64
    {- ^ /@size@/: size to reallocate /@data@/ to -}
    -> m (Ptr ())
    {- ^ __Returns:__ a pointer to the reallocated memory -}
dynamic_ReallocFunc __funPtr data_ size = liftIO $ do
    result <- (__dynamic_C_ReallocFunc __funPtr) data_ size
    return result

foreign import ccall "wrapper"
    mk_ReallocFunc :: C_ReallocFunc -> IO (FunPtr C_ReallocFunc)

type ReallocFunc =
    Ptr () ->
    Word64 ->
    IO (Ptr ())

noReallocFunc :: Maybe ReallocFunc
noReallocFunc = Nothing

genClosure_ReallocFunc :: ReallocFunc -> IO Closure
genClosure_ReallocFunc cb = do
    let cb' = wrap_ReallocFunc Nothing cb
    mk_ReallocFunc cb' >>= newCClosure


wrap_ReallocFunc ::
    Maybe (Ptr (FunPtr C_ReallocFunc)) ->
    ReallocFunc ->
    Ptr () ->
    Word64 ->
    IO (Ptr ())
wrap_ReallocFunc funptrptr _cb data_ size = do
    result <- _cb  data_ size
    maybeReleaseFunPtr funptrptr
    return result


-- callback PollableSourceFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "it should return %FALSE if the source should be removed.", sinceVersion = Nothing}, args = [Arg {argCName = "pollable_stream", argType = TInterface (Name {namespace = "GObject", name = "Object"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GPollableInputStream or #GPollableOutputStream", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data passed in by the user.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "This is the function type of the callback used for the #GSource\nreturned by g_pollable_input_stream_create_source() and\ng_pollable_output_stream_create_source().", sinceVersion = Just "2.28"}}
type C_PollableSourceFunc =
    Ptr GObject.Object.Object ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "pollable_stream", argType = TInterface (Name {namespace = "GObject", name = "Object"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GPollableInputStream or #GPollableOutputStream", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data passed in by the user.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PollableSourceFunc :: FunPtr C_PollableSourceFunc -> C_PollableSourceFunc

dynamic_PollableSourceFunc ::
    (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) =>
    FunPtr C_PollableSourceFunc
    -> a
    {- ^ /@pollableStream@/: the 'GI.Gio.Interfaces.PollableInputStream.PollableInputStream' or 'GI.Gio.Interfaces.PollableOutputStream.PollableOutputStream' -}
    -> Ptr ()
    {- ^ /@userData@/: data passed in by the user. -}
    -> m Bool
    {- ^ __Returns:__ it should return 'False' if the source should be removed. -}
dynamic_PollableSourceFunc __funPtr pollableStream userData = liftIO $ do
    pollableStream' <- unsafeManagedPtrCastPtr pollableStream
    result <- (__dynamic_C_PollableSourceFunc __funPtr) pollableStream' userData
    let result' = (/= 0) result
    touchManagedPtr pollableStream
    return result'

foreign import ccall "wrapper"
    mk_PollableSourceFunc :: C_PollableSourceFunc -> IO (FunPtr C_PollableSourceFunc)

type PollableSourceFunc =
    GObject.Object.Object ->
    IO Bool

noPollableSourceFunc :: Maybe PollableSourceFunc
noPollableSourceFunc = Nothing

type PollableSourceFunc_WithClosures =
    GObject.Object.Object ->
    Ptr () ->
    IO Bool

noPollableSourceFunc_WithClosures :: Maybe PollableSourceFunc_WithClosures
noPollableSourceFunc_WithClosures = Nothing

drop_closures_PollableSourceFunc :: PollableSourceFunc -> PollableSourceFunc_WithClosures
drop_closures_PollableSourceFunc _f pollableStream _ = _f pollableStream

genClosure_PollableSourceFunc :: PollableSourceFunc -> IO Closure
genClosure_PollableSourceFunc cb = do
    let cb' = drop_closures_PollableSourceFunc cb
    let cb'' = wrap_PollableSourceFunc Nothing cb'
    mk_PollableSourceFunc cb'' >>= newCClosure


wrap_PollableSourceFunc ::
    Maybe (Ptr (FunPtr C_PollableSourceFunc)) ->
    PollableSourceFunc_WithClosures ->
    Ptr GObject.Object.Object ->
    Ptr () ->
    IO CInt
wrap_PollableSourceFunc funptrptr _cb pollableStream userData = do
    pollableStream' <- (newObject GObject.Object.Object) pollableStream
    result <- _cb  pollableStream' userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback IOSchedulerJobFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if this function should be called again to\n   complete the job, %FALSE if the job is complete (or cancelled)", sinceVersion = Nothing}, args = [Arg {argCName = "job", argType = TInterface (Name {namespace = "Gio", name = "IOSchedulerJob"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GIOSchedulerJob.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional #GCancellable object, %NULL to ignore.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the data to pass to callback function", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "I/O Job function.\n\nLong-running jobs should periodically check the @cancellable\nto see if they have been cancelled.", sinceVersion = Nothing}}
type C_IOSchedulerJobFunc =
    Ptr Gio.IOSchedulerJob.IOSchedulerJob ->
    Ptr Gio.Cancellable.Cancellable ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "job", argType = TInterface (Name {namespace = "Gio", name = "IOSchedulerJob"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GIOSchedulerJob.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional #GCancellable object, %NULL to ignore.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the data to pass to callback function", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_IOSchedulerJobFunc :: FunPtr C_IOSchedulerJobFunc -> C_IOSchedulerJobFunc

dynamic_IOSchedulerJobFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
    FunPtr C_IOSchedulerJobFunc
    -> Gio.IOSchedulerJob.IOSchedulerJob
    {- ^ /@job@/: a 'GI.Gio.Structs.IOSchedulerJob.IOSchedulerJob'. -}
    -> Maybe (a)
    {- ^ /@cancellable@/: optional 'GI.Gio.Objects.Cancellable.Cancellable' object, 'Nothing' to ignore. -}
    -> Ptr ()
    {- ^ /@userData@/: the data to pass to callback function -}
    -> m Bool
    {- ^ __Returns:__ 'True' if this function should be called again to
   complete the job, 'False' if the job is complete (or cancelled) -}
dynamic_IOSchedulerJobFunc __funPtr job cancellable userData = liftIO $ do
    job' <- unsafeManagedPtrGetPtr job
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    result <- (__dynamic_C_IOSchedulerJobFunc __funPtr) job' maybeCancellable userData
    let result' = (/= 0) result
    touchManagedPtr job
    whenJust cancellable touchManagedPtr
    return result'

foreign import ccall "wrapper"
    mk_IOSchedulerJobFunc :: C_IOSchedulerJobFunc -> IO (FunPtr C_IOSchedulerJobFunc)

type IOSchedulerJobFunc =
    Gio.IOSchedulerJob.IOSchedulerJob ->
    Maybe Gio.Cancellable.Cancellable ->
    IO Bool

noIOSchedulerJobFunc :: Maybe IOSchedulerJobFunc
noIOSchedulerJobFunc = Nothing

type IOSchedulerJobFunc_WithClosures =
    Gio.IOSchedulerJob.IOSchedulerJob ->
    Maybe Gio.Cancellable.Cancellable ->
    Ptr () ->
    IO Bool

noIOSchedulerJobFunc_WithClosures :: Maybe IOSchedulerJobFunc_WithClosures
noIOSchedulerJobFunc_WithClosures = Nothing

drop_closures_IOSchedulerJobFunc :: IOSchedulerJobFunc -> IOSchedulerJobFunc_WithClosures
drop_closures_IOSchedulerJobFunc _f job cancellable _ = _f job cancellable

genClosure_IOSchedulerJobFunc :: IOSchedulerJobFunc -> IO Closure
genClosure_IOSchedulerJobFunc cb = do
    let cb' = drop_closures_IOSchedulerJobFunc cb
    let cb'' = wrap_IOSchedulerJobFunc Nothing cb'
    mk_IOSchedulerJobFunc cb'' >>= newCClosure


wrap_IOSchedulerJobFunc ::
    Maybe (Ptr (FunPtr C_IOSchedulerJobFunc)) ->
    IOSchedulerJobFunc_WithClosures ->
    Ptr Gio.IOSchedulerJob.IOSchedulerJob ->
    Ptr Gio.Cancellable.Cancellable ->
    Ptr () ->
    IO CInt
wrap_IOSchedulerJobFunc funptrptr _cb job cancellable userData = do
    job' <- (newPtr Gio.IOSchedulerJob.IOSchedulerJob) job
    maybeCancellable <-
        if cancellable == nullPtr
        then return Nothing
        else do
            cancellable' <- (newObject Gio.Cancellable.Cancellable) cancellable
            return $ Just cancellable'
    result <- _cb  job' maybeCancellable userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback FileReadMoreCallback
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if more data should be read back. %FALSE otherwise.", sinceVersion = Nothing}, args = [Arg {argCName = "file_contents", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the data as currently read.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "file_size", argType = TBasicType TInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the size of the data currently read.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data passed to the callback.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "When loading the partial contents of a file with g_file_load_partial_contents_async(),\nit may become necessary to determine if any more data from the file should be loaded.\nA #GFileReadMoreCallback function facilitates this by returning %TRUE if more data\nshould be read, or %FALSE otherwise.", sinceVersion = Nothing}}
type C_FileReadMoreCallback =
    CString ->
    Int64 ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "file_contents", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the data as currently read.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "file_size", argType = TBasicType TInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the size of the data currently read.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data passed to the callback.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FileReadMoreCallback :: FunPtr C_FileReadMoreCallback -> C_FileReadMoreCallback

dynamic_FileReadMoreCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_FileReadMoreCallback
    -> T.Text
    {- ^ /@fileContents@/: the data as currently read. -}
    -> Int64
    {- ^ /@fileSize@/: the size of the data currently read. -}
    -> Ptr ()
    {- ^ /@callbackData@/: data passed to the callback. -}
    -> m Bool
    {- ^ __Returns:__ 'True' if more data should be read back. 'False' otherwise. -}
dynamic_FileReadMoreCallback __funPtr fileContents fileSize callbackData = liftIO $ do
    fileContents' <- textToCString fileContents
    result <- (__dynamic_C_FileReadMoreCallback __funPtr) fileContents' fileSize callbackData
    let result' = (/= 0) result
    freeMem fileContents'
    return result'

foreign import ccall "wrapper"
    mk_FileReadMoreCallback :: C_FileReadMoreCallback -> IO (FunPtr C_FileReadMoreCallback)

type FileReadMoreCallback =
    T.Text ->
    Int64 ->
    Ptr () ->
    IO Bool

noFileReadMoreCallback :: Maybe FileReadMoreCallback
noFileReadMoreCallback = Nothing

genClosure_FileReadMoreCallback :: FileReadMoreCallback -> IO Closure
genClosure_FileReadMoreCallback cb = do
    let cb' = wrap_FileReadMoreCallback Nothing cb
    mk_FileReadMoreCallback cb' >>= newCClosure


wrap_FileReadMoreCallback ::
    Maybe (Ptr (FunPtr C_FileReadMoreCallback)) ->
    FileReadMoreCallback ->
    CString ->
    Int64 ->
    Ptr () ->
    IO CInt
wrap_FileReadMoreCallback funptrptr _cb fileContents fileSize callbackData = do
    fileContents' <- cstringToText fileContents
    result <- _cb  fileContents' fileSize callbackData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback FileProgressCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "current_num_bytes", argType = TBasicType TInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the current number of bytes in the operation.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "total_num_bytes", argType = TBasicType TInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the total number of bytes in the operation.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to the callback.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "When doing file operations that may take a while, such as moving\na file or copying a file, a progress callback is used to pass how\nfar along that operation is to the application.", sinceVersion = Nothing}}
type C_FileProgressCallback =
    Int64 ->
    Int64 ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "current_num_bytes", argType = TBasicType TInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the current number of bytes in the operation.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "total_num_bytes", argType = TBasicType TInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the total number of bytes in the operation.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to the callback.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FileProgressCallback :: FunPtr C_FileProgressCallback -> C_FileProgressCallback

dynamic_FileProgressCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_FileProgressCallback
    -> Int64
    {- ^ /@currentNumBytes@/: the current number of bytes in the operation. -}
    -> Int64
    {- ^ /@totalNumBytes@/: the total number of bytes in the operation. -}
    -> Ptr ()
    {- ^ /@userData@/: user data passed to the callback. -}
    -> m ()
dynamic_FileProgressCallback __funPtr currentNumBytes totalNumBytes userData = liftIO $ do
    (__dynamic_C_FileProgressCallback __funPtr) currentNumBytes totalNumBytes userData
    return ()

foreign import ccall "wrapper"
    mk_FileProgressCallback :: C_FileProgressCallback -> IO (FunPtr C_FileProgressCallback)

type FileProgressCallback =
    Int64 ->
    Int64 ->
    IO ()

noFileProgressCallback :: Maybe FileProgressCallback
noFileProgressCallback = Nothing

type FileProgressCallback_WithClosures =
    Int64 ->
    Int64 ->
    Ptr () ->
    IO ()

noFileProgressCallback_WithClosures :: Maybe FileProgressCallback_WithClosures
noFileProgressCallback_WithClosures = Nothing

drop_closures_FileProgressCallback :: FileProgressCallback -> FileProgressCallback_WithClosures
drop_closures_FileProgressCallback _f currentNumBytes totalNumBytes _ = _f currentNumBytes totalNumBytes

genClosure_FileProgressCallback :: FileProgressCallback -> IO Closure
genClosure_FileProgressCallback cb = do
    let cb' = drop_closures_FileProgressCallback cb
    let cb'' = wrap_FileProgressCallback Nothing cb'
    mk_FileProgressCallback cb'' >>= newCClosure


wrap_FileProgressCallback ::
    Maybe (Ptr (FunPtr C_FileProgressCallback)) ->
    FileProgressCallback_WithClosures ->
    Int64 ->
    Int64 ->
    Ptr () ->
    IO ()
wrap_FileProgressCallback funptrptr _cb currentNumBytes totalNumBytes userData = do
    _cb  currentNumBytes totalNumBytes userData
    maybeReleaseFunPtr funptrptr


-- callback FileMeasureProgressCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "reporting", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE if more reports will come", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "current_size", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the current cumulative size measurement", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "num_dirs", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the number of directories visited so far", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "num_files", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the number of non-directory files encountered", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the data passed to the original request for this callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 4, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "This callback type is used by g_file_measure_disk_usage() to make\nperiodic progress reports when measuring the amount of disk spaced\nused by a directory.\n\nThese calls are made on a best-effort basis and not all types of\n#GFile will support them.  At the minimum, however, one call will\nalways be made immediately.\n\nIn the case that there is no support, @reporting will be set to\n%FALSE (and the other values undefined) and no further calls will be\nmade.  Otherwise, the @reporting will be %TRUE and the other values\nall-zeros during the first (immediate) call.  In this way, you can\nknow which type of progress UI to show without a delay.\n\nFor g_file_measure_disk_usage() the callback is made directly.  For\ng_file_measure_disk_usage_async() the callback is made via the\ndefault main context of the calling thread (ie: the same way that the\nfinal async result would be reported).\n\n@current_size is in the same units as requested by the operation (see\n%G_FILE_DISK_USAGE_APPARENT_SIZE).\n\nThe frequency of the updates is implementation defined, but is\nideally about once every 200ms.\n\nThe last progress callback may or may not be equal to the final\nresult.  Always check the async result to get the final value.", sinceVersion = Just "2.38"}}
type C_FileMeasureProgressCallback =
    CInt ->
    Word64 ->
    Word64 ->
    Word64 ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "reporting", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE if more reports will come", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "current_size", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the current cumulative size measurement", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "num_dirs", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the number of directories visited so far", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "num_files", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the number of non-directory files encountered", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the data passed to the original request for this callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 4, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FileMeasureProgressCallback :: FunPtr C_FileMeasureProgressCallback -> C_FileMeasureProgressCallback

dynamic_FileMeasureProgressCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_FileMeasureProgressCallback
    -> Bool
    {- ^ /@reporting@/: 'True' if more reports will come -}
    -> Word64
    {- ^ /@currentSize@/: the current cumulative size measurement -}
    -> Word64
    {- ^ /@numDirs@/: the number of directories visited so far -}
    -> Word64
    {- ^ /@numFiles@/: the number of non-directory files encountered -}
    -> Ptr ()
    {- ^ /@userData@/: the data passed to the original request for this callback -}
    -> m ()
dynamic_FileMeasureProgressCallback __funPtr reporting currentSize numDirs numFiles userData = liftIO $ do
    let reporting' = (fromIntegral . fromEnum) reporting
    (__dynamic_C_FileMeasureProgressCallback __funPtr) reporting' currentSize numDirs numFiles userData
    return ()

foreign import ccall "wrapper"
    mk_FileMeasureProgressCallback :: C_FileMeasureProgressCallback -> IO (FunPtr C_FileMeasureProgressCallback)

type FileMeasureProgressCallback =
    Bool ->
    Word64 ->
    Word64 ->
    Word64 ->
    IO ()

noFileMeasureProgressCallback :: Maybe FileMeasureProgressCallback
noFileMeasureProgressCallback = Nothing

type FileMeasureProgressCallback_WithClosures =
    Bool ->
    Word64 ->
    Word64 ->
    Word64 ->
    Ptr () ->
    IO ()

noFileMeasureProgressCallback_WithClosures :: Maybe FileMeasureProgressCallback_WithClosures
noFileMeasureProgressCallback_WithClosures = Nothing

drop_closures_FileMeasureProgressCallback :: FileMeasureProgressCallback -> FileMeasureProgressCallback_WithClosures
drop_closures_FileMeasureProgressCallback _f reporting currentSize numDirs numFiles _ = _f reporting currentSize numDirs numFiles

genClosure_FileMeasureProgressCallback :: FileMeasureProgressCallback -> IO Closure
genClosure_FileMeasureProgressCallback cb = do
    let cb' = drop_closures_FileMeasureProgressCallback cb
    let cb'' = wrap_FileMeasureProgressCallback Nothing cb'
    mk_FileMeasureProgressCallback cb'' >>= newCClosure


wrap_FileMeasureProgressCallback ::
    Maybe (Ptr (FunPtr C_FileMeasureProgressCallback)) ->
    FileMeasureProgressCallback_WithClosures ->
    CInt ->
    Word64 ->
    Word64 ->
    Word64 ->
    Ptr () ->
    IO ()
wrap_FileMeasureProgressCallback funptrptr _cb reporting currentSize numDirs numFiles userData = do
    let reporting' = (/= 0) reporting
    _cb  reporting' currentSize numDirs numFiles userData
    maybeReleaseFunPtr funptrptr


-- callback DesktopAppLaunchCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "appinfo", argType = TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDesktopAppInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "pid", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Process identifier", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "During invocation, g_desktop_app_info_launch_uris_as_manager() may\ncreate one or more child processes.  This callback is invoked once\nfor each, providing the process ID.", sinceVersion = Nothing}}
type C_DesktopAppLaunchCallback =
    Ptr Gio.DesktopAppInfo.DesktopAppInfo ->
    Int32 ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "appinfo", argType = TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDesktopAppInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "pid", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Process identifier", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_DesktopAppLaunchCallback :: FunPtr C_DesktopAppLaunchCallback -> C_DesktopAppLaunchCallback

dynamic_DesktopAppLaunchCallback ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.DesktopAppInfo.IsDesktopAppInfo a) =>
    FunPtr C_DesktopAppLaunchCallback
    -> a
    {- ^ /@appinfo@/: a 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' -}
    -> Int32
    {- ^ /@pid@/: Process identifier -}
    -> Ptr ()
    {- ^ /@userData@/: User data -}
    -> m ()
dynamic_DesktopAppLaunchCallback __funPtr appinfo pid userData = liftIO $ do
    appinfo' <- unsafeManagedPtrCastPtr appinfo
    (__dynamic_C_DesktopAppLaunchCallback __funPtr) appinfo' pid userData
    touchManagedPtr appinfo
    return ()

foreign import ccall "wrapper"
    mk_DesktopAppLaunchCallback :: C_DesktopAppLaunchCallback -> IO (FunPtr C_DesktopAppLaunchCallback)

type DesktopAppLaunchCallback =
    Gio.DesktopAppInfo.DesktopAppInfo ->
    Int32 ->
    IO ()

noDesktopAppLaunchCallback :: Maybe DesktopAppLaunchCallback
noDesktopAppLaunchCallback = Nothing

type DesktopAppLaunchCallback_WithClosures =
    Gio.DesktopAppInfo.DesktopAppInfo ->
    Int32 ->
    Ptr () ->
    IO ()

noDesktopAppLaunchCallback_WithClosures :: Maybe DesktopAppLaunchCallback_WithClosures
noDesktopAppLaunchCallback_WithClosures = Nothing

drop_closures_DesktopAppLaunchCallback :: DesktopAppLaunchCallback -> DesktopAppLaunchCallback_WithClosures
drop_closures_DesktopAppLaunchCallback _f appinfo pid _ = _f appinfo pid

genClosure_DesktopAppLaunchCallback :: DesktopAppLaunchCallback -> IO Closure
genClosure_DesktopAppLaunchCallback cb = do
    let cb' = drop_closures_DesktopAppLaunchCallback cb
    let cb'' = wrap_DesktopAppLaunchCallback Nothing cb'
    mk_DesktopAppLaunchCallback cb'' >>= newCClosure


wrap_DesktopAppLaunchCallback ::
    Maybe (Ptr (FunPtr C_DesktopAppLaunchCallback)) ->
    DesktopAppLaunchCallback_WithClosures ->
    Ptr Gio.DesktopAppInfo.DesktopAppInfo ->
    Int32 ->
    Ptr () ->
    IO ()
wrap_DesktopAppLaunchCallback funptrptr _cb appinfo pid userData = do
    appinfo' <- (newObject Gio.DesktopAppInfo.DesktopAppInfo) appinfo
    _cb  appinfo' pid userData
    maybeReleaseFunPtr funptrptr


-- callback DatagramBasedSourceFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%G_SOURCE_REMOVE if the source should be removed,\n  %G_SOURCE_CONTINUE otherwise", sinceVersion = Nothing}, args = [Arg {argCName = "datagram_based", argType = TInterface (Name {namespace = "Gio", name = "DatagramBased"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GDatagramBased", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "condition", argType = TInterface (Name {namespace = "GLib", name = "IOCondition"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the current condition at the source fired", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data passed in by the user", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "This is the function type of the callback used for the #GSource\nreturned by g_datagram_based_create_source().", sinceVersion = Just "2.48"}}
type C_DatagramBasedSourceFunc =
    Ptr Gio.DatagramBased.DatagramBased ->
    CUInt ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "datagram_based", argType = TInterface (Name {namespace = "Gio", name = "DatagramBased"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GDatagramBased", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "condition", argType = TInterface (Name {namespace = "GLib", name = "IOCondition"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the current condition at the source fired", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data passed in by the user", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_DatagramBasedSourceFunc :: FunPtr C_DatagramBasedSourceFunc -> C_DatagramBasedSourceFunc

dynamic_DatagramBasedSourceFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.DatagramBased.IsDatagramBased a) =>
    FunPtr C_DatagramBasedSourceFunc
    -> a
    {- ^ /@datagramBased@/: the 'GI.Gio.Interfaces.DatagramBased.DatagramBased' -}
    -> [GLib.Flags.IOCondition]
    {- ^ /@condition@/: the current condition at the source fired -}
    -> Ptr ()
    {- ^ /@userData@/: data passed in by the user -}
    -> m Bool
    {- ^ __Returns:__ 'GI.GLib.Constants.SOURCE_REMOVE' if the source should be removed,
  'GI.GLib.Constants.SOURCE_CONTINUE' otherwise -}
dynamic_DatagramBasedSourceFunc __funPtr datagramBased condition userData = liftIO $ do
    datagramBased' <- unsafeManagedPtrCastPtr datagramBased
    let condition' = gflagsToWord condition
    result <- (__dynamic_C_DatagramBasedSourceFunc __funPtr) datagramBased' condition' userData
    let result' = (/= 0) result
    touchManagedPtr datagramBased
    return result'

foreign import ccall "wrapper"
    mk_DatagramBasedSourceFunc :: C_DatagramBasedSourceFunc -> IO (FunPtr C_DatagramBasedSourceFunc)

type DatagramBasedSourceFunc =
    Gio.DatagramBased.DatagramBased ->
    [GLib.Flags.IOCondition] ->
    IO Bool

noDatagramBasedSourceFunc :: Maybe DatagramBasedSourceFunc
noDatagramBasedSourceFunc = Nothing

type DatagramBasedSourceFunc_WithClosures =
    Gio.DatagramBased.DatagramBased ->
    [GLib.Flags.IOCondition] ->
    Ptr () ->
    IO Bool

noDatagramBasedSourceFunc_WithClosures :: Maybe DatagramBasedSourceFunc_WithClosures
noDatagramBasedSourceFunc_WithClosures = Nothing

drop_closures_DatagramBasedSourceFunc :: DatagramBasedSourceFunc -> DatagramBasedSourceFunc_WithClosures
drop_closures_DatagramBasedSourceFunc _f datagramBased condition _ = _f datagramBased condition

genClosure_DatagramBasedSourceFunc :: DatagramBasedSourceFunc -> IO Closure
genClosure_DatagramBasedSourceFunc cb = do
    let cb' = drop_closures_DatagramBasedSourceFunc cb
    let cb'' = wrap_DatagramBasedSourceFunc Nothing cb'
    mk_DatagramBasedSourceFunc cb'' >>= newCClosure


wrap_DatagramBasedSourceFunc ::
    Maybe (Ptr (FunPtr C_DatagramBasedSourceFunc)) ->
    DatagramBasedSourceFunc_WithClosures ->
    Ptr Gio.DatagramBased.DatagramBased ->
    CUInt ->
    Ptr () ->
    IO CInt
wrap_DatagramBasedSourceFunc funptrptr _cb datagramBased condition userData = do
    datagramBased' <- (newObject Gio.DatagramBased.DatagramBased) datagramBased
    let condition' = wordToGFlags condition
    result <- _cb  datagramBased' condition' userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback DBusSubtreeIntrospectFunc
--          -> Callable {returnType = Just (TInterface (Name {namespace = "Gio", name = "DBusInterfaceInfo"})), returnMayBeNull = False, returnTransfer = TransferEverything, returnDocumentation = Documentation {rawDocText = Just "A %NULL-terminated array of pointers to #GDBusInterfaceInfo, or %NULL.", sinceVersion = Nothing}, args = [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusConnection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sender", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The unique bus name of the remote caller.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path that was registered with g_dbus_connection_register_subtree().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "node", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A node that is a child of @object_path (relative to @object_path) or %NULL for the root of the subtree.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The @user_data #gpointer passed to g_dbus_connection_register_subtree().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 4, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The type of the @introspect function in #GDBusSubtreeVTable.\n\nSubtrees are flat.  @node, if non-%NULL, is always exactly one\nsegment of the object path (ie: it never contains a slash).\n\nThis function should return %NULL to indicate that there is no object\nat this node.\n\nIf this function returns non-%NULL, the return value is expected to\nbe a %NULL-terminated array of pointers to #GDBusInterfaceInfo\nstructures describing the interfaces implemented by @node.  This\narray will have g_dbus_interface_info_unref() called on each item\nbefore being freed with g_free().\n\nThe difference between returning %NULL and an array containing zero\nitems is that the standard DBus interfaces will returned to the\nremote introspector in the empty array case, but not in the %NULL\ncase.", sinceVersion = Just "2.26"}}
type C_DBusSubtreeIntrospectFunc =
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    CString ->
    CString ->
    Ptr () ->
    IO (Ptr Gio.DBusInterfaceInfo.DBusInterfaceInfo)

-- Args : [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusConnection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sender", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The unique bus name of the remote caller.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path that was registered with g_dbus_connection_register_subtree().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "node", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A node that is a child of @object_path (relative to @object_path) or %NULL for the root of the subtree.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The @user_data #gpointer passed to g_dbus_connection_register_subtree().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 4, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "DBusInterfaceInfo"}))
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_DBusSubtreeIntrospectFunc :: FunPtr C_DBusSubtreeIntrospectFunc -> C_DBusSubtreeIntrospectFunc

dynamic_DBusSubtreeIntrospectFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a) =>
    FunPtr C_DBusSubtreeIntrospectFunc
    -> a
    {- ^ /@connection@/: A 'GI.Gio.Objects.DBusConnection.DBusConnection'. -}
    -> T.Text
    {- ^ /@sender@/: The unique bus name of the remote caller. -}
    -> T.Text
    {- ^ /@objectPath@/: The object path that was registered with 'GI.Gio.Objects.DBusConnection.dBusConnectionRegisterSubtree'. -}
    -> T.Text
    {- ^ /@node@/: A node that is a child of /@objectPath@/ (relative to /@objectPath@/) or 'Nothing' for the root of the subtree. -}
    -> Ptr ()
    {- ^ /@userData@/: The /@userData@/ @/gpointer/@ passed to 'GI.Gio.Objects.DBusConnection.dBusConnectionRegisterSubtree'. -}
    -> m Gio.DBusInterfaceInfo.DBusInterfaceInfo
    {- ^ __Returns:__ A 'Nothing'-terminated array of pointers to 'GI.Gio.Structs.DBusInterfaceInfo.DBusInterfaceInfo', or 'Nothing'. -}
dynamic_DBusSubtreeIntrospectFunc __funPtr connection sender objectPath node userData = liftIO $ do
    connection' <- unsafeManagedPtrCastPtr connection
    sender' <- textToCString sender
    objectPath' <- textToCString objectPath
    node' <- textToCString node
    result <- (__dynamic_C_DBusSubtreeIntrospectFunc __funPtr) connection' sender' objectPath' node' userData
    checkUnexpectedReturnNULL "dBusSubtreeIntrospectFunc" result
    result' <- (wrapBoxed Gio.DBusInterfaceInfo.DBusInterfaceInfo) result
    touchManagedPtr connection
    freeMem sender'
    freeMem objectPath'
    freeMem node'
    return result'

foreign import ccall "wrapper"
    mk_DBusSubtreeIntrospectFunc :: C_DBusSubtreeIntrospectFunc -> IO (FunPtr C_DBusSubtreeIntrospectFunc)

type DBusSubtreeIntrospectFunc =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    T.Text ->
    T.Text ->
    IO Gio.DBusInterfaceInfo.DBusInterfaceInfo

noDBusSubtreeIntrospectFunc :: Maybe DBusSubtreeIntrospectFunc
noDBusSubtreeIntrospectFunc = Nothing

type DBusSubtreeIntrospectFunc_WithClosures =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    T.Text ->
    T.Text ->
    Ptr () ->
    IO Gio.DBusInterfaceInfo.DBusInterfaceInfo

noDBusSubtreeIntrospectFunc_WithClosures :: Maybe DBusSubtreeIntrospectFunc_WithClosures
noDBusSubtreeIntrospectFunc_WithClosures = Nothing

drop_closures_DBusSubtreeIntrospectFunc :: DBusSubtreeIntrospectFunc -> DBusSubtreeIntrospectFunc_WithClosures
drop_closures_DBusSubtreeIntrospectFunc _f connection sender objectPath node _ = _f connection sender objectPath node

genClosure_DBusSubtreeIntrospectFunc :: DBusSubtreeIntrospectFunc -> IO Closure
genClosure_DBusSubtreeIntrospectFunc cb = do
    let cb' = drop_closures_DBusSubtreeIntrospectFunc cb
    let cb'' = wrap_DBusSubtreeIntrospectFunc Nothing cb'
    mk_DBusSubtreeIntrospectFunc cb'' >>= newCClosure


wrap_DBusSubtreeIntrospectFunc ::
    Maybe (Ptr (FunPtr C_DBusSubtreeIntrospectFunc)) ->
    DBusSubtreeIntrospectFunc_WithClosures ->
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    CString ->
    CString ->
    Ptr () ->
    IO (Ptr Gio.DBusInterfaceInfo.DBusInterfaceInfo)
wrap_DBusSubtreeIntrospectFunc funptrptr _cb connection sender objectPath node userData = do
    connection' <- (newObject Gio.DBusConnection.DBusConnection) connection
    sender' <- cstringToText sender
    objectPath' <- cstringToText objectPath
    node' <- cstringToText node
    result <- _cb  connection' sender' objectPath' node' userData
    maybeReleaseFunPtr funptrptr
    result' <- B.ManagedPtr.disownBoxed result
    return result'


-- callback DBusSubtreeDispatchFunc
--          -> Callable {returnType = Just (TInterface (Name {namespace = "Gio", name = "DBusInterfaceVTable"})), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "A #GDBusInterfaceVTable or %NULL if you don't want to handle the methods.", sinceVersion = Nothing}, args = [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusConnection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sender", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The unique bus name of the remote caller.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path that was registered with g_dbus_connection_register_subtree().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "interface_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The D-Bus interface name that the method call or property access is for.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "node", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A node that is a child of @object_path (relative to @object_path) or %NULL for the root of the subtree.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Return location for user data to pass to functions in the returned #GDBusInterfaceVTable (never %NULL).", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The @user_data #gpointer passed to g_dbus_connection_register_subtree().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 6, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The type of the @dispatch function in #GDBusSubtreeVTable.\n\nSubtrees are flat.  @node, if non-%NULL, is always exactly one\nsegment of the object path (ie: it never contains a slash).", sinceVersion = Just "2.26"}}
type C_DBusSubtreeDispatchFunc =
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    CString ->
    CString ->
    CString ->
    Ptr () ->
    Ptr () ->
    IO (Ptr Gio.DBusInterfaceVTable.DBusInterfaceVTable)

-- Args : [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusConnection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sender", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The unique bus name of the remote caller.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path that was registered with g_dbus_connection_register_subtree().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "interface_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The D-Bus interface name that the method call or property access is for.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "node", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A node that is a child of @object_path (relative to @object_path) or %NULL for the root of the subtree.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Return location for user data to pass to functions in the returned #GDBusInterfaceVTable (never %NULL).", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The @user_data #gpointer passed to g_dbus_connection_register_subtree().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 6, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "DBusInterfaceVTable"}))
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_DBusSubtreeDispatchFunc :: FunPtr C_DBusSubtreeDispatchFunc -> C_DBusSubtreeDispatchFunc

dynamic_DBusSubtreeDispatchFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a) =>
    FunPtr C_DBusSubtreeDispatchFunc
    -> a
    {- ^ /@connection@/: A 'GI.Gio.Objects.DBusConnection.DBusConnection'. -}
    -> T.Text
    {- ^ /@sender@/: The unique bus name of the remote caller. -}
    -> T.Text
    {- ^ /@objectPath@/: The object path that was registered with 'GI.Gio.Objects.DBusConnection.dBusConnectionRegisterSubtree'. -}
    -> T.Text
    {- ^ /@interfaceName@/: The D-Bus interface name that the method call or property access is for. -}
    -> T.Text
    {- ^ /@node@/: A node that is a child of /@objectPath@/ (relative to /@objectPath@/) or 'Nothing' for the root of the subtree. -}
    -> Ptr ()
    {- ^ /@outUserData@/: Return location for user data to pass to functions in the returned 'GI.Gio.Structs.DBusInterfaceVTable.DBusInterfaceVTable' (never 'Nothing'). -}
    -> Ptr ()
    {- ^ /@userData@/: The /@userData@/ @/gpointer/@ passed to 'GI.Gio.Objects.DBusConnection.dBusConnectionRegisterSubtree'. -}
    -> m Gio.DBusInterfaceVTable.DBusInterfaceVTable
    {- ^ __Returns:__ A 'GI.Gio.Structs.DBusInterfaceVTable.DBusInterfaceVTable' or 'Nothing' if you don\'t want to handle the methods. -}
dynamic_DBusSubtreeDispatchFunc __funPtr connection sender objectPath interfaceName node outUserData userData = liftIO $ do
    connection' <- unsafeManagedPtrCastPtr connection
    sender' <- textToCString sender
    objectPath' <- textToCString objectPath
    interfaceName' <- textToCString interfaceName
    node' <- textToCString node
    result <- (__dynamic_C_DBusSubtreeDispatchFunc __funPtr) connection' sender' objectPath' interfaceName' node' outUserData userData
    checkUnexpectedReturnNULL "dBusSubtreeDispatchFunc" result
    result' <- (newPtr Gio.DBusInterfaceVTable.DBusInterfaceVTable) result
    touchManagedPtr connection
    freeMem sender'
    freeMem objectPath'
    freeMem interfaceName'
    freeMem node'
    return result'

foreign import ccall "wrapper"
    mk_DBusSubtreeDispatchFunc :: C_DBusSubtreeDispatchFunc -> IO (FunPtr C_DBusSubtreeDispatchFunc)

type DBusSubtreeDispatchFunc =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    T.Text ->
    T.Text ->
    T.Text ->
    Ptr () ->
    IO Gio.DBusInterfaceVTable.DBusInterfaceVTable

noDBusSubtreeDispatchFunc :: Maybe DBusSubtreeDispatchFunc
noDBusSubtreeDispatchFunc = Nothing

type DBusSubtreeDispatchFunc_WithClosures =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    T.Text ->
    T.Text ->
    T.Text ->
    Ptr () ->
    Ptr () ->
    IO Gio.DBusInterfaceVTable.DBusInterfaceVTable

noDBusSubtreeDispatchFunc_WithClosures :: Maybe DBusSubtreeDispatchFunc_WithClosures
noDBusSubtreeDispatchFunc_WithClosures = Nothing

drop_closures_DBusSubtreeDispatchFunc :: DBusSubtreeDispatchFunc -> DBusSubtreeDispatchFunc_WithClosures
drop_closures_DBusSubtreeDispatchFunc _f connection sender objectPath interfaceName node outUserData _ = _f connection sender objectPath interfaceName node outUserData

genClosure_DBusSubtreeDispatchFunc :: DBusSubtreeDispatchFunc -> IO Closure
genClosure_DBusSubtreeDispatchFunc cb = do
    let cb' = drop_closures_DBusSubtreeDispatchFunc cb
    let cb'' = wrap_DBusSubtreeDispatchFunc Nothing cb'
    mk_DBusSubtreeDispatchFunc cb'' >>= newCClosure


wrap_DBusSubtreeDispatchFunc ::
    Maybe (Ptr (FunPtr C_DBusSubtreeDispatchFunc)) ->
    DBusSubtreeDispatchFunc_WithClosures ->
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    CString ->
    CString ->
    CString ->
    Ptr () ->
    Ptr () ->
    IO (Ptr Gio.DBusInterfaceVTable.DBusInterfaceVTable)
wrap_DBusSubtreeDispatchFunc funptrptr _cb connection sender objectPath interfaceName node outUserData userData = do
    connection' <- (newObject Gio.DBusConnection.DBusConnection) connection
    sender' <- cstringToText sender
    objectPath' <- cstringToText objectPath
    interfaceName' <- cstringToText interfaceName
    node' <- cstringToText node
    result <- _cb  connection' sender' objectPath' interfaceName' node' outUserData userData
    maybeReleaseFunPtr funptrptr
    result' <- unsafeManagedPtrGetPtr result
    return result'


-- callback DBusSignalCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusConnection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sender_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The unique bus name of the sender of the signal.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path that the signal was emitted on.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "interface_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name of the interface.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "signal_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name of the signal.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parameters", argType = TVariant, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GVariant tuple with parameters for the signal.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data passed when subscribing to the signal.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 6, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Signature for callback function used in g_dbus_connection_signal_subscribe().", sinceVersion = Just "2.26"}}
type C_DBusSignalCallback =
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    CString ->
    CString ->
    CString ->
    Ptr GVariant ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusConnection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sender_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The unique bus name of the sender of the signal.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path that the signal was emitted on.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "interface_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name of the interface.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "signal_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name of the signal.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parameters", argType = TVariant, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GVariant tuple with parameters for the signal.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data passed when subscribing to the signal.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 6, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_DBusSignalCallback :: FunPtr C_DBusSignalCallback -> C_DBusSignalCallback

dynamic_DBusSignalCallback ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a) =>
    FunPtr C_DBusSignalCallback
    -> a
    {- ^ /@connection@/: A 'GI.Gio.Objects.DBusConnection.DBusConnection'. -}
    -> T.Text
    {- ^ /@senderName@/: The unique bus name of the sender of the signal. -}
    -> T.Text
    {- ^ /@objectPath@/: The object path that the signal was emitted on. -}
    -> T.Text
    {- ^ /@interfaceName@/: The name of the interface. -}
    -> T.Text
    {- ^ /@signalName@/: The name of the signal. -}
    -> GVariant
    {- ^ /@parameters@/: A 'GVariant' tuple with parameters for the signal. -}
    -> Ptr ()
    {- ^ /@userData@/: User data passed when subscribing to the signal. -}
    -> m ()
dynamic_DBusSignalCallback __funPtr connection senderName objectPath interfaceName signalName parameters userData = liftIO $ do
    connection' <- unsafeManagedPtrCastPtr connection
    senderName' <- textToCString senderName
    objectPath' <- textToCString objectPath
    interfaceName' <- textToCString interfaceName
    signalName' <- textToCString signalName
    parameters' <- unsafeManagedPtrGetPtr parameters
    (__dynamic_C_DBusSignalCallback __funPtr) connection' senderName' objectPath' interfaceName' signalName' parameters' userData
    touchManagedPtr connection
    touchManagedPtr parameters
    freeMem senderName'
    freeMem objectPath'
    freeMem interfaceName'
    freeMem signalName'
    return ()

foreign import ccall "wrapper"
    mk_DBusSignalCallback :: C_DBusSignalCallback -> IO (FunPtr C_DBusSignalCallback)

type DBusSignalCallback =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    T.Text ->
    T.Text ->
    T.Text ->
    GVariant ->
    IO ()

noDBusSignalCallback :: Maybe DBusSignalCallback
noDBusSignalCallback = Nothing

type DBusSignalCallback_WithClosures =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    T.Text ->
    T.Text ->
    T.Text ->
    GVariant ->
    Ptr () ->
    IO ()

noDBusSignalCallback_WithClosures :: Maybe DBusSignalCallback_WithClosures
noDBusSignalCallback_WithClosures = Nothing

drop_closures_DBusSignalCallback :: DBusSignalCallback -> DBusSignalCallback_WithClosures
drop_closures_DBusSignalCallback _f connection senderName objectPath interfaceName signalName parameters _ = _f connection senderName objectPath interfaceName signalName parameters

genClosure_DBusSignalCallback :: DBusSignalCallback -> IO Closure
genClosure_DBusSignalCallback cb = do
    let cb' = drop_closures_DBusSignalCallback cb
    let cb'' = wrap_DBusSignalCallback Nothing cb'
    mk_DBusSignalCallback cb'' >>= newCClosure


wrap_DBusSignalCallback ::
    Maybe (Ptr (FunPtr C_DBusSignalCallback)) ->
    DBusSignalCallback_WithClosures ->
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    CString ->
    CString ->
    CString ->
    Ptr GVariant ->
    Ptr () ->
    IO ()
wrap_DBusSignalCallback funptrptr _cb connection senderName objectPath interfaceName signalName parameters userData = do
    connection' <- (newObject Gio.DBusConnection.DBusConnection) connection
    senderName' <- cstringToText senderName
    objectPath' <- cstringToText objectPath
    interfaceName' <- cstringToText interfaceName
    signalName' <- cstringToText signalName
    parameters' <- newGVariantFromPtr parameters
    _cb  connection' senderName' objectPath' interfaceName' signalName' parameters' userData
    maybeReleaseFunPtr funptrptr


-- callback DBusProxyTypeFunc
--          -> Callable {returnType = Just (TBasicType TGType), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "A #GType to use for the remote object. The returned type\n  must be a #GDBusProxy or #GDBusObjectProxy -derived\n  type.", sinceVersion = Nothing}, args = [Arg {argCName = "manager", argType = TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusObjectManagerClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path of the remote object.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "interface_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The interface name of the remote object or %NULL if a #GDBusObjectProxy #GType is requested.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 3, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Function signature for a function used to determine the #GType to\nuse for an interface proxy (if @interface_name is not %NULL) or\nobject proxy (if @interface_name is %NULL).\n\nThis function is called in the\n[thread-default main loop][g-main-context-push-thread-default]\nthat @manager was constructed in.", sinceVersion = Just "2.30"}}
type C_DBusProxyTypeFunc =
    Ptr Gio.DBusObjectManagerClient.DBusObjectManagerClient ->
    CString ->
    CString ->
    Ptr () ->
    IO CGType

-- Args : [Arg {argCName = "manager", argType = TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusObjectManagerClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path of the remote object.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "interface_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The interface name of the remote object or %NULL if a #GDBusObjectProxy #GType is requested.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 3, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TGType)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_DBusProxyTypeFunc :: FunPtr C_DBusProxyTypeFunc -> C_DBusProxyTypeFunc

dynamic_DBusProxyTypeFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.DBusObjectManagerClient.IsDBusObjectManagerClient a) =>
    FunPtr C_DBusProxyTypeFunc
    -> a
    {- ^ /@manager@/: A 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient'. -}
    -> T.Text
    {- ^ /@objectPath@/: The object path of the remote object. -}
    -> Maybe (T.Text)
    {- ^ /@interfaceName@/: The interface name of the remote object or 'Nothing' if a 'GI.Gio.Objects.DBusObjectProxy.DBusObjectProxy' 'GType' is requested. -}
    -> Ptr ()
    {- ^ /@userData@/: User data. -}
    -> m GType
    {- ^ __Returns:__ A 'GType' to use for the remote object. The returned type
  must be a 'GI.Gio.Objects.DBusProxy.DBusProxy' or 'GI.Gio.Objects.DBusObjectProxy.DBusObjectProxy' -derived
  type. -}
dynamic_DBusProxyTypeFunc __funPtr manager objectPath interfaceName userData = liftIO $ do
    manager' <- unsafeManagedPtrCastPtr manager
    objectPath' <- textToCString objectPath
    maybeInterfaceName <- case interfaceName of
        Nothing -> return nullPtr
        Just jInterfaceName -> do
            jInterfaceName' <- textToCString jInterfaceName
            return jInterfaceName'
    result <- (__dynamic_C_DBusProxyTypeFunc __funPtr) manager' objectPath' maybeInterfaceName userData
    let result' = GType result
    touchManagedPtr manager
    freeMem objectPath'
    freeMem maybeInterfaceName
    return result'

foreign import ccall "wrapper"
    mk_DBusProxyTypeFunc :: C_DBusProxyTypeFunc -> IO (FunPtr C_DBusProxyTypeFunc)

type DBusProxyTypeFunc =
    Gio.DBusObjectManagerClient.DBusObjectManagerClient ->
    T.Text ->
    Maybe T.Text ->
    IO GType

noDBusProxyTypeFunc :: Maybe DBusProxyTypeFunc
noDBusProxyTypeFunc = Nothing

type DBusProxyTypeFunc_WithClosures =
    Gio.DBusObjectManagerClient.DBusObjectManagerClient ->
    T.Text ->
    Maybe T.Text ->
    Ptr () ->
    IO GType

noDBusProxyTypeFunc_WithClosures :: Maybe DBusProxyTypeFunc_WithClosures
noDBusProxyTypeFunc_WithClosures = Nothing

drop_closures_DBusProxyTypeFunc :: DBusProxyTypeFunc -> DBusProxyTypeFunc_WithClosures
drop_closures_DBusProxyTypeFunc _f manager objectPath interfaceName _ = _f manager objectPath interfaceName

genClosure_DBusProxyTypeFunc :: DBusProxyTypeFunc -> IO Closure
genClosure_DBusProxyTypeFunc cb = do
    let cb' = drop_closures_DBusProxyTypeFunc cb
    let cb'' = wrap_DBusProxyTypeFunc Nothing cb'
    mk_DBusProxyTypeFunc cb'' >>= newCClosure


wrap_DBusProxyTypeFunc ::
    Maybe (Ptr (FunPtr C_DBusProxyTypeFunc)) ->
    DBusProxyTypeFunc_WithClosures ->
    Ptr Gio.DBusObjectManagerClient.DBusObjectManagerClient ->
    CString ->
    CString ->
    Ptr () ->
    IO CGType
wrap_DBusProxyTypeFunc funptrptr _cb manager objectPath interfaceName userData = do
    manager' <- (newObject Gio.DBusObjectManagerClient.DBusObjectManagerClient) manager
    objectPath' <- cstringToText objectPath
    maybeInterfaceName <-
        if interfaceName == nullPtr
        then return Nothing
        else do
            interfaceName' <- cstringToText interfaceName
            return $ Just interfaceName'
    result <- _cb  manager' objectPath' maybeInterfaceName userData
    maybeReleaseFunPtr funptrptr
    let result' = gtypeToCGType result
    return result'


-- callback DBusMessageFilterFunction
--          -> Callable {returnType = Just (TInterface (Name {namespace = "Gio", name = "DBusMessage"})), returnMayBeNull = True, returnTransfer = TransferEverything, returnDocumentation = Documentation {rawDocText = Just "A #GDBusMessage that will be freed with\ng_object_unref() or %NULL to drop the message. Passive filter\nfunctions can simply return the passed @message object.", sinceVersion = Nothing}, args = [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusConnection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "message", argType = TInterface (Name {namespace = "Gio", name = "DBusMessage"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A locked #GDBusMessage that the filter function takes ownership of.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "incoming", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE if it is a message received from the other peer, %FALSE if it is\na message to be sent to the other peer.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data passed when adding the filter.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 3, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Signature for function used in g_dbus_connection_add_filter().\n\nA filter function is passed a #GDBusMessage and expected to return\na #GDBusMessage too. Passive filter functions that don't modify the\nmessage can simply return the @message object:\n|[\nstatic GDBusMessage *\npassive_filter (GDBusConnection *connection\n                GDBusMessage    *message,\n                gboolean         incoming,\n                gpointer         user_data)\n{\n  /<!-- -->* inspect @message *<!-- -->/\n  return message;\n}\n]|\nFilter functions that wants to drop a message can simply return %NULL:\n|[\nstatic GDBusMessage *\ndrop_filter (GDBusConnection *connection\n             GDBusMessage    *message,\n             gboolean         incoming,\n             gpointer         user_data)\n{\n  if (should_drop_message)\n    {\n      g_object_unref (message);\n      message = NULL;\n    }\n  return message;\n}\n]|\nFinally, a filter function may modify a message by copying it:\n|[\nstatic GDBusMessage *\nmodifying_filter (GDBusConnection *connection\n                  GDBusMessage    *message,\n                  gboolean         incoming,\n                  gpointer         user_data)\n{\n  GDBusMessage *copy;\n  GError *error;\n\n  error = NULL;\n  copy = g_dbus_message_copy (message, &error);\n  /<!-- -->* handle @error being is set *<!-- -->/\n  g_object_unref (message);\n\n  /<!-- -->* modify @copy *<!-- -->/\n\n  return copy;\n}\n]|\nIf the returned #GDBusMessage is different from @message and cannot\nbe sent on @connection (it could use features, such as file\ndescriptors, not compatible with @connection), then a warning is\nlogged to <emphasis>standard error</emphasis>. Applications can\ncheck this ahead of time using g_dbus_message_to_blob() passing a\n#GDBusCapabilityFlags value obtained from @connection.", sinceVersion = Just "2.26"}}
type C_DBusMessageFilterFunction =
    Ptr Gio.DBusConnection.DBusConnection ->
    Ptr Gio.DBusMessage.DBusMessage ->
    CInt ->
    Ptr () ->
    IO (Ptr Gio.DBusMessage.DBusMessage)

-- Args : [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusConnection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "message", argType = TInterface (Name {namespace = "Gio", name = "DBusMessage"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A locked #GDBusMessage that the filter function takes ownership of.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "incoming", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE if it is a message received from the other peer, %FALSE if it is\na message to be sent to the other peer.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data passed when adding the filter.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 3, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "DBusMessage"}))
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_DBusMessageFilterFunction :: FunPtr C_DBusMessageFilterFunction -> C_DBusMessageFilterFunction

dynamic_DBusMessageFilterFunction ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a, Gio.DBusMessage.IsDBusMessage b) =>
    FunPtr C_DBusMessageFilterFunction
    -> a
    {- ^ /@connection@/: A 'GI.Gio.Objects.DBusConnection.DBusConnection'. -}
    -> b
    {- ^ /@message@/: A locked 'GI.Gio.Objects.DBusMessage.DBusMessage' that the filter function takes ownership of. -}
    -> Bool
    {- ^ /@incoming@/: 'True' if it is a message received from the other peer, 'False' if it is
a message to be sent to the other peer. -}
    -> Ptr ()
    {- ^ /@userData@/: User data passed when adding the filter. -}
    -> m (Maybe Gio.DBusMessage.DBusMessage)
    {- ^ __Returns:__ A 'GI.Gio.Objects.DBusMessage.DBusMessage' that will be freed with
'GI.GObject.Objects.Object.objectUnref' or 'Nothing' to drop the message. Passive filter
functions can simply return the passed /@message@/ object. -}
dynamic_DBusMessageFilterFunction __funPtr connection message incoming userData = liftIO $ do
    connection' <- unsafeManagedPtrCastPtr connection
    message' <- B.ManagedPtr.disownObject message
    let incoming' = (fromIntegral . fromEnum) incoming
    result <- (__dynamic_C_DBusMessageFilterFunction __funPtr) connection' message' incoming' userData
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapObject Gio.DBusMessage.DBusMessage) result'
        return result''
    touchManagedPtr connection
    touchManagedPtr message
    return maybeResult

foreign import ccall "wrapper"
    mk_DBusMessageFilterFunction :: C_DBusMessageFilterFunction -> IO (FunPtr C_DBusMessageFilterFunction)

type DBusMessageFilterFunction =
    Gio.DBusConnection.DBusConnection ->
    Gio.DBusMessage.DBusMessage ->
    Bool ->
    IO (Maybe Gio.DBusMessage.DBusMessage)

noDBusMessageFilterFunction :: Maybe DBusMessageFilterFunction
noDBusMessageFilterFunction = Nothing

type DBusMessageFilterFunction_WithClosures =
    Gio.DBusConnection.DBusConnection ->
    Gio.DBusMessage.DBusMessage ->
    Bool ->
    Ptr () ->
    IO (Maybe Gio.DBusMessage.DBusMessage)

noDBusMessageFilterFunction_WithClosures :: Maybe DBusMessageFilterFunction_WithClosures
noDBusMessageFilterFunction_WithClosures = Nothing

drop_closures_DBusMessageFilterFunction :: DBusMessageFilterFunction -> DBusMessageFilterFunction_WithClosures
drop_closures_DBusMessageFilterFunction _f connection message incoming _ = _f connection message incoming

genClosure_DBusMessageFilterFunction :: DBusMessageFilterFunction -> IO Closure
genClosure_DBusMessageFilterFunction cb = do
    let cb' = drop_closures_DBusMessageFilterFunction cb
    let cb'' = wrap_DBusMessageFilterFunction Nothing cb'
    mk_DBusMessageFilterFunction cb'' >>= newCClosure


wrap_DBusMessageFilterFunction ::
    Maybe (Ptr (FunPtr C_DBusMessageFilterFunction)) ->
    DBusMessageFilterFunction_WithClosures ->
    Ptr Gio.DBusConnection.DBusConnection ->
    Ptr Gio.DBusMessage.DBusMessage ->
    CInt ->
    Ptr () ->
    IO (Ptr Gio.DBusMessage.DBusMessage)
wrap_DBusMessageFilterFunction funptrptr _cb connection message incoming userData = do
    connection' <- (newObject Gio.DBusConnection.DBusConnection) connection
    message' <- (wrapObject Gio.DBusMessage.DBusMessage) message
    let incoming' = (/= 0) incoming
    result <- _cb  connection' message' incoming' userData
    maybeReleaseFunPtr funptrptr
    maybeM nullPtr result $ \result' -> do
        result'' <- B.ManagedPtr.disownObject result'
        return result''


-- callback DBusInterfaceSetPropertyFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if the property was set to @value, %FALSE if @error is set.", sinceVersion = Nothing}, args = [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusConnection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sender", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The unique bus name of the remote caller.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path that the method was invoked on.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "interface_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The D-Bus interface name for the property.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "property_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name of the property to get the value of.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TVariant, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The value to set the property to.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "error", argType = TError, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Return location for error.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The @user_data #gpointer passed to g_dbus_connection_register_object().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 7, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The type of the @set_property function in #GDBusInterfaceVTable.", sinceVersion = Just "2.26"}}
type C_DBusInterfaceSetPropertyFunc =
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    CString ->
    CString ->
    CString ->
    Ptr GVariant ->
    Ptr GError ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusConnection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sender", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The unique bus name of the remote caller.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path that the method was invoked on.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "interface_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The D-Bus interface name for the property.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "property_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name of the property to get the value of.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TVariant, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The value to set the property to.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "error", argType = TError, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Return location for error.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The @user_data #gpointer passed to g_dbus_connection_register_object().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 7, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_DBusInterfaceSetPropertyFunc :: FunPtr C_DBusInterfaceSetPropertyFunc -> C_DBusInterfaceSetPropertyFunc

dynamic_DBusInterfaceSetPropertyFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a) =>
    FunPtr C_DBusInterfaceSetPropertyFunc
    -> a
    {- ^ /@connection@/: A 'GI.Gio.Objects.DBusConnection.DBusConnection'. -}
    -> T.Text
    {- ^ /@sender@/: The unique bus name of the remote caller. -}
    -> T.Text
    {- ^ /@objectPath@/: The object path that the method was invoked on. -}
    -> T.Text
    {- ^ /@interfaceName@/: The D-Bus interface name for the property. -}
    -> T.Text
    {- ^ /@propertyName@/: The name of the property to get the value of. -}
    -> GVariant
    {- ^ /@value@/: The value to set the property to. -}
    -> GError
    {- ^ /@error@/: Return location for error. -}
    -> Ptr ()
    {- ^ /@userData@/: The /@userData@/ @/gpointer/@ passed to @/g_dbus_connection_register_object()/@. -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the property was set to /@value@/, 'False' if /@error@/ is set. -}
dynamic_DBusInterfaceSetPropertyFunc __funPtr connection sender objectPath interfaceName propertyName value error_ userData = liftIO $ do
    connection' <- unsafeManagedPtrCastPtr connection
    sender' <- textToCString sender
    objectPath' <- textToCString objectPath
    interfaceName' <- textToCString interfaceName
    propertyName' <- textToCString propertyName
    value' <- unsafeManagedPtrGetPtr value
    error_' <- unsafeManagedPtrGetPtr error_
    result <- (__dynamic_C_DBusInterfaceSetPropertyFunc __funPtr) connection' sender' objectPath' interfaceName' propertyName' value' error_' userData
    let result' = (/= 0) result
    touchManagedPtr connection
    touchManagedPtr value
    touchManagedPtr error_
    freeMem sender'
    freeMem objectPath'
    freeMem interfaceName'
    freeMem propertyName'
    return result'

foreign import ccall "wrapper"
    mk_DBusInterfaceSetPropertyFunc :: C_DBusInterfaceSetPropertyFunc -> IO (FunPtr C_DBusInterfaceSetPropertyFunc)

type DBusInterfaceSetPropertyFunc =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    T.Text ->
    T.Text ->
    T.Text ->
    GVariant ->
    GError ->
    IO Bool

noDBusInterfaceSetPropertyFunc :: Maybe DBusInterfaceSetPropertyFunc
noDBusInterfaceSetPropertyFunc = Nothing

type DBusInterfaceSetPropertyFunc_WithClosures =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    T.Text ->
    T.Text ->
    T.Text ->
    GVariant ->
    GError ->
    Ptr () ->
    IO Bool

noDBusInterfaceSetPropertyFunc_WithClosures :: Maybe DBusInterfaceSetPropertyFunc_WithClosures
noDBusInterfaceSetPropertyFunc_WithClosures = Nothing

drop_closures_DBusInterfaceSetPropertyFunc :: DBusInterfaceSetPropertyFunc -> DBusInterfaceSetPropertyFunc_WithClosures
drop_closures_DBusInterfaceSetPropertyFunc _f connection sender objectPath interfaceName propertyName value error_ _ = _f connection sender objectPath interfaceName propertyName value error_

genClosure_DBusInterfaceSetPropertyFunc :: DBusInterfaceSetPropertyFunc -> IO Closure
genClosure_DBusInterfaceSetPropertyFunc cb = do
    let cb' = drop_closures_DBusInterfaceSetPropertyFunc cb
    let cb'' = wrap_DBusInterfaceSetPropertyFunc Nothing cb'
    mk_DBusInterfaceSetPropertyFunc cb'' >>= newCClosure


wrap_DBusInterfaceSetPropertyFunc ::
    Maybe (Ptr (FunPtr C_DBusInterfaceSetPropertyFunc)) ->
    DBusInterfaceSetPropertyFunc_WithClosures ->
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    CString ->
    CString ->
    CString ->
    Ptr GVariant ->
    Ptr GError ->
    Ptr () ->
    IO CInt
wrap_DBusInterfaceSetPropertyFunc funptrptr _cb connection sender objectPath interfaceName propertyName value error_ userData = do
    connection' <- (newObject Gio.DBusConnection.DBusConnection) connection
    sender' <- cstringToText sender
    objectPath' <- cstringToText objectPath
    interfaceName' <- cstringToText interfaceName
    propertyName' <- cstringToText propertyName
    value' <- newGVariantFromPtr value
    error_' <- (newBoxed GError) error_
    result <- _cb  connection' sender' objectPath' interfaceName' propertyName' value' error_' userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback DBusInterfaceMethodCallFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusConnection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sender", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The unique bus name of the remote caller.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path that the method was invoked on.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "interface_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The D-Bus interface name the method was invoked on.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "method_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name of the method that was invoked.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parameters", argType = TVariant, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GVariant tuple with parameters.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "invocation", argType = TInterface (Name {namespace = "Gio", name = "DBusMethodInvocation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusMethodInvocation object that must be used to return a value or error.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The @user_data #gpointer passed to g_dbus_connection_register_object().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 7, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The type of the @method_call function in #GDBusInterfaceVTable.", sinceVersion = Just "2.26"}}
type C_DBusInterfaceMethodCallFunc =
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    CString ->
    CString ->
    CString ->
    Ptr GVariant ->
    Ptr Gio.DBusMethodInvocation.DBusMethodInvocation ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusConnection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sender", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The unique bus name of the remote caller.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path that the method was invoked on.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "interface_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The D-Bus interface name the method was invoked on.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "method_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name of the method that was invoked.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parameters", argType = TVariant, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GVariant tuple with parameters.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "invocation", argType = TInterface (Name {namespace = "Gio", name = "DBusMethodInvocation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusMethodInvocation object that must be used to return a value or error.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The @user_data #gpointer passed to g_dbus_connection_register_object().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 7, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_DBusInterfaceMethodCallFunc :: FunPtr C_DBusInterfaceMethodCallFunc -> C_DBusInterfaceMethodCallFunc

dynamic_DBusInterfaceMethodCallFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a, Gio.DBusMethodInvocation.IsDBusMethodInvocation b) =>
    FunPtr C_DBusInterfaceMethodCallFunc
    -> a
    {- ^ /@connection@/: A 'GI.Gio.Objects.DBusConnection.DBusConnection'. -}
    -> T.Text
    {- ^ /@sender@/: The unique bus name of the remote caller. -}
    -> T.Text
    {- ^ /@objectPath@/: The object path that the method was invoked on. -}
    -> T.Text
    {- ^ /@interfaceName@/: The D-Bus interface name the method was invoked on. -}
    -> T.Text
    {- ^ /@methodName@/: The name of the method that was invoked. -}
    -> GVariant
    {- ^ /@parameters@/: A 'GVariant' tuple with parameters. -}
    -> b
    {- ^ /@invocation@/: A 'GI.Gio.Objects.DBusMethodInvocation.DBusMethodInvocation' object that must be used to return a value or error. -}
    -> Ptr ()
    {- ^ /@userData@/: The /@userData@/ @/gpointer/@ passed to @/g_dbus_connection_register_object()/@. -}
    -> m ()
dynamic_DBusInterfaceMethodCallFunc __funPtr connection sender objectPath interfaceName methodName parameters invocation userData = liftIO $ do
    connection' <- unsafeManagedPtrCastPtr connection
    sender' <- textToCString sender
    objectPath' <- textToCString objectPath
    interfaceName' <- textToCString interfaceName
    methodName' <- textToCString methodName
    parameters' <- unsafeManagedPtrGetPtr parameters
    invocation' <- B.ManagedPtr.disownObject invocation
    (__dynamic_C_DBusInterfaceMethodCallFunc __funPtr) connection' sender' objectPath' interfaceName' methodName' parameters' invocation' userData
    touchManagedPtr connection
    touchManagedPtr parameters
    touchManagedPtr invocation
    freeMem sender'
    freeMem objectPath'
    freeMem interfaceName'
    freeMem methodName'
    return ()

foreign import ccall "wrapper"
    mk_DBusInterfaceMethodCallFunc :: C_DBusInterfaceMethodCallFunc -> IO (FunPtr C_DBusInterfaceMethodCallFunc)

type DBusInterfaceMethodCallFunc =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    T.Text ->
    T.Text ->
    T.Text ->
    GVariant ->
    Gio.DBusMethodInvocation.DBusMethodInvocation ->
    IO ()

noDBusInterfaceMethodCallFunc :: Maybe DBusInterfaceMethodCallFunc
noDBusInterfaceMethodCallFunc = Nothing

type DBusInterfaceMethodCallFunc_WithClosures =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    T.Text ->
    T.Text ->
    T.Text ->
    GVariant ->
    Gio.DBusMethodInvocation.DBusMethodInvocation ->
    Ptr () ->
    IO ()

noDBusInterfaceMethodCallFunc_WithClosures :: Maybe DBusInterfaceMethodCallFunc_WithClosures
noDBusInterfaceMethodCallFunc_WithClosures = Nothing

drop_closures_DBusInterfaceMethodCallFunc :: DBusInterfaceMethodCallFunc -> DBusInterfaceMethodCallFunc_WithClosures
drop_closures_DBusInterfaceMethodCallFunc _f connection sender objectPath interfaceName methodName parameters invocation _ = _f connection sender objectPath interfaceName methodName parameters invocation

genClosure_DBusInterfaceMethodCallFunc :: DBusInterfaceMethodCallFunc -> IO Closure
genClosure_DBusInterfaceMethodCallFunc cb = do
    let cb' = drop_closures_DBusInterfaceMethodCallFunc cb
    let cb'' = wrap_DBusInterfaceMethodCallFunc Nothing cb'
    mk_DBusInterfaceMethodCallFunc cb'' >>= newCClosure


wrap_DBusInterfaceMethodCallFunc ::
    Maybe (Ptr (FunPtr C_DBusInterfaceMethodCallFunc)) ->
    DBusInterfaceMethodCallFunc_WithClosures ->
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    CString ->
    CString ->
    CString ->
    Ptr GVariant ->
    Ptr Gio.DBusMethodInvocation.DBusMethodInvocation ->
    Ptr () ->
    IO ()
wrap_DBusInterfaceMethodCallFunc funptrptr _cb connection sender objectPath interfaceName methodName parameters invocation userData = do
    connection' <- (newObject Gio.DBusConnection.DBusConnection) connection
    sender' <- cstringToText sender
    objectPath' <- cstringToText objectPath
    interfaceName' <- cstringToText interfaceName
    methodName' <- cstringToText methodName
    parameters' <- newGVariantFromPtr parameters
    invocation' <- (wrapObject Gio.DBusMethodInvocation.DBusMethodInvocation) invocation
    _cb  connection' sender' objectPath' interfaceName' methodName' parameters' invocation' userData
    maybeReleaseFunPtr funptrptr


-- callback DBusInterfaceGetPropertyFunc
--          -> Callable {returnType = Just TVariant, returnMayBeNull = False, returnTransfer = TransferEverything, returnDocumentation = Documentation {rawDocText = Just "A #GVariant with the value for @property_name or %NULL if\n    @error is set. If the returned #GVariant is floating, it is\n    consumed - otherwise its reference count is decreased by one.", sinceVersion = Nothing}, args = [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusConnection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sender", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The unique bus name of the remote caller.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path that the method was invoked on.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "interface_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The D-Bus interface name for the property.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "property_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name of the property to get the value of.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "error", argType = TError, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Return location for error.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The @user_data #gpointer passed to g_dbus_connection_register_object().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 6, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The type of the @get_property function in #GDBusInterfaceVTable.", sinceVersion = Just "2.26"}}
type C_DBusInterfaceGetPropertyFunc =
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    CString ->
    CString ->
    CString ->
    Ptr GError ->
    Ptr () ->
    IO (Ptr GVariant)

-- Args : [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusConnection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sender", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The unique bus name of the remote caller.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path that the method was invoked on.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "interface_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The D-Bus interface name for the property.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "property_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name of the property to get the value of.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "error", argType = TError, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Return location for error.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The @user_data #gpointer passed to g_dbus_connection_register_object().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 6, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just TVariant
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_DBusInterfaceGetPropertyFunc :: FunPtr C_DBusInterfaceGetPropertyFunc -> C_DBusInterfaceGetPropertyFunc

dynamic_DBusInterfaceGetPropertyFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a) =>
    FunPtr C_DBusInterfaceGetPropertyFunc
    -> a
    {- ^ /@connection@/: A 'GI.Gio.Objects.DBusConnection.DBusConnection'. -}
    -> T.Text
    {- ^ /@sender@/: The unique bus name of the remote caller. -}
    -> T.Text
    {- ^ /@objectPath@/: The object path that the method was invoked on. -}
    -> T.Text
    {- ^ /@interfaceName@/: The D-Bus interface name for the property. -}
    -> T.Text
    {- ^ /@propertyName@/: The name of the property to get the value of. -}
    -> GError
    {- ^ /@error@/: Return location for error. -}
    -> Ptr ()
    {- ^ /@userData@/: The /@userData@/ @/gpointer/@ passed to @/g_dbus_connection_register_object()/@. -}
    -> m GVariant
    {- ^ __Returns:__ A 'GVariant' with the value for /@propertyName@/ or 'Nothing' if
    /@error@/ is set. If the returned 'GVariant' is floating, it is
    consumed - otherwise its reference count is decreased by one. -}
dynamic_DBusInterfaceGetPropertyFunc __funPtr connection sender objectPath interfaceName propertyName error_ userData = liftIO $ do
    connection' <- unsafeManagedPtrCastPtr connection
    sender' <- textToCString sender
    objectPath' <- textToCString objectPath
    interfaceName' <- textToCString interfaceName
    propertyName' <- textToCString propertyName
    error_' <- unsafeManagedPtrGetPtr error_
    result <- (__dynamic_C_DBusInterfaceGetPropertyFunc __funPtr) connection' sender' objectPath' interfaceName' propertyName' error_' userData
    checkUnexpectedReturnNULL "dBusInterfaceGetPropertyFunc" result
    result' <- wrapGVariantPtr result
    touchManagedPtr connection
    touchManagedPtr error_
    freeMem sender'
    freeMem objectPath'
    freeMem interfaceName'
    freeMem propertyName'
    return result'

foreign import ccall "wrapper"
    mk_DBusInterfaceGetPropertyFunc :: C_DBusInterfaceGetPropertyFunc -> IO (FunPtr C_DBusInterfaceGetPropertyFunc)

type DBusInterfaceGetPropertyFunc =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    T.Text ->
    T.Text ->
    T.Text ->
    GError ->
    IO GVariant

noDBusInterfaceGetPropertyFunc :: Maybe DBusInterfaceGetPropertyFunc
noDBusInterfaceGetPropertyFunc = Nothing

type DBusInterfaceGetPropertyFunc_WithClosures =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    T.Text ->
    T.Text ->
    T.Text ->
    GError ->
    Ptr () ->
    IO GVariant

noDBusInterfaceGetPropertyFunc_WithClosures :: Maybe DBusInterfaceGetPropertyFunc_WithClosures
noDBusInterfaceGetPropertyFunc_WithClosures = Nothing

drop_closures_DBusInterfaceGetPropertyFunc :: DBusInterfaceGetPropertyFunc -> DBusInterfaceGetPropertyFunc_WithClosures
drop_closures_DBusInterfaceGetPropertyFunc _f connection sender objectPath interfaceName propertyName error_ _ = _f connection sender objectPath interfaceName propertyName error_

genClosure_DBusInterfaceGetPropertyFunc :: DBusInterfaceGetPropertyFunc -> IO Closure
genClosure_DBusInterfaceGetPropertyFunc cb = do
    let cb' = drop_closures_DBusInterfaceGetPropertyFunc cb
    let cb'' = wrap_DBusInterfaceGetPropertyFunc Nothing cb'
    mk_DBusInterfaceGetPropertyFunc cb'' >>= newCClosure


wrap_DBusInterfaceGetPropertyFunc ::
    Maybe (Ptr (FunPtr C_DBusInterfaceGetPropertyFunc)) ->
    DBusInterfaceGetPropertyFunc_WithClosures ->
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    CString ->
    CString ->
    CString ->
    Ptr GError ->
    Ptr () ->
    IO (Ptr GVariant)
wrap_DBusInterfaceGetPropertyFunc funptrptr _cb connection sender objectPath interfaceName propertyName error_ userData = do
    connection' <- (newObject Gio.DBusConnection.DBusConnection) connection
    sender' <- cstringToText sender
    objectPath' <- cstringToText objectPath
    interfaceName' <- cstringToText interfaceName
    propertyName' <- cstringToText propertyName
    error_' <- (newBoxed GError) error_
    result <- _cb  connection' sender' objectPath' interfaceName' propertyName' error_' userData
    maybeReleaseFunPtr funptrptr
    result' <- B.GVariant.disownGVariant result
    return result'


-- callback CancellableSourceFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "it should return %FALSE if the source should be removed.", sinceVersion = Nothing}, args = [Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the #GCancellable", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data passed in by the user.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "This is the function type of the callback used for the #GSource\nreturned by g_cancellable_source_new().", sinceVersion = Just "2.28"}}
type C_CancellableSourceFunc =
    Ptr Gio.Cancellable.Cancellable ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the #GCancellable", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data passed in by the user.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_CancellableSourceFunc :: FunPtr C_CancellableSourceFunc -> C_CancellableSourceFunc

dynamic_CancellableSourceFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
    FunPtr C_CancellableSourceFunc
    -> Maybe (a)
    {- ^ /@cancellable@/: the 'GI.Gio.Objects.Cancellable.Cancellable' -}
    -> Ptr ()
    {- ^ /@userData@/: data passed in by the user. -}
    -> m Bool
    {- ^ __Returns:__ it should return 'False' if the source should be removed. -}
dynamic_CancellableSourceFunc __funPtr cancellable userData = liftIO $ do
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    result <- (__dynamic_C_CancellableSourceFunc __funPtr) maybeCancellable userData
    let result' = (/= 0) result
    whenJust cancellable touchManagedPtr
    return result'

foreign import ccall "wrapper"
    mk_CancellableSourceFunc :: C_CancellableSourceFunc -> IO (FunPtr C_CancellableSourceFunc)

type CancellableSourceFunc =
    Maybe Gio.Cancellable.Cancellable ->
    IO Bool

noCancellableSourceFunc :: Maybe CancellableSourceFunc
noCancellableSourceFunc = Nothing

type CancellableSourceFunc_WithClosures =
    Maybe Gio.Cancellable.Cancellable ->
    Ptr () ->
    IO Bool

noCancellableSourceFunc_WithClosures :: Maybe CancellableSourceFunc_WithClosures
noCancellableSourceFunc_WithClosures = Nothing

drop_closures_CancellableSourceFunc :: CancellableSourceFunc -> CancellableSourceFunc_WithClosures
drop_closures_CancellableSourceFunc _f cancellable _ = _f cancellable

genClosure_CancellableSourceFunc :: CancellableSourceFunc -> IO Closure
genClosure_CancellableSourceFunc cb = do
    let cb' = drop_closures_CancellableSourceFunc cb
    let cb'' = wrap_CancellableSourceFunc Nothing cb'
    mk_CancellableSourceFunc cb'' >>= newCClosure


wrap_CancellableSourceFunc ::
    Maybe (Ptr (FunPtr C_CancellableSourceFunc)) ->
    CancellableSourceFunc_WithClosures ->
    Ptr Gio.Cancellable.Cancellable ->
    Ptr () ->
    IO CInt
wrap_CancellableSourceFunc funptrptr _cb cancellable userData = do
    maybeCancellable <-
        if cancellable == nullPtr
        then return Nothing
        else do
            cancellable' <- (newObject Gio.Cancellable.Cancellable) cancellable
            return $ Just cancellable'
    result <- _cb  maybeCancellable userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback BusNameVanishedCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #GDBusConnection the name is being watched on, or\n    %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name being watched.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data passed to g_bus_watch_name().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Invoked when the name being watched is known not to have to have a owner.\n\nThis is also invoked when the #GDBusConection on which the watch was\nestablished has been closed.  In that case, @connection will be\n%NULL.", sinceVersion = Just "2.26"}}
type C_BusNameVanishedCallback =
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #GDBusConnection the name is being watched on, or\n    %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name being watched.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data passed to g_bus_watch_name().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_BusNameVanishedCallback :: FunPtr C_BusNameVanishedCallback -> C_BusNameVanishedCallback

dynamic_BusNameVanishedCallback ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a) =>
    FunPtr C_BusNameVanishedCallback
    -> a
    {- ^ /@connection@/: The 'GI.Gio.Objects.DBusConnection.DBusConnection' the name is being watched on, or
    'Nothing'. -}
    -> T.Text
    {- ^ /@name@/: The name being watched. -}
    -> Ptr ()
    {- ^ /@userData@/: User data passed to @/g_bus_watch_name()/@. -}
    -> m ()
dynamic_BusNameVanishedCallback __funPtr connection name userData = liftIO $ do
    connection' <- unsafeManagedPtrCastPtr connection
    name' <- textToCString name
    (__dynamic_C_BusNameVanishedCallback __funPtr) connection' name' userData
    touchManagedPtr connection
    freeMem name'
    return ()

foreign import ccall "wrapper"
    mk_BusNameVanishedCallback :: C_BusNameVanishedCallback -> IO (FunPtr C_BusNameVanishedCallback)

type BusNameVanishedCallback =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    IO ()

noBusNameVanishedCallback :: Maybe BusNameVanishedCallback
noBusNameVanishedCallback = Nothing

type BusNameVanishedCallback_WithClosures =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    Ptr () ->
    IO ()

noBusNameVanishedCallback_WithClosures :: Maybe BusNameVanishedCallback_WithClosures
noBusNameVanishedCallback_WithClosures = Nothing

drop_closures_BusNameVanishedCallback :: BusNameVanishedCallback -> BusNameVanishedCallback_WithClosures
drop_closures_BusNameVanishedCallback _f connection name _ = _f connection name

genClosure_BusNameVanishedCallback :: BusNameVanishedCallback -> IO Closure
genClosure_BusNameVanishedCallback cb = do
    let cb' = drop_closures_BusNameVanishedCallback cb
    let cb'' = wrap_BusNameVanishedCallback Nothing cb'
    mk_BusNameVanishedCallback cb'' >>= newCClosure


wrap_BusNameVanishedCallback ::
    Maybe (Ptr (FunPtr C_BusNameVanishedCallback)) ->
    BusNameVanishedCallback_WithClosures ->
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    Ptr () ->
    IO ()
wrap_BusNameVanishedCallback funptrptr _cb connection name userData = do
    connection' <- (newObject Gio.DBusConnection.DBusConnection) connection
    name' <- cstringToText name
    _cb  connection' name' userData
    maybeReleaseFunPtr funptrptr


-- callback BusNameLostCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #GDBusConnection on which to acquire the name or %NULL if\nthe connection was disconnected.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name being owned.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data passed to g_bus_own_name() or g_bus_own_name_on_connection().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Invoked when the name is lost or @connection has been closed.", sinceVersion = Just "2.26"}}
type C_BusNameLostCallback =
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #GDBusConnection on which to acquire the name or %NULL if\nthe connection was disconnected.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name being owned.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data passed to g_bus_own_name() or g_bus_own_name_on_connection().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_BusNameLostCallback :: FunPtr C_BusNameLostCallback -> C_BusNameLostCallback

dynamic_BusNameLostCallback ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a) =>
    FunPtr C_BusNameLostCallback
    -> a
    {- ^ /@connection@/: The 'GI.Gio.Objects.DBusConnection.DBusConnection' on which to acquire the name or 'Nothing' if
the connection was disconnected. -}
    -> T.Text
    {- ^ /@name@/: The name being owned. -}
    -> Ptr ()
    {- ^ /@userData@/: User data passed to @/g_bus_own_name()/@ or @/g_bus_own_name_on_connection()/@. -}
    -> m ()
dynamic_BusNameLostCallback __funPtr connection name userData = liftIO $ do
    connection' <- unsafeManagedPtrCastPtr connection
    name' <- textToCString name
    (__dynamic_C_BusNameLostCallback __funPtr) connection' name' userData
    touchManagedPtr connection
    freeMem name'
    return ()

foreign import ccall "wrapper"
    mk_BusNameLostCallback :: C_BusNameLostCallback -> IO (FunPtr C_BusNameLostCallback)

type BusNameLostCallback =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    IO ()

noBusNameLostCallback :: Maybe BusNameLostCallback
noBusNameLostCallback = Nothing

type BusNameLostCallback_WithClosures =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    Ptr () ->
    IO ()

noBusNameLostCallback_WithClosures :: Maybe BusNameLostCallback_WithClosures
noBusNameLostCallback_WithClosures = Nothing

drop_closures_BusNameLostCallback :: BusNameLostCallback -> BusNameLostCallback_WithClosures
drop_closures_BusNameLostCallback _f connection name _ = _f connection name

genClosure_BusNameLostCallback :: BusNameLostCallback -> IO Closure
genClosure_BusNameLostCallback cb = do
    let cb' = drop_closures_BusNameLostCallback cb
    let cb'' = wrap_BusNameLostCallback Nothing cb'
    mk_BusNameLostCallback cb'' >>= newCClosure


wrap_BusNameLostCallback ::
    Maybe (Ptr (FunPtr C_BusNameLostCallback)) ->
    BusNameLostCallback_WithClosures ->
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    Ptr () ->
    IO ()
wrap_BusNameLostCallback funptrptr _cb connection name userData = do
    connection' <- (newObject Gio.DBusConnection.DBusConnection) connection
    name' <- cstringToText name
    _cb  connection' name' userData
    maybeReleaseFunPtr funptrptr


-- callback BusNameAppearedCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #GDBusConnection the name is being watched on.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name being watched.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name_owner", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Unique name of the owner of the name being watched.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data passed to g_bus_watch_name().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 3, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Invoked when the name being watched is known to have to have a owner.", sinceVersion = Just "2.26"}}
type C_BusNameAppearedCallback =
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    CString ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #GDBusConnection the name is being watched on.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name being watched.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name_owner", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Unique name of the owner of the name being watched.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data passed to g_bus_watch_name().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 3, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_BusNameAppearedCallback :: FunPtr C_BusNameAppearedCallback -> C_BusNameAppearedCallback

dynamic_BusNameAppearedCallback ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a) =>
    FunPtr C_BusNameAppearedCallback
    -> a
    {- ^ /@connection@/: The 'GI.Gio.Objects.DBusConnection.DBusConnection' the name is being watched on. -}
    -> T.Text
    {- ^ /@name@/: The name being watched. -}
    -> T.Text
    {- ^ /@nameOwner@/: Unique name of the owner of the name being watched. -}
    -> Ptr ()
    {- ^ /@userData@/: User data passed to @/g_bus_watch_name()/@. -}
    -> m ()
dynamic_BusNameAppearedCallback __funPtr connection name nameOwner userData = liftIO $ do
    connection' <- unsafeManagedPtrCastPtr connection
    name' <- textToCString name
    nameOwner' <- textToCString nameOwner
    (__dynamic_C_BusNameAppearedCallback __funPtr) connection' name' nameOwner' userData
    touchManagedPtr connection
    freeMem name'
    freeMem nameOwner'
    return ()

foreign import ccall "wrapper"
    mk_BusNameAppearedCallback :: C_BusNameAppearedCallback -> IO (FunPtr C_BusNameAppearedCallback)

type BusNameAppearedCallback =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    T.Text ->
    IO ()

noBusNameAppearedCallback :: Maybe BusNameAppearedCallback
noBusNameAppearedCallback = Nothing

type BusNameAppearedCallback_WithClosures =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    T.Text ->
    Ptr () ->
    IO ()

noBusNameAppearedCallback_WithClosures :: Maybe BusNameAppearedCallback_WithClosures
noBusNameAppearedCallback_WithClosures = Nothing

drop_closures_BusNameAppearedCallback :: BusNameAppearedCallback -> BusNameAppearedCallback_WithClosures
drop_closures_BusNameAppearedCallback _f connection name nameOwner _ = _f connection name nameOwner

genClosure_BusNameAppearedCallback :: BusNameAppearedCallback -> IO Closure
genClosure_BusNameAppearedCallback cb = do
    let cb' = drop_closures_BusNameAppearedCallback cb
    let cb'' = wrap_BusNameAppearedCallback Nothing cb'
    mk_BusNameAppearedCallback cb'' >>= newCClosure


wrap_BusNameAppearedCallback ::
    Maybe (Ptr (FunPtr C_BusNameAppearedCallback)) ->
    BusNameAppearedCallback_WithClosures ->
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    CString ->
    Ptr () ->
    IO ()
wrap_BusNameAppearedCallback funptrptr _cb connection name nameOwner userData = do
    connection' <- (newObject Gio.DBusConnection.DBusConnection) connection
    name' <- cstringToText name
    nameOwner' <- cstringToText nameOwner
    _cb  connection' name' nameOwner' userData
    maybeReleaseFunPtr funptrptr


-- callback BusNameAcquiredCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #GDBusConnection on which to acquired the name.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name being owned.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data passed to g_bus_own_name() or g_bus_own_name_on_connection().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Invoked when the name is acquired.", sinceVersion = Just "2.26"}}
type C_BusNameAcquiredCallback =
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #GDBusConnection on which to acquired the name.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name being owned.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data passed to g_bus_own_name() or g_bus_own_name_on_connection().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_BusNameAcquiredCallback :: FunPtr C_BusNameAcquiredCallback -> C_BusNameAcquiredCallback

dynamic_BusNameAcquiredCallback ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a) =>
    FunPtr C_BusNameAcquiredCallback
    -> a
    {- ^ /@connection@/: The 'GI.Gio.Objects.DBusConnection.DBusConnection' on which to acquired the name. -}
    -> T.Text
    {- ^ /@name@/: The name being owned. -}
    -> Ptr ()
    {- ^ /@userData@/: User data passed to @/g_bus_own_name()/@ or @/g_bus_own_name_on_connection()/@. -}
    -> m ()
dynamic_BusNameAcquiredCallback __funPtr connection name userData = liftIO $ do
    connection' <- unsafeManagedPtrCastPtr connection
    name' <- textToCString name
    (__dynamic_C_BusNameAcquiredCallback __funPtr) connection' name' userData
    touchManagedPtr connection
    freeMem name'
    return ()

foreign import ccall "wrapper"
    mk_BusNameAcquiredCallback :: C_BusNameAcquiredCallback -> IO (FunPtr C_BusNameAcquiredCallback)

type BusNameAcquiredCallback =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    IO ()

noBusNameAcquiredCallback :: Maybe BusNameAcquiredCallback
noBusNameAcquiredCallback = Nothing

type BusNameAcquiredCallback_WithClosures =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    Ptr () ->
    IO ()

noBusNameAcquiredCallback_WithClosures :: Maybe BusNameAcquiredCallback_WithClosures
noBusNameAcquiredCallback_WithClosures = Nothing

drop_closures_BusNameAcquiredCallback :: BusNameAcquiredCallback -> BusNameAcquiredCallback_WithClosures
drop_closures_BusNameAcquiredCallback _f connection name _ = _f connection name

genClosure_BusNameAcquiredCallback :: BusNameAcquiredCallback -> IO Closure
genClosure_BusNameAcquiredCallback cb = do
    let cb' = drop_closures_BusNameAcquiredCallback cb
    let cb'' = wrap_BusNameAcquiredCallback Nothing cb'
    mk_BusNameAcquiredCallback cb'' >>= newCClosure


wrap_BusNameAcquiredCallback ::
    Maybe (Ptr (FunPtr C_BusNameAcquiredCallback)) ->
    BusNameAcquiredCallback_WithClosures ->
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    Ptr () ->
    IO ()
wrap_BusNameAcquiredCallback funptrptr _cb connection name userData = do
    connection' <- (newObject Gio.DBusConnection.DBusConnection) connection
    name' <- cstringToText name
    _cb  connection' name' userData
    maybeReleaseFunPtr funptrptr


-- callback BusAcquiredCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #GDBusConnection to a message bus.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name that is requested to be owned.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data passed to g_bus_own_name().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Invoked when a connection to a message bus has been obtained.", sinceVersion = Just "2.26"}}
type C_BusAcquiredCallback =
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #GDBusConnection to a message bus.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The name that is requested to be owned.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data passed to g_bus_own_name().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_BusAcquiredCallback :: FunPtr C_BusAcquiredCallback -> C_BusAcquiredCallback

dynamic_BusAcquiredCallback ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a) =>
    FunPtr C_BusAcquiredCallback
    -> a
    {- ^ /@connection@/: The 'GI.Gio.Objects.DBusConnection.DBusConnection' to a message bus. -}
    -> T.Text
    {- ^ /@name@/: The name that is requested to be owned. -}
    -> Ptr ()
    {- ^ /@userData@/: User data passed to @/g_bus_own_name()/@. -}
    -> m ()
dynamic_BusAcquiredCallback __funPtr connection name userData = liftIO $ do
    connection' <- unsafeManagedPtrCastPtr connection
    name' <- textToCString name
    (__dynamic_C_BusAcquiredCallback __funPtr) connection' name' userData
    touchManagedPtr connection
    freeMem name'
    return ()

foreign import ccall "wrapper"
    mk_BusAcquiredCallback :: C_BusAcquiredCallback -> IO (FunPtr C_BusAcquiredCallback)

type BusAcquiredCallback =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    IO ()

noBusAcquiredCallback :: Maybe BusAcquiredCallback
noBusAcquiredCallback = Nothing

type BusAcquiredCallback_WithClosures =
    Gio.DBusConnection.DBusConnection ->
    T.Text ->
    Ptr () ->
    IO ()

noBusAcquiredCallback_WithClosures :: Maybe BusAcquiredCallback_WithClosures
noBusAcquiredCallback_WithClosures = Nothing

drop_closures_BusAcquiredCallback :: BusAcquiredCallback -> BusAcquiredCallback_WithClosures
drop_closures_BusAcquiredCallback _f connection name _ = _f connection name

genClosure_BusAcquiredCallback :: BusAcquiredCallback -> IO Closure
genClosure_BusAcquiredCallback cb = do
    let cb' = drop_closures_BusAcquiredCallback cb
    let cb'' = wrap_BusAcquiredCallback Nothing cb'
    mk_BusAcquiredCallback cb'' >>= newCClosure


wrap_BusAcquiredCallback ::
    Maybe (Ptr (FunPtr C_BusAcquiredCallback)) ->
    BusAcquiredCallback_WithClosures ->
    Ptr Gio.DBusConnection.DBusConnection ->
    CString ->
    Ptr () ->
    IO ()
wrap_BusAcquiredCallback funptrptr _cb connection name userData = do
    connection' <- (newObject Gio.DBusConnection.DBusConnection) connection
    name' <- cstringToText name
    _cb  connection' name' userData
    maybeReleaseFunPtr funptrptr


-- callback AsyncReadyCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "source_object", argType = TInterface (Name {namespace = "GObject", name = "Object"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the object the asynchronous operation was started with.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "res", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GAsyncResult.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to the callback.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Type definition for a function that will be called back when an asynchronous\noperation within GIO has been completed.", sinceVersion = Nothing}}
type C_AsyncReadyCallback =
    Ptr GObject.Object.Object ->
    Ptr Gio.AsyncResult.AsyncResult ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "source_object", argType = TInterface (Name {namespace = "GObject", name = "Object"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the object the asynchronous operation was started with.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "res", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GAsyncResult.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to the callback.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_AsyncReadyCallback :: FunPtr C_AsyncReadyCallback -> C_AsyncReadyCallback

dynamic_AsyncReadyCallback ::
    (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a, Gio.AsyncResult.IsAsyncResult b) =>
    FunPtr C_AsyncReadyCallback
    -> a
    {- ^ /@sourceObject@/: the object the asynchronous operation was started with. -}
    -> b
    {- ^ /@res@/: a 'GI.Gio.Interfaces.AsyncResult.AsyncResult'. -}
    -> Ptr ()
    {- ^ /@userData@/: user data passed to the callback. -}
    -> m ()
dynamic_AsyncReadyCallback __funPtr sourceObject res userData = liftIO $ do
    sourceObject' <- unsafeManagedPtrCastPtr sourceObject
    res' <- unsafeManagedPtrCastPtr res
    (__dynamic_C_AsyncReadyCallback __funPtr) sourceObject' res' userData
    touchManagedPtr sourceObject
    touchManagedPtr res
    return ()

foreign import ccall "wrapper"
    mk_AsyncReadyCallback :: C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)

type AsyncReadyCallback =
    GObject.Object.Object ->
    Gio.AsyncResult.AsyncResult ->
    IO ()

noAsyncReadyCallback :: Maybe AsyncReadyCallback
noAsyncReadyCallback = Nothing

type AsyncReadyCallback_WithClosures =
    GObject.Object.Object ->
    Gio.AsyncResult.AsyncResult ->
    Ptr () ->
    IO ()

noAsyncReadyCallback_WithClosures :: Maybe AsyncReadyCallback_WithClosures
noAsyncReadyCallback_WithClosures = Nothing

drop_closures_AsyncReadyCallback :: AsyncReadyCallback -> AsyncReadyCallback_WithClosures
drop_closures_AsyncReadyCallback _f sourceObject res _ = _f sourceObject res

genClosure_AsyncReadyCallback :: AsyncReadyCallback -> IO Closure
genClosure_AsyncReadyCallback cb = do
    let cb' = drop_closures_AsyncReadyCallback cb
    let cb'' = wrap_AsyncReadyCallback Nothing cb'
    mk_AsyncReadyCallback cb'' >>= newCClosure


wrap_AsyncReadyCallback ::
    Maybe (Ptr (FunPtr C_AsyncReadyCallback)) ->
    AsyncReadyCallback_WithClosures ->
    Ptr GObject.Object.Object ->
    Ptr Gio.AsyncResult.AsyncResult ->
    Ptr () ->
    IO ()
wrap_AsyncReadyCallback funptrptr _cb sourceObject res userData = do
    sourceObject' <- (newObject GObject.Object.Object) sourceObject
    res' <- (newObject Gio.AsyncResult.AsyncResult) res
    _cb  sourceObject' res' userData
    maybeReleaseFunPtr funptrptr


-- callback ActionEntryChangeStateFieldCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "action", argType = TInterface (Name {namespace = "Gio", name = "SimpleAction"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TVariant, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}}
type C_ActionEntryChangeStateFieldCallback =
    Ptr Gio.SimpleAction.SimpleAction ->
    Ptr GVariant ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "action", argType = TInterface (Name {namespace = "Gio", name = "SimpleAction"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TVariant, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_ActionEntryChangeStateFieldCallback :: FunPtr C_ActionEntryChangeStateFieldCallback -> C_ActionEntryChangeStateFieldCallback

dynamic_ActionEntryChangeStateFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.SimpleAction.IsSimpleAction a) =>
    FunPtr C_ActionEntryChangeStateFieldCallback
    -> a
    -> GVariant
    -> Ptr ()
    -> m ()
dynamic_ActionEntryChangeStateFieldCallback __funPtr action value userData = liftIO $ do
    action' <- unsafeManagedPtrCastPtr action
    value' <- unsafeManagedPtrGetPtr value
    (__dynamic_C_ActionEntryChangeStateFieldCallback __funPtr) action' value' userData
    touchManagedPtr action
    touchManagedPtr value
    return ()

foreign import ccall "wrapper"
    mk_ActionEntryChangeStateFieldCallback :: C_ActionEntryChangeStateFieldCallback -> IO (FunPtr C_ActionEntryChangeStateFieldCallback)

type ActionEntryChangeStateFieldCallback =
    Gio.SimpleAction.SimpleAction ->
    GVariant ->
    IO ()

noActionEntryChangeStateFieldCallback :: Maybe ActionEntryChangeStateFieldCallback
noActionEntryChangeStateFieldCallback = Nothing

type ActionEntryChangeStateFieldCallback_WithClosures =
    Gio.SimpleAction.SimpleAction ->
    GVariant ->
    Ptr () ->
    IO ()

noActionEntryChangeStateFieldCallback_WithClosures :: Maybe ActionEntryChangeStateFieldCallback_WithClosures
noActionEntryChangeStateFieldCallback_WithClosures = Nothing

drop_closures_ActionEntryChangeStateFieldCallback :: ActionEntryChangeStateFieldCallback -> ActionEntryChangeStateFieldCallback_WithClosures
drop_closures_ActionEntryChangeStateFieldCallback _f action value _ = _f action value

genClosure_ActionEntryChangeStateFieldCallback :: ActionEntryChangeStateFieldCallback -> IO Closure
genClosure_ActionEntryChangeStateFieldCallback cb = do
    let cb' = drop_closures_ActionEntryChangeStateFieldCallback cb
    let cb'' = wrap_ActionEntryChangeStateFieldCallback Nothing cb'
    mk_ActionEntryChangeStateFieldCallback cb'' >>= newCClosure


wrap_ActionEntryChangeStateFieldCallback ::
    Maybe (Ptr (FunPtr C_ActionEntryChangeStateFieldCallback)) ->
    ActionEntryChangeStateFieldCallback_WithClosures ->
    Ptr Gio.SimpleAction.SimpleAction ->
    Ptr GVariant ->
    Ptr () ->
    IO ()
wrap_ActionEntryChangeStateFieldCallback funptrptr _cb action value userData = do
    action' <- (newObject Gio.SimpleAction.SimpleAction) action
    value' <- newGVariantFromPtr value
    _cb  action' value' userData
    maybeReleaseFunPtr funptrptr


-- callback ActionEntryActivateFieldCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "action", argType = TInterface (Name {namespace = "Gio", name = "SimpleAction"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parameter", argType = TVariant, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}}
type C_ActionEntryActivateFieldCallback =
    Ptr Gio.SimpleAction.SimpleAction ->
    Ptr GVariant ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "action", argType = TInterface (Name {namespace = "Gio", name = "SimpleAction"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parameter", argType = TVariant, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_ActionEntryActivateFieldCallback :: FunPtr C_ActionEntryActivateFieldCallback -> C_ActionEntryActivateFieldCallback

dynamic_ActionEntryActivateFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.SimpleAction.IsSimpleAction a) =>
    FunPtr C_ActionEntryActivateFieldCallback
    -> a
    -> GVariant
    -> Ptr ()
    -> m ()
dynamic_ActionEntryActivateFieldCallback __funPtr action parameter userData = liftIO $ do
    action' <- unsafeManagedPtrCastPtr action
    parameter' <- unsafeManagedPtrGetPtr parameter
    (__dynamic_C_ActionEntryActivateFieldCallback __funPtr) action' parameter' userData
    touchManagedPtr action
    touchManagedPtr parameter
    return ()

foreign import ccall "wrapper"
    mk_ActionEntryActivateFieldCallback :: C_ActionEntryActivateFieldCallback -> IO (FunPtr C_ActionEntryActivateFieldCallback)

type ActionEntryActivateFieldCallback =
    Gio.SimpleAction.SimpleAction ->
    GVariant ->
    IO ()

noActionEntryActivateFieldCallback :: Maybe ActionEntryActivateFieldCallback
noActionEntryActivateFieldCallback = Nothing

type ActionEntryActivateFieldCallback_WithClosures =
    Gio.SimpleAction.SimpleAction ->
    GVariant ->
    Ptr () ->
    IO ()

noActionEntryActivateFieldCallback_WithClosures :: Maybe ActionEntryActivateFieldCallback_WithClosures
noActionEntryActivateFieldCallback_WithClosures = Nothing

drop_closures_ActionEntryActivateFieldCallback :: ActionEntryActivateFieldCallback -> ActionEntryActivateFieldCallback_WithClosures
drop_closures_ActionEntryActivateFieldCallback _f action parameter _ = _f action parameter

genClosure_ActionEntryActivateFieldCallback :: ActionEntryActivateFieldCallback -> IO Closure
genClosure_ActionEntryActivateFieldCallback cb = do
    let cb' = drop_closures_ActionEntryActivateFieldCallback cb
    let cb'' = wrap_ActionEntryActivateFieldCallback Nothing cb'
    mk_ActionEntryActivateFieldCallback cb'' >>= newCClosure


wrap_ActionEntryActivateFieldCallback ::
    Maybe (Ptr (FunPtr C_ActionEntryActivateFieldCallback)) ->
    ActionEntryActivateFieldCallback_WithClosures ->
    Ptr Gio.SimpleAction.SimpleAction ->
    Ptr GVariant ->
    Ptr () ->
    IO ()
wrap_ActionEntryActivateFieldCallback funptrptr _cb action parameter userData = do
    action' <- (newObject Gio.SimpleAction.SimpleAction) action
    parameter' <- newGVariantFromPtr parameter
    _cb  action' parameter' userData
    maybeReleaseFunPtr funptrptr