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

The GdkPixbufLoader struct contains only private
fields.
-}

module GI.GdkPixbuf.Objects.PixbufLoader
    ( 

-- * Exported types
    PixbufLoader(..)                        ,
    IsPixbufLoader                          ,
    toPixbufLoader                          ,
    noPixbufLoader                          ,


 -- * Methods
-- ** close #method:close#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    PixbufLoaderCloseMethodInfo             ,
#endif
    pixbufLoaderClose                       ,


-- ** getAnimation #method:getAnimation#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    PixbufLoaderGetAnimationMethodInfo      ,
#endif
    pixbufLoaderGetAnimation                ,


-- ** getFormat #method:getFormat#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    PixbufLoaderGetFormatMethodInfo         ,
#endif
    pixbufLoaderGetFormat                   ,


-- ** getPixbuf #method:getPixbuf#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    PixbufLoaderGetPixbufMethodInfo         ,
#endif
    pixbufLoaderGetPixbuf                   ,


-- ** new #method:new#
    pixbufLoaderNew                         ,


-- ** newWithMimeType #method:newWithMimeType#
    pixbufLoaderNewWithMimeType             ,


-- ** newWithType #method:newWithType#
    pixbufLoaderNewWithType                 ,


-- ** setSize #method:setSize#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    PixbufLoaderSetSizeMethodInfo           ,
#endif
    pixbufLoaderSetSize                     ,


-- ** write #method:write#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    PixbufLoaderWriteMethodInfo             ,
#endif
    pixbufLoaderWrite                       ,


-- ** writeBytes #method:writeBytes#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    PixbufLoaderWriteBytesMethodInfo        ,
#endif
    pixbufLoaderWriteBytes                  ,




 -- * Signals
-- ** areaPrepared #signal:areaPrepared#
    C_PixbufLoaderAreaPreparedCallback      ,
    PixbufLoaderAreaPreparedCallback        ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    PixbufLoaderAreaPreparedSignalInfo      ,
#endif
    afterPixbufLoaderAreaPrepared           ,
    genClosure_PixbufLoaderAreaPrepared     ,
    mk_PixbufLoaderAreaPreparedCallback     ,
    noPixbufLoaderAreaPreparedCallback      ,
    onPixbufLoaderAreaPrepared              ,
    wrap_PixbufLoaderAreaPreparedCallback   ,


-- ** areaUpdated #signal:areaUpdated#
    C_PixbufLoaderAreaUpdatedCallback       ,
    PixbufLoaderAreaUpdatedCallback         ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    PixbufLoaderAreaUpdatedSignalInfo       ,
#endif
    afterPixbufLoaderAreaUpdated            ,
    genClosure_PixbufLoaderAreaUpdated      ,
    mk_PixbufLoaderAreaUpdatedCallback      ,
    noPixbufLoaderAreaUpdatedCallback       ,
    onPixbufLoaderAreaUpdated               ,
    wrap_PixbufLoaderAreaUpdatedCallback    ,


-- ** closed #signal:closed#
    C_PixbufLoaderClosedCallback            ,
    PixbufLoaderClosedCallback              ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    PixbufLoaderClosedSignalInfo            ,
#endif
    afterPixbufLoaderClosed                 ,
    genClosure_PixbufLoaderClosed           ,
    mk_PixbufLoaderClosedCallback           ,
    noPixbufLoaderClosedCallback            ,
    onPixbufLoaderClosed                    ,
    wrap_PixbufLoaderClosedCallback         ,


-- ** sizePrepared #signal:sizePrepared#
    C_PixbufLoaderSizePreparedCallback      ,
    PixbufLoaderSizePreparedCallback        ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    PixbufLoaderSizePreparedSignalInfo      ,
#endif
    afterPixbufLoaderSizePrepared           ,
    genClosure_PixbufLoaderSizePrepared     ,
    mk_PixbufLoaderSizePreparedCallback     ,
    noPixbufLoaderSizePreparedCallback      ,
    onPixbufLoaderSizePrepared              ,
    wrap_PixbufLoaderSizePreparedCallback   ,




    ) where

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

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

import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GObject.Objects.Object as GObject.Object
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

newtype PixbufLoader = PixbufLoader (ManagedPtr PixbufLoader)
foreign import ccall "gdk_pixbuf_loader_get_type"
    c_gdk_pixbuf_loader_get_type :: IO GType

instance GObject PixbufLoader where
    gobjectType _ = c_gdk_pixbuf_loader_get_type
    

class GObject o => IsPixbufLoader o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError PixbufLoader a) =>
    IsPixbufLoader a
#endif
instance IsPixbufLoader PixbufLoader
instance GObject.Object.IsObject PixbufLoader

toPixbufLoader :: (MonadIO m, IsPixbufLoader o) => o -> m PixbufLoader
toPixbufLoader = liftIO . unsafeCastTo PixbufLoader

noPixbufLoader :: Maybe PixbufLoader
noPixbufLoader = Nothing

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolvePixbufLoaderMethod (t :: Symbol) (o :: *) :: * where
    ResolvePixbufLoaderMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolvePixbufLoaderMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolvePixbufLoaderMethod "close" o = PixbufLoaderCloseMethodInfo
    ResolvePixbufLoaderMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolvePixbufLoaderMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolvePixbufLoaderMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolvePixbufLoaderMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolvePixbufLoaderMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolvePixbufLoaderMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolvePixbufLoaderMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolvePixbufLoaderMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolvePixbufLoaderMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolvePixbufLoaderMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolvePixbufLoaderMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolvePixbufLoaderMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolvePixbufLoaderMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolvePixbufLoaderMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolvePixbufLoaderMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolvePixbufLoaderMethod "write" o = PixbufLoaderWriteMethodInfo
    ResolvePixbufLoaderMethod "writeBytes" o = PixbufLoaderWriteBytesMethodInfo
    ResolvePixbufLoaderMethod "getAnimation" o = PixbufLoaderGetAnimationMethodInfo
    ResolvePixbufLoaderMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolvePixbufLoaderMethod "getFormat" o = PixbufLoaderGetFormatMethodInfo
    ResolvePixbufLoaderMethod "getPixbuf" o = PixbufLoaderGetPixbufMethodInfo
    ResolvePixbufLoaderMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolvePixbufLoaderMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolvePixbufLoaderMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolvePixbufLoaderMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolvePixbufLoaderMethod "setSize" o = PixbufLoaderSetSizeMethodInfo
    ResolvePixbufLoaderMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolvePixbufLoaderMethod t PixbufLoader, O.MethodInfo info PixbufLoader p) => O.IsLabelProxy t (PixbufLoader -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolvePixbufLoaderMethod t PixbufLoader, O.MethodInfo info PixbufLoader p) => O.IsLabel t (PixbufLoader -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif

#endif

-- signal PixbufLoader::area-prepared
type PixbufLoaderAreaPreparedCallback =
    IO ()

noPixbufLoaderAreaPreparedCallback :: Maybe PixbufLoaderAreaPreparedCallback
noPixbufLoaderAreaPreparedCallback = Nothing

type C_PixbufLoaderAreaPreparedCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_PixbufLoaderAreaPreparedCallback :: C_PixbufLoaderAreaPreparedCallback -> IO (FunPtr C_PixbufLoaderAreaPreparedCallback)

genClosure_PixbufLoaderAreaPrepared :: PixbufLoaderAreaPreparedCallback -> IO Closure
genClosure_PixbufLoaderAreaPrepared cb = do
    let cb' = wrap_PixbufLoaderAreaPreparedCallback cb
    mk_PixbufLoaderAreaPreparedCallback cb' >>= newCClosure


wrap_PixbufLoaderAreaPreparedCallback ::
    PixbufLoaderAreaPreparedCallback ->
    Ptr () ->
    Ptr () ->
    IO ()
wrap_PixbufLoaderAreaPreparedCallback _cb _ _ = do
    _cb 


onPixbufLoaderAreaPrepared :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderAreaPreparedCallback -> m SignalHandlerId
onPixbufLoaderAreaPrepared obj cb = liftIO $ do
    let cb' = wrap_PixbufLoaderAreaPreparedCallback cb
    cb'' <- mk_PixbufLoaderAreaPreparedCallback cb'
    connectSignalFunPtr obj "area-prepared" cb'' SignalConnectBefore

afterPixbufLoaderAreaPrepared :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderAreaPreparedCallback -> m SignalHandlerId
afterPixbufLoaderAreaPrepared obj cb = liftIO $ do
    let cb' = wrap_PixbufLoaderAreaPreparedCallback cb
    cb'' <- mk_PixbufLoaderAreaPreparedCallback cb'
    connectSignalFunPtr obj "area-prepared" cb'' SignalConnectAfter


-- signal PixbufLoader::area-updated
type PixbufLoaderAreaUpdatedCallback =
    Int32 ->
    Int32 ->
    Int32 ->
    Int32 ->
    IO ()

noPixbufLoaderAreaUpdatedCallback :: Maybe PixbufLoaderAreaUpdatedCallback
noPixbufLoaderAreaUpdatedCallback = Nothing

type C_PixbufLoaderAreaUpdatedCallback =
    Ptr () ->                               -- object
    Int32 ->
    Int32 ->
    Int32 ->
    Int32 ->
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_PixbufLoaderAreaUpdatedCallback :: C_PixbufLoaderAreaUpdatedCallback -> IO (FunPtr C_PixbufLoaderAreaUpdatedCallback)

genClosure_PixbufLoaderAreaUpdated :: PixbufLoaderAreaUpdatedCallback -> IO Closure
genClosure_PixbufLoaderAreaUpdated cb = do
    let cb' = wrap_PixbufLoaderAreaUpdatedCallback cb
    mk_PixbufLoaderAreaUpdatedCallback cb' >>= newCClosure


wrap_PixbufLoaderAreaUpdatedCallback ::
    PixbufLoaderAreaUpdatedCallback ->
    Ptr () ->
    Int32 ->
    Int32 ->
    Int32 ->
    Int32 ->
    Ptr () ->
    IO ()
wrap_PixbufLoaderAreaUpdatedCallback _cb _ x y width height _ = do
    _cb  x y width height


onPixbufLoaderAreaUpdated :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderAreaUpdatedCallback -> m SignalHandlerId
onPixbufLoaderAreaUpdated obj cb = liftIO $ do
    let cb' = wrap_PixbufLoaderAreaUpdatedCallback cb
    cb'' <- mk_PixbufLoaderAreaUpdatedCallback cb'
    connectSignalFunPtr obj "area-updated" cb'' SignalConnectBefore

afterPixbufLoaderAreaUpdated :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderAreaUpdatedCallback -> m SignalHandlerId
afterPixbufLoaderAreaUpdated obj cb = liftIO $ do
    let cb' = wrap_PixbufLoaderAreaUpdatedCallback cb
    cb'' <- mk_PixbufLoaderAreaUpdatedCallback cb'
    connectSignalFunPtr obj "area-updated" cb'' SignalConnectAfter


-- signal PixbufLoader::closed
type PixbufLoaderClosedCallback =
    IO ()

noPixbufLoaderClosedCallback :: Maybe PixbufLoaderClosedCallback
noPixbufLoaderClosedCallback = Nothing

type C_PixbufLoaderClosedCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_PixbufLoaderClosedCallback :: C_PixbufLoaderClosedCallback -> IO (FunPtr C_PixbufLoaderClosedCallback)

genClosure_PixbufLoaderClosed :: PixbufLoaderClosedCallback -> IO Closure
genClosure_PixbufLoaderClosed cb = do
    let cb' = wrap_PixbufLoaderClosedCallback cb
    mk_PixbufLoaderClosedCallback cb' >>= newCClosure


wrap_PixbufLoaderClosedCallback ::
    PixbufLoaderClosedCallback ->
    Ptr () ->
    Ptr () ->
    IO ()
wrap_PixbufLoaderClosedCallback _cb _ _ = do
    _cb 


onPixbufLoaderClosed :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderClosedCallback -> m SignalHandlerId
onPixbufLoaderClosed obj cb = liftIO $ do
    let cb' = wrap_PixbufLoaderClosedCallback cb
    cb'' <- mk_PixbufLoaderClosedCallback cb'
    connectSignalFunPtr obj "closed" cb'' SignalConnectBefore

afterPixbufLoaderClosed :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderClosedCallback -> m SignalHandlerId
afterPixbufLoaderClosed obj cb = liftIO $ do
    let cb' = wrap_PixbufLoaderClosedCallback cb
    cb'' <- mk_PixbufLoaderClosedCallback cb'
    connectSignalFunPtr obj "closed" cb'' SignalConnectAfter


-- signal PixbufLoader::size-prepared
type PixbufLoaderSizePreparedCallback =
    Int32 ->
    Int32 ->
    IO ()

noPixbufLoaderSizePreparedCallback :: Maybe PixbufLoaderSizePreparedCallback
noPixbufLoaderSizePreparedCallback = Nothing

type C_PixbufLoaderSizePreparedCallback =
    Ptr () ->                               -- object
    Int32 ->
    Int32 ->
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_PixbufLoaderSizePreparedCallback :: C_PixbufLoaderSizePreparedCallback -> IO (FunPtr C_PixbufLoaderSizePreparedCallback)

genClosure_PixbufLoaderSizePrepared :: PixbufLoaderSizePreparedCallback -> IO Closure
genClosure_PixbufLoaderSizePrepared cb = do
    let cb' = wrap_PixbufLoaderSizePreparedCallback cb
    mk_PixbufLoaderSizePreparedCallback cb' >>= newCClosure


wrap_PixbufLoaderSizePreparedCallback ::
    PixbufLoaderSizePreparedCallback ->
    Ptr () ->
    Int32 ->
    Int32 ->
    Ptr () ->
    IO ()
wrap_PixbufLoaderSizePreparedCallback _cb _ width height _ = do
    _cb  width height


onPixbufLoaderSizePrepared :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderSizePreparedCallback -> m SignalHandlerId
onPixbufLoaderSizePrepared obj cb = liftIO $ do
    let cb' = wrap_PixbufLoaderSizePreparedCallback cb
    cb'' <- mk_PixbufLoaderSizePreparedCallback cb'
    connectSignalFunPtr obj "size-prepared" cb'' SignalConnectBefore

afterPixbufLoaderSizePrepared :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderSizePreparedCallback -> m SignalHandlerId
afterPixbufLoaderSizePrepared obj cb = liftIO $ do
    let cb' = wrap_PixbufLoaderSizePreparedCallback cb
    cb'' <- mk_PixbufLoaderSizePreparedCallback cb'
    connectSignalFunPtr obj "size-prepared" cb'' SignalConnectAfter


#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList PixbufLoader
type instance O.AttributeList PixbufLoader = PixbufLoaderAttributeList
type PixbufLoaderAttributeList = ('[ ] :: [(Symbol, *)])
#endif

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

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufLoaderAreaPreparedSignalInfo
instance SignalInfo PixbufLoaderAreaPreparedSignalInfo where
    type HaskellCallbackType PixbufLoaderAreaPreparedSignalInfo = PixbufLoaderAreaPreparedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_PixbufLoaderAreaPreparedCallback cb
        cb'' <- mk_PixbufLoaderAreaPreparedCallback cb'
        connectSignalFunPtr obj "area-prepared" cb'' connectMode

data PixbufLoaderAreaUpdatedSignalInfo
instance SignalInfo PixbufLoaderAreaUpdatedSignalInfo where
    type HaskellCallbackType PixbufLoaderAreaUpdatedSignalInfo = PixbufLoaderAreaUpdatedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_PixbufLoaderAreaUpdatedCallback cb
        cb'' <- mk_PixbufLoaderAreaUpdatedCallback cb'
        connectSignalFunPtr obj "area-updated" cb'' connectMode

data PixbufLoaderClosedSignalInfo
instance SignalInfo PixbufLoaderClosedSignalInfo where
    type HaskellCallbackType PixbufLoaderClosedSignalInfo = PixbufLoaderClosedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_PixbufLoaderClosedCallback cb
        cb'' <- mk_PixbufLoaderClosedCallback cb'
        connectSignalFunPtr obj "closed" cb'' connectMode

data PixbufLoaderSizePreparedSignalInfo
instance SignalInfo PixbufLoaderSizePreparedSignalInfo where
    type HaskellCallbackType PixbufLoaderSizePreparedSignalInfo = PixbufLoaderSizePreparedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_PixbufLoaderSizePreparedCallback cb
        cb'' <- mk_PixbufLoaderSizePreparedCallback cb'
        connectSignalFunPtr obj "size-prepared" cb'' connectMode

type instance O.SignalList PixbufLoader = PixbufLoaderSignalList
type PixbufLoaderSignalList = ('[ '("areaPrepared", PixbufLoaderAreaPreparedSignalInfo), '("areaUpdated", PixbufLoaderAreaUpdatedSignalInfo), '("closed", PixbufLoaderClosedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("sizePrepared", PixbufLoaderSizePreparedSignalInfo)] :: [(Symbol, *)])

#endif

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

foreign import ccall "gdk_pixbuf_loader_new" gdk_pixbuf_loader_new :: 
    IO (Ptr PixbufLoader)

{- |
Creates a new pixbuf loader object.
-}
pixbufLoaderNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m PixbufLoader
    {- ^ __Returns:__ A newly-created pixbuf loader. -}
pixbufLoaderNew  = liftIO $ do
    result <- gdk_pixbuf_loader_new
    checkUnexpectedReturnNULL "pixbufLoaderNew" result
    result' <- (wrapObject PixbufLoader) result
    return result'

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

-- method PixbufLoader::new_with_mime_type
-- method type : Constructor
-- Args : [Arg {argCName = "mime_type", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the mime type to be loaded", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GdkPixbuf", name = "PixbufLoader"}))
-- throws : True
-- Skip return : False

foreign import ccall "gdk_pixbuf_loader_new_with_mime_type" gdk_pixbuf_loader_new_with_mime_type :: 
    CString ->                              -- mime_type : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr PixbufLoader)

{- |
Creates a new pixbuf loader object that always attempts to parse
image data as if it were an image of mime type /@mimeType@/, instead of
identifying the type automatically. Useful if you want an error if
the image isn\'t the expected mime type, for loading image formats
that can\'t be reliably identified by looking at the data, or if
the user manually forces a specific mime type.

The list of supported mime types depends on what image loaders
are installed, but typically \"image\/png\", \"image\/jpeg\", \"image\/gif\",
\"image\/tiff\" and \"image\/x-xpixmap\" are among the supported mime types.
To obtain the full list of supported mime types, call
'GI.GdkPixbuf.Structs.PixbufFormat.pixbufFormatGetMimeTypes' on each of the 'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat'
structs returned by 'GI.GdkPixbuf.Objects.Pixbuf.pixbufGetFormats'.

@since 2.4
-}
pixbufLoaderNewWithMimeType ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    {- ^ /@mimeType@/: the mime type to be loaded -}
    -> m PixbufLoader
    {- ^ __Returns:__ A newly-created pixbuf loader. /(Can throw 'Data.GI.Base.GError.GError')/ -}
pixbufLoaderNewWithMimeType mimeType = liftIO $ do
    mimeType' <- textToCString mimeType
    onException (do
        result <- propagateGError $ gdk_pixbuf_loader_new_with_mime_type mimeType'
        checkUnexpectedReturnNULL "pixbufLoaderNewWithMimeType" result
        result' <- (wrapObject PixbufLoader) result
        freeMem mimeType'
        return result'
     ) (do
        freeMem mimeType'
     )

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

-- method PixbufLoader::new_with_type
-- method type : Constructor
-- Args : [Arg {argCName = "image_type", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "name of the image format to be loaded with the image", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GdkPixbuf", name = "PixbufLoader"}))
-- throws : True
-- Skip return : False

foreign import ccall "gdk_pixbuf_loader_new_with_type" gdk_pixbuf_loader_new_with_type :: 
    CString ->                              -- image_type : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr PixbufLoader)

{- |
Creates a new pixbuf loader object that always attempts to parse
image data as if it were an image of type /@imageType@/, instead of
identifying the type automatically. Useful if you want an error if
the image isn\'t the expected type, for loading image formats
that can\'t be reliably identified by looking at the data, or if
the user manually forces a specific type.

The list of supported image formats depends on what image loaders
are installed, but typically \"png\", \"jpeg\", \"gif\", \"tiff\" and
\"xpm\" are among the supported formats. To obtain the full list of
supported image formats, call 'GI.GdkPixbuf.Structs.PixbufFormat.pixbufFormatGetName' on each
of the 'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat' structs returned by 'GI.GdkPixbuf.Objects.Pixbuf.pixbufGetFormats'.
-}
pixbufLoaderNewWithType ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    {- ^ /@imageType@/: name of the image format to be loaded with the image -}
    -> m PixbufLoader
    {- ^ __Returns:__ A newly-created pixbuf loader. /(Can throw 'Data.GI.Base.GError.GError')/ -}
pixbufLoaderNewWithType imageType = liftIO $ do
    imageType' <- textToCString imageType
    onException (do
        result <- propagateGError $ gdk_pixbuf_loader_new_with_type imageType'
        checkUnexpectedReturnNULL "pixbufLoaderNewWithType" result
        result' <- (wrapObject PixbufLoader) result
        freeMem imageType'
        return result'
     ) (do
        freeMem imageType'
     )

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

-- method PixbufLoader::close
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "loader", argType = TInterface (Name {namespace = "GdkPixbuf", name = "PixbufLoader"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A pixbuf loader.", 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 "gdk_pixbuf_loader_close" gdk_pixbuf_loader_close :: 
    Ptr PixbufLoader ->                     -- loader : TInterface (Name {namespace = "GdkPixbuf", name = "PixbufLoader"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Informs a pixbuf loader that no further writes with
'GI.GdkPixbuf.Objects.PixbufLoader.pixbufLoaderWrite' will occur, so that it can free its
internal loading structures. Also, tries to parse any data that
hasn\'t yet been parsed; if the remaining data is partial or
corrupt, an error will be returned.  If 'False' is returned, /@error@/
will be set to an error from the @/GDK_PIXBUF_ERROR/@ or @/G_FILE_ERROR/@
domains. If you\'re just cancelling a load rather than expecting it
to be finished, passing 'Nothing' for /@error@/ to ignore it is
reasonable.

Remember that this does not unref the loader, so if you plan not to
use it anymore, please 'GI.GObject.Objects.Object.objectUnref' it.
-}
pixbufLoaderClose ::
    (B.CallStack.HasCallStack, MonadIO m, IsPixbufLoader a) =>
    a
    {- ^ /@loader@/: A pixbuf loader. -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
pixbufLoaderClose loader = liftIO $ do
    loader' <- unsafeManagedPtrCastPtr loader
    onException (do
        _ <- propagateGError $ gdk_pixbuf_loader_close loader'
        touchManagedPtr loader
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufLoaderCloseMethodInfo
instance (signature ~ (m ()), MonadIO m, IsPixbufLoader a) => O.MethodInfo PixbufLoaderCloseMethodInfo a signature where
    overloadedMethod _ = pixbufLoaderClose

#endif

-- method PixbufLoader::get_animation
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "loader", argType = TInterface (Name {namespace = "GdkPixbuf", name = "PixbufLoader"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A pixbuf loader", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GdkPixbuf", name = "PixbufAnimation"}))
-- throws : False
-- Skip return : False

foreign import ccall "gdk_pixbuf_loader_get_animation" gdk_pixbuf_loader_get_animation :: 
    Ptr PixbufLoader ->                     -- loader : TInterface (Name {namespace = "GdkPixbuf", name = "PixbufLoader"})
    IO (Ptr GdkPixbuf.PixbufAnimation.PixbufAnimation)

{- |
Queries the 'GI.GdkPixbuf.Objects.PixbufAnimation.PixbufAnimation' that a pixbuf loader is currently creating.
In general it only makes sense to call this function after the \"area-prepared\"
signal has been emitted by the loader. If the loader doesn\'t have enough
bytes yet (hasn\'t emitted the \"area-prepared\" signal) this function will
return 'Nothing'.
-}
pixbufLoaderGetAnimation ::
    (B.CallStack.HasCallStack, MonadIO m, IsPixbufLoader a) =>
    a
    {- ^ /@loader@/: A pixbuf loader -}
    -> m GdkPixbuf.PixbufAnimation.PixbufAnimation
    {- ^ __Returns:__ The 'GI.GdkPixbuf.Objects.PixbufAnimation.PixbufAnimation' that the loader is loading, or 'Nothing' if
not enough data has been read to determine the information. -}
pixbufLoaderGetAnimation loader = liftIO $ do
    loader' <- unsafeManagedPtrCastPtr loader
    result <- gdk_pixbuf_loader_get_animation loader'
    checkUnexpectedReturnNULL "pixbufLoaderGetAnimation" result
    result' <- (newObject GdkPixbuf.PixbufAnimation.PixbufAnimation) result
    touchManagedPtr loader
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufLoaderGetAnimationMethodInfo
instance (signature ~ (m GdkPixbuf.PixbufAnimation.PixbufAnimation), MonadIO m, IsPixbufLoader a) => O.MethodInfo PixbufLoaderGetAnimationMethodInfo a signature where
    overloadedMethod _ = pixbufLoaderGetAnimation

#endif

-- method PixbufLoader::get_format
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "loader", argType = TInterface (Name {namespace = "GdkPixbuf", name = "PixbufLoader"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A pixbuf loader.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"}))
-- throws : False
-- Skip return : False

foreign import ccall "gdk_pixbuf_loader_get_format" gdk_pixbuf_loader_get_format :: 
    Ptr PixbufLoader ->                     -- loader : TInterface (Name {namespace = "GdkPixbuf", name = "PixbufLoader"})
    IO (Ptr GdkPixbuf.PixbufFormat.PixbufFormat)

{- |
Obtains the available information about the format of the
currently loading image file.

@since 2.2
-}
pixbufLoaderGetFormat ::
    (B.CallStack.HasCallStack, MonadIO m, IsPixbufLoader a) =>
    a
    {- ^ /@loader@/: A pixbuf loader. -}
    -> m (Maybe GdkPixbuf.PixbufFormat.PixbufFormat)
    {- ^ __Returns:__ A 'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat' or
'Nothing'. The return value is owned by GdkPixbuf and should not be
freed. -}
pixbufLoaderGetFormat loader = liftIO $ do
    loader' <- unsafeManagedPtrCastPtr loader
    result <- gdk_pixbuf_loader_get_format loader'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (newBoxed GdkPixbuf.PixbufFormat.PixbufFormat) result'
        return result''
    touchManagedPtr loader
    return maybeResult

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufLoaderGetFormatMethodInfo
instance (signature ~ (m (Maybe GdkPixbuf.PixbufFormat.PixbufFormat)), MonadIO m, IsPixbufLoader a) => O.MethodInfo PixbufLoaderGetFormatMethodInfo a signature where
    overloadedMethod _ = pixbufLoaderGetFormat

#endif

-- method PixbufLoader::get_pixbuf
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "loader", argType = TInterface (Name {namespace = "GdkPixbuf", name = "PixbufLoader"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A pixbuf loader.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GdkPixbuf", name = "Pixbuf"}))
-- throws : False
-- Skip return : False

foreign import ccall "gdk_pixbuf_loader_get_pixbuf" gdk_pixbuf_loader_get_pixbuf :: 
    Ptr PixbufLoader ->                     -- loader : TInterface (Name {namespace = "GdkPixbuf", name = "PixbufLoader"})
    IO (Ptr GdkPixbuf.Pixbuf.Pixbuf)

{- |
Queries the 'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf' that a pixbuf loader is currently creating.
In general it only makes sense to call this function after the
\"area-prepared\" signal has been emitted by the loader; this means
that enough data has been read to know the size of the image that
will be allocated.  If the loader has not received enough data via
'GI.GdkPixbuf.Objects.PixbufLoader.pixbufLoaderWrite', then this function returns 'Nothing'.  The
returned pixbuf will be the same in all future calls to the loader,
so simply calling 'GI.GObject.Objects.Object.objectRef' should be sufficient to continue
using it.  Additionally, if the loader is an animation, it will
return the \"static image\" of the animation
(see 'GI.GdkPixbuf.Objects.PixbufAnimation.pixbufAnimationGetStaticImage').
-}
pixbufLoaderGetPixbuf ::
    (B.CallStack.HasCallStack, MonadIO m, IsPixbufLoader a) =>
    a
    {- ^ /@loader@/: A pixbuf loader. -}
    -> m GdkPixbuf.Pixbuf.Pixbuf
    {- ^ __Returns:__ The 'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf' that the loader is creating, or 'Nothing' if not
enough data has been read to determine how to create the image buffer. -}
pixbufLoaderGetPixbuf loader = liftIO $ do
    loader' <- unsafeManagedPtrCastPtr loader
    result <- gdk_pixbuf_loader_get_pixbuf loader'
    checkUnexpectedReturnNULL "pixbufLoaderGetPixbuf" result
    result' <- (newObject GdkPixbuf.Pixbuf.Pixbuf) result
    touchManagedPtr loader
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufLoaderGetPixbufMethodInfo
instance (signature ~ (m GdkPixbuf.Pixbuf.Pixbuf), MonadIO m, IsPixbufLoader a) => O.MethodInfo PixbufLoaderGetPixbufMethodInfo a signature where
    overloadedMethod _ = pixbufLoaderGetPixbuf

#endif

-- method PixbufLoader::set_size
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "loader", argType = TInterface (Name {namespace = "GdkPixbuf", name = "PixbufLoader"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A pixbuf loader.", 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 desired width of the image being loaded.", 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 desired height of the image being loaded.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_pixbuf_loader_set_size" gdk_pixbuf_loader_set_size :: 
    Ptr PixbufLoader ->                     -- loader : TInterface (Name {namespace = "GdkPixbuf", name = "PixbufLoader"})
    Int32 ->                                -- width : TBasicType TInt
    Int32 ->                                -- height : TBasicType TInt
    IO ()

{- |
Causes the image to be scaled while it is loaded. The desired
image size can be determined relative to the original size of
the image by calling 'GI.GdkPixbuf.Objects.PixbufLoader.pixbufLoaderSetSize' from a
signal handler for the ::size-prepared signal.

Attempts to set the desired image size  are ignored after the
emission of the ::size-prepared signal.

@since 2.2
-}
pixbufLoaderSetSize ::
    (B.CallStack.HasCallStack, MonadIO m, IsPixbufLoader a) =>
    a
    {- ^ /@loader@/: A pixbuf loader. -}
    -> Int32
    {- ^ /@width@/: The desired width of the image being loaded. -}
    -> Int32
    {- ^ /@height@/: The desired height of the image being loaded. -}
    -> m ()
pixbufLoaderSetSize loader width height = liftIO $ do
    loader' <- unsafeManagedPtrCastPtr loader
    gdk_pixbuf_loader_set_size loader' width height
    touchManagedPtr loader
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufLoaderSetSizeMethodInfo
instance (signature ~ (Int32 -> Int32 -> m ()), MonadIO m, IsPixbufLoader a) => O.MethodInfo PixbufLoaderSetSizeMethodInfo a signature where
    overloadedMethod _ = pixbufLoaderSetSize

#endif

-- method PixbufLoader::write
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "loader", argType = TInterface (Name {namespace = "GdkPixbuf", name = "PixbufLoader"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A pixbuf loader.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "buf", argType = TCArray False (-1) 2 (TBasicType TUInt8), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Pointer to image data.", 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 "Length of the @buf buffer in bytes.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : [Arg {argCName = "count", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Length of the @buf buffer in bytes.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "gdk_pixbuf_loader_write" gdk_pixbuf_loader_write :: 
    Ptr PixbufLoader ->                     -- loader : TInterface (Name {namespace = "GdkPixbuf", name = "PixbufLoader"})
    Ptr Word8 ->                            -- buf : TCArray False (-1) 2 (TBasicType TUInt8)
    Word64 ->                               -- count : TBasicType TUInt64
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
This will cause a pixbuf loader to parse the next /@count@/ bytes of
an image.  It will return 'True' if the data was loaded successfully,
and 'False' if an error occurred.  In the latter case, the loader
will be closed, and will not accept further writes. If 'False' is
returned, /@error@/ will be set to an error from the @/GDK_PIXBUF_ERROR/@
or @/G_FILE_ERROR/@ domains.
-}
pixbufLoaderWrite ::
    (B.CallStack.HasCallStack, MonadIO m, IsPixbufLoader a) =>
    a
    {- ^ /@loader@/: A pixbuf loader. -}
    -> ByteString
    {- ^ /@buf@/: Pointer to image data. -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
pixbufLoaderWrite loader buf = liftIO $ do
    let count = fromIntegral $ B.length buf
    loader' <- unsafeManagedPtrCastPtr loader
    buf' <- packByteString buf
    onException (do
        _ <- propagateGError $ gdk_pixbuf_loader_write loader' buf' count
        touchManagedPtr loader
        freeMem buf'
        return ()
     ) (do
        freeMem buf'
     )

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufLoaderWriteMethodInfo
instance (signature ~ (ByteString -> m ()), MonadIO m, IsPixbufLoader a) => O.MethodInfo PixbufLoaderWriteMethodInfo a signature where
    overloadedMethod _ = pixbufLoaderWrite

#endif

-- method PixbufLoader::write_bytes
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "loader", argType = TInterface (Name {namespace = "GdkPixbuf", name = "PixbufLoader"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A pixbuf loader.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "buffer", argType = TInterface (Name {namespace = "GLib", name = "Bytes"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The image data as a #GBytes", 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 "gdk_pixbuf_loader_write_bytes" gdk_pixbuf_loader_write_bytes :: 
    Ptr PixbufLoader ->                     -- loader : TInterface (Name {namespace = "GdkPixbuf", name = "PixbufLoader"})
    Ptr GLib.Bytes.Bytes ->                 -- buffer : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
This will cause a pixbuf loader to parse a buffer inside a 'GI.GLib.Structs.Bytes.Bytes'
for an image.  It will return 'True' if the data was loaded successfully,
and 'False' if an error occurred.  In the latter case, the loader
will be closed, and will not accept further writes. If 'False' is
returned, /@error@/ will be set to an error from the @/GDK_PIXBUF_ERROR/@
or @/G_FILE_ERROR/@ domains.

See also: 'GI.GdkPixbuf.Objects.PixbufLoader.pixbufLoaderWrite'

@since 2.30
-}
pixbufLoaderWriteBytes ::
    (B.CallStack.HasCallStack, MonadIO m, IsPixbufLoader a) =>
    a
    {- ^ /@loader@/: A pixbuf loader. -}
    -> GLib.Bytes.Bytes
    {- ^ /@buffer@/: The image data as a 'GI.GLib.Structs.Bytes.Bytes' -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
pixbufLoaderWriteBytes loader buffer = liftIO $ do
    loader' <- unsafeManagedPtrCastPtr loader
    buffer' <- unsafeManagedPtrGetPtr buffer
    onException (do
        _ <- propagateGError $ gdk_pixbuf_loader_write_bytes loader' buffer'
        touchManagedPtr loader
        touchManagedPtr buffer
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufLoaderWriteBytesMethodInfo
instance (signature ~ (GLib.Bytes.Bytes -> m ()), MonadIO m, IsPixbufLoader a) => O.MethodInfo PixbufLoaderWriteBytesMethodInfo a signature where
    overloadedMethod _ = pixbufLoaderWriteBytes

#endif