[Vala] Vapi question (



Hi all,

I'm probably a bit out of my depth with vapi editing but I am trying
none the less:

Currently in hlidon-1.vapi

there is a static method
[CCode (cheader_filename = "hildon/hildon.h")]
        public static void gtk_window_set_progress_indicator (Gtk.Window
window, uint state);

which I would like to coerce to be available as a class method of
Hildon.Window & Hildon.StackableWindow as this would feel more natural

i.e.
Hildon.Window win = new Hildon.Window(...);
win.set_progress_indicator (0);

instead of
Hildon.Window win = new Hildon.Window(...);
gtk_window_set_progress_indicator(win, 0);

from hildon-gtk.h

void
hildon_gtk_window_set_progress_indicator        (GtkWindow *window,
                                                 guint      state);

the following changes to the vapi:

                [CCode (cname = "hildon_gtk_window_set_progress_indicator")]
          public void set_progress_indicator (uint state);

 now generate:

        hildon_gtk_window_set_progress_indicator ((HildonWindow*)
self->priv->window, (guint) 0);

which compiles and runs fine.

I guess I have three questions:

1) Does this /feel/ correct? Is it the appropriate idiom for vala?

2) Should I submit patches to hildon-1.vapi with them?

3) If so should I leave the static methods in place to avoid breakage
on existing code bases or not?

Many thanks

dru



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]