Re: introspection and broken API



Havoc Pennington wrote:

On Fri, 2005-03-25 at 00:45 -0500, Havoc Pennington wrote:
- put the main loop only in the GLib layer, no gtk_main visible
- hide color allocation, just always use the GdkRGB stuff
- fix some of the other examples of weird X features leaking through
- gdk_drawable_get_size() replaced by get_width()/get_height() accessors
- omit deprecated APIs
- omit non-multihead-correct APIs


A couple other good ones I remembered:
- dumping GtkObject out of the class hierarchy
There are two things that GtkObject provides: the "destroy" method+signal, and the floating reference.

For languages with some form of automatic memory management, it certainly makes sense to hide the floating reference concept. In most cases, this is just a case of checking if an object has a floating reference after construction, and if so ref+sink it so the language binding owns a real reference (with of GtkWindow, where you need to ref() only, since it starts with a single non-floating reference that you don't own).

Is there any reason to hide destroy() though? If you hide it, you'll need to provide some other way to destroy toplevel windows, among other things.

- killing off the argument to gtk_window_new
I'd put this one under "provide sane default values for arguments where appropriate", for languages that support default argument values (like C++, Python, Java, etc).

If language bindings provide default argument values, then it would probably be good if they use the same defaults :)

James.



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