summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Landwerlin <llandwerlin@gmail.com>2014-02-23 23:19:33 +0000
committerLionel Landwerlin <llandwerlin@gmail.com>2014-02-23 23:20:03 +0000
commit05bafdaf384133b78fda2d53214ce18bcc8ce096 (patch)
treef7b7f0b6167507cb1c5dd8b658f1d9acdb6a24b8
parentf48a4e3948697bfb15e5f6054dc654c7ee6b9216 (diff)
downloadcogl-wip/lionel/introspection.tar.gz
onscreen: make closure types visible to introspectionwip/lionel/introspection
-rw-r--r--cogl/cogl-onscreen.c23
-rw-r--r--cogl/cogl-onscreen.h41
2 files changed, 57 insertions, 7 deletions
diff --git a/cogl/cogl-onscreen.c b/cogl/cogl-onscreen.c
index 20534c8b..8e27f4b3 100644
--- a/cogl/cogl-onscreen.c
+++ b/cogl/cogl-onscreen.c
@@ -51,6 +51,29 @@ COGL_OBJECT_DEFINE_WITH_CODE (Onscreen, onscreen,
COGL_GTYPE_DEFINE_CLASS (Onscreen, onscreen,
COGL_GTYPE_IMPLEMENT_INTERFACE (framebuffer));
+static gpointer
+cogl_dummy_copy (gpointer data)
+{
+ return data;
+}
+
+static void
+cogl_dummy_free (gpointer data)
+{
+}
+
+COGL_GTYPE_DEFINE_BOXED (FrameClosure, frame_closure,
+ cogl_dummy_copy,
+ cogl_dummy_free);
+COGL_GTYPE_DEFINE_BOXED (OnscreenResizeClosure,
+ onscreen_resize_closure,
+ cogl_dummy_copy,
+ cogl_dummy_free);
+COGL_GTYPE_DEFINE_BOXED (OnscreenDirtyClosure,
+ onscreen_dirty_closure,
+ cogl_dummy_copy,
+ cogl_dummy_free);
+
static void
_cogl_onscreen_init_from_template (CoglOnscreen *onscreen,
CoglOnscreenTemplate *onscreen_template)
diff --git a/cogl/cogl-onscreen.h b/cogl/cogl-onscreen.h
index 16537e06..1091bc6f 100644
--- a/cogl/cogl-onscreen.h
+++ b/cogl/cogl-onscreen.h
@@ -588,11 +588,20 @@ typedef void (*CoglFrameCallback) (CoglOnscreen *onscreen,
*/
typedef struct _CoglClosure CoglFrameClosure;
+#ifdef COGL_HAS_GTYPE_SUPPORT
+/**
+ * cogl_frame_closure_get_gtype:
+ *
+ * Returns: a #GType that can be used with the GLib type system.
+ */
+GType cogl_frame_closure_get_gtype (void);
+#endif
+
/**
* cogl_onscreen_add_frame_callback:
* @onscreen: A #CoglOnscreen framebuffer
- * @callback: A callback function to call for frame events
- * @user_data: A private pointer to be passed to @callback
+ * @callback: (scope notified): A callback function to call for frame events
+ * @user_data: (closure): A private pointer to be passed to @callback
* @destroy: An optional callback to destroy @user_data when the
* @callback is removed or @onscreen is freed.
*
@@ -753,12 +762,21 @@ typedef void (*CoglOnscreenResizeCallback) (CoglOnscreen *onscreen,
*/
typedef struct _CoglClosure CoglOnscreenResizeClosure;
+#ifdef COGL_HAS_GTYPE_SUPPORT
+/**
+ * cogl_onscreen_resize_closure_get_gtype:
+ *
+ * Returns: a #GType that can be used with the GLib type system.
+ */
+GType cogl_onscreen_resize_closure_get_gtype (void);
+#endif
+
/**
* cogl_onscreen_add_resize_callback:
* @onscreen: A #CoglOnscreen framebuffer
- * @callback: A #CoglOnscreenResizeCallback to call when the @onscreen
- * changes size.
- * @user_data: Private data to be passed to @callback.
+ * @callback: (scope notified): A #CoglOnscreenResizeCallback to call
+ * when the @onscreen changes size.
+ * @user_data: (closure): Private data to be passed to @callback.
* @destroy: An optional callback to destroy @user_data when the
* @callback is removed or @onscreen is freed.
*
@@ -860,11 +878,20 @@ typedef void (*CoglOnscreenDirtyCallback) (CoglOnscreen *onscreen,
*/
typedef struct _CoglClosure CoglOnscreenDirtyClosure;
+#ifdef COGL_HAS_GTYPE_SUPPORT
+/**
+ * cogl_onscreen_dirty_closure_get_gtype:
+ *
+ * Returns: a #GType that can be used with the GLib type system.
+ */
+GType cogl_onscreen_dirty_closure_get_gtype (void);
+#endif
+
/**
* cogl_onscreen_add_dirty_callback:
* @onscreen: A #CoglOnscreen framebuffer
- * @callback: A callback function to call for dirty events
- * @user_data: A private pointer to be passed to @callback
+ * @callback: (scope notified): A callback function to call for dirty events
+ * @user_data: (closure): A private pointer to be passed to @callback
* @destroy: An optional callback to destroy @user_data when the
* @callback is removed or @onscreen is freed.
*