{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GdkPixbuf.Objects.PixbufAnimation
(
PixbufAnimation(..) ,
IsPixbufAnimation ,
toPixbufAnimation ,
noPixbufAnimation ,
#if defined(ENABLE_OVERLOADING)
ResolvePixbufAnimationMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
PixbufAnimationGetHeightMethodInfo ,
#endif
pixbufAnimationGetHeight ,
#if defined(ENABLE_OVERLOADING)
PixbufAnimationGetIterMethodInfo ,
#endif
pixbufAnimationGetIter ,
#if defined(ENABLE_OVERLOADING)
PixbufAnimationGetStaticImageMethodInfo ,
#endif
pixbufAnimationGetStaticImage ,
#if defined(ENABLE_OVERLOADING)
PixbufAnimationGetWidthMethodInfo ,
#endif
pixbufAnimationGetWidth ,
#if defined(ENABLE_OVERLOADING)
PixbufAnimationIsStaticImageMethodInfo ,
#endif
pixbufAnimationIsStaticImage ,
pixbufAnimationNewFromFile ,
pixbufAnimationNewFromResource ,
pixbufAnimationNewFromStream ,
pixbufAnimationNewFromStreamAsync ,
pixbufAnimationNewFromStreamFinish ,
) 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.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 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.TimeVal as GLib.TimeVal
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.PixbufAnimationIter as GdkPixbuf.PixbufAnimationIter
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
newtype PixbufAnimation = PixbufAnimation (ManagedPtr PixbufAnimation)
deriving (PixbufAnimation -> PixbufAnimation -> Bool
(PixbufAnimation -> PixbufAnimation -> Bool)
-> (PixbufAnimation -> PixbufAnimation -> Bool)
-> Eq PixbufAnimation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PixbufAnimation -> PixbufAnimation -> Bool
$c/= :: PixbufAnimation -> PixbufAnimation -> Bool
== :: PixbufAnimation -> PixbufAnimation -> Bool
$c== :: PixbufAnimation -> PixbufAnimation -> Bool
Eq)
foreign import ccall "gdk_pixbuf_animation_get_type"
c_gdk_pixbuf_animation_get_type :: IO GType
instance GObject PixbufAnimation where
gobjectType :: IO GType
gobjectType = IO GType
c_gdk_pixbuf_animation_get_type
instance B.GValue.IsGValue PixbufAnimation where
toGValue :: PixbufAnimation -> IO GValue
toGValue o :: PixbufAnimation
o = do
GType
gtype <- IO GType
c_gdk_pixbuf_animation_get_type
PixbufAnimation -> (Ptr PixbufAnimation -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr PixbufAnimation
o (GType
-> (GValue -> Ptr PixbufAnimation -> IO ())
-> Ptr PixbufAnimation
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr PixbufAnimation -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO PixbufAnimation
fromGValue gv :: GValue
gv = do
Ptr PixbufAnimation
ptr <- GValue -> IO (Ptr PixbufAnimation)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr PixbufAnimation)
(ManagedPtr PixbufAnimation -> PixbufAnimation)
-> Ptr PixbufAnimation -> IO PixbufAnimation
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr PixbufAnimation -> PixbufAnimation
PixbufAnimation Ptr PixbufAnimation
ptr
class (GObject o, O.IsDescendantOf PixbufAnimation o) => IsPixbufAnimation o
instance (GObject o, O.IsDescendantOf PixbufAnimation o) => IsPixbufAnimation o
instance O.HasParentTypes PixbufAnimation
type instance O.ParentTypes PixbufAnimation = '[GObject.Object.Object]
toPixbufAnimation :: (MonadIO m, IsPixbufAnimation o) => o -> m PixbufAnimation
toPixbufAnimation :: o -> m PixbufAnimation
toPixbufAnimation = IO PixbufAnimation -> m PixbufAnimation
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PixbufAnimation -> m PixbufAnimation)
-> (o -> IO PixbufAnimation) -> o -> m PixbufAnimation
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr PixbufAnimation -> PixbufAnimation)
-> o -> IO PixbufAnimation
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr PixbufAnimation -> PixbufAnimation
PixbufAnimation
noPixbufAnimation :: Maybe PixbufAnimation
noPixbufAnimation :: Maybe PixbufAnimation
noPixbufAnimation = Maybe PixbufAnimation
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolvePixbufAnimationMethod (t :: Symbol) (o :: *) :: * where
ResolvePixbufAnimationMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolvePixbufAnimationMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolvePixbufAnimationMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolvePixbufAnimationMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolvePixbufAnimationMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolvePixbufAnimationMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolvePixbufAnimationMethod "isStaticImage" o = PixbufAnimationIsStaticImageMethodInfo
ResolvePixbufAnimationMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolvePixbufAnimationMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolvePixbufAnimationMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolvePixbufAnimationMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolvePixbufAnimationMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolvePixbufAnimationMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolvePixbufAnimationMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolvePixbufAnimationMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolvePixbufAnimationMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolvePixbufAnimationMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolvePixbufAnimationMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolvePixbufAnimationMethod "getHeight" o = PixbufAnimationGetHeightMethodInfo
ResolvePixbufAnimationMethod "getIter" o = PixbufAnimationGetIterMethodInfo
ResolvePixbufAnimationMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolvePixbufAnimationMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolvePixbufAnimationMethod "getStaticImage" o = PixbufAnimationGetStaticImageMethodInfo
ResolvePixbufAnimationMethod "getWidth" o = PixbufAnimationGetWidthMethodInfo
ResolvePixbufAnimationMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolvePixbufAnimationMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolvePixbufAnimationMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolvePixbufAnimationMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolvePixbufAnimationMethod t PixbufAnimation, O.MethodInfo info PixbufAnimation p) => OL.IsLabel t (PixbufAnimation -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList PixbufAnimation
type instance O.AttributeList PixbufAnimation = PixbufAnimationAttributeList
type PixbufAnimationAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList PixbufAnimation = PixbufAnimationSignalList
type PixbufAnimationSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gdk_pixbuf_animation_new_from_file" gdk_pixbuf_animation_new_from_file ::
CString ->
Ptr (Ptr GError) ->
IO (Ptr PixbufAnimation)
pixbufAnimationNewFromFile ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Char]
-> m PixbufAnimation
pixbufAnimationNewFromFile :: [Char] -> m PixbufAnimation
pixbufAnimationNewFromFile filename :: [Char]
filename = 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
CString
filename' <- [Char] -> IO CString
stringToCString [Char]
filename
IO PixbufAnimation -> IO () -> IO PixbufAnimation
forall a b. IO a -> IO b -> IO a
onException (do
Ptr PixbufAnimation
result <- (Ptr (Ptr GError) -> IO (Ptr PixbufAnimation))
-> IO (Ptr PixbufAnimation)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr PixbufAnimation))
-> IO (Ptr PixbufAnimation))
-> (Ptr (Ptr GError) -> IO (Ptr PixbufAnimation))
-> IO (Ptr PixbufAnimation)
forall a b. (a -> b) -> a -> b
$ CString -> Ptr (Ptr GError) -> IO (Ptr PixbufAnimation)
gdk_pixbuf_animation_new_from_file CString
filename'
Text -> Ptr PixbufAnimation -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "pixbufAnimationNewFromFile" 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
wrapObject ManagedPtr PixbufAnimation -> PixbufAnimation
PixbufAnimation) Ptr PixbufAnimation
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
PixbufAnimation -> IO PixbufAnimation
forall (m :: * -> *) a. Monad m => a -> m a
return PixbufAnimation
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_animation_new_from_resource" gdk_pixbuf_animation_new_from_resource ::
CString ->
Ptr (Ptr GError) ->
IO (Ptr PixbufAnimation)
pixbufAnimationNewFromResource ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m PixbufAnimation
pixbufAnimationNewFromResource :: Text -> m PixbufAnimation
pixbufAnimationNewFromResource resourcePath :: Text
resourcePath = 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
CString
resourcePath' <- Text -> IO CString
textToCString Text
resourcePath
IO PixbufAnimation -> IO () -> IO PixbufAnimation
forall a b. IO a -> IO b -> IO a
onException (do
Ptr PixbufAnimation
result <- (Ptr (Ptr GError) -> IO (Ptr PixbufAnimation))
-> IO (Ptr PixbufAnimation)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr PixbufAnimation))
-> IO (Ptr PixbufAnimation))
-> (Ptr (Ptr GError) -> IO (Ptr PixbufAnimation))
-> IO (Ptr PixbufAnimation)
forall a b. (a -> b) -> a -> b
$ CString -> Ptr (Ptr GError) -> IO (Ptr PixbufAnimation)
gdk_pixbuf_animation_new_from_resource CString
resourcePath'
Text -> Ptr PixbufAnimation -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "pixbufAnimationNewFromResource" 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
wrapObject ManagedPtr PixbufAnimation -> PixbufAnimation
PixbufAnimation) Ptr PixbufAnimation
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
resourcePath'
PixbufAnimation -> IO PixbufAnimation
forall (m :: * -> *) a. Monad m => a -> m a
return PixbufAnimation
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
resourcePath'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_animation_new_from_stream" gdk_pixbuf_animation_new_from_stream ::
Ptr Gio.InputStream.InputStream ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr PixbufAnimation)
pixbufAnimationNewFromStream ::
(B.CallStack.HasCallStack, MonadIO m, Gio.InputStream.IsInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m PixbufAnimation
pixbufAnimationNewFromStream :: a -> Maybe b -> m PixbufAnimation
pixbufAnimationNewFromStream stream :: a
stream cancellable :: Maybe b
cancellable = 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 InputStream
stream' <- a -> IO (Ptr InputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO PixbufAnimation -> IO () -> IO PixbufAnimation
forall a b. IO a -> IO b -> IO a
onException (do
Ptr PixbufAnimation
result <- (Ptr (Ptr GError) -> IO (Ptr PixbufAnimation))
-> IO (Ptr PixbufAnimation)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr PixbufAnimation))
-> IO (Ptr PixbufAnimation))
-> (Ptr (Ptr GError) -> IO (Ptr PixbufAnimation))
-> IO (Ptr PixbufAnimation)
forall a b. (a -> b) -> a -> b
$ Ptr InputStream
-> Ptr Cancellable -> Ptr (Ptr GError) -> IO (Ptr PixbufAnimation)
gdk_pixbuf_animation_new_from_stream Ptr InputStream
stream' Ptr Cancellable
maybeCancellable
Text -> Ptr PixbufAnimation -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "pixbufAnimationNewFromStream" 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
wrapObject ManagedPtr PixbufAnimation -> PixbufAnimation
PixbufAnimation) Ptr PixbufAnimation
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
PixbufAnimation -> IO PixbufAnimation
forall (m :: * -> *) a. Monad m => a -> m a
return PixbufAnimation
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_animation_new_from_stream_finish" gdk_pixbuf_animation_new_from_stream_finish ::
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr PixbufAnimation)
pixbufAnimationNewFromStreamFinish ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
a
-> m PixbufAnimation
pixbufAnimationNewFromStreamFinish :: a -> m PixbufAnimation
pixbufAnimationNewFromStreamFinish asyncResult :: a
asyncResult = 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 AsyncResult
asyncResult' <- a -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
asyncResult
IO PixbufAnimation -> IO () -> IO PixbufAnimation
forall a b. IO a -> IO b -> IO a
onException (do
Ptr PixbufAnimation
result <- (Ptr (Ptr GError) -> IO (Ptr PixbufAnimation))
-> IO (Ptr PixbufAnimation)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr PixbufAnimation))
-> IO (Ptr PixbufAnimation))
-> (Ptr (Ptr GError) -> IO (Ptr PixbufAnimation))
-> IO (Ptr PixbufAnimation)
forall a b. (a -> b) -> a -> b
$ Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr PixbufAnimation)
gdk_pixbuf_animation_new_from_stream_finish Ptr AsyncResult
asyncResult'
Text -> Ptr PixbufAnimation -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "pixbufAnimationNewFromStreamFinish" 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
wrapObject ManagedPtr PixbufAnimation -> PixbufAnimation
PixbufAnimation) Ptr PixbufAnimation
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
asyncResult
PixbufAnimation -> IO PixbufAnimation
forall (m :: * -> *) a. Monad m => a -> m a
return PixbufAnimation
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_animation_get_height" gdk_pixbuf_animation_get_height ::
Ptr PixbufAnimation ->
IO Int32
pixbufAnimationGetHeight ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbufAnimation a) =>
a
-> m Int32
pixbufAnimationGetHeight :: a -> m Int32
pixbufAnimationGetHeight animation :: a
animation = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr PixbufAnimation
animation' <- a -> IO (Ptr PixbufAnimation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
animation
Int32
result <- Ptr PixbufAnimation -> IO Int32
gdk_pixbuf_animation_get_height Ptr PixbufAnimation
animation'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
animation
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data PixbufAnimationGetHeightMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsPixbufAnimation a) => O.MethodInfo PixbufAnimationGetHeightMethodInfo a signature where
overloadedMethod = pixbufAnimationGetHeight
#endif
foreign import ccall "gdk_pixbuf_animation_get_iter" gdk_pixbuf_animation_get_iter ::
Ptr PixbufAnimation ->
Ptr GLib.TimeVal.TimeVal ->
IO (Ptr GdkPixbuf.PixbufAnimationIter.PixbufAnimationIter)
pixbufAnimationGetIter ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbufAnimation a) =>
a
-> Maybe (GLib.TimeVal.TimeVal)
-> m GdkPixbuf.PixbufAnimationIter.PixbufAnimationIter
pixbufAnimationGetIter :: a -> Maybe TimeVal -> m PixbufAnimationIter
pixbufAnimationGetIter animation :: a
animation startTime :: Maybe TimeVal
startTime = IO PixbufAnimationIter -> m PixbufAnimationIter
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PixbufAnimationIter -> m PixbufAnimationIter)
-> IO PixbufAnimationIter -> m PixbufAnimationIter
forall a b. (a -> b) -> a -> b
$ do
Ptr PixbufAnimation
animation' <- a -> IO (Ptr PixbufAnimation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
animation
Ptr TimeVal
maybeStartTime <- case Maybe TimeVal
startTime of
Nothing -> Ptr TimeVal -> IO (Ptr TimeVal)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TimeVal
forall a. Ptr a
nullPtr
Just jStartTime :: TimeVal
jStartTime -> do
Ptr TimeVal
jStartTime' <- TimeVal -> IO (Ptr TimeVal)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TimeVal
jStartTime
Ptr TimeVal -> IO (Ptr TimeVal)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TimeVal
jStartTime'
Ptr PixbufAnimationIter
result <- Ptr PixbufAnimation -> Ptr TimeVal -> IO (Ptr PixbufAnimationIter)
gdk_pixbuf_animation_get_iter Ptr PixbufAnimation
animation' Ptr TimeVal
maybeStartTime
Text -> Ptr PixbufAnimationIter -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "pixbufAnimationGetIter" Ptr PixbufAnimationIter
result
PixbufAnimationIter
result' <- ((ManagedPtr PixbufAnimationIter -> PixbufAnimationIter)
-> Ptr PixbufAnimationIter -> IO PixbufAnimationIter
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr PixbufAnimationIter -> PixbufAnimationIter
GdkPixbuf.PixbufAnimationIter.PixbufAnimationIter) Ptr PixbufAnimationIter
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
animation
Maybe TimeVal -> (TimeVal -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe TimeVal
startTime TimeVal -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
PixbufAnimationIter -> IO PixbufAnimationIter
forall (m :: * -> *) a. Monad m => a -> m a
return PixbufAnimationIter
result'
#if defined(ENABLE_OVERLOADING)
data PixbufAnimationGetIterMethodInfo
instance (signature ~ (Maybe (GLib.TimeVal.TimeVal) -> m GdkPixbuf.PixbufAnimationIter.PixbufAnimationIter), MonadIO m, IsPixbufAnimation a) => O.MethodInfo PixbufAnimationGetIterMethodInfo a signature where
overloadedMethod = pixbufAnimationGetIter
#endif
foreign import ccall "gdk_pixbuf_animation_get_static_image" gdk_pixbuf_animation_get_static_image ::
Ptr PixbufAnimation ->
IO (Ptr GdkPixbuf.Pixbuf.Pixbuf)
pixbufAnimationGetStaticImage ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbufAnimation a) =>
a
-> m GdkPixbuf.Pixbuf.Pixbuf
pixbufAnimationGetStaticImage :: a -> m Pixbuf
pixbufAnimationGetStaticImage animation :: a
animation = IO Pixbuf -> m Pixbuf
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Pixbuf -> m Pixbuf) -> IO Pixbuf -> m Pixbuf
forall a b. (a -> b) -> a -> b
$ do
Ptr PixbufAnimation
animation' <- a -> IO (Ptr PixbufAnimation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
animation
Ptr Pixbuf
result <- Ptr PixbufAnimation -> IO (Ptr Pixbuf)
gdk_pixbuf_animation_get_static_image Ptr PixbufAnimation
animation'
Text -> Ptr Pixbuf -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "pixbufAnimationGetStaticImage" Ptr Pixbuf
result
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
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
animation
Pixbuf -> IO Pixbuf
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result'
#if defined(ENABLE_OVERLOADING)
data PixbufAnimationGetStaticImageMethodInfo
instance (signature ~ (m GdkPixbuf.Pixbuf.Pixbuf), MonadIO m, IsPixbufAnimation a) => O.MethodInfo PixbufAnimationGetStaticImageMethodInfo a signature where
overloadedMethod = pixbufAnimationGetStaticImage
#endif
foreign import ccall "gdk_pixbuf_animation_get_width" gdk_pixbuf_animation_get_width ::
Ptr PixbufAnimation ->
IO Int32
pixbufAnimationGetWidth ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbufAnimation a) =>
a
-> m Int32
pixbufAnimationGetWidth :: a -> m Int32
pixbufAnimationGetWidth animation :: a
animation = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr PixbufAnimation
animation' <- a -> IO (Ptr PixbufAnimation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
animation
Int32
result <- Ptr PixbufAnimation -> IO Int32
gdk_pixbuf_animation_get_width Ptr PixbufAnimation
animation'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
animation
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data PixbufAnimationGetWidthMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsPixbufAnimation a) => O.MethodInfo PixbufAnimationGetWidthMethodInfo a signature where
overloadedMethod = pixbufAnimationGetWidth
#endif
foreign import ccall "gdk_pixbuf_animation_is_static_image" gdk_pixbuf_animation_is_static_image ::
Ptr PixbufAnimation ->
IO CInt
pixbufAnimationIsStaticImage ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbufAnimation a) =>
a
-> m Bool
pixbufAnimationIsStaticImage :: a -> m Bool
pixbufAnimationIsStaticImage animation :: a
animation = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr PixbufAnimation
animation' <- a -> IO (Ptr PixbufAnimation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
animation
CInt
result <- Ptr PixbufAnimation -> IO CInt
gdk_pixbuf_animation_is_static_image Ptr PixbufAnimation
animation'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
animation
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data PixbufAnimationIsStaticImageMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsPixbufAnimation a) => O.MethodInfo PixbufAnimationIsStaticImageMethodInfo a signature where
overloadedMethod = pixbufAnimationIsStaticImage
#endif
foreign import ccall "gdk_pixbuf_animation_new_from_stream_async" gdk_pixbuf_animation_new_from_stream_async ::
Ptr Gio.InputStream.InputStream ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
pixbufAnimationNewFromStreamAsync ::
(B.CallStack.HasCallStack, MonadIO m, Gio.InputStream.IsInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
pixbufAnimationNewFromStreamAsync :: a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
pixbufAnimationNewFromStreamAsync stream :: a
stream cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = 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 InputStream
stream' <- a -> IO (Ptr InputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr InputStream
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
gdk_pixbuf_animation_new_from_stream_async Ptr InputStream
stream' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif