I keep seeing things that use GObject that could be useful (GEGL was the latest one).

Has anyone investigated the idea of using GObject and Objective-C together? The object models seem very similar, but the implementations are quite different. There are a few approaches I can see that might work:

1) Writing a parser that would take a GObject header and spit out a corresponding Objective-C class. This would work, but would only give us access to objects we knew about at compile time.

2) Writing a GObjectWrapper class, that would use forwardInvocation: to pass on messages to the corresponding functions. This would lose us any kind of nice type checking, but would be relatively clean, assuming GObject stores enough information to get method names at runtime...

3) Modifying the GNU Objective-C runtime so that it does this mapping for us, and lets us use GObjects as Objective-C objects directly. This would be ideal, but it would require some significant modifications to the objc_msgSend mechanism. Ideally, if I were to do this, I would wrap around the objc_object structure up in something that would include an object_type element. This would then contain a set of function pointers to equivalents of objc_msgSend, thus allowing us to add support for future object representations, but it would break binary compatibility with absolutely everything...

Thoughts?
_______________________________________________
Etoile-dev mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-dev

Reply via email to