def __init__(self): """ init the skin engine """ global skin_engine skin_engine = self self.display_style = { 'menu' : 0 } self.force_redraw = True self.last_draw = None, None, None self.screen = screen.get_singleton() self.areas = {} self.suspended = False self.transitioning = False self.current_screen= None self.next_screen = None self.timer = None # load default areas from listing_area import Listing_Area from tvlisting_area import TVListing_Area from view_area import View_Area from info_area import Info_Area from default_areas import Screen_Area, Title_Area, Subtitle_Area, Plugin_Area from scrollabletext_area import Scrollabletext_Area from textentry_area import Textentry_Area from buttongroup_area import Buttongroup_Area for a in ('screen', 'title', 'subtitle', 'view', 'listing', 'info', 'plugin', 'scrollabletext', 'textentry', 'buttongroup'): self.areas[a] = eval('%s_Area()' % a.capitalize()) self.areas['tvlisting'] = TVListing_Area() self.storage_file = os.path.join(config.FREEVO_CACHEDIR, 'skin-%s' % os.getuid()) self.storage = util.read_pickle(self.storage_file) if self.storage: if not config.SKIN_XML_FILE: config.SKIN_XML_FILE = self.storage['SKIN_XML_FILE'] else: logger.log( 9, 'skin forced to %s', config.SKIN_XML_FILE) else: if not config.SKIN_XML_FILE: config.SKIN_XML_FILE = config.SKIN_DEFAULT_XML_FILE self.storage = {} # load the fxd file self.settings = xml_skin.XMLSkin() self.set_base_fxd(config.SKIN_XML_FILE) if config.SKIN_SCREEN_TRANSITION == 'blend': self.do_transition = self.do_blend_transition elif config.SKIN_SCREEN_TRANSITION == 'slide': self.do_transition = self.do_slide_transition else: print 'WARNING: Unknown screen transition, disabling transitions' config.SKIN_USE_SCREEN_TRANSITIONS = False config.SKIN_USE_PAGE_TRANSITIONS = False
def __init__(self, name, imagecachesize=5): self.area_name = name self.area_val = None self.redraw = True self.layout = None self.name = name self.screen = screen.get_singleton() self.objects = SkinObjects() self.imagecache = util.objectcache.ObjectCache(imagecachesize, desc='%s_image' % self.name)
def __init__(self): """ init the skin engine """ global skin_engine skin_engine = self self.display_style = {'menu': 0} self.force_redraw = True self.last_draw = None, None, None self.screen = screen.get_singleton() self.areas = {} # load default areas from listing_area import Listing_Area from tvlisting_area import TVListing_Area from view_area import View_Area from info_area import Info_Area from default_areas import Screen_Area, Title_Area, Subtitle_Area, Plugin_Area from scrollabletext_area import Scrollabletext_Area from textentry_area import Textentry_Area from buttongroup_area import Buttongroup_Area for a in ('screen', 'title', 'subtitle', 'view', 'listing', 'info', 'plugin', 'scrollabletext', 'textentry', 'buttongroup'): self.areas[a] = eval('%s_Area()' % a.capitalize()) self.areas['tvlisting'] = TVListing_Area() self.storage_file = os.path.join(config.FREEVO_CACHEDIR, 'skin-%s' % os.getuid()) self.storage = util.read_pickle(self.storage_file) if self.storage: if not config.SKIN_XML_FILE: config.SKIN_XML_FILE = self.storage['SKIN_XML_FILE'] else: _debug_('skin forced to %s' % config.SKIN_XML_FILE, 2) else: if not config.SKIN_XML_FILE: config.SKIN_XML_FILE = config.SKIN_DEFAULT_XML_FILE self.storage = {} # load the fxd file self.settings = xml_skin.XMLSkin() self.set_base_fxd(config.SKIN_XML_FILE)