On Mon, 2009-12-07 at 21:35 +0100, Michael 'Mickey' Lauer wrote:
Am Sonntag, den 06.12.2009, 17:18 +0100 schrieb Jürg Billeter:On Sat, 2009-12-05 at 21:10 +0100, Michael 'Mickey' Lauer wrote:How can we fix the MarkupParser binding? Apart from the anonymous callbacks, which needs fixing upstream, it still doesn't quite work, as the delegates complain about their missing target. How can we fix that?The MarkupParser binding should be usable, IIRC, although possibly not in the most convenient way and it's easy to get it wrong in a way that valac can't detect. If you have an issue that goes beyond convenience and error detection, please paste a test case and I'll take a look.Ok, for a start the attached example which fails with mickey andromeda:/tmp$ valac parse.vala /tmp/parse.vala.c: In function ‘foo_construct’: /tmp/parse.vala.c:108: warning: assignment from incompatible pointer type /tmp/parse.vala.c:108: error: ‘GMarkupParser’ has no member named ‘start_element_target’ /tmp/parse.vala.c:109: error: ‘GMarkupParser’ has no member named ‘end_element_target’ /tmp/parse.vala.c:110: error: ‘GMarkupParser’ has no member named ‘text_target’ /tmp/parse.vala.c:111: error: ‘GMarkupParser’ has no member named ‘passthrough_target’ /tmp/parse.vala.c:112: error: ‘GMarkupParser’ has no member named ‘error_target’ error: cc exited with status 256 Compilation failed: 1 error(s), 0 warning(s) Making the functions in question static doesn't improve it. Thanks, :M:
Hi Michael, today I had to resolve the same problem and I think that the MarkupParser bindings are wrong. This problem was already reported in the past as you can see here: http://mail.gnome.org/archives/vala-list/2009-June/msg00030.html and the proposed solution seems to "partially" work as stated here: http://mail.gnome.org/archives/vala-list/2009-June/msg00031.html There is also another problem about the user_data field that in the current bindings is wrongly assumed to be the MarkupParser instance pointer but instead it is the user_data parameter passed to the MarkupParserContext class. Attached a patch to glib-2.0.vapi and your updated example. HTH, Andrea
Attachment:
parse.vala
Description: Text Data
Attachment:
markup-glib-vapi.patch
Description: Text Data