$(srcdir)/cogl-shader.c \
$(srcdir)/cogl-callback-list.h \
$(srcdir)/cogl-callback-list.c \
+ $(srcdir)/cogl-gtype-private.h \
$(NULL)
if SUPPORT_XLIB
--- /dev/null
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2010 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ *
+ */
+
+#include <glib.h>
+#include <glib-object.h>
+
+#ifndef __COGL_GTYPE_PRIVATE_H__
+#define __COGL_GTYPE_PRIVATE_H__
+
+#define COGL_GTYPE_DEFINE_BOXED(Name, underscore_name, copy_func, free_func) \
+GType \
+cogl_gtype_ ## underscore_name ## _get_type (void) \
+{ \
+ static volatile gsize type_volatile = 0; \
+ if (g_once_init_enter (&type_volatile)) \
+ { \
+ GType type = \
+ g_boxed_type_register_static (g_intern_static_string ("Cogl" Name), \
+ (GBoxedCopyFunc)copy_func, \
+ (GBoxedFreeFunc)free_func); \
+ g_once_init_leave (&type_volatile, type); \
+ } \
+ return type_volatile; \
+}
+
+#endif /* __COGL_GTYPE_PRIVATE_H__ */
+
#include <math.h>
#include <string.h>
+#ifdef _COGL_SUPPORTS_GTYPE_INTEGRATION
+#include <cogl-gtype-private.h>
+COGL_GTYPE_DEFINE_BOXED ("Matrix", matrix,
+ cogl_matrix_copy,
+ cogl_matrix_free);
+#endif
+
void
_cogl_matrix_print (CoglMatrix *matrix)
{
#endif /* COGL_ENABLE_EXPERIMENTAL_API */
+#ifdef _COGL_SUPPORTS_GTYPE_INTEGRATION
+
+#define COGL_GTYPE_TYPE_MATRIX (cogl_gtype_matrix_get_type ())
+
+/**
+ * cogl_gtype_matrix_get_type:
+ *
+ * Returns the GType for the registered "CoglMatrix" boxed type. This
+ * can be used for example to define GObject properties that accept a
+ * #CoglMatrix value.
+ */
+GType
+cogl_gtype_matrix_get_type (void);
+
+#endif /* _COGL_SUPPORTS_GTYPE_INTEGRATION */
+
G_END_DECLS
#endif /* __COGL_MATRIX_H */
#endif
#endif
+/* We currently keep gtype integration delimited in case we eventually
+ * want to split it out into a separate utility library when Cogl
+ * becomes a standalone project. (like cairo-gobject.so)
+ */
+#define _COGL_SUPPORTS_GTYPE_INTEGRATION
+
#include <cogl/cogl-defines.h>
#include <cogl/cogl-object.h>
<xi:include href="xml/cogl-vector.xml"/>
<xi:include href="xml/cogl-types.xml"/>
</section>
+
+ <section id="cogl-integration">
+ <title>Binding and Integrating</title>
+ <xi:include href="xml/cogl-gtype.xml"/>
+ </section>
+
</chapter>
<chapter id="coglglossary">
CoglAttributeType
</SECTION>
-
+<SECTION>
+<FILE>cogl-gtype</FILE>
+<TITLE>GType Integration API</TITLE>
+cogl_gtype_matrix_get_type
+</SECTION>
<xi:include href="xml/cogl-shaders.xml"/>
<xi:include href="xml/cogl-offscreen.xml"/>
<xi:include href="xml/cogl-fixed.xml"/>
+ <xi:include href="xml/cogl-gtype.xml"/>
</chapter>
</SECTION>
<SECTION>
+<FILE>cogl-gtype</FILE>
+<TITLE>GType Integration API</TITLE>
+cogl_gtype_matrix_get_type
+</SECTION>
+
+<SECTION>
<FILE>cogl-deprecated</FILE>
<TITLE>General API (Deprecated)</TITLE>
cogl_check_extension