# -*-python-*- import java import vob from org.fenfire.swamp import Nodes from org.nongnu.alph.impl import PageImageScroll from org import fenfire as ff from org.nongnu import alph from org.nongnu import storm from org.fenfire.test import gfx gfx.needGL() def testSomething(): """ fail: GL """ vs = gfx.getvs() # Create fen with swamps. fen = ff.test.fen.newFen() rst = ff.modules.pp.RSTActionsImpl(fen) textstyle = vob.GraphicsAPI.getInstance().getTextStyle("sans", 0, 24) textnodeview = ff.view.TextNodeView(fen.txtfunc, textstyle, 1) view = ff.view.CanvasView2D(fen, textnodeview) view.cull = 1 paperview = ff.view.PaperView2D(gfx.win, view) canvas = rst.newRSTCanvas() parag = rst.newParagraph(canvas, 200, 10,10) senten = rst.newSentence(parag,0) note = ff.swamp.Nodes.N() ff.util.AlphContent(fen).setText(note, 'This is rst canvas test', 1) rst.insertNode(senten, note, 0) mainNode = ff.view.buoy.MainNode2D(canvas, paperview) # set context... context = ff.view.FenPDFContext(fen, rst, textnodeview) context.setAccursed(note) context.setRSTNode(senten) context.setCursorOffset(3) mainNode.context = context rst.util.generateBasicSpatialCoords(canvas, textnodeview) vs.map.put(vob.vobs.SolidBackdropVob(java.awt.Color.green)) into = vs.orthoBoxCS(0, "FocusFrame", 0, 30, 30, 1, 1, 50, 50) mainNode.renderMain(vs, into) gfx.render(vs) # put up some empty nodes and test will jam mainNode.keystroke('Space') mainNode.keystroke('Space') mainNode.keystroke('Space') mainNode.keystroke('Return') rst.util.generateBasicSpatialCoords(canvas, textnodeview) vs.map.put(vob.vobs.SolidBackdropVob(java.awt.Color.green)) into = vs.orthoBoxCS(0, "FocusFrame", 0, 30, 30, 1, 1, 50, 50) mainNode.renderMain(vs, into) gfx.render(vs)