RE: [Java-gnome-developer] CVS: Problem with gdk_BaseObject.c and GTK_IS_OBJECT()
Brought to you by:
afcowie
From: Santeri P. <sa...@ik...> - 2001-10-09 19:34:56
|
On Tue, 9 Oct 2001, Jeffrey Morgan wrote: > I have struggled with this issue for some time and as yet haven't > found a solution. I need to determine if a void pointer is actually > pointing to a GTK type. All macros and methods in GTK assume this is > the case (like the GTK_IS_OBJECT macro below). Does anybody have a > suggestion? Of course there is no generic way to test that -- we could put all GTK objects into a hashtable and check them from there.. but that's not really an option. However, the caller to makeBaseObjectSubclass routine always knows the type of the 'peer' argument, eg. whether it is a GTK or non-GTK object. Thus, we could remove the GTK_IS_OBJECT test from makeBaseObjectSubclass, add a new routine makeGtkBaseObjectSubclass, which would have the GTK_IS_OBJECT test, and modify the code generator to use the GTK routine version when it knows that the underlying object (for which it is being called) is a GTK (or Gnome) object, and not some other (glib, gdk). -- sa...@ik... I have become death, destroyer of the worlds. |