[libchamplainmm] Marker: Update to latest 0.12



commit fc1f3f31995a5464aaa849bb8db7d3ebe4d8fab4
Author: Juan R. García Blanco <juanrgar gmail com>
Date:   Sun Mar 2 17:32:13 2014 +0100

    Marker: Update to latest 0.12
    
        * Remove get/set_highlighted(), set_position() methods.
        * Remove highlighted, latitude, longitud properties.
        * Add get/set_selectable(), get/set_draggable(), get/set_selected()
        methods.
        * Add selected, selectable, draggable properties.
        * Add button-press, button-release, drag-motion, drag-finish
        signals.
        * Add documentation.
        * Add implemented interface Location.
        * Create marker.ccg

 champlain/src/marker.ccg |   23 ++++++++++++++++++
 champlain/src/marker.hg  |   59 ++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 72 insertions(+), 10 deletions(-)
---
diff --git a/champlain/src/marker.ccg b/champlain/src/marker.ccg
index e69de29..98e7f82 100644
--- a/champlain/src/marker.ccg
+++ b/champlain/src/marker.ccg
@@ -0,0 +1,23 @@
+/* Copyright (c) 2014  Juan R. García Blanco <juanrgar gmail com>
+ *
+ * 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 <champlain/champlain.h>
+
+namespace Champlain
+{
+} // namespace Champlain
diff --git a/champlain/src/marker.hg b/champlain/src/marker.hg
index 6481f71..384b7f0 100644
--- a/champlain/src/marker.hg
+++ b/champlain/src/marker.hg
@@ -16,37 +16,76 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <cluttermm.h>
+#include <cluttermm/actor.h>
+#include <champlainmm/location.h>
 
 _DEFS(champlainmm,champlain)
-
-_CC_INCLUDE(champlain/champlain.h)
 _PINCLUDE(cluttermm/private/actor_p.h)
 
 namespace Champlain
 {
 
-class Marker : public Clutter::Actor
+/** Base class for markers.
+ *
+ * Markers represent points of interest on a map. Markers need to be
+ * placed on a layer (a MarkerLayer). Layers have to be added to a
+ * View for the markers to show on the map.
+ *
+ * A marker is nothing more than a regular Clutter::Actor. You can draw on
+ * it what ever you want.  Set the marker's position
+ * on the map using Location::set_location(). Don't forget to set the 
+ * marker's pointer position using Clutter::Actor::set_translation().
+ *
+ * This is a base class of all markers. libchamplainmm has a more evoluted
+ * type of markers with text and image support. See Label for more details.
+ *
+ * @newin{0,10}
+ */
+class Marker
+  : public Clutter::Actor,
+    public Location
 {
   _CLASS_GOBJECT(Marker, ChamplainMarker, CHAMPLAIN_MARKER, Clutter::Actor, ClutterActor)
+  _IMPLEMENTS_INTERFACE(Location)
 
 protected:
+  /** Creates an instance of Marker.
+   *
+   * @newin{0,12}
+   */
   _CTOR_DEFAULT()
 
 public:
+  /** Creates an instance of Marker.
+   *
+   * @newin{0,12}
+   */
   _WRAP_CREATE()
 
+  _WRAP_METHOD(bool get_selectable() const, champlain_marker_get_selectable)
+  _WRAP_METHOD(void set_selectable(bool selectable = true), champlain_marker_set_selectable)
+
+  _WRAP_METHOD(bool get_draggable() const, champlain_marker_get_draggable)
+  _WRAP_METHOD(void set_draggable(bool draggable = true), champlain_marker_set_draggable)
+
+  _WRAP_METHOD(bool get_selected() const, champlain_marker_get_selected)
+  _WRAP_METHOD(void set_selected(bool selected = true), champlain_marker_set_selected)
+
   _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)
+  _WRAP_PROPERTY("selected", bool)
+  _WRAP_PROPERTY("selectable", bool)
+  _WRAP_PROPERTY("draggable", bool)
+
+//TODO
+  _WRAP_SIGNAL(void button_press(ClutterEvent*), "button-press", no_default_handler)
+  _WRAP_SIGNAL(void button_release(ClutterEvent*), "button-release", no_default_handler)
+  _WRAP_SIGNAL(void drag_motion(double, double, ClutterEvent*), "drag-motion", no_default_handler)
+  _WRAP_SIGNAL(void drag_finish(ClutterEvent*), "drag-finish", no_default_handler)
 };
 
 } // namespace Champlain


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