-- | 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.GdkPixbuf.Callbacks
    ( 

 -- * Signals


-- ** PixbufDestroyNotify #signal:PixbufDestroyNotify#

    C_PixbufDestroyNotify                   ,
    PixbufDestroyNotify                     ,
    PixbufDestroyNotify_WithClosures        ,
    drop_closures_PixbufDestroyNotify       ,
    dynamic_PixbufDestroyNotify             ,
    genClosure_PixbufDestroyNotify          ,
    mk_PixbufDestroyNotify                  ,
    noPixbufDestroyNotify                   ,
    noPixbufDestroyNotify_WithClosures      ,
    wrap_PixbufDestroyNotify                ,


-- ** PixbufModuleFillInfoFunc #signal:PixbufModuleFillInfoFunc#

    C_PixbufModuleFillInfoFunc              ,
    PixbufModuleFillInfoFunc                ,
    dynamic_PixbufModuleFillInfoFunc        ,
    genClosure_PixbufModuleFillInfoFunc     ,
    mk_PixbufModuleFillInfoFunc             ,
    noPixbufModuleFillInfoFunc              ,
    wrap_PixbufModuleFillInfoFunc           ,


-- ** PixbufModuleFillVtableFunc #signal:PixbufModuleFillVtableFunc#

    C_PixbufModuleFillVtableFunc            ,
    PixbufModuleFillVtableFunc              ,
    dynamic_PixbufModuleFillVtableFunc      ,
    genClosure_PixbufModuleFillVtableFunc   ,
    mk_PixbufModuleFillVtableFunc           ,
    noPixbufModuleFillVtableFunc            ,
    wrap_PixbufModuleFillVtableFunc         ,


-- ** PixbufModuleIsSaveOptionSupportedFieldCallback #signal:PixbufModuleIsSaveOptionSupportedFieldCallback#

    C_PixbufModuleIsSaveOptionSupportedFieldCallback,
    PixbufModuleIsSaveOptionSupportedFieldCallback,
    dynamic_PixbufModuleIsSaveOptionSupportedFieldCallback,
    genClosure_PixbufModuleIsSaveOptionSupportedFieldCallback,
    mk_PixbufModuleIsSaveOptionSupportedFieldCallback,
    noPixbufModuleIsSaveOptionSupportedFieldCallback,
    wrap_PixbufModuleIsSaveOptionSupportedFieldCallback,


-- ** PixbufModuleLoadIncrementFieldCallback #signal:PixbufModuleLoadIncrementFieldCallback#

    C_PixbufModuleLoadIncrementFieldCallback,
    PixbufModuleLoadIncrementFieldCallback  ,
    dynamic_PixbufModuleLoadIncrementFieldCallback,
    mk_PixbufModuleLoadIncrementFieldCallback,
    noPixbufModuleLoadIncrementFieldCallback,


-- ** PixbufModulePreparedFunc #signal:PixbufModulePreparedFunc#

    C_PixbufModulePreparedFunc              ,
    PixbufModulePreparedFunc                ,
    PixbufModulePreparedFunc_WithClosures   ,
    drop_closures_PixbufModulePreparedFunc  ,
    dynamic_PixbufModulePreparedFunc        ,
    genClosure_PixbufModulePreparedFunc     ,
    mk_PixbufModulePreparedFunc             ,
    noPixbufModulePreparedFunc              ,
    noPixbufModulePreparedFunc_WithClosures ,
    wrap_PixbufModulePreparedFunc           ,


-- ** PixbufModuleSaveFieldCallback #signal:PixbufModuleSaveFieldCallback#

    C_PixbufModuleSaveFieldCallback         ,
    PixbufModuleSaveFieldCallback           ,
    dynamic_PixbufModuleSaveFieldCallback   ,
    mk_PixbufModuleSaveFieldCallback        ,
    noPixbufModuleSaveFieldCallback         ,


-- ** PixbufModuleSizeFunc #signal:PixbufModuleSizeFunc#

    C_PixbufModuleSizeFunc                  ,
    PixbufModuleSizeFunc                    ,
    PixbufModuleSizeFunc_WithClosures       ,
    drop_closures_PixbufModuleSizeFunc      ,
    dynamic_PixbufModuleSizeFunc            ,
    genClosure_PixbufModuleSizeFunc         ,
    mk_PixbufModuleSizeFunc                 ,
    noPixbufModuleSizeFunc                  ,
    noPixbufModuleSizeFunc_WithClosures     ,
    wrap_PixbufModuleSizeFunc               ,


-- ** PixbufModuleStopLoadFieldCallback #signal:PixbufModuleStopLoadFieldCallback#

    C_PixbufModuleStopLoadFieldCallback     ,
    PixbufModuleStopLoadFieldCallback       ,
    dynamic_PixbufModuleStopLoadFieldCallback,
    mk_PixbufModuleStopLoadFieldCallback    ,
    noPixbufModuleStopLoadFieldCallback     ,


-- ** PixbufModuleUpdatedFunc #signal:PixbufModuleUpdatedFunc#

    C_PixbufModuleUpdatedFunc               ,
    PixbufModuleUpdatedFunc                 ,
    PixbufModuleUpdatedFunc_WithClosures    ,
    drop_closures_PixbufModuleUpdatedFunc   ,
    dynamic_PixbufModuleUpdatedFunc         ,
    genClosure_PixbufModuleUpdatedFunc      ,
    mk_PixbufModuleUpdatedFunc              ,
    noPixbufModuleUpdatedFunc               ,
    noPixbufModuleUpdatedFunc_WithClosures  ,
    wrap_PixbufModuleUpdatedFunc            ,


-- ** PixbufSaveFunc #signal:PixbufSaveFunc#

    C_PixbufSaveFunc                        ,
    PixbufSaveFunc                          ,
    PixbufSaveFunc_WithClosures             ,
    drop_closures_PixbufSaveFunc            ,
    dynamic_PixbufSaveFunc                  ,
    genClosure_PixbufSaveFunc               ,
    mk_PixbufSaveFunc                       ,
    noPixbufSaveFunc                        ,
    noPixbufSaveFunc_WithClosures           ,
    wrap_PixbufSaveFunc                     ,




    ) 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.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.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 {-# SOURCE #-} qualified GI.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf
import {-# SOURCE #-} qualified GI.GdkPixbuf.Objects.PixbufAnimation as GdkPixbuf.PixbufAnimation
import {-# SOURCE #-} qualified GI.GdkPixbuf.Structs.PixbufFormat as GdkPixbuf.PixbufFormat
import {-# SOURCE #-} qualified GI.GdkPixbuf.Structs.PixbufModule as GdkPixbuf.PixbufModule

-- callback PixbufSaveFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText = Just "`TRUE` if successful, `FALSE` otherwise"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "buf"
          , argType = TCArray False (-1) 1 (TBasicType TUInt8)
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "bytes to be written."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "count"
          , argType = TBasicType TUInt64
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "number of bytes in @buf."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "error"
          , argType = TError
          , direction = DirectionOut
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "A location to return an error."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferEverything
          }
      , Arg
          { argCName = "data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText =
                    Just "user data passed to gdk_pixbuf_save_to_callback()."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 3
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Save functions used by [method@GdkPixbuf.Pixbuf.save_to_callback].\n\nThis function is called once for each block of bytes that is \"written\"\nby `gdk_pixbuf_save_to_callback()`.\n\nIf successful it should return `TRUE`; if an error occurs it should set\n`error` and return `FALSE`, in which case `gdk_pixbuf_save_to_callback()`\nwill fail with the same error."
        , sinceVersion = Just "2.4"
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_PixbufSaveFunc =
    Ptr Word8 ->
    Word64 ->
    Ptr (Ptr GError) ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "buf"
--           , argType = TCArray False (-1) 1 (TBasicType TUInt8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "bytes to be written."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "count"
--           , argType = TBasicType TUInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "number of bytes in @buf."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "error"
--           , argType = TError
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A location to return an error."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "user data passed to gdk_pixbuf_save_to_callback()."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "count"
--              , argType = TBasicType TUInt64
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "number of bytes in @buf."
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PixbufSaveFunc :: FunPtr C_PixbufSaveFunc -> C_PixbufSaveFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PixbufSaveFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_PixbufSaveFunc
    -> ByteString
    -- ^ /@buf@/: bytes to be written.
    -> Ptr ()
    -- ^ /@data@/: user data passed to @/gdk_pixbuf_save_to_callback()/@.
    -> m ((Bool, GError))
    -- ^ __Returns:__ @TRUE@ if successful, @FALSE@ otherwise
dynamic_PixbufSaveFunc :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_PixbufSaveFunc -> ByteString -> Ptr () -> m (Bool, GError)
dynamic_PixbufSaveFunc FunPtr C_PixbufSaveFunc
__funPtr ByteString
buf Ptr ()
data_ = IO (Bool, GError) -> m (Bool, GError)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, GError) -> m (Bool, GError))
-> IO (Bool, GError) -> m (Bool, GError)
forall a b. (a -> b) -> a -> b
$ do
    let count :: Word64
count = Int -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word64) -> Int -> Word64
forall a b. (a -> b) -> a -> b
$ ByteString -> Int
B.length ByteString
buf
    Ptr Word8
buf' <- ByteString -> IO (Ptr Word8)
packByteString ByteString
buf
    Ptr (Ptr GError)
error_ <- IO (Ptr (Ptr GError))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr GError))
    CInt
result <- (FunPtr C_PixbufSaveFunc -> C_PixbufSaveFunc
__dynamic_C_PixbufSaveFunc FunPtr C_PixbufSaveFunc
__funPtr) Ptr Word8
buf' Word64
count Ptr (Ptr GError)
error_ Ptr ()
data_
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Ptr GError
error_' <- Ptr (Ptr GError) -> IO (Ptr GError)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr GError)
error_
    GError
error_'' <- ((ManagedPtr GError -> GError) -> Ptr GError -> IO GError
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr GError -> GError
GError) Ptr GError
error_'
    Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
buf'
    Ptr (Ptr GError) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr GError)
error_
    (Bool, GError) -> IO (Bool, GError)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', GError
error_'')

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

-- | Save functions used by t'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf'.@/save_to_callback/@().
-- 
-- This function is called once for each block of bytes that is \"written\"
-- by @gdk_pixbuf_save_to_callback()@.
-- 
-- If successful it should return @TRUE@; if an error occurs it should set
-- @error@ and return @FALSE@, in which case @gdk_pixbuf_save_to_callback()@
-- will fail with the same error.
-- 
-- /Since: 2.4/
type PixbufSaveFunc =
    ByteString
    -- ^ /@buf@/: bytes to be written.
    -> IO ((Bool, GError))
    -- ^ __Returns:__ @TRUE@ if successful, @FALSE@ otherwise

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufSaveFunc`@.
noPixbufSaveFunc :: Maybe PixbufSaveFunc
noPixbufSaveFunc :: Maybe PixbufSaveFunc
noPixbufSaveFunc = Maybe PixbufSaveFunc
forall a. Maybe a
Nothing

-- | Save functions used by t'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf'.@/save_to_callback/@().
-- 
-- This function is called once for each block of bytes that is \"written\"
-- by @gdk_pixbuf_save_to_callback()@.
-- 
-- If successful it should return @TRUE@; if an error occurs it should set
-- @error@ and return @FALSE@, in which case @gdk_pixbuf_save_to_callback()@
-- will fail with the same error.
-- 
-- /Since: 2.4/
type PixbufSaveFunc_WithClosures =
    ByteString
    -- ^ /@buf@/: bytes to be written.
    -> Ptr ()
    -- ^ /@data@/: user data passed to @/gdk_pixbuf_save_to_callback()/@.
    -> IO ((Bool, GError))
    -- ^ __Returns:__ @TRUE@ if successful, @FALSE@ otherwise

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufSaveFunc_WithClosures`@.
noPixbufSaveFunc_WithClosures :: Maybe PixbufSaveFunc_WithClosures
noPixbufSaveFunc_WithClosures :: Maybe PixbufSaveFunc_WithClosures
noPixbufSaveFunc_WithClosures = Maybe PixbufSaveFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_PixbufSaveFunc :: PixbufSaveFunc -> PixbufSaveFunc_WithClosures
drop_closures_PixbufSaveFunc :: PixbufSaveFunc -> PixbufSaveFunc_WithClosures
drop_closures_PixbufSaveFunc PixbufSaveFunc
_f ByteString
buf Ptr ()
_ = PixbufSaveFunc
_f ByteString
buf

-- | Wrap the callback into a `GClosure`.
genClosure_PixbufSaveFunc :: MonadIO m => PixbufSaveFunc -> m (GClosure C_PixbufSaveFunc)
genClosure_PixbufSaveFunc :: forall (m :: * -> *).
MonadIO m =>
PixbufSaveFunc -> m (GClosure C_PixbufSaveFunc)
genClosure_PixbufSaveFunc PixbufSaveFunc
cb = IO (GClosure C_PixbufSaveFunc) -> m (GClosure C_PixbufSaveFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PixbufSaveFunc) -> m (GClosure C_PixbufSaveFunc))
-> IO (GClosure C_PixbufSaveFunc) -> m (GClosure C_PixbufSaveFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: PixbufSaveFunc_WithClosures
cb' = PixbufSaveFunc -> PixbufSaveFunc_WithClosures
drop_closures_PixbufSaveFunc PixbufSaveFunc
cb
    let cb'' :: C_PixbufSaveFunc
cb'' = Maybe (Ptr (FunPtr C_PixbufSaveFunc))
-> PixbufSaveFunc_WithClosures -> C_PixbufSaveFunc
wrap_PixbufSaveFunc Maybe (Ptr (FunPtr C_PixbufSaveFunc))
forall a. Maybe a
Nothing PixbufSaveFunc_WithClosures
cb'
    C_PixbufSaveFunc -> IO (FunPtr C_PixbufSaveFunc)
mk_PixbufSaveFunc C_PixbufSaveFunc
cb'' IO (FunPtr C_PixbufSaveFunc)
-> (FunPtr C_PixbufSaveFunc -> IO (GClosure C_PixbufSaveFunc))
-> IO (GClosure C_PixbufSaveFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PixbufSaveFunc -> IO (GClosure C_PixbufSaveFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PixbufSaveFunc` into a `C_PixbufSaveFunc`.
wrap_PixbufSaveFunc :: 
    Maybe (Ptr (FunPtr C_PixbufSaveFunc)) ->
    PixbufSaveFunc_WithClosures ->
    C_PixbufSaveFunc
wrap_PixbufSaveFunc :: Maybe (Ptr (FunPtr C_PixbufSaveFunc))
-> PixbufSaveFunc_WithClosures -> C_PixbufSaveFunc
wrap_PixbufSaveFunc Maybe (Ptr (FunPtr C_PixbufSaveFunc))
gi'funptrptr PixbufSaveFunc_WithClosures
gi'cb Ptr Word8
buf Word64
count Ptr (Ptr GError)
error_ Ptr ()
data_ = do
    ByteString
buf' <- (Word64 -> Ptr Word8 -> IO ByteString
forall a. Integral a => a -> Ptr Word8 -> IO ByteString
unpackByteStringWithLength Word64
count) Ptr Word8
buf
    (Bool
result, GError
outerror_) <- PixbufSaveFunc_WithClosures
gi'cb  ByteString
buf' Ptr ()
data_
    Ptr GError
outerror_' <- GError -> IO (Ptr GError)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed GError
outerror_
    Ptr (Ptr GError) -> Ptr GError -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (Ptr GError)
error_ Ptr GError
outerror_'
    Maybe (Ptr (FunPtr C_PixbufSaveFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PixbufSaveFunc))
gi'funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback PixbufModuleUpdatedFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "pixbuf"
          , argType =
              TInterface Name { namespace = "GdkPixbuf" , name = "Pixbuf" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText =
                    Just "the #GdkPixbuf that is currently being loaded."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "x"
          , argType = TBasicType TInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the X origin of the updated area."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "y"
          , argType = TBasicType TInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the Y origin of the updated area."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "width"
          , argType = TBasicType TInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the width of the updated area."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "height"
          , argType = TBasicType TInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the height of the updated area."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "the loader." , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 5
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Defines the type of the function that gets called every time a region\nof @pixbuf is updated.\n\n#GdkPixbufLoader uses a function of this type to emit the\n\"<link linkend=\"GdkPixbufLoader-area-updated\">area_updated</link>\"\nsignal."
        , sinceVersion = Just "2.2"
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_PixbufModuleUpdatedFunc =
    Ptr GdkPixbuf.Pixbuf.Pixbuf ->
    Int32 ->
    Int32 ->
    Int32 ->
    Int32 ->
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "pixbuf"
--           , argType =
--               TInterface Name { namespace = "GdkPixbuf" , name = "Pixbuf" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the #GdkPixbuf that is currently being loaded."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the X origin of the updated area."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the Y origin of the updated area."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the width of the updated area."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the height of the updated area."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the loader." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 5
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PixbufModuleUpdatedFunc :: FunPtr C_PixbufModuleUpdatedFunc -> C_PixbufModuleUpdatedFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PixbufModuleUpdatedFunc ::
    (B.CallStack.HasCallStack, MonadIO m, GdkPixbuf.Pixbuf.IsPixbuf a) =>
    FunPtr C_PixbufModuleUpdatedFunc
    -> a
    -- ^ /@pixbuf@/: the t'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf' that is currently being loaded.
    -> Int32
    -- ^ /@x@/: the X origin of the updated area.
    -> Int32
    -- ^ /@y@/: the Y origin of the updated area.
    -> Int32
    -- ^ /@width@/: the width of the updated area.
    -> Int32
    -- ^ /@height@/: the height of the updated area.
    -> Ptr ()
    -- ^ /@userData@/: the loader.
    -> m ()
dynamic_PixbufModuleUpdatedFunc :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
FunPtr C_PixbufModuleUpdatedFunc
-> a -> Int32 -> Int32 -> Int32 -> Int32 -> Ptr () -> m ()
dynamic_PixbufModuleUpdatedFunc FunPtr C_PixbufModuleUpdatedFunc
__funPtr a
pixbuf Int32
x Int32
y Int32
width Int32
height Ptr ()
userData = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
    (FunPtr C_PixbufModuleUpdatedFunc -> C_PixbufModuleUpdatedFunc
__dynamic_C_PixbufModuleUpdatedFunc FunPtr C_PixbufModuleUpdatedFunc
__funPtr) Ptr Pixbuf
pixbuf' Int32
x Int32
y Int32
width Int32
height Ptr ()
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | Defines the type of the function that gets called every time a region
-- of /@pixbuf@/ is updated.
-- 
-- t'GI.GdkPixbuf.Objects.PixbufLoader.PixbufLoader' uses a function of this type to emit the
-- \"\<link linkend=\"GdkPixbufLoader-area-updated\">area_updated\<\/link>\"
-- signal.
-- 
-- /Since: 2.2/
type PixbufModuleUpdatedFunc =
    GdkPixbuf.Pixbuf.Pixbuf
    -- ^ /@pixbuf@/: the t'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf' that is currently being loaded.
    -> Int32
    -- ^ /@x@/: the X origin of the updated area.
    -> Int32
    -- ^ /@y@/: the Y origin of the updated area.
    -> Int32
    -- ^ /@width@/: the width of the updated area.
    -> Int32
    -- ^ /@height@/: the height of the updated area.
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufModuleUpdatedFunc`@.
noPixbufModuleUpdatedFunc :: Maybe PixbufModuleUpdatedFunc
noPixbufModuleUpdatedFunc :: Maybe PixbufModuleUpdatedFunc
noPixbufModuleUpdatedFunc = Maybe PixbufModuleUpdatedFunc
forall a. Maybe a
Nothing

-- | Defines the type of the function that gets called every time a region
-- of /@pixbuf@/ is updated.
-- 
-- t'GI.GdkPixbuf.Objects.PixbufLoader.PixbufLoader' uses a function of this type to emit the
-- \"\<link linkend=\"GdkPixbufLoader-area-updated\">area_updated\<\/link>\"
-- signal.
-- 
-- /Since: 2.2/
type PixbufModuleUpdatedFunc_WithClosures =
    GdkPixbuf.Pixbuf.Pixbuf
    -- ^ /@pixbuf@/: the t'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf' that is currently being loaded.
    -> Int32
    -- ^ /@x@/: the X origin of the updated area.
    -> Int32
    -- ^ /@y@/: the Y origin of the updated area.
    -> Int32
    -- ^ /@width@/: the width of the updated area.
    -> Int32
    -- ^ /@height@/: the height of the updated area.
    -> Ptr ()
    -- ^ /@userData@/: the loader.
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufModuleUpdatedFunc_WithClosures`@.
noPixbufModuleUpdatedFunc_WithClosures :: Maybe PixbufModuleUpdatedFunc_WithClosures
noPixbufModuleUpdatedFunc_WithClosures :: Maybe PixbufModuleUpdatedFunc_WithClosures
noPixbufModuleUpdatedFunc_WithClosures = Maybe PixbufModuleUpdatedFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_PixbufModuleUpdatedFunc :: PixbufModuleUpdatedFunc -> PixbufModuleUpdatedFunc_WithClosures
drop_closures_PixbufModuleUpdatedFunc :: PixbufModuleUpdatedFunc -> PixbufModuleUpdatedFunc_WithClosures
drop_closures_PixbufModuleUpdatedFunc PixbufModuleUpdatedFunc
_f Pixbuf
pixbuf Int32
x Int32
y Int32
width Int32
height Ptr ()
_ = PixbufModuleUpdatedFunc
_f Pixbuf
pixbuf Int32
x Int32
y Int32
width Int32
height

-- | Wrap the callback into a `GClosure`.
genClosure_PixbufModuleUpdatedFunc :: MonadIO m => PixbufModuleUpdatedFunc -> m (GClosure C_PixbufModuleUpdatedFunc)
genClosure_PixbufModuleUpdatedFunc :: forall (m :: * -> *).
MonadIO m =>
PixbufModuleUpdatedFunc -> m (GClosure C_PixbufModuleUpdatedFunc)
genClosure_PixbufModuleUpdatedFunc PixbufModuleUpdatedFunc
cb = IO (GClosure C_PixbufModuleUpdatedFunc)
-> m (GClosure C_PixbufModuleUpdatedFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PixbufModuleUpdatedFunc)
 -> m (GClosure C_PixbufModuleUpdatedFunc))
-> IO (GClosure C_PixbufModuleUpdatedFunc)
-> m (GClosure C_PixbufModuleUpdatedFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: PixbufModuleUpdatedFunc_WithClosures
cb' = PixbufModuleUpdatedFunc -> PixbufModuleUpdatedFunc_WithClosures
drop_closures_PixbufModuleUpdatedFunc PixbufModuleUpdatedFunc
cb
    let cb'' :: C_PixbufModuleUpdatedFunc
cb'' = Maybe (Ptr (FunPtr C_PixbufModuleUpdatedFunc))
-> PixbufModuleUpdatedFunc_WithClosures
-> C_PixbufModuleUpdatedFunc
wrap_PixbufModuleUpdatedFunc Maybe (Ptr (FunPtr C_PixbufModuleUpdatedFunc))
forall a. Maybe a
Nothing PixbufModuleUpdatedFunc_WithClosures
cb'
    C_PixbufModuleUpdatedFunc -> IO (FunPtr C_PixbufModuleUpdatedFunc)
mk_PixbufModuleUpdatedFunc C_PixbufModuleUpdatedFunc
cb'' IO (FunPtr C_PixbufModuleUpdatedFunc)
-> (FunPtr C_PixbufModuleUpdatedFunc
    -> IO (GClosure C_PixbufModuleUpdatedFunc))
-> IO (GClosure C_PixbufModuleUpdatedFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PixbufModuleUpdatedFunc
-> IO (GClosure C_PixbufModuleUpdatedFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PixbufModuleUpdatedFunc` into a `C_PixbufModuleUpdatedFunc`.
wrap_PixbufModuleUpdatedFunc :: 
    Maybe (Ptr (FunPtr C_PixbufModuleUpdatedFunc)) ->
    PixbufModuleUpdatedFunc_WithClosures ->
    C_PixbufModuleUpdatedFunc
wrap_PixbufModuleUpdatedFunc :: Maybe (Ptr (FunPtr C_PixbufModuleUpdatedFunc))
-> PixbufModuleUpdatedFunc_WithClosures
-> C_PixbufModuleUpdatedFunc
wrap_PixbufModuleUpdatedFunc Maybe (Ptr (FunPtr C_PixbufModuleUpdatedFunc))
gi'funptrptr PixbufModuleUpdatedFunc_WithClosures
gi'cb Ptr Pixbuf
pixbuf Int32
x Int32
y Int32
width Int32
height Ptr ()
userData = do
    Pixbuf
pixbuf' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pixbuf -> Pixbuf
GdkPixbuf.Pixbuf.Pixbuf) Ptr Pixbuf
pixbuf
    PixbufModuleUpdatedFunc_WithClosures
gi'cb  Pixbuf
pixbuf' Int32
x Int32
y Int32
width Int32
height Ptr ()
userData
    Maybe (Ptr (FunPtr C_PixbufModuleUpdatedFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PixbufModuleUpdatedFunc))
gi'funptrptr


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

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

foreign import ccall "dynamic" __dynamic_C_PixbufModuleStopLoadFieldCallback :: FunPtr C_PixbufModuleStopLoadFieldCallback -> C_PixbufModuleStopLoadFieldCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PixbufModuleStopLoadFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_PixbufModuleStopLoadFieldCallback
    -> Ptr ()
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
dynamic_PixbufModuleStopLoadFieldCallback :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_PixbufModuleStopLoadFieldCallback -> Ptr () -> m ()
dynamic_PixbufModuleStopLoadFieldCallback FunPtr C_PixbufModuleStopLoadFieldCallback
__funPtr Ptr ()
context = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ (FunPtr C_PixbufModuleStopLoadFieldCallback
-> C_PixbufModuleStopLoadFieldCallback
__dynamic_C_PixbufModuleStopLoadFieldCallback FunPtr C_PixbufModuleStopLoadFieldCallback
__funPtr) Ptr ()
context
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

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

-- | /No description available in the introspection data./
type PixbufModuleStopLoadFieldCallback =
    Ptr ()
    -> IO ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufModuleStopLoadFieldCallback`@.
noPixbufModuleStopLoadFieldCallback :: Maybe PixbufModuleStopLoadFieldCallback
noPixbufModuleStopLoadFieldCallback :: Maybe PixbufModuleStopLoadFieldCallback
noPixbufModuleStopLoadFieldCallback = Maybe PixbufModuleStopLoadFieldCallback
forall a. Maybe a
Nothing

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

-- callback PixbufModuleSizeFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "width"
          , argType = TBasicType TInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText =
                    Just "pointer to a location containing the current image width"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "height"
          , argType = TBasicType TInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText =
                    Just "pointer to a location containing the current image height"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "the loader." , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 2
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Defines the type of the function that gets called once the size\nof the loaded image is known.\n\nThe function is expected to set @width and @height to the desired\nsize to which the image should be scaled. If a module has no efficient\nway to achieve the desired scaling during the loading of the image, it may\neither ignore the size request, or only approximate it - gdk-pixbuf will\nthen perform the required scaling on the completely loaded image.\n\nIf the function sets @width or @height to zero, the module should interpret\nthis as a hint that it will be closed soon and shouldn't allocate further\nresources. This convention is used to implement gdk_pixbuf_get_file_info()\nefficiently."
        , sinceVersion = Just "2.2"
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_PixbufModuleSizeFunc =
    Int32 ->
    Int32 ->
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "width"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "pointer to a location containing the current image width"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "pointer to a location containing the current image height"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the loader." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 2
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PixbufModuleSizeFunc :: FunPtr C_PixbufModuleSizeFunc -> C_PixbufModuleSizeFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PixbufModuleSizeFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_PixbufModuleSizeFunc
    -> Int32
    -- ^ /@width@/: pointer to a location containing the current image width
    -> Int32
    -- ^ /@height@/: pointer to a location containing the current image height
    -> Ptr ()
    -- ^ /@userData@/: the loader.
    -> m ()
dynamic_PixbufModuleSizeFunc :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_PixbufModuleSizeFunc -> Int32 -> Int32 -> Ptr () -> m ()
dynamic_PixbufModuleSizeFunc FunPtr C_PixbufModuleSizeFunc
__funPtr Int32
width Int32
height Ptr ()
userData = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    (FunPtr C_PixbufModuleSizeFunc -> C_PixbufModuleSizeFunc
__dynamic_C_PixbufModuleSizeFunc FunPtr C_PixbufModuleSizeFunc
__funPtr) Int32
width Int32
height Ptr ()
userData
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | Defines the type of the function that gets called once the size
-- of the loaded image is known.
-- 
-- The function is expected to set /@width@/ and /@height@/ to the desired
-- size to which the image should be scaled. If a module has no efficient
-- way to achieve the desired scaling during the loading of the image, it may
-- either ignore the size request, or only approximate it - gdk-pixbuf will
-- then perform the required scaling on the completely loaded image.
-- 
-- If the function sets /@width@/ or /@height@/ to zero, the module should interpret
-- this as a hint that it will be closed soon and shouldn\'t allocate further
-- resources. This convention is used to implement 'GI.GdkPixbuf.Objects.Pixbuf.pixbufGetFileInfo'
-- efficiently.
-- 
-- /Since: 2.2/
type PixbufModuleSizeFunc =
    Int32
    -- ^ /@width@/: pointer to a location containing the current image width
    -> Int32
    -- ^ /@height@/: pointer to a location containing the current image height
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufModuleSizeFunc`@.
noPixbufModuleSizeFunc :: Maybe PixbufModuleSizeFunc
noPixbufModuleSizeFunc :: Maybe PixbufModuleSizeFunc
noPixbufModuleSizeFunc = Maybe PixbufModuleSizeFunc
forall a. Maybe a
Nothing

-- | Defines the type of the function that gets called once the size
-- of the loaded image is known.
-- 
-- The function is expected to set /@width@/ and /@height@/ to the desired
-- size to which the image should be scaled. If a module has no efficient
-- way to achieve the desired scaling during the loading of the image, it may
-- either ignore the size request, or only approximate it - gdk-pixbuf will
-- then perform the required scaling on the completely loaded image.
-- 
-- If the function sets /@width@/ or /@height@/ to zero, the module should interpret
-- this as a hint that it will be closed soon and shouldn\'t allocate further
-- resources. This convention is used to implement 'GI.GdkPixbuf.Objects.Pixbuf.pixbufGetFileInfo'
-- efficiently.
-- 
-- /Since: 2.2/
type PixbufModuleSizeFunc_WithClosures =
    Int32
    -- ^ /@width@/: pointer to a location containing the current image width
    -> Int32
    -- ^ /@height@/: pointer to a location containing the current image height
    -> Ptr ()
    -- ^ /@userData@/: the loader.
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufModuleSizeFunc_WithClosures`@.
noPixbufModuleSizeFunc_WithClosures :: Maybe PixbufModuleSizeFunc_WithClosures
noPixbufModuleSizeFunc_WithClosures :: Maybe C_PixbufModuleSizeFunc
noPixbufModuleSizeFunc_WithClosures = Maybe C_PixbufModuleSizeFunc
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_PixbufModuleSizeFunc :: PixbufModuleSizeFunc -> PixbufModuleSizeFunc_WithClosures
drop_closures_PixbufModuleSizeFunc :: PixbufModuleSizeFunc -> C_PixbufModuleSizeFunc
drop_closures_PixbufModuleSizeFunc PixbufModuleSizeFunc
_f Int32
width Int32
height Ptr ()
_ = PixbufModuleSizeFunc
_f Int32
width Int32
height

-- | Wrap the callback into a `GClosure`.
genClosure_PixbufModuleSizeFunc :: MonadIO m => PixbufModuleSizeFunc -> m (GClosure C_PixbufModuleSizeFunc)
genClosure_PixbufModuleSizeFunc :: forall (m :: * -> *).
MonadIO m =>
PixbufModuleSizeFunc -> m (GClosure C_PixbufModuleSizeFunc)
genClosure_PixbufModuleSizeFunc PixbufModuleSizeFunc
cb = IO (GClosure C_PixbufModuleSizeFunc)
-> m (GClosure C_PixbufModuleSizeFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PixbufModuleSizeFunc)
 -> m (GClosure C_PixbufModuleSizeFunc))
-> IO (GClosure C_PixbufModuleSizeFunc)
-> m (GClosure C_PixbufModuleSizeFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PixbufModuleSizeFunc
cb' = PixbufModuleSizeFunc -> C_PixbufModuleSizeFunc
drop_closures_PixbufModuleSizeFunc PixbufModuleSizeFunc
cb
    let cb'' :: C_PixbufModuleSizeFunc
cb'' = Maybe (Ptr (FunPtr C_PixbufModuleSizeFunc))
-> C_PixbufModuleSizeFunc -> C_PixbufModuleSizeFunc
wrap_PixbufModuleSizeFunc Maybe (Ptr (FunPtr C_PixbufModuleSizeFunc))
forall a. Maybe a
Nothing C_PixbufModuleSizeFunc
cb'
    C_PixbufModuleSizeFunc -> IO (FunPtr C_PixbufModuleSizeFunc)
mk_PixbufModuleSizeFunc C_PixbufModuleSizeFunc
cb'' IO (FunPtr C_PixbufModuleSizeFunc)
-> (FunPtr C_PixbufModuleSizeFunc
    -> IO (GClosure C_PixbufModuleSizeFunc))
-> IO (GClosure C_PixbufModuleSizeFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PixbufModuleSizeFunc
-> IO (GClosure C_PixbufModuleSizeFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PixbufModuleSizeFunc` into a `C_PixbufModuleSizeFunc`.
wrap_PixbufModuleSizeFunc :: 
    Maybe (Ptr (FunPtr C_PixbufModuleSizeFunc)) ->
    PixbufModuleSizeFunc_WithClosures ->
    C_PixbufModuleSizeFunc
wrap_PixbufModuleSizeFunc :: Maybe (Ptr (FunPtr C_PixbufModuleSizeFunc))
-> C_PixbufModuleSizeFunc -> C_PixbufModuleSizeFunc
wrap_PixbufModuleSizeFunc Maybe (Ptr (FunPtr C_PixbufModuleSizeFunc))
gi'funptrptr C_PixbufModuleSizeFunc
gi'cb Int32
width Int32
height Ptr ()
userData = do
    C_PixbufModuleSizeFunc
gi'cb  Int32
width Int32
height Ptr ()
userData
    Maybe (Ptr (FunPtr C_PixbufModuleSizeFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PixbufModuleSizeFunc))
gi'funptrptr


-- callback PixbufModuleSaveFieldCallback
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "f"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "pixbuf"
          , argType =
              TInterface Name { namespace = "GdkPixbuf" , name = "Pixbuf" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "param_keys"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "param_values"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = True
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_PixbufModuleSaveFieldCallback =
    Ptr () ->
    Ptr GdkPixbuf.Pixbuf.Pixbuf ->
    CString ->
    CString ->
    Ptr (Ptr GError) ->
    IO CInt

-- Args: [ Arg
--           { argCName = "f"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "pixbuf"
--           , argType =
--               TInterface Name { namespace = "GdkPixbuf" , name = "Pixbuf" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "param_keys"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "param_values"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PixbufModuleSaveFieldCallback :: FunPtr C_PixbufModuleSaveFieldCallback -> C_PixbufModuleSaveFieldCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PixbufModuleSaveFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m, GdkPixbuf.Pixbuf.IsPixbuf a) =>
    FunPtr C_PixbufModuleSaveFieldCallback
    -> Ptr ()
    -> a
    -> T.Text
    -> T.Text
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
dynamic_PixbufModuleSaveFieldCallback :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
FunPtr C_PixbufModuleSaveFieldCallback
-> Ptr () -> a -> Text -> Text -> m ()
dynamic_PixbufModuleSaveFieldCallback FunPtr C_PixbufModuleSaveFieldCallback
__funPtr Ptr ()
f a
pixbuf Text
paramKeys Text
paramValues = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
    CString
paramKeys' <- Text -> IO CString
textToCString Text
paramKeys
    CString
paramValues' <- Text -> IO CString
textToCString Text
paramValues
    IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ (FunPtr C_PixbufModuleSaveFieldCallback
-> C_PixbufModuleSaveFieldCallback
__dynamic_C_PixbufModuleSaveFieldCallback FunPtr C_PixbufModuleSaveFieldCallback
__funPtr) Ptr ()
f Ptr Pixbuf
pixbuf' CString
paramKeys' CString
paramValues'
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
paramKeys'
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
paramValues'
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
paramKeys'
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
paramValues'
     )

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

-- | /No description available in the introspection data./
type PixbufModuleSaveFieldCallback =
    Ptr ()
    -> GdkPixbuf.Pixbuf.Pixbuf
    -> T.Text
    -> T.Text
    -> IO ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufModuleSaveFieldCallback`@.
noPixbufModuleSaveFieldCallback :: Maybe PixbufModuleSaveFieldCallback
noPixbufModuleSaveFieldCallback :: Maybe PixbufModuleSaveFieldCallback
noPixbufModuleSaveFieldCallback = Maybe PixbufModuleSaveFieldCallback
forall a. Maybe a
Nothing

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

-- callback PixbufModulePreparedFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "pixbuf"
          , argType =
              TInterface Name { namespace = "GdkPixbuf" , name = "Pixbuf" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText =
                    Just "the #GdkPixbuf that is currently being loaded."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "anim"
          , argType =
              TInterface
                Name { namespace = "GdkPixbuf" , name = "PixbufAnimation" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText =
                    Just
                      "if an animation is being loaded, the #GdkPixbufAnimation, else %NULL."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "the loader." , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 2
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Defines the type of the function that gets called once the initial\nsetup of @pixbuf is done.\n\n#GdkPixbufLoader uses a function of this type to emit the\n\"<link linkend=\"GdkPixbufLoader-area-prepared\">area_prepared</link>\"\nsignal."
        , sinceVersion = Just "2.2"
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_PixbufModulePreparedFunc =
    Ptr GdkPixbuf.Pixbuf.Pixbuf ->
    Ptr GdkPixbuf.PixbufAnimation.PixbufAnimation ->
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "pixbuf"
--           , argType =
--               TInterface Name { namespace = "GdkPixbuf" , name = "Pixbuf" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the #GdkPixbuf that is currently being loaded."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "anim"
--           , argType =
--               TInterface
--                 Name { namespace = "GdkPixbuf" , name = "PixbufAnimation" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "if an animation is being loaded, the #GdkPixbufAnimation, else %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the loader." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 2
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PixbufModulePreparedFunc :: FunPtr C_PixbufModulePreparedFunc -> C_PixbufModulePreparedFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PixbufModulePreparedFunc ::
    (B.CallStack.HasCallStack, MonadIO m, GdkPixbuf.Pixbuf.IsPixbuf a, GdkPixbuf.PixbufAnimation.IsPixbufAnimation b) =>
    FunPtr C_PixbufModulePreparedFunc
    -> a
    -- ^ /@pixbuf@/: the t'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf' that is currently being loaded.
    -> b
    -- ^ /@anim@/: if an animation is being loaded, the t'GI.GdkPixbuf.Objects.PixbufAnimation.PixbufAnimation', else 'P.Nothing'.
    -> Ptr ()
    -- ^ /@userData@/: the loader.
    -> m ()
dynamic_PixbufModulePreparedFunc :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsPixbuf a, IsPixbufAnimation b) =>
FunPtr C_PixbufModulePreparedFunc -> a -> b -> Ptr () -> m ()
dynamic_PixbufModulePreparedFunc FunPtr C_PixbufModulePreparedFunc
__funPtr a
pixbuf b
anim Ptr ()
userData = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
    Ptr PixbufAnimation
anim' <- b -> IO (Ptr PixbufAnimation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
anim
    (FunPtr C_PixbufModulePreparedFunc -> C_PixbufModulePreparedFunc
__dynamic_C_PixbufModulePreparedFunc FunPtr C_PixbufModulePreparedFunc
__funPtr) Ptr Pixbuf
pixbuf' Ptr PixbufAnimation
anim' Ptr ()
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
anim
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | Defines the type of the function that gets called once the initial
-- setup of /@pixbuf@/ is done.
-- 
-- t'GI.GdkPixbuf.Objects.PixbufLoader.PixbufLoader' uses a function of this type to emit the
-- \"\<link linkend=\"GdkPixbufLoader-area-prepared\">area_prepared\<\/link>\"
-- signal.
-- 
-- /Since: 2.2/
type PixbufModulePreparedFunc =
    GdkPixbuf.Pixbuf.Pixbuf
    -- ^ /@pixbuf@/: the t'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf' that is currently being loaded.
    -> GdkPixbuf.PixbufAnimation.PixbufAnimation
    -- ^ /@anim@/: if an animation is being loaded, the t'GI.GdkPixbuf.Objects.PixbufAnimation.PixbufAnimation', else 'P.Nothing'.
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufModulePreparedFunc`@.
noPixbufModulePreparedFunc :: Maybe PixbufModulePreparedFunc
noPixbufModulePreparedFunc :: Maybe PixbufModulePreparedFunc
noPixbufModulePreparedFunc = Maybe PixbufModulePreparedFunc
forall a. Maybe a
Nothing

-- | Defines the type of the function that gets called once the initial
-- setup of /@pixbuf@/ is done.
-- 
-- t'GI.GdkPixbuf.Objects.PixbufLoader.PixbufLoader' uses a function of this type to emit the
-- \"\<link linkend=\"GdkPixbufLoader-area-prepared\">area_prepared\<\/link>\"
-- signal.
-- 
-- /Since: 2.2/
type PixbufModulePreparedFunc_WithClosures =
    GdkPixbuf.Pixbuf.Pixbuf
    -- ^ /@pixbuf@/: the t'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf' that is currently being loaded.
    -> GdkPixbuf.PixbufAnimation.PixbufAnimation
    -- ^ /@anim@/: if an animation is being loaded, the t'GI.GdkPixbuf.Objects.PixbufAnimation.PixbufAnimation', else 'P.Nothing'.
    -> Ptr ()
    -- ^ /@userData@/: the loader.
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufModulePreparedFunc_WithClosures`@.
noPixbufModulePreparedFunc_WithClosures :: Maybe PixbufModulePreparedFunc_WithClosures
noPixbufModulePreparedFunc_WithClosures :: Maybe PixbufModulePreparedFunc_WithClosures
noPixbufModulePreparedFunc_WithClosures = Maybe PixbufModulePreparedFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_PixbufModulePreparedFunc :: PixbufModulePreparedFunc -> PixbufModulePreparedFunc_WithClosures
drop_closures_PixbufModulePreparedFunc :: PixbufModulePreparedFunc -> PixbufModulePreparedFunc_WithClosures
drop_closures_PixbufModulePreparedFunc PixbufModulePreparedFunc
_f Pixbuf
pixbuf PixbufAnimation
anim Ptr ()
_ = PixbufModulePreparedFunc
_f Pixbuf
pixbuf PixbufAnimation
anim

-- | Wrap the callback into a `GClosure`.
genClosure_PixbufModulePreparedFunc :: MonadIO m => PixbufModulePreparedFunc -> m (GClosure C_PixbufModulePreparedFunc)
genClosure_PixbufModulePreparedFunc :: forall (m :: * -> *).
MonadIO m =>
PixbufModulePreparedFunc -> m (GClosure C_PixbufModulePreparedFunc)
genClosure_PixbufModulePreparedFunc PixbufModulePreparedFunc
cb = IO (GClosure C_PixbufModulePreparedFunc)
-> m (GClosure C_PixbufModulePreparedFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PixbufModulePreparedFunc)
 -> m (GClosure C_PixbufModulePreparedFunc))
-> IO (GClosure C_PixbufModulePreparedFunc)
-> m (GClosure C_PixbufModulePreparedFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: PixbufModulePreparedFunc_WithClosures
cb' = PixbufModulePreparedFunc -> PixbufModulePreparedFunc_WithClosures
drop_closures_PixbufModulePreparedFunc PixbufModulePreparedFunc
cb
    let cb'' :: C_PixbufModulePreparedFunc
cb'' = Maybe (Ptr (FunPtr C_PixbufModulePreparedFunc))
-> PixbufModulePreparedFunc_WithClosures
-> C_PixbufModulePreparedFunc
wrap_PixbufModulePreparedFunc Maybe (Ptr (FunPtr C_PixbufModulePreparedFunc))
forall a. Maybe a
Nothing PixbufModulePreparedFunc_WithClosures
cb'
    C_PixbufModulePreparedFunc
-> IO (FunPtr C_PixbufModulePreparedFunc)
mk_PixbufModulePreparedFunc C_PixbufModulePreparedFunc
cb'' IO (FunPtr C_PixbufModulePreparedFunc)
-> (FunPtr C_PixbufModulePreparedFunc
    -> IO (GClosure C_PixbufModulePreparedFunc))
-> IO (GClosure C_PixbufModulePreparedFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PixbufModulePreparedFunc
-> IO (GClosure C_PixbufModulePreparedFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PixbufModulePreparedFunc` into a `C_PixbufModulePreparedFunc`.
wrap_PixbufModulePreparedFunc :: 
    Maybe (Ptr (FunPtr C_PixbufModulePreparedFunc)) ->
    PixbufModulePreparedFunc_WithClosures ->
    C_PixbufModulePreparedFunc
wrap_PixbufModulePreparedFunc :: Maybe (Ptr (FunPtr C_PixbufModulePreparedFunc))
-> PixbufModulePreparedFunc_WithClosures
-> C_PixbufModulePreparedFunc
wrap_PixbufModulePreparedFunc Maybe (Ptr (FunPtr C_PixbufModulePreparedFunc))
gi'funptrptr PixbufModulePreparedFunc_WithClosures
gi'cb Ptr Pixbuf
pixbuf Ptr PixbufAnimation
anim Ptr ()
userData = do
    Pixbuf
pixbuf' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pixbuf -> Pixbuf
GdkPixbuf.Pixbuf.Pixbuf) Ptr Pixbuf
pixbuf
    PixbufAnimation
anim' <- ((ManagedPtr PixbufAnimation -> PixbufAnimation)
-> Ptr PixbufAnimation -> IO PixbufAnimation
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr PixbufAnimation -> PixbufAnimation
GdkPixbuf.PixbufAnimation.PixbufAnimation) Ptr PixbufAnimation
anim
    PixbufModulePreparedFunc_WithClosures
gi'cb  Pixbuf
pixbuf' PixbufAnimation
anim' Ptr ()
userData
    Maybe (Ptr (FunPtr C_PixbufModulePreparedFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PixbufModulePreparedFunc))
gi'funptrptr


-- callback PixbufModuleLoadIncrementFieldCallback
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "context"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "buf"
          , argType = TBasicType TUInt8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "size"
          , argType = TBasicType TUInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = True
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_PixbufModuleLoadIncrementFieldCallback =
    Ptr () ->
    Word8 ->
    Word32 ->
    Ptr (Ptr GError) ->
    IO CInt

-- Args: [ Arg
--           { argCName = "context"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buf"
--           , argType = TBasicType TUInt8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "size"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PixbufModuleLoadIncrementFieldCallback :: FunPtr C_PixbufModuleLoadIncrementFieldCallback -> C_PixbufModuleLoadIncrementFieldCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PixbufModuleLoadIncrementFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_PixbufModuleLoadIncrementFieldCallback
    -> Ptr ()
    -> Word8
    -> Word32
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
dynamic_PixbufModuleLoadIncrementFieldCallback :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_PixbufModuleLoadIncrementFieldCallback
-> Ptr () -> Word8 -> Word32 -> m ()
dynamic_PixbufModuleLoadIncrementFieldCallback FunPtr C_PixbufModuleLoadIncrementFieldCallback
__funPtr Ptr ()
context Word8
buf Word32
size = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ (FunPtr C_PixbufModuleLoadIncrementFieldCallback
-> C_PixbufModuleLoadIncrementFieldCallback
__dynamic_C_PixbufModuleLoadIncrementFieldCallback FunPtr C_PixbufModuleLoadIncrementFieldCallback
__funPtr) Ptr ()
context Word8
buf Word32
size
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

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

-- | /No description available in the introspection data./
type PixbufModuleLoadIncrementFieldCallback =
    Ptr ()
    -> Word8
    -> Word32
    -> IO ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufModuleLoadIncrementFieldCallback`@.
noPixbufModuleLoadIncrementFieldCallback :: Maybe PixbufModuleLoadIncrementFieldCallback
noPixbufModuleLoadIncrementFieldCallback :: Maybe PixbufModuleLoadIncrementFieldCallback
noPixbufModuleLoadIncrementFieldCallback = Maybe PixbufModuleLoadIncrementFieldCallback
forall a. Maybe a
Nothing

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

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

-- Args: [ Arg
--           { argCName = "option_key"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PixbufModuleIsSaveOptionSupportedFieldCallback :: FunPtr C_PixbufModuleIsSaveOptionSupportedFieldCallback -> C_PixbufModuleIsSaveOptionSupportedFieldCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PixbufModuleIsSaveOptionSupportedFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_PixbufModuleIsSaveOptionSupportedFieldCallback
    -> T.Text
    -> m Bool
dynamic_PixbufModuleIsSaveOptionSupportedFieldCallback :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_PixbufModuleIsSaveOptionSupportedFieldCallback
-> Text -> m Bool
dynamic_PixbufModuleIsSaveOptionSupportedFieldCallback FunPtr C_PixbufModuleIsSaveOptionSupportedFieldCallback
__funPtr Text
optionKey = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    CString
optionKey' <- Text -> IO CString
textToCString Text
optionKey
    CInt
result <- (FunPtr C_PixbufModuleIsSaveOptionSupportedFieldCallback
-> C_PixbufModuleIsSaveOptionSupportedFieldCallback
__dynamic_C_PixbufModuleIsSaveOptionSupportedFieldCallback FunPtr C_PixbufModuleIsSaveOptionSupportedFieldCallback
__funPtr) CString
optionKey'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
optionKey'
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | /No description available in the introspection data./
type PixbufModuleIsSaveOptionSupportedFieldCallback =
    T.Text
    -> IO Bool

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufModuleIsSaveOptionSupportedFieldCallback`@.
noPixbufModuleIsSaveOptionSupportedFieldCallback :: Maybe PixbufModuleIsSaveOptionSupportedFieldCallback
noPixbufModuleIsSaveOptionSupportedFieldCallback :: Maybe PixbufModuleIsSaveOptionSupportedFieldCallback
noPixbufModuleIsSaveOptionSupportedFieldCallback = Maybe PixbufModuleIsSaveOptionSupportedFieldCallback
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PixbufModuleIsSaveOptionSupportedFieldCallback :: MonadIO m => PixbufModuleIsSaveOptionSupportedFieldCallback -> m (GClosure C_PixbufModuleIsSaveOptionSupportedFieldCallback)
genClosure_PixbufModuleIsSaveOptionSupportedFieldCallback :: forall (m :: * -> *).
MonadIO m =>
PixbufModuleIsSaveOptionSupportedFieldCallback
-> m (GClosure C_PixbufModuleIsSaveOptionSupportedFieldCallback)
genClosure_PixbufModuleIsSaveOptionSupportedFieldCallback PixbufModuleIsSaveOptionSupportedFieldCallback
cb = IO (GClosure C_PixbufModuleIsSaveOptionSupportedFieldCallback)
-> m (GClosure C_PixbufModuleIsSaveOptionSupportedFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PixbufModuleIsSaveOptionSupportedFieldCallback)
 -> m (GClosure C_PixbufModuleIsSaveOptionSupportedFieldCallback))
-> IO (GClosure C_PixbufModuleIsSaveOptionSupportedFieldCallback)
-> m (GClosure C_PixbufModuleIsSaveOptionSupportedFieldCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PixbufModuleIsSaveOptionSupportedFieldCallback
cb' = Maybe
  (Ptr (FunPtr C_PixbufModuleIsSaveOptionSupportedFieldCallback))
-> PixbufModuleIsSaveOptionSupportedFieldCallback
-> C_PixbufModuleIsSaveOptionSupportedFieldCallback
wrap_PixbufModuleIsSaveOptionSupportedFieldCallback Maybe
  (Ptr (FunPtr C_PixbufModuleIsSaveOptionSupportedFieldCallback))
forall a. Maybe a
Nothing PixbufModuleIsSaveOptionSupportedFieldCallback
cb
    C_PixbufModuleIsSaveOptionSupportedFieldCallback
-> IO (FunPtr C_PixbufModuleIsSaveOptionSupportedFieldCallback)
mk_PixbufModuleIsSaveOptionSupportedFieldCallback C_PixbufModuleIsSaveOptionSupportedFieldCallback
cb' IO (FunPtr C_PixbufModuleIsSaveOptionSupportedFieldCallback)
-> (FunPtr C_PixbufModuleIsSaveOptionSupportedFieldCallback
    -> IO (GClosure C_PixbufModuleIsSaveOptionSupportedFieldCallback))
-> IO (GClosure C_PixbufModuleIsSaveOptionSupportedFieldCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PixbufModuleIsSaveOptionSupportedFieldCallback
-> IO (GClosure C_PixbufModuleIsSaveOptionSupportedFieldCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PixbufModuleIsSaveOptionSupportedFieldCallback` into a `C_PixbufModuleIsSaveOptionSupportedFieldCallback`.
wrap_PixbufModuleIsSaveOptionSupportedFieldCallback :: 
    Maybe (Ptr (FunPtr C_PixbufModuleIsSaveOptionSupportedFieldCallback)) ->
    PixbufModuleIsSaveOptionSupportedFieldCallback ->
    C_PixbufModuleIsSaveOptionSupportedFieldCallback
wrap_PixbufModuleIsSaveOptionSupportedFieldCallback :: Maybe
  (Ptr (FunPtr C_PixbufModuleIsSaveOptionSupportedFieldCallback))
-> PixbufModuleIsSaveOptionSupportedFieldCallback
-> C_PixbufModuleIsSaveOptionSupportedFieldCallback
wrap_PixbufModuleIsSaveOptionSupportedFieldCallback Maybe
  (Ptr (FunPtr C_PixbufModuleIsSaveOptionSupportedFieldCallback))
gi'funptrptr PixbufModuleIsSaveOptionSupportedFieldCallback
gi'cb CString
optionKey = do
    Text
optionKey' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
optionKey
    Bool
result <- PixbufModuleIsSaveOptionSupportedFieldCallback
gi'cb  Text
optionKey'
    Maybe
  (Ptr (FunPtr C_PixbufModuleIsSaveOptionSupportedFieldCallback))
-> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe
  (Ptr (FunPtr C_PixbufModuleIsSaveOptionSupportedFieldCallback))
gi'funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback PixbufModuleFillVtableFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "module"
          , argType =
              TInterface Name { namespace = "GdkPixbuf" , name = "PixbufModule" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GdkPixbufModule."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Defines the type of the function used to set the vtable of a\n#GdkPixbufModule when it is loaded."
        , sinceVersion = Just "2.2"
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_PixbufModuleFillVtableFunc =
    Ptr GdkPixbuf.PixbufModule.PixbufModule ->
    IO ()

-- Args: [ Arg
--           { argCName = "module"
--           , argType =
--               TInterface Name { namespace = "GdkPixbuf" , name = "PixbufModule" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkPixbufModule."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PixbufModuleFillVtableFunc :: FunPtr C_PixbufModuleFillVtableFunc -> C_PixbufModuleFillVtableFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PixbufModuleFillVtableFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_PixbufModuleFillVtableFunc
    -> GdkPixbuf.PixbufModule.PixbufModule
    -- ^ /@module@/: a t'GI.GdkPixbuf.Structs.PixbufModule.PixbufModule'.
    -> m ()
dynamic_PixbufModuleFillVtableFunc :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_PixbufModuleFillVtableFunc -> PixbufModule -> m ()
dynamic_PixbufModuleFillVtableFunc FunPtr C_PixbufModuleFillVtableFunc
__funPtr PixbufModule
module_ = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr PixbufModule
module_' <- PixbufModule -> IO (Ptr PixbufModule)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PixbufModule
module_
    (FunPtr C_PixbufModuleFillVtableFunc -> C_PixbufModuleFillVtableFunc
__dynamic_C_PixbufModuleFillVtableFunc FunPtr C_PixbufModuleFillVtableFunc
__funPtr) Ptr PixbufModule
module_'
    PixbufModule -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PixbufModule
module_
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | Defines the type of the function used to set the vtable of a
-- t'GI.GdkPixbuf.Structs.PixbufModule.PixbufModule' when it is loaded.
-- 
-- /Since: 2.2/
type PixbufModuleFillVtableFunc =
    GdkPixbuf.PixbufModule.PixbufModule
    -- ^ /@module@/: a t'GI.GdkPixbuf.Structs.PixbufModule.PixbufModule'.
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufModuleFillVtableFunc`@.
noPixbufModuleFillVtableFunc :: Maybe PixbufModuleFillVtableFunc
noPixbufModuleFillVtableFunc :: Maybe (PixbufModule -> IO ())
noPixbufModuleFillVtableFunc = Maybe (PixbufModule -> IO ())
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PixbufModuleFillVtableFunc :: MonadIO m => PixbufModuleFillVtableFunc -> m (GClosure C_PixbufModuleFillVtableFunc)
genClosure_PixbufModuleFillVtableFunc :: forall (m :: * -> *).
MonadIO m =>
(PixbufModule -> IO ())
-> m (GClosure C_PixbufModuleFillVtableFunc)
genClosure_PixbufModuleFillVtableFunc PixbufModule -> IO ()
cb = IO (GClosure C_PixbufModuleFillVtableFunc)
-> m (GClosure C_PixbufModuleFillVtableFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PixbufModuleFillVtableFunc)
 -> m (GClosure C_PixbufModuleFillVtableFunc))
-> IO (GClosure C_PixbufModuleFillVtableFunc)
-> m (GClosure C_PixbufModuleFillVtableFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PixbufModuleFillVtableFunc
cb' = Maybe (Ptr (FunPtr C_PixbufModuleFillVtableFunc))
-> (PixbufModule -> IO ()) -> C_PixbufModuleFillVtableFunc
wrap_PixbufModuleFillVtableFunc Maybe (Ptr (FunPtr C_PixbufModuleFillVtableFunc))
forall a. Maybe a
Nothing PixbufModule -> IO ()
cb
    C_PixbufModuleFillVtableFunc
-> IO (FunPtr C_PixbufModuleFillVtableFunc)
mk_PixbufModuleFillVtableFunc C_PixbufModuleFillVtableFunc
cb' IO (FunPtr C_PixbufModuleFillVtableFunc)
-> (FunPtr C_PixbufModuleFillVtableFunc
    -> IO (GClosure C_PixbufModuleFillVtableFunc))
-> IO (GClosure C_PixbufModuleFillVtableFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PixbufModuleFillVtableFunc
-> IO (GClosure C_PixbufModuleFillVtableFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PixbufModuleFillVtableFunc` into a `C_PixbufModuleFillVtableFunc`.
wrap_PixbufModuleFillVtableFunc :: 
    Maybe (Ptr (FunPtr C_PixbufModuleFillVtableFunc)) ->
    PixbufModuleFillVtableFunc ->
    C_PixbufModuleFillVtableFunc
wrap_PixbufModuleFillVtableFunc :: Maybe (Ptr (FunPtr C_PixbufModuleFillVtableFunc))
-> (PixbufModule -> IO ()) -> C_PixbufModuleFillVtableFunc
wrap_PixbufModuleFillVtableFunc Maybe (Ptr (FunPtr C_PixbufModuleFillVtableFunc))
gi'funptrptr PixbufModule -> IO ()
gi'cb Ptr PixbufModule
module_ = do
    PixbufModule
module_' <- ((ManagedPtr PixbufModule -> PixbufModule)
-> Ptr PixbufModule -> IO PixbufModule
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr PixbufModule -> PixbufModule
GdkPixbuf.PixbufModule.PixbufModule) Ptr PixbufModule
module_
    PixbufModule -> IO ()
gi'cb  PixbufModule
module_'
    Maybe (Ptr (FunPtr C_PixbufModuleFillVtableFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PixbufModuleFillVtableFunc))
gi'funptrptr


-- callback PixbufModuleFillInfoFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "info"
          , argType =
              TInterface Name { namespace = "GdkPixbuf" , name = "PixbufFormat" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GdkPixbufFormat."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Defines the type of the function used to fill a\n#GdkPixbufFormat structure with information about a module."
        , sinceVersion = Just "2.2"
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_PixbufModuleFillInfoFunc =
    Ptr GdkPixbuf.PixbufFormat.PixbufFormat ->
    IO ()

-- Args: [ Arg
--           { argCName = "info"
--           , argType =
--               TInterface Name { namespace = "GdkPixbuf" , name = "PixbufFormat" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkPixbufFormat."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PixbufModuleFillInfoFunc :: FunPtr C_PixbufModuleFillInfoFunc -> C_PixbufModuleFillInfoFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PixbufModuleFillInfoFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_PixbufModuleFillInfoFunc
    -> GdkPixbuf.PixbufFormat.PixbufFormat
    -- ^ /@info@/: a t'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat'.
    -> m ()
dynamic_PixbufModuleFillInfoFunc :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_PixbufModuleFillInfoFunc -> PixbufFormat -> m ()
dynamic_PixbufModuleFillInfoFunc FunPtr C_PixbufModuleFillInfoFunc
__funPtr PixbufFormat
info = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr PixbufFormat
info' <- PixbufFormat -> IO (Ptr PixbufFormat)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PixbufFormat
info
    (FunPtr C_PixbufModuleFillInfoFunc -> C_PixbufModuleFillInfoFunc
__dynamic_C_PixbufModuleFillInfoFunc FunPtr C_PixbufModuleFillInfoFunc
__funPtr) Ptr PixbufFormat
info'
    PixbufFormat -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PixbufFormat
info
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | Defines the type of the function used to fill a
-- t'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat' structure with information about a module.
-- 
-- /Since: 2.2/
type PixbufModuleFillInfoFunc =
    GdkPixbuf.PixbufFormat.PixbufFormat
    -- ^ /@info@/: a t'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat'.
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufModuleFillInfoFunc`@.
noPixbufModuleFillInfoFunc :: Maybe PixbufModuleFillInfoFunc
noPixbufModuleFillInfoFunc :: Maybe (PixbufFormat -> IO ())
noPixbufModuleFillInfoFunc = Maybe (PixbufFormat -> IO ())
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PixbufModuleFillInfoFunc :: MonadIO m => PixbufModuleFillInfoFunc -> m (GClosure C_PixbufModuleFillInfoFunc)
genClosure_PixbufModuleFillInfoFunc :: forall (m :: * -> *).
MonadIO m =>
(PixbufFormat -> IO ()) -> m (GClosure C_PixbufModuleFillInfoFunc)
genClosure_PixbufModuleFillInfoFunc PixbufFormat -> IO ()
cb = IO (GClosure C_PixbufModuleFillInfoFunc)
-> m (GClosure C_PixbufModuleFillInfoFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PixbufModuleFillInfoFunc)
 -> m (GClosure C_PixbufModuleFillInfoFunc))
-> IO (GClosure C_PixbufModuleFillInfoFunc)
-> m (GClosure C_PixbufModuleFillInfoFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PixbufModuleFillInfoFunc
cb' = Maybe (Ptr (FunPtr C_PixbufModuleFillInfoFunc))
-> (PixbufFormat -> IO ()) -> C_PixbufModuleFillInfoFunc
wrap_PixbufModuleFillInfoFunc Maybe (Ptr (FunPtr C_PixbufModuleFillInfoFunc))
forall a. Maybe a
Nothing PixbufFormat -> IO ()
cb
    C_PixbufModuleFillInfoFunc
-> IO (FunPtr C_PixbufModuleFillInfoFunc)
mk_PixbufModuleFillInfoFunc C_PixbufModuleFillInfoFunc
cb' IO (FunPtr C_PixbufModuleFillInfoFunc)
-> (FunPtr C_PixbufModuleFillInfoFunc
    -> IO (GClosure C_PixbufModuleFillInfoFunc))
-> IO (GClosure C_PixbufModuleFillInfoFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PixbufModuleFillInfoFunc
-> IO (GClosure C_PixbufModuleFillInfoFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PixbufModuleFillInfoFunc` into a `C_PixbufModuleFillInfoFunc`.
wrap_PixbufModuleFillInfoFunc :: 
    Maybe (Ptr (FunPtr C_PixbufModuleFillInfoFunc)) ->
    PixbufModuleFillInfoFunc ->
    C_PixbufModuleFillInfoFunc
wrap_PixbufModuleFillInfoFunc :: Maybe (Ptr (FunPtr C_PixbufModuleFillInfoFunc))
-> (PixbufFormat -> IO ()) -> C_PixbufModuleFillInfoFunc
wrap_PixbufModuleFillInfoFunc Maybe (Ptr (FunPtr C_PixbufModuleFillInfoFunc))
gi'funptrptr PixbufFormat -> IO ()
gi'cb Ptr PixbufFormat
info = do
    Ptr PixbufFormat -> (PixbufFormat -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  Ptr PixbufFormat
info ((PixbufFormat -> IO ()) -> IO ())
-> (PixbufFormat -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \PixbufFormat
info' -> do
        PixbufFormat -> IO ()
gi'cb  PixbufFormat
info'
        Maybe (Ptr (FunPtr C_PixbufModuleFillInfoFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PixbufModuleFillInfoFunc))
gi'funptrptr


-- callback PixbufDestroyNotify
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "pixels"
          , argType = TCArray False (-1) (-1) (TBasicType TUInt8)
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText =
                    Just "The pixel array of the pixbuf\n  that is being finalized."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "User closure data." , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A function of this type is responsible for freeing the pixel array\nof a pixbuf.\n\nThe gdk_pixbuf_new_from_data() function lets you pass in a pre-allocated\npixel array so that a pixbuf can be created from it; in this case you\nwill need to pass in a function of type `GdkPixbufDestroyNotify` so that\nthe pixel data can be freed when the pixbuf is finalized."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_PixbufDestroyNotify =
    Ptr Word8 ->
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "pixels"
--           , argType = TCArray False (-1) (-1) (TBasicType TUInt8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The pixel array of the pixbuf\n  that is being finalized."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "User closure data." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PixbufDestroyNotify :: FunPtr C_PixbufDestroyNotify -> C_PixbufDestroyNotify

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PixbufDestroyNotify ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_PixbufDestroyNotify
    -> Ptr Word8
    -- ^ /@pixels@/: The pixel array of the pixbuf
    --   that is being finalized.
    -> Ptr ()
    -- ^ /@data@/: User closure data.
    -> m ()
dynamic_PixbufDestroyNotify :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_PixbufDestroyNotify -> Ptr Word8 -> Ptr () -> m ()
dynamic_PixbufDestroyNotify FunPtr C_PixbufDestroyNotify
__funPtr Ptr Word8
pixels Ptr ()
data_ = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    (FunPtr C_PixbufDestroyNotify -> C_PixbufDestroyNotify
__dynamic_C_PixbufDestroyNotify FunPtr C_PixbufDestroyNotify
__funPtr) Ptr Word8
pixels Ptr ()
data_
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | A function of this type is responsible for freeing the pixel array
-- of a pixbuf.
-- 
-- The 'GI.GdkPixbuf.Objects.Pixbuf.pixbufNewFromData' function lets you pass in a pre-allocated
-- pixel array so that a pixbuf can be created from it; in this case you
-- will need to pass in a function of type @GdkPixbufDestroyNotify@ so that
-- the pixel data can be freed when the pixbuf is finalized.
type PixbufDestroyNotify =
    Ptr Word8
    -- ^ /@pixels@/: The pixel array of the pixbuf
    --   that is being finalized.
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufDestroyNotify`@.
noPixbufDestroyNotify :: Maybe PixbufDestroyNotify
noPixbufDestroyNotify :: Maybe (Ptr Word8 -> IO ())
noPixbufDestroyNotify = Maybe (Ptr Word8 -> IO ())
forall a. Maybe a
Nothing

-- | A function of this type is responsible for freeing the pixel array
-- of a pixbuf.
-- 
-- The 'GI.GdkPixbuf.Objects.Pixbuf.pixbufNewFromData' function lets you pass in a pre-allocated
-- pixel array so that a pixbuf can be created from it; in this case you
-- will need to pass in a function of type @GdkPixbufDestroyNotify@ so that
-- the pixel data can be freed when the pixbuf is finalized.
type PixbufDestroyNotify_WithClosures =
    Ptr Word8
    -- ^ /@pixels@/: The pixel array of the pixbuf
    --   that is being finalized.
    -> Ptr ()
    -- ^ /@data@/: User closure data.
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufDestroyNotify_WithClosures`@.
noPixbufDestroyNotify_WithClosures :: Maybe PixbufDestroyNotify_WithClosures
noPixbufDestroyNotify_WithClosures :: Maybe C_PixbufDestroyNotify
noPixbufDestroyNotify_WithClosures = Maybe C_PixbufDestroyNotify
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_PixbufDestroyNotify :: PixbufDestroyNotify -> PixbufDestroyNotify_WithClosures
drop_closures_PixbufDestroyNotify :: (Ptr Word8 -> IO ()) -> C_PixbufDestroyNotify
drop_closures_PixbufDestroyNotify Ptr Word8 -> IO ()
_f Ptr Word8
pixels Ptr ()
_ = Ptr Word8 -> IO ()
_f Ptr Word8
pixels

-- | Wrap the callback into a `GClosure`.
genClosure_PixbufDestroyNotify :: MonadIO m => PixbufDestroyNotify -> m (GClosure C_PixbufDestroyNotify)
genClosure_PixbufDestroyNotify :: forall (m :: * -> *).
MonadIO m =>
(Ptr Word8 -> IO ()) -> m (GClosure C_PixbufDestroyNotify)
genClosure_PixbufDestroyNotify Ptr Word8 -> IO ()
cb = IO (GClosure C_PixbufDestroyNotify)
-> m (GClosure C_PixbufDestroyNotify)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PixbufDestroyNotify)
 -> m (GClosure C_PixbufDestroyNotify))
-> IO (GClosure C_PixbufDestroyNotify)
-> m (GClosure C_PixbufDestroyNotify)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PixbufDestroyNotify
cb' = (Ptr Word8 -> IO ()) -> C_PixbufDestroyNotify
drop_closures_PixbufDestroyNotify Ptr Word8 -> IO ()
cb
    let cb'' :: C_PixbufDestroyNotify
cb'' = Maybe (Ptr (FunPtr C_PixbufDestroyNotify))
-> C_PixbufDestroyNotify -> C_PixbufDestroyNotify
wrap_PixbufDestroyNotify Maybe (Ptr (FunPtr C_PixbufDestroyNotify))
forall a. Maybe a
Nothing C_PixbufDestroyNotify
cb'
    C_PixbufDestroyNotify -> IO (FunPtr C_PixbufDestroyNotify)
mk_PixbufDestroyNotify C_PixbufDestroyNotify
cb'' IO (FunPtr C_PixbufDestroyNotify)
-> (FunPtr C_PixbufDestroyNotify
    -> IO (GClosure C_PixbufDestroyNotify))
-> IO (GClosure C_PixbufDestroyNotify)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PixbufDestroyNotify -> IO (GClosure C_PixbufDestroyNotify)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PixbufDestroyNotify` into a `C_PixbufDestroyNotify`.
wrap_PixbufDestroyNotify :: 
    Maybe (Ptr (FunPtr C_PixbufDestroyNotify)) ->
    PixbufDestroyNotify_WithClosures ->
    C_PixbufDestroyNotify
wrap_PixbufDestroyNotify :: Maybe (Ptr (FunPtr C_PixbufDestroyNotify))
-> C_PixbufDestroyNotify -> C_PixbufDestroyNotify
wrap_PixbufDestroyNotify Maybe (Ptr (FunPtr C_PixbufDestroyNotify))
gi'funptrptr C_PixbufDestroyNotify
gi'cb Ptr Word8
pixels Ptr ()
data_ = do
    C_PixbufDestroyNotify
gi'cb  Ptr Word8
pixels Ptr ()
data_
    Maybe (Ptr (FunPtr C_PixbufDestroyNotify)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PixbufDestroyNotify))
gi'funptrptr