[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz ./Gzz.py ./Makefile doc/gzz.css gzz/client/...
From: |
Benja Fallenstein |
Subject: |
[Gzz-commits] gzz ./Gzz.py ./Makefile doc/gzz.css gzz/client/... |
Date: |
Fri, 03 Jan 2003 13:05:07 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Benja Fallenstein <address@hidden> 03/01/03 13:05:07
Modified files:
. : Gzz.py Makefile
doc : gzz.css
gzz/client : Fallback.java
gzz/media/impl : FakeTextSpan.java
lava/gzz/client: PotionFallbackBinder.java
lava/gzz/potion: AbstractHead.java Call.java
Added files:
lava/gzz/potion/potions: Connect.java PrefixOrOther.java
lava/gzz/view : PendingPotionDecorator.java
metacode/gzz/util: GrepDoclet.java JythonDoclet.java
Removed files:
gzz/util : GrepDoclet.java JythonDoclet.java
Log message:
Potion bindings to show text at the bottom of the window, maturing
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/Gzz.py.diff?tr1=1.58&tr2=1.59&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/Makefile.diff?tr1=1.232&tr2=1.233&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/doc/gzz.css.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/client/Fallback.java.diff?tr1=1.52&tr2=1.53&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/media/impl/FakeTextSpan.java.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/client/PotionFallbackBinder.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/potion/AbstractHead.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/potion/Call.java.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/potion/potions/Connect.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/potion/potions/PrefixOrOther.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/view/PendingPotionDecorator.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/gzz/util/GrepDoclet.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/gzz/util/JythonDoclet.java?rev=1.1
Patches:
Index: gzz/Gzz.py
diff -u gzz/Gzz.py:1.58 gzz/Gzz.py:1.59
--- gzz/Gzz.py:1.58 Wed Jan 1 19:00:49 2003
+++ gzz/Gzz.py Fri Jan 3 13:05:06 2003
@@ -31,6 +31,13 @@
'python-bindings', 'potion-bindings']
+def call(list, type=gzz.potion.CommandCall):
+ if list is None: return None
+ head = list[0]
+ params = [call(l, gzz.potion.FunctionCall) for l in list[1:]]
+ print head, params
+ return type(head(), params)
+
class Gzz(java.lang.Runnable):
"""The main Gzz client class."""
@@ -70,9 +77,9 @@
self.cellViews = [gzz.view.LollipopCellView(self.cellContentView)]
gzz.client.Fallback(self.space.getHomeCell(), self.linkSpace,
- self.binder, self.dimensions, self.views,
- self.viewSpecificBinders, self.cellViews,
- self.filers)
+ self.binder, self.dimensions, self.decorators,
+ self.views, self.viewSpecificBinders,
+ self.cellViews, self.filers)
gzz.client.AbstractUpdateManager.chg()
@@ -93,6 +100,11 @@
def set_defaults(self):
+ self.decorators = [
+ gzz.view.MarkDecorator(),
+ gzz.view.DimDecorator(),
+ ]
+
if 'python-bindings' in self.flags:
print "Using Python bindings"
import bindings
@@ -101,16 +113,29 @@
elif 'potion-bindings' in self.flags:
arr = gzz.client.PotionFallbackBinder.Arrow
- bindings = java.util.HashMap()
- bindings.put('Up', arr(1,1,-1))
- bindings.put('Down', arr(1,1,1))
- bindings.put('Left', arr(1,0,-1))
- bindings.put('Right', arr(1,0,1))
- newCell = gzz.potion.potions.NewCell();
- bindings.put('n', gzz.potion.CommandCall(newCell, [None]))
- self.binder = gzz.client.PotionFallbackBinder(bindings)
+ def map(dict):
+ m = java.util.HashMap()
+ for k,v in dict.items(): m.put(k, v)
+ return m
+
+ from gzz.potion.potions import NewCell, Connect, PrefixOrOther
+
+ bindings = {
+ 'Up': arr(1,1,-1), 'i': arr(1,1,-1), 'e': arr(0,1,-1),
+ 'Down': arr(1,1,1), ',': arr(1,1,1), 'c': arr(0,1,1),
+ 'Left': arr(1,0,-1), 'j': arr(1,0,-1), 's': arr(0,1,-1),
+ 'Right': arr(1,0,1), 'l': arr(1,0,1), 'f': arr(0,0,1),
+ 'k': arr(1,2,1), 'K': arr(1,2,-1),
+ 'd': arr(0,2,1), 'D': arr(0,2,-1),
+ 'n': call([NewCell, None]),
+ '-': call([Connect, [PrefixOrOther], None])
+ }
+
+ self.binder = gzz.client.PotionFallbackBinder(map(bindings))
+ self.decorators.append(gzz.view.PendingPotionDecorator())
else:
self.binder = gzz.view.DefaultBinder()
+ self.decorators.append(gzz.view.LastOpDecorator())
self.spanType = java.lang.System.getProperty("gzz.spanType")
self.spaceType = java.lang.System.getProperty("gzz.spaceType")
Index: gzz/Makefile
diff -u gzz/Makefile:1.232 gzz/Makefile:1.233
--- gzz/Makefile:1.232 Fri Jan 3 02:16:56 2003
+++ gzz/Makefile Fri Jan 3 13:05:06 2003
@@ -176,20 +176,11 @@
PP=gzz/modules/pp/*.java gzz/modules/pp/vob/*.java
-# Can't add ZZClangOps since javac complains of doubly defined class...
-# maybe should use uniq?
-SRC0:=$(GENERATED) `find gzz/ -name "*.java"` `find test/gzz/ -name "*.java"`
-
-
-LAVASRC:= `find lava/gzz/ -name "*.java"` `find lava/test/gzz/ -name "*.java"`
-#$(wildcard lava/gzz/*.java lava/gzz/impl/*.java lava/gzz/impl/errors/*.java
lava/gzz/impl/mirror/*.java lava/gzz/storm/*.java lava/gzz/util/*.java
lava/gzz/storm/headers/*.java lava/gzz/storm/impl/*.java)
-
BASALTSRC:= $(wildcard basalt/gzz/*.java basalt/gzz/impl/*.java)
-# Remove duplicates
+# Tempfile
tmpfile := $(shell mktemp /tmp/fileXXXXXX)
foo := $(shell echo 1>&2 "Tempfile is $(tmpfile)")
-SRC:=$(shell echo $(SRC0) | perl -pe 's/\s+/\n/g' - | sort | uniq | egrep -v
'Doclet\.java$$'| tee $(tmpfile))
# jikes := $(shell which jikes)
# Disable for now, since on debian jikes is at a bad version
@@ -230,7 +221,7 @@
# $(JAVAC) -deprecation $(DEBUG) -d $(CLASSDIR) BuildInfo.java
# fix circular dependency problem in clean builds
# -deprecation
- $(JAVAC) $(DEBUG) -d $(CLASSDIR) $(SRC)
+ $(JAVAC) $(DEBUG) -d $(CLASSDIR) `find gzz/ -name "*.java"` `find
test/gzz/ -name "*.java"`
$(archcompile)
qc: ready_to_compile
@@ -323,12 +314,12 @@
GrepDoclet:
mkdir -p $(CLASSDIR)
echo $$CLASSPATH
- $(JAVAC) $(DEBUG) -d $(CLASSDIR) gzz/util/GrepDoclet.java
+ $(JAVAC) $(DEBUG) -d $(CLASSDIR) metacode/gzz/util/GrepDoclet.java
JythonDoclet:
mkdir -p $(CLASSDIR)
echo $$CLASSPATH
- $(JAVAC) $(DEBUG) -d $(CLASSDIR) gzz/util/JythonDoclet.java
+ $(JAVAC) $(DEBUG) -d $(CLASSDIR) metacode/gzz/util/JythonDoclet.java
clean:
$(RM) -r $(CLASSDIR)
@@ -504,7 +495,7 @@
lava:: compile-lava test-lava
compile-lava:
- $(JAVAC) $(DEBUG) -d $(CLASSDIR) $(LAVASRC)
+ $(JAVAC) $(DEBUG) -d $(CLASSDIR) `find lava/gzz/ -name "*.java"` `find
lava/test/gzz/ -name "*.java"`
test-lava:
$(GLLIB) $(JYTHON) test/testutil.py $(DBG) $(wildcard ./lava/test/)
test-lava-junit:
Index: gzz/doc/gzz.css
diff -u gzz/doc/gzz.css:1.11 gzz/doc/gzz.css:1.12
--- gzz/doc/gzz.css:1.11 Wed Jan 1 10:47:30 2003
+++ gzz/doc/gzz.css Fri Jan 3 13:05:06 2003
@@ -158,7 +158,8 @@
pre.literal-block, pre.doctest-block {
margin-left: 2em ;
- margin-right: 2em }
+ margin-right: 2em ;
+ font-family: fixed }
span.classifier {
font-family: sans-serif ;
Index: gzz/gzz/client/Fallback.java
diff -u gzz/gzz/client/Fallback.java:1.52 gzz/gzz/client/Fallback.java:1.53
--- gzz/gzz/client/Fallback.java:1.52 Thu Dec 5 20:03:50 2002
+++ gzz/gzz/client/Fallback.java Fri Jan 3 13:05:06 2003
@@ -74,7 +74,7 @@
* It implements a subset of the 0.6.0 bindings.
*/
public class Fallback {
-public static final String rcsid = "$Id: Fallback.java,v 1.52 2002/12/06
01:03:50 benja Exp $";
+public static final String rcsid = "$Id: Fallback.java,v 1.53 2003/01/03
18:05:06 benja Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
@@ -137,7 +137,7 @@
public FallbackDim[] dimList;
- Set decorators;
+ FallbackSceneDecorator[] decorators;
public class Win extends AbstractShower implements ViewContext, Binder {
public Cell cursor;
@@ -166,6 +166,12 @@
return (Win)windowList.get(i);
}
+ public Win getOther() {
+ if(windows[LEFT] == this) return windows[RIGHT];
+ if(windows[RIGHT] == this) return windows[LEFT];
+ throw new IllegalStateException("No other window");
+ }
+
/**
* @returns true if this was the last window.
*/
@@ -256,11 +262,9 @@
VobScene sc = this.screen.window.createVobScene();
sc.map.put(new SolidBgVob(bg), 0);
- for(Iterator i=decorators.iterator(); i.hasNext();) {
- FallbackSceneDecorator dec =
- (FallbackSceneDecorator)i.next();
- if(dbg) pa("Call scene decorator: "+dec);
- dec.render(sc, 0, Fallback.this, this);
+ for(int i=0; i<decorators.length; i++) {
+ if(dbg) pa("Call scene decorator: "+decorators[i]);
+ decorators[i].render(sc, 0, Fallback.this, this);
}
getView().render(sc, 0, this);
@@ -343,11 +347,12 @@
}
public Fallback(Cell start, Space linkSpace, FallbackBinder binder,
- FallbackDim[] dimList,
- View[] viewList, Map viewSpecificBinders,
+ FallbackDim[] dimList, FallbackSceneDecorator[] decorators,
+ View[] viewList, Map viewSpecificBinders,
CellView[] cellViewList, Filer.Group filers) {
this.binder = binder;
this.dimList = dimList;
+ this.decorators = decorators;
this.viewList = viewList;
this.viewSpecificBinders = viewSpecificBinders;
this.filers = filers;
@@ -379,11 +384,6 @@
windows[0].screen.window.setLocation(0, 0, w, h);
windows[1].screen.window.setLocation(w, 0, w, h);
-
- decorators = new HashSet();
- decorators.add(new DimDecorator());
- decorators.add(new LastOpDecorator());
- decorators.add(new MarkDecorator());
AbstractUpdateManager.chg();
}
Index: gzz/gzz/media/impl/FakeTextSpan.java
diff -u gzz/gzz/media/impl/FakeTextSpan.java:1.6
gzz/gzz/media/impl/FakeTextSpan.java:1.7
--- gzz/gzz/media/impl/FakeTextSpan.java:1.6 Wed Jan 1 19:00:49 2003
+++ gzz/gzz/media/impl/FakeTextSpan.java Fri Jan 3 13:05:06 2003
@@ -34,10 +34,10 @@
*/
public class FakeTextSpan implements TextSpan, java.io.Serializable {
-public static final String rcsid = "$Id: FakeTextSpan.java,v 1.6 2003/01/02
00:00:49 benja Exp $";
+public static final String rcsid = "$Id: FakeTextSpan.java,v 1.7 2003/01/03
18:05:06 benja Exp $";
String text;
- FakeTextScrollBlock sb;
+ transient FakeTextScrollBlock sb;
transient char[] textarr;
public FakeTextSpan(String s) {
Index: gzz/lava/gzz/client/PotionFallbackBinder.java
diff -u gzz/lava/gzz/client/PotionFallbackBinder.java:1.2
gzz/lava/gzz/client/PotionFallbackBinder.java:1.3
--- gzz/lava/gzz/client/PotionFallbackBinder.java:1.2 Wed Jan 1 19:00:49 2003
+++ gzz/lava/gzz/client/PotionFallbackBinder.java Fri Jan 3 13:05:06 2003
@@ -34,11 +34,11 @@
Object binding = bindings.get(k);
if(dbg) pa("Binding: "+binding);
- if(binding == null)
- // no binding for this key
- return;
-
- else if(binding instanceof CommandCall) {
+ if(binding == null) {
+ // no binding for this key: clear pending
+ currentAction = null;
+ AbstractUpdateManager.chg();
+ } else if(binding instanceof CommandCall) {
currentAction = (CommandCall)binding;
if(dbg) pa("Replaced currentAction.");
if(currentAction.isComplete()) {
Index: gzz/lava/gzz/potion/AbstractHead.java
diff -u gzz/lava/gzz/potion/AbstractHead.java:1.2
gzz/lava/gzz/potion/AbstractHead.java:1.3
--- gzz/lava/gzz/potion/AbstractHead.java:1.2 Mon Dec 2 20:33:19 2002
+++ gzz/lava/gzz/potion/AbstractHead.java Fri Jan 3 13:05:06 2003
@@ -42,7 +42,7 @@
if(params[p] != null)
s += params[p].getString(context);
else
- ((Type)spec[i]).getQuestionString();
+ s += ((Type)spec[i]).getQuestionString();
p++;
} else
Index: gzz/lava/gzz/potion/Call.java
diff -u gzz/lava/gzz/potion/Call.java:1.6 gzz/lava/gzz/potion/Call.java:1.7
--- gzz/lava/gzz/potion/Call.java:1.6 Wed Jan 1 19:00:49 2003
+++ gzz/lava/gzz/potion/Call.java Fri Jan 3 13:05:06 2003
@@ -65,7 +65,7 @@
public Call setNextParam(FunctionExpression expr) {
FunctionExpression[] n = new FunctionExpression[params.length];
int i=0;
- while(i<params.length) {
+ for(; i<params.length; i++) {
if(params[i] == null) {
n[i] = expr;
break;
@@ -102,7 +102,7 @@
StringBuffer buf = new StringBuffer(head.toString());
buf.append("[");
for(int i=0; i<params.length-1; i++) {
- buf.append(params[i].toString());
+ buf.append(params[i]);
buf.append(", ");
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz ./Gzz.py ./Makefile doc/gzz.css gzz/client/...,
Benja Fallenstein <=