/[gzz]/gzz/gfx/demo/xupdf.py
ViewVC logotype

Diff of /gzz/gfx/demo/xupdf.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.26 by tjl, Fri Sep 27 18:22:59 2002 UTC revision 1.27 by tjl, Fri Sep 27 18:52:26 2002 UTC
# Line 1  Line 1 
1  from __future__ import nested_scopes  from __future__ import nested_scopes
2  from gzz.index import XuLink  from gzz.index import XuLink
3    from gzz.gfx.gl import Stencil
4    
5  # Now, this is the start of the REAL demo, the one  # Now, this is the start of the REAL demo, the one
6  # with Xanadu links between PDF and text.  # with Xanadu links between PDF and text.
7    
# Line 126  class CellPDFView: Line 128  class CellPDFView:
128          self.cell = cell          self.cell = cell
129          self.content = space.cellTexter.getEnfilade(cell, None)          self.content = space.cellTexter.getEnfilade(cell, None)
130          self.pap = getPDFPapers(self.content)          self.pap = getPDFPapers(self.content)
131          self.irregu = IrreguFrame(0.2, 2, 1.5, # XXX          self.irregu = IrreguFrame(0.06, 2, 1.5, # XXX
132                          1)                          0.5)
133      # Height = always 1.      # Height = always 1.
134      # Start = always (0,0)      # Start = always (0,0)
135      def placepapers(self, vs,      def placepapers(self, vs,
# Line 168  class CellPDFView: Line 170  class CellPDFView:
170    
171          pp = PutPapers()          pp = PutPapers()
172          if cliprect:          if cliprect:
173              irr = vs.coords.affineCoordsys(0, 0, 0.2, 0.1, 0.90, 0, 0, 0.50)              irr = vs.coords.affineCoordsys(0, 0,
174  #                   (cliprect[0]+cliprect[2])/2,                      (cliprect[0]+cliprect[2])/2,
175  #                   (cliprect[1]+cliprect[3])/2,                      (cliprect[1]+cliprect[3])/2,
176  #                   (cliprect[2]-cliprect[0])/2,                      (cliprect[2]-cliprect[0])/2,
177  #                   0, 0,                      0, 0,
178  #                   (cliprect[3]-cliprect[1])/2)                      (cliprect[3]-cliprect[1])/2)
179              vs.matcher.add(irr, key+"_irr")              vs.matcher.add(irr, key+"_irr")
180              c0 = vs.coords.affineCoordsys(0, 10, 500, 500, 300, 0, 0, 300)  
181              vs.matcher.add(c0, key+"_c0")              class FrameR(java.lang.Runnable):
182              vs.map.put(self.white)                  def run(rself):
183              vs.map.put(self.irregu.frame, c0, irr)                      vs.map.put(self.black)
184              vs.map.put(self.black)                      vs.map.put(self.irregu.frame, cs1into, irr)
185              vs.map.put(self.irregu.content, c0, irr)              class ContentR(java.lang.Runnable):
186              print "Irr: ",c0,self.irregu.frame, self.irregu.content                  def run(rself):
187                        vs.map.put(self.white)
188                        vs.map.put(self.irregu.content, cs1into, irr)
189                Stencil.drawStenciled(vs,
190                    ContentR(),
191                    None,
192                    FrameR(),
193                    pp,
194                    0)
195                
196          else:          else:
197              pp.run()              pp.run()
198    
# Line 440  class XuPDFScene_PDFZoom: Line 451  class XuPDFScene_PDFZoom:
451          vs.matcher.add(cs1_trans, globalcursor.getId()+"__trans")          vs.matcher.add(cs1_trans, globalcursor.getId()+"__trans")
452    
453          if self.clip:          if self.clip:
454              clip = (-10+globalx, -1+globaly, 10+globalx, 10+globaly)              clip = (-0.2+globalx, -0.2+globaly, 0.2+globalx, 0.2+globaly)
455          else:          else:
456              clip = None              clip = None
457          globalview.placepapers(vs, cs1_trans,          globalview.placepapers(vs, cs1_trans,

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26