{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- Implements a fragment shader using GLSL.
-- 
-- A fragment shader gets the coordinates being rendered as input and
-- produces the pixel values for that particular pixel. Additionally,
-- the shader can declare a set of other input arguments, called
-- uniforms (as they are uniform over all the calls to your shader in
-- each instance of use). A shader can also receive up to 4
-- textures that it can use as input when producing the pixel data.
-- 
-- @GskGLShader@ is usually used with @/gtk_snapshot_push_gl_shader()/@
-- to produce a t'GI.Gsk.Objects.GLShaderNode.GLShaderNode' in the rendering hierarchy,
-- and then its input textures are constructed by rendering the child
-- nodes to textures before rendering the shader node itself. (You can
-- pass texture nodes as children if you want to directly use a texture
-- as input).
-- 
-- The actual shader code is GLSL code that gets combined with
-- some other code into the fragment shader. Since the exact
-- capabilities of the GPU driver differs between different OpenGL
-- drivers and hardware, GTK adds some defines that you can use
-- to ensure your GLSL code runs on as many drivers as it can.
-- 
-- If the OpenGL driver is GLES, then the shader language version
-- is set to 100, and GSK_GLES will be defined in the shader.
-- 
-- Otherwise, if the OpenGL driver does not support the 3.2 core profile,
-- then the shader will run with language version 110 for GL2 and 130 for GL3,
-- and GSK_LEGACY will be defined in the shader.
-- 
-- If the OpenGL driver supports the 3.2 code profile, it will be used,
-- the shader language version is set to 150, and GSK_GL3 will be defined
-- in the shader.
-- 
-- The main function the shader must implement is:
-- 
-- 
-- === /glsl code/
-- > void mainImage(out vec4 fragColor,
-- >                in vec2 fragCoord,
-- >                in vec2 resolution,
-- >                in vec2 uv)
-- 
-- 
-- Where the input /@fragCoord@/ is the coordinate of the pixel we\'re
-- currently rendering, relative to the boundary rectangle that was
-- specified in the @GskGLShaderNode@, and /@resolution@/ is the width and
-- height of that rectangle. This is in the typical GTK coordinate
-- system with the origin in the top left. /@uv@/ contains the u and v
-- coordinates that can be used to index a texture at the
-- corresponding point. These coordinates are in the [0..1]x[0..1]
-- region, with 0, 0 being in the lower left corder (which is typical
-- for OpenGL).
-- 
-- The output /@fragColor@/ should be a RGBA color (with
-- premultiplied alpha) that will be used as the output for the
-- specified pixel location. Note that this output will be
-- automatically clipped to the clip region of the glshader node.
-- 
-- In addition to the function arguments the shader can define
-- up to 4 uniforms for textures which must be called u_textureN
-- (i.e. u_texture1 to u_texture4) as well as any custom uniforms
-- you want of types int, uint, bool, float, vec2, vec3 or vec4.
-- 
-- All textures sources contain premultiplied alpha colors, but if some
-- there are outer sources of colors there is a @/gsk_premultiply()/@ helper
-- to compute premultiplication when needed.
-- 
-- Note that GTK parses the uniform declarations, so each uniform has to
-- be on a line by itself with no other code, like so:
-- 
-- 
-- === /glsl code/
-- >uniform float u_time;
-- >uniform vec3 u_color;
-- >uniform sampler2D u_texture1;
-- >uniform sampler2D u_texture2;
-- 
-- 
-- GTK uses the \"gsk\" namespace in the symbols it uses in the
-- shader, so your code should not use any symbols with the prefix gsk
-- or GSK. There are some helper functions declared that you can use:
-- 
-- 
-- === /glsl code/
-- >vec4 GskTexture(sampler2D sampler, vec2 texCoords);
-- 
-- 
-- This samples a texture (e.g. u_texture1) at the specified
-- coordinates, and contains some helper ifdefs to ensure that
-- it works on all OpenGL versions.
-- 
-- You can compile the shader yourself using 'GI.Gsk.Objects.GLShader.gLShaderCompile',
-- otherwise the GSK renderer will do it when it handling the glshader
-- node. If errors occurs, the returned /@error@/ will include the glsl
-- sources, so you can see what GSK was passing to the compiler. You
-- can also set GSK_DEBUG=shaders in the environment to see the sources
-- and other relevant information about all shaders that GSK is handling.
-- 
-- = An example shader
-- 
-- 
-- === /glsl code/
-- >uniform float position;
-- >uniform sampler2D u_texture1;
-- >uniform sampler2D u_texture2;
-- >
-- >void mainImage(out vec4 fragColor,
-- >               in vec2 fragCoord,
-- >               in vec2 resolution,
-- >               in vec2 uv) {
-- >  vec4 source1 = GskTexture(u_texture1, uv);
-- >  vec4 source2 = GskTexture(u_texture2, uv);
-- >
-- >  fragColor = position * source1 + (1.0 - position) * source2;
-- >}
-- 

#if !defined(__HADDOCK_VERSION__)
#define ENABLE_OVERLOADING
#endif

module GI.Gsk.Objects.GLShader
    ( 

-- * Exported types
    GLShader(..)                            ,
    IsGLShader                              ,
    toGLShader                              ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [compile]("GI.Gsk.Objects.GLShader#g:method:compile"), [findUniformByName]("GI.Gsk.Objects.GLShader#g:method:findUniformByName"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getArgBool]("GI.Gsk.Objects.GLShader#g:method:getArgBool"), [getArgFloat]("GI.Gsk.Objects.GLShader#g:method:getArgFloat"), [getArgInt]("GI.Gsk.Objects.GLShader#g:method:getArgInt"), [getArgUint]("GI.Gsk.Objects.GLShader#g:method:getArgUint"), [getArgVec2]("GI.Gsk.Objects.GLShader#g:method:getArgVec2"), [getArgVec3]("GI.Gsk.Objects.GLShader#g:method:getArgVec3"), [getArgVec4]("GI.Gsk.Objects.GLShader#g:method:getArgVec4"), [getArgsSize]("GI.Gsk.Objects.GLShader#g:method:getArgsSize"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getNTextures]("GI.Gsk.Objects.GLShader#g:method:getNTextures"), [getNUniforms]("GI.Gsk.Objects.GLShader#g:method:getNUniforms"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getResource]("GI.Gsk.Objects.GLShader#g:method:getResource"), [getSource]("GI.Gsk.Objects.GLShader#g:method:getSource"), [getUniformName]("GI.Gsk.Objects.GLShader#g:method:getUniformName"), [getUniformOffset]("GI.Gsk.Objects.GLShader#g:method:getUniformOffset"), [getUniformType]("GI.Gsk.Objects.GLShader#g:method:getUniformType").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveGLShaderMethod                   ,
#endif

-- ** compile #method:compile#

#if defined(ENABLE_OVERLOADING)
    GLShaderCompileMethodInfo               ,
#endif
    gLShaderCompile                         ,


-- ** findUniformByName #method:findUniformByName#

#if defined(ENABLE_OVERLOADING)
    GLShaderFindUniformByNameMethodInfo     ,
#endif
    gLShaderFindUniformByName               ,


-- ** getArgBool #method:getArgBool#

#if defined(ENABLE_OVERLOADING)
    GLShaderGetArgBoolMethodInfo            ,
#endif
    gLShaderGetArgBool                      ,


-- ** getArgFloat #method:getArgFloat#

#if defined(ENABLE_OVERLOADING)
    GLShaderGetArgFloatMethodInfo           ,
#endif
    gLShaderGetArgFloat                     ,


-- ** getArgInt #method:getArgInt#

#if defined(ENABLE_OVERLOADING)
    GLShaderGetArgIntMethodInfo             ,
#endif
    gLShaderGetArgInt                       ,


-- ** getArgUint #method:getArgUint#

#if defined(ENABLE_OVERLOADING)
    GLShaderGetArgUintMethodInfo            ,
#endif
    gLShaderGetArgUint                      ,


-- ** getArgVec2 #method:getArgVec2#

#if defined(ENABLE_OVERLOADING)
    GLShaderGetArgVec2MethodInfo            ,
#endif
    gLShaderGetArgVec2                      ,


-- ** getArgVec3 #method:getArgVec3#

#if defined(ENABLE_OVERLOADING)
    GLShaderGetArgVec3MethodInfo            ,
#endif
    gLShaderGetArgVec3                      ,


-- ** getArgVec4 #method:getArgVec4#

#if defined(ENABLE_OVERLOADING)
    GLShaderGetArgVec4MethodInfo            ,
#endif
    gLShaderGetArgVec4                      ,


-- ** getArgsSize #method:getArgsSize#

#if defined(ENABLE_OVERLOADING)
    GLShaderGetArgsSizeMethodInfo           ,
#endif
    gLShaderGetArgsSize                     ,


-- ** getNTextures #method:getNTextures#

#if defined(ENABLE_OVERLOADING)
    GLShaderGetNTexturesMethodInfo          ,
#endif
    gLShaderGetNTextures                    ,


-- ** getNUniforms #method:getNUniforms#

#if defined(ENABLE_OVERLOADING)
    GLShaderGetNUniformsMethodInfo          ,
#endif
    gLShaderGetNUniforms                    ,


-- ** getResource #method:getResource#

#if defined(ENABLE_OVERLOADING)
    GLShaderGetResourceMethodInfo           ,
#endif
    gLShaderGetResource                     ,


-- ** getSource #method:getSource#

#if defined(ENABLE_OVERLOADING)
    GLShaderGetSourceMethodInfo             ,
#endif
    gLShaderGetSource                       ,


-- ** getUniformName #method:getUniformName#

#if defined(ENABLE_OVERLOADING)
    GLShaderGetUniformNameMethodInfo        ,
#endif
    gLShaderGetUniformName                  ,


-- ** getUniformOffset #method:getUniformOffset#

#if defined(ENABLE_OVERLOADING)
    GLShaderGetUniformOffsetMethodInfo      ,
#endif
    gLShaderGetUniformOffset                ,


-- ** getUniformType #method:getUniformType#

#if defined(ENABLE_OVERLOADING)
    GLShaderGetUniformTypeMethodInfo        ,
#endif
    gLShaderGetUniformType                  ,


-- ** newFromBytes #method:newFromBytes#

    gLShaderNewFromBytes                    ,


-- ** newFromResource #method:newFromResource#

    gLShaderNewFromResource                 ,




 -- * Properties


-- ** resource #attr:resource#
-- | Resource containing the source code for the shader.
-- 
-- If the shader source is not coming from a resource, this
-- will be 'P.Nothing'.

#if defined(ENABLE_OVERLOADING)
    GLShaderResourcePropertyInfo            ,
#endif
    constructGLShaderResource               ,
#if defined(ENABLE_OVERLOADING)
    gLShaderResource                        ,
#endif
    getGLShaderResource                     ,


-- ** source #attr:source#
-- | The source code for the shader, as a @GBytes@.

#if defined(ENABLE_OVERLOADING)
    GLShaderSourcePropertyInfo              ,
#endif
    constructGLShaderSource                 ,
#if defined(ENABLE_OVERLOADING)
    gLShaderSource                          ,
#endif
    getGLShaderSource                       ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT

-- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392
#if MIN_VERSION_base(4,18,0)
import qualified GI.Cairo.Structs.Context as Cairo.Context
import qualified GI.Cairo.Structs.Region as Cairo.Region
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Objects.Display as Gdk.Display
import qualified GI.Gdk.Objects.Surface as Gdk.Surface
import qualified GI.Gdk.Objects.Texture as Gdk.Texture
import qualified GI.Graphene.Structs.Rect as Graphene.Rect
import qualified GI.Graphene.Structs.Vec2 as Graphene.Vec2
import qualified GI.Graphene.Structs.Vec3 as Graphene.Vec3
import qualified GI.Graphene.Structs.Vec4 as Graphene.Vec4
import qualified GI.Gsk.Callbacks as Gsk.Callbacks
import {-# SOURCE #-} qualified GI.Gsk.Enums as Gsk.Enums
import {-# SOURCE #-} qualified GI.Gsk.Objects.RenderNode as Gsk.RenderNode
import {-# SOURCE #-} qualified GI.Gsk.Objects.Renderer as Gsk.Renderer

#else
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Graphene.Structs.Vec2 as Graphene.Vec2
import qualified GI.Graphene.Structs.Vec3 as Graphene.Vec3
import qualified GI.Graphene.Structs.Vec4 as Graphene.Vec4
import {-# SOURCE #-} qualified GI.Gsk.Enums as Gsk.Enums
import {-# SOURCE #-} qualified GI.Gsk.Objects.Renderer as Gsk.Renderer

#endif

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

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

foreign import ccall "gsk_gl_shader_get_type"
    c_gsk_gl_shader_get_type :: IO B.Types.GType

instance B.Types.TypedObject GLShader where
    glibType :: IO GType
glibType = IO GType
c_gsk_gl_shader_get_type

instance B.Types.GObject GLShader

-- | Type class for types which can be safely cast to t'GLShader', for instance with `toGLShader`.
class (SP.GObject o, O.IsDescendantOf GLShader o) => IsGLShader o
instance (SP.GObject o, O.IsDescendantOf GLShader o) => IsGLShader o

instance O.HasParentTypes GLShader
type instance O.ParentTypes GLShader = '[GObject.Object.Object]

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

-- | Convert t'GLShader' to and from t'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe GLShader) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gsk_gl_shader_get_type
    gvalueSet_ :: Ptr GValue -> Maybe GLShader -> IO ()
gvalueSet_ Ptr GValue
gv Maybe GLShader
P.Nothing = Ptr GValue -> Ptr GLShader -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr GLShader
forall a. Ptr a
FP.nullPtr :: FP.Ptr GLShader)
    gvalueSet_ Ptr GValue
gv (P.Just GLShader
obj) = GLShader -> (Ptr GLShader -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr GLShader
obj (Ptr GValue -> Ptr GLShader -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe GLShader)
gvalueGet_ Ptr GValue
gv = do
        ptr <- Ptr GValue -> IO (Ptr GLShader)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr GLShader)
        if ptr /= FP.nullPtr
        then P.Just <$> B.ManagedPtr.newObject GLShader ptr
        else return P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
type family ResolveGLShaderMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveGLShaderMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveGLShaderMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveGLShaderMethod "compile" o = GLShaderCompileMethodInfo
    ResolveGLShaderMethod "findUniformByName" o = GLShaderFindUniformByNameMethodInfo
    ResolveGLShaderMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveGLShaderMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveGLShaderMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveGLShaderMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveGLShaderMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveGLShaderMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveGLShaderMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveGLShaderMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveGLShaderMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveGLShaderMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveGLShaderMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveGLShaderMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveGLShaderMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveGLShaderMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveGLShaderMethod "getArgBool" o = GLShaderGetArgBoolMethodInfo
    ResolveGLShaderMethod "getArgFloat" o = GLShaderGetArgFloatMethodInfo
    ResolveGLShaderMethod "getArgInt" o = GLShaderGetArgIntMethodInfo
    ResolveGLShaderMethod "getArgUint" o = GLShaderGetArgUintMethodInfo
    ResolveGLShaderMethod "getArgVec2" o = GLShaderGetArgVec2MethodInfo
    ResolveGLShaderMethod "getArgVec3" o = GLShaderGetArgVec3MethodInfo
    ResolveGLShaderMethod "getArgVec4" o = GLShaderGetArgVec4MethodInfo
    ResolveGLShaderMethod "getArgsSize" o = GLShaderGetArgsSizeMethodInfo
    ResolveGLShaderMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveGLShaderMethod "getNTextures" o = GLShaderGetNTexturesMethodInfo
    ResolveGLShaderMethod "getNUniforms" o = GLShaderGetNUniformsMethodInfo
    ResolveGLShaderMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveGLShaderMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveGLShaderMethod "getResource" o = GLShaderGetResourceMethodInfo
    ResolveGLShaderMethod "getSource" o = GLShaderGetSourceMethodInfo
    ResolveGLShaderMethod "getUniformName" o = GLShaderGetUniformNameMethodInfo
    ResolveGLShaderMethod "getUniformOffset" o = GLShaderGetUniformOffsetMethodInfo
    ResolveGLShaderMethod "getUniformType" o = GLShaderGetUniformTypeMethodInfo
    ResolveGLShaderMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveGLShaderMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveGLShaderMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveGLShaderMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

-- VVV Prop "resource"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just True,Nothing)

-- | Get the value of the “@resource@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' gLShader #resource
-- @
getGLShaderResource :: (MonadIO m, IsGLShader o) => o -> m (Maybe T.Text)
getGLShaderResource :: forall (m :: * -> *) o.
(MonadIO m, IsGLShader o) =>
o -> m (Maybe Text)
getGLShaderResource o
obj = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"resource"

-- | Construct a t'GValueConstruct' with valid value for the “@resource@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructGLShaderResource :: (IsGLShader o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructGLShaderResource :: forall o (m :: * -> *).
(IsGLShader o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructGLShaderResource Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"resource" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)

#if defined(ENABLE_OVERLOADING)
data GLShaderResourcePropertyInfo
instance AttrInfo GLShaderResourcePropertyInfo where
    type AttrAllowedOps GLShaderResourcePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint GLShaderResourcePropertyInfo = IsGLShader
    type AttrSetTypeConstraint GLShaderResourcePropertyInfo = (~) T.Text
    type AttrTransferTypeConstraint GLShaderResourcePropertyInfo = (~) T.Text
    type AttrTransferType GLShaderResourcePropertyInfo = T.Text
    type AttrGetType GLShaderResourcePropertyInfo = (Maybe T.Text)
    type AttrLabel GLShaderResourcePropertyInfo = "resource"
    type AttrOrigin GLShaderResourcePropertyInfo = GLShader
    attrGet = getGLShaderResource
    attrSet = undefined
    attrPut = undefined
    attrTransfer _ v = do
        return v
    attrConstruct = constructGLShaderResource
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Objects.GLShader.resource"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.9/docs/GI-Gsk-Objects-GLShader.html#g:attr:resource"
        })
#endif

-- VVV Prop "source"
   -- Type: TInterface (Name {namespace = "GLib", name = "Bytes"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just False,Nothing)

-- | Get the value of the “@source@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' gLShader #source
-- @
getGLShaderSource :: (MonadIO m, IsGLShader o) => o -> m GLib.Bytes.Bytes
getGLShaderSource :: forall (m :: * -> *) o. (MonadIO m, IsGLShader o) => o -> m Bytes
getGLShaderSource o
obj = IO Bytes -> m Bytes
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bytes -> m Bytes) -> IO Bytes -> m Bytes
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Bytes) -> IO Bytes
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getGLShaderSource" (IO (Maybe Bytes) -> IO Bytes) -> IO (Maybe Bytes) -> IO Bytes
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr Bytes -> Bytes) -> IO (Maybe Bytes)
forall a b.
(GObject a, GBoxed b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyBoxed o
obj String
"source" ManagedPtr Bytes -> Bytes
GLib.Bytes.Bytes

-- | Construct a t'GValueConstruct' with valid value for the “@source@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructGLShaderSource :: (IsGLShader o, MIO.MonadIO m) => GLib.Bytes.Bytes -> m (GValueConstruct o)
constructGLShaderSource :: forall o (m :: * -> *).
(IsGLShader o, MonadIO m) =>
Bytes -> m (GValueConstruct o)
constructGLShaderSource Bytes
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Bytes -> IO (GValueConstruct o)
forall a o. GBoxed a => String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBoxed String
"source" (Bytes -> Maybe Bytes
forall a. a -> Maybe a
P.Just Bytes
val)

#if defined(ENABLE_OVERLOADING)
data GLShaderSourcePropertyInfo
instance AttrInfo GLShaderSourcePropertyInfo where
    type AttrAllowedOps GLShaderSourcePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint GLShaderSourcePropertyInfo = IsGLShader
    type AttrSetTypeConstraint GLShaderSourcePropertyInfo = (~) GLib.Bytes.Bytes
    type AttrTransferTypeConstraint GLShaderSourcePropertyInfo = (~) GLib.Bytes.Bytes
    type AttrTransferType GLShaderSourcePropertyInfo = GLib.Bytes.Bytes
    type AttrGetType GLShaderSourcePropertyInfo = GLib.Bytes.Bytes
    type AttrLabel GLShaderSourcePropertyInfo = "source"
    type AttrOrigin GLShaderSourcePropertyInfo = GLShader
    attrGet = getGLShaderSource
    attrSet = undefined
    attrPut = undefined
    attrTransfer _ v = do
        return v
    attrConstruct = constructGLShaderSource
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Objects.GLShader.source"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.9/docs/GI-Gsk-Objects-GLShader.html#g:attr:source"
        })
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList GLShader
type instance O.AttributeList GLShader = GLShaderAttributeList
type GLShaderAttributeList = ('[ '("resource", GLShaderResourcePropertyInfo), '("source", GLShaderSourcePropertyInfo)] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
gLShaderResource :: AttrLabelProxy "resource"
gLShaderResource = AttrLabelProxy

gLShaderSource :: AttrLabelProxy "source"
gLShaderSource = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList GLShader = GLShaderSignalList
type GLShaderSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])

#endif

-- method GLShader::new_from_bytes
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "sourcecode"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "GLSL sourcecode for the shader, as a `GBytes`"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gsk" , name = "GLShader" })
-- throws : False
-- Skip return : False

foreign import ccall "gsk_gl_shader_new_from_bytes" gsk_gl_shader_new_from_bytes :: 
    Ptr GLib.Bytes.Bytes ->                 -- sourcecode : TInterface (Name {namespace = "GLib", name = "Bytes"})
    IO (Ptr GLShader)

{-# DEPRECATED gLShaderNewFromBytes ["(Since version 4.16)","GTK\\'s new Vulkan-focused rendering","  does not support this feature. Use <http://developer.gnome.org/gsk/stable/../gtk4/class.GLArea.html GtkGLArea>","  for OpenGL rendering."] #-}
-- | Creates a @GskGLShader@ that will render pixels using the specified code.
gLShaderNewFromBytes ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GLib.Bytes.Bytes
    -- ^ /@sourcecode@/: GLSL sourcecode for the shader, as a @GBytes@
    -> m GLShader
    -- ^ __Returns:__ A new @GskGLShader@
gLShaderNewFromBytes :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Bytes -> m GLShader
gLShaderNewFromBytes Bytes
sourcecode = IO GLShader -> m GLShader
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GLShader -> m GLShader) -> IO GLShader -> m GLShader
forall a b. (a -> b) -> a -> b
$ do
    sourcecode' <- Bytes -> IO (Ptr Bytes)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bytes
sourcecode
    result <- gsk_gl_shader_new_from_bytes sourcecode'
    checkUnexpectedReturnNULL "gLShaderNewFromBytes" result
    result' <- (wrapObject GLShader) result
    touchManagedPtr sourcecode
    return result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method GLShader::new_from_resource
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "resource_path"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "path to a resource that contains the GLSL sourcecode for\n    the shader"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gsk" , name = "GLShader" })
-- throws : False
-- Skip return : False

foreign import ccall "gsk_gl_shader_new_from_resource" gsk_gl_shader_new_from_resource :: 
    CString ->                              -- resource_path : TBasicType TUTF8
    IO (Ptr GLShader)

{-# DEPRECATED gLShaderNewFromResource ["(Since version 4.16)","GTK\\'s new Vulkan-focused rendering","  does not support this feature. Use <http://developer.gnome.org/gsk/stable/../gtk4/class.GLArea.html GtkGLArea>","  for OpenGL rendering."] #-}
-- | Creates a @GskGLShader@ that will render pixels using the specified code.
gLShaderNewFromResource ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@resourcePath@/: path to a resource that contains the GLSL sourcecode for
    --     the shader
    -> m GLShader
    -- ^ __Returns:__ A new @GskGLShader@
gLShaderNewFromResource :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m GLShader
gLShaderNewFromResource Text
resourcePath = IO GLShader -> m GLShader
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GLShader -> m GLShader) -> IO GLShader -> m GLShader
forall a b. (a -> b) -> a -> b
$ do
    resourcePath' <- Text -> IO CString
textToCString Text
resourcePath
    result <- gsk_gl_shader_new_from_resource resourcePath'
    checkUnexpectedReturnNULL "gLShaderNewFromResource" result
    result' <- (wrapObject GLShader) result
    freeMem resourcePath'
    return result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method GLShader::compile
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "shader"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "GLShader" }
--           , argCType = Just "GskGLShader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskGLShader`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "renderer"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "Renderer" }
--           , argCType = Just "GskRenderer*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskRenderer`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "gsk_gl_shader_compile" gsk_gl_shader_compile :: 
    Ptr GLShader ->                         -- shader : TInterface (Name {namespace = "Gsk", name = "GLShader"})
    Ptr Gsk.Renderer.Renderer ->            -- renderer : TInterface (Name {namespace = "Gsk", name = "Renderer"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{-# DEPRECATED gLShaderCompile ["(Since version 4.16)","GTK\\'s new Vulkan-focused rendering","  does not support this feature. Use <http://developer.gnome.org/gsk/stable/../gtk4/class.GLArea.html GtkGLArea>","  for OpenGL rendering."] #-}
-- | Tries to compile the /@shader@/ for the given /@renderer@/.
-- 
-- If there is a problem, this function returns 'P.False' and reports
-- an error. You should use this function before relying on the shader
-- for rendering and use a fallback with a simpler shader or without
-- shaders if it fails.
-- 
-- Note that this will modify the rendering state (for example
-- change the current GL context) and requires the renderer to be
-- set up. This means that the widget has to be realized. Commonly you
-- want to call this from the realize signal of a widget, or during
-- widget snapshot.
gLShaderCompile ::
    (B.CallStack.HasCallStack, MonadIO m, IsGLShader a, Gsk.Renderer.IsRenderer b) =>
    a
    -- ^ /@shader@/: a @GskGLShader@
    -> b
    -- ^ /@renderer@/: a @GskRenderer@
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
gLShaderCompile :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsGLShader a, IsRenderer b) =>
a -> b -> m ()
gLShaderCompile a
shader b
renderer = 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
    shader' <- a -> IO (Ptr GLShader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
shader
    renderer' <- unsafeManagedPtrCastPtr renderer
    onException (do
        _ <- propagateGError $ gsk_gl_shader_compile shader' renderer'
        touchManagedPtr shader
        touchManagedPtr renderer
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data GLShaderCompileMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsGLShader a, Gsk.Renderer.IsRenderer b) => O.OverloadedMethod GLShaderCompileMethodInfo a signature where
    overloadedMethod = gLShaderCompile

instance O.OverloadedMethodInfo GLShaderCompileMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Objects.GLShader.gLShaderCompile",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.9/docs/GI-Gsk-Objects-GLShader.html#v:gLShaderCompile"
        })


#endif

-- method GLShader::find_uniform_by_name
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "shader"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "GLShader" }
--           , argCType = Just "GskGLShader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskGLShader`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "uniform name" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "gsk_gl_shader_find_uniform_by_name" gsk_gl_shader_find_uniform_by_name :: 
    Ptr GLShader ->                         -- shader : TInterface (Name {namespace = "Gsk", name = "GLShader"})
    CString ->                              -- name : TBasicType TUTF8
    IO Int32

{-# DEPRECATED gLShaderFindUniformByName ["(Since version 4.16)","GTK\\'s new Vulkan-focused rendering","  does not support this feature. Use <http://developer.gnome.org/gsk/stable/../gtk4/class.GLArea.html GtkGLArea>","  for OpenGL rendering."] #-}
-- | Looks for a uniform by the name /@name@/, and returns the index
-- of the uniform, or -1 if it was not found.
gLShaderFindUniformByName ::
    (B.CallStack.HasCallStack, MonadIO m, IsGLShader a) =>
    a
    -- ^ /@shader@/: a @GskGLShader@
    -> T.Text
    -- ^ /@name@/: uniform name
    -> m Int32
    -- ^ __Returns:__ The index of the uniform, or -1
gLShaderFindUniformByName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLShader a) =>
a -> Text -> m Int32
gLShaderFindUniformByName a
shader Text
name = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    shader' <- a -> IO (Ptr GLShader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
shader
    name' <- textToCString name
    result <- gsk_gl_shader_find_uniform_by_name shader' name'
    touchManagedPtr shader
    freeMem name'
    return result

#if defined(ENABLE_OVERLOADING)
data GLShaderFindUniformByNameMethodInfo
instance (signature ~ (T.Text -> m Int32), MonadIO m, IsGLShader a) => O.OverloadedMethod GLShaderFindUniformByNameMethodInfo a signature where
    overloadedMethod = gLShaderFindUniformByName

instance O.OverloadedMethodInfo GLShaderFindUniformByNameMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Objects.GLShader.gLShaderFindUniformByName",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.9/docs/GI-Gsk-Objects-GLShader.html#v:gLShaderFindUniformByName"
        })


#endif

-- method GLShader::get_arg_bool
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "shader"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "GLShader" }
--           , argCType = Just "GskGLShader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskGLShader`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "args"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "uniform arguments" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "idx"
--           , argType = TBasicType TInt
--           , argCType = Just "int"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "index of the uniform"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gsk_gl_shader_get_arg_bool" gsk_gl_shader_get_arg_bool :: 
    Ptr GLShader ->                         -- shader : TInterface (Name {namespace = "Gsk", name = "GLShader"})
    Ptr GLib.Bytes.Bytes ->                 -- args : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Int32 ->                                -- idx : TBasicType TInt
    IO CInt

{-# DEPRECATED gLShaderGetArgBool ["(Since version 4.16)","GTK\\'s new Vulkan-focused rendering","  does not support this feature. Use <http://developer.gnome.org/gsk/stable/../gtk4/class.GLArea.html GtkGLArea>","  for OpenGL rendering."] #-}
-- | Gets the value of the uniform /@idx@/ in the /@args@/ block.
-- 
-- The uniform must be of bool type.
gLShaderGetArgBool ::
    (B.CallStack.HasCallStack, MonadIO m, IsGLShader a) =>
    a
    -- ^ /@shader@/: a @GskGLShader@
    -> GLib.Bytes.Bytes
    -- ^ /@args@/: uniform arguments
    -> Int32
    -- ^ /@idx@/: index of the uniform
    -> m Bool
    -- ^ __Returns:__ The value
gLShaderGetArgBool :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLShader a) =>
a -> Bytes -> Int32 -> m Bool
gLShaderGetArgBool a
shader Bytes
args Int32
idx = 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
    shader' <- a -> IO (Ptr GLShader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
shader
    args' <- unsafeManagedPtrGetPtr args
    result <- gsk_gl_shader_get_arg_bool shader' args' idx
    let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    touchManagedPtr shader
    touchManagedPtr args
    return result'

#if defined(ENABLE_OVERLOADING)
data GLShaderGetArgBoolMethodInfo
instance (signature ~ (GLib.Bytes.Bytes -> Int32 -> m Bool), MonadIO m, IsGLShader a) => O.OverloadedMethod GLShaderGetArgBoolMethodInfo a signature where
    overloadedMethod = gLShaderGetArgBool

instance O.OverloadedMethodInfo GLShaderGetArgBoolMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Objects.GLShader.gLShaderGetArgBool",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.9/docs/GI-Gsk-Objects-GLShader.html#v:gLShaderGetArgBool"
        })


#endif

-- method GLShader::get_arg_float
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "shader"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "GLShader" }
--           , argCType = Just "GskGLShader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskGLShader`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "args"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "uniform arguments" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "idx"
--           , argType = TBasicType TInt
--           , argCType = Just "int"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "index of the uniform"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TFloat)
-- throws : False
-- Skip return : False

foreign import ccall "gsk_gl_shader_get_arg_float" gsk_gl_shader_get_arg_float :: 
    Ptr GLShader ->                         -- shader : TInterface (Name {namespace = "Gsk", name = "GLShader"})
    Ptr GLib.Bytes.Bytes ->                 -- args : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Int32 ->                                -- idx : TBasicType TInt
    IO CFloat

{-# DEPRECATED gLShaderGetArgFloat ["(Since version 4.16)","GTK\\'s new Vulkan-focused rendering","  does not support this feature. Use <http://developer.gnome.org/gsk/stable/../gtk4/class.GLArea.html GtkGLArea>","  for OpenGL rendering."] #-}
-- | Gets the value of the uniform /@idx@/ in the /@args@/ block.
-- 
-- The uniform must be of float type.
gLShaderGetArgFloat ::
    (B.CallStack.HasCallStack, MonadIO m, IsGLShader a) =>
    a
    -- ^ /@shader@/: a @GskGLShader@
    -> GLib.Bytes.Bytes
    -- ^ /@args@/: uniform arguments
    -> Int32
    -- ^ /@idx@/: index of the uniform
    -> m Float
    -- ^ __Returns:__ The value
gLShaderGetArgFloat :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLShader a) =>
a -> Bytes -> Int32 -> m Float
gLShaderGetArgFloat a
shader Bytes
args Int32
idx = IO Float -> m Float
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
    shader' <- a -> IO (Ptr GLShader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
shader
    args' <- unsafeManagedPtrGetPtr args
    result <- gsk_gl_shader_get_arg_float shader' args' idx
    let result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
    touchManagedPtr shader
    touchManagedPtr args
    return result'

#if defined(ENABLE_OVERLOADING)
data GLShaderGetArgFloatMethodInfo
instance (signature ~ (GLib.Bytes.Bytes -> Int32 -> m Float), MonadIO m, IsGLShader a) => O.OverloadedMethod GLShaderGetArgFloatMethodInfo a signature where
    overloadedMethod = gLShaderGetArgFloat

instance O.OverloadedMethodInfo GLShaderGetArgFloatMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Objects.GLShader.gLShaderGetArgFloat",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.9/docs/GI-Gsk-Objects-GLShader.html#v:gLShaderGetArgFloat"
        })


#endif

-- method GLShader::get_arg_int
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "shader"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "GLShader" }
--           , argCType = Just "GskGLShader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskGLShader`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "args"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "uniform arguments" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "idx"
--           , argType = TBasicType TInt
--           , argCType = Just "int"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "index of the uniform"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt32)
-- throws : False
-- Skip return : False

foreign import ccall "gsk_gl_shader_get_arg_int" gsk_gl_shader_get_arg_int :: 
    Ptr GLShader ->                         -- shader : TInterface (Name {namespace = "Gsk", name = "GLShader"})
    Ptr GLib.Bytes.Bytes ->                 -- args : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Int32 ->                                -- idx : TBasicType TInt
    IO Int32

{-# DEPRECATED gLShaderGetArgInt ["(Since version 4.16)","GTK\\'s new Vulkan-focused rendering","  does not support this feature. Use <http://developer.gnome.org/gsk/stable/../gtk4/class.GLArea.html GtkGLArea>","  for OpenGL rendering."] #-}
-- | Gets the value of the uniform /@idx@/ in the /@args@/ block.
-- 
-- The uniform must be of int type.
gLShaderGetArgInt ::
    (B.CallStack.HasCallStack, MonadIO m, IsGLShader a) =>
    a
    -- ^ /@shader@/: a @GskGLShader@
    -> GLib.Bytes.Bytes
    -- ^ /@args@/: uniform arguments
    -> Int32
    -- ^ /@idx@/: index of the uniform
    -> m Int32
    -- ^ __Returns:__ The value
gLShaderGetArgInt :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLShader a) =>
a -> Bytes -> Int32 -> m Int32
gLShaderGetArgInt a
shader Bytes
args Int32
idx = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    shader' <- a -> IO (Ptr GLShader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
shader
    args' <- unsafeManagedPtrGetPtr args
    result <- gsk_gl_shader_get_arg_int shader' args' idx
    touchManagedPtr shader
    touchManagedPtr args
    return result

#if defined(ENABLE_OVERLOADING)
data GLShaderGetArgIntMethodInfo
instance (signature ~ (GLib.Bytes.Bytes -> Int32 -> m Int32), MonadIO m, IsGLShader a) => O.OverloadedMethod GLShaderGetArgIntMethodInfo a signature where
    overloadedMethod = gLShaderGetArgInt

instance O.OverloadedMethodInfo GLShaderGetArgIntMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Objects.GLShader.gLShaderGetArgInt",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.9/docs/GI-Gsk-Objects-GLShader.html#v:gLShaderGetArgInt"
        })


#endif

-- method GLShader::get_arg_uint
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "shader"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "GLShader" }
--           , argCType = Just "GskGLShader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskGLShader`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "args"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "uniform arguments" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "idx"
--           , argType = TBasicType TInt
--           , argCType = Just "int"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "index of the uniform"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt32)
-- throws : False
-- Skip return : False

foreign import ccall "gsk_gl_shader_get_arg_uint" gsk_gl_shader_get_arg_uint :: 
    Ptr GLShader ->                         -- shader : TInterface (Name {namespace = "Gsk", name = "GLShader"})
    Ptr GLib.Bytes.Bytes ->                 -- args : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Int32 ->                                -- idx : TBasicType TInt
    IO Word32

{-# DEPRECATED gLShaderGetArgUint ["(Since version 4.16)","GTK\\'s new Vulkan-focused rendering","  does not support this feature. Use <http://developer.gnome.org/gsk/stable/../gtk4/class.GLArea.html GtkGLArea>","  for OpenGL rendering."] #-}
-- | Gets the value of the uniform /@idx@/ in the /@args@/ block.
-- 
-- The uniform must be of uint type.
gLShaderGetArgUint ::
    (B.CallStack.HasCallStack, MonadIO m, IsGLShader a) =>
    a
    -- ^ /@shader@/: a @GskGLShader@
    -> GLib.Bytes.Bytes
    -- ^ /@args@/: uniform arguments
    -> Int32
    -- ^ /@idx@/: index of the uniform
    -> m Word32
    -- ^ __Returns:__ The value
gLShaderGetArgUint :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLShader a) =>
a -> Bytes -> Int32 -> m Word32
gLShaderGetArgUint a
shader Bytes
args Int32
idx = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    shader' <- a -> IO (Ptr GLShader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
shader
    args' <- unsafeManagedPtrGetPtr args
    result <- gsk_gl_shader_get_arg_uint shader' args' idx
    touchManagedPtr shader
    touchManagedPtr args
    return result

#if defined(ENABLE_OVERLOADING)
data GLShaderGetArgUintMethodInfo
instance (signature ~ (GLib.Bytes.Bytes -> Int32 -> m Word32), MonadIO m, IsGLShader a) => O.OverloadedMethod GLShaderGetArgUintMethodInfo a signature where
    overloadedMethod = gLShaderGetArgUint

instance O.OverloadedMethodInfo GLShaderGetArgUintMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Objects.GLShader.gLShaderGetArgUint",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.9/docs/GI-Gsk-Objects-GLShader.html#v:gLShaderGetArgUint"
        })


#endif

-- method GLShader::get_arg_vec2
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "shader"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "GLShader" }
--           , argCType = Just "GskGLShader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskGLShader`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "args"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "uniform arguments" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "idx"
--           , argType = TBasicType TInt
--           , argCType = Just "int"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "index of the uniform"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_value"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Vec2" }
--           , argCType = Just "graphene_vec2_t*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to store the uniform value in"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gsk_gl_shader_get_arg_vec2" gsk_gl_shader_get_arg_vec2 :: 
    Ptr GLShader ->                         -- shader : TInterface (Name {namespace = "Gsk", name = "GLShader"})
    Ptr GLib.Bytes.Bytes ->                 -- args : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Int32 ->                                -- idx : TBasicType TInt
    Ptr Graphene.Vec2.Vec2 ->               -- out_value : TInterface (Name {namespace = "Graphene", name = "Vec2"})
    IO ()

{-# DEPRECATED gLShaderGetArgVec2 ["(Since version 4.16)","GTK\\'s new Vulkan-focused rendering","  does not support this feature. Use <http://developer.gnome.org/gsk/stable/../gtk4/class.GLArea.html GtkGLArea>","  for OpenGL rendering."] #-}
-- | Gets the value of the uniform /@idx@/ in the /@args@/ block.
-- 
-- The uniform must be of vec2 type.
gLShaderGetArgVec2 ::
    (B.CallStack.HasCallStack, MonadIO m, IsGLShader a) =>
    a
    -- ^ /@shader@/: a @GskGLShader@
    -> GLib.Bytes.Bytes
    -- ^ /@args@/: uniform arguments
    -> Int32
    -- ^ /@idx@/: index of the uniform
    -> Graphene.Vec2.Vec2
    -- ^ /@outValue@/: location to store the uniform value in
    -> m ()
gLShaderGetArgVec2 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLShader a) =>
a -> Bytes -> Int32 -> Vec2 -> m ()
gLShaderGetArgVec2 a
shader Bytes
args Int32
idx Vec2
outValue = 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
    shader' <- a -> IO (Ptr GLShader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
shader
    args' <- unsafeManagedPtrGetPtr args
    outValue' <- unsafeManagedPtrGetPtr outValue
    gsk_gl_shader_get_arg_vec2 shader' args' idx outValue'
    touchManagedPtr shader
    touchManagedPtr args
    touchManagedPtr outValue
    return ()

#if defined(ENABLE_OVERLOADING)
data GLShaderGetArgVec2MethodInfo
instance (signature ~ (GLib.Bytes.Bytes -> Int32 -> Graphene.Vec2.Vec2 -> m ()), MonadIO m, IsGLShader a) => O.OverloadedMethod GLShaderGetArgVec2MethodInfo a signature where
    overloadedMethod = gLShaderGetArgVec2

instance O.OverloadedMethodInfo GLShaderGetArgVec2MethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Objects.GLShader.gLShaderGetArgVec2",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.9/docs/GI-Gsk-Objects-GLShader.html#v:gLShaderGetArgVec2"
        })


#endif

-- method GLShader::get_arg_vec3
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "shader"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "GLShader" }
--           , argCType = Just "GskGLShader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskGLShader`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "args"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "uniform arguments" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "idx"
--           , argType = TBasicType TInt
--           , argCType = Just "int"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "index of the uniform"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_value"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Vec3" }
--           , argCType = Just "graphene_vec3_t*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to store the uniform value in"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gsk_gl_shader_get_arg_vec3" gsk_gl_shader_get_arg_vec3 :: 
    Ptr GLShader ->                         -- shader : TInterface (Name {namespace = "Gsk", name = "GLShader"})
    Ptr GLib.Bytes.Bytes ->                 -- args : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Int32 ->                                -- idx : TBasicType TInt
    Ptr Graphene.Vec3.Vec3 ->               -- out_value : TInterface (Name {namespace = "Graphene", name = "Vec3"})
    IO ()

{-# DEPRECATED gLShaderGetArgVec3 ["(Since version 4.16)","GTK\\'s new Vulkan-focused rendering","  does not support this feature. Use <http://developer.gnome.org/gsk/stable/../gtk4/class.GLArea.html GtkGLArea>","  for OpenGL rendering."] #-}
-- | Gets the value of the uniform /@idx@/ in the /@args@/ block.
-- 
-- The uniform must be of vec3 type.
gLShaderGetArgVec3 ::
    (B.CallStack.HasCallStack, MonadIO m, IsGLShader a) =>
    a
    -- ^ /@shader@/: a @GskGLShader@
    -> GLib.Bytes.Bytes
    -- ^ /@args@/: uniform arguments
    -> Int32
    -- ^ /@idx@/: index of the uniform
    -> Graphene.Vec3.Vec3
    -- ^ /@outValue@/: location to store the uniform value in
    -> m ()
gLShaderGetArgVec3 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLShader a) =>
a -> Bytes -> Int32 -> Vec3 -> m ()
gLShaderGetArgVec3 a
shader Bytes
args Int32
idx Vec3
outValue = 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
    shader' <- a -> IO (Ptr GLShader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
shader
    args' <- unsafeManagedPtrGetPtr args
    outValue' <- unsafeManagedPtrGetPtr outValue
    gsk_gl_shader_get_arg_vec3 shader' args' idx outValue'
    touchManagedPtr shader
    touchManagedPtr args
    touchManagedPtr outValue
    return ()

#if defined(ENABLE_OVERLOADING)
data GLShaderGetArgVec3MethodInfo
instance (signature ~ (GLib.Bytes.Bytes -> Int32 -> Graphene.Vec3.Vec3 -> m ()), MonadIO m, IsGLShader a) => O.OverloadedMethod GLShaderGetArgVec3MethodInfo a signature where
    overloadedMethod = gLShaderGetArgVec3

instance O.OverloadedMethodInfo GLShaderGetArgVec3MethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Objects.GLShader.gLShaderGetArgVec3",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.9/docs/GI-Gsk-Objects-GLShader.html#v:gLShaderGetArgVec3"
        })


#endif

-- method GLShader::get_arg_vec4
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "shader"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "GLShader" }
--           , argCType = Just "GskGLShader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskGLShader`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "args"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "uniform arguments" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "idx"
--           , argType = TBasicType TInt
--           , argCType = Just "int"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "index of the uniform"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_value"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Vec4" }
--           , argCType = Just "graphene_vec4_t*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to store set the uniform value in"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gsk_gl_shader_get_arg_vec4" gsk_gl_shader_get_arg_vec4 :: 
    Ptr GLShader ->                         -- shader : TInterface (Name {namespace = "Gsk", name = "GLShader"})
    Ptr GLib.Bytes.Bytes ->                 -- args : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Int32 ->                                -- idx : TBasicType TInt
    Ptr Graphene.Vec4.Vec4 ->               -- out_value : TInterface (Name {namespace = "Graphene", name = "Vec4"})
    IO ()

{-# DEPRECATED gLShaderGetArgVec4 ["(Since version 4.16)","GTK\\'s new Vulkan-focused rendering","  does not support this feature. Use <http://developer.gnome.org/gsk/stable/../gtk4/class.GLArea.html GtkGLArea>","  for OpenGL rendering."] #-}
-- | Gets the value of the uniform /@idx@/ in the /@args@/ block.
-- 
-- The uniform must be of vec4 type.
gLShaderGetArgVec4 ::
    (B.CallStack.HasCallStack, MonadIO m, IsGLShader a) =>
    a
    -- ^ /@shader@/: a @GskGLShader@
    -> GLib.Bytes.Bytes
    -- ^ /@args@/: uniform arguments
    -> Int32
    -- ^ /@idx@/: index of the uniform
    -> Graphene.Vec4.Vec4
    -- ^ /@outValue@/: location to store set the uniform value in
    -> m ()
gLShaderGetArgVec4 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLShader a) =>
a -> Bytes -> Int32 -> Vec4 -> m ()
gLShaderGetArgVec4 a
shader Bytes
args Int32
idx Vec4
outValue = 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
    shader' <- a -> IO (Ptr GLShader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
shader
    args' <- unsafeManagedPtrGetPtr args
    outValue' <- unsafeManagedPtrGetPtr outValue
    gsk_gl_shader_get_arg_vec4 shader' args' idx outValue'
    touchManagedPtr shader
    touchManagedPtr args
    touchManagedPtr outValue
    return ()

#if defined(ENABLE_OVERLOADING)
data GLShaderGetArgVec4MethodInfo
instance (signature ~ (GLib.Bytes.Bytes -> Int32 -> Graphene.Vec4.Vec4 -> m ()), MonadIO m, IsGLShader a) => O.OverloadedMethod GLShaderGetArgVec4MethodInfo a signature where
    overloadedMethod = gLShaderGetArgVec4

instance O.OverloadedMethodInfo GLShaderGetArgVec4MethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Objects.GLShader.gLShaderGetArgVec4",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.9/docs/GI-Gsk-Objects-GLShader.html#v:gLShaderGetArgVec4"
        })


#endif

-- method GLShader::get_args_size
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "shader"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "GLShader" }
--           , argCType = Just "GskGLShader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskGLShader`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TSize)
-- throws : False
-- Skip return : False

foreign import ccall "gsk_gl_shader_get_args_size" gsk_gl_shader_get_args_size :: 
    Ptr GLShader ->                         -- shader : TInterface (Name {namespace = "Gsk", name = "GLShader"})
    IO FCT.CSize

{-# DEPRECATED gLShaderGetArgsSize ["(Since version 4.16)","GTK\\'s new Vulkan-focused rendering","  does not support this feature. Use <http://developer.gnome.org/gsk/stable/../gtk4/class.GLArea.html GtkGLArea>","  for OpenGL rendering."] #-}
-- | Get the size of the data block used to specify arguments for this shader.
gLShaderGetArgsSize ::
    (B.CallStack.HasCallStack, MonadIO m, IsGLShader a) =>
    a
    -- ^ /@shader@/: a @GskGLShader@
    -> m FCT.CSize
    -- ^ __Returns:__ The size of the data block
gLShaderGetArgsSize :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLShader a) =>
a -> m CSize
gLShaderGetArgsSize a
shader = IO CSize -> m CSize
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CSize -> m CSize) -> IO CSize -> m CSize
forall a b. (a -> b) -> a -> b
$ do
    shader' <- a -> IO (Ptr GLShader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
shader
    result <- gsk_gl_shader_get_args_size shader'
    touchManagedPtr shader
    return result

#if defined(ENABLE_OVERLOADING)
data GLShaderGetArgsSizeMethodInfo
instance (signature ~ (m FCT.CSize), MonadIO m, IsGLShader a) => O.OverloadedMethod GLShaderGetArgsSizeMethodInfo a signature where
    overloadedMethod = gLShaderGetArgsSize

instance O.OverloadedMethodInfo GLShaderGetArgsSizeMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Objects.GLShader.gLShaderGetArgsSize",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.9/docs/GI-Gsk-Objects-GLShader.html#v:gLShaderGetArgsSize"
        })


#endif

-- method GLShader::get_n_textures
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "shader"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "GLShader" }
--           , argCType = Just "GskGLShader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskGLShader`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "gsk_gl_shader_get_n_textures" gsk_gl_shader_get_n_textures :: 
    Ptr GLShader ->                         -- shader : TInterface (Name {namespace = "Gsk", name = "GLShader"})
    IO Int32

{-# DEPRECATED gLShaderGetNTextures ["(Since version 4.16)","GTK\\'s new Vulkan-focused rendering","  does not support this feature. Use <http://developer.gnome.org/gsk/stable/../gtk4/class.GLArea.html GtkGLArea>","  for OpenGL rendering."] #-}
-- | Returns the number of textures that the shader requires.
-- 
-- This can be used to check that the a passed shader works
-- in your usecase. It is determined by looking at the highest
-- u_textureN value that the shader defines.
gLShaderGetNTextures ::
    (B.CallStack.HasCallStack, MonadIO m, IsGLShader a) =>
    a
    -- ^ /@shader@/: a @GskGLShader@
    -> m Int32
    -- ^ __Returns:__ The number of texture inputs required by /@shader@/
gLShaderGetNTextures :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLShader a) =>
a -> m Int32
gLShaderGetNTextures a
shader = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    shader' <- a -> IO (Ptr GLShader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
shader
    result <- gsk_gl_shader_get_n_textures shader'
    touchManagedPtr shader
    return result

#if defined(ENABLE_OVERLOADING)
data GLShaderGetNTexturesMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsGLShader a) => O.OverloadedMethod GLShaderGetNTexturesMethodInfo a signature where
    overloadedMethod = gLShaderGetNTextures

instance O.OverloadedMethodInfo GLShaderGetNTexturesMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Objects.GLShader.gLShaderGetNTextures",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.9/docs/GI-Gsk-Objects-GLShader.html#v:gLShaderGetNTextures"
        })


#endif

-- method GLShader::get_n_uniforms
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "shader"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "GLShader" }
--           , argCType = Just "GskGLShader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskGLShader`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "gsk_gl_shader_get_n_uniforms" gsk_gl_shader_get_n_uniforms :: 
    Ptr GLShader ->                         -- shader : TInterface (Name {namespace = "Gsk", name = "GLShader"})
    IO Int32

{-# DEPRECATED gLShaderGetNUniforms ["(Since version 4.16)","GTK\\'s new Vulkan-focused rendering","  does not support this feature. Use <http://developer.gnome.org/gsk/stable/../gtk4/class.GLArea.html GtkGLArea>","  for OpenGL rendering."] #-}
-- | Get the number of declared uniforms for this shader.
gLShaderGetNUniforms ::
    (B.CallStack.HasCallStack, MonadIO m, IsGLShader a) =>
    a
    -- ^ /@shader@/: a @GskGLShader@
    -> m Int32
    -- ^ __Returns:__ The number of declared uniforms
gLShaderGetNUniforms :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLShader a) =>
a -> m Int32
gLShaderGetNUniforms a
shader = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    shader' <- a -> IO (Ptr GLShader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
shader
    result <- gsk_gl_shader_get_n_uniforms shader'
    touchManagedPtr shader
    return result

#if defined(ENABLE_OVERLOADING)
data GLShaderGetNUniformsMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsGLShader a) => O.OverloadedMethod GLShaderGetNUniformsMethodInfo a signature where
    overloadedMethod = gLShaderGetNUniforms

instance O.OverloadedMethodInfo GLShaderGetNUniformsMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Objects.GLShader.gLShaderGetNUniforms",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.9/docs/GI-Gsk-Objects-GLShader.html#v:gLShaderGetNUniforms"
        })


#endif

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

foreign import ccall "gsk_gl_shader_get_resource" gsk_gl_shader_get_resource :: 
    Ptr GLShader ->                         -- shader : TInterface (Name {namespace = "Gsk", name = "GLShader"})
    IO CString

{-# DEPRECATED gLShaderGetResource ["(Since version 4.16)","GTK\\'s new Vulkan-focused rendering","  does not support this feature. Use <http://developer.gnome.org/gsk/stable/../gtk4/class.GLArea.html GtkGLArea>","  for OpenGL rendering."] #-}
-- | Gets the resource path for the GLSL sourcecode being used
-- to render this shader.
gLShaderGetResource ::
    (B.CallStack.HasCallStack, MonadIO m, IsGLShader a) =>
    a
    -- ^ /@shader@/: a @GskGLShader@
    -> m (Maybe T.Text)
    -- ^ __Returns:__ The resource path for the shader
gLShaderGetResource :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLShader a) =>
a -> m (Maybe Text)
gLShaderGetResource a
shader = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
    shader' <- a -> IO (Ptr GLShader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
shader
    result <- gsk_gl_shader_get_resource shader'
    maybeResult <- convertIfNonNull result $ \CString
result' -> do
        result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
        return result''
    touchManagedPtr shader
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data GLShaderGetResourceMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsGLShader a) => O.OverloadedMethod GLShaderGetResourceMethodInfo a signature where
    overloadedMethod = gLShaderGetResource

instance O.OverloadedMethodInfo GLShaderGetResourceMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Objects.GLShader.gLShaderGetResource",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.9/docs/GI-Gsk-Objects-GLShader.html#v:gLShaderGetResource"
        })


#endif

-- method GLShader::get_source
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "shader"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "GLShader" }
--           , argCType = Just "GskGLShader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskGLShader`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "Bytes" })
-- throws : False
-- Skip return : False

foreign import ccall "gsk_gl_shader_get_source" gsk_gl_shader_get_source :: 
    Ptr GLShader ->                         -- shader : TInterface (Name {namespace = "Gsk", name = "GLShader"})
    IO (Ptr GLib.Bytes.Bytes)

{-# DEPRECATED gLShaderGetSource ["(Since version 4.16)","GTK\\'s new Vulkan-focused rendering","  does not support this feature. Use <http://developer.gnome.org/gsk/stable/../gtk4/class.GLArea.html GtkGLArea>","  for OpenGL rendering."] #-}
-- | Gets the GLSL sourcecode being used to render this shader.
gLShaderGetSource ::
    (B.CallStack.HasCallStack, MonadIO m, IsGLShader a) =>
    a
    -- ^ /@shader@/: a @GskGLShader@
    -> m GLib.Bytes.Bytes
    -- ^ __Returns:__ The source code for the shader
gLShaderGetSource :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLShader a) =>
a -> m Bytes
gLShaderGetSource a
shader = IO Bytes -> m Bytes
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bytes -> m Bytes) -> IO Bytes -> m Bytes
forall a b. (a -> b) -> a -> b
$ do
    shader' <- a -> IO (Ptr GLShader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
shader
    result <- gsk_gl_shader_get_source shader'
    checkUnexpectedReturnNULL "gLShaderGetSource" result
    result' <- (newBoxed GLib.Bytes.Bytes) result
    touchManagedPtr shader
    return result'

#if defined(ENABLE_OVERLOADING)
data GLShaderGetSourceMethodInfo
instance (signature ~ (m GLib.Bytes.Bytes), MonadIO m, IsGLShader a) => O.OverloadedMethod GLShaderGetSourceMethodInfo a signature where
    overloadedMethod = gLShaderGetSource

instance O.OverloadedMethodInfo GLShaderGetSourceMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Objects.GLShader.gLShaderGetSource",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.9/docs/GI-Gsk-Objects-GLShader.html#v:gLShaderGetSource"
        })


#endif

-- method GLShader::get_uniform_name
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "shader"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "GLShader" }
--           , argCType = Just "GskGLShader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskGLShader`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "idx"
--           , argType = TBasicType TInt
--           , argCType = Just "int"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "index of the uniform"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gsk_gl_shader_get_uniform_name" gsk_gl_shader_get_uniform_name :: 
    Ptr GLShader ->                         -- shader : TInterface (Name {namespace = "Gsk", name = "GLShader"})
    Int32 ->                                -- idx : TBasicType TInt
    IO CString

{-# DEPRECATED gLShaderGetUniformName ["(Since version 4.16)","GTK\\'s new Vulkan-focused rendering","  does not support this feature. Use <http://developer.gnome.org/gsk/stable/../gtk4/class.GLArea.html GtkGLArea>","  for OpenGL rendering."] #-}
-- | Get the name of the declared uniform for this shader at index /@idx@/.
gLShaderGetUniformName ::
    (B.CallStack.HasCallStack, MonadIO m, IsGLShader a) =>
    a
    -- ^ /@shader@/: a @GskGLShader@
    -> Int32
    -- ^ /@idx@/: index of the uniform
    -> m T.Text
    -- ^ __Returns:__ The name of the declared uniform
gLShaderGetUniformName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLShader a) =>
a -> Int32 -> m Text
gLShaderGetUniformName a
shader Int32
idx = 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
    shader' <- a -> IO (Ptr GLShader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
shader
    result <- gsk_gl_shader_get_uniform_name shader' idx
    checkUnexpectedReturnNULL "gLShaderGetUniformName" result
    result' <- cstringToText result
    touchManagedPtr shader
    return result'

#if defined(ENABLE_OVERLOADING)
data GLShaderGetUniformNameMethodInfo
instance (signature ~ (Int32 -> m T.Text), MonadIO m, IsGLShader a) => O.OverloadedMethod GLShaderGetUniformNameMethodInfo a signature where
    overloadedMethod = gLShaderGetUniformName

instance O.OverloadedMethodInfo GLShaderGetUniformNameMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Objects.GLShader.gLShaderGetUniformName",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.9/docs/GI-Gsk-Objects-GLShader.html#v:gLShaderGetUniformName"
        })


#endif

-- method GLShader::get_uniform_offset
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "shader"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "GLShader" }
--           , argCType = Just "GskGLShader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskGLShader`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "idx"
--           , argType = TBasicType TInt
--           , argCType = Just "int"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "index of the uniform"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "gsk_gl_shader_get_uniform_offset" gsk_gl_shader_get_uniform_offset :: 
    Ptr GLShader ->                         -- shader : TInterface (Name {namespace = "Gsk", name = "GLShader"})
    Int32 ->                                -- idx : TBasicType TInt
    IO Int32

{-# DEPRECATED gLShaderGetUniformOffset ["(Since version 4.16)","GTK\\'s new Vulkan-focused rendering","  does not support this feature. Use <http://developer.gnome.org/gsk/stable/../gtk4/class.GLArea.html GtkGLArea>","  for OpenGL rendering."] #-}
-- | Get the offset into the data block where data for this uniforms is stored.
gLShaderGetUniformOffset ::
    (B.CallStack.HasCallStack, MonadIO m, IsGLShader a) =>
    a
    -- ^ /@shader@/: a @GskGLShader@
    -> Int32
    -- ^ /@idx@/: index of the uniform
    -> m Int32
    -- ^ __Returns:__ The data offset
gLShaderGetUniformOffset :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLShader a) =>
a -> Int32 -> m Int32
gLShaderGetUniformOffset a
shader Int32
idx = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    shader' <- a -> IO (Ptr GLShader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
shader
    result <- gsk_gl_shader_get_uniform_offset shader' idx
    touchManagedPtr shader
    return result

#if defined(ENABLE_OVERLOADING)
data GLShaderGetUniformOffsetMethodInfo
instance (signature ~ (Int32 -> m Int32), MonadIO m, IsGLShader a) => O.OverloadedMethod GLShaderGetUniformOffsetMethodInfo a signature where
    overloadedMethod = gLShaderGetUniformOffset

instance O.OverloadedMethodInfo GLShaderGetUniformOffsetMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Objects.GLShader.gLShaderGetUniformOffset",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.9/docs/GI-Gsk-Objects-GLShader.html#v:gLShaderGetUniformOffset"
        })


#endif

-- method GLShader::get_uniform_type
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "shader"
--           , argType =
--               TInterface Name { namespace = "Gsk" , name = "GLShader" }
--           , argCType = Just "GskGLShader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GskGLShader`" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "idx"
--           , argType = TBasicType TInt
--           , argCType = Just "int"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "index of the uniform"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gsk" , name = "GLUniformType" })
-- throws : False
-- Skip return : False

foreign import ccall "gsk_gl_shader_get_uniform_type" gsk_gl_shader_get_uniform_type :: 
    Ptr GLShader ->                         -- shader : TInterface (Name {namespace = "Gsk", name = "GLShader"})
    Int32 ->                                -- idx : TBasicType TInt
    IO CUInt

{-# DEPRECATED gLShaderGetUniformType ["(Since version 4.16)","GTK\\'s new Vulkan-focused rendering","  does not support this feature. Use <http://developer.gnome.org/gsk/stable/../gtk4/class.GLArea.html GtkGLArea>","  for OpenGL rendering."] #-}
-- | Get the type of the declared uniform for this shader at index /@idx@/.
gLShaderGetUniformType ::
    (B.CallStack.HasCallStack, MonadIO m, IsGLShader a) =>
    a
    -- ^ /@shader@/: a @GskGLShader@
    -> Int32
    -- ^ /@idx@/: index of the uniform
    -> m Gsk.Enums.GLUniformType
    -- ^ __Returns:__ The type of the declared uniform
gLShaderGetUniformType :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLShader a) =>
a -> Int32 -> m GLUniformType
gLShaderGetUniformType a
shader Int32
idx = IO GLUniformType -> m GLUniformType
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GLUniformType -> m GLUniformType)
-> IO GLUniformType -> m GLUniformType
forall a b. (a -> b) -> a -> b
$ do
    shader' <- a -> IO (Ptr GLShader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
shader
    result <- gsk_gl_shader_get_uniform_type shader' idx
    let result' = (Int -> GLUniformType
forall a. Enum a => Int -> a
toEnum (Int -> GLUniformType) -> (CUInt -> Int) -> CUInt -> GLUniformType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    touchManagedPtr shader
    return result'

#if defined(ENABLE_OVERLOADING)
data GLShaderGetUniformTypeMethodInfo
instance (signature ~ (Int32 -> m Gsk.Enums.GLUniformType), MonadIO m, IsGLShader a) => O.OverloadedMethod GLShaderGetUniformTypeMethodInfo a signature where
    overloadedMethod = gLShaderGetUniformType

instance O.OverloadedMethodInfo GLShaderGetUniformTypeMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gsk.Objects.GLShader.gLShaderGetUniformType",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gsk-4.0.9/docs/GI-Gsk-Objects-GLShader.html#v:gLShaderGetUniformType"
        })


#endif