Update of /cvsroot/freevo/freevo/src/skins/main
In directory sc8-pr-cvs1:/tmp/cvs-serv20206/src/skins/main

Modified Files:
        info_area.py screen.py 
Log Message:
move the shadow code into osd.py

Index: info_area.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/skins/main/info_area.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** info_area.py        14 Dec 2003 17:39:52 -0000      1.8
--- info_area.py        1 Jan 2004 15:53:18 -0000       1.9
***************
*** 10,13 ****
--- 10,16 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.9  2004/01/01 15:53:18  dischi
+ # move the shadow code into osd.py
+ #
  # Revision 1.8  2003/12/14 17:39:52  dischi
  # Change TRUE and FALSE to True and False; vfs fixes
***************
*** 148,159 ****
          """
          update=0
!         try:
!             if self.content.width != self.area_val.width or \
!                self.content.height != self.area_val.height or \
!                self.content.x != self.area_val.x or \
!                self.content.y != self.area_val.y:
!                 update=1
!         except:
!             pass
          
          if self.layout_content is not self.layout.content or update:
--- 151,160 ----
          """
          update=0
!         if self.content and self.area_val and \
!                (self.content.width != self.area_val.width or \
!                 self.content.height != self.area_val.height or \
!                 self.content.x != self.area_val.x or \
!                 self.content.y != self.area_val.y):
!             update=1
          
          if self.layout_content is not self.layout.content or update:
***************
*** 369,381 ****
                  element.y = y
  
-                 shadow_x, shadow_y = 0, 0
-                 if element.font.shadow.visible == 'yes':
-                     shadow_x = element.font.shadow.x
-                     shadow_y = element.font.shadow.y
-                     
                  # Calculate the geometry
                  r = Geometry( x, y, element.width, element.height)
!                 r = self.get_item_rectangle(r, self.content.width - x - shadow_x,
!                                             self.content.height - y - shadow_y )[ 2 ]
  
                  if element.height > 0:
--- 370,377 ----
                  element.y = y
  
                  # Calculate the geometry
                  r = Geometry( x, y, element.width, element.height)
!                 r = self.get_item_rectangle(r, self.content.width - x,
!                                             self.content.height - y )[ 2 ]
  
                  if element.height > 0:
***************
*** 383,398 ****
                  else:
                      height = -1
!                     
                  size = osd.drawstringframed( _(element.text), 0, 0,
                                               r.width, r.height,
                                               element.font.font, None, None,
                                               element.align, element.valign,
!                                              element.mode, layer='' )[ 1 ]
!                 try:
!                     m_width  = size[ 2 ] - size[ 0 ]
!                     m_height = size[ 3 ] - size[ 1 ]
!                 except:
!                     m_width = r.width
!                     m_height = r.height
  
                  if isinstance( element.width, int ):
--- 379,395 ----
                  else:
                      height = -1
! 
!                 if element.font.shadow.visible:
!                     shadow = (element.font.shadow.x, element.font.shadow.y,
!                               element.font.shadow.color)
!                 else:
!                     shadow = None
                  size = osd.drawstringframed( _(element.text), 0, 0,
                                               r.width, r.height,
                                               element.font.font, None, None,
                                               element.align, element.valign,
!                                              element.mode, shadow=shadow, layer='' 
)[ 1 ]
!                 m_width  = size[ 2 ] - size[ 0 ]
!                 m_height = size[ 3 ] - size[ 1 ]
  
                  if isinstance( element.width, int ):
***************
*** 408,416 ****
                      element.height = min( m_height, r.height )
  
-                 element.width += shadow_x
-                 element.height += shadow_y
- 
                  x += element.width
!                 ret_list += [ element ]
              
  
--- 405,410 ----
                      element.height = min( m_height, r.height )
  
                  x += element.width
!                 ret_list.append(element)
              
  

Index: screen.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/skins/main/screen.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** screen.py   14 Dec 2003 17:39:52 -0000      1.5
--- screen.py   1 Jan 2004 15:53:18 -0000       1.6
***************
*** 7,10 ****
--- 7,13 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.6  2004/01/01 15:53:18  dischi
+ # move the shadow code into osd.py
+ #
  # Revision 1.5  2003/12/14 17:39:52  dischi
  # Change TRUE and FALSE to True and False; vfs fixes
***************
*** 79,82 ****
--- 82,86 ----
          self.s_alpha        = self.s_content.convert_alpha()
          self.s_bg           = self.s_content.convert()
+         self.s_screen       = self.s_content.convert()
          self.update_bg      = None
          self.update_alpha   = []
***************
*** 180,186 ****
  
  
-         layer = self.s_content.convert()
          update_area += self.update_content
  
          # if something changed redraw all content objects
          if update_area:
--- 184,193 ----
  
  
          update_area += self.update_content
  
+         layer = self.s_screen
+         for x0, y0, x1, y1 in update_area:
+             layer.blit(self.s_content, (x0, y0), (x0, y0, x1-x0, y1-y0))
+         
          # if something changed redraw all content objects
          if update_area:
***************
*** 199,213 ****
                      ellipses in self.drawlist.text:
                  if self.in_update(x1, y1, x2, y2, update_area):
-                     width = x2 - x1
                      if font.shadow.visible:
!                         width -= font.shadow.x
!                         osd.drawstringframed(text, x1+font.shadow.x, 
y1+font.shadow.y,
!                                              width, height, font.font, 
font.shadow.color,
!                                              None, align_h = align_h, align_v = 
align_v,
!                                              mode=mode, ellipses=ellipses, 
layer=layer)
!                     osd.drawstringframed(text, x1, y1, width, height, font.font,
                                           font.color, None, align_h = align_h,
                                           align_v = align_v, mode=mode,
!                                          ellipses=ellipses, layer=layer)
  
          for x0, y0, x1, y1 in update_area:
--- 206,217 ----
                      ellipses in self.drawlist.text:
                  if self.in_update(x1, y1, x2, y2, update_area):
                      if font.shadow.visible:
!                         shadow = (font.shadow.x, font.shadow.y, font.shadow.color)
!                     else:
!                         shadow = None
!                     osd.drawstringframed(text, x1, y1, x2 - x1, height, font.font,
                                           font.color, None, align_h = align_h,
                                           align_v = align_v, mode=mode,
!                                          shadow=shadow, ellipses=ellipses, 
layer=layer)
  
          for x0, y0, x1, y1 in update_area:




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to