g-wrap-dev
[Top][All Lists]
Advanced

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

Re: how to wrap arrays?


From: Andreas Rottmann
Subject: Re: how to wrap arrays?
Date: Sun, 03 Sep 2006 14:14:51 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

John Steele Scott <address@hidden> writes:

> Hi,
>
> Just for fun, I am using g-wrap to interface the cairo graphics library
> with guile. Thankfully this library has quite a wrapper-friendly
> interface, but I don't know how to do this one:
>
>   void cairo_set_dash(cairo_t *cr, 
>                       const double *dashes,
>                       int num_dashes,
>                       double offset);
>
> The num_dashes argument gives the number of values pointed to by
> dashes, and it may be 0.
>
> Ideally I'd like to be able to have a Scheme function which could be
> called like:
>
>   (cairo-set-dash cr (list 1.0 3.0 1.5 2.5) 2.5)
>
> Where dashes and num_dashes can be supplied based on the values and
> length of the list. But at the moment I don't know see how to handle
> the dashes argument at all. Any help would be appreciated.
>
G-Wrap currently doesn't support this (yet); a half-manual wrapper
must be written, consisting of an override and a C part:

The override:

(define-function gtk_stock_add
  (c-name    "_wrap_gtk_stock_add")
  (overrides "gtk_stock_add")
  (return-type "none")
  (parameters
   '("SCM" "items")))

C part:

void
_wrap_gtk_stock_add (SCM items)
{
  ...
}

HTH, 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

Anonymous surfing? Use Tor: http://tor.eff.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]