[cp-patches] FYI: AWT/Swing window event handling fixes

2006-10-18 Thread Roman Kennke
We were not processing AWT WindowEvents at all, because
eventTypeEnabled() wasn't implemented for java.awt.Window. This caused
Swing windows not beeing able to be closed, because the event handling
methods in Swing's JFrame never received a message that a window is
about to beeing closed.

2006-10-18  Roman Kennke  [EMAIL PROTECTED]

PR 29448
* java/awt/Window.java
(eventTypeEnabled): Overridden to handle WindowEvents.
(processEvent): Switch between processWindowEvent(),
processWindowFocusEvent() and processWindowStateEvent() here,
rather than simply calling processWindowEvent().
(processWindowEvent): Only dispatch event to listener, do not
switch to processWindowFocusEvent() or processWindowStateEvent()
here.
* javax/swing/JFrame.java
(frameInit): Explicitly enable window and key events here.
(processWindowEvent): Throw out some unnecessary code.
* javax/swing/JWindow.java
(windowInit): Explicitly enable key events here.
* javax/swing/JDialog.java
(close_action): Renamed to closeAction.
(dialogInit): Explicitly enable window events here.
(getDefaultCloseOperation): Renamed close_action to closeAction.
(processWindowEvent): Throw out some unnecessary code.
Renamed close_action to closeAction.
(setDefaultCloseOperation): Renamed close_action to closeAction.


/Roman

Index: java/awt/Window.java
===
RCS file: /cvsroot/classpath/classpath/java/awt/Window.java,v
retrieving revision 1.75
diff -u -1 -5 -r1.75 Window.java
--- java/awt/Window.java	20 Sep 2006 12:35:41 -	1.75
+++ java/awt/Window.java	18 Oct 2006 09:17:44 -
@@ -606,93 +606,95 @@
   }
 super.dispatchEventImpl(e);
   }
 
   /**
* Processes the specified event for this window.  If the event is an
* instance of codeWindowEvent/code, then
* codeprocessWindowEvent()/code is called to process the event,
* otherwise the superclass version of this method is invoked.
*
* @param evt The event to process.
*/
   protected void processEvent(AWTEvent evt)
   {
 if (evt instanceof WindowEvent)
-  processWindowEvent((WindowEvent) evt);
+  {
+WindowEvent we = (WindowEvent) evt;
+switch (evt.getID())
+  {
+  case WindowEvent.WINDOW_OPENED:
+  case WindowEvent.WINDOW_CLOSED:
+  case WindowEvent.WINDOW_CLOSING:
+  case WindowEvent.WINDOW_ICONIFIED:
+  case WindowEvent.WINDOW_DEICONIFIED:
+  case WindowEvent.WINDOW_ACTIVATED:
+  case WindowEvent.WINDOW_DEACTIVATED:
+processWindowEvent(we);
+break;
+  case WindowEvent.WINDOW_GAINED_FOCUS:
+  case WindowEvent.WINDOW_LOST_FOCUS:
+processWindowFocusEvent(we);
+break;
+  case WindowEvent.WINDOW_STATE_CHANGED:
+processWindowStateEvent(we);
+break;
+  }
+  }
 else
   super.processEvent(evt);
   }
 
   /**
* Dispatches this event to any listeners that are listening for
* codeWindowEvents/code on this window.  This method only gets
* invoked if it is enabled via codeenableEvents()/code or if
* a listener has been added.
*
* @param evt The event to process.
*/
   protected void processWindowEvent(WindowEvent evt)
   {
-int id = evt.getID();
-
-if (id == WindowEvent.WINDOW_GAINED_FOCUS
-	|| id == WindowEvent.WINDOW_LOST_FOCUS)
-  processWindowFocusEvent (evt);
-else if (id == WindowEvent.WINDOW_STATE_CHANGED)
-  processWindowStateEvent (evt);
-else
+if (windowListener != null)
   {
-	if (windowListener != null)
-	  {
-	switch (evt.getID())
-	  {
-	  case WindowEvent.WINDOW_ACTIVATED:
-		windowListener.windowActivated(evt);
-		break;
-
-	  case WindowEvent.WINDOW_CLOSED:
-		windowListener.windowClosed(evt);
-		break;
-
-	  case WindowEvent.WINDOW_CLOSING:
-		windowListener.windowClosing(evt);
-		break;
-
-	  case WindowEvent.WINDOW_DEACTIVATED:
-		windowListener.windowDeactivated(evt);
-		break;
-
-	  case WindowEvent.WINDOW_DEICONIFIED:
-		windowListener.windowDeiconified(evt);
-		break;
-
-	  case WindowEvent.WINDOW_ICONIFIED:
-		windowListener.windowIconified(evt);
-		break;
-
-	  case WindowEvent.WINDOW_OPENED:
-		windowListener.windowOpened(evt);
-		break;
-
-	  default:
-		break;
-	  }
-	  }
+switch (evt.getID())
+  {
+  case WindowEvent.WINDOW_ACTIVATED:
+windowListener.windowActivated(evt);
+break;
+  case WindowEvent.WINDOW_CLOSED:
+windowListener.windowClosed(evt);
+break;
+  case WindowEvent.WINDOW_CLOSING:
+windowListener.windowClosing(evt);
+break;
+  case WindowEvent.WINDOW_DEACTIVATED:
+

[cp-patches] FYI: Some more cvsignores

2006-10-18 Thread Roman Kennke
This adds .cvsignore files in native/target and subdirs to let CVS
ignore the generated Makefile and Makefile.in files.

2006-10-18  Roman Kennke  [EMAIL PROTECTED]

* native/target/.cvsignore
* native/target/Linux/.cvsignore
* native/target/generic/.cvsignore:
Added to let CVS ignore the generated Makefile and Makefile.in
files.


/Roman

Index: native/target/.cvsignore
===
RCS file: native/target/.cvsignore
diff -N native/target/.cvsignore
--- /dev/null	1 Jan 1970 00:00:00 -
+++ native/target/.cvsignore	18 Oct 2006 09:28:32 -
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Index: native/target/Linux/.cvsignore
===
RCS file: native/target/Linux/.cvsignore
diff -N native/target/Linux/.cvsignore
--- /dev/null	1 Jan 1970 00:00:00 -
+++ native/target/Linux/.cvsignore	18 Oct 2006 09:28:32 -
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Index: native/target/generic/.cvsignore
===
RCS file: native/target/generic/.cvsignore
diff -N native/target/generic/.cvsignore
--- /dev/null	1 Jan 1970 00:00:00 -
+++ native/target/generic/.cvsignore	18 Oct 2006 09:28:32 -
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in


[cp-patches] FYI: Container fixlets

2006-10-18 Thread Roman Kennke
In java.awt.Container we were not calling the ContainerPeer begin|
endLayout|validate() methods correctly. I fixed this with the attached
patch.

2006-10-18  Roman Kennke  [EMAIL PROTECTED]

* java/awt/Container.java
(validateTree): Call ContainerPeer.begin|endLayout() rather than
begin|endValidate().
(validate): Call ContainerPeer.begin|endValidate() here.
Added some local vars to avoid NPEs.

/Roman

Index: java/awt/Container.java
===
RCS file: /cvsroot/classpath/classpath/java/awt/Container.java,v
retrieving revision 1.109
diff -u -1 -5 -r1.109 Container.java
--- java/awt/Container.java	27 Sep 2006 21:00:07 -	1.109
+++ java/awt/Container.java	18 Oct 2006 09:38:29 -
@@ -31,30 +31,31 @@
 terms of your choice, provided that you also meet, for each linked
 independent module, the terms and conditions of the license of that
 module.  An independent module is a module which is not derived from
 or based on this library.  If you modify this library, you may extend
 this exception to your version of the library, but you are not
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
 
 package java.awt;
 
 import java.awt.event.ContainerEvent;
 import java.awt.event.ContainerListener;
 import java.awt.event.HierarchyEvent;
 import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
 import java.awt.peer.ComponentPeer;
 import java.awt.peer.ContainerPeer;
 import java.awt.peer.LightweightPeer;
 import java.beans.PropertyChangeListener;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.PrintStream;
 import java.io.PrintWriter;
 import java.io.Serializable;
 import java.util.Collections;
 import java.util.EventListener;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
@@ -593,95 +594,104 @@
   public void invalidate()
   {
 super.invalidate();
 if (layoutMgr != null  layoutMgr instanceof LayoutManager2)
   {
 LayoutManager2 lm2 = (LayoutManager2) layoutMgr;
 lm2.invalidateLayout(this);
   }
   }
 
   /**
* Re-lays out the components in this container.
*/
   public void validate()
   {
-synchronized (getTreeLock ())
+ComponentPeer p = peer;
+if (! valid  p != null)
   {
-if (! isValid()  peer != null)
+ContainerPeer cPeer = null;
+if (p instanceof ContainerPeer)
+  cPeer = (ContainerPeer) peer;
+synchronized (getTreeLock ())
   {
+if (cPeer != null)
+  cPeer.beginValidate();
 validateTree();
+valid = true;
+if (cPeer != null)
+  cPeer.endValidate();
   }
   }
   }
 
   /**
* Recursively invalidates the container tree.
*/
   private final void invalidateTree()
   {
 synchronized (getTreeLock())
   {
 for (int i = 0; i  ncomponents; i++)
   {
 Component comp = component[i];
 if (comp instanceof Container)
   ((Container) comp).invalidateTree();
 else if (comp.valid)
   comp.invalidate();
   }
 if (valid)
   invalidate();
   }
   }
 
   /**
* Recursively validates the container tree, recomputing any invalid
* layouts.
*/
   protected void validateTree()
   {
-if (valid)
-  return;
-
-ContainerPeer cPeer = null;
-if (peer instanceof ContainerPeer)
-  {
-cPeer = (ContainerPeer) peer;
-cPeer.beginValidate();
-  }
-
-doLayout ();
-for (int i = 0; i  ncomponents; ++i)
+if (!valid)
   {
-Component comp = component[i];
-
-if (comp instanceof Container  ! (comp instanceof Window)
- ! comp.valid)
+ContainerPeer cPeer = null;
+if (peer instanceof ContainerPeer)
   {
-((Container) comp).validateTree();
+cPeer = (ContainerPeer) peer;
+cPeer.beginLayout();
   }
-else
+
+doLayout ();
+for (int i = 0; i  ncomponents; ++i)
   {
-comp.validate();
+Component comp = component[i];
+
+if (comp instanceof Container  ! (comp instanceof Window)
+ ! comp.valid)
+  {
+((Container) comp).validateTree();
+  }
+else
+  {
+comp.validate();
+  }
   }
-  }
 
-if (peer instanceof ContainerPeer)
-  {
-cPeer = (ContainerPeer) peer;
-cPeer.endValidate();
+if (cPeer != null)
+  {
+cPeer = (ContainerPeer) peer;
+cPeer.endLayout();
+  }
   }
 
 /* children will call invalidate() when they are layed out. It
is therefore important that valid is not set to true
  

[cp-patches] FYI: DataFlavor fixlet

2006-10-18 Thread Roman Kennke
In the DataFlavor(String) constructor we checked if a space is contained
in the mime string. My TransferHandler testcases show that space is
actually allowed, like in application/x-java-jvm-local-objectref;
class=java.lang.String.

I will add a more extensive testcase for that particular case soon, and
commit this for the time beeing so that the TransferHandler tests can
pass.

2006-10-18  Roman Kennke  [EMAIL PROTECTED]

* java/awt/datatransfer/DataFlavor.java
(DataFlavor(String)): Removed check for space in mime string.

/Roman
Index: java/awt/datatransfer/DataFlavor.java
===
RCS file: /cvsroot/classpath/classpath/java/awt/datatransfer/DataFlavor.java,v
retrieving revision 1.31
diff -u -1 -5 -r1.31 DataFlavor.java
--- java/awt/datatransfer/DataFlavor.java	27 Jun 2006 18:00:02 -	1.31
+++ java/awt/datatransfer/DataFlavor.java	18 Oct 2006 09:41:08 -
@@ -326,32 +326,31 @@
 humanPresentableName = null;
   }
 
   /**
* Private constructor.
*/
   private DataFlavor(Class representationClass,
 String mimeType,
 String humanPresentableName)
   {
 this.representationClass = representationClass;
 this.mimeType = mimeType;
 
 // Do some simple validity checks
 String type = getPrimaryType() + / + getSubType();
-if (type.indexOf(' ') != -1
-|| type.indexOf('=') != -1
+if (type.indexOf('=') != -1
 || type.indexOf(';') != -1)
   throw new IllegalArgumentException(mimeType);
 
 if (humanPresentableName != null)
   this.humanPresentableName = humanPresentableName;
 else
   this.humanPresentableName = mimeType;
   }
 
   /**
* Initializes a new instance of codeDataFlavor/code.  The class
* and human readable name are specified, the MIME type will be
* application/x-java-serialized-object. If the human readable name
* is not specified (codenull/code) then the human readable name
* will be the same as the MIME type.


[cp-patches] FYI: JEditorPane fix

2006-10-18 Thread Roman Kennke
This is an old patch that enables basic HTML loading from URLs in
JEditorPanes via setPage(URL).

2006-10-18  Roman Kennke  [EMAIL PROTECTED]

* javax/swing/JEditorPane.java
(page): Removed field. The page is now stored in the correct
document property.
(getPage): Fetch page URL from document property.
(read): Set the document for this JEditorPane. Use a Reader
for reading in the document.
(setPage): Call getStream() to get the stream from which we read.
Fire property change. Store page in document property.

/Roman

Index: javax/swing/JEditorPane.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/JEditorPane.java,v
retrieving revision 1.35
diff -u -1 -5 -r1.35 JEditorPane.java
--- javax/swing/JEditorPane.java	31 Aug 2006 19:25:07 -	1.35
+++ javax/swing/JEditorPane.java	18 Oct 2006 09:54:59 -
@@ -496,31 +496,30 @@
  */
 public ViewFactory getViewFactory()
 {
   return new ViewFactory()
   {
 public View create(Element el)
 {
   return new WrappedPlainView(el);
 }
   };
 }
   }
 
   private static final long serialVersionUID = 3140472492599046285L;
   
-  private URL page;
   private EditorKit editorKit;
   
   boolean focus_root;
   
   // A mapping between content types and registered EditorKit types
   static HashMap registerMap;
   
   // A mapping between content types and used EditorKits
   HashMap editorMap;  
 
   public JEditorPane()
   {
 init();
 setEditorKit(createDefaultEditorKit());
   }
@@ -750,31 +749,31 @@
*
* @return codetrue/code when a Viewport should force the width of
* this component to match the viewport width
*/
   public boolean getScrollableTracksViewportWidth()
   {
 // Tests show that this returns true when the parent is a JViewport
 // and has a width  minimum UI width.
 Container parent = getParent();
 return parent != null  parent instanceof JViewport
 parent.getWidth()  getUI().getMinimumSize(this).width;
   }
 
   public URL getPage()
   {
-return page;
+return (URL) getDocument().getProperty(Document.StreamDescriptionProperty);
   }
 
   protected InputStream getStream(URL page)
 throws IOException
   {
 return page.openStream();
   }
 
   public String getText()
   {
 return super.getText();
   }
 
   public String getUIClassID()
   {
@@ -787,34 +786,36 @@
   }
 
   protected String paramString()
   {
 return JEditorPane;
   }
 
   /**
* This method initializes from a stream. 
*/
   public void read(InputStream in, Object desc) throws IOException
   {
 EditorKit kit = getEditorKit();
 if (kit instanceof HTMLEditorKit  desc instanceof HTMLDocument)
   {
-Document doc = (Document) desc;
+HTMLDocument doc = (HTMLDocument) desc;
+setDocument(doc);
 try
   {
-kit.read(in, doc, 0);
+InputStreamReader reader = new InputStreamReader(in);
+kit.read(reader, doc, 0);
   }
 catch (BadLocationException ex)
   {
 assert false : BadLocationException must not be thrown here.;
   }
   }
 else
   {
 Reader inRead = new InputStreamReader(in);
 super.read(inRead, desc);
   }
   }
 
   /**
* Establishes a binding between type and classname.  This enables
@@ -909,39 +910,40 @@
* Sets the current URL being displayed.  
*/
   public void setPage(String url) throws IOException
   {
 setPage(new URL(url));
   }
 
   /**
* Sets the current URL being displayed.  
*/
   public void setPage(URL page) throws IOException
   {
 if (page == null)
   throw new IOException(invalid url);
 
-try
-  {
-	this.page = page;
-	getEditorKit().read(page.openStream(), getDocument(), 0);
-  }
-catch (BadLocationException e)
+URL old = getPage();;
+InputStream in = getStream(page);
+if (editorKit != null)
   {
-	// Ignored. '0' is always a valid offset.
+Document doc = editorKit.createDefaultDocument();
+doc.putProperty(Document.StreamDescriptionProperty, page);
+read(in, doc);
+setDocument(doc);
   }
+firePropertyChange(page, old, page);
   }
 
   /**
* Sets the text of the JEditorPane.  The argument codet/code
* is expected to be in the format of the current EditorKit.  This removes
* the content of the current document and uses the EditorKit to read in the
* new text.  This allows the EditorKit to handle the String rather than just
* inserting in plain text.
* 
* @param t the text to display in this JEditorPane
*/
   public void setText(String t)
   {
 try
 {


Re: [cp-patches] FYI: JEditorPane fix

2006-10-18 Thread David Gilbert

Hi Roman,

I was hopeful that this might improve the JFreeChart demo a little, 
because it displays an HTML description of the selected chart.  With GNU 
Classpath, the description is currently displayed as plain text with 
visible HTML tags.


It turns out that with your patch, the chart description disappears 
entirely.  It might be because the demo uses a JTextPane to display the 
description (JTextPane is a subclass of JEditorPane).  I don't know how 
to fix this in GNU Classpath.  Do you have time to look at the JTextPane 
class?  If not, I'll file a bug so it isn't forgotten in the long run...


Regards,

Dave

Roman Kennke wrote:

This is an old patch that enables basic HTML loading from URLs in
JEditorPanes via setPage(URL).

2006-10-18  Roman Kennke  [EMAIL PROTECTED]

* javax/swing/JEditorPane.java
(page): Removed field. The page is now stored in the correct
document property.
(getPage): Fetch page URL from document property.
(read): Set the document for this JEditorPane. Use a Reader
for reading in the document.
(setPage): Call getStream() to get the stream from which we read.
Fire property change. Store page in document property.

/Roman

  




Re: [cp-patches] FYI: JEditorPane fix

2006-10-18 Thread David Gilbert
I've attached a minimal test case that shows the problem.  Run the test 
code with the test.html file in the same directory as the 
JTextPaneTest.class file.  I tried changing the JTextPane to a 
JEditorPane, but that fails also.


Regards,

Dave

David Gilbert wrote:

Hi Roman,

I was hopeful that this might improve the JFreeChart demo a little, 
because it displays an HTML description of the selected chart.  With 
GNU Classpath, the description is currently displayed as plain text 
with visible HTML tags.


It turns out that with your patch, the chart description disappears 
entirely.  It might be because the demo uses a JTextPane to display 
the description (JTextPane is a subclass of JEditorPane).  I don't 
know how to fix this in GNU Classpath.  Do you have time to look at 
the JTextPane class?  If not, I'll file a bug so it isn't forgotten in 
the long run...


Regards,

Dave

Roman Kennke wrote:

This is an old patch that enables basic HTML loading from URLs in
JEditorPanes via setPage(URL).

2006-10-18  Roman Kennke  [EMAIL PROTECTED]

* javax/swing/JEditorPane.java
(page): Removed field. The page is now stored in the correct
document property.
(getPage): Fetch page URL from document property.
(read): Set the document for this JEditorPane. Use a Reader
for reading in the document.
(setPage): Call getStream() to get the stream from which we read.
Fire property change. Store page in document property.

/Roman

  






import java.awt.Dimension;
import java.io.IOException;
import java.net.URL;

import javax.swing.JFrame;
import javax.swing.JTextPane;

public class JTextPaneTest extends JFrame {

public JTextPaneTest(String title) {
super(title);
JTextPane tp = new JTextPane();
tp.setEditable(false);
URL url = JTextPaneTest.class.getResource(test.html);
try {
tp.setPage(url);
} 
catch (IOException e) {
e.printStackTrace();
}
setContentPane(tp);
}
public static void main(String[] args) {
JTextPaneTest app = new JTextPaneTest(JTextPaneTest);
app.setPreferredSize(new Dimension(600, 400));
app.pack();
app.setVisible(true);
}
}
Hello World!

This is a JTextPane.

[cp-patches] FYI: JEditorPane content type fix

2006-10-18 Thread Roman Kennke
I added support for detecting the content type of the connection stream
in JEditorPane. This way a JEditorPane can automatically load the
correct EditorKit.

2006-10-18  Roman Kennke  [EMAIL PROTECTED]

* javax/swing/JEditorPane.java
(getStream): Try to detect and set the content type of the
connection stream.

/Roman




[cp-patches] FYI: GTK Window fix

2006-10-18 Thread Roman Kennke
In GtkWindowPeer we really should call update() on the Window when an
UPDATE PaintEvent arrives. The testcase in 

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29502

demonstrates that. (I'll try to add that to Mauve).

That testcase shows another problem with Window event handling (window
not closing), which is also fixed by this patch.

2006-10-18  Roman Kennke  [EMAIL PROTECTED]

PR 29502
* gnu/java/awt/peer/gtk/GtkWindowPeer.java
(updateComponent): Don't override this here.
* java/awt/Window.java
(addWindowListener): Ignore null listener. Set newEventsOnly
flag.
(addWindowFocusListener): Ignore null listener. Set
newEventsOnly
flag.
(addWindowStateListener): Ignore null listener. Set
newEventsOnly
flag.

/Roman
Index: gnu/java/awt/peer/gtk/GtkWindowPeer.java
===
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkWindowPeer.java,v
retrieving revision 1.54
diff -u -1 -5 -r1.54 GtkWindowPeer.java
--- gnu/java/awt/peer/gtk/GtkWindowPeer.java	13 Oct 2006 15:15:12 -	1.54
+++ gnu/java/awt/peer/gtk/GtkWindowPeer.java	18 Oct 2006 16:18:45 -
@@ -366,37 +366,30 @@
 return retval;
   }
 
   public Graphics getGraphics ()
   {
 Graphics g = super.getGraphics ();
 // Translate AWT co-ordinates, which include a window frame's
 // insets, to GTK co-ordinates, which do not include a window
 // frame's insets.  GtkWindowPeer should always have all-zero
 // insets but GtkFramePeer and GtkDialogPeer insets will be
 // non-zero.
 g.translate (-insets.left, -insets.top);
 return g;
   }
 
-  protected void updateComponent (PaintEvent event)
-  {
-// Do not clear anything before painting.  Sun never calls
-// Window.update, only Window.paint.
-paintComponent(event);
-  }
-
   protected void postMouseEvent(int id, long when, int mods, int x, int y, 
 int clickCount, boolean popupTrigger)
   {
 // Translate AWT co-ordinates, which include a window frame's
 // insets, to GTK co-ordinates, which do not include a window
 // frame's insets.  GtkWindowPeer should always have all-zero
 // insets but GtkFramePeer and GtkDialogPeer insets will be
 // non-zero.
 super.postMouseEvent (id, when, mods, 
 			  x + insets.left, y + insets.top, 
 			  clickCount, popupTrigger);
   }
 
   // We override this to keep it in sync with our internal
   // representation.
Index: java/awt/Window.java
===
RCS file: /cvsroot/classpath/classpath/java/awt/Window.java,v
retrieving revision 1.76
diff -u -1 -5 -r1.76 Window.java
--- java/awt/Window.java	18 Oct 2006 09:18:55 -	1.76
+++ java/awt/Window.java	18 Oct 2006 16:18:45 -
@@ -480,31 +480,35 @@
 	  }
 	else
 	  trimmedList = validList;
   }
 return trimmedList;
   }
 
   /**
* Adds the specified listener to the list of codeWindowListeners/code
* that will receive events for this window.
*
* @param listener The codeWindowListener/code to add.
*/
   public synchronized void addWindowListener(WindowListener listener)
   {
-windowListener = AWTEventMulticaster.add(windowListener, listener);
+if (listener != null)
+  {
+newEventsOnly = true;
+windowListener = AWTEventMulticaster.add(windowListener, listener);
+  }
   }
 
   /**
* Removes the specified listener from the list of
* codeWindowListeners/code that will receive events for this window.
*
* @param listener The codeWindowListener/code to remove.
*/
   public synchronized void removeWindowListener(WindowListener listener)
   {
 windowListener = AWTEventMulticaster.remove(windowListener, listener);
   }
 
   /**
* Returns an array of all the window listeners registered on this window.
@@ -537,41 +541,51 @@
*
* @since 1.4
*/
   public synchronized WindowStateListener[] getWindowStateListeners()
   {
 return (WindowStateListener[])
   AWTEventMulticaster.getListeners(windowStateListener,
WindowStateListener.class);
   }
 
   /**
* Adds the specified listener to this window.
*/
   public void addWindowFocusListener (WindowFocusListener wfl)
   {
-windowFocusListener = AWTEventMulticaster.add (windowFocusListener, wfl);
+if (wfl != null)
+  {
+newEventsOnly = true;
+windowFocusListener = AWTEventMulticaster.add (windowFocusListener,
+   wfl);
+  }
   }
   
   /**
* Adds the specified listener to this window.
*
* @since 1.4
*/
   public void addWindowStateListener (WindowStateListener wsl)
   {
-windowStateListener = AWTEventMulticaster.add (windowStateListener, wsl);  
+if (wsl != null)
+  {
+newEventsOnly = true;
+windowStateListener = AWTEventMulticaster.add 

[cp-patches] FYI: More scrolling fixes

2006-10-18 Thread Roman Kennke

This fixes a couple more issues with scrolling:
- In JTree I found a thinko in the Scrollable implementation, sometimes
causing a 'round-trip' scrolling when scrolling down.
- Sometimes the JTree cause an NPE in JComponent.repaint() when it
passed a null Rectangle in there. However, the
JTree.TreeSelectionRedirector class shouldn't paint at all, it only
redirects selection events. JTrees are still painted correctly.

- I moved some code around in BasicScrollBarUI and BasicScrollPaneUI to
avoid duplication of scrolling code in the wheel scroller.
- Also I added a check to only allow wheel scrolling when the
appropriate property in JScrollPane is set.

/Roman

2006-10-18  Roman Kennke  [EMAIL PROTECTED]

PR 28769
* javax/swing/JScrollPane.java
(viewportBorder): Made field private.
(wheelScrollingEnabled): Made field private.
(JScrollPane): Enabled wheel scrolling by default.
* javax/swing/JTree.java
(TreeSelectionRedirector.valueChanged): Don't repaint anything
here.
(getScrollableUnitIncrement): Fixed thinko.
* javax/swing/plaf/basic/BasicScrollBarUI.java
(static scrollByBlock): New static method to avoid code duplication
for the BasicScrollPane wheel scrolling.
(static scrollByUnits): New static method to avoid code duplication
for the BasicScrollPane wheel scrolling.
(scrollByBlock): Delegate to static helper method.
(scrollByUnit): Delegate to static helper method.
* javax/swing/plaf/basic/BasicScrollPaneUI.java
(MouseWheelHandler.mouseWheelMoved): Delegate to BasicScrollBarUI
static helper methods to avoid code duplication.
(MouseWheelHandler.bounds): Removed.
(MouseWheelHandler.getValue): Removed.
(MouseWheelHandler.scroll): Removed.

Index: javax/swing/JScrollPane.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/JScrollPane.java,v
retrieving revision 1.32
diff -u -1 -5 -r1.32 JScrollPane.java
--- javax/swing/JScrollPane.java	1 Jun 2006 04:38:49 -	1.32
+++ javax/swing/JScrollPane.java	18 Oct 2006 18:45:23 -
@@ -149,33 +149,34 @@
   
   protected JViewport columnHeader;
   protected JViewport rowHeader;
 
   protected Component lowerLeft;
   protected Component lowerRight;
   protected Component upperLeft;
   protected Component upperRight;
 
   protected JScrollBar horizontalScrollBar;
   protected int horizontalScrollBarPolicy;
   protected JScrollBar verticalScrollBar;
   protected int verticalScrollBarPolicy;
 
   protected JViewport viewport;
-  
-  Border viewportBorder;
-  boolean wheelScrollingEnabled;
+
+  private Border viewportBorder;
+
+  private boolean wheelScrollingEnabled;
 
   public JViewport getColumnHeader()
   {
 return columnHeader;
   }
 
   public Component getCorner(String key) 
   {
 if (getComponentOrientation() 
 == ComponentOrientation.LEFT_TO_RIGHT)
   {
 if (key == LOWER_LEADING_CORNER)
   key = LOWER_LEFT_CORNER;
 else if (key == LOWER_TRAILING_CORNER)
   key = LOWER_RIGHT_CORNER;
@@ -583,30 +584,31 @@
* codeview/code component; The scrollbar
* policies are set to codevsbPolicy/code and codehsbPolicy/code.
*
* @param vsbPolicy the vertical scrollbar policy to set
* @param hsbPolicy the vertical scrollbar policy to set
*
* @see ScrollPaneConstants#HORIZONTAL_SCROLLBAR_ALWAYS
* @see ScrollPaneConstants#HORIZONTAL_SCROLLBAR_AS_NEEDED
* @see ScrollPaneConstants#HORIZONTAL_SCROLLBAR_NEVER
* @see ScrollPaneConstants#VERTICAL_SCROLLBAR_ALWAYS
* @see ScrollPaneConstants#VERTICAL_SCROLLBAR_AS_NEEDED
* @see ScrollPaneConstants#VERTICAL_SCROLLBAR_NEVER
*/
   public JScrollPane(Component view, int vsbPolicy, int hsbPolicy) 
   {
+wheelScrollingEnabled = true;
 setVerticalScrollBarPolicy(vsbPolicy);
 setVerticalScrollBar(createVerticalScrollBar());
 setHorizontalScrollBarPolicy(hsbPolicy);
 setHorizontalScrollBar(createHorizontalScrollBar());
 viewport = createViewport();
 if (view != null)
   getViewport().setView(view);
 add(viewport,0);
 setLayout(new ScrollPaneLayout());
 setOpaque(false);
 updateUI();
   }
 
   
   public JScrollBar createHorizontalScrollBar()
Index: javax/swing/JTree.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/JTree.java,v
retrieving revision 1.76
diff -u -1 -5 -r1.76 JTree.java
--- javax/swing/JTree.java	8 Oct 2006 22:37:31 -	1.76
+++ javax/swing/JTree.java	18 Oct 2006 18:45:24 -
@@ -1267,37 +1267,30 @@
 protected TreeSelectionRedirector()
 {
   // Nothing to do here.
 }
 
 /**
  * Notifies when the tree selection changes.
  * 
  * @param ev the TreeSelectionEvent that describes the change
  */
 public void 

[cp-patches] FYI: Custom composites in CairoSurfaceGraphics

2006-10-18 Thread Francis Kung
Hi,

The attached patch implements custom composites in CairoSurfaceGraphics,
with the same approach that I've been using so far.

I'll commit my tests to either mauve as visual tests, or to the java2d
demo, eventually...

Cheers,
Francis


2006-10-18  Francis Kung  [EMAIL PROTECTED]

* gnu/java/awt/peer/gtk/CairoSurfaceGraphics.java
(drawRenderedImage):  New method.
(drawImage): New method.
(CairoSurfaceGraphics): Set clip.
(createBuffer): New method.
(getBufferCM): New method.
(drawComposite): New method.
(fill): New method.
(getNativeCM): New method.
(drawGlyphVector): New method.
(draw): New method.
* gnu/java/awt/peer/gtk/VolatileImageGraphics.java
(getNativeCM): Reflect renamed field.
* gnu/java/awt/peer/gtk/CairoSurface.java
(cairoCM_pre): Renamed from cairoColorModel.
(cairoColorModel): Set premultiplication to false.

Index: gnu/java/awt/peer/gtk/CairoSurface.java
===
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/CairoSurface.java,v
retrieving revision 1.20
diff -u -r1.20 CairoSurface.java
--- gnu/java/awt/peer/gtk/CairoSurface.java	11 Oct 2006 20:14:59 -	1.20
+++ gnu/java/awt/peer/gtk/CairoSurface.java	18 Oct 2006 18:44:55 -
@@ -72,14 +72,22 @@
*/
   long bufferPointer;
 
-  static ColorModel cairoColorModel = new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
-   32, 0x00FF,
+  // FIXME: use only the cairoCM_pre colormodel
+  // since that's what Cairo really uses (is there a way to do this cheaply?
+  // we use a non-multiplied model most of the time to avoid costly coercion
+  // operations...)
+  static ColorModel cairoColorModel = new DirectColorModel(32, 0x00FF,
0xFF00,
0x00FF,
-   0xFF00,
-   true,
-   Buffers.smallestAppropriateTransferType(32));
+   0xFF00);
 
+  static ColorModel cairoCM_pre = new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+   32, 0x00FF,
+   0xFF00,
+   0x00FF,
+   0xFF00,
+   true,
+   Buffers.smallestAppropriateTransferType(32));
   /**
* Allocates and clears the buffer and creates the cairo surface.
* @param width, height - the image size
Index: gnu/java/awt/peer/gtk/VolatileImageGraphics.java
===
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/VolatileImageGraphics.java,v
retrieving revision 1.9
diff -u -r1.9 VolatileImageGraphics.java
--- gnu/java/awt/peer/gtk/VolatileImageGraphics.java	11 Oct 2006 20:14:59 -	1.9
+++ gnu/java/awt/peer/gtk/VolatileImageGraphics.java	18 Oct 2006 18:44:56 -
@@ -306,7 +306,7 @@
 // the fixme in drawImage) so we use the naive Cairo model instead to trick
 // the compositing context.
 // Because getNativeCM() == getBufferCM() for this peer, it doesn't break.
-return CairoSurface.cairoColorModel;
+return CairoSurface.cairoCM_pre;
   }
 }
 
Index: gnu/java/awt/peer/gtk/CairoSurfaceGraphics.java
===
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/CairoSurfaceGraphics.java,v
retrieving revision 1.7
diff -u -r1.7 CairoSurfaceGraphics.java
--- gnu/java/awt/peer/gtk/CairoSurfaceGraphics.java	17 Jul 2006 22:41:03 -	1.7
+++ gnu/java/awt/peer/gtk/CairoSurfaceGraphics.java	18 Oct 2006 18:44:55 -
@@ -38,10 +38,26 @@
 
 package gnu.java.awt.peer.gtk;
 
+import java.awt.AlphaComposite;
+import java.awt.Color;
 import java.awt.Graphics;
-import java.awt.GraphicsEnvironment;
+import java.awt.Graphics2D;
 import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.Image;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.Toolkit;
+import java.awt.font.GlyphVector;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
 import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.ImageObserver;
+import java.awt.image.ImageProducer;
+import java.awt.image.RenderedImage;
+import java.util.Hashtable;
 
 /**
  * Implementation of Graphics2D on a 

[cp-patches] FYI: More Window fixes

2006-10-18 Thread Roman Kennke
This fixes two more issues with java.awt.Window:

- when calling show() we posted a WINDOW_OPENED twice, once from the
show() method itself, once from the peer. IMO the event should be posted
from the Window.show() method.
- dispose() also posted WINDOW_OPENED. This was a copy+paste mistake
when I copied this part over from show(). It should of course be a
WINDOW_CLOSED.

2006-10-18  Roman Kennke  [EMAIL PROTECTED]

* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
(AWT_WINDOW_OPENED): Remove unnecessary macro.
(window_show_cb): Removed unnecessary function.
(connect_signals): Don't connect signal for show.
* gnu/java/awt/peer/gtk/GtkWindowPeer.java
(hasBeenShown): Removed. This is handled in java.awt.Window.
(postWindowEvent): Removed handling of WINDOW_OPENED. This
is done in java.awt.Window.
* java/awt/Window.java
(dispose): Post WINDOW_CLOSED here, not WINDOW_OPENED.

/Roman
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
===
RCS file: /cvsroot/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c,v
retrieving revision 1.69
diff -u -1 -5 -r1.69 gnu_java_awt_peer_gtk_GtkWindowPeer.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c	25 Jul 2006 22:41:46 -	1.69
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c	18 Oct 2006 19:13:27 -
@@ -32,31 +32,30 @@
 independent module, the terms and conditions of the license of that
 module.  An independent module is a module which is not derived from
 or based on this library.  If you modify this library, you may extend
 this exception to your version of the library, but you are not
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
 
 #include gtkpeer.h
 #include gnu_java_awt_peer_gtk_GtkWindowPeer.h
 #include gdk/gdkprivate.h
 #include gdk/gdkx.h
 #include X11/Xatom.h
 #include gdk/gdkkeysyms.h
 
-#define AWT_WINDOW_OPENED 200
 #define AWT_WINDOW_CLOSING 201
 #define AWT_WINDOW_CLOSED 202
 #define AWT_WINDOW_ICONIFIED 203
 #define AWT_WINDOW_DEICONIFIED 204
 #define AWT_WINDOW_ACTIVATED 205
 #define AWT_WINDOW_DEACTIVATED 206
 #define AWT_WINDOW_GAINED_FOCUS 207
 #define AWT_WINDOW_LOST_FOCUS 208
 #define AWT_WINDOW_STATE_CHANGED 209
 
 /* Virtual Keys */
 /* This list should be kept in the same order as the VK_ field
declarations in KeyEvent.java. */
 #define VK_ENTER '\n'
 #define VK_BACK_SPACE '\b'
@@ -1034,31 +1033,30 @@
 
 static void window_get_frame_extents (GtkWidget *window,
   int *top, int *left,
   int *bottom, int *right);
 
 static void request_frame_extents (GtkWidget *window);
 
 static Bool property_notify_predicate (Display *display,
XEvent  *xevent,
XPointer arg);
 
 static gboolean window_delete_cb (GtkWidget *widget, GdkEvent *event,
 			  jobject peer);
 static void window_destroy_cb (GtkWidget *widget, GdkEvent *event,
 			   jobject peer);
-static void window_show_cb (GtkWidget *widget, jobject peer);
 static void window_focus_state_change_cb (GtkWidget *widget,
   GParamSpec *pspec,
   jobject peer);
 static gboolean window_focus_in_cb (GtkWidget * widget,
 GdkEventFocus *event,
 jobject peer);
 static gboolean window_focus_out_cb (GtkWidget * widget,
  GdkEventFocus *event,
  jobject peer);
 static gboolean window_window_state_cb (GtkWidget *widget,
 	GdkEvent *event,
 	jobject peer);
 static gboolean window_property_changed_cb (GtkWidget *widget,
 	GdkEventProperty *event,
 	jobject peer);
@@ -1310,33 +1308,30 @@
 {
   void *ptr;
   jobject *gref;
 
   gdk_threads_enter ();
 
   ptr = NSA_GET_PTR (env, obj);
   gref = NSA_GET_GLOBAL_REF (env, obj);
 
   g_signal_connect (G_OBJECT (ptr), delete-event,
 		G_CALLBACK (window_delete_cb), *gref);
 
   g_signal_connect (G_OBJECT (ptr), destroy-event,
 		G_CALLBACK (window_destroy_cb), *gref);
 
-  g_signal_connect (G_OBJECT (ptr), show,
-		G_CALLBACK (window_show_cb), *gref);
-
   g_signal_connect (G_OBJECT (ptr), notify::has-toplevel-focus,
   		G_CALLBACK (window_focus_state_change_cb), *gref);
 
   g_signal_connect (G_OBJECT (ptr), focus-in-event,
 G_CALLBACK (window_focus_in_cb), *gref);
 
   g_signal_connect (G_OBJECT (ptr), focus-out-event,
 G_CALLBACK (window_focus_out_cb), *gref);
 
   g_signal_connect (G_OBJECT (ptr), window-state-event,
 		G_CALLBACK (window_window_state_cb), *gref);
 
   g_signal_connect (G_OBJECT (ptr), 

[cp-patches] RFC: GtkButtonPeer fix

2006-10-18 Thread Tania Bento
Hey,

This patch fixes a segmentation fault caused when the button's label was
null.  

Can someone kindly comment on or approve this patch?

Thanks,
Tania

2006-10-18  Tania Bento  [EMAIL PROTECTED]

*native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c:
(gtkSetLabel): Prevented a segmentation fault.
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
===
RCS file: /cvsroot/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c,v
retrieving revision 1.30
diff -u -r1.30 gnu_java_awt_peer_gtk_GtkButtonPeer.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c	25 Aug 2005 02:26:49 -	1.30
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c	18 Oct 2006 20:28:05 -
@@ -170,13 +170,19 @@
 
   ptr = NSA_GET_PTR (env, obj);
 
-  text = (*env)-GetStringUTFChars (env, jtext, NULL);
-
+  if (jtext == NULL) {
+ text = ;
+  } else {
+ text = (*env)-GetStringUTFChars (env, jtext, NULL);
+  }
+  
   button = gtk_bin_get_child (GTK_BIN (ptr));
   label = gtk_bin_get_child (GTK_BIN (button));
   gtk_label_set_text (GTK_LABEL (label), text);
-
-  (*env)-ReleaseStringUTFChars (env, jtext, text);
+ 
+  if (jtext != NULL) {
+ (*env)-ReleaseStringUTFChars (env, jtext, text);
+  }
 
   gdk_threads_leave ();
 }


[cp-patches] FYI: appletviewer cleanups

2006-10-18 Thread Thomas Fitzsimmons

Hi,

I committed this patch to clean up the message handling in the appletviewer 
tool.  The patch also removes some unused classes.


Tom

2006-10-18  Thomas Fitzsimmons  [EMAIL PROTECTED]

* resource/gnu/classpath/tools/appletviewer/MessagesBundle.properties:
Rename file...
* resource/gnu/classpath/tools/appletviewer/messages.properties:
New file.
* 
resource/gnu/classpath/tools/appletviewer/MessagesBundle_de.properties:
Remove file.
* tools/gnu/classpath/tools/appletviewer/AppletWarning.java:
Remove file.
* tools/gnu/classpath/tools/appletviewer/ConsoleDialog.java:
Likewise.
* tools/gnu/classpath/tools/appletviewer/Messages.java: New file.
* tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java:
Retrieve user-visible strings through Messages.getString.
* tools/gnu/classpath/tools/appletviewer/Main.java: Likewise.
* tools/gnu/classpath/tools/appletviewer/PluginAppletContext.java:
Likewise.
* tools/gnu/classpath/tools/appletviewer/PluginAppletViewer.java:
Likewise.
* tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java:
Likewise.
* tools/gnu/classpath/tools/appletviewer/StandaloneAppletContext.java:
Likewise.
* tools/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.java:
Likewise.
* tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java:
Likewise.
Index: resource/gnu/classpath/tools/appletviewer/MessagesBundle.properties
===
RCS file: resource/gnu/classpath/tools/appletviewer/MessagesBundle.properties
diff -N resource/gnu/classpath/tools/appletviewer/MessagesBundle.properties
--- resource/gnu/classpath/tools/appletviewer/MessagesBundle.properties	9 May 2006 23:55:59 -	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -
@@ -1,70 +0,0 @@
-# MessagesBundle.properties -- English language messages
-# Copyright (C) 2004, 2006  Free Software Foundation, Inc.
-#
-# This file is part of GNU Classpath.
-#
-# GNU Classpath is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# GNU Classpath is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Classpath; see the file COPYING.  If not, write to the
-# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-#
-# Linking this library statically or dynamically with other modules is
-# making a combined work based on this library.  Thus, the terms and
-# conditions of the GNU General Public License cover the whole
-# combination.
-#
-# As a special exception, the copyright holders of this library give you
-# permission to link this library with independent modules to produce an
-# executable, regardless of the license terms of these independent
-# modules, and to copy and distribute the resulting executable under
-# terms of your choice, provided that you also meet, for each linked
-# independent module, the terms and conditions of the license of that
-# module.  An independent module is a module which is not derived from
-# or based on this library.  If you modify this library, you may extend
-# this exception to your version of the library, but you are not
-# obligated to do so.  If you do not wish to do so, delete this
-# exception statement from your version.
-
-gcjwebplugin.code_description=specify the code attribute
-gcjwebplugin.codebase_description=specify the codebase attribute
-gcjwebplugin.archive_description=specify the archive attribute
-gcjwebplugin.width_description=specify the width attribute
-gcjwebplugin.height_description=specify the height attribute
-gcjwebplugin.param_description=specify the parameter arguments
-gcjwebplugin.plugin_description=enable plugin mode
-gcjwebplugin.verbose_description=enable verbose mode
-gcjwebplugin.debug_description=enable debugging mode (not implemented)
-gcjwebplugin.encoding_description=specify the HTML character encoding
-
-gcjwebplugin.no_input_files=appletviewer: no input files
-
-gcjwebplugin.menu_title=Applet
-gcjwebplugin.menu_reload=Reload
-gcjwebplugin.menu_restart=Restart
-gcjwebplugin.menu_start=Start
-gcjwebplugin.menu_stop=Stop
-gcjwebplugin.menu_clone=Clone ...
-gcjwebplugin.menu_quit=Quit
-gcjwebplugin.menu_close=Close
-gcjwebplugin.menu_tag=Tag ...
-gcjwebplugin.menu_info=Info ...
-gcjwebplugin.menu_edit=Edit
-gcjwebplugin.menu_encoding=Character Encoding
-gcjwebplugin.menu_print=Print ...
-gcjwebplugin.menu_properties=Properties ...

Re: [cp-patches] RFC: GtkButtonPeer fix

2006-10-18 Thread Tania Bento
Hey,

Upon further inspection, it turns out that this is a bug in jamvm. 

Sorry,
Tania

On Wed, 2006-10-18 at 16:36 -0400, Tania Bento wrote:
 Hey,
 
 This patch fixes a segmentation fault caused when the button's label was
 null.  
 
 Can someone kindly comment on or approve this patch?
 
 Thanks,
 Tania
 
 2006-10-18  Tania Bento  [EMAIL PROTECTED]
 
   *native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c:
   (gtkSetLabel): Prevented a segmentation fault.




Re: Re: [cp-patches] RFC: GtkButtonPeer fix

2006-10-18 Thread Robert Lougher

Any details on how to reproduce it?  Is it 100% reproducible?  Send
some details and I'll have a look at it.

Rob.

On 10/18/06, Tania Bento [EMAIL PROTECTED] wrote:

Hey,

Upon further inspection, it turns out that this is a bug in jamvm.

Sorry,
Tania

On Wed, 2006-10-18 at 16:36 -0400, Tania Bento wrote:
 Hey,

 This patch fixes a segmentation fault caused when the button's label was
 null.

 Can someone kindly comment on or approve this patch?

 Thanks,
 Tania

 2006-10-18  Tania Bento  [EMAIL PROTECTED]

   *native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c:
   (gtkSetLabel): Prevented a segmentation fault.







[cp-patches] FYI: CardLayout fixes

2006-10-18 Thread Tania Bento
Hey,

This patch fixes a couple of bugs in CardLayout.

The first fix is in maximumLayoutSize.  If the value of the argument
passed is null, then a new Dimension with values of Integer.MAX_VALUE as
its width and height is returned.  I have committed a mauve test for
this modification.

The other fix is in the gotoComponent private method.  In the for-loop,
only the case where the component was already visible was being
considered.  You also need to consider the case where its not visible.
Is this case, you just need to make it visible.  This fix causes a
failing Intel test that was failing to pass.

Cheers,
Tania

2006-10-18  Tania Bento  [EMAIL PROTECTED]

* java/awt/CardLayout.java:
(maximumLayoutSize): Return a new Dimension with
Integer.MAX_VALUE as
its height and width if Container passed as argument is null.
(gotoComponent): Consider the case where the component is not
visible.

Index: java/awt/CardLayout.java
===
RCS file: /cvsroot/classpath/classpath/java/awt/CardLayout.java,v
retrieving revision 1.17
diff -u -r1.17 CardLayout.java
--- java/awt/CardLayout.java	1 Aug 2006 16:10:19 -	1.17
+++ java/awt/CardLayout.java	18 Oct 2006 21:42:33 -
@@ -225,6 +225,8 @@
*/
   public Dimension maximumLayoutSize (Container target)
   {
+if (target == null)
+  return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
 // The JCL says that this returns Integer.MAX_VALUE for both
 // dimensions.  But that just seems wrong to me.
 return getSize (target, MAX);
@@ -423,7 +425,10 @@
  
 		if (choice = 0)
 		  break;
-	  }
+	  } else 
+{
+  comps[i].setVisible(true);
+}
 	  }
 
 	if (choice = 0  choice  num)


[cp-patches] FYI: Frame.set[Extended]State support

2006-10-18 Thread Roman Kennke
This fixes a long outstanding AWT issue:
- Frame.set[Extended]State() is now fully supported (save for the
MAXIMIZE_VERT and MAXIMIZE_HORIZ settings, which isn't supported in GTK
yet). This means that an application can now request the AWT to
iconify/maximize a Frame.
- The window state events are now reported correctly and include the
extended states.

2006-10-18  Roman Kennke  [EMAIL PROTECTED]

PR 27091
* gnu/java/awt/peer/gtk/GtkFramePeer.java
(maximize): New native method.
(unmaximize): New native method.
(iconify): New native method.
(deiconify): New native method.
(getState): Implemented.
(setState): Implemented.
* gnu/java/awt/peer/gtk/GtkWindowPeer.java
(oldState): Rename to windowState and made protected, so that
the FramePeer can access it.
(postWindowEvent): Handle state change events more gently and
correctly.
* java/awt/Frame.java
(getState): Fetch state from getExtendedState().
(setExtendedState): Update the peer. Check if the state change
is actually supported.
(getExtendedState): Update the state from the peer.
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
(maximize): New method.
(unmaximize): New method.
(iconify): New method.
(deiconify): New method.
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
(AWT_FRAME_NORMAL): New macro.
(AWT_FRAME_ICONIFIED): New macro.
(AWT_FRAME_MAXIMIZED_BOTH): New macro.
(window_window_state_cb): Rewritten to handle window state changes
more gently (mostly on the java side of the world).
* include/gnu_java_awt_peer_gtk_GtkFramePeer.h: Regenerated.

/Roman

Index: include/gnu_java_awt_peer_gtk_GtkFramePeer.h
===
RCS file: /cvsroot/classpath/classpath/include/gnu_java_awt_peer_gtk_GtkFramePeer.h,v
retrieving revision 1.13
diff -u -1 -5 -r1.13 gnu_java_awt_peer_gtk_GtkFramePeer.h
--- include/gnu_java_awt_peer_gtk_GtkFramePeer.h	30 Apr 2006 10:37:36 -	1.13
+++ include/gnu_java_awt_peer_gtk_GtkFramePeer.h	18 Oct 2006 22:08:07 -
@@ -4,22 +4,26 @@
 #define __gnu_java_awt_peer_gtk_GtkFramePeer__
 
 #include jni.h
 
 #ifdef __cplusplus
 extern C
 {
 #endif
 
 JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_getMenuBarHeight (JNIEnv *env, jobject, jobject);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_setMenuBarWidthUnlocked (JNIEnv *env, jobject, jobject, jint);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_setMenuBarWidth (JNIEnv *env, jobject, jobject, jint);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_setMenuBarPeer (JNIEnv *env, jobject, jobject);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_removeMenuBarPeer (JNIEnv *env, jobject);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_gtkFixedSetVisible (JNIEnv *env, jobject, jboolean);
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_maximize (JNIEnv *env, jobject);
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_unmaximize (JNIEnv *env, jobject);
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_iconify (JNIEnv *env, jobject);
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_deiconify (JNIEnv *env, jobject);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_nativeSetIconImage (JNIEnv *env, jobject, jobject);
 
 #ifdef __cplusplus
 }
 #endif
 
 #endif /* __gnu_java_awt_peer_gtk_GtkFramePeer__ */
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
===
RCS file: /cvsroot/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c,v
retrieving revision 1.11
diff -u -1 -5 -r1.11 gnu_java_awt_peer_gtk_GtkFramePeer.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c	29 May 2006 16:14:59 -	1.11
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c	18 Oct 2006 22:08:07 -
@@ -176,15 +176,59 @@
 {
   void *ptr;
   GdkPixbuf *pixbuf = NULL;
 
   gdk_threads_enter ();
 
   pixbuf = cp_gtk_image_get_pixbuf (env, gtkimage);
   g_assert (pixbuf != NULL);
 
   ptr = NSA_GET_PTR (env, obj);
 
   gtk_window_set_icon (GTK_WINDOW (ptr), pixbuf);
 
   gdk_threads_leave ();
 }
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkFramePeer_maximize
+(JNIEnv *env, jobject obj)
+{
+  void *ptr;
+  gdk_threads_enter ();
+  ptr = NSA_GET_PTR (env, obj);
+  gtk_window_maximize (GTK_WINDOW (ptr));
+  gdk_threads_leave ();
+}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkFramePeer_unmaximize
+(JNIEnv *env, jobject obj)
+{
+  void *ptr;
+  gdk_threads_enter ();
+  ptr = NSA_GET_PTR (env, obj);
+  gtk_window_unmaximize (GTK_WINDOW (ptr));
+  gdk_threads_leave ();
+}
+
+JNIEXPORT void JNICALL

[cp-patches] FYI: copyArea() issue

2006-10-18 Thread Roman Kennke
copyArea() sometimes crashed GTK. This was caused by 0 size passed into
it (that caused a malloc with 0 length and an assertion error). I fixed
the safety check in CairoGraphics2D as well as the calling code to not
call copyArea() in the first place.


2006-10-18  Roman Kennke  [EMAIL PROTECTED]

PR 29419
* gnu/java/awt/peer/gtk/CairoGraphics2D.java
(copyArea): Changed size comparison to return when size == 0
too.
* javax/swing/JViewport.java
(paintBackingStore): Check width and height of blitted area
and only do blit if its  0.
(paintBlit): Check width and height of blitted area
and only do blit if its  0.

/Roman

Index: gnu/java/awt/peer/gtk/CairoGraphics2D.java
===
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java,v
retrieving revision 1.45
diff -u -1 -5 -r1.45 CairoGraphics2D.java
--- gnu/java/awt/peer/gtk/CairoGraphics2D.java	17 Oct 2006 18:59:19 -	1.45
+++ gnu/java/awt/peer/gtk/CairoGraphics2D.java	18 Oct 2006 22:27:03 -
@@ -1210,31 +1210,31 @@
   (Point2D) null);
 Point2D dim = transform.transform(new Point2D.Double(ox + owidth, 
 			 oy + oheight),
   (Point2D) null);
 Point2D p2 = transform.transform(new Point2D.Double(ox + odx, oy + ody),
  (Point2D) null);
 int x = (int)pos.getX();
 int y = (int)pos.getY();
 int width = (int)(dim.getX() - pos.getX());
 int height = (int)(dim.getY() - pos.getY());
 int dx = (int)(p2.getX() - pos.getX());
 int dy = (int)(p2.getY() - pos.getY());
 
 Rectangle2D r = getRealBounds();
 
-if( width  0 || height  0 )
+if( width = 0 || height = 0 )
   return;
 // Return if outside the surface
 if( x + dx  r.getWidth() || y + dy  r.getHeight() )
   return;
 
 if( x + dx + width  r.getX() || y + dy + height  r.getY() )
   return;
 
 // Clip edges if necessary 
 if( x + dx  r.getX() ) // left
   {
 	width = x + dx + width;
 	x = (int)r.getX() - dx;
   }
 
Index: javax/swing/JViewport.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/JViewport.java,v
retrieving revision 1.50
diff -u -1 -5 -r1.50 JViewport.java
--- javax/swing/JViewport.java	12 Oct 2006 10:20:52 -	1.50
+++ javax/swing/JViewport.java	18 Oct 2006 22:27:04 -
@@ -825,34 +825,37 @@
   }
 // Otherwise we can perform the blitting on the backing store image:
 // First we move the part that remains visible after scrolling, then
 // we only need to paint the bit that becomes newly visible.
 else
   {
 Graphics g2 = backingStoreImage.getGraphics();
 Point viewPosition = getViewPosition();
 int dx = viewPosition.x - lastPaintPosition.x;
 int dy = viewPosition.y - lastPaintPosition.y;
 boolean canBlit = computeBlit(dx, dy, cachedBlitFrom, cachedBlitTo,
   cachedBlitSize, cachedBlitPaint);
 if (canBlit)
   {
 // Copy the part that remains visible during scrolling.
-g2.copyArea(cachedBlitFrom.x, cachedBlitFrom.y,
-cachedBlitSize.width, cachedBlitSize.height,
-cachedBlitTo.x - cachedBlitFrom.x,
-cachedBlitTo.y - cachedBlitFrom.y);
+if (cachedBlitSize.width  0  cachedBlitSize.height  0)
+  {
+g2.copyArea(cachedBlitFrom.x, cachedBlitFrom.y,
+cachedBlitSize.width, cachedBlitSize.height,
+cachedBlitTo.x - cachedBlitFrom.x,
+cachedBlitTo.y - cachedBlitFrom.y);
+  }
 // Now paint the part that becomes newly visible.
 g2.setClip(cachedBlitPaint.x, cachedBlitPaint.y,
cachedBlitPaint.width, cachedBlitPaint.height);
 paintSimple(g2);
   }
 // If blitting is not possible for some reason, fall back to repainting
 // everything.
 else
   {
 // If the image has not been scrolled at all, only the changed
 // clip must be updated in the buffer.
 if (dx == 0  dy == 0)
   g2.setClip(g.getClip());
 
 paintSimple(g2);
@@ -876,34 +879,37 @@
*
* @param g the graphics context to use
*/
   void paintBlit(Graphics g)
   {
 // First we move the part that remains visible after scrolling, then
 // we only need to paint the bit that becomes newly visible.
 Point viewPosition = getViewPosition();
 int dx = viewPosition.x - lastPaintPosition.x;
 int dy = viewPosition.y - lastPaintPosition.y;
 boolean canBlit = computeBlit(dx, dy, cachedBlitFrom, cachedBlitTo,
   cachedBlitSize, cachedBlitPaint);
 if (canBlit  

Re: [cp-patches] FYI: Frame.set[Extended]State support

2006-10-18 Thread Thomas Fitzsimmons

Hi,

Roman Kennke wrote:

[...]


+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkFramePeer_unmaximize
+(JNIEnv *env, jobject obj)
+{
+  void *ptr;
+  gdk_threads_enter ();
+  ptr = NSA_GET_PTR (env, obj);
+  gtk_window_unmaximize (GTK_WINDOW (ptr));
+  gdk_threads_leave ();
+}


For consistency, can you leave a blank line before and after the 
gdk_threads_enter call and before the gdk_threads_leave call?  This 
makes it easier to visually verify that the locking functions are called 
 at the start and and end of each function in the peers.


[...]


+// Post old styleWindowEvent with WINDOW_ICONIFIED or


Typo in comment.

Other than these little things, this patch looks good.

Tom



[cp-patches] RFC: fix annotation inheritance

2006-10-18 Thread Tom Tromey
I'm not checking this in yet.

I wrote a patch for the annotation inheritance bug (PR 28203) for the
gcj-eclipse branch of gcj.  I also fixed a buglet (IMO) in
AnnotationInvocationHandler, and added a helper 'create' method to
that class.

This patch ports this work back to Classpath.

The only trouble is, I had to break Class.getAnnotations() to make
this compile against cvs head -- the Inherited class doesn't exist
there and is required for proper operation of the code.  So, the real
patch can only work on the generics branch.

What would you prefer?  The hacked patch on the trunk and the real
patch on the branch?  No change on the trunk and the real patch on the
branch?  Something else?

Note that the 1.4-ification is much uglier than the original, too, as
the original used foreach.

Finally, this adds a new native method, Method.getDefaultValue.  Not
sure if that is best either; but I have noticed that our Method and
Field implementations are missing a number of things related to
annotations.

Tom

2006-10-18  Tom Tromey  [EMAIL PROTECTED]

PR classpath/28203:
* java/lang/Class.java (getAnnotations): Rewrote.
* sun/reflect/annotation/AnnotationInvocationHandler.java (create):
New method.
(arrayClone): New method.
(invoke): Clone array return results.
* vm/reference/java/lang/reflect/Method.java (getDefaultValue): New
native method.

Index: java/lang/Class.java
===
RCS file: /cvsroot/classpath/classpath/java/lang/Class.java,v
retrieving revision 1.49
diff -u -r1.49 Class.java
--- java/lang/Class.java28 Apr 2006 13:43:02 -  1.49
+++ java/lang/Class.java19 Oct 2006 04:52:57 -
@@ -66,6 +66,7 @@
 import java.security.ProtectionDomain;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
 
@@ -1514,15 +1515,29 @@
*/
   public Annotation[] getAnnotations()
   {
-HashSet set = new HashSet();
-set.addAll(Arrays.asList(getDeclaredAnnotations()));
-Class[] interfaces = getInterfaces();
-for (int i = 0; i  interfaces.length; i++)
-  set.addAll(Arrays.asList(interfaces[i].getAnnotations()));
-Class superClass = getSuperclass();
-if (superClass != null)
-  set.addAll(Arrays.asList(superClass.getAnnotations()));
-return (Annotation[]) set.toArray(new Annotation[set.size()]);
+HashMap/*Class, Annotation*/ map = new HashMap/*Class, Annotation*/();
+Annotation[] as = getDeclaredAnnotations();
+for (int i = 0; i  as.length; ++i)
+  {
+Annotation a = as[i];
+map.put(a.annotationType(), a);
+  }
+for (Class s = getSuperclass();
+ s != null;
+ s = s.getSuperclass())
+  {
+as = s.getAnnotations();
+for (int i = 0; i  as.length; ++i)
+  {
+Annotation a = as[i];
+Class k = a.annotationType();
+// FIXME: only generics has Inherited.
+if (! map.containsKey(k) /*  
k.isAnnotationPresent(Inherited.class) */)
+  map.put(k, a);
+  }
+  }
+Collection/*Annotation*/ v = map.values();
+return (Annotation[]) v.toArray(new Annotation[v.size()]);
   }
 
   /**
Index: sun/reflect/annotation/AnnotationInvocationHandler.java
===
RCS file: 
/cvsroot/classpath/classpath/sun/reflect/annotation/AnnotationInvocationHandler.java,v
retrieving revision 1.1
diff -u -r1.1 AnnotationInvocationHandler.java
--- sun/reflect/annotation/AnnotationInvocationHandler.java 9 Jun 2006 
06:59:21 -   1.1
+++ sun/reflect/annotation/AnnotationInvocationHandler.java 19 Oct 2006 
04:53:00 -
@@ -39,11 +39,13 @@
 package sun.reflect.annotation;
 
 import java.io.Serializable;
+import java.lang.annotation.Annotation;
 import java.lang.annotation.AnnotationTypeMismatchException;
 import java.lang.annotation.IncompleteAnnotationException;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.Map;
@@ -74,6 +76,26 @@
 this.memberValues = memberValues;
 }
 
+public static Annotation create(Class type, Map memberValues)
+{
+  Method[] ms = type.getDeclaredMethods();
+  for (int i = 0; i  ms.length; ++i)
+{
+  Method m = ms[i];
+  String name = m.getName();
+  if (! memberValues.containsKey(name))
+{
+  // FIXME: what to do about exceptions here?
+  memberValues.put(name, m.getDefaultValue());
+}
+}
+  AnnotationInvocationHandler handler
+= new AnnotationInvocationHandler(type, memberValues);
+  return (Annotation) 

[cp-testresults] FAIL: regressions for mauve-jamvm on Wed Oct 18 09:36:08 UTC 2006

2006-10-18 Thread cpdev
Baseline from: Fri Sep 22 05:30:46 UTC 2006

Regressions:
FAIL: gnu.javax.crypto.sasl.srp.TestOfSRPPasswordFile
FAIL: java.awt.image.LookupOp.filterImage
FAIL: 
javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getForeground

Improvements:
PASS: java.awt.Component.keyPressTest
PASS: java.lang.Thread.sleep
PASS: javax.swing.JFileChooser.addChoosableFileFilter
PASS: javax.swing.JFileChooser.constructors
PASS: javax.swing.JFileChooser.getApproveButtonToolTipText
PASS: javax.swing.JFileChooser.getDialogType
PASS: javax.swing.JFileChooser.getFileFilter
PASS: javax.swing.JFileChooser.getFileSystemView
PASS: javax.swing.JFileChooser.getSelectedFiles
PASS: javax.swing.JFileChooser.removeChoosableFileFilter
PASS: javax.swing.JFileChooser.setApproveButtonText
PASS: javax.swing.JFileChooser.setCurrentDirectory
PASS: javax.swing.JFileChooser.setDialogType
PASS: javax.swing.JFileChooser.setFileFilter
PASS: javax.swing.JFileChooser.setFileSelectionMode
PASS: javax.swing.JFrame.glassPaneLayout
PASS: javax.swing.JFrame.paint5
PASS: javax.swing.JTable.TableRobot
PASS: javax.swing.plaf.basic.BasicFileChooserUI.getApproveButtonText
PASS: javax.swing.plaf.basic.BasicFileChooserUI.getCancelSelectionAction
PASS: javax.swing.plaf.basic.BasicFileChooserUI.getDialogTitle
PASS: javax.swing.plaf.basic.BasicFileChooserUI.getFileView
PASS: javax.swing.plaf.basic.BasicFileChooserUI.getUpdateAction
PASS: javax.swing.plaf.basic.BasicFormattedTextFieldUI.getPropertyPrefix
PASS: javax.swing.plaf.metal.MetalFileChooserUI.getApproveButton
PASS: javax.swing.plaf.metal.MetalFileChooserUI.getBottomPanel
PASS: javax.swing.plaf.metal.MetalFileChooserUI.getMaximumSize
PASS: javax.swing.plaf.metal.MetalFileChooserUI.setFileName

New fails:
FAIL: java.awt.Graphics.clearRect
FAIL: java.net.InetAddress.security
FAIL: java.net.Socket.security
FAIL: java.text.DecimalFormat.MaximumAndMinimumDigits
FAIL: java.text.DecimalFormat.PR23996
FAIL: java.text.DecimalFormat.toPattern14

Totals:
PASS: 2828
XPASS: 0
FAIL: 201
XFAIL: 0


___
Classpath-testresults mailing list
Classpath-testresults@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-testresults


[cp-testresults] FAIL: regressions for mauve-cacao on Wed Oct 18 16:27:31 UTC 2006

2006-10-18 Thread cpdev
Baseline from: Fri Sep 29 17:47:30 UTC 2006

Regressions:
FAIL: java.awt.ColorClass.brighter
FAIL: java.awt.Graphics.TestPaintGraphics
FAIL: java.awt.image.LookupOp.filterImage
FAIL: java.util.zip.Deflater.PR27435
FAIL: javax.swing.JComboBox.ComboRobot
FAIL: javax.swing.JTable.TableRobot

Improvements:
PASS: java.awt.Scrollbar.ScrollbarPaintTest
PASS: java.awt.event.MouseEvent.modifiers
PASS: java.awt.event.MouseEvent.modifiersEx
PASS: java.beans.EventHandler.check
PASS: java.beans.EventHandler.check14
PASS: java.beans.EventHandler.check14b
PASS: java.beans.EventHandler.check14c
PASS: java.io.ObjectInputOutput.ProxySerializationTest
PASS: java.lang.reflect.Proxy.DeclaringClass
PASS: java.lang.reflect.Proxy.ExceptionRaising
PASS: java.lang.reflect.Proxy.ToString
PASS: java.lang.reflect.Proxy.check13
PASS: java.net.ServerSocket.ServerSocketTest

New fails:
FAIL: java.awt.Graphics.clearRect
FAIL: java.net.Socket.security
FAIL: java.text.DecimalFormat.PR23996

Totals:
PASS: 2817
XPASS: 0
FAIL: 211
XFAIL: 0


___
Classpath-testresults mailing list
Classpath-testresults@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-testresults


[cp-testresults] FAIL: generics classpath build on Wed Oct 18 21:03:08 UTC 2006

2006-10-18 Thread cpdev
6263. WARNING in ../../classpath/vm/reference/sun/misc/Unsafe.java (at line 297)
public native int arrayIndexScale(Class arrayClass);
  ^
Class is a raw type. References to generic type ClassT should be parameterized
--
--
6264. WARNING in ../../classpath/vm/reference/sun/reflect/misc/ReflectUtil.java 
(at line 54)
public static void checkPackageAccess(Class declaringClass)
  ^
Class is a raw type. References to generic type ClassT should be parameterized
--
6265. WARNING in ../../classpath/vm/reference/sun/reflect/misc/ReflectUtil.java 
(at line 69)
public static void ensureMemberAccess(Class caller,
  ^
Class is a raw type. References to generic type ClassT should be parameterized
--
6266. WARNING in ../../classpath/vm/reference/sun/reflect/misc/ReflectUtil.java 
(at line 70)
Class declarer,
^
Class is a raw type. References to generic type ClassT should be parameterized
--
--
6267. WARNING in ../../classpath/vm/reference/sun/reflect/Reflection.java (at 
line 47)
public static Class getCallerClass(int depth)
  ^
Class is a raw type. References to generic type ClassT should be parameterized
--
6267 problems (1 error, 6266 warnings)make[1]: *** [compile-classes] Error 255
make[1]: Leaving directory `/home/cpdev/Nightly/generics/build/lib'
make: *** [all-recursive] Error 1


___
Classpath-testresults mailing list
Classpath-testresults@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-testresults


[cp-testresults] FAIL: regressions for mauve-jamvm on Thu Oct 19 04:40:36 UTC 2006

2006-10-18 Thread cpdev
Baseline from: Fri Sep 22 05:30:46 UTC 2006

Regressions:
FAIL: gnu.javax.crypto.sasl.srp.TestOfSRPPasswordFile
FAIL: java.awt.image.LookupOp.filterImage
FAIL: 
javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getForeground

Improvements:
PASS: java.awt.Component.keyPressTest
PASS: javax.swing.JFileChooser.addChoosableFileFilter
PASS: javax.swing.JFileChooser.constructors
PASS: javax.swing.JFileChooser.getApproveButtonToolTipText
PASS: javax.swing.JFileChooser.getDialogType
PASS: javax.swing.JFileChooser.getFileFilter
PASS: javax.swing.JFileChooser.getFileSystemView
PASS: javax.swing.JFileChooser.getSelectedFiles
PASS: javax.swing.JFileChooser.removeChoosableFileFilter
PASS: javax.swing.JFileChooser.setApproveButtonText
PASS: javax.swing.JFileChooser.setCurrentDirectory
PASS: javax.swing.JFileChooser.setDialogType
PASS: javax.swing.JFileChooser.setFileFilter
PASS: javax.swing.JFileChooser.setFileSelectionMode
PASS: javax.swing.JFrame.glassPaneLayout
PASS: javax.swing.JFrame.paint5
PASS: javax.swing.JTable.TableRobot
PASS: javax.swing.plaf.basic.BasicFileChooserUI.getApproveButtonText
PASS: javax.swing.plaf.basic.BasicFileChooserUI.getCancelSelectionAction
PASS: javax.swing.plaf.basic.BasicFileChooserUI.getDialogTitle
PASS: javax.swing.plaf.basic.BasicFileChooserUI.getFileView
PASS: javax.swing.plaf.basic.BasicFileChooserUI.getUpdateAction
PASS: javax.swing.plaf.basic.BasicFormattedTextFieldUI.getPropertyPrefix
PASS: javax.swing.plaf.metal.MetalFileChooserUI.getApproveButton
PASS: javax.swing.plaf.metal.MetalFileChooserUI.getBottomPanel
PASS: javax.swing.plaf.metal.MetalFileChooserUI.getMaximumSize
PASS: javax.swing.plaf.metal.MetalFileChooserUI.setFileName

New fails:
FAIL: java.awt.Graphics.clearRect
FAIL: java.net.InetAddress.security
FAIL: java.net.Socket.security
FAIL: java.text.DecimalFormat.MaximumAndMinimumDigits
FAIL: java.text.DecimalFormat.PR23996
FAIL: java.text.DecimalFormat.toPattern14

Totals:
PASS: 2829
XPASS: 0
FAIL: 202
XFAIL: 0


___
Classpath-testresults mailing list
Classpath-testresults@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-testresults


Re: HTMLWriter

2006-10-18 Thread fchoong
Hi Roman,
Ok, I will probably get it after thinking through it a few more times.
Thanks for your help! ;)
 David Fu.

 Hi Fu.,

 Am Dienstag, den 17.10.2006, 22:15 +0900 schrieb [EMAIL PROTECTED]:
 Hi Roman,
 Thanks! That makes it much clearer! But I Still do not understand what
 is
 meant by Unwanted in the closeOutUnwantedEmbeddedTags()... :(

 Well. The API docs for writeEmbeddedTags() says:

 Searches for embedded tags in the AttributeSet and writes them out. It
 also stores these tags in a vector so that when appropriate the
 corresponding end tags can be written out.

 Then, the API docs for closeOutUnwantedEmbeddedTags() says the
 following:
 Searches the attribute set and for each tag that is stored in the tag
 vector. If the tag isnt found, then the tag is removed from the vector
 and a corresponding end tag is written out.

 This means to me that writeEmbeddedtag() writes the opening tags for the
 embedded tags in the AttributeSet and stores them in a datastructure
 (they say vector, but I suppose its better to use an HashSet since this
 is not public, and HashSet seems much more efficient here). Actually, in
 my understanding, we should only write an opening tag for an embedded
 tag that is in the AttributeSet, but not yet in the datastructure.

 Now, for the following tags the closeOutUnwantedEmbeddedTags() does the
 opposite: For each tag in the vector that is _not_ in the AttributeSet,
 it writes out the end tag (because for an embedded tag not present in
 the AttributeSet it means it must be closed).

 I hope that this helps. (And also note that this is only my
 interpretation of the specs in the light of the underlying modeling of
 HTML).

 Cheers, Roman







Signals, sockets and threads

2006-10-18 Thread Robert Schuster
Hi all,
the title looks like fun, eh? :)

In an attempt to get gnu/testlet/java/net/ServerSocket/ReturnOnClose to succeed
on Cacao with the new an shiny VMChannel implementation I found out the Cacao's
Thread.interrupt() does not cause blocking system calls to be interrupted. A
short glimpse a GCJ's code (where the above testcase runs fine) revealed that I
needed to add a pthread_kill (and an obligatory sigaction) to get things 
working.

With that in place I tried to implement a correct VMChannel.accept. The
interesting part looks like this:

  do
{
  ret = cpnio_accept (fd, (struct sockaddr *) addr, alen);
  tmp_errno = errno;

  /* Check if interrupted by Thread.interrupt(). If not then some
   * other unrelated signal interrupted the system function and
   * we should start over again.
   */
  if (tmp_errno == EINTR  JCL_thread_interrupted(env, clazz))
{
  JCL_ThrowException (env, java/net/SocketException, strerror
(tmp_errno));
  return -1;
}
}

  while (ret == -1);

  if (ret == -1)
{
  if (EWOULDBLOCK != tmp_errno  EAGAIN != tmp_errno)
JCL_ThrowException (env, java/net/SocketException, strerror 
(tmp_errno));
}

  return ret;

tmp_errno is an int which is set to 0 in the beginning.

The special bit is JCL_thread_interrupted which calls back into the VM
to ask it whether the current thread has its interrupted flag set. My idea is
that a delibarate Thread.interrupt() from inside the VM should stop
VMChannel.accept() while a user running: killall -SIGUSR1 cacao from the
console should not.

Is that implementation OK. If not please give me some pointers to make it 
better.

cya
Robert



signature.asc
Description: PGP signature


signature.asc
Description: OpenPGP digital signature


[Bug classpath/29499] New: [security] MappedByteBuffer DirectByteBufferImpl incorrectly use finalize to clean up

2006-10-18 Thread jeroen at frijters dot net
Both MappedByteBuffer and DirectByteBufferImpl use a finalize() method to free
the native memory, this is a potential security risk, because finalization does
not guarantee that an object is no longer reachable (it can still be
resurrected from another finalizer).

The proper way to handle clean up is by using a PhantomReference and a
ReferenceQueue.


-- 
   Summary: [security] MappedByteBuffer  DirectByteBufferImpl
incorrectly use finalize to clean up
   Product: classpath
   Version: 0.93
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: classpath
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jeroen at frijters dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29499



___
Bug-classpath mailing list
Bug-classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-classpath


[Bug swing/28769] Regression:JTree and JTable mouse-wheel scrolling

2006-10-18 Thread hendrich at informatik dot uni-hamburg dot de


--- Comment #9 from hendrich at informatik dot uni-hamburg dot de  
2006-10-18 15:15 ---
Hello Roman and Audrius,

first of all, thanks for working on Swing in general, and my bugs in
particular. Please don't quarrel about the bugs or the exact state of them.
By now, I am pretty experienced in re-opening bugs when necessary - for
example, right now :-)


 (In reply to comment #8)
 I have just tested the JTree scrolling with fresh CVS check. The scrolling in
 both components with mouse wheel works correctly. Scrolling both up and down 
 is possible, and even the boundary adjustment works as required. 
 The user likely
 tested with the outdated version. I am closing this as no longer
 unreproducible.

Well, I just tested with a fresh cvs checkout again to make sure. This is
on Linux x86 with jamvm and cacao, with my image viewer (Niffler) as
the text application.

Playing with a large tree with about 4000 nodes (max depth six levels)
shows that expanding and collapsing nodes in the tree works. However,
I also sometimes get NPEs [1] from repaint(), but the tree looks ok.

Basic mouse-wheel scrolling does indeed work now, both up and down,
but scrolling down to the very bottom often resets the scrollbar thumb, 
and one can scroll down again... Doesn't happen when scrolling up.
This doesn't happen always. My initial theory is that it happens 
when I use mouse-scrolling after expanding a new subtree, while it
gets fixed when I click or drag the scrollbar.

Is this an effect of the JTree layout cache? If so, please feel free
to close the bug again :-)

(If you bother to test this with my image viewer, please make sure to 
keep the mouse in motion... Otherwise, the HideCursorManager might trigger
and hide the mouse cursor on the image canvas, which wrongly also hides
the cursor in the JTree. I report this as a new bug.)


[1] NPE from repaint:
java.lang.NullPointerException
   at javax.swing.JComponent.repaint(JComponent.java:2889)
   at javax.swing.JTree$TreeSelectionRedirector.valueChanged(JTree.java:1287)
   at
javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:769)
   at
javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1163)
   at
javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(DefaultTreeSelectionModel.java:461)
   at
javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(DefaultTreeSelectionModel.java:338)
   at javax.swing.JTree.setSelectionPath(JTree.java:2211)
   at
javax.swing.plaf.basic.BasicTreeUI.selectPathForEvent(BasicTreeUI.java:2095)
   at
javax.swing.plaf.basic.BasicTreeUI$MouseHandler.handleEvent(BasicTreeUI.java:2543)
   at
javax.swing.plaf.basic.BasicTreeUI$MouseHandler.mousePressed(BasicTreeUI.java:2469)
   at java.awt.Component.processMouseEvent(Component.java:3808)
   at java.awt.Component.processEvent(Component.java:3670)
   at java.awt.Container.processEvent(Container.java:1027)
   at java.awt.Component.dispatchEventImpl(Component.java:5737)
   at java.awt.Container.dispatchEventImpl(Container.java:1922)
   at java.awt.Component.dispatchEvent(Component.java:2836)
   at java.awt.LightweightDispatcher.redispatch(LightweightDispatcher.java:325)
   at
java.awt.LightweightDispatcher.handleMouseEvent(LightweightDispatcher.java:151)
   at
java.awt.LightweightDispatcher.dispatchEvent(LightweightDispatcher.java:115)
   at java.awt.Container.dispatchEventImpl(Container.java:1911)
   at java.awt.Window.dispatchEventImpl(Window.java:607)
   at java.awt.Component.dispatchEvent(Component.java:2836)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:618)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)


-- 

hendrich at informatik dot uni-hamburg dot de changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|WORKSFORME  |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28769



___
Bug-classpath mailing list
Bug-classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-classpath


[Bug swing/28769] Regression:JTree and JTable mouse-wheel scrolling

2006-10-18 Thread roman at kennke dot org


--- Comment #10 from roman at kennke dot org  2006-10-18 15:25 ---
Hi Norman,

The NPE seems to be caused by unnecessary code in JTree.TreeSelectionRedirector
that repaints although it most likely should not. That's probably easy to fix.
I am not sure about the resetting. I will put together a very large tree for
Classpath's Swing demo and see what I can do.


-- 

roman at kennke dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2006-10-18 15:25:32
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28769



___
Bug-classpath mailing list
Bug-classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-classpath


[Bug swing/29500] New: setCursor modifies wrong JComponent

2006-10-18 Thread hendrich at informatik dot uni-hamburg dot de
My image viewer [1] uses a background thread to hide the cursor on the
main image canvas after some seconds of inactivity. This is done by a 
call to setCursor() with a custom transparent cursor.

Testing with classpath cvs 2006.08.18 shows that hiding the cursor and
restoring the original cursor basically works. However, the call to
ImageCanvas.setCursor() also changes (hides) the cursor of different 
parts of the GUI, namely the navigation tree and thumbnails preview panels,
and even the main menus.

A mouse-exit event on a component seems to reset the cursor in most cases.
However, entering the main image canvas re-enables the MouseHideManager,
and the cursor gets hidden again on whatever component it is positioned on.
Might be a problem with JSplitPane, JComponent, or even Component (AWT),
but I don't have a small testcase yet.

[1] http://tams-www.informatik.uni-hamburg.de/people/alumni/hendrich/niffler/


-- 
   Summary: setCursor modifies wrong JComponent
   Product: classpath
   Version: 0.93
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: swing
AssignedTo: roman at kennke dot org
ReportedBy: hendrich at informatik dot uni-hamburg dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29500



___
Bug-classpath mailing list
Bug-classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-classpath


[Bug swing/28769] Regression:JTree and JTable mouse-wheel scrolling

2006-10-18 Thread david dot gilbert at object-refinery dot com


--- Comment #11 from david dot gilbert at object-refinery dot com  
2006-10-18 15:41 ---
Hi Roman,

I can reproduce the resetting problem in the current Swing demo, by opening
up a subtree (so the scrollbar appears) then scrolling down with the mouse
wheel.  So you shouldn't need to modify the demo to reproduce this.

Sometimes I need to resize the JInternalFrame to see the problem (it seems that
when the frame is wide, the bug is less likely to show up).

Regards,

Dave


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28769



___
Bug-classpath mailing list
Bug-classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-classpath


[Bug classpath/29501] New: RMI fixed to localhost?

2006-10-18 Thread das05 at doc dot ic dot ac dot uk
When I attempt to call a Remote object which is running on JamVM with
Classpath, the calls fail because the caller (which is running Sun's JVM and
libraries) attempts to access localhost rather than the machine the Remote
object is on.

When the same Remote object is running on another machine which is running
Sun's JVM+libraries, no such problem occurs.

In the example code I will attach, class A (implements RemoteA) is running on
JamVM+Classpath and class B (implements RemoteB) is running on Sun's JVM, on a
machine with rmiregistry. Class A looks up class B and is supposed to call
class B to register itself, and then class B can call A.hi().

The A.hi() call results in a ConnectException with message connection refused
to localhost.

Interestingly, the reverse problem does not occur - code running on Classpath
can call a Remote object on Sun's libraries.

Furthermore, if the rmiregistry is run on the machine with Classpath, the very
same exception occurs. It's as if there is a field in the object passed out
from the Classpath machine that contains the IP calls should go to, and this is
fixed to localhost.

I have also been using the -D...codebase= and -D...policy= options as
necessary, and I have even tried -Djava.rmi.server.hostname=thecorrectone and
adding the correct host to /etc/hosts. None of these attempts work.


-- 
   Summary: RMI fixed to localhost?
   Product: classpath
   Version: 0.91
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: classpath
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: das05 at doc dot ic dot ac dot uk


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29501



___
Bug-classpath mailing list
Bug-classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-classpath


[Bug classpath/29501] RMI fixed to localhost?

2006-10-18 Thread das05 at doc dot ic dot ac dot uk


--- Comment #1 from das05 at doc dot ic dot ac dot uk  2006-10-18 15:48 
---
Created an attachment (id=12452)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12452action=view)
Remote interface A


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29501



___
Bug-classpath mailing list
Bug-classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-classpath


[Bug classpath/29501] RMI fixed to localhost?

2006-10-18 Thread das05 at doc dot ic dot ac dot uk


--- Comment #2 from das05 at doc dot ic dot ac dot uk  2006-10-18 15:49 
---
Created an attachment (id=12453)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12453action=view)
Remote interface B


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29501



___
Bug-classpath mailing list
Bug-classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-classpath


[Bug classpath/29501] RMI fixed to localhost?

2006-10-18 Thread das05 at doc dot ic dot ac dot uk


--- Comment #3 from das05 at doc dot ic dot ac dot uk  2006-10-18 15:49 
---
Created an attachment (id=12454)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12454action=view)
Class A


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29501



___
Bug-classpath mailing list
Bug-classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-classpath


[Bug classpath/29501] RMI fixed to localhost?

2006-10-18 Thread das05 at doc dot ic dot ac dot uk


--- Comment #4 from das05 at doc dot ic dot ac dot uk  2006-10-18 15:50 
---
Created an attachment (id=12455)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12455action=view)
Class B


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29501



___
Bug-classpath mailing list
Bug-classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-classpath


[Bug classpath/29502] New: Repaint requests ignored for lightweight components

2006-10-18 Thread gcj at esclat dot net
(I appologize for not specifying version information.  I'm using Fedora Core 5
with java-1.4.2-gcj-compat-1.4.2.0-40jpp_83rh.1 and I'm not sure how this
corresponds to the classpath version -- or indeed if the problem isn't in gij
or somewhere else.  Classpath is my best guess for the moment.)

Repaint requests on lightweight components appear to be ignored.  No invocation
of update(Graphics) is ever made as a result.  This behavior contradicts
documentation from Sun such as the following:

http://java.sun.com/products/jfc/tsc/articles/painting/index.html

I've also tested the same class files on Windows XP with Sun's JRE 1.5 and
repaint requests are honored there.  Replacing extends Component with
extends Canvas makes the problem disappear on Fedora Core, so only
lightweight components are affected.

I will attach a simple source file that demonstrates the problem.


-- 
   Summary: Repaint requests ignored for lightweight components
   Product: classpath
   Version: unspecified
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: classpath
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gcj at esclat dot net
  GCC host triplet: i686-redhat-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29502



___
Bug-classpath mailing list
Bug-classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-classpath


[Bug classpath/29502] Repaint requests ignored for lightweight components

2006-10-18 Thread gcj at esclat dot net


--- Comment #1 from gcj at esclat dot net  2006-10-18 16:00 ---
Created an attachment (id=12456)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12456action=view)
A simple example that demonstrates ignored repaint events

Use javac -d . Broken.java  java Broken to invoke this program.  A 320x240
window is created.  Clicking anywhere inside that results in a partial repaint
request that should make a simple filled arc appear.  That doesn't happen. 
Debugging statements are printed when the click happens and when the paint
method is called.  From this it should be easy to see that the repaint never
results in a paint invocation.  (Technically it should result in an update
invocation but the default implementation of that calls paint.  This code can
be trivially modified to instrument update too.  It never gets called.) 
Covering and revealing the window or moving part of it off screen results in
display of the arc, so system generated events seem to be properly handled.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29502



___
Bug-classpath mailing list
Bug-classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-classpath


[Bug classpath/29502] Repaint requests ignored for lightweight components

2006-10-18 Thread roman at kennke dot org


--- Comment #2 from roman at kennke dot org  2006-10-18 16:06 ---
Confirmed. I recently worked in this area. Will fix it asap.


-- 

roman at kennke dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |roman at kennke dot org
   |dot org |
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2006-10-18 16:06:55
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29502



___
Bug-classpath mailing list
Bug-classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-classpath


[Bug swing/28769] Regression:JTree and JTable mouse-wheel scrolling

2006-10-18 Thread roman at kennke dot org


--- Comment #12 from roman at kennke dot org  2006-10-18 16:09 ---
Thanks David. I can see the problem now. I think I know what the problem might
be.


-- 

roman at kennke dot org changed:

   What|Removed |Added

   Last reconfirmed|2006-10-18 15:25:32 |2006-10-18 16:09:37
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28769



___
Bug-classpath mailing list
Bug-classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-classpath


[Bug classpath/29502] Repaint requests ignored for lightweight components

2006-10-18 Thread cvs-commit at developer dot classpath dot org


--- Comment #3 from cvs-commit at developer dot classpath dot org  
2006-10-18 16:20 ---
Subject: Bug 29502

CVSROOT:/cvsroot/classpath
Module name:classpath
Changes by: Roman Kennke rabbit78 06/10/18 16:19:54

Modified files:
gnu/java/awt/peer/gtk: GtkWindowPeer.java 
java/awt   : Window.java 
.  : ChangeLog 

Log message:
2006-10-18  Roman Kennke  [EMAIL PROTECTED]

PR 29502
* gnu/java/awt/peer/gtk/GtkWindowPeer.java
(updateComponent): Don't override this here.
* java/awt/Window.java
(addWindowListener): Ignore null listener. Set newEventsOnly
flag.
(addWindowFocusListener): Ignore null listener. Set
newEventsOnly
flag.
(addWindowStateListener): Ignore null listener. Set
newEventsOnly
flag.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/awt/peer/gtk/GtkWindowPeer.java?cvsroot=classpathr1=1.54r2=1.55
http://cvs.savannah.gnu.org/viewcvs/classpath/java/awt/Window.java?cvsroot=classpathr1=1.76r2=1.77
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.8701r2=1.8702


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29502



___
Bug-classpath mailing list
Bug-classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-classpath


[Bug awt/29502] Repaint requests ignored for lightweight components

2006-10-18 Thread roman at kennke dot org


--- Comment #4 from roman at kennke dot org  2006-10-18 16:22 ---
The above patch fixes the situation for me. Are you able to retest, or should I
close the bug for now?


-- 

roman at kennke dot org changed:

   What|Removed |Added

 Status|ASSIGNED|WAITING
  Component|classpath   |awt
   Target Milestone|--- |0.93


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29502



___
Bug-classpath mailing list
Bug-classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-classpath


Re: Signals, sockets and threads

2006-10-18 Thread Guilhem Lavaux
Hi Robert,

You are using tmp_errno = errno... ret is precisely holding errno. I
have built the native-lib so that we are always thread safe. I have not
noticed that VMChannel is so native-lib agnostic. ;-) I will have to
rewrite VMChannel... Probably next weeks will be devoted to this.

In respect to this buggy interface, it is ok. :)

Cheers,

Guilhem.

Robert Schuster wrote:
 Hi all,
 the title looks like fun, eh? :)
 
 In an attempt to get gnu/testlet/java/net/ServerSocket/ReturnOnClose to 
 succeed
 on Cacao with the new an shiny VMChannel implementation I found out the 
 Cacao's
 Thread.interrupt() does not cause blocking system calls to be interrupted. A
 short glimpse a GCJ's code (where the above testcase runs fine) revealed that 
 I
 needed to add a pthread_kill (and an obligatory sigaction) to get things 
 working.
 
 With that in place I tried to implement a correct VMChannel.accept. The
 interesting part looks like this:
 
   do
 {
   ret = cpnio_accept (fd, (struct sockaddr *) addr, alen);
   tmp_errno = errno;
 
   /* Check if interrupted by Thread.interrupt(). If not then some
* other unrelated signal interrupted the system function and
* we should start over again.
*/
   if (tmp_errno == EINTR  JCL_thread_interrupted(env, clazz))
 {
   JCL_ThrowException (env, java/net/SocketException, strerror
 (tmp_errno));
   return -1;
 }
 }
 
   while (ret == -1);
 
   if (ret == -1)
 {
   if (EWOULDBLOCK != tmp_errno  EAGAIN != tmp_errno)
 JCL_ThrowException (env, java/net/SocketException, strerror 
 (tmp_errno));
 }
 
   return ret;
 
 tmp_errno is an int which is set to 0 in the beginning.
 
 The special bit is JCL_thread_interrupted which calls back into the VM
 to ask it whether the current thread has its interrupted flag set. My idea is
 that a delibarate Thread.interrupt() from inside the VM should stop
 VMChannel.accept() while a user running: killall -SIGUSR1 cacao from the
 console should not.
 
 Is that implementation OK. If not please give me some pointers to make it 
 better.
 
 cya
 Robert
 




Re: Signals, sockets and threads

2006-10-18 Thread Casey Marshall
Guilhem Lavaux wrote:
 Hi Robert,
 
 You are using tmp_errno = errno... ret is precisely holding errno. I

Nope. 'ret' contains the return value of 'accept', which is not the same
as 'errno'.

 have built the native-lib so that we are always thread safe. I have not
 noticed that VMChannel is so native-lib agnostic. ;-) I will have to
 rewrite VMChannel... Probably next weeks will be devoted to this.
 

Why does NIO need to use the native-lib way at all? What, pray tell, is
wrong with the POSIX way of doing things?

Please don't rewrite VMChannel. If accessing 'errno' is not thread safe
on some platforms (I think on Linux and Darwin it should be thread safe)
then we should work around that.

 In respect to this buggy interface, it is ok. :)
 

I fail to see why this is buggy.



gkeytool error

2006-10-18 Thread Haoyang Lin
Hello,

I did : gkeytool
then:
 
errors:
 
 java.lang.NoClassDefFoundError: gnu/classpath/tools/keytool/Main
No stacktrace available
 Caused by: java.lang.ClassNotFoundException:
 gnu.classpath.tools.keytool.Main not found in java.lang.ClassLoader

$1{urls=[file:/usr/local/classpath/share/classpath/glibj.zip,file:/usr/local/classpath/bin/./,file:/usr/local/classpath/share/classpath/tools.zip],
 parent=null}
at java.net.URLClassLoader.findClass(URLClassLoader.java:530)
at java.lang.ClassLoader.loadClass(ClassLoader.java:342)
at java.lang.ClassLoader$1.loadClass(ClassLoader.java:1112)
at java.lang.ClassLoader.loadClass(ClassLoader.java:294)

glibj.zip and tools.zip exist in /usr/local/classpath/share/classpath/ 
 What should I do? Please help.

thank you in advance
haoyang




Re: Signals, sockets and threads

2006-10-18 Thread Robert Lougher

On 10/18/06, Robert Schuster [EMAIL PROTECTED] wrote:


  do
{
  ret = cpnio_accept (fd, (struct sockaddr *) addr, alen);
}

  while (ret == -1);

  if (ret == -1)
{
  if (EWOULDBLOCK != tmp_errno  EAGAIN != tmp_errno)
JCL_ThrowException (env, java/net/SocketException, strerror 
(tmp_errno));
}

  return ret;

tmp_errno is an int which is set to 0 in the beginning.




Obvious point.  The check at the end of the loop is completely
redundant as you can never exit the loop with ret == -1.

You only want to loop if it was an EINTR but no Java-interrupt.
Currently this code loops for all errors apart from Java-interrupt.
This is wrong.  For example it will enter a never-ending loop if
accept returned EBADF, i.e. if the socket had closed for some reason.
A non-blocking socket will also spin while there was no connection
present.

Rob.



[commit-cp] classpath java/awt/Window.java javax/swing/JFra...

2006-10-18 Thread Roman Kennke
CVSROOT:/cvsroot/classpath
Module name:classpath
Changes by: Roman Kennke rabbit78 06/10/18 09:18:55

Modified files:
java/awt   : Window.java 
javax/swing: JFrame.java JDialog.java JWindow.java 
.  : ChangeLog 

Log message:
2006-10-18  Roman Kennke  [EMAIL PROTECTED]

PR 29448
* java/awt/Window.java
(eventTypeEnabled): Overridden to handle WindowEvents.
(processEvent): Switch between processWindowEvent(),
processWindowFocusEvent() and processWindowStateEvent() here,
rather than simply calling processWindowEvent().
(processWindowEvent): Only dispatch event to listener, do not
switch to processWindowFocusEvent() or processWindowStateEvent()
here.
* javax/swing/JFrame.java
(frameInit): Explicitly enable window and key events here.
(processWindowEvent): Throw out some unnecessary code.
* javax/swing/JWindow.java
(windowInit): Explicitly enable key events here.
* javax/swing/JDialog.java
(close_action): Renamed to closeAction.
(dialogInit): Explicitly enable window events here.
(getDefaultCloseOperation): Renamed close_action to closeAction.
(processWindowEvent): Throw out some unnecessary code.
Renamed close_action to closeAction.
(setDefaultCloseOperation): Renamed close_action to closeAction.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/java/awt/Window.java?cvsroot=classpathr1=1.75r2=1.76
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/JFrame.java?cvsroot=classpathr1=1.36r2=1.37
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/JDialog.java?cvsroot=classpathr1=1.22r2=1.23
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/JWindow.java?cvsroot=classpathr1=1.26r2=1.27
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.8694r2=1.8695




[commit-cp] classpath java/awt/datatransfer/DataFlavor.java...

2006-10-18 Thread Roman Kennke
CVSROOT:/cvsroot/classpath
Module name:classpath
Changes by: Roman Kennke rabbit78 06/10/18 09:42:23

Modified files:
java/awt/datatransfer: DataFlavor.java 
.  : ChangeLog 

Log message:
2006-10-18  Roman Kennke  [EMAIL PROTECTED]

* java/awt/datatransfer/DataFlavor.java
(DataFlavor(String)): Removed check for space in mime string.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/java/awt/datatransfer/DataFlavor.java?cvsroot=classpathr1=1.31r2=1.32
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.8697r2=1.8698




[commit-cp] classpath javax/swing/JEditorPane.java ChangeLog

2006-10-18 Thread Roman Kennke
CVSROOT:/cvsroot/classpath
Module name:classpath
Changes by: Roman Kennke rabbit78 06/10/18 09:55:48

Modified files:
javax/swing: JEditorPane.java 
.  : ChangeLog 

Log message:
2006-10-18  Roman Kennke  [EMAIL PROTECTED]

* javax/swing/JEditorPane.java
(page): Removed field. The page is now stored in the correct
document property.
(getPage): Fetch page URL from document property.
(read): Set the document for this JEditorPane. Use a Reader
for reading in the document.
(setPage): Call getStream() to get the stream from which we 
read.
Fire property change. Store page in document property.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/JEditorPane.java?cvsroot=classpathr1=1.35r2=1.36
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.8698r2=1.8699




[commit-cp] classpath javax/swing/RepaintManager.java Chang...

2006-10-18 Thread Roman Kennke
CVSROOT:/cvsroot/classpath
Module name:classpath
Changes by: Roman Kennke rabbit78 06/10/18 10:01:30

Modified files:
javax/swing: RepaintManager.java 
.  : ChangeLog 

Log message:
2006-10-18  Roman Kennke  [EMAIL PROTECTED]

* javax/swing/RepaintManager.java
(RepaintWorkerEvent): Pass full set of params to super.
(RepaintWorker.dispatch): Overridden to allow apps to call this
via reflection.
(addDirtyRegion): Synchronize a little more to protect the
dirtyComponents field and avoid NPEs.
(invokeLater): Pass full set of params to RepaintWorkerEvent
constructor.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/RepaintManager.java?cvsroot=classpathr1=1.46r2=1.47
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.8699r2=1.8700




[commit-cp] classpath javax/swing/JEditorPane.java ChangeLog

2006-10-18 Thread Roman Kennke
CVSROOT:/cvsroot/classpath
Module name:classpath
Changes by: Roman Kennke rabbit78 06/10/18 15:17:06

Modified files:
javax/swing: JEditorPane.java 
.  : ChangeLog 

Log message:
2006-10-18  Roman Kennke  [EMAIL PROTECTED]

* javax/swing/JEditorPane.java
(getStream): Try to detect and set the content type of the
connection stream.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/JEditorPane.java?cvsroot=classpathr1=1.36r2=1.37
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.8700r2=1.8701




[commit-cp] classpath gnu/java/awt/peer/gtk/GtkWindowPeer.j...

2006-10-18 Thread Roman Kennke
CVSROOT:/cvsroot/classpath
Module name:classpath
Changes by: Roman Kennke rabbit78 06/10/18 16:19:54

Modified files:
gnu/java/awt/peer/gtk: GtkWindowPeer.java 
java/awt   : Window.java 
.  : ChangeLog 

Log message:
2006-10-18  Roman Kennke  [EMAIL PROTECTED]

PR 29502
* gnu/java/awt/peer/gtk/GtkWindowPeer.java
(updateComponent): Don't override this here.
* java/awt/Window.java
(addWindowListener): Ignore null listener. Set newEventsOnly 
flag.
(addWindowFocusListener): Ignore null listener. Set 
newEventsOnly
flag.
(addWindowStateListener): Ignore null listener. Set 
newEventsOnly
flag.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/awt/peer/gtk/GtkWindowPeer.java?cvsroot=classpathr1=1.54r2=1.55
http://cvs.savannah.gnu.org/viewcvs/classpath/java/awt/Window.java?cvsroot=classpathr1=1.76r2=1.77
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.8701r2=1.8702




[commit-cp] classpath javax/swing/JScrollPane.java javax/sw...

2006-10-18 Thread Roman Kennke
CVSROOT:/cvsroot/classpath
Module name:classpath
Changes by: Roman Kennke rabbit78 06/10/18 18:46:25

Modified files:
javax/swing: JScrollPane.java JTree.java 
javax/swing/plaf/basic: BasicScrollBarUI.java 
BasicScrollPaneUI.java 
.  : ChangeLog 

Log message:
2006-10-18  Roman Kennke  [EMAIL PROTECTED]

PR 28769
* javax/swing/JScrollPane.java
(viewportBorder): Made field private.
(wheelScrollingEnabled): Made field private.
(JScrollPane): Enabled wheel scrolling by default.
* javax/swing/JTree.java
(TreeSelectionRedirector.valueChanged): Don't repaint anything
here.
(getScrollableUnitIncrement): Fixed thinko.
* javax/swing/plaf/basic/BasicScrollBarUI.java
(static scrollByBlock): New static method to avoid code 
duplication
for the BasicScrollPane wheel scrolling.
(static scrollByUnits): New static method to avoid code 
duplication
for the BasicScrollPane wheel scrolling.
(scrollByBlock): Delegate to static helper method.
(scrollByUnit): Delegate to static helper method.
* javax/swing/plaf/basic/BasicScrollPaneUI.java
(MouseWheelHandler.mouseWheelMoved): Delegate to 
BasicScrollBarUI
static helper methods to avoid code duplication.
(MouseWheelHandler.bounds): Removed.
(MouseWheelHandler.getValue): Removed.
(MouseWheelHandler.scroll): Removed.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/JScrollPane.java?cvsroot=classpathr1=1.32r2=1.33
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/JTree.java?cvsroot=classpathr1=1.76r2=1.77
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java?cvsroot=classpathr1=1.39r2=1.40
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/plaf/basic/BasicScrollPaneUI.java?cvsroot=classpathr1=1.32r2=1.33
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.8702r2=1.8703




[commit-cp] classpath gnu/java/awt/peer/gtk/CairoSurfaceGra...

2006-10-18 Thread Francis Kung
CVSROOT:/cvsroot/classpath
Module name:classpath
Changes by: Francis Kung fkung06/10/18 19:00:32

Modified files:
gnu/java/awt/peer/gtk: CairoSurfaceGraphics.java 
   VolatileImageGraphics.java 
   CairoSurface.java 
.  : ChangeLog 

Log message:
2006-10-18  Francis Kung  [EMAIL PROTECTED]

* gnu/java/awt/peer/gtk/CairoSurfaceGraphics.java
(drawRenderedImage):  New method.
(drawImage): New method.
(CairoSurfaceGraphics): Set clip.
(createBuffer): New method.
(getBufferCM): New method.
(drawComposite): New method.
(fill): New method.
(getNativeCM): New method.
(drawGlyphVector): New method.
(draw): New method.
* gnu/java/awt/peer/gtk/VolatileImageGraphics.java
(getNativeCM): Reflect renamed field.
* gnu/java/awt/peer/gtk/CairoSurface.java
(cairoCM_pre): Renamed from cairoColorModel.
(cairoColorModel): Set premultiplication to false.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/awt/peer/gtk/CairoSurfaceGraphics.java?cvsroot=classpathr1=1.7r2=1.8
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/awt/peer/gtk/VolatileImageGraphics.java?cvsroot=classpathr1=1.9r2=1.10
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/awt/peer/gtk/CairoSurface.java?cvsroot=classpathr1=1.20r2=1.21
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.8703r2=1.8704




[commit-cp] classpath ChangeLog tools/gnu/classpath/tools/a...

2006-10-18 Thread Thomas Fitzsimmons
CVSROOT:/sources/classpath
Module name:classpath
Changes by: Thomas Fitzsimmons fitzsim06/10/18 20:47:40

Modified files:
.  : ChangeLog 
tools/gnu/classpath/tools/appletviewer: CommonAppletStub.java 
Main.java 
PluginAppletContext.java 
PluginAppletViewer.java 
PluginAppletWindow.java 
StandaloneAppletContext.java 
StandaloneAppletViewer.java 
StandaloneAppletWindow.java 
Added files:
resource/gnu/classpath/tools/appletviewer: messages.properties 
tools/gnu/classpath/tools/appletviewer: Messages.java 
Removed files:
resource/gnu/classpath/tools/appletviewer: 
   MessagesBundle.properties 
   MessagesBundle_de.properties 
tools/gnu/classpath/tools/appletviewer: AppletWarning.java 
ConsoleDialog.java 

Log message:
2006-10-18  Thomas Fitzsimmons  [EMAIL PROTECTED]

* 
resource/gnu/classpath/tools/appletviewer/MessagesBundle.properties:
Rename file...
* resource/gnu/classpath/tools/appletviewer/messages.properties:
New file.
* 
resource/gnu/classpath/tools/appletviewer/MessagesBundle_de.properties:
Remove file.
* tools/gnu/classpath/tools/appletviewer/AppletWarning.java:
Remove file.
* tools/gnu/classpath/tools/appletviewer/ConsoleDialog.java:
Likewise.
* tools/gnu/classpath/tools/appletviewer/Messages.java: New 
file.
* tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java:
Retrieve user-visible strings through Messages.getString.
* tools/gnu/classpath/tools/appletviewer/Main.java: Likewise.
* 
tools/gnu/classpath/tools/appletviewer/PluginAppletContext.java:
Likewise.
* 
tools/gnu/classpath/tools/appletviewer/PluginAppletViewer.java:
Likewise.
* 
tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java:
Likewise.
* 
tools/gnu/classpath/tools/appletviewer/StandaloneAppletContext.java:
Likewise.
* 
tools/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.java:
Likewise.
* 
tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java:
Likewise.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.8705r2=1.8706
http://cvs.savannah.gnu.org/viewcvs/classpath/resource/gnu/classpath/tools/appletviewer/messages.properties?cvsroot=classpathrev=1.1
http://cvs.savannah.gnu.org/viewcvs/classpath/resource/gnu/classpath/tools/appletviewer/MessagesBundle.properties?cvsroot=classpathr1=1.3r2=0
http://cvs.savannah.gnu.org/viewcvs/classpath/resource/gnu/classpath/tools/appletviewer/MessagesBundle_de.properties?cvsroot=classpathr1=1.2r2=0
http://cvs.savannah.gnu.org/viewcvs/classpath/tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java?cvsroot=classpathr1=1.1r2=1.2
http://cvs.savannah.gnu.org/viewcvs/classpath/tools/gnu/classpath/tools/appletviewer/Main.java?cvsroot=classpathr1=1.6r2=1.7
http://cvs.savannah.gnu.org/viewcvs/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletContext.java?cvsroot=classpathr1=1.1r2=1.2
http://cvs.savannah.gnu.org/viewcvs/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletViewer.java?cvsroot=classpathr1=1.1r2=1.2
http://cvs.savannah.gnu.org/viewcvs/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java?cvsroot=classpathr1=1.1r2=1.2
http://cvs.savannah.gnu.org/viewcvs/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletContext.java?cvsroot=classpathr1=1.1r2=1.2
http://cvs.savannah.gnu.org/viewcvs/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.java?cvsroot=classpathr1=1.1r2=1.2
http://cvs.savannah.gnu.org/viewcvs/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java?cvsroot=classpathr1=1.2r2=1.3
http://cvs.savannah.gnu.org/viewcvs/classpath/tools/gnu/classpath/tools/appletviewer/Messages.java?cvsroot=classpathrev=1.1
http://cvs.savannah.gnu.org/viewcvs/classpath/tools/gnu/classpath/tools/appletviewer/AppletWarning.java?cvsroot=classpathr1=1.1r2=0
http://cvs.savannah.gnu.org/viewcvs/classpath/tools/gnu/classpath/tools/appletviewer/ConsoleDialog.java?cvsroot=classpathr1=1.1r2=0




[commit-cp] classpath ChangeLog java/awt/CardLayout.java

2006-10-18 Thread Tania Bento
CVSROOT:/cvsroot/classpath
Module name:classpath
Changes by: Tania Bento tbento06/10/18 21:51:05

Modified files:
.  : ChangeLog 
java/awt   : CardLayout.java 

Log message:
2006-10-18  Tania Bento  [EMAIL PROTECTED]

* java/awt/CardLayout.java:
(maximumLayoutSize): Return a new Dimension with 
Integer.MAX_VALUE as
its height and width if Container passed as argument is null.
(gotoComponent): Consider the case where the component is not 
visible.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.8706r2=1.8707
http://cvs.savannah.gnu.org/viewcvs/classpath/java/awt/CardLayout.java?cvsroot=classpathr1=1.17r2=1.18




[commit-cp] classpath ChangeLog include/gnu_java_awt_peer_g...

2006-10-18 Thread Roman Kennke
CVSROOT:/cvsroot/classpath
Module name:classpath
Changes by: Roman Kennke rabbit78 06/10/18 22:09:16

Modified files:
.  : ChangeLog 
include: gnu_java_awt_peer_gtk_GtkFramePeer.h 
native/jni/gtk-peer: gnu_java_awt_peer_gtk_GtkFramePeer.c 
 gnu_java_awt_peer_gtk_GtkWindowPeer.c 
gnu/java/awt/peer/gtk: GtkFramePeer.java GtkToolkit.java 
   GtkWindowPeer.java 
java/awt   : Frame.java 

Log message:
2006-10-18  Roman Kennke  [EMAIL PROTECTED]

PR 27091
* gnu/java/awt/peer/gtk/GtkFramePeer.java
(maximize): New native method.
(unmaximize): New native method.
(iconify): New native method.
(deiconify): New native method.
(getState): Implemented.
(setState): Implemented.
* gnu/java/awt/peer/gtk/GtkWindowPeer.java
(oldState): Rename to windowState and made protected, so that
the FramePeer can access it.
(postWindowEvent): Handle state change events more gently and
correctly.
* java/awt/Frame.java
(getState): Fetch state from getExtendedState().
(setExtendedState): Update the peer. Check if the state change
is actually supported.
(getExtendedState): Update the state from the peer.
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
(maximize): New method.
(unmaximize): New method.
(iconify): New method.
(deiconify): New method.
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
(AWT_FRAME_NORMAL): New macro.
(AWT_FRAME_ICONIFIED): New macro.
(AWT_FRAME_MAXIMIZED_BOTH): New macro.
(window_window_state_cb): Rewritten to handle window state 
changes
more gently (mostly on the java side of the world).
* include/gnu_java_awt_peer_gtk_GtkFramePeer.h: Regenerated.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.8707r2=1.8708
http://cvs.savannah.gnu.org/viewcvs/classpath/include/gnu_java_awt_peer_gtk_GtkFramePeer.h?cvsroot=classpathr1=1.13r2=1.14
http://cvs.savannah.gnu.org/viewcvs/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c?cvsroot=classpathr1=1.11r2=1.12
http://cvs.savannah.gnu.org/viewcvs/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c?cvsroot=classpathr1=1.70r2=1.71
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/awt/peer/gtk/GtkFramePeer.java?cvsroot=classpathr1=1.48r2=1.49
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java?cvsroot=classpathr1=1.93r2=1.94
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/awt/peer/gtk/GtkWindowPeer.java?cvsroot=classpathr1=1.56r2=1.57
http://cvs.savannah.gnu.org/viewcvs/classpath/java/awt/Frame.java?cvsroot=classpathr1=1.39r2=1.40




[commit-cp] classpath gnu/java/awt/peer/gtk/CairoGraphics2D...

2006-10-18 Thread Roman Kennke
CVSROOT:/cvsroot/classpath
Module name:classpath
Changes by: Roman Kennke rabbit78 06/10/18 22:28:12

Modified files:
gnu/java/awt/peer/gtk: CairoGraphics2D.java 
javax/swing: JViewport.java 
.  : ChangeLog 

Log message:
2006-10-18  Roman Kennke  [EMAIL PROTECTED]

PR 29419
* gnu/java/awt/peer/gtk/CairoGraphics2D.java
(copyArea): Changed size comparison to return when size == 0
too.
* javax/swing/JViewport.java
(paintBackingStore): Check width and height of blitted area
and only do blit if its  0.
(paintBlit): Check width and height of blitted area
and only do blit if its  0.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java?cvsroot=classpathr1=1.45r2=1.46
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/JViewport.java?cvsroot=classpathr1=1.50r2=1.51
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.8708r2=1.8709