public inbox for guile-gtk@sourceware.org
 help / color / mirror / Atom feed
* guile-gobject problem
@ 2003-08-11 20:30 Andreas Rottmann
  2003-08-12 14:49 ` guile-gobject problem [solved], g-wrap Andreas Rottmann
  2003-08-15 13:19 ` guile-gobject problem Andy Wingo
  0 siblings, 2 replies; 7+ messages in thread
From: Andreas Rottmann @ 2003-08-11 20:30 UTC (permalink / raw)
  To: guile-gtk

Hi!

Trying to use guile-gobject to create bindings for a library of mine,
I always get C compiler errors, since there is a mapping generated
from c-type none to <none>, which causes the return type type in the
wrapper to be declared of type 'none'.

So I have in the log file:

,----
| Opaque types in the gw-dstw wrapset: c-name scm-name
|  
| DSTWService* <dstwservice*>
| gboolean <gboolean>
| GType <gtype>
| char* <char*>
| none <none>
| gunichar* <gunichar*>
| ...
`----

Which leads to C code like this:

,----
| static char * gw__tmp246_dstw_servicetype_add_namestr = "dstw-servicetype-add";
| static SCM gw__tmp245_dstw_servicetype_add_wrapper  (SCM gw__scm_arg0, SCM gw__scm_arg1 ) {
|   SCM gw__scm_result = SCM_UNSPECIFIED;
|   enum GW__ErrorStatus gw__error_status = GW__ERR_NONE;
|   SCM gw__error_data = SCM_UNSPECIFIED;
|   unsigned int gw__arg_pos = 0;
|   const char *gw__error_misc_msg = NULL;
| none gw__c_result;
| ...
`----

My spec file:

,----
| (define-module (distwork server gw-dstw-spec)
|   :use-module (g-wrap)
|   :use-module (gnome gobject gw-glib-spec)
|   :use-module (gnome gobject defs-support)
|   :use-module (gnome gobject gw-spec-utils))
| 
| (let ((ws (gw:new-wrapset "gw-dstw")))
|   
|   (gw:wrapset-set-guile-module! ws '(distwork server gw-dstw))
|   
|   (gw:wrapset-add-cs-declarations!
|    ws
|    (lambda (wrapset client-wrapset)
|      (if (eq? client-wrapset wrapset)
|          '()
|          (list "#include <libdstw/service.h>\n"))))
| 
|   (load-defs ws "distwork/defs/dstw.defs")
| 
|   ws)
`----

Hope somebody has a hint for me :-/

Thanks, An *frustrated* dy
-- 
Andreas Rottmann         | Rotty@ICQ      | 118634484@ICQ | a.rottmann@gmx.at
http://www.8ung.at/rotty | GnuPG Key: http://www.8ung.at/rotty/gpg.asc
Fingerprint              | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62

This reality is really just a fucked-up dream -- Papa Roach

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: guile-gobject problem [solved], g-wrap
  2003-08-11 20:30 guile-gobject problem Andreas Rottmann
@ 2003-08-12 14:49 ` Andreas Rottmann
  2003-08-12 15:29   ` Greg Troxel
  2003-08-15 13:19 ` guile-gobject problem Andy Wingo
  1 sibling, 1 reply; 7+ messages in thread
From: Andreas Rottmann @ 2003-08-12 14:49 UTC (permalink / raw)
  To: guile-gtk; +Cc: rbl

Andreas Rottmann <a.rottmann@gmx.at> writes:

> Hi!
>
> Trying to use guile-gobject to create bindings for a library of mine,
> I always get C compiler errors, since there is a mapping generated
> from c-type none to <none>, which causes the return type type in the
> wrapper to be declared of type 'none'.
>
[snip]

I've found & fixed the bug. I'll commit to CVS (just have been given
access by Marius!), after posting a patch here for review. First,
however, I'd like to discuss (once again ;-)), the forking of
g-wrap. I could check in a g-wrap into the guile-gtk CVS repository
that provides:

* Argument hiding (needed for GError exceptions).

* An argument call-ccg (needed for GError, since it is passed 
  by double-refernce (pointer to pointer)).

* A changed (generating less code) mechanism to 
  wrap enums (this only has gains for non-GObject enums, though).

* The patched gw-standard-spec.scm as provided by guile-gobject today.

* An exported gw:wrapset-get-wrapsets-depended-on (the fix 
  mentioned already uses this, although it could be changed not 
  to use it easily).

Comments (Rob!)?

Regards, Andy
-- 
Andreas Rottmann         | Rotty@ICQ      | 118634484@ICQ | a.rottmann@gmx.at
http://www.8ung.at/rotty | GnuPG Key: http://www.8ung.at/rotty/gpg.asc
Fingerprint              | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62

It's GNU/Linux dammit!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: guile-gobject problem [solved], g-wrap
  2003-08-12 14:49 ` guile-gobject problem [solved], g-wrap Andreas Rottmann
@ 2003-08-12 15:29   ` Greg Troxel
  2003-08-12 16:31     ` Andreas Rottmann
  0 siblings, 1 reply; 7+ messages in thread
From: Greg Troxel @ 2003-08-12 15:29 UTC (permalink / raw)
  To: Andreas Rottmann; +Cc: guile-gtk, rlb

[I fixed the spelling of Rob's username - it was rbl in your mail.]

  I've found & fixed the bug. I'll commit to CVS (just have been given
  access by Marius!), after posting a patch here for review. First,
  however, I'd like to discuss (once again ;-)), the forking of
  g-wrap. I could check in a g-wrap into the guile-gtk CVS repository
  that provides:

  * Argument hiding (needed for GError exceptions).

  * An argument call-ccg (needed for GError, since it is passed 
    by double-refernce (pointer to pointer)).

  * A changed (generating less code) mechanism to 
    wrap enums (this only has gains for non-GObject enums, though).

  * The patched gw-standard-spec.scm as provided by guile-gobject today.

  * An exported gw:wrapset-get-wrapsets-depended-on (the fix 
    mentioned already uses this, although it could be changed not 
    to use it easily).

Not that I know what's really up, but note that gnucash is said to be
short of developer cycles.  So creating a g-wrap _project_ on
savannah, rather than putting it under guile-gtk, and trying to make
sure (a bit) it still works for other uses, and perhaps a release,
might be a real contribution.

-- 
        Greg Troxel <gdt@ir.bbn.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: guile-gobject problem [solved], g-wrap
  2003-08-12 15:29   ` Greg Troxel
@ 2003-08-12 16:31     ` Andreas Rottmann
  2003-08-12 17:00       ` Rob Browning
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Rottmann @ 2003-08-12 16:31 UTC (permalink / raw)
  To: Greg Troxel; +Cc: guile-gtk, rlb

Greg Troxel <gdt@ir.bbn.com> writes:

> [I fixed the spelling of Rob's username - it was rbl in your mail.]
>
[I already re-sent it to him]

>   I've found & fixed the bug. I'll commit to CVS (just have been given
>   access by Marius!), after posting a patch here for review. First,
>   however, I'd like to discuss (once again ;-)), the forking of
>   g-wrap. I could check in a g-wrap into the guile-gtk CVS repository
>   that provides:
>
[some nice features]

> Not that I know what's really up, but note that gnucash is said to be
> short of developer cycles.
>
Yes, I've read the article on LWN.

> So creating a g-wrap _project_ on savannah, rather than putting it
> under guile-gtk, and trying to make sure (a bit) it still works for
> other uses, and perhaps a release, might be a real contribution.
>
There is already a g-wrap project on savannah, owned by Rob. There is
no code in CVS ATM. If Rob would give me CVS write access, I'd be
happy to check my modified version in. He could then lart me on any
ugly things I've done with his code ;-), and I'll try to bring it in
shape again.

Regards, Andy
-- 
Andreas Rottmann         | Rotty@ICQ      | 118634484@ICQ | a.rottmann@gmx.at
http://www.8ung.at/rotty | GnuPG Key: http://www.8ung.at/rotty/gpg.asc
Fingerprint              | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62

Latein ist das humanoide Äquivalent zu Fortran.
   -- Alexander Bartolich in at.linux

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: guile-gobject problem [solved], g-wrap
  2003-08-12 16:31     ` Andreas Rottmann
@ 2003-08-12 17:00       ` Rob Browning
  0 siblings, 0 replies; 7+ messages in thread
From: Rob Browning @ 2003-08-12 17:00 UTC (permalink / raw)
  To: Andreas Rottmann; +Cc: Greg Troxel, guile-gtk

Andreas Rottmann <a.rottmann@gmx.at> writes:

> There is already a g-wrap project on savannah, owned by Rob. There
> is no code in CVS ATM. If Rob would give me CVS write access, I'd be
> happy to check my modified version in. He could then lart me on any
> ugly things I've done with his code ;-), and I'll try to bring it in
> shape again.

I'd like to use savannah, and have been meaning to, but I've been
short on cycles myself :>

In any case, I just got back from being out of town, so give me a few
days.  Also I may have to deal with some authentication issues at
savannah (haven't tried since they had some FSF account problems), so
that might take a day or two to resolve as well.  If you haven't heard
anything from me by Fri, please feel free to check back.

Thanks again for your help, and sorry for my molasses-like behavior
lately.

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: guile-gobject problem
  2003-08-11 20:30 guile-gobject problem Andreas Rottmann
  2003-08-12 14:49 ` guile-gobject problem [solved], g-wrap Andreas Rottmann
@ 2003-08-15 13:19 ` Andy Wingo
  2003-08-15 13:58   ` Andreas Rottmann
  1 sibling, 1 reply; 7+ messages in thread
From: Andy Wingo @ 2003-08-15 13:19 UTC (permalink / raw)
  To: guile-gtk

There've been some internet difficulties at my workplace, but hopefully
they're sorted out now...

On Mon, 11 Aug 2003, Andreas Rottmann wrote:

> | DSTWService* <dstwservice*>
> | gboolean <gboolean>
> | GType <gtype>
> | char* <char*>
> | none <none>
> | gunichar* <gunichar*>

Hmm, looks like you forgot to set the standard wrapset as a used
wrapset. Check the gw-atk-spec.scm for more details, bit it will suffice
to add (gw:wrapset-depends-on ws "guile-gnome-gw-standard") to your
wrapset definition code.

Of course, you have to also depend on glib and gobject if you want those
types to be recognized as well.

Regards,

wingo.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: guile-gobject problem
  2003-08-15 13:19 ` guile-gobject problem Andy Wingo
@ 2003-08-15 13:58   ` Andreas Rottmann
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Rottmann @ 2003-08-15 13:58 UTC (permalink / raw)
  To: guile-gtk

[-- Attachment #1: Type: text/plain, Size: 933 bytes --]

Andy Wingo <wingo@pobox.com> writes:

> There've been some internet difficulties at my workplace, but hopefully
> they're sorted out now...
>
> On Mon, 11 Aug 2003, Andreas Rottmann wrote:
>
>> | DSTWService* <dstwservice*>
>> | gboolean <gboolean>
>> | GType <gtype>
>> | char* <char*>
>> | none <none>
>> | gunichar* <gunichar*>
>
> Hmm, looks like you forgot to set the standard wrapset as a used
> wrapset. Check the gw-atk-spec.scm for more details, bit it will suffice
> to add (gw:wrapset-depends-on ws "guile-gnome-gw-standard") to your
> wrapset definition code.
>
> Of course, you have to also depend on glib and gobject if you want those
> types to be recognized as well.
>
I posted the wrng .spec version, I had those depends in place. In fact
this is a bug in defs-support.scm; the function doesn't search in the
depended-on wrapsets if there are no types registered or the
wrapset. The attached patch should fix this.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: find-recursive.patch --]
[-- Type: text/x-patch, Size: 1610 bytes --]

Index: gnome/gobject/defs-support.scm
===================================================================
RCS file: /cvsroot/guile-gtk/guile-gobject/gnome/gobject/defs-support.scm,v
retrieving revision 1.3
diff -u -p -r1.3 defs-support.scm
--- gnome/gobject/defs-support.scm	1 Jul 2003 16:10:25 -0000	1.3
+++ gnome/gobject/defs-support.scm	15 Aug 2003 13:46:59 -0000
@@ -34,20 +34,20 @@
 (define (recursive-type-find ws type)
   (let* ((ws-name (gw:wrapset-get-name ws))
          (types-hash (hash-ref types-hash-hash ws-name)))
-    (if types-hash
-        (let ((ret (hash-ref types-hash type)))
-          (if ret
-              ret
-              (call-with-current-continuation
-               (lambda (exit)
-                 (for-each
-                  (lambda (ws)
-                    (let ((ret (recursive-type-find ws type)))
-                      (if ret
-                          (exit ret))))
-                  (wrapset-get-wrapsets-depended-on ws))
-                 #f))))
-        #f)))
+    (let ((ret (if types-hash
+                   (hash-ref types-hash type)
+                   #f)))
+      (if ret
+          ret
+          (call-with-current-continuation
+           (lambda (exit)
+             (for-each
+              (lambda (ws)
+                (let ((ret (recursive-type-find ws type)))
+                  (if ret
+                      (exit ret))))
+              (wrapset-get-wrapsets-depended-on ws))
+             #f))))))
 
 ;; find the gwrap type name for a given type name in a defs file, or
 ;; wrap the type as an opaque gpointer -- this thing is getting nasty!

[-- Attachment #3: Type: text/plain, Size: 276 bytes --]


Regards, Andy
-- 
Andreas Rottmann         | Rotty@ICQ      | 118634484@ICQ | a.rottmann@gmx.at
http://www.8ung.at/rotty | GnuPG Key: http://www.8ung.at/rotty/gpg.asc
Fingerprint              | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62

Make free software, not war!

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-08-15 13:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-11 20:30 guile-gobject problem Andreas Rottmann
2003-08-12 14:49 ` guile-gobject problem [solved], g-wrap Andreas Rottmann
2003-08-12 15:29   ` Greg Troxel
2003-08-12 16:31     ` Andreas Rottmann
2003-08-12 17:00       ` Rob Browning
2003-08-15 13:19 ` guile-gobject problem Andy Wingo
2003-08-15 13:58   ` Andreas Rottmann

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).