-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- 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.Dazzle.Callbacks
    ( 

 -- * Signals


-- ** CounterForeachFunc #signal:CounterForeachFunc#

    C_CounterForeachFunc                    ,
    CounterForeachFunc                      ,
    CounterForeachFunc_WithClosures         ,
    drop_closures_CounterForeachFunc        ,
    dynamic_CounterForeachFunc              ,
    genClosure_CounterForeachFunc           ,
    mk_CounterForeachFunc                   ,
    noCounterForeachFunc                    ,
    noCounterForeachFunc_WithClosures       ,
    wrap_CounterForeachFunc                 ,


-- ** DirectoryModelVisibleFunc #signal:DirectoryModelVisibleFunc#

    C_DirectoryModelVisibleFunc             ,
    DirectoryModelVisibleFunc               ,
    DirectoryModelVisibleFunc_WithClosures  ,
    drop_closures_DirectoryModelVisibleFunc ,
    dynamic_DirectoryModelVisibleFunc       ,
    genClosure_DirectoryModelVisibleFunc    ,
    mk_DirectoryModelVisibleFunc            ,
    noDirectoryModelVisibleFunc             ,
    noDirectoryModelVisibleFunc_WithClosures,
    wrap_DirectoryModelVisibleFunc          ,


-- ** ListModelFilterFunc #signal:ListModelFilterFunc#

    C_ListModelFilterFunc                   ,
    ListModelFilterFunc                     ,
    ListModelFilterFunc_WithClosures        ,
    drop_closures_ListModelFilterFunc       ,
    dynamic_ListModelFilterFunc             ,
    genClosure_ListModelFilterFunc          ,
    mk_ListModelFilterFunc                  ,
    noListModelFilterFunc                   ,
    noListModelFilterFunc_WithClosures      ,
    wrap_ListModelFilterFunc                ,


-- ** RecursiveIgnoreFunc #signal:RecursiveIgnoreFunc#

    C_RecursiveIgnoreFunc                   ,
    RecursiveIgnoreFunc                     ,
    RecursiveIgnoreFunc_WithClosures        ,
    drop_closures_RecursiveIgnoreFunc       ,
    dynamic_RecursiveIgnoreFunc             ,
    genClosure_RecursiveIgnoreFunc          ,
    mk_RecursiveIgnoreFunc                  ,
    noRecursiveIgnoreFunc                   ,
    noRecursiveIgnoreFunc_WithClosures      ,
    wrap_RecursiveIgnoreFunc                ,


-- ** ShortcutChordTableForeach #signal:ShortcutChordTableForeach#

    C_ShortcutChordTableForeach             ,
    ShortcutChordTableForeach               ,
    ShortcutChordTableForeach_WithClosures  ,
    drop_closures_ShortcutChordTableForeach ,
    dynamic_ShortcutChordTableForeach       ,
    genClosure_ShortcutChordTableForeach    ,
    mk_ShortcutChordTableForeach            ,
    noShortcutChordTableForeach             ,
    noShortcutChordTableForeach_WithClosures,
    wrap_ShortcutChordTableForeach          ,


-- ** StackListCreateWidgetFunc #signal:StackListCreateWidgetFunc#

    C_StackListCreateWidgetFunc             ,
    StackListCreateWidgetFunc               ,
    StackListCreateWidgetFunc_WithClosures  ,
    drop_closures_StackListCreateWidgetFunc ,
    dynamic_StackListCreateWidgetFunc       ,
    genClosure_StackListCreateWidgetFunc    ,
    mk_StackListCreateWidgetFunc            ,
    noStackListCreateWidgetFunc             ,
    noStackListCreateWidgetFunc_WithClosures,
    wrap_StackListCreateWidgetFunc          ,


-- ** SuggestionPositionFunc #signal:SuggestionPositionFunc#

    C_SuggestionPositionFunc                ,
    SuggestionPositionFunc                  ,
    SuggestionPositionFunc_WithClosures     ,
    drop_closures_SuggestionPositionFunc    ,
    dynamic_SuggestionPositionFunc          ,
    genClosure_SuggestionPositionFunc       ,
    mk_SuggestionPositionFunc               ,
    noSuggestionPositionFunc                ,
    noSuggestionPositionFunc_WithClosures   ,
    wrap_SuggestionPositionFunc             ,


-- ** TaskCacheCallback #signal:TaskCacheCallback#

    C_TaskCacheCallback                     ,
    TaskCacheCallback                       ,
    TaskCacheCallback_WithClosures          ,
    drop_closures_TaskCacheCallback         ,
    dynamic_TaskCacheCallback               ,
    genClosure_TaskCacheCallback            ,
    mk_TaskCacheCallback                    ,
    noTaskCacheCallback                     ,
    noTaskCacheCallback_WithClosures        ,
    wrap_TaskCacheCallback                  ,


-- ** TreeFilterFunc #signal:TreeFilterFunc#

    C_TreeFilterFunc                        ,
    TreeFilterFunc                          ,
    TreeFilterFunc_WithClosures             ,
    drop_closures_TreeFilterFunc            ,
    dynamic_TreeFilterFunc                  ,
    genClosure_TreeFilterFunc               ,
    mk_TreeFilterFunc                       ,
    noTreeFilterFunc                        ,
    noTreeFilterFunc_WithClosures           ,
    wrap_TreeFilterFunc                     ,


-- ** TreeFindFunc #signal:TreeFindFunc#

    C_TreeFindFunc                          ,
    TreeFindFunc                            ,
    TreeFindFunc_WithClosures               ,
    drop_closures_TreeFindFunc              ,
    dynamic_TreeFindFunc                    ,
    genClosure_TreeFindFunc                 ,
    mk_TreeFindFunc                         ,
    noTreeFindFunc                          ,
    noTreeFindFunc_WithClosures             ,
    wrap_TreeFindFunc                       ,


-- ** TreeNodeCompareFunc #signal:TreeNodeCompareFunc#

    C_TreeNodeCompareFunc                   ,
    TreeNodeCompareFunc                     ,
    TreeNodeCompareFunc_WithClosures        ,
    drop_closures_TreeNodeCompareFunc       ,
    dynamic_TreeNodeCompareFunc             ,
    genClosure_TreeNodeCompareFunc          ,
    mk_TreeNodeCompareFunc                  ,
    noTreeNodeCompareFunc                   ,
    noTreeNodeCompareFunc_WithClosures      ,
    wrap_TreeNodeCompareFunc                ,


-- ** TrieTraverseFunc #signal:TrieTraverseFunc#

    C_TrieTraverseFunc                      ,
    TrieTraverseFunc                        ,
    TrieTraverseFunc_WithClosures           ,
    drop_closures_TrieTraverseFunc          ,
    dynamic_TrieTraverseFunc                ,
    genClosure_TrieTraverseFunc             ,
    mk_TrieTraverseFunc                     ,
    noTrieTraverseFunc                      ,
    noTrieTraverseFunc_WithClosures         ,
    wrap_TrieTraverseFunc                   ,




    ) where

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

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT

-- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392
#if MIN_VERSION_base(4,18,0)
import qualified GI.Atk.Interfaces.ImplementorIface as Atk.ImplementorIface
import qualified GI.Cairo.Structs.Surface as Cairo.Surface
import {-# SOURCE #-} qualified GI.Dazzle.Enums as Dazzle.Enums
import {-# SOURCE #-} qualified GI.Dazzle.Objects.DirectoryModel as Dazzle.DirectoryModel
import {-# SOURCE #-} qualified GI.Dazzle.Objects.Suggestion as Dazzle.Suggestion
import {-# SOURCE #-} qualified GI.Dazzle.Objects.SuggestionEntry as Dazzle.SuggestionEntry
import {-# SOURCE #-} qualified GI.Dazzle.Objects.TaskCache as Dazzle.TaskCache
import {-# SOURCE #-} qualified GI.Dazzle.Objects.Tree as Dazzle.Tree
import {-# SOURCE #-} qualified GI.Dazzle.Objects.TreeBuilder as Dazzle.TreeBuilder
import {-# SOURCE #-} qualified GI.Dazzle.Objects.TreeNode as Dazzle.TreeNode
import {-# SOURCE #-} qualified GI.Dazzle.Structs.Counter as Dazzle.Counter
import {-# SOURCE #-} qualified GI.Dazzle.Structs.CounterValue as Dazzle.CounterValue
import {-# SOURCE #-} qualified GI.Dazzle.Structs.ShortcutChord as Dazzle.ShortcutChord
import {-# SOURCE #-} qualified GI.Dazzle.Structs.Trie as Dazzle.Trie
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Enums as GLib.Enums
import qualified GI.GLib.Flags as GLib.Flags
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Flags as Gdk.Flags
import qualified GI.Gdk.Structs.EventKey as Gdk.EventKey
import qualified GI.Gdk.Structs.RGBA as Gdk.RGBA
import qualified GI.Gdk.Structs.Rectangle as Gdk.Rectangle
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Interfaces.Icon as Gio.Icon
import qualified GI.Gio.Interfaces.ListModel as Gio.ListModel
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.FileInfo as Gio.FileInfo
import qualified GI.Gio.Objects.Menu as Gio.Menu
import qualified GI.Gio.Objects.MenuModel as Gio.MenuModel
import qualified GI.Gio.Objects.Task as Gio.Task
import qualified GI.Gtk.Interfaces.Buildable as Gtk.Buildable
import qualified GI.Gtk.Interfaces.CellEditable as Gtk.CellEditable
import qualified GI.Gtk.Interfaces.Editable as Gtk.Editable
import qualified GI.Gtk.Interfaces.Scrollable as Gtk.Scrollable
import qualified GI.Gtk.Objects.Container as Gtk.Container
import qualified GI.Gtk.Objects.Entry as Gtk.Entry
import qualified GI.Gtk.Objects.Popover as Gtk.Popover
import qualified GI.Gtk.Objects.TreeView as Gtk.TreeView
import qualified GI.Gtk.Objects.Widget as Gtk.Widget
import qualified GI.Gtk.Structs.SelectionData as Gtk.SelectionData
import qualified GI.Gtk.Structs.TreeIter as Gtk.TreeIter
import qualified GI.Gtk.Structs.TreePath as Gtk.TreePath

#else
import {-# SOURCE #-} qualified GI.Dazzle.Objects.DirectoryModel as Dazzle.DirectoryModel
import {-# SOURCE #-} qualified GI.Dazzle.Objects.SuggestionEntry as Dazzle.SuggestionEntry
import {-# SOURCE #-} qualified GI.Dazzle.Objects.TaskCache as Dazzle.TaskCache
import {-# SOURCE #-} qualified GI.Dazzle.Objects.Tree as Dazzle.Tree
import {-# SOURCE #-} qualified GI.Dazzle.Objects.TreeNode as Dazzle.TreeNode
import {-# SOURCE #-} qualified GI.Dazzle.Structs.Counter as Dazzle.Counter
import {-# SOURCE #-} qualified GI.Dazzle.Structs.ShortcutChord as Dazzle.ShortcutChord
import {-# SOURCE #-} qualified GI.Dazzle.Structs.Trie as Dazzle.Trie
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Structs.Rectangle as Gdk.Rectangle
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Objects.FileInfo as Gio.FileInfo
import qualified GI.Gio.Objects.Task as Gio.Task
import qualified GI.Gtk.Objects.Widget as Gtk.Widget

#endif

-- callback TrieTraverseFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "dzl_trie"
          , argType =
              TInterface Name { namespace = "Dazzle" , name = "Trie" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "key"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "value"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = True
          , 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_TrieTraverseFunc =
    Ptr Dazzle.Trie.Trie ->
    CString ->
    Ptr () ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "dzl_trie"
--           , argType =
--               TInterface Name { namespace = "Dazzle" , name = "Trie" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TrieTraverseFunc :: FunPtr C_TrieTraverseFunc -> C_TrieTraverseFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TrieTraverseFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TrieTraverseFunc
    -> Dazzle.Trie.Trie
    -> T.Text
    -> Ptr ()
    -> Ptr ()
    -> m Bool
dynamic_TrieTraverseFunc :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_TrieTraverseFunc
-> Trie -> Text -> Ptr () -> Ptr () -> m Bool
dynamic_TrieTraverseFunc FunPtr C_TrieTraverseFunc
__funPtr Trie
dzlTrie Text
key Ptr ()
value Ptr ()
userData = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Trie
dzlTrie' <- Trie -> IO (Ptr Trie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Trie
dzlTrie
    CString
key' <- Text -> IO CString
textToCString Text
key
    CInt
result <- (FunPtr C_TrieTraverseFunc -> C_TrieTraverseFunc
__dynamic_C_TrieTraverseFunc FunPtr C_TrieTraverseFunc
__funPtr) Ptr Trie
dzlTrie' CString
key' Ptr ()
value Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Trie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Trie
dzlTrie
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | /No description available in the introspection data./
type TrieTraverseFunc =
    Dazzle.Trie.Trie
    -> T.Text
    -> Ptr ()
    -> IO Bool

-- | A convenience synonym for @`Nothing` :: `Maybe` `TrieTraverseFunc`@.
noTrieTraverseFunc :: Maybe TrieTraverseFunc
noTrieTraverseFunc :: Maybe TrieTraverseFunc
noTrieTraverseFunc = Maybe TrieTraverseFunc
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type TrieTraverseFunc_WithClosures =
    Dazzle.Trie.Trie
    -> T.Text
    -> Ptr ()
    -> Ptr ()
    -> IO Bool

-- | A convenience synonym for @`Nothing` :: `Maybe` `TrieTraverseFunc_WithClosures`@.
noTrieTraverseFunc_WithClosures :: Maybe TrieTraverseFunc_WithClosures
noTrieTraverseFunc_WithClosures :: Maybe TrieTraverseFunc_WithClosures
noTrieTraverseFunc_WithClosures = Maybe TrieTraverseFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_TrieTraverseFunc :: TrieTraverseFunc -> TrieTraverseFunc_WithClosures
drop_closures_TrieTraverseFunc :: TrieTraverseFunc -> TrieTraverseFunc_WithClosures
drop_closures_TrieTraverseFunc TrieTraverseFunc
_f Trie
dzlTrie Text
key Ptr ()
value Ptr ()
_ = TrieTraverseFunc
_f Trie
dzlTrie Text
key Ptr ()
value

-- | Wrap the callback into a `GClosure`.
genClosure_TrieTraverseFunc :: MonadIO m => TrieTraverseFunc -> m (GClosure C_TrieTraverseFunc)
genClosure_TrieTraverseFunc :: forall (m :: * -> *).
MonadIO m =>
TrieTraverseFunc -> m (GClosure C_TrieTraverseFunc)
genClosure_TrieTraverseFunc TrieTraverseFunc
cb = IO (GClosure C_TrieTraverseFunc) -> m (GClosure C_TrieTraverseFunc)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TrieTraverseFunc)
 -> m (GClosure C_TrieTraverseFunc))
-> IO (GClosure C_TrieTraverseFunc)
-> m (GClosure C_TrieTraverseFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: TrieTraverseFunc_WithClosures
cb' = TrieTraverseFunc -> TrieTraverseFunc_WithClosures
drop_closures_TrieTraverseFunc TrieTraverseFunc
cb
    let cb'' :: C_TrieTraverseFunc
cb'' = Maybe (Ptr (FunPtr C_TrieTraverseFunc))
-> TrieTraverseFunc_WithClosures -> C_TrieTraverseFunc
wrap_TrieTraverseFunc Maybe (Ptr (FunPtr C_TrieTraverseFunc))
forall a. Maybe a
Nothing TrieTraverseFunc_WithClosures
cb'
    C_TrieTraverseFunc -> IO (FunPtr C_TrieTraverseFunc)
mk_TrieTraverseFunc C_TrieTraverseFunc
cb'' IO (FunPtr C_TrieTraverseFunc)
-> (FunPtr C_TrieTraverseFunc -> IO (GClosure C_TrieTraverseFunc))
-> IO (GClosure C_TrieTraverseFunc)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TrieTraverseFunc -> IO (GClosure C_TrieTraverseFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `TrieTraverseFunc` into a `C_TrieTraverseFunc`.
wrap_TrieTraverseFunc :: 
    Maybe (Ptr (FunPtr C_TrieTraverseFunc)) ->
    TrieTraverseFunc_WithClosures ->
    C_TrieTraverseFunc
wrap_TrieTraverseFunc :: Maybe (Ptr (FunPtr C_TrieTraverseFunc))
-> TrieTraverseFunc_WithClosures -> C_TrieTraverseFunc
wrap_TrieTraverseFunc Maybe (Ptr (FunPtr C_TrieTraverseFunc))
gi'funptrptr TrieTraverseFunc_WithClosures
gi'cb Ptr Trie
dzlTrie CString
key Ptr ()
value Ptr ()
userData = do
    Ptr Trie -> (Trie -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  Ptr Trie
dzlTrie ((Trie -> IO CInt) -> IO CInt) -> (Trie -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Trie
dzlTrie' -> do
        Text
key' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
key
        Bool
result <- TrieTraverseFunc_WithClosures
gi'cb  Trie
dzlTrie' Text
key' Ptr ()
value Ptr ()
userData
        Maybe (Ptr (FunPtr C_TrieTraverseFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_TrieTraverseFunc))
gi'funptrptr
        let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
result
        CInt -> IO CInt
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback TreeNodeCompareFunc
{- Callable
  { returnType = Just (TBasicType TInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "a"
          , argType =
              TInterface Name { namespace = "Dazzle" , name = "TreeNode" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "b"
          , argType =
              TInterface Name { namespace = "Dazzle" , name = "TreeNode" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = True
          , 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_TreeNodeCompareFunc =
    Ptr Dazzle.TreeNode.TreeNode ->
    Ptr Dazzle.TreeNode.TreeNode ->
    Ptr () ->
    IO Int32

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

foreign import ccall "dynamic" __dynamic_C_TreeNodeCompareFunc :: FunPtr C_TreeNodeCompareFunc -> C_TreeNodeCompareFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TreeNodeCompareFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Dazzle.TreeNode.IsTreeNode a, Dazzle.TreeNode.IsTreeNode b) =>
    FunPtr C_TreeNodeCompareFunc
    -> a
    -> b
    -> Ptr ()
    -> m Int32
dynamic_TreeNodeCompareFunc :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsTreeNode a, IsTreeNode b) =>
FunPtr C_TreeNodeCompareFunc -> a -> b -> Ptr () -> m Int32
dynamic_TreeNodeCompareFunc FunPtr C_TreeNodeCompareFunc
__funPtr a
a b
b Ptr ()
userData = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr TreeNode
a' <- a -> IO (Ptr TreeNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
a
    Ptr TreeNode
b' <- b -> IO (Ptr TreeNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
b
    Int32
result <- (FunPtr C_TreeNodeCompareFunc -> C_TreeNodeCompareFunc
__dynamic_C_TreeNodeCompareFunc FunPtr C_TreeNodeCompareFunc
__funPtr) Ptr TreeNode
a' Ptr TreeNode
b' Ptr ()
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
a
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
b
    Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

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

-- | /No description available in the introspection data./
type TreeNodeCompareFunc =
    Dazzle.TreeNode.TreeNode
    -> Dazzle.TreeNode.TreeNode
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `TreeNodeCompareFunc`@.
noTreeNodeCompareFunc :: Maybe TreeNodeCompareFunc
noTreeNodeCompareFunc :: Maybe TreeNodeCompareFunc
noTreeNodeCompareFunc = Maybe TreeNodeCompareFunc
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type TreeNodeCompareFunc_WithClosures =
    Dazzle.TreeNode.TreeNode
    -> Dazzle.TreeNode.TreeNode
    -> Ptr ()
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `TreeNodeCompareFunc_WithClosures`@.
noTreeNodeCompareFunc_WithClosures :: Maybe TreeNodeCompareFunc_WithClosures
noTreeNodeCompareFunc_WithClosures :: Maybe TreeNodeCompareFunc_WithClosures
noTreeNodeCompareFunc_WithClosures = Maybe TreeNodeCompareFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_TreeNodeCompareFunc :: TreeNodeCompareFunc -> TreeNodeCompareFunc_WithClosures
drop_closures_TreeNodeCompareFunc :: TreeNodeCompareFunc -> TreeNodeCompareFunc_WithClosures
drop_closures_TreeNodeCompareFunc TreeNodeCompareFunc
_f TreeNode
a TreeNode
b Ptr ()
_ = TreeNodeCompareFunc
_f TreeNode
a TreeNode
b

-- | Wrap the callback into a `GClosure`.
genClosure_TreeNodeCompareFunc :: MonadIO m => TreeNodeCompareFunc -> m (GClosure C_TreeNodeCompareFunc)
genClosure_TreeNodeCompareFunc :: forall (m :: * -> *).
MonadIO m =>
TreeNodeCompareFunc -> m (GClosure C_TreeNodeCompareFunc)
genClosure_TreeNodeCompareFunc TreeNodeCompareFunc
cb = IO (GClosure C_TreeNodeCompareFunc)
-> m (GClosure C_TreeNodeCompareFunc)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TreeNodeCompareFunc)
 -> m (GClosure C_TreeNodeCompareFunc))
-> IO (GClosure C_TreeNodeCompareFunc)
-> m (GClosure C_TreeNodeCompareFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: TreeNodeCompareFunc_WithClosures
cb' = TreeNodeCompareFunc -> TreeNodeCompareFunc_WithClosures
drop_closures_TreeNodeCompareFunc TreeNodeCompareFunc
cb
    let cb'' :: C_TreeNodeCompareFunc
cb'' = Maybe (Ptr (FunPtr C_TreeNodeCompareFunc))
-> TreeNodeCompareFunc_WithClosures -> C_TreeNodeCompareFunc
wrap_TreeNodeCompareFunc Maybe (Ptr (FunPtr C_TreeNodeCompareFunc))
forall a. Maybe a
Nothing TreeNodeCompareFunc_WithClosures
cb'
    C_TreeNodeCompareFunc -> IO (FunPtr C_TreeNodeCompareFunc)
mk_TreeNodeCompareFunc C_TreeNodeCompareFunc
cb'' IO (FunPtr C_TreeNodeCompareFunc)
-> (FunPtr C_TreeNodeCompareFunc
    -> IO (GClosure C_TreeNodeCompareFunc))
-> IO (GClosure C_TreeNodeCompareFunc)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TreeNodeCompareFunc -> IO (GClosure C_TreeNodeCompareFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `TreeNodeCompareFunc` into a `C_TreeNodeCompareFunc`.
wrap_TreeNodeCompareFunc :: 
    Maybe (Ptr (FunPtr C_TreeNodeCompareFunc)) ->
    TreeNodeCompareFunc_WithClosures ->
    C_TreeNodeCompareFunc
wrap_TreeNodeCompareFunc :: Maybe (Ptr (FunPtr C_TreeNodeCompareFunc))
-> TreeNodeCompareFunc_WithClosures -> C_TreeNodeCompareFunc
wrap_TreeNodeCompareFunc Maybe (Ptr (FunPtr C_TreeNodeCompareFunc))
gi'funptrptr TreeNodeCompareFunc_WithClosures
gi'cb Ptr TreeNode
a Ptr TreeNode
b Ptr ()
userData = do
    TreeNode
a' <- ((ManagedPtr TreeNode -> TreeNode) -> Ptr TreeNode -> IO TreeNode
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr TreeNode -> TreeNode
Dazzle.TreeNode.TreeNode) Ptr TreeNode
a
    TreeNode
b' <- ((ManagedPtr TreeNode -> TreeNode) -> Ptr TreeNode -> IO TreeNode
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr TreeNode -> TreeNode
Dazzle.TreeNode.TreeNode) Ptr TreeNode
b
    Int32
result <- TreeNodeCompareFunc_WithClosures
gi'cb  TreeNode
a' TreeNode
b' Ptr ()
userData
    Maybe (Ptr (FunPtr C_TreeNodeCompareFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_TreeNodeCompareFunc))
gi'funptrptr
    Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- callback TreeFindFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText = Just "%TRUE if @child matched"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "tree"
          , argType =
              TInterface Name { namespace = "Dazzle" , name = "Tree" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "node"
          , argType =
              TInterface Name { namespace = "Dazzle" , name = "TreeNode" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "child"
          , argType =
              TInterface Name { namespace = "Dazzle" , name = "TreeNode" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = True
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Callback to check @child, a child of @node, matches a lookup\nrequest. Returns %TRUE if @child matches, %FALSE if not."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_TreeFindFunc =
    Ptr Dazzle.Tree.Tree ->
    Ptr Dazzle.TreeNode.TreeNode ->
    Ptr Dazzle.TreeNode.TreeNode ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "tree"
--           , argType =
--               TInterface Name { namespace = "Dazzle" , name = "Tree" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "node"
--           , argType =
--               TInterface Name { namespace = "Dazzle" , name = "TreeNode" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "child"
--           , argType =
--               TInterface Name { namespace = "Dazzle" , name = "TreeNode" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TreeFindFunc :: FunPtr C_TreeFindFunc -> C_TreeFindFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TreeFindFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Dazzle.Tree.IsTree a, Dazzle.TreeNode.IsTreeNode b, Dazzle.TreeNode.IsTreeNode c) =>
    FunPtr C_TreeFindFunc
    -> a
    -> b
    -> c
    -> Ptr ()
    -> m Bool
    -- ^ __Returns:__ 'P.True' if /@child@/ matched
dynamic_TreeFindFunc :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsTree a, IsTreeNode b, IsTreeNode c) =>
FunPtr C_TreeFindFunc -> a -> b -> c -> Ptr () -> m Bool
dynamic_TreeFindFunc FunPtr C_TreeFindFunc
__funPtr a
tree b
node c
child Ptr ()
userData = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Tree
tree' <- a -> IO (Ptr Tree)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
tree
    Ptr TreeNode
node' <- b -> IO (Ptr TreeNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
node
    Ptr TreeNode
child' <- c -> IO (Ptr TreeNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
child
    CInt
result <- (FunPtr C_TreeFindFunc -> C_TreeFindFunc
__dynamic_C_TreeFindFunc FunPtr C_TreeFindFunc
__funPtr) Ptr Tree
tree' Ptr TreeNode
node' Ptr TreeNode
child' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
tree
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
node
    c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr c
child
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | Callback to check /@child@/, a child of /@node@/, matches a lookup
-- request. Returns 'P.True' if /@child@/ matches, 'P.False' if not.
type TreeFindFunc =
    Dazzle.Tree.Tree
    -> Dazzle.TreeNode.TreeNode
    -> Dazzle.TreeNode.TreeNode
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if /@child@/ matched

-- | A convenience synonym for @`Nothing` :: `Maybe` `TreeFindFunc`@.
noTreeFindFunc :: Maybe TreeFindFunc
noTreeFindFunc :: Maybe TreeFindFunc
noTreeFindFunc = Maybe TreeFindFunc
forall a. Maybe a
Nothing

-- | Callback to check /@child@/, a child of /@node@/, matches a lookup
-- request. Returns 'P.True' if /@child@/ matches, 'P.False' if not.
type TreeFindFunc_WithClosures =
    Dazzle.Tree.Tree
    -> Dazzle.TreeNode.TreeNode
    -> Dazzle.TreeNode.TreeNode
    -> Ptr ()
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if /@child@/ matched

-- | A convenience synonym for @`Nothing` :: `Maybe` `TreeFindFunc_WithClosures`@.
noTreeFindFunc_WithClosures :: Maybe TreeFindFunc_WithClosures
noTreeFindFunc_WithClosures :: Maybe TreeFindFunc_WithClosures
noTreeFindFunc_WithClosures = Maybe TreeFindFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_TreeFindFunc :: TreeFindFunc -> TreeFindFunc_WithClosures
drop_closures_TreeFindFunc :: TreeFindFunc -> TreeFindFunc_WithClosures
drop_closures_TreeFindFunc TreeFindFunc
_f Tree
tree TreeNode
node TreeNode
child Ptr ()
_ = TreeFindFunc
_f Tree
tree TreeNode
node TreeNode
child

-- | Wrap the callback into a `GClosure`.
genClosure_TreeFindFunc :: MonadIO m => TreeFindFunc -> m (GClosure C_TreeFindFunc)
genClosure_TreeFindFunc :: forall (m :: * -> *).
MonadIO m =>
TreeFindFunc -> m (GClosure C_TreeFindFunc)
genClosure_TreeFindFunc TreeFindFunc
cb = IO (GClosure C_TreeFindFunc) -> m (GClosure C_TreeFindFunc)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TreeFindFunc) -> m (GClosure C_TreeFindFunc))
-> IO (GClosure C_TreeFindFunc) -> m (GClosure C_TreeFindFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: TreeFindFunc_WithClosures
cb' = TreeFindFunc -> TreeFindFunc_WithClosures
drop_closures_TreeFindFunc TreeFindFunc
cb
    let cb'' :: C_TreeFindFunc
cb'' = Maybe (Ptr (FunPtr C_TreeFindFunc))
-> TreeFindFunc_WithClosures -> C_TreeFindFunc
wrap_TreeFindFunc Maybe (Ptr (FunPtr C_TreeFindFunc))
forall a. Maybe a
Nothing TreeFindFunc_WithClosures
cb'
    C_TreeFindFunc -> IO (FunPtr C_TreeFindFunc)
mk_TreeFindFunc C_TreeFindFunc
cb'' IO (FunPtr C_TreeFindFunc)
-> (FunPtr C_TreeFindFunc -> IO (GClosure C_TreeFindFunc))
-> IO (GClosure C_TreeFindFunc)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TreeFindFunc -> IO (GClosure C_TreeFindFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `TreeFindFunc` into a `C_TreeFindFunc`.
wrap_TreeFindFunc :: 
    Maybe (Ptr (FunPtr C_TreeFindFunc)) ->
    TreeFindFunc_WithClosures ->
    C_TreeFindFunc
wrap_TreeFindFunc :: Maybe (Ptr (FunPtr C_TreeFindFunc))
-> TreeFindFunc_WithClosures -> C_TreeFindFunc
wrap_TreeFindFunc Maybe (Ptr (FunPtr C_TreeFindFunc))
gi'funptrptr TreeFindFunc_WithClosures
gi'cb Ptr Tree
tree Ptr TreeNode
node Ptr TreeNode
child Ptr ()
userData = do
    Tree
tree' <- ((ManagedPtr Tree -> Tree) -> Ptr Tree -> IO Tree
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Tree -> Tree
Dazzle.Tree.Tree) Ptr Tree
tree
    TreeNode
node' <- ((ManagedPtr TreeNode -> TreeNode) -> Ptr TreeNode -> IO TreeNode
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr TreeNode -> TreeNode
Dazzle.TreeNode.TreeNode) Ptr TreeNode
node
    TreeNode
child' <- ((ManagedPtr TreeNode -> TreeNode) -> Ptr TreeNode -> IO TreeNode
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr TreeNode -> TreeNode
Dazzle.TreeNode.TreeNode) Ptr TreeNode
child
    Bool
result <- TreeFindFunc_WithClosures
gi'cb  Tree
tree' TreeNode
node' TreeNode
child' Ptr ()
userData
    Maybe (Ptr (FunPtr C_TreeFindFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_TreeFindFunc))
gi'funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
result
    CInt -> IO CInt
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback TreeFilterFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText = Just "%TRUE if @node should be visible."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "tree"
          , argType =
              TInterface Name { namespace = "Dazzle" , name = "Tree" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "node"
          , argType =
              TInterface Name { namespace = "Dazzle" , name = "TreeNode" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = True
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText = Just "Callback to check if @node should be visible."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_TreeFilterFunc =
    Ptr Dazzle.Tree.Tree ->
    Ptr Dazzle.TreeNode.TreeNode ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "tree"
--           , argType =
--               TInterface Name { namespace = "Dazzle" , name = "Tree" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "node"
--           , argType =
--               TInterface Name { namespace = "Dazzle" , name = "TreeNode" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TreeFilterFunc :: FunPtr C_TreeFilterFunc -> C_TreeFilterFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TreeFilterFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Dazzle.Tree.IsTree a, Dazzle.TreeNode.IsTreeNode b) =>
    FunPtr C_TreeFilterFunc
    -> a
    -> b
    -> Ptr ()
    -> m Bool
    -- ^ __Returns:__ 'P.True' if /@node@/ should be visible.
dynamic_TreeFilterFunc :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsTree a, IsTreeNode b) =>
FunPtr C_TreeFilterFunc -> a -> b -> Ptr () -> m Bool
dynamic_TreeFilterFunc FunPtr C_TreeFilterFunc
__funPtr a
tree b
node Ptr ()
userData = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Tree
tree' <- a -> IO (Ptr Tree)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
tree
    Ptr TreeNode
node' <- b -> IO (Ptr TreeNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
node
    CInt
result <- (FunPtr C_TreeFilterFunc -> C_TreeFilterFunc
__dynamic_C_TreeFilterFunc FunPtr C_TreeFilterFunc
__funPtr) Ptr Tree
tree' Ptr TreeNode
node' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
tree
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
node
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | Callback to check if /@node@/ should be visible.
type TreeFilterFunc =
    Dazzle.Tree.Tree
    -> Dazzle.TreeNode.TreeNode
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if /@node@/ should be visible.

-- | A convenience synonym for @`Nothing` :: `Maybe` `TreeFilterFunc`@.
noTreeFilterFunc :: Maybe TreeFilterFunc
noTreeFilterFunc :: Maybe TreeFilterFunc
noTreeFilterFunc = Maybe TreeFilterFunc
forall a. Maybe a
Nothing

-- | Callback to check if /@node@/ should be visible.
type TreeFilterFunc_WithClosures =
    Dazzle.Tree.Tree
    -> Dazzle.TreeNode.TreeNode
    -> Ptr ()
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if /@node@/ should be visible.

-- | A convenience synonym for @`Nothing` :: `Maybe` `TreeFilterFunc_WithClosures`@.
noTreeFilterFunc_WithClosures :: Maybe TreeFilterFunc_WithClosures
noTreeFilterFunc_WithClosures :: Maybe TreeFilterFunc_WithClosures
noTreeFilterFunc_WithClosures = Maybe TreeFilterFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_TreeFilterFunc :: TreeFilterFunc -> TreeFilterFunc_WithClosures
drop_closures_TreeFilterFunc :: TreeFilterFunc -> TreeFilterFunc_WithClosures
drop_closures_TreeFilterFunc TreeFilterFunc
_f Tree
tree TreeNode
node Ptr ()
_ = TreeFilterFunc
_f Tree
tree TreeNode
node

-- | Wrap the callback into a `GClosure`.
genClosure_TreeFilterFunc :: MonadIO m => TreeFilterFunc -> m (GClosure C_TreeFilterFunc)
genClosure_TreeFilterFunc :: forall (m :: * -> *).
MonadIO m =>
TreeFilterFunc -> m (GClosure C_TreeFilterFunc)
genClosure_TreeFilterFunc TreeFilterFunc
cb = IO (GClosure C_TreeFilterFunc) -> m (GClosure C_TreeFilterFunc)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TreeFilterFunc) -> m (GClosure C_TreeFilterFunc))
-> IO (GClosure C_TreeFilterFunc) -> m (GClosure C_TreeFilterFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: TreeFilterFunc_WithClosures
cb' = TreeFilterFunc -> TreeFilterFunc_WithClosures
drop_closures_TreeFilterFunc TreeFilterFunc
cb
    let cb'' :: C_TreeFilterFunc
cb'' = Maybe (Ptr (FunPtr C_TreeFilterFunc))
-> TreeFilterFunc_WithClosures -> C_TreeFilterFunc
wrap_TreeFilterFunc Maybe (Ptr (FunPtr C_TreeFilterFunc))
forall a. Maybe a
Nothing TreeFilterFunc_WithClosures
cb'
    C_TreeFilterFunc -> IO (FunPtr C_TreeFilterFunc)
mk_TreeFilterFunc C_TreeFilterFunc
cb'' IO (FunPtr C_TreeFilterFunc)
-> (FunPtr C_TreeFilterFunc -> IO (GClosure C_TreeFilterFunc))
-> IO (GClosure C_TreeFilterFunc)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TreeFilterFunc -> IO (GClosure C_TreeFilterFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `TreeFilterFunc` into a `C_TreeFilterFunc`.
wrap_TreeFilterFunc :: 
    Maybe (Ptr (FunPtr C_TreeFilterFunc)) ->
    TreeFilterFunc_WithClosures ->
    C_TreeFilterFunc
wrap_TreeFilterFunc :: Maybe (Ptr (FunPtr C_TreeFilterFunc))
-> TreeFilterFunc_WithClosures -> C_TreeFilterFunc
wrap_TreeFilterFunc Maybe (Ptr (FunPtr C_TreeFilterFunc))
gi'funptrptr TreeFilterFunc_WithClosures
gi'cb Ptr Tree
tree Ptr TreeNode
node Ptr ()
userData = do
    Tree
tree' <- ((ManagedPtr Tree -> Tree) -> Ptr Tree -> IO Tree
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Tree -> Tree
Dazzle.Tree.Tree) Ptr Tree
tree
    TreeNode
node' <- ((ManagedPtr TreeNode -> TreeNode) -> Ptr TreeNode -> IO TreeNode
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr TreeNode -> TreeNode
Dazzle.TreeNode.TreeNode) Ptr TreeNode
node
    Bool
result <- TreeFilterFunc_WithClosures
gi'cb  Tree
tree' TreeNode
node' Ptr ()
userData
    Maybe (Ptr (FunPtr C_TreeFilterFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_TreeFilterFunc))
gi'funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
result
    CInt -> IO CInt
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback TaskCacheCallback
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "self"
          , argType =
              TInterface Name { namespace = "Dazzle" , name = "TaskCache" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "An #DzlTaskCache." , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "key"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "the key to fetch" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "task"
          , argType = TInterface Name { namespace = "Gio" , name = "Task" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the task to be completed"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "user_data registered at initialization."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = True
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "#DzlTaskCacheCallback is the prototype for a function to be executed to\npopulate an item in the cache.\n\nThis function will be executed when a fault (cache miss) occurs from\na caller requesting an item from the cache.\n\nThe callee may complete the operation asynchronously, but MUST return\neither a GObject using g_task_return_pointer() or a #GError using\ng_task_return_error() or g_task_return_new_error()."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_TaskCacheCallback =
    Ptr Dazzle.TaskCache.TaskCache ->
    Ptr () ->
    Ptr Gio.Task.Task ->
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Dazzle" , name = "TaskCache" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #DzlTaskCache." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the key to fetch" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "task"
--           , argType = TInterface Name { namespace = "Gio" , name = "Task" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the task to be completed"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user_data registered at initialization."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TaskCacheCallback :: FunPtr C_TaskCacheCallback -> C_TaskCacheCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TaskCacheCallback ::
    (B.CallStack.HasCallStack, MonadIO m, Dazzle.TaskCache.IsTaskCache a, Gio.Task.IsTask b) =>
    FunPtr C_TaskCacheCallback
    -> a
    -- ^ /@self@/: An t'GI.Dazzle.Objects.TaskCache.TaskCache'.
    -> Ptr ()
    -- ^ /@key@/: the key to fetch
    -> b
    -- ^ /@task@/: the task to be completed
    -> Ptr ()
    -- ^ /@userData@/: user_data registered at initialization.
    -> m ()
dynamic_TaskCacheCallback :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsTaskCache a, IsTask b) =>
FunPtr C_TaskCacheCallback -> a -> Ptr () -> b -> Ptr () -> m ()
dynamic_TaskCacheCallback FunPtr C_TaskCacheCallback
__funPtr a
self Ptr ()
key b
task Ptr ()
userData = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr TaskCache
self' <- a -> IO (Ptr TaskCache)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr Task
task' <- b -> IO (Ptr Task)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
task
    (FunPtr C_TaskCacheCallback -> C_TaskCacheCallback
__dynamic_C_TaskCacheCallback FunPtr C_TaskCacheCallback
__funPtr) Ptr TaskCache
self' Ptr ()
key Ptr Task
task' Ptr ()
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
task
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | t'GI.Dazzle.Callbacks.TaskCacheCallback' is the prototype for a function to be executed to
-- populate an item in the cache.
-- 
-- This function will be executed when a fault (cache miss) occurs from
-- a caller requesting an item from the cache.
-- 
-- The callee may complete the operation asynchronously, but MUST return
-- either a GObject using 'GI.Gio.Objects.Task.taskReturnPointer' or a t'GError' using
-- 'GI.Gio.Objects.Task.taskReturnError' or @/g_task_return_new_error()/@.
type TaskCacheCallback =
    Dazzle.TaskCache.TaskCache
    -- ^ /@self@/: An t'GI.Dazzle.Objects.TaskCache.TaskCache'.
    -> Ptr ()
    -- ^ /@key@/: the key to fetch
    -> Gio.Task.Task
    -- ^ /@task@/: the task to be completed
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TaskCacheCallback`@.
noTaskCacheCallback :: Maybe TaskCacheCallback
noTaskCacheCallback :: Maybe TaskCacheCallback
noTaskCacheCallback = Maybe TaskCacheCallback
forall a. Maybe a
Nothing

-- | t'GI.Dazzle.Callbacks.TaskCacheCallback' is the prototype for a function to be executed to
-- populate an item in the cache.
-- 
-- This function will be executed when a fault (cache miss) occurs from
-- a caller requesting an item from the cache.
-- 
-- The callee may complete the operation asynchronously, but MUST return
-- either a GObject using 'GI.Gio.Objects.Task.taskReturnPointer' or a t'GError' using
-- 'GI.Gio.Objects.Task.taskReturnError' or @/g_task_return_new_error()/@.
type TaskCacheCallback_WithClosures =
    Dazzle.TaskCache.TaskCache
    -- ^ /@self@/: An t'GI.Dazzle.Objects.TaskCache.TaskCache'.
    -> Ptr ()
    -- ^ /@key@/: the key to fetch
    -> Gio.Task.Task
    -- ^ /@task@/: the task to be completed
    -> Ptr ()
    -- ^ /@userData@/: user_data registered at initialization.
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TaskCacheCallback_WithClosures`@.
noTaskCacheCallback_WithClosures :: Maybe TaskCacheCallback_WithClosures
noTaskCacheCallback_WithClosures :: Maybe TaskCacheCallback_WithClosures
noTaskCacheCallback_WithClosures = Maybe TaskCacheCallback_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_TaskCacheCallback :: TaskCacheCallback -> TaskCacheCallback_WithClosures
drop_closures_TaskCacheCallback :: TaskCacheCallback -> TaskCacheCallback_WithClosures
drop_closures_TaskCacheCallback TaskCacheCallback
_f TaskCache
self Ptr ()
key Task
task Ptr ()
_ = TaskCacheCallback
_f TaskCache
self Ptr ()
key Task
task

-- | Wrap the callback into a `GClosure`.
genClosure_TaskCacheCallback :: MonadIO m => TaskCacheCallback -> m (GClosure C_TaskCacheCallback)
genClosure_TaskCacheCallback :: forall (m :: * -> *).
MonadIO m =>
TaskCacheCallback -> m (GClosure C_TaskCacheCallback)
genClosure_TaskCacheCallback TaskCacheCallback
cb = IO (GClosure C_TaskCacheCallback)
-> m (GClosure C_TaskCacheCallback)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TaskCacheCallback)
 -> m (GClosure C_TaskCacheCallback))
-> IO (GClosure C_TaskCacheCallback)
-> m (GClosure C_TaskCacheCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: TaskCacheCallback_WithClosures
cb' = TaskCacheCallback -> TaskCacheCallback_WithClosures
drop_closures_TaskCacheCallback TaskCacheCallback
cb
    let cb'' :: C_TaskCacheCallback
cb'' = Maybe (Ptr (FunPtr C_TaskCacheCallback))
-> TaskCacheCallback_WithClosures -> C_TaskCacheCallback
wrap_TaskCacheCallback Maybe (Ptr (FunPtr C_TaskCacheCallback))
forall a. Maybe a
Nothing TaskCacheCallback_WithClosures
cb'
    C_TaskCacheCallback -> IO (FunPtr C_TaskCacheCallback)
mk_TaskCacheCallback C_TaskCacheCallback
cb'' IO (FunPtr C_TaskCacheCallback)
-> (FunPtr C_TaskCacheCallback
    -> IO (GClosure C_TaskCacheCallback))
-> IO (GClosure C_TaskCacheCallback)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TaskCacheCallback -> IO (GClosure C_TaskCacheCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `TaskCacheCallback` into a `C_TaskCacheCallback`.
wrap_TaskCacheCallback :: 
    Maybe (Ptr (FunPtr C_TaskCacheCallback)) ->
    TaskCacheCallback_WithClosures ->
    C_TaskCacheCallback
wrap_TaskCacheCallback :: Maybe (Ptr (FunPtr C_TaskCacheCallback))
-> TaskCacheCallback_WithClosures -> C_TaskCacheCallback
wrap_TaskCacheCallback Maybe (Ptr (FunPtr C_TaskCacheCallback))
gi'funptrptr TaskCacheCallback_WithClosures
gi'cb Ptr TaskCache
self Ptr ()
key Ptr Task
task Ptr ()
userData = do
    TaskCache
self' <- ((ManagedPtr TaskCache -> TaskCache)
-> Ptr TaskCache -> IO TaskCache
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr TaskCache -> TaskCache
Dazzle.TaskCache.TaskCache) Ptr TaskCache
self
    Task
task' <- ((ManagedPtr Task -> Task) -> Ptr Task -> IO Task
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Task -> Task
Gio.Task.Task) Ptr Task
task
    TaskCacheCallback_WithClosures
gi'cb  TaskCache
self' Ptr ()
key Task
task' Ptr ()
userData
    Maybe (Ptr (FunPtr C_TaskCacheCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_TaskCacheCallback))
gi'funptrptr


-- callback SuggestionPositionFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "entry"
          , argType =
              TInterface Name { namespace = "Dazzle" , name = "SuggestionEntry" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #DzlSuggestionEntry"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "area"
          , argType =
              TInterface Name { namespace = "Gdk" , name = "Rectangle" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "location to place the popover"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "is_absolute"
          , argType = TBasicType TBoolean
          , direction = DirectionInout
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "If the area is in absolute coordinates"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferEverything
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "closure data" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = True
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Positions the popover in the coordinates defined by @area.\n\nIf @is_absolute is set to %TRUE, then absolute coordinates are used.\nOtherwise, the position is expected to be relative to @entry."
        , sinceVersion = Just "3.26"
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_SuggestionPositionFunc =
    Ptr Dazzle.SuggestionEntry.SuggestionEntry ->
    Ptr Gdk.Rectangle.Rectangle ->
    Ptr CInt ->
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "entry"
--           , argType =
--               TInterface Name { namespace = "Dazzle" , name = "SuggestionEntry" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #DzlSuggestionEntry"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "area"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Rectangle" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to place the popover"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "is_absolute"
--           , argType = TBasicType TBoolean
--           , direction = DirectionInout
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "If the area is in absolute coordinates"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "closure data" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_SuggestionPositionFunc :: FunPtr C_SuggestionPositionFunc -> C_SuggestionPositionFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_SuggestionPositionFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Dazzle.SuggestionEntry.IsSuggestionEntry a) =>
    FunPtr C_SuggestionPositionFunc
    -> a
    -- ^ /@entry@/: a t'GI.Dazzle.Objects.SuggestionEntry.SuggestionEntry'
    -> Gdk.Rectangle.Rectangle
    -- ^ /@area@/: location to place the popover
    -> Bool
    -- ^ /@isAbsolute@/: If the area is in absolute coordinates
    -> Ptr ()
    -- ^ /@userData@/: closure data
    -> m (Bool)
dynamic_SuggestionPositionFunc :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSuggestionEntry a) =>
FunPtr C_SuggestionPositionFunc
-> a -> Rectangle -> Bool -> Ptr () -> m Bool
dynamic_SuggestionPositionFunc FunPtr C_SuggestionPositionFunc
__funPtr a
entry Rectangle
area Bool
isAbsolute Ptr ()
userData = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr SuggestionEntry
entry' <- a -> IO (Ptr SuggestionEntry)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
entry
    Ptr Rectangle
area' <- Rectangle -> IO (Ptr Rectangle)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rectangle
area
    let isAbsolute' :: CInt
isAbsolute' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
isAbsolute
    Ptr CInt
isAbsolute'' <- IO (Ptr CInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CInt)
    Ptr CInt -> CInt -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr CInt
isAbsolute'' CInt
isAbsolute'
    (FunPtr C_SuggestionPositionFunc -> C_SuggestionPositionFunc
__dynamic_C_SuggestionPositionFunc FunPtr C_SuggestionPositionFunc
__funPtr) Ptr SuggestionEntry
entry' Ptr Rectangle
area' Ptr CInt
isAbsolute'' Ptr ()
userData
    CInt
isAbsolute''' <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
isAbsolute''
    let isAbsolute'''' :: Bool
isAbsolute'''' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
isAbsolute'''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
entry
    Rectangle -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rectangle
area
    Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
isAbsolute''
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
isAbsolute''''

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

-- | Positions the popover in the coordinates defined by /@area@/.
-- 
-- If /@isAbsolute@/ is set to 'P.True', then absolute coordinates are used.
-- Otherwise, the position is expected to be relative to /@entry@/.
-- 
-- /Since: 3.26/
type SuggestionPositionFunc =
    Dazzle.SuggestionEntry.SuggestionEntry
    -- ^ /@entry@/: a t'GI.Dazzle.Objects.SuggestionEntry.SuggestionEntry'
    -> Gdk.Rectangle.Rectangle
    -- ^ /@area@/: location to place the popover
    -> Bool
    -- ^ /@isAbsolute@/: If the area is in absolute coordinates
    -> IO (Bool)

-- | A convenience synonym for @`Nothing` :: `Maybe` `SuggestionPositionFunc`@.
noSuggestionPositionFunc :: Maybe SuggestionPositionFunc
noSuggestionPositionFunc :: Maybe SuggestionPositionFunc
noSuggestionPositionFunc = Maybe SuggestionPositionFunc
forall a. Maybe a
Nothing

-- | Positions the popover in the coordinates defined by /@area@/.
-- 
-- If /@isAbsolute@/ is set to 'P.True', then absolute coordinates are used.
-- Otherwise, the position is expected to be relative to /@entry@/.
-- 
-- /Since: 3.26/
type SuggestionPositionFunc_WithClosures =
    Dazzle.SuggestionEntry.SuggestionEntry
    -- ^ /@entry@/: a t'GI.Dazzle.Objects.SuggestionEntry.SuggestionEntry'
    -> Gdk.Rectangle.Rectangle
    -- ^ /@area@/: location to place the popover
    -> Bool
    -- ^ /@isAbsolute@/: If the area is in absolute coordinates
    -> Ptr ()
    -- ^ /@userData@/: closure data
    -> IO (Bool)

-- | A convenience synonym for @`Nothing` :: `Maybe` `SuggestionPositionFunc_WithClosures`@.
noSuggestionPositionFunc_WithClosures :: Maybe SuggestionPositionFunc_WithClosures
noSuggestionPositionFunc_WithClosures :: Maybe SuggestionPositionFunc_WithClosures
noSuggestionPositionFunc_WithClosures = Maybe SuggestionPositionFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_SuggestionPositionFunc :: SuggestionPositionFunc -> SuggestionPositionFunc_WithClosures
drop_closures_SuggestionPositionFunc :: SuggestionPositionFunc -> SuggestionPositionFunc_WithClosures
drop_closures_SuggestionPositionFunc SuggestionPositionFunc
_f SuggestionEntry
entry Rectangle
area Bool
isAbsolute Ptr ()
_ = SuggestionPositionFunc
_f SuggestionEntry
entry Rectangle
area Bool
isAbsolute

-- | Wrap the callback into a `GClosure`.
genClosure_SuggestionPositionFunc :: MonadIO m => SuggestionPositionFunc -> m (GClosure C_SuggestionPositionFunc)
genClosure_SuggestionPositionFunc :: forall (m :: * -> *).
MonadIO m =>
SuggestionPositionFunc -> m (GClosure C_SuggestionPositionFunc)
genClosure_SuggestionPositionFunc SuggestionPositionFunc
cb = IO (GClosure C_SuggestionPositionFunc)
-> m (GClosure C_SuggestionPositionFunc)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SuggestionPositionFunc)
 -> m (GClosure C_SuggestionPositionFunc))
-> IO (GClosure C_SuggestionPositionFunc)
-> m (GClosure C_SuggestionPositionFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: SuggestionPositionFunc_WithClosures
cb' = SuggestionPositionFunc -> SuggestionPositionFunc_WithClosures
drop_closures_SuggestionPositionFunc SuggestionPositionFunc
cb
    let cb'' :: C_SuggestionPositionFunc
cb'' = Maybe (Ptr (FunPtr C_SuggestionPositionFunc))
-> SuggestionPositionFunc_WithClosures -> C_SuggestionPositionFunc
wrap_SuggestionPositionFunc Maybe (Ptr (FunPtr C_SuggestionPositionFunc))
forall a. Maybe a
Nothing SuggestionPositionFunc_WithClosures
cb'
    C_SuggestionPositionFunc -> IO (FunPtr C_SuggestionPositionFunc)
mk_SuggestionPositionFunc C_SuggestionPositionFunc
cb'' IO (FunPtr C_SuggestionPositionFunc)
-> (FunPtr C_SuggestionPositionFunc
    -> IO (GClosure C_SuggestionPositionFunc))
-> IO (GClosure C_SuggestionPositionFunc)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SuggestionPositionFunc
-> IO (GClosure C_SuggestionPositionFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `SuggestionPositionFunc` into a `C_SuggestionPositionFunc`.
wrap_SuggestionPositionFunc :: 
    Maybe (Ptr (FunPtr C_SuggestionPositionFunc)) ->
    SuggestionPositionFunc_WithClosures ->
    C_SuggestionPositionFunc
wrap_SuggestionPositionFunc :: Maybe (Ptr (FunPtr C_SuggestionPositionFunc))
-> SuggestionPositionFunc_WithClosures -> C_SuggestionPositionFunc
wrap_SuggestionPositionFunc Maybe (Ptr (FunPtr C_SuggestionPositionFunc))
gi'funptrptr SuggestionPositionFunc_WithClosures
gi'cb Ptr SuggestionEntry
entry Ptr Rectangle
area Ptr CInt
isAbsolute Ptr ()
userData = do
    SuggestionEntry
entry' <- ((ManagedPtr SuggestionEntry -> SuggestionEntry)
-> Ptr SuggestionEntry -> IO SuggestionEntry
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr SuggestionEntry -> SuggestionEntry
Dazzle.SuggestionEntry.SuggestionEntry) Ptr SuggestionEntry
entry
    Ptr Rectangle -> (Rectangle -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  Ptr Rectangle
area ((Rectangle -> IO ()) -> IO ()) -> (Rectangle -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Rectangle
area' -> do
        CInt
isAbsolute' <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
isAbsolute
        let isAbsolute'' :: Bool
isAbsolute'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
isAbsolute'
        Bool
outisAbsolute <- SuggestionPositionFunc_WithClosures
gi'cb  SuggestionEntry
entry' Rectangle
area' Bool
isAbsolute'' Ptr ()
userData
        let outisAbsolute' :: CInt
outisAbsolute' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
outisAbsolute
        Ptr CInt -> CInt -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr CInt
isAbsolute CInt
outisAbsolute'
        Maybe (Ptr (FunPtr C_SuggestionPositionFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_SuggestionPositionFunc))
gi'funptrptr


-- callback StackListCreateWidgetFunc
{- Callable
  { returnType =
      Just (TInterface Name { namespace = "Gtk" , name = "Widget" })
  , returnMayBeNull = False
  , returnTransfer = TransferEverything
  , returnDocumentation =
      Documentation
        { rawDocText = Just "a #GtkWidget that represents @item"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "item"
          , argType =
              TInterface Name { namespace = "GObject" , name = "Object" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText =
                    Just "the item from the model for which to create a widget for"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "user data from dzl_stack_list_push()"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = True
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Called for stack lists that are bound to a #GListModel with\ndzl_stack_list_push() for each item that gets added to the model."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_StackListCreateWidgetFunc =
    Ptr GObject.Object.Object ->
    Ptr () ->
    IO (Ptr Gtk.Widget.Widget)

-- Args: [ Arg
--           { argCName = "item"
--           , argType =
--               TInterface Name { namespace = "GObject" , name = "Object" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the item from the model for which to create a widget for"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user data from dzl_stack_list_push()"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gtk" , name = "Widget" })
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_StackListCreateWidgetFunc :: FunPtr C_StackListCreateWidgetFunc -> C_StackListCreateWidgetFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_StackListCreateWidgetFunc ::
    (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) =>
    FunPtr C_StackListCreateWidgetFunc
    -> a
    -- ^ /@item@/: the item from the model for which to create a widget for
    -> Ptr ()
    -- ^ /@userData@/: user data from 'GI.Dazzle.Objects.StackList.stackListPush'
    -> m Gtk.Widget.Widget
    -- ^ __Returns:__ a t'GI.Gtk.Objects.Widget.Widget' that represents /@item@/
dynamic_StackListCreateWidgetFunc :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsObject a) =>
FunPtr C_StackListCreateWidgetFunc -> a -> Ptr () -> m Widget
dynamic_StackListCreateWidgetFunc FunPtr C_StackListCreateWidgetFunc
__funPtr a
item Ptr ()
userData = IO Widget -> m Widget
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Widget -> m Widget) -> IO Widget -> m Widget
forall a b. (a -> b) -> a -> b
$ do
    Ptr Object
item' <- a -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
item
    Ptr Widget
result <- (FunPtr C_StackListCreateWidgetFunc -> C_StackListCreateWidgetFunc
__dynamic_C_StackListCreateWidgetFunc FunPtr C_StackListCreateWidgetFunc
__funPtr) Ptr Object
item' Ptr ()
userData
    Text -> Ptr Widget -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stackListCreateWidgetFunc" Ptr Widget
result
    Widget
result' <- ((ManagedPtr Widget -> Widget) -> Ptr Widget -> IO Widget
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Widget -> Widget
Gtk.Widget.Widget) Ptr Widget
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
item
    Widget -> IO Widget
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Widget
result'

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

-- | Called for stack lists that are bound to a t'GI.Gio.Interfaces.ListModel.ListModel' with
-- 'GI.Dazzle.Objects.StackList.stackListPush' for each item that gets added to the model.
type StackListCreateWidgetFunc =
    GObject.Object.Object
    -- ^ /@item@/: the item from the model for which to create a widget for
    -> IO Gtk.Widget.Widget
    -- ^ __Returns:__ a t'GI.Gtk.Objects.Widget.Widget' that represents /@item@/

-- | A convenience synonym for @`Nothing` :: `Maybe` `StackListCreateWidgetFunc`@.
noStackListCreateWidgetFunc :: Maybe StackListCreateWidgetFunc
noStackListCreateWidgetFunc :: Maybe StackListCreateWidgetFunc
noStackListCreateWidgetFunc = Maybe StackListCreateWidgetFunc
forall a. Maybe a
Nothing

-- | Called for stack lists that are bound to a t'GI.Gio.Interfaces.ListModel.ListModel' with
-- 'GI.Dazzle.Objects.StackList.stackListPush' for each item that gets added to the model.
type StackListCreateWidgetFunc_WithClosures =
    GObject.Object.Object
    -- ^ /@item@/: the item from the model for which to create a widget for
    -> Ptr ()
    -- ^ /@userData@/: user data from 'GI.Dazzle.Objects.StackList.stackListPush'
    -> IO Gtk.Widget.Widget
    -- ^ __Returns:__ a t'GI.Gtk.Objects.Widget.Widget' that represents /@item@/

-- | A convenience synonym for @`Nothing` :: `Maybe` `StackListCreateWidgetFunc_WithClosures`@.
noStackListCreateWidgetFunc_WithClosures :: Maybe StackListCreateWidgetFunc_WithClosures
noStackListCreateWidgetFunc_WithClosures :: Maybe StackListCreateWidgetFunc_WithClosures
noStackListCreateWidgetFunc_WithClosures = Maybe StackListCreateWidgetFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_StackListCreateWidgetFunc :: StackListCreateWidgetFunc -> StackListCreateWidgetFunc_WithClosures
drop_closures_StackListCreateWidgetFunc :: StackListCreateWidgetFunc -> StackListCreateWidgetFunc_WithClosures
drop_closures_StackListCreateWidgetFunc StackListCreateWidgetFunc
_f Object
item Ptr ()
_ = StackListCreateWidgetFunc
_f Object
item

-- | Wrap the callback into a `GClosure`.
genClosure_StackListCreateWidgetFunc :: MonadIO m => StackListCreateWidgetFunc -> m (GClosure C_StackListCreateWidgetFunc)
genClosure_StackListCreateWidgetFunc :: forall (m :: * -> *).
MonadIO m =>
StackListCreateWidgetFunc
-> m (GClosure C_StackListCreateWidgetFunc)
genClosure_StackListCreateWidgetFunc StackListCreateWidgetFunc
cb = IO (GClosure C_StackListCreateWidgetFunc)
-> m (GClosure C_StackListCreateWidgetFunc)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_StackListCreateWidgetFunc)
 -> m (GClosure C_StackListCreateWidgetFunc))
-> IO (GClosure C_StackListCreateWidgetFunc)
-> m (GClosure C_StackListCreateWidgetFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: StackListCreateWidgetFunc_WithClosures
cb' = StackListCreateWidgetFunc -> StackListCreateWidgetFunc_WithClosures
drop_closures_StackListCreateWidgetFunc StackListCreateWidgetFunc
cb
    let cb'' :: C_StackListCreateWidgetFunc
cb'' = Maybe (Ptr (FunPtr C_StackListCreateWidgetFunc))
-> StackListCreateWidgetFunc_WithClosures
-> C_StackListCreateWidgetFunc
wrap_StackListCreateWidgetFunc Maybe (Ptr (FunPtr C_StackListCreateWidgetFunc))
forall a. Maybe a
Nothing StackListCreateWidgetFunc_WithClosures
cb'
    C_StackListCreateWidgetFunc
-> IO (FunPtr C_StackListCreateWidgetFunc)
mk_StackListCreateWidgetFunc C_StackListCreateWidgetFunc
cb'' IO (FunPtr C_StackListCreateWidgetFunc)
-> (FunPtr C_StackListCreateWidgetFunc
    -> IO (GClosure C_StackListCreateWidgetFunc))
-> IO (GClosure C_StackListCreateWidgetFunc)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_StackListCreateWidgetFunc
-> IO (GClosure C_StackListCreateWidgetFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `StackListCreateWidgetFunc` into a `C_StackListCreateWidgetFunc`.
wrap_StackListCreateWidgetFunc :: 
    Maybe (Ptr (FunPtr C_StackListCreateWidgetFunc)) ->
    StackListCreateWidgetFunc_WithClosures ->
    C_StackListCreateWidgetFunc
wrap_StackListCreateWidgetFunc :: Maybe (Ptr (FunPtr C_StackListCreateWidgetFunc))
-> StackListCreateWidgetFunc_WithClosures
-> C_StackListCreateWidgetFunc
wrap_StackListCreateWidgetFunc Maybe (Ptr (FunPtr C_StackListCreateWidgetFunc))
gi'funptrptr StackListCreateWidgetFunc_WithClosures
gi'cb Ptr Object
item Ptr ()
userData = do
    Object
item' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
GObject.Object.Object) Ptr Object
item
    Widget
result <- StackListCreateWidgetFunc_WithClosures
gi'cb  Object
item' Ptr ()
userData
    Maybe (Ptr (FunPtr C_StackListCreateWidgetFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_StackListCreateWidgetFunc))
gi'funptrptr
    Ptr Widget
result' <- Widget -> IO (Ptr Widget)
forall a b. (HasCallStack, GObject a) => a -> IO (Ptr b)
B.ManagedPtr.disownObject Widget
result
    Ptr Widget -> IO (Ptr Widget)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Widget
result'


-- callback ShortcutChordTableForeach
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "chord"
          , argType =
              TInterface Name { namespace = "Dazzle" , name = "ShortcutChord" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "chord_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = True
          , 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_ShortcutChordTableForeach =
    Ptr Dazzle.ShortcutChord.ShortcutChord ->
    Ptr () ->
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "chord"
--           , argType =
--               TInterface Name { namespace = "Dazzle" , name = "ShortcutChord" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "chord_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_ShortcutChordTableForeach :: FunPtr C_ShortcutChordTableForeach -> C_ShortcutChordTableForeach

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_ShortcutChordTableForeach ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_ShortcutChordTableForeach
    -> Dazzle.ShortcutChord.ShortcutChord
    -> Ptr ()
    -> Ptr ()
    -> m ()
dynamic_ShortcutChordTableForeach :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_ShortcutChordTableForeach
-> ShortcutChord -> Ptr () -> Ptr () -> m ()
dynamic_ShortcutChordTableForeach FunPtr C_ShortcutChordTableForeach
__funPtr ShortcutChord
chord Ptr ()
chordData Ptr ()
userData = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr ShortcutChord
chord' <- ShortcutChord -> IO (Ptr ShortcutChord)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ShortcutChord
chord
    (FunPtr C_ShortcutChordTableForeach -> C_ShortcutChordTableForeach
__dynamic_C_ShortcutChordTableForeach FunPtr C_ShortcutChordTableForeach
__funPtr) Ptr ShortcutChord
chord' Ptr ()
chordData Ptr ()
userData
    ShortcutChord -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ShortcutChord
chord
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

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

-- | A convenience synonym for @`Nothing` :: `Maybe` `ShortcutChordTableForeach`@.
noShortcutChordTableForeach :: Maybe ShortcutChordTableForeach
noShortcutChordTableForeach :: Maybe ShortcutChordTableForeach
noShortcutChordTableForeach = Maybe ShortcutChordTableForeach
forall a. Maybe a
Nothing

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

-- | A convenience synonym for @`Nothing` :: `Maybe` `ShortcutChordTableForeach_WithClosures`@.
noShortcutChordTableForeach_WithClosures :: Maybe ShortcutChordTableForeach_WithClosures
noShortcutChordTableForeach_WithClosures :: Maybe ShortcutChordTableForeach_WithClosures
noShortcutChordTableForeach_WithClosures = Maybe ShortcutChordTableForeach_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_ShortcutChordTableForeach :: ShortcutChordTableForeach -> ShortcutChordTableForeach_WithClosures
drop_closures_ShortcutChordTableForeach :: ShortcutChordTableForeach -> ShortcutChordTableForeach_WithClosures
drop_closures_ShortcutChordTableForeach ShortcutChordTableForeach
_f ShortcutChord
chord Ptr ()
chordData Ptr ()
_ = ShortcutChordTableForeach
_f ShortcutChord
chord Ptr ()
chordData

-- | Wrap the callback into a `GClosure`.
genClosure_ShortcutChordTableForeach :: MonadIO m => ShortcutChordTableForeach -> m (GClosure C_ShortcutChordTableForeach)
genClosure_ShortcutChordTableForeach :: forall (m :: * -> *).
MonadIO m =>
ShortcutChordTableForeach
-> m (GClosure C_ShortcutChordTableForeach)
genClosure_ShortcutChordTableForeach ShortcutChordTableForeach
cb = IO (GClosure C_ShortcutChordTableForeach)
-> m (GClosure C_ShortcutChordTableForeach)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ShortcutChordTableForeach)
 -> m (GClosure C_ShortcutChordTableForeach))
-> IO (GClosure C_ShortcutChordTableForeach)
-> m (GClosure C_ShortcutChordTableForeach)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: ShortcutChordTableForeach_WithClosures
cb' = ShortcutChordTableForeach -> ShortcutChordTableForeach_WithClosures
drop_closures_ShortcutChordTableForeach ShortcutChordTableForeach
cb
    let cb'' :: C_ShortcutChordTableForeach
cb'' = Maybe (Ptr (FunPtr C_ShortcutChordTableForeach))
-> ShortcutChordTableForeach_WithClosures
-> C_ShortcutChordTableForeach
wrap_ShortcutChordTableForeach Maybe (Ptr (FunPtr C_ShortcutChordTableForeach))
forall a. Maybe a
Nothing ShortcutChordTableForeach_WithClosures
cb'
    C_ShortcutChordTableForeach
-> IO (FunPtr C_ShortcutChordTableForeach)
mk_ShortcutChordTableForeach C_ShortcutChordTableForeach
cb'' IO (FunPtr C_ShortcutChordTableForeach)
-> (FunPtr C_ShortcutChordTableForeach
    -> IO (GClosure C_ShortcutChordTableForeach))
-> IO (GClosure C_ShortcutChordTableForeach)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ShortcutChordTableForeach
-> IO (GClosure C_ShortcutChordTableForeach)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ShortcutChordTableForeach` into a `C_ShortcutChordTableForeach`.
wrap_ShortcutChordTableForeach :: 
    Maybe (Ptr (FunPtr C_ShortcutChordTableForeach)) ->
    ShortcutChordTableForeach_WithClosures ->
    C_ShortcutChordTableForeach
wrap_ShortcutChordTableForeach :: Maybe (Ptr (FunPtr C_ShortcutChordTableForeach))
-> ShortcutChordTableForeach_WithClosures
-> C_ShortcutChordTableForeach
wrap_ShortcutChordTableForeach Maybe (Ptr (FunPtr C_ShortcutChordTableForeach))
gi'funptrptr ShortcutChordTableForeach_WithClosures
gi'cb Ptr ShortcutChord
chord Ptr ()
chordData Ptr ()
userData = do
    Ptr ShortcutChord -> (ShortcutChord -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  Ptr ShortcutChord
chord ((ShortcutChord -> IO ()) -> IO ())
-> (ShortcutChord -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ShortcutChord
chord' -> do
        ShortcutChordTableForeach_WithClosures
gi'cb  ShortcutChord
chord' Ptr ()
chordData Ptr ()
userData
        Maybe (Ptr (FunPtr C_ShortcutChordTableForeach)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ShortcutChordTableForeach))
gi'funptrptr


-- callback RecursiveIgnoreFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "file"
          , argType = TInterface Name { namespace = "Gio" , name = "File" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = True
          , 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_RecursiveIgnoreFunc =
    Ptr Gio.File.File ->
    Ptr () ->
    IO CInt

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

foreign import ccall "dynamic" __dynamic_C_RecursiveIgnoreFunc :: FunPtr C_RecursiveIgnoreFunc -> C_RecursiveIgnoreFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_RecursiveIgnoreFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a) =>
    FunPtr C_RecursiveIgnoreFunc
    -> a
    -> Ptr ()
    -> m Bool
dynamic_RecursiveIgnoreFunc :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFile a) =>
FunPtr C_RecursiveIgnoreFunc -> a -> Ptr () -> m Bool
dynamic_RecursiveIgnoreFunc FunPtr C_RecursiveIgnoreFunc
__funPtr a
file Ptr ()
userData = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
    CInt
result <- (FunPtr C_RecursiveIgnoreFunc -> C_RecursiveIgnoreFunc
__dynamic_C_RecursiveIgnoreFunc FunPtr C_RecursiveIgnoreFunc
__funPtr) Ptr File
file' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | /No description available in the introspection data./
type RecursiveIgnoreFunc =
    Gio.File.File
    -> IO Bool

-- | A convenience synonym for @`Nothing` :: `Maybe` `RecursiveIgnoreFunc`@.
noRecursiveIgnoreFunc :: Maybe RecursiveIgnoreFunc
noRecursiveIgnoreFunc :: Maybe RecursiveIgnoreFunc
noRecursiveIgnoreFunc = Maybe RecursiveIgnoreFunc
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type RecursiveIgnoreFunc_WithClosures =
    Gio.File.File
    -> Ptr ()
    -> IO Bool

-- | A convenience synonym for @`Nothing` :: `Maybe` `RecursiveIgnoreFunc_WithClosures`@.
noRecursiveIgnoreFunc_WithClosures :: Maybe RecursiveIgnoreFunc_WithClosures
noRecursiveIgnoreFunc_WithClosures :: Maybe RecursiveIgnoreFunc_WithClosures
noRecursiveIgnoreFunc_WithClosures = Maybe RecursiveIgnoreFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_RecursiveIgnoreFunc :: RecursiveIgnoreFunc -> RecursiveIgnoreFunc_WithClosures
drop_closures_RecursiveIgnoreFunc :: RecursiveIgnoreFunc -> RecursiveIgnoreFunc_WithClosures
drop_closures_RecursiveIgnoreFunc RecursiveIgnoreFunc
_f File
file Ptr ()
_ = RecursiveIgnoreFunc
_f File
file

-- | Wrap the callback into a `GClosure`.
genClosure_RecursiveIgnoreFunc :: MonadIO m => RecursiveIgnoreFunc -> m (GClosure C_RecursiveIgnoreFunc)
genClosure_RecursiveIgnoreFunc :: forall (m :: * -> *).
MonadIO m =>
RecursiveIgnoreFunc -> m (GClosure C_RecursiveIgnoreFunc)
genClosure_RecursiveIgnoreFunc RecursiveIgnoreFunc
cb = IO (GClosure C_RecursiveIgnoreFunc)
-> m (GClosure C_RecursiveIgnoreFunc)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_RecursiveIgnoreFunc)
 -> m (GClosure C_RecursiveIgnoreFunc))
-> IO (GClosure C_RecursiveIgnoreFunc)
-> m (GClosure C_RecursiveIgnoreFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: RecursiveIgnoreFunc_WithClosures
cb' = RecursiveIgnoreFunc -> RecursiveIgnoreFunc_WithClosures
drop_closures_RecursiveIgnoreFunc RecursiveIgnoreFunc
cb
    let cb'' :: C_RecursiveIgnoreFunc
cb'' = Maybe (Ptr (FunPtr C_RecursiveIgnoreFunc))
-> RecursiveIgnoreFunc_WithClosures -> C_RecursiveIgnoreFunc
wrap_RecursiveIgnoreFunc Maybe (Ptr (FunPtr C_RecursiveIgnoreFunc))
forall a. Maybe a
Nothing RecursiveIgnoreFunc_WithClosures
cb'
    C_RecursiveIgnoreFunc -> IO (FunPtr C_RecursiveIgnoreFunc)
mk_RecursiveIgnoreFunc C_RecursiveIgnoreFunc
cb'' IO (FunPtr C_RecursiveIgnoreFunc)
-> (FunPtr C_RecursiveIgnoreFunc
    -> IO (GClosure C_RecursiveIgnoreFunc))
-> IO (GClosure C_RecursiveIgnoreFunc)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_RecursiveIgnoreFunc -> IO (GClosure C_RecursiveIgnoreFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `RecursiveIgnoreFunc` into a `C_RecursiveIgnoreFunc`.
wrap_RecursiveIgnoreFunc :: 
    Maybe (Ptr (FunPtr C_RecursiveIgnoreFunc)) ->
    RecursiveIgnoreFunc_WithClosures ->
    C_RecursiveIgnoreFunc
wrap_RecursiveIgnoreFunc :: Maybe (Ptr (FunPtr C_RecursiveIgnoreFunc))
-> RecursiveIgnoreFunc_WithClosures -> C_RecursiveIgnoreFunc
wrap_RecursiveIgnoreFunc Maybe (Ptr (FunPtr C_RecursiveIgnoreFunc))
gi'funptrptr RecursiveIgnoreFunc_WithClosures
gi'cb Ptr File
file Ptr ()
userData = do
    File
file' <- ((ManagedPtr File -> File) -> Ptr File -> IO File
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr File -> File
Gio.File.File) Ptr File
file
    Bool
result <- RecursiveIgnoreFunc_WithClosures
gi'cb  File
file' Ptr ()
userData
    Maybe (Ptr (FunPtr C_RecursiveIgnoreFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_RecursiveIgnoreFunc))
gi'funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
result
    CInt -> IO CInt
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback ListModelFilterFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "object"
          , argType =
              TInterface Name { namespace = "GObject" , name = "Object" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = True
          , 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_ListModelFilterFunc =
    Ptr GObject.Object.Object ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "object"
--           , argType =
--               TInterface Name { namespace = "GObject" , name = "Object" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_ListModelFilterFunc :: FunPtr C_ListModelFilterFunc -> C_ListModelFilterFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_ListModelFilterFunc ::
    (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) =>
    FunPtr C_ListModelFilterFunc
    -> a
    -> Ptr ()
    -> m Bool
dynamic_ListModelFilterFunc :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsObject a) =>
FunPtr C_ListModelFilterFunc -> a -> Ptr () -> m Bool
dynamic_ListModelFilterFunc FunPtr C_ListModelFilterFunc
__funPtr a
object Ptr ()
userData = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Object
object' <- a -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
object
    CInt
result <- (FunPtr C_ListModelFilterFunc -> C_ListModelFilterFunc
__dynamic_C_ListModelFilterFunc FunPtr C_ListModelFilterFunc
__funPtr) Ptr Object
object' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
object
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | /No description available in the introspection data./
type ListModelFilterFunc =
    GObject.Object.Object
    -> IO Bool

-- | A convenience synonym for @`Nothing` :: `Maybe` `ListModelFilterFunc`@.
noListModelFilterFunc :: Maybe ListModelFilterFunc
noListModelFilterFunc :: Maybe ListModelFilterFunc
noListModelFilterFunc = Maybe ListModelFilterFunc
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type ListModelFilterFunc_WithClosures =
    GObject.Object.Object
    -> Ptr ()
    -> IO Bool

-- | A convenience synonym for @`Nothing` :: `Maybe` `ListModelFilterFunc_WithClosures`@.
noListModelFilterFunc_WithClosures :: Maybe ListModelFilterFunc_WithClosures
noListModelFilterFunc_WithClosures :: Maybe ListModelFilterFunc_WithClosures
noListModelFilterFunc_WithClosures = Maybe ListModelFilterFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_ListModelFilterFunc :: ListModelFilterFunc -> ListModelFilterFunc_WithClosures
drop_closures_ListModelFilterFunc :: ListModelFilterFunc -> ListModelFilterFunc_WithClosures
drop_closures_ListModelFilterFunc ListModelFilterFunc
_f Object
object Ptr ()
_ = ListModelFilterFunc
_f Object
object

-- | Wrap the callback into a `GClosure`.
genClosure_ListModelFilterFunc :: MonadIO m => ListModelFilterFunc -> m (GClosure C_ListModelFilterFunc)
genClosure_ListModelFilterFunc :: forall (m :: * -> *).
MonadIO m =>
ListModelFilterFunc -> m (GClosure C_ListModelFilterFunc)
genClosure_ListModelFilterFunc ListModelFilterFunc
cb = IO (GClosure C_ListModelFilterFunc)
-> m (GClosure C_ListModelFilterFunc)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ListModelFilterFunc)
 -> m (GClosure C_ListModelFilterFunc))
-> IO (GClosure C_ListModelFilterFunc)
-> m (GClosure C_ListModelFilterFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: ListModelFilterFunc_WithClosures
cb' = ListModelFilterFunc -> ListModelFilterFunc_WithClosures
drop_closures_ListModelFilterFunc ListModelFilterFunc
cb
    let cb'' :: C_ListModelFilterFunc
cb'' = Maybe (Ptr (FunPtr C_ListModelFilterFunc))
-> ListModelFilterFunc_WithClosures -> C_ListModelFilterFunc
wrap_ListModelFilterFunc Maybe (Ptr (FunPtr C_ListModelFilterFunc))
forall a. Maybe a
Nothing ListModelFilterFunc_WithClosures
cb'
    C_ListModelFilterFunc -> IO (FunPtr C_ListModelFilterFunc)
mk_ListModelFilterFunc C_ListModelFilterFunc
cb'' IO (FunPtr C_ListModelFilterFunc)
-> (FunPtr C_ListModelFilterFunc
    -> IO (GClosure C_ListModelFilterFunc))
-> IO (GClosure C_ListModelFilterFunc)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ListModelFilterFunc -> IO (GClosure C_ListModelFilterFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ListModelFilterFunc` into a `C_ListModelFilterFunc`.
wrap_ListModelFilterFunc :: 
    Maybe (Ptr (FunPtr C_ListModelFilterFunc)) ->
    ListModelFilterFunc_WithClosures ->
    C_ListModelFilterFunc
wrap_ListModelFilterFunc :: Maybe (Ptr (FunPtr C_ListModelFilterFunc))
-> ListModelFilterFunc_WithClosures -> C_ListModelFilterFunc
wrap_ListModelFilterFunc Maybe (Ptr (FunPtr C_ListModelFilterFunc))
gi'funptrptr ListModelFilterFunc_WithClosures
gi'cb Ptr Object
object Ptr ()
userData = do
    Object
object' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
GObject.Object.Object) Ptr Object
object
    Bool
result <- ListModelFilterFunc_WithClosures
gi'cb  Object
object' Ptr ()
userData
    Maybe (Ptr (FunPtr C_ListModelFilterFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ListModelFilterFunc))
gi'funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
result
    CInt -> IO CInt
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback DirectoryModelVisibleFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "self"
          , argType =
              TInterface Name { namespace = "Dazzle" , name = "DirectoryModel" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "directory"
          , argType = TInterface Name { namespace = "Gio" , name = "File" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "file_info"
          , argType =
              TInterface Name { namespace = "Gio" , name = "FileInfo" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = True
          , 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_DirectoryModelVisibleFunc =
    Ptr Dazzle.DirectoryModel.DirectoryModel ->
    Ptr Gio.File.File ->
    Ptr Gio.FileInfo.FileInfo ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Dazzle" , name = "DirectoryModel" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "directory"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "file_info"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "FileInfo" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_DirectoryModelVisibleFunc :: FunPtr C_DirectoryModelVisibleFunc -> C_DirectoryModelVisibleFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_DirectoryModelVisibleFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Dazzle.DirectoryModel.IsDirectoryModel a, Gio.File.IsFile b, Gio.FileInfo.IsFileInfo c) =>
    FunPtr C_DirectoryModelVisibleFunc
    -> a
    -> b
    -> c
    -> Ptr ()
    -> m Bool
dynamic_DirectoryModelVisibleFunc :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsDirectoryModel a, IsFile b,
 IsFileInfo c) =>
FunPtr C_DirectoryModelVisibleFunc
-> a -> b -> c -> Ptr () -> m Bool
dynamic_DirectoryModelVisibleFunc FunPtr C_DirectoryModelVisibleFunc
__funPtr a
self b
directory c
fileInfo Ptr ()
userData = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr DirectoryModel
self' <- a -> IO (Ptr DirectoryModel)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr File
directory' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
directory
    Ptr FileInfo
fileInfo' <- c -> IO (Ptr FileInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
fileInfo
    CInt
result <- (FunPtr C_DirectoryModelVisibleFunc -> C_DirectoryModelVisibleFunc
__dynamic_C_DirectoryModelVisibleFunc FunPtr C_DirectoryModelVisibleFunc
__funPtr) Ptr DirectoryModel
self' Ptr File
directory' Ptr FileInfo
fileInfo' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
directory
    c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr c
fileInfo
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | /No description available in the introspection data./
type DirectoryModelVisibleFunc =
    Dazzle.DirectoryModel.DirectoryModel
    -> Gio.File.File
    -> Gio.FileInfo.FileInfo
    -> IO Bool

-- | A convenience synonym for @`Nothing` :: `Maybe` `DirectoryModelVisibleFunc`@.
noDirectoryModelVisibleFunc :: Maybe DirectoryModelVisibleFunc
noDirectoryModelVisibleFunc :: Maybe DirectoryModelVisibleFunc
noDirectoryModelVisibleFunc = Maybe DirectoryModelVisibleFunc
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type DirectoryModelVisibleFunc_WithClosures =
    Dazzle.DirectoryModel.DirectoryModel
    -> Gio.File.File
    -> Gio.FileInfo.FileInfo
    -> Ptr ()
    -> IO Bool

-- | A convenience synonym for @`Nothing` :: `Maybe` `DirectoryModelVisibleFunc_WithClosures`@.
noDirectoryModelVisibleFunc_WithClosures :: Maybe DirectoryModelVisibleFunc_WithClosures
noDirectoryModelVisibleFunc_WithClosures :: Maybe DirectoryModelVisibleFunc_WithClosures
noDirectoryModelVisibleFunc_WithClosures = Maybe DirectoryModelVisibleFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_DirectoryModelVisibleFunc :: DirectoryModelVisibleFunc -> DirectoryModelVisibleFunc_WithClosures
drop_closures_DirectoryModelVisibleFunc :: DirectoryModelVisibleFunc -> DirectoryModelVisibleFunc_WithClosures
drop_closures_DirectoryModelVisibleFunc DirectoryModelVisibleFunc
_f DirectoryModel
self File
directory FileInfo
fileInfo Ptr ()
_ = DirectoryModelVisibleFunc
_f DirectoryModel
self File
directory FileInfo
fileInfo

-- | Wrap the callback into a `GClosure`.
genClosure_DirectoryModelVisibleFunc :: MonadIO m => DirectoryModelVisibleFunc -> m (GClosure C_DirectoryModelVisibleFunc)
genClosure_DirectoryModelVisibleFunc :: forall (m :: * -> *).
MonadIO m =>
DirectoryModelVisibleFunc
-> m (GClosure C_DirectoryModelVisibleFunc)
genClosure_DirectoryModelVisibleFunc DirectoryModelVisibleFunc
cb = IO (GClosure C_DirectoryModelVisibleFunc)
-> m (GClosure C_DirectoryModelVisibleFunc)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DirectoryModelVisibleFunc)
 -> m (GClosure C_DirectoryModelVisibleFunc))
-> IO (GClosure C_DirectoryModelVisibleFunc)
-> m (GClosure C_DirectoryModelVisibleFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: DirectoryModelVisibleFunc_WithClosures
cb' = DirectoryModelVisibleFunc -> DirectoryModelVisibleFunc_WithClosures
drop_closures_DirectoryModelVisibleFunc DirectoryModelVisibleFunc
cb
    let cb'' :: C_DirectoryModelVisibleFunc
cb'' = Maybe (Ptr (FunPtr C_DirectoryModelVisibleFunc))
-> DirectoryModelVisibleFunc_WithClosures
-> C_DirectoryModelVisibleFunc
wrap_DirectoryModelVisibleFunc Maybe (Ptr (FunPtr C_DirectoryModelVisibleFunc))
forall a. Maybe a
Nothing DirectoryModelVisibleFunc_WithClosures
cb'
    C_DirectoryModelVisibleFunc
-> IO (FunPtr C_DirectoryModelVisibleFunc)
mk_DirectoryModelVisibleFunc C_DirectoryModelVisibleFunc
cb'' IO (FunPtr C_DirectoryModelVisibleFunc)
-> (FunPtr C_DirectoryModelVisibleFunc
    -> IO (GClosure C_DirectoryModelVisibleFunc))
-> IO (GClosure C_DirectoryModelVisibleFunc)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DirectoryModelVisibleFunc
-> IO (GClosure C_DirectoryModelVisibleFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `DirectoryModelVisibleFunc` into a `C_DirectoryModelVisibleFunc`.
wrap_DirectoryModelVisibleFunc :: 
    Maybe (Ptr (FunPtr C_DirectoryModelVisibleFunc)) ->
    DirectoryModelVisibleFunc_WithClosures ->
    C_DirectoryModelVisibleFunc
wrap_DirectoryModelVisibleFunc :: Maybe (Ptr (FunPtr C_DirectoryModelVisibleFunc))
-> DirectoryModelVisibleFunc_WithClosures
-> C_DirectoryModelVisibleFunc
wrap_DirectoryModelVisibleFunc Maybe (Ptr (FunPtr C_DirectoryModelVisibleFunc))
gi'funptrptr DirectoryModelVisibleFunc_WithClosures
gi'cb Ptr DirectoryModel
self Ptr File
directory Ptr FileInfo
fileInfo Ptr ()
userData = do
    DirectoryModel
self' <- ((ManagedPtr DirectoryModel -> DirectoryModel)
-> Ptr DirectoryModel -> IO DirectoryModel
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr DirectoryModel -> DirectoryModel
Dazzle.DirectoryModel.DirectoryModel) Ptr DirectoryModel
self
    File
directory' <- ((ManagedPtr File -> File) -> Ptr File -> IO File
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr File -> File
Gio.File.File) Ptr File
directory
    FileInfo
fileInfo' <- ((ManagedPtr FileInfo -> FileInfo) -> Ptr FileInfo -> IO FileInfo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr FileInfo -> FileInfo
Gio.FileInfo.FileInfo) Ptr FileInfo
fileInfo
    Bool
result <- DirectoryModelVisibleFunc_WithClosures
gi'cb  DirectoryModel
self' File
directory' FileInfo
fileInfo' Ptr ()
userData
    Maybe (Ptr (FunPtr C_DirectoryModelVisibleFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_DirectoryModelVisibleFunc))
gi'funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
result
    CInt -> IO CInt
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback CounterForeachFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "counter"
          , argType =
              TInterface Name { namespace = "Dazzle" , name = "Counter" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the counter." , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "data supplied to dzl_counter_arena_foreach()."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , argCallbackUserData = True
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Function prototype for callbacks provided to dzl_counter_arena_foreach()."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_CounterForeachFunc =
    Ptr Dazzle.Counter.Counter ->
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "counter"
--           , argType =
--               TInterface Name { namespace = "Dazzle" , name = "Counter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the counter." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "data supplied to dzl_counter_arena_foreach()."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_CounterForeachFunc :: FunPtr C_CounterForeachFunc -> C_CounterForeachFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_CounterForeachFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_CounterForeachFunc
    -> Dazzle.Counter.Counter
    -- ^ /@counter@/: the counter.
    -> Ptr ()
    -- ^ /@userData@/: data supplied to 'GI.Dazzle.Structs.CounterArena.counterArenaForeach'.
    -> m ()
dynamic_CounterForeachFunc :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_CounterForeachFunc -> Counter -> Ptr () -> m ()
dynamic_CounterForeachFunc FunPtr C_CounterForeachFunc
__funPtr Counter
counter Ptr ()
userData = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Counter
counter' <- Counter -> IO (Ptr Counter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Counter
counter
    (FunPtr C_CounterForeachFunc -> C_CounterForeachFunc
__dynamic_C_CounterForeachFunc FunPtr C_CounterForeachFunc
__funPtr) Ptr Counter
counter' Ptr ()
userData
    Counter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Counter
counter
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | Function prototype for callbacks provided to 'GI.Dazzle.Structs.CounterArena.counterArenaForeach'.
type CounterForeachFunc =
    Dazzle.Counter.Counter
    -- ^ /@counter@/: the counter.
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `CounterForeachFunc`@.
noCounterForeachFunc :: Maybe CounterForeachFunc
noCounterForeachFunc :: Maybe (Counter -> IO ())
noCounterForeachFunc = Maybe (Counter -> IO ())
forall a. Maybe a
Nothing

-- | Function prototype for callbacks provided to 'GI.Dazzle.Structs.CounterArena.counterArenaForeach'.
type CounterForeachFunc_WithClosures =
    Dazzle.Counter.Counter
    -- ^ /@counter@/: the counter.
    -> Ptr ()
    -- ^ /@userData@/: data supplied to 'GI.Dazzle.Structs.CounterArena.counterArenaForeach'.
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `CounterForeachFunc_WithClosures`@.
noCounterForeachFunc_WithClosures :: Maybe CounterForeachFunc_WithClosures
noCounterForeachFunc_WithClosures :: Maybe CounterForeachFunc_WithClosures
noCounterForeachFunc_WithClosures = Maybe CounterForeachFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_CounterForeachFunc :: CounterForeachFunc -> CounterForeachFunc_WithClosures
drop_closures_CounterForeachFunc :: (Counter -> IO ()) -> CounterForeachFunc_WithClosures
drop_closures_CounterForeachFunc Counter -> IO ()
_f Counter
counter Ptr ()
_ = Counter -> IO ()
_f Counter
counter

-- | Wrap the callback into a `GClosure`.
genClosure_CounterForeachFunc :: MonadIO m => CounterForeachFunc -> m (GClosure C_CounterForeachFunc)
genClosure_CounterForeachFunc :: forall (m :: * -> *).
MonadIO m =>
(Counter -> IO ()) -> m (GClosure C_CounterForeachFunc)
genClosure_CounterForeachFunc Counter -> IO ()
cb = IO (GClosure C_CounterForeachFunc)
-> m (GClosure C_CounterForeachFunc)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_CounterForeachFunc)
 -> m (GClosure C_CounterForeachFunc))
-> IO (GClosure C_CounterForeachFunc)
-> m (GClosure C_CounterForeachFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: CounterForeachFunc_WithClosures
cb' = (Counter -> IO ()) -> CounterForeachFunc_WithClosures
drop_closures_CounterForeachFunc Counter -> IO ()
cb
    let cb'' :: C_CounterForeachFunc
cb'' = Maybe (Ptr (FunPtr C_CounterForeachFunc))
-> CounterForeachFunc_WithClosures -> C_CounterForeachFunc
wrap_CounterForeachFunc Maybe (Ptr (FunPtr C_CounterForeachFunc))
forall a. Maybe a
Nothing CounterForeachFunc_WithClosures
cb'
    C_CounterForeachFunc -> IO (FunPtr C_CounterForeachFunc)
mk_CounterForeachFunc C_CounterForeachFunc
cb'' IO (FunPtr C_CounterForeachFunc)
-> (FunPtr C_CounterForeachFunc
    -> IO (GClosure C_CounterForeachFunc))
-> IO (GClosure C_CounterForeachFunc)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_CounterForeachFunc -> IO (GClosure C_CounterForeachFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `CounterForeachFunc` into a `C_CounterForeachFunc`.
wrap_CounterForeachFunc :: 
    Maybe (Ptr (FunPtr C_CounterForeachFunc)) ->
    CounterForeachFunc_WithClosures ->
    C_CounterForeachFunc
wrap_CounterForeachFunc :: Maybe (Ptr (FunPtr C_CounterForeachFunc))
-> CounterForeachFunc_WithClosures -> C_CounterForeachFunc
wrap_CounterForeachFunc Maybe (Ptr (FunPtr C_CounterForeachFunc))
gi'funptrptr CounterForeachFunc_WithClosures
gi'cb Ptr Counter
counter Ptr ()
userData = do
    Counter
counter' <- ((ManagedPtr Counter -> Counter) -> Ptr Counter -> IO Counter
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Counter -> Counter
Dazzle.Counter.Counter) Ptr Counter
counter
    CounterForeachFunc_WithClosures
gi'cb  Counter
counter' Ptr ()
userData
    Maybe (Ptr (FunPtr C_CounterForeachFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_CounterForeachFunc))
gi'funptrptr