[libchamplainmm] Rename BaseMarker and Marker classes



commit 6e069f0bd4ec8cfb2a2d41f908b5a7d18f818904
Author: Juan R. GarcĂ­a Blanco <juanrgar gmail com>
Date:   Sun Feb 23 21:50:30 2014 +0100

    Rename BaseMarker and Marker classes
    
        * Marker renamed to Label
        * BaseMarker renamed to Marker

 .../extradefs/generate_extra_defs_libchamplain.cc  |    4 +-
 libchamplain/src/base-marker.hg                    |   58 -----------
 libchamplain/src/label.ccg                         |   45 +++++++++
 libchamplain/src/label.hg                          |   98 +++++++++++++++++++
 libchamplain/src/marker.ccg                        |   46 ---------
 libchamplain/src/marker.hg                         |  101 +++-----------------
 6 files changed, 159 insertions(+), 193 deletions(-)
---
diff --git a/codegen/extradefs/generate_extra_defs_libchamplain.cc 
b/codegen/extradefs/generate_extra_defs_libchamplain.cc
index 2ffa8f4..050363d 100644
--- a/codegen/extradefs/generate_extra_defs_libchamplain.cc
+++ b/codegen/extradefs/generate_extra_defs_libchamplain.cc
@@ -26,12 +26,12 @@ main(int argc, char *argv[])
 {
   clutter_init(&argc, &argv);
 
-  std::cout << get_defs(CHAMPLAIN_TYPE_BASE_MARKER)
+  std::cout << get_defs(CHAMPLAIN_TYPE_MARKER)
             << get_defs(CHAMPLAIN_TYPE_CACHE)
             << get_defs(CHAMPLAIN_TYPE_LAYER)
             << get_defs(CHAMPLAIN_TYPE_MAP_SOURCE)
             << get_defs(CHAMPLAIN_TYPE_MAP_PROJECTION)
-            << get_defs(CHAMPLAIN_TYPE_MARKER)
+            << get_defs(CHAMPLAIN_TYPE_LABEL)
             << get_defs(CHAMPLAIN_TYPE_NETWORK_MAP_SOURCE)
             << get_defs(CHAMPLAIN_TYPE_POLYGON)
             << get_defs(CHAMPLAIN_TYPE_SCROLL_MODE)
diff --git a/libchamplain/src/label.ccg b/libchamplain/src/label.ccg
new file mode 100644
index 0000000..d5901d1
--- /dev/null
+++ b/libchamplain/src/label.ccg
@@ -0,0 +1,45 @@
+/* Copyright (c) 2009  Debarshi Ray <debarshir src gnome org>
+ *
+ * This file is part of libchamplainmm.
+ *
+ * libchamplainmm 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.
+ *
+ * libchamplainmm 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 program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+namespace Champlain
+{
+
+Glib::RefPtr<Label> Label::create(const Glib::ustring & label,
+                                  const Glib::ustring & font,
+                                  const Clutter::Color & text_color,
+                                  const Clutter::Color & marker_color)
+{
+  const Glib::RefPtr<Label> champlain_label(new Label());
+
+  champlain_label->set_text(label);
+  champlain_label->set_font_name(font);
+  champlain_label->set_text_color(text_color);
+  champlain_label->set_color(marker_color);
+  return champlain_label;
+}
+
+Glib::RefPtr<Label> Label::create(const std::string & filename)
+{
+  const Glib::RefPtr<Label> champlain_label(new Label());
+  const Glib::RefPtr<Clutter::Texture> texture = Clutter::Texture::create_from_file(filename);
+
+  champlain_label->add_actor(texture);
+  return champlain_label;
+}
+
+} // namespace Champlain
diff --git a/libchamplain/src/label.hg b/libchamplain/src/label.hg
new file mode 100644
index 0000000..fb2518f
--- /dev/null
+++ b/libchamplain/src/label.hg
@@ -0,0 +1,98 @@
+/* Copyright (c) 2009  Debarshi Ray <debarshir src gnome org>
+ *
+ * This file is part of libchamplainmm.
+ *
+ * libchamplainmm 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.
+ *
+ * libchamplainmm 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 program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <string>
+#include <cluttermm.h>
+#include <glibmm.h>
+#include <pangomm.h>
+#include <libchamplainmm/marker.h>
+
+_DEFS(libchamplainmm,libchamplain)
+
+_CC_INCLUDE(champlain/champlain.h)
+_PINCLUDE(libchamplainmm/private/marker_p.h)
+
+namespace Champlain
+{
+
+class Label : public Marker
+{
+  _CLASS_GOBJECT(Label, ChamplainLabel, CHAMPLAIN_LABEL, Marker, ChamplainMarker)
+
+protected:
+  _CTOR_DEFAULT()
+
+  _IGNORE(champlain_label_new_from_file)
+  _IGNORE(champlain_label_new_full)
+  _IGNORE(champlain_label_new_with_image)
+  _IGNORE(champlain_label_new_with_text)
+
+public:
+  _WRAP_CREATE()
+
+  static Glib::RefPtr<Label> create(
+      const Glib::ustring & label,
+      const Glib::ustring & font  = Glib::ustring("Sans 11"),
+      const Clutter::Color & text_color
+                                 = Clutter::Color(0x22, 0x22, 0x22, 0xFF),
+      const Clutter::Color & marker_color
+                                 = Clutter::Color(0x33, 0x33, 0x33, 0xFF));
+  static Glib::RefPtr<Label> create(const std::string & filename);
+
+  _WRAP_METHOD(Pango::Alignment get_alignment(), champlain_label_get_alignment)
+  _WRAP_METHOD(Pango::EllipsizeMode get_ellipsize() const, champlain_label_get_ellipsize)
+  _WRAP_METHOD(Clutter::Color get_color() const, champlain_label_get_color)
+  _WRAP_METHOD(bool get_draw_background() const, champlain_label_get_draw_background)
+  _WRAP_METHOD(std::string get_font_name() const, champlain_label_get_font_name)
+  _WRAP_METHOD(Glib::RefPtr<Clutter::Actor> get_image(), champlain_label_get_image)
+  _WRAP_METHOD(Glib::ustring get_text() const, champlain_label_get_text)
+  _WRAP_METHOD(Clutter::Color get_text_color() const, champlain_label_get_text_color)
+  _WRAP_METHOD(bool get_single_line_mode() const, champlain_label_get_single_line_mode)
+  _WRAP_METHOD(bool get_use_markup() const, champlain_label_get_use_markup)
+  _WRAP_METHOD(bool get_wrap(), champlain_label_get_wrap)
+  _WRAP_METHOD(Pango::WrapMode get_wrap_mode(), champlain_label_get_wrap_mode)
+
+  _WRAP_METHOD(void set_alignment(Pango::Alignment alignment), champlain_label_set_alignment)
+  _WRAP_METHOD(void set_attributes(Pango::AttrList & attributes), champlain_label_set_attributes)
+  _WRAP_METHOD(void set_ellipsize(Pango::EllipsizeMode ellipsize_mode), champlain_label_set_ellipsize)
+  _WRAP_METHOD(void set_color(const Clutter::Color & color), champlain_label_set_color)
+  _WRAP_METHOD(void set_draw_background(bool setting=true), champlain_label_set_draw_background)
+  _WRAP_METHOD(void set_font_name(const std::string & font_name), champlain_label_set_font_name)
+  _WRAP_METHOD(void set_image(const Glib::RefPtr<Clutter::Actor> & image), champlain_label_set_image)
+  _WRAP_METHOD(void set_text(const Glib::ustring & text), champlain_label_set_text)
+  _WRAP_METHOD(void set_text_color(const Clutter::Color & text_color), champlain_label_set_text_color)
+  _WRAP_METHOD(void set_single_line_mode(bool setting=true), champlain_label_set_single_line_mode)
+  _WRAP_METHOD(void set_use_markup(bool setting=true), champlain_label_set_use_markup)
+  _WRAP_METHOD(void set_wrap(bool setting=true), champlain_label_set_wrap)
+  _WRAP_METHOD(void set_wrap_mode(Pango::WrapMode wrap_mode), champlain_label_set_wrap_mode)
+
+  _WRAP_PROPERTY("alignment", Pango::Alignment)
+  _WRAP_PROPERTY("color", Clutter::Color)
+  _WRAP_PROPERTY("draw-background", bool)
+  _WRAP_PROPERTY("ellipsize", Pango::EllipsizeMode)
+  _WRAP_PROPERTY("font-name", std::string)
+  _WRAP_PROPERTY("image", Glib::RefPtr<Clutter::Actor>)
+  _WRAP_PROPERTY("single-line-mode", bool)
+  _WRAP_PROPERTY("text", Glib::ustring)
+  _WRAP_PROPERTY("text-color", Clutter::Color)
+  _WRAP_PROPERTY("use-markup", bool)
+  _WRAP_PROPERTY("wrap", bool)
+  _WRAP_PROPERTY("wrap-mode", Pango::WrapMode)
+};
+
+} // namespace Champlain
diff --git a/libchamplain/src/marker.ccg b/libchamplain/src/marker.ccg
index 0c6573f..e69de29 100644
--- a/libchamplain/src/marker.ccg
+++ b/libchamplain/src/marker.ccg
@@ -1,46 +0,0 @@
-/* Copyright (c) 2009  Debarshi Ray <debarshir src gnome org>
- *
- * This file is part of libchamplainmm.
- *
- * libchamplainmm 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.
- *
- * libchamplainmm 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 program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace Champlain
-{
-
-Glib::RefPtr<Marker> Marker::create(const Glib::ustring & label,
-                                    const Glib::ustring & font,
-                                    const Clutter::Color & text_color,
-                                    const Clutter::Color & marker_color)
-{
-  const Glib::RefPtr<Marker> marker(new Marker());
-
-  marker->set_text(label);
-  marker->set_font_name(font);
-  marker->set_text_color(text_color);
-  marker->set_color(marker_color);
-  return marker;
-}
-
-Glib::RefPtr<Marker> Marker::create(const std::string & filename)
-{
-  const Glib::RefPtr<Marker> marker(new Marker());
-  const Glib::RefPtr<Clutter::Texture> texture
-    = Clutter::Texture::create_from_file(filename);
-
-  marker->add_actor(texture);
-  return marker;
-}
-
-} // namespace Champlain
diff --git a/libchamplain/src/marker.hg b/libchamplain/src/marker.hg
index f5bc322..15df65a 100644
--- a/libchamplain/src/marker.hg
+++ b/libchamplain/src/marker.hg
@@ -16,110 +16,37 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <string>
 #include <cluttermm.h>
-#include <glibmm.h>
-#include <pangomm.h>
-#include <libchamplainmm/base-marker.h>
 
 _DEFS(libchamplainmm,libchamplain)
 
 _CC_INCLUDE(champlain/champlain.h)
-_PINCLUDE(libchamplainmm/private/base-marker_p.h)
+_PINCLUDE(cluttermm/private/actor_p.h)
 
 namespace Champlain
 {
 
-class Marker :
-    public BaseMarker
+class Marker : public Clutter::Actor
 {
-  _CLASS_GOBJECT(Marker, ChamplainMarker, CHAMPLAIN_MARKER,
-                 BaseMarker, ChamplainBaseMarker)
+  _CLASS_GOBJECT(Marker, ChamplainMarker, CHAMPLAIN_MARKER, Clutter::Actor, ClutterActor)
 
 protected:
   _CTOR_DEFAULT()
 
-  _IGNORE(champlain_marker_new_from_file)
-  _IGNORE(champlain_marker_new_full)
-  _IGNORE(champlain_marker_new_with_image)
-  _IGNORE(champlain_marker_new_with_text)
-
-  _WRAP_VFUNC(void draw_marker(), draw_marker);
-
 public:
   _WRAP_CREATE()
 
-  static Glib::RefPtr<Marker> create(
-      const Glib::ustring & label,
-      const Glib::ustring & font  = Glib::ustring("Sans 11"),
-      const Clutter::Color & text_color
-                                 = Clutter::Color(0x22, 0x22, 0x22, 0xFF),
-      const Clutter::Color & marker_color
-                                 = Clutter::Color(0x33, 0x33, 0x33, 0xFF));
-  static Glib::RefPtr<Marker> create(const std::string & filename);
-
-  _WRAP_METHOD(Pango::Alignment get_alignment(),
-               champlain_marker_get_alignment)
-  _WRAP_METHOD(Pango::EllipsizeMode get_ellipsize() const,
-               champlain_marker_get_ellipsize)
-  _WRAP_METHOD(Clutter::Color get_color() const,
-               champlain_marker_get_color)
-  _WRAP_METHOD(bool get_draw_background() const,
-               champlain_marker_get_draw_background)
-  _WRAP_METHOD(std::string get_font_name() const,
-               champlain_marker_get_font_name)
-  _WRAP_METHOD(Glib::RefPtr<Clutter::Actor> get_image(),
-               champlain_marker_get_image)
-  _WRAP_METHOD(Glib::ustring get_text() const,
-               champlain_marker_get_text)
-  _WRAP_METHOD(Clutter::Color get_text_color() const,
-               champlain_marker_get_text_color)
-  _WRAP_METHOD(bool get_single_line_mode() const,
-               champlain_marker_get_single_line_mode)
-  _WRAP_METHOD(bool get_use_markup() const,
-               champlain_marker_get_use_markup)
-  _WRAP_METHOD(bool get_wrap(), champlain_marker_get_wrap)
-  _WRAP_METHOD(Pango::WrapMode get_wrap_mode(),
-               champlain_marker_get_wrap_mode)
-
-  _WRAP_METHOD(void set_alignment(Pango::Alignment alignment),
-               champlain_marker_set_alignment)
-  _WRAP_METHOD(void set_attributes(Pango::AttrList & attributes),
-               champlain_marker_set_attributes)
-  _WRAP_METHOD(void set_ellipsize(Pango::EllipsizeMode ellipsize_mode),
-               champlain_marker_set_ellipsize)
-  _WRAP_METHOD(void set_color(const Clutter::Color & color),
-               champlain_marker_set_color)
-  _WRAP_METHOD(void set_draw_background(bool setting=true),
-               champlain_marker_set_draw_background)
-  _WRAP_METHOD(void set_font_name(const std::string & font_name),
-               champlain_marker_set_font_name)
-  _WRAP_METHOD(void set_image(const Glib::RefPtr<Clutter::Actor> & image),
-               champlain_marker_set_image)
-  _WRAP_METHOD(void set_text(const Glib::ustring & text),
-               champlain_marker_set_text)
-  _WRAP_METHOD(void set_text_color(const Clutter::Color & text_color),
-               champlain_marker_set_text_color)
-  _WRAP_METHOD(void set_single_line_mode(bool setting=true),
-               champlain_marker_set_single_line_mode)
-  _WRAP_METHOD(void set_use_markup(bool setting=true),
-               champlain_marker_set_use_markup)
-  _WRAP_METHOD(void set_wrap(bool setting=true), champlain_marker_set_wrap)
-  _WRAP_METHOD(void set_wrap_mode(Pango::WrapMode wrap_mode),
-               champlain_marker_set_wrap_mode)
-
-  _WRAP_PROPERTY("alignment", Pango::Alignment)
-  _WRAP_PROPERTY("color", Clutter::Color)
-  _WRAP_PROPERTY("draw-background", bool)
-  _WRAP_PROPERTY("ellipsize", Pango::EllipsizeMode)
-  _WRAP_PROPERTY("font-name", std::string)
-  _WRAP_PROPERTY("image", Glib::RefPtr<Clutter::Actor>)
-  _WRAP_PROPERTY("single-line-mode", bool)
-  _WRAP_PROPERTY("text", Glib::ustring)
-  _WRAP_PROPERTY("text-color", Clutter::Color)
-  _WRAP_PROPERTY("use-markup", bool)
-  _WRAP_PROPERTY("wrap", bool)
-  _WRAP_PROPERTY("wrap-mode", Pango::WrapMode)
+  _WRAP_METHOD(void animate_in(), champlain_marker_animate_in)
+  _WRAP_METHOD(void animate_in_with_delay(guint delay), champlain_marker_animate_in_with_delay)
+  _WRAP_METHOD(void animate_out(), champlain_marker_animate_out)
+  _WRAP_METHOD(void animate_out_with_delay(guint delay), champlain_marker_animate_out_with_delay)
+  _WRAP_METHOD(bool get_highlighted(), champlain_marker_get_highlighted)
+  _WRAP_METHOD(void set_highlighted(bool highlighted=true), champlain_marker_set_highlighted)
+  _WRAP_METHOD(void set_position(double latitude, double longitude), champlain_marker_set_position)
+
+  _WRAP_PROPERTY("highlighted", bool)
+  _WRAP_PROPERTY("latitude", double)
+  _WRAP_PROPERTY("longitude", double)
 };
 
 } // namespace Champlain


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