]> err.no Git - libchamplain/commitdiff
Update bindings to reflect new Layer gobject
authorMichael Sheldon <mike@mikeasoft.com>
Fri, 27 Feb 2009 13:10:12 +0000 (13:10 +0000)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Sun, 1 Mar 2009 20:53:12 +0000 (22:53 +0200)
Make animated-marker.py set behaviours and use layers

bindings/python/champlain-gtk/pychamplaingtk.defs
bindings/python/champlain/pychamplain.defs
bindings/python/demos/animated-marker.py [changed mode: 0644->0755]
bindings/python/update-binding.sh

index da4500afc0396a8840ae737d1cc367e6ad0ca819..7099aae76a803db016030bb4bfb35d3cab5d8a06 100644 (file)
@@ -27,7 +27,3 @@
 )
 
 
-
-;; From champlain-gtk-marshal.h
-
-
index e3adc0b9f264c3675848aa2edd8b35420de6acd6..0a84ef4d4af90cddd269a9abe7409167857b8977 100644 (file)
@@ -1,5 +1,12 @@
 ;; -*- scheme -*-
 ; object definitions ...
+(define-object Layer
+  (in-module "Champlain")
+  (parent "ClutterGroup")
+  (c-name "ChamplainLayer")
+  (gtype-id "CHAMPLAIN_TYPE_LAYER")
+)
+
 (define-object Marker
   (in-module "Champlain")
   (parent "ClutterGroup")
   )
 )
 
+(define-enum StateEnum
+  (in-module "Champlain")
+  (c-name "ChamplainStateEnum")
+  (gtype-id "CHAMPLAIN_TYPE_STATE_ENUM")
+  (values
+    '("none" "CHAMPLAIN_STATE_NONE")
+    '("init" "CHAMPLAIN_STATE_INIT")
+    '("loading" "CHAMPLAIN_STATE_LOADING")
+    '("done" "CHAMPLAIN_STATE_DONE")
+  )
+)
+
 
 ;; From champlain.h
 
 
 ;; From champlain-layer.h
 
+(define-function layer_get_type
+  (c-name "champlain_layer_get_type")
+  (return-type "GType")
+)
+
 (define-function layer_new
   (c-name "champlain_layer_new")
   (is-constructor-of "ChamplainLayer")
   (return-type "ChamplainLayer*")
-  (parameters
-  )
 )
 
 
 )
 
 
-
-;; From champlain-marshal.h
-
-
-
-;; From champlain-enum-types.h
-
-(define-function map_source_get_type
-  (c-name "champlain_map_source_get_type")
-  (return-type "GType")
-)
-
-(define-function scroll_mode_get_type
-  (c-name "champlain_scroll_mode_get_type")
-  (return-type "GType")
-)
-
-
old mode 100644 (file)
new mode 100755 (executable)
index d699152..2930bb8
@@ -14,8 +14,6 @@ def create_marker():
        orange = clutter.Color(0xf3, 0x94, 0x07, 0xbb)
        white = clutter.Color(0xff, 0xff, 0xff, 0xff)
        timeline = clutter.Timeline()
-       #behaviour = clutter.Behaviour()
-       alpha = clutter.Alpha()
        
        marker = champlain.Marker()
        bg = cluttercairo.CairoTexture(MARKER_SIZE, MARKER_SIZE)
@@ -54,14 +52,20 @@ def create_marker():
 
        timeline.set_duration(1000)
        timeline.set_loop(True)
+
+       alpha = clutter.Alpha()
+       alpha.set_timeline(timeline)
+       alpha.set_func(clutter.sine_inc_func)
+
+       behaviour = clutter.BehaviourScale(0.5, 0.5, 2.0, 2.0)
        
        #alpha = clutter_alpha_new_full (timeline, CLUTTER_ALPHA_SINE_INC, NULL, g_object_unref);
+       behaviour.set_alpha(alpha)
+       behaviour.apply(bg)
 
-#behaviour = clutter_behaviour_scale_new (alpha, 0.5, 0.5, 2.0, 2.0);
- # clutter_behaviour_apply (behaviour, bg);
-
-  #behaviour = clutter_behaviour_opacity_new (alpha, 255, 0);
-  #clutter_behaviour_apply (behaviour, bg);
+       behaviour = clutter.BehaviourOpacity(255, 0)
+       behaviour.set_alpha(alpha)
+       behaviour.apply(bg)
 
        timeline.start()
 
@@ -83,12 +87,12 @@ def main():
        actor.set_size(800, 600)
        stage.add(actor)
 
-       #layer = champlain.Layer()
-       #layer.show()
-       #actor.add_layer(layer)
+       layer = champlain.Layer()
+       layer.show()
+       actor.add_layer(layer)
 
        marker = create_marker()
-       actor.add(marker)
+       layer.add(marker)
 
        # Finish initialising the map view
        actor.set_property("zoom-level", 5)
index d45e6bd9e305726f2366da465c0eb6c05092ca2b..4ea6b5b5d10dd8bbf34b69d27cf869e1a8888980 100755 (executable)
@@ -10,8 +10,6 @@ python /usr/share/pygobject/2.0/codegen/h2def.py      \
        champlain-defines.h                     \
        champlain-layer.h                       \
        champlain-marker.h                      \
-       champlain-marshal.h                     \
-       champlain-enum-types.h                  \
  > ../bindings/python/champlain/pychamplain.defs
 
 # Update the list of headers from Makefile.am
@@ -20,7 +18,6 @@ python /usr/share/pygobject/2.0/codegen/h2def.py      \
        -m champlain                            \
        champlain-gtk.h                         \
        champlain-view-embed.h                  \
-       champlain-gtk-marshal.h                 \
  > ../bindings/python/champlain-gtk/pychamplaingtk.defs
 
 # Keep original version