{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GdkPixbuf.Objects.PixbufAnimationIter
(
PixbufAnimationIter(..) ,
IsPixbufAnimationIter ,
toPixbufAnimationIter ,
#if defined(ENABLE_OVERLOADING)
ResolvePixbufAnimationIterMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
PixbufAnimationIterAdvanceMethodInfo ,
#endif
pixbufAnimationIterAdvance ,
#if defined(ENABLE_OVERLOADING)
PixbufAnimationIterGetDelayTimeMethodInfo,
#endif
pixbufAnimationIterGetDelayTime ,
#if defined(ENABLE_OVERLOADING)
PixbufAnimationIterGetPixbufMethodInfo ,
#endif
pixbufAnimationIterGetPixbuf ,
#if defined(ENABLE_OVERLOADING)
PixbufAnimationIterOnCurrentlyLoadingFrameMethodInfo,
#endif
pixbufAnimationIterOnCurrentlyLoadingFrame,
) 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.TimeVal as GLib.TimeVal
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf
newtype PixbufAnimationIter = PixbufAnimationIter (SP.ManagedPtr PixbufAnimationIter)
deriving (PixbufAnimationIter -> PixbufAnimationIter -> Bool
(PixbufAnimationIter -> PixbufAnimationIter -> Bool)
-> (PixbufAnimationIter -> PixbufAnimationIter -> Bool)
-> Eq PixbufAnimationIter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PixbufAnimationIter -> PixbufAnimationIter -> Bool
$c/= :: PixbufAnimationIter -> PixbufAnimationIter -> Bool
== :: PixbufAnimationIter -> PixbufAnimationIter -> Bool
$c== :: PixbufAnimationIter -> PixbufAnimationIter -> Bool
Eq)
instance SP.ManagedPtrNewtype PixbufAnimationIter where
toManagedPtr :: PixbufAnimationIter -> ManagedPtr PixbufAnimationIter
toManagedPtr (PixbufAnimationIter ManagedPtr PixbufAnimationIter
p) = ManagedPtr PixbufAnimationIter
p
foreign import ccall "gdk_pixbuf_animation_iter_get_type"
c_gdk_pixbuf_animation_iter_get_type :: IO B.Types.GType
instance B.Types.TypedObject PixbufAnimationIter where
glibType :: IO GType
glibType = IO GType
c_gdk_pixbuf_animation_iter_get_type
instance B.Types.GObject PixbufAnimationIter
instance B.GValue.IsGValue PixbufAnimationIter where
toGValue :: PixbufAnimationIter -> IO GValue
toGValue PixbufAnimationIter
o = do
GType
gtype <- IO GType
c_gdk_pixbuf_animation_iter_get_type
PixbufAnimationIter
-> (Ptr PixbufAnimationIter -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr PixbufAnimationIter
o (GType
-> (GValue -> Ptr PixbufAnimationIter -> IO ())
-> Ptr PixbufAnimationIter
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr PixbufAnimationIter -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO PixbufAnimationIter
fromGValue GValue
gv = do
Ptr PixbufAnimationIter
ptr <- GValue -> IO (Ptr PixbufAnimationIter)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr PixbufAnimationIter)
(ManagedPtr PixbufAnimationIter -> PixbufAnimationIter)
-> Ptr PixbufAnimationIter -> IO PixbufAnimationIter
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr PixbufAnimationIter -> PixbufAnimationIter
PixbufAnimationIter Ptr PixbufAnimationIter
ptr
class (SP.GObject o, O.IsDescendantOf PixbufAnimationIter o) => IsPixbufAnimationIter o
instance (SP.GObject o, O.IsDescendantOf PixbufAnimationIter o) => IsPixbufAnimationIter o
instance O.HasParentTypes PixbufAnimationIter
type instance O.ParentTypes PixbufAnimationIter = '[GObject.Object.Object]
toPixbufAnimationIter :: (MonadIO m, IsPixbufAnimationIter o) => o -> m PixbufAnimationIter
toPixbufAnimationIter :: o -> m PixbufAnimationIter
toPixbufAnimationIter = IO PixbufAnimationIter -> m PixbufAnimationIter
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PixbufAnimationIter -> m PixbufAnimationIter)
-> (o -> IO PixbufAnimationIter) -> o -> m PixbufAnimationIter
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr PixbufAnimationIter -> PixbufAnimationIter)
-> o -> IO PixbufAnimationIter
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr PixbufAnimationIter -> PixbufAnimationIter
PixbufAnimationIter
#if defined(ENABLE_OVERLOADING)
type family ResolvePixbufAnimationIterMethod (t :: Symbol) (o :: *) :: * where
ResolvePixbufAnimationIterMethod "advance" o = PixbufAnimationIterAdvanceMethodInfo
ResolvePixbufAnimationIterMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolvePixbufAnimationIterMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolvePixbufAnimationIterMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolvePixbufAnimationIterMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolvePixbufAnimationIterMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolvePixbufAnimationIterMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolvePixbufAnimationIterMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolvePixbufAnimationIterMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolvePixbufAnimationIterMethod "onCurrentlyLoadingFrame" o = PixbufAnimationIterOnCurrentlyLoadingFrameMethodInfo
ResolvePixbufAnimationIterMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolvePixbufAnimationIterMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolvePixbufAnimationIterMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolvePixbufAnimationIterMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolvePixbufAnimationIterMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolvePixbufAnimationIterMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolvePixbufAnimationIterMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolvePixbufAnimationIterMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolvePixbufAnimationIterMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolvePixbufAnimationIterMethod "getDelayTime" o = PixbufAnimationIterGetDelayTimeMethodInfo
ResolvePixbufAnimationIterMethod "getPixbuf" o = PixbufAnimationIterGetPixbufMethodInfo
ResolvePixbufAnimationIterMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolvePixbufAnimationIterMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolvePixbufAnimationIterMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolvePixbufAnimationIterMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolvePixbufAnimationIterMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolvePixbufAnimationIterMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolvePixbufAnimationIterMethod t PixbufAnimationIter, O.MethodInfo info PixbufAnimationIter p) => OL.IsLabel t (PixbufAnimationIter -> 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 PixbufAnimationIter
type instance O.AttributeList PixbufAnimationIter = PixbufAnimationIterAttributeList
type PixbufAnimationIterAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList PixbufAnimationIter = PixbufAnimationIterSignalList
type PixbufAnimationIterSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gdk_pixbuf_animation_iter_advance" gdk_pixbuf_animation_iter_advance ::
Ptr PixbufAnimationIter ->
Ptr GLib.TimeVal.TimeVal ->
IO CInt
pixbufAnimationIterAdvance ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbufAnimationIter a) =>
a
-> Maybe (GLib.TimeVal.TimeVal)
-> m Bool
pixbufAnimationIterAdvance :: a -> Maybe TimeVal -> m Bool
pixbufAnimationIterAdvance a
iter Maybe TimeVal
currentTime = 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 PixbufAnimationIter
iter' <- a -> IO (Ptr PixbufAnimationIter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
iter
Ptr TimeVal
maybeCurrentTime <- case Maybe TimeVal
currentTime of
Maybe TimeVal
Nothing -> Ptr TimeVal -> IO (Ptr TimeVal)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TimeVal
forall a. Ptr a
nullPtr
Just TimeVal
jCurrentTime -> do
Ptr TimeVal
jCurrentTime' <- TimeVal -> IO (Ptr TimeVal)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TimeVal
jCurrentTime
Ptr TimeVal -> IO (Ptr TimeVal)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TimeVal
jCurrentTime'
CInt
result <- Ptr PixbufAnimationIter -> Ptr TimeVal -> IO CInt
gdk_pixbuf_animation_iter_advance Ptr PixbufAnimationIter
iter' Ptr TimeVal
maybeCurrentTime
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
iter
Maybe TimeVal -> (TimeVal -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe TimeVal
currentTime TimeVal -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data PixbufAnimationIterAdvanceMethodInfo
instance (signature ~ (Maybe (GLib.TimeVal.TimeVal) -> m Bool), MonadIO m, IsPixbufAnimationIter a) => O.MethodInfo PixbufAnimationIterAdvanceMethodInfo a signature where
overloadedMethod = pixbufAnimationIterAdvance
#endif
foreign import ccall "gdk_pixbuf_animation_iter_get_delay_time" gdk_pixbuf_animation_iter_get_delay_time ::
Ptr PixbufAnimationIter ->
IO Int32
pixbufAnimationIterGetDelayTime ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbufAnimationIter a) =>
a
-> m Int32
pixbufAnimationIterGetDelayTime :: a -> m Int32
pixbufAnimationIterGetDelayTime a
iter = 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 PixbufAnimationIter
iter' <- a -> IO (Ptr PixbufAnimationIter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
iter
Int32
result <- Ptr PixbufAnimationIter -> IO Int32
gdk_pixbuf_animation_iter_get_delay_time Ptr PixbufAnimationIter
iter'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
iter
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data PixbufAnimationIterGetDelayTimeMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsPixbufAnimationIter a) => O.MethodInfo PixbufAnimationIterGetDelayTimeMethodInfo a signature where
overloadedMethod = pixbufAnimationIterGetDelayTime
#endif
foreign import ccall "gdk_pixbuf_animation_iter_get_pixbuf" gdk_pixbuf_animation_iter_get_pixbuf ::
Ptr PixbufAnimationIter ->
IO (Ptr GdkPixbuf.Pixbuf.Pixbuf)
pixbufAnimationIterGetPixbuf ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbufAnimationIter a) =>
a
-> m GdkPixbuf.Pixbuf.Pixbuf
pixbufAnimationIterGetPixbuf :: a -> m Pixbuf
pixbufAnimationIterGetPixbuf a
iter = 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 PixbufAnimationIter
iter' <- a -> IO (Ptr PixbufAnimationIter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
iter
Ptr Pixbuf
result <- Ptr PixbufAnimationIter -> IO (Ptr Pixbuf)
gdk_pixbuf_animation_iter_get_pixbuf Ptr PixbufAnimationIter
iter'
Text -> Ptr Pixbuf -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pixbufAnimationIterGetPixbuf" 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
iter
Pixbuf -> IO Pixbuf
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result'
#if defined(ENABLE_OVERLOADING)
data PixbufAnimationIterGetPixbufMethodInfo
instance (signature ~ (m GdkPixbuf.Pixbuf.Pixbuf), MonadIO m, IsPixbufAnimationIter a) => O.MethodInfo PixbufAnimationIterGetPixbufMethodInfo a signature where
overloadedMethod = pixbufAnimationIterGetPixbuf
#endif
foreign import ccall "gdk_pixbuf_animation_iter_on_currently_loading_frame" gdk_pixbuf_animation_iter_on_currently_loading_frame ::
Ptr PixbufAnimationIter ->
IO CInt
pixbufAnimationIterOnCurrentlyLoadingFrame ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbufAnimationIter a) =>
a
-> m Bool
pixbufAnimationIterOnCurrentlyLoadingFrame :: a -> m Bool
pixbufAnimationIterOnCurrentlyLoadingFrame a
iter = 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 PixbufAnimationIter
iter' <- a -> IO (Ptr PixbufAnimationIter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
iter
CInt
result <- Ptr PixbufAnimationIter -> IO CInt
gdk_pixbuf_animation_iter_on_currently_loading_frame Ptr PixbufAnimationIter
iter'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
iter
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data PixbufAnimationIterOnCurrentlyLoadingFrameMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsPixbufAnimationIter a) => O.MethodInfo PixbufAnimationIterOnCurrentlyLoadingFrameMethodInfo a signature where
overloadedMethod = pixbufAnimationIterOnCurrentlyLoadingFrame
#endif