From 669d2fc71e3743bc66757b2f9365074021851aaf Mon Sep 17 00:00:00 2001 From: Victor Godoy Poluceno Date: Thu, 6 Aug 2009 18:10:02 -0300 Subject: [PATCH] Sync wtih clutter 1.0 api --- bindings/python/demos/animated-marker.py | 9 +++------ bindings/python/demos/launcher-gtk.py | 11 +++++++---- bindings/python/demos/launcher.py | 6 +++--- bindings/python/demos/polygons.py | 6 +++--- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/bindings/python/demos/animated-marker.py b/bindings/python/demos/animated-marker.py index 238592c..b6d1c77 100755 --- a/bindings/python/demos/animated-marker.py +++ b/bindings/python/demos/animated-marker.py @@ -7,7 +7,6 @@ import champlain import clutter -import cluttercairo import cairo import math import gobject @@ -29,7 +28,7 @@ class AnimatedMarker(champlain.Marker) : color = MARKER_COLOR #Cairo definition of the inner marker - bg_in = cluttercairo.CairoTexture(MARKER_SIZE, MARKER_SIZE) + bg_in = clutter.CairoTexture(MARKER_SIZE, MARKER_SIZE) cr_in = bg_in.cairo_create() cr_in.set_source_rgb(0, 0, 0) cr_in.arc(MARKER_SIZE / 2.0, MARKER_SIZE / 2.0, MARKER_SIZE / 2.0, 0, 2 * math.pi) @@ -41,7 +40,7 @@ class AnimatedMarker(champlain.Marker) : bg_in.set_position(0, 0) #Cairo definition of the outside circle (that will be animated) - bg_out = cluttercairo.CairoTexture(2 * MARKER_SIZE, 2 * MARKER_SIZE) + bg_out = clutter.CairoTexture(2 * MARKER_SIZE, 2 * MARKER_SIZE) cr_out = bg_out.cairo_create() cr_out.set_source_rgb(0, 0, 0) cr_out.arc(MARKER_SIZE, MARKER_SIZE, 0.9 * MARKER_SIZE, 0, 2 * math.pi) @@ -59,9 +58,7 @@ class AnimatedMarker(champlain.Marker) : self.timeline.set_duration(1000) self.timeline.set_loop(True) - self.alpha = clutter.Alpha() - self.alpha.set_timeline(self.timeline) - self.alpha.set_func(clutter.sine_inc_func) + self.alpha = clutter.Alpha(self.timeline, clutter.EASE_OUT_SINE) #The "growing" behaviour self.grow_behaviour = clutter.BehaviourScale(0.5, 0.5, 2.0, 2.0) diff --git a/bindings/python/demos/launcher-gtk.py b/bindings/python/demos/launcher-gtk.py index 019f5c2..091ed4f 100755 --- a/bindings/python/demos/launcher-gtk.py +++ b/bindings/python/demos/launcher-gtk.py @@ -6,7 +6,8 @@ import gobject import gtk import champlain import champlaingtk -from demomarkers import DemoMarkerLayer + +from markers import create_marker_layer class LauncherGTK: @@ -22,7 +23,7 @@ class LauncherGTK: self.view = champlain.View() self.view.set_property("scroll-mode", champlain.SCROLL_MODE_KINETIC) - self.layer = DemoMarkerLayer() + self.layer = create_marker_layer(self.view) self.view.add_layer(self.layer) embed = cluttergtk.Embed() @@ -82,9 +83,11 @@ class LauncherGTK: def toggle_layer(self, widget): if widget.get_active(): - self.layer.show_all() + self.layer.animate_in_all_markers() + #self.layer.show_all() else: - self.layer.hide() + self.layer.animate_out_all_markers() + #self.layer.hide() def zoom_changed(self, widget): self.view.set_property("zoom-level", self.spinbutton.get_value_as_int()) diff --git a/bindings/python/demos/launcher.py b/bindings/python/demos/launcher.py index 8c82a3a..cb6b812 100644 --- a/bindings/python/demos/launcher.py +++ b/bindings/python/demos/launcher.py @@ -27,12 +27,12 @@ def zoom_out(actor, event, view): def make_button(text): button = clutter.Group() button_bg = clutter.Rectangle() - button_bg.set_color(clutter.color_parse('white')) + button_bg.set_color(clutter.color_from_string('white')) button_bg.set_opacity(0xcc) button.add(button_bg) - button_text = clutter.label_new_full('Sans 10', text, \ - clutter.color_parse('black')) + button_text = clutter.Text('Sans 10', text, \ + clutter.color_from_string('black')) button.add(button_text) width, height = button_text.get_size() diff --git a/bindings/python/demos/polygons.py b/bindings/python/demos/polygons.py index 5677629..b2f5a76 100644 --- a/bindings/python/demos/polygons.py +++ b/bindings/python/demos/polygons.py @@ -23,12 +23,12 @@ def zoom_out(actor, event, view): def make_button(text): button = clutter.Group() button_bg = clutter.Rectangle() - button_bg.set_color(clutter.color_parse('white')) + button_bg.set_color(clutter.color_from_string('white')) button_bg.set_opacity(0xcc) button.add(button_bg) - button_text = clutter.label_new_full('Sans 10', text, \ - clutter.color_parse('black')) + button_text = clutter.Text('Sans 10', text, \ + clutter.color_from_string('black')) button.add(button_text) width, height = button_text.get_size() -- 2.39.5