{-# 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 ,
#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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.TimeVal as GLib.TimeVal
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.GdkPixbuf.Callbacks as GdkPixbuf.Callbacks
import {-# SOURCE #-} qualified GI.GdkPixbuf.Enums as GdkPixbuf.Enums
import {-# SOURCE #-} qualified GI.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf
import {-# SOURCE #-} qualified GI.GdkPixbuf.Objects.PixbufAnimationIter as GdkPixbuf.PixbufAnimationIter
import {-# SOURCE #-} qualified GI.GdkPixbuf.Structs.PixbufFormat as GdkPixbuf.PixbufFormat
import {-# SOURCE #-} qualified GI.GdkPixbuf.Structs.PixbufModulePattern as GdkPixbuf.PixbufModulePattern
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.Icon as Gio.Icon
import qualified GI.Gio.Interfaces.LoadableIcon as Gio.LoadableIcon
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
#else
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
#endif
newtype PixbufAnimation = PixbufAnimation (SP.ManagedPtr PixbufAnimation)
deriving (PixbufAnimation -> PixbufAnimation -> Bool
(PixbufAnimation -> PixbufAnimation -> Bool)
-> (PixbufAnimation -> PixbufAnimation -> Bool)
-> Eq PixbufAnimation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PixbufAnimation -> PixbufAnimation -> Bool
== :: PixbufAnimation -> PixbufAnimation -> Bool
$c/= :: PixbufAnimation -> PixbufAnimation -> Bool
/= :: PixbufAnimation -> PixbufAnimation -> Bool
Eq)
instance SP.ManagedPtrNewtype PixbufAnimation where
toManagedPtr :: PixbufAnimation -> ManagedPtr PixbufAnimation
toManagedPtr (PixbufAnimation ManagedPtr PixbufAnimation
p) = ManagedPtr PixbufAnimation
p
foreign import ccall "gdk_pixbuf_animation_get_type"
c_gdk_pixbuf_animation_get_type :: IO B.Types.GType
instance B.Types.TypedObject PixbufAnimation where
glibType :: IO GType
glibType = IO GType
c_gdk_pixbuf_animation_get_type
instance B.Types.GObject PixbufAnimation
class (SP.GObject o, O.IsDescendantOf PixbufAnimation o) => IsPixbufAnimation o
instance (SP.GObject o, O.IsDescendantOf PixbufAnimation o) => IsPixbufAnimation o
instance O.HasParentTypes PixbufAnimation
type instance O.ParentTypes PixbufAnimation = '[GObject.Object.Object]
toPixbufAnimation :: (MIO.MonadIO m, IsPixbufAnimation o) => o -> m PixbufAnimation
toPixbufAnimation :: forall (m :: * -> *) o.
(MonadIO m, IsPixbufAnimation o) =>
o -> m PixbufAnimation
toPixbufAnimation = IO PixbufAnimation -> m PixbufAnimation
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr PixbufAnimation -> PixbufAnimation
PixbufAnimation
instance B.GValue.IsGValue (Maybe PixbufAnimation) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gdk_pixbuf_animation_get_type
gvalueSet_ :: Ptr GValue -> Maybe PixbufAnimation -> IO ()
gvalueSet_ Ptr GValue
gv Maybe PixbufAnimation
P.Nothing = Ptr GValue -> Ptr PixbufAnimation -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr PixbufAnimation
forall a. Ptr a
FP.nullPtr :: FP.Ptr PixbufAnimation)
gvalueSet_ Ptr GValue
gv (P.Just PixbufAnimation
obj) = PixbufAnimation -> (Ptr PixbufAnimation -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr PixbufAnimation
obj (Ptr GValue -> Ptr PixbufAnimation -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe PixbufAnimation)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr PixbufAnimation)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr PixbufAnimation)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject PixbufAnimation ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolvePixbufAnimationMethod (t :: Symbol) (o :: DK.Type) :: DK.Type 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.OverloadedMethod 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
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolvePixbufAnimationMethod t PixbufAnimation, O.OverloadedMethod info PixbufAnimation p, R.HasField t PixbufAnimation p) => R.HasField t PixbufAnimation p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolvePixbufAnimationMethod t PixbufAnimation, O.OverloadedMethodInfo info PixbufAnimation) => OL.IsLabel t (O.MethodProxy info PixbufAnimation) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList PixbufAnimation
type instance O.AttributeList PixbufAnimation = PixbufAnimationAttributeList
type PixbufAnimationAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList PixbufAnimation = PixbufAnimationSignalList
type PixbufAnimationSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "gdk_pixbuf_animation_new_from_file" gdk_pixbuf_animation_new_from_file ::
CString ->
Ptr (Ptr GError) ->
IO (Ptr PixbufAnimation)
{-# DEPRECATED pixbufAnimationNewFromFile ["(Since version 2.44)","Use a different image loading library for animatable assets"] #-}
pixbufAnimationNewFromFile ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Char]
-> m (Maybe PixbufAnimation)
pixbufAnimationNewFromFile :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
[Char] -> m (Maybe PixbufAnimation)
pixbufAnimationNewFromFile [Char]
filename = IO (Maybe PixbufAnimation) -> m (Maybe PixbufAnimation)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe PixbufAnimation) -> m (Maybe PixbufAnimation))
-> IO (Maybe PixbufAnimation) -> m (Maybe PixbufAnimation)
forall a b. (a -> b) -> a -> b
$ do
filename' <- [Char] -> IO CString
stringToCString [Char]
filename
onException (do
result <- propagateGError $ gdk_pixbuf_animation_new_from_file filename'
maybeResult <- convertIfNonNull result $ \Ptr PixbufAnimation
result' -> do
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'
return result''
freeMem filename'
return maybeResult
) (do
freeMem 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)
{-# DEPRECATED pixbufAnimationNewFromResource ["(Since version 2.44)","Use a different image loading library for animatable assets"] #-}
pixbufAnimationNewFromResource ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m (Maybe PixbufAnimation)
pixbufAnimationNewFromResource :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m (Maybe PixbufAnimation)
pixbufAnimationNewFromResource Text
resourcePath = IO (Maybe PixbufAnimation) -> m (Maybe PixbufAnimation)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe PixbufAnimation) -> m (Maybe PixbufAnimation))
-> IO (Maybe PixbufAnimation) -> m (Maybe PixbufAnimation)
forall a b. (a -> b) -> a -> b
$ do
resourcePath' <- Text -> IO CString
textToCString Text
resourcePath
onException (do
result <- propagateGError $ gdk_pixbuf_animation_new_from_resource resourcePath'
maybeResult <- convertIfNonNull result $ \Ptr PixbufAnimation
result' -> do
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'
return result''
freeMem resourcePath'
return maybeResult
) (do
freeMem 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)
{-# DEPRECATED pixbufAnimationNewFromStream ["(Since version 2.44)","Use a different image loading library for animatable assets"] #-}
pixbufAnimationNewFromStream ::
(B.CallStack.HasCallStack, MonadIO m, Gio.InputStream.IsInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m (Maybe PixbufAnimation)
pixbufAnimationNewFromStream :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsInputStream a, IsCancellable b) =>
a -> Maybe b -> m (Maybe PixbufAnimation)
pixbufAnimationNewFromStream a
stream Maybe b
cancellable = IO (Maybe PixbufAnimation) -> m (Maybe PixbufAnimation)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe PixbufAnimation) -> m (Maybe PixbufAnimation))
-> IO (Maybe PixbufAnimation) -> m (Maybe PixbufAnimation)
forall a b. (a -> b) -> a -> b
$ do
stream' <- a -> IO (Ptr InputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
onException (do
result <- propagateGError $ gdk_pixbuf_animation_new_from_stream stream' maybeCancellable
maybeResult <- convertIfNonNull result $ \Ptr PixbufAnimation
result' -> do
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'
return result''
touchManagedPtr stream
whenJust cancellable touchManagedPtr
return maybeResult
) (do
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)
{-# DEPRECATED pixbufAnimationNewFromStreamFinish ["(Since version 2.44)","Use a different image loading library for animatable assets"] #-}
pixbufAnimationNewFromStreamFinish ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
a
-> m (Maybe PixbufAnimation)
pixbufAnimationNewFromStreamFinish :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncResult a) =>
a -> m (Maybe PixbufAnimation)
pixbufAnimationNewFromStreamFinish a
asyncResult = IO (Maybe PixbufAnimation) -> m (Maybe PixbufAnimation)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe PixbufAnimation) -> m (Maybe PixbufAnimation))
-> IO (Maybe PixbufAnimation) -> m (Maybe PixbufAnimation)
forall a b. (a -> b) -> a -> b
$ do
asyncResult' <- a -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
asyncResult
onException (do
result <- propagateGError $ gdk_pixbuf_animation_new_from_stream_finish asyncResult'
maybeResult <- convertIfNonNull result $ \Ptr PixbufAnimation
result' -> do
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'
return result''
touchManagedPtr asyncResult
return maybeResult
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_animation_get_height" gdk_pixbuf_animation_get_height ::
Ptr PixbufAnimation ->
IO Int32
{-# DEPRECATED pixbufAnimationGetHeight ["(Since version 2.44)","Use a different image loading library for animatable assets"] #-}
pixbufAnimationGetHeight ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbufAnimation a) =>
a
-> m Int32
pixbufAnimationGetHeight :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbufAnimation a) =>
a -> m Int32
pixbufAnimationGetHeight a
animation = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
animation' <- a -> IO (Ptr PixbufAnimation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
animation
result <- gdk_pixbuf_animation_get_height animation'
touchManagedPtr animation
return result
#if defined(ENABLE_OVERLOADING)
data PixbufAnimationGetHeightMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsPixbufAnimation a) => O.OverloadedMethod PixbufAnimationGetHeightMethodInfo a signature where
overloadedMethod = pixbufAnimationGetHeight
instance O.OverloadedMethodInfo PixbufAnimationGetHeightMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.PixbufAnimation.pixbufAnimationGetHeight",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.32/docs/GI-GdkPixbuf-Objects-PixbufAnimation.html#v: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)
{-# DEPRECATED pixbufAnimationGetIter ["(Since version 2.44)","Use a different image loading library for animatable assets"] #-}
pixbufAnimationGetIter ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbufAnimation a) =>
a
-> Maybe (GLib.TimeVal.TimeVal)
-> m GdkPixbuf.PixbufAnimationIter.PixbufAnimationIter
pixbufAnimationGetIter :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbufAnimation a) =>
a -> Maybe TimeVal -> m PixbufAnimationIter
pixbufAnimationGetIter a
animation Maybe TimeVal
startTime = IO PixbufAnimationIter -> m PixbufAnimationIter
forall a. IO a -> m a
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
animation' <- a -> IO (Ptr PixbufAnimation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
animation
maybeStartTime <- case startTime of
Maybe TimeVal
Nothing -> Ptr TimeVal -> IO (Ptr TimeVal)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TimeVal
forall a. Ptr a
FP.nullPtr
Just TimeVal
jStartTime -> do
jStartTime' <- TimeVal -> IO (Ptr TimeVal)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TimeVal
jStartTime
return jStartTime'
result <- gdk_pixbuf_animation_get_iter animation' maybeStartTime
checkUnexpectedReturnNULL "pixbufAnimationGetIter" result
result' <- (wrapObject GdkPixbuf.PixbufAnimationIter.PixbufAnimationIter) result
touchManagedPtr animation
whenJust startTime touchManagedPtr
return result'
#if defined(ENABLE_OVERLOADING)
data PixbufAnimationGetIterMethodInfo
instance (signature ~ (Maybe (GLib.TimeVal.TimeVal) -> m GdkPixbuf.PixbufAnimationIter.PixbufAnimationIter), MonadIO m, IsPixbufAnimation a) => O.OverloadedMethod PixbufAnimationGetIterMethodInfo a signature where
overloadedMethod = pixbufAnimationGetIter
instance O.OverloadedMethodInfo PixbufAnimationGetIterMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.PixbufAnimation.pixbufAnimationGetIter",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.32/docs/GI-GdkPixbuf-Objects-PixbufAnimation.html#v:pixbufAnimationGetIter"
})
#endif
foreign import ccall "gdk_pixbuf_animation_get_static_image" gdk_pixbuf_animation_get_static_image ::
Ptr PixbufAnimation ->
IO (Ptr GdkPixbuf.Pixbuf.Pixbuf)
{-# DEPRECATED pixbufAnimationGetStaticImage ["(Since version 2.44)","Use a different image loading library for animatable assets"] #-}
pixbufAnimationGetStaticImage ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbufAnimation a) =>
a
-> m GdkPixbuf.Pixbuf.Pixbuf
pixbufAnimationGetStaticImage :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbufAnimation a) =>
a -> m Pixbuf
pixbufAnimationGetStaticImage a
animation = IO Pixbuf -> m Pixbuf
forall a. IO a -> m a
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
animation' <- a -> IO (Ptr PixbufAnimation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
animation
result <- gdk_pixbuf_animation_get_static_image animation'
checkUnexpectedReturnNULL "pixbufAnimationGetStaticImage" result
result' <- (newObject GdkPixbuf.Pixbuf.Pixbuf) result
touchManagedPtr animation
return result'
#if defined(ENABLE_OVERLOADING)
data PixbufAnimationGetStaticImageMethodInfo
instance (signature ~ (m GdkPixbuf.Pixbuf.Pixbuf), MonadIO m, IsPixbufAnimation a) => O.OverloadedMethod PixbufAnimationGetStaticImageMethodInfo a signature where
overloadedMethod = pixbufAnimationGetStaticImage
instance O.OverloadedMethodInfo PixbufAnimationGetStaticImageMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.PixbufAnimation.pixbufAnimationGetStaticImage",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.32/docs/GI-GdkPixbuf-Objects-PixbufAnimation.html#v:pixbufAnimationGetStaticImage"
})
#endif
foreign import ccall "gdk_pixbuf_animation_get_width" gdk_pixbuf_animation_get_width ::
Ptr PixbufAnimation ->
IO Int32
{-# DEPRECATED pixbufAnimationGetWidth ["(Since version 2.44)","Use a different image loading library for animatable assets"] #-}
pixbufAnimationGetWidth ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbufAnimation a) =>
a
-> m Int32
pixbufAnimationGetWidth :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbufAnimation a) =>
a -> m Int32
pixbufAnimationGetWidth a
animation = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
animation' <- a -> IO (Ptr PixbufAnimation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
animation
result <- gdk_pixbuf_animation_get_width animation'
touchManagedPtr animation
return result
#if defined(ENABLE_OVERLOADING)
data PixbufAnimationGetWidthMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsPixbufAnimation a) => O.OverloadedMethod PixbufAnimationGetWidthMethodInfo a signature where
overloadedMethod = pixbufAnimationGetWidth
instance O.OverloadedMethodInfo PixbufAnimationGetWidthMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.PixbufAnimation.pixbufAnimationGetWidth",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.32/docs/GI-GdkPixbuf-Objects-PixbufAnimation.html#v:pixbufAnimationGetWidth"
})
#endif
foreign import ccall "gdk_pixbuf_animation_is_static_image" gdk_pixbuf_animation_is_static_image ::
Ptr PixbufAnimation ->
IO CInt
{-# DEPRECATED pixbufAnimationIsStaticImage ["(Since version 2.44)","Use a different image loading library for animatable assets"] #-}
pixbufAnimationIsStaticImage ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbufAnimation a) =>
a
-> m Bool
pixbufAnimationIsStaticImage :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbufAnimation a) =>
a -> m Bool
pixbufAnimationIsStaticImage a
animation = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
animation' <- a -> IO (Ptr PixbufAnimation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
animation
result <- gdk_pixbuf_animation_is_static_image animation'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr animation
return result'
#if defined(ENABLE_OVERLOADING)
data PixbufAnimationIsStaticImageMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsPixbufAnimation a) => O.OverloadedMethod PixbufAnimationIsStaticImageMethodInfo a signature where
overloadedMethod = pixbufAnimationIsStaticImage
instance O.OverloadedMethodInfo PixbufAnimationIsStaticImageMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.PixbufAnimation.pixbufAnimationIsStaticImage",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.32/docs/GI-GdkPixbuf-Objects-PixbufAnimation.html#v: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 ()
{-# DEPRECATED pixbufAnimationNewFromStreamAsync ["(Since version 2.44)","Use a different image loading library for animatable assets"] #-}
pixbufAnimationNewFromStreamAsync ::
(B.CallStack.HasCallStack, MonadIO m, Gio.InputStream.IsInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
pixbufAnimationNewFromStreamAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsInputStream a, IsCancellable b) =>
a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
pixbufAnimationNewFromStreamAsync a
stream Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
stream' <- a -> IO (Ptr InputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
gdk_pixbuf_animation_new_from_stream_async stream' maybeCancellable maybeCallback userData
touchManagedPtr stream
whenJust cancellable touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
#endif