]> err.no Git - libchamplain/commitdiff
Update the Python bindings to have ChamplainBaseMarker
authorVictor Godoy Poluceno <victorpoluceno@gmail.com>
Wed, 22 Apr 2009 23:26:25 +0000 (19:26 -0400)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Wed, 22 Apr 2009 23:26:25 +0000 (19:26 -0400)
AUTHORS
bindings/python/champlain/pychamplain.defs
bindings/python/demos/capitals.py
bindings/python/demos/launcher-gtk.py
bindings/python/update-binding.sh

diff --git a/AUTHORS b/AUTHORS
index ced84f48a05fa1354b340a0dd35e2f8c97c6048b..7b02e6ef7aed6c4bd8e3faf4462c8990591a5022 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -15,3 +15,4 @@ Kritarth Upadhyay <boyzoneblues@gmail.com>
 Debarshi Ray <rish@gnu.org>
 Paulo Cabido <paulo.cabido@gmail.com>
 Sjoerd Simons <sjoerd@luon.net>
+Victor Godoy Poluceno <victorpoluceno@gmail.com>
index 2eb59f1a1573c4b344aebf2e8c6f6aad371ecd6a..d05594b7357be8f87999dfd4155a74e2ac0b73a7 100644 (file)
@@ -1,5 +1,12 @@
 ;; -*- scheme -*-
 ; object definitions ...
+(define-object BaseMarker
+  (in-module "Champlain")
+  (parent "ClutterGroup")
+  (c-name "ChamplainBaseMarker")
+  (gtype-id "CHAMPLAIN_TYPE_BASE_MARKER")
+)
+
 (define-object Layer
   (in-module "Champlain")
   (parent "ClutterGroup")
@@ -16,7 +23,7 @@
 
 (define-object Marker
   (in-module "Champlain")
-  (parent "ClutterGroup")
+  (parent "ChamplainBaseMarker")
   (c-name "ChamplainMarker")
   (gtype-id "CHAMPLAIN_TYPE_MARKER")
 )
   (c-name "champlain_view_ensure_markers_visible")
   (return-type "none")
   (parameters
-    '("ChamplainMarker*[]" "markers")
+    '("ChamplainBaseMarker*[]" "markers")
     '("gboolean" "animate")
   )
 )
   (return-type "ClutterActor*")
 )
 
-(define-method set_position
-  (of-object "ChamplainMarker")
-  (c-name "champlain_marker_set_position")
-  (return-type "none")
-  (parameters
-    '("gdouble" "longitude")
-    '("gdouble" "latitude")
-  )
-)
-
-(define-function marker_new_with_label
-  (c-name "champlain_marker_new_with_label")
+(define-function marker_new_with_text
+  (c-name "champlain_marker_new_with_text")
   (return-type "ClutterActor*")
   (parameters
-    '("const-gchar*" "label")
+    '("const-gchar*" "text")
     '("const-gchar*" "font")
     '("ClutterColor*" "text_color")
     '("ClutterColor*" "marker_color")
   (c-name "champlain_marker_new_with_image")
   (return-type "ClutterActor*")
   (parameters
-    '("const-gchar*" "filename")
-    '("GError**" "error")
+    '("ClutterActor*" "actor")
   )
 )
 
-(define-function marker_new_with_image_full
-  (c-name "champlain_marker_new_with_image_full")
+(define-function marker_new_from_file
+  (c-name "champlain_marker_new_from_file")
   (return-type "ClutterActor*")
   (parameters
     '("const-gchar*" "filename")
-    '("gint" "width")
-    '("gint" "height")
-    '("gint" "anchor_x")
-    '("gint" "anchor_y")
     '("GError**" "error")
   )
 )
 
+(define-function marker_new_full
+  (c-name "champlain_marker_new_full")
+  (return-type "ClutterActor*")
+  (parameters
+    '("const-gchar*" "text")
+    '("ClutterActor*" "actor")
+  )
+)
+
+(define-method set_text
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_set_text")
+  (return-type "none")
+  (parameters
+    '("const-gchar*" "text")
+  )
+)
+
+(define-method set_image
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_set_image")
+  (return-type "none")
+  (parameters
+    '("ClutterActor*" "image")
+  )
+)
+
+(define-method set_use_markup
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_set_use_markup")
+  (return-type "none")
+  (parameters
+    '("gboolean" "use_markup")
+  )
+)
+
+(define-method set_alignment
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_set_alignment")
+  (return-type "none")
+  (parameters
+    '("PangoAlignment" "alignment")
+  )
+)
+
+(define-method set_color
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_set_color")
+  (return-type "none")
+  (parameters
+    '("const-ClutterColor*" "color")
+  )
+)
+
+(define-method set_text_color
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_set_text_color")
+  (return-type "none")
+  (parameters
+    '("const-ClutterColor*" "color")
+  )
+)
+
+(define-method set_font_name
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_set_font_name")
+  (return-type "none")
+  (parameters
+    '("const-gchar*" "font_name")
+  )
+)
+
+(define-method set_wrap
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_set_wrap")
+  (return-type "none")
+  (parameters
+    '("gboolean" "wrap")
+  )
+)
+
+(define-method set_wrap_mode
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_set_wrap_mode")
+  (return-type "none")
+  (parameters
+    '("PangoWrapMode" "wrap_mode")
+  )
+)
+
+(define-method set_attributes
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_set_attributes")
+  (return-type "none")
+  (parameters
+    '("PangoAttrList*" "list")
+  )
+)
+
+(define-method set_single_line_mode
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_set_single_line_mode")
+  (return-type "none")
+  (parameters
+    '("gboolean" "mode")
+  )
+)
+
+(define-method set_ellipsize
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_set_ellipsize")
+  (return-type "none")
+  (parameters
+    '("PangoEllipsizeMode" "mode")
+  )
+)
+
+(define-method set_draw_background
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_set_draw_background")
+  (return-type "none")
+  (parameters
+    '("gboolean" "wrap")
+  )
+)
+
+(define-method get_use_markup
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_get_use_markup")
+  (return-type "gboolean")
+)
+
+(define-method get_text
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_get_text")
+  (return-type "const-gchar*")
+)
+
+(define-method get_image
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_get_image")
+  (return-type "ClutterActor*")
+)
+
+(define-method get_alignment
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_get_alignment")
+  (return-type "PangoAlignment")
+)
+
+(define-method get_color
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_get_color")
+  (return-type "ClutterColor*")
+)
+
+(define-method get_text_color
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_get_text_color")
+  (return-type "ClutterColor*")
+)
+
+(define-method get_font_name
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_get_font_name")
+  (return-type "const-gchar*")
+)
+
+(define-method get_wrap
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_get_wrap")
+  (return-type "gboolean")
+)
+
+(define-method get_wrap_mode
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_get_wrap_mode")
+  (return-type "PangoWrapMode")
+)
+
+(define-method get_ellipsize
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_get_ellipsize")
+  (return-type "PangoEllipsizeMode")
+)
+
+(define-method get_single_line_mode
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_get_single_line_mode")
+  (return-type "gboolean")
+)
+
+(define-method get_draw_background
+  (of-object "ChamplainMarker")
+  (c-name "champlain_marker_get_draw_background")
+  (return-type "gboolean")
+)
+
+
+
+;; From champlain-base-marker.h
+
+(define-function base_marker_get_type
+  (c-name "champlain_base_marker_get_type")
+  (return-type "GType")
+)
+
+(define-function base_marker_new
+  (c-name "champlain_base_marker_new")
+  (is-constructor-of "ChamplainBaseMarker")
+  (return-type "ClutterActor*")
+)
+
+(define-method set_position
+  (of-object "ChamplainBaseMarker")
+  (c-name "champlain_base_marker_set_position")
+  (return-type "none")
+  (parameters
+    '("gdouble" "longitude")
+    '("gdouble" "latitude")
+  )
+)
+
 
 
 ;; From champlain-tile.h
index 4af78785ca04f1ce09093dc1394e2babf3958d5c..a2782ad1c0f5b7ae6d0fb3dd89733c31e8929dd1 100755 (executable)
@@ -103,13 +103,13 @@ class Capitals:
                        #Change the colour of the last marker's text
                        last = self.markers.pop()
                        self.layer.remove(last)
-                       marker = champlain.marker_new_with_label(last.name, font, black, orange)
+                       marker = champlain.marker_new_with_text(last.name, font, black, orange)
                        marker.set_position(last.get_property("latitude"), last.get_property("longitude"))
                        self.markers.append(marker)
                        self.layer.add(marker)
                        marker.raise_top()
 
-               marker = champlain.marker_new_with_label(name, font, white, orange)
+               marker = champlain.marker_new_with_text(name, font, white, orange)
                marker.set_position(latitude, longitude)
                marker.name = name
                self.markers.append(marker)
index 0dd6b6d7bc5d47f373e27ba75890a4e80e394eed..83a2ba73dcae72a99f9457a2d94fa244706f59af 100755 (executable)
@@ -47,15 +47,15 @@ class champlainDemo:
                orange = clutter.Color(0xf3, 0x94, 0x07, 0xbb)
                white = clutter.Color(0xff, 0xff, 0xff, 0xff)
                black = clutter.Color(0x00, 0x00, 0x00, 0xff)
-               marker = champlain.marker_new_with_label("MontrĂ©al", "Airmole 14", black, orange)
+               marker = champlain.marker_new_with_text("MontrĂ©al", "Airmole 14", black, orange)
                marker.set_position(45.528178, -73.563788)
                layer.add(marker)
 
-               marker = champlain.marker_new_with_label("New York", "Sans 25", white, orange);
+               marker = champlain.marker_new_with_text("New York", "Sans 25", white, orange);
                marker.set_position(40.77, -73.98);
                layer.add(marker)
 
-               marker = champlain.marker_new_with_label("Saint-Tite-des-Caps", "Serif 12", black, orange);
+               marker = champlain.marker_new_with_text("Saint-Tite-des-Caps", "Serif 12", black, orange);
                marker.set_position(47.130885, -70.764141);
                layer.add(marker)
 
index 42cfc74b41d74b2c53a385245d30055b6f4bae69..32bc859a57d0ab713df8e93381f991b093e25d19 100755 (executable)
@@ -12,6 +12,7 @@ python /usr/share/pygobject/2.0/codegen/h2def.py      \
        champlain-map-source.h                  \
        champlain-network-map-source.h          \
        champlain-marker.h                      \
+       champlain-base-marker.h                 \
        champlain-tile.h                        \
        champlain-zoom-level.h                  \
  > ../bindings/python/champlain/pychamplain.defs