Re: Octave bindings for GTK+




On Jul 18, 2004, at 7:56 AM, Muthiah Annamalai wrote:

Muppet wrote
You may be able to work around this, if you make some evil assumptions. Assume that you have an int large enough to hold a pointer on all platforms. Then you could turn the widget pointers into integers that you'll use as "handles" in octave.
That was really cool! Abusing an integer ;-)

well, it's neither a great idea nor an original one; both win32 and x11 use "plain integers" as window handles, and this does not make for a very safe interface. but if you're stuck with it, you're stuck with it.

i think matlab also uses integer window ids, but i haven't messed with it in over a year (since i turned all my matlab code to octave code).


From what you said, I understood that

1: I must manually write 'C++' wrappers for interfacing Octave with GLib & GOBject.

yes, using octave's extension apis (whatever those might be).

2: Then I could use SWIG at some point of time to ceate the binding code for all the GTK+ widgets & GDK.

looking at swig's webpage (http://www.swig.org) i see no mention of octave as a target language for its code generator. you will probably have to roll your own solution.

3: I could then write Octave wrappers to access the internal dynamically loaded C++ functions of Octave.

all depends how you want to do it. a common practice is to do simple low-level bindings of the C lib to the target language, and then use target language-level code to wrap it up in a more idiomatic fashion. in some cases, the binding tools can go straight there (e.g. perl's xs) and skip the middle man.

i know nothing about this facet of octave, so i leave that as an exercise for the reader. :-)

--
Eight, eight, eight, eight ounces to gooooo, you're gonna be sedated!
  -- Elysse, singing while feeding rice cereal formula to
    fussy infant Yvonne




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