[vala] girparser: add cname for constructors not prefixed with new_
- From: Evan Nemerson <evann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] girparser: add cname for constructors not prefixed with new_
- Date: Sat, 15 Sep 2012 23:28:39 +0000 (UTC)
commit 4fa204614f725ba60513cb74eb7fbca05b3f2edd
Author: Evan Nemerson <evan coeus-group com>
Date: Sat Sep 15 16:20:34 2012 -0700
girparser: add cname for constructors not prefixed with new_
vala/valagirparser.vala | 4 ++++
vapi/clutter-1.0.vapi | 2 +-
vapi/libpeas-1.0.vapi | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 8678007..0a90886 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 1000c51..6604ed1 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 5551ff4..17f1375 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]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]