/[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.8 by tjl, Wed Sep 18 11:39:26 2002 UTC revision 1.9 by tjl, Wed Sep 18 12:02:17 2002 UTC
# Line 1  Line 1 
1  from __future__ import nested_scopes  from __future__ import nested_scopes
2    from gzz.index import XuLink
3  # Now, this is the start of the REAL demo, the one  # Now, this is the start of the REAL demo, the one
4  # with Xanadu links between PDF and text.  # with Xanadu links between PDF and text.
5    
# Line 11  execfile("gfx/libutil/effects.py") Line 12  execfile("gfx/libutil/effects.py")
12    
13  space = gzz.impl.ModularSpace(*tools.spaceArgList())  space = gzz.impl.ModularSpace(*tools.spaceArgList())
14  xuindexer = gzz.index.impl.TransientXuIndexer()  xuindexer = gzz.index.impl.TransientXuIndexer()
15    enfoverlap = gzz.index.IndexManager.getEnfiladeOverlap(space)
16    
17  enfMaker = gzz.media.impl.Enfilade1DImpl.Enfilade1DImplMaker()  enfMaker = gzz.media.impl.Enfilade1DImpl.Enfilade1DImplMaker()
18    
19  # A PDF file  # A PDF file
# Line 31  home = space.getHomeCell() Line 34  home = space.getHomeCell()
34  c1 = home.N(d1)  c1 = home.N(d1)
35  c2 = c1.N(d1)  c2 = c1.N(d1)
36    
37  space.cellTexter.setEnfilade(c1, enfMaker.makeEnfilade(pagescroll1.getCurrent()))  pages1span = pagescroll1.getCurrent()
38  space.cellTexter.setEnfilade(c2, enfMaker.makeEnfilade(pagescroll2.getCurrent()))  pages2span = pagescroll2.getCurrent()
39    pages1 = enfMaker.makeEnfilade(pages1span)
40    pages2 = enfMaker.makeEnfilade(pages2span)
41    
42    xuindexer.add(XuLink(
43        enfMaker.makeEnfilade(pages1span.subSpan(1,2).subArea(100,100,300,100)),
44        enfMaker.makeEnfilade(pages2span.subSpan(2,3).subArea(200,100,200,200))
45        ))
46    
47    space.cellTexter.setEnfilade(c1, pages1)
48    space.cellTexter.setEnfilade(c2, pages2)
49    
50  globalcursor = None  globalcursor = None
51    
# Line 49  def moveToCell(cell): Line 62  def moveToCell(cell):
62      if 1: # PDF      if 1: # PDF
63          list = content.getList()          list = content.getList()
64          print list          print list
65          content = list[0]          contentspan = list[0]
66          prect = [          prect = [
67              GLSpans.getRect(content.subSpan(i,i+1))              GLSpans.getRect(contentspan.subSpan(i,i+1))
68                  for i in range(0,content.length())]                  for i in range(0,content.length())]
69          globalpap = [          globalpap = [
70              pdfpaper(p) for p in prect              pdfpaper(p) for p in prect
71          ]          ]
72    
73        forw = xuindexer.getForwardIndex().getMatches(content)
74        back = xuindexer.getBackwardIndex().getMatches(content)
75    
76        print "Xu: ",forw,back
77    
78      java.lang.System.gc()      java.lang.System.gc()
79      AbstractUpdateManager.chg()      AbstractUpdateManager.chg()
80    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

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