Update of /cvsroot/freevo/freevo/skins/dischi1
In directory sc8-pr-cvs1:/tmp/cvs-serv26774

Modified Files:
        TODO area.py skin_dischi1.py tvlisting_area.py 
Log Message:
(listing.py from prev. checkin has the wrong log message)
o tvlisting now has left/right items and the label width is taken from the
  skin xml file. The channel logos are scaled to fit that space
o add image load function to area
o add some few lines here and there to make it possible to force the
  skin to a specific layout
o initial display style is set to config.SKIN_START_LAYOUT


Index: TODO
===================================================================
RCS file: /cvsroot/freevo/freevo/skins/dischi1/TODO,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** TODO        23 Mar 2003 20:05:51 -0000      1.7
--- TODO        30 Mar 2003 14:13:23 -0000      1.8
***************
*** 1,4 ****
- add indicators for tv items
- 
  fallback to text view if all images are the same
  
--- 1,2 ----
***************
*** 7,18 ****
  clean DTD for all our xml files.
  
- No "this directory is empty" handling yet (you only see nothing)
- 
  blue1_round will get an image listing, too
  
  Finish integration of Robs new gui stuff
- 
- Add force-to-style and begin-with style in some way
- 
- better scroll up/down handling for text menus
- 
--- 5,9 ----

Index: area.py
===================================================================
RCS file: /cvsroot/freevo/freevo/skins/dischi1/area.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** area.py     27 Mar 2003 20:10:56 -0000      1.34
--- area.py     30 Mar 2003 14:13:23 -0000      1.35
***************
*** 28,31 ****
--- 28,40 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.35  2003/03/30 14:13:23  dischi
+ # (listing.py from prev. checkin has the wrong log message)
+ # o tvlisting now has left/right items and the label width is taken from the
+ #   skin xml file. The channel logos are scaled to fit that space
+ # o add image load function to area
+ # o add some few lines here and there to make it possible to force the
+ #   skin to a specific layout
+ # o initial display style is set to config.SKIN_START_LAYOUT
+ #
  # Revision 1.34  2003/03/27 20:10:56  dischi
  # Fix endless loop on empty directories (and added a messages)
***************
*** 357,363 ****
--- 366,377 ----
          """
  
+         self.display_style = display_style
+ 
          if widget_type == 'menu':
              self.menuw = obj
              self.menu  = obj.menustack[-1]
+             if self.menu.force_skin_layout != -1:
+                 self.display_style = self.menu.force_skin_layout
+             
              if self.menu.viewitem:
                  self.viewitem = self.menu.viewitem
***************
*** 392,396 ****
              visible = FALSE
  
-         self.display_style = display_style
          self.redraw = self.init_vars(settings, item_type, widget_type)
              
--- 406,409 ----
***************
*** 762,765 ****
--- 775,802 ----
      
  
+     def load_image(self, image, val, redraw=TRUE):
+         """
+         load an image (use self.imagecache
+         """
+         if isinstance(val, tuple) or isinstance(val, list):
+             w = val[0]
+             h = val[1]
+         else:
+             w = val.width
+             h = val.height
+             
+         cname = '%s-%s-%s' % (image, w, h)
+         cimage = self.imagecache[cname]
+         if not cimage:
+             try:
+                 image = pygame.transform.scale(osd.loadbitmap(image), (w, h))
+                 self.imagecache[cname] = image
+             except:
+                 return None
+         else:
+             image = cimage
+         return image
+ 
+         
      def draw_image(self, image, val, redraw=TRUE):
          """
***************
*** 772,782 ****
          
          if isinstance(image, str):
!             cname = '%s-%s-%s' % (image, val.width, val.height)
!             cimage = self.imagecache[cname]
!             if not cimage:
!                 image = pygame.transform.scale(osd.loadbitmap(image), (val.width, 
val.height))
!                 self.imagecache[cname] = image
!             else:
!                 image = cimage
                  
          if not image:
--- 809,813 ----
          
          if isinstance(image, str):
!             image = self.load_image(image, val)
                  
          if not image:

Index: skin_dischi1.py
===================================================================
RCS file: /cvsroot/freevo/freevo/skins/dischi1/skin_dischi1.py,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** skin_dischi1.py     27 Mar 2003 20:11:00 -0000      1.43
--- skin_dischi1.py     30 Mar 2003 14:13:23 -0000      1.44
***************
*** 10,13 ****
--- 10,22 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.44  2003/03/30 14:13:23  dischi
+ # (listing.py from prev. checkin has the wrong log message)
+ # o tvlisting now has left/right items and the label width is taken from the
+ #   skin xml file. The channel logos are scaled to fit that space
+ # o add image load function to area
+ # o add some few lines here and there to make it possible to force the
+ #   skin to a specific layout
+ # o initial display style is set to config.SKIN_START_LAYOUT
+ #
  # Revision 1.43  2003/03/27 20:11:00  dischi
  # Fix endless loop on empty directories (and added a messages)
***************
*** 297,301 ****
      
      def __init__(self):
!         self.display_style = 0
          self.force_redraw = TRUE
          self.last_draw = None
--- 306,310 ----
      
      def __init__(self):
!         self.display_style = config.SKIN_START_LAYOUT
          self.force_redraw = TRUE
          self.last_draw = None
***************
*** 371,374 ****
--- 380,386 ----
          Toggle display style
          """
+         if menu.force_skin_layout != -1:
+             return 0
+         
          if menu and menu.skin_settings:
              settings = menu.skin_settings
***************
*** 388,395 ****
  
  
!     def GetDisplayStyle(self):
          """
          return current display style
          """
          return self.display_style
  
--- 400,409 ----
  
  
!     def GetDisplayStyle(self, menu=None):
          """
          return current display style
          """
+         if menu and menu.force_skin_layout != -1:
+             return menu.force_skin_layout
          return self.display_style
  

Index: tvlisting_area.py
===================================================================
RCS file: /cvsroot/freevo/freevo/skins/dischi1/tvlisting_area.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** tvlisting_area.py   22 Mar 2003 20:08:31 -0000      1.9
--- tvlisting_area.py   30 Mar 2003 14:13:23 -0000      1.10
***************
*** 10,13 ****
--- 10,22 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.10  2003/03/30 14:13:23  dischi
+ # (listing.py from prev. checkin has the wrong log message)
+ # o tvlisting now has left/right items and the label width is taken from the
+ #   skin xml file. The channel logos are scaled to fit that space
+ # o add image load function to area
+ # o add some few lines here and there to make it possible to force the
+ #   skin to a specific layout
+ # o initial display style is set to config.SKIN_START_LAYOUT
+ #
  # Revision 1.9  2003/03/22 20:08:31  dischi
  # Lots of changes:
***************
*** 134,142 ****
  
          # get the max width needed for the longest channel name
!         label_width = 0
!         for channel in menuw.all_channels:
!             label_width = max(label_width, osd.stringsize(channel.displayname,
!                                                           label_val.font.name,
!                                                           label_val.font.size)[0])
          label_txt_width = label_width
  
--- 143,153 ----
  
          # get the max width needed for the longest channel name
!         label_width = label_val.width
! 
!         #for channel in menuw.all_channels:
!         #    label_width = max(label_width, osd.stringsize(channel.displayname,
!         #                                                  label_val.font.name,
!         #                                                  label_val.font.size)[0])
! 
          label_txt_width = label_width
  
***************
*** 204,232 ****
                     selected_font, default_val, default_font = self.all_vals
  
-         
-         #left_arrow_size = osd.bitmapsize(val.indicator['left'])
-         #right_arrow_size = osd.bitmapsize(val.indicator['right'])
- 
-         left_arrow_size = (0,0)
-         right_arrow_size = (0,0)
- 
-         # col_size = int( w_contents / n_cols )
- 
-         # Display the Time on top
-         #x = conf_x
-         #y = conf_y
  
!         # Display the Channel on top
!         #drawroundbox(x, y, x+val.label.width, y+str_h_head + 2 * val.spacing,
!         #             val.head.bgcolor, 1, val.border_color, radius=val.head.radius)
!         #settings2 = copy.copy(val.head)
!         # first head column is date, should be aligned like 'label'
!         #settings2.align=val.label.align
!         #settings2.valign=val.label.valign
!         #DrawTextFramed(time.strftime("%m/%d",time.localtime(to_listing[0][1])),
!         #               settings2, x + val.spacing, y + val.spacing,
!         #               val.label.width - 2 * val.spacing, str_h_head)
  
!         # other head columns should be aligned like specified in xml
  
          x_contents = content.x + label_width + content.spacing
--- 215,232 ----
                     selected_font, default_val, default_font = self.all_vals
  
  
!         leftarraw = None
!         if area.images['leftarrow']:
!             i = area.images['leftarrow']
!             leftarrow = self.load_image(i.filename, i)
!             if leftarrow:
!                 leftarrow_size = (leftarrow.get_width(), leftarrow.get_height())
  
!         rightarraw = None
!         if area.images['rightarrow']:
!             i = area.images['rightarrow']
!             rightarrow = self.load_image(i.filename, i)
!             if rightarrow:
!                 rightarrow_size = (rightarrow.get_width(), rightarrow.get_height())
  
          x_contents = content.x + label_width + content.spacing
***************
*** 283,302 ****
              channel_logo = config.TV_LOGOS + '/' + to_listing[i].id + '.png'
              if os.path.isfile(channel_logo):
!                 image = self.imagecache[to_listing[i].id]
!                 if image:
!                     channel_logo = image
!                 else:
!                     image = osd.loadbitmap(channel_logo)
!                     if image:
!                         i_w, i_h = image.get_size()
!                         if int(float(logo_geo[2] * i_h) / i_w) > logo_geo[3]:
!                             logo_geo[2] = int(float(logo_geo[3] * i_w) / i_h)
!                         else:
!                             logo_geo[3] = int(float(logo_geo[2] * i_h) / i_w)
!                     
!                         channel_logo = pygame.transform.scale(image, logo_geo[2:])
!                         self.imagecache[to_listing[i].id] = channel_logo
!                     else:
!                         channel_logo = None
              else:
                  channel_logo = None
--- 283,287 ----
              channel_logo = config.TV_LOGOS + '/' + to_listing[i].id + '.png'
              if os.path.isfile(channel_logo):
!                 channel_logo = self.load_image(channel_logo, logo_geo[2:])
              else:
                  channel_logo = None
***************
*** 348,354 ****
                          val.align='center'
  
-                     #tx0 = min(x1, 
x0+(flag_left+1)*spacing+flag_left*left_arrow_size[0])
-                     #tx1 = max(x0, 
x1-(flag_right+1)*spacing-flag_right*right_arrow_size[0])
- 
                      if x0 > x1:
                          break
--- 333,336 ----
***************
*** 363,378 ****
                          self.drawroundbox(tx0+r.x, ty0+r.y, r.width, r.height, r)
                          
                      if tx0 < tx1:
                          self.write_text(prg.title, font, content, x=tx0+ig.x,
                                          y=ty0+ig.y, width=ig.width, height=-1,
                                          align_v='center', align_h = val.align)
- 
-                     #if flag_left:
-                     #    osd.drawbitmap(val2.indicator['left'], x0 + spacing,
-                     #                   y0+spacing+int((str_h - 
left_arrow_size[1])/2))
-                     #if flag_right:
-                     #    osd.drawbitmap(val2.indicator['right'],
-                     #                   x1-right_arrow_size[0]-spacing, \
-                     #                   y0+spacing+int((str_h - 
right_arrow_size[1])/2))
  
              i += 1
--- 345,363 ----
                          self.drawroundbox(tx0+r.x, ty0+r.y, r.width, r.height, r)
                          
+                     if flag_left:
+                         tx0 += leftarrow_size[0]
+                         if tx0 < tx1:
+                             self.draw_image(leftarrow, (tx0-leftarrow_size[0], ty0 + 
ig.y +\
+                                                         
(ig.height-leftarrow_size[1])/2))
+                     if flag_right:
+                         tx1 -= rightarrow_size[0]
+                         if tx0 < tx1:
+                             self.draw_image(rightarrow, (tx1, ty0 + ig.y + \
+                                                          
(ig.height-rightarrow_size[1])/2))
+ 
                      if tx0 < tx1:
                          self.write_text(prg.title, font, content, x=tx0+ig.x,
                                          y=ty0+ig.y, width=ig.width, height=-1,
                                          align_v='center', align_h = val.align)
  
              i += 1




-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to