From: Evan Nemerson Date: Sat, 15 Sep 2012 23:20:34 +0000 (-0700) Subject: girparser: add cname for constructors not prefixed with new_ X-Git-Tag: 0.17.7~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4fa204614f725ba60513cb74eb7fbca05b3f2edd;p=thirdparty%2Fvala.git girparser: add cname for constructors not prefixed with new_ --- diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala index 86780079e..0a9088606 100644 --- a/vala/valagirparser.vala +++ b/vala/valagirparser.vala @@ -2795,6 +2795,10 @@ public class Vala.GirParser : CodeVisitor { var m = new CreationMethod (null, name, current.source_reference); m.has_construct_function = false; + if (name != null && !current.name.has_prefix ("new_")) { + m.set_attribute_string ("CCode", "cname", current.girdata["c:identifier"]); + } + string parent_ctype = null; if (current.parent.symbol is Class) { parent_ctype = current.parent.get_cname (); diff --git a/vapi/clutter-1.0.vapi b/vapi/clutter-1.0.vapi index 1000c517a..6604ed189 100644 --- a/vapi/clutter-1.0.vapi +++ b/vapi/clutter-1.0.vapi @@ -6087,7 +6087,7 @@ namespace Clutter { public class ListModel : Clutter.Model, Clutter.Scriptable { [CCode (has_construct_function = false, type = "ClutterModel*")] public ListModel (uint n_columns, ...); - [CCode (has_construct_function = false, type = "ClutterModel*")] + [CCode (cname = "clutter_list_model_newv", has_construct_function = false, type = "ClutterModel*")] public ListModel.newv ([CCode (array_length_cname = "n_columns", array_length_pos = 0.5, array_length_type = "guint")] GLib.Type[] types, [CCode (array_length_cname = "n_columns", array_length_pos = 0.5, array_length_type = "guint")] string[] names); } [CCode (cheader_filename = "clutter/clutter.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "clutter_margin_get_type ()")] diff --git a/vapi/libpeas-1.0.vapi b/vapi/libpeas-1.0.vapi index 5551ff472..17f1375c4 100644 --- a/vapi/libpeas-1.0.vapi +++ b/vapi/libpeas-1.0.vapi @@ -52,7 +52,7 @@ namespace Peas { public virtual bool call (string method_name, GI.Argument args); public void @foreach (Peas.ExtensionSetForeachFunc func); public unowned Peas.Extension get_extension (Peas.PluginInfo info); - [CCode (has_construct_function = false)] + [CCode (cname = "peas_extension_set_newv", has_construct_function = false)] public ExtensionSet.newv (Peas.Engine? engine, GLib.Type exten_type, [CCode (array_length_cname = "n_parameters", array_length_pos = 2.5, array_length_type = "guint")] GLib.Parameter[] parameters); public void* construct_properties { construct; } [NoAccessorMethod]