mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-24 09:58:54 +02:00
Add support for non-GObject fundamental objects
This patch adds support for instantiable fundamental object types, which are not GObject based. This is mostly interesting for being able to support GstMiniObject's which are extensivly used in GStreamer. Includes a big test case to the Everything module (inspired by GstMiniObject) which should be used by language bindings who wishes to test this functionallity. This patch increases the size of the typelib and breaks compatibility with older typelibs. https://bugzilla.gnome.org/show_bug.cgi?id=568913
This commit is contained in:
19
girparser.c
19
girparser.c
@@ -1640,6 +1640,11 @@ start_class (GMarkupParseContext *context,
|
||||
const gchar *typeinit;
|
||||
const gchar *deprecated;
|
||||
const gchar *abstract;
|
||||
const gchar *fundamental;
|
||||
const gchar *ref_func;
|
||||
const gchar *unref_func;
|
||||
const gchar *set_value_func;
|
||||
const gchar *get_value_func;
|
||||
GIrNodeInterface *iface;
|
||||
|
||||
if (!(strcmp (element_name, "class") == 0 &&
|
||||
@@ -1656,6 +1661,11 @@ start_class (GMarkupParseContext *context,
|
||||
typeinit = find_attribute ("glib:get-type", attribute_names, attribute_values);
|
||||
deprecated = find_attribute ("deprecated", attribute_names, attribute_values);
|
||||
abstract = find_attribute ("abstract", attribute_names, attribute_values);
|
||||
fundamental = find_attribute ("glib:fundamental", attribute_names, attribute_values);
|
||||
ref_func = find_attribute ("glib:ref-func", attribute_names, attribute_values);
|
||||
unref_func = find_attribute ("glib:unref-func", attribute_names, attribute_values);
|
||||
set_value_func = find_attribute ("glib:set-value-func", attribute_names, attribute_values);
|
||||
get_value_func = find_attribute ("glib:get-value-func", attribute_names, attribute_values);
|
||||
|
||||
if (name == NULL)
|
||||
{
|
||||
@@ -1686,6 +1696,15 @@ start_class (GMarkupParseContext *context,
|
||||
|
||||
iface->abstract = abstract && strcmp (abstract, "1") == 0;
|
||||
|
||||
if (ref_func)
|
||||
iface->ref_func = g_strdup (ref_func);
|
||||
if (unref_func)
|
||||
iface->unref_func = g_strdup (unref_func);
|
||||
if (set_value_func)
|
||||
iface->set_value_func = g_strdup (set_value_func);
|
||||
if (get_value_func)
|
||||
iface->get_value_func = g_strdup (get_value_func);
|
||||
|
||||
push_node (ctx, (GIrNode *) iface);
|
||||
ctx->current_module->entries =
|
||||
g_list_append (ctx->current_module->entries, iface);
|
||||
|
Reference in New Issue
Block a user