On Tue, 2006-02-21 at 13:09 -0500, Lillian Angel wrote:
> > GLightweightPeer should probably be renamed to LightweightComponentPeer
> > though, and GtkLightweightPeer should be GtkLightweightContainerPeer.
> 
> 
> Attached is the updated patch.

OK, a few comments:

+public class LightweightComponentPeer
+  implements LightweightPeer, ContainerPeer

Does LightweightComponentPeer still need to implement ContainerPeer or
can it just implement ComponentPeer?

-
-            // Skip lightweight peers.
+            

Actually we do still need to skip lightweight peers here (and the patch
doesn't change the behaviour) so the comment should stay.

+    // This should be overridden by default Toolkit (eg. GtkToolkit).
+    // If target is an instance of Container, then a GtkLightweightPeer
+    // should be returned. Otherwise, an instance of GLightweightPeer
is
+    // returned for Components. This is because, all the properties of
a
+    // Container should be accessible (bounds, location etc).
+    // A lightweight Component should _just_ be drawn on its parent
window,
+    // but we should be able to reshape a Container. Therefore,
Component
+    // and Container lightweights should be treated differently.

You need to update the class names in this comment and the comment could
be clearer.  The reason for the distinction is that
LightweightComponentPeers really are lightweight but
GtkLightweightContainerPeer is lightweight in that it doesn't allocate
screen resources but it still has a backing widget that tracks its
bounds and location for use by the native side.

Tom



Reply via email to