{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Cogl.Interfaces.Texture
(
Texture(..) ,
IsTexture ,
#if defined(ENABLE_OVERLOADING)
ResolveTextureMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
TextureAllocateMethodInfo ,
#endif
textureAllocate ,
#if defined(ENABLE_OVERLOADING)
TextureGetComponentsMethodInfo ,
#endif
textureGetComponents ,
#if defined(ENABLE_OVERLOADING)
TextureGetDataMethodInfo ,
#endif
textureGetData ,
#if defined(ENABLE_OVERLOADING)
TextureGetGlTextureMethodInfo ,
#endif
textureGetGlTexture ,
#if defined(ENABLE_OVERLOADING)
TextureGetHeightMethodInfo ,
#endif
textureGetHeight ,
#if defined(ENABLE_OVERLOADING)
TextureGetMaxWasteMethodInfo ,
#endif
textureGetMaxWaste ,
#if defined(ENABLE_OVERLOADING)
TextureGetPremultipliedMethodInfo ,
#endif
textureGetPremultiplied ,
#if defined(ENABLE_OVERLOADING)
TextureGetWidthMethodInfo ,
#endif
textureGetWidth ,
#if defined(ENABLE_OVERLOADING)
TextureIsSlicedMethodInfo ,
#endif
textureIsSliced ,
#if defined(ENABLE_OVERLOADING)
TextureSetComponentsMethodInfo ,
#endif
textureSetComponents ,
#if defined(ENABLE_OVERLOADING)
TextureSetPremultipliedMethodInfo ,
#endif
textureSetPremultiplied ,
#if defined(ENABLE_OVERLOADING)
TextureSetRegionMethodInfo ,
#endif
textureSetRegion ,
) 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.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 {-# SOURCE #-} qualified GI.Cogl.Enums as Cogl.Enums
newtype Texture = Texture (SP.ManagedPtr Texture)
deriving (Texture -> Texture -> Bool
(Texture -> Texture -> Bool)
-> (Texture -> Texture -> Bool) -> Eq Texture
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Texture -> Texture -> Bool
== :: Texture -> Texture -> Bool
$c/= :: Texture -> Texture -> Bool
/= :: Texture -> Texture -> Bool
Eq)
instance SP.ManagedPtrNewtype Texture where
toManagedPtr :: Texture -> ManagedPtr Texture
toManagedPtr (Texture ManagedPtr Texture
p) = ManagedPtr Texture
p
class (ManagedPtrNewtype o, O.IsDescendantOf Texture o) => IsTexture o
instance (ManagedPtrNewtype o, O.IsDescendantOf Texture o) => IsTexture o
instance BoxedPtr Texture where
boxedPtrCopy :: Texture -> IO Texture
boxedPtrCopy = Texture -> IO Texture
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return
boxedPtrFree :: Texture -> IO ()
boxedPtrFree = \Texture
_x -> () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
type family ResolveTextureMethod (t :: Symbol) (o :: *) :: * where
ResolveTextureMethod "allocate" o = TextureAllocateMethodInfo
ResolveTextureMethod "isSliced" o = TextureIsSlicedMethodInfo
ResolveTextureMethod "getComponents" o = TextureGetComponentsMethodInfo
ResolveTextureMethod "getData" o = TextureGetDataMethodInfo
ResolveTextureMethod "getGlTexture" o = TextureGetGlTextureMethodInfo
ResolveTextureMethod "getHeight" o = TextureGetHeightMethodInfo
ResolveTextureMethod "getMaxWaste" o = TextureGetMaxWasteMethodInfo
ResolveTextureMethod "getPremultiplied" o = TextureGetPremultipliedMethodInfo
ResolveTextureMethod "getWidth" o = TextureGetWidthMethodInfo
ResolveTextureMethod "setComponents" o = TextureSetComponentsMethodInfo
ResolveTextureMethod "setPremultiplied" o = TextureSetPremultipliedMethodInfo
ResolveTextureMethod "setRegion" o = TextureSetRegionMethodInfo
ResolveTextureMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTextureMethod t Texture, O.OverloadedMethod info Texture p) => OL.IsLabel t (Texture -> 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 ~ ResolveTextureMethod t Texture, O.OverloadedMethod info Texture p, R.HasField t Texture p) => R.HasField t Texture p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveTextureMethod t Texture, O.OverloadedMethodInfo info Texture) => OL.IsLabel t (O.MethodProxy info Texture) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
foreign import ccall "cogl_texture_allocate" cogl_texture_allocate ::
Ptr Texture ->
Ptr (Ptr GError) ->
IO Int32
textureAllocate ::
(B.CallStack.HasCallStack, MonadIO m, IsTexture a) =>
a
-> m Int32
textureAllocate :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTexture a) =>
a -> m Int32
textureAllocate a
texture = 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
Ptr Texture
texture' <- a -> IO (Ptr Texture)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
texture
IO Int32 -> IO () -> IO Int32
forall a b. IO a -> IO b -> IO a
onException (do
Int32
result <- (Ptr (Ptr GError) -> IO Int32) -> IO Int32
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Int32) -> IO Int32)
-> (Ptr (Ptr GError) -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ Ptr Texture -> Ptr (Ptr GError) -> IO Int32
cogl_texture_allocate Ptr Texture
texture'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
texture
Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
) (do
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data TextureAllocateMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsTexture a) => O.OverloadedMethod TextureAllocateMethodInfo a signature where
overloadedMethod = textureAllocate
instance O.OverloadedMethodInfo TextureAllocateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Cogl.Interfaces.Texture.textureAllocate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-cogl-1.0.3/docs/GI-Cogl-Interfaces-Texture.html#v:textureAllocate"
})
#endif
foreign import ccall "cogl_texture_get_components" cogl_texture_get_components ::
Ptr Texture ->
IO CUInt
textureGetComponents ::
(B.CallStack.HasCallStack, MonadIO m, IsTexture a) =>
a
-> m Cogl.Enums.TextureComponents
textureGetComponents :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTexture a) =>
a -> m TextureComponents
textureGetComponents a
texture = IO TextureComponents -> m TextureComponents
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TextureComponents -> m TextureComponents)
-> IO TextureComponents -> m TextureComponents
forall a b. (a -> b) -> a -> b
$ do
Ptr Texture
texture' <- a -> IO (Ptr Texture)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
texture
CUInt
result <- Ptr Texture -> IO CUInt
cogl_texture_get_components Ptr Texture
texture'
let result' :: TextureComponents
result' = (Int -> TextureComponents
forall a. Enum a => Int -> a
toEnum (Int -> TextureComponents)
-> (CUInt -> Int) -> CUInt -> TextureComponents
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
texture
TextureComponents -> IO TextureComponents
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return TextureComponents
result'
#if defined(ENABLE_OVERLOADING)
data TextureGetComponentsMethodInfo
instance (signature ~ (m Cogl.Enums.TextureComponents), MonadIO m, IsTexture a) => O.OverloadedMethod TextureGetComponentsMethodInfo a signature where
overloadedMethod = textureGetComponents
instance O.OverloadedMethodInfo TextureGetComponentsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Cogl.Interfaces.Texture.textureGetComponents",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-cogl-1.0.3/docs/GI-Cogl-Interfaces-Texture.html#v:textureGetComponents"
})
#endif
foreign import ccall "cogl_texture_get_data" cogl_texture_get_data ::
Ptr Texture ->
CUInt ->
Word32 ->
Word8 ->
IO Int32
textureGetData ::
(B.CallStack.HasCallStack, MonadIO m, IsTexture a) =>
a
-> Cogl.Enums.PixelFormat
-> Word32
-> Word8
-> m Int32
textureGetData :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTexture a) =>
a -> PixelFormat -> Word32 -> Word8 -> m Int32
textureGetData a
texture PixelFormat
format Word32
rowstride Word8
data_ = 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
Ptr Texture
texture' <- a -> IO (Ptr Texture)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
texture
let format' :: CUInt
format' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (PixelFormat -> Int) -> PixelFormat -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PixelFormat -> Int
forall a. Enum a => a -> Int
fromEnum) PixelFormat
format
Int32
result <- Ptr Texture -> CUInt -> Word32 -> Word8 -> IO Int32
cogl_texture_get_data Ptr Texture
texture' CUInt
format' Word32
rowstride Word8
data_
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
texture
Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data TextureGetDataMethodInfo
instance (signature ~ (Cogl.Enums.PixelFormat -> Word32 -> Word8 -> m Int32), MonadIO m, IsTexture a) => O.OverloadedMethod TextureGetDataMethodInfo a signature where
overloadedMethod = textureGetData
instance O.OverloadedMethodInfo TextureGetDataMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Cogl.Interfaces.Texture.textureGetData",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-cogl-1.0.3/docs/GI-Cogl-Interfaces-Texture.html#v:textureGetData"
})
#endif
foreign import ccall "cogl_texture_get_gl_texture" cogl_texture_get_gl_texture ::
Ptr Texture ->
Ptr Word32 ->
Ptr Word32 ->
IO Int32
textureGetGlTexture ::
(B.CallStack.HasCallStack, MonadIO m, IsTexture a) =>
a
-> m ((Int32, Word32, Word32))
textureGetGlTexture :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTexture a) =>
a -> m (Int32, Word32, Word32)
textureGetGlTexture a
texture = IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32))
-> IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Texture
texture' <- a -> IO (Ptr Texture)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
texture
Ptr Word32
outGlHandle <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
Ptr Word32
outGlTarget <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
Int32
result <- Ptr Texture -> Ptr Word32 -> Ptr Word32 -> IO Int32
cogl_texture_get_gl_texture Ptr Texture
texture' Ptr Word32
outGlHandle Ptr Word32
outGlTarget
Word32
outGlHandle' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
outGlHandle
Word32
outGlTarget' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
outGlTarget
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
texture
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
outGlHandle
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
outGlTarget
(Int32, Word32, Word32) -> IO (Int32, Word32, Word32)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
outGlHandle', Word32
outGlTarget')
#if defined(ENABLE_OVERLOADING)
data TextureGetGlTextureMethodInfo
instance (signature ~ (m ((Int32, Word32, Word32))), MonadIO m, IsTexture a) => O.OverloadedMethod TextureGetGlTextureMethodInfo a signature where
overloadedMethod = textureGetGlTexture
instance O.OverloadedMethodInfo TextureGetGlTextureMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Cogl.Interfaces.Texture.textureGetGlTexture",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-cogl-1.0.3/docs/GI-Cogl-Interfaces-Texture.html#v:textureGetGlTexture"
})
#endif
foreign import ccall "cogl_texture_get_height" cogl_texture_get_height ::
Ptr Texture ->
IO Word32
textureGetHeight ::
(B.CallStack.HasCallStack, MonadIO m, IsTexture a) =>
a
-> m Word32
textureGetHeight :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTexture a) =>
a -> m Word32
textureGetHeight a
texture = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr Texture
texture' <- a -> IO (Ptr Texture)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
texture
Word32
result <- Ptr Texture -> IO Word32
cogl_texture_get_height Ptr Texture
texture'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
texture
Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data TextureGetHeightMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsTexture a) => O.OverloadedMethod TextureGetHeightMethodInfo a signature where
overloadedMethod = textureGetHeight
instance O.OverloadedMethodInfo TextureGetHeightMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Cogl.Interfaces.Texture.textureGetHeight",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-cogl-1.0.3/docs/GI-Cogl-Interfaces-Texture.html#v:textureGetHeight"
})
#endif
foreign import ccall "cogl_texture_get_max_waste" cogl_texture_get_max_waste ::
Ptr Texture ->
IO Int32
textureGetMaxWaste ::
(B.CallStack.HasCallStack, MonadIO m, IsTexture a) =>
a
-> m Int32
textureGetMaxWaste :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTexture a) =>
a -> m Int32
textureGetMaxWaste a
texture = 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
Ptr Texture
texture' <- a -> IO (Ptr Texture)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
texture
Int32
result <- Ptr Texture -> IO Int32
cogl_texture_get_max_waste Ptr Texture
texture'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
texture
Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data TextureGetMaxWasteMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsTexture a) => O.OverloadedMethod TextureGetMaxWasteMethodInfo a signature where
overloadedMethod = textureGetMaxWaste
instance O.OverloadedMethodInfo TextureGetMaxWasteMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Cogl.Interfaces.Texture.textureGetMaxWaste",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-cogl-1.0.3/docs/GI-Cogl-Interfaces-Texture.html#v:textureGetMaxWaste"
})
#endif
foreign import ccall "cogl_texture_get_premultiplied" cogl_texture_get_premultiplied ::
Ptr Texture ->
IO Int32
textureGetPremultiplied ::
(B.CallStack.HasCallStack, MonadIO m, IsTexture a) =>
a
-> m Int32
textureGetPremultiplied :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTexture a) =>
a -> m Int32
textureGetPremultiplied a
texture = 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
Ptr Texture
texture' <- a -> IO (Ptr Texture)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
texture
Int32
result <- Ptr Texture -> IO Int32
cogl_texture_get_premultiplied Ptr Texture
texture'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
texture
Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data TextureGetPremultipliedMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsTexture a) => O.OverloadedMethod TextureGetPremultipliedMethodInfo a signature where
overloadedMethod = textureGetPremultiplied
instance O.OverloadedMethodInfo TextureGetPremultipliedMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Cogl.Interfaces.Texture.textureGetPremultiplied",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-cogl-1.0.3/docs/GI-Cogl-Interfaces-Texture.html#v:textureGetPremultiplied"
})
#endif
foreign import ccall "cogl_texture_get_width" cogl_texture_get_width ::
Ptr Texture ->
IO Word32
textureGetWidth ::
(B.CallStack.HasCallStack, MonadIO m, IsTexture a) =>
a
-> m Word32
textureGetWidth :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTexture a) =>
a -> m Word32
textureGetWidth a
texture = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr Texture
texture' <- a -> IO (Ptr Texture)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
texture
Word32
result <- Ptr Texture -> IO Word32
cogl_texture_get_width Ptr Texture
texture'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
texture
Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data TextureGetWidthMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsTexture a) => O.OverloadedMethod TextureGetWidthMethodInfo a signature where
overloadedMethod = textureGetWidth
instance O.OverloadedMethodInfo TextureGetWidthMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Cogl.Interfaces.Texture.textureGetWidth",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-cogl-1.0.3/docs/GI-Cogl-Interfaces-Texture.html#v:textureGetWidth"
})
#endif
foreign import ccall "cogl_texture_is_sliced" cogl_texture_is_sliced ::
Ptr Texture ->
IO Int32
textureIsSliced ::
(B.CallStack.HasCallStack, MonadIO m, IsTexture a) =>
a
-> m Int32
textureIsSliced :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTexture a) =>
a -> m Int32
textureIsSliced a
texture = 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
Ptr Texture
texture' <- a -> IO (Ptr Texture)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
texture
Int32
result <- Ptr Texture -> IO Int32
cogl_texture_is_sliced Ptr Texture
texture'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
texture
Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data TextureIsSlicedMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsTexture a) => O.OverloadedMethod TextureIsSlicedMethodInfo a signature where
overloadedMethod = textureIsSliced
instance O.OverloadedMethodInfo TextureIsSlicedMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Cogl.Interfaces.Texture.textureIsSliced",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-cogl-1.0.3/docs/GI-Cogl-Interfaces-Texture.html#v:textureIsSliced"
})
#endif
foreign import ccall "cogl_texture_set_components" cogl_texture_set_components ::
Ptr Texture ->
CUInt ->
IO ()
textureSetComponents ::
(B.CallStack.HasCallStack, MonadIO m, IsTexture a) =>
a
-> Cogl.Enums.TextureComponents
-> m ()
textureSetComponents :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTexture a) =>
a -> TextureComponents -> m ()
textureSetComponents a
texture TextureComponents
components = 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
Ptr Texture
texture' <- a -> IO (Ptr Texture)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
texture
let components' :: CUInt
components' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (TextureComponents -> Int) -> TextureComponents -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TextureComponents -> Int
forall a. Enum a => a -> Int
fromEnum) TextureComponents
components
Ptr Texture -> CUInt -> IO ()
cogl_texture_set_components Ptr Texture
texture' CUInt
components'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
texture
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TextureSetComponentsMethodInfo
instance (signature ~ (Cogl.Enums.TextureComponents -> m ()), MonadIO m, IsTexture a) => O.OverloadedMethod TextureSetComponentsMethodInfo a signature where
overloadedMethod = textureSetComponents
instance O.OverloadedMethodInfo TextureSetComponentsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Cogl.Interfaces.Texture.textureSetComponents",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-cogl-1.0.3/docs/GI-Cogl-Interfaces-Texture.html#v:textureSetComponents"
})
#endif
foreign import ccall "cogl_texture_set_premultiplied" cogl_texture_set_premultiplied ::
Ptr Texture ->
Int32 ->
IO ()
textureSetPremultiplied ::
(B.CallStack.HasCallStack, MonadIO m, IsTexture a) =>
a
-> Int32
-> m ()
textureSetPremultiplied :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTexture a) =>
a -> Int32 -> m ()
textureSetPremultiplied a
texture Int32
premultiplied = 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
Ptr Texture
texture' <- a -> IO (Ptr Texture)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
texture
Ptr Texture -> Int32 -> IO ()
cogl_texture_set_premultiplied Ptr Texture
texture' Int32
premultiplied
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
texture
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TextureSetPremultipliedMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsTexture a) => O.OverloadedMethod TextureSetPremultipliedMethodInfo a signature where
overloadedMethod = textureSetPremultiplied
instance O.OverloadedMethodInfo TextureSetPremultipliedMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Cogl.Interfaces.Texture.textureSetPremultiplied",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-cogl-1.0.3/docs/GI-Cogl-Interfaces-Texture.html#v:textureSetPremultiplied"
})
#endif
foreign import ccall "cogl_texture_set_region" cogl_texture_set_region ::
Ptr Texture ->
Int32 ->
Int32 ->
Int32 ->
Int32 ->
Word32 ->
Word32 ->
Int32 ->
Int32 ->
CUInt ->
Word32 ->
Word8 ->
IO Int32
textureSetRegion ::
(B.CallStack.HasCallStack, MonadIO m, IsTexture a) =>
a
-> Int32
-> Int32
-> Int32
-> Int32
-> Word32
-> Word32
-> Int32
-> Int32
-> Cogl.Enums.PixelFormat
-> Word32
-> Word8
-> m Int32
textureSetRegion :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTexture a) =>
a
-> Int32
-> Int32
-> Int32
-> Int32
-> Word32
-> Word32
-> Int32
-> Int32
-> PixelFormat
-> Word32
-> Word8
-> m Int32
textureSetRegion a
texture Int32
srcX Int32
srcY Int32
dstX Int32
dstY Word32
dstWidth Word32
dstHeight Int32
width Int32
height PixelFormat
format Word32
rowstride Word8
data_ = 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
Ptr Texture
texture' <- a -> IO (Ptr Texture)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
texture
let format' :: CUInt
format' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (PixelFormat -> Int) -> PixelFormat -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PixelFormat -> Int
forall a. Enum a => a -> Int
fromEnum) PixelFormat
format
Int32
result <- Ptr Texture
-> Int32
-> Int32
-> Int32
-> Int32
-> Word32
-> Word32
-> Int32
-> Int32
-> CUInt
-> Word32
-> Word8
-> IO Int32
cogl_texture_set_region Ptr Texture
texture' Int32
srcX Int32
srcY Int32
dstX Int32
dstY Word32
dstWidth Word32
dstHeight Int32
width Int32
height CUInt
format' Word32
rowstride Word8
data_
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
texture
Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data TextureSetRegionMethodInfo
instance (signature ~ (Int32 -> Int32 -> Int32 -> Int32 -> Word32 -> Word32 -> Int32 -> Int32 -> Cogl.Enums.PixelFormat -> Word32 -> Word8 -> m Int32), MonadIO m, IsTexture a) => O.OverloadedMethod TextureSetRegionMethodInfo a signature where
overloadedMethod = textureSetRegion
instance O.OverloadedMethodInfo TextureSetRegionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Cogl.Interfaces.Texture.textureSetRegion",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-cogl-1.0.3/docs/GI-Cogl-Interfaces-Texture.html#v:textureSetRegion"
})
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Texture = TextureSignalList
type TextureSignalList = ('[ ] :: [(Symbol, *)])
#endif