Have started building the 3.20 bindings for Nim language...

Currently we are not using GObject Introspection but generate the
bindings from the header files using the Nim tool c2nim.

~/Downloads/glib-2.47.92/gio $ grep GListModel *.h
glistmodel.h:G_DECLARE_INTERFACE(GListModel, g_list_model, G, LIST_MODEL, GObject)
glistmodel.h:struct _GListModelInterface
glistmodel.h:  GType     (* get_item_type)   (GListModel *list);
glistmodel.h:  guint     (* get_n_items)     (GListModel *list);
glistmodel.h:  gpointer  (* get_item)        (GListModel *list,
glistmodel.h:GType                   g_list_model_get_item_type                      (GListModel *list);
glistmodel.h:guint                   g_list_model_get_n_items                        (GListModel *list);
glistmodel.h:gpointer                g_list_model_get_item                           (GListModel *list,
glistmodel.h:GObject *               g_list_model_get_object                         (GListModel *list,
glistmodel.h:void                    g_list_model_items_changed                      (GListModel *list,
stefan AMD64X2 ~/Downloads/glib-2.47.92/gio $ grep G_DECLARE_INTERFACE *.h
glistmodel.h:G_DECLARE_INTERFACE(GListModel, g_list_model, G, LIST_MODEL, GObject)

So for glistmodel.h struct ListModel is not explicitly declared but
generated by G_DECLARE_INTERFACE macro. Can not remember having seen
that before in header files, only in examples. Is this an exception or
the new way to go for GTK headers? Does that work well for
introspection? I guess for Nim and c2nim that is not a big problem, we
have only to build that macro in Nim. 

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