GRX graphics library and Kaffe

1999-12-22 Thread Ganesh Sivaraman

Hello Peter,

Been a long time since we communicated on this issue. I wasn't able to
look into the Kaffe Custom Edition for some time. But this is what I have
been able to do in the last few days.

I read thru the whole structure of Kaffe.

This is what I have done.

kaffe-19990929 untarred in the following 

/root/kaffe-19990929
|
|+ build-gnu
|
|
|+ build-smx-vc++  
|
|
|-+ build-win32-vc++
|
|
|-+ build-wince-vc++ 
|
|
|-+ src  


Did the necessary modification to the Makefile in 

/root/kaffe-19990929/build-gnu/libraries/clib/awt

so that Kaffe uses the framebuffer instead of X11.(Please have a look at
the Makefile attachement). For this, I have installed the GRX2.3 graphics
library. The test progs of GRX works just fine and also the REGRESSION in
kaffe works fine. But when I run a simple AWT based application it give
the following ERROR. I have attached the AFrame.java file also.

[root@fobar awt]# kaffe AFrame
java.lang.ExceptionInInitializerError: [exception was
java.lang.ExceptionInInitializerError: [exception was
java.lang.ExceptionInInitializerError: [exception was
java.lang.ExceptionInInitializerError: [exception was
java.lang.UnsatisfiedLinkError: awt
at AFrame.main(12)   

Could you point out as to where I have goofed up?

Awaiting reply...please reply asap as I will be going on my one month
vacation and need to produce some kind of result before that.

Wish you a Merry X'mas.

Rgds,

Ganesh.


On Fri, 19 Nov 1999, Peter C. Mehlitz wrote:

 Ganesh,
 
 Please contact [EMAIL PROTECTED] to learn more about the Custom ed. With
 respect to the "standalone AWT" (the one which doesn't use a native windowing
 system), I can give you more technical infos.
 
 This thing is a complete AWT (including some optional, customizable desktop
 functionality), which is based on a macro interface to a standard 2D
 graphics library (typically contains about 1500 loc), looking like this:
 
 ...
 /*
  * Draw line
  *  gr   Graphics object used for drawing
  *  x0,y0start point
  *  x1,y1end point
  */
 #define LINE_DRAW(_gr,_x0,_y0,_x1,_y1)  \
   MGL_lineCoord( _x0,_y0,_x1,_y1)
 ...
 
 My reference platform for initial development has been GRX (because it was
 avail for DOS, Linux svgalib and X), but there have been other ports, too
 (Allegro, for instance). I'm currently in the process of porting it to MGL.
 New ports typically take about 4 weeks, depending on the development platform
 and the target lib.
 
 The whole AWT is a JNI lib, with nativ state caching for increased performance.
 
 -- Peter
 
 -- 
   Peter C. Mehlitz  Tel:  +1 510 704 1527
   Transvirtual Technologies, Inc.,  Fax:  +1 510 704 1893
   Berkeley, CA, USA.Email:[EMAIL PROTECTED]
 




# Generated automatically from Makefile.in by configure.
# generic AWT support for standard Java libraries
# Changed on 18/12/1999. Originaly used for X but modified for GRX library
# Copyright (c) 1998
#   Transvirtual Technologies, Inc.  All rights reserved.
#
# See the file "lib-license.terms" for information on usage and redistribution 
# of this file. 

VPATH=  
./../../../../src/libraries/clib/awt:./../../../../src/libraries/clib/awt/no-native-wm/grx

srcdir= ./../../../../src/libraries/clib/awt/
awtsubdir=  no-native-wm/grx
prefix= /usr/local
exec_prefix=${prefix}
nativedir=  ${prefix}/share/kaffe/lib/i386-linux
CC= gcc
LD= ld
AR= ar cr
RANLIB= ranlib
INCLUDES=   -I$(srcdir) -I../../../include -I$(srcdir)/../../../include 
-I../../../config -I$(srcdir)/../../../config -I$(srcdir)/$(awtsubdir) 
-I/usr/src/grx-2.3/include
INCPATH= -I/root/kaffe-19990929/build-gnu/./../src/kaffe/kaffevm 
-I/root/kaffe-19990929/build-gnu/./../src/kaffe/kaffevm/systems/unix-jthreads
LIBPATH=
CFLAGS= -g -O2
WALL=   -Wall
ALL_CFLAGS= $(CFLAGS) $(WALL) $(INCLUDES) $(INCPATH) $(EXTRA_CFLAGS)
INSTALL=/usr/bin/install -c
INSTALL_DATA=   ${INSTALL} -m 644
MKDIR=  mkdir -p
LN= ln -s
TOUCH=  touch
DLLTOOL=true
PIC=-fpic
LDFLAGS=-shared
LIBS=   -lvga -lpng -ljpeg -lXext -lX11 -lz -ldl -lm -lc -lpthread  
-L/usr/src/grx-2.3/lib/unix -lgrx20
LDTAIL=  -L/usr/src/grx-2.3/lib/unix -lgrx20 -ljpeg -lpng -lz 
KVER=   1.00
OBJEXT= .o
LIBEXT= .so

LIBNAME=libawt
LIB=$(LIBNAME)$(LIBEXT)
LIBV=   $(LIBNAME)$(LIBEXT).$(KVER)

WRAPPER_CMD="s%^\(Java_[^(]*\).*$$%KAFFE_NATIVE(\1)%p"

OBJECT=

all:$(LIB)

# GRX based AWT support for standard Java libraries
#
# Copyright (c) 1998
#   Transvirtual Technologies, Inc.  All rights reserved.
#
# See 

Re: BufferedInputReader

1999-12-22 Thread Kero van Gelder


  I encountered a small problem using the BufferedInputStream.
  When telling it to skip a big number of bytes, it stops at the first
  2k boundary (or, more precisely, from position 32 to skip 37919 bytes
  lets it stop at position 2048).
 
 This is not a bug.  The skip() method as defined in FilterInputStream
 is not required to skip the number of bytes requested.
 
 Ref: 
http://java.sun.com/products/jdk/1.2/docs/api/java/io/BufferedInputStream.html#skip(long)

Forgive my ignorance!

I guess there is no use in complaining about such a useless API in
this newsgroup, is there? Sorry, but I could not possibly imagine that
this was _not_ a bug... Not that ``for a variety of reasons'' is a
clear way of telling when skip(n) might not skip n bytes.

(if anybody knows an alternative call that I can use, mail me :-)

I guess I'll ByteArray my files instead of Buffering them. Fast enough
and no problems with 2k boundaries. Lucky for me my files are only
several 100k long.

 No code was stolen :-) Kaffe tries to behave like JDK whenever possible
 and in this case is just using the same default buffer size (eg., 2048).

Fine with me. Sorry if I appeared harsh.
(But it is something to be wary about.)

 Presumably, JDK and kaffe use the same (obvious) skip() algorithm,
 i.e., skip remaining buffered data first.

Apparently...

It's good to test programs on 1 JVM, preferably 1.1 and 1.2
mixed.

Merry Christmas everybody!
Kero.

+--- Kero -- [EMAIL PROTECTED] ---+
| If there were no hell to pay, would you still need a God? |
| -- Leah Androne   |
+--- M38C --- http://www.huizen.dds.nl/~kero ---+