[cluttermm] Add the Content interface and the Image class.



commit 2d7119e3049a3a6039b37b1120d972e59b352d5d
Author: Ian Martin <martin_id vodafone co nz>
Date:   Tue Feb 25 21:14:49 2014 +1300

    Add the Content interface and the Image class.
    
    Bug #725125

 clutter/src/color.ccg         |    1 +
 clutter/src/content.ccg       |   24 +++++++++++++++
 clutter/src/content.hg        |   62 +++++++++++++++++++++++++++++++++++++++
 clutter/src/filelist.am       |    2 +
 clutter/src/image.ccg         |   30 +++++++++++++++++++
 clutter/src/image.hg          |   65 +++++++++++++++++++++++++++++++++++++++++
 codegen/m4/convert_clutter.m4 |    3 ++
 7 files changed, 187 insertions(+), 0 deletions(-)
---
diff --git a/clutter/src/color.ccg b/clutter/src/color.ccg
index de24c39..23012a5 100644
--- a/clutter/src/color.ccg
+++ b/clutter/src/color.ccg
@@ -108,3 +108,4 @@ Color operator-(const Color& color1, const Color& color2)
 
 } //namespace Clutter
 
+
diff --git a/clutter/src/content.ccg b/clutter/src/content.ccg
new file mode 100644
index 0000000..ea27fb3
--- /dev/null
+++ b/clutter/src/content.ccg
@@ -0,0 +1,24 @@
+/* Copyright (C) 2007 The cluttermm Development Team
+ *
+ * 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.1 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, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <cluttermm/actor.h>
+#include <cluttermm/types.h>
+
+namespace Clutter
+{
+
+} // namespace Clutter
diff --git a/clutter/src/content.hg b/clutter/src/content.hg
new file mode 100644
index 0000000..29ff431
--- /dev/null
+++ b/clutter/src/content.hg
@@ -0,0 +1,62 @@
+/* Copyright (C) 2014 The cluttermm Development Team
+ *
+ * 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.1 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, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include <glibmm/object.h>
+#include <glibmm/interface.h>
+#include <glibmm/ustring.h>
+#include <cluttermm/actor.h>
+#include <clutter/clutter.h>
+
+_DEFS(cluttermm,clutter)
+_PINCLUDE(glibmm/private/interface_p.h)
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+extern "C"
+{
+typedef struct _ClutterContentIface   ClutterContentIface;
+}
+#endif /* DOXYGEN_SHOULD_SKIP_THIS */
+
+
+
+namespace Clutter
+{
+
+//TODO: Documentation
+class Content : public Glib::Interface
+{
+  _CLASS_INTERFACE(Content, ClutterContent, CLUTTER_CONTENT, ClutterContentIface)
+public:
+
+
+protected:
+  _WRAP_METHOD(void invalidate(), clutter_content_invalidate)
+
+
+  #m4 _CONVERSION(`float&',`gfloat*',`&($3)')
+  #m4 _INITIALIZATION(`float&',`gfloat',`&($3)')
+  _WRAP_VFUNC(bool get_preferred_size(float& width{>>}, float& height{>>}) const, 
clutter_content_get_preferred_size)
+
+  //TODO: Wrap ClutterPaintNode? _WRAP_VFUNC(void paint_content(const Glib::RefPtr<Actor>& actor, 
ClutterPaintNode* node), paint_content)
+
+  _WRAP_VFUNC(void attached(const Glib::RefPtr<Actor>& actor), detached)
+  _WRAP_VFUNC(void detached(const Glib::RefPtr<Actor>& actor), detached)
+  _WRAP_VFUNC(void invalidate(), invalidate)
+};
+
+}
diff --git a/clutter/src/filelist.am b/clutter/src/filelist.am
index 4ce02f7..54c8e02 100644
--- a/clutter/src/filelist.am
+++ b/clutter/src/filelist.am
@@ -35,11 +35,13 @@ files_hg =                  \
        clone.hg                \
        color.hg                \
        container.hg            \
+       content.hg              \
        device-manager.hg       \
        effect.hg               \
        fixed-layout.hg         \
        flow-layout.hg          \
        group.hg                \
+       image.hg                \
        input-device.hg         \
        interval.hg             \
        layoutmeta.hg           \
diff --git a/clutter/src/image.ccg b/clutter/src/image.ccg
new file mode 100644
index 0000000..0188f46
--- /dev/null
+++ b/clutter/src/image.ccg
@@ -0,0 +1,30 @@
+/* Copyright (C) 2014 The cluttermm Development Team
+ *
+ * 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.1 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, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <glibmm/object.h>
+#include <cluttermm/actor-meta.h>
+#include <clutter/clutter.h>
+#include <cogl/cogl.h>
+#include <glibmm/vectorutils.h>
+#include <cairo/cairo.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+
+
+namespace Clutter
+{
+
+} //namespace Clutter
diff --git a/clutter/src/image.hg b/clutter/src/image.hg
new file mode 100644
index 0000000..2777f39
--- /dev/null
+++ b/clutter/src/image.hg
@@ -0,0 +1,65 @@
+/* Copyright (C) 2014 The cluttermm Development Team
+ *
+ * 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.1 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, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <glibmm/object.h>
+#include <cogl/cogl.h>
+#include <cluttermm/content.h>
+#include <cluttermm/types.h>
+
+_DEFS(cluttermm,clutter)
+_PINCLUDE(glibmm/private/object_p.h)
+_PINCLUDE(cluttermm/private/content_p.h)
+
+namespace Clutter
+{
+
+_WRAP_ENUM(ImageError, ClutterImageError)
+
+class Image
+  : public Glib::Object,
+    public Content
+{
+  _CLASS_GOBJECT(Image, ClutterImage, CLUTTER_IMAGE, Glib::Object, GObject)
+  _DERIVES_INITIALLY_UNOWNED()
+  _IMPLEMENTS_INTERFACE(Content)
+
+protected:
+  _WRAP_CTOR(Image(), clutter_image_new)
+
+public:
+
+  _WRAP_CREATE()
+  //_WRAP_METHOD(CoglTexture* get_texture(), clutter_image_get_texture)
+
+  _WRAP_METHOD(bool set(const guint8* data, CoglPixelFormat pixel_format, guint width, guint height, guint 
row_stride), clutter_image_set_data, errthrow)
+
+  _WRAP_METHOD(bool set(const Glib::Bytes& data, CoglPixelFormat pixel_format, guint width, guint height, 
guint row_stride), clutter_image_set_bytes, errthrow)
+
+
+  //TODO IM: Not sure how to wrap the Cogl::Rectangle, seeing as Cogl isn't wrapped.
+
+  //~ bool set_area(const int data, Cogl::PixelFormat pixel_format, int width, int height, int row_stride);
+
+  // TODO IM: from Pango::Coverage:
+  //** Convert the coverage map into a flat binary format.
+   //* @return An array of bytes representing the coverage map.
+   //*/
+  //Glib::ArrayHandle<unsigned char> to_bytes() const;
+
+};
+
+} // namespace Clutter
diff --git a/codegen/m4/convert_clutter.m4 b/codegen/m4/convert_clutter.m4
index 7123ac6..663fece 100644
--- a/codegen/m4/convert_clutter.m4
+++ b/codegen/m4/convert_clutter.m4
@@ -1,3 +1,6 @@
+_CONVERSION(`const Glib::Bytes&',`GBytes*',`const_cast<GBytes*>(($3).gobj())')
+
+
 _CONVERSION(`const Glib::RefPtr<Action>&',`ClutterAction*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<const Action>&',`ClutterAction*',__CONVERT_CONST_REFPTR_TO_P)
 


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