gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] libvob ./rules.mk include/vob/vobs/Irregu.hxx l...


From: Tuomas J. Lukka
Subject: [Gzz-commits] libvob ./rules.mk include/vob/vobs/Irregu.hxx l...
Date: Fri, 25 Apr 2003 07:17:55 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Changes by:     Tuomas J. Lukka <address@hidden>        03/04/25 07:17:54

Modified files:
        .              : rules.mk 
        include/vob/vobs: Irregu.hxx 
        lava/fonts     : fonts.tex 
        org/nongnu/libvob: AbstractColorableVob.java Screen.java 
        org/nongnu/libvob/gl: Paper.java 
        org/nongnu/libvob/impl: DefaultVobMap.java 
        org/nongnu/libvob/impl/awt: FrameScreen.java JUpdateManager.java 
        org/nongnu/libvob/util: Dbg.java InputEventUtil.java 
                                ScalableFont.java 
        org/nongnu/libvob/vobs: OvalBgVob.java 

Log message:
        Drag irregu kicking and screaming into the century of the fruitbat - 
support boxes via sqsize. Remove the dangling p() methods.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/rules.mk.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/vobs/Irregu.hxx.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/lava/fonts/fonts.tex.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/AbstractColorableVob.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/Screen.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/gl/Paper.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/impl/DefaultVobMap.java.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/impl/awt/FrameScreen.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/impl/awt/JUpdateManager.java.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/util/Dbg.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/util/InputEventUtil.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/util/ScalableFont.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/vobs/OvalBgVob.java.diff?tr1=1.4&tr2=1.5&r1=text&r2=text

Patches:
Index: libvob/include/vob/vobs/Irregu.hxx
diff -u libvob/include/vob/vobs/Irregu.hxx:1.6 
libvob/include/vob/vobs/Irregu.hxx:1.7
--- libvob/include/vob/vobs/Irregu.hxx:1.6      Tue Apr 22 06:16:50 2003
+++ libvob/include/vob/vobs/Irregu.hxx  Fri Apr 25 07:17:54 2003
@@ -117,27 +117,40 @@
         // Normalize tearaway part unit vectors in paper coords to get border 
widths
         // Note: we assume that coords2 is an affine transform so that the 
border (ripple) width
         //       is translation invariant
-        const T &cs2inv = coords2.getInverse();
-        ZVec xvec = (coords2.transform(ZPt(1,0,0)) - 
coords2.transform(ZPt(0,0,0))).normalized();
-        ZVec yvec = (coords2.transform(ZPt(0,1,0)) - 
coords2.transform(ZPt(0,0,0))).normalized();
+        // const T &cs2inv = coords2.getInverse();
+        float bx = border / (coords2.transform(ZPt(1,0,0)) - 
coords2.transform(ZPt(0,0,0))).length();
+        float by = border /  (coords2.transform(ZPt(0,1,0)) - 
coords2.transform(ZPt(0,0,0))).length();
+
+        DBG(dbg_irregularquad) << "Bordercalc: " << border<<" "<<
+           coords2.transform(ZPt(0,0,0)) << " " <<
+           coords2.transform(ZPt(1,0,0)) << " " <<
+           coords2.transform(ZPt(0,1,0)) << " " <<
+           bx<<" "<<by<<" \n";
+
 
         //cout << (coords2.transform(ZPt(1,0,0)) - 
coords2.transform(ZPt(0,0,0)))
         //     << (coords2.transform(ZPt(0,1,0)) - 
coords2.transform(ZPt(0,0,0))) << "\n";
         
-        float bx = border * (cs2inv.transform(ZPt(0,0,0) + xvec) - 
cs2inv.transform(ZPt(0,0,0))).length();
-        float by = border * (cs2inv.transform(ZPt(0,0,0) + yvec) - 
cs2inv.transform(ZPt(0,0,0))).length();
+       /*
+        float bx = border * ( (cs2inv.transform(ZPt(0,0,0) + xvec) 
+                             - cs2inv.transform(ZPt(0,0,0)))).length();
+        float by = border * ( (cs2inv.transform(ZPt(0,0,0) + yvec) 
+                             - cs2inv.transform(ZPt(0,0,0)))).length();
+           */
 
         //cout << bx << "," << by << "\n";
 
-        float x0 = 1;
-        float x1 = 1 - bx;
-        float x2 = 1 - 2 * bx;
+       Pt box = coords2.getSqSize();
+
+        float x0 = box.x;
+        float x1 = box.x - bx;
+        float x2 = box.x - 2 * bx;
         float mx0 = 0;
         float mx1 = 0 + bx;
         float mx2 = 0 + 2 * bx;
-        float y0 = 1;
-        float y1 = 1 - by;
-        float y2 = 1 - 2 * by;
+        float y0 = box.y;
+        float y1 = box.y - by;
+        float y2 = box.y - 2 * by;
         float my0 = 0;
         float my1 = 0 + by;
         float my2 = 0 + 2 * by;
@@ -147,17 +160,13 @@
         float wtbl[] = { 1, 1, 1, 1, w, w, w, w };
 
         ZPt ctr = coords2.transform(ZPt(0,0,0));
-        double r1 = (coords2.transform(ZPt(1,1,0)) - ctr).length();
-        double r2 = (coords2.transform(ZPt(1,0,0)) - ctr).length();
-        double r3 = (coords2.transform(ZPt(0,1,0)) - ctr).length();
-        double r4 = (coords2.transform(ZPt(-1,0,0)) - ctr).length();
-        double r5 = (coords2.transform(ZPt(0,-1,0)) - ctr).length();
+        double r1 = (coords2.transform(ZPt(box.x,box.y,0)) - ctr).length();
+        double r2 = (coords2.transform(ZPt(box.x,0,0)) - ctr).length();
+        double r3 = (coords2.transform(ZPt(0,box.y,0)) - ctr).length();
 
        double r = r1;
        if(r < r2) r = r2;
        if(r < r3) r = r3;
-       if(r < r4) r = r4;
-       if(r < r5) r = r5;
         double nonl = dicefactor * coords1.nonlinearity(ctr, r);
 
         int diceb = (int)fabs(2 * border * sqrt(2) * nonl) + 1;
@@ -331,6 +340,8 @@
 
        DBG(dbg_irregularquad) << "Reserve "<<n<<"\n";
         std::vector<ZPt> vert(n+1);
+
+       Pt box = coords2.getSqSize();
         
         switch (shape) {
         case 1:
@@ -364,17 +375,18 @@
 
             float poww = 2 + (shape - 8) * 3;
            DBG(dbg_irregularquad) << "GetEllipse type2 "<<n<<" "<<poww<<"\n";
-            vert = Irregu::getEllipse(n, poww * pow(xw/120, 0.2), poww * 
pow(yw/120, 0.2));
+            vert = Irregu::getEllipse(n, poww * pow(box.x * xw/120, 0.2), poww 
* pow(box.y * yw/120, 0.2));
             }
             break;
         }
 
+
        DBG(dbg_irregularquad) << "Resize "<<(n+1)<<"\n";
         vert.resize(n + 1);
         vert[n] = vert[0];
         for (unsigned int i=0; i<vert.size(); i++) {
-            vert[i].x = 0.5*(vert[i].x+1);
-            vert[i].y = 0.5*(vert[i].y+1);
+            vert[i].x = 0.5*(vert[i].x+1) * box.x;
+            vert[i].y = 0.5*(vert[i].y+1) * box.y;
         }
        DBG(dbg_irregularquad) << "trans\n";
         Irregu::transform(coords2, vert);
Index: libvob/lava/fonts/fonts.tex
diff -u libvob/lava/fonts/fonts.tex:1.1 libvob/lava/fonts/fonts.tex:1.2
--- libvob/lava/fonts/fonts.tex:1.1     Thu Apr 17 11:19:44 2003
+++ libvob/lava/fonts/fonts.tex Fri Apr 25 07:17:54 2003
@@ -4,6 +4,66 @@
 \usepackage{bbm}
 \begin{document}
 
+\section{Ad hoc Ideas}
+
+
+\subsection{Darkening}
+
+Using "twice the ink", i.e.~doubling the alpha from an alpha text 
+texture or calculating $1-2(1-x)$ for intensity makes
+letters look crisper and better.
+
+Assumes trilinear filtering is used.
+
+Status: In use; helps somewhat.
+
+\subsection{Subpixel rendering by texture accesses}
+
+Status: Works.
+
+
+\subsection{Distance filtering}
+
+For bi-level functions, let the texture value be the minimum
+distance (in texture space) to a texel of different color.
+Filter using nearest-neighbour texture access mode and comparing
+the distance to the pixel size.
+
+Status: Seems to work if parameters chosen carefully.
+
+\subsection{Distance and direction filtering}
+
+In addition to the distance, store its gradient direction
+(or access the texture to find out). Use to antialias
+oblique ($45^o$) edges more than nearly horizontal or vertical ones.
+
+Status: unknown
+
+\subsection{LOD bias}
+
+(A commonly used texture, trading temporal aliasing for spatial crispness)
+
+Status: unknown for text
+
+\subsection{Background whitening}
+
+Adjust the background texture's color according
+to a blurred sample from the foreground texture. Makes the text
+stand out clearer.
+
+Status: tested, ambiguous results
+
+\subsection{Background blurring}
+
+Adjust the background texture's bias or derivatives according
+to a blurred sample from the foreground texture. Makes the background
+"move away" from interfering with the foreground.
+
+Status: unknown
+
+%------------------------------------------
+\section{Rigorous treatment}
+
 Notation: Original function: $f(x) : \mathbbmss{R}^2 \rightarrow [0,1]$.  
 Pixellated function: $g(p) : \mathbbmss{N}^2 \rightarrow [0,1]$.
 
@@ -25,12 +85,12 @@
 \item Examine distance-based filtering for bi-level functions.
 \end{itemize}
 
-\section{Sets of unfiltered functions}
+\subsection{Sets of unfiltered functions}
 
 Can be defined through fourier transforms (bad) or various
 correlation statistics.
 
-\section{Distance functions}
+\subsection{Distance functions}
 
 Simple squared distance of area integrals.
 
@@ -43,13 +103,13 @@
 in the middle of the pixels.
 However, when the line is sloping, the jaggies will have to be dealt with in 
that way.
 
-\section{Calculations}
+\subsection{Calculations}
 
 Lots of integrals of distance function distributions.
 Analytic or \emph{Monte Carlo}. For Monte Carlo, could use 
 GPU for integrations!!
 
-\section{Research questions / goals}
+\subsection{Research questions / goals}
 
 First: focus on bi-level functions; start with lines and curves.
 
Index: libvob/org/nongnu/libvob/AbstractColorableVob.java
diff -u libvob/org/nongnu/libvob/AbstractColorableVob.java:1.1 
libvob/org/nongnu/libvob/AbstractColorableVob.java:1.2
--- libvob/org/nongnu/libvob/AbstractColorableVob.java:1.1      Thu Apr 10 
16:01:48 2003
+++ libvob/org/nongnu/libvob/AbstractColorableVob.java  Fri Apr 25 07:17:54 2003
@@ -40,9 +40,9 @@
  */
 public abstract class AbstractColorableVob extends AbstractVob
     implements ColorableVob, Cloneable {
-    public static final String rcsid = "$Id: AbstractColorableVob.java,v 1.1 
2003/04/10 20:01:48 humppake Exp $";
+    public static final String rcsid = "$Id: AbstractColorableVob.java,v 1.2 
2003/04/25 11:17:54 tjl Exp $";
     public static boolean dbg = false;
-    static final void p(String s) { if(dbg) System.out.println(s); }
+    static final void pa(String s) { System.out.println(s); }
 
     /** An array to store colors. The default value is null, but 
      * otherwise the array contains never null values.
Index: libvob/org/nongnu/libvob/Screen.java
diff -u libvob/org/nongnu/libvob/Screen.java:1.2 
libvob/org/nongnu/libvob/Screen.java:1.3
--- libvob/org/nongnu/libvob/Screen.java:1.2    Fri Mar  7 06:38:20 2003
+++ libvob/org/nongnu/libvob/Screen.java        Fri Apr 25 07:17:54 2003
@@ -37,9 +37,8 @@
  */
 
 public class Screen implements AbstractUpdateManager.Window {
-    public static final String rcsid = "$Id: Screen.java,v 1.2 2003/03/07 
11:38:20 tjl Exp $";
+    public static final String rcsid = "$Id: Screen.java,v 1.3 2003/04/25 
11:17:54 tjl Exp $";
     public static boolean dbg = false;
-    private static void p(String s) { if(dbg) pa(s); }
     private static void pa(String s) { System.err.println(s); }
 
 
Index: libvob/org/nongnu/libvob/gl/Paper.java
diff -u libvob/org/nongnu/libvob/gl/Paper.java:1.1 
libvob/org/nongnu/libvob/gl/Paper.java:1.2
--- libvob/org/nongnu/libvob/gl/Paper.java:1.1  Wed Mar 26 08:15:03 2003
+++ libvob/org/nongnu/libvob/gl/Paper.java      Fri Apr 25 07:17:54 2003
@@ -32,7 +32,6 @@
  */
 public class Paper implements GLDeletable {
     public static boolean dbg = true;
-    private static void p(String s) { if(dbg) System.out.println(s); }
     private static void pa(String s) { System.err.println(s); }
 
     /** The identififier to be passed to C for this object.
Index: libvob/org/nongnu/libvob/impl/DefaultVobMap.java
diff -u libvob/org/nongnu/libvob/impl/DefaultVobMap.java:1.4 
libvob/org/nongnu/libvob/impl/DefaultVobMap.java:1.5
--- libvob/org/nongnu/libvob/impl/DefaultVobMap.java:1.4        Wed Apr  9 
10:45:06 2003
+++ libvob/org/nongnu/libvob/impl/DefaultVobMap.java    Fri Apr 25 07:17:54 2003
@@ -32,9 +32,8 @@
 /** An implementation of VobMap.
  */
 public class DefaultVobMap implements VobMap {
-public static final String rcsid = "$Id: DefaultVobMap.java,v 1.4 2003/04/09 
14:45:06 humppake Exp $";
+public static final String rcsid = "$Id: DefaultVobMap.java,v 1.5 2003/04/25 
11:17:54 tjl Exp $";
     public static boolean dbg = false;
-    private static void p(String s) { if(dbg) pa(s); }
     private static void pa(String s) { System.err.println(s); }
 
     public void setVS(VobScene vs) { }
Index: libvob/org/nongnu/libvob/impl/awt/FrameScreen.java
diff -u libvob/org/nongnu/libvob/impl/awt/FrameScreen.java:1.3 
libvob/org/nongnu/libvob/impl/awt/FrameScreen.java:1.4
--- libvob/org/nongnu/libvob/impl/awt/FrameScreen.java:1.3      Sun Mar 16 
11:07:53 2003
+++ libvob/org/nongnu/libvob/impl/awt/FrameScreen.java  Fri Apr 25 07:17:54 2003
@@ -32,17 +32,16 @@
  */
 
 public class FrameScreen extends AWTScreen {
-public static final String rcsid = "$Id: FrameScreen.java,v 1.3 2003/03/16 
16:07:53 benja Exp $";
+public static final String rcsid = "$Id: FrameScreen.java,v 1.4 2003/04/25 
11:17:54 tjl Exp $";
+    public static boolean dbg = false;
+    private static void pa(String s) { System.out.println(s); }
+
     protected Frame zzFrame;
 
     /** Get the AWT Frame this screen is rendered in.
      */
     public Frame getFrame() { return zzFrame; }
 
-    public static boolean dbg = false;
-    private static void p(String s) { if(dbg) pa(s); }
-    private static void pa(String s) { System.out.println(s); }
-
     public FrameScreen(GraphicsAPI api) {
        super(api);
        zzFrame = new Frame("Gzz");
@@ -82,7 +81,7 @@
     public void chg() {
        // zzFrame.setTitle(screenCell.t()+" - GZigZag");
        //
-       p("FrameScreen chg");
+       if(dbg) pa("FrameScreen chg");
 
        /*if (zzFrame.getComponentCount() != 1) {
            p("FrameScreen chg: add stuff and show");
@@ -102,7 +101,7 @@
           p("SetBounds: "+r+" to "+x+" "+y+" "+w+" "+h);
        */
 
-       p("FrameScreen setloc "+x+" "+y+" "+w+" "+h);
+       if(dbg) pa("FrameScreen setloc "+x+" "+y+" "+w+" "+h);
 
        zzFrame.setSize(w, h);
        zzFrame.setLocation(x, y);
Index: libvob/org/nongnu/libvob/impl/awt/JUpdateManager.java
diff -u libvob/org/nongnu/libvob/impl/awt/JUpdateManager.java:1.4 
libvob/org/nongnu/libvob/impl/awt/JUpdateManager.java:1.5
--- libvob/org/nongnu/libvob/impl/awt/JUpdateManager.java:1.4   Wed Apr  9 
10:09:26 2003
+++ libvob/org/nongnu/libvob/impl/awt/JUpdateManager.java       Fri Apr 25 
07:17:54 2003
@@ -33,9 +33,8 @@
 import java.awt.image.*;
 
 public class JUpdateManager extends AbstractUpdateManager {
-public static final String rcsid = "$Id: JUpdateManager.java,v 1.4 2003/04/09 
14:09:26 tjl Exp $";
+public static final String rcsid = "$Id: JUpdateManager.java,v 1.5 2003/04/25 
11:17:54 tjl Exp $";
     private static boolean dbg = false;
-    private static void p(String s) { if(dbg) pa(s); }
     private static void pa(String s) { System.err.println(s); }
 
     public JUpdateManager(Runnable r) { super(r); }
@@ -80,7 +79,7 @@
 
     private Thread t = new Thread(this);
     {
-       p("STARTORDTHREAD");
+       if(dbg) pa("STARTORDTHREAD");
        t.start();
     }
 
@@ -109,7 +108,7 @@
        synchronized(ordering) {
            if(handleEvents_nohang()) return true;
            try {
-               p("JUpdateManager: going to wait for next event");
+               if(dbg) pa("JUpdateManager: going to wait for next event");
                // We wait on 'ordering' since that is also
                // what is notified by AbstractUpdateManager.chg()
                ordering.wait();
Index: libvob/org/nongnu/libvob/util/Dbg.java
diff -u libvob/org/nongnu/libvob/util/Dbg.java:1.1 
libvob/org/nongnu/libvob/util/Dbg.java:1.2
--- libvob/org/nongnu/libvob/util/Dbg.java:1.1  Tue Mar 25 07:04:10 2003
+++ libvob/org/nongnu/libvob/util/Dbg.java      Fri Apr 25 07:17:54 2003
@@ -37,11 +37,11 @@
  * class Foo {
  *     static public boolean dbg = false;
  *      ...
- *     private final void p(String s) { if(dbg) System.out.println(s); }
+ *     private final void pa(String s) { System.out.println(s); }
  *      ...
  *      ...
  *      void method() {
- *         p("Here");
+ *         if(dbg) pa("Here");
  *         ...
  *         if(dbg)
  *             object-&lt;printDebugInfo();
@@ -83,10 +83,10 @@
  */
 
 public final class Dbg {
-public static final String rcsid = "$Id: Dbg.java,v 1.1 2003/03/25 12:04:10 
tjl Exp $";
+public static final String rcsid = "$Id: Dbg.java,v 1.2 2003/04/25 11:17:54 
tjl Exp $";
 
     static boolean dbg = true;
-    final void p(String s) { if(dbg) System.out.println(s); }
+    final void pa(String s) { System.out.println(s); }
 
     List dbgClasses = new ArrayList();
 
@@ -96,7 +96,7 @@
      */
     public void debugClass(String name, boolean dbg) {
        try {
-           p("Turning on debugging for class "+name);
+           if(dbg) pa("Turning on debugging for class "+name);
            Class clazz = Class.forName("gzz."+name);
            Field f = clazz.getField("dbg");
            f.setBoolean(null, dbg);
@@ -104,7 +104,7 @@
            dbgClasses.add(f);
        } catch(Exception e) {
            e.printStackTrace();
-           p(""+e);
+           if(dbg) pa(""+e);
            throw new Error("Error while turning on debug info");
        }
     }
Index: libvob/org/nongnu/libvob/util/InputEventUtil.java
diff -u libvob/org/nongnu/libvob/util/InputEventUtil.java:1.1 
libvob/org/nongnu/libvob/util/InputEventUtil.java:1.2
--- libvob/org/nongnu/libvob/util/InputEventUtil.java:1.1       Sun Mar  9 
08:13:14 2003
+++ libvob/org/nongnu/libvob/util/InputEventUtil.java   Fri Apr 25 07:17:54 2003
@@ -46,9 +46,8 @@
  */
 
 public class InputEventUtil {
-public static final String rcsid = "$Id: InputEventUtil.java,v 1.1 2003/03/09 
13:13:14 tjl Exp $";
+public static final String rcsid = "$Id: InputEventUtil.java,v 1.2 2003/04/25 
11:17:54 tjl Exp $";
     public static boolean dbg = false;
-    static final void p(String s) { if(dbg) System.out.println(s); }
     static final void pa(String s) { System.out.println(s); }
 
     static public String getKeyEventName(KeyEvent k) {
@@ -77,7 +76,7 @@
        int kc = k.getKeyCode();
        String kt = KeyEvent.getKeyText(kc);
        String kbychar = new String(new char[] {c});
-       p("Have: "+c+" "+kc+" '"+kt+"' '"+kbychar+"'");
+       if(dbg) pa("Have: "+c+" "+kc+" '"+kt+"' '"+kbychar+"'");
        /** Map key codes to key names.
         *  We need this because KeyEvent.getKeyText() is (urks) localized. 
That's
         *  all very nice, but unusable for our purposes: on a German system, 
Java
@@ -120,7 +119,7 @@
             t = kt;
        else
            t = kt; // bychar; // XXX
-       p("Chose: "+t);
+       if(dbg) pa("Chose: "+t);
        if(t.equals("\n")) t = "Enter";
        if(t.equals("\t")) t = "Tab";
        if(t.equals("\033")) t = "Esc";
@@ -141,7 +140,7 @@
           Character.isISOControl(t.charAt(0)) ||
           k.isAltDown() || k.isControlDown()
           ) {
-           p("Maybe rechoosing");
+           if(dbg) pa("Maybe rechoosing");
            if(kc != 0)
                t = kt;
            if(k.isShiftDown()) t = "Shift-"+t;
@@ -149,19 +148,19 @@
        if(k.isAltDown()) t = "Alt-"+t;
        if(k.isControlDown()) t = "Ctrl-"+t;
 
-       p("KEYTEXT: '" + t + "', was by kt: '"+kt+"' and by char: '"
+       if(dbg) pa("KEYTEXT: '" + t + "', was by kt: '"+kt+"' and by char: '"
          +kbychar+"'");
 
        return t;
     }
 
     public static String getKeyEventName2(KeyEvent k) {
-           p("getKeyEventName2() active");
+           if(dbg) pa("getKeyEventName2() active");
        /* First we'll check for normal typing as this is the way
           They say everyone should do it */
        if(k.getID() == k.KEY_TYPED) {
            char c = k.getKeyChar();
-           p("KEY_TYPED event: '"+c+"'");
+           if(dbg) pa("KEY_TYPED event: '"+c+"'");
            if(c == k.CHAR_UNDEFINED
                 // k.CHAR_UNDEFINED changed between JDK1.1 and 1.2
                 || c == 0x0 || c == 0xFFFF) // needed for cross-compiling
@@ -188,7 +187,7 @@
        int kc = k.getKeyCode();
        String kt = KeyEvent.getKeyText(kc);
        String kbychar = new String(new char[] {c});
-       p("KEY_RELEASED event: "+c+" "+kc+" '"+kt+"' '"+kbychar+"'");
+       if(dbg) pa("KEY_RELEASED event: "+c+" "+kc+" '"+kt+"' '"+kbychar+"'");
        /** Map key codes to key names.
         *  We need this because KeyEvent.getKeyText() is (urks) localized. 
That's
         *  all very nice, but unusable for our purposes: on a German system, 
Java
@@ -223,10 +222,10 @@
            t = "Numpad-Right";
 
        if(t!=null) {
-           p("Returning \""+modifiers+t+"\"");
+           if(dbg) pa("Returning \""+modifiers+t+"\"");
            return modifiers+t;
        }
-       p("Returning null");
+       if(dbg) pa("Returning null");
        return null;
     }
 
Index: libvob/org/nongnu/libvob/util/ScalableFont.java
diff -u libvob/org/nongnu/libvob/util/ScalableFont.java:1.2 
libvob/org/nongnu/libvob/util/ScalableFont.java:1.3
--- libvob/org/nongnu/libvob/util/ScalableFont.java:1.2 Sun Mar 30 14:55:21 2003
+++ libvob/org/nongnu/libvob/util/ScalableFont.java     Fri Apr 25 07:17:54 2003
@@ -38,9 +38,9 @@
  */
 
 public final class ScalableFont {
-    public static final String rcsid = "$Id: ScalableFont.java,v 1.2 
2003/03/30 19:55:21 benja Exp $";
+    public static final String rcsid = "$Id: ScalableFont.java,v 1.3 
2003/04/25 11:17:54 tjl Exp $";
     public static boolean dbg=false;
-    private static final void p(String s) { System.out.println(s); }
+    private static final void pa(String s) { System.out.println(s); }
 
     /** If set, font metrics will not be cached.
      */
@@ -164,28 +164,28 @@
      */
     public float getScale(float height) {
        float start = 1f;
-       if (dbg) p("Start with start: "+start+" height: 
"+getFontMetrics(start).getHeight());
+       if (dbg) pa("Start with start: "+start+" height: 
"+getFontMetrics(start).getHeight());
        while (getFontMetrics(start).getHeight() < height) {
-           if (dbg) p("Increment start, was: "+start);
+           if (dbg) pa("Increment start, was: "+start);
            start += 1f;
        }
-       if (dbg) p("Intended height: " + height);
-       if (dbg) p("Start: "+start);
-       if (dbg) p("Seeking area from " + (start-1f) + " (height: " +
+       if (dbg) pa("Intended height: " + height);
+       if (dbg) pa("Start: "+start);
+       if (dbg) pa("Seeking area from " + (start-1f) + " (height: " +
                   getFontMetrics(start-1f).getHeight() + ") to " + start + " 
(height: " +
                   getFontMetrics(start).getHeight() + ")");
 
        if ((int)getFontMetrics(start-1f).getHeight() == (int)height) {
-           if (dbg) p("Best: " + (start-1f) + " (height: " +
+           if (dbg) pa("Best: " + (start-1f) + " (height: " +
                   getFontMetrics(start-1f).getHeight() + ")");
            return start-1f;
        } else if ((int)getFontMetrics(start).getHeight() == (int)height) {
-           if (dbg) p("Best: " + (start) + " (height: " +
+           if (dbg) pa("Best: " + (start) + " (height: " +
                   getFontMetrics(start).getHeight() + ")");
            return start;
        }
 
-       if (dbg) p("Enters a recursive search for the best font scale for given 
height.");
+       if (dbg) pa("Enters a recursive search for the best font scale for 
given height.");
        return seekBestScale(start-1f, start, 0, height);
        
        /*
@@ -211,17 +211,17 @@
      */
     private float seekBestScale(float start, float end, float best, float 
height) {
        if (getFontMetrics(start).getHeight() > height) return 1; // for 
fail-safety
-       if (dbg) p("Start: " + start + " End: " + end + " Best: " + best + " 
Height: " + height);
+       if (dbg) pa("Start: " + start + " End: " + end + " Best: " + best + " 
Height: " + height);
 
        float current = start + (end-start)/2;
        float current_height = getFontMetrics(current).getHeight();
        float best_height = getFontMetrics(best).getHeight();
 
        if ((int)current_height == (int)height && (int)current_height != 
(int)best_height) {
-           if (dbg) p("Best: " + current_height + " (height: " + 
current_height + ")");
+           if (dbg) pa("Best: " + current_height + " (height: " + 
current_height + ")");
            return current;
        } else if ((int)current_height == (int)best_height) {
-           if (dbg) p("Best: " + best_height + " (height: " + best_height + 
")");
+           if (dbg) pa("Best: " + best_height + " (height: " + best_height + 
")");
            return best;
        } else best = current;
 
Index: libvob/org/nongnu/libvob/vobs/OvalBgVob.java
diff -u libvob/org/nongnu/libvob/vobs/OvalBgVob.java:1.4 
libvob/org/nongnu/libvob/vobs/OvalBgVob.java:1.5
--- libvob/org/nongnu/libvob/vobs/OvalBgVob.java:1.4    Thu Apr 10 16:01:49 2003
+++ libvob/org/nongnu/libvob/vobs/OvalBgVob.java        Fri Apr 25 07:17:54 2003
@@ -42,9 +42,9 @@
  * surrounded by a circle of the current foreground color.
  */
 public class OvalBgVob extends AbstractColorableVob {
-public static final String rcsid = "$Id: OvalBgVob.java,v 1.4 2003/04/10 
20:01:49 humppake Exp $";
+public static final String rcsid = "$Id: OvalBgVob.java,v 1.5 2003/04/25 
11:17:54 tjl Exp $";
     public static boolean dbg = false;
-    private static final void p(String s) { if(dbg) System.out.println(s); }
+    private static final void pa(String s) { System.out.println(s); }
 
     /** Background color */
     protected final Color bgColor;
@@ -191,7 +191,7 @@
     Vob glStencil, glBorder, glList;
 
     public int putGL(final VobScene vs, final int coordsys1) {
-       p("Addtolistgl ovalbg "+coordsys1);
+       if(dbg) pa("Addtolistgl ovalbg "+coordsys1);
 
        if(glList == null) {
            if (!circleGLReady) prepareCircleGL(0.5f);
Index: libvob/rules.mk
diff -u libvob/rules.mk:1.17 libvob/rules.mk:1.18
--- libvob/rules.mk:1.17        Thu Apr 24 13:49:42 2003
+++ libvob/rules.mk     Fri Apr 25 07:17:54 2003
@@ -40,11 +40,11 @@
 
 %.vobjnidep: %.vobgenjni
        $(SHELL) -ec '$(CXX) -x c++ -M $(CPPFLAGS) $< \
-                      | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
+                      | sed '\''s/\($*\)\.o[ :]*/\1.vobjniobj $@ : /g'\'' > 
$@; \
                       [ -s $@ ] || rm -f $@'
 %.transjnidep: %.transgenjni
        $(SHELL) -ec '$(CXX) -x c++ -M $(CPPFLAGS) $< \
-                      | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
+                      | sed '\''s/\($*\)\.o[ :]*/\1.vobjniobj $@ : /g'\'' > 
$@; \
                       [ -s $@ ] || rm -f $@'
 
 %.o: %.cxx




reply via email to

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