Update of /cvsroot/freevo/freevo/skins/main1
In directory sc8-pr-cvs1:/tmp/cvs-serv6888

Modified Files:
        area.py skin_main1.py xml_skin.py 
Log Message:
created a special area for plugins to draw

Index: area.py
===================================================================
RCS file: /cvsroot/freevo/freevo/skins/main1/area.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** area.py     10 Jul 2003 20:01:11 -0000      1.14
--- area.py     12 Jul 2003 17:16:30 -0000      1.15
***************
*** 28,31 ****
--- 28,34 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.15  2003/07/12 17:16:30  dischi
+ # created a special area for plugins to draw
+ #
  # Revision 1.14  2003/07/10 20:01:11  dischi
  # small bugfix for blue_round1
***************
*** 308,312 ****
  
          self.display_style = display_style
! 
          if widget_type == 'menu':
              self.menuw = obj
--- 311,316 ----
  
          self.display_style = display_style
!         self.xml_settings = settings
!         
          if widget_type == 'menu':
              self.menuw = obj
***************
*** 362,372 ****
              self.objects = SkinObjects()
  
!         if not area.visible or not self.layout:
!             self.objects = SkinObjects()
!             return
! 
!         self.tmp_objects = SkinObjects()
!         self.draw_background()
  
          # dependencies haven't changed
          if not self.redraw:
--- 366,379 ----
              self.objects = SkinObjects()
  
!         if not self.area_name == 'plugin':
!             if not area.visible or not self.layout:
!                 self.objects = SkinObjects()
!                 return
  
+             self.tmp_objects = SkinObjects()
+             self.draw_background()
+         else:
+             self.tmp_objects = SkinObjects()
+             
          # dependencies haven't changed
          if not self.redraw:
***************
*** 629,637 ****
                  area = area[0]
  
!         try:
!             area = getattr(area, self.area_name)
!         except AttributeError:
!             area = xml_skin.XML_area(self.area_name)
!             area.visible = FALSE
              
  
--- 636,651 ----
                  area = area[0]
  
!         if self.area_name == 'plugin':
!             if not self.area_val:
!                 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)
!             return TRUE
!         else:
!             try:
!                 area = getattr(area, self.area_name)
!             except AttributeError:
!                 area = xml_skin.XML_area(self.area_name)
!                 area.visible = FALSE
              
  
***************
*** 723,730 ****
          in a variable. The real drawing is done inside draw()
          """
! 
!         self.tmp_objects.rectangles.append(( x, y, x + width, y + height, 
rect.bgcolor,
!                                              rect.size, rect.color, rect.radius ))
! 
              
      # Draws a text inside a frame based on the settings in the XML file
--- 737,746 ----
          in a variable. The real drawing is done inside draw()
          """
!         try:
!             self.tmp_objects.rectangles.append(( x, y, x + width, y + height, 
rect.bgcolor,
!                                                  rect.size, rect.color, rect.radius 
))
!         except AttributeError:
!             self.tmp_objects.rectangles.append(( x, y, x + width, y + height, 
rect[0],
!                                                  rect[1], rect[2], rect[3] ))
              
      # Draws a text inside a frame based on the settings in the XML file
***************
*** 780,784 ****
          if not cimage:
              try:
!                 image = pygame.transform.scale(osd.loadbitmap(image), (w, h))
                  self.imagecache[cname] = image
              except:
--- 796,802 ----
          if not cimage:
              try:
!                 image = osd.loadbitmap(image)
!                 if w > 0 and h > 0:
!                     image = pygame.transform.scale(image, (w, h))
                  self.imagecache[cname] = image
              except:
***************
*** 796,811 ****
  
          if not image:
!             return
          
          if isinstance(image, str):
!             image = self.load_image(image, val)
!                 
          if not image:
!             return
          
          if isinstance(val, tuple):
              self.tmp_objects.images.append((val[0], val[1], val[0] + 
image.get_width(),
                                              val[1] + image.get_height(), image))
!             return
  
          try:
--- 814,832 ----
  
          if not image:
!             return 0,0
          
          if isinstance(image, str):
!             if isinstance(val, tuple):
!                 image = self.load_image(image, val[2:])
!             else:
!                 image = self.load_image(image, val)
! 
          if not image:
!             return 0,0
          
          if isinstance(val, tuple):
              self.tmp_objects.images.append((val[0], val[1], val[0] + 
image.get_width(),
                                              val[1] + image.get_height(), image))
!             return image.get_width(), image.get_height()
  
          try:
***************
*** 813,817 ****
                  self.tmp_objects.bgimages.append((val.x, val.y, val.x + val.width,
                                                    val.y + val.height, image))
!                 return
          except:
              pass
--- 834,838 ----
                  self.tmp_objects.bgimages.append((val.x, val.y, val.x + val.width,
                                                    val.y + val.height, image))
!                 return val.width, val.height
          except:
              pass
***************
*** 819,820 ****
--- 840,843 ----
          self.tmp_objects.images.append((val.x, val.y, val.x + val.width,
                                          val.y + val.height, image))
+         return val.width, val.height
+         

Index: skin_main1.py
===================================================================
RCS file: /cvsroot/freevo/freevo/skins/main1/skin_main1.py,v
retrieving revision 1.105
retrieving revision 1.106
diff -C2 -d -r1.105 -r1.106
*** skin_main1.py       10 Jul 2003 20:01:11 -0000      1.105
--- skin_main1.py       12 Jul 2003 17:16:30 -0000      1.106
***************
*** 10,13 ****
--- 10,16 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.106  2003/07/12 17:16:30  dischi
+ # created a special area for plugins to draw
+ #
  # Revision 1.105  2003/07/10 20:01:11  dischi
  # small bugfix for blue_round1
***************
*** 215,218 ****
--- 218,257 ----
  
  
+ class Plugin_Area(Skin_Area):
+     """
+     in this area all plugins can draw
+     """
+     def __init__(self, parent, screen):
+         Skin_Area.__init__(self, 'plugin', screen)
+         self.plugins = None
+         self.x = config.OVERSCAN_X
+         self.y = config.OVERSCAN_Y
+         self.width   = osd.width  - 2 * config.OVERSCAN_X
+         self.height  = osd.height - 2 * config.OVERSCAN_Y
+         
+     def get_font(self, name):
+         try:
+             return self.xml_settings.font[name]
+         except:
+             return self.xml_settings.font['default']
+     
+     def update_content_needed(self):
+         """
+         this area needs never a content update
+         """
+         return TRUE
+ 
+     def update_content(self):
+         """
+         there is no content in this area
+         """
+         if self.plugins == None:
+             self.plugins = plugin.get('daemon_draw')
+ 
+         for p in self.plugins:
+             p.draw((type, object), self)
+ 
+ 
+ 
  ###############################################################################
  
***************
*** 237,241 ****
          self.tv_areas = []
  
!         for a in ( 'screen', 'title', 'subtitle', 'view', 'listing', 'info'):
              o = eval('%s%s_Area(self, self.screen)' % (a[0].upper(), a[1:]))
              self.normal_areas.append(o)
--- 276,280 ----
          self.tv_areas = []
  
!         for a in ( 'screen', 'title', 'subtitle', 'view', 'listing', 'info', 
'plugin'):
              o = eval('%s%s_Area(self, self.screen)' % (a[0].upper(), a[1:]))
              self.normal_areas.append(o)
***************
*** 262,267 ****
                  break
  
-         self.plugin_refresh = None
-                 
      
      def LoadSettings(self, dir, copy_content = 1):
--- 301,304 ----
***************
*** 468,474 ****
              self.settings.prepare()
              
-         if self.plugin_refresh == None:
-             self.plugin_refresh = plugin.get('daemon_draw')
- 
          menu = None
          if type == 'menu':
--- 505,508 ----
***************
*** 527,533 ****
              
          self.screen.show(self.force_redraw)
- 
-         for p in self.plugin_refresh:
-             p.draw((type, object))
  
          osd.update()
--- 561,564 ----

Index: xml_skin.py
===================================================================
RCS file: /cvsroot/freevo/freevo/skins/main1/xml_skin.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** xml_skin.py 11 Jul 2003 19:44:18 -0000      1.13
--- xml_skin.py 12 Jul 2003 17:16:30 -0000      1.14
***************
*** 10,13 ****
--- 10,16 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.14  2003/07/12 17:16:30  dischi
+ # created a special area for plugins to draw
+ #
  # Revision 1.13  2003/07/11 19:44:18  dischi
  # close file after parsing
***************
*** 883,896 ****
          self.player = copy.deepcopy(self._player)
          
!         font        = copy.deepcopy(self._font)
          layout      = copy.deepcopy(self._layout)
          
          search_dirs = self.skin_directories + [ 'skins/images', self.icon_dir, '.' ]
          
!         for f in font:
!             font[f].prepare(self._color, scale=self.font_scale)
              
          for l in layout:
!             layout[l].prepare(font, self._color, search_dirs, self._images)
          for menu in self.menu:
              self.menu[menu].prepare(self._menuset, layout)
--- 886,899 ----
          self.player = copy.deepcopy(self._player)
          
!         self.font   = copy.deepcopy(self._font)
          layout      = copy.deepcopy(self._layout)
          
          search_dirs = self.skin_directories + [ 'skins/images', self.icon_dir, '.' ]
          
!         for f in self.font:
!             self.font[f].prepare(self._color, scale=self.font_scale)
              
          for l in layout:
!             layout[l].prepare(self.font, self._color, search_dirs, self._images)
          for menu in self.menu:
              self.menu[menu].prepare(self._menuset, layout)




-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to