[kaffe] CVS kaffe (riccardo): refactored fgClr and bgClr to foreground and background

Kaffe CVS cvs-commits at kaffe.org
Fri May 12 07:53:11 PDT 2006


PatchSet 7288 
Date: 2006/05/12 14:38:33
Author: riccardo
Branch: HEAD
Tag: (none) 
Log:
refactored fgClr and bgClr to foreground and background

Members: 
	ChangeLog:1.4792->1.4793 
	libraries/javalib/awt-implementations/kaffe/java/awt/BarMenu.java:1.1->1.2 
	libraries/javalib/awt-implementations/kaffe/java/awt/Button.java:1.2->1.3 
	libraries/javalib/awt-implementations/kaffe/java/awt/Checkbox.java:1.1->1.2 
	libraries/javalib/awt-implementations/kaffe/java/awt/Component.java:1.12->1.13 
	libraries/javalib/awt-implementations/kaffe/java/awt/Container.java:1.6->1.7 
	libraries/javalib/awt-implementations/kaffe/java/awt/Dialog.java:1.2->1.3 
	libraries/javalib/awt-implementations/kaffe/java/awt/Frame.java:1.2->1.3 
	libraries/javalib/awt-implementations/kaffe/java/awt/Label.java:1.2->1.3 
	libraries/javalib/awt-implementations/kaffe/java/awt/List.java:1.2->1.3 
	libraries/javalib/awt-implementations/kaffe/java/awt/NativeGraphics.java:1.4->1.5 
	libraries/javalib/awt-implementations/kaffe/java/awt/PopupWindow.java:1.2->1.3 
	libraries/javalib/awt-implementations/kaffe/java/awt/RowCanvas.java:1.3->1.4 
	libraries/javalib/awt-implementations/kaffe/java/awt/Scrollbar.java:1.2->1.3 
	libraries/javalib/awt-implementations/kaffe/java/awt/TextArea.java:1.2->1.3 
	libraries/javalib/awt-implementations/kaffe/java/awt/TextField.java:1.2->1.3 
	libraries/javalib/awt-implementations/kaffe/java/awt/Window.java:1.7->1.8 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4792 kaffe/ChangeLog:1.4793
--- kaffe/ChangeLog:1.4792	Wed May 10 23:00:45 2006
+++ kaffe/ChangeLog	Fri May 12 14:38:33 2006
@@ -1,3 +1,23 @@
+2006-05-12  Riccardo Mottola <riccardo at kaffe.org>
+
+	* libraries/javalib/awt-implementations/kaffe/java/awt/BarMenu.java,
+	libraries/javalib/awt-implementations/kaffe/java/awt/Button.java,
+	libraries/javalib/awt-implementations/kaffe/java/awt/Checkbox.java,
+	libraries/javalib/awt-implementations/kaffe/java/awt/Component.java,
+	libraries/javalib/awt-implementations/kaffe/java/awt/Container.java,
+	libraries/javalib/awt-implementations/kaffe/java/awt/Dialog.java,
+	libraries/javalib/awt-implementations/kaffe/java/awt/Frame.java,
+	libraries/javalib/awt-implementations/kaffe/java/awt/Label.java,
+	libraries/javalib/awt-implementations/kaffe/java/awt/List.java,
+	libraries/javalib/awt-implementations/kaffe/java/awt/NativeGraphics.java,
+	libraries/javalib/awt-implementations/kaffe/java/awt/PopupWindow.java,
+	libraries/javalib/awt-implementations/kaffe/java/awt/RowCanvas.java,
+	libraries/javalib/awt-implementations/kaffe/java/awt/Scrollbar.java,
+	libraries/javalib/awt-implementations/kaffe/java/awt/TextArea.java,
+	libraries/javalib/awt-implementations/kaffe/java/awt/TextField.java,
+	libraries/javalib/awt-implementations/kaffe/java/awt/Window.java:
+	refactored fgClr and bgClr to foreground and background
+
 2006-05-11  Riccardo Mottola <riccardo at kaffe.org>
 
 	* libraries/javalib/awt-implementations/kaffe/java/awt/Component.java,
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/BarMenu.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/BarMenu.java:1.1 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/BarMenu.java:1.2
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/BarMenu.java:1.1	Thu Jul 22 19:19:29 2004
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/BarMenu.java	Fri May 12 14:38:38 2006
@@ -76,7 +76,7 @@
 	return NativeGraphics.getGraphics( parent, ((Window)parent).nativeData,
 	                                   NativeGraphics.TGT_TYPE_WINDOW,
 	                                   u, v, 0, 0, width, height,
-	                                   parent.fgClr, parent.bgClr, parent.font, false);
+	                                   parent.foreground, parent.background, parent.font, false);
 }
 
 int getX ( Menu m) {
@@ -161,7 +161,7 @@
 		Menu m = (Menu)mb.menus.elementAt( i);
 		int mw = m.getWidth() +dx2;
 
-		m.paint( g, x0, Dx, y0, mw, mh, bgClr, fgClr, selection == m);
+		m.paint( g, x0, Dx, y0, mw, mh, background, foreground, selection == m);
 		x0 += mw;
 	}
 }
@@ -178,7 +178,7 @@
 		int mw = cm.getWidth() + dx2;
 
 		if ( m == cm) {
-			cm.paint( g, x0, Dx, y0, mw, mh, bgClr, fgClr, selection == cm);
+			cm.paint( g, x0, Dx, y0, mw, mh, background, foreground, selection == cm);
 			return;
 		}
 		x0 += mw;
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Button.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Button.java:1.2 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Button.java:1.3
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Button.java:1.2	Wed Oct 19 20:10:48 2005
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Button.java	Fri May 12 14:38:38 2006
@@ -105,7 +105,7 @@
 	// If button is disabled then the text as such.
 	if (!isEnabled()) {
 		c1 = null;
-		c2 = bgClr.darker();
+		c2 = background.darker();
 	}
 	else if ( (state & PUSHED) > 0 ){
 		x--; y--;
@@ -114,12 +114,12 @@
 	}
 	else {
 		if ( (state & HILIGHTED) > 0 ) {
-			c1 = Defaults.BtnTxtCarved ? bgClr.brighter() : null;
+			c1 = Defaults.BtnTxtCarved ? background.brighter() : null;
 			c2 = Defaults.BtnPointTxtClr;
 		}
 		else {
-			c1 = Defaults.BtnTxtCarved ? bgClr.brighter() : null;
-			c2 = fgClr;
+			c1 = Defaults.BtnTxtCarved ? background.brighter() : null;
+			c2 = foreground;
 		}
 	}
 
@@ -172,7 +172,7 @@
 	}
 	else {
 		kaffePaintBorder( g);
-		g.setColor( ((state & HILIGHTED) > 0) ? Defaults.BtnPointClr : bgClr);
+		g.setColor( ((state & HILIGHTED) > 0) ? Defaults.BtnPointClr : background);
 		g.fill3DRect( d, d, width-2*d, height-2*d, ((state & PUSHED) == 0));
 		if ( imgs != null )
 			drawImage( g);
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Checkbox.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Checkbox.java:1.1 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Checkbox.java:1.2
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Checkbox.java:1.1	Thu Jul 22 19:19:30 2004
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Checkbox.java	Fri May 12 14:38:38 2006
@@ -188,7 +188,7 @@
 	int x0  = dx;
 	int y0  = (height - ext) / 2;
 	
-	g.setColor( bgClr);
+	g.setColor( background );
 	g.fillRect( 0, 0, width, height);
 	
 	drawButton( g, ext, x0, y0);
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Component.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Component.java:1.12 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Component.java:1.13
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Component.java:1.12	Wed May 10 23:00:46 2006
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Component.java	Fri May 12 14:38:38 2006
@@ -74,8 +74,6 @@
 {
 	// We're not actually compatible with Sun's serialization format, so don't claim to be:
 	//final private static long serialVersionUID = -7644114512714619750L;
-	Color fgClr;
-	Color bgClr;
 	PopupMenu popup;
 	Rectangle deco = noDeco;
 	int flags = IS_VISIBLE;
@@ -526,14 +524,14 @@
 // }
 // 
 // private void writeDefaultObject() {
-// 	bgColor = Component.this.bgClr;
+// 	bgColor = Component.this.background;
 // 	changeSupport = null;
 // 	componentSerializedDataVersion = 0;
 // 	cursor = Component.this.cursor;
 // 	enabled = isEnabled();
 // 	eventMask = Component.this.eventMask;
 // 	font = Component.this.font;
-// 	foreground = Component.this.fgClr;
+// 	foreground = Component.this.foreground;
 // 	hasFocus = false;
 // 	height = Component.this.height;
 // 	isPacked = false;
@@ -883,13 +881,13 @@
 }
 
 public Color getBackground () {
-	return bgClr;
+	return background;
 /*
-	if ( bgClr != null )
-		return bgClr;
+	if ( background != null )
+		return background;
 
 	for ( Component c=parent; c != null; c = c.parent ) {
-		if ( c.bgClr != null ) return c.bgClr;
+		if ( c.background != null ) return c.bgClr;
 	}
 	
 	// even though not in the specs, some apps (e.g. swing) rely on the
@@ -959,7 +957,7 @@
 }
 
 public Color getForeground () {
-	return fgClr;
+	return foreground;
 }
 
 public Graphics getGraphics () {
@@ -1959,12 +1957,12 @@
 
 void propagateBgClr ( Color clr ) {
 	// should be called *only* on Components with unset IS_BG_COLORED
-	bgClr = clr;
+	background = clr;
 }
 
 void propagateFgClr ( Color clr ) {
 	// should be called *only* on Components with unset IS_FG_COLORED
-	fgClr = clr;
+	foreground = clr;
 }
 
 void propagateFont ( Font fnt ) {
@@ -2377,7 +2375,7 @@
 }
 
 public void setBackground ( Color clr ) {
-	if ( clr == bgClr )
+	if ( clr == background )
 		return;
 
 	if ( clr != null ){
@@ -2386,7 +2384,7 @@
 	else {
 		flags &= ~IS_BG_COLORED;
 		if ( parent != null )
-			clr = parent.bgClr;
+			clr = parent.background;
 	}
 
 	propagateBgClr( clr);
@@ -2454,7 +2452,7 @@
 }
 
 public void setForeground ( Color clr ) {
-	if ( clr == fgClr )
+	if ( clr == foreground )
 		return;
 
 	if ( clr != null ){
@@ -2463,7 +2461,7 @@
 	else {
 		flags &= ~IS_FG_COLORED;
 		if ( parent != null )
-			clr = parent.fgClr;
+			clr = parent.foreground;
 	}
 
 	propagateFgClr( clr);
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Container.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Container.java:1.6 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Container.java:1.7
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Container.java:1.6	Tue May  2 14:32:32 2006
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Container.java	Fri May 12 14:38:38 2006
@@ -202,9 +202,9 @@
 			child.propagateParentShowing( false);
 		}
 		if ( (child.flags & IS_BG_COLORED) == 0 )
-			child.propagateBgClr( bgClr);
+			child.propagateBgClr( background);
 		if ( (child.flags & IS_FG_COLORED) == 0 )
-			child.propagateFgClr( fgClr);
+			child.propagateFgClr( foreground);
 		if ( (child.flags & IS_FONTIFIED) == 0 )
 			child.propagateFont( font);
 			
@@ -722,7 +722,7 @@
 }
 
 void propagateBgClr ( Color clr ) {
-	bgClr = clr;
+	background = clr;
 
 	for ( int i=0; i<ncomponents; i++ ){
 		Component c = component[i];
@@ -733,7 +733,7 @@
 }
 
 void propagateFgClr ( Color clr ) {
-	fgClr = clr;
+	foreground = clr;
 
 	for ( int i=0; i<ncomponents; i++ ){
 		Component c = component[i];
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Dialog.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Dialog.java:1.2 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Dialog.java:1.3
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Dialog.java:1.2	Sun Jan 29 14:33:49 2006
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Dialog.java	Fri May 12 14:38:38 2006
@@ -78,7 +78,7 @@
 	}
 
 	nativeData = Toolkit.wndCreateDialog( owner.nativeData, title, u, v, w, h,
-	                               cursor.type, bgClr.getNativeValue(), ((flags & IS_RESIZABLE) != 0));
+	                               cursor.type, background.getNativeValue(), ((flags & IS_RESIZABLE) != 0));
 }
 
 public void hide () {
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Frame.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Frame.java:1.2 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Frame.java:1.3
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Frame.java:1.2	Wed Apr 19 09:49:29 2006
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Frame.java	Fri May 12 14:38:38 2006
@@ -101,7 +101,7 @@
 	}
 
 	nativeData = Toolkit.wndCreateFrame( title, u, v, w, h,
-	                               cursor.type, bgClr.getNativeValue(), ((flags & IS_RESIZABLE) != 0));
+	                               cursor.type, background.getNativeValue(), ((flags & IS_RESIZABLE) != 0));
 }
 
 public Component getComponent( int index) {
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Label.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Label.java:1.2 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Label.java:1.3
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Label.java:1.2	Fri May  5 14:40:44 2006
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Label.java	Fri May 12 14:38:38 2006
@@ -90,7 +90,7 @@
 		g.drawString( label, x0+1, y0+1 );
 	}
 	
-	g.setColor( fgClr);
+	g.setColor( foreground );
 	g.drawString( label, x0, y0);
 }
 
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/List.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/List.java:1.2 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/List.java:1.3
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/List.java:1.2	Wed May 10 15:43:09 2006
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/List.java	Fri May 12 14:38:38 2006
@@ -239,9 +239,9 @@
 		g.setColor( Defaults.ListFlyOverTxtClr);
 	}
 	else {
-		g.setColor( this.bgClr );
+		g.setColor( this.background );
 		g.fillRect( d, y0, this.width-2*d, rowHeight);
-		g.setColor( this.fgClr );
+		g.setColor( this.foreground );
 	}
 
 	g.drawString( s, x0, y1);
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/NativeGraphics.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/NativeGraphics.java:1.4 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/NativeGraphics.java:1.5
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/NativeGraphics.java:1.4	Tue Aug  9 14:03:39 2005
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/NativeGraphics.java	Fri May 12 14:38:38 2006
@@ -40,8 +40,8 @@
 	Pointer nativeData;
 	int xOffset;
 	int yOffset;
-	Color fgClr;
-	Color bgClr;
+	Color foreground;
+	Color background;
 	Font font;
 	int xClip;
 	int yClip;
@@ -103,7 +103,7 @@
 	NativeGraphics g = getGraphics( this, nativeData, TGT_TYPE_GRAPHICS,
 	                xOffset, yOffset,
 									xClip, yClip, wClip, hClip,
-									fgClr, bgClr, font, false);
+									foreground, background, font, false);
 	if ( xClr != null )
 		g.setXORMode( xClr);
 
@@ -131,7 +131,7 @@
 	NativeGraphics g = getGraphics( this, nativeData, TGT_TYPE_GRAPHICS,
 	                x + xOffset, y + yOffset,
 									clx - x, cly - y, clw, clh,
-									fgClr, bgClr, font, false);
+									foreground, background, font, false);
 							
 	if ( xClr != null )
 		g.setXORMode( xClr);
@@ -144,7 +144,7 @@
 }
 
 public void dispose () {
-	if ( bgClr == null ) {
+	if ( background == null ) {
 		// We have to provide some protection against double disposes
 		// since it would make the whole cache inconsistent (leads to
 		// simultanous use). We shouldn't store the target here because
@@ -159,8 +159,8 @@
 		synchronized ( target ) {
 			xClr = null;
 			font = null;
-			fgClr = null;
-			bgClr = null;
+			foreground = null;
+			background = null;
 
 			target.unlinkGraphics( this);
 			target = null;
@@ -169,8 +169,8 @@
 	else {
 		xClr = null;
 		font = null;
-		fgClr = null;
-		bgClr = null;
+		foreground = null;
+		background = null;
 	}
 
 	if ( nativeData != null ) {
@@ -187,7 +187,7 @@
 public void draw3DRect ( int x, int y, int width, int height, boolean raised ){
 	// we pass the rgb color value because it might be stored on the native
 	// side as pixel value (requiring an additional color conversion)
-	Toolkit.graDraw3DRect( nativeData, x, y, width, height, raised, fgClr.value);
+	Toolkit.graDraw3DRect( nativeData, x, y, width, height, raised, foreground.value);
 }
 
 public void drawArc ( int x, int y, int width, int height,
@@ -356,7 +356,7 @@
 }
 
 public void fill3DRect ( int x, int y, int width, int height, boolean raised ){
-	Toolkit.graFill3DRect( nativeData, x, y, width, height, raised, fgClr.value);
+	Toolkit.graFill3DRect( nativeData, x, y, width, height, raised, foreground.value);
 }
 
 public void fillArc ( int x, int y, int width, int height, int startAngle, int arcAngle ){
@@ -392,7 +392,7 @@
 }
 
 Color getBackColor () {
-	return bgClr;
+	return background;
 }
 
 public Shape getClip (){
@@ -440,10 +440,10 @@
 	if ( (c.flags & Component.IS_ADD_NOTIFIED) == 0 ) return null;
 
 	if ( g == null ) {
-		fg  = c.fgClr;	bg  = c.bgClr;	fnt = c.font;
+		fg  = c.foreground;	bg  = c.background;	fnt = c.font;
 	}
 	else { // otherwise, the silly compiler complains about missing init
-		fg = g.fgClr;   bg = g.bgClr;   fnt = g.font;
+		fg = g.foreground;   bg = g.background;   fnt = g.font;
 	}
 
 	while ( true ) {
@@ -522,7 +522,7 @@
 }
 
 public Color getColor() {
-	return fgClr;
+	return foreground;
 }
 
 public Font getFont() {
@@ -563,8 +563,8 @@
 	g.hClip = hClip;
 	g.hClipDefault = hClip;
 	g.font     = fnt;
-	g.fgClr    = fg;
-	g.bgClr    = bg;
+	g.foreground    = fg;
+	g.background    = bg;
 
 if ( fg == null ){ Thread.currentThread().dumpStack();}
 
@@ -620,7 +620,7 @@
 		NativeGraphics g = getGraphics( this, nativeData, TGT_TYPE_GRAPHICS,
 										                c.x + xOffset, c.y + yOffset,
 																		clx, cly, clw, clh,
-																		c.fgClr, c.bgClr, c.font, false);
+																		c.foreground, c.background, c.font, false);
 		if ( g != null ) {
 			if ( isUpdate )
 				c.update( g);
@@ -635,10 +635,10 @@
 }
 
 void setBackColor ( Color clr ){
-	if ( (clr != null) && (clr != bgClr) ) {
-		bgClr = clr;
+	if ( (clr != null) && (clr != background) ) {
+		background = clr;
 		
-		Toolkit.graSetBackColor( nativeData, bgClr.getNativeValue());
+		Toolkit.graSetBackColor( nativeData, background.getNativeValue());
 	}
 }
 
@@ -673,9 +673,9 @@
 }
 
 public void setColor ( Color clr ){
-	if ( (clr != null) && (clr != fgClr) ) {
-		fgClr = clr;
-		Toolkit.graSetColor( nativeData, fgClr.getNativeValue());
+	if ( (clr != null) && (clr != foreground) ) {
+		foreground = clr;
+		Toolkit.graSetColor( nativeData, foreground.getNativeValue());
 	}
 }
 
@@ -701,18 +701,18 @@
 		font = fnt;
 	}
 	if ( fg != null ) {
-		fgClr = fg;
+		foreground = fg;
 	}
 	if ( bg != null ) {
-		bgClr = bg;
+		background = bg;
 	}
 
 	nativeData = Toolkit.graInitGraphics( nativeData, tgtData, tgtType,
 	                                      xOffset, yOffset,
 	                                      xClip, yClip, wClip, hClip,
 	                                      font.nativeData,
-	                                      fgClr.getNativeValue(),
-	                                      bgClr.getNativeValue(),
+	                                      foreground.getNativeValue(),
+	                                      background.getNativeValue(),
 	                                      blank);
 }
 
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/PopupWindow.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/PopupWindow.java:1.2 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/PopupWindow.java:1.3
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/PopupWindow.java:1.2	Fri Feb 17 00:28:57 2006
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/PopupWindow.java	Fri May 12 14:38:38 2006
@@ -128,7 +128,7 @@
 
 	g.setColor( Color.black);
 	g.drawRect( 0, 0, width-1, height-1);
-	g.setColor( bgClr);
+	g.setColor( background);
 	g.fill3DRect( 1, 1, width-2, height-2, true);
 
 	for ( int i=0; i<s; i++) {
@@ -139,7 +139,7 @@
 
 int paintItem ( MenuItem mi, Graphics g, int y) {
 
-	int ih = mi.paint( g, 1, xOffs, y, width-3, 0, bgClr, fgClr, mi == selection);
+	int ih = mi.paint( g, 1, xOffs, y, width-3, 0, background, foreground, mi == selection);
 
 	// draw the submenu mark
 	if ( mi instanceof Menu) {
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/RowCanvas.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/RowCanvas.java:1.3 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/RowCanvas.java:1.4
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/RowCanvas.java:1.3	Wed May 10 15:43:09 2006
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/RowCanvas.java	Fri May 12 14:38:38 2006
@@ -215,7 +215,7 @@
 void rearrange() {
 	Graphics g = parent.getGraphics();
 	if ( g != null ) {
-		g.setColor( parent.bgClr );
+		g.setColor( parent.background );
 		g.fillRect( 0, 0, parent.width, parent.height);
 		g.dispose();
 	}
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Scrollbar.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Scrollbar.java:1.2 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Scrollbar.java:1.3
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Scrollbar.java:1.2	Wed Oct 19 20:10:50 2005
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Scrollbar.java	Fri May 12 14:38:38 2006
@@ -167,7 +167,7 @@
 		return;
 
 	int dx, dy;
-	Color cp = parent.bgClr;
+	Color cp = parent.background;
 
 	if ( ori == VERTICAL ) {
 		int y0 = e.getY() - dragOffs.y;
@@ -278,7 +278,7 @@
 	currentOp = getCurrentOp( e.getX(), e.getY() );
 	
 	if ( (dragGr = getGraphics()) != null )
-		dragGr.setColor( bgClr);
+		dragGr.setColor( background);
 	
 	dragRect.x = slRect.x;
 	dragRect.y = slRect.y;
@@ -327,12 +327,12 @@
 	int x, y, xw, yh;
 
 	if ( slRect.width == 0 ) {
-		g.setColor( parent.bgClr );
+		g.setColor( parent.background );
 		g.fillRect( 0, 0, width, height);
 		return;
 	}
 	
-	g.setColor( bgClr);
+	g.setColor( background);
 
 	if ( ori == HORIZONTAL) {
 		y = height/2 -1;
@@ -509,7 +509,7 @@
 		g = getGraphics();
 	
 	if ( g != null ){
-		g.setColor( parent.bgClr);
+		g.setColor( parent.background);
 		g.fillRect( slRect.x, slRect.y, slRect.width, slRect.height);
 
 		updateSliderRect();
@@ -525,7 +525,7 @@
 }
 
 public void update ( Graphics g ) {
-	g.setColor( parent.bgClr );
+	g.setColor( parent.background );
 	g.fillRect( 0, 0, width, height);
 	paint( g);
 }
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/TextArea.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/TextArea.java:1.2 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/TextArea.java:1.3
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/TextArea.java:1.2	Wed May 10 15:43:10 2006
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/TextArea.java	Fri May 12 14:38:38 2006
@@ -101,9 +101,9 @@
 	TextBuffer tb;
 
 	if ( rgr != null ) {
-		rgr.setColor( this.bgClr );
+		rgr.setColor( this.background );
 		tCursor.blank( rgr, xOffs, getRowYPos( tCursor.yindex) );
-		rgr.setColor( this.fgClr );
+		rgr.setColor( this.foreground );
 		tb = (TextBuffer)rows.elementAt( tCursor.yindex );
 		tb.paint( rgr, xOffs, tCursor.y, rowHeight, tCursor.index, 1);
 	}
@@ -719,18 +719,18 @@
 	if ( ss == se ) {
 		x0 = (startX == 0) ? 0 : tb.getPos( startX) + xOffs;
 		w = this.width - x0;
-		g.setColor( this.bgClr );
+		g.setColor( this.background );
 		g.fillRect( x0, y0, w-d, rowHeight);
-		g.setColor( this.fgClr );
+		g.setColor( this.foreground );
 		tb.paint( g, xOffs, y0, rowHeight, startX);
 	}
 	else {
 		if ( ss > startX ) {
 			x0 = tb.getPos( startX) + xOffs;
 			w = tb.getWidth( startX, ss);
-			g.setColor( this.bgClr );
+			g.setColor( this.background );
 			g.fillRect( x0, y0, w, rowHeight);
-			g.setColor( this.fgClr );
+			g.setColor( this.foreground );
 			tb.paint( g, xOffs, y0, rowHeight, startX, ss-startX);
 		}
 		if ( se > startX ) {
@@ -743,10 +743,10 @@
 		}
 		x0 = tb.getPos( se) + xOffs;
 		w = this.width - x0;
-		g.setColor( this.bgClr );
+		g.setColor( this.background );
 		g.fillRect( x0, y0, w, rowHeight);
 		if ( se < tb.len ) {
-			g.setColor( this.fgClr );
+			g.setColor( this.foreground );
 			tb.paint( g, xOffs, y0, rowHeight, se);
 		}
 	}
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/TextField.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/TextField.java:1.2 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/TextField.java:1.3
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/TextField.java:1.2	Fri Feb 17 00:28:57 2006
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/TextField.java	Fri May 12 14:38:38 2006
@@ -428,7 +428,7 @@
 	int d = BORDER_WIDTH;
 	kaffePaintBorder( g);
 	
-	g.setColor( bgClr);
+	g.setColor( background);
 	g.fillRect( d, d, width-2*d, height-2*d);
 
 	repaintFrom( 0);
@@ -542,11 +542,11 @@
 		rgr.setColor( Defaults.TextFieldSelTxtClr);
 	}
 	else {
-		rgr.setColor( bgClr );
+		rgr.setColor( background );
 		if ( end == tb.len )
 			x1 = width - db;
 		rgr.fillRect( x0, tCursor.y, x1-x0, tCursor.height+1);
-		rgr.setColor( fgClr);
+		rgr.setColor( foreground);
 	}
 
 	tb.paintFrom( rgr, db + xOffs, 0, height, first, start, end-start);
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Window.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Window.java:1.7 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Window.java:1.8
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Window.java:1.7	Wed May 10 23:00:46 2006
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Window.java	Fri May 12 14:38:38 2006
@@ -40,8 +40,8 @@
 	// windows aren't visible per se, but they are exposed, colored and fontified
 	flags = (IS_PARENT_SHOWING | IS_BG_COLORED | IS_FG_COLORED | IS_FONTIFIED);
 
-	fgClr = Defaults.WndForeground;
-	bgClr = Defaults.WndBackground;
+	foreground = Defaults.WndForeground;
+	background = Defaults.WndBackground;
 	font  = Defaults.WndFont;
 
 	setLayout(new BorderLayout());
@@ -101,7 +101,7 @@
 void createNative () {
 	nativeData = Toolkit.wndCreateWindow( (owner != null) ? owner.nativeData : null,
 	                                x, y, width, height,
-	                                cursor.type, bgClr.getNativeValue());
+	                                cursor.type, background.getNativeValue());
 }
 
 void destroyNative () {
@@ -158,7 +158,7 @@
 		                                   u, v, insets.left, insets.top,
 		                                   width - deco.width,
 		                                   height - (insets.top + insets.bottom),
-		                                   fgClr, bgClr, font, false);
+		                                   foreground, background, font, false);
 	}
 	else {
 		return null;
@@ -322,9 +322,9 @@
 }
 
 public void setBackground ( Color clr ) {
-	// we can't nullify this (rermember the "bgClr != null" invariant)
+	// we can't nullify this (rermember the "background != null" invariant)
 	if ( clr != null ) {
-		bgClr = clr;
+		background = clr;
 		propagateBgClr( clr);
 
 		if ( isShowing() )
@@ -344,9 +344,9 @@
 }
 
 public void setForeground ( Color clr ) {
-	// we can't nullify this (rermember the "fgClr != null" invariant)
+	// we can't nullify this (rermember the "foreground != null" invariant)
 	if ( clr != null ) {
-		fgClr = clr;
+		foreground = clr;
 		propagateFgClr( clr);
 
 		if ( isShowing() )




More information about the kaffe mailing list