{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- The @ClutterPaintNode@ structure contains only private data
-- and it should be accessed using the provided API.
-- 
-- /Since: 1.10/

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Clutter.Objects.PaintNode
    ( 

-- * Exported types
    PaintNode(..)                           ,
    IsPaintNode                             ,
    toPaintNode                             ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [addChild]("GI.Clutter.Objects.PaintNode#g:method:addChild"), [addRectangle]("GI.Clutter.Objects.PaintNode#g:method:addRectangle"), [addTextureRectangle]("GI.Clutter.Objects.PaintNode#g:method:addTextureRectangle"), [ref]("GI.Clutter.Objects.PaintNode#g:method:ref"), [unref]("GI.Clutter.Objects.PaintNode#g:method:unref").
-- 
-- ==== Getters
-- /None/.
-- 
-- ==== Setters
-- [setName]("GI.Clutter.Objects.PaintNode#g:method:setName").

#if defined(ENABLE_OVERLOADING)
    ResolvePaintNodeMethod                  ,
#endif

-- ** addChild #method:addChild#

#if defined(ENABLE_OVERLOADING)
    PaintNodeAddChildMethodInfo             ,
#endif
    paintNodeAddChild                       ,


-- ** addRectangle #method:addRectangle#

#if defined(ENABLE_OVERLOADING)
    PaintNodeAddRectangleMethodInfo         ,
#endif
    paintNodeAddRectangle                   ,


-- ** addTextureRectangle #method:addTextureRectangle#

#if defined(ENABLE_OVERLOADING)
    PaintNodeAddTextureRectangleMethodInfo  ,
#endif
    paintNodeAddTextureRectangle            ,


-- ** ref #method:ref#

#if defined(ENABLE_OVERLOADING)
    PaintNodeRefMethodInfo                  ,
#endif
    paintNodeRef                            ,


-- ** setName #method:setName#

#if defined(ENABLE_OVERLOADING)
    PaintNodeSetNameMethodInfo              ,
#endif
    paintNodeSetName                        ,


-- ** unref #method:unref#

#if defined(ENABLE_OVERLOADING)
    PaintNodeUnrefMethodInfo                ,
#endif
    paintNodeUnref                          ,




    ) 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 {-# SOURCE #-} qualified GI.Clutter.Structs.ActorBox as Clutter.ActorBox

-- | Memory-managed wrapper type.
newtype PaintNode = PaintNode (SP.ManagedPtr PaintNode)
    deriving (PaintNode -> PaintNode -> Bool
(PaintNode -> PaintNode -> Bool)
-> (PaintNode -> PaintNode -> Bool) -> Eq PaintNode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PaintNode -> PaintNode -> Bool
$c/= :: PaintNode -> PaintNode -> Bool
== :: PaintNode -> PaintNode -> Bool
$c== :: PaintNode -> PaintNode -> Bool
Eq)

instance SP.ManagedPtrNewtype PaintNode where
    toManagedPtr :: PaintNode -> ManagedPtr PaintNode
toManagedPtr (PaintNode ManagedPtr PaintNode
p) = ManagedPtr PaintNode
p

foreign import ccall "clutter_paint_node_get_type"
    c_clutter_paint_node_get_type :: IO B.Types.GType

instance B.Types.TypedObject PaintNode where
    glibType :: IO GType
glibType = IO GType
c_clutter_paint_node_get_type

-- | Type class for types which can be safely cast to `PaintNode`, for instance with `toPaintNode`.
class (SP.BoxedPtr o, SP.TypedObject o, O.IsDescendantOf PaintNode o) => IsPaintNode o
instance (SP.BoxedPtr o, SP.TypedObject o, O.IsDescendantOf PaintNode o) => IsPaintNode o

instance O.HasParentTypes PaintNode
type instance O.ParentTypes PaintNode = '[]

-- | Cast to `PaintNode`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toPaintNode :: (MIO.MonadIO m, IsPaintNode o) => o -> m PaintNode
toPaintNode :: forall (m :: * -> *) o.
(MonadIO m, IsPaintNode o) =>
o -> m PaintNode
toPaintNode = IO PaintNode -> m PaintNode
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO PaintNode -> m PaintNode)
-> (o -> IO PaintNode) -> o -> m PaintNode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr PaintNode -> PaintNode) -> o -> IO PaintNode
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr PaintNode -> PaintNode
PaintNode

foreign import ccall "clutter_value_get_paint_node" gv_get_clutter_value_get_paint_node ::
    FP.Ptr B.GValue.GValue -> IO (FP.Ptr PaintNode)

foreign import ccall "clutter_value_set_paint_node" gv_set_clutter_value_set_paint_node ::
    FP.Ptr B.GValue.GValue -> FP.Ptr PaintNode -> IO ()

-- | Convert 'PaintNode' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe PaintNode) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_clutter_paint_node_get_type
    gvalueSet_ :: Ptr GValue -> Maybe PaintNode -> IO ()
gvalueSet_ Ptr GValue
gv Maybe PaintNode
P.Nothing = Ptr GValue -> Ptr PaintNode -> IO ()
gv_set_clutter_value_set_paint_node Ptr GValue
gv (Ptr PaintNode
forall a. Ptr a
FP.nullPtr :: FP.Ptr PaintNode)
    gvalueSet_ Ptr GValue
gv (P.Just PaintNode
obj) = PaintNode -> (Ptr PaintNode -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr PaintNode
obj (Ptr GValue -> Ptr PaintNode -> IO ()
gv_set_clutter_value_set_paint_node Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe PaintNode)
gvalueGet_ Ptr GValue
gv = do
        Ptr PaintNode
ptr <- Ptr GValue -> IO (Ptr PaintNode)
gv_get_clutter_value_get_paint_node Ptr GValue
gv :: IO (FP.Ptr PaintNode)
        if Ptr PaintNode
ptr Ptr PaintNode -> Ptr PaintNode -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr PaintNode
forall a. Ptr a
FP.nullPtr
        then PaintNode -> Maybe PaintNode
forall a. a -> Maybe a
P.Just (PaintNode -> Maybe PaintNode)
-> IO PaintNode -> IO (Maybe PaintNode)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr PaintNode -> PaintNode)
-> Ptr PaintNode -> IO PaintNode
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newPtr ManagedPtr PaintNode -> PaintNode
PaintNode Ptr PaintNode
ptr
        else Maybe PaintNode -> IO (Maybe PaintNode)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe PaintNode
forall a. Maybe a
P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
type family ResolvePaintNodeMethod (t :: Symbol) (o :: *) :: * where
    ResolvePaintNodeMethod "addChild" o = PaintNodeAddChildMethodInfo
    ResolvePaintNodeMethod "addRectangle" o = PaintNodeAddRectangleMethodInfo
    ResolvePaintNodeMethod "addTextureRectangle" o = PaintNodeAddTextureRectangleMethodInfo
    ResolvePaintNodeMethod "ref" o = PaintNodeRefMethodInfo
    ResolvePaintNodeMethod "unref" o = PaintNodeUnrefMethodInfo
    ResolvePaintNodeMethod "setName" o = PaintNodeSetNameMethodInfo
    ResolvePaintNodeMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolvePaintNodeMethod t PaintNode, O.OverloadedMethod info PaintNode p) => OL.IsLabel t (PaintNode -> 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 ~ ResolvePaintNodeMethod t PaintNode, O.OverloadedMethod info PaintNode p, R.HasField t PaintNode p) => R.HasField t PaintNode p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolvePaintNodeMethod t PaintNode, O.OverloadedMethodInfo info PaintNode) => OL.IsLabel t (O.MethodProxy info PaintNode) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif

foreign import ccall "clutter_paint_node_ref" _PaintNode_copy_clutter_paint_node_ref :: Ptr a -> IO (Ptr a)

foreign import ccall "clutter_paint_node_unref" _PaintNode_free_clutter_paint_node_unref :: Ptr a -> IO ()

instance BoxedPtr PaintNode where
    boxedPtrCopy :: PaintNode -> IO PaintNode
boxedPtrCopy = \PaintNode
p -> PaintNode -> (Ptr PaintNode -> IO PaintNode) -> IO PaintNode
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr PaintNode
p (Ptr PaintNode -> IO (Ptr PaintNode)
forall a. Ptr a -> IO (Ptr a)
_PaintNode_copy_clutter_paint_node_ref (Ptr PaintNode -> IO (Ptr PaintNode))
-> (Ptr PaintNode -> IO PaintNode) -> Ptr PaintNode -> IO PaintNode
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> (ManagedPtr PaintNode -> PaintNode)
-> Ptr PaintNode -> IO PaintNode
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.wrapPtr ManagedPtr PaintNode -> PaintNode
PaintNode)
    boxedPtrFree :: PaintNode -> IO ()
boxedPtrFree = \PaintNode
p -> PaintNode -> (Ptr PaintNode -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr PaintNode
p Ptr PaintNode -> IO ()
forall a. Ptr a -> IO ()
_PaintNode_free_clutter_paint_node_unref


-- method PaintNode::add_child
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "node"
--           , argType =
--               TInterface Name { namespace = "Clutter" , name = "PaintNode" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #ClutterPaintNode"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "child"
--           , argType =
--               TInterface Name { namespace = "Clutter" , name = "PaintNode" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the child #ClutterPaintNode to add"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "clutter_paint_node_add_child" clutter_paint_node_add_child :: 
    Ptr PaintNode ->                        -- node : TInterface (Name {namespace = "Clutter", name = "PaintNode"})
    Ptr PaintNode ->                        -- child : TInterface (Name {namespace = "Clutter", name = "PaintNode"})
    IO ()

-- | Adds /@child@/ to the list of children of /@node@/.
-- 
-- This function will acquire a reference on /@child@/.
-- 
-- /Since: 1.10/
paintNodeAddChild ::
    (B.CallStack.HasCallStack, MonadIO m, IsPaintNode a, IsPaintNode b) =>
    a
    -- ^ /@node@/: a t'GI.Clutter.Objects.PaintNode.PaintNode'
    -> b
    -- ^ /@child@/: the child t'GI.Clutter.Objects.PaintNode.PaintNode' to add
    -> m ()
paintNodeAddChild :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsPaintNode a, IsPaintNode b) =>
a -> b -> m ()
paintNodeAddChild a
node b
child = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr PaintNode
node' <- a -> IO (Ptr PaintNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
node
    Ptr PaintNode
child' <- b -> IO (Ptr PaintNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
child
    Ptr PaintNode -> Ptr PaintNode -> IO ()
clutter_paint_node_add_child Ptr PaintNode
node' Ptr PaintNode
child'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
node
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
child
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data PaintNodeAddChildMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsPaintNode a, IsPaintNode b) => O.OverloadedMethod PaintNodeAddChildMethodInfo a signature where
    overloadedMethod = paintNodeAddChild

instance O.OverloadedMethodInfo PaintNodeAddChildMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Clutter.Objects.PaintNode.paintNodeAddChild",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.2/docs/GI-Clutter-Objects-PaintNode.html#v:paintNodeAddChild"
        })


#endif

-- method PaintNode::add_rectangle
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "node"
--           , argType =
--               TInterface Name { namespace = "Clutter" , name = "PaintNode" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #ClutterPaintNode"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "rect"
--           , argType =
--               TInterface Name { namespace = "Clutter" , name = "ActorBox" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #ClutterActorBox" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "clutter_paint_node_add_rectangle" clutter_paint_node_add_rectangle :: 
    Ptr PaintNode ->                        -- node : TInterface (Name {namespace = "Clutter", name = "PaintNode"})
    Ptr Clutter.ActorBox.ActorBox ->        -- rect : TInterface (Name {namespace = "Clutter", name = "ActorBox"})
    IO ()

-- | Adds a rectangle region to the /@node@/, as described by the
-- passed /@rect@/.
-- 
-- /Since: 1.10/
paintNodeAddRectangle ::
    (B.CallStack.HasCallStack, MonadIO m, IsPaintNode a) =>
    a
    -- ^ /@node@/: a t'GI.Clutter.Objects.PaintNode.PaintNode'
    -> Clutter.ActorBox.ActorBox
    -- ^ /@rect@/: a t'GI.Clutter.Structs.ActorBox.ActorBox'
    -> m ()
paintNodeAddRectangle :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPaintNode a) =>
a -> ActorBox -> m ()
paintNodeAddRectangle a
node ActorBox
rect = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr PaintNode
node' <- a -> IO (Ptr PaintNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
node
    Ptr ActorBox
rect' <- ActorBox -> IO (Ptr ActorBox)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ActorBox
rect
    Ptr PaintNode -> Ptr ActorBox -> IO ()
clutter_paint_node_add_rectangle Ptr PaintNode
node' Ptr ActorBox
rect'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
node
    ActorBox -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ActorBox
rect
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data PaintNodeAddRectangleMethodInfo
instance (signature ~ (Clutter.ActorBox.ActorBox -> m ()), MonadIO m, IsPaintNode a) => O.OverloadedMethod PaintNodeAddRectangleMethodInfo a signature where
    overloadedMethod = paintNodeAddRectangle

instance O.OverloadedMethodInfo PaintNodeAddRectangleMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Clutter.Objects.PaintNode.paintNodeAddRectangle",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.2/docs/GI-Clutter-Objects-PaintNode.html#v:paintNodeAddRectangle"
        })


#endif

-- method PaintNode::add_texture_rectangle
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "node"
--           , argType =
--               TInterface Name { namespace = "Clutter" , name = "PaintNode" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #ClutterPaintNode"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "rect"
--           , argType =
--               TInterface Name { namespace = "Clutter" , name = "ActorBox" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #ClutterActorBox" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x_1"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the left X coordinate of the texture"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y_1"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the top Y coordinate of the texture"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x_2"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the right X coordinate of the texture"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y_2"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the bottom Y coordinate of the texture"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "clutter_paint_node_add_texture_rectangle" clutter_paint_node_add_texture_rectangle :: 
    Ptr PaintNode ->                        -- node : TInterface (Name {namespace = "Clutter", name = "PaintNode"})
    Ptr Clutter.ActorBox.ActorBox ->        -- rect : TInterface (Name {namespace = "Clutter", name = "ActorBox"})
    CFloat ->                               -- x_1 : TBasicType TFloat
    CFloat ->                               -- y_1 : TBasicType TFloat
    CFloat ->                               -- x_2 : TBasicType TFloat
    CFloat ->                               -- y_2 : TBasicType TFloat
    IO ()

-- | Adds a rectangle region to the /@node@/, with texture coordinates.
-- 
-- /Since: 1.10/
paintNodeAddTextureRectangle ::
    (B.CallStack.HasCallStack, MonadIO m, IsPaintNode a) =>
    a
    -- ^ /@node@/: a t'GI.Clutter.Objects.PaintNode.PaintNode'
    -> Clutter.ActorBox.ActorBox
    -- ^ /@rect@/: a t'GI.Clutter.Structs.ActorBox.ActorBox'
    -> Float
    -- ^ /@x1@/: the left X coordinate of the texture
    -> Float
    -- ^ /@y1@/: the top Y coordinate of the texture
    -> Float
    -- ^ /@x2@/: the right X coordinate of the texture
    -> Float
    -- ^ /@y2@/: the bottom Y coordinate of the texture
    -> m ()
paintNodeAddTextureRectangle :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPaintNode a) =>
a -> ActorBox -> Float -> Float -> Float -> Float -> m ()
paintNodeAddTextureRectangle a
node ActorBox
rect Float
x1 Float
y1 Float
x2 Float
y2 = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr PaintNode
node' <- a -> IO (Ptr PaintNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
node
    Ptr ActorBox
rect' <- ActorBox -> IO (Ptr ActorBox)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ActorBox
rect
    let x1' :: CFloat
x1' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
x1
    let y1' :: CFloat
y1' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
y1
    let x2' :: CFloat
x2' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
x2
    let y2' :: CFloat
y2' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
y2
    Ptr PaintNode
-> Ptr ActorBox -> CFloat -> CFloat -> CFloat -> CFloat -> IO ()
clutter_paint_node_add_texture_rectangle Ptr PaintNode
node' Ptr ActorBox
rect' CFloat
x1' CFloat
y1' CFloat
x2' CFloat
y2'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
node
    ActorBox -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ActorBox
rect
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data PaintNodeAddTextureRectangleMethodInfo
instance (signature ~ (Clutter.ActorBox.ActorBox -> Float -> Float -> Float -> Float -> m ()), MonadIO m, IsPaintNode a) => O.OverloadedMethod PaintNodeAddTextureRectangleMethodInfo a signature where
    overloadedMethod = paintNodeAddTextureRectangle

instance O.OverloadedMethodInfo PaintNodeAddTextureRectangleMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Clutter.Objects.PaintNode.paintNodeAddTextureRectangle",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.2/docs/GI-Clutter-Objects-PaintNode.html#v:paintNodeAddTextureRectangle"
        })


#endif

-- method PaintNode::ref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "node"
--           , argType =
--               TInterface Name { namespace = "Clutter" , name = "PaintNode" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #ClutterPaintNode"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Clutter" , name = "PaintNode" })
-- throws : False
-- Skip return : False

foreign import ccall "clutter_paint_node_ref" clutter_paint_node_ref :: 
    Ptr PaintNode ->                        -- node : TInterface (Name {namespace = "Clutter", name = "PaintNode"})
    IO (Ptr PaintNode)

-- | Acquires a reference on /@node@/.
-- 
-- /Since: 1.10/
paintNodeRef ::
    (B.CallStack.HasCallStack, MonadIO m, IsPaintNode a) =>
    a
    -- ^ /@node@/: a t'GI.Clutter.Objects.PaintNode.PaintNode'
    -> m PaintNode
    -- ^ __Returns:__ the t'GI.Clutter.Objects.PaintNode.PaintNode'
paintNodeRef :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPaintNode a) =>
a -> m PaintNode
paintNodeRef a
node = IO PaintNode -> m PaintNode
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PaintNode -> m PaintNode) -> IO PaintNode -> m PaintNode
forall a b. (a -> b) -> a -> b
$ do
    Ptr PaintNode
node' <- a -> IO (Ptr PaintNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
node
    Ptr PaintNode
result <- Ptr PaintNode -> IO (Ptr PaintNode)
clutter_paint_node_ref Ptr PaintNode
node'
    Text -> Ptr PaintNode -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"paintNodeRef" Ptr PaintNode
result
    PaintNode
result' <- ((ManagedPtr PaintNode -> PaintNode)
-> Ptr PaintNode -> IO PaintNode
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr PaintNode -> PaintNode
PaintNode) Ptr PaintNode
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
node
    PaintNode -> IO PaintNode
forall (m :: * -> *) a. Monad m => a -> m a
return PaintNode
result'

#if defined(ENABLE_OVERLOADING)
data PaintNodeRefMethodInfo
instance (signature ~ (m PaintNode), MonadIO m, IsPaintNode a) => O.OverloadedMethod PaintNodeRefMethodInfo a signature where
    overloadedMethod = paintNodeRef

instance O.OverloadedMethodInfo PaintNodeRefMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Clutter.Objects.PaintNode.paintNodeRef",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.2/docs/GI-Clutter-Objects-PaintNode.html#v:paintNodeRef"
        })


#endif

-- method PaintNode::set_name
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "node"
--           , argType =
--               TInterface Name { namespace = "Clutter" , name = "PaintNode" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #ClutterPaintNode"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a string annotating the @node"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "clutter_paint_node_set_name" clutter_paint_node_set_name :: 
    Ptr PaintNode ->                        -- node : TInterface (Name {namespace = "Clutter", name = "PaintNode"})
    CString ->                              -- name : TBasicType TUTF8
    IO ()

-- | Sets a user-readable /@name@/ for /@node@/.
-- 
-- The /@name@/ will be used for debugging purposes.
-- 
-- The /@node@/ will copy the passed string.
-- 
-- /Since: 1.10/
paintNodeSetName ::
    (B.CallStack.HasCallStack, MonadIO m, IsPaintNode a) =>
    a
    -- ^ /@node@/: a t'GI.Clutter.Objects.PaintNode.PaintNode'
    -> T.Text
    -- ^ /@name@/: a string annotating the /@node@/
    -> m ()
paintNodeSetName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPaintNode a) =>
a -> Text -> m ()
paintNodeSetName a
node Text
name = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr PaintNode
node' <- a -> IO (Ptr PaintNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
node
    CString
name' <- Text -> IO CString
textToCString Text
name
    Ptr PaintNode -> CString -> IO ()
clutter_paint_node_set_name Ptr PaintNode
node' CString
name'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
node
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data PaintNodeSetNameMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsPaintNode a) => O.OverloadedMethod PaintNodeSetNameMethodInfo a signature where
    overloadedMethod = paintNodeSetName

instance O.OverloadedMethodInfo PaintNodeSetNameMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Clutter.Objects.PaintNode.paintNodeSetName",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.2/docs/GI-Clutter-Objects-PaintNode.html#v:paintNodeSetName"
        })


#endif

-- method PaintNode::unref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "node"
--           , argType =
--               TInterface Name { namespace = "Clutter" , name = "PaintNode" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #ClutterPaintNode"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "clutter_paint_node_unref" clutter_paint_node_unref :: 
    Ptr PaintNode ->                        -- node : TInterface (Name {namespace = "Clutter", name = "PaintNode"})
    IO ()

-- | Releases a reference on /@node@/.
-- 
-- /Since: 1.10/
paintNodeUnref ::
    (B.CallStack.HasCallStack, MonadIO m, IsPaintNode a) =>
    a
    -- ^ /@node@/: a t'GI.Clutter.Objects.PaintNode.PaintNode'
    -> m ()
paintNodeUnref :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPaintNode a) =>
a -> m ()
paintNodeUnref a
node = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr PaintNode
node' <- a -> IO (Ptr PaintNode)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
node
    Ptr PaintNode -> IO ()
clutter_paint_node_unref Ptr PaintNode
node'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
node
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data PaintNodeUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m, IsPaintNode a) => O.OverloadedMethod PaintNodeUnrefMethodInfo a signature where
    overloadedMethod = paintNodeUnref

instance O.OverloadedMethodInfo PaintNodeUnrefMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Clutter.Objects.PaintNode.paintNodeUnref",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-clutter-1.0.2/docs/GI-Clutter-Objects-PaintNode.html#v:paintNodeUnref"
        })


#endif