コード例 #1
0
ファイル: clutter_feedreader.py プロジェクト: uncia/tools-1
    def __init__(self):
        self.feed = feedparser.parse(
            'http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml')
        self.img, self.data = urllib.urlretrieve(self.feed.feed.image.href)
        self.stage = clutter.Stage()
        self.ident = clutter.texture_new_from_file(self.img)
        self.head = clutter.Text()
        self.body = clutter.Text()
        self.entry = 0
        #initialize elements of the display group
        self.head.set_position(130, 5)
        self.head.set_color(blue)
        self.body = clutter.Text()
        self.body.set_max_length(70)
        self.body.set_position(130, 22)
        self.body.set_size(250, 100)
        self.body.set_line_wrap(True)

        #get first feeed entry for text elements
        self.setfeed()
        #create group to hold elements
        self.group = clutter.Group()
        self.group.add(self.ident, self.head, self.body)
        self.group.show_all()
        #set up stage
        self.stage.set_size(400, 60)
        self.stage.set_color(white)
        self.stage.show_all()
        self.stage.add(self.group)
        self.stage.connect('key-press-event', self.parseKeyPress)
        clutter.main()
コード例 #2
0
    def __init__(self, media_player, move_to_new_screen_callback):
        Screen.__init__(self, 'Main', move_to_new_screen_callback)

        self.media_player = media_player
        self.media_player.connect("stop", self.update)
        self.media_player.connect("play", self.update)
        self.media_player.connect('refresh', self._update_preview_title)

        self.theme = self.config.theme

        self._preview_title = None
        self.preview = clutter.Group() # Group that contains preview actors
        self.preview.set_position(self.get_abs_x(0.07), self.get_abs_y(0.1))
        self.preview.show()
        self.preview.set_opacity(0x00)
        self.add(self.preview)

        self.menu = self._create_main_menu()
        self.add(self.menu)

        self._update_preview_area()

        self.add(ClockLabel(0.13, "screentitle", 0, 0.87))

        self.menu.connect('selected', self._handle_select)
        self.menu.connect('moved', self._on_menu_moved)

        self.menu.active = True
コード例 #3
0
    def _create_album_preview(self, album):
        """
        Create a clutter.Group that contains album preview actors.
        """
        group = clutter.Group()
        group.set_position(self.get_abs_x(0.07), self.get_abs_y(0.1953))

        # Preview images
        images = album.get_preview_images(3)
        self.preview_textures = []

        max_w = 0.4026
        max_h = 0.5599
        abs_max_w = self.get_abs_x(max_w)
        abs_max_h = self.get_abs_y(max_h)

        for image in images:
            pix_buffer = gtk.gdk.pixbuf_new_from_file(
                image.get_thumbnail_url())
            ratio = float(pix_buffer.get_width())
            ratio /= float(pix_buffer.get_height())

            # Resize and center preview texture
            if ratio > 1:
                texture = EyeCandyTexture(0.0, 0.0, max_w, max_h / ratio,
                                          pix_buffer)
                new_y = int((abs_max_h - abs_max_h / ratio) / 2.0)
                texture.set_position(0, new_y)
            else:
                texture = EyeCandyTexture(0.0, 0.0, max_w * ratio, max_h,
                                          pix_buffer)
                new_x = int((abs_max_w - abs_max_w * ratio) / 2.0)
                texture.set_position(new_x, 0)

            texture.set_rotation(clutter.Y_AXIS, 25, 0, 0, 0)
            texture.set_opacity(0)

            self.preview_textures.append(texture)
            group.add(texture)
        self.preview_textures[0].set_opacity(255)

        title = Label(0.03646,
                      "title",
                      0.4649,
                      0,
                      album.get_title(),
                      font_weight="bold")
        title.width = 0.4758
        title.set_ellipsize(pango.ELLIPSIZE_END)
        group.add(title)

        desc = Label(0.026, "subtitle", 0.4649, 0.0521,
                     album.get_description())
        desc.width = 0.4758
        group.add(desc)

        return group
コード例 #4
0
ファイル: buttons.py プロジェクト: disciple961/mieru
 def __init__(self, mieru, gui):
     self.mieru = mieru
     self.gui = gui
     self.layer = clutter.Group()
     self.gui.getStage().add(self.layer)
     self.pressLength = 175  # in ms, higher than this and it will be considered to a drag
     self.fsButton = None
     self.fsButtonActive = False
     self.fsButtonLastPressTimestamp = None
     self._addButtons()
     self.gui.getStage().connect('allocation-changed', self._handleResize)
コード例 #5
0
    def _create_playing_preview(self):
        '''Create the Now Playing preview sidebar.'''
        preview = clutter.Group()

        # Video preview of current media
        video_texture = self.media_player.get_texture()
        if video_texture == None:
            video_texture = Texture(self.theme.getImage("default_album_art"))
        width, height = video_texture.get_size()
        x_ratio = (self.PREVIEW_WIDTH - 50) / float(width)
        y_ratio = (self.PREVIEW_HEIGHT - 50) / float(height)

        if x_ratio > y_ratio:
            video_texture.set_scale((self.PREVIEW_HEIGHT - 50) / float(height),
                                    (self.PREVIEW_HEIGHT - 50) / float(height))
            new_width = int(width * \
                ((self.PREVIEW_HEIGHT - 50) / float(height)))
            new_x = int(((self.PREVIEW_WIDTH - 50) - new_width) / 2.0)
            video_texture.set_position(int(new_x), 0)
            # Below are size and position calculations for border rectangle
            rect_x = new_x -3
            rect_y = -3
            new_width = (self.PREVIEW_HEIGHT - 50) / float(height) * width
            new_height = (self.PREVIEW_HEIGHT - 50) / float(height) * height
        else:
            video_texture.set_scale((self.PREVIEW_WIDTH - 50) / float(width),
                                    (self.PREVIEW_WIDTH - 50) / float(width))
            new_height = int(height * \
                ((self.PREVIEW_WIDTH - 50) / float(width)))
            new_y = int(((self.PREVIEW_HEIGHT - 50) - new_height) / 2.0)
            video_texture.set_position(0, int(new_y))
            rect_x = -3
            rect_y = new_y -3
            # Below are size and position calculations for border rectangle
            new_width = (self.PREVIEW_WIDTH - 50) / float(width) * width
            new_height = (self.PREVIEW_WIDTH - 50) / float(width) * height

        # Video frame
        rect = clutter.Rectangle()
        rect.set_size(int(new_width + 6), int(new_height + 6))
        rect.set_position(rect_x, rect_y)
        rect.set_color((128, 128, 128, 192))
        preview.add(rect)

        preview.add(video_texture)

        self._preview_title = Label(0.03, "text", 0.03, 0.74, "")
        preview.add(self._preview_title)

        return preview
コード例 #6
0
ファイル: scroll_area.py プロジェクト: tiwilliam/entertainer
    def __init__(self, x, y, width, height, content):
        Base.__init__(self)
        clutter.Group.__init__(self)

        self._motion_buffer = MotionBuffer()
        self._offset = 0  # Drives the content motion.
        self._offset_max = 0  # Maximum value of offset (equal on bottom).
        self._old_offset = 0  # Stores the old value of offset on motions.
        self._motion_handler = 0
        self._active = None

        self.step_size = self.get_abs_y(self.STEP_SIZE_PERCENT)

        # Allowed area for the widget's scrolling content.
        self.area_width = self.get_abs_x(width)
        self.area_height = self.get_abs_y(height)

        # Create content position indicator
        self.indicator = ListIndicator(3 * width / 4, height, 0.2, 0.045,
                                       ListIndicator.VERTICAL)
        self.indicator.hide_position()
        self.indicator.set_maximum(2)
        self.add(self.indicator)

        # A clipped Group to receive the content.
        self._fixed_group = clutter.Group()
        self._fixed_group.set_clip(0, 0, self.area_width, self.area_height)
        self.add(self._fixed_group)
        self.content = None

        self._motion_timeline = clutter.Timeline(500)
        self._motion_timeline.connect('completed',
                                      self._motion_timeline_callback, None)
        self._motion_alpha = clutter.Alpha(self._motion_timeline,
                                           clutter.EASE_OUT_SINE)
        self._motion_behaviour = LoopedPathBehaviour(self._motion_alpha)

        self.set_content(content)

        self.active = None

        # Preparation to pointer events handling.
        self.set_reactive(True)
        self.connect('button-press-event', self._on_button_press_event)
        self.connect('button-release-event', self._on_button_release_event)
        self.connect('scroll-event', self._on_scroll_event)

        self.set_position(self.get_abs_x(x), self.get_abs_y(y))
コード例 #7
0
    def __init__(self, mieru, type, size):
        gtk_gui.GTKGUI.__init__(self, mieru, type, size)

        # get the Clutter embed and add it to the window
        self.embed = cluttergtk.Embed()
        self.vbox.pack_start(self.embed)
        self.vbox.show_all()

        # we need to realize the widget before we get the stage
        self.embed.realize()
        self.embed.show()
        self.embed.connect('key-press-event', self._onKeyPressEvent)

        # get the stage
        self.stage = self.embed.get_stage()
        self.stage.connect('allocation-changed', self._handleResize)
        self.stage.realize()
        self.stage.set_color("White")

        # activate clutter based buttons
        self.buttons = buttons.ClutterButtons(self.mieru, self)

        # create the manga layer
        self.mangaLayer = clutter.Group()
        # stick it under the button layer
        self.stage.add(self.mangaLayer)
        self.stage.lower_child(self.mangaLayer, self.buttons.getLayer())

        # This packs the button into the window (a GTK container).
        self.embed.show()

        # setup page turning
        self._setupPageTurning()
        self.activePage = None

        # page preview
        self.previewBox = None
        self.previewBoxStartingPoint = (0, 0)

        # and show the window
        self.window.show_all()
コード例 #8
0
    def showPreview(self, thumbnail, type, pressedAction=None):
        if self.previewBox:  # replace previous preview
            self.hidePreview()

        (pBoxY, pBoxX, pBoxShownX, pBoxSide, pBoxInSide,
         border) = self._getPBoxCoords(type)
        # 50% transparent yellow TODO: take this from current OS theme ?
        backgroundColor = clutter.color_from_string("yellow")
        backgroundColor.alpha = 128
        background = clutter.Rectangle(color=backgroundColor)
        background.set_size(pBoxSide, pBoxSide)
        background.set_reactive(True)
        background.connect('button-release-event', self._previewPressedCB,
                           pressedAction)

        # resize and fit in the thumbnail
        thumbnail.set_keep_aspect_ratio(True)
        (tw, th) = thumbnail.get_size()
        wf = float(pBoxInSide) / tw
        hf = float(pBoxInSide) / th
        if tw >= th:
            thumbnail.set_size(tw * wf, th * wf)
        else:
            thumbnail.set_size(tw * hf, th * hf)
        (tw, th) = thumbnail.get_size()
        print(tw, th)
        thumbnail.move_by(border + (pBoxInSide - tw) / 2.0,
                          border + (pBoxInSide - th) / 2.0)

        # create a container for the thumbnail and background
        box = clutter.Group()
        box.add(background)
        box.add(thumbnail)
        # TODO: preview layer above the buttons layer ?
        self.buttons.getLayer().add(box)
        box.show()
        box.set_position(pBoxX, pBoxY)
        self.previewBoxStartingPoint = (pBoxX, pBoxY)
        box.animate(clutter.LINEAR, 300, "x", pBoxShownX)
        self.previewBox = box
コード例 #9
0
ファイル: reflection.py プロジェクト: muizmusaddik/pyclutter
def main(args):
    stage = clutter.Stage()
    stage.set_color(clutter.Color(0, 0, 0, 255))
    stage.set_title('TextureReflection')
    stage.connect('button-press-event', clutter.main_quit)
    stage.connect('destroy', clutter.main_quit)

    group = clutter.Group()
    stage.add(group)

    try:
        tex = clutter.Texture(filename=args[0])
    except Exception:
        print "Unable to load the texture file"
        return 1

    reflect = TextureReflection(tex)
    reflect.set_opacity(100)

    x_pos = float((stage.get_width() - tex.get_width()) / 2)

    group.add(tex, reflect)
    group.set_position(x_pos, 20.0)
    reflect.set_position(0.0, (tex.get_height() + 20))

    timeline = clutter.Timeline(duration=3000)
    timeline.set_loop(True)
    alpha = clutter.Alpha(timeline, clutter.LINEAR)
    behaviour = clutter.BehaviourRotate(clutter.Y_AXIS, 0.0, 360.0, alpha,
                                        clutter.ROTATE_CW)
    behaviour.set_center(int(group.get_width() / 2), 0, 0)
    behaviour.apply(group)

    stage.show()

    timeline.start()

    clutter.main()

    return 0
コード例 #10
0
ファイル: main.py プロジェクト: yucefsourani/clutter-tutorial
def main():
    stage_color = clutter.Color(0, 0, 0, 255)
    actor_color = clutter.Color(255, 255, 255, 153)

    # Get the stage and set its size and color
    stage = clutter.Stage()
    stage.set_size(200, 200)
    stage.set_color(stage_color)

    # Add a group to the stage
    group = clutter.Group()
    group.set_position(40, 40)
    stage.add(group)
    group.show()

    # Add a rectangle to the group
    rect = clutter.Rectangle(actor_color)
    rect.set_size(50, 50)
    rect.set_position(0, 0)
    group.add(rect)
    rect.show()

    # Add a label to the group
    label = clutter.Text("Sans 9", "Some Text", actor_color)
    label.set_position(0, 60)
    group.add(label)
    label.show()

    # Scale the group 120% along the x axis
    group.set_scale(3.0, 1.0)

    # Rotate it around the z axis
    group.set_rotation(clutter.Z_AXIS, 10, 0, 0, 0)

    # Show the stage
    stage.connect("destroy", clutter.main_quit)
    stage.show_all()

    # Start the main loop, so we can respond to events
    clutter.main()
コード例 #11
0
    def __init__(self, image_library, move_to_new_screen_callback):
        Screen.__init__(self, 'PhotoAlbums', move_to_new_screen_callback)

        self.theme = self.config.theme
        self.image_library = image_library
        self.timeout = None  # Timeout key (this is used when scrolling menu)

        # Screen Title (Displayed at the bottom left corner)
        screen_title = Label(0.13, "screentitle", 0, 0.87, _("Photographs"))
        self.add(screen_title)

        if self.image_library.get_number_of_albums() == 0:
            self._create_no_photos_information()
        else:
            # Album preview group
            self.preview = clutter.Group()
            self.preview.set_position(self.get_abs_x(0.07),
                                      self.get_abs_y(0.1953))
            self.preview.show()
            self.add(self.preview)

            self.preview_fade = None
            self.menu = None
            self.in_behaviour = None
            self.out_behaviour = None
            self.in_opacity = None
            self.out_opacity = None
            self.preview_textures = None
            self.menu = self._create_album_menu()
            self.add(self.menu)
            self.li = None
            self._create_list_indicator()

            self._update_album_preview(self.menu.selected_userdata)

            self.menu.connect('selected', self._handle_select)
            self.menu.connect('moved', self._display_selected_album)
コード例 #12
0
    def __init__(self, x=0, y=0, item_width=0.2, item_height=0.1):
        Base.__init__(self)
        clutter.Group.__init__(self)

        self.motion_duration = 100  # Default duration of animations ms.
        self.cursor_below = True  # Is the cursor below items?
        self._active = None
        self._is_vertical = True
        self.items = []

        # Items dimensions variable: relative, absolute, center
        self._item_width = item_width
        self._item_height = item_height
        self._item_width_abs = self.get_abs_x(item_width)
        self._item_height_abs = self.get_abs_y(item_height)
        self._dx = int(self._item_width_abs / 2)
        self._dy = int(self._item_height_abs / 2)

        # Default cursor's index.
        self._selected_index = 0

        # Grid dimensions: real, visible.
        self.items_per_row = 10
        self.items_per_col = 10
        self._visible_rows = 3
        self._visible_cols = 5

        # The moving_group is a Clutter group containing all the items.
        self._moving_group_x = 0
        self._moving_group_y = 0
        self._moving_group = clutter.Group()
        self.add(self._moving_group)

        # The moving_group is translated using a `BehaviourPath`.
        self._moving_group_timeline = clutter.Timeline(200)
        moving_group_alpha = clutter.Alpha(self._moving_group_timeline,
                                           clutter.EASE_IN_OUT_SINE)
        moving_group_path = clutter.Path()
        self._moving_group_behaviour = clutter.BehaviourPath(
            moving_group_alpha, moving_group_path)
        self._moving_group_behaviour.apply(self._moving_group)

        # The cursor is an Actor that can be added and moved on the menu.
        # The cusor is always located in the visible (clipped) area of the menu.
        self._cursor_x = 0
        self._cursor_y = 0
        self._cursor = None
        self._cursor_timeline = clutter.Timeline(200)
        cursor_alpha = clutter.Alpha(self._cursor_timeline,
                                     clutter.EASE_IN_SINE)
        cursor_path = clutter.Path()
        self._cursor_behaviour = clutter.BehaviourPath(cursor_alpha,
                                                       cursor_path)

        # A MotionBuffer is used to compute useful information about the
        # cursor's motion. It's used when moving the cursor with a pointer.
        self._motion_buffer = MotionBuffer()
        self._event_mode = self.MODE_NONE
        self._motion_handler = 0
        self._seek_step_x = 0
        self._seek_step_y = 0
        gobject.timeout_add(200, self._internal_timer_callback)

        #XXX: Samuel Buffet
        # This rectangle is used to grab events as it turns out that their
        # might be a bug in clutter 0.8 or python-clutter 0.8.
        # It may be avoided with next release of clutter.
        self._event_rect = clutter.Rectangle()
        self._event_rect.set_opacity(0)
        self.add(self._event_rect)
        self._event_rect.set_reactive(True)
        self._event_rect.connect('button-press-event',
                                 self._on_button_press_event)
        self._event_rect.connect('button-release-event',
                                 self._on_button_release_event)
        self._event_rect.connect('scroll-event', self._on_scroll_event)

        self.set_position(self.get_abs_x(x), self.get_abs_y(y))
コード例 #13
0
    def __init__(self):
        if len(sys.argv) != 2:  #TODO: move to ... or remove
            raise SystemExit("Usage: python main.py <image file>")

        # Create a new window
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)

        self.window.connect("delete-event", self.delete_event)
        self.window.connect("destroy", self.destroy)

        # Sets the border width of the window.
        self.window.set_title('BNF Viewer')
        self.window.set_border_width(10)
        #self.window.set_size_request(200,100)
        self.window.set_default_size(640, 400)

        self.vbox = gtk.VBox()  #False, 0
        #self.box1.pack_start(self.button1, True, True, 0)

        self.toolbar = gtk.Toolbar()
        self.toolbar.set_style(gtk.TOOLBAR_TEXT)

        self.toolbar.append_item('Rules', 'Show Rules', 'private text', None,
                                 self.on_button_clicked)
        self.toolbar.append_space()

        self.vbox.add(self.toolbar)

        self.table = gtk.Table(2, 2, False)

        self.clutter_widget = cluttergtk.Embed()
        self.clutter_widget.set_size_request(200, 200)

        self.table.attach(self.clutter_widget, 0, 1, 0, 1,
                          gtk.EXPAND | gtk.FILL, gtk.EXPAND | gtk.FILL, 0, 0)

        self.vbox.add(
            self.table)  # pack_end(self.clutter_widget, True, True, 0)

        self.stage_color = clutter.Color(0, 0, 0, 255)  # Black
        self.actor_color = clutter.Color(255, 255, 255, 153)

        self.stage = self.clutter_widget.get_stage()
        self.stage.set_color(self.stage_color)
        self.stage.set_size(640, 480)

        # Create a viewport actor to be able to scroll actor. By passing NULL it
        # will create new GtkAdjustments
        self.viewport = cluttergtk.Viewport()
        self.stage.add(self.viewport)
        self.viewport.set_size(640, 480)

        # Load image from first command line argument and add it to viewport
        self.texture = clutter.Texture(sys.argv[1])
        self.viewport_group = clutter.Group()

        self.viewport_group.add(self.texture)
        self.viewport.add(self.viewport_group)

        self.texture.set_position(0, 0)

        # Create scrollbars and connect them to viewport
        self.h_adjustment, self.v_adjustment = self.viewport.get_adjustments()
        self.scrollbar = gtk.VScrollbar(self.v_adjustment)
        self.table.attach(self.scrollbar, 1, 2, 0, 1, 0, gtk.EXPAND | gtk.FILL,
                          0, 0)

        self.scrollbar = gtk.HScrollbar(self.h_adjustment)
        self.table.attach(self.scrollbar, 0, 1, 1, 2, gtk.EXPAND | gtk.FILL, 0,
                          0, 0)

        # Connect a signal handler to handle mouse clicks and key presses on the stage
        self.stage.connect("button-press-event", self.on_stage_button_pressed)

        # Add a group to the stage
        self.group = clutter.Group()
        self.group.set_position(40, 40)
        self.viewport_group.add(self.group)

        # Add a rectangle to the stage
        self.rect = clutter.Rectangle(self.actor_color)
        self.rect.set_size(100, 400)
        self.rect.set_position(20, 20)
        self.group.add(self.rect)
        #self.rect.show()

        # Add a label to the stage
        self.label = clutter.Text("Sans 12", "Some Text", self.actor_color)
        self.label.set_size(500, 500)
        self.label.set_position(20, 15)
        self.group.add(self.label)
        #label.show()

        # This packs the button into the window (which is a container).
        self.window.add(self.vbox)

        # Show the window and the button
        self.window.show_all()
コード例 #14
0
    def __init__(self, fullscreen=True):
        self.fullscreen = fullscreen
        self.transition = 'FADE'

        self.stage = clutter.Stage()
        if self.fullscreen == True:
            self.stage.set_fullscreen(True)
        else:
            self.stage.set_size(1200, 800)

        size = self.stage.get_size()
        print "%r" % (size,)

        display_width = size[0]*0.7
        display_height = size[1]*0.7

        self.stage.set_color(clutter.Color(0,0,0))
        if self.fullscreen == True:
            self.stage.connect('button-press-event', lambda x,y: reactor.stop())
        self.stage.connect('destroy', lambda x: reactor.stop())
        #self.stage.connect('key-press-event', self.process_key)

        self.texture_group = clutter.Group()
        self.stage.add(self.texture_group)

        self.texture_1 = clutter.Texture()
        self.texture_1.set_opacity(0)
        self.texture_1.set_keep_aspect_ratio(True)
        self.texture_1.set_size(display_width,display_height)
        self.texture_1.haz_image = False

        self.texture_2 = clutter.Texture()
        self.texture_2.set_opacity(0)
        self.texture_2.set_keep_aspect_ratio(True)
        self.texture_2.set_size(display_width,display_height)
        self.texture_2.haz_image = False

        self.texture_1.reflection = TextureReflection(self.texture_1)
        self.texture_1.reflection.set_reflection_height(display_height/3)
        self.texture_1.reflection.set_opacity(100)

        self.texture_2.reflection = TextureReflection(self.texture_2)
        self.texture_2.reflection.set_reflection_height(display_height/3)
        self.texture_2.reflection.set_opacity(0)

        x_pos = float((self.stage.get_width() - self.texture_1.get_width()) / 2)

        self.texture_group.add(self.texture_1, self.texture_1.reflection)
        self.texture_group.add(self.texture_2, self.texture_2.reflection)
        self.texture_group.set_position(x_pos, 20.0)
        self.texture_1.reflection.set_position(0.0, (self.texture_1.get_height() + 20))
        self.texture_2.reflection.set_position(0.0, (self.texture_2.get_height() + 20))

        def timeline_out_1_comleted(x):
            self.info("timeline_out_1_comleted")

        def timeline_out_2_comleted(x):
            self.info("timeline_out_2_comleted")

        def timeline_in_1_comleted(x):
            self.info("timeline_in_1_comleted")

        def timeline_in_2_comleted(x):
            self.info("timeline_in_2_comleted")

        self.texture_1.transition_fade_out_timeline = clutter.Timeline(2000)
        self.texture_1.transition_fade_out_timeline.connect('completed',timeline_out_1_comleted)
        alpha=clutter.Alpha(self.texture_1.transition_fade_out_timeline, clutter.EASE_OUT_SINE)
        self.fade_out_texture_behaviour_1 = clutter.BehaviourOpacity(alpha=alpha, opacity_start=255, opacity_end=0)
        self.fade_out_texture_behaviour_1.apply(self.texture_1)
        self.fade_out_reflection_behaviour_1 = clutter.BehaviourOpacity(alpha=alpha, opacity_start=100, opacity_end=0)
        self.fade_out_reflection_behaviour_1.apply(self.texture_1.reflection)
        self.texture_1.transition_fade_out_timeline.add_marker_at_time('out_nearly_finished', 500)

        self.texture_1.transition_fade_in_timeline = clutter.Timeline(2000)
        self.texture_1.transition_fade_in_timeline.connect('completed',timeline_in_1_comleted)
        alpha=clutter.Alpha(self.texture_1.transition_fade_in_timeline, clutter.EASE_OUT_SINE)
        self.fade_in_texture_behaviour_1 = clutter.BehaviourOpacity(alpha=alpha, opacity_start=0, opacity_end=255)
        self.fade_in_texture_behaviour_1.apply(self.texture_1)
        self.fade_in_reflection_behaviour_1 = clutter.BehaviourOpacity(alpha=alpha, opacity_start=0, opacity_end=100)
        self.fade_in_reflection_behaviour_1.apply(self.texture_1.reflection)

        self.texture_2.transition_fade_out_timeline = clutter.Timeline(2000)
        self.texture_2.transition_fade_out_timeline.connect('completed',timeline_out_2_comleted)
        alpha=clutter.Alpha(self.texture_2.transition_fade_out_timeline, clutter.EASE_OUT_SINE)
        self.fade_out_texture_behaviour_2 = clutter.BehaviourOpacity(alpha=alpha, opacity_start=255, opacity_end=0)
        self.fade_out_texture_behaviour_2.apply(self.texture_2)
        self.fade_out_reflection_behaviour_2 = clutter.BehaviourOpacity(alpha=alpha, opacity_start=100, opacity_end=0)
        self.fade_out_reflection_behaviour_2.apply(self.texture_2.reflection)
        self.texture_2.transition_fade_out_timeline.add_marker_at_time('out_nearly_finished', 500)

        self.texture_2.transition_fade_in_timeline = clutter.Timeline(2000)
        self.texture_2.transition_fade_in_timeline.connect('completed',timeline_in_2_comleted)
        alpha=clutter.Alpha(self.texture_2.transition_fade_in_timeline, clutter.EASE_OUT_SINE)
        self.fade_in_texture_behaviour_2 = clutter.BehaviourOpacity(alpha=alpha, opacity_start=0, opacity_end=255)
        self.fade_in_texture_behaviour_2.apply(self.texture_2)
        self.fade_in_reflection_behaviour_2 = clutter.BehaviourOpacity(alpha=alpha, opacity_start=0, opacity_end=100)
        self.fade_in_reflection_behaviour_2.apply(self.texture_2.reflection)

        self.texture_1.fading_score = clutter.Score()
        self.texture_1.fading_score.append(timeline=self.texture_2.transition_fade_out_timeline)
        self.texture_1.fading_score.append_at_marker(timeline=self.texture_1.transition_fade_in_timeline,parent=self.texture_2.transition_fade_out_timeline,marker_name='out_nearly_finished')
        def score_1_started(x):
            self.info("score_1_started")
        def score_1_completed(x):
            self.info("score_1_completed")
        self.texture_1.fading_score.connect('started', score_1_started)
        self.texture_1.fading_score.connect('completed', score_1_completed)

        self.texture_2.fading_score = clutter.Score()
        self.texture_2.fading_score.append(timeline=self.texture_1.transition_fade_out_timeline)
        self.texture_2.fading_score.append_at_marker(timeline=self.texture_2.transition_fade_in_timeline,parent=self.texture_1.transition_fade_out_timeline,marker_name='out_nearly_finished')
        def score_2_started(x):
            self.info("score_2_started")
        def score_2_completed(x):
            self.info("score_2_completed")
        self.texture_2.fading_score.connect('started', score_2_started)
        self.texture_2.fading_score.connect('completed', score_2_completed)

        self.in_texture = self.texture_1
        self.out_texture = self.texture_2
        self.stage.show()