2004-01-26 David Jee <djee@redhat.com>
* gnu/java/awt/peer/gtk/GtkComponentPeer.java (handleEvent): Implemented. Handles PaintEvents. (paint): Implemented. Use GTK native methods to queue updates for this heavyweight peer. * gnu/java/awt/peer/gtk/GtkContainerPeer.java (handleEvent): Removed. * java/awt/Component.java (paint): Implemented. Explictly paint the heavyweight peer. (update): Clear the background for heavyweight components. (paintAll): No need to call peer.paint() anymore. (processEvent): Don't process PaintEvents here. It's now done in the peer's handleEvent(). (processPaintEvent): Removed. * java/awt/Container.java (paint): No need to call super.paint(). Visit heavyweight children as well. (update): Don't clear the background here. It's done in Component.update(). (visitChildren): Added check to not recurse into Containers. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (filter_expose_event_handler): New method. Filter unwanted expose events while painting heavyweight peers. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_addExposeFilter): New method. Connect filter and block pre_event_handler. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_removeExposeFilter): New method. Disconnect filter and unblock pre_event_handler. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetQueueDrawArea): New method. Invalidate and update given area. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (pre_event_handler): Add checks for unwanted expose events. From-SVN: r76668
This commit is contained in:
parent
81a88a6157
commit
7edbd87e17
7 changed files with 191 additions and 90 deletions
|
@ -663,8 +663,9 @@ public class Container extends Component
|
|||
{
|
||||
if (!isShowing())
|
||||
return;
|
||||
super.paint(g);
|
||||
visitChildren(g, GfxPaintVisitor.INSTANCE, true);
|
||||
// Visit heavyweights as well, in case they were
|
||||
// erased when we cleared the background for this container.
|
||||
visitChildren(g, GfxPaintVisitor.INSTANCE, false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -678,11 +679,6 @@ public class Container extends Component
|
|||
*/
|
||||
public void update(Graphics g)
|
||||
{
|
||||
Rectangle clip = g.getClipBounds();
|
||||
if (clip == null)
|
||||
g.clearRect(0, 0, width, height);
|
||||
else
|
||||
g.clearRect(clip.x, clip.y, clip.width, clip.height);
|
||||
super.update(g);
|
||||
}
|
||||
|
||||
|
@ -1204,8 +1200,12 @@ public class Container extends Component
|
|||
for (int i = ncomponents - 1; i >= 0; --i)
|
||||
{
|
||||
Component comp = component[i];
|
||||
// If we're visiting heavyweights as well,
|
||||
// don't recurse into Containers here. This avoids
|
||||
// painting the same nested child multiple times.
|
||||
boolean applicable = comp.isVisible()
|
||||
&& (comp.isLightweight() || !lightweightOnly);
|
||||
&& (comp.isLightweight()
|
||||
|| !lightweightOnly && ! (comp instanceof Container));
|
||||
|
||||
if (applicable)
|
||||
visitChild(gfx, visitor, comp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue