[java-gnome-hackers] Problem with TextIter / Generator
Brought to you by:
afcowie
From: Stefan P. <st...@pr...> - 2008-05-03 21:07:19
|
Hi all! First of all: Andrew "tricked" me into having a closer look at the sources and do needed coverage of GTK methods myself, so I just found myself digging through the sources. I hope I can help you add some coverage in the future. I started working on coverage for TextBuffer/TreeView and friends and nearly immediately stumbled into my first problem, for which I request your advice. I want to write a method TextIter TextBuffer.getStartIter() Having a look at GtkTextBuffer I found static final void getStartIter(TextBuffer self, TextIter iter) { .. gtk_text_buffer_get_start_iter(pointerOf(self), pointerOf(iter)); .. } So, I need an instance of a TextIter to call that method - but where do I get that from? Normally I would expect a native method like gtk_text_iter_new but it seems that it does not exist. The GTK API docs claim that "... GtkTextIter is a struct designed to be allocated on the stack; ...", so normally I would call it like GtkTextIter start_iter; GtkTextBuffer foo = ...; gtk_text_buffer_get_start_iter (&foo, &start_iter); This is basically what is in GtkTextBuffer.c Java_org_gnome_gtk_GtkTextBuffer_gtk_1text_1buffer_1get_1start_1iter except that that method requires a pointer to a GtkTextIter, although it should be the method to create one. Manually patching GtkTextBuffer.c is out of the question, since it is generated, so now I am stuck. Can anyone shed some light on this. Did I miss something? Any idea how to solve this? Cheers, Stefan Germany, Bremen |