PatchSet 4952 Date: 2004/07/12 06:39:49 Author: jserv Branch: HEAD Tag: (none) Log: Better way to handle Qt AWT backend debugging and update FAQ.awt
* libraries/clib/awt/qt/evt.cc: Safer way to handler processEvent. * libraries/clib/awt/qt/img.cc: Add type conversion with threshold. * libraries/clib/awt/qt/tlk.cc: Implement message handler for Qt AWT backend, and it is more convenient to debug or catch some messages from Qt core. * FAQ/FAQ.awt: Update Qt AWT backend debugging information. Members: ChangeLog:1.2517->1.2518 FAQ/FAQ.awt:1.9->1.10 libraries/clib/awt/qt/evt.cc:1.6->1.7 libraries/clib/awt/qt/img.cc:1.5->1.6 libraries/clib/awt/qt/tlk.cc:1.4->1.5 Index: kaffe/ChangeLog diff -u kaffe/ChangeLog:1.2517 kaffe/ChangeLog:1.2518 --- kaffe/ChangeLog:1.2517 Mon Jul 12 05:21:53 2004 +++ kaffe/ChangeLog Mon Jul 12 06:39:49 2004 @@ -1,5 +1,20 @@ 2004-07-12 Jim Huang <[EMAIL PROTECTED]> + * libraries/clib/awt/qt/evt.cc: + Safer way to handler processEvent. + + * libraries/clib/awt/qt/img.cc: + Add type conversion with threshold. + + * libraries/clib/awt/qt/tlk.cc: + Implement message handler for Qt AWT backend, and it is more + convenient to debug or catch some messages from Qt core. + + * FAQ/FAQ.awt: + Update Qt AWT backend debugging information. + +2004-07-12 Jim Huang <[EMAIL PROTECTED]> + * libraries/javalib/java/awt/ScrollPane.java (ScrollPane): supports GraphicsEnvironment.isHeadless() checks. (addImpl): checks scrollbar type. Index: kaffe/FAQ/FAQ.awt diff -u kaffe/FAQ/FAQ.awt:1.9 kaffe/FAQ/FAQ.awt:1.10 --- kaffe/FAQ/FAQ.awt:1.9 Sat Jul 10 02:48:03 2004 +++ kaffe/FAQ/FAQ.awt Mon Jul 12 06:39:49 2004 @@ -155,6 +155,18 @@ implementation is still rather rough, so it prints a lot of debugging output which confuses the framebuffer, apparently. + * Qt AWT backend crashes, how can I help? + + Firsr, Qt AWT backend in Kaffe is still buggy, so any feedback + is important to developers for improving. You may attempt to + enable the debug option in Kaffe (configure as --enable-debug + support), and execute a Java AWT application like: + + kaffe -vmdebug AWT -cp <PATH> <CLASSNAME> + + Qt AWT backend will dump debug messages in stderr, and you could + redirect to text file. It's sometimes useful for trouble shooting. + Finally, if all else fails, you are on your own. Build kaffe with support for debugging, read FAQ/FAQ.debugging and try to figure out what's wrong using a debugger. Good luck and please keep in Index: kaffe/libraries/clib/awt/qt/evt.cc diff -u kaffe/libraries/clib/awt/qt/evt.cc:1.6 kaffe/libraries/clib/awt/qt/evt.cc:1.7 --- kaffe/libraries/clib/awt/qt/evt.cc:1.6 Sat Jul 10 01:58:25 2004 +++ kaffe/libraries/clib/awt/qt/evt.cc Mon Jul 12 06:39:48 2004 @@ -522,8 +522,10 @@ packet=g_event_queue.dequeue(); event=packet->getEvent(); index=packet->getIndex(); - jEvt = processEvent(env, X, event, index); - delete event; + if (event) { + jEvt = processEvent(env, X, event, index); + delete event; + } delete packet; } Index: kaffe/libraries/clib/awt/qt/img.cc diff -u kaffe/libraries/clib/awt/qt/img.cc:1.5 kaffe/libraries/clib/awt/qt/img.cc:1.6 --- kaffe/libraries/clib/awt/qt/img.cc:1.5 Sat Jul 10 01:58:25 2004 +++ kaffe/libraries/clib/awt/qt/img.cc Mon Jul 12 06:39:48 2004 @@ -91,7 +91,7 @@ if ( !img->alpha ) return 0; - max = (img->width * img->height) * threshold; + max = (img->width * img->height) * (int)threshold; for ( i=0; i<img->height; i++ ) { for ( j=0; j<img->width; j++ ) { Index: kaffe/libraries/clib/awt/qt/tlk.cc diff -u kaffe/libraries/clib/awt/qt/tlk.cc:1.4 kaffe/libraries/clib/awt/qt/tlk.cc:1.5 --- kaffe/libraries/clib/awt/qt/tlk.cc:1.4 Sat Jul 10 01:58:25 2004 +++ kaffe/libraries/clib/awt/qt/tlk.cc Mon Jul 12 06:39:48 2004 @@ -46,12 +46,29 @@ } +void qtawtMessageOutput(QtMsgType type, const char *msg) +{ + switch ( type ) { + case QtDebugMsg: + fprintf(stderr, "QtAWT: %s\n", msg); + break; + case QtWarningMsg: + fprintf(stderr, "QtAWT - Warning: %s\n", msg); + break; + case QtFatalMsg: + fprintf(stderr, "QtAWT - Fatal: %s\n", msg); + abort(); // dump core on purpose + } +} + // tlkInit(System.getProperty( "awt.display")); in Toolkit.java jboolean Java_java_awt_Toolkit_tlkInit(JNIEnv* env, jclass clazz, jstring name) { char * argv[1] = { "Qt AWT backend for Kaffe" }; int argc = 1; + + qInstallMsgHandler(qtawtMessageOutput); #ifdef QPE qapp = new QPEApplication(argc, argv); _______________________________________________ kaffe mailing list [EMAIL PROTECTED] http://kaffe.org/cgi-bin/mailman/listinfo/kaffe