vala r979 - in trunk: . gobject vala
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r979 - in trunk: . gobject vala
- Date: Tue, 5 Feb 2008 20:28:44 +0000 (GMT)
Author: juergbi
Date: Tue Feb 5 20:28:44 2008
New Revision: 979
URL: http://svn.gnome.org/viewvc/vala?rev=979&view=rev
Log:
2008-02-05 Juerg Billeter <j bitron ch>
* vala/valastruct.vala, gobject/valaccodegeneratorsignal.vala:
support non-simple struct as signal parameter type
Modified:
trunk/ChangeLog
trunk/gobject/valaccodegeneratorsignal.vala
trunk/vala/valastruct.vala
Modified: trunk/gobject/valaccodegeneratorsignal.vala
==============================================================================
--- trunk/gobject/valaccodegeneratorsignal.vala (original)
+++ trunk/gobject/valaccodegeneratorsignal.vala Tue Feb 5 20:28:44 2008
@@ -70,7 +70,12 @@
} else if (t.data_type is Class || t.data_type is Interface) {
return "gpointer";
} else if (t.data_type is Struct) {
- return t.data_type.get_cname ();
+ var st = (Struct) t.data_type;
+ if (st.is_simple_type ()) {
+ return t.data_type.get_cname ();
+ } else {
+ return "gpointer";
+ }
} else if (t.data_type is Enum) {
return "gint";
} else if (t is ArrayType) {
Modified: trunk/vala/valastruct.vala
==============================================================================
--- trunk/vala/valastruct.vala (original)
+++ trunk/vala/valastruct.vala Tue Feb 5 20:28:44 2008
@@ -315,7 +315,11 @@
public override string get_type_id () {
if (type_id == null) {
- Report.error (source_reference, "The type `%s` doesn't declare a type id".printf (get_full_name ()));
+ if (simple_type) {
+ Report.error (source_reference, "The type `%s` doesn't declare a type id".printf (get_full_name ()));
+ } else {
+ return "G_TYPE_POINTER";
+ }
}
return type_id;
}
@@ -326,7 +330,11 @@
public override string get_marshaller_type_name () {
if (marshaller_type_name == null) {
- Report.error (source_reference, "The type `%s` doesn't declare a marshaller type name".printf (get_full_name ()));
+ if (simple_type) {
+ Report.error (source_reference, "The type `%s` doesn't declare a marshaller type name".printf (get_full_name ()));
+ } else {
+ return "POINTER";
+ }
}
return marshaller_type_name;
}
@@ -337,8 +345,12 @@
public override string get_get_value_function () {
if (get_value_function == null) {
- Report.error (source_reference, "The value type `%s` doesn't declare a GValue get function".printf (get_full_name ()));
- return null;
+ if (simple_type) {
+ Report.error (source_reference, "The value type `%s` doesn't declare a GValue get function".printf (get_full_name ()));
+ return null;
+ } else {
+ return "g_value_get_pointer";
+ }
} else {
return get_value_function;
}
@@ -346,8 +358,12 @@
public override string get_set_value_function () {
if (set_value_function == null) {
- Report.error (source_reference, "The value type `%s` doesn't declare a GValue set function".printf (get_full_name ()));
- return null;
+ if (simple_type) {
+ Report.error (source_reference, "The value type `%s` doesn't declare a GValue set function".printf (get_full_name ()));
+ return null;
+ } else {
+ return "g_value_set_pointer";
+ }
} else {
return set_value_function;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]