From: Ariel Rios <ariel@linuxppc.org>
To: guile-gtk@sourceware.cygnus.com, Rob Browning <rlb@cs.utexas.edu>
Subject: Converting defs file unto guile-wrap code
Date: Tue, 29 May 2001 21:14:00 -0000 [thread overview]
Message-ID: <991192650.2622.3.camel@soleil> (raw)
Ok.
I plan to translate defs files unto guile-wrap by
defining macros according to the different define-foo types;
Eg for enums:
;;other functions are omitted
(define-macro (define-enum name in-mod cname val)
`(define ,name (string-append (enum-do-let ,cname) (enum-do-values
,val) "\t#t)\n")))
ANd when evaluating for example:
guile> (define-enum DirectionType
(in-module "Gtk")
(c-name "GtkDirectionType")
(values
'("tab-forward" "GTK_DIR_TAB_FORWARD" 0)
'("tab-backward" "GTK_DIR_TAB_BACKWARD" 1)
'("up" "GTK_DIR_UP" 2)
'("down" "GTK_DIR_DOWN" 3)
'("left" "GTK_DIR_LEFT" 4)
'("right" "GTK_DIR_RIGHT" 5)))
guile> (display DirectionType)
(let ((we ((gw:wrap-enumeration mod '<gtk:GtkDirectionType>
"GtkDirectionType*"
"const GtkDirectionType*")))
(gw:enum-add-value! we "tab-forward" 'GTK_DIR_TAB_FORWARD)
(gw:enum-add-value! we "tab-backward" 'GTK_DIR_TAB_BACKWARD)
(gw:enum-add-value! we "up" 'GTK_DIR_UP)
(gw:enum-add-value! we "down" 'GTK_DIR_DOWN)
(gw:enum-add-value! we "left" 'GTK_DIR_LEFT)
(gw:enum-add-value! we "right" 'GTK_DIR_RIGHT)
#t)
Now, Is these the correct approach to follow? It is obviously
a very easy way of doing it.
Any objections?
Rob, do you think that the current defs format info is enough for
g-wrap?
ariel
next reply other threads:[~2001-05-29 21:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-29 21:14 Ariel Rios [this message]
2001-05-29 22:05 ` Rob Browning
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=991192650.2622.3.camel@soleil \
--to=ariel@linuxppc.org \
--cc=guile-gtk@sourceware.cygnus.com \
--cc=rlb@cs.utexas.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).