fenfire-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ff-cvs] fenfire/org/fenfire/fenpdf fenpdfcontext.py


From: Matti Katila
Subject: [ff-cvs] fenfire/org/fenfire/fenpdf fenpdfcontext.py
Date: Mon, 25 Aug 2003 17:26:21 -0400

CVSROOT:        /cvsroot/fenfire
Module name:    fenfire
Branch:         
Changes by:     Matti Katila <address@hidden>   03/08/25 17:26:21

Modified files:
        org/fenfire/fenpdf: fenpdfcontext.py 

Log message:
        text cursor easily. problem still is the stencil because cursor is 
painted without one. also problem is that chgFast() (sets coordsystems params) 
isn't called and settin pan in main node moves cursor even if it should be at 
center.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/fenpdf/fenpdfcontext.py.diff?tr1=1.27&tr2=1.28&r1=text&r2=text

Patches:
Index: fenfire/org/fenfire/fenpdf/fenpdfcontext.py
diff -u fenfire/org/fenfire/fenpdf/fenpdfcontext.py:1.27 
fenfire/org/fenfire/fenpdf/fenpdfcontext.py:1.28
--- fenfire/org/fenfire/fenpdf/fenpdfcontext.py:1.27    Mon Aug 25 05:28:50 2003
+++ fenfire/org/fenfire/fenpdf/fenpdfcontext.py Mon Aug 25 17:26:21 2003
@@ -101,8 +101,7 @@
        pass
 
 class Context(ff.view.lava.ContextNodeView.Context,
-              ff.view.buoy.AbstractMainNode2D.Context,
-              ff.view.lava.TextHandler.Context):
+              ff.view.buoy.AbstractMainNode2D.Context):
     def __init__(self, win, fen, pp, filename):
         global w
         w = win
@@ -116,21 +115,37 @@
         return self.states.fastChg
 
     # call back from AbstractMainNode2D
-    def mainNodeToBeRender(self, vs, into, main):
-       self.selection = ff.util.lava.view.getView(main, 
ff.view.AreaSelectingView2D)
+    def mainNodeToBeRender(self, vs, into, mainNode):
+       self.selection = ff.util.lava.view.getView(mainNode, 
ff.view.AreaSelectingView2D)
 
-       
-
-        #self.super.mainNodeToBeRender(vs, into, main)
+        if mainNode != self.states.buoymanager.getLastMain(): return
 
         # draw cursor
-        if not self.states.cursor.hasAccursed() and main == 
self.fenPDF.views.getBuoyManager().getLastMain():
-            tmp = jarray.zeros(2, 'f')
-            vs.coords.getSqSize(into, tmp)
-           cursorCS = vs.orthoBoxCS(into, "CURSOR", 0,
-                                     tmp[0]/2, tmp[1]/2, 1,1, tmp[0]/12, 
tmp[1]/12)
-           vs.put(vob.vobs.LineVob(0,0,0,1, java.awt.Color.darkGray), cursorCS)
+        mainNode = self.states.buoymanager.getLastMain()
+        canvas = ff.util.lava.view.getView(mainNode, ff.view.CanvasView2D)
+        if not isinstance(canvas, ff.view.CanvasView2D): return
             
+        xy = jarray.zeros(2, 'f')
+        if not self.states.cursor.hasAccursed():
+            focus = mainNode.getFocus()
+            cs = vs.matcher.getCS(into, 'canvasview_conc')
+           cs = vs.coords.orthoBox(cs,0, focus.getPanX(), focus.getPanY(), 
1,1, 1,1)
+        else:
+            # draw the cursor in somewhere where node is.
+            containerCS = canvas.getContainerCS(vs, into)
+            cs = vs.matcher.getCS(containerCS, 
self.states.cursor.getAccursed())
+            if cs < 0: return
+
+            viewFunction = 
self.states.fenPDF.views.getMultiplexerNodeContentFunction()
+            p = viewFunction.f(self.states.fen.graph, 
self.states.cursor.getAccursed())
+            if isinstance(p, vob.lava.placeable.TextPlaceable):
+                p.getCursorXY(self.states.cursor.getCursorOffset(), xy)
+            else: return 
+                
+        # XXX ugly 
+        height = 24
+        cs = vs.coords.ortho(cs, 0,xy[0],xy[1], 1, -height)
+        vs.put(vob.vobs.ContinuousLineVob(5, [0,0,0 , 0,1,0]), cs)
         
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]