Kaffe package for Linux Mandrake

Maurizio DE CECCO maurizio at mandrakesoft.com
Thu Mar 16 06:30:27 PST 2000



OK, here are some patches; the patches are merged in a single diff file
based on the kaffe 1.0.5 source distribution.

Two patches regards the TextComponent and TextField class, and
fix the textListener, that wasn't called; they apply to the relative
Java classes.

The third package regard the return status for a Process class,
but affect a C file; actually, the waitpid function do not
return the exit status of a process, but a integer coding the 
exit status and some other information; this integer should be decoded
using a couple of macros in order to get the real exit status;
the fix should work on all the POSIX compliant system, but i tryied
it only on Linux (Mandrake).

Hope this is usefull :->

Maurizio


-- snip ----------------------------------------------------------------------
diff -ru kaffe-1.0.5.org/kaffe/kaffevm/systems/unix-jthreads/jthread.c kaffe-1.0.5/kaffe/kaffevm/systems/unix-jthreads/jthread.c
--- kaffe-1.0.5.org/kaffe/kaffevm/systems/unix-jthreads/jthread.c	Mon Oct 18 07:24:01 1999
+++ kaffe-1.0.5/kaffe/kaffevm/systems/unix-jthreads/jthread.c	Tue Mar 14 16:27:02 2000
@@ -2362,11 +2362,22 @@
 
 	intsDisable();
 	for (;;) {
+	        int ret;
 		wouldlosewakeup = 1;
-		npid = waitpid(wpid, status, options|WNOHANG);
+		npid = waitpid(wpid, &ret, options|WNOHANG);
 		/* XXX what return codes should cause us to return an error? */
 		if (npid > 0) {
 			*outpid = npid;
+
+			// Handle exit status correctly
+
+			if (WIFEXITED(ret))
+			  *status = WEXITSTATUS(ret);
+			else if (WIFSIGNALED(ret))
+			  *status=128+WTERMSIG(ret);
+			else
+			  *status = (-1); // should never happens a the end.
+
 			break;
 		}
 		BLOCKED_ON_EXTERNAL(currentJThread);
diff -ru kaffe-1.0.5.org/libraries/javalib/java/awt/widgets/TextComponent.java kaffe-1.0.5/libraries/javalib/java/awt/widgets/TextComponent.java
--- kaffe-1.0.5.org/libraries/javalib/java/awt/widgets/TextComponent.java	Mon Oct 18 07:24:17 1999
+++ kaffe-1.0.5/libraries/javalib/java/awt/widgets/TextComponent.java	Tue Mar 14 16:36:05 2000
@@ -46,6 +46,7 @@
 }
 
 public void addTextListener( TextListener l) {
+	textListener = AWTEventMulticaster.add( textListener, l);
 	eventMask |= AWTEvent.TEXT_EVENT_MASK;
 }
 
diff -ru kaffe-1.0.5.org/libraries/javalib/java/awt/widgets/TextField.java kaffe-1.0.5/libraries/javalib/java/awt/widgets/TextField.java
--- kaffe-1.0.5.org/libraries/javalib/java/awt/widgets/TextField.java	Mon Oct 18 07:24:17 1999
+++ kaffe-1.0.5/libraries/javalib/java/awt/widgets/TextField.java	Tue Mar 14 16:36:14 2000
@@ -206,6 +206,7 @@
 }
 
 public void keyPressed( KeyEvent e) {
+        boolean changed = false;
 	int mods = e.getModifiers();
 	boolean shift = e.isShiftDown();
 	int code = e.getKeyCode();
@@ -222,6 +223,7 @@
 	case KeyEvent.VK_ESCAPE:
 		if (isEditable) {
 			setText( "");
+			changed = true;
 		}
 		break;
 	case KeyEvent.VK_HOME:
@@ -260,10 +262,12 @@
 		if (isEditable) {
 			if ( selStart != selEnd) {
 				deleteSelection();
+				changed = true;
 			}
 			else if ( tCursor.index > 0) {
 				textBuf.remove( tCursor.index-1, 1);
 				shiftTextCursor( -1, true);
+				changed = true;
 			}
 		}
 		break;
@@ -271,10 +275,12 @@
 		if (isEditable) {
 			if ( selStart != selEnd) {
 				deleteSelection();
+				changed = true;
 			}
 			else if ( tCursor.index < textBuf.len) {
 				textBuf.remove( tCursor.index, 1);
 				repaintTrailing();
+				changed = true;
 			}
 		}
 		break;
@@ -282,6 +288,11 @@
 		return;
 	}
 	
+	if (changed && ((textListener != null) || (eventMask & AWTEvent.TEXT_EVENT_MASK) != 0))
+	{
+	  Toolkit.eventQueue.postEvent( TextEvt.getEvent( this, TextEvt.TEXT_VALUE_CHANGED));		
+	}
+
 	e.consume();
 }
 

-- snip ----------------------------------------------------------------------


-- 
Maurizio De Cecco
MandrakeSoft 		http://www.mandrakesoft.com/


More information about the kaffe mailing list