GRX graphics library and Kaffe

Ganesh Sivaraman ganeshs at cc.hut.fi
Wed Dec 22 02:18:06 PST 1999


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 at 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 <info at transvirtual.com> 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,y0    start point
>  *  x1,y1    end 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:    peter at transvirtual.com
> 


-------------- next part --------------
# 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 the file "lib-license.terms" for information on usage and redistribution 
# of this file. 

TDIR=no-native-wm/grx
CDIR=no-native-wm

# files containing exported (native) methods
EXPORTS=$(srcdir)/$(CDIR)/*.c $(srcdir)/$(TDIR)/*.c

OBJECT+=\
		$(TDIR)/tlk$(OBJEXT) \
		$(TDIR)/wnd$(OBJEXT) \
		$(TDIR)/evt$(OBJEXT) \
		$(TDIR)/gra$(OBJEXT) \
		$(TDIR)/fnt$(OBJEXT) \
		$(TDIR)/clr$(OBJEXT) \
		$(TDIR)/img$(OBJEXT) \
		$(CDIR)/imgjpeg$(OBJEXT) \
		$(CDIR)/imgpng$(OBJEXT)  \
		$(CDIR)/cbd$(OBJEXT) \
		$(CDIR)/geometry$(OBJEXT)


HDRS=$(TDIR)/toolkit.h \
     $(CDIR)/toolkit-common-pre.h \
     $(CDIR)/toolkit-common-post.h \
     $(TDIR)/grlib.def

$(TDIR)/tlk$(OBJEXT): $(TDIR)/tlk.c $(HDRS)

$(TDIR)/wnd$(OBJEXT): $(TDIR)/wnd.c $(CDIR)/wnd-common.c $(HDRS)

$(TDIR)/evt$(OBJEXT): $(TDIR)/evt.c $(CDIR)/evt-common.c $(HDRS)

$(TDIR)/gra$(OBJEXT): $(TDIR)/gra.c $(CDIR)/gra-common.c $(HDRS)

$(TDIR)/fnt$(OBJEXT): $(TDIR)/fnt.c $(HDRS)

$(TDIR)/clr$(OBJEXT): $(TDIR)/clr.c $(CDIR)/clr-common.c $(HDRS)

$(TDIR)/img$(OBJEXT): $(TDIR)/img.c $(CDIR)/img-common.c $(HDRS)

$(TDIR)/imggif$(OBJEXT): $(TDIR)/imggif.c $(HDRS)

$(TDIR)/imgjpeg$(OBJEXT): $(TDIR)/imgjpeg.c $(HDRS)

$(TDIR)/imgpng$(OBJEXT): $(TDIR)/imgpng.c $(HDRS)

$(TDIR)/cbd$(OBJEXT): $(TDIR)/cbd.c $(HDRS)

$(TDIR)/geometry$(OBJEXT): $(TDIR)/geometry.c $(HDRS)


$(LIB):         .dir-stamp $(OBJECT) lib.exp external_wrappers.h
		$(LD) $(LDFLAGS) -o $(LIB) $(OBJECT) $(LIBPATH) $(LDTAIL)

.dir-stamp:
		test -d $(awtsubdir) || $(MKDIR) $(awtsubdir)
		$(TOUCH) .dir-stamp

.c$(OBJEXT):
		$(CC) $(ALL_CFLAGS) -c $(PIC) $< -o $*.o

external_wrappers.h:	$(OBJECT)
		sed -n $(WRAPPER_CMD) $(EXPORTS) > external_wrappers.h

clean:
		rm -f $(LIB) $(OBJECT) lib.exp external_wrappers.h

distclean:	clean
		rm -f Makefile .dir-stamp
		-rmdir $(awtsubdir) no-native-wm

install:
		test -d $(nativedir) || $(MKDIR) $(nativedir)
		rm -f $(nativedir)/$(LIB) $(nativedir)/$(LIBV)
		$(INSTALL_DATA) $(LIB) $(nativedir)/$(LIBV)
		$(LN) $(LIBV) $(nativedir)/$(LIB)

lib.exp:
		$(DLLTOOL) --def $(srcdir)/$(LIBNAME).def --output-exp lib.exp --output-lib $(LIBNAME).a --dllname $(LIB)
		touch lib.exp









-------------- next part --------------




import java.awt.*;

import java.lang.*;



public class AFrame {







	public static void main(String[] args) {



		Frame af = new Frame("MyFrame");



		af.setSize(new Dimension(400,400));

		

		

		af.show();

System.out.println("hello..");

	}









}



More information about the kaffe mailing list