コード例 #1
0
    def __init__(self, menuitem, font=None, enable_arrow=False):
        surface.Surface.__init__(self, menuitem.get_short_name())
        self._appli = common.get_application()
        self._focus = False
        self._menuitem = menuitem
        self._enable_arrow = enable_arrow
        self._appli.get_menu_renderer().add_menuitem_surface(menuitem, self)

        if enable_arrow == True:
            self._arrow_surface = surface.Surface(
                self._menuitem.get_short_name() + str(' arrow'))
            self._arrow_surface.set_back_color(255, 255, 255)
            self._arrow_surface.set_location(14, 128, 2.3)
            self._arrow_surface.set_size(100, 20)
            self._arrow_surface.set_background_from_file(
                "elisa/skins/default_skin/pictures/downarrow.png")
            #self._arrow_surface.get_texture().set_aspect_ratio(False)
            self.add_surface(self._arrow_surface)
        else:
            self._arrow_surface = None

        self._font = font
        self.set_focus(False)

        if self._appli.get_player_manager().uri_is_attached(
                menuitem.get_target_path()) == True:
            #Movie is playing
            p = self._appli.get_player_manager().get_player(
                menuitem.get_target_path())
            self.set_texture(p.get_texture())
        else:
            self.set_background_from_file(menuitem.get_icon_path())
コード例 #2
0
ファイル: plugin.py プロジェクト: BackupTheBerlios/elisa-svn
 def _get_cached_extensions(self):
     if not hasattr(self, '_matched_extensions'):
         appli = common.get_application()
         self._matched_extensions = []
         for entry_point_name, plugins in appli.get_plugins().iteritems():
             for plugin in plugins:
                 if plugin.implements(self.interface):
                     self._matched_extensions.append(plugin)
     return self._matched_extensions
コード例 #3
0
ファイル: plugin.py プロジェクト: BackupTheBerlios/elisa-svn
 def _get_cached_extensions(self):
     if not hasattr(self, '_matched_extensions'):
         appli = common.get_application()
         self._matched_extensions = []
         for entry_point_name, plugins in appli.get_plugins().iteritems():
             for plugin in plugins:
                 if plugin.implements(self.interface):
                     self._matched_extensions.append(plugin)
     return self._matched_extensions
コード例 #4
0
    def __init__(self, root_menuitem_list, name):
        surface.Surface.__init__(self, name)

        self._appli = common.get_application()
        self._drawing_next_level = False
        self._drawing_previous_level = False
        self._level_to_draw = None
        self.set_alpha_level(0)
        self.set_size(500, 100)
        
        self._treelevel_surface_list = []
        _root_treelevel_surface = treelevel.TreeLevel(root_menuitem_list, "treelevel rank 0")
        self._treelevel_surface_list.append(_root_treelevel_surface)
        self._current_level_id = 0
        self.draw_level(_root_treelevel_surface)
        self._y_init = 0
        self.add_surface(_root_treelevel_surface)
        self.set_initial_location(105.0, 450.0, 2.0)
コード例 #5
0
    def __init__(self, root_menuitem_list, name):
        surface.Surface.__init__(self, name)

        self._appli = common.get_application()
        self._drawing_next_level = False
        self._drawing_previous_level = False
        self._level_to_draw = None
        self.set_alpha_level(0)
        self.set_size(500, 100)

        self._treelevel_surface_list = []
        _root_treelevel_surface = treelevel.TreeLevel(root_menuitem_list,
                                                      "treelevel rank 0")
        self._treelevel_surface_list.append(_root_treelevel_surface)
        self._current_level_id = 0
        self.draw_level(_root_treelevel_surface)
        self._y_init = 0
        self.add_surface(_root_treelevel_surface)
        self.set_initial_location(105.0, 450.0, 2.0)
コード例 #6
0
ファイル: surface.py プロジェクト: BackupTheBerlios/elisa-svn
 def __init__(self, name='Surface'):
     self._logger = Logger()
     self._name=name
     self._logger.debug('Surface.__init__()', self)
     self._message_bus = MessageBus()
     self._message_bus.register(self, self.on_message)
     self._surface_impl = testgl_impl._testGL_Surface_Impl()
     self._surface_list = []
     self._parentsurface = None
     self._x = 0
     self._y = 0
     self._z = 0
     self._width = 100
     self._height = 100
     self._alphalevel = 100
     self._background_image_path = None
     self._window = None
     self._visible = True
     self._visible_r = True
     self._background_is_movie = False
     self._texture = None
     self._appli = common.get_application()
     
     self._surface_impl.set_size(self._width, self._height)
コード例 #7
0
ファイル: surface.py プロジェクト: BackupTheBerlios/elisa-svn
    def __init__(self, name='Surface'):
        self._logger = Logger()
        self._name = name
        self._logger.debug('Surface.__init__()', self)
        self._message_bus = MessageBus()
        self._message_bus.register(self, self.on_message)
        self._surface_impl = testgl_impl._testGL_Surface_Impl()
        self._surface_list = []
        self._parentsurface = None
        self._x = 0
        self._y = 0
        self._z = 0
        self._width = 100
        self._height = 100
        self._alphalevel = 100
        self._background_image_path = None
        self._window = None
        self._visible = True
        self._visible_r = True
        self._background_is_movie = False
        self._texture = None
        self._appli = common.get_application()

        self._surface_impl.set_size(self._width, self._height)
コード例 #8
0
 def fullscreen(self):
     application = common.get_application()
     application.set_background_texture(self.get_texture())
コード例 #9
0
 def fullscreen(self):
     application = common.get_application()
     application.set_background_texture(self.get_texture())
コード例 #10
0
    def __init__(self, menuitem_list, name="TreeLevel"):
        surface.Surface.__init__(self, name)

        self._menuitem_list = menuitem_list
        self._appli = common.get_application()

        #list composed of sublist [item,surface]
        #rank are the same as visual rank
        self._surface_items = []
        self.set_alpha_level(0)
        self._current_rank = 0
        self._back_image = surface.Surface('treelevel backimage')
        self._back_image.set_background_from_file(
            "extern/testGL/themes/mce/COMMON.BUTTON.LEFT.FOCUS.PNG")
        #self._back_image.get_texture().set_aspect_ratio(False)
        self._back_image.set_size(550, 40)
        self._back_image.set_location(20, 30, 2.1)
        self.add_surface(self._back_image)

        self._surface_items = []
        self.set_alpha_level(0)
        self._current_rank = 0
        self._items_surface = surface.Surface('group items surface')
        self._items_surface.set_alpha_level(0)
        self._items_surface.set_location(0, 0, 0.01)
        self.add_surface(self._items_surface)

        #self._left_arrow_surface = surface.Surface('treelevel left arrow')
        #self._left_arrow_surface.set_back_color(255,255,255)
        #self._left_arrow_surface.set_location(-20, 0, 2.3)
        #self._left_arrow_surface.set_size(20,100)
        #self._left_arrow_surface.set_background_from_file("elisa/skins/default_skin/default_pictures/leftarrow.png")
        #self.add_surface(self._left_arrow_surface)

        #self._right_arrow_surface = surface.Surface('treelevel right arrow')
        #self._right_arrow_surface.set_back_color(255,255,255)
        #self._right_arrow_surface.set_location(600, 0, 2.3)
        #self._right_arrow_surface.set_size(20,100)
        #self._right_arrow_surface.set_background_from_file("elisa/skins/default_skin/default_pictures/rightarrow.png")
        #self.add_surface(self._right_arrow_surface)

        self._font = fontsurface.FontSurface('treelevel font')
        self._font.set_font_size(36)
        self._font.hide()

        self._move_items_offset = 0
        self._fist_item = 0

        _i = 10
        for item in self._menuitem_list:
            s = treeitem.TreeItem(item, self._font, True)
            s.set_size(128, 128)
            s.set_location(_i, -12, 2.2)
            _i += 150
            self._items_surface.add_surface(s)
            self._surface_items.append(s)
            self._current_rank = 0

        if self._surface_items != []:
            current_itemsurface = self._surface_items[self._current_rank]
            current_itemdata = current_itemsurface.get_menuitem()
            current_itemsurface.set_focus(True)
コード例 #11
0
    def __init__(self, menuitem_list, name="TreeLevel"):
        surface.Surface.__init__(self, name)
            
        self._menuitem_list = menuitem_list
        self._appli = common.get_application()
        
        #list composed of sublist [item,surface]
        #rank are the same as visual rank
        self._surface_items = []
        self.set_alpha_level(0)
        self._current_rank = 0
        self._back_image = surface.Surface('treelevel backimage')
        self._back_image.set_background_from_file("extern/testGL/themes/mce/COMMON.BUTTON.LEFT.FOCUS.PNG")
        #self._back_image.get_texture().set_aspect_ratio(False)
        self._back_image.set_size(550,40)
        self._back_image.set_location(20,30,2.1)
        self.add_surface(self._back_image)
        
        self._surface_items = []
        self.set_alpha_level(0)
        self._current_rank = 0
        self._items_surface = surface.Surface('group items surface')
        self._items_surface.set_alpha_level(0)
        self._items_surface.set_location(0,0,0.01)
        self.add_surface(self._items_surface)
        
        #self._left_arrow_surface = surface.Surface('treelevel left arrow')
        #self._left_arrow_surface.set_back_color(255,255,255)
        #self._left_arrow_surface.set_location(-20, 0, 2.3)
        #self._left_arrow_surface.set_size(20,100)
        #self._left_arrow_surface.set_background_from_file("elisa/skins/default_skin/default_pictures/leftarrow.png")
        #self.add_surface(self._left_arrow_surface)
        
        #self._right_arrow_surface = surface.Surface('treelevel right arrow')
        #self._right_arrow_surface.set_back_color(255,255,255)
        #self._right_arrow_surface.set_location(600, 0, 2.3)
        #self._right_arrow_surface.set_size(20,100)
        #self._right_arrow_surface.set_background_from_file("elisa/skins/default_skin/default_pictures/rightarrow.png")
        #self.add_surface(self._right_arrow_surface)
        
        self._font = fontsurface.FontSurface('treelevel font')
        self._font.set_font_size(36)
        self._font.hide()
        
        self._move_items_offset = 0
        self._fist_item = 0
        
        _i = 10
        for item in self._menuitem_list:
            s = treeitem.TreeItem(item, self._font, True)
            s.set_size(128, 128)
            s.set_location(_i, -12, 2.2)
            _i += 150
            self._items_surface.add_surface(s)
            self._surface_items.append(s)
            self._current_rank = 0

        if self._surface_items != []:
            current_itemsurface = self._surface_items[self._current_rank]
            current_itemdata = current_itemsurface.get_menuitem()
            current_itemsurface.set_focus(True)