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

Modified Files:
        area.py info_area.py 
Log Message:
use now the two parts of drawstringframed

Index: area.py
===================================================================
RCS file: /cvsroot/freevo/freevo/skins/main1/area.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** area.py     29 Jun 2003 20:38:58 -0000      1.7
--- area.py     2 Jul 2003 20:13:30 -0000       1.8
***************
*** 28,31 ****
--- 28,34 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.8  2003/07/02 20:13:30  dischi
+ # use now the two parts of drawstringframed
+ #
  # Revision 1.7  2003/06/29 20:38:58  dischi
  # switch to the new info area
***************
*** 228,246 ****
                      layer.blit(image, (x1, y1))
  
!             for x1, y1, x2, y2, text, font, height, align_h, align_v, mode, \
!                 ellipses in objects.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.shadow.color, None,
!                                              font=font.name, ptsize=font.size,
!                                              align_h = align_h, align_v = align_v,
!                                              mode=mode, ellipses=ellipses, 
layer=layer)
!                     osd.drawstringframed(text, x1, y1, width, height, font.color, 
None,
!                                          font=font.name, ptsize=font.size,
!                                          align_h = align_h, align_v = align_v,
!                                          mode=mode, ellipses=ellipses, layer=layer)
  
          for x0, y0, x1, y1 in update_area:
--- 231,238 ----
                      layer.blit(image, (x1, y1))
  
!             for x1, y1, x2, y2, dsf_object in objects.text:
                  if self.in_update(x1, y1, x2, y2, update_area):
                      width = x2 - x1
!                     osd.dsf_draw(dsf_object, layer)
  
          for x0, y0, x1, y1 in update_area:
***************
*** 686,691 ****
      # Draws a text inside a frame based on the settings in the XML file
      def write_text(self, text, font, content, x=-1, y=-1, width=None, height=None,
!                    align_h = None, align_v = None, mode='hard', ellipses='...',
!                    return_area=FALSE):
          """
          writes a text ... or better stores the information about this call
--- 678,682 ----
      # Draws a text inside a frame based on the settings in the XML file
      def write_text(self, text, font, content, x=-1, y=-1, width=None, height=None,
!                    align_h = None, align_v = None, mode='hard', ellipses='...'):
          """
          writes a text ... or better stores the information about this call
***************
*** 694,698 ****
  
          if not text:
!             return
          
          if x == -1: x = content.x
--- 685,689 ----
  
          if not text:
!             return (0,0,0,0)
          
          if x == -1: x = content.x
***************
*** 718,732 ****
              height2 = font.h + 2
  
!         if return_area:
!             ret = osd.drawstringframed(text, x, y, width, height, None, None,
!                                        font=font.name, ptsize=font.size,
!                                        align_h = align_h, align_v = align_v,
!                                        mode=mode, ellipses=ellipses, 
layer=osd.null_layer)
  
!         self.tmp_objects.text.append((x, y, x+width+font.shadow.x, 
y+height2+font.shadow.y,
!                                       text, font, height, align_h, align_v, mode, 
ellipses ))
  
!         if return_area:
!             return ret[1]
      
  
--- 709,734 ----
              height2 = font.h + 2
  
!         if font.shadow.visible:
!             width -= font.shadow.x
  
!         dsf_info = osd.dsf_calc(text, x, y, width, height, font.color, None,
!                                 font=font.name, ptsize=font.size,
!                                 align_h = align_h, align_v = align_v,
!                                 mode=mode, ellipses=ellipses)
!         if dsf_info[1] == text:
!             # there is nothing to draw
!             return dsf_info[2]
!             
!         if font.shadow.visible:
!             objects = copy.deepcopy(dsf_info[0])
!             for o in objects:
!                 o.x += font.shadow.x
!                 o.y += font.shadow.y
!                 o.fgcolor = font.shadow.color
!             self.tmp_objects.text.append((x+font.shadow.x, y+font.shadow.y,
!                                           x+width, y+height2, objects))
  
!         self.tmp_objects.text.append((x, y, x+width, y+height2, dsf_info[0]))
!         return dsf_info[2]
      
  

Index: info_area.py
===================================================================
RCS file: /cvsroot/freevo/freevo/skins/main1/info_area.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** info_area.py        29 Jun 2003 20:38:58 -0000      1.5
--- info_area.py        2 Jul 2003 20:13:30 -0000       1.6
***************
*** 10,13 ****
--- 10,16 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.6  2003/07/02 20:13:30  dischi
+ # use now the two parts of drawstringframed
+ #
  # Revision 1.5  2003/06/29 20:38:58  dischi
  # switch to the new info area
***************
*** 72,75 ****
--- 75,81 ----
              return TRUE
  
+         if self.last_item != self.infoitem:
+             return TRUE
+         
          update += self.set_content()    # set self.content
          update += self.set_list(update) # set self.list
***************
*** 89,101 ****
          update the info area
          """
- 
          if not self.updated: # entered a menu for the first time
              self.set_list(self.set_content())
              self.sellist = self.eval_expressions( self.list )
  
          if not self.list: # nothing to draw
              self.updated = 0
              return
  
          # get items to be draw
          list = self.return_formatedtext( self.sellist )
--- 95,114 ----
          update the info area
          """
          if not self.updated: # entered a menu for the first time
              self.set_list(self.set_content())
              self.sellist = self.eval_expressions( self.list )
  
+         self.last_item = self.infoitem
          if not self.list: # nothing to draw
              self.updated = 0
              return
  
+ 
+         if 1:
+             self.return_formatedtext( self.sellist )
+             self.updated = 0
+             return
+ 
+ 
          # get items to be draw
          list = self.return_formatedtext( self.sellist )
***************
*** 310,325 ****
                  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 ]
!                 size = osd.drawstringframed( element.text, 0, 0,
!                                              r.width-element.font.shadow.x, r.height,
!                                              None, None,
!                                              element.font.name, element.font.size,
!                                              element.align, element.valign,
!                                              element.mode, layer=osd.null_layer )[ 1 
]
                  m_width  = size[ 2 ] - size[ 0 ]
                  m_height = size[ 3 ] - size[ 1 ]
--- 323,341 ----
                  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:
!                     height = min(r.height, element.height)
!                 else:
!                     height = -1
!                     
!                 size = self.write_text(element.text, element.font, self.content,
!                                        self.content.x+x, self.content.y+y,
!                                        r.width, height, element.align,
!                                        element.valign, element.mode)
! 
                  m_width  = size[ 2 ] - size[ 0 ]
                  m_height = size[ 3 ] - size[ 1 ]
***************
*** 333,345 ****
                  if isinstance( element.height, int ) or element.height == 
'line_height':
                      if element.height <= 0 or element.height == 'line_height':
!                         element.height = osd.stringsize( element.text,
!                                                          element.font.name,
!                                                          element.font.size)[ 1 ]
                  else:
                      element.height = min( m_height, r.height )
  
- 
                  x += element.width
- 
                  ret_list += [ element ]
  
--- 349,357 ----
                  if isinstance( element.height, int ) or element.height == 
'line_height':
                      if element.height <= 0 or element.height == 'line_height':
!                         element.height = m_height
                  else:
                      element.height = min( m_height, r.height )
  
                  x += element.width
                  ret_list += [ element ]
  
***************
*** 351,355 ****
--- 363,372 ----
                  element.width = self.content.width - element.x
  
+ 
              # Need to recalculate line height?
+             #
+             # XXX varitical alignment is broekn right now. We need to
+             # XXX use parts of write_text and the dsf functions to do that
+             #
              if newline and ret_list:
                  newline_height = 0
***************
*** 368,373 ****
                      j.height = newline_height
                  
! 
!         return ret_list
  
  
--- 385,390 ----
                      j.height = newline_height
                  
!             
!         return # XXX ret_list
  
  




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to