import champlain
import clutter
-import cluttercairo
import cairo
import math
import gobject
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)
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)
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)
import gtk
import champlain
import champlaingtk
-from demomarkers import DemoMarkerLayer
+
+from markers import create_marker_layer
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()
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())
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()
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()