[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz ./TODO gzz/view/xubuoy.py
From: |
Benja Fallenstein |
Subject: |
[Gzz-commits] gzz ./TODO gzz/view/xubuoy.py |
Date: |
Thu, 03 Oct 2002 15:30:31 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Benja Fallenstein <address@hidden> 02/10/03 15:30:31
Modified files:
. : TODO
gzz/view : xubuoy.py
Log message:
Text works, except for rotation bug. Last commit today.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/TODO.diff?tr1=1.237&tr2=1.238&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/xubuoy.py.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
Patches:
Index: gzz/TODO
diff -c gzz/TODO:1.237 gzz/TODO:1.238
*** gzz/TODO:1.237 Thu Oct 3 14:50:37 2002
--- gzz/TODO Thu Oct 3 15:30:31 2002
***************
*** 26,33 ****
which allows papers to work without register combiners.
- both texenv() and blending need to be set there.
benja:
! - xupdf:
! - text
tuukkah:
- when a gl window is closed, call Binder.windowClosed()
- unit tests for libcoords:
--- 26,45 ----
which allows papers to work without register combiners.
- both texenv() and blending need to be set there.
benja:
! [ All done. Text now works in cvs, EXCEPT for a strange BUG:
! when shown as a buoy, the text inside the box is rotated w.r.t.
! the box. Seems to me this is a bug in the coordinate stuff,
! because nothing in the view hierarchy called there uses any
! of GL's specific coordset types, just the vanilla OrthoCoorder
! one, so if a child cs is rotated w.r.t. a parent cs, something
! is wrong. -- Note also that I've changed xubuoy so that
! the view-specific bindings are disabled when in a client mode
! other than Fallback.NORMAL-- so that text input works. HOWEVER:
! when typing a few words of text in a cell, my client crashes;
! I've successfully used extedit to avoid this at one point today
! (to use extedit, remember to set the EDITOR environment variable).
! --
! Hope all goes well with the demo! -b. ]
tuukkah:
- when a gl window is closed, call Binder.windowClosed()
- unit tests for libcoords:
Index: gzz/gzz/view/xubuoy.py
diff -c gzz/gzz/view/xubuoy.py:1.20 gzz/gzz/view/xubuoy.py:1.21
*** gzz/gzz/view/xubuoy.py:1.20 Thu Oct 3 14:41:29 2002
--- gzz/gzz/view/xubuoy.py Thu Oct 3 15:30:31 2002
***************
*** 73,90 ****
fps = vs.coords.coordsys(0, 10, 10, 20, 1.5, 1.5)
vs.matcher.add(fps, "FPS")
vs.map.put(fps_text, fps, 0)
lineconn = GLRen.createLineConnector(0,0)
class XuPDFBuoy:
! def __init__(self, linkindex, link, enfoverlap, cellview, win):
self.cursor = None
self.link = link
self.linkindex = linkindex
self.linkspan = link[linkindex].getList()[0]
- self.cellview = cellview
- self.win = win
self.mat = enfoverlap.getMatches(link[linkindex])
l = [m for m in self.mat]
if len(l) == 0:
--- 73,114 ----
fps = vs.coords.coordsys(0, 10, 10, 20, 1.5, 1.5)
vs.matcher.add(fps, "FPS")
vs.map.put(fps_text, fps, 0)
+
+ style = GraphicsAPI.getInstance().getTextStyle("SansSerif",
java.awt.Font.PLAIN, 10)
+ contview = gzz.view.LinebrokenCellContentView(style)
+ cellview = gzz.view.CellVobFactory(contview)
+
+ class EmptyContext(gzz.view.ViewContext):
+ emptylist = java.util.ArrayList()
+ getAccursed = lambda self: None
+ getCursorColors = lambda self, c: self.emptylist
+ getDims = lambda self: []
+ getCursorOffset = lambda self, c: -1
+ isMarked = lambda self, c: 0
+ getView = lambda self: None
+ getCellView = lambda self: None
+ getCellContentView = lambda self: None
+ getWindow = lambda self: None
+
+ emptyContext = EmptyContext()
+
+ DEFAULT_TEXT_WIDTH = 200
+ def puttext(cell, vs, cs, scale):
+ w = DEFAULT_TEXT_WIDTH * scale
+ h = contview.getHeight(cell, w, scale)
+ cs_t = vs.coords.translateXY(cs, -w/2.0, -h/2.0)
+ vs.matcher.add(cs, cell.getId()+"__text")
+ cellview.place(cell, vs, cs_t, w, h, emptyContext, scale)
lineconn = GLRen.createLineConnector(0,0)
class XuPDFBuoy:
! def __init__(self, linkindex, link, enfoverlap):
self.cursor = None
self.link = link
self.linkindex = linkindex
self.linkspan = link[linkindex].getList()[0]
self.mat = enfoverlap.getMatches(link[linkindex])
l = [m for m in self.mat]
if len(l) == 0:
***************
*** 134,140 ****
mainpoint = globalview.paperpoint(mainpage,
mainp.x-mainoffsp.x+0.5*maind.width,
mainp.y-mainoffsp.y+0.5*maind.height)
else:
! mainpoint = (.5, .5)
main_end_cs = vs.coords.coordsys(maincs, -20, mainpoint[0],
mainpoint[1], 0, 0)
--- 158,164 ----
mainpoint = globalview.paperpoint(mainpage,
mainp.x-mainoffsp.x+0.5*maind.width,
mainp.y-mainoffsp.y+0.5*maind.height)
else:
! mainpoint = (0, 0)
main_end_cs = vs.coords.coordsys(maincs, -20, mainpoint[0],
mainpoint[1], 0, 0)
***************
*** 169,179 ****
link_end_cs = vs.coords.coordsys(cs1_trans, -20, self.pctr[0],
self.pctr[1], 0, 0)
else:
! d = java.awt.Dimension()
! self.cellview.getDefaultSize(1.1, d)
! cs1_text = vs.coords.translateXY(cs1, -d.width/2.0, -d.height/2.0)
! vs.matcher.add(cs1_text, cell.getId()+"__text")
! self.cellview.place(cell, vs, cs1_text, d.width, d.height,
self.win, 1)
link_end_cs = vs.coords.coordsys(cs1, -20, 0, 0, 0, 0)
--- 193,199 ----
link_end_cs = vs.coords.coordsys(cs1_trans, -20, self.pctr[0],
self.pctr[1], 0, 0)
else:
! puttext(cell, vs, cs1, 1.2)
link_end_cs = vs.coords.coordsys(cs1, -20, 0, 0, 0, 0)
***************
*** 265,276 ****
self.currentvs = None
self.corner1 = None
- self.cv = gzz.view.CellVobFactory()
- self.textsize = java.awt.Dimension()
- self.cv.getDefaultSize(1.6, self.textsize)
-
def key(self, key):
global currentScene
if key == 'M':
rotatelist(self.modes)
elif key == 'm':
--- 285,295 ----
self.currentvs = None
self.corner1 = None
def key(self, key):
global currentScene
+ fallback = self.win.getFallback()
+ if fallback.mode != fallback.NORMAL: return 1
+
if key == 'M':
rotatelist(self.modes)
elif key == 'm':
***************
*** 499,510 ****
if ispdf(self.cursor):
self.view.placepapers(vs, cs1_trans, cliprect = clip,
fancy = self.usefancypaper, showTessel = self.showtessel)
else:
! d = self.textsize
! cs1_text = vs.coords.translateXY(cs1, -d.width/2.0, -d.height/2.0)
! vs.matcher.add(cs1_text, self.cursor.getId()+"__text")
! self.cv.place(self.cursor, vs, cs1_text, d.width, d.height,
! self.win, 1.6);
self.buoys = []
--- 518,527 ----
if ispdf(self.cursor):
self.view.placepapers(vs, cs1_trans, cliprect = clip,
fancy = self.usefancypaper, showTessel = self.showtessel)
+ maincs = cs1_trans
else:
! puttext(self.cursor, vs, cs1, 1.6)
! maincs = cs1
self.buoys = []
***************
*** 514,521 ****
if self.modes[0].context:
for forwlink in globalforw:
b = XuPDFBuoy(1, (getattr(forwlink, "from"), forwlink.to),
! enfoverlap = enfoverlap, cellview=self.cv, win=self.win)
! b.add(vs, 1, bfforw, maincs = cs1_trans,
globalview = self.view,
globalusefancypaper = self.usefancypaper,
globalshowtessel = self.showtessel,
--- 531,538 ----
if self.modes[0].context:
for forwlink in globalforw:
b = XuPDFBuoy(1, (getattr(forwlink, "from"), forwlink.to),
! enfoverlap = enfoverlap)
! b.add(vs, 1, bfforw, maincs = maincs,
globalview = self.view,
globalusefancypaper = self.usefancypaper,
globalshowtessel = self.showtessel,
***************
*** 523,530 ****
self.buoys.append(b)
for backlink in globalback:
b = XuPDFBuoy(0,(getattr(backlink,"from"), backlink.to),
! enfoverlap = enfoverlap, cellview=self.cv, win=self.win)
! b.add(vs, 1, bf, maincs = cs1_trans,
globalview = self.view,
globalusefancypaper = self.usefancypaper,
globalshowtessel = self.showtessel,
--- 540,547 ----
self.buoys.append(b)
for backlink in globalback:
b = XuPDFBuoy(0,(getattr(backlink,"from"), backlink.to),
! enfoverlap = enfoverlap)
! b.add(vs, 1, bf, maincs = maincs,
globalview = self.view,
globalusefancypaper = self.usefancypaper,
globalshowtessel = self.showtessel,
***************
*** 543,548 ****
--- 560,566 ----
if not self.views.has_key(win):
fb = win.getFallback()
self.views[win] = XuPDFScene_PDFContext(fb.linkSpace, win)
+ cellview.setSpace(fb.space)
return self.views[win]
def windowClosed(self, win): pass
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz ./TODO gzz/view/xubuoy.py,
Benja Fallenstein <=