[gnome-db] GdaDataModel is hard to implement on Vala
Daniel Espinosa <[email protected]> Thu, 22 Dec 2011 15:01:33 -0600
| Newsgroups | gmane.comp.gnome.db |
|---|---|
| Message-ID | <CAHirWtJLcTR1QFu2-dgw2bTq+E7NZshnQk0_3crou+uCPq5SCw@mail.gmail.com> |
I'm implementing GdaDataModel interface in an Gee Collection object called GdaData.DataModelIterable, but I can't implement the following virtual functions: [NoWrapper] public abstract bool i_get_notify (); [NoWrapper] public abstract bool i_iter_at_row (Gda.DataModelIter iter, int row); [NoWrapper] public abstract bool i_iter_next (Gda.DataModelIter iter); [NoWrapper] public abstract bool i_iter_prev (Gda.DataModelIter iter); [NoWrapper] public abstract bool i_iter_set_value (Gda.DataModelIter iter, int col, GLib.Value value) throws GLib.Error; [NoWrapper] public abstract void i_set_notify (bool do_notify_changes); These functions are declared *abstract* because they must be implemented and with the annotation [NoWrapper] because they don't have any function in the public header to call like the for example get_n_rows (); [CCode (vfunc_name = "i_get_n_rows")] public abstract int get_n_rows (); In the last function implementors must declare a get_n_rows (). In the case of the above functions they have the following problems: * i_iter_at_row, i_iter_next, i_iter_prev are functions that are implemented on a separated object GdaDataModelIter, then how to deal with that in C? Is this correct or can be modified in future version? * i_set_notify and i_get_notify they have a function that wrap it but they are "incompatible" because require different number of arguments and return type: freeze() and thaw (), initially I've declared them in GIR as the one to call for the virtual functions but fails when Vala try to use them. Now they are declared as above with no invoker and with [NoWrapper] in Vala bindings. To fix all this problems is possible to add the following functions to the GdaDataModel just to have an invoker as a function to call and make easy to Vala (and maybe other languages) to implement GdaDataModel interface: gda_data_model_get_notify (GdaDataModel*) gda_data_model_set_notify (GdaDataModel*, gboolean) gda_data_model_iter_at_row (GdaDataModel*, GdaDataModelIter*, int) gda_data_model_iter_next (GdaDataModel*, GdaDataModelIter*) gda_data_model_iter_prev (GdaDataModel*, GdaDataModelIter*) -- Trabajar, la mejor arma para tu superación "de grano en grano, se hace la arena" (R) (en trámite, pero para los cuates: LIBRE) _______________________________________________ gnome-db-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gnome-db-list