{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gsk.Objects.RepeatNode
(
RepeatNode(..) ,
IsRepeatNode ,
toRepeatNode ,
#if defined(ENABLE_OVERLOADING)
ResolveRepeatNodeMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
RepeatNodeGetChildMethodInfo ,
#endif
repeatNodeGetChild ,
#if defined(ENABLE_OVERLOADING)
RepeatNodeGetChildBoundsMethodInfo ,
#endif
repeatNodeGetChildBounds ,
repeatNodeNew ,
) 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.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 qualified GI.Graphene.Structs.Rect as Graphene.Rect
import {-# SOURCE #-} qualified GI.Gsk.Objects.RenderNode as Gsk.RenderNode
newtype RepeatNode = RepeatNode (SP.ManagedPtr RepeatNode)
deriving (RepeatNode -> RepeatNode -> Bool
(RepeatNode -> RepeatNode -> Bool)
-> (RepeatNode -> RepeatNode -> Bool) -> Eq RepeatNode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RepeatNode -> RepeatNode -> Bool
$c/= :: RepeatNode -> RepeatNode -> Bool
== :: RepeatNode -> RepeatNode -> Bool
$c== :: RepeatNode -> RepeatNode -> Bool
Eq)
instance SP.ManagedPtrNewtype RepeatNode where
toManagedPtr :: RepeatNode -> ManagedPtr RepeatNode
toManagedPtr (RepeatNode ManagedPtr RepeatNode
p) = ManagedPtr RepeatNode
p
foreign import ccall "gsk_repeat_node_get_type"
c_gsk_repeat_node_get_type :: IO B.Types.GType
instance B.Types.TypedObject RepeatNode where
glibType :: IO GType
glibType = IO GType
c_gsk_repeat_node_get_type
class (SP.BoxedPtr o, SP.TypedObject o, O.IsDescendantOf RepeatNode o) => IsRepeatNode o
instance (SP.BoxedPtr o, SP.TypedObject o, O.IsDescendantOf RepeatNode o) => IsRepeatNode o
instance O.HasParentTypes RepeatNode
type instance O.ParentTypes RepeatNode = '[Gsk.RenderNode.RenderNode]
toRepeatNode :: (MIO.MonadIO m, IsRepeatNode o) => o -> m RepeatNode
toRepeatNode :: forall (m :: * -> *) o.
(MonadIO m, IsRepeatNode o) =>
o -> m RepeatNode
toRepeatNode = IO RepeatNode -> m RepeatNode
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO RepeatNode -> m RepeatNode)
-> (o -> IO RepeatNode) -> o -> m RepeatNode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr RepeatNode -> RepeatNode) -> o -> IO RepeatNode
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr RepeatNode -> RepeatNode
RepeatNode
#if defined(ENABLE_OVERLOADING)
type family ResolveRepeatNodeMethod (t :: Symbol) (o :: *) :: * where
ResolveRepeatNodeMethod "draw" o = Gsk.RenderNode.RenderNodeDrawMethodInfo
ResolveRepeatNodeMethod "ref" o = Gsk.RenderNode.RenderNodeRefMethodInfo
ResolveRepeatNodeMethod "serialize" o = Gsk.RenderNode.RenderNodeSerializeMethodInfo
ResolveRepeatNodeMethod "unref" o = Gsk.RenderNode.RenderNodeUnrefMethodInfo
ResolveRepeatNodeMethod "writeToFile" o = Gsk.RenderNode.RenderNodeWriteToFileMethodInfo
ResolveRepeatNodeMethod "getBounds" o = Gsk.RenderNode.RenderNodeGetBoundsMethodInfo
ResolveRepeatNodeMethod "getChild" o = RepeatNodeGetChildMethodInfo
ResolveRepeatNodeMethod "getChildBounds" o = RepeatNodeGetChildBoundsMethodInfo
ResolveRepeatNodeMethod "getNodeType" o = Gsk.RenderNode.RenderNodeGetNodeTypeMethodInfo
ResolveRepeatNodeMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveRepeatNodeMethod t RepeatNode, O.OverloadedMethod info RepeatNode p) => OL.IsLabel t (RepeatNode -> 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 ~ ResolveRepeatNodeMethod t RepeatNode, O.OverloadedMethod info RepeatNode p, R.HasField t RepeatNode p) => R.HasField t RepeatNode p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveRepeatNodeMethod t RepeatNode, O.OverloadedMethodInfo info RepeatNode) => OL.IsLabel t (O.MethodProxy info RepeatNode) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
instance BoxedPtr RepeatNode where
boxedPtrCopy :: RepeatNode -> IO RepeatNode
boxedPtrCopy = RepeatNode -> IO RepeatNode
forall (m :: * -> *) a. Monad m => a -> m a
return
boxedPtrFree :: RepeatNode -> IO ()
boxedPtrFree = \RepeatNode
_x -> () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "gsk_repeat_node_new" gsk_repeat_node_new ::
Ptr Graphene.Rect.Rect ->
Ptr Gsk.RenderNode.RenderNode ->
Ptr Graphene.Rect.Rect ->
IO (Ptr RepeatNode)
repeatNodeNew ::
(B.CallStack.HasCallStack, MonadIO m, Gsk.RenderNode.IsRenderNode a) =>
Graphene.Rect.Rect
-> a
-> Maybe (Graphene.Rect.Rect)
-> m RepeatNode
repeatNodeNew :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRenderNode a) =>
Rect -> a -> Maybe Rect -> m RepeatNode
repeatNodeNew Rect
bounds a
child Maybe Rect
childBounds = IO RepeatNode -> m RepeatNode
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RepeatNode -> m RepeatNode) -> IO RepeatNode -> m RepeatNode
forall a b. (a -> b) -> a -> b
$ do
Ptr Rect
bounds' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
bounds
Ptr RenderNode
child' <- a -> IO (Ptr RenderNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
child
Ptr Rect
maybeChildBounds <- case Maybe Rect
childBounds of
Maybe Rect
Nothing -> Ptr Rect -> IO (Ptr Rect)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Rect
forall a. Ptr a
nullPtr
Just Rect
jChildBounds -> do
Ptr Rect
jChildBounds' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
jChildBounds
Ptr Rect -> IO (Ptr Rect)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Rect
jChildBounds'
Ptr RepeatNode
result <- Ptr Rect -> Ptr RenderNode -> Ptr Rect -> IO (Ptr RepeatNode)
gsk_repeat_node_new Ptr Rect
bounds' Ptr RenderNode
child' Ptr Rect
maybeChildBounds
Text -> Ptr RepeatNode -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"repeatNodeNew" Ptr RepeatNode
result
RepeatNode
result' <- ((ManagedPtr RepeatNode -> RepeatNode)
-> Ptr RepeatNode -> IO RepeatNode
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr RepeatNode -> RepeatNode
RepeatNode) Ptr RepeatNode
result
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
bounds
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
child
Maybe Rect -> (Rect -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Rect
childBounds Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
RepeatNode -> IO RepeatNode
forall (m :: * -> *) a. Monad m => a -> m a
return RepeatNode
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gsk_repeat_node_get_child" gsk_repeat_node_get_child ::
Ptr RepeatNode ->
IO (Ptr Gsk.RenderNode.RenderNode)
repeatNodeGetChild ::
(B.CallStack.HasCallStack, MonadIO m, IsRepeatNode a) =>
a
-> m Gsk.RenderNode.RenderNode
repeatNodeGetChild :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepeatNode a) =>
a -> m RenderNode
repeatNodeGetChild a
node = IO RenderNode -> m RenderNode
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 RepeatNode
node' <- a -> IO (Ptr RepeatNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
node
Ptr RenderNode
result <- Ptr RepeatNode -> IO (Ptr RenderNode)
gsk_repeat_node_get_child Ptr RepeatNode
node'
Text -> Ptr RenderNode -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"repeatNodeGetChild" 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 (m :: * -> *) a. Monad m => a -> m a
return RenderNode
result'
#if defined(ENABLE_OVERLOADING)
data RepeatNodeGetChildMethodInfo
instance (signature ~ (m Gsk.RenderNode.RenderNode), MonadIO m, IsRepeatNode a) => O.OverloadedMethod RepeatNodeGetChildMethodInfo a signature where
overloadedMethod = repeatNodeGetChild
instance O.OverloadedMethodInfo RepeatNodeGetChildMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gsk.Objects.RepeatNode.repeatNodeGetChild",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.4/docs/GI-Gsk-Objects-RepeatNode.html#v:repeatNodeGetChild"
})
#endif
foreign import ccall "gsk_repeat_node_get_child_bounds" gsk_repeat_node_get_child_bounds ::
Ptr RepeatNode ->
IO (Ptr Graphene.Rect.Rect)
repeatNodeGetChildBounds ::
(B.CallStack.HasCallStack, MonadIO m, IsRepeatNode a) =>
a
-> m Graphene.Rect.Rect
repeatNodeGetChildBounds :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepeatNode a) =>
a -> m Rect
repeatNodeGetChildBounds a
node = IO Rect -> m Rect
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rect -> m Rect) -> IO Rect -> m Rect
forall a b. (a -> b) -> a -> b
$ do
Ptr RepeatNode
node' <- a -> IO (Ptr RepeatNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
node
Ptr Rect
result <- Ptr RepeatNode -> IO (Ptr Rect)
gsk_repeat_node_get_child_bounds Ptr RepeatNode
node'
Text -> Ptr Rect -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"repeatNodeGetChildBounds" Ptr Rect
result
Rect
result' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Rect -> Rect
Graphene.Rect.Rect) Ptr Rect
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
node
Rect -> IO Rect
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
result'
#if defined(ENABLE_OVERLOADING)
data RepeatNodeGetChildBoundsMethodInfo
instance (signature ~ (m Graphene.Rect.Rect), MonadIO m, IsRepeatNode a) => O.OverloadedMethod RepeatNodeGetChildBoundsMethodInfo a signature where
overloadedMethod = repeatNodeGetChildBounds
instance O.OverloadedMethodInfo RepeatNodeGetChildBoundsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gsk.Objects.RepeatNode.repeatNodeGetChildBounds",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.4/docs/GI-Gsk-Objects-RepeatNode.html#v:repeatNodeGetChildBounds"
})
#endif