{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- @GskTransform@ is an object to describe transform matrices.
-- 
-- Unlike @graphene_matrix_t@, @GskTransform@ retains the steps in how
-- a transform was constructed, and allows inspecting them. It is modeled
-- after the way CSS describes transforms.
-- 
-- @GskTransform@ objects are immutable and cannot be changed after creation.
-- This means code can safely expose them as properties of objects without
-- having to worry about others changing them.

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

module GI.Gsk.Structs.Transform
    ( 

-- * Exported types
    Transform(..)                           ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [equal]("GI.Gsk.Structs.Transform#g:method:equal"), [invert]("GI.Gsk.Structs.Transform#g:method:invert"), [matrix]("GI.Gsk.Structs.Transform#g:method:matrix"), [perspective]("GI.Gsk.Structs.Transform#g:method:perspective"), [print]("GI.Gsk.Structs.Transform#g:method:print"), [ref]("GI.Gsk.Structs.Transform#g:method:ref"), [rotate]("GI.Gsk.Structs.Transform#g:method:rotate"), [rotate3d]("GI.Gsk.Structs.Transform#g:method:rotate3d"), [scale]("GI.Gsk.Structs.Transform#g:method:scale"), [scale3d]("GI.Gsk.Structs.Transform#g:method:scale3d"), [skew]("GI.Gsk.Structs.Transform#g:method:skew"), [to2d]("GI.Gsk.Structs.Transform#g:method:to2d"), [to2dComponents]("GI.Gsk.Structs.Transform#g:method:to2dComponents"), [toAffine]("GI.Gsk.Structs.Transform#g:method:toAffine"), [toMatrix]("GI.Gsk.Structs.Transform#g:method:toMatrix"), [toString]("GI.Gsk.Structs.Transform#g:method:toString"), [toTranslate]("GI.Gsk.Structs.Transform#g:method:toTranslate"), [transform]("GI.Gsk.Structs.Transform#g:method:transform"), [transformBounds]("GI.Gsk.Structs.Transform#g:method:transformBounds"), [transformPoint]("GI.Gsk.Structs.Transform#g:method:transformPoint"), [translate]("GI.Gsk.Structs.Transform#g:method:translate"), [translate3d]("GI.Gsk.Structs.Transform#g:method:translate3d"), [unref]("GI.Gsk.Structs.Transform#g:method:unref").
-- 
-- ==== Getters
-- [getCategory]("GI.Gsk.Structs.Transform#g:method:getCategory").
-- 
-- ==== Setters
-- /None/.

#if defined(ENABLE_OVERLOADING)
    ResolveTransformMethod                  ,
#endif

-- ** equal #method:equal#

#if defined(ENABLE_OVERLOADING)
    TransformEqualMethodInfo                ,
#endif
    transformEqual                          ,


-- ** getCategory #method:getCategory#

#if defined(ENABLE_OVERLOADING)
    TransformGetCategoryMethodInfo          ,
#endif
    transformGetCategory                    ,


-- ** invert #method:invert#

#if defined(ENABLE_OVERLOADING)
    TransformInvertMethodInfo               ,
#endif
    transformInvert                         ,


-- ** matrix #method:matrix#

#if defined(ENABLE_OVERLOADING)
    TransformMatrixMethodInfo               ,
#endif
    transformMatrix                         ,


-- ** new #method:new#

    transformNew                            ,


-- ** parse #method:parse#

    transformParse                          ,


-- ** perspective #method:perspective#

#if defined(ENABLE_OVERLOADING)
    TransformPerspectiveMethodInfo          ,
#endif
    transformPerspective                    ,


-- ** print #method:print#

#if defined(ENABLE_OVERLOADING)
    TransformPrintMethodInfo                ,
#endif
    transformPrint                          ,


-- ** ref #method:ref#

#if defined(ENABLE_OVERLOADING)
    TransformRefMethodInfo                  ,
#endif
    transformRef                            ,


-- ** rotate #method:rotate#

#if defined(ENABLE_OVERLOADING)
    TransformRotateMethodInfo               ,
#endif
    transformRotate                         ,


-- ** rotate3d #method:rotate3d#

#if defined(ENABLE_OVERLOADING)
    TransformRotate3dMethodInfo             ,
#endif
    transformRotate3d                       ,


-- ** scale #method:scale#

#if defined(ENABLE_OVERLOADING)
    TransformScaleMethodInfo                ,
#endif
    transformScale                          ,


-- ** scale3d #method:scale3d#

#if defined(ENABLE_OVERLOADING)
    TransformScale3dMethodInfo              ,
#endif
    transformScale3d                        ,


-- ** skew #method:skew#

#if defined(ENABLE_OVERLOADING)
    TransformSkewMethodInfo                 ,
#endif
    transformSkew                           ,


-- ** to2d #method:to2d#

#if defined(ENABLE_OVERLOADING)
    TransformTo2dMethodInfo                 ,
#endif
    transformTo2d                           ,


-- ** to2dComponents #method:to2dComponents#

#if defined(ENABLE_OVERLOADING)
    TransformTo2dComponentsMethodInfo       ,
#endif
    transformTo2dComponents                 ,


-- ** toAffine #method:toAffine#

#if defined(ENABLE_OVERLOADING)
    TransformToAffineMethodInfo             ,
#endif
    transformToAffine                       ,


-- ** toMatrix #method:toMatrix#

#if defined(ENABLE_OVERLOADING)
    TransformToMatrixMethodInfo             ,
#endif
    transformToMatrix                       ,


-- ** toString #method:toString#

#if defined(ENABLE_OVERLOADING)
    TransformToStringMethodInfo             ,
#endif
    transformToString                       ,


-- ** toTranslate #method:toTranslate#

#if defined(ENABLE_OVERLOADING)
    TransformToTranslateMethodInfo          ,
#endif
    transformToTranslate                    ,


-- ** transform #method:transform#

#if defined(ENABLE_OVERLOADING)
    TransformTransformMethodInfo            ,
#endif
    transformTransform                      ,


-- ** transformBounds #method:transformBounds#

#if defined(ENABLE_OVERLOADING)
    TransformTransformBoundsMethodInfo      ,
#endif
    transformTransformBounds                ,


-- ** transformPoint #method:transformPoint#

#if defined(ENABLE_OVERLOADING)
    TransformTransformPointMethodInfo       ,
#endif
    transformTransformPoint                 ,


-- ** translate #method:translate#

#if defined(ENABLE_OVERLOADING)
    TransformTranslateMethodInfo            ,
#endif
    transformTranslate                      ,


-- ** translate3d #method:translate3d#

#if defined(ENABLE_OVERLOADING)
    TransformTranslate3dMethodInfo          ,
#endif
    transformTranslate3d                    ,


-- ** unref #method:unref#

#if defined(ENABLE_OVERLOADING)
    TransformUnrefMethodInfo                ,
#endif
    transformUnref                          ,




    ) 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 qualified GI.GLib.Structs.String as GLib.String
import qualified GI.Graphene.Structs.Matrix as Graphene.Matrix
import qualified GI.Graphene.Structs.Point as Graphene.Point
import qualified GI.Graphene.Structs.Point3D as Graphene.Point3D
import qualified GI.Graphene.Structs.Rect as Graphene.Rect
import qualified GI.Graphene.Structs.Vec3 as Graphene.Vec3
import {-# SOURCE #-} qualified GI.Gsk.Enums as Gsk.Enums

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

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

foreign import ccall "gsk_transform_get_type" c_gsk_transform_get_type :: 
    IO GType

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

instance B.Types.TypedObject Transform where
    glibType :: IO GType
glibType = IO GType
c_gsk_transform_get_type

instance B.Types.GBoxed Transform

-- | Convert 'Transform' 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 Transform) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gsk_transform_get_type
    gvalueSet_ :: Ptr GValue -> Maybe Transform -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Transform
P.Nothing = Ptr GValue -> Ptr Transform -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr Transform
forall a. Ptr a
FP.nullPtr :: FP.Ptr Transform)
    gvalueSet_ Ptr GValue
gv (P.Just Transform
obj) = Transform -> (Ptr Transform -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Transform
obj (Ptr GValue -> Ptr Transform -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe Transform)
gvalueGet_ Ptr GValue
gv = do
        Ptr Transform
ptr <- Ptr GValue -> IO (Ptr Transform)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr Transform)
        if Ptr Transform
ptr Ptr Transform -> Ptr Transform -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Transform
forall a. Ptr a
FP.nullPtr
        then Transform -> Maybe Transform
forall a. a -> Maybe a
P.Just (Transform -> Maybe Transform)
-> IO Transform -> IO (Maybe Transform)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Transform -> Transform)
-> Ptr Transform -> IO Transform
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr Transform -> Transform
Transform Ptr Transform
ptr
        else Maybe Transform -> IO (Maybe Transform)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Transform
forall a. Maybe a
P.Nothing
        
    


#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Transform
type instance O.AttributeList Transform = TransformAttributeList
type TransformAttributeList = ('[ ] :: [(Symbol, *)])
#endif

-- method Transform::new
-- method type : Constructor
-- Args: []
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gsk" , name = "Transform" })
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_new" gsk_transform_new :: 
    IO (Ptr Transform)

-- | /No description available in the introspection data./
transformNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Transform
transformNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Transform
transformNew  = IO Transform -> m Transform
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Transform -> m Transform) -> IO Transform -> m Transform
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
result <- IO (Ptr Transform)
gsk_transform_new
    Text -> Ptr Transform -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"transformNew" Ptr Transform
result
    Transform
result' <- ((ManagedPtr Transform -> Transform)
-> Ptr Transform -> IO Transform
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Transform -> Transform
Transform) Ptr Transform
result
    Transform -> IO Transform
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Transform
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method Transform::equal
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "first"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the first transform"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "second"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the second transform"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_equal" gsk_transform_equal :: 
    Ptr Transform ->                        -- first : TInterface (Name {namespace = "Gsk", name = "Transform"})
    Ptr Transform ->                        -- second : TInterface (Name {namespace = "Gsk", name = "Transform"})
    IO CInt

-- | Checks two transforms for equality.
transformEqual ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@first@/: the first transform
    -> Maybe (Transform)
    -- ^ /@second@/: the second transform
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the two transforms perform the same operation
transformEqual :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> Maybe Transform -> m Bool
transformEqual Transform
first Maybe Transform
second = IO Bool -> m Bool
forall a. IO a -> m a
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 Transform
first' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Transform
first
    Ptr Transform
maybeSecond <- case Maybe Transform
second of
        Maybe Transform
Nothing -> Ptr Transform -> IO (Ptr Transform)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Transform
forall a. Ptr a
nullPtr
        Just Transform
jSecond -> do
            Ptr Transform
jSecond' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Transform
jSecond
            Ptr Transform -> IO (Ptr Transform)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Transform
jSecond'
    CInt
result <- Ptr Transform -> Ptr Transform -> IO CInt
gsk_transform_equal Ptr Transform
first' Ptr Transform
maybeSecond
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
first
    Maybe Transform -> (Transform -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Transform
second Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data TransformEqualMethodInfo
instance (signature ~ (Maybe (Transform) -> m Bool), MonadIO m) => O.OverloadedMethod TransformEqualMethodInfo Transform signature where
    overloadedMethod = transformEqual

instance O.OverloadedMethodInfo TransformEqualMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformEqual",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformEqual"
        })


#endif

-- method Transform::get_category
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A `GskTransform`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "Gsk" , name = "TransformCategory" })
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_get_category" gsk_transform_get_category :: 
    Ptr Transform ->                        -- self : TInterface (Name {namespace = "Gsk", name = "Transform"})
    IO CUInt

-- | Returns the category this transform belongs to.
transformGetCategory ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@self@/: A @GskTransform@
    -> m Gsk.Enums.TransformCategory
    -- ^ __Returns:__ The category of the transform
transformGetCategory :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> m TransformCategory
transformGetCategory Transform
self = IO TransformCategory -> m TransformCategory
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TransformCategory -> m TransformCategory)
-> IO TransformCategory -> m TransformCategory
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
self' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Transform
self
    CUInt
result <- Ptr Transform -> IO CUInt
gsk_transform_get_category Ptr Transform
self'
    let result' :: TransformCategory
result' = (Int -> TransformCategory
forall a. Enum a => Int -> a
toEnum (Int -> TransformCategory)
-> (CUInt -> Int) -> CUInt -> TransformCategory
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
self
    TransformCategory -> IO TransformCategory
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return TransformCategory
result'

#if defined(ENABLE_OVERLOADING)
data TransformGetCategoryMethodInfo
instance (signature ~ (m Gsk.Enums.TransformCategory), MonadIO m) => O.OverloadedMethod TransformGetCategoryMethodInfo Transform signature where
    overloadedMethod = transformGetCategory

instance O.OverloadedMethodInfo TransformGetCategoryMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformGetCategory",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformGetCategory"
        })


#endif

-- method Transform::invert
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Transform to invert"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gsk" , name = "Transform" })
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_invert" gsk_transform_invert :: 
    Ptr Transform ->                        -- self : TInterface (Name {namespace = "Gsk", name = "Transform"})
    IO (Ptr Transform)

-- | Inverts the given transform.
-- 
-- If /@self@/ is not invertible, 'P.Nothing' is returned.
-- Note that inverting 'P.Nothing' also returns 'P.Nothing', which is
-- the correct inverse of 'P.Nothing'. If you need to differentiate
-- between those cases, you should check /@self@/ is not 'P.Nothing'
-- before calling this function.
transformInvert ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@self@/: Transform to invert
    -> m (Maybe Transform)
    -- ^ __Returns:__ The inverted transform
transformInvert :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> m (Maybe Transform)
transformInvert Transform
self = IO (Maybe Transform) -> m (Maybe Transform)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Transform) -> m (Maybe Transform))
-> IO (Maybe Transform) -> m (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
self' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Transform
self
    Ptr Transform
result <- Ptr Transform -> IO (Ptr Transform)
gsk_transform_invert Ptr Transform
self'
    Maybe Transform
maybeResult <- Ptr Transform
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Transform
result ((Ptr Transform -> IO Transform) -> IO (Maybe Transform))
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ \Ptr Transform
result' -> do
        Transform
result'' <- ((ManagedPtr Transform -> Transform)
-> Ptr Transform -> IO Transform
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Transform -> Transform
Transform) Ptr Transform
result'
        Transform -> IO Transform
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Transform
result''
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
self
    Maybe Transform -> IO (Maybe Transform)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Transform
maybeResult

#if defined(ENABLE_OVERLOADING)
data TransformInvertMethodInfo
instance (signature ~ (m (Maybe Transform)), MonadIO m) => O.OverloadedMethod TransformInvertMethodInfo Transform signature where
    overloadedMethod = transformInvert

instance O.OverloadedMethodInfo TransformInvertMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformInvert",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformInvert"
        })


#endif

-- method Transform::matrix
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "next"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the next transform" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "matrix"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Matrix" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the matrix to multiply @next with"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gsk" , name = "Transform" })
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_matrix" gsk_transform_matrix :: 
    Ptr Transform ->                        -- next : TInterface (Name {namespace = "Gsk", name = "Transform"})
    Ptr Graphene.Matrix.Matrix ->           -- matrix : TInterface (Name {namespace = "Graphene", name = "Matrix"})
    IO (Ptr Transform)

-- | Multiplies /@next@/ with the given /@matrix@/.
transformMatrix ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@next@/: the next transform
    -> Graphene.Matrix.Matrix
    -- ^ /@matrix@/: the matrix to multiply /@next@/ with
    -> m Transform
    -- ^ __Returns:__ The new transform
transformMatrix :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> Matrix -> m Transform
transformMatrix Transform
next Matrix
matrix = IO Transform -> m Transform
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Transform -> m Transform) -> IO Transform -> m Transform
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
next' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Transform
next
    Ptr Matrix
matrix' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
matrix
    Ptr Transform
result <- Ptr Transform -> Ptr Matrix -> IO (Ptr Transform)
gsk_transform_matrix Ptr Transform
next' Ptr Matrix
matrix'
    Text -> Ptr Transform -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"transformMatrix" Ptr Transform
result
    Transform
result' <- ((ManagedPtr Transform -> Transform)
-> Ptr Transform -> IO Transform
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Transform -> Transform
Transform) Ptr Transform
result
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
next
    Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Matrix
matrix
    Transform -> IO Transform
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Transform
result'

#if defined(ENABLE_OVERLOADING)
data TransformMatrixMethodInfo
instance (signature ~ (Graphene.Matrix.Matrix -> m Transform), MonadIO m) => O.OverloadedMethod TransformMatrixMethodInfo Transform signature where
    overloadedMethod = transformMatrix

instance O.OverloadedMethodInfo TransformMatrixMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformMatrix",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformMatrix"
        })


#endif

-- method Transform::perspective
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "next"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the next transform" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "depth"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "distance of the z=0 plane. Lower values give a more\n  flattened pyramid and therefore a more pronounced\n  perspective effect."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gsk" , name = "Transform" })
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_perspective" gsk_transform_perspective :: 
    Ptr Transform ->                        -- next : TInterface (Name {namespace = "Gsk", name = "Transform"})
    CFloat ->                               -- depth : TBasicType TFloat
    IO (Ptr Transform)

-- | Applies a perspective projection transform.
-- 
-- This transform scales points in X and Y based on their Z value,
-- scaling points with positive Z values away from the origin, and
-- those with negative Z values towards the origin. Points
-- on the z=0 plane are unchanged.
transformPerspective ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@next@/: the next transform
    -> Float
    -- ^ /@depth@/: distance of the z=0 plane. Lower values give a more
    --   flattened pyramid and therefore a more pronounced
    --   perspective effect.
    -> m Transform
    -- ^ __Returns:__ The new transform
transformPerspective :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> Float -> m Transform
transformPerspective Transform
next Float
depth = IO Transform -> m Transform
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Transform -> m Transform) -> IO Transform -> m Transform
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
next' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Transform
next
    let depth' :: CFloat
depth' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
depth
    Ptr Transform
result <- Ptr Transform -> CFloat -> IO (Ptr Transform)
gsk_transform_perspective Ptr Transform
next' CFloat
depth'
    Text -> Ptr Transform -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"transformPerspective" Ptr Transform
result
    Transform
result' <- ((ManagedPtr Transform -> Transform)
-> Ptr Transform -> IO Transform
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Transform -> Transform
Transform) Ptr Transform
result
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
next
    Transform -> IO Transform
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Transform
result'

#if defined(ENABLE_OVERLOADING)
data TransformPerspectiveMethodInfo
instance (signature ~ (Float -> m Transform), MonadIO m) => O.OverloadedMethod TransformPerspectiveMethodInfo Transform signature where
    overloadedMethod = transformPerspective

instance O.OverloadedMethodInfo TransformPerspectiveMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformPerspective",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformPerspective"
        })


#endif

-- method Transform::print
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskTransform`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "string"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "String" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The string to print into"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_print" gsk_transform_print :: 
    Ptr Transform ->                        -- self : TInterface (Name {namespace = "Gsk", name = "Transform"})
    Ptr GLib.String.String ->               -- string : TInterface (Name {namespace = "GLib", name = "String"})
    IO ()

-- | Converts /@self@/ into a human-readable string representation suitable
-- for printing.
-- 
-- The result of this function can later be parsed with
-- [func/@gsk@/.Transform.parse].
transformPrint ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@self@/: a @GskTransform@
    -> GLib.String.String
    -- ^ /@string@/: The string to print into
    -> m ()
transformPrint :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> String -> m ()
transformPrint Transform
self String
string = 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 Transform
self' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Transform
self
    Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
    Ptr Transform -> Ptr String -> IO ()
gsk_transform_print Ptr Transform
self' Ptr String
string'
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
self
    String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data TransformPrintMethodInfo
instance (signature ~ (GLib.String.String -> m ()), MonadIO m) => O.OverloadedMethod TransformPrintMethodInfo Transform signature where
    overloadedMethod = transformPrint

instance O.OverloadedMethodInfo TransformPrintMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformPrint",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformPrint"
        })


#endif

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

foreign import ccall "gsk_transform_ref" gsk_transform_ref :: 
    Ptr Transform ->                        -- self : TInterface (Name {namespace = "Gsk", name = "Transform"})
    IO (Ptr Transform)

-- | Acquires a reference on the given @GskTransform@.
transformRef ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@self@/: a @GskTransform@
    -> m (Maybe Transform)
    -- ^ __Returns:__ the @GskTransform@ with an additional reference
transformRef :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> m (Maybe Transform)
transformRef Transform
self = IO (Maybe Transform) -> m (Maybe Transform)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Transform) -> m (Maybe Transform))
-> IO (Maybe Transform) -> m (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
self' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Transform
self
    Ptr Transform
result <- Ptr Transform -> IO (Ptr Transform)
gsk_transform_ref Ptr Transform
self'
    Maybe Transform
maybeResult <- Ptr Transform
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Transform
result ((Ptr Transform -> IO Transform) -> IO (Maybe Transform))
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ \Ptr Transform
result' -> do
        Transform
result'' <- ((ManagedPtr Transform -> Transform)
-> Ptr Transform -> IO Transform
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Transform -> Transform
Transform) Ptr Transform
result'
        Transform -> IO Transform
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Transform
result''
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
self
    Maybe Transform -> IO (Maybe Transform)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Transform
maybeResult

#if defined(ENABLE_OVERLOADING)
data TransformRefMethodInfo
instance (signature ~ (m (Maybe Transform)), MonadIO m) => O.OverloadedMethod TransformRefMethodInfo Transform signature where
    overloadedMethod = transformRef

instance O.OverloadedMethodInfo TransformRefMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformRef",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformRef"
        })


#endif

-- method Transform::rotate
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "next"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the next transform" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "angle"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the rotation angle, in degrees (clockwise)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gsk" , name = "Transform" })
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_rotate" gsk_transform_rotate :: 
    Ptr Transform ->                        -- next : TInterface (Name {namespace = "Gsk", name = "Transform"})
    CFloat ->                               -- angle : TBasicType TFloat
    IO (Ptr Transform)

-- | Rotates /@next@/ /@angle@/ degrees in 2D - or in 3D-speak, around the z axis.
transformRotate ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@next@/: the next transform
    -> Float
    -- ^ /@angle@/: the rotation angle, in degrees (clockwise)
    -> m (Maybe Transform)
    -- ^ __Returns:__ The new transform
transformRotate :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> Float -> m (Maybe Transform)
transformRotate Transform
next Float
angle = IO (Maybe Transform) -> m (Maybe Transform)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Transform) -> m (Maybe Transform))
-> IO (Maybe Transform) -> m (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
next' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Transform
next
    let angle' :: CFloat
angle' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
angle
    Ptr Transform
result <- Ptr Transform -> CFloat -> IO (Ptr Transform)
gsk_transform_rotate Ptr Transform
next' CFloat
angle'
    Maybe Transform
maybeResult <- Ptr Transform
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Transform
result ((Ptr Transform -> IO Transform) -> IO (Maybe Transform))
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ \Ptr Transform
result' -> do
        Transform
result'' <- ((ManagedPtr Transform -> Transform)
-> Ptr Transform -> IO Transform
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Transform -> Transform
Transform) Ptr Transform
result'
        Transform -> IO Transform
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Transform
result''
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
next
    Maybe Transform -> IO (Maybe Transform)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Transform
maybeResult

#if defined(ENABLE_OVERLOADING)
data TransformRotateMethodInfo
instance (signature ~ (Float -> m (Maybe Transform)), MonadIO m) => O.OverloadedMethod TransformRotateMethodInfo Transform signature where
    overloadedMethod = transformRotate

instance O.OverloadedMethodInfo TransformRotateMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformRotate",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformRotate"
        })


#endif

-- method Transform::rotate_3d
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "next"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the next transform" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "angle"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the rotation angle, in degrees (clockwise)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "axis"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Vec3" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The rotation axis" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gsk" , name = "Transform" })
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_rotate_3d" gsk_transform_rotate_3d :: 
    Ptr Transform ->                        -- next : TInterface (Name {namespace = "Gsk", name = "Transform"})
    CFloat ->                               -- angle : TBasicType TFloat
    Ptr Graphene.Vec3.Vec3 ->               -- axis : TInterface (Name {namespace = "Graphene", name = "Vec3"})
    IO (Ptr Transform)

-- | Rotates /@next@/ /@angle@/ degrees around /@axis@/.
-- 
-- For a rotation in 2D space, use 'GI.Gsk.Structs.Transform.transformRotate'
transformRotate3d ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@next@/: the next transform
    -> Float
    -- ^ /@angle@/: the rotation angle, in degrees (clockwise)
    -> Graphene.Vec3.Vec3
    -- ^ /@axis@/: The rotation axis
    -> m (Maybe Transform)
    -- ^ __Returns:__ The new transform
transformRotate3d :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> Float -> Vec3 -> m (Maybe Transform)
transformRotate3d Transform
next Float
angle Vec3
axis = IO (Maybe Transform) -> m (Maybe Transform)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Transform) -> m (Maybe Transform))
-> IO (Maybe Transform) -> m (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
next' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Transform
next
    let angle' :: CFloat
angle' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
angle
    Ptr Vec3
axis' <- Vec3 -> IO (Ptr Vec3)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec3
axis
    Ptr Transform
result <- Ptr Transform -> CFloat -> Ptr Vec3 -> IO (Ptr Transform)
gsk_transform_rotate_3d Ptr Transform
next' CFloat
angle' Ptr Vec3
axis'
    Maybe Transform
maybeResult <- Ptr Transform
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Transform
result ((Ptr Transform -> IO Transform) -> IO (Maybe Transform))
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ \Ptr Transform
result' -> do
        Transform
result'' <- ((ManagedPtr Transform -> Transform)
-> Ptr Transform -> IO Transform
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Transform -> Transform
Transform) Ptr Transform
result'
        Transform -> IO Transform
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Transform
result''
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
next
    Vec3 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec3
axis
    Maybe Transform -> IO (Maybe Transform)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Transform
maybeResult

#if defined(ENABLE_OVERLOADING)
data TransformRotate3dMethodInfo
instance (signature ~ (Float -> Graphene.Vec3.Vec3 -> m (Maybe Transform)), MonadIO m) => O.OverloadedMethod TransformRotate3dMethodInfo Transform signature where
    overloadedMethod = transformRotate3d

instance O.OverloadedMethodInfo TransformRotate3dMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformRotate3d",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformRotate3d"
        })


#endif

-- method Transform::scale
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "next"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the next transform" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "factor_x"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "scaling factor on the X axis"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "factor_y"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "scaling factor on the Y axis"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gsk" , name = "Transform" })
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_scale" gsk_transform_scale :: 
    Ptr Transform ->                        -- next : TInterface (Name {namespace = "Gsk", name = "Transform"})
    CFloat ->                               -- factor_x : TBasicType TFloat
    CFloat ->                               -- factor_y : TBasicType TFloat
    IO (Ptr Transform)

-- | Scales /@next@/ in 2-dimensional space by the given factors.
-- 
-- Use 'GI.Gsk.Structs.Transform.transformScale3d' to scale in all 3 dimensions.
transformScale ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@next@/: the next transform
    -> Float
    -- ^ /@factorX@/: scaling factor on the X axis
    -> Float
    -- ^ /@factorY@/: scaling factor on the Y axis
    -> m (Maybe Transform)
    -- ^ __Returns:__ The new transform
transformScale :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> Float -> Float -> m (Maybe Transform)
transformScale Transform
next Float
factorX Float
factorY = IO (Maybe Transform) -> m (Maybe Transform)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Transform) -> m (Maybe Transform))
-> IO (Maybe Transform) -> m (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
next' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Transform
next
    let factorX' :: CFloat
factorX' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
factorX
    let factorY' :: CFloat
factorY' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
factorY
    Ptr Transform
result <- Ptr Transform -> CFloat -> CFloat -> IO (Ptr Transform)
gsk_transform_scale Ptr Transform
next' CFloat
factorX' CFloat
factorY'
    Maybe Transform
maybeResult <- Ptr Transform
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Transform
result ((Ptr Transform -> IO Transform) -> IO (Maybe Transform))
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ \Ptr Transform
result' -> do
        Transform
result'' <- ((ManagedPtr Transform -> Transform)
-> Ptr Transform -> IO Transform
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Transform -> Transform
Transform) Ptr Transform
result'
        Transform -> IO Transform
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Transform
result''
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
next
    Maybe Transform -> IO (Maybe Transform)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Transform
maybeResult

#if defined(ENABLE_OVERLOADING)
data TransformScaleMethodInfo
instance (signature ~ (Float -> Float -> m (Maybe Transform)), MonadIO m) => O.OverloadedMethod TransformScaleMethodInfo Transform signature where
    overloadedMethod = transformScale

instance O.OverloadedMethodInfo TransformScaleMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformScale",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformScale"
        })


#endif

-- method Transform::scale_3d
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "next"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the next transform" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "factor_x"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "scaling factor on the X axis"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "factor_y"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "scaling factor on the Y axis"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "factor_z"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "scaling factor on the Z axis"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gsk" , name = "Transform" })
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_scale_3d" gsk_transform_scale_3d :: 
    Ptr Transform ->                        -- next : TInterface (Name {namespace = "Gsk", name = "Transform"})
    CFloat ->                               -- factor_x : TBasicType TFloat
    CFloat ->                               -- factor_y : TBasicType TFloat
    CFloat ->                               -- factor_z : TBasicType TFloat
    IO (Ptr Transform)

-- | Scales /@next@/ by the given factors.
transformScale3d ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@next@/: the next transform
    -> Float
    -- ^ /@factorX@/: scaling factor on the X axis
    -> Float
    -- ^ /@factorY@/: scaling factor on the Y axis
    -> Float
    -- ^ /@factorZ@/: scaling factor on the Z axis
    -> m (Maybe Transform)
    -- ^ __Returns:__ The new transform
transformScale3d :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> Float -> Float -> Float -> m (Maybe Transform)
transformScale3d Transform
next Float
factorX Float
factorY Float
factorZ = IO (Maybe Transform) -> m (Maybe Transform)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Transform) -> m (Maybe Transform))
-> IO (Maybe Transform) -> m (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
next' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Transform
next
    let factorX' :: CFloat
factorX' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
factorX
    let factorY' :: CFloat
factorY' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
factorY
    let factorZ' :: CFloat
factorZ' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
factorZ
    Ptr Transform
result <- Ptr Transform -> CFloat -> CFloat -> CFloat -> IO (Ptr Transform)
gsk_transform_scale_3d Ptr Transform
next' CFloat
factorX' CFloat
factorY' CFloat
factorZ'
    Maybe Transform
maybeResult <- Ptr Transform
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Transform
result ((Ptr Transform -> IO Transform) -> IO (Maybe Transform))
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ \Ptr Transform
result' -> do
        Transform
result'' <- ((ManagedPtr Transform -> Transform)
-> Ptr Transform -> IO Transform
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Transform -> Transform
Transform) Ptr Transform
result'
        Transform -> IO Transform
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Transform
result''
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
next
    Maybe Transform -> IO (Maybe Transform)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Transform
maybeResult

#if defined(ENABLE_OVERLOADING)
data TransformScale3dMethodInfo
instance (signature ~ (Float -> Float -> Float -> m (Maybe Transform)), MonadIO m) => O.OverloadedMethod TransformScale3dMethodInfo Transform signature where
    overloadedMethod = transformScale3d

instance O.OverloadedMethodInfo TransformScale3dMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformScale3d",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformScale3d"
        })


#endif

-- method Transform::skew
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "next"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the next transform" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "skew_x"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "skew factor, in degrees, on the X axis"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "skew_y"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "skew factor, in degrees, on the Y axis"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gsk" , name = "Transform" })
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_skew" gsk_transform_skew :: 
    Ptr Transform ->                        -- next : TInterface (Name {namespace = "Gsk", name = "Transform"})
    CFloat ->                               -- skew_x : TBasicType TFloat
    CFloat ->                               -- skew_y : TBasicType TFloat
    IO (Ptr Transform)

-- | Applies a skew transform.
-- 
-- /Since: 4.6/
transformSkew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@next@/: the next transform
    -> Float
    -- ^ /@skewX@/: skew factor, in degrees, on the X axis
    -> Float
    -- ^ /@skewY@/: skew factor, in degrees, on the Y axis
    -> m (Maybe Transform)
    -- ^ __Returns:__ The new transform
transformSkew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> Float -> Float -> m (Maybe Transform)
transformSkew Transform
next Float
skewX Float
skewY = IO (Maybe Transform) -> m (Maybe Transform)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Transform) -> m (Maybe Transform))
-> IO (Maybe Transform) -> m (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
next' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Transform
next
    let skewX' :: CFloat
skewX' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
skewX
    let skewY' :: CFloat
skewY' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
skewY
    Ptr Transform
result <- Ptr Transform -> CFloat -> CFloat -> IO (Ptr Transform)
gsk_transform_skew Ptr Transform
next' CFloat
skewX' CFloat
skewY'
    Maybe Transform
maybeResult <- Ptr Transform
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Transform
result ((Ptr Transform -> IO Transform) -> IO (Maybe Transform))
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ \Ptr Transform
result' -> do
        Transform
result'' <- ((ManagedPtr Transform -> Transform)
-> Ptr Transform -> IO Transform
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Transform -> Transform
Transform) Ptr Transform
result'
        Transform -> IO Transform
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Transform
result''
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
next
    Maybe Transform -> IO (Maybe Transform)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Transform
maybeResult

#if defined(ENABLE_OVERLOADING)
data TransformSkewMethodInfo
instance (signature ~ (Float -> Float -> m (Maybe Transform)), MonadIO m) => O.OverloadedMethod TransformSkewMethodInfo Transform signature where
    overloadedMethod = transformSkew

instance O.OverloadedMethodInfo TransformSkewMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformSkew",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformSkew"
        })


#endif

-- method Transform::to_2d
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a 2D `GskTransform`"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_xx"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the xx member"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_yx"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the yx member"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_xy"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the xy member"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_yy"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the yy member"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_dx"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the x0 member"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_dy"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the y0 member"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_to_2d" gsk_transform_to_2d :: 
    Ptr Transform ->                        -- self : TInterface (Name {namespace = "Gsk", name = "Transform"})
    Ptr CFloat ->                           -- out_xx : TBasicType TFloat
    Ptr CFloat ->                           -- out_yx : TBasicType TFloat
    Ptr CFloat ->                           -- out_xy : TBasicType TFloat
    Ptr CFloat ->                           -- out_yy : TBasicType TFloat
    Ptr CFloat ->                           -- out_dx : TBasicType TFloat
    Ptr CFloat ->                           -- out_dy : TBasicType TFloat
    IO ()

-- | Converts a @GskTransform@ to a 2D transformation matrix.
-- 
-- /@self@/ must be a 2D transformation. If you are not
-- sure, use 'GI.Gsk.Structs.Transform.transformGetCategory' >=
-- 'GI.Gsk.Enums.TransformCategory2d' to check.
-- 
-- The returned values have the following layout:
-- 
-- >  | xx yx |   |  a  b  0 |
-- >  | xy yy | = |  c  d  0 |
-- >  | dx dy |   | tx ty  1 |
-- 
-- 
-- This function can be used to convert between a @GskTransform@
-- and a matrix type from other 2D drawing libraries, in particular
-- Cairo.
transformTo2d ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@self@/: a 2D @GskTransform@
    -> m ((Float, Float, Float, Float, Float, Float))
transformTo2d :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> m (Float, Float, Float, Float, Float, Float)
transformTo2d Transform
self = IO (Float, Float, Float, Float, Float, Float)
-> m (Float, Float, Float, Float, Float, Float)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Float, Float, Float, Float, Float, Float)
 -> m (Float, Float, Float, Float, Float, Float))
-> IO (Float, Float, Float, Float, Float, Float)
-> m (Float, Float, Float, Float, Float, Float)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
self' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Transform
self
    Ptr CFloat
outXx <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr CFloat
outYx <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr CFloat
outXy <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr CFloat
outYy <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr CFloat
outDx <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr CFloat
outDy <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr Transform
-> Ptr CFloat
-> Ptr CFloat
-> Ptr CFloat
-> Ptr CFloat
-> Ptr CFloat
-> Ptr CFloat
-> IO ()
gsk_transform_to_2d Ptr Transform
self' Ptr CFloat
outXx Ptr CFloat
outYx Ptr CFloat
outXy Ptr CFloat
outYy Ptr CFloat
outDx Ptr CFloat
outDy
    CFloat
outXx' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
outXx
    let outXx'' :: Float
outXx'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
outXx'
    CFloat
outYx' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
outYx
    let outYx'' :: Float
outYx'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
outYx'
    CFloat
outXy' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
outXy
    let outXy'' :: Float
outXy'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
outXy'
    CFloat
outYy' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
outYy
    let outYy'' :: Float
outYy'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
outYy'
    CFloat
outDx' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
outDx
    let outDx'' :: Float
outDx'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
outDx'
    CFloat
outDy' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
outDy
    let outDy'' :: Float
outDy'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
outDy'
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
self
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
outXx
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
outYx
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
outXy
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
outYy
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
outDx
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
outDy
    (Float, Float, Float, Float, Float, Float)
-> IO (Float, Float, Float, Float, Float, Float)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Float
outXx'', Float
outYx'', Float
outXy'', Float
outYy'', Float
outDx'', Float
outDy'')

#if defined(ENABLE_OVERLOADING)
data TransformTo2dMethodInfo
instance (signature ~ (m ((Float, Float, Float, Float, Float, Float))), MonadIO m) => O.OverloadedMethod TransformTo2dMethodInfo Transform signature where
    overloadedMethod = transformTo2d

instance O.OverloadedMethodInfo TransformTo2dMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformTo2d",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformTo2d"
        })


#endif

-- method Transform::to_2d_components
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskTransform`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_skew_x"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for the skew factor\n  in the  x direction"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_skew_y"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for the skew factor\n  in the  y direction"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_scale_x"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for the scale\n  factor in the x direction"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_scale_y"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for the scale\n  factor in the y direction"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_angle"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the rotation angle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_dx"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for the translation\n  in the x direction"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_dy"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for the translation\n  in the y direction"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_to_2d_components" gsk_transform_to_2d_components :: 
    Ptr Transform ->                        -- self : TInterface (Name {namespace = "Gsk", name = "Transform"})
    Ptr CFloat ->                           -- out_skew_x : TBasicType TFloat
    Ptr CFloat ->                           -- out_skew_y : TBasicType TFloat
    Ptr CFloat ->                           -- out_scale_x : TBasicType TFloat
    Ptr CFloat ->                           -- out_scale_y : TBasicType TFloat
    Ptr CFloat ->                           -- out_angle : TBasicType TFloat
    Ptr CFloat ->                           -- out_dx : TBasicType TFloat
    Ptr CFloat ->                           -- out_dy : TBasicType TFloat
    IO ()

-- | Converts a @GskTransform@ to 2D transformation factors.
-- 
-- To recreate an equivalent transform from the factors returned
-- by this function, use
-- 
--     gsk_transform_skew (
--         gsk_transform_scale (
--             gsk_transform_rotate (
--                 gsk_transform_translate (NULL, &GRAPHENE_POINT_T (dx, dy)),
--                 angle),
--             scale_x, scale_y),
--         skew_x, skew_y)
-- 
-- /@self@/ must be a 2D transformation. If you are not sure, use
-- 
--     'GI.Gsk.Structs.Transform.transformGetCategory' >= 'GI.Gsk.Enums.TransformCategory2d'
-- 
-- to check.
-- 
-- /Since: 4.6/
transformTo2dComponents ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@self@/: a @GskTransform@
    -> m ((Float, Float, Float, Float, Float, Float, Float))
transformTo2dComponents :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> m (Float, Float, Float, Float, Float, Float, Float)
transformTo2dComponents Transform
self = IO (Float, Float, Float, Float, Float, Float, Float)
-> m (Float, Float, Float, Float, Float, Float, Float)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Float, Float, Float, Float, Float, Float, Float)
 -> m (Float, Float, Float, Float, Float, Float, Float))
-> IO (Float, Float, Float, Float, Float, Float, Float)
-> m (Float, Float, Float, Float, Float, Float, Float)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
self' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Transform
self
    Ptr CFloat
outSkewX <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr CFloat
outSkewY <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr CFloat
outScaleX <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr CFloat
outScaleY <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr CFloat
outAngle <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr CFloat
outDx <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr CFloat
outDy <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr Transform
-> Ptr CFloat
-> Ptr CFloat
-> Ptr CFloat
-> Ptr CFloat
-> Ptr CFloat
-> Ptr CFloat
-> Ptr CFloat
-> IO ()
gsk_transform_to_2d_components Ptr Transform
self' Ptr CFloat
outSkewX Ptr CFloat
outSkewY Ptr CFloat
outScaleX Ptr CFloat
outScaleY Ptr CFloat
outAngle Ptr CFloat
outDx Ptr CFloat
outDy
    CFloat
outSkewX' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
outSkewX
    let outSkewX'' :: Float
outSkewX'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
outSkewX'
    CFloat
outSkewY' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
outSkewY
    let outSkewY'' :: Float
outSkewY'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
outSkewY'
    CFloat
outScaleX' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
outScaleX
    let outScaleX'' :: Float
outScaleX'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
outScaleX'
    CFloat
outScaleY' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
outScaleY
    let outScaleY'' :: Float
outScaleY'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
outScaleY'
    CFloat
outAngle' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
outAngle
    let outAngle'' :: Float
outAngle'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
outAngle'
    CFloat
outDx' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
outDx
    let outDx'' :: Float
outDx'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
outDx'
    CFloat
outDy' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
outDy
    let outDy'' :: Float
outDy'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
outDy'
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
self
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
outSkewX
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
outSkewY
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
outScaleX
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
outScaleY
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
outAngle
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
outDx
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
outDy
    (Float, Float, Float, Float, Float, Float, Float)
-> IO (Float, Float, Float, Float, Float, Float, Float)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Float
outSkewX'', Float
outSkewY'', Float
outScaleX'', Float
outScaleY'', Float
outAngle'', Float
outDx'', Float
outDy'')

#if defined(ENABLE_OVERLOADING)
data TransformTo2dComponentsMethodInfo
instance (signature ~ (m ((Float, Float, Float, Float, Float, Float, Float))), MonadIO m) => O.OverloadedMethod TransformTo2dComponentsMethodInfo Transform signature where
    overloadedMethod = transformTo2dComponents

instance O.OverloadedMethodInfo TransformTo2dComponentsMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformTo2dComponents",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformTo2dComponents"
        })


#endif

-- method Transform::to_affine
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskTransform`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_scale_x"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for the scale\n  factor in the x direction"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_scale_y"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for the scale\n  factor in the y direction"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_dx"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for the translation\n  in the x direction"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_dy"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for the translation\n  in the y direction"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_to_affine" gsk_transform_to_affine :: 
    Ptr Transform ->                        -- self : TInterface (Name {namespace = "Gsk", name = "Transform"})
    Ptr CFloat ->                           -- out_scale_x : TBasicType TFloat
    Ptr CFloat ->                           -- out_scale_y : TBasicType TFloat
    Ptr CFloat ->                           -- out_dx : TBasicType TFloat
    Ptr CFloat ->                           -- out_dy : TBasicType TFloat
    IO ()

-- | Converts a @GskTransform@ to 2D affine transformation factors.
-- 
-- To recreate an equivalent transform from the factors returned
-- by this function, use
-- 
--     gsk_transform_scale (gsk_transform_translate (NULL,
--                                                   &GRAPHENE_POINT_T (dx, dy)),
--                          sx, sy)
-- 
-- /@self@/ must be a 2D affine transformation. If you are not
-- sure, use
-- 
--     'GI.Gsk.Structs.Transform.transformGetCategory' >= 'GI.Gsk.Enums.TransformCategory2dAffine'
-- 
-- to check.
transformToAffine ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@self@/: a @GskTransform@
    -> m ((Float, Float, Float, Float))
transformToAffine :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> m (Float, Float, Float, Float)
transformToAffine Transform
self = IO (Float, Float, Float, Float) -> m (Float, Float, Float, Float)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Float, Float, Float, Float) -> m (Float, Float, Float, Float))
-> IO (Float, Float, Float, Float)
-> m (Float, Float, Float, Float)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
self' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Transform
self
    Ptr CFloat
outScaleX <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr CFloat
outScaleY <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr CFloat
outDx <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr CFloat
outDy <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr Transform
-> Ptr CFloat -> Ptr CFloat -> Ptr CFloat -> Ptr CFloat -> IO ()
gsk_transform_to_affine Ptr Transform
self' Ptr CFloat
outScaleX Ptr CFloat
outScaleY Ptr CFloat
outDx Ptr CFloat
outDy
    CFloat
outScaleX' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
outScaleX
    let outScaleX'' :: Float
outScaleX'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
outScaleX'
    CFloat
outScaleY' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
outScaleY
    let outScaleY'' :: Float
outScaleY'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
outScaleY'
    CFloat
outDx' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
outDx
    let outDx'' :: Float
outDx'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
outDx'
    CFloat
outDy' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
outDy
    let outDy'' :: Float
outDy'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
outDy'
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
self
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
outScaleX
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
outScaleY
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
outDx
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
outDy
    (Float, Float, Float, Float) -> IO (Float, Float, Float, Float)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Float
outScaleX'', Float
outScaleY'', Float
outDx'', Float
outDy'')

#if defined(ENABLE_OVERLOADING)
data TransformToAffineMethodInfo
instance (signature ~ (m ((Float, Float, Float, Float))), MonadIO m) => O.OverloadedMethod TransformToAffineMethodInfo Transform signature where
    overloadedMethod = transformToAffine

instance O.OverloadedMethodInfo TransformToAffineMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformToAffine",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformToAffine"
        })


#endif

-- method Transform::to_matrix
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskTransform`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_matrix"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Matrix" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The matrix to set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_to_matrix" gsk_transform_to_matrix :: 
    Ptr Transform ->                        -- self : TInterface (Name {namespace = "Gsk", name = "Transform"})
    Ptr Graphene.Matrix.Matrix ->           -- out_matrix : TInterface (Name {namespace = "Graphene", name = "Matrix"})
    IO ()

-- | Computes the actual value of /@self@/ and stores it in /@outMatrix@/.
-- 
-- The previous value of /@outMatrix@/ will be ignored.
transformToMatrix ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@self@/: a @GskTransform@
    -> m (Graphene.Matrix.Matrix)
transformToMatrix :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> m Matrix
transformToMatrix Transform
self = IO Matrix -> m Matrix
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Matrix -> m Matrix) -> IO Matrix -> m Matrix
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
self' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Transform
self
    Ptr Matrix
outMatrix <- Int -> IO (Ptr Matrix)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
64 :: IO (Ptr Graphene.Matrix.Matrix)
    Ptr Transform -> Ptr Matrix -> IO ()
gsk_transform_to_matrix Ptr Transform
self' Ptr Matrix
outMatrix
    Matrix
outMatrix' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Matrix -> Matrix
Graphene.Matrix.Matrix) Ptr Matrix
outMatrix
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
self
    Matrix -> IO Matrix
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
outMatrix'

#if defined(ENABLE_OVERLOADING)
data TransformToMatrixMethodInfo
instance (signature ~ (m (Graphene.Matrix.Matrix)), MonadIO m) => O.OverloadedMethod TransformToMatrixMethodInfo Transform signature where
    overloadedMethod = transformToMatrix

instance O.OverloadedMethodInfo TransformToMatrixMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformToMatrix",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformToMatrix"
        })


#endif

-- method Transform::to_string
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskTransform`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_to_string" gsk_transform_to_string :: 
    Ptr Transform ->                        -- self : TInterface (Name {namespace = "Gsk", name = "Transform"})
    IO CString

-- | Converts a matrix into a string that is suitable for printing.
-- 
-- The resulting string can be parsed with [func/@gsk@/.Transform.parse].
-- 
-- This is a wrapper around 'GI.Gsk.Structs.Transform.transformPrint'.
transformToString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@self@/: a @GskTransform@
    -> m T.Text
    -- ^ __Returns:__ A new string for /@self@/
transformToString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> m Text
transformToString Transform
self = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
self' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Transform
self
    CString
result <- Ptr Transform -> IO CString
gsk_transform_to_string Ptr Transform
self'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"transformToString" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
self
    Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data TransformToStringMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod TransformToStringMethodInfo Transform signature where
    overloadedMethod = transformToString

instance O.OverloadedMethodInfo TransformToStringMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformToString",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformToString"
        })


#endif

-- method Transform::to_translate
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskTransform`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_dx"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for the translation\n  in the x direction"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_dy"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for the translation\n  in the y direction"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_to_translate" gsk_transform_to_translate :: 
    Ptr Transform ->                        -- self : TInterface (Name {namespace = "Gsk", name = "Transform"})
    Ptr CFloat ->                           -- out_dx : TBasicType TFloat
    Ptr CFloat ->                           -- out_dy : TBasicType TFloat
    IO ()

-- | Converts a @GskTransform@ to a translation operation.
-- 
-- /@self@/ must be a 2D transformation. If you are not
-- sure, use
-- 
--     'GI.Gsk.Structs.Transform.transformGetCategory' >= 'GI.Gsk.Enums.TransformCategory2dTranslate'
-- 
-- to check.
transformToTranslate ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@self@/: a @GskTransform@
    -> m ((Float, Float))
transformToTranslate :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> m (Float, Float)
transformToTranslate Transform
self = IO (Float, Float) -> m (Float, Float)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Float, Float) -> m (Float, Float))
-> IO (Float, Float) -> m (Float, Float)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
self' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Transform
self
    Ptr CFloat
outDx <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr CFloat
outDy <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr Transform -> Ptr CFloat -> Ptr CFloat -> IO ()
gsk_transform_to_translate Ptr Transform
self' Ptr CFloat
outDx Ptr CFloat
outDy
    CFloat
outDx' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
outDx
    let outDx'' :: Float
outDx'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
outDx'
    CFloat
outDy' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
outDy
    let outDy'' :: Float
outDy'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
outDy'
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
self
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
outDx
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
outDy
    (Float, Float) -> IO (Float, Float)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Float
outDx'', Float
outDy'')

#if defined(ENABLE_OVERLOADING)
data TransformToTranslateMethodInfo
instance (signature ~ (m ((Float, Float))), MonadIO m) => O.OverloadedMethod TransformToTranslateMethodInfo Transform signature where
    overloadedMethod = transformToTranslate

instance O.OverloadedMethodInfo TransformToTranslateMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformToTranslate",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformToTranslate"
        })


#endif

-- method Transform::transform
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "next"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Transform to apply @other to"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "other"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Transform to apply" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gsk" , name = "Transform" })
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_transform" gsk_transform_transform :: 
    Ptr Transform ->                        -- next : TInterface (Name {namespace = "Gsk", name = "Transform"})
    Ptr Transform ->                        -- other : TInterface (Name {namespace = "Gsk", name = "Transform"})
    IO (Ptr Transform)

-- | Applies all the operations from /@other@/ to /@next@/.
transformTransform ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@next@/: Transform to apply /@other@/ to
    -> Maybe (Transform)
    -- ^ /@other@/: Transform to apply
    -> m (Maybe Transform)
    -- ^ __Returns:__ The new transform
transformTransform :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> Maybe Transform -> m (Maybe Transform)
transformTransform Transform
next Maybe Transform
other = IO (Maybe Transform) -> m (Maybe Transform)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Transform) -> m (Maybe Transform))
-> IO (Maybe Transform) -> m (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
next' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Transform
next
    Ptr Transform
maybeOther <- case Maybe Transform
other of
        Maybe Transform
Nothing -> Ptr Transform -> IO (Ptr Transform)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Transform
forall a. Ptr a
nullPtr
        Just Transform
jOther -> do
            Ptr Transform
jOther' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Transform
jOther
            Ptr Transform -> IO (Ptr Transform)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Transform
jOther'
    Ptr Transform
result <- Ptr Transform -> Ptr Transform -> IO (Ptr Transform)
gsk_transform_transform Ptr Transform
next' Ptr Transform
maybeOther
    Maybe Transform
maybeResult <- Ptr Transform
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Transform
result ((Ptr Transform -> IO Transform) -> IO (Maybe Transform))
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ \Ptr Transform
result' -> do
        Transform
result'' <- ((ManagedPtr Transform -> Transform)
-> Ptr Transform -> IO Transform
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Transform -> Transform
Transform) Ptr Transform
result'
        Transform -> IO Transform
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Transform
result''
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
next
    Maybe Transform -> (Transform -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Transform
other Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Maybe Transform -> IO (Maybe Transform)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Transform
maybeResult

#if defined(ENABLE_OVERLOADING)
data TransformTransformMethodInfo
instance (signature ~ (Maybe (Transform) -> m (Maybe Transform)), MonadIO m) => O.OverloadedMethod TransformTransformMethodInfo Transform signature where
    overloadedMethod = transformTransform

instance O.OverloadedMethodInfo TransformTransformMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformTransform",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformTransform"
        })


#endif

-- method Transform::transform_bounds
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskTransform`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "rect"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Rect" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `graphene_rect_t`"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_rect"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Rect" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "return location for the bounds\n  of the transformed rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_transform_bounds" gsk_transform_transform_bounds :: 
    Ptr Transform ->                        -- self : TInterface (Name {namespace = "Gsk", name = "Transform"})
    Ptr Graphene.Rect.Rect ->               -- rect : TInterface (Name {namespace = "Graphene", name = "Rect"})
    Ptr Graphene.Rect.Rect ->               -- out_rect : TInterface (Name {namespace = "Graphene", name = "Rect"})
    IO ()

-- | Transforms a @graphene_rect_t@ using the given transform /@self@/.
-- 
-- The result is the bounding box containing the coplanar quad.
transformTransformBounds ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@self@/: a @GskTransform@
    -> Graphene.Rect.Rect
    -- ^ /@rect@/: a @graphene_rect_t@
    -> m (Graphene.Rect.Rect)
transformTransformBounds :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> Rect -> m Rect
transformTransformBounds Transform
self Rect
rect = IO Rect -> m Rect
forall a. IO a -> m a
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 Transform
self' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Transform
self
    Ptr Rect
rect' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
rect
    Ptr Rect
outRect <- Int -> IO (Ptr Rect)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Graphene.Rect.Rect)
    Ptr Transform -> Ptr Rect -> Ptr Rect -> IO ()
gsk_transform_transform_bounds Ptr Transform
self' Ptr Rect
rect' Ptr Rect
outRect
    Rect
outRect' <- ((ManagedPtr Rect -> Rect) -> Ptr Rect -> IO Rect
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rect -> Rect
Graphene.Rect.Rect) Ptr Rect
outRect
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
self
    Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
rect
    Rect -> IO Rect
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Rect
outRect'

#if defined(ENABLE_OVERLOADING)
data TransformTransformBoundsMethodInfo
instance (signature ~ (Graphene.Rect.Rect -> m (Graphene.Rect.Rect)), MonadIO m) => O.OverloadedMethod TransformTransformBoundsMethodInfo Transform signature where
    overloadedMethod = transformTransformBounds

instance O.OverloadedMethodInfo TransformTransformBoundsMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformTransformBounds",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformTransformBounds"
        })


#endif

-- method Transform::transform_point
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskTransform`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "point"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Point" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `graphene_point_t`"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_point"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Point" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for\n  the transformed point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_transform_point" gsk_transform_transform_point :: 
    Ptr Transform ->                        -- self : TInterface (Name {namespace = "Gsk", name = "Transform"})
    Ptr Graphene.Point.Point ->             -- point : TInterface (Name {namespace = "Graphene", name = "Point"})
    Ptr Graphene.Point.Point ->             -- out_point : TInterface (Name {namespace = "Graphene", name = "Point"})
    IO ()

-- | Transforms a @graphene_point_t@ using the given transform /@self@/.
transformTransformPoint ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@self@/: a @GskTransform@
    -> Graphene.Point.Point
    -- ^ /@point@/: a @graphene_point_t@
    -> m (Graphene.Point.Point)
transformTransformPoint :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> Point -> m Point
transformTransformPoint Transform
self Point
point = IO Point -> m Point
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point -> m Point) -> IO Point -> m Point
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
self' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Transform
self
    Ptr Point
point' <- Point -> IO (Ptr Point)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point
point
    Ptr Point
outPoint <- Int -> IO (Ptr Point)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
8 :: IO (Ptr Graphene.Point.Point)
    Ptr Transform -> Ptr Point -> Ptr Point -> IO ()
gsk_transform_transform_point Ptr Transform
self' Ptr Point
point' Ptr Point
outPoint
    Point
outPoint' <- ((ManagedPtr Point -> Point) -> Ptr Point -> IO Point
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point -> Point
Graphene.Point.Point) Ptr Point
outPoint
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
self
    Point -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point
point
    Point -> IO Point
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Point
outPoint'

#if defined(ENABLE_OVERLOADING)
data TransformTransformPointMethodInfo
instance (signature ~ (Graphene.Point.Point -> m (Graphene.Point.Point)), MonadIO m) => O.OverloadedMethod TransformTransformPointMethodInfo Transform signature where
    overloadedMethod = transformTransformPoint

instance O.OverloadedMethodInfo TransformTransformPointMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformTransformPoint",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformTransformPoint"
        })


#endif

-- method Transform::translate
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "next"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the next transform" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "point"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Point" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the point to translate the transform by"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gsk" , name = "Transform" })
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_translate" gsk_transform_translate :: 
    Ptr Transform ->                        -- next : TInterface (Name {namespace = "Gsk", name = "Transform"})
    Ptr Graphene.Point.Point ->             -- point : TInterface (Name {namespace = "Graphene", name = "Point"})
    IO (Ptr Transform)

-- | Translates /@next@/ in 2-dimensional space by /@point@/.
transformTranslate ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@next@/: the next transform
    -> Graphene.Point.Point
    -- ^ /@point@/: the point to translate the transform by
    -> m (Maybe Transform)
    -- ^ __Returns:__ The new transform
transformTranslate :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> Point -> m (Maybe Transform)
transformTranslate Transform
next Point
point = IO (Maybe Transform) -> m (Maybe Transform)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Transform) -> m (Maybe Transform))
-> IO (Maybe Transform) -> m (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
next' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Transform
next
    Ptr Point
point' <- Point -> IO (Ptr Point)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point
point
    Ptr Transform
result <- Ptr Transform -> Ptr Point -> IO (Ptr Transform)
gsk_transform_translate Ptr Transform
next' Ptr Point
point'
    Maybe Transform
maybeResult <- Ptr Transform
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Transform
result ((Ptr Transform -> IO Transform) -> IO (Maybe Transform))
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ \Ptr Transform
result' -> do
        Transform
result'' <- ((ManagedPtr Transform -> Transform)
-> Ptr Transform -> IO Transform
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Transform -> Transform
Transform) Ptr Transform
result'
        Transform -> IO Transform
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Transform
result''
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
next
    Point -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point
point
    Maybe Transform -> IO (Maybe Transform)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Transform
maybeResult

#if defined(ENABLE_OVERLOADING)
data TransformTranslateMethodInfo
instance (signature ~ (Graphene.Point.Point -> m (Maybe Transform)), MonadIO m) => O.OverloadedMethod TransformTranslateMethodInfo Transform signature where
    overloadedMethod = transformTranslate

instance O.OverloadedMethodInfo TransformTranslateMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformTranslate",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformTranslate"
        })


#endif

-- method Transform::translate_3d
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "next"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the next transform" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "point"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Point3D" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the point to translate the transform by"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gsk" , name = "Transform" })
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_translate_3d" gsk_transform_translate_3d :: 
    Ptr Transform ->                        -- next : TInterface (Name {namespace = "Gsk", name = "Transform"})
    Ptr Graphene.Point3D.Point3D ->         -- point : TInterface (Name {namespace = "Graphene", name = "Point3D"})
    IO (Ptr Transform)

-- | Translates /@next@/ by /@point@/.
transformTranslate3d ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@next@/: the next transform
    -> Graphene.Point3D.Point3D
    -- ^ /@point@/: the point to translate the transform by
    -> m (Maybe Transform)
    -- ^ __Returns:__ The new transform
transformTranslate3d :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> Point3D -> m (Maybe Transform)
transformTranslate3d Transform
next Point3D
point = IO (Maybe Transform) -> m (Maybe Transform)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Transform) -> m (Maybe Transform))
-> IO (Maybe Transform) -> m (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Transform
next' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Transform
next
    Ptr Point3D
point' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
point
    Ptr Transform
result <- Ptr Transform -> Ptr Point3D -> IO (Ptr Transform)
gsk_transform_translate_3d Ptr Transform
next' Ptr Point3D
point'
    Maybe Transform
maybeResult <- Ptr Transform
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Transform
result ((Ptr Transform -> IO Transform) -> IO (Maybe Transform))
-> (Ptr Transform -> IO Transform) -> IO (Maybe Transform)
forall a b. (a -> b) -> a -> b
$ \Ptr Transform
result' -> do
        Transform
result'' <- ((ManagedPtr Transform -> Transform)
-> Ptr Transform -> IO Transform
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Transform -> Transform
Transform) Ptr Transform
result'
        Transform -> IO Transform
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Transform
result''
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
next
    Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
point
    Maybe Transform -> IO (Maybe Transform)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Transform
maybeResult

#if defined(ENABLE_OVERLOADING)
data TransformTranslate3dMethodInfo
instance (signature ~ (Graphene.Point3D.Point3D -> m (Maybe Transform)), MonadIO m) => O.OverloadedMethod TransformTranslate3dMethodInfo Transform signature where
    overloadedMethod = transformTranslate3d

instance O.OverloadedMethodInfo TransformTranslate3dMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformTranslate3d",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformTranslate3d"
        })


#endif

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

foreign import ccall "gsk_transform_unref" gsk_transform_unref :: 
    Ptr Transform ->                        -- self : TInterface (Name {namespace = "Gsk", name = "Transform"})
    IO ()

-- | Releases a reference on the given @GskTransform@.
-- 
-- If the reference was the last, the resources associated to the /@self@/ are
-- freed.
transformUnref ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Transform
    -- ^ /@self@/: a @GskTransform@
    -> m ()
transformUnref :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Transform -> m ()
transformUnref Transform
self = 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 Transform
self' <- Transform -> IO (Ptr Transform)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Transform
self
    Ptr Transform -> IO ()
gsk_transform_unref Ptr Transform
self'
    Transform -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Transform
self
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data TransformUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod TransformUnrefMethodInfo Transform signature where
    overloadedMethod = transformUnref

instance O.OverloadedMethodInfo TransformUnrefMethodInfo Transform where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Structs.Transform.transformUnref",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.5/docs/GI-Gsk-Structs-Transform.html#v:transformUnref"
        })


#endif

-- method Transform::parse
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "string"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the string to parse"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_transform"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Transform" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The location to put the transform in"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gsk_transform_parse" gsk_transform_parse :: 
    CString ->                              -- string : TBasicType TUTF8
    Ptr (Ptr Transform) ->                  -- out_transform : TInterface (Name {namespace = "Gsk", name = "Transform"})
    IO CInt

-- | Parses the given /@string@/ into a transform and puts it in
-- /@outTransform@/.
-- 
-- Strings printed via 'GI.Gsk.Structs.Transform.transformToString'
-- can be read in again successfully using this function.
-- 
-- If /@string@/ does not describe a valid transform, 'P.False' is
-- returned and 'P.Nothing' is put in /@outTransform@/.
transformParse ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@string@/: the string to parse
    -> m ((Bool, Transform))
    -- ^ __Returns:__ 'P.True' if /@string@/ described a valid transform.
transformParse :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m (Bool, Transform)
transformParse Text
string = IO (Bool, Transform) -> m (Bool, Transform)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Transform) -> m (Bool, Transform))
-> IO (Bool, Transform) -> m (Bool, Transform)
forall a b. (a -> b) -> a -> b
$ do
    CString
string' <- Text -> IO CString
textToCString Text
string
    Ptr (Ptr Transform)
outTransform <- IO (Ptr (Ptr Transform))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Transform))
    CInt
result <- CString -> Ptr (Ptr Transform) -> IO CInt
gsk_transform_parse CString
string' Ptr (Ptr Transform)
outTransform
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Ptr Transform
outTransform' <- Ptr (Ptr Transform) -> IO (Ptr Transform)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Transform)
outTransform
    Transform
outTransform'' <- ((ManagedPtr Transform -> Transform)
-> Ptr Transform -> IO Transform
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Transform -> Transform
Transform) Ptr Transform
outTransform'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
string'
    Ptr (Ptr Transform) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Transform)
outTransform
    (Bool, Transform) -> IO (Bool, Transform)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Transform
outTransform'')

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveTransformMethod (t :: Symbol) (o :: *) :: * where
    ResolveTransformMethod "equal" o = TransformEqualMethodInfo
    ResolveTransformMethod "invert" o = TransformInvertMethodInfo
    ResolveTransformMethod "matrix" o = TransformMatrixMethodInfo
    ResolveTransformMethod "perspective" o = TransformPerspectiveMethodInfo
    ResolveTransformMethod "print" o = TransformPrintMethodInfo
    ResolveTransformMethod "ref" o = TransformRefMethodInfo
    ResolveTransformMethod "rotate" o = TransformRotateMethodInfo
    ResolveTransformMethod "rotate3d" o = TransformRotate3dMethodInfo
    ResolveTransformMethod "scale" o = TransformScaleMethodInfo
    ResolveTransformMethod "scale3d" o = TransformScale3dMethodInfo
    ResolveTransformMethod "skew" o = TransformSkewMethodInfo
    ResolveTransformMethod "to2d" o = TransformTo2dMethodInfo
    ResolveTransformMethod "to2dComponents" o = TransformTo2dComponentsMethodInfo
    ResolveTransformMethod "toAffine" o = TransformToAffineMethodInfo
    ResolveTransformMethod "toMatrix" o = TransformToMatrixMethodInfo
    ResolveTransformMethod "toString" o = TransformToStringMethodInfo
    ResolveTransformMethod "toTranslate" o = TransformToTranslateMethodInfo
    ResolveTransformMethod "transform" o = TransformTransformMethodInfo
    ResolveTransformMethod "transformBounds" o = TransformTransformBoundsMethodInfo
    ResolveTransformMethod "transformPoint" o = TransformTransformPointMethodInfo
    ResolveTransformMethod "translate" o = TransformTranslateMethodInfo
    ResolveTransformMethod "translate3d" o = TransformTranslate3dMethodInfo
    ResolveTransformMethod "unref" o = TransformUnrefMethodInfo
    ResolveTransformMethod "getCategory" o = TransformGetCategoryMethodInfo
    ResolveTransformMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif