-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.GLib.Callbacks
    ( 

 -- * Signals
-- ** ChildWatchFunc #signal:ChildWatchFunc#

    C_ChildWatchFunc                        ,
    ChildWatchFunc                          ,
    ChildWatchFunc_WithClosures             ,
    drop_closures_ChildWatchFunc            ,
    dynamic_ChildWatchFunc                  ,
    genClosure_ChildWatchFunc               ,
    mk_ChildWatchFunc                       ,
    noChildWatchFunc                        ,
    noChildWatchFunc_WithClosures           ,
    wrap_ChildWatchFunc                     ,


-- ** ClearHandleFunc #signal:ClearHandleFunc#

    C_ClearHandleFunc                       ,
    ClearHandleFunc                         ,
    dynamic_ClearHandleFunc                 ,
    genClosure_ClearHandleFunc              ,
    mk_ClearHandleFunc                      ,
    noClearHandleFunc                       ,
    wrap_ClearHandleFunc                    ,


-- ** CompareDataFunc #signal:CompareDataFunc#

    C_CompareDataFunc                       ,
    CompareDataFunc                         ,
    CompareDataFunc_WithClosures            ,
    drop_closures_CompareDataFunc           ,
    dynamic_CompareDataFunc                 ,
    genClosure_CompareDataFunc              ,
    mk_CompareDataFunc                      ,
    noCompareDataFunc                       ,
    noCompareDataFunc_WithClosures          ,
    wrap_CompareDataFunc                    ,


-- ** CompareFunc #signal:CompareFunc#

    C_CompareFunc                           ,
    CompareFunc                             ,
    dynamic_CompareFunc                     ,
    genClosure_CompareFunc                  ,
    mk_CompareFunc                          ,
    noCompareFunc                           ,
    wrap_CompareFunc                        ,


-- ** CopyFunc #signal:CopyFunc#

    C_CopyFunc                              ,
    CopyFunc                                ,
    dynamic_CopyFunc                        ,
    genClosure_CopyFunc                     ,
    mk_CopyFunc                             ,
    noCopyFunc                              ,
    wrap_CopyFunc                           ,


-- ** DataForeachFunc #signal:DataForeachFunc#

    C_DataForeachFunc                       ,
    DataForeachFunc                         ,
    DataForeachFunc_WithClosures            ,
    drop_closures_DataForeachFunc           ,
    dynamic_DataForeachFunc                 ,
    genClosure_DataForeachFunc              ,
    mk_DataForeachFunc                      ,
    noDataForeachFunc                       ,
    noDataForeachFunc_WithClosures          ,
    wrap_DataForeachFunc                    ,


-- ** DestroyNotify #signal:DestroyNotify#

    C_DestroyNotify                         ,
    DestroyNotify                           ,
    dynamic_DestroyNotify                   ,
    genClosure_DestroyNotify                ,
    mk_DestroyNotify                        ,
    noDestroyNotify                         ,
    wrap_DestroyNotify                      ,


-- ** DuplicateFunc #signal:DuplicateFunc#

    C_DuplicateFunc                         ,
    DuplicateFunc                           ,
    DuplicateFunc_WithClosures              ,
    drop_closures_DuplicateFunc             ,
    dynamic_DuplicateFunc                   ,
    genClosure_DuplicateFunc                ,
    mk_DuplicateFunc                        ,
    noDuplicateFunc                         ,
    noDuplicateFunc_WithClosures            ,
    wrap_DuplicateFunc                      ,


-- ** EqualFunc #signal:EqualFunc#

    C_EqualFunc                             ,
    EqualFunc                               ,
    dynamic_EqualFunc                       ,
    genClosure_EqualFunc                    ,
    mk_EqualFunc                            ,
    noEqualFunc                             ,
    wrap_EqualFunc                          ,


-- ** FreeFunc #signal:FreeFunc#

    C_FreeFunc                              ,
    FreeFunc                                ,
    dynamic_FreeFunc                        ,
    genClosure_FreeFunc                     ,
    mk_FreeFunc                             ,
    noFreeFunc                              ,
    wrap_FreeFunc                           ,


-- ** Func #signal:Func#

    C_Func                                  ,
    Func                                    ,
    Func_WithClosures                       ,
    drop_closures_Func                      ,
    dynamic_Func                            ,
    genClosure_Func                         ,
    mk_Func                                 ,
    noFunc                                  ,
    noFunc_WithClosures                     ,
    wrap_Func                               ,


-- ** HFunc #signal:HFunc#

    C_HFunc                                 ,
    HFunc                                   ,
    HFunc_WithClosures                      ,
    drop_closures_HFunc                     ,
    dynamic_HFunc                           ,
    genClosure_HFunc                        ,
    mk_HFunc                                ,
    noHFunc                                 ,
    noHFunc_WithClosures                    ,
    wrap_HFunc                              ,


-- ** HRFunc #signal:HRFunc#

    C_HRFunc                                ,
    HRFunc                                  ,
    HRFunc_WithClosures                     ,
    drop_closures_HRFunc                    ,
    dynamic_HRFunc                          ,
    genClosure_HRFunc                       ,
    mk_HRFunc                               ,
    noHRFunc                                ,
    noHRFunc_WithClosures                   ,
    wrap_HRFunc                             ,


-- ** HashFunc #signal:HashFunc#

    C_HashFunc                              ,
    HashFunc                                ,
    dynamic_HashFunc                        ,
    genClosure_HashFunc                     ,
    mk_HashFunc                             ,
    noHashFunc                              ,
    wrap_HashFunc                           ,


-- ** HookCheckFunc #signal:HookCheckFunc#

    C_HookCheckFunc                         ,
    HookCheckFunc                           ,
    dynamic_HookCheckFunc                   ,
    genClosure_HookCheckFunc                ,
    mk_HookCheckFunc                        ,
    noHookCheckFunc                         ,
    wrap_HookCheckFunc                      ,


-- ** HookCheckMarshaller #signal:HookCheckMarshaller#

    C_HookCheckMarshaller                   ,
    HookCheckMarshaller                     ,
    dynamic_HookCheckMarshaller             ,
    genClosure_HookCheckMarshaller          ,
    mk_HookCheckMarshaller                  ,
    noHookCheckMarshaller                   ,
    wrap_HookCheckMarshaller                ,


-- ** HookCompareFunc #signal:HookCompareFunc#

    C_HookCompareFunc                       ,
    HookCompareFunc                         ,
    dynamic_HookCompareFunc                 ,
    genClosure_HookCompareFunc              ,
    mk_HookCompareFunc                      ,
    noHookCompareFunc                       ,
    wrap_HookCompareFunc                    ,


-- ** HookFinalizeFunc #signal:HookFinalizeFunc#

    C_HookFinalizeFunc                      ,
    HookFinalizeFunc                        ,
    dynamic_HookFinalizeFunc                ,
    genClosure_HookFinalizeFunc             ,
    mk_HookFinalizeFunc                     ,
    noHookFinalizeFunc                      ,
    wrap_HookFinalizeFunc                   ,


-- ** HookFindFunc #signal:HookFindFunc#

    C_HookFindFunc                          ,
    HookFindFunc                            ,
    dynamic_HookFindFunc                    ,
    genClosure_HookFindFunc                 ,
    mk_HookFindFunc                         ,
    noHookFindFunc                          ,
    wrap_HookFindFunc                       ,


-- ** HookFunc #signal:HookFunc#

    C_HookFunc                              ,
    HookFunc                                ,
    dynamic_HookFunc                        ,
    genClosure_HookFunc                     ,
    mk_HookFunc                             ,
    noHookFunc                              ,
    wrap_HookFunc                           ,


-- ** HookMarshaller #signal:HookMarshaller#

    C_HookMarshaller                        ,
    HookMarshaller                          ,
    dynamic_HookMarshaller                  ,
    genClosure_HookMarshaller               ,
    mk_HookMarshaller                       ,
    noHookMarshaller                        ,
    wrap_HookMarshaller                     ,


-- ** IOFunc #signal:IOFunc#

    C_IOFunc                                ,
    IOFunc                                  ,
    dynamic_IOFunc                          ,
    genClosure_IOFunc                       ,
    mk_IOFunc                               ,
    noIOFunc                                ,
    wrap_IOFunc                             ,


-- ** IOFuncsIoCloseFieldCallback #signal:IOFuncsIoCloseFieldCallback#

    C_IOFuncsIoCloseFieldCallback           ,
    IOFuncsIoCloseFieldCallback             ,
    dynamic_IOFuncsIoCloseFieldCallback     ,
    mk_IOFuncsIoCloseFieldCallback          ,
    noIOFuncsIoCloseFieldCallback           ,


-- ** IOFuncsIoCreateWatchFieldCallback #signal:IOFuncsIoCreateWatchFieldCallback#

    C_IOFuncsIoCreateWatchFieldCallback     ,
    IOFuncsIoCreateWatchFieldCallback       ,
    dynamic_IOFuncsIoCreateWatchFieldCallback,
    genClosure_IOFuncsIoCreateWatchFieldCallback,
    mk_IOFuncsIoCreateWatchFieldCallback    ,
    noIOFuncsIoCreateWatchFieldCallback     ,
    wrap_IOFuncsIoCreateWatchFieldCallback  ,


-- ** IOFuncsIoFreeFieldCallback #signal:IOFuncsIoFreeFieldCallback#

    C_IOFuncsIoFreeFieldCallback            ,
    IOFuncsIoFreeFieldCallback              ,
    dynamic_IOFuncsIoFreeFieldCallback      ,
    genClosure_IOFuncsIoFreeFieldCallback   ,
    mk_IOFuncsIoFreeFieldCallback           ,
    noIOFuncsIoFreeFieldCallback            ,
    wrap_IOFuncsIoFreeFieldCallback         ,


-- ** IOFuncsIoGetFlagsFieldCallback #signal:IOFuncsIoGetFlagsFieldCallback#

    C_IOFuncsIoGetFlagsFieldCallback        ,
    IOFuncsIoGetFlagsFieldCallback          ,
    dynamic_IOFuncsIoGetFlagsFieldCallback  ,
    genClosure_IOFuncsIoGetFlagsFieldCallback,
    mk_IOFuncsIoGetFlagsFieldCallback       ,
    noIOFuncsIoGetFlagsFieldCallback        ,
    wrap_IOFuncsIoGetFlagsFieldCallback     ,


-- ** IOFuncsIoReadFieldCallback #signal:IOFuncsIoReadFieldCallback#

    C_IOFuncsIoReadFieldCallback            ,
    IOFuncsIoReadFieldCallback              ,
    dynamic_IOFuncsIoReadFieldCallback      ,
    mk_IOFuncsIoReadFieldCallback           ,
    noIOFuncsIoReadFieldCallback            ,


-- ** IOFuncsIoSeekFieldCallback #signal:IOFuncsIoSeekFieldCallback#

    C_IOFuncsIoSeekFieldCallback            ,
    IOFuncsIoSeekFieldCallback              ,
    dynamic_IOFuncsIoSeekFieldCallback      ,
    mk_IOFuncsIoSeekFieldCallback           ,
    noIOFuncsIoSeekFieldCallback            ,


-- ** IOFuncsIoSetFlagsFieldCallback #signal:IOFuncsIoSetFlagsFieldCallback#

    C_IOFuncsIoSetFlagsFieldCallback        ,
    IOFuncsIoSetFlagsFieldCallback          ,
    dynamic_IOFuncsIoSetFlagsFieldCallback  ,
    mk_IOFuncsIoSetFlagsFieldCallback       ,
    noIOFuncsIoSetFlagsFieldCallback        ,


-- ** IOFuncsIoWriteFieldCallback #signal:IOFuncsIoWriteFieldCallback#

    C_IOFuncsIoWriteFieldCallback           ,
    IOFuncsIoWriteFieldCallback             ,
    dynamic_IOFuncsIoWriteFieldCallback     ,
    mk_IOFuncsIoWriteFieldCallback          ,
    noIOFuncsIoWriteFieldCallback           ,


-- ** LogFunc #signal:LogFunc#

    C_LogFunc                               ,
    LogFunc                                 ,
    LogFunc_WithClosures                    ,
    drop_closures_LogFunc                   ,
    dynamic_LogFunc                         ,
    genClosure_LogFunc                      ,
    mk_LogFunc                              ,
    noLogFunc                               ,
    noLogFunc_WithClosures                  ,
    wrap_LogFunc                            ,


-- ** LogWriterFunc #signal:LogWriterFunc#

    C_LogWriterFunc                         ,
    LogWriterFunc                           ,
    LogWriterFunc_WithClosures              ,
    drop_closures_LogWriterFunc             ,
    dynamic_LogWriterFunc                   ,
    genClosure_LogWriterFunc                ,
    mk_LogWriterFunc                        ,
    noLogWriterFunc                         ,
    noLogWriterFunc_WithClosures            ,
    wrap_LogWriterFunc                      ,


-- ** MarkupParserEndElementFieldCallback #signal:MarkupParserEndElementFieldCallback#

    C_MarkupParserEndElementFieldCallback   ,
    MarkupParserEndElementFieldCallback     ,
    MarkupParserEndElementFieldCallback_WithClosures,
    drop_closures_MarkupParserEndElementFieldCallback,
    dynamic_MarkupParserEndElementFieldCallback,
    mk_MarkupParserEndElementFieldCallback  ,
    noMarkupParserEndElementFieldCallback   ,
    noMarkupParserEndElementFieldCallback_WithClosures,


-- ** MarkupParserErrorFieldCallback #signal:MarkupParserErrorFieldCallback#

    C_MarkupParserErrorFieldCallback        ,
    MarkupParserErrorFieldCallback          ,
    MarkupParserErrorFieldCallback_WithClosures,
    drop_closures_MarkupParserErrorFieldCallback,
    dynamic_MarkupParserErrorFieldCallback  ,
    genClosure_MarkupParserErrorFieldCallback,
    mk_MarkupParserErrorFieldCallback       ,
    noMarkupParserErrorFieldCallback        ,
    noMarkupParserErrorFieldCallback_WithClosures,
    wrap_MarkupParserErrorFieldCallback     ,


-- ** MarkupParserPassthroughFieldCallback #signal:MarkupParserPassthroughFieldCallback#

    C_MarkupParserPassthroughFieldCallback  ,
    MarkupParserPassthroughFieldCallback    ,
    MarkupParserPassthroughFieldCallback_WithClosures,
    drop_closures_MarkupParserPassthroughFieldCallback,
    dynamic_MarkupParserPassthroughFieldCallback,
    mk_MarkupParserPassthroughFieldCallback ,
    noMarkupParserPassthroughFieldCallback  ,
    noMarkupParserPassthroughFieldCallback_WithClosures,


-- ** MarkupParserStartElementFieldCallback #signal:MarkupParserStartElementFieldCallback#

    C_MarkupParserStartElementFieldCallback ,
    MarkupParserStartElementFieldCallback   ,
    MarkupParserStartElementFieldCallback_WithClosures,
    drop_closures_MarkupParserStartElementFieldCallback,
    dynamic_MarkupParserStartElementFieldCallback,
    mk_MarkupParserStartElementFieldCallback,
    noMarkupParserStartElementFieldCallback ,
    noMarkupParserStartElementFieldCallback_WithClosures,


-- ** MarkupParserTextFieldCallback #signal:MarkupParserTextFieldCallback#

    C_MarkupParserTextFieldCallback         ,
    MarkupParserTextFieldCallback           ,
    MarkupParserTextFieldCallback_WithClosures,
    drop_closures_MarkupParserTextFieldCallback,
    dynamic_MarkupParserTextFieldCallback   ,
    mk_MarkupParserTextFieldCallback        ,
    noMarkupParserTextFieldCallback         ,
    noMarkupParserTextFieldCallback_WithClosures,


-- ** MemVTableCallocFieldCallback #signal:MemVTableCallocFieldCallback#

    C_MemVTableCallocFieldCallback          ,
    MemVTableCallocFieldCallback            ,
    dynamic_MemVTableCallocFieldCallback    ,
    genClosure_MemVTableCallocFieldCallback ,
    mk_MemVTableCallocFieldCallback         ,
    noMemVTableCallocFieldCallback          ,
    wrap_MemVTableCallocFieldCallback       ,


-- ** MemVTableFreeFieldCallback #signal:MemVTableFreeFieldCallback#

    C_MemVTableFreeFieldCallback            ,
    MemVTableFreeFieldCallback              ,
    dynamic_MemVTableFreeFieldCallback      ,
    genClosure_MemVTableFreeFieldCallback   ,
    mk_MemVTableFreeFieldCallback           ,
    noMemVTableFreeFieldCallback            ,
    wrap_MemVTableFreeFieldCallback         ,


-- ** MemVTableMallocFieldCallback #signal:MemVTableMallocFieldCallback#

    C_MemVTableMallocFieldCallback          ,
    MemVTableMallocFieldCallback            ,
    dynamic_MemVTableMallocFieldCallback    ,
    genClosure_MemVTableMallocFieldCallback ,
    mk_MemVTableMallocFieldCallback         ,
    noMemVTableMallocFieldCallback          ,
    wrap_MemVTableMallocFieldCallback       ,


-- ** MemVTableReallocFieldCallback #signal:MemVTableReallocFieldCallback#

    C_MemVTableReallocFieldCallback         ,
    MemVTableReallocFieldCallback           ,
    dynamic_MemVTableReallocFieldCallback   ,
    genClosure_MemVTableReallocFieldCallback,
    mk_MemVTableReallocFieldCallback        ,
    noMemVTableReallocFieldCallback         ,
    wrap_MemVTableReallocFieldCallback      ,


-- ** MemVTableTryMallocFieldCallback #signal:MemVTableTryMallocFieldCallback#

    C_MemVTableTryMallocFieldCallback       ,
    MemVTableTryMallocFieldCallback         ,
    dynamic_MemVTableTryMallocFieldCallback ,
    genClosure_MemVTableTryMallocFieldCallback,
    mk_MemVTableTryMallocFieldCallback      ,
    noMemVTableTryMallocFieldCallback       ,
    wrap_MemVTableTryMallocFieldCallback    ,


-- ** MemVTableTryReallocFieldCallback #signal:MemVTableTryReallocFieldCallback#

    C_MemVTableTryReallocFieldCallback      ,
    MemVTableTryReallocFieldCallback        ,
    dynamic_MemVTableTryReallocFieldCallback,
    genClosure_MemVTableTryReallocFieldCallback,
    mk_MemVTableTryReallocFieldCallback     ,
    noMemVTableTryReallocFieldCallback      ,
    wrap_MemVTableTryReallocFieldCallback   ,


-- ** NodeForeachFunc #signal:NodeForeachFunc#

    C_NodeForeachFunc                       ,
    NodeForeachFunc                         ,
    dynamic_NodeForeachFunc                 ,
    genClosure_NodeForeachFunc              ,
    mk_NodeForeachFunc                      ,
    noNodeForeachFunc                       ,
    wrap_NodeForeachFunc                    ,


-- ** NodeTraverseFunc #signal:NodeTraverseFunc#

    C_NodeTraverseFunc                      ,
    NodeTraverseFunc                        ,
    dynamic_NodeTraverseFunc                ,
    genClosure_NodeTraverseFunc             ,
    mk_NodeTraverseFunc                     ,
    noNodeTraverseFunc                      ,
    wrap_NodeTraverseFunc                   ,


-- ** OptionArgFunc #signal:OptionArgFunc#

    C_OptionArgFunc                         ,
    OptionArgFunc                           ,
    dynamic_OptionArgFunc                   ,
    mk_OptionArgFunc                        ,
    noOptionArgFunc                         ,


-- ** OptionErrorFunc #signal:OptionErrorFunc#

    C_OptionErrorFunc                       ,
    OptionErrorFunc                         ,
    dynamic_OptionErrorFunc                 ,
    mk_OptionErrorFunc                      ,
    noOptionErrorFunc                       ,


-- ** OptionParseFunc #signal:OptionParseFunc#

    C_OptionParseFunc                       ,
    OptionParseFunc                         ,
    dynamic_OptionParseFunc                 ,
    mk_OptionParseFunc                      ,
    noOptionParseFunc                       ,


-- ** PollFunc #signal:PollFunc#

    C_PollFunc                              ,
    PollFunc                                ,
    dynamic_PollFunc                        ,
    genClosure_PollFunc                     ,
    mk_PollFunc                             ,
    noPollFunc                              ,
    wrap_PollFunc                           ,


-- ** PrintFunc #signal:PrintFunc#

    C_PrintFunc                             ,
    PrintFunc                               ,
    dynamic_PrintFunc                       ,
    genClosure_PrintFunc                    ,
    mk_PrintFunc                            ,
    noPrintFunc                             ,
    wrap_PrintFunc                          ,


-- ** RegexEvalCallback #signal:RegexEvalCallback#

    C_RegexEvalCallback                     ,
    RegexEvalCallback                       ,
    RegexEvalCallback_WithClosures          ,
    drop_closures_RegexEvalCallback         ,
    dynamic_RegexEvalCallback               ,
    genClosure_RegexEvalCallback            ,
    mk_RegexEvalCallback                    ,
    noRegexEvalCallback                     ,
    noRegexEvalCallback_WithClosures        ,
    wrap_RegexEvalCallback                  ,


-- ** ScannerMsgFunc #signal:ScannerMsgFunc#

    C_ScannerMsgFunc                        ,
    ScannerMsgFunc                          ,
    dynamic_ScannerMsgFunc                  ,
    genClosure_ScannerMsgFunc               ,
    mk_ScannerMsgFunc                       ,
    noScannerMsgFunc                        ,
    wrap_ScannerMsgFunc                     ,


-- ** SequenceIterCompareFunc #signal:SequenceIterCompareFunc#

    C_SequenceIterCompareFunc               ,
    SequenceIterCompareFunc                 ,
    dynamic_SequenceIterCompareFunc         ,
    genClosure_SequenceIterCompareFunc      ,
    mk_SequenceIterCompareFunc              ,
    noSequenceIterCompareFunc               ,
    wrap_SequenceIterCompareFunc            ,


-- ** SourceCallbackFuncsRefFieldCallback #signal:SourceCallbackFuncsRefFieldCallback#

    C_SourceCallbackFuncsRefFieldCallback   ,
    SourceCallbackFuncsRefFieldCallback     ,
    dynamic_SourceCallbackFuncsRefFieldCallback,
    genClosure_SourceCallbackFuncsRefFieldCallback,
    mk_SourceCallbackFuncsRefFieldCallback  ,
    noSourceCallbackFuncsRefFieldCallback   ,
    wrap_SourceCallbackFuncsRefFieldCallback,


-- ** SourceCallbackFuncsUnrefFieldCallback #signal:SourceCallbackFuncsUnrefFieldCallback#

    C_SourceCallbackFuncsUnrefFieldCallback ,
    SourceCallbackFuncsUnrefFieldCallback   ,
    dynamic_SourceCallbackFuncsUnrefFieldCallback,
    genClosure_SourceCallbackFuncsUnrefFieldCallback,
    mk_SourceCallbackFuncsUnrefFieldCallback,
    noSourceCallbackFuncsUnrefFieldCallback ,
    wrap_SourceCallbackFuncsUnrefFieldCallback,


-- ** SourceDisposeFunc #signal:SourceDisposeFunc#

    C_SourceDisposeFunc                     ,
    SourceDisposeFunc                       ,
    dynamic_SourceDisposeFunc               ,
    genClosure_SourceDisposeFunc            ,
    mk_SourceDisposeFunc                    ,
    noSourceDisposeFunc                     ,
    wrap_SourceDisposeFunc                  ,


-- ** SourceDummyMarshal #signal:SourceDummyMarshal#

    C_SourceDummyMarshal                    ,
    SourceDummyMarshal                      ,
    dynamic_SourceDummyMarshal              ,
    genClosure_SourceDummyMarshal           ,
    mk_SourceDummyMarshal                   ,
    noSourceDummyMarshal                    ,
    wrap_SourceDummyMarshal                 ,


-- ** SourceFunc #signal:SourceFunc#

    C_SourceFunc                            ,
    SourceFunc                              ,
    SourceFunc_WithClosures                 ,
    drop_closures_SourceFunc                ,
    dynamic_SourceFunc                      ,
    genClosure_SourceFunc                   ,
    mk_SourceFunc                           ,
    noSourceFunc                            ,
    noSourceFunc_WithClosures               ,
    wrap_SourceFunc                         ,


-- ** SourceFuncsCheckFieldCallback #signal:SourceFuncsCheckFieldCallback#

    C_SourceFuncsCheckFieldCallback         ,
    SourceFuncsCheckFieldCallback           ,
    dynamic_SourceFuncsCheckFieldCallback   ,
    genClosure_SourceFuncsCheckFieldCallback,
    mk_SourceFuncsCheckFieldCallback        ,
    noSourceFuncsCheckFieldCallback         ,
    wrap_SourceFuncsCheckFieldCallback      ,


-- ** SourceFuncsFinalizeFieldCallback #signal:SourceFuncsFinalizeFieldCallback#

    C_SourceFuncsFinalizeFieldCallback      ,
    SourceFuncsFinalizeFieldCallback        ,
    dynamic_SourceFuncsFinalizeFieldCallback,
    genClosure_SourceFuncsFinalizeFieldCallback,
    mk_SourceFuncsFinalizeFieldCallback     ,
    noSourceFuncsFinalizeFieldCallback      ,
    wrap_SourceFuncsFinalizeFieldCallback   ,


-- ** SourceFuncsPrepareFieldCallback #signal:SourceFuncsPrepareFieldCallback#

    C_SourceFuncsPrepareFieldCallback       ,
    SourceFuncsPrepareFieldCallback         ,
    dynamic_SourceFuncsPrepareFieldCallback ,
    genClosure_SourceFuncsPrepareFieldCallback,
    mk_SourceFuncsPrepareFieldCallback      ,
    noSourceFuncsPrepareFieldCallback       ,
    wrap_SourceFuncsPrepareFieldCallback    ,


-- ** SpawnChildSetupFunc #signal:SpawnChildSetupFunc#

    C_SpawnChildSetupFunc                   ,
    SpawnChildSetupFunc                     ,
    SpawnChildSetupFunc_WithClosures        ,
    drop_closures_SpawnChildSetupFunc       ,
    dynamic_SpawnChildSetupFunc             ,
    genClosure_SpawnChildSetupFunc          ,
    mk_SpawnChildSetupFunc                  ,
    noSpawnChildSetupFunc                   ,
    noSpawnChildSetupFunc_WithClosures      ,
    wrap_SpawnChildSetupFunc                ,


-- ** TestDataFunc #signal:TestDataFunc#

    C_TestDataFunc                          ,
    TestDataFunc                            ,
    TestDataFunc_WithClosures               ,
    drop_closures_TestDataFunc              ,
    dynamic_TestDataFunc                    ,
    genClosure_TestDataFunc                 ,
    mk_TestDataFunc                         ,
    noTestDataFunc                          ,
    noTestDataFunc_WithClosures             ,
    wrap_TestDataFunc                       ,


-- ** TestFixtureFunc #signal:TestFixtureFunc#

    C_TestFixtureFunc                       ,
    TestFixtureFunc                         ,
    TestFixtureFunc_WithClosures            ,
    drop_closures_TestFixtureFunc           ,
    dynamic_TestFixtureFunc                 ,
    genClosure_TestFixtureFunc              ,
    mk_TestFixtureFunc                      ,
    noTestFixtureFunc                       ,
    noTestFixtureFunc_WithClosures          ,
    wrap_TestFixtureFunc                    ,


-- ** TestFunc #signal:TestFunc#

    C_TestFunc                              ,
    TestFunc                                ,
    dynamic_TestFunc                        ,
    genClosure_TestFunc                     ,
    mk_TestFunc                             ,
    noTestFunc                              ,
    wrap_TestFunc                           ,


-- ** TestLogFatalFunc #signal:TestLogFatalFunc#

    C_TestLogFatalFunc                      ,
    TestLogFatalFunc                        ,
    TestLogFatalFunc_WithClosures           ,
    drop_closures_TestLogFatalFunc          ,
    dynamic_TestLogFatalFunc                ,
    genClosure_TestLogFatalFunc             ,
    mk_TestLogFatalFunc                     ,
    noTestLogFatalFunc                      ,
    noTestLogFatalFunc_WithClosures         ,
    wrap_TestLogFatalFunc                   ,


-- ** ThreadFunc #signal:ThreadFunc#

    C_ThreadFunc                            ,
    ThreadFunc                              ,
    dynamic_ThreadFunc                      ,
    genClosure_ThreadFunc                   ,
    mk_ThreadFunc                           ,
    noThreadFunc                            ,
    wrap_ThreadFunc                         ,


-- ** TranslateFunc #signal:TranslateFunc#

    C_TranslateFunc                         ,
    TranslateFunc                           ,
    dynamic_TranslateFunc                   ,
    genClosure_TranslateFunc                ,
    mk_TranslateFunc                        ,
    noTranslateFunc                         ,
    wrap_TranslateFunc                      ,


-- ** TraverseFunc #signal:TraverseFunc#

    C_TraverseFunc                          ,
    TraverseFunc                            ,
    dynamic_TraverseFunc                    ,
    genClosure_TraverseFunc                 ,
    mk_TraverseFunc                         ,
    noTraverseFunc                          ,
    wrap_TraverseFunc                       ,


-- ** UnixFDSourceFunc #signal:UnixFDSourceFunc#

    C_UnixFDSourceFunc                      ,
    UnixFDSourceFunc                        ,
    UnixFDSourceFunc_WithClosures           ,
    drop_closures_UnixFDSourceFunc          ,
    dynamic_UnixFDSourceFunc                ,
    genClosure_UnixFDSourceFunc             ,
    mk_UnixFDSourceFunc                     ,
    noUnixFDSourceFunc                      ,
    noUnixFDSourceFunc_WithClosures         ,
    wrap_UnixFDSourceFunc                   ,


-- ** VoidFunc #signal:VoidFunc#

    C_VoidFunc                              ,
    VoidFunc                                ,
    dynamic_VoidFunc                        ,
    genClosure_VoidFunc                     ,
    mk_VoidFunc                             ,
    noVoidFunc                              ,
    wrap_VoidFunc                           ,




    ) where

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

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL

import {-# SOURCE #-} qualified GI.GLib.Enums as GLib.Enums
import {-# SOURCE #-} qualified GI.GLib.Flags as GLib.Flags
import {-# SOURCE #-} qualified GI.GLib.Structs.Hook as GLib.Hook
import {-# SOURCE #-} qualified GI.GLib.Structs.HookList as GLib.HookList
import {-# SOURCE #-} qualified GI.GLib.Structs.IOChannel as GLib.IOChannel
import {-# SOURCE #-} qualified GI.GLib.Structs.LogField as GLib.LogField
import {-# SOURCE #-} qualified GI.GLib.Structs.MarkupParseContext as GLib.MarkupParseContext
import {-# SOURCE #-} qualified GI.GLib.Structs.MatchInfo as GLib.MatchInfo
import {-# SOURCE #-} qualified GI.GLib.Structs.Node as GLib.Node
import {-# SOURCE #-} qualified GI.GLib.Structs.OptionContext as GLib.OptionContext
import {-# SOURCE #-} qualified GI.GLib.Structs.OptionGroup as GLib.OptionGroup
import {-# SOURCE #-} qualified GI.GLib.Structs.PollFD as GLib.PollFD
import {-# SOURCE #-} qualified GI.GLib.Structs.Scanner as GLib.Scanner
import {-# SOURCE #-} qualified GI.GLib.Structs.SequenceIter as GLib.SequenceIter
import {-# SOURCE #-} qualified GI.GLib.Structs.Source as GLib.Source
import {-# SOURCE #-} qualified GI.GLib.Structs.String as GLib.String

-- callback VoidFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args = []
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Declares a type of function which takes no arguments\nand has no return value. It is used to specify the type\nfunction passed to g_atexit()."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_VoidFunc =
    IO ()

-- Args: []
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_VoidFunc :: FunPtr C_VoidFunc -> C_VoidFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_VoidFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_VoidFunc
    -> m ()
dynamic_VoidFunc :: FunPtr C_VoidFunc -> m ()
dynamic_VoidFunc FunPtr C_VoidFunc
__funPtr = C_VoidFunc -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (C_VoidFunc -> m ()) -> C_VoidFunc -> m ()
forall a b. (a -> b) -> a -> b
$ do
    (FunPtr C_VoidFunc -> C_VoidFunc
__dynamic_C_VoidFunc FunPtr C_VoidFunc
__funPtr)
    () -> C_VoidFunc
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | Declares a type of function which takes no arguments
-- and has no return value. It is used to specify the type
-- function passed to 'GI.GLib.Functions.atexit'.
type VoidFunc =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `VoidFunc`@.
noVoidFunc :: Maybe VoidFunc
noVoidFunc :: Maybe C_VoidFunc
noVoidFunc = Maybe C_VoidFunc
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_VoidFunc :: MonadIO m => VoidFunc -> m (GClosure C_VoidFunc)
genClosure_VoidFunc :: C_VoidFunc -> m (GClosure C_VoidFunc)
genClosure_VoidFunc C_VoidFunc
cb = IO (GClosure C_VoidFunc) -> m (GClosure C_VoidFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_VoidFunc) -> m (GClosure C_VoidFunc))
-> IO (GClosure C_VoidFunc) -> m (GClosure C_VoidFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_VoidFunc
cb' = Maybe (Ptr (FunPtr C_VoidFunc)) -> C_VoidFunc -> C_VoidFunc
wrap_VoidFunc Maybe (Ptr (FunPtr C_VoidFunc))
forall a. Maybe a
Nothing C_VoidFunc
cb
    C_VoidFunc -> IO (FunPtr C_VoidFunc)
mk_VoidFunc C_VoidFunc
cb' IO (FunPtr C_VoidFunc)
-> (FunPtr C_VoidFunc -> IO (GClosure C_VoidFunc))
-> IO (GClosure C_VoidFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_VoidFunc -> IO (GClosure C_VoidFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `VoidFunc` into a `C_VoidFunc`.
wrap_VoidFunc ::
    Maybe (Ptr (FunPtr C_VoidFunc)) ->
    VoidFunc ->
    C_VoidFunc
wrap_VoidFunc :: Maybe (Ptr (FunPtr C_VoidFunc)) -> C_VoidFunc -> C_VoidFunc
wrap_VoidFunc Maybe (Ptr (FunPtr C_VoidFunc))
funptrptr C_VoidFunc
_cb = do
    C_VoidFunc
_cb 
    Maybe (Ptr (FunPtr C_VoidFunc)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_VoidFunc))
funptrptr


-- callback UnixFDSourceFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText = Just "%FALSE if the source should be removed"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "fd"
          , argType = TBasicType TInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the fd that triggered the event"
                , 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 IO conditions reported on @fd"
                , 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_unix_fd_add()"
                , 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 functions to be called when a UNIX fd watch source\ntriggers."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_UnixFDSourceFunc =
    Int32 ->
    CUInt ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "fd"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the fd that triggered the event"
--                 , 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 IO conditions reported on @fd"
--                 , 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_unix_fd_add()"
--                 , 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_UnixFDSourceFunc :: FunPtr C_UnixFDSourceFunc -> C_UnixFDSourceFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_UnixFDSourceFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_UnixFDSourceFunc
    -> Int32
    -- ^ /@fd@/: the fd that triggered the event
    -> [GLib.Flags.IOCondition]
    -- ^ /@condition@/: the IO conditions reported on /@fd@/
    -> Ptr ()
    -- ^ /@userData@/: user data passed to @/g_unix_fd_add()/@
    -> m Bool
    -- ^ __Returns:__ 'P.False' if the source should be removed
dynamic_UnixFDSourceFunc :: FunPtr C_UnixFDSourceFunc
-> Int32 -> [IOCondition] -> Ptr () -> m Bool
dynamic_UnixFDSourceFunc FunPtr C_UnixFDSourceFunc
__funPtr Int32
fd [IOCondition]
condition Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    let condition' :: CUInt
condition' = [IOCondition] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [IOCondition]
condition
    CInt
result <- (FunPtr C_UnixFDSourceFunc -> C_UnixFDSourceFunc
__dynamic_C_UnixFDSourceFunc FunPtr C_UnixFDSourceFunc
__funPtr) Int32
fd CUInt
condition' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | The type of functions to be called when a UNIX fd watch source
-- triggers.
type UnixFDSourceFunc =
    Int32
    -- ^ /@fd@/: the fd that triggered the event
    -> [GLib.Flags.IOCondition]
    -- ^ /@condition@/: the IO conditions reported on /@fd@/
    -> IO Bool
    -- ^ __Returns:__ 'P.False' if the source should be removed

-- | A convenience synonym for @`Nothing` :: `Maybe` `UnixFDSourceFunc`@.
noUnixFDSourceFunc :: Maybe UnixFDSourceFunc
noUnixFDSourceFunc :: Maybe UnixFDSourceFunc
noUnixFDSourceFunc = Maybe UnixFDSourceFunc
forall a. Maybe a
Nothing

-- | The type of functions to be called when a UNIX fd watch source
-- triggers.
type UnixFDSourceFunc_WithClosures =
    Int32
    -- ^ /@fd@/: the fd that triggered the event
    -> [GLib.Flags.IOCondition]
    -- ^ /@condition@/: the IO conditions reported on /@fd@/
    -> Ptr ()
    -- ^ /@userData@/: user data passed to @/g_unix_fd_add()/@
    -> IO Bool
    -- ^ __Returns:__ 'P.False' if the source should be removed

-- | A convenience synonym for @`Nothing` :: `Maybe` `UnixFDSourceFunc_WithClosures`@.
noUnixFDSourceFunc_WithClosures :: Maybe UnixFDSourceFunc_WithClosures
noUnixFDSourceFunc_WithClosures :: Maybe UnixFDSourceFunc_WithClosures
noUnixFDSourceFunc_WithClosures = Maybe UnixFDSourceFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_UnixFDSourceFunc :: UnixFDSourceFunc -> UnixFDSourceFunc_WithClosures
drop_closures_UnixFDSourceFunc :: UnixFDSourceFunc -> UnixFDSourceFunc_WithClosures
drop_closures_UnixFDSourceFunc UnixFDSourceFunc
_f Int32
fd [IOCondition]
condition Ptr ()
_ = UnixFDSourceFunc
_f Int32
fd [IOCondition]
condition

-- | Wrap the callback into a `GClosure`.
genClosure_UnixFDSourceFunc :: MonadIO m => UnixFDSourceFunc -> m (GClosure C_UnixFDSourceFunc)
genClosure_UnixFDSourceFunc :: UnixFDSourceFunc -> m (GClosure C_UnixFDSourceFunc)
genClosure_UnixFDSourceFunc UnixFDSourceFunc
cb = IO (GClosure C_UnixFDSourceFunc) -> m (GClosure C_UnixFDSourceFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_UnixFDSourceFunc)
 -> m (GClosure C_UnixFDSourceFunc))
-> IO (GClosure C_UnixFDSourceFunc)
-> m (GClosure C_UnixFDSourceFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: UnixFDSourceFunc_WithClosures
cb' = UnixFDSourceFunc -> UnixFDSourceFunc_WithClosures
drop_closures_UnixFDSourceFunc UnixFDSourceFunc
cb
    let cb'' :: C_UnixFDSourceFunc
cb'' = Maybe (Ptr (FunPtr C_UnixFDSourceFunc))
-> UnixFDSourceFunc_WithClosures -> C_UnixFDSourceFunc
wrap_UnixFDSourceFunc Maybe (Ptr (FunPtr C_UnixFDSourceFunc))
forall a. Maybe a
Nothing UnixFDSourceFunc_WithClosures
cb'
    C_UnixFDSourceFunc -> IO (FunPtr C_UnixFDSourceFunc)
mk_UnixFDSourceFunc C_UnixFDSourceFunc
cb'' IO (FunPtr C_UnixFDSourceFunc)
-> (FunPtr C_UnixFDSourceFunc -> IO (GClosure C_UnixFDSourceFunc))
-> IO (GClosure C_UnixFDSourceFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_UnixFDSourceFunc -> IO (GClosure C_UnixFDSourceFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `UnixFDSourceFunc` into a `C_UnixFDSourceFunc`.
wrap_UnixFDSourceFunc ::
    Maybe (Ptr (FunPtr C_UnixFDSourceFunc)) ->
    UnixFDSourceFunc_WithClosures ->
    C_UnixFDSourceFunc
wrap_UnixFDSourceFunc :: Maybe (Ptr (FunPtr C_UnixFDSourceFunc))
-> UnixFDSourceFunc_WithClosures -> C_UnixFDSourceFunc
wrap_UnixFDSourceFunc Maybe (Ptr (FunPtr C_UnixFDSourceFunc))
funptrptr UnixFDSourceFunc_WithClosures
_cb Int32
fd CUInt
condition Ptr ()
userData = do
    let condition' :: [IOCondition]
condition' = CUInt -> [IOCondition]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
condition
    Bool
result <- UnixFDSourceFunc_WithClosures
_cb  Int32
fd [IOCondition]
condition' Ptr ()
userData
    Maybe (Ptr (FunPtr C_UnixFDSourceFunc)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_UnixFDSourceFunc))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback TraverseFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText = Just "%TRUE to stop the traversal"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "key"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "a key of a #GTree node"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "value"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "the value corresponding to the key"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "user data passed to g_tree_traverse()"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Specifies the type of function passed to g_tree_traverse(). It is\npassed the key and value of each node, together with the @user_data\nparameter passed to g_tree_traverse(). If the function returns\n%TRUE, the traversal is stopped."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_TraverseFunc =
    Ptr () ->
    Ptr () ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "key"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a key of a #GTree node"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the value corresponding to the key"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user data passed to g_tree_traverse()"
--                 , 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_TraverseFunc :: FunPtr C_TraverseFunc -> C_TraverseFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TraverseFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TraverseFunc
    -> Ptr ()
    -- ^ /@key@/: a key of a t'GI.GLib.Structs.Tree.Tree' node
    -> Ptr ()
    -- ^ /@value@/: the value corresponding to the key
    -> Ptr ()
    -- ^ /@data@/: user data passed to @/g_tree_traverse()/@
    -> m Bool
    -- ^ __Returns:__ 'P.True' to stop the traversal
dynamic_TraverseFunc :: FunPtr C_TraverseFunc -> Ptr () -> Ptr () -> Ptr () -> m Bool
dynamic_TraverseFunc FunPtr C_TraverseFunc
__funPtr Ptr ()
key Ptr ()
value Ptr ()
data_ = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    CInt
result <- (FunPtr C_TraverseFunc -> C_TraverseFunc
__dynamic_C_TraverseFunc FunPtr C_TraverseFunc
__funPtr) Ptr ()
key Ptr ()
value Ptr ()
data_
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | Specifies the type of function passed to @/g_tree_traverse()/@. It is
-- passed the key and value of each node, together with the /@userData@/
-- parameter passed to @/g_tree_traverse()/@. If the function returns
-- 'P.True', the traversal is stopped.
type TraverseFunc =
    Ptr ()
    -- ^ /@key@/: a key of a t'GI.GLib.Structs.Tree.Tree' node
    -> Ptr ()
    -- ^ /@value@/: the value corresponding to the key
    -> Ptr ()
    -- ^ /@data@/: user data passed to @/g_tree_traverse()/@
    -> IO Bool
    -- ^ __Returns:__ 'P.True' to stop the traversal

-- | A convenience synonym for @`Nothing` :: `Maybe` `TraverseFunc`@.
noTraverseFunc :: Maybe TraverseFunc
noTraverseFunc :: Maybe TraverseFunc
noTraverseFunc = Maybe TraverseFunc
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_TraverseFunc :: MonadIO m => TraverseFunc -> m (GClosure C_TraverseFunc)
genClosure_TraverseFunc :: TraverseFunc -> m (GClosure C_TraverseFunc)
genClosure_TraverseFunc TraverseFunc
cb = IO (GClosure C_TraverseFunc) -> m (GClosure C_TraverseFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TraverseFunc) -> m (GClosure C_TraverseFunc))
-> IO (GClosure C_TraverseFunc) -> m (GClosure C_TraverseFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_TraverseFunc
cb' = Maybe (Ptr (FunPtr C_TraverseFunc))
-> TraverseFunc -> C_TraverseFunc
wrap_TraverseFunc Maybe (Ptr (FunPtr C_TraverseFunc))
forall a. Maybe a
Nothing TraverseFunc
cb
    C_TraverseFunc -> IO (FunPtr C_TraverseFunc)
mk_TraverseFunc C_TraverseFunc
cb' IO (FunPtr C_TraverseFunc)
-> (FunPtr C_TraverseFunc -> IO (GClosure C_TraverseFunc))
-> IO (GClosure C_TraverseFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TraverseFunc -> IO (GClosure C_TraverseFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `TraverseFunc` into a `C_TraverseFunc`.
wrap_TraverseFunc ::
    Maybe (Ptr (FunPtr C_TraverseFunc)) ->
    TraverseFunc ->
    C_TraverseFunc
wrap_TraverseFunc :: Maybe (Ptr (FunPtr C_TraverseFunc))
-> TraverseFunc -> C_TraverseFunc
wrap_TraverseFunc Maybe (Ptr (FunPtr C_TraverseFunc))
funptrptr TraverseFunc
_cb Ptr ()
key Ptr ()
value Ptr ()
data_ = do
    Bool
result <- TraverseFunc
_cb  Ptr ()
key Ptr ()
value Ptr ()
data_
    Maybe (Ptr (FunPtr C_TraverseFunc)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_TraverseFunc))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback TranslateFunc
{- Callable
  { returnType = Just (TBasicType TUTF8)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just
              "a translation of the string for the current locale.\n The returned string is owned by GLib and must not be freed."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "str"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the untranslated string"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText =
                    Just
                      "user data specified when installing the function, e.g.\n in g_option_group_set_translate_func()"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "The type of functions which are used to translate user-visible\nstrings, for <option>--help</option> output."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_TranslateFunc =
    CString ->
    Ptr () ->
    IO CString

-- Args: [ Arg
--           { argCName = "str"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the untranslated string"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "user data specified when installing the function, e.g.\n in g_option_group_set_translate_func()"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TranslateFunc :: FunPtr C_TranslateFunc -> C_TranslateFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TranslateFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TranslateFunc
    -> T.Text
    -- ^ /@str@/: the untranslated string
    -> Ptr ()
    -- ^ /@data@/: user data specified when installing the function, e.g.
    --  in 'GI.GLib.Structs.OptionGroup.optionGroupSetTranslateFunc'
    -> m T.Text
    -- ^ __Returns:__ a translation of the string for the current locale.
    --  The returned string is owned by GLib and must not be freed.
dynamic_TranslateFunc :: FunPtr C_TranslateFunc -> Text -> Ptr () -> m Text
dynamic_TranslateFunc FunPtr C_TranslateFunc
__funPtr Text
str Ptr ()
data_ = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    CString
str' <- Text -> IO CString
textToCString Text
str
    CString
result <- (FunPtr C_TranslateFunc -> C_TranslateFunc
__dynamic_C_TranslateFunc FunPtr C_TranslateFunc
__funPtr) CString
str' Ptr ()
data_
    Text -> CString -> C_VoidFunc
forall a. HasCallStack => Text -> Ptr a -> C_VoidFunc
checkUnexpectedReturnNULL Text
"translateFunc" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    CString -> C_VoidFunc
forall a. Ptr a -> C_VoidFunc
freeMem CString
str'
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

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

-- | The type of functions which are used to translate user-visible
-- strings, for \<option>--help\<\/option> output.
type TranslateFunc =
    T.Text
    -- ^ /@str@/: the untranslated string
    -> Ptr ()
    -- ^ /@data@/: user data specified when installing the function, e.g.
    --  in 'GI.GLib.Structs.OptionGroup.optionGroupSetTranslateFunc'
    -> IO T.Text
    -- ^ __Returns:__ a translation of the string for the current locale.
    --  The returned string is owned by GLib and must not be freed.

-- | A convenience synonym for @`Nothing` :: `Maybe` `TranslateFunc`@.
noTranslateFunc :: Maybe TranslateFunc
noTranslateFunc :: Maybe TranslateFunc
noTranslateFunc = Maybe TranslateFunc
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_TranslateFunc :: MonadIO m => TranslateFunc -> m (GClosure C_TranslateFunc)
genClosure_TranslateFunc :: TranslateFunc -> m (GClosure C_TranslateFunc)
genClosure_TranslateFunc TranslateFunc
cb = IO (GClosure C_TranslateFunc) -> m (GClosure C_TranslateFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TranslateFunc) -> m (GClosure C_TranslateFunc))
-> IO (GClosure C_TranslateFunc) -> m (GClosure C_TranslateFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_TranslateFunc
cb' = Maybe (Ptr (FunPtr C_TranslateFunc))
-> TranslateFunc -> C_TranslateFunc
wrap_TranslateFunc Maybe (Ptr (FunPtr C_TranslateFunc))
forall a. Maybe a
Nothing TranslateFunc
cb
    C_TranslateFunc -> IO (FunPtr C_TranslateFunc)
mk_TranslateFunc C_TranslateFunc
cb' IO (FunPtr C_TranslateFunc)
-> (FunPtr C_TranslateFunc -> IO (GClosure C_TranslateFunc))
-> IO (GClosure C_TranslateFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TranslateFunc -> IO (GClosure C_TranslateFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `TranslateFunc` into a `C_TranslateFunc`.
wrap_TranslateFunc ::
    Maybe (Ptr (FunPtr C_TranslateFunc)) ->
    TranslateFunc ->
    C_TranslateFunc
wrap_TranslateFunc :: Maybe (Ptr (FunPtr C_TranslateFunc))
-> TranslateFunc -> C_TranslateFunc
wrap_TranslateFunc Maybe (Ptr (FunPtr C_TranslateFunc))
funptrptr TranslateFunc
_cb CString
str Ptr ()
data_ = do
    Text
str' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
str
    Text
result <- TranslateFunc
_cb  Text
str' Ptr ()
data_
    Maybe (Ptr (FunPtr C_TranslateFunc)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_TranslateFunc))
funptrptr
    CString
result' <- Text -> IO CString
textToCString Text
result
    CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
result'


-- callback ThreadFunc
{- Callable
  { returnType = Just (TBasicType TPtr)
  , returnMayBeNull = True
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText = Just "the return value of the thread"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "data passed to the thread"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Specifies the type of the @func functions passed to g_thread_new()\nor g_thread_try_new()."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_ThreadFunc =
    Ptr () ->
    IO (Ptr ())

-- Args: [ Arg
--           { argCName = "data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "data passed to the thread"
--                 , 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_ThreadFunc :: FunPtr C_ThreadFunc -> C_ThreadFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_ThreadFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_ThreadFunc
    -> Ptr ()
    -- ^ /@data@/: data passed to the thread
    -> m (Ptr ())
    -- ^ __Returns:__ the return value of the thread
dynamic_ThreadFunc :: FunPtr C_ThreadFunc -> Ptr () -> m (Ptr ())
dynamic_ThreadFunc FunPtr C_ThreadFunc
__funPtr Ptr ()
data_ = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ do
    Ptr ()
result <- (FunPtr C_ThreadFunc -> C_ThreadFunc
__dynamic_C_ThreadFunc FunPtr C_ThreadFunc
__funPtr) Ptr ()
data_
    C_ThreadFunc
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result

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

-- | Specifies the type of the /@func@/ functions passed to @/g_thread_new()/@
-- or @/g_thread_try_new()/@.
type ThreadFunc =
    Ptr ()
    -- ^ /@data@/: data passed to the thread
    -> IO (Ptr ())
    -- ^ __Returns:__ the return value of the thread

-- | A convenience synonym for @`Nothing` :: `Maybe` `ThreadFunc`@.
noThreadFunc :: Maybe ThreadFunc
noThreadFunc :: Maybe C_ThreadFunc
noThreadFunc = Maybe C_ThreadFunc
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_ThreadFunc :: MonadIO m => ThreadFunc -> m (GClosure C_ThreadFunc)
genClosure_ThreadFunc :: C_ThreadFunc -> m (GClosure C_ThreadFunc)
genClosure_ThreadFunc C_ThreadFunc
cb = IO (GClosure C_ThreadFunc) -> m (GClosure C_ThreadFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ThreadFunc) -> m (GClosure C_ThreadFunc))
-> IO (GClosure C_ThreadFunc) -> m (GClosure C_ThreadFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ThreadFunc
cb' = Maybe (Ptr (FunPtr C_ThreadFunc)) -> C_ThreadFunc -> C_ThreadFunc
wrap_ThreadFunc Maybe (Ptr (FunPtr C_ThreadFunc))
forall a. Maybe a
Nothing C_ThreadFunc
cb
    C_ThreadFunc -> IO (FunPtr C_ThreadFunc)
mk_ThreadFunc C_ThreadFunc
cb' IO (FunPtr C_ThreadFunc)
-> (FunPtr C_ThreadFunc -> IO (GClosure C_ThreadFunc))
-> IO (GClosure C_ThreadFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ThreadFunc -> IO (GClosure C_ThreadFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ThreadFunc` into a `C_ThreadFunc`.
wrap_ThreadFunc ::
    Maybe (Ptr (FunPtr C_ThreadFunc)) ->
    ThreadFunc ->
    C_ThreadFunc
wrap_ThreadFunc :: Maybe (Ptr (FunPtr C_ThreadFunc)) -> C_ThreadFunc -> C_ThreadFunc
wrap_ThreadFunc Maybe (Ptr (FunPtr C_ThreadFunc))
funptrptr C_ThreadFunc
_cb Ptr ()
data_ = do
    Ptr ()
result <- C_ThreadFunc
_cb  Ptr ()
data_
    Maybe (Ptr (FunPtr C_ThreadFunc)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ThreadFunc))
funptrptr
    C_ThreadFunc
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result


-- callback TestLogFatalFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just "%TRUE if the program should abort, %FALSE otherwise"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "log_domain"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the log domain of the message"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "log_level"
          , argType =
              TInterface Name { namespace = "GLib" , name = "LogLevelFlags" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText =
                    Just
                      "the log level of the message (including the fatal and recursion flags)"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "message"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the message to process"
                , 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, set in g_test_log_set_fatal_handler()"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 3
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just "Specifies the prototype of fatal log handler functions."
        , sinceVersion = Just "2.22"
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_TestLogFatalFunc =
    CString ->
    CInt ->
    CString ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "log_domain"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the log domain of the message"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "log_level"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "LogLevelFlags" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the log level of the message (including the fatal and recursion flags)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "message"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the message to process"
--                 , 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, set in g_test_log_set_fatal_handler()"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TestLogFatalFunc :: FunPtr C_TestLogFatalFunc -> C_TestLogFatalFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TestLogFatalFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TestLogFatalFunc
    -> T.Text
    -- ^ /@logDomain@/: the log domain of the message
    -> [GLib.Flags.LogLevelFlags]
    -- ^ /@logLevel@/: the log level of the message (including the fatal and recursion flags)
    -> T.Text
    -- ^ /@message@/: the message to process
    -> Ptr ()
    -- ^ /@userData@/: user data, set in @/g_test_log_set_fatal_handler()/@
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the program should abort, 'P.False' otherwise
dynamic_TestLogFatalFunc :: FunPtr C_TestLogFatalFunc
-> Text -> [LogLevelFlags] -> Text -> Ptr () -> m Bool
dynamic_TestLogFatalFunc FunPtr C_TestLogFatalFunc
__funPtr Text
logDomain [LogLevelFlags]
logLevel Text
message Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    CString
logDomain' <- Text -> IO CString
textToCString Text
logDomain
    let logLevel' :: CInt
logLevel' = [LogLevelFlags] -> CInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [LogLevelFlags]
logLevel
    CString
message' <- Text -> IO CString
textToCString Text
message
    CInt
result <- (FunPtr C_TestLogFatalFunc -> C_TestLogFatalFunc
__dynamic_C_TestLogFatalFunc FunPtr C_TestLogFatalFunc
__funPtr) CString
logDomain' CInt
logLevel' CString
message' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CString -> C_VoidFunc
forall a. Ptr a -> C_VoidFunc
freeMem CString
logDomain'
    CString -> C_VoidFunc
forall a. Ptr a -> C_VoidFunc
freeMem CString
message'
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | Specifies the prototype of fatal log handler functions.
-- 
-- /Since: 2.22/
type TestLogFatalFunc =
    T.Text
    -- ^ /@logDomain@/: the log domain of the message
    -> [GLib.Flags.LogLevelFlags]
    -- ^ /@logLevel@/: the log level of the message (including the fatal and recursion flags)
    -> T.Text
    -- ^ /@message@/: the message to process
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the program should abort, 'P.False' otherwise

-- | A convenience synonym for @`Nothing` :: `Maybe` `TestLogFatalFunc`@.
noTestLogFatalFunc :: Maybe TestLogFatalFunc
noTestLogFatalFunc :: Maybe TestLogFatalFunc
noTestLogFatalFunc = Maybe TestLogFatalFunc
forall a. Maybe a
Nothing

-- | Specifies the prototype of fatal log handler functions.
-- 
-- /Since: 2.22/
type TestLogFatalFunc_WithClosures =
    T.Text
    -- ^ /@logDomain@/: the log domain of the message
    -> [GLib.Flags.LogLevelFlags]
    -- ^ /@logLevel@/: the log level of the message (including the fatal and recursion flags)
    -> T.Text
    -- ^ /@message@/: the message to process
    -> Ptr ()
    -- ^ /@userData@/: user data, set in @/g_test_log_set_fatal_handler()/@
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the program should abort, 'P.False' otherwise

-- | A convenience synonym for @`Nothing` :: `Maybe` `TestLogFatalFunc_WithClosures`@.
noTestLogFatalFunc_WithClosures :: Maybe TestLogFatalFunc_WithClosures
noTestLogFatalFunc_WithClosures :: Maybe TestLogFatalFunc_WithClosures
noTestLogFatalFunc_WithClosures = Maybe TestLogFatalFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_TestLogFatalFunc :: TestLogFatalFunc -> TestLogFatalFunc_WithClosures
drop_closures_TestLogFatalFunc :: TestLogFatalFunc -> TestLogFatalFunc_WithClosures
drop_closures_TestLogFatalFunc TestLogFatalFunc
_f Text
logDomain [LogLevelFlags]
logLevel Text
message Ptr ()
_ = TestLogFatalFunc
_f Text
logDomain [LogLevelFlags]
logLevel Text
message

-- | Wrap the callback into a `GClosure`.
genClosure_TestLogFatalFunc :: MonadIO m => TestLogFatalFunc -> m (GClosure C_TestLogFatalFunc)
genClosure_TestLogFatalFunc :: TestLogFatalFunc -> m (GClosure C_TestLogFatalFunc)
genClosure_TestLogFatalFunc TestLogFatalFunc
cb = IO (GClosure C_TestLogFatalFunc) -> m (GClosure C_TestLogFatalFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TestLogFatalFunc)
 -> m (GClosure C_TestLogFatalFunc))
-> IO (GClosure C_TestLogFatalFunc)
-> m (GClosure C_TestLogFatalFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: TestLogFatalFunc_WithClosures
cb' = TestLogFatalFunc -> TestLogFatalFunc_WithClosures
drop_closures_TestLogFatalFunc TestLogFatalFunc
cb
    let cb'' :: C_TestLogFatalFunc
cb'' = Maybe (Ptr (FunPtr C_TestLogFatalFunc))
-> TestLogFatalFunc_WithClosures -> C_TestLogFatalFunc
wrap_TestLogFatalFunc Maybe (Ptr (FunPtr C_TestLogFatalFunc))
forall a. Maybe a
Nothing TestLogFatalFunc_WithClosures
cb'
    C_TestLogFatalFunc -> IO (FunPtr C_TestLogFatalFunc)
mk_TestLogFatalFunc C_TestLogFatalFunc
cb'' IO (FunPtr C_TestLogFatalFunc)
-> (FunPtr C_TestLogFatalFunc -> IO (GClosure C_TestLogFatalFunc))
-> IO (GClosure C_TestLogFatalFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TestLogFatalFunc -> IO (GClosure C_TestLogFatalFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `TestLogFatalFunc` into a `C_TestLogFatalFunc`.
wrap_TestLogFatalFunc ::
    Maybe (Ptr (FunPtr C_TestLogFatalFunc)) ->
    TestLogFatalFunc_WithClosures ->
    C_TestLogFatalFunc
wrap_TestLogFatalFunc :: Maybe (Ptr (FunPtr C_TestLogFatalFunc))
-> TestLogFatalFunc_WithClosures -> C_TestLogFatalFunc
wrap_TestLogFatalFunc Maybe (Ptr (FunPtr C_TestLogFatalFunc))
funptrptr TestLogFatalFunc_WithClosures
_cb CString
logDomain CInt
logLevel CString
message Ptr ()
userData = do
    Text
logDomain' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
logDomain
    let logLevel' :: [LogLevelFlags]
logLevel' = CInt -> [LogLevelFlags]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CInt
logLevel
    Text
message' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
message
    Bool
result <- TestLogFatalFunc_WithClosures
_cb  Text
logDomain' [LogLevelFlags]
logLevel' Text
message' Ptr ()
userData
    Maybe (Ptr (FunPtr C_TestLogFatalFunc)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_TestLogFatalFunc))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback TestFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args = []
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText = Just "The type used for test case functions."
        , sinceVersion = Just "2.28"
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_TestFunc =
    IO ()

-- Args: []
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TestFunc :: FunPtr C_TestFunc -> C_TestFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TestFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TestFunc
    -> m ()
dynamic_TestFunc :: FunPtr C_VoidFunc -> m ()
dynamic_TestFunc FunPtr C_VoidFunc
__funPtr = C_VoidFunc -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (C_VoidFunc -> m ()) -> C_VoidFunc -> m ()
forall a b. (a -> b) -> a -> b
$ do
    (FunPtr C_VoidFunc -> C_VoidFunc
__dynamic_C_TestFunc FunPtr C_VoidFunc
__funPtr)
    () -> C_VoidFunc
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | The type used for test case functions.
-- 
-- /Since: 2.28/
type TestFunc =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TestFunc`@.
noTestFunc :: Maybe TestFunc
noTestFunc :: Maybe C_VoidFunc
noTestFunc = Maybe C_VoidFunc
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_TestFunc :: MonadIO m => TestFunc -> m (GClosure C_TestFunc)
genClosure_TestFunc :: C_VoidFunc -> m (GClosure C_VoidFunc)
genClosure_TestFunc C_VoidFunc
cb = IO (GClosure C_VoidFunc) -> m (GClosure C_VoidFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_VoidFunc) -> m (GClosure C_VoidFunc))
-> IO (GClosure C_VoidFunc) -> m (GClosure C_VoidFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_VoidFunc
cb' = Maybe (Ptr (FunPtr C_VoidFunc)) -> C_VoidFunc -> C_VoidFunc
wrap_TestFunc Maybe (Ptr (FunPtr C_VoidFunc))
forall a. Maybe a
Nothing C_VoidFunc
cb
    C_VoidFunc -> IO (FunPtr C_VoidFunc)
mk_TestFunc C_VoidFunc
cb' IO (FunPtr C_VoidFunc)
-> (FunPtr C_VoidFunc -> IO (GClosure C_VoidFunc))
-> IO (GClosure C_VoidFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_VoidFunc -> IO (GClosure C_VoidFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `TestFunc` into a `C_TestFunc`.
wrap_TestFunc ::
    Maybe (Ptr (FunPtr C_TestFunc)) ->
    TestFunc ->
    C_TestFunc
wrap_TestFunc :: Maybe (Ptr (FunPtr C_VoidFunc)) -> C_VoidFunc -> C_VoidFunc
wrap_TestFunc Maybe (Ptr (FunPtr C_VoidFunc))
funptrptr C_VoidFunc
_cb = do
    C_VoidFunc
_cb 
    Maybe (Ptr (FunPtr C_VoidFunc)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_VoidFunc))
funptrptr


-- callback TestFixtureFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "fixture"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the test fixture" , 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 provided when registering the test"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "The type used for functions that operate on test fixtures.  This is\nused for the fixture setup and teardown functions as well as for the\ntestcases themselves.\n\n@user_data is a pointer to the data that was given when registering\nthe test case.\n\n@fixture will be a pointer to the area of memory allocated by the\ntest framework, of the size requested.  If the requested size was\nzero then @fixture will be equal to @user_data."
        , sinceVersion = Just "2.28"
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_TestFixtureFunc =
    Ptr () ->
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "fixture"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the test fixture" , 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 provided when registering the test"
--                 , 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_TestFixtureFunc :: FunPtr C_TestFixtureFunc -> C_TestFixtureFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TestFixtureFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TestFixtureFunc
    -> Ptr ()
    -- ^ /@fixture@/: the test fixture
    -> Ptr ()
    -- ^ /@userData@/: the data provided when registering the test
    -> m ()
dynamic_TestFixtureFunc :: FunPtr C_TestFixtureFunc -> Ptr () -> Ptr () -> m ()
dynamic_TestFixtureFunc FunPtr C_TestFixtureFunc
__funPtr Ptr ()
fixture Ptr ()
userData = C_VoidFunc -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (C_VoidFunc -> m ()) -> C_VoidFunc -> m ()
forall a b. (a -> b) -> a -> b
$ do
    (FunPtr C_TestFixtureFunc -> C_TestFixtureFunc
__dynamic_C_TestFixtureFunc FunPtr C_TestFixtureFunc
__funPtr) Ptr ()
fixture Ptr ()
userData
    () -> C_VoidFunc
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | The type used for functions that operate on test fixtures.  This is
-- used for the fixture setup and teardown functions as well as for the
-- testcases themselves.
-- 
-- /@userData@/ is a pointer to the data that was given when registering
-- the test case.
-- 
-- /@fixture@/ will be a pointer to the area of memory allocated by the
-- test framework, of the size requested.  If the requested size was
-- zero then /@fixture@/ will be equal to /@userData@/.
-- 
-- /Since: 2.28/
type TestFixtureFunc =
    Ptr ()
    -- ^ /@fixture@/: the test fixture
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TestFixtureFunc`@.
noTestFixtureFunc :: Maybe TestFixtureFunc
noTestFixtureFunc :: Maybe TestFixtureFunc
noTestFixtureFunc = Maybe TestFixtureFunc
forall a. Maybe a
Nothing

-- | The type used for functions that operate on test fixtures.  This is
-- used for the fixture setup and teardown functions as well as for the
-- testcases themselves.
-- 
-- /@userData@/ is a pointer to the data that was given when registering
-- the test case.
-- 
-- /@fixture@/ will be a pointer to the area of memory allocated by the
-- test framework, of the size requested.  If the requested size was
-- zero then /@fixture@/ will be equal to /@userData@/.
-- 
-- /Since: 2.28/
type TestFixtureFunc_WithClosures =
    Ptr ()
    -- ^ /@fixture@/: the test fixture
    -> Ptr ()
    -- ^ /@userData@/: the data provided when registering the test
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TestFixtureFunc_WithClosures`@.
noTestFixtureFunc_WithClosures :: Maybe TestFixtureFunc_WithClosures
noTestFixtureFunc_WithClosures :: Maybe C_TestFixtureFunc
noTestFixtureFunc_WithClosures = Maybe C_TestFixtureFunc
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_TestFixtureFunc :: TestFixtureFunc -> TestFixtureFunc_WithClosures
drop_closures_TestFixtureFunc :: TestFixtureFunc -> C_TestFixtureFunc
drop_closures_TestFixtureFunc TestFixtureFunc
_f Ptr ()
fixture Ptr ()
_ = TestFixtureFunc
_f Ptr ()
fixture

-- | Wrap the callback into a `GClosure`.
genClosure_TestFixtureFunc :: MonadIO m => TestFixtureFunc -> m (GClosure C_TestFixtureFunc)
genClosure_TestFixtureFunc :: TestFixtureFunc -> m (GClosure C_TestFixtureFunc)
genClosure_TestFixtureFunc TestFixtureFunc
cb = IO (GClosure C_TestFixtureFunc) -> m (GClosure C_TestFixtureFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TestFixtureFunc) -> m (GClosure C_TestFixtureFunc))
-> IO (GClosure C_TestFixtureFunc)
-> m (GClosure C_TestFixtureFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_TestFixtureFunc
cb' = TestFixtureFunc -> C_TestFixtureFunc
drop_closures_TestFixtureFunc TestFixtureFunc
cb
    let cb'' :: C_TestFixtureFunc
cb'' = Maybe (Ptr (FunPtr C_TestFixtureFunc))
-> C_TestFixtureFunc -> C_TestFixtureFunc
wrap_TestFixtureFunc Maybe (Ptr (FunPtr C_TestFixtureFunc))
forall a. Maybe a
Nothing C_TestFixtureFunc
cb'
    C_TestFixtureFunc -> IO (FunPtr C_TestFixtureFunc)
mk_TestFixtureFunc C_TestFixtureFunc
cb'' IO (FunPtr C_TestFixtureFunc)
-> (FunPtr C_TestFixtureFunc -> IO (GClosure C_TestFixtureFunc))
-> IO (GClosure C_TestFixtureFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TestFixtureFunc -> IO (GClosure C_TestFixtureFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `TestFixtureFunc` into a `C_TestFixtureFunc`.
wrap_TestFixtureFunc ::
    Maybe (Ptr (FunPtr C_TestFixtureFunc)) ->
    TestFixtureFunc_WithClosures ->
    C_TestFixtureFunc
wrap_TestFixtureFunc :: Maybe (Ptr (FunPtr C_TestFixtureFunc))
-> C_TestFixtureFunc -> C_TestFixtureFunc
wrap_TestFixtureFunc Maybe (Ptr (FunPtr C_TestFixtureFunc))
funptrptr C_TestFixtureFunc
_cb Ptr ()
fixture Ptr ()
userData = do
    C_TestFixtureFunc
_cb  Ptr ()
fixture Ptr ()
userData
    Maybe (Ptr (FunPtr C_TestFixtureFunc)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_TestFixtureFunc))
funptrptr


-- callback TestDataFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "the data provided when registering the test"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 0
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "The type used for test case functions that take an extra pointer\nargument."
        , sinceVersion = Just "2.28"
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_TestDataFunc =
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the data provided when registering the test"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 0
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TestDataFunc :: FunPtr C_TestDataFunc -> C_TestDataFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TestDataFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TestDataFunc
    -> Ptr ()
    -- ^ /@userData@/: the data provided when registering the test
    -> m ()
dynamic_TestDataFunc :: FunPtr TestFixtureFunc -> Ptr () -> m ()
dynamic_TestDataFunc FunPtr TestFixtureFunc
__funPtr Ptr ()
userData = C_VoidFunc -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (C_VoidFunc -> m ()) -> C_VoidFunc -> m ()
forall a b. (a -> b) -> a -> b
$ do
    (FunPtr TestFixtureFunc -> TestFixtureFunc
__dynamic_C_TestDataFunc FunPtr TestFixtureFunc
__funPtr) Ptr ()
userData
    () -> C_VoidFunc
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | The type used for test case functions that take an extra pointer
-- argument.
-- 
-- /Since: 2.28/
type TestDataFunc =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TestDataFunc`@.
noTestDataFunc :: Maybe TestDataFunc
noTestDataFunc :: Maybe C_VoidFunc
noTestDataFunc = Maybe C_VoidFunc
forall a. Maybe a
Nothing

-- | The type used for test case functions that take an extra pointer
-- argument.
-- 
-- /Since: 2.28/
type TestDataFunc_WithClosures =
    Ptr ()
    -- ^ /@userData@/: the data provided when registering the test
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TestDataFunc_WithClosures`@.
noTestDataFunc_WithClosures :: Maybe TestDataFunc_WithClosures
noTestDataFunc_WithClosures :: Maybe TestFixtureFunc
noTestDataFunc_WithClosures = Maybe TestFixtureFunc
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_TestDataFunc :: TestDataFunc -> TestDataFunc_WithClosures
drop_closures_TestDataFunc :: C_VoidFunc -> TestFixtureFunc
drop_closures_TestDataFunc C_VoidFunc
_f Ptr ()
_ = C_VoidFunc
_f 

-- | Wrap the callback into a `GClosure`.
genClosure_TestDataFunc :: MonadIO m => TestDataFunc -> m (GClosure C_TestDataFunc)
genClosure_TestDataFunc :: C_VoidFunc -> m (GClosure TestFixtureFunc)
genClosure_TestDataFunc C_VoidFunc
cb = IO (GClosure TestFixtureFunc) -> m (GClosure TestFixtureFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure TestFixtureFunc) -> m (GClosure TestFixtureFunc))
-> IO (GClosure TestFixtureFunc) -> m (GClosure TestFixtureFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: TestFixtureFunc
cb' = C_VoidFunc -> TestFixtureFunc
drop_closures_TestDataFunc C_VoidFunc
cb
    let cb'' :: TestFixtureFunc
cb'' = Maybe (Ptr (FunPtr TestFixtureFunc))
-> TestFixtureFunc -> TestFixtureFunc
wrap_TestDataFunc Maybe (Ptr (FunPtr TestFixtureFunc))
forall a. Maybe a
Nothing TestFixtureFunc
cb'
    TestFixtureFunc -> IO (FunPtr TestFixtureFunc)
mk_TestDataFunc TestFixtureFunc
cb'' IO (FunPtr TestFixtureFunc)
-> (FunPtr TestFixtureFunc -> IO (GClosure TestFixtureFunc))
-> IO (GClosure TestFixtureFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr TestFixtureFunc -> IO (GClosure TestFixtureFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `TestDataFunc` into a `C_TestDataFunc`.
wrap_TestDataFunc ::
    Maybe (Ptr (FunPtr C_TestDataFunc)) ->
    TestDataFunc_WithClosures ->
    C_TestDataFunc
wrap_TestDataFunc :: Maybe (Ptr (FunPtr TestFixtureFunc))
-> TestFixtureFunc -> TestFixtureFunc
wrap_TestDataFunc Maybe (Ptr (FunPtr TestFixtureFunc))
funptrptr TestFixtureFunc
_cb Ptr ()
userData = do
    TestFixtureFunc
_cb  Ptr ()
userData
    Maybe (Ptr (FunPtr TestFixtureFunc)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr TestFixtureFunc))
funptrptr


-- callback SpawnChildSetupFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "user data to pass to the function."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 0
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Specifies the type of the setup function passed to g_spawn_async(),\ng_spawn_sync() and g_spawn_async_with_pipes(), which can, in very\nlimited ways, be used to affect the child's execution.\n\nOn POSIX platforms, the function is called in the child after GLib\nhas performed all the setup it plans to perform, but before calling\nexec(). Actions taken in this function will only affect the child,\nnot the parent.\n\nOn Windows, the function is called in the parent. Its usefulness on\nWindows is thus questionable. In many cases executing the child setup\nfunction in the parent can have ill effects, and you should be very\ncareful when porting software to Windows that uses child setup\nfunctions.\n\nHowever, even on POSIX, you are extremely limited in what you can\nsafely do from a #GSpawnChildSetupFunc, because any mutexes that were\nheld by other threads in the parent process at the time of the fork()\nwill still be locked in the child process, and they will never be\nunlocked (since the threads that held them don't exist in the child).\nPOSIX allows only async-signal-safe functions (see signal(7)) to be\ncalled in the child between fork() and exec(), which drastically limits\nthe usefulness of child setup functions.\n\nIn particular, it is not safe to call any function which may\ncall malloc(), which includes POSIX functions such as setenv().\nIf you need to set up the child environment differently from\nthe parent, you should use g_get_environ(), g_environ_setenv(),\nand g_environ_unsetenv(), and then pass the complete environment\nlist to the `g_spawn...` function."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_SpawnChildSetupFunc =
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user data to pass to the function."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 0
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_SpawnChildSetupFunc :: FunPtr C_SpawnChildSetupFunc -> C_SpawnChildSetupFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_SpawnChildSetupFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SpawnChildSetupFunc
    -> Ptr ()
    -- ^ /@userData@/: user data to pass to the function.
    -> m ()
dynamic_SpawnChildSetupFunc :: FunPtr TestFixtureFunc -> Ptr () -> m ()
dynamic_SpawnChildSetupFunc FunPtr TestFixtureFunc
__funPtr Ptr ()
userData = C_VoidFunc -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (C_VoidFunc -> m ()) -> C_VoidFunc -> m ()
forall a b. (a -> b) -> a -> b
$ do
    (FunPtr TestFixtureFunc -> TestFixtureFunc
__dynamic_C_SpawnChildSetupFunc FunPtr TestFixtureFunc
__funPtr) Ptr ()
userData
    () -> C_VoidFunc
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | Specifies the type of the setup function passed to 'GI.GLib.Functions.spawnAsync',
-- 'GI.GLib.Functions.spawnSync' and 'GI.GLib.Functions.spawnAsyncWithPipes', which can, in very
-- limited ways, be used to affect the child\'s execution.
-- 
-- On POSIX platforms, the function is called in the child after GLib
-- has performed all the setup it plans to perform, but before calling
-- @/exec()/@. Actions taken in this function will only affect the child,
-- not the parent.
-- 
-- On Windows, the function is called in the parent. Its usefulness on
-- Windows is thus questionable. In many cases executing the child setup
-- function in the parent can have ill effects, and you should be very
-- careful when porting software to Windows that uses child setup
-- functions.
-- 
-- However, even on POSIX, you are extremely limited in what you can
-- safely do from a t'GI.GLib.Callbacks.SpawnChildSetupFunc', because any mutexes that were
-- held by other threads in the parent process at the time of the @/fork()/@
-- will still be locked in the child process, and they will never be
-- unlocked (since the threads that held them don\'t exist in the child).
-- POSIX allows only async-signal-safe functions (see signal(7)) to be
-- called in the child between @/fork()/@ and @/exec()/@, which drastically limits
-- the usefulness of child setup functions.
-- 
-- In particular, it is not safe to call any function which may
-- call @/malloc()/@, which includes POSIX functions such as @/setenv()/@.
-- If you need to set up the child environment differently from
-- the parent, you should use 'GI.GLib.Functions.getEnviron', 'GI.GLib.Functions.environSetenv',
-- and 'GI.GLib.Functions.environUnsetenv', and then pass the complete environment
-- list to the @g_spawn...@ function.
type SpawnChildSetupFunc =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `SpawnChildSetupFunc`@.
noSpawnChildSetupFunc :: Maybe SpawnChildSetupFunc
noSpawnChildSetupFunc :: Maybe C_VoidFunc
noSpawnChildSetupFunc = Maybe C_VoidFunc
forall a. Maybe a
Nothing

-- | Specifies the type of the setup function passed to 'GI.GLib.Functions.spawnAsync',
-- 'GI.GLib.Functions.spawnSync' and 'GI.GLib.Functions.spawnAsyncWithPipes', which can, in very
-- limited ways, be used to affect the child\'s execution.
-- 
-- On POSIX platforms, the function is called in the child after GLib
-- has performed all the setup it plans to perform, but before calling
-- @/exec()/@. Actions taken in this function will only affect the child,
-- not the parent.
-- 
-- On Windows, the function is called in the parent. Its usefulness on
-- Windows is thus questionable. In many cases executing the child setup
-- function in the parent can have ill effects, and you should be very
-- careful when porting software to Windows that uses child setup
-- functions.
-- 
-- However, even on POSIX, you are extremely limited in what you can
-- safely do from a t'GI.GLib.Callbacks.SpawnChildSetupFunc', because any mutexes that were
-- held by other threads in the parent process at the time of the @/fork()/@
-- will still be locked in the child process, and they will never be
-- unlocked (since the threads that held them don\'t exist in the child).
-- POSIX allows only async-signal-safe functions (see signal(7)) to be
-- called in the child between @/fork()/@ and @/exec()/@, which drastically limits
-- the usefulness of child setup functions.
-- 
-- In particular, it is not safe to call any function which may
-- call @/malloc()/@, which includes POSIX functions such as @/setenv()/@.
-- If you need to set up the child environment differently from
-- the parent, you should use 'GI.GLib.Functions.getEnviron', 'GI.GLib.Functions.environSetenv',
-- and 'GI.GLib.Functions.environUnsetenv', and then pass the complete environment
-- list to the @g_spawn...@ function.
type SpawnChildSetupFunc_WithClosures =
    Ptr ()
    -- ^ /@userData@/: user data to pass to the function.
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `SpawnChildSetupFunc_WithClosures`@.
noSpawnChildSetupFunc_WithClosures :: Maybe SpawnChildSetupFunc_WithClosures
noSpawnChildSetupFunc_WithClosures :: Maybe TestFixtureFunc
noSpawnChildSetupFunc_WithClosures = Maybe TestFixtureFunc
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_SpawnChildSetupFunc :: SpawnChildSetupFunc -> SpawnChildSetupFunc_WithClosures
drop_closures_SpawnChildSetupFunc :: C_VoidFunc -> TestFixtureFunc
drop_closures_SpawnChildSetupFunc C_VoidFunc
_f Ptr ()
_ = C_VoidFunc
_f 

-- | Wrap the callback into a `GClosure`.
genClosure_SpawnChildSetupFunc :: MonadIO m => SpawnChildSetupFunc -> m (GClosure C_SpawnChildSetupFunc)
genClosure_SpawnChildSetupFunc :: C_VoidFunc -> m (GClosure TestFixtureFunc)
genClosure_SpawnChildSetupFunc C_VoidFunc
cb = IO (GClosure TestFixtureFunc) -> m (GClosure TestFixtureFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure TestFixtureFunc) -> m (GClosure TestFixtureFunc))
-> IO (GClosure TestFixtureFunc) -> m (GClosure TestFixtureFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: TestFixtureFunc
cb' = C_VoidFunc -> TestFixtureFunc
drop_closures_SpawnChildSetupFunc C_VoidFunc
cb
    let cb'' :: TestFixtureFunc
cb'' = Maybe (Ptr (FunPtr TestFixtureFunc))
-> TestFixtureFunc -> TestFixtureFunc
wrap_SpawnChildSetupFunc Maybe (Ptr (FunPtr TestFixtureFunc))
forall a. Maybe a
Nothing TestFixtureFunc
cb'
    TestFixtureFunc -> IO (FunPtr TestFixtureFunc)
mk_SpawnChildSetupFunc TestFixtureFunc
cb'' IO (FunPtr TestFixtureFunc)
-> (FunPtr TestFixtureFunc -> IO (GClosure TestFixtureFunc))
-> IO (GClosure TestFixtureFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr TestFixtureFunc -> IO (GClosure TestFixtureFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `SpawnChildSetupFunc` into a `C_SpawnChildSetupFunc`.
wrap_SpawnChildSetupFunc ::
    Maybe (Ptr (FunPtr C_SpawnChildSetupFunc)) ->
    SpawnChildSetupFunc_WithClosures ->
    C_SpawnChildSetupFunc
wrap_SpawnChildSetupFunc :: Maybe (Ptr (FunPtr TestFixtureFunc))
-> TestFixtureFunc -> TestFixtureFunc
wrap_SpawnChildSetupFunc Maybe (Ptr (FunPtr TestFixtureFunc))
funptrptr TestFixtureFunc
_cb Ptr ()
userData = do
    TestFixtureFunc
_cb  Ptr ()
userData
    Maybe (Ptr (FunPtr TestFixtureFunc)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr TestFixtureFunc))
funptrptr


-- callback SourceFuncsPrepareFieldCallback
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "source"
          , argType =
              TInterface Name { namespace = "GLib" , name = "Source" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "timeout_"
          , argType = TBasicType TInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_SourceFuncsPrepareFieldCallback =
    Ptr GLib.Source.Source ->
    Int32 ->
    IO CInt

-- Args: [ Arg
--           { argCName = "source"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Source" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "timeout_"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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_SourceFuncsPrepareFieldCallback :: FunPtr C_SourceFuncsPrepareFieldCallback -> C_SourceFuncsPrepareFieldCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_SourceFuncsPrepareFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SourceFuncsPrepareFieldCallback
    -> GLib.Source.Source
    -> Int32
    -> m Bool
dynamic_SourceFuncsPrepareFieldCallback :: FunPtr C_SourceFuncsPrepareFieldCallback
-> Source -> Int32 -> m Bool
dynamic_SourceFuncsPrepareFieldCallback FunPtr C_SourceFuncsPrepareFieldCallback
__funPtr Source
source Int32
timeout_ = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Source
source' <- Source -> IO (Ptr Source)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Source
source
    CInt
result <- (FunPtr C_SourceFuncsPrepareFieldCallback
-> C_SourceFuncsPrepareFieldCallback
__dynamic_C_SourceFuncsPrepareFieldCallback FunPtr C_SourceFuncsPrepareFieldCallback
__funPtr) Ptr Source
source' Int32
timeout_
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Source -> C_VoidFunc
forall a. ManagedPtrNewtype a => a -> C_VoidFunc
touchManagedPtr Source
source
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | /No description available in the introspection data./
type SourceFuncsPrepareFieldCallback =
    GLib.Source.Source
    -> Int32
    -> IO Bool

-- | A convenience synonym for @`Nothing` :: `Maybe` `SourceFuncsPrepareFieldCallback`@.
noSourceFuncsPrepareFieldCallback :: Maybe SourceFuncsPrepareFieldCallback
noSourceFuncsPrepareFieldCallback :: Maybe SourceFuncsPrepareFieldCallback
noSourceFuncsPrepareFieldCallback = Maybe SourceFuncsPrepareFieldCallback
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_SourceFuncsPrepareFieldCallback :: MonadIO m => SourceFuncsPrepareFieldCallback -> m (GClosure C_SourceFuncsPrepareFieldCallback)
genClosure_SourceFuncsPrepareFieldCallback :: SourceFuncsPrepareFieldCallback
-> m (GClosure C_SourceFuncsPrepareFieldCallback)
genClosure_SourceFuncsPrepareFieldCallback SourceFuncsPrepareFieldCallback
cb = IO (GClosure C_SourceFuncsPrepareFieldCallback)
-> m (GClosure C_SourceFuncsPrepareFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SourceFuncsPrepareFieldCallback)
 -> m (GClosure C_SourceFuncsPrepareFieldCallback))
-> IO (GClosure C_SourceFuncsPrepareFieldCallback)
-> m (GClosure C_SourceFuncsPrepareFieldCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_SourceFuncsPrepareFieldCallback
cb' = Maybe (Ptr (FunPtr C_SourceFuncsPrepareFieldCallback))
-> SourceFuncsPrepareFieldCallback
-> C_SourceFuncsPrepareFieldCallback
wrap_SourceFuncsPrepareFieldCallback Maybe (Ptr (FunPtr C_SourceFuncsPrepareFieldCallback))
forall a. Maybe a
Nothing SourceFuncsPrepareFieldCallback
cb
    C_SourceFuncsPrepareFieldCallback
-> IO (FunPtr C_SourceFuncsPrepareFieldCallback)
mk_SourceFuncsPrepareFieldCallback C_SourceFuncsPrepareFieldCallback
cb' IO (FunPtr C_SourceFuncsPrepareFieldCallback)
-> (FunPtr C_SourceFuncsPrepareFieldCallback
    -> IO (GClosure C_SourceFuncsPrepareFieldCallback))
-> IO (GClosure C_SourceFuncsPrepareFieldCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SourceFuncsPrepareFieldCallback
-> IO (GClosure C_SourceFuncsPrepareFieldCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `SourceFuncsPrepareFieldCallback` into a `C_SourceFuncsPrepareFieldCallback`.
wrap_SourceFuncsPrepareFieldCallback ::
    Maybe (Ptr (FunPtr C_SourceFuncsPrepareFieldCallback)) ->
    SourceFuncsPrepareFieldCallback ->
    C_SourceFuncsPrepareFieldCallback
wrap_SourceFuncsPrepareFieldCallback :: Maybe (Ptr (FunPtr C_SourceFuncsPrepareFieldCallback))
-> SourceFuncsPrepareFieldCallback
-> C_SourceFuncsPrepareFieldCallback
wrap_SourceFuncsPrepareFieldCallback Maybe (Ptr (FunPtr C_SourceFuncsPrepareFieldCallback))
funptrptr SourceFuncsPrepareFieldCallback
_cb Ptr Source
source Int32
timeout_ = do
    (ManagedPtr Source -> Source)
-> Ptr Source -> (Source -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Source -> Source
GLib.Source.Source Ptr Source
source ((Source -> IO CInt) -> IO CInt) -> (Source -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Source
source' -> do
        Bool
result <- SourceFuncsPrepareFieldCallback
_cb  Source
source' Int32
timeout_
        Maybe (Ptr (FunPtr C_SourceFuncsPrepareFieldCallback))
-> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_SourceFuncsPrepareFieldCallback))
funptrptr
        let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
        CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback SourceFuncsFinalizeFieldCallback
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "source"
          , argType =
              TInterface Name { namespace = "GLib" , name = "Source" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_SourceFuncsFinalizeFieldCallback =
    Ptr GLib.Source.Source ->
    IO ()

-- Args: [ Arg
--           { argCName = "source"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Source" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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_SourceFuncsFinalizeFieldCallback :: FunPtr C_SourceFuncsFinalizeFieldCallback -> C_SourceFuncsFinalizeFieldCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_SourceFuncsFinalizeFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SourceFuncsFinalizeFieldCallback
    -> GLib.Source.Source
    -> m ()
dynamic_SourceFuncsFinalizeFieldCallback :: FunPtr C_SourceFuncsFinalizeFieldCallback -> Source -> m ()
dynamic_SourceFuncsFinalizeFieldCallback FunPtr C_SourceFuncsFinalizeFieldCallback
__funPtr Source
source = C_VoidFunc -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (C_VoidFunc -> m ()) -> C_VoidFunc -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Source
source' <- Source -> IO (Ptr Source)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Source
source
    (FunPtr C_SourceFuncsFinalizeFieldCallback
-> C_SourceFuncsFinalizeFieldCallback
__dynamic_C_SourceFuncsFinalizeFieldCallback FunPtr C_SourceFuncsFinalizeFieldCallback
__funPtr) Ptr Source
source'
    Source -> C_VoidFunc
forall a. ManagedPtrNewtype a => a -> C_VoidFunc
touchManagedPtr Source
source
    () -> C_VoidFunc
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | /No description available in the introspection data./
type SourceFuncsFinalizeFieldCallback =
    GLib.Source.Source
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `SourceFuncsFinalizeFieldCallback`@.
noSourceFuncsFinalizeFieldCallback :: Maybe SourceFuncsFinalizeFieldCallback
noSourceFuncsFinalizeFieldCallback :: Maybe (Source -> C_VoidFunc)
noSourceFuncsFinalizeFieldCallback = Maybe (Source -> C_VoidFunc)
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_SourceFuncsFinalizeFieldCallback :: MonadIO m => SourceFuncsFinalizeFieldCallback -> m (GClosure C_SourceFuncsFinalizeFieldCallback)
genClosure_SourceFuncsFinalizeFieldCallback :: (Source -> C_VoidFunc)
-> m (GClosure C_SourceFuncsFinalizeFieldCallback)
genClosure_SourceFuncsFinalizeFieldCallback Source -> C_VoidFunc
cb = IO (GClosure C_SourceFuncsFinalizeFieldCallback)
-> m (GClosure C_SourceFuncsFinalizeFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SourceFuncsFinalizeFieldCallback)
 -> m (GClosure C_SourceFuncsFinalizeFieldCallback))
-> IO (GClosure C_SourceFuncsFinalizeFieldCallback)
-> m (GClosure C_SourceFuncsFinalizeFieldCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_SourceFuncsFinalizeFieldCallback
cb' = Maybe (Ptr (FunPtr C_SourceFuncsFinalizeFieldCallback))
-> (Source -> C_VoidFunc) -> C_SourceFuncsFinalizeFieldCallback
wrap_SourceFuncsFinalizeFieldCallback Maybe (Ptr (FunPtr C_SourceFuncsFinalizeFieldCallback))
forall a. Maybe a
Nothing Source -> C_VoidFunc
cb
    C_SourceFuncsFinalizeFieldCallback
-> IO (FunPtr C_SourceFuncsFinalizeFieldCallback)
mk_SourceFuncsFinalizeFieldCallback C_SourceFuncsFinalizeFieldCallback
cb' IO (FunPtr C_SourceFuncsFinalizeFieldCallback)
-> (FunPtr C_SourceFuncsFinalizeFieldCallback
    -> IO (GClosure C_SourceFuncsFinalizeFieldCallback))
-> IO (GClosure C_SourceFuncsFinalizeFieldCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SourceFuncsFinalizeFieldCallback
-> IO (GClosure C_SourceFuncsFinalizeFieldCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `SourceFuncsFinalizeFieldCallback` into a `C_SourceFuncsFinalizeFieldCallback`.
wrap_SourceFuncsFinalizeFieldCallback ::
    Maybe (Ptr (FunPtr C_SourceFuncsFinalizeFieldCallback)) ->
    SourceFuncsFinalizeFieldCallback ->
    C_SourceFuncsFinalizeFieldCallback
wrap_SourceFuncsFinalizeFieldCallback :: Maybe (Ptr (FunPtr C_SourceFuncsFinalizeFieldCallback))
-> (Source -> C_VoidFunc) -> C_SourceFuncsFinalizeFieldCallback
wrap_SourceFuncsFinalizeFieldCallback Maybe (Ptr (FunPtr C_SourceFuncsFinalizeFieldCallback))
funptrptr Source -> C_VoidFunc
_cb Ptr Source
source = do
    (ManagedPtr Source -> Source)
-> Ptr Source -> (Source -> C_VoidFunc) -> C_VoidFunc
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Source -> Source
GLib.Source.Source Ptr Source
source ((Source -> C_VoidFunc) -> C_VoidFunc)
-> (Source -> C_VoidFunc) -> C_VoidFunc
forall a b. (a -> b) -> a -> b
$ \Source
source' -> do
        Source -> C_VoidFunc
_cb  Source
source'
        Maybe (Ptr (FunPtr C_SourceFuncsFinalizeFieldCallback))
-> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_SourceFuncsFinalizeFieldCallback))
funptrptr


-- callback SourceFuncsCheckFieldCallback
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "source"
          , argType =
              TInterface Name { namespace = "GLib" , name = "Source" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_SourceFuncsCheckFieldCallback =
    Ptr GLib.Source.Source ->
    IO CInt

-- Args: [ Arg
--           { argCName = "source"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Source" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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_SourceFuncsCheckFieldCallback :: FunPtr C_SourceFuncsCheckFieldCallback -> C_SourceFuncsCheckFieldCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_SourceFuncsCheckFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SourceFuncsCheckFieldCallback
    -> GLib.Source.Source
    -> m Bool
dynamic_SourceFuncsCheckFieldCallback :: FunPtr C_SourceFuncsCheckFieldCallback -> Source -> m Bool
dynamic_SourceFuncsCheckFieldCallback FunPtr C_SourceFuncsCheckFieldCallback
__funPtr Source
source = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Source
source' <- Source -> IO (Ptr Source)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Source
source
    CInt
result <- (FunPtr C_SourceFuncsCheckFieldCallback
-> C_SourceFuncsCheckFieldCallback
__dynamic_C_SourceFuncsCheckFieldCallback FunPtr C_SourceFuncsCheckFieldCallback
__funPtr) Ptr Source
source'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Source -> C_VoidFunc
forall a. ManagedPtrNewtype a => a -> C_VoidFunc
touchManagedPtr Source
source
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | /No description available in the introspection data./
type SourceFuncsCheckFieldCallback =
    GLib.Source.Source
    -> IO Bool

-- | A convenience synonym for @`Nothing` :: `Maybe` `SourceFuncsCheckFieldCallback`@.
noSourceFuncsCheckFieldCallback :: Maybe SourceFuncsCheckFieldCallback
noSourceFuncsCheckFieldCallback :: Maybe SourceFuncsCheckFieldCallback
noSourceFuncsCheckFieldCallback = Maybe SourceFuncsCheckFieldCallback
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_SourceFuncsCheckFieldCallback :: MonadIO m => SourceFuncsCheckFieldCallback -> m (GClosure C_SourceFuncsCheckFieldCallback)
genClosure_SourceFuncsCheckFieldCallback :: SourceFuncsCheckFieldCallback
-> m (GClosure C_SourceFuncsCheckFieldCallback)
genClosure_SourceFuncsCheckFieldCallback SourceFuncsCheckFieldCallback
cb = IO (GClosure C_SourceFuncsCheckFieldCallback)
-> m (GClosure C_SourceFuncsCheckFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SourceFuncsCheckFieldCallback)
 -> m (GClosure C_SourceFuncsCheckFieldCallback))
-> IO (GClosure C_SourceFuncsCheckFieldCallback)
-> m (GClosure C_SourceFuncsCheckFieldCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_SourceFuncsCheckFieldCallback
cb' = Maybe (Ptr (FunPtr C_SourceFuncsCheckFieldCallback))
-> SourceFuncsCheckFieldCallback -> C_SourceFuncsCheckFieldCallback
wrap_SourceFuncsCheckFieldCallback Maybe (Ptr (FunPtr C_SourceFuncsCheckFieldCallback))
forall a. Maybe a
Nothing SourceFuncsCheckFieldCallback
cb
    C_SourceFuncsCheckFieldCallback
-> IO (FunPtr C_SourceFuncsCheckFieldCallback)
mk_SourceFuncsCheckFieldCallback C_SourceFuncsCheckFieldCallback
cb' IO (FunPtr C_SourceFuncsCheckFieldCallback)
-> (FunPtr C_SourceFuncsCheckFieldCallback
    -> IO (GClosure C_SourceFuncsCheckFieldCallback))
-> IO (GClosure C_SourceFuncsCheckFieldCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SourceFuncsCheckFieldCallback
-> IO (GClosure C_SourceFuncsCheckFieldCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `SourceFuncsCheckFieldCallback` into a `C_SourceFuncsCheckFieldCallback`.
wrap_SourceFuncsCheckFieldCallback ::
    Maybe (Ptr (FunPtr C_SourceFuncsCheckFieldCallback)) ->
    SourceFuncsCheckFieldCallback ->
    C_SourceFuncsCheckFieldCallback
wrap_SourceFuncsCheckFieldCallback :: Maybe (Ptr (FunPtr C_SourceFuncsCheckFieldCallback))
-> SourceFuncsCheckFieldCallback -> C_SourceFuncsCheckFieldCallback
wrap_SourceFuncsCheckFieldCallback Maybe (Ptr (FunPtr C_SourceFuncsCheckFieldCallback))
funptrptr SourceFuncsCheckFieldCallback
_cb Ptr Source
source = do
    (ManagedPtr Source -> Source)
-> Ptr Source -> (Source -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Source -> Source
GLib.Source.Source Ptr Source
source ((Source -> IO CInt) -> IO CInt) -> (Source -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Source
source' -> do
        Bool
result <- SourceFuncsCheckFieldCallback
_cb  Source
source'
        Maybe (Ptr (FunPtr C_SourceFuncsCheckFieldCallback)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_SourceFuncsCheckFieldCallback))
funptrptr
        let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
        CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback SourceFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just
              "%FALSE if the source should be removed. #G_SOURCE_CONTINUE and\n#G_SOURCE_REMOVE are more memorable names for the return value."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText =
                    Just
                      "data passed to the function, set when the source was\n    created with one of the above functions"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 0
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Specifies the type of function passed to g_timeout_add(),\ng_timeout_add_full(), g_idle_add(), and g_idle_add_full().\n\nWhen calling g_source_set_callback(), you may need to cast a function of a\ndifferent type to this type. Use G_SOURCE_FUNC() to avoid warnings about\nincompatible function types."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_SourceFunc =
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "data passed to the function, set when the source was\n    created with one of the above functions"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 0
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_SourceFunc :: FunPtr C_SourceFunc -> C_SourceFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_SourceFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SourceFunc
    -> Ptr ()
    -- ^ /@userData@/: data passed to the function, set when the source was
    --     created with one of the above functions
    -> m Bool
    -- ^ __Returns:__ 'P.False' if the source should be removed. 'GI.GLib.Constants.SOURCE_CONTINUE' and
    -- 'GI.GLib.Constants.SOURCE_REMOVE' are more memorable names for the return value.
dynamic_SourceFunc :: FunPtr C_SourceFunc -> Ptr () -> m Bool
dynamic_SourceFunc FunPtr C_SourceFunc
__funPtr Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    CInt
result <- (FunPtr C_SourceFunc -> C_SourceFunc
__dynamic_C_SourceFunc FunPtr C_SourceFunc
__funPtr) Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | Specifies the type of function passed to @/g_timeout_add()/@,
-- 'GI.GLib.Functions.timeoutAdd', @/g_idle_add()/@, and 'GI.GLib.Functions.idleAdd'.
-- 
-- When calling 'GI.GLib.Structs.Source.sourceSetCallback', you may need to cast a function of a
-- different type to this type. Use @/G_SOURCE_FUNC()/@ to avoid warnings about
-- incompatible function types.
type SourceFunc =
    IO Bool
    -- ^ __Returns:__ 'P.False' if the source should be removed. 'GI.GLib.Constants.SOURCE_CONTINUE' and
    -- 'GI.GLib.Constants.SOURCE_REMOVE' are more memorable names for the return value.

-- | A convenience synonym for @`Nothing` :: `Maybe` `SourceFunc`@.
noSourceFunc :: Maybe SourceFunc
noSourceFunc :: Maybe (IO Bool)
noSourceFunc = Maybe (IO Bool)
forall a. Maybe a
Nothing

-- | Specifies the type of function passed to @/g_timeout_add()/@,
-- 'GI.GLib.Functions.timeoutAdd', @/g_idle_add()/@, and 'GI.GLib.Functions.idleAdd'.
-- 
-- When calling 'GI.GLib.Structs.Source.sourceSetCallback', you may need to cast a function of a
-- different type to this type. Use @/G_SOURCE_FUNC()/@ to avoid warnings about
-- incompatible function types.
type SourceFunc_WithClosures =
    Ptr ()
    -- ^ /@userData@/: data passed to the function, set when the source was
    --     created with one of the above functions
    -> IO Bool
    -- ^ __Returns:__ 'P.False' if the source should be removed. 'GI.GLib.Constants.SOURCE_CONTINUE' and
    -- 'GI.GLib.Constants.SOURCE_REMOVE' are more memorable names for the return value.

-- | A convenience synonym for @`Nothing` :: `Maybe` `SourceFunc_WithClosures`@.
noSourceFunc_WithClosures :: Maybe SourceFunc_WithClosures
noSourceFunc_WithClosures :: Maybe SourceFunc_WithClosures
noSourceFunc_WithClosures = Maybe SourceFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_SourceFunc :: SourceFunc -> SourceFunc_WithClosures
drop_closures_SourceFunc :: IO Bool -> SourceFunc_WithClosures
drop_closures_SourceFunc IO Bool
_f Ptr ()
_ = IO Bool
_f 

-- | Wrap the callback into a `GClosure`.
genClosure_SourceFunc :: MonadIO m => SourceFunc -> m (GClosure C_SourceFunc)
genClosure_SourceFunc :: IO Bool -> m (GClosure C_SourceFunc)
genClosure_SourceFunc IO Bool
cb = IO (GClosure C_SourceFunc) -> m (GClosure C_SourceFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SourceFunc) -> m (GClosure C_SourceFunc))
-> IO (GClosure C_SourceFunc) -> m (GClosure C_SourceFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: SourceFunc_WithClosures
cb' = IO Bool -> SourceFunc_WithClosures
drop_closures_SourceFunc IO Bool
cb
    let cb'' :: C_SourceFunc
cb'' = Maybe (Ptr (FunPtr C_SourceFunc))
-> SourceFunc_WithClosures -> C_SourceFunc
wrap_SourceFunc Maybe (Ptr (FunPtr C_SourceFunc))
forall a. Maybe a
Nothing SourceFunc_WithClosures
cb'
    C_SourceFunc -> IO (FunPtr C_SourceFunc)
mk_SourceFunc C_SourceFunc
cb'' IO (FunPtr C_SourceFunc)
-> (FunPtr C_SourceFunc -> IO (GClosure C_SourceFunc))
-> IO (GClosure C_SourceFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SourceFunc -> IO (GClosure C_SourceFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `SourceFunc` into a `C_SourceFunc`.
wrap_SourceFunc ::
    Maybe (Ptr (FunPtr C_SourceFunc)) ->
    SourceFunc_WithClosures ->
    C_SourceFunc
wrap_SourceFunc :: Maybe (Ptr (FunPtr C_SourceFunc))
-> SourceFunc_WithClosures -> C_SourceFunc
wrap_SourceFunc Maybe (Ptr (FunPtr C_SourceFunc))
funptrptr SourceFunc_WithClosures
_cb Ptr ()
userData = do
    Bool
result <- SourceFunc_WithClosures
_cb  Ptr ()
userData
    Maybe (Ptr (FunPtr C_SourceFunc)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_SourceFunc))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback SourceDummyMarshal
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args = []
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "This is just a placeholder for #GClosureMarshal,\nwhich cannot be used here for dependency reasons."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_SourceDummyMarshal =
    IO ()

-- Args: []
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_SourceDummyMarshal :: FunPtr C_SourceDummyMarshal -> C_SourceDummyMarshal

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_SourceDummyMarshal ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SourceDummyMarshal
    -> m ()
dynamic_SourceDummyMarshal :: FunPtr C_VoidFunc -> m ()
dynamic_SourceDummyMarshal FunPtr C_VoidFunc
__funPtr = C_VoidFunc -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (C_VoidFunc -> m ()) -> C_VoidFunc -> m ()
forall a b. (a -> b) -> a -> b
$ do
    (FunPtr C_VoidFunc -> C_VoidFunc
__dynamic_C_SourceDummyMarshal FunPtr C_VoidFunc
__funPtr)
    () -> C_VoidFunc
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | This is just a placeholder for @/GClosureMarshal/@,
-- which cannot be used here for dependency reasons.
type SourceDummyMarshal =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `SourceDummyMarshal`@.
noSourceDummyMarshal :: Maybe SourceDummyMarshal
noSourceDummyMarshal :: Maybe C_VoidFunc
noSourceDummyMarshal = Maybe C_VoidFunc
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_SourceDummyMarshal :: MonadIO m => SourceDummyMarshal -> m (GClosure C_SourceDummyMarshal)
genClosure_SourceDummyMarshal :: C_VoidFunc -> m (GClosure C_VoidFunc)
genClosure_SourceDummyMarshal C_VoidFunc
cb = IO (GClosure C_VoidFunc) -> m (GClosure C_VoidFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_VoidFunc) -> m (GClosure C_VoidFunc))
-> IO (GClosure C_VoidFunc) -> m (GClosure C_VoidFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_VoidFunc
cb' = Maybe (Ptr (FunPtr C_VoidFunc)) -> C_VoidFunc -> C_VoidFunc
wrap_SourceDummyMarshal Maybe (Ptr (FunPtr C_VoidFunc))
forall a. Maybe a
Nothing C_VoidFunc
cb
    C_VoidFunc -> IO (FunPtr C_VoidFunc)
mk_SourceDummyMarshal C_VoidFunc
cb' IO (FunPtr C_VoidFunc)
-> (FunPtr C_VoidFunc -> IO (GClosure C_VoidFunc))
-> IO (GClosure C_VoidFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_VoidFunc -> IO (GClosure C_VoidFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `SourceDummyMarshal` into a `C_SourceDummyMarshal`.
wrap_SourceDummyMarshal ::
    Maybe (Ptr (FunPtr C_SourceDummyMarshal)) ->
    SourceDummyMarshal ->
    C_SourceDummyMarshal
wrap_SourceDummyMarshal :: Maybe (Ptr (FunPtr C_VoidFunc)) -> C_VoidFunc -> C_VoidFunc
wrap_SourceDummyMarshal Maybe (Ptr (FunPtr C_VoidFunc))
funptrptr C_VoidFunc
_cb = do
    C_VoidFunc
_cb 
    Maybe (Ptr (FunPtr C_VoidFunc)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_VoidFunc))
funptrptr


-- callback SourceDisposeFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "source"
          , argType =
              TInterface Name { namespace = "GLib" , name = "Source" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "#GSource that is currently being disposed"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Dispose function for @source. See g_source_set_dispose_function() for\ndetails."
        , sinceVersion = Just "2.64"
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_SourceDisposeFunc =
    Ptr GLib.Source.Source ->
    IO ()

-- Args: [ Arg
--           { argCName = "source"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Source" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#GSource that is currently being disposed"
--                 , 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_SourceDisposeFunc :: FunPtr C_SourceDisposeFunc -> C_SourceDisposeFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_SourceDisposeFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SourceDisposeFunc
    -> GLib.Source.Source
    -- ^ /@source@/: t'GI.GLib.Structs.Source.Source' that is currently being disposed
    -> m ()
dynamic_SourceDisposeFunc :: FunPtr C_SourceFuncsFinalizeFieldCallback -> Source -> m ()
dynamic_SourceDisposeFunc FunPtr C_SourceFuncsFinalizeFieldCallback
__funPtr Source
source = C_VoidFunc -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (C_VoidFunc -> m ()) -> C_VoidFunc -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Source
source' <- Source -> IO (Ptr Source)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Source
source
    (FunPtr C_SourceFuncsFinalizeFieldCallback
-> C_SourceFuncsFinalizeFieldCallback
__dynamic_C_SourceDisposeFunc FunPtr C_SourceFuncsFinalizeFieldCallback
__funPtr) Ptr Source
source'
    Source -> C_VoidFunc
forall a. ManagedPtrNewtype a => a -> C_VoidFunc
touchManagedPtr Source
source
    () -> C_VoidFunc
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | Dispose function for /@source@/. See @/g_source_set_dispose_function()/@ for
-- details.
-- 
-- /Since: 2.64/
type SourceDisposeFunc =
    GLib.Source.Source
    -- ^ /@source@/: t'GI.GLib.Structs.Source.Source' that is currently being disposed
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `SourceDisposeFunc`@.
noSourceDisposeFunc :: Maybe SourceDisposeFunc
noSourceDisposeFunc :: Maybe (Source -> C_VoidFunc)
noSourceDisposeFunc = Maybe (Source -> C_VoidFunc)
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_SourceDisposeFunc :: MonadIO m => SourceDisposeFunc -> m (GClosure C_SourceDisposeFunc)
genClosure_SourceDisposeFunc :: (Source -> C_VoidFunc)
-> m (GClosure C_SourceFuncsFinalizeFieldCallback)
genClosure_SourceDisposeFunc Source -> C_VoidFunc
cb = IO (GClosure C_SourceFuncsFinalizeFieldCallback)
-> m (GClosure C_SourceFuncsFinalizeFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SourceFuncsFinalizeFieldCallback)
 -> m (GClosure C_SourceFuncsFinalizeFieldCallback))
-> IO (GClosure C_SourceFuncsFinalizeFieldCallback)
-> m (GClosure C_SourceFuncsFinalizeFieldCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_SourceFuncsFinalizeFieldCallback
cb' = Maybe (Ptr (FunPtr C_SourceFuncsFinalizeFieldCallback))
-> (Source -> C_VoidFunc) -> C_SourceFuncsFinalizeFieldCallback
wrap_SourceDisposeFunc Maybe (Ptr (FunPtr C_SourceFuncsFinalizeFieldCallback))
forall a. Maybe a
Nothing Source -> C_VoidFunc
cb
    C_SourceFuncsFinalizeFieldCallback
-> IO (FunPtr C_SourceFuncsFinalizeFieldCallback)
mk_SourceDisposeFunc C_SourceFuncsFinalizeFieldCallback
cb' IO (FunPtr C_SourceFuncsFinalizeFieldCallback)
-> (FunPtr C_SourceFuncsFinalizeFieldCallback
    -> IO (GClosure C_SourceFuncsFinalizeFieldCallback))
-> IO (GClosure C_SourceFuncsFinalizeFieldCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SourceFuncsFinalizeFieldCallback
-> IO (GClosure C_SourceFuncsFinalizeFieldCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `SourceDisposeFunc` into a `C_SourceDisposeFunc`.
wrap_SourceDisposeFunc ::
    Maybe (Ptr (FunPtr C_SourceDisposeFunc)) ->
    SourceDisposeFunc ->
    C_SourceDisposeFunc
wrap_SourceDisposeFunc :: Maybe (Ptr (FunPtr C_SourceFuncsFinalizeFieldCallback))
-> (Source -> C_VoidFunc) -> C_SourceFuncsFinalizeFieldCallback
wrap_SourceDisposeFunc Maybe (Ptr (FunPtr C_SourceFuncsFinalizeFieldCallback))
funptrptr Source -> C_VoidFunc
_cb Ptr Source
source = do
    (ManagedPtr Source -> Source)
-> Ptr Source -> (Source -> C_VoidFunc) -> C_VoidFunc
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Source -> Source
GLib.Source.Source Ptr Source
source ((Source -> C_VoidFunc) -> C_VoidFunc)
-> (Source -> C_VoidFunc) -> C_VoidFunc
forall a b. (a -> b) -> a -> b
$ \Source
source' -> do
        Source -> C_VoidFunc
_cb  Source
source'
        Maybe (Ptr (FunPtr C_SourceFuncsFinalizeFieldCallback))
-> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_SourceFuncsFinalizeFieldCallback))
funptrptr


-- callback SourceCallbackFuncsUnrefFieldCallback
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "cb_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_SourceCallbackFuncsUnrefFieldCallback =
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "cb_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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_SourceCallbackFuncsUnrefFieldCallback :: FunPtr C_SourceCallbackFuncsUnrefFieldCallback -> C_SourceCallbackFuncsUnrefFieldCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_SourceCallbackFuncsUnrefFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SourceCallbackFuncsUnrefFieldCallback
    -> Ptr ()
    -> m ()
dynamic_SourceCallbackFuncsUnrefFieldCallback :: FunPtr TestFixtureFunc -> Ptr () -> m ()
dynamic_SourceCallbackFuncsUnrefFieldCallback FunPtr TestFixtureFunc
__funPtr Ptr ()
cbData = C_VoidFunc -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (C_VoidFunc -> m ()) -> C_VoidFunc -> m ()
forall a b. (a -> b) -> a -> b
$ do
    (FunPtr TestFixtureFunc -> TestFixtureFunc
__dynamic_C_SourceCallbackFuncsUnrefFieldCallback FunPtr TestFixtureFunc
__funPtr) Ptr ()
cbData
    () -> C_VoidFunc
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | /No description available in the introspection data./
type SourceCallbackFuncsUnrefFieldCallback =
    Ptr ()
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `SourceCallbackFuncsUnrefFieldCallback`@.
noSourceCallbackFuncsUnrefFieldCallback :: Maybe SourceCallbackFuncsUnrefFieldCallback
noSourceCallbackFuncsUnrefFieldCallback :: Maybe TestFixtureFunc
noSourceCallbackFuncsUnrefFieldCallback = Maybe TestFixtureFunc
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_SourceCallbackFuncsUnrefFieldCallback :: MonadIO m => SourceCallbackFuncsUnrefFieldCallback -> m (GClosure C_SourceCallbackFuncsUnrefFieldCallback)
genClosure_SourceCallbackFuncsUnrefFieldCallback :: TestFixtureFunc -> m (GClosure TestFixtureFunc)
genClosure_SourceCallbackFuncsUnrefFieldCallback TestFixtureFunc
cb = IO (GClosure TestFixtureFunc) -> m (GClosure TestFixtureFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure TestFixtureFunc) -> m (GClosure TestFixtureFunc))
-> IO (GClosure TestFixtureFunc) -> m (GClosure TestFixtureFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: TestFixtureFunc
cb' = Maybe (Ptr (FunPtr TestFixtureFunc))
-> TestFixtureFunc -> TestFixtureFunc
wrap_SourceCallbackFuncsUnrefFieldCallback Maybe (Ptr (FunPtr TestFixtureFunc))
forall a. Maybe a
Nothing TestFixtureFunc
cb
    TestFixtureFunc -> IO (FunPtr TestFixtureFunc)
mk_SourceCallbackFuncsUnrefFieldCallback TestFixtureFunc
cb' IO (FunPtr TestFixtureFunc)
-> (FunPtr TestFixtureFunc -> IO (GClosure TestFixtureFunc))
-> IO (GClosure TestFixtureFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr TestFixtureFunc -> IO (GClosure TestFixtureFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `SourceCallbackFuncsUnrefFieldCallback` into a `C_SourceCallbackFuncsUnrefFieldCallback`.
wrap_SourceCallbackFuncsUnrefFieldCallback ::
    Maybe (Ptr (FunPtr C_SourceCallbackFuncsUnrefFieldCallback)) ->
    SourceCallbackFuncsUnrefFieldCallback ->
    C_SourceCallbackFuncsUnrefFieldCallback
wrap_SourceCallbackFuncsUnrefFieldCallback :: Maybe (Ptr (FunPtr TestFixtureFunc))
-> TestFixtureFunc -> TestFixtureFunc
wrap_SourceCallbackFuncsUnrefFieldCallback Maybe (Ptr (FunPtr TestFixtureFunc))
funptrptr TestFixtureFunc
_cb Ptr ()
cbData = do
    TestFixtureFunc
_cb  Ptr ()
cbData
    Maybe (Ptr (FunPtr TestFixtureFunc)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr TestFixtureFunc))
funptrptr


-- callback SourceCallbackFuncsRefFieldCallback
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "cb_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_SourceCallbackFuncsRefFieldCallback =
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "cb_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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_SourceCallbackFuncsRefFieldCallback :: FunPtr C_SourceCallbackFuncsRefFieldCallback -> C_SourceCallbackFuncsRefFieldCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_SourceCallbackFuncsRefFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SourceCallbackFuncsRefFieldCallback
    -> Ptr ()
    -> m ()
dynamic_SourceCallbackFuncsRefFieldCallback :: FunPtr TestFixtureFunc -> Ptr () -> m ()
dynamic_SourceCallbackFuncsRefFieldCallback FunPtr TestFixtureFunc
__funPtr Ptr ()
cbData = C_VoidFunc -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (C_VoidFunc -> m ()) -> C_VoidFunc -> m ()
forall a b. (a -> b) -> a -> b
$ do
    (FunPtr TestFixtureFunc -> TestFixtureFunc
__dynamic_C_SourceCallbackFuncsRefFieldCallback FunPtr TestFixtureFunc
__funPtr) Ptr ()
cbData
    () -> C_VoidFunc
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | /No description available in the introspection data./
type SourceCallbackFuncsRefFieldCallback =
    Ptr ()
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `SourceCallbackFuncsRefFieldCallback`@.
noSourceCallbackFuncsRefFieldCallback :: Maybe SourceCallbackFuncsRefFieldCallback
noSourceCallbackFuncsRefFieldCallback :: Maybe TestFixtureFunc
noSourceCallbackFuncsRefFieldCallback = Maybe TestFixtureFunc
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_SourceCallbackFuncsRefFieldCallback :: MonadIO m => SourceCallbackFuncsRefFieldCallback -> m (GClosure C_SourceCallbackFuncsRefFieldCallback)
genClosure_SourceCallbackFuncsRefFieldCallback :: TestFixtureFunc -> m (GClosure TestFixtureFunc)
genClosure_SourceCallbackFuncsRefFieldCallback TestFixtureFunc
cb = IO (GClosure TestFixtureFunc) -> m (GClosure TestFixtureFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure TestFixtureFunc) -> m (GClosure TestFixtureFunc))
-> IO (GClosure TestFixtureFunc) -> m (GClosure TestFixtureFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: TestFixtureFunc
cb' = Maybe (Ptr (FunPtr TestFixtureFunc))
-> TestFixtureFunc -> TestFixtureFunc
wrap_SourceCallbackFuncsRefFieldCallback Maybe (Ptr (FunPtr TestFixtureFunc))
forall a. Maybe a
Nothing TestFixtureFunc
cb
    TestFixtureFunc -> IO (FunPtr TestFixtureFunc)
mk_SourceCallbackFuncsRefFieldCallback TestFixtureFunc
cb' IO (FunPtr TestFixtureFunc)
-> (FunPtr TestFixtureFunc -> IO (GClosure TestFixtureFunc))
-> IO (GClosure TestFixtureFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr TestFixtureFunc -> IO (GClosure TestFixtureFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `SourceCallbackFuncsRefFieldCallback` into a `C_SourceCallbackFuncsRefFieldCallback`.
wrap_SourceCallbackFuncsRefFieldCallback ::
    Maybe (Ptr (FunPtr C_SourceCallbackFuncsRefFieldCallback)) ->
    SourceCallbackFuncsRefFieldCallback ->
    C_SourceCallbackFuncsRefFieldCallback
wrap_SourceCallbackFuncsRefFieldCallback :: Maybe (Ptr (FunPtr TestFixtureFunc))
-> TestFixtureFunc -> TestFixtureFunc
wrap_SourceCallbackFuncsRefFieldCallback Maybe (Ptr (FunPtr TestFixtureFunc))
funptrptr TestFixtureFunc
_cb Ptr ()
cbData = do
    TestFixtureFunc
_cb  Ptr ()
cbData
    Maybe (Ptr (FunPtr TestFixtureFunc)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr TestFixtureFunc))
funptrptr


-- callback SequenceIterCompareFunc
{- Callable
  { returnType = Just (TBasicType TInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just
              "zero if the iterators are equal, a negative value if @a\n    comes before @b, and a positive value if @b comes before @a."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "a"
          , argType =
              TInterface Name { namespace = "GLib" , name = "SequenceIter" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GSequenceIter" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "b"
          , argType =
              TInterface Name { namespace = "GLib" , name = "SequenceIter" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GSequenceIter" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "user data" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A #GSequenceIterCompareFunc is a function used to compare iterators.\nIt must return zero if the iterators compare equal, a negative value\nif @a comes before @b, and a positive value if @b comes before @a."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_SequenceIterCompareFunc =
    Ptr GLib.SequenceIter.SequenceIter ->
    Ptr GLib.SequenceIter.SequenceIter ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "a"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "SequenceIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GSequenceIter" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "b"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "SequenceIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GSequenceIter" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user data" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_SequenceIterCompareFunc :: FunPtr C_SequenceIterCompareFunc -> C_SequenceIterCompareFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_SequenceIterCompareFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_SequenceIterCompareFunc
    -> GLib.SequenceIter.SequenceIter
    -- ^ /@a@/: a t'GI.GLib.Structs.SequenceIter.SequenceIter'
    -> GLib.SequenceIter.SequenceIter
    -- ^ /@b@/: a t'GI.GLib.Structs.SequenceIter.SequenceIter'
    -> Ptr ()
    -- ^ /@data@/: user data
    -> m Int32
    -- ^ __Returns:__ zero if the iterators are equal, a negative value if /@a@/
    --     comes before /@b@/, and a positive value if /@b@/ comes before /@a@/.
dynamic_SequenceIterCompareFunc :: FunPtr C_SequenceIterCompareFunc
-> SequenceIter -> SequenceIter -> Ptr () -> m Int32
dynamic_SequenceIterCompareFunc FunPtr C_SequenceIterCompareFunc
__funPtr SequenceIter
a SequenceIter
b Ptr ()
data_ = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr SequenceIter
a' <- SequenceIter -> IO (Ptr SequenceIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SequenceIter
a
    Ptr SequenceIter
b' <- SequenceIter -> IO (Ptr SequenceIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SequenceIter
b
    Int32
result <- (FunPtr C_SequenceIterCompareFunc -> C_SequenceIterCompareFunc
__dynamic_C_SequenceIterCompareFunc FunPtr C_SequenceIterCompareFunc
__funPtr) Ptr SequenceIter
a' Ptr SequenceIter
b' Ptr ()
data_
    SequenceIter -> C_VoidFunc
forall a. ManagedPtrNewtype a => a -> C_VoidFunc
touchManagedPtr SequenceIter
a
    SequenceIter -> C_VoidFunc
forall a. ManagedPtrNewtype a => a -> C_VoidFunc
touchManagedPtr SequenceIter
b
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

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

-- | A t'GI.GLib.Callbacks.SequenceIterCompareFunc' is a function used to compare iterators.
-- It must return zero if the iterators compare equal, a negative value
-- if /@a@/ comes before /@b@/, and a positive value if /@b@/ comes before /@a@/.
type SequenceIterCompareFunc =
    GLib.SequenceIter.SequenceIter
    -- ^ /@a@/: a t'GI.GLib.Structs.SequenceIter.SequenceIter'
    -> GLib.SequenceIter.SequenceIter
    -- ^ /@b@/: a t'GI.GLib.Structs.SequenceIter.SequenceIter'
    -> Ptr ()
    -- ^ /@data@/: user data
    -> IO Int32
    -- ^ __Returns:__ zero if the iterators are equal, a negative value if /@a@/
    --     comes before /@b@/, and a positive value if /@b@/ comes before /@a@/.

-- | A convenience synonym for @`Nothing` :: `Maybe` `SequenceIterCompareFunc`@.
noSequenceIterCompareFunc :: Maybe SequenceIterCompareFunc
noSequenceIterCompareFunc :: Maybe SequenceIterCompareFunc
noSequenceIterCompareFunc = Maybe SequenceIterCompareFunc
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_SequenceIterCompareFunc :: MonadIO m => SequenceIterCompareFunc -> m (GClosure C_SequenceIterCompareFunc)
genClosure_SequenceIterCompareFunc :: SequenceIterCompareFunc -> m (GClosure C_SequenceIterCompareFunc)
genClosure_SequenceIterCompareFunc SequenceIterCompareFunc
cb = IO (GClosure C_SequenceIterCompareFunc)
-> m (GClosure C_SequenceIterCompareFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SequenceIterCompareFunc)
 -> m (GClosure C_SequenceIterCompareFunc))
-> IO (GClosure C_SequenceIterCompareFunc)
-> m (GClosure C_SequenceIterCompareFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_SequenceIterCompareFunc
cb' = Maybe (Ptr (FunPtr C_SequenceIterCompareFunc))
-> SequenceIterCompareFunc -> C_SequenceIterCompareFunc
wrap_SequenceIterCompareFunc Maybe (Ptr (FunPtr C_SequenceIterCompareFunc))
forall a. Maybe a
Nothing SequenceIterCompareFunc
cb
    C_SequenceIterCompareFunc -> IO (FunPtr C_SequenceIterCompareFunc)
mk_SequenceIterCompareFunc C_SequenceIterCompareFunc
cb' IO (FunPtr C_SequenceIterCompareFunc)
-> (FunPtr C_SequenceIterCompareFunc
    -> IO (GClosure C_SequenceIterCompareFunc))
-> IO (GClosure C_SequenceIterCompareFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SequenceIterCompareFunc
-> IO (GClosure C_SequenceIterCompareFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `SequenceIterCompareFunc` into a `C_SequenceIterCompareFunc`.
wrap_SequenceIterCompareFunc ::
    Maybe (Ptr (FunPtr C_SequenceIterCompareFunc)) ->
    SequenceIterCompareFunc ->
    C_SequenceIterCompareFunc
wrap_SequenceIterCompareFunc :: Maybe (Ptr (FunPtr C_SequenceIterCompareFunc))
-> SequenceIterCompareFunc -> C_SequenceIterCompareFunc
wrap_SequenceIterCompareFunc Maybe (Ptr (FunPtr C_SequenceIterCompareFunc))
funptrptr SequenceIterCompareFunc
_cb Ptr SequenceIter
a Ptr SequenceIter
b Ptr ()
data_ = do
    SequenceIter
a' <- ((ManagedPtr SequenceIter -> SequenceIter)
-> Ptr SequenceIter -> IO SequenceIter
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr SequenceIter -> SequenceIter
GLib.SequenceIter.SequenceIter) Ptr SequenceIter
a
    SequenceIter
b' <- ((ManagedPtr SequenceIter -> SequenceIter)
-> Ptr SequenceIter -> IO SequenceIter
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr SequenceIter -> SequenceIter
GLib.SequenceIter.SequenceIter) Ptr SequenceIter
b
    Int32
result <- SequenceIterCompareFunc
_cb  SequenceIter
a' SequenceIter
b' Ptr ()
data_
    Maybe (Ptr (FunPtr C_SequenceIterCompareFunc)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_SequenceIterCompareFunc))
funptrptr
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- callback ScannerMsgFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "scanner"
          , argType =
              TInterface Name { namespace = "GLib" , name = "Scanner" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GScanner" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "message"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the message" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "error"
          , argType = TBasicType TBoolean
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText =
                    Just
                      "%TRUE if the message signals an error,\n    %FALSE if it signals a warning."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just "Specifies the type of the message handler function."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_ScannerMsgFunc =
    Ptr GLib.Scanner.Scanner ->
    CString ->
    CInt ->
    IO ()

-- Args: [ Arg
--           { argCName = "scanner"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Scanner" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GScanner" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "message"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the message" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "error"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "%TRUE if the message signals an error,\n    %FALSE if it signals a warning."
--                 , 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_ScannerMsgFunc :: FunPtr C_ScannerMsgFunc -> C_ScannerMsgFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_ScannerMsgFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_ScannerMsgFunc
    -> GLib.Scanner.Scanner
    -- ^ /@scanner@/: a t'GI.GLib.Structs.Scanner.Scanner'
    -> T.Text
    -- ^ /@message@/: the message
    -> Bool
    -- ^ /@error@/: 'P.True' if the message signals an error,
    --     'P.False' if it signals a warning.
    -> m ()
dynamic_ScannerMsgFunc :: FunPtr C_ScannerMsgFunc -> Scanner -> Text -> Bool -> m ()
dynamic_ScannerMsgFunc FunPtr C_ScannerMsgFunc
__funPtr Scanner
scanner Text
message Bool
error_ = C_VoidFunc -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (C_VoidFunc -> m ()) -> C_VoidFunc -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Scanner
scanner' <- Scanner -> IO (Ptr Scanner)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Scanner
scanner
    CString
message' <- Text -> IO CString
textToCString Text
message
    let error_' :: CInt
error_' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
error_
    (FunPtr C_ScannerMsgFunc -> C_ScannerMsgFunc
__dynamic_C_ScannerMsgFunc FunPtr C_ScannerMsgFunc
__funPtr) Ptr Scanner
scanner' CString
message' CInt
error_'
    Scanner -> C_VoidFunc
forall a. ManagedPtrNewtype a => a -> C_VoidFunc
touchManagedPtr Scanner
scanner
    CString -> C_VoidFunc
forall a. Ptr a -> C_VoidFunc
freeMem CString
message'
    () -> C_VoidFunc
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | Specifies the type of the message handler function.
type ScannerMsgFunc =
    GLib.Scanner.Scanner
    -- ^ /@scanner@/: a t'GI.GLib.Structs.Scanner.Scanner'
    -> T.Text
    -- ^ /@message@/: the message
    -> Bool
    -- ^ /@error@/: 'P.True' if the message signals an error,
    --     'P.False' if it signals a warning.
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `ScannerMsgFunc`@.
noScannerMsgFunc :: Maybe ScannerMsgFunc
noScannerMsgFunc :: Maybe ScannerMsgFunc
noScannerMsgFunc = Maybe ScannerMsgFunc
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_ScannerMsgFunc :: MonadIO m => ScannerMsgFunc -> m (GClosure C_ScannerMsgFunc)
genClosure_ScannerMsgFunc :: ScannerMsgFunc -> m (GClosure C_ScannerMsgFunc)
genClosure_ScannerMsgFunc ScannerMsgFunc
cb = IO (GClosure C_ScannerMsgFunc) -> m (GClosure C_ScannerMsgFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ScannerMsgFunc) -> m (GClosure C_ScannerMsgFunc))
-> IO (GClosure C_ScannerMsgFunc) -> m (GClosure C_ScannerMsgFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ScannerMsgFunc
cb' = Maybe (Ptr (FunPtr C_ScannerMsgFunc))
-> ScannerMsgFunc -> C_ScannerMsgFunc
wrap_ScannerMsgFunc Maybe (Ptr (FunPtr C_ScannerMsgFunc))
forall a. Maybe a
Nothing ScannerMsgFunc
cb
    C_ScannerMsgFunc -> IO (FunPtr C_ScannerMsgFunc)
mk_ScannerMsgFunc C_ScannerMsgFunc
cb' IO (FunPtr C_ScannerMsgFunc)
-> (FunPtr C_ScannerMsgFunc -> IO (GClosure C_ScannerMsgFunc))
-> IO (GClosure C_ScannerMsgFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ScannerMsgFunc -> IO (GClosure C_ScannerMsgFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ScannerMsgFunc` into a `C_ScannerMsgFunc`.
wrap_ScannerMsgFunc ::
    Maybe (Ptr (FunPtr C_ScannerMsgFunc)) ->
    ScannerMsgFunc ->
    C_ScannerMsgFunc
wrap_ScannerMsgFunc :: Maybe (Ptr (FunPtr C_ScannerMsgFunc))
-> ScannerMsgFunc -> C_ScannerMsgFunc
wrap_ScannerMsgFunc Maybe (Ptr (FunPtr C_ScannerMsgFunc))
funptrptr ScannerMsgFunc
_cb Ptr Scanner
scanner CString
message CInt
error_ = do
    Scanner
scanner' <- ((ManagedPtr Scanner -> Scanner) -> Ptr Scanner -> IO Scanner
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Scanner -> Scanner
GLib.Scanner.Scanner) Ptr Scanner
scanner
    Text
message' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
message
    let error_' :: Bool
error_' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
error_
    ScannerMsgFunc
_cb  Scanner
scanner' Text
message' Bool
error_'
    Maybe (Ptr (FunPtr C_ScannerMsgFunc)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ScannerMsgFunc))
funptrptr


-- callback RegexEvalCallback
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just "%FALSE to continue the replacement process, %TRUE to stop it"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "match_info"
          , argType =
              TInterface Name { namespace = "GLib" , name = "MatchInfo" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText =
                    Just
                      "the #GMatchInfo generated by the match.\n    Use g_match_info_get_regex() and g_match_info_get_string() if you\n    need the #GRegex or the matched string."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "result"
          , argType =
              TInterface Name { namespace = "GLib" , name = "String" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GString containing the new string"
                , 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_regex_replace_eval()"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 2
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Specifies the type of the function passed to g_regex_replace_eval().\nIt is called for each occurrence of the pattern in the string passed\nto g_regex_replace_eval(), and it should append the replacement to\n@result."
        , sinceVersion = Just "2.14"
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_RegexEvalCallback =
    Ptr GLib.MatchInfo.MatchInfo ->
    Ptr GLib.String.String ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "match_info"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "MatchInfo" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the #GMatchInfo generated by the match.\n    Use g_match_info_get_regex() and g_match_info_get_string() if you\n    need the #GRegex or the matched string."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "String" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GString containing the new string"
--                 , 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_regex_replace_eval()"
--                 , 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_RegexEvalCallback :: FunPtr C_RegexEvalCallback -> C_RegexEvalCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_RegexEvalCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_RegexEvalCallback
    -> GLib.MatchInfo.MatchInfo
    -- ^ /@matchInfo@/: the t'GI.GLib.Structs.MatchInfo.MatchInfo' generated by the match.
    --     Use 'GI.GLib.Structs.MatchInfo.matchInfoGetRegex' and 'GI.GLib.Structs.MatchInfo.matchInfoGetString' if you
    --     need the t'GI.GLib.Structs.Regex.Regex' or the matched string.
    -> GLib.String.String
    -- ^ /@result@/: a t'GI.GLib.Structs.String.String' containing the new string
    -> Ptr ()
    -- ^ /@userData@/: user data passed to @/g_regex_replace_eval()/@
    -> m Bool
    -- ^ __Returns:__ 'P.False' to continue the replacement process, 'P.True' to stop it
dynamic_RegexEvalCallback :: FunPtr C_RegexEvalCallback
-> MatchInfo -> String -> Ptr () -> m Bool
dynamic_RegexEvalCallback FunPtr C_RegexEvalCallback
__funPtr MatchInfo
matchInfo String
result_ Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr MatchInfo
matchInfo' <- MatchInfo -> IO (Ptr MatchInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MatchInfo
matchInfo
    Ptr String
result_' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
result_
    CInt
result <- (FunPtr C_RegexEvalCallback -> C_RegexEvalCallback
__dynamic_C_RegexEvalCallback FunPtr C_RegexEvalCallback
__funPtr) Ptr MatchInfo
matchInfo' Ptr String
result_' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    MatchInfo -> C_VoidFunc
forall a. ManagedPtrNewtype a => a -> C_VoidFunc
touchManagedPtr MatchInfo
matchInfo
    String -> C_VoidFunc
forall a. ManagedPtrNewtype a => a -> C_VoidFunc
touchManagedPtr String
result_
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | Specifies the type of the function passed to @/g_regex_replace_eval()/@.
-- It is called for each occurrence of the pattern in the string passed
-- to @/g_regex_replace_eval()/@, and it should append the replacement to
-- /@result@/.
-- 
-- /Since: 2.14/
type RegexEvalCallback =
    GLib.MatchInfo.MatchInfo
    -- ^ /@matchInfo@/: the t'GI.GLib.Structs.MatchInfo.MatchInfo' generated by the match.
    --     Use 'GI.GLib.Structs.MatchInfo.matchInfoGetRegex' and 'GI.GLib.Structs.MatchInfo.matchInfoGetString' if you
    --     need the t'GI.GLib.Structs.Regex.Regex' or the matched string.
    -> GLib.String.String
    -- ^ /@result@/: a t'GI.GLib.Structs.String.String' containing the new string
    -> IO Bool
    -- ^ __Returns:__ 'P.False' to continue the replacement process, 'P.True' to stop it

-- | A convenience synonym for @`Nothing` :: `Maybe` `RegexEvalCallback`@.
noRegexEvalCallback :: Maybe RegexEvalCallback
noRegexEvalCallback :: Maybe RegexEvalCallback
noRegexEvalCallback = Maybe RegexEvalCallback
forall a. Maybe a
Nothing

-- | Specifies the type of the function passed to @/g_regex_replace_eval()/@.
-- It is called for each occurrence of the pattern in the string passed
-- to @/g_regex_replace_eval()/@, and it should append the replacement to
-- /@result@/.
-- 
-- /Since: 2.14/
type RegexEvalCallback_WithClosures =
    GLib.MatchInfo.MatchInfo
    -- ^ /@matchInfo@/: the t'GI.GLib.Structs.MatchInfo.MatchInfo' generated by the match.
    --     Use 'GI.GLib.Structs.MatchInfo.matchInfoGetRegex' and 'GI.GLib.Structs.MatchInfo.matchInfoGetString' if you
    --     need the t'GI.GLib.Structs.Regex.Regex' or the matched string.
    -> GLib.String.String
    -- ^ /@result@/: a t'GI.GLib.Structs.String.String' containing the new string
    -> Ptr ()
    -- ^ /@userData@/: user data passed to @/g_regex_replace_eval()/@
    -> IO Bool
    -- ^ __Returns:__ 'P.False' to continue the replacement process, 'P.True' to stop it

-- | A convenience synonym for @`Nothing` :: `Maybe` `RegexEvalCallback_WithClosures`@.
noRegexEvalCallback_WithClosures :: Maybe RegexEvalCallback_WithClosures
noRegexEvalCallback_WithClosures :: Maybe RegexEvalCallback_WithClosures
noRegexEvalCallback_WithClosures = Maybe RegexEvalCallback_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_RegexEvalCallback :: RegexEvalCallback -> RegexEvalCallback_WithClosures
drop_closures_RegexEvalCallback :: RegexEvalCallback -> RegexEvalCallback_WithClosures
drop_closures_RegexEvalCallback RegexEvalCallback
_f MatchInfo
matchInfo String
result_ Ptr ()
_ = RegexEvalCallback
_f MatchInfo
matchInfo String
result_

-- | Wrap the callback into a `GClosure`.
genClosure_RegexEvalCallback :: MonadIO m => RegexEvalCallback -> m (GClosure C_RegexEvalCallback)
genClosure_RegexEvalCallback :: RegexEvalCallback -> m (GClosure C_RegexEvalCallback)
genClosure_RegexEvalCallback RegexEvalCallback
cb = IO (GClosure C_RegexEvalCallback)
-> m (GClosure C_RegexEvalCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_RegexEvalCallback)
 -> m (GClosure C_RegexEvalCallback))
-> IO (GClosure C_RegexEvalCallback)
-> m (GClosure C_RegexEvalCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: RegexEvalCallback_WithClosures
cb' = RegexEvalCallback -> RegexEvalCallback_WithClosures
drop_closures_RegexEvalCallback RegexEvalCallback
cb
    let cb'' :: C_RegexEvalCallback
cb'' = Maybe (Ptr (FunPtr C_RegexEvalCallback))
-> RegexEvalCallback_WithClosures -> C_RegexEvalCallback
wrap_RegexEvalCallback Maybe (Ptr (FunPtr C_RegexEvalCallback))
forall a. Maybe a
Nothing RegexEvalCallback_WithClosures
cb'
    C_RegexEvalCallback -> IO (FunPtr C_RegexEvalCallback)
mk_RegexEvalCallback C_RegexEvalCallback
cb'' IO (FunPtr C_RegexEvalCallback)
-> (FunPtr C_RegexEvalCallback
    -> IO (GClosure C_RegexEvalCallback))
-> IO (GClosure C_RegexEvalCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_RegexEvalCallback -> IO (GClosure C_RegexEvalCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `RegexEvalCallback` into a `C_RegexEvalCallback`.
wrap_RegexEvalCallback ::
    Maybe (Ptr (FunPtr C_RegexEvalCallback)) ->
    RegexEvalCallback_WithClosures ->
    C_RegexEvalCallback
wrap_RegexEvalCallback :: Maybe (Ptr (FunPtr C_RegexEvalCallback))
-> RegexEvalCallback_WithClosures -> C_RegexEvalCallback
wrap_RegexEvalCallback Maybe (Ptr (FunPtr C_RegexEvalCallback))
funptrptr RegexEvalCallback_WithClosures
_cb Ptr MatchInfo
matchInfo Ptr String
result_ Ptr ()
userData = do
    (ManagedPtr MatchInfo -> MatchInfo)
-> Ptr MatchInfo -> (MatchInfo -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr MatchInfo -> MatchInfo
GLib.MatchInfo.MatchInfo Ptr MatchInfo
matchInfo ((MatchInfo -> IO CInt) -> IO CInt)
-> (MatchInfo -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \MatchInfo
matchInfo' -> do
        (ManagedPtr String -> String)
-> Ptr String -> (String -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr String -> String
GLib.String.String Ptr String
result_ ((String -> IO CInt) -> IO CInt) -> (String -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \String
result_' -> do
            Bool
result <- RegexEvalCallback_WithClosures
_cb  MatchInfo
matchInfo' String
result_' Ptr ()
userData
            Maybe (Ptr (FunPtr C_RegexEvalCallback)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_RegexEvalCallback))
funptrptr
            let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
            CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback PrintFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "string"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the message to output"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Specifies the type of the print handler functions.\nThese are called with the complete formatted string to output."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_PrintFunc =
    CString ->
    IO ()

-- Args: [ Arg
--           { argCName = "string"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the message to output"
--                 , 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_PrintFunc :: FunPtr C_PrintFunc -> C_PrintFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PrintFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_PrintFunc
    -> T.Text
    -- ^ /@string@/: the message to output
    -> m ()
dynamic_PrintFunc :: FunPtr (CString -> C_VoidFunc) -> Text -> m ()
dynamic_PrintFunc FunPtr (CString -> C_VoidFunc)
__funPtr Text
string = C_VoidFunc -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (C_VoidFunc -> m ()) -> C_VoidFunc -> m ()
forall a b. (a -> b) -> a -> b
$ do
    CString
string' <- Text -> IO CString
textToCString Text
string
    (FunPtr (CString -> C_VoidFunc) -> CString -> C_VoidFunc
__dynamic_C_PrintFunc FunPtr (CString -> C_VoidFunc)
__funPtr) CString
string'
    CString -> C_VoidFunc
forall a. Ptr a -> C_VoidFunc
freeMem CString
string'
    () -> C_VoidFunc
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | Specifies the type of the print handler functions.
-- These are called with the complete formatted string to output.
type PrintFunc =
    T.Text
    -- ^ /@string@/: the message to output
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `PrintFunc`@.
noPrintFunc :: Maybe PrintFunc
noPrintFunc :: Maybe PrintFunc
noPrintFunc = Maybe PrintFunc
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PrintFunc :: MonadIO m => PrintFunc -> m (GClosure C_PrintFunc)
genClosure_PrintFunc :: PrintFunc -> m (GClosure (CString -> C_VoidFunc))
genClosure_PrintFunc PrintFunc
cb = IO (GClosure (CString -> C_VoidFunc))
-> m (GClosure (CString -> C_VoidFunc))
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure (CString -> C_VoidFunc))
 -> m (GClosure (CString -> C_VoidFunc)))
-> IO (GClosure (CString -> C_VoidFunc))
-> m (GClosure (CString -> C_VoidFunc))
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: CString -> C_VoidFunc
cb' = Maybe (Ptr (FunPtr (CString -> C_VoidFunc)))
-> PrintFunc -> CString -> C_VoidFunc
wrap_PrintFunc Maybe (Ptr (FunPtr (CString -> C_VoidFunc)))
forall a. Maybe a
Nothing PrintFunc
cb
    (CString -> C_VoidFunc) -> IO (FunPtr (CString -> C_VoidFunc))
mk_PrintFunc CString -> C_VoidFunc
cb' IO (FunPtr (CString -> C_VoidFunc))
-> (FunPtr (CString -> C_VoidFunc)
    -> IO (GClosure (CString -> C_VoidFunc)))
-> IO (GClosure (CString -> C_VoidFunc))
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr (CString -> C_VoidFunc)
-> IO (GClosure (CString -> C_VoidFunc))
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PrintFunc` into a `C_PrintFunc`.
wrap_PrintFunc ::
    Maybe (Ptr (FunPtr C_PrintFunc)) ->
    PrintFunc ->
    C_PrintFunc
wrap_PrintFunc :: Maybe (Ptr (FunPtr (CString -> C_VoidFunc)))
-> PrintFunc -> CString -> C_VoidFunc
wrap_PrintFunc Maybe (Ptr (FunPtr (CString -> C_VoidFunc)))
funptrptr PrintFunc
_cb CString
string = do
    Text
string' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
string
    PrintFunc
_cb  Text
string'
    Maybe (Ptr (FunPtr (CString -> C_VoidFunc))) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr (CString -> C_VoidFunc)))
funptrptr


-- callback PollFunc
{- Callable
  { returnType = Just (TBasicType TInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just
              "the number of #GPollFD elements which have events or errors\n    reported, or -1 if an error occurred."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "ufds"
          , argType =
              TInterface Name { namespace = "GLib" , name = "PollFD" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "an array of #GPollFD elements"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "nfsd"
          , argType = TBasicType TUInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the number of elements in @ufds"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "timeout_"
          , argType = TBasicType TInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText =
                    Just
                      "the maximum time to wait for an event of the file descriptors.\n    A negative value indicates an infinite timeout."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Specifies the type of function passed to g_main_context_set_poll_func().\nThe semantics of the function should match those of the poll() system call."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_PollFunc =
    Ptr GLib.PollFD.PollFD ->
    Word32 ->
    Int32 ->
    IO Int32

-- Args: [ Arg
--           { argCName = "ufds"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "PollFD" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an array of #GPollFD elements"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "nfsd"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the number of elements in @ufds"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "timeout_"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the maximum time to wait for an event of the file descriptors.\n    A negative value indicates an infinite timeout."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PollFunc :: FunPtr C_PollFunc -> C_PollFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PollFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_PollFunc
    -> GLib.PollFD.PollFD
    -- ^ /@ufds@/: an array of t'GI.GLib.Structs.PollFD.PollFD' elements
    -> Word32
    -- ^ /@nfsd@/: the number of elements in /@ufds@/
    -> Int32
    -- ^ /@timeout_@/: the maximum time to wait for an event of the file descriptors.
    --     A negative value indicates an infinite timeout.
    -> m Int32
    -- ^ __Returns:__ the number of t'GI.GLib.Structs.PollFD.PollFD' elements which have events or errors
    --     reported, or -1 if an error occurred.
dynamic_PollFunc :: FunPtr C_PollFunc -> PollFD -> Word32 -> Int32 -> m Int32
dynamic_PollFunc FunPtr C_PollFunc
__funPtr PollFD
ufds Word32
nfsd Int32
timeout_ = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr PollFD
ufds' <- PollFD -> IO (Ptr PollFD)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PollFD
ufds
    Int32
result <- (FunPtr C_PollFunc -> C_PollFunc
__dynamic_C_PollFunc FunPtr C_PollFunc
__funPtr) Ptr PollFD
ufds' Word32
nfsd Int32
timeout_
    PollFD -> C_VoidFunc
forall a. ManagedPtrNewtype a => a -> C_VoidFunc
touchManagedPtr PollFD
ufds
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

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

-- | Specifies the type of function passed to @/g_main_context_set_poll_func()/@.
-- The semantics of the function should match those of the @/poll()/@ system call.
type PollFunc =
    GLib.PollFD.PollFD
    -- ^ /@ufds@/: an array of t'GI.GLib.Structs.PollFD.PollFD' elements
    -> Word32
    -- ^ /@nfsd@/: the number of elements in /@ufds@/
    -> Int32
    -- ^ /@timeout_@/: the maximum time to wait for an event of the file descriptors.
    --     A negative value indicates an infinite timeout.
    -> IO Int32
    -- ^ __Returns:__ the number of t'GI.GLib.Structs.PollFD.PollFD' elements which have events or errors
    --     reported, or -1 if an error occurred.

-- | A convenience synonym for @`Nothing` :: `Maybe` `PollFunc`@.
noPollFunc :: Maybe PollFunc
noPollFunc :: Maybe PollFunc
noPollFunc = Maybe PollFunc
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PollFunc :: MonadIO m => PollFunc -> m (GClosure C_PollFunc)
genClosure_PollFunc :: PollFunc -> m (GClosure C_PollFunc)
genClosure_PollFunc PollFunc
cb = IO (GClosure C_PollFunc) -> m (GClosure C_PollFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PollFunc) -> m (GClosure C_PollFunc))
-> IO (GClosure C_PollFunc) -> m (GClosure C_PollFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PollFunc
cb' = Maybe (Ptr (FunPtr C_PollFunc)) -> PollFunc -> C_PollFunc
wrap_PollFunc Maybe (Ptr (FunPtr C_PollFunc))
forall a. Maybe a
Nothing PollFunc
cb
    C_PollFunc -> IO (FunPtr C_PollFunc)
mk_PollFunc C_PollFunc
cb' IO (FunPtr C_PollFunc)
-> (FunPtr C_PollFunc -> IO (GClosure C_PollFunc))
-> IO (GClosure C_PollFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PollFunc -> IO (GClosure C_PollFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PollFunc` into a `C_PollFunc`.
wrap_PollFunc ::
    Maybe (Ptr (FunPtr C_PollFunc)) ->
    PollFunc ->
    C_PollFunc
wrap_PollFunc :: Maybe (Ptr (FunPtr C_PollFunc)) -> PollFunc -> C_PollFunc
wrap_PollFunc Maybe (Ptr (FunPtr C_PollFunc))
funptrptr PollFunc
_cb Ptr PollFD
ufds Word32
nfsd Int32
timeout_ = do
    (ManagedPtr PollFD -> PollFD)
-> Ptr PollFD -> (PollFD -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr PollFD -> PollFD
GLib.PollFD.PollFD Ptr PollFD
ufds ((PollFD -> IO Int32) -> IO Int32)
-> (PollFD -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \PollFD
ufds' -> do
        Int32
result <- PollFunc
_cb  PollFD
ufds' Word32
nfsd Int32
timeout_
        Maybe (Ptr (FunPtr C_PollFunc)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PollFunc))
funptrptr
        Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- callback OptionParseFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just
              "%TRUE if the function completed successfully, %FALSE if an error\n occurred, in which case @error should be set with g_set_error()"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "context"
          , argType =
              TInterface Name { namespace = "GLib" , name = "OptionContext" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The active #GOptionContext"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "group"
          , argType =
              TInterface Name { namespace = "GLib" , name = "OptionGroup" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The group to which the function belongs"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText =
                    Just
                      "User data added to the #GOptionGroup containing the option when it\n was created with g_option_group_new()"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = True
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "The type of function that can be called before and after parsing."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_OptionParseFunc =
    Ptr GLib.OptionContext.OptionContext ->
    Ptr GLib.OptionGroup.OptionGroup ->
    Ptr () ->
    Ptr (Ptr GError) ->
    IO CInt

-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "OptionContext" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The active #GOptionContext"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "group"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "OptionGroup" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The group to which the function belongs"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "User data added to the #GOptionGroup containing the option when it\n was created with g_option_group_new()"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_OptionParseFunc :: FunPtr C_OptionParseFunc -> C_OptionParseFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_OptionParseFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_OptionParseFunc
    -> GLib.OptionContext.OptionContext
    -- ^ /@context@/: The active t'GI.GLib.Structs.OptionContext.OptionContext'
    -> GLib.OptionGroup.OptionGroup
    -- ^ /@group@/: The group to which the function belongs
    -> Ptr ()
    -- ^ /@data@/: User data added to the t'GI.GLib.Structs.OptionGroup.OptionGroup' containing the option when it
    --  was created with 'GI.GLib.Structs.OptionGroup.optionGroupNew'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
dynamic_OptionParseFunc :: FunPtr C_OptionParseFunc
-> OptionContext -> OptionGroup -> Ptr () -> m ()
dynamic_OptionParseFunc FunPtr C_OptionParseFunc
__funPtr OptionContext
context OptionGroup
group Ptr ()
data_ = C_VoidFunc -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (C_VoidFunc -> m ()) -> C_VoidFunc -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr OptionContext
context' <- OptionContext -> IO (Ptr OptionContext)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr OptionContext
context
    Ptr OptionGroup
group' <- OptionGroup -> IO (Ptr OptionGroup)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr OptionGroup
group
    C_VoidFunc -> C_VoidFunc -> C_VoidFunc
forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ (FunPtr C_OptionParseFunc -> C_OptionParseFunc
__dynamic_C_OptionParseFunc FunPtr C_OptionParseFunc
__funPtr) Ptr OptionContext
context' Ptr OptionGroup
group' Ptr ()
data_
        OptionContext -> C_VoidFunc
forall a. ManagedPtrNewtype a => a -> C_VoidFunc
touchManagedPtr OptionContext
context
        OptionGroup -> C_VoidFunc
forall a. ManagedPtrNewtype a => a -> C_VoidFunc
touchManagedPtr OptionGroup
group
        () -> C_VoidFunc
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        () -> C_VoidFunc
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

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

-- | The type of function that can be called before and after parsing.
type OptionParseFunc =
    GLib.OptionContext.OptionContext
    -- ^ /@context@/: The active t'GI.GLib.Structs.OptionContext.OptionContext'
    -> GLib.OptionGroup.OptionGroup
    -- ^ /@group@/: The group to which the function belongs
    -> Ptr ()
    -- ^ /@data@/: User data added to the t'GI.GLib.Structs.OptionGroup.OptionGroup' containing the option when it
    --  was created with 'GI.GLib.Structs.OptionGroup.optionGroupNew'
    -> IO ()
    -- ^ __Returns:__ 'P.True' if the function completed successfully, 'P.False' if an error
    --  occurred, in which case /@error@/ should be set with @/g_set_error()/@ /(Can throw 'Data.GI.Base.GError.GError')/

-- | A convenience synonym for @`Nothing` :: `Maybe` `OptionParseFunc`@.
noOptionParseFunc :: Maybe OptionParseFunc
noOptionParseFunc :: Maybe OptionParseFunc
noOptionParseFunc = Maybe OptionParseFunc
forall a. Maybe a
Nothing

-- No Haskell->C wrapper generated since the function throws.

-- callback OptionErrorFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "context"
          , argType =
              TInterface Name { namespace = "GLib" , name = "OptionContext" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The active #GOptionContext"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "group"
          , argType =
              TInterface Name { namespace = "GLib" , name = "OptionGroup" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The group to which the function belongs"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText =
                    Just
                      "User data added to the #GOptionGroup containing the option when it\n was created with g_option_group_new()"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = True
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "The type of function to be used as callback when a parse error occurs."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_OptionErrorFunc =
    Ptr GLib.OptionContext.OptionContext ->
    Ptr GLib.OptionGroup.OptionGroup ->
    Ptr () ->
    Ptr (Ptr GError) ->
    IO ()

-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "OptionContext" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The active #GOptionContext"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "group"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "OptionGroup" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The group to which the function belongs"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "User data added to the #GOptionGroup containing the option when it\n was created with g_option_group_new()"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_OptionErrorFunc :: FunPtr C_OptionErrorFunc -> C_OptionErrorFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_OptionErrorFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_OptionErrorFunc
    -> GLib.OptionContext.OptionContext
    -- ^ /@context@/: The active t'GI.GLib.Structs.OptionContext.OptionContext'
    -> GLib.OptionGroup.OptionGroup
    -- ^ /@group@/: The group to which the function belongs
    -> Ptr ()
    -- ^ /@data@/: User data added to the t'GI.GLib.Structs.OptionGroup.OptionGroup' containing the option when it
    --  was created with 'GI.GLib.Structs.OptionGroup.optionGroupNew'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
dynamic_OptionErrorFunc :: FunPtr C_OptionErrorFunc
-> OptionContext -> OptionGroup -> Ptr () -> m ()
dynamic_OptionErrorFunc FunPtr C_OptionErrorFunc
__funPtr OptionContext
context OptionGroup
group Ptr ()
data_ = C_VoidFunc -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (C_VoidFunc -> m ()) -> C_VoidFunc -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr OptionContext
context' <- OptionContext -> IO (Ptr OptionContext)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr OptionContext
context
    Ptr OptionGroup
group' <- OptionGroup -> IO (Ptr OptionGroup)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr OptionGroup
group
    C_VoidFunc -> C_VoidFunc -> C_VoidFunc
forall a b. IO a -> IO b -> IO a
onException (do
        (Ptr (Ptr GError) -> C_VoidFunc) -> C_VoidFunc
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> C_VoidFunc) -> C_VoidFunc)
-> (Ptr (Ptr GError) -> C_VoidFunc) -> C_VoidFunc
forall a b. (a -> b) -> a -> b
$ (FunPtr C_OptionErrorFunc -> C_OptionErrorFunc
__dynamic_C_OptionErrorFunc FunPtr C_OptionErrorFunc
__funPtr) Ptr OptionContext
context' Ptr OptionGroup
group' Ptr ()
data_
        OptionContext -> C_VoidFunc
forall a. ManagedPtrNewtype a => a -> C_VoidFunc
touchManagedPtr OptionContext
context
        OptionGroup -> C_VoidFunc
forall a. ManagedPtrNewtype a => a -> C_VoidFunc
touchManagedPtr OptionGroup
group
        () -> C_VoidFunc
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        () -> C_VoidFunc
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

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

-- | The type of function to be used as callback when a parse error occurs.
type OptionErrorFunc =
    GLib.OptionContext.OptionContext
    -- ^ /@context@/: The active t'GI.GLib.Structs.OptionContext.OptionContext'
    -> GLib.OptionGroup.OptionGroup
    -- ^ /@group@/: The group to which the function belongs
    -> Ptr ()
    -- ^ /@data@/: User data added to the t'GI.GLib.Structs.OptionGroup.OptionGroup' containing the option when it
    --  was created with 'GI.GLib.Structs.OptionGroup.optionGroupNew'
    -> IO ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/

-- | A convenience synonym for @`Nothing` :: `Maybe` `OptionErrorFunc`@.
noOptionErrorFunc :: Maybe OptionErrorFunc
noOptionErrorFunc :: Maybe OptionParseFunc
noOptionErrorFunc = Maybe OptionParseFunc
forall a. Maybe a
Nothing

-- No Haskell->C wrapper generated since the function throws.

-- callback OptionArgFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just
              "%TRUE if the option was successfully parsed, %FALSE if an error\n occurred, in which case @error should be set with g_set_error()"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "option_name"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText =
                    Just
                      "The name of the option being parsed. This will be either a\n single dash followed by a single letter (for a short name) or two dashes\n followed by a long option name."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "value"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The value to be parsed."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText =
                    Just
                      "User data added to the #GOptionGroup containing the option when it\n was created with g_option_group_new()"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = True
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "The type of function to be passed as callback for %G_OPTION_ARG_CALLBACK\noptions."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_OptionArgFunc =
    CString ->
    CString ->
    Ptr () ->
    Ptr (Ptr GError) ->
    IO CInt

-- Args: [ Arg
--           { argCName = "option_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "The name of the option being parsed. This will be either a\n single dash followed by a single letter (for a short name) or two dashes\n followed by a long option name."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The value to be parsed."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "User data added to the #GOptionGroup containing the option when it\n was created with g_option_group_new()"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_OptionArgFunc :: FunPtr C_OptionArgFunc -> C_OptionArgFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_OptionArgFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_OptionArgFunc
    -> T.Text
    -- ^ /@optionName@/: The name of the option being parsed. This will be either a
    --  single dash followed by a single letter (for a short name) or two dashes
    --  followed by a long option name.
    -> T.Text
    -- ^ /@value@/: The value to be parsed.
    -> Ptr ()
    -- ^ /@data@/: User data added to the t'GI.GLib.Structs.OptionGroup.OptionGroup' containing the option when it
    --  was created with 'GI.GLib.Structs.OptionGroup.optionGroupNew'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
dynamic_OptionArgFunc :: FunPtr C_OptionArgFunc -> Text -> Text -> Ptr () -> m ()
dynamic_OptionArgFunc FunPtr C_OptionArgFunc
__funPtr Text
optionName Text
value Ptr ()
data_ = C_VoidFunc -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (C_VoidFunc -> m ()) -> C_VoidFunc -> m ()
forall a b. (a -> b) -> a -> b
$ do
    CString
optionName' <- Text -> IO CString
textToCString Text
optionName
    CString
value' <- Text -> IO CString
textToCString Text
value
    C_VoidFunc -> C_VoidFunc -> C_VoidFunc
forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ (FunPtr C_OptionArgFunc -> C_OptionArgFunc
__dynamic_C_OptionArgFunc FunPtr C_OptionArgFunc
__funPtr) CString
optionName' CString
value' Ptr ()
data_
        CString -> C_VoidFunc
forall a. Ptr a -> C_VoidFunc
freeMem CString
optionName'
        CString -> C_VoidFunc
forall a. Ptr a -> C_VoidFunc
freeMem CString
value'
        () -> C_VoidFunc
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        CString -> C_VoidFunc
forall a. Ptr a -> C_VoidFunc
freeMem CString
optionName'
        CString -> C_VoidFunc
forall a. Ptr a -> C_VoidFunc
freeMem CString
value'
     )

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

-- | The type of function to be passed as callback for 'GI.GLib.Enums.OptionArgCallback'
-- options.
type OptionArgFunc =
    T.Text
    -- ^ /@optionName@/: The name of the option being parsed. This will be either a
    --  single dash followed by a single letter (for a short name) or two dashes
    --  followed by a long option name.
    -> T.Text
    -- ^ /@value@/: The value to be parsed.
    -> Ptr ()
    -- ^ /@data@/: User data added to the t'GI.GLib.Structs.OptionGroup.OptionGroup' containing the option when it
    --  was created with 'GI.GLib.Structs.OptionGroup.optionGroupNew'
    -> IO ()
    -- ^ __Returns:__ 'P.True' if the option was successfully parsed, 'P.False' if an error
    --  occurred, in which case /@error@/ should be set with @/g_set_error()/@ /(Can throw 'Data.GI.Base.GError.GError')/

-- | A convenience synonym for @`Nothing` :: `Maybe` `OptionArgFunc`@.
noOptionArgFunc :: Maybe OptionArgFunc
noOptionArgFunc :: Maybe OptionArgFunc
noOptionArgFunc = Maybe OptionArgFunc
forall a. Maybe a
Nothing

-- No Haskell->C wrapper generated since the function throws.

-- callback NodeTraverseFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText = Just "%TRUE to stop the traversal."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "node"
          , argType = TInterface Name { namespace = "GLib" , name = "Node" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GNode." , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "user data passed to g_node_traverse()."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Specifies the type of function passed to g_node_traverse(). The\nfunction is called with each of the nodes visited, together with the\nuser data passed to g_node_traverse(). If the function returns\n%TRUE, then the traversal is stopped."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_NodeTraverseFunc =
    Ptr GLib.Node.Node ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "node"
--           , argType = TInterface Name { namespace = "GLib" , name = "Node" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GNode." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user data passed to g_node_traverse()."
--                 , 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_NodeTraverseFunc :: FunPtr C_NodeTraverseFunc -> C_NodeTraverseFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_NodeTraverseFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_NodeTraverseFunc
    -> GLib.Node.Node
    -- ^ /@node@/: a t'GI.GLib.Structs.Node.Node'.
    -> Ptr ()
    -- ^ /@data@/: user data passed to @/g_node_traverse()/@.
    -> m Bool
    -- ^ __Returns:__ 'P.True' to stop the traversal.
dynamic_NodeTraverseFunc :: FunPtr C_NodeTraverseFunc -> Node -> Ptr () -> m Bool
dynamic_NodeTraverseFunc FunPtr C_NodeTraverseFunc
__funPtr Node
node Ptr ()
data_ = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
    CInt
result <- (FunPtr C_NodeTraverseFunc -> C_NodeTraverseFunc
__dynamic_C_NodeTraverseFunc FunPtr C_NodeTraverseFunc
__funPtr) Ptr Node
node' Ptr ()
data_
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Node -> C_VoidFunc
forall a. ManagedPtrNewtype a => a -> C_VoidFunc
touchManagedPtr Node
node
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | Specifies the type of function passed to @/g_node_traverse()/@. The
-- function is called with each of the nodes visited, together with the
-- user data passed to @/g_node_traverse()/@. If the function returns
-- 'P.True', then the traversal is stopped.
type NodeTraverseFunc =
    GLib.Node.Node
    -- ^ /@node@/: a t'GI.GLib.Structs.Node.Node'.
    -> Ptr ()
    -- ^ /@data@/: user data passed to @/g_node_traverse()/@.
    -> IO Bool
    -- ^ __Returns:__ 'P.True' to stop the traversal.

-- | A convenience synonym for @`Nothing` :: `Maybe` `NodeTraverseFunc`@.
noNodeTraverseFunc :: Maybe NodeTraverseFunc
noNodeTraverseFunc :: Maybe NodeTraverseFunc
noNodeTraverseFunc = Maybe NodeTraverseFunc
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_NodeTraverseFunc :: MonadIO m => NodeTraverseFunc -> m (GClosure C_NodeTraverseFunc)
genClosure_NodeTraverseFunc :: NodeTraverseFunc -> m (GClosure C_NodeTraverseFunc)
genClosure_NodeTraverseFunc NodeTraverseFunc
cb = IO (GClosure C_NodeTraverseFunc) -> m (GClosure C_NodeTraverseFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_NodeTraverseFunc)
 -> m (GClosure C_NodeTraverseFunc))
-> IO (GClosure C_NodeTraverseFunc)
-> m (GClosure C_NodeTraverseFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_NodeTraverseFunc
cb' = Maybe (Ptr (FunPtr C_NodeTraverseFunc))
-> NodeTraverseFunc -> C_NodeTraverseFunc
wrap_NodeTraverseFunc Maybe (Ptr (FunPtr C_NodeTraverseFunc))
forall a. Maybe a
Nothing NodeTraverseFunc
cb
    C_NodeTraverseFunc -> IO (FunPtr C_NodeTraverseFunc)
mk_NodeTraverseFunc C_NodeTraverseFunc
cb' IO (FunPtr C_NodeTraverseFunc)
-> (FunPtr C_NodeTraverseFunc -> IO (GClosure C_NodeTraverseFunc))
-> IO (GClosure C_NodeTraverseFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_NodeTraverseFunc -> IO (GClosure C_NodeTraverseFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `NodeTraverseFunc` into a `C_NodeTraverseFunc`.
wrap_NodeTraverseFunc ::
    Maybe (Ptr (FunPtr C_NodeTraverseFunc)) ->
    NodeTraverseFunc ->
    C_NodeTraverseFunc
wrap_NodeTraverseFunc :: Maybe (Ptr (FunPtr C_NodeTraverseFunc))
-> NodeTraverseFunc -> C_NodeTraverseFunc
wrap_NodeTraverseFunc Maybe (Ptr (FunPtr C_NodeTraverseFunc))
funptrptr NodeTraverseFunc
_cb Ptr Node
node Ptr ()
data_ = do
    Node
node' <- ((ManagedPtr Node -> Node) -> Ptr Node -> IO Node
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Node -> Node
GLib.Node.Node) Ptr Node
node
    Bool
result <- NodeTraverseFunc
_cb  Node
node' Ptr ()
data_
    Maybe (Ptr (FunPtr C_NodeTraverseFunc)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_NodeTraverseFunc))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback NodeForeachFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "node"
          , argType = TInterface Name { namespace = "GLib" , name = "Node" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GNode." , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText =
                    Just "user data passed to g_node_children_foreach()."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Specifies the type of function passed to g_node_children_foreach().\nThe function is called with each child node, together with the user\ndata passed to g_node_children_foreach()."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_NodeForeachFunc =
    Ptr GLib.Node.Node ->
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "node"
--           , argType = TInterface Name { namespace = "GLib" , name = "Node" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GNode." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "user data passed to g_node_children_foreach()."
--                 , 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_NodeForeachFunc :: FunPtr C_NodeForeachFunc -> C_NodeForeachFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_NodeForeachFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_NodeForeachFunc
    -> GLib.Node.Node
    -- ^ /@node@/: a t'GI.GLib.Structs.Node.Node'.
    -> Ptr ()
    -- ^ /@data@/: user data passed to @/g_node_children_foreach()/@.
    -> m ()
dynamic_NodeForeachFunc :: FunPtr C_NodeForeachFunc -> Node -> Ptr () -> m ()
dynamic_NodeForeachFunc FunPtr C_NodeForeachFunc
__funPtr Node
node Ptr ()
data_ = C_VoidFunc -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (C_VoidFunc -> m ()) -> C_VoidFunc -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
    (FunPtr C_NodeForeachFunc -> C_NodeForeachFunc
__dynamic_C_NodeForeachFunc FunPtr C_NodeForeachFunc
__funPtr) Ptr Node
node' Ptr ()
data_
    Node -> C_VoidFunc
forall a. ManagedPtrNewtype a => a -> C_VoidFunc
touchManagedPtr Node
node
    () -> C_VoidFunc
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | Specifies the type of function passed to @/g_node_children_foreach()/@.
-- The function is called with each child node, together with the user
-- data passed to @/g_node_children_foreach()/@.
type NodeForeachFunc =
    GLib.Node.Node
    -- ^ /@node@/: a t'GI.GLib.Structs.Node.Node'.
    -> Ptr ()
    -- ^ /@data@/: user data passed to @/g_node_children_foreach()/@.
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `NodeForeachFunc`@.
noNodeForeachFunc :: Maybe NodeForeachFunc
noNodeForeachFunc :: Maybe NodeForeachFunc
noNodeForeachFunc = Maybe NodeForeachFunc
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_NodeForeachFunc :: MonadIO m => NodeForeachFunc -> m (GClosure C_NodeForeachFunc)
genClosure_NodeForeachFunc :: NodeForeachFunc -> m (GClosure C_NodeForeachFunc)
genClosure_NodeForeachFunc NodeForeachFunc
cb = IO (GClosure C_NodeForeachFunc) -> m (GClosure C_NodeForeachFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_NodeForeachFunc) -> m (GClosure C_NodeForeachFunc))
-> IO (GClosure C_NodeForeachFunc)
-> m (GClosure C_NodeForeachFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_NodeForeachFunc
cb' = Maybe (Ptr (FunPtr C_NodeForeachFunc))
-> NodeForeachFunc -> C_NodeForeachFunc
wrap_NodeForeachFunc Maybe (Ptr (FunPtr C_NodeForeachFunc))
forall a. Maybe a
Nothing NodeForeachFunc
cb
    C_NodeForeachFunc -> IO (FunPtr C_NodeForeachFunc)
mk_NodeForeachFunc C_NodeForeachFunc
cb' IO (FunPtr C_NodeForeachFunc)
-> (FunPtr C_NodeForeachFunc -> IO (GClosure C_NodeForeachFunc))
-> IO (GClosure C_NodeForeachFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_NodeForeachFunc -> IO (GClosure C_NodeForeachFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `NodeForeachFunc` into a `C_NodeForeachFunc`.
wrap_NodeForeachFunc ::
    Maybe (Ptr (FunPtr C_NodeForeachFunc)) ->
    NodeForeachFunc ->
    C_NodeForeachFunc
wrap_NodeForeachFunc :: Maybe (Ptr (FunPtr C_NodeForeachFunc))
-> NodeForeachFunc -> C_NodeForeachFunc
wrap_NodeForeachFunc Maybe (Ptr (FunPtr C_NodeForeachFunc))
funptrptr NodeForeachFunc
_cb Ptr Node
node Ptr ()
data_ = do
    Node
node' <- ((ManagedPtr Node -> Node) -> Ptr Node -> IO Node
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Node -> Node
GLib.Node.Node) Ptr Node
node
    NodeForeachFunc
_cb  Node
node' Ptr ()
data_
    Maybe (Ptr (FunPtr C_NodeForeachFunc)) -> C_VoidFunc
forall a. Maybe (Ptr (FunPtr a)) -> C_VoidFunc
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_NodeForeachFunc))
funptrptr


-- callback MemVTableTryReallocFieldCallback
{- Callable
  { returnType = Just (TBasicType TPtr)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "mem"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "n_bytes"
          , argType = TBasicType TUInt64
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_MemVTableTryReallocFieldCallback =
    Ptr () ->
    Word64 ->
    IO (Ptr ())

-- Args: [ Arg
--           { argCName = "mem"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "n_bytes"
--           , argType = TBasicType TUInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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_MemVTableTryReallocFieldCallback :: FunPtr C_MemVTableTryReallocFieldCallback -> C_MemVTableTryReallocFieldCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_MemVTableTryReallocFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MemVTableTryReallocFieldCallback
    -> Ptr ()
    -> Word64
    -> m (Ptr ())
dynamic_MemVTableTryReallocFieldCallback :: FunPtr C_MemVTableTryReallocFieldCallback
-> Ptr () -> Word64 -> m (Ptr ())
dynamic_MemVTableTryReallocFieldCallback FunPtr C_MemVTableTryReallocFieldCallback
__funPtr Ptr ()
mem Word64
nBytes = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ do
    Ptr ()
result <- (FunPtr C_MemVTableTryReallocFieldCallback
-> C_MemVTableTryReallocFieldCallback
__dynamic_C_MemVTableTryReallocFieldCallback FunPtr C_MemVTableTryReallocFieldCallback
__funPtr) Ptr ()
mem Word64
nBytes
    C_ThreadFunc
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result

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

-- | /No description available in the introspection data./
type MemVTableTryReallocFieldCallback =
    Ptr ()
    -> Word64
    -> IO (Ptr ())

-- | A convenience synonym for @`Nothing` :: `Maybe` `MemVTableTryReallocFieldCallback`@.
noMemVTableTryReallocFieldCallback :: Maybe MemVTableTryReallocFieldCallback
noMemVTableTryReallocFieldCallback :: Maybe C_MemVTableTryReallocFieldCallback
noMemVTableTryReallocFieldCallback = Maybe C_MemVTableTryReallocFieldCallback
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_MemVTableTryReallocFieldCallback :: MonadIO m => MemVTableTryReallocFieldCallback -> m (GClosure C_MemVTableTryReallocFieldCallback)
genClosure_MemVTableTryReallocFieldCallback :: C_MemVTableTryReallocFieldCallback
-> m (GClosure C_MemVTableTryReallocFieldCallback)
genClosure_MemVTableTryReallocFieldCallback C_MemVTableTryReallocFieldCallback
cb = IO (GClosure C_MemVTableTryReallocFieldCallback)
-> m (GClosure C_MemVTableTryReallocFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MemVTableTryReallocFieldCallback)
 -> m (GClosure C_MemVTableTryReallocFieldCallback))
-> IO (GClosure C_MemVTableTryReallocFieldCallback)
-> m (GClosure C_MemVTableTryReallocFieldCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_MemVTableTryReallocFieldCallback
cb' = Maybe (Ptr (FunPtr C_MemVTableTryReallocFieldCallback))
-> C_MemVTableTryReallocFieldCallback
-> C_MemVTableTryReallocFieldCallback
wrap_MemVTableTryReallocFieldCallback Maybe (Ptr (FunPtr C_MemVTableTryReallocFieldCallback))
forall a. Maybe a
Nothing C_MemVTableTryReallocFieldCallback
cb
    C_MemVTableTryReallocFieldCallback
-> IO (FunPtr C_MemVTableTryReallocFieldCallback)
mk_MemVTableTryReallocFieldCallback C_MemVTableTryReallocFieldCallback
cb' IO (FunPtr C_MemVTableTryReallocFieldCallback)
-> (FunPtr C_MemVTableTryReallocFieldCallback
    -> IO (GClosure C_MemVTableTryReallocFieldCallback))
-> IO (GClosure C_MemVTableTryReallocFieldCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MemVTableTryReallocFieldCallback
-> IO (GClosure C_MemVTableTryReallocFieldCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `MemVTableTryReallocFieldCallback` into a `C_MemVTableTryReallocFieldCallback`.
wrap_MemVTableTryReallocFieldCallback ::
    Maybe (Ptr (FunPtr C_MemVTableTryReallocFieldCallback)) ->
    MemVTableTryReallocFieldCallback ->
    C_MemVTableTryReallocFieldCallback
wrap_MemVTableTryReallocFieldCallback :: Maybe (Ptr (FunPtr C_MemVTableTryReallocFieldCallback))
-> C_MemVTableTryReallocFieldCallback
-> C_MemVTableTryReallocFieldCallback
wrap_MemVTableTryReallocFieldCallback Maybe (Ptr (FunPtr C_MemVTableTryReallocFieldCallback))
funptrptr C_MemVTableTryReallocFieldCallback
_cb Ptr ()
mem Word64
nBytes = do
    Ptr ()
result <- C_MemVTableTryReallocFieldCallback
_cb  Ptr ()
mem Word64