Created attachment 8038 fix vala binding The gobject-instrospection fails to generate XfceRc as a class, and fails to define the xfce_rc_simple_open() and xfce_rc_config_open() at all. For vala binding we can work around that by add a -custom.vala.
Hi, Thank you for your patch. After applying the fix, I have the following warning : # /usr/bin/vapigen-0.42 --library libxfce4util-1.0 --metadatadir . --girdir /usr/local/share/gir-1.0 libxfce4util-1.0.gir libxfce4util-1.0-custom.vala (vapigen-0.42:6880): GLib-GObject-WARNING **: 22:27:11.725: invalid cast from 'ValaClass' to 'ValaStruct' Generation succeeded - 0 warning(s)
Yes, and I don't know how to remove the warning. The vala code seems to work though.
I think this is related: GISCAN libxfce4util-1.0.gir ... xfce-rc.c:109: Warning: libxfce4util: xfce_rc_simple_open: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip) xfce-rc.c:153: Warning: libxfce4util: xfce_rc_config_open: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip) xfce-rc.c:153: Warning: libxfce4util: xfce_rc_config_open: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip) xfce-rc.c:109: Warning: libxfce4util: xfce_rc_simple_open: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip) The gi-r-scanner is not able to register xfce_rc_* as an object. I think the proper solution is to refactor the XfceRc struct to a proper gobject class. See https://wiki.gnome.org/Projects/GObjectIntrospection/WritingBindingableAPIs
Note: we also need to update libxfce4util/Makefile.am to change the c-include to the correct one : - --c-include=libxfce4util.h + --c-include=libxfce4util/libxfce4util.h
Created attachment 8255 Fix GObject Introspection language bindings This patch fixes Xfce.Rc class (used in Vala) for 'xfce_rc_simple_open' and 'xfce_rc_config_open' methods.
(In reply to Olivier Duchateau from comment #5) > Created attachment 8255 > Fix GObject Introspection language bindings > > This patch fixes Xfce.Rc class (used in Vala) for 'xfce_rc_simple_open' and > 'xfce_rc_config_open' methods. Awesome! This fixes the problem for me. Thanks!
Awesome² ! xfce_rc_get_type need to be added in libxfce4util/libxfce4util.symbols to fix make distcheck (tests run by libxfce4util/abicheck.sh)
Created attachment 8258 Fix GObject Introspection language bindings Add xfce_rc_get_type in libxfce4util.symbols (Skunnyk's suggestion); Otherwise nothing changed.
Thank you very much ! Forgot to add the issue number in the commit message. Pushed to master on https://git.xfce.org/xfce/libxfce4util/commit/?id=99f20b70df5a02043e14b82d693deda14804c17c