eliminate unnecessary DIRTY macro
authoradam <adam@megacz.com>
Thu, 15 Apr 2004 23:28:55 +0000 (23:28 +0000)
committeradam <adam@megacz.com>
Thu, 15 Apr 2004 23:28:55 +0000 (23:28 +0000)
darcs-hash:20040415232855-5007d-4685e8de2346c8ec19296ad5808f7544ab04e4b0.gz

src/org/ibex/core/Box.java

index 4116c30..4967252 100644 (file)
@@ -133,8 +133,6 @@ public final class Box extends JSScope implements Task {
     private Affine rtransform = null;
     */
 
-    //#define DIRTY dirty()
-
     // Instance Methods /////////////////////////////////////////////////////////////////////
 
     public final int fontSize() { return font == null ? DEFAULT_FONT.pointsize : font.pointsize; }
@@ -145,7 +143,7 @@ public final class Box extends JSScope implements Task {
         if (texture.isLoaded) {
             setWidth(max(texture.width, minwidth), maxwidth); 
             setHeight(max(texture.height, minheight), maxheight); 
-            DIRTY; }
+            dirty(); }
         else { JS res = texture.stream; texture = null; throw new JSExn("image not found: "+res.unclone()); }
     }
 
@@ -242,7 +240,7 @@ public final class Box extends JSScope implements Task {
         } else {
             who.dirty(thisx, thisy, this.width, this.height);
             this.width = width; this.height = height; this.x = x; this.y = y;
-            DIRTY;
+            dirty();
         }
         if (sizechange) putAndTriggerTrapsAndCatchExceptions("SizeChange", T);
     }
@@ -540,14 +538,14 @@ public final class Box extends JSScope implements Task {
         if (name instanceof Number) { put(toInt(name), value); return; }
         //#switch(name)
         case "thisbox":     if (value == null) removeSelf();
-        case "text":        if (value == null) value = ""; CHECKSET_STRING(text); RECONSTRAIN(); DIRTY;
-        case "strokecolor": value = N(Color.stringToColor((String)value)); CHECKSET_INT(strokecolor); DIRTY;
-        case "textcolor":   value = N(Color.stringToColor((String)value)); CHECKSET_INT(strokecolor); DIRTY;
-        case "strokewidth": CHECKSET_SHORT(strokewidth); DIRTY;
+        case "text":        if (value == null) value = ""; CHECKSET_STRING(text); RECONSTRAIN(); dirty();
+        case "strokecolor": value = N(Color.stringToColor((String)value)); CHECKSET_INT(strokecolor); dirty();
+        case "textcolor":   value = N(Color.stringToColor((String)value)); CHECKSET_INT(strokecolor); dirty();
+        case "strokewidth": CHECKSET_SHORT(strokewidth); dirty();
         case "shrink":      CHECKSET_FLAG(HSHRINK | VSHRINK); RECONSTRAIN();
         case "hshrink":     CHECKSET_FLAG(HSHRINK); RECONSTRAIN();
         case "vshrink":     CHECKSET_FLAG(VSHRINK); RECONSTRAIN();
-        case "path":        path = Path.parse(toString(value)); DIRTY;
+        case "path":        path = Path.parse(toString(value)); dirty();
         case "width":       setWidth(toInt(value), toInt(value));
         case "height":      setHeight(toInt(value), toInt(value));
         case "maxwidth":    setWidth(minwidth, toInt(value));
@@ -556,12 +554,12 @@ public final class Box extends JSScope implements Task {
         case "minheight":   setHeight(toInt(value), maxheight);
         case "colspan":     if (toInt(value) > 0) { CHECKSET_SHORT(colspan); if (parent != null) parent.REPACK(); }
         case "rowspan":     if (toInt(value) > 0) { CHECKSET_SHORT(rowspan); if (parent != null) parent.REPACK(); }
-        case "visible":     CHECKSET_FLAG(VISIBLE); RECONSTRAIN(); DIRTY;
+        case "visible":     CHECKSET_FLAG(VISIBLE); RECONSTRAIN(); dirty();
         case "packed":      CHECKSET_FLAG(PACKED); if (parent != null) { parent.REPACK(); } else { REPACK(); }
         case "align":       clear(ALIGNS); setAlign(value == null ? "center" : value); REPLACE();
         case "cursor":      setCursor(value);
         case "fill":        setFill(value);
-        case "clip":        CHECKSET_FLAG(CLIP); if (parent == null) DIRTY; else parent.DIRTY;
+        case "clip":        CHECKSET_FLAG(CLIP); if (parent == null) dirty(); else parent.dirty();
         case "rows": CHECKSET_SHORT(rows); if (rows==0){set(FIXED, COLS);if(cols==0)cols=1;} else set(FIXED, ROWS); REPACK();
         case "cols": CHECKSET_SHORT(cols); if (cols==0){set(FIXED, ROWS);if(rows==0)rows=1;} else set(FIXED, COLS); REPACK();
 
@@ -579,13 +577,13 @@ public final class Box extends JSScope implements Task {
             for(Box cur = (Box)value; cur != null || cur == redirect; cur = cur.parent)
                 if (cur == redirect) { redirect = (Box)value; return; }
             JS.error("redirect can only be set to a descendant of its current value");
-        case "fontsize": font = Font.getFont(font == null ? null : font.stream, toInt(value)); RECONSTRAIN(); DIRTY;
+        case "fontsize": font = Font.getFont(font == null ? null : font.stream, toInt(value)); RECONSTRAIN(); dirty();
         case "font":
             if(!(value instanceof Stream)) throw new JSExn("You can only put streams to the font property");
             if (font == value) return;  // FIXME: unclone()
             font = value == null ? null : Font.getFont((Stream)value, font == null ? 10 : font.pointsize);
             RECONSTRAIN();
-            DIRTY;
+            dirty();
         case "x": if (parent==null && Surface.fromBox(this)!=null) {
             CHECKSET_INT(x);
         } else {
@@ -711,7 +709,7 @@ public final class Box extends JSScope implements Task {
         } else {
             throw new JSExn("fill must be null, a String, or a stream, not a " + value.getClass());
         }
-        DIRTY;
+        dirty();
     }
 
     /**
@@ -847,7 +845,7 @@ public final class Box extends JSScope implements Task {
     public void removeChild(int i) {
         Box b = getChild(i);
         b.RECONSTRAIN();
-        b.DIRTY;
+        b.dirty();
         b.clear(MOUSEINSIDE);
         deleteNode(i);
         b.parent = null;
@@ -907,7 +905,7 @@ public final class Box extends JSScope implements Task {
             b.REPACK();
             REPACK();
             
-            b.DIRTY; 
+            b.dirty(); 
             putAndTriggerTrapsAndCatchExceptions("ChildChange", b);
         }
     }