Update of /cvsroot/freevo/freevo/src/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv7040

Modified Files:
        idlebar.py 
Log Message:
moved idlebar to a skin plugin

Index: idlebar.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/plugins/idlebar.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** idlebar.py  5 Jul 2003 14:57:07 -0000       1.18
--- idlebar.py  12 Jul 2003 17:17:27 -0000      1.19
***************
*** 23,26 ****
--- 23,29 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.19  2003/07/12 17:17:27  dischi
+ # moved idlebar to a skin plugin
+ #
  # Revision 1.18  2003/07/05 14:57:07  dischi
  # the idlebar registers itself as idlebar to the plugin interface
***************
*** 121,127 ****
  import pymetar
  
- import osd
- osd  = osd.get_singleton()
- 
  TRUE  = 1
  FALSE = 0
--- 124,127 ----
***************
*** 132,158 ****
          plugin.DaemonPlugin.__init__(self)
          self.poll_interval   = 300
-         self.toolbar_surface = None
          self.plugins = None
          plugin.register(self, 'idlebar')
          self.visible = TRUE
          
!     def draw(self, (type, object)):
!         if not self.toolbar_surface:
!             osd.drawbox(0,0,osd.width,75,color=0x80000000,width=-1)
!             self.toolbar_surface = osd.getsurface(0,0,osd.width,75)
          if not self.plugins:
              self.plugins = plugin.get('idlebar')
! 
!         osd.putsurface(self.toolbar_surface,0,0)
          for p in self.plugins:
!             p.draw((type, object))
!         rect = (0,0,osd.width,75)
!         osd.update(rect)
  
  
      def poll(self):
          # XXX This probably shouldn't be None,None, but at least it doesn't crash
!         self.draw((None,None))
! 
  
  class IdleBarPlugin(plugin.Plugin):
--- 132,154 ----
          plugin.DaemonPlugin.__init__(self)
          self.poll_interval   = 300
          self.plugins = None
          plugin.register(self, 'idlebar')
          self.visible = TRUE
          
!     def draw(self, (type, object), osd):
!         osd.drawroundbox(0, 0, osd.width, osd.y + 60, (0x80000000, 0, 0, 0))
          if not self.plugins:
              self.plugins = plugin.get('idlebar')
!         x = osd.x
          for p in self.plugins:
!             add_x = p.draw((type, object), x, osd)
!             if add_x:
!                 x += add_x + 20
  
  
      def poll(self):
          # XXX This probably shouldn't be None,None, but at least it doesn't crash
!         # self.draw((None,None))
!         pass
  
  class IdleBarPlugin(plugin.Plugin):
***************
*** 161,165 ****
          self._type = 'idlebar'
          
!     def draw(self, (type, object)):
          return
  
--- 157,161 ----
          self._type = 'idlebar'
          
!     def draw(self, (type, object), x, osd):
          return
  
***************
*** 168,180 ****
      def __init__(self):
          IdleBarPlugin.__init__(self)
-         self.CLOCKFONT = 'skins/fonts/Trebuchet_MS.ttf'
-         if not os.path.isfile(self.CLOCKFONT):
-             # XXX Get this from the skin, but for now this will allow it to work
-             self.CLOCKFONT = config.OSD_DEFAULT_FONTNAME
      
!     def draw(self, (type, object)):
          clock = time.strftime('%a %I:%M %P')
!         osd.drawstring(clock,580,40,fgcolor=0xffffff,font=self.CLOCKFONT,ptsize=12)
! 
  
  class cdstatus(IdleBarPlugin):
--- 164,175 ----
      def __init__(self):
          IdleBarPlugin.__init__(self)
      
!     def draw(self, (type, object), x, osd):
          clock = time.strftime('%a %I:%M %P')
!         font  = osd.get_font('clock')
!         osd.write_text(clock, font, None, osd.x + osd.width-200, osd.y + 10, 190,
!                        40, 'right', 'center')
!         return 0
!     
  
  class cdstatus(IdleBarPlugin):
***************
*** 190,194 ****
          self.cdimages ['mixed'] = 'skins/images/status/cd_mixed.png'
  
!     def draw(self, (type, object)):
          image = self.cdimages['empty_cdrom']
          for media in config.REMOVABLE_MEDIA:
--- 185,189 ----
          self.cdimages ['mixed'] = 'skins/images/status/cd_mixed.png'
  
!     def draw(self, (type, object), x, osd):
          image = self.cdimages['empty_cdrom']
          for media in config.REMOVABLE_MEDIA:
***************
*** 198,202 ****
                  elif media.info.handle_type: 
                      image = self.cdimages[media.info.handle_type]
!         osd.drawbitmap(image,220,30)
  
  class mail(IdleBarPlugin):
--- 193,198 ----
                  elif media.info.handle_type: 
                      image = self.cdimages[media.info.handle_type]
!         return osd.draw_image(image, (x, osd.y + 15, -1, -1))[0]
! 
  
  class mail(IdleBarPlugin):
***************
*** 221,229 ****
              return 0
  
!     def draw(self, (type, object)):
          if self.checkmail() > 0:
!             osd.drawbitmap(self.MAILIMAGE,25,25)
          else:
!             osd.drawbitmap(self.NO_MAILIMAGE,25,25) 
  
  
--- 217,225 ----
              return 0
  
!     def draw(self, (type, object), x, osd):
          if self.checkmail() > 0:
!             return osd.draw_image(self.MAILIMAGE, (x, osd.y + 10, -1, -1))[0]
          else:
!             return osd.draw_image(self.NO_MAILIMAGE, (x, osd.y + 10, -1, -1))[0] 
  
  
***************
*** 242,250 ****
          return 0
  
!     def draw(self, (type, object)):
          if self.checktv() == 1:
!             osd.drawbitmap(self.TVLOCKED,100,25)
          else:
!             osd.drawbitmap(self.TVFREE,100,25)
  
  
--- 238,246 ----
          return 0
  
!     def draw(self, (type, object), x, osd):
          if self.checktv() == 1:
!             return osd.draw_image(self.TVLOCKED, (x, osd.y + 10, -1, -1))[0]
          else:
!             return osd.draw_image(self.TVFREE, (x, osd.y + 10, -1, -1))[0]
  
  
***************
*** 301,310 ****
          return temperature, icon
  
!     def draw(self, (type, object)):
          temp,icon = self.checkweather()
!         osd.drawbitmap('skins/icons/weather/' + icon,160,30)
!         osd.drawstring(temp,175,50,fgcolor=0xbbbbbb,font=self.CLOCKFONT,ptsize=14)
!         osd.drawstring('o',192,47,fgcolor=0xbbbbbb,font=self.CLOCKFONT,ptsize=10)
! 
          
  # This class checks if the current date is a holiday and will
--- 297,309 ----
          return temperature, icon
  
!     def draw(self, (type, object), x, osd):
          temp,icon = self.checkweather()
!         font  = osd.get_font('weather')
!         osd.draw_image('skins/icons/weather/' + icon, (x, osd.y + 15, -1, -1))
!         temp = '%s�' % temp
!         width = font.font.stringsize(temp)
!         osd.write_text(temp, font, None, x + 15, osd.y + 55 - font.h, width, font.h,
!                        'left', 'top')
!         return width + 15
          
  # This class checks if the current date is a holiday and will
***************
*** 330,335 ****
                      return icon
  
!     def draw(self, (type, object)):
          icon = self.get_holiday_icon()
          if icon:
!             osd.drawbitmap( 'skins/images/holidays/' + icon, 580, 2)        
--- 329,334 ----
                      return icon
  
!     def draw(self, (type, object), x, osd):
          icon = self.get_holiday_icon()
          if icon:
!             return osd.draw_image('skins/images/holidays/' + icon, (x, osd.y + 10, 
-1, -1))[0]




-------------------------------------------------------
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