[clutter/wip/apocalypses/apocalypse-3: 30/35] image: Add get_texture()



commit 32e775c6c3f7fa7c5445b5997956379126926e7d
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Mon Mar 12 15:25:38 2012 +0000

    image: Add get_texture()
    
    Allow retrieving the Cogl texture used by the ClutterImage.

 clutter/clutter-image.c                    |   25 +++++++++++++++++++++++++
 clutter/clutter-image.h                    |    4 ++++
 clutter/clutter.symbols                    |    1 +
 doc/reference/clutter/clutter-sections.txt |    1 +
 4 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-image.c b/clutter/clutter-image.c
index 9e608df..e6e563e 100644
--- a/clutter/clutter-image.c
+++ b/clutter/clutter-image.c
@@ -30,6 +30,10 @@
  * #ClutterImage is a #ClutterContent implementation that displays
  * image data.
  *
+ * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"; parse="text" href="../../../../tests/interactive/test-image-box.c">
+ *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
+ * </xi:include>
+ *
  * #ClutterImage is available since Clutter 1.10.
  */
 
@@ -37,6 +41,8 @@
 #include "config.h"
 #endif
 
+#define CLUTTER_ENABLE_EXPERIMENTAL_API
+
 #include "clutter-image.h"
 
 #include "clutter-color.h"
@@ -226,3 +232,22 @@ clutter_image_set_data (ClutterImage     *image,
 
   return TRUE;
 }
+
+/**
+ * clutter_image_get_texture:
+ * @image: a #ClutterImage
+ *
+ * Retrieves a pointer to the Cogl texture used by @image.
+ *
+ * Return value: (transfer none): a pointer to the Cogl texture, or %NULL
+ *
+ * Since: 1.10
+ * Stability: unstable
+ */
+CoglTexture *
+clutter_image_get_texture (ClutterImage *image)
+{
+  g_return_val_if_fail (CLUTTER_IS_IMAGE (image), NULL);
+
+  return image->priv->texture;
+}
diff --git a/clutter/clutter-image.h b/clutter/clutter-image.h
index 690bd65..ae718b7 100644
--- a/clutter/clutter-image.h
+++ b/clutter/clutter-image.h
@@ -96,6 +96,10 @@ gboolean                clutter_image_set_data          (ClutterImage     *image
                                                          guint             row_stride,
                                                          GError          **error);
 
+#if defined(COGL_ENABLE_EXPERIMENTAL_API) && defined(CLUTTER_ENABLE_EXPERIMENTAL_API)
+CoglTexture *           clutter_image_get_texture       (ClutterImage     *image);
+#endif
+
 G_END_DECLS
 
 #endif /* __CLUTTER_IMAGE_H__ */
diff --git a/clutter/clutter.symbols b/clutter/clutter.symbols
index a3a5f1e..add3803 100644
--- a/clutter/clutter.symbols
+++ b/clutter/clutter.symbols
@@ -731,6 +731,7 @@ clutter_group_new
 clutter_group_remove_all
 clutter_image_error_get_type
 clutter_image_error_quark
+clutter_image_get_texture
 clutter_image_get_type
 clutter_image_new
 clutter_image_set_data
diff --git a/doc/reference/clutter/clutter-sections.txt b/doc/reference/clutter/clutter-sections.txt
index 2db5973..eca8a61 100644
--- a/doc/reference/clutter/clutter-sections.txt
+++ b/doc/reference/clutter/clutter-sections.txt
@@ -3157,6 +3157,7 @@ ClutterImageClass
 ClutterImageError
 clutter_image_new
 clutter_image_set_data
+clutter_image_get_texture
 <SUBSECTION Standard>
 CLUTTER_TYPE_IMAGE
 CLUTTER_IMAGE



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]