harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r440748 [5/25] - in /incubator/harmony/enhanced/classlib/trunk/modules: accessibility/src/main/java/javax/accessibility/ awt/ awt/make/ awt/src/main/java/common/java/awt/ awt/src/main/java/common/java/awt/datatransfer/ awt/src/main/java/com...
Date Wed, 06 Sep 2006 16:06:30 GMT
Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/FontPeerImpl.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/FontPeerImpl.java?view=diff&rev=440748&r1=440747&r2=440748
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/FontPeerImpl.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/FontPeerImpl.java
Wed Sep  6 09:06:15 2006
@@ -34,13 +34,6 @@
  */
 public abstract class FontPeerImpl implements FontPeer{
 
-    // logical family types (indices in FontManager.LOGICAL_FONT_NAMES)
-    static final int DIALOG = 3;        // FF_SWISS
-    static final int SANSSERIF = 1;     // FF_SWISS
-    static final int DIALOGINPUT = 4;   // FF_MODERN
-    static final int MONOSPACED = 2;    // FF_MODERN
-    static final int SERIF = 0;         // FF_ROMAN
-
     // ascent of this font peer (in pixels)
     int ascent;
 
@@ -78,10 +71,10 @@
     Rectangle2D maxCharBounds;
 
     // italic angle value of this font peer
-    float italicAngle;
+    float italicAngle = 0.0f;
 
     // the number of glyphs supported by this font peer
-    int numGlyphs;
+    int numGlyphs = 0;
 
     // native font handle
     long pFont;
@@ -110,22 +103,20 @@
      */
     int fontType = FontManager.FONT_TYPE_UNDEF;
 
-    /** 
-     * The number of Font objects, that link to this font peer.
-     * If the number of linking fonts is equal to null this
-     * font peer can be disposed. Depends on FontManager implementation.
-     */
-    private int numRefs = 1; 
-
     /**
      * Flag if this Font was created from stream, 
      * this parameter used in finilize method.
      */ 
-    private boolean createdFromStream = false;
+    private boolean createdFromStream = false;  
     
     // temorary Font file name, if this FontPeerImpl was created from InputStream 
     private String tempFontFileName = null;     
+    
+    // cached FontExtraMetrics object related to this font peer
+    FontExtraMetrics extraMetrix = null;
 
+    public abstract FontExtraMetrics getExtraMetrics();
+    
     /**
      * Returns LineMetrics object with specified parameters
      * @param str specified String
@@ -139,7 +130,14 @@
      * Returns postscript name of the font.  
      */
     public abstract String getPSName();
-
+    
+    /**
+     * Set postscript name of the font to the specified parameter.  
+     */
+    public void setPSName(String name){
+        this.psName = name;
+    }
+    
     /**
      * Returns code of the missing glyph. 
      */
@@ -150,7 +148,7 @@
      * @param ch specified char
      */
     public abstract Glyph getGlyph(char ch);
-    
+
     /**
      * Disposes nesessary resources.
      */
@@ -167,7 +165,7 @@
     public abstract boolean canDisplay(char c);
 
     /**
-     * Returns fanily name of the font in specified locale settings.
+     * Returns family name of the font in specified locale settings.
      * @param l specified Locale
      */
     public String getFamily(Locale l){
@@ -175,6 +173,13 @@
     }
 
     /**
+     * Sets family name of the font in specified locale settings.
+     */
+    public void setFamily(String familyName){
+        this.fontFamilyName = familyName;
+    }
+
+    /**
      * Returns face name of the font in specified locale settings.
      * @param l specified Locale
      */
@@ -183,6 +188,13 @@
     }
 
     /**
+     * Sets font name of the font in specified locale settings.
+     */
+    public void setFontName(String fontName){
+        this.faceName = fontName;
+    }
+
+    /**
      * Returns true, if this font peer was created from InputStream, false otherwise.
      * In case of creating fonts from InputStream some font peer implementations 
      * may need to free temporary resources.
@@ -217,30 +229,6 @@
     }
 
     /**
-     * Returns the number of active font references to this font peer object. 
-     */
-    public int getNumRefs(){
-        return this.numRefs;
-    }
-
-    /**
-     * Increases the number of active font references to this font peer object. 
-     */
-    public int addRef(){
-        this.numRefs++;
-        return this.numRefs;
-    }
-
-    
-    /**
-     * Decreases the number of active font references to this font peer object. 
-     */
-    public int removeRef(){
-        this.numRefs--;
-        return this.numRefs;
-    }
-
-    /**
      * Returns the advance width of the specified char of this FontPeerImpl.
      * Note, if glyph is absent in the font's glyphset - returned value 
      * is the advance of the deafualt glyph. For escape-chars returned 
@@ -453,7 +441,7 @@
      * Returns type of this font.
      *  
      * @return one of constant font type values. 
-     */
+     */    
     public int getFontType(){
         return fontType;
     }
@@ -467,6 +455,17 @@
         if (newType == FontManager.FONT_TYPE_T1 || newType == FontManager.FONT_TYPE_TT){
             fontType = newType;
         }
+    }
+
+    /**
+     * Sets new font type to the font object.
+     * 
+     * @param newType new type value
+     */
+    protected void finalize() throws Throwable {
+      super.finalize();
+      
+      dispose();
     }
 
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/FontProperty.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/FontProperty.java?view=diff&rev=440748&r1=440747&r2=440748
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/FontProperty.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/FontProperty.java
Wed Sep  6 09:06:15 2006
@@ -27,7 +27,7 @@
  *
  */
 public class FontProperty {
-    
+
     // font file name 
     String fileName = null;
     

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/Glyph.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/Glyph.java?view=diff&rev=440748&r1=440747&r2=440748
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/Glyph.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/Glyph.java
Wed Sep  6 09:06:15 2006
@@ -27,7 +27,7 @@
 public abstract class Glyph{
 
     // character of the glyph
-    char glChar; 
+    char glChar;
     
     // precise glyph metrics
     GlyphMetrics glMetrics;
@@ -61,7 +61,7 @@
      */
     
     //  top side bearing
-    public int bmp_top = 0; 
+    public int bmp_top = 0;
     
     // left side bearing
     public int bmp_left = 0;
@@ -72,7 +72,7 @@
     // number of rows
     public int bmp_rows;
     
-    // number of rows
+    // width of the row
     public int bmp_width;
 
     /**
@@ -139,7 +139,7 @@
     public void setGlyphJustificationInfo(GlyphJustificationInfo newJustInfo){
         this.glJustInfo = newJustInfo;
     }
-    
+
     /**
      * Returns an int array of 3 elements, so-called ABC structure that contains 
      * the width of the character:
@@ -193,7 +193,7 @@
     public int getPointHeight(){
         return (int)glPointMetrics.getBounds2D().getHeight();
     }
-    
+
     /**
      * Returns width of the glyph in points. 
      */

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/LineMetricsImpl.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/LineMetricsImpl.java?view=diff&rev=440748&r1=440747&r2=440748
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/LineMetricsImpl.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/LineMetricsImpl.java
Wed Sep  6 09:06:15 2006
@@ -27,7 +27,7 @@
  */
 
 public class LineMetricsImpl extends LineMetrics implements Cloneable{
-    
+
     // array of baseline offsets
     float[] baselineOffsets;
 
@@ -84,7 +84,7 @@
 
     // Ascent of the font (in pixels)
     int lAscent;
- 
+    
     // Descent of the font (in pixels)
     int lDescent;
 
@@ -93,7 +93,7 @@
 
     // units per EM square in font value
     int units_per_EM = 0;
-    
+
     /**
      * Creates LineMetricsImpl object from specified parameters. If baseline data parameter
      * is null than {0, (-ascent+descent)/2, -ascent} values are used for baseline offsets.
@@ -161,7 +161,23 @@
 
     }
 
-
+    /**
+     * Creates LineMetricsImpl object from specified parameters. If baseline data parameter
+     * is null than {0, (-ascent+descent)/2, -ascent} values are used for baseline offsets.
+     *  
+     * @param _numChars number of chars 
+     * @param _baseLineIndex index of the baseline offset
+     * @param _baselineOffsets an array of baseline offsets
+     * @param _underlineThickness underline thickness
+     * @param _underlineOffset underline offset
+     * @param _strikethroughThickness strikethrough thickness
+     * @param _strikethroughOffset strinkethrough offset
+     * @param _leading leading of the font
+     * @param _height font height
+     * @param _ascent ascent of the font
+     * @param _descent descent of the font
+     * @param _maxCharWidth max char width
+     */
     public LineMetricsImpl(int _numChars, int _baseLineIndex,
             float[] _baselineOffsets, float _underlineThickness,
             float _underlineOffset, float _strikethroughThickness,

Added: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/image/DataBufferListener.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/image/DataBufferListener.java?view=auto&rev=440748
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/image/DataBufferListener.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/image/DataBufferListener.java
Wed Sep  6 09:06:15 2006
@@ -0,0 +1,30 @@
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/**
+ * @author Igor V. Stolyarov
+ * @version $Revision$
+ * Created on 13.03.2006
+ *
+ */
+package org.apache.harmony.awt.gl.image;
+
+public interface DataBufferListener {
+    
+    void dataChanged();
+    void dataTaken();
+    void dataReleased();
+
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/opengl/GL.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/opengl/GL.java?view=auto&rev=440748
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/opengl/GL.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/opengl/GL.java
Wed Sep  6 09:06:15 2006
@@ -0,0 +1,290 @@
+package org.apache.harmony.awt.gl.opengl;
+
+
+import org.apache.harmony.awt.nativebridge.*;
+
+/**
+ * This file is based on OGL header and has been generated by the nativebridge tool.
+ *
+ * @author Oleg V. Khaschansky
+ * @version $Revision$
+ *
+ */
+public class GL extends BasicLibWrapper {
+    static GL instance;
+
+    public static synchronized GL getInstance() {
+        if (instance == null) {
+            instance = new GL();
+        }
+        return instance;
+    }
+
+    private GL() {
+        System.loadLibrary("oglwrapper");
+        init();
+    }
+
+    private static native void init();
+
+    public final void glVertexPointer(int size, int type, int stride, VoidPointer pointer)
{
+        long tmp_0 = pointer == null ? 0 : pointer.longLockPointer();
+        glVertexPointer(size, type, stride, tmp_0);
+        if (pointer != null) {
+            pointer.unlock();
+        }
+    }
+    public final native void glVertexPointer(int size, int type, int stride, long pointer);
+
+    public final native void glPixelStoref(int pname, float param);
+
+    public final native void glRectd(double x1, double y1, double x2, double y2);
+
+    public final native void glTranslated(double x, double y, double z);
+
+    public final native void glLineStipple(int factor, short pattern);
+
+    public final native void glBlendFunc(int sfactor, int dfactor);
+
+    public final void glColor4ubv(String v) {
+        Int8Pointer _v = null == v? null :  nb.createInt8Pointer(v, false);
+        long tmp_0 = _v == null ? 0 : _v.longLockPointer();
+        glColor4ubv(tmp_0);
+        if (_v != null) {
+            _v.unlock();
+            _v.free();
+        }
+    }
+    public final void glColor4ubv(Int8Pointer v) {
+        long tmp_0 = v == null ? 0 : v.longLockPointer();
+        glColor4ubv(tmp_0);
+        if (v != null) {
+            v.unlock();
+        }
+    }
+    public final native void glColor4ubv(long v);
+
+    public final void glTexImage1D(int target, int level, int internalformat, int width,
int border, int format, int type, VoidPointer pixels) {
+        long tmp_0 = pixels == null ? 0 : pixels.longLockPointer();
+        glTexImage1D(target, level, internalformat, width, border, format, type, tmp_0);
+        if (pixels != null) {
+            pixels.unlock();
+        }
+    }
+    public final native void glTexImage1D(int target, int level, int internalformat, int
width, int border, int format, int type, long pixels);
+
+    public final native void gluOrtho2D(double left, double right, double bottom, double
top);
+
+    public final native void glDrawArrays(int mode, int first, int count);
+
+    public final native void glPixelStorei(int pname, int param);
+
+    public final native void glTexParameteri(int target, int pname, int param);
+
+    public final native void glRotated(double angle, double x, double y, double z);
+
+    public final void glGetIntegerv(int pname, Int32Pointer params) {
+        long tmp_0 = params == null ? 0 : params.longLockPointer();
+        glGetIntegerv(pname, tmp_0);
+        if (params != null) {
+            params.unlock();
+        }
+    }
+    public final native void glGetIntegerv(int pname, long params);
+
+    public final void glTexGendv(int coord, int pname, DoublePointer params) {
+        long tmp_0 = params == null ? 0 : params.longLockPointer();
+        glTexGendv(coord, pname, tmp_0);
+        if (params != null) {
+            params.unlock();
+        }
+    }
+    public final native void glTexGendv(int coord, int pname, long params);
+
+    public final native void glTexCoord2d(double s, double t);
+
+    public final native void glPixelTransferf(int pname, float param);
+
+    public final native void glCopyTexSubImage2D(int target, int level, int xoffset, int
yoffset, int x, int y, int width, int height);
+
+    public final native void glEnd();
+
+    public final native void glColorMask(byte red, byte green, byte blue, byte alpha);
+
+    public final native void glFlush();
+
+    public final native void glMatrixMode(int mode);
+
+    public final native void glTexEnvf(int target, int pname, float param);
+
+    public final native void glPixelZoom(float xfactor, float yfactor);
+
+    public final native void glScissor(int x, int y, int width, int height);
+
+    public final native int glGetError();
+
+    public final void glDrawPixels(int width, int height, int format, int type, VoidPointer
pixels) {
+        long tmp_0 = pixels == null ? 0 : pixels.longLockPointer();
+        glDrawPixels(width, height, format, type, tmp_0);
+        if (pixels != null) {
+            pixels.unlock();
+        }
+    }
+    public final native void glDrawPixels(int width, int height, int format, int type, long
pixels);
+
+    public final native void glCopyPixels(int x, int y, int width, int height, int type);
+
+    public final native void glBlendFuncSeparate(int param_0, int param_1, int param_2, int
param_3);
+
+    public final native void glEnableClientState(int array);
+
+    public final void glMultMatrixd(DoublePointer m) {
+        long tmp_0 = m == null ? 0 : m.longLockPointer();
+        glMultMatrixd(tmp_0);
+        if (m != null) {
+            m.unlock();
+        }
+    }
+    public final native void glMultMatrixd(long m);
+
+    public final native void glClear(int mask);
+
+    public final native void glPopMatrix();
+
+    public final void glColorPointer(int size, int type, int stride, VoidPointer pointer)
{
+        long tmp_0 = pointer == null ? 0 : pointer.longLockPointer();
+        glColorPointer(size, type, stride, tmp_0);
+        if (pointer != null) {
+            pointer.unlock();
+        }
+    }
+    public final native void glColorPointer(int size, int type, int stride, long pointer);
+
+    public final native void glScaled(double x, double y, double z);
+
+    public final native void glDisable(int cap);
+
+    public final native void glRasterPos2i(int x, int y);
+
+    public final native void glEnable(int cap);
+
+    public final void glBitmap(int width, int height, float xorig, float yorig, float xmove,
float ymove, String bitmap) {
+        Int8Pointer _bitmap = null == bitmap? null :  nb.createInt8Pointer(bitmap, false);
+        long tmp_0 = _bitmap == null ? 0 : _bitmap.longLockPointer();
+        glBitmap(width, height, xorig, yorig, xmove, ymove, tmp_0);
+        if (_bitmap != null) {
+            _bitmap.unlock();
+            _bitmap.free();
+        }
+    }
+    public final void glBitmap(int width, int height, float xorig, float yorig, float xmove,
float ymove, Int8Pointer bitmap) {
+        long tmp_0 = bitmap == null ? 0 : bitmap.longLockPointer();
+        glBitmap(width, height, xorig, yorig, xmove, ymove, tmp_0);
+        if (bitmap != null) {
+            bitmap.unlock();
+        }
+    }
+    public final native void glBitmap(int width, int height, float xorig, float yorig, float
xmove, float ymove, long bitmap);
+
+    public final void glColorTable(int param_0, int param_1, int param_2, int param_3, int
param_4, VoidPointer param_5) {
+        long tmp_0 = param_5 == null ? 0 : param_5.longLockPointer();
+        glColorTable(param_0, param_1, param_2, param_3, param_4, tmp_0);
+        if (param_5 != null) {
+            param_5.unlock();
+        }
+    }
+    public final native void glColorTable(int param_0, int param_1, int param_2, int param_3,
int param_4, long param_5);
+
+    public final void glGenTextures(int n, Int32Pointer textures) {
+        long tmp_0 = textures == null ? 0 : textures.longLockPointer();
+        glGenTextures(n, tmp_0);
+        if (textures != null) {
+            textures.unlock();
+        }
+    }
+    public final native void glGenTextures(int n, long textures);
+
+    public final native void glFinish();
+
+    public final void glDeleteTextures(int n, Int32Pointer textures) {
+        long tmp_0 = textures == null ? 0 : textures.longLockPointer();
+        glDeleteTextures(n, tmp_0);
+        if (textures != null) {
+            textures.unlock();
+        }
+    }
+    public final native void glDeleteTextures(int n, long textures);
+
+    public final native void glDisableClientState(int array);
+
+    public final native void glBegin(int mode);
+
+    public final native void glVertex2d(double x, double y);
+
+    public final native void glLineWidth(float width);
+
+    public final void glLoadMatrixd(DoublePointer m) {
+        long tmp_0 = m == null ? 0 : m.longLockPointer();
+        glLoadMatrixd(tmp_0);
+        if (m != null) {
+            m.unlock();
+        }
+    }
+    public final native void glLoadMatrixd(long m);
+
+    public final void glReadPixels(int x, int y, int width, int height, int format, int type,
VoidPointer pixels) {
+        long tmp_0 = pixels == null ? 0 : pixels.longLockPointer();
+        glReadPixels(x, y, width, height, format, type, tmp_0);
+        if (pixels != null) {
+            pixels.unlock();
+        }
+    }
+    public final native void glReadPixels(int x, int y, int width, int height, int format,
int type, long pixels);
+
+    public final native void glBindTexture(int target, int texture);
+
+    public final native void glPushMatrix();
+
+    public final native void glTexGeni(int coord, int pname, int param);
+
+    public final native void glStencilFunc(int func, int ref, int mask);
+
+    public final void glTexImage2D(int target, int level, int internalformat, int width,
int height, int border, int format, int type, VoidPointer pixels) {
+        long tmp_0 = pixels == null ? 0 : pixels.longLockPointer();
+        glTexImage2D(target, level, internalformat, width, height, border, format, type,
tmp_0);
+        if (pixels != null) {
+            pixels.unlock();
+        }
+    }
+    public final native void glTexImage2D(int target, int level, int internalformat, int
width, int height, int border, int format, int type, long pixels);
+
+    public final void glPixelMapusv(int map, int mapsize, Int16Pointer values) {
+        long tmp_0 = values == null ? 0 : values.longLockPointer();
+        glPixelMapusv(map, mapsize, tmp_0);
+        if (values != null) {
+            values.unlock();
+        }
+    }
+    public final native void glPixelMapusv(int map, int mapsize, long values);
+
+    public final native void glViewport(int x, int y, int width, int height);
+
+    public final native void glLoadIdentity();
+
+    public final void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int
width, int height, int format, int type, VoidPointer pixels) {
+        long tmp_0 = pixels == null ? 0 : pixels.longLockPointer();
+        glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, tmp_0);
+        if (pixels != null) {
+            pixels.unlock();
+        }
+    }
+    public final native void glTexSubImage2D(int target, int level, int xoffset, int yoffset,
int width, int height, int format, int type, long pixels);
+
+    public final native void glDrawBuffer(int mode);
+
+    public final native void glReadBuffer(int mode);
+
+    public final native void glStencilOp(int fail, int zfail, int zpass);
+
+}
+



Mime
View raw message