RE: [Java-gnome-developer] Question concerning pixel graphics (fw d)
Brought to you by:
afcowie
From: Santeri P. <sjp...@cc...> - 2001-11-06 19:12:23
|
On Tue, 6 Nov 2001, Jeffrey Morgan wrote: > Once you invoke a method that returns this type it > will try to discover its' type at runtime using > gtk_type_name(GTK_OBJECT_TYPE(peer)). This will > fail on a GDK object. There also is a call > to GTK_IS_OBJECT(). There is no runtime type > identification of GDK objects and hence the > "define-boxed". This has been addressed to a > large extent in Gnome 2 but I will not have a > release that supports Gnome 2 until late January. This is an artifact of the object wrapping, not of Gdk types per se. The problem is that the code that is generated assumes it is always generated for Gtk bindings. The code assumes that. What should be done is to have a property for all objects to defined "what type" of object they are. That property would then be properly inherited, eg. for example something like.. (define-object GtkObject () (comment ...) (object-binding-type gtk)) (define-object GdkObject () (object-binding-type gdk)) (define-object GtkFoo (GtkObject) ...) (define-object GdkFoo (GtkObject) ...) Then, when code is generated which requires to access the underlying type mechanism, GtkFoo and GdkFoo at their code generation time have access to information of which type they are. Due to Java object safety properties it is sufficient that GdkObject and GtkObject are separate: it is not legal to pass a GdkObject to a method which excepts GtkObject -- thus if any class descendant (or itself) GtkObject is excepted, it is already known that the given object has the property of being a GTK object. This property is due to the Java type safety. -- sa...@ik... I have become death, destroyer of the worlds. |