Re: [gtk-list] Re: GC and GTK+



Kenneth Albanowski <kjahds@kjahds.com> writes:

> "Foreign" types would be handled simply by creating a new descendant of
> GTK_TYPE_POINTER, using the existing mechanisms.

I think we completely agree, modulo s/GTK_TYPE_POINTER/GTK_TYPE_FOREIGN/

I see GTK_TYPE_POINTER as a kludge that has to be removed someday.
Each and every use of GTK_TYPE_POINTER should be replaced with a more
precise type.

For example, gtkwidget.c uses GTK_TYPE_POINTER for GdkRectangle*.
Ideally, we should make a new builtin type GTK_TYPE_GDK_RECTANGLE
(derived from GTK_TYPE_BOXED) and use that instead of
GTK_TYPE_POINTER.

GtkNotebook uses GTK_TYPE_POINTER for GtkNotebookPage, which is just a
struct.  Maybe the notebook should identify pages with small integers
for the switch_page signal.

And so on.  I think only GtkCList makes additional use of
GTK_TYPE_POINTER in Gtk+-1.0 so we are pretty much there.
 
GTK_TYPE_FOREIGN would be for types from other dynamically typed
run-time systems, like Perl or Guile.  Note that GTK_TYPE_FOREIGN is
already there, but is not used by anyone, I think.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]