{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- The GdkPixbufLoader struct contains only private
-- fields.

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

module GI.GdkPixbuf.Objects.PixbufLoader
    ( 

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


 -- * Methods
-- ** Overloaded methods #method:Overloaded methods#

#if defined(ENABLE_OVERLOADING)
    ResolvePixbufLoaderMethod               ,
#endif


-- ** close #method:close#

#if defined(ENABLE_OVERLOADING)
    PixbufLoaderCloseMethodInfo             ,
#endif
    pixbufLoaderClose                       ,


-- ** getAnimation #method:getAnimation#

#if defined(ENABLE_OVERLOADING)
    PixbufLoaderGetAnimationMethodInfo      ,
#endif
    pixbufLoaderGetAnimation                ,


-- ** getFormat #method:getFormat#

#if defined(ENABLE_OVERLOADING)
    PixbufLoaderGetFormatMethodInfo         ,
#endif
    pixbufLoaderGetFormat                   ,


-- ** getPixbuf #method:getPixbuf#

#if defined(ENABLE_OVERLOADING)
    PixbufLoaderGetPixbufMethodInfo         ,
#endif
    pixbufLoaderGetPixbuf                   ,


-- ** new #method:new#

    pixbufLoaderNew                         ,


-- ** newWithMimeType #method:newWithMimeType#

    pixbufLoaderNewWithMimeType             ,


-- ** newWithType #method:newWithType#

    pixbufLoaderNewWithType                 ,


-- ** setSize #method:setSize#

#if defined(ENABLE_OVERLOADING)
    PixbufLoaderSetSizeMethodInfo           ,
#endif
    pixbufLoaderSetSize                     ,


-- ** write #method:write#

#if defined(ENABLE_OVERLOADING)
    PixbufLoaderWriteMethodInfo             ,
#endif
    pixbufLoaderWrite                       ,


-- ** writeBytes #method:writeBytes#

#if defined(ENABLE_OVERLOADING)
    PixbufLoaderWriteBytesMethodInfo        ,
#endif
    pixbufLoaderWriteBytes                  ,




 -- * Signals
-- ** areaPrepared #signal:areaPrepared#

    C_PixbufLoaderAreaPreparedCallback      ,
    PixbufLoaderAreaPreparedCallback        ,
#if defined(ENABLE_OVERLOADING)
    PixbufLoaderAreaPreparedSignalInfo      ,
#endif
    afterPixbufLoaderAreaPrepared           ,
    genClosure_PixbufLoaderAreaPrepared     ,
    mk_PixbufLoaderAreaPreparedCallback     ,
    noPixbufLoaderAreaPreparedCallback      ,
    onPixbufLoaderAreaPrepared              ,
    wrap_PixbufLoaderAreaPreparedCallback   ,


-- ** areaUpdated #signal:areaUpdated#

    C_PixbufLoaderAreaUpdatedCallback       ,
    PixbufLoaderAreaUpdatedCallback         ,
#if defined(ENABLE_OVERLOADING)
    PixbufLoaderAreaUpdatedSignalInfo       ,
#endif
    afterPixbufLoaderAreaUpdated            ,
    genClosure_PixbufLoaderAreaUpdated      ,
    mk_PixbufLoaderAreaUpdatedCallback      ,
    noPixbufLoaderAreaUpdatedCallback       ,
    onPixbufLoaderAreaUpdated               ,
    wrap_PixbufLoaderAreaUpdatedCallback    ,


-- ** closed #signal:closed#

    C_PixbufLoaderClosedCallback            ,
    PixbufLoaderClosedCallback              ,
#if defined(ENABLE_OVERLOADING)
    PixbufLoaderClosedSignalInfo            ,
#endif
    afterPixbufLoaderClosed                 ,
    genClosure_PixbufLoaderClosed           ,
    mk_PixbufLoaderClosedCallback           ,
    noPixbufLoaderClosedCallback            ,
    onPixbufLoaderClosed                    ,
    wrap_PixbufLoaderClosedCallback         ,


-- ** sizePrepared #signal:sizePrepared#

    C_PixbufLoaderSizePreparedCallback      ,
    PixbufLoaderSizePreparedCallback        ,
#if defined(ENABLE_OVERLOADING)
    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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL

import 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

-- | Memory-managed wrapper type.
newtype PixbufLoader = PixbufLoader (SP.ManagedPtr PixbufLoader)
    deriving (PixbufLoader -> PixbufLoader -> Bool
(PixbufLoader -> PixbufLoader -> Bool)
-> (PixbufLoader -> PixbufLoader -> Bool) -> Eq PixbufLoader
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PixbufLoader -> PixbufLoader -> Bool
$c/= :: PixbufLoader -> PixbufLoader -> Bool
== :: PixbufLoader -> PixbufLoader -> Bool
$c== :: PixbufLoader -> PixbufLoader -> Bool
Eq)

instance SP.ManagedPtrNewtype PixbufLoader where
    toManagedPtr :: PixbufLoader -> ManagedPtr PixbufLoader
toManagedPtr (PixbufLoader ManagedPtr PixbufLoader
p) = ManagedPtr PixbufLoader
p

foreign import ccall "gdk_pixbuf_loader_get_type"
    c_gdk_pixbuf_loader_get_type :: IO B.Types.GType

instance B.Types.TypedObject PixbufLoader where
    glibType :: IO GType
glibType = IO GType
c_gdk_pixbuf_loader_get_type

instance B.Types.GObject PixbufLoader

-- | Convert 'PixbufLoader' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue PixbufLoader where
    toGValue :: PixbufLoader -> IO GValue
toGValue PixbufLoader
o = do
        GType
gtype <- IO GType
c_gdk_pixbuf_loader_get_type
        PixbufLoader -> (Ptr PixbufLoader -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr PixbufLoader
o (GType
-> (GValue -> Ptr PixbufLoader -> IO ())
-> Ptr PixbufLoader
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr PixbufLoader -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
        
    fromGValue :: GValue -> IO PixbufLoader
fromGValue GValue
gv = do
        Ptr PixbufLoader
ptr <- GValue -> IO (Ptr PixbufLoader)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr PixbufLoader)
        (ManagedPtr PixbufLoader -> PixbufLoader)
-> Ptr PixbufLoader -> IO PixbufLoader
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr PixbufLoader -> PixbufLoader
PixbufLoader Ptr PixbufLoader
ptr
        
    

-- | Type class for types which can be safely cast to `PixbufLoader`, for instance with `toPixbufLoader`.
class (SP.GObject o, O.IsDescendantOf PixbufLoader o) => IsPixbufLoader o
instance (SP.GObject o, O.IsDescendantOf PixbufLoader o) => IsPixbufLoader o

instance O.HasParentTypes PixbufLoader
type instance O.ParentTypes PixbufLoader = '[GObject.Object.Object]

-- | Cast to `PixbufLoader`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toPixbufLoader :: (MonadIO m, IsPixbufLoader o) => o -> m PixbufLoader
toPixbufLoader :: o -> m PixbufLoader
toPixbufLoader = IO PixbufLoader -> m PixbufLoader
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PixbufLoader -> m PixbufLoader)
-> (o -> IO PixbufLoader) -> o -> m PixbufLoader
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr PixbufLoader -> PixbufLoader) -> o -> IO PixbufLoader
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr PixbufLoader -> PixbufLoader
PixbufLoader

#if defined(ENABLE_OVERLOADING)
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 "getv" o = GObject.Object.ObjectGetvMethodInfo
    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 "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 "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    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) => OL.IsLabel t (PixbufLoader -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#endif

-- signal PixbufLoader::area-prepared
-- | This signal is emitted when the pixbuf loader has allocated the
-- pixbuf in the desired size.  After this signal is emitted,
-- applications can call 'GI.GdkPixbuf.Objects.PixbufLoader.pixbufLoaderGetPixbuf' to fetch
-- the partially-loaded pixbuf.
type PixbufLoaderAreaPreparedCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufLoaderAreaPreparedCallback`@.
noPixbufLoaderAreaPreparedCallback :: Maybe PixbufLoaderAreaPreparedCallback
noPixbufLoaderAreaPreparedCallback :: Maybe (IO ())
noPixbufLoaderAreaPreparedCallback = Maybe (IO ())
forall a. Maybe a
Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_PixbufLoaderAreaPreparedCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_PixbufLoaderAreaPrepared :: MonadIO m => PixbufLoaderAreaPreparedCallback -> m (GClosure C_PixbufLoaderAreaPreparedCallback)
genClosure_PixbufLoaderAreaPrepared :: IO () -> m (GClosure C_PixbufLoaderAreaPreparedCallback)
genClosure_PixbufLoaderAreaPrepared IO ()
cb = IO (GClosure C_PixbufLoaderAreaPreparedCallback)
-> m (GClosure C_PixbufLoaderAreaPreparedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PixbufLoaderAreaPreparedCallback)
 -> m (GClosure C_PixbufLoaderAreaPreparedCallback))
-> IO (GClosure C_PixbufLoaderAreaPreparedCallback)
-> m (GClosure C_PixbufLoaderAreaPreparedCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PixbufLoaderAreaPreparedCallback
cb' = IO () -> C_PixbufLoaderAreaPreparedCallback
wrap_PixbufLoaderAreaPreparedCallback IO ()
cb
    C_PixbufLoaderAreaPreparedCallback
-> IO (FunPtr C_PixbufLoaderAreaPreparedCallback)
mk_PixbufLoaderAreaPreparedCallback C_PixbufLoaderAreaPreparedCallback
cb' IO (FunPtr C_PixbufLoaderAreaPreparedCallback)
-> (FunPtr C_PixbufLoaderAreaPreparedCallback
    -> IO (GClosure C_PixbufLoaderAreaPreparedCallback))
-> IO (GClosure C_PixbufLoaderAreaPreparedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PixbufLoaderAreaPreparedCallback
-> IO (GClosure C_PixbufLoaderAreaPreparedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PixbufLoaderAreaPreparedCallback` into a `C_PixbufLoaderAreaPreparedCallback`.
wrap_PixbufLoaderAreaPreparedCallback ::
    PixbufLoaderAreaPreparedCallback ->
    C_PixbufLoaderAreaPreparedCallback
wrap_PixbufLoaderAreaPreparedCallback :: IO () -> C_PixbufLoaderAreaPreparedCallback
wrap_PixbufLoaderAreaPreparedCallback IO ()
_cb Ptr ()
_ Ptr ()
_ = do
    IO ()
_cb 


-- | Connect a signal handler for the [areaPrepared](#signal:areaPrepared) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' pixbufLoader #areaPrepared callback
-- @
-- 
-- 
onPixbufLoaderAreaPrepared :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderAreaPreparedCallback -> m SignalHandlerId
onPixbufLoaderAreaPrepared :: a -> IO () -> m SignalHandlerId
onPixbufLoaderAreaPrepared a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PixbufLoaderAreaPreparedCallback
cb' = IO () -> C_PixbufLoaderAreaPreparedCallback
wrap_PixbufLoaderAreaPreparedCallback IO ()
cb
    FunPtr C_PixbufLoaderAreaPreparedCallback
cb'' <- C_PixbufLoaderAreaPreparedCallback
-> IO (FunPtr C_PixbufLoaderAreaPreparedCallback)
mk_PixbufLoaderAreaPreparedCallback C_PixbufLoaderAreaPreparedCallback
cb'
    a
-> Text
-> FunPtr C_PixbufLoaderAreaPreparedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"area-prepared" FunPtr C_PixbufLoaderAreaPreparedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [areaPrepared](#signal:areaPrepared) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' pixbufLoader #areaPrepared callback
-- @
-- 
-- 
afterPixbufLoaderAreaPrepared :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderAreaPreparedCallback -> m SignalHandlerId
afterPixbufLoaderAreaPrepared :: a -> IO () -> m SignalHandlerId
afterPixbufLoaderAreaPrepared a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PixbufLoaderAreaPreparedCallback
cb' = IO () -> C_PixbufLoaderAreaPreparedCallback
wrap_PixbufLoaderAreaPreparedCallback IO ()
cb
    FunPtr C_PixbufLoaderAreaPreparedCallback
cb'' <- C_PixbufLoaderAreaPreparedCallback
-> IO (FunPtr C_PixbufLoaderAreaPreparedCallback)
mk_PixbufLoaderAreaPreparedCallback C_PixbufLoaderAreaPreparedCallback
cb'
    a
-> Text
-> FunPtr C_PixbufLoaderAreaPreparedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"area-prepared" FunPtr C_PixbufLoaderAreaPreparedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


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

#endif

-- signal PixbufLoader::area-updated
-- | This signal is emitted when a significant area of the image being
-- loaded has been updated.  Normally it means that a complete
-- scanline has been read in, but it could be a different area as
-- well.  Applications can use this signal to know when to repaint
-- areas of an image that is being loaded.
type PixbufLoaderAreaUpdatedCallback =
    Int32
    -- ^ /@x@/: X offset of upper-left corner of the updated area.
    -> Int32
    -- ^ /@y@/: Y offset of upper-left corner of the updated area.
    -> Int32
    -- ^ /@width@/: Width of updated area.
    -> Int32
    -- ^ /@height@/: Height of updated area.
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufLoaderAreaUpdatedCallback`@.
noPixbufLoaderAreaUpdatedCallback :: Maybe PixbufLoaderAreaUpdatedCallback
noPixbufLoaderAreaUpdatedCallback :: Maybe PixbufLoaderAreaUpdatedCallback
noPixbufLoaderAreaUpdatedCallback = Maybe PixbufLoaderAreaUpdatedCallback
forall a. Maybe a
Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_PixbufLoaderAreaUpdatedCallback =
    Ptr () ->                               -- object
    Int32 ->
    Int32 ->
    Int32 ->
    Int32 ->
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_PixbufLoaderAreaUpdated :: MonadIO m => PixbufLoaderAreaUpdatedCallback -> m (GClosure C_PixbufLoaderAreaUpdatedCallback)
genClosure_PixbufLoaderAreaUpdated :: PixbufLoaderAreaUpdatedCallback
-> m (GClosure C_PixbufLoaderAreaUpdatedCallback)
genClosure_PixbufLoaderAreaUpdated PixbufLoaderAreaUpdatedCallback
cb = IO (GClosure C_PixbufLoaderAreaUpdatedCallback)
-> m (GClosure C_PixbufLoaderAreaUpdatedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PixbufLoaderAreaUpdatedCallback)
 -> m (GClosure C_PixbufLoaderAreaUpdatedCallback))
-> IO (GClosure C_PixbufLoaderAreaUpdatedCallback)
-> m (GClosure C_PixbufLoaderAreaUpdatedCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PixbufLoaderAreaUpdatedCallback
cb' = PixbufLoaderAreaUpdatedCallback
-> C_PixbufLoaderAreaUpdatedCallback
wrap_PixbufLoaderAreaUpdatedCallback PixbufLoaderAreaUpdatedCallback
cb
    C_PixbufLoaderAreaUpdatedCallback
-> IO (FunPtr C_PixbufLoaderAreaUpdatedCallback)
mk_PixbufLoaderAreaUpdatedCallback C_PixbufLoaderAreaUpdatedCallback
cb' IO (FunPtr C_PixbufLoaderAreaUpdatedCallback)
-> (FunPtr C_PixbufLoaderAreaUpdatedCallback
    -> IO (GClosure C_PixbufLoaderAreaUpdatedCallback))
-> IO (GClosure C_PixbufLoaderAreaUpdatedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PixbufLoaderAreaUpdatedCallback
-> IO (GClosure C_PixbufLoaderAreaUpdatedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PixbufLoaderAreaUpdatedCallback` into a `C_PixbufLoaderAreaUpdatedCallback`.
wrap_PixbufLoaderAreaUpdatedCallback ::
    PixbufLoaderAreaUpdatedCallback ->
    C_PixbufLoaderAreaUpdatedCallback
wrap_PixbufLoaderAreaUpdatedCallback :: PixbufLoaderAreaUpdatedCallback
-> C_PixbufLoaderAreaUpdatedCallback
wrap_PixbufLoaderAreaUpdatedCallback PixbufLoaderAreaUpdatedCallback
_cb Ptr ()
_ Int32
x Int32
y Int32
width Int32
height Ptr ()
_ = do
    PixbufLoaderAreaUpdatedCallback
_cb  Int32
x Int32
y Int32
width Int32
height


-- | Connect a signal handler for the [areaUpdated](#signal:areaUpdated) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' pixbufLoader #areaUpdated callback
-- @
-- 
-- 
onPixbufLoaderAreaUpdated :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderAreaUpdatedCallback -> m SignalHandlerId
onPixbufLoaderAreaUpdated :: a -> PixbufLoaderAreaUpdatedCallback -> m SignalHandlerId
onPixbufLoaderAreaUpdated a
obj PixbufLoaderAreaUpdatedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PixbufLoaderAreaUpdatedCallback
cb' = PixbufLoaderAreaUpdatedCallback
-> C_PixbufLoaderAreaUpdatedCallback
wrap_PixbufLoaderAreaUpdatedCallback PixbufLoaderAreaUpdatedCallback
cb
    FunPtr C_PixbufLoaderAreaUpdatedCallback
cb'' <- C_PixbufLoaderAreaUpdatedCallback
-> IO (FunPtr C_PixbufLoaderAreaUpdatedCallback)
mk_PixbufLoaderAreaUpdatedCallback C_PixbufLoaderAreaUpdatedCallback
cb'
    a
-> Text
-> FunPtr C_PixbufLoaderAreaUpdatedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"area-updated" FunPtr C_PixbufLoaderAreaUpdatedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [areaUpdated](#signal:areaUpdated) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' pixbufLoader #areaUpdated callback
-- @
-- 
-- 
afterPixbufLoaderAreaUpdated :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderAreaUpdatedCallback -> m SignalHandlerId
afterPixbufLoaderAreaUpdated :: a -> PixbufLoaderAreaUpdatedCallback -> m SignalHandlerId
afterPixbufLoaderAreaUpdated a
obj PixbufLoaderAreaUpdatedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PixbufLoaderAreaUpdatedCallback
cb' = PixbufLoaderAreaUpdatedCallback
-> C_PixbufLoaderAreaUpdatedCallback
wrap_PixbufLoaderAreaUpdatedCallback PixbufLoaderAreaUpdatedCallback
cb
    FunPtr C_PixbufLoaderAreaUpdatedCallback
cb'' <- C_PixbufLoaderAreaUpdatedCallback
-> IO (FunPtr C_PixbufLoaderAreaUpdatedCallback)
mk_PixbufLoaderAreaUpdatedCallback C_PixbufLoaderAreaUpdatedCallback
cb'
    a
-> Text
-> FunPtr C_PixbufLoaderAreaUpdatedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"area-updated" FunPtr C_PixbufLoaderAreaUpdatedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data PixbufLoaderAreaUpdatedSignalInfo
instance SignalInfo PixbufLoaderAreaUpdatedSignalInfo where
    type HaskellCallbackType PixbufLoaderAreaUpdatedSignalInfo = PixbufLoaderAreaUpdatedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_PixbufLoaderAreaUpdatedCallback cb
        cb'' <- mk_PixbufLoaderAreaUpdatedCallback cb'
        connectSignalFunPtr obj "area-updated" cb'' connectMode detail

#endif

-- signal PixbufLoader::closed
-- | This signal is emitted when 'GI.GdkPixbuf.Objects.PixbufLoader.pixbufLoaderClose' is called.
-- It can be used by different parts of an application to receive
-- notification when an image loader is closed by the code that
-- drives it.
type PixbufLoaderClosedCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufLoaderClosedCallback`@.
noPixbufLoaderClosedCallback :: Maybe PixbufLoaderClosedCallback
noPixbufLoaderClosedCallback :: Maybe (IO ())
noPixbufLoaderClosedCallback = Maybe (IO ())
forall a. Maybe a
Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_PixbufLoaderClosedCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_PixbufLoaderClosed :: MonadIO m => PixbufLoaderClosedCallback -> m (GClosure C_PixbufLoaderClosedCallback)
genClosure_PixbufLoaderClosed :: IO () -> m (GClosure C_PixbufLoaderAreaPreparedCallback)
genClosure_PixbufLoaderClosed IO ()
cb = IO (GClosure C_PixbufLoaderAreaPreparedCallback)
-> m (GClosure C_PixbufLoaderAreaPreparedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PixbufLoaderAreaPreparedCallback)
 -> m (GClosure C_PixbufLoaderAreaPreparedCallback))
-> IO (GClosure C_PixbufLoaderAreaPreparedCallback)
-> m (GClosure C_PixbufLoaderAreaPreparedCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PixbufLoaderAreaPreparedCallback
cb' = IO () -> C_PixbufLoaderAreaPreparedCallback
wrap_PixbufLoaderClosedCallback IO ()
cb
    C_PixbufLoaderAreaPreparedCallback
-> IO (FunPtr C_PixbufLoaderAreaPreparedCallback)
mk_PixbufLoaderClosedCallback C_PixbufLoaderAreaPreparedCallback
cb' IO (FunPtr C_PixbufLoaderAreaPreparedCallback)
-> (FunPtr C_PixbufLoaderAreaPreparedCallback
    -> IO (GClosure C_PixbufLoaderAreaPreparedCallback))
-> IO (GClosure C_PixbufLoaderAreaPreparedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PixbufLoaderAreaPreparedCallback
-> IO (GClosure C_PixbufLoaderAreaPreparedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PixbufLoaderClosedCallback` into a `C_PixbufLoaderClosedCallback`.
wrap_PixbufLoaderClosedCallback ::
    PixbufLoaderClosedCallback ->
    C_PixbufLoaderClosedCallback
wrap_PixbufLoaderClosedCallback :: IO () -> C_PixbufLoaderAreaPreparedCallback
wrap_PixbufLoaderClosedCallback IO ()
_cb Ptr ()
_ Ptr ()
_ = do
    IO ()
_cb 


-- | Connect a signal handler for the [closed](#signal:closed) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' pixbufLoader #closed callback
-- @
-- 
-- 
onPixbufLoaderClosed :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderClosedCallback -> m SignalHandlerId
onPixbufLoaderClosed :: a -> IO () -> m SignalHandlerId
onPixbufLoaderClosed a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PixbufLoaderAreaPreparedCallback
cb' = IO () -> C_PixbufLoaderAreaPreparedCallback
wrap_PixbufLoaderClosedCallback IO ()
cb
    FunPtr C_PixbufLoaderAreaPreparedCallback
cb'' <- C_PixbufLoaderAreaPreparedCallback
-> IO (FunPtr C_PixbufLoaderAreaPreparedCallback)
mk_PixbufLoaderClosedCallback C_PixbufLoaderAreaPreparedCallback
cb'
    a
-> Text
-> FunPtr C_PixbufLoaderAreaPreparedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"closed" FunPtr C_PixbufLoaderAreaPreparedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [closed](#signal:closed) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' pixbufLoader #closed callback
-- @
-- 
-- 
afterPixbufLoaderClosed :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderClosedCallback -> m SignalHandlerId
afterPixbufLoaderClosed :: a -> IO () -> m SignalHandlerId
afterPixbufLoaderClosed a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PixbufLoaderAreaPreparedCallback
cb' = IO () -> C_PixbufLoaderAreaPreparedCallback
wrap_PixbufLoaderClosedCallback IO ()
cb
    FunPtr C_PixbufLoaderAreaPreparedCallback
cb'' <- C_PixbufLoaderAreaPreparedCallback
-> IO (FunPtr C_PixbufLoaderAreaPreparedCallback)
mk_PixbufLoaderClosedCallback C_PixbufLoaderAreaPreparedCallback
cb'
    a
-> Text
-> FunPtr C_PixbufLoaderAreaPreparedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"closed" FunPtr C_PixbufLoaderAreaPreparedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data PixbufLoaderClosedSignalInfo
instance SignalInfo PixbufLoaderClosedSignalInfo where
    type HaskellCallbackType PixbufLoaderClosedSignalInfo = PixbufLoaderClosedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_PixbufLoaderClosedCallback cb
        cb'' <- mk_PixbufLoaderClosedCallback cb'
        connectSignalFunPtr obj "closed" cb'' connectMode detail

#endif

-- signal PixbufLoader::size-prepared
-- | This signal is emitted when the pixbuf loader has been fed the
-- initial amount of data that is required to figure out the size
-- of the image that it will create.  Applications can call
-- 'GI.GdkPixbuf.Objects.PixbufLoader.pixbufLoaderSetSize' in response to this signal to set
-- the desired size to which the image should be scaled.
type PixbufLoaderSizePreparedCallback =
    Int32
    -- ^ /@width@/: the original width of the image
    -> Int32
    -- ^ /@height@/: the original height of the image
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `PixbufLoaderSizePreparedCallback`@.
noPixbufLoaderSizePreparedCallback :: Maybe PixbufLoaderSizePreparedCallback
noPixbufLoaderSizePreparedCallback :: Maybe PixbufLoaderSizePreparedCallback
noPixbufLoaderSizePreparedCallback = Maybe PixbufLoaderSizePreparedCallback
forall a. Maybe a
Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_PixbufLoaderSizePreparedCallback =
    Ptr () ->                               -- object
    Int32 ->
    Int32 ->
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_PixbufLoaderSizePrepared :: MonadIO m => PixbufLoaderSizePreparedCallback -> m (GClosure C_PixbufLoaderSizePreparedCallback)
genClosure_PixbufLoaderSizePrepared :: PixbufLoaderSizePreparedCallback
-> m (GClosure C_PixbufLoaderSizePreparedCallback)
genClosure_PixbufLoaderSizePrepared PixbufLoaderSizePreparedCallback
cb = IO (GClosure C_PixbufLoaderSizePreparedCallback)
-> m (GClosure C_PixbufLoaderSizePreparedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PixbufLoaderSizePreparedCallback)
 -> m (GClosure C_PixbufLoaderSizePreparedCallback))
-> IO (GClosure C_PixbufLoaderSizePreparedCallback)
-> m (GClosure C_PixbufLoaderSizePreparedCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PixbufLoaderSizePreparedCallback
cb' = PixbufLoaderSizePreparedCallback
-> C_PixbufLoaderSizePreparedCallback
wrap_PixbufLoaderSizePreparedCallback PixbufLoaderSizePreparedCallback
cb
    C_PixbufLoaderSizePreparedCallback
-> IO (FunPtr C_PixbufLoaderSizePreparedCallback)
mk_PixbufLoaderSizePreparedCallback C_PixbufLoaderSizePreparedCallback
cb' IO (FunPtr C_PixbufLoaderSizePreparedCallback)
-> (FunPtr C_PixbufLoaderSizePreparedCallback
    -> IO (GClosure C_PixbufLoaderSizePreparedCallback))
-> IO (GClosure C_PixbufLoaderSizePreparedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PixbufLoaderSizePreparedCallback
-> IO (GClosure C_PixbufLoaderSizePreparedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PixbufLoaderSizePreparedCallback` into a `C_PixbufLoaderSizePreparedCallback`.
wrap_PixbufLoaderSizePreparedCallback ::
    PixbufLoaderSizePreparedCallback ->
    C_PixbufLoaderSizePreparedCallback
wrap_PixbufLoaderSizePreparedCallback :: PixbufLoaderSizePreparedCallback
-> C_PixbufLoaderSizePreparedCallback
wrap_PixbufLoaderSizePreparedCallback PixbufLoaderSizePreparedCallback
_cb Ptr ()
_ Int32
width Int32
height Ptr ()
_ = do
    PixbufLoaderSizePreparedCallback
_cb  Int32
width Int32
height


-- | Connect a signal handler for the [sizePrepared](#signal:sizePrepared) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' pixbufLoader #sizePrepared callback
-- @
-- 
-- 
onPixbufLoaderSizePrepared :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderSizePreparedCallback -> m SignalHandlerId
onPixbufLoaderSizePrepared :: a -> PixbufLoaderSizePreparedCallback -> m SignalHandlerId
onPixbufLoaderSizePrepared a
obj PixbufLoaderSizePreparedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PixbufLoaderSizePreparedCallback
cb' = PixbufLoaderSizePreparedCallback
-> C_PixbufLoaderSizePreparedCallback
wrap_PixbufLoaderSizePreparedCallback PixbufLoaderSizePreparedCallback
cb
    FunPtr C_PixbufLoaderSizePreparedCallback
cb'' <- C_PixbufLoaderSizePreparedCallback
-> IO (FunPtr C_PixbufLoaderSizePreparedCallback)
mk_PixbufLoaderSizePreparedCallback C_PixbufLoaderSizePreparedCallback
cb'
    a
-> Text
-> FunPtr C_PixbufLoaderSizePreparedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"size-prepared" FunPtr C_PixbufLoaderSizePreparedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [sizePrepared](#signal:sizePrepared) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' pixbufLoader #sizePrepared callback
-- @
-- 
-- 
afterPixbufLoaderSizePrepared :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderSizePreparedCallback -> m SignalHandlerId
afterPixbufLoaderSizePrepared :: a -> PixbufLoaderSizePreparedCallback -> m SignalHandlerId
afterPixbufLoaderSizePrepared a
obj PixbufLoaderSizePreparedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PixbufLoaderSizePreparedCallback
cb' = PixbufLoaderSizePreparedCallback
-> C_PixbufLoaderSizePreparedCallback
wrap_PixbufLoaderSizePreparedCallback PixbufLoaderSizePreparedCallback
cb
    FunPtr C_PixbufLoaderSizePreparedCallback
cb'' <- C_PixbufLoaderSizePreparedCallback
-> IO (FunPtr C_PixbufLoaderSizePreparedCallback)
mk_PixbufLoaderSizePreparedCallback C_PixbufLoaderSizePreparedCallback
cb'
    a
-> Text
-> FunPtr C_PixbufLoaderSizePreparedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"size-prepared" FunPtr C_PixbufLoaderSizePreparedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data PixbufLoaderSizePreparedSignalInfo
instance SignalInfo PixbufLoaderSizePreparedSignalInfo where
    type HaskellCallbackType PixbufLoaderSizePreparedSignalInfo = PixbufLoaderSizePreparedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_PixbufLoaderSizePreparedCallback cb
        cb'' <- mk_PixbufLoaderSizePreparedCallback cb'
        connectSignalFunPtr obj "size-prepared" cb'' connectMode detail

#endif

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

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
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 :: m PixbufLoader
pixbufLoaderNew  = IO PixbufLoader -> m PixbufLoader
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PixbufLoader -> m PixbufLoader)
-> IO PixbufLoader -> m PixbufLoader
forall a b. (a -> b) -> a -> b
$ do
    Ptr PixbufLoader
result <- IO (Ptr PixbufLoader)
gdk_pixbuf_loader_new
    Text -> Ptr PixbufLoader -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pixbufLoaderNew" Ptr PixbufLoader
result
    PixbufLoader
result' <- ((ManagedPtr PixbufLoader -> PixbufLoader)
-> Ptr PixbufLoader -> IO PixbufLoader
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr PixbufLoader -> PixbufLoader
PixbufLoader) Ptr PixbufLoader
result
    PixbufLoader -> IO PixbufLoader
forall (m :: * -> *) a. Monad m => a -> m a
return PixbufLoader
result'

#if defined(ENABLE_OVERLOADING)
#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 t'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 :: Text -> m PixbufLoader
pixbufLoaderNewWithMimeType Text
mimeType = IO PixbufLoader -> m PixbufLoader
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PixbufLoader -> m PixbufLoader)
-> IO PixbufLoader -> m PixbufLoader
forall a b. (a -> b) -> a -> b
$ do
    CString
mimeType' <- Text -> IO CString
textToCString Text
mimeType
    IO PixbufLoader -> IO () -> IO PixbufLoader
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr PixbufLoader
result <- (Ptr (Ptr GError) -> IO (Ptr PixbufLoader))
-> IO (Ptr PixbufLoader)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr PixbufLoader))
 -> IO (Ptr PixbufLoader))
-> (Ptr (Ptr GError) -> IO (Ptr PixbufLoader))
-> IO (Ptr PixbufLoader)
forall a b. (a -> b) -> a -> b
$ CString -> Ptr (Ptr GError) -> IO (Ptr PixbufLoader)
gdk_pixbuf_loader_new_with_mime_type CString
mimeType'
        Text -> Ptr PixbufLoader -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pixbufLoaderNewWithMimeType" Ptr PixbufLoader
result
        PixbufLoader
result' <- ((ManagedPtr PixbufLoader -> PixbufLoader)
-> Ptr PixbufLoader -> IO PixbufLoader
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr PixbufLoader -> PixbufLoader
PixbufLoader) Ptr PixbufLoader
result
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
mimeType'
        PixbufLoader -> IO PixbufLoader
forall (m :: * -> *) a. Monad m => a -> m a
return PixbufLoader
result'
     ) (do
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
mimeType'
     )

#if defined(ENABLE_OVERLOADING)
#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 t'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 :: Text -> m PixbufLoader
pixbufLoaderNewWithType Text
imageType = IO PixbufLoader -> m PixbufLoader
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PixbufLoader -> m PixbufLoader)
-> IO PixbufLoader -> m PixbufLoader
forall a b. (a -> b) -> a -> b
$ do
    CString
imageType' <- Text -> IO CString
textToCString Text
imageType
    IO PixbufLoader -> IO () -> IO PixbufLoader
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr PixbufLoader
result <- (Ptr (Ptr GError) -> IO (Ptr PixbufLoader))
-> IO (Ptr PixbufLoader)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr PixbufLoader))
 -> IO (Ptr PixbufLoader))
-> (Ptr (Ptr GError) -> IO (Ptr PixbufLoader))
-> IO (Ptr PixbufLoader)
forall a b. (a -> b) -> a -> b
$ CString -> Ptr (Ptr GError) -> IO (Ptr PixbufLoader)
gdk_pixbuf_loader_new_with_type CString
imageType'
        Text -> Ptr PixbufLoader -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pixbufLoaderNewWithType" Ptr PixbufLoader
result
        PixbufLoader
result' <- ((ManagedPtr PixbufLoader -> PixbufLoader)
-> Ptr PixbufLoader -> IO PixbufLoader
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr PixbufLoader -> PixbufLoader
PixbufLoader) Ptr PixbufLoader
result
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
imageType'
        PixbufLoader -> IO PixbufLoader
forall (m :: * -> *) a. Monad m => a -> m a
return PixbufLoader
result'
     ) (do
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
imageType'
     )

#if defined(ENABLE_OVERLOADING)
#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 'P.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 'P.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 :: a -> m ()
pixbufLoaderClose a
loader = 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 PixbufLoader
loader' <- a -> IO (Ptr PixbufLoader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
loader
    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
$ Ptr PixbufLoader -> Ptr (Ptr GError) -> IO CInt
gdk_pixbuf_loader_close Ptr PixbufLoader
loader'
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
loader
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
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 t'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 'P.Nothing'.
pixbufLoaderGetAnimation ::
    (B.CallStack.HasCallStack, MonadIO m, IsPixbufLoader a) =>
    a
    -- ^ /@loader@/: A pixbuf loader
    -> m GdkPixbuf.PixbufAnimation.PixbufAnimation
    -- ^ __Returns:__ The t'GI.GdkPixbuf.Objects.PixbufAnimation.PixbufAnimation' that the loader is loading, or 'P.Nothing' if
    -- not enough data has been read to determine the information.
pixbufLoaderGetAnimation :: a -> m PixbufAnimation
pixbufLoaderGetAnimation a
loader = IO PixbufAnimation -> m PixbufAnimation
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PixbufAnimation -> m PixbufAnimation)
-> IO PixbufAnimation -> m PixbufAnimation
forall a b. (a -> b) -> a -> b
$ do
    Ptr PixbufLoader
loader' <- a -> IO (Ptr PixbufLoader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
loader
    Ptr PixbufAnimation
result <- Ptr PixbufLoader -> IO (Ptr PixbufAnimation)
gdk_pixbuf_loader_get_animation Ptr PixbufLoader
loader'
    Text -> Ptr PixbufAnimation -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pixbufLoaderGetAnimation" Ptr PixbufAnimation
result
    PixbufAnimation
result' <- ((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
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
loader
    PixbufAnimation -> IO PixbufAnimation
forall (m :: * -> *) a. Monad m => a -> m a
return PixbufAnimation
result'

#if defined(ENABLE_OVERLOADING)
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 t'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat' or
    -- 'P.Nothing'. The return value is owned by GdkPixbuf and should not be
    -- freed.
pixbufLoaderGetFormat :: a -> m (Maybe PixbufFormat)
pixbufLoaderGetFormat a
loader = IO (Maybe PixbufFormat) -> m (Maybe PixbufFormat)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe PixbufFormat) -> m (Maybe PixbufFormat))
-> IO (Maybe PixbufFormat) -> m (Maybe PixbufFormat)
forall a b. (a -> b) -> a -> b
$ do
    Ptr PixbufLoader
loader' <- a -> IO (Ptr PixbufLoader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
loader
    Ptr PixbufFormat
result <- Ptr PixbufLoader -> IO (Ptr PixbufFormat)
gdk_pixbuf_loader_get_format Ptr PixbufLoader
loader'
    Maybe PixbufFormat
maybeResult <- Ptr PixbufFormat
-> (Ptr PixbufFormat -> IO PixbufFormat) -> IO (Maybe PixbufFormat)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr PixbufFormat
result ((Ptr PixbufFormat -> IO PixbufFormat) -> IO (Maybe PixbufFormat))
-> (Ptr PixbufFormat -> IO PixbufFormat) -> IO (Maybe PixbufFormat)
forall a b. (a -> b) -> a -> b
$ \Ptr PixbufFormat
result' -> do
        PixbufFormat
result'' <- ((ManagedPtr PixbufFormat -> PixbufFormat)
-> Ptr PixbufFormat -> IO PixbufFormat
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr PixbufFormat -> PixbufFormat
GdkPixbuf.PixbufFormat.PixbufFormat) Ptr PixbufFormat
result'
        PixbufFormat -> IO PixbufFormat
forall (m :: * -> *) a. Monad m => a -> m a
return PixbufFormat
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
loader
    Maybe PixbufFormat -> IO (Maybe PixbufFormat)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe PixbufFormat
maybeResult

#if defined(ENABLE_OVERLOADING)
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 t'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 'P.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 (Maybe GdkPixbuf.Pixbuf.Pixbuf)
    -- ^ __Returns:__ The t'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf' that the loader is creating, or 'P.Nothing' if not
    -- enough data has been read to determine how to create the image buffer.
pixbufLoaderGetPixbuf :: a -> m (Maybe Pixbuf)
pixbufLoaderGetPixbuf a
loader = IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf))
-> IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ do
    Ptr PixbufLoader
loader' <- a -> IO (Ptr PixbufLoader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
loader
    Ptr Pixbuf
result <- Ptr PixbufLoader -> IO (Ptr Pixbuf)
gdk_pixbuf_loader_get_pixbuf Ptr PixbufLoader
loader'
    Maybe Pixbuf
maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pixbuf
result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf))
-> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
result' -> do
        Pixbuf
result'' <- ((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
result'
        Pixbuf -> IO Pixbuf
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
loader
    Maybe Pixbuf -> IO (Maybe Pixbuf)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pixbuf
maybeResult

#if defined(ENABLE_OVERLOADING)
data PixbufLoaderGetPixbufMethodInfo
instance (signature ~ (m (Maybe 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 [sizePrepared](#g:signal:sizePrepared) signal.
-- 
-- Attempts to set the desired image size  are ignored after the
-- emission of the [sizePrepared](#g:signal:sizePrepared) 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 :: a -> Int32 -> Int32 -> m ()
pixbufLoaderSetSize a
loader Int32
width Int32
height = 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 PixbufLoader
loader' <- a -> IO (Ptr PixbufLoader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
loader
    Ptr PixbufLoader -> PixbufLoaderSizePreparedCallback
gdk_pixbuf_loader_set_size Ptr PixbufLoader
loader' Int32
width Int32
height
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
loader
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
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 'P.True' if the data was loaded successfully,
-- and 'P.False' if an error occurred.  In the latter case, the loader
-- will be closed, and will not accept further writes. If 'P.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 :: a -> ByteString -> m ()
pixbufLoaderWrite a
loader ByteString
buf = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
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 PixbufLoader
loader' <- a -> IO (Ptr PixbufLoader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
loader
    Ptr Word8
buf' <- ByteString -> IO (Ptr Word8)
packByteString ByteString
buf
    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
$ Ptr PixbufLoader
-> Ptr Word8 -> Word64 -> Ptr (Ptr GError) -> IO CInt
gdk_pixbuf_loader_write Ptr PixbufLoader
loader' Ptr Word8
buf' Word64
count
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
loader
        Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
buf'
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
buf'
     )

#if defined(ENABLE_OVERLOADING)
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 t'GI.GLib.Structs.Bytes.Bytes'
-- for an image.  It will return 'P.True' if the data was loaded successfully,
-- and 'P.False' if an error occurred.  In the latter case, the loader
-- will be closed, and will not accept further writes. If 'P.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 t'GI.GLib.Structs.Bytes.Bytes'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
pixbufLoaderWriteBytes :: a -> Bytes -> m ()
pixbufLoaderWriteBytes a
loader Bytes
buffer = 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 PixbufLoader
loader' <- a -> IO (Ptr PixbufLoader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
loader
    Ptr Bytes
buffer' <- Bytes -> IO (Ptr Bytes)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bytes
buffer
    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
$ Ptr PixbufLoader -> Ptr Bytes -> Ptr (Ptr GError) -> IO CInt
gdk_pixbuf_loader_write_bytes Ptr PixbufLoader
loader' Ptr Bytes
buffer'
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
loader
        Bytes -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Bytes
buffer
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

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

#endif