update to 1.10.4
[profile/ivi/clutter.git] / clutter / clutter-shader-types.h
1 /*
2  * Clutter.
3  *
4  * An OpenGL based 'interactive canvas' library.
5  *
6  * Authored By Matthew Allum  <mallum@openedhand.com>
7  *
8  * Copyright (C) 2008  Intel Corporation.
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
22  */
23
24 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
25 #error "Only <clutter/clutter.h> can be included directly."
26 #endif
27
28 #ifndef __CLUTTER_SHADER_TYPES_H__
29 #define __CLUTTER_SHADER_TYPES_H__
30
31 #include <glib-object.h>
32
33 G_BEGIN_DECLS
34
35 #define CLUTTER_TYPE_SHADER_FLOAT   (clutter_shader_float_get_type ())
36 #define CLUTTER_TYPE_SHADER_INT     (clutter_shader_int_get_type ())
37 #define CLUTTER_TYPE_SHADER_MATRIX  (clutter_shader_matrix_get_type ())
38
39 typedef struct _ClutterShaderFloat    ClutterShaderFloat;
40 typedef struct _ClutterShaderInt      ClutterShaderInt;
41 typedef struct _ClutterShaderMatrix   ClutterShaderMatrix;
42
43 /**
44  * CLUTTER_VALUE_HOLDS_SHADER_FLOAT:
45  * @x: a #GValue
46  *
47  * Evaluates to %TRUE if @x holds a #ClutterShaderFloat.
48  *
49  * Since: 1.0
50  */
51 #define CLUTTER_VALUE_HOLDS_SHADER_FLOAT(x) (G_VALUE_HOLDS ((x), CLUTTER_TYPE_SHADER_FLOAT))
52
53 /**
54  * CLUTTER_VALUE_HOLDS_SHADER_INT:
55  * @x: a #GValue
56  *
57  * Evaluates to %TRUE if @x holds a #ClutterShaderInt.
58  *
59  * Since: 1.0
60  */
61 #define CLUTTER_VALUE_HOLDS_SHADER_INT(x) (G_VALUE_HOLDS ((x), CLUTTER_TYPE_SHADER_INT))
62
63 /**
64  * CLUTTER_VALUE_HOLDS_SHADER_MATRIX:
65  * @x: a #GValue
66  *
67  * Evaluates to %TRUE if @x holds a #ClutterShaderMatrix.
68  *
69  * Since: 1.0
70  */
71 #define CLUTTER_VALUE_HOLDS_SHADER_MATRIX(x) (G_VALUE_HOLDS ((x), CLUTTER_TYPE_SHADER_MATRIX))
72
73 GType clutter_shader_float_get_type  (void) G_GNUC_CONST;
74 GType clutter_shader_int_get_type    (void) G_GNUC_CONST;
75 GType clutter_shader_matrix_get_type (void) G_GNUC_CONST;
76
77 void            clutter_value_set_shader_float  (GValue       *value,
78                                                  gint          size,
79                                                  const gfloat *floats);
80 void            clutter_value_set_shader_int    (GValue       *value,
81                                                  gint          size,
82                                                  const gint   *ints);
83 void            clutter_value_set_shader_matrix (GValue       *value,
84                                                  gint          size,
85                                                  const gfloat *matrix);
86 const gfloat *  clutter_value_get_shader_float  (const GValue *value,
87                                                  gsize        *length);
88 const gint   *  clutter_value_get_shader_int    (const GValue *value,
89                                                  gsize        *length);
90 const gfloat *  clutter_value_get_shader_matrix (const GValue *value,
91                                                  gsize        *length);
92
93 G_END_DECLS
94
95 #endif /* __CLUTTER_SHADER_TYPES_H__ */