Update of /cvsroot/freevo/freevo/src/skins/main
In directory sc8-pr-cvs1:/tmp/cvs-serv6698/skins/main
Modified Files:
main.py area.py
Log Message:
make the skin blankscreen a real plugin area
Index: main.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/skins/main/main.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** main.py 31 Oct 2003 17:00:20 -0000 1.17
--- main.py 22 Nov 2003 12:02:11 -0000 1.18
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.18 2003/11/22 12:02:11 dischi
+ # make the skin blankscreen a real plugin area
+ #
# Revision 1.17 2003/10/31 17:00:20 dischi
# splashscreen for bsd
***************
*** 223,227 ****
skin_engine = None
! class BlankScreen:
"""
An area only with the background. This can be used by plugins to
--- 226,230 ----
skin_engine = None
! class BlankScreen(Skin_Area):
"""
An area only with the background. This can be used by plugins to
***************
*** 229,232 ****
--- 232,247 ----
skin setting except the background.
"""
+ class Rectange(xml_skin.XML_rectangle):
+ def __init__(self, color=None, bgcolor=None, size=None, radius = None):
+ xml_skin.XML_rectangle.__init__(self)
+ if not color == None:
+ self.color = color
+ if not bgcolor == None:
+ self.bgcolor = bgcolor
+ if not size == None:
+ self.size = size
+ if not radius == None:
+ self.radius = radius
+
def __init__(self):
"""
***************
*** 234,238 ****
"""
global skin_engine
! osd.clearscreen(color=osd.COL_BLACK)
if not skin_engine.settings.prepared:
skin_engine.settings.prepare()
--- 249,253 ----
"""
global skin_engine
! Skin_Area.__init__(self, name='blank', screen=skin_engine.screen)
if not skin_engine.settings.prepared:
skin_engine.settings.prepare()
***************
*** 241,250 ****
image = osd.loadbitmap(skin_engine.settings.images['background'])
image = pygame.transform.scale(image, (osd.width, osd.height))
- osd.drawbitmap(image, 0, 0)
! self.user_area_initialized = TRUE
! self.bg = osd.screen.convert()
def draw(self, x0, y0, x1, y1):
"""
--- 256,281 ----
image = osd.loadbitmap(skin_engine.settings.images['background'])
image = pygame.transform.scale(image, (osd.width, osd.height))
! self.allow_plugins = False
! self.bg = xml_skin.XML_image()
! self.bg.x = 0
! self.bg.y = 0
! self.bg.width = osd.width
! self.bg.height = osd.height
! self.bg.label = 'background'
! self.bg.image = image
!
! self.area_val = None
! self.area_name = 'blank'
! self.skin_engine = skin_engine
!
! # be aware of the idlebar
! if plugin.getbyname('idlebar'):
! self.has_idlebar = True
! else:
! self.has_idlebar = False
+
def draw(self, x0, y0, x1, y1):
"""
***************
*** 252,255 ****
--- 283,306 ----
"""
+ def init_vars(self, settings, display_type, widget_type):
+ self.area_val = xml_skin.XML_area(self.area_name)
+ self.area_val.visible = TRUE
+ self.area_val.r = (0, 0, osd.width, osd.height)
+ self.layout = 1
+ return 1
+
+
+ def update_content(self):
+ y0 = config.OVERSCAN_Y
+ if self.allow_plugins and self.has_idlebar:
+ y0 += 70
+ self.draw(config.OVERSCAN_X, y0, osd.width - config.OVERSCAN_X,
+ osd.height - config.OVERSCAN_Y)
+
+
+ def draw_background(self):
+ self.draw_image(self.bg.image, self.bg)
+
+
def refresh(self):
"""
***************
*** 258,265 ****
later to add something to it.
"""
! osd.screen.blit(self.bg, (0, 0))
! self.draw(config.OVERSCAN_X, config.OVERSCAN_Y, osd.width -
config.OVERSCAN_X,
! osd.height - config.OVERSCAN_Y)
! osd.update()
--- 309,313 ----
later to add something to it.
"""
! self.skin_engine.draw((self, self))
***************
*** 271,280 ****
def __init__(self):
BlankScreen.__init__(self)
- # reset skin engine prepared mode, maybe the idlebar will
- # be used and than some things will change
- skin_engine.settings.prepared = FALSE
self.initialized = FALSE
self.pos = 0
def draw(self, x0, y0, x1, y1):
--- 319,328 ----
def __init__(self):
BlankScreen.__init__(self)
self.initialized = FALSE
self.pos = 0
+ self.bar_border = self.Rectange(bgcolor=0xff000000, size=2)
+ self.bar_position = self.Rectange(bgcolor=0xa0000000L)
+
def draw(self, x0, y0, x1, y1):
***************
*** 287,296 ****
if not self.initialized:
if os.uname()[0] == 'FreeBSD':
! image = osd.loadbitmap(os.path.join(config.IMAGE_DIR,
'splashscreen-bsd.png'))
else:
! image = osd.loadbitmap(os.path.join(config.IMAGE_DIR,
'splashscreen.png'))
if image:
image = pygame.transform.scale(image, (x1-x0, y1-y0))
! osd.drawbitmap(image, x0, y0)
osd.drawstringframed(_('Starting Freevo, please wait ...'),
--- 335,346 ----
if not self.initialized:
if os.uname()[0] == 'FreeBSD':
! logo = os.path.join(config.IMAGE_DIR, 'splashscreen-bsd.png')
else:
! logo = os.path.join(config.IMAGE_DIR, 'splashscreen.png')
!
! image = osd.loadbitmap(logo)
if image:
image = pygame.transform.scale(image, (x1-x0, y1-y0))
! osd.drawbitmap(image, x0, y0, layer=self.bg.image)
osd.drawstringframed(_('Starting Freevo, please wait ...'),
***************
*** 298,310 ****
osd.getfont(config.OSD_DEFAULT_FONTNAME, 20),
fgcolor=0xffffff, align_h='center',
! align_v='bottom')
! self.bg = osd.screen.convert()
self.initialized = TRUE
pos = 0
if self.pos:
! pos = round(float((x1 - x0 - 2)) / (float(100) / self.pos))
! osd.drawbox(x0, y1-130, x0 + pos, y1-110, color=0xa0000000L, fill=TRUE)
! osd.drawbox(x0, y1-130, x1, y1-110, 2)
--- 348,359 ----
osd.getfont(config.OSD_DEFAULT_FONTNAME, 20),
fgcolor=0xffffff, align_h='center',
! align_v='bottom', layer=self.bg.image)
self.initialized = TRUE
pos = 0
if self.pos:
! pos = round(float((x1 - x0 - 4)) / (float(100) / self.pos))
! self.drawroundbox(x0, y1-130, x1-x0, 20, self.bar_border)
! self.drawroundbox(x0+2, y1-128, pos, 16, self.bar_position)
***************
*** 346,349 ****
--- 395,400 ----
self.tv_areas = []
+ self.freevo_active = False
+
for a in ( 'screen', 'title', 'subtitle', 'view', 'listing', 'info',
'plugin'):
o = eval('%s%s_Area(self, self.screen)' % (a[0].upper(), a[1:]))
***************
*** 354,358 ****
self.tvlisting = o
self.tv_areas.append(o)
!
_debug_('Skin: Loading XML file %s' % config.SKIN_XML_FILE,2)
--- 405,411 ----
self.tvlisting = o
self.tv_areas.append(o)
! if a == 'plugin':
! self.plugin_area = o
!
_debug_('Skin: Loading XML file %s' % config.SKIN_XML_FILE,2)
***************
*** 610,613 ****
--- 663,670 ----
menu = None
if type == 'menu':
+ if not self.freevo_active:
+ self.freevo_active = True
+ self.settings.prepare()
+
menuw = object
***************
*** 656,665 ****
if self.last_draw[0] != type:
self.force_redraw = TRUE
self.last_draw = type, object
self.screen.clear()
! for a in all_areas:
! a.draw(settings, object, style, type, self.force_redraw)
self.screen.show(self.force_redraw)
--- 713,728 ----
if self.last_draw[0] != type:
self.force_redraw = TRUE
+
self.last_draw = type, object
self.screen.clear()
! if isinstance(object, Skin_Area):
! Skin_Area.draw(object, settings, object, style, type, self.force_redraw)
! if object.allow_plugins:
! self.plugin_area.draw(settings, object, style, type,
self.force_redraw)
! else:
! for a in all_areas:
! a.draw(settings, object, style, type, self.force_redraw)
self.screen.show(self.force_redraw)
Index: area.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/skins/main/area.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** area.py 28 Oct 2003 17:54:12 -0000 1.12
--- area.py 22 Nov 2003 12:02:12 -0000 1.13
***************
*** 28,31 ****
--- 28,34 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.13 2003/11/22 12:02:12 dischi
+ # make the skin blankscreen a real plugin area
+ #
# Revision 1.12 2003/10/28 17:54:12 dischi
# take icons from theme if available
***************
*** 792,804 ****
height = content.height
! if not align_h:
align_h = content.align
! if not align_h:
! align_h = 'left'
! if not align_v:
align_v = content.valign
! if not align_v:
! align_v = 'top'
height2 = height
--- 795,807 ----
height = content.height
! if not align_h and content:
align_h = content.align
! if not align_h:
! align_h = 'left'
! if not align_v and content:
align_v = content.valign
! if not align_v:
! align_v = 'top'
height2 = height
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog