push_node (element_get_name (name), true);
Class cl;
+ bool require_copy_free = false;
if (current.new_symbol) {
cl = new Class (current.name, current.source_reference);
cl.is_compact = true;
var typeid = reader.get_attribute ("glib:get-type");
if (typeid != null) {
+ require_copy_free = true;
cl.set_attribute_string ("CCode", "type_id", "%s ()".printf (typeid));
- cl.set_attribute_string ("CCode", "free_function", "g_boxed_free");
- cl.set_attribute_string ("CCode", "copy_function", "g_boxed_copy");
}
current.symbol = cl;
cl.comment = parse_symbol_doc ();
+ Node? ref_method = null;
+ Node? unref_method = null;
+
while (current_token == MarkupTokenType.START_ELEMENT) {
if (!push_metadata ()) {
skip_element ();
parse_constructor ();
} else if (reader.name == "method") {
parse_method ("method");
+ var cname = old_current.get_cname ();
+ if (cname.has_suffix ("_ref")) {
+ ref_method = old_current;
+ } else if (cname.has_suffix ("_unref")) {
+ unref_method = old_current;
+ }
} else if (reader.name == "function") {
skip_element ();
} else if (reader.name == "union") {
pop_metadata ();
}
+ // Add ccode-attributes for ref/unref methodes if available
+ // otherwise fallback to default g_boxed_copy/free
+ if (ref_method != null && unref_method != null) {
+ cl.set_attribute_string ("CCode", "ref_function", ref_method.get_cname ());
+ cl.set_attribute_string ("CCode", "unref_function", unref_method.get_cname ());
+ } else if (require_copy_free) {
+ cl.set_attribute_string ("CCode", "copy_function", "g_boxed_copy");
+ cl.set_attribute_string ("CCode", "free_function", "g_boxed_free");
+ }
+
pop_node ();
end_element (element_name);
}
public signal void resume_events ();
public signal void update ();
}
- [CCode (cheader_filename = "gdk/gdk.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "gdk_frame_timings_get_type ()")]
+ [CCode (cheader_filename = "gdk/gdk.h", ref_function = "gdk_frame_timings_ref", type_id = "gdk_frame_timings_get_type ()", unref_function = "gdk_frame_timings_unref")]
[Compact]
public class FrameTimings {
public bool get_complete ();
public string key;
public int ref_count;
public string value;
+ public GLib.DBusAnnotationInfo @ref ();
+ public void unref ();
}
[CCode (cheader_filename = "gio/gio.h", ref_function = "g_dbus_arg_info_ref", type_id = "g_dbus_arg_info_get_type ()", unref_function = "g_dbus_arg_info_unref")]
[Compact]
public string name;
public int ref_count;
public string signature;
+ public GLib.DBusArgInfo @ref ();
+ public void unref ();
}
[CCode (cheader_filename = "gio/gio.h", type_id = "g_dbus_auth_observer_get_type ()")]
public class DBusAuthObserver : GLib.Object {
public unowned GLib.DBusMethodInfo lookup_method (string name);
public unowned GLib.DBusPropertyInfo lookup_property (string name);
public unowned GLib.DBusSignalInfo lookup_signal (string name);
+ public GLib.DBusInterfaceInfo @ref ();
+ public void unref ();
}
[CCode (cheader_filename = "gio/gio.h", type_id = "g_dbus_interface_skeleton_get_type ()")]
public abstract class DBusInterfaceSkeleton : GLib.Object, GLib.DBusInterface {
[CCode (array_length = false, array_null_terminated = true)]
public GLib.DBusArgInfo[] out_args;
public int ref_count;
+ public GLib.DBusMethodInfo @ref ();
+ public void unref ();
}
[CCode (cheader_filename = "gio/gio.h", type_id = "g_dbus_method_invocation_get_type ()")]
public class DBusMethodInvocation : GLib.Object {
public DBusNodeInfo.for_xml (string xml_data) throws GLib.Error;
public void generate_xml (uint indent, GLib.StringBuilder string_builder);
public unowned GLib.DBusInterfaceInfo lookup_interface (string name);
+ public GLib.DBusNodeInfo @ref ();
+ public void unref ();
}
[CCode (cheader_filename = "gio/gio.h", type_id = "g_dbus_object_manager_client_get_type ()")]
public class DBusObjectManagerClient : GLib.Object, GLib.AsyncInitable, GLib.DBusObjectManager, GLib.Initable, GLib.AsyncInitable, GLib.DBusObjectManager, GLib.Initable {
public string g_object_path { owned get; set construct; }
public virtual signal bool authorize_method (GLib.DBusInterfaceSkeleton interface_, GLib.DBusMethodInvocation invocation);
}
- [CCode (cheader_filename = "gio/gio.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "g_dbus_property_info_get_type ()")]
+ [CCode (cheader_filename = "gio/gio.h", ref_function = "g_dbus_property_info_ref", type_id = "g_dbus_property_info_get_type ()", unref_function = "g_dbus_property_info_unref")]
[Compact]
public class DBusPropertyInfo {
[CCode (array_length = false, array_null_terminated = true)]
public string name;
public int ref_count;
public string signature;
+ public GLib.DBusPropertyInfo @ref ();
+ public void unref ();
}
[CCode (cheader_filename = "gio/gio.h")]
public class DBusProxy : GLib.Object, GLib.AsyncInitable, GLib.DBusInterface, GLib.Initable, GLib.AsyncInitable, GLib.DBusInterface, GLib.Initable {
public GLib.DBusArgInfo[] args;
public string name;
public int ref_count;
+ public GLib.DBusSignalInfo @ref ();
+ public void unref ();
}
[CCode (cheader_filename = "gio/gio.h")]
public class DataInputStream : GLib.BufferedInputStream, GLib.Seekable {
public void add (string name, GLib.FileAttributeType type, GLib.FileAttributeInfoFlags flags);
public GLib.FileAttributeInfoList dup ();
public unowned GLib.FileAttributeInfo? lookup (string name);
+ public GLib.FileAttributeInfoList @ref ();
+ public void unref ();
}
[CCode (cheader_filename = "gio/gio.h", ref_function = "g_file_attribute_matcher_ref", type_id = "g_file_attribute_matcher_get_type ()", unref_function = "g_file_attribute_matcher_unref")]
[Compact]
public unowned string enumerate_next ();
public bool matches (string attribute);
public bool matches_only (string attribute);
+ public GLib.FileAttributeMatcher @ref ();
public GLib.FileAttributeMatcher subtract (GLib.FileAttributeMatcher subtract);
public string to_string ();
+ public void unref ();
}
[CCode (cheader_filename = "gio/gio.h", type_id = "g_file_enumerator_get_type ()")]
public class FileEnumerator : GLib.Object {
[CCode (has_construct_function = false)]
public IOModuleScope (GLib.IOModuleScopeFlags flags);
public void block (string basename);
+ public void free ();
}
[CCode (cheader_filename = "gio/gio.h")]
[Compact]
public static GLib.Resource load (string filename) throws GLib.Error;
public GLib.Bytes lookup_data (string path, GLib.ResourceLookupFlags lookup_flags) throws GLib.Error;
public GLib.InputStream open_stream (string path, GLib.ResourceLookupFlags lookup_flags) throws GLib.Error;
+ public GLib.Resource @ref ();
+ public void unref ();
}
[CCode (cheader_filename = "gio/gio.h")]
public class Settings : GLib.Object {
[CCode (has_construct_function = false)]
protected SettingsBackend ();
}
- [CCode (cheader_filename = "gio/gio.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "g_settings_schema_get_type ()")]
+ [CCode (cheader_filename = "gio/gio.h", ref_function = "g_settings_schema_ref", type_id = "g_settings_schema_get_type ()", unref_function = "g_settings_schema_unref")]
[Compact]
public class SettingsSchema {
public unowned string get_id ();
public GLib.SettingsSchema @ref ();
public void unref ();
}
- [CCode (cheader_filename = "gio/gio.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "g_settings_schema_source_get_type ()")]
+ [CCode (cheader_filename = "gio/gio.h", ref_function = "g_settings_schema_source_ref", type_id = "g_settings_schema_source_get_type ()", unref_function = "g_settings_schema_source_unref")]
[Compact]
public class SettingsSchemaSource {
[CCode (has_construct_function = false)]
[CCode (has_construct_function = false)]
public SrvTarget (string hostname, uint16 port, uint16 priority, uint16 weight);
public GLib.SrvTarget copy ();
+ public void free ();
public unowned string get_hostname ();
public uint16 get_port ();
public uint16 get_priority ();
public void set_user_data<T> (owned T user_data);
public void unref ();
}
- [CCode (cheader_filename = "gst/video/colorbalance.h,gst/video/colorbalancechannel.h,gst/video/gstvideodecoder.h,gst/video/gstvideoencoder.h,gst/video/gstvideofilter.h,gst/video/gstvideometa.h,gst/video/gstvideopool.h,gst/video/gstvideosink.h,gst/video/gstvideoutils.h,gst/video/navigation.h,gst/video/video-blend.h,gst/video/video-color.h,gst/video/video-enumtypes.h,gst/video/video-event.h,gst/video/video-format.h,gst/video/video-frame.h,gst/video/video-info.h,gst/video/video-overlay-composition.h,gst/video/video.h,gst/video/videoorientation.h,gst/video/videooverlay.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "gst_video_codec_state_get_type ()")]
+ [CCode (cheader_filename = "gst/video/colorbalance.h,gst/video/colorbalancechannel.h,gst/video/gstvideodecoder.h,gst/video/gstvideoencoder.h,gst/video/gstvideofilter.h,gst/video/gstvideometa.h,gst/video/gstvideopool.h,gst/video/gstvideosink.h,gst/video/gstvideoutils.h,gst/video/navigation.h,gst/video/video-blend.h,gst/video/video-color.h,gst/video/video-enumtypes.h,gst/video/video-event.h,gst/video/video-format.h,gst/video/video-frame.h,gst/video/video-info.h,gst/video/video-overlay-composition.h,gst/video/video.h,gst/video/videoorientation.h,gst/video/videooverlay.h", ref_function = "gst_video_codec_state_ref", type_id = "gst_video_codec_state_get_type ()", unref_function = "gst_video_codec_state_unref")]
[Compact]
[GIR (name = "VideoCodecState")]
public class CodecState {
[CCode (cprefix = "Json", gir_namespace = "Json", gir_version = "1.0", lower_case_cprefix = "json_")]
namespace Json {
- [CCode (cheader_filename = "json-glib/json-glib.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "json_array_get_type ()")]
+ [CCode (cheader_filename = "json-glib/json-glib.h", ref_function = "json_array_ref", type_id = "json_array_get_type ()", unref_function = "json_array_unref")]
[Compact]
public class Array {
[CCode (has_construct_function = false)]
public void take_object (owned Json.Object object);
public unowned string type_name ();
}
- [CCode (cheader_filename = "json-glib/json-glib.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "json_object_get_type ()")]
+ [CCode (cheader_filename = "json-glib/json-glib.h", ref_function = "json_object_ref", type_id = "json_object_get_type ()", unref_function = "json_object_unref")]
[Compact]
public class Object {
[CCode (has_construct_function = false)]
[CCode (cheader_filename = "gio/gio.h", cname = "g_tls_error_quark")]
public static GLib.Quark g_tls_error_quark ();
- /*** Bug #: GIR parser doesn't pick up ref/unref functions ***/
-
- [CCode (cheader_filename = "gio/gio.h", ref_function = "g_dbus_annotation_info_ref", type_id = "g_dbus_annotation_info_get_type ()", unref_function = "g_dbus_annotation_info_unref")]
- [Compact]
- public class DBusAnnotationInfo {
- }
-
- [CCode (cheader_filename = "gio/gio.h", ref_function = "g_dbus_arg_info_ref", type_id = "g_dbus_arg_info_get_type ()", unref_function = "g_dbus_arg_info_unref")]
- [Compact]
- public class DBusArgInfo {
- }
-
- [CCode (ref_function = "g_dbus_interface_info_ref", type_id = "g_dbus_interface_info_get_type ()", unref_function = "g_dbus_interface_info_unref")]
- [Compact]
- public class DBusInterfaceInfo {
- }
-
- [CCode (ref_function = "g_dbus_method_info_ref", type_id = "g_dbus_method_info_get_type ()", unref_function = "g_dbus_method_info_unref")]
- [Compact]
- public class DBusMethodInfo {
- }
-
- [CCode (ref_function = "g_dbus_node_info_ref", type_id = "g_dbus_node_info_get_type ()", unref_function = "g_dbus_node_info_unref")]
- [Compact]
- public class DBusNodeInfo {
- }
-
- [CCode (ref_function = "g_dbus_signal_info_ref", type_id = "g_dbus_signal_info_get_type ()", unref_function = "g_dbus_signal_info_unref")]
- [Compact]
- public class DBusSignalInfo {
- }
-
- [CCode (ref_function = "g_file_attribute_info_list_ref", type_id = "g_file_attribute_info_list_get_type ()", unref_function = "g_file_attribute_info_list_unref")]
- [Compact]
- public class FileAttributeInfoList {
- }
-
- [CCode (ref_function = "g_file_attribute_matcher_ref", type_id = "g_file_attribute_matcher_get_type ()", unref_function = "g_file_attribute_matcher_unref")]
- [Compact]
- public class FileAttributeMatcher {
- }
-
- [CCode (ref_function = "g_resource_ref", type_id = "g_resource_get_type ()", unref_function = "g_resource_unref")]
- [Compact]
- public class Resource {
- }
-
[CCode (cheader_filename = "gio/gio.h", has_target = false, cname = "GSettingsBindGetMapping")]
public delegate bool SettingsBindGetMappingShared (GLib.Value value, GLib.Variant variant, void* user_data);
[CCode (cheader_filename = "gio/gio.h", has_target = false, cname = "GSettingsBindSetMapping")]
.list_attributes nullable
FileEnumerator
.next_file nullable
-IOModuleScope
- .free skip
IOStream
.close* skip
.input_stream abstract
.serialize.data type="uint8[]"
SocketListener
.accept*.source_object#parameter default=null
-SrvTarget
- .free skip
srv_target_list_sort type_arguments="GLib.SrvTarget" skip=false
srv_target_list_sort.targets type_arguments="GLib.SrvTarget" owned
StaticResource
simple_async_report_gerror_in_idle parent="GLib.SimpleAsyncResult" name="report_gerror_in_idle"
tls_* skip
-
-// Bug #666796: GIR parser doesn't pick up ref/unref functions
-DBus*Info
- .ref skip
- .unref skip
-FileAttributeInfoList
- .ref skip
- .unref skip
-FileAttributeMatcher
- .ref skip
- .unref skip
-Resource
- .ref skip
- .unref skip
-
// Bug #659886: Async constuctors don't work
DBusConnection
.new skip
[CCode (has_construct_function = false, type = "PangoAttribute*")]
public AttrLanguage (Pango.Language language);
}
- [CCode (cheader_filename = "pango/pango.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "pango_attr_list_get_type ()")]
+ [CCode (cheader_filename = "pango/pango.h", ref_function = "pango_attr_list_ref", type_id = "pango_attr_list_get_type ()", unref_function = "pango_attr_list_unref")]
[Compact]
public class AttrList {
[CCode (has_construct_function = false)]
public Pango.Font load_font (Pango.Context context, Pango.FontDescription desc);
public Pango.Fontset load_fontset (Pango.Context context, Pango.FontDescription desc, Pango.Language language);
}
- [CCode (cheader_filename = "pango/pango.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "pango_font_metrics_get_type ()")]
+ [CCode (cheader_filename = "pango/pango.h", ref_function = "pango_font_metrics_ref", type_id = "pango_font_metrics_get_type ()", unref_function = "pango_font_metrics_unref")]
[Compact]
public class FontMetrics {
public int get_approximate_char_width ();
public bool next_line ();
public bool next_run ();
}
- [CCode (cheader_filename = "pango/pango.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "pango_layout_line_get_type ()")]
+ [CCode (cheader_filename = "pango/pango.h", ref_function = "pango_layout_line_ref", type_id = "pango_layout_line_get_type ()", unref_function = "pango_layout_line_unref")]
[Compact]
public class LayoutLine {
public uint is_paragraph_start;
[CCode (has_construct_function = false)]
protected OAuthProxyCall ();
public void parse_token_reponse ();
+ public void parse_token_response ();
}
- [CCode (cheader_filename = "rest/rest-param.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "rest_param_get_type ()")]
+ [CCode (cheader_filename = "rest/rest-param.h", ref_function = "rest_param_ref", type_id = "rest_param_get_type ()", unref_function = "rest_param_unref")]
[Compact]
public class Param {
[CCode (has_construct_function = false)]
[NoAccessorMethod]
public Rest.Proxy proxy { owned get; construct; }
}
- [CCode (cheader_filename = "rest/rest-xml-node.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "rest_xml_node_get_type ()")]
+ [CCode (cheader_filename = "rest/rest-xml-node.h", ref_function = "rest_xml_node_ref", type_id = "rest_xml_node_get_type ()", unref_function = "rest_xml_node_unref")]
[Compact]
public class XmlNode {
public weak GLib.HashTable<void*,void*> attrs;
HTTP_HTTP_VERSION_NOT_SUPPORTED;
public static GLib.Quark quark ();
}
- [CCode (cheader_filename = "rest/oauth-proxy.h", cname = "OAuthProxyAuthCallback", instance_pos = 3.9)]
+ [CCode (cheader_filename = "rest/oauth-proxy.h", instance_pos = 3.9)]
public delegate void OAuthProxyAuthCallback (Rest.OAuthProxy proxy, GLib.Error? error, GLib.Object? weak_object);
[CCode (cheader_filename = "rest/rest-proxy-call.h", instance_pos = 3.9)]
public delegate void ProxyCallAsyncCallback (Rest.ProxyCall call, GLib.Error? error, GLib.Object? weak_object);