[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: making a SCM from a GObject *
From: |
Andreas Rottmann |
Subject: |
Re: making a SCM from a GObject * |
Date: |
Wed, 11 May 2005 09:31:31 +0200 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.4 (gnu/linux) |
gregory benison <address@hidden> writes:
> I have had success using this method:
> 1) Create a .defs file which describes your gobject - based header
> file. It describes all of your functions and custom types. Look in
> the guile-gnome distribution in the 'defs' directory for examples.
> You can use the 'h2defs.py' program (found in the guile-gnome
> distribution) to generate this file automatically from your headers,
> if you have followed normal conventions in writing your headers.
> 2) Process your .defs file to automatically create C-to-guile glue
> code for your gobject types. Look at any "*-spec.scm" file in the
> guile-gnome distribution to see how this works.
> 3) Compile the resulting C file into a shared library. Load it from a
> scheme interpreter, and your gobject type will be available to use
> from scheme.
>
> ( guile-gnome experts: is this the right approach?? )
>
Yes, this is exactly how it works. Sometimes you have to do some extra
C coding for functions that take callbacks, for instance.
Regards, Rotty
--
Andreas Rottmann | address@hidden | address@hidden | address@hidden
http://yi.org/rotty | GnuPG Key: http://yi.org/rotty/gpg.asc
Fingerprint | DFB4 4EB4 78A4 5EEE 6219 F228 F92F CFC5 01FD 5B62
v2sw7MYChw5pr5OFma7u7Lw2m5g/l7Di6e6t5BSb7en6g3/5HZa2Xs6MSr1/2p7 hackerkey.com
I have a truly elegant proof of the above, but it is too long to
fit into this .signature file.