Re: Adding full introspection information (#139486)




On Nov 6, 2004, at 9:12 AM, Owen Taylor wrote:

On Sat, 2004-11-06 at 08:34 -0500, muppet wrote:
answer this, then:  how will this introspection info help to bind
GBoxed types (generic structures)

If they are simple structures like GdkRectangle, that's reasonable to
include within

did you trail off here or mean "include within G_TYPE_POINTER properties"?

the problem here is that the boxed types will require either a full description of their members' types and offsets in typelib, or hand-written glue to access the members. for example, in gtk2-perl, some structures get automatically turned into native perl data structures (a hash or array), and this marshaling requires hand-written glue for each type; even if you don't do this, we have to hand-code (or custom-generate) accessors for each struct member.


 G_TYPE_POINTER object properties,

Shouldn't be any in properly bindable APIS.

"shouldn't" is the key; there are several. in fact, some signals with proper argument types still require custom marshalers to get the semantics correct (write-through parameters, etc).

in gtk+ itself, there are several signals with G_TYPE_POINTER properties:

GtkEditable::insert_text
GtkMenuItem::toggle_size_request
GtkNotebook::switch_page
GtkPathBar::path-clicked  (not public, is it?)
GtkSpinButton::input
GtkTreeModel::rows_reordered


variadic C functions,

These are only convenience functionality in properly bindable APIs. The
language binding might need similar convenience glue that is hand-
written.

in other words, you don't think that Maciej's goal of zero hand-written code in bindings (even for well-behaved APIs) is possible?

i think it will suffer at the hands of the 90-10 rule; it will be quite easy to get 90% of the bindings done right and automatic, but that last 10%, mostly esoteric but some critical things, will be an albatross.

--
If I lived in Teletubby Land, the homicide rate would be four.
  -- elysse




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