[gui][PATCH] Fix MemoryImageSource and other things
Thomas Fitzsimmons
fitzsim@redhat.com
Thu Nov 25 03:17:00 GMT 2004
Hi,
I committed the attached patch that fixes a bunch of problems in
MemoryImageSource and the GTK peers. It
- updates image observers in GdkGraphics drawImage calls
- protects against negative menu bar widths in GtkFramePeer
- allows one to set an applet's size from its constructor
- fixes some bounds errors when accessing a memory image source's buffer
- makes memory image sources read directly from the pixel array, rather
than creating a copy
- uncomments gdk_flush calls in GdkGraphics -- for an explanation of why
they're needed, see this entry in the GTK FAQ:
http://www.gtk.org/faq/#AEN492
Tom
2004-11-15 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/awt/peer/gtk/GdkGraphics.java (drawImage variants):
Update image observer.
* gnu/java/awt/peer/gtk/GtkComponentPeer.java (createImage):
Start image production.
* gnu/java/awt/peer/gtk/GtkFramePeer.java (setMenuBar): Protect
against negative menu bar widths.
(setBounds): Likewise.
(postConfigureEvent): Likewise.
* gnu/java/awt/peer/gtk/GtkImage.java (imageComplete): Don't
remove consumer unless only a single frame has completed.
* gnu/java/awt/peer/gtk/GtkImagePainter.java (GtkImagePainter):
Add observer parameter.
(setPixels): Update image observer.
(imageComplete): Likewise.
* java/applet/Applet.java (width): New field.
(height): Likewise.
(setStub): Set size if width or height field has been set.
(resize): If stub is null save width and height values.
* java/awt/Component.java (reshape): Protect against null
parent.
* java/awt/image/MemoryImageSource.java
(MemoryImageSource(int,int,ColorModel,byte[],int,int)):
Document.
(MemoryImageSource(int,int,ColorModel,int[],int,int)):
Likewise.
(MemoryImageSource(int,int,ColorModel,byte[],int,int,Hashtable)):
Reference pixel array directly, rather than creating a local
copy.
(MemoryImageSource(int,int,ColorModel,int[],int,int,Hashtable)):
Likewise.
(newPixels(int,int,int,int)): Fix for loop and array copy
bounds.
(newPixels(int,int,int,int,boolean)): Likewise.
(startProduction): If animated call imageComplete with
SINGLEFRAME.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c: Uncomment
gdk_flush lines.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c
(drawPixels): Return if g is null or g->drawable is not a gdk
drawable.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: awt-image-fixes.patch
Type: text/x-patch
Size: 20442 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20041125/ef334005/attachment.bin>
More information about the Java-patches
mailing list