{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gsk.Objects.MaskNode
(
MaskNode(..) ,
IsMaskNode ,
toMaskNode ,
#if defined(ENABLE_OVERLOADING)
ResolveMaskNodeMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
MaskNodeGetMaskMethodInfo ,
#endif
maskNodeGetMask ,
#if defined(ENABLE_OVERLOADING)
MaskNodeGetMaskModeMethodInfo ,
#endif
maskNodeGetMaskMode ,
#if defined(ENABLE_OVERLOADING)
MaskNodeGetSourceMethodInfo ,
#endif
maskNodeGetSource ,
maskNodeNew ,
) 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 {-# SOURCE #-} qualified GI.Gsk.Enums as Gsk.Enums
import {-# SOURCE #-} qualified GI.Gsk.Objects.RenderNode as Gsk.RenderNode
newtype MaskNode = MaskNode (SP.ManagedPtr MaskNode)
deriving (MaskNode -> MaskNode -> Bool
(MaskNode -> MaskNode -> Bool)
-> (MaskNode -> MaskNode -> Bool) -> Eq MaskNode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MaskNode -> MaskNode -> Bool
== :: MaskNode -> MaskNode -> Bool
$c/= :: MaskNode -> MaskNode -> Bool
/= :: MaskNode -> MaskNode -> Bool
Eq)
instance SP.ManagedPtrNewtype MaskNode where
toManagedPtr :: MaskNode -> ManagedPtr MaskNode
toManagedPtr (MaskNode ManagedPtr MaskNode
p) = ManagedPtr MaskNode
p
foreign import ccall "gsk_mask_node_get_type"
c_gsk_mask_node_get_type :: IO B.Types.GType
instance B.Types.TypedObject MaskNode where
glibType :: IO GType
glibType = IO GType
c_gsk_mask_node_get_type
class (SP.BoxedPtr o, SP.TypedObject o, O.IsDescendantOf MaskNode o) => IsMaskNode o
instance (SP.BoxedPtr o, SP.TypedObject o, O.IsDescendantOf MaskNode o) => IsMaskNode o
instance O.HasParentTypes MaskNode
type instance O.ParentTypes MaskNode = '[Gsk.RenderNode.RenderNode]
toMaskNode :: (MIO.MonadIO m, IsMaskNode o) => o -> m MaskNode
toMaskNode :: forall (m :: * -> *) o.
(MonadIO m, IsMaskNode o) =>
o -> m MaskNode
toMaskNode = IO MaskNode -> m MaskNode
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO MaskNode -> m MaskNode)
-> (o -> IO MaskNode) -> o -> m MaskNode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr MaskNode -> MaskNode) -> o -> IO MaskNode
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr MaskNode -> MaskNode
MaskNode
#if defined(ENABLE_OVERLOADING)
type family ResolveMaskNodeMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveMaskNodeMethod "draw" o = Gsk.RenderNode.RenderNodeDrawMethodInfo
ResolveMaskNodeMethod "ref" o = Gsk.RenderNode.RenderNodeRefMethodInfo
ResolveMaskNodeMethod "serialize" o = Gsk.RenderNode.RenderNodeSerializeMethodInfo
ResolveMaskNodeMethod "unref" o = Gsk.RenderNode.RenderNodeUnrefMethodInfo
ResolveMaskNodeMethod "writeToFile" o = Gsk.RenderNode.RenderNodeWriteToFileMethodInfo
ResolveMaskNodeMethod "getBounds" o = Gsk.RenderNode.RenderNodeGetBoundsMethodInfo
ResolveMaskNodeMethod "getMask" o = MaskNodeGetMaskMethodInfo
ResolveMaskNodeMethod "getMaskMode" o = MaskNodeGetMaskModeMethodInfo
ResolveMaskNodeMethod "getNodeType" o = Gsk.RenderNode.RenderNodeGetNodeTypeMethodInfo
ResolveMaskNodeMethod "getSource" o = MaskNodeGetSourceMethodInfo
ResolveMaskNodeMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveMaskNodeMethod t MaskNode, O.OverloadedMethod info MaskNode p) => OL.IsLabel t (MaskNode -> 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 ~ ResolveMaskNodeMethod t MaskNode, O.OverloadedMethod info MaskNode p, R.HasField t MaskNode p) => R.HasField t MaskNode p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveMaskNodeMethod t MaskNode, O.OverloadedMethodInfo info MaskNode) => OL.IsLabel t (O.MethodProxy info MaskNode) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
instance BoxedPtr MaskNode where
boxedPtrCopy :: MaskNode -> IO MaskNode
boxedPtrCopy = MaskNode -> IO MaskNode
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return
boxedPtrFree :: MaskNode -> IO ()
boxedPtrFree = \MaskNode
_x -> () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "gsk_mask_node_new" gsk_mask_node_new ::
Ptr Gsk.RenderNode.RenderNode ->
Ptr Gsk.RenderNode.RenderNode ->
CUInt ->
IO (Ptr MaskNode)
maskNodeNew ::
(B.CallStack.HasCallStack, MonadIO m, Gsk.RenderNode.IsRenderNode a, Gsk.RenderNode.IsRenderNode b) =>
a
-> b
-> Gsk.Enums.MaskMode
-> m MaskNode
maskNodeNew :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRenderNode a, IsRenderNode b) =>
a -> b -> MaskMode -> m MaskNode
maskNodeNew a
source b
mask MaskMode
maskMode = IO MaskNode -> m MaskNode
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MaskNode -> m MaskNode) -> IO MaskNode -> m MaskNode
forall a b. (a -> b) -> a -> b
$ do
Ptr RenderNode
source' <- a -> IO (Ptr RenderNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
source
Ptr RenderNode
mask' <- b -> IO (Ptr RenderNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
mask
let maskMode' :: CUInt
maskMode' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (MaskMode -> Int) -> MaskMode -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. MaskMode -> Int
forall a. Enum a => a -> Int
fromEnum) MaskMode
maskMode
Ptr MaskNode
result <- Ptr RenderNode -> Ptr RenderNode -> CUInt -> IO (Ptr MaskNode)
gsk_mask_node_new Ptr RenderNode
source' Ptr RenderNode
mask' CUInt
maskMode'
Text -> Ptr MaskNode -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"maskNodeNew" Ptr MaskNode
result
MaskNode
result' <- ((ManagedPtr MaskNode -> MaskNode) -> Ptr MaskNode -> IO MaskNode
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr MaskNode -> MaskNode
MaskNode) Ptr MaskNode
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
source
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
mask
MaskNode -> IO MaskNode
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return MaskNode
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gsk_mask_node_get_mask" gsk_mask_node_get_mask ::
Ptr MaskNode ->
IO (Ptr Gsk.RenderNode.RenderNode)
maskNodeGetMask ::
(B.CallStack.HasCallStack, MonadIO m, IsMaskNode a) =>
a
-> m Gsk.RenderNode.RenderNode
maskNodeGetMask :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMaskNode a) =>
a -> m RenderNode
maskNodeGetMask a
node = IO RenderNode -> m RenderNode
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RenderNode -> m RenderNode) -> IO RenderNode -> m RenderNode
forall a b. (a -> b) -> a -> b
$ do
Ptr MaskNode
node' <- a -> IO (Ptr MaskNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
node
Ptr RenderNode
result <- Ptr MaskNode -> IO (Ptr RenderNode)
gsk_mask_node_get_mask Ptr MaskNode
node'
Text -> Ptr RenderNode -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"maskNodeGetMask" Ptr RenderNode
result
RenderNode
result' <- ((ManagedPtr RenderNode -> RenderNode)
-> Ptr RenderNode -> IO RenderNode
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr RenderNode -> RenderNode
Gsk.RenderNode.RenderNode) Ptr RenderNode
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
node
RenderNode -> IO RenderNode
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return RenderNode
result'
#if defined(ENABLE_OVERLOADING)
data MaskNodeGetMaskMethodInfo
instance (signature ~ (m Gsk.RenderNode.RenderNode), MonadIO m, IsMaskNode a) => O.OverloadedMethod MaskNodeGetMaskMethodInfo a signature where
overloadedMethod = maskNodeGetMask
instance O.OverloadedMethodInfo MaskNodeGetMaskMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gsk.Objects.MaskNode.maskNodeGetMask",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.7/docs/GI-Gsk-Objects-MaskNode.html#v:maskNodeGetMask"
})
#endif
foreign import ccall "gsk_mask_node_get_mask_mode" gsk_mask_node_get_mask_mode ::
Ptr MaskNode ->
IO CUInt
maskNodeGetMaskMode ::
(B.CallStack.HasCallStack, MonadIO m, IsMaskNode a) =>
a
-> m Gsk.Enums.MaskMode
maskNodeGetMaskMode :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMaskNode a) =>
a -> m MaskMode
maskNodeGetMaskMode a
node = IO MaskMode -> m MaskMode
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MaskMode -> m MaskMode) -> IO MaskMode -> m MaskMode
forall a b. (a -> b) -> a -> b
$ do
Ptr MaskNode
node' <- a -> IO (Ptr MaskNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
node
CUInt
result <- Ptr MaskNode -> IO CUInt
gsk_mask_node_get_mask_mode Ptr MaskNode
node'
let result' :: MaskMode
result' = (Int -> MaskMode
forall a. Enum a => Int -> a
toEnum (Int -> MaskMode) -> (CUInt -> Int) -> CUInt -> MaskMode
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
node
MaskMode -> IO MaskMode
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return MaskMode
result'
#if defined(ENABLE_OVERLOADING)
data MaskNodeGetMaskModeMethodInfo
instance (signature ~ (m Gsk.Enums.MaskMode), MonadIO m, IsMaskNode a) => O.OverloadedMethod MaskNodeGetMaskModeMethodInfo a signature where
overloadedMethod = maskNodeGetMaskMode
instance O.OverloadedMethodInfo MaskNodeGetMaskModeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gsk.Objects.MaskNode.maskNodeGetMaskMode",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.7/docs/GI-Gsk-Objects-MaskNode.html#v:maskNodeGetMaskMode"
})
#endif
foreign import ccall "gsk_mask_node_get_source" gsk_mask_node_get_source ::
Ptr MaskNode ->
IO (Ptr Gsk.RenderNode.RenderNode)
maskNodeGetSource ::
(B.CallStack.HasCallStack, MonadIO m, IsMaskNode a) =>
a
-> m Gsk.RenderNode.RenderNode
maskNodeGetSource :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMaskNode a) =>
a -> m RenderNode
maskNodeGetSource a
node = IO RenderNode -> m RenderNode
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RenderNode -> m RenderNode) -> IO RenderNode -> m RenderNode
forall a b. (a -> b) -> a -> b
$ do
Ptr MaskNode
node' <- a -> IO (Ptr MaskNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
node
Ptr RenderNode
result <- Ptr MaskNode -> IO (Ptr RenderNode)
gsk_mask_node_get_source Ptr MaskNode
node'
Text -> Ptr RenderNode -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"maskNodeGetSource" Ptr RenderNode
result
RenderNode
result' <- ((ManagedPtr RenderNode -> RenderNode)
-> Ptr RenderNode -> IO RenderNode
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr RenderNode -> RenderNode
Gsk.RenderNode.RenderNode) Ptr RenderNode
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
node
RenderNode -> IO RenderNode
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return RenderNode
result'
#if defined(ENABLE_OVERLOADING)
data MaskNodeGetSourceMethodInfo
instance (signature ~ (m Gsk.RenderNode.RenderNode), MonadIO m, IsMaskNode a) => O.OverloadedMethod MaskNodeGetSourceMethodInfo a signature where
overloadedMethod = maskNodeGetSource
instance O.OverloadedMethodInfo MaskNodeGetSourceMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gsk.Objects.MaskNode.maskNodeGetSource",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.7/docs/GI-Gsk-Objects-MaskNode.html#v:maskNodeGetSource"
})
#endif