[cluttermm] ActorBox: Move this to its own file, to make things clearer.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cluttermm] ActorBox: Move this to its own file, to make things clearer.
- Date: Fri, 21 Mar 2014 09:39:29 +0000 (UTC)
commit 38fa575d93dd2aa91b104b04cc57db1116ce7b22
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Mar 21 10:38:53 2014 +0100
ActorBox: Move this to its own file, to make things clearer.
clutter/src/actor-box.ccg | 33 +++++++++++++++++++++
clutter/src/actor-box.hg | 71 +++++++++++++++++++++++++++++++++++++++++++++
clutter/src/actor.ccg | 8 -----
clutter/src/actor.hg | 44 +---------------------------
clutter/src/filelist.am | 1 +
5 files changed, 106 insertions(+), 51 deletions(-)
---
diff --git a/clutter/src/actor-box.ccg b/clutter/src/actor-box.ccg
new file mode 100644
index 0000000..bf7eb73
--- /dev/null
+++ b/clutter/src/actor-box.ccg
@@ -0,0 +1,33 @@
+/* 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 <clutter/clutter.h>
+#include <iterator>
+
+namespace Clutter
+{
+
+ActorBox::ActorBox(float x1, float y1, float x2, float y2)
+{
+ gobject_.x1 = x1;
+ gobject_.y1 = y1;
+ gobject_.x2 = x2;
+ gobject_.y2 = y2;
+}
+
+} //namespace Clutter
+
diff --git a/clutter/src/actor-box.hg b/clutter/src/actor-box.hg
new file mode 100644
index 0000000..65a5ef4
--- /dev/null
+++ b/clutter/src/actor-box.hg
@@ -0,0 +1,71 @@
+/* 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 <glibmm/object.h>
+#include <cluttermm/types.h> // For Event*
+
+_DEFS(cluttermm,clutter)
+_PINCLUDE(glibmm/private/object_p.h)
+
+
+namespace Clutter
+{
+
+class ActorBox
+{
+ _CLASS_BOXEDTYPE_STATIC(ActorBox, ClutterActorBox, NONE, clutter_actor_box_copy, clutter_actor_box_free)
+ _IGNORE(clutter_actor_box_init, clutter_actor_box_copy, clutter_actor_box_free)
+public:
+ _CUSTOM_DEFAULT_CTOR
+
+ //hand-coded constructor to allow default values:
+ explicit ActorBox(float x1 = 0, float y1 = 0, float x2 = 0, float y2 = 0);
+
+ // Convenience constructor that would be difficult to wrap - it's got 4
+ // floats (origin x and y and the width and height) so will conflict with the
+ // other constructor.
+ _IGNORE(clutter_actor_box_init_rect)
+
+ _WRAP_EQUAL(clutter_actor_box_equal)
+
+ _WRAP_METHOD(float get_x() const, clutter_actor_box_get_x)
+ _WRAP_METHOD(float get_y() const, clutter_actor_box_get_y)
+ _WRAP_METHOD(float get_width() const, clutter_actor_box_get_width)
+ _WRAP_METHOD(float get_height() const, clutter_actor_box_get_height)
+ _WRAP_METHOD(void set_origin(float x, float y), clutter_actor_box_set_origin)
+
+ #m4 _INITIALIZATION(`float&',`gfloat',`&($3)')
+ _WRAP_METHOD(void get_origin(float& x, float& y) const, clutter_actor_box_get_origin)
+ _WRAP_METHOD(void set_size(float width, float height), clutter_actor_box_set_size)
+ _WRAP_METHOD(void get_size(float& width, float& height) const, clutter_actor_box_get_size)
+
+ _WRAP_METHOD(float get_area() const, clutter_actor_box_get_area)
+ _WRAP_METHOD(bool contains(float x, float y) const, clutter_actor_box_contains)
+
+ // wrap if need be- what would be the use case?
+ _IGNORE(clutter_actor_box_from_vertices)
+ //_WRAP_METHOD(bool from_vertices(const ClutterVertex verts[]) const, clutter_actor_box_from_vertices
+ _WRAP_METHOD(void clamp_to_pixel(), clutter_actor_box_clamp_to_pixel)
+
+#m4 _INITIALIZATION(`ActorBox&',`ClutterActorBox', `$3 = Glib::wrap(&($4))')
+ _WRAP_METHOD(void interpolate(const ActorBox& final_, double progress, ActorBox& result{>>}),
clutter_actor_box_interpolate)
+
+ _WRAP_METHOD(void unite(const ActorBox& b, ActorBox& result{>>}), clutter_actor_box_union)
+
+};
+
+} // namespace Clutter
diff --git a/clutter/src/actor.ccg b/clutter/src/actor.ccg
index abc205a..51d143e 100644
--- a/clutter/src/actor.ccg
+++ b/clutter/src/actor.ccg
@@ -21,14 +21,6 @@
namespace Clutter
{
-ActorBox::ActorBox(float x1, float y1, float x2, float y2)
-{
- gobject_.x1 = x1;
- gobject_.y1 = y1;
- gobject_.x2 = x2;
- gobject_.y2 = y2;
-}
-
bool Actor::is_mapped() const
{
return (CLUTTER_ACTOR_IS_MAPPED(gobj()) != 0);
diff --git a/clutter/src/actor.hg b/clutter/src/actor.hg
index aaff73d..fcbccd2 100644
--- a/clutter/src/actor.hg
+++ b/clutter/src/actor.hg
@@ -20,6 +20,7 @@
#include <pangomm/layout.h>
#include <atkmm/object.h>
#include <cluttermm/action.h>
+#include <cluttermm/actor-box.h>
#include <cluttermm/animation.h>
#include <cluttermm/color.h>
#include <cluttermm/effect.h>
@@ -36,49 +37,6 @@ namespace Clutter
class Animation;
-class ActorBox
-{
- _CLASS_BOXEDTYPE_STATIC(ActorBox, ClutterActorBox, NONE, clutter_actor_box_copy, clutter_actor_box_free)
- _IGNORE(clutter_actor_box_init, clutter_actor_box_copy, clutter_actor_box_free)
-public:
- _CUSTOM_DEFAULT_CTOR
-
- //hand-coded constructor to allow default values:
- explicit ActorBox(float x1 = 0, float y1 = 0, float x2 = 0, float y2 = 0);
-
- // Convenience constructor that would be difficult to wrap - it's got 4
- // floats (origin x and y and the width and height) so will conflict with the
- // other constructor.
- _IGNORE(clutter_actor_box_init_rect)
-
- _WRAP_EQUAL(clutter_actor_box_equal)
-
- _WRAP_METHOD(float get_x() const, clutter_actor_box_get_x)
- _WRAP_METHOD(float get_y() const, clutter_actor_box_get_y)
- _WRAP_METHOD(float get_width() const, clutter_actor_box_get_width)
- _WRAP_METHOD(float get_height() const, clutter_actor_box_get_height)
- _WRAP_METHOD(void set_origin(float x, float y), clutter_actor_box_set_origin)
-
- #m4 _INITIALIZATION(`float&',`gfloat',`&($3)')
- _WRAP_METHOD(void get_origin(float& x, float& y) const, clutter_actor_box_get_origin)
- _WRAP_METHOD(void set_size(float width, float height), clutter_actor_box_set_size)
- _WRAP_METHOD(void get_size(float& width, float& height) const, clutter_actor_box_get_size)
-
- _WRAP_METHOD(float get_area() const, clutter_actor_box_get_area)
- _WRAP_METHOD(bool contains(float x, float y) const, clutter_actor_box_contains)
-
- // wrap if need be- what would be the use case?
- _IGNORE(clutter_actor_box_from_vertices)
- //_WRAP_METHOD(bool from_vertices(const ClutterVertex verts[]) const, clutter_actor_box_from_vertices
- _WRAP_METHOD(void clamp_to_pixel(), clutter_actor_box_clamp_to_pixel)
-
-#m4 _INITIALIZATION(`ActorBox&',`ClutterActorBox', `$3 = Glib::wrap(&($4))')
- _WRAP_METHOD(void interpolate(const ActorBox& final_, double progress, ActorBox& result{>>}),
clutter_actor_box_interpolate)
-
- _WRAP_METHOD(void unite(const ActorBox& b, ActorBox& result{>>}), clutter_actor_box_union)
-
-};
-
_WRAP_ENUM(ActorFlags, ClutterActorFlags)
_WRAP_ENUM(AllocationFlags, ClutterAllocationFlags)
diff --git a/clutter/src/filelist.am b/clutter/src/filelist.am
index 4386a1e..7a809e1 100644
--- a/clutter/src/filelist.am
+++ b/clutter/src/filelist.am
@@ -12,6 +12,7 @@ files_defs = \
files_hg = \
actor.hg \
+ actor-box.hg \
actor-meta.hg \
action.hg \
alpha.hg \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]