[vala/wip/attributes: 60/121] Drop TypeSymbol set/get/take value function and marshaller type name
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/attributes: 60/121] Drop TypeSymbol set/get/take value function and marshaller type name
- Date: Mon, 4 Jul 2011 17:13:48 +0000 (UTC)
commit 9c6b193dcf5d6a8436669d432607b8ae772f6c1d
Author: Luca Bruno <lucabru src gnome org>
Date: Wed Jun 29 20:32:37 2011 +0200
Drop TypeSymbol set/get/take value function and marshaller type name
vala/valaclass.vala | 81 -----------------------------
vala/valadelegate.vala | 12 ----
vala/valaenum.vala | 48 -----------------
vala/valaerrordomain.vala | 12 ----
vala/valainterface.vala | 40 ---------------
vala/valastruct.vala | 123 ---------------------------------------------
vala/valatypesymbol.vala | 37 -------------
7 files changed, 0 insertions(+), 353 deletions(-)
---
diff --git a/vala/valaclass.vala b/vala/valaclass.vala
index a3bbe9f..73544f4 100644
--- a/vala/valaclass.vala
+++ b/vala/valaclass.vala
@@ -113,10 +113,6 @@ public class Vala.Class : ObjectTypeSymbol {
private string ref_sink_function;
private string param_spec_function;
private string copy_function;
- private string marshaller_type_name;
- private string get_value_function;
- private string set_value_function;
- private string take_value_function;
private bool _is_compact;
private bool _is_immutable;
@@ -681,19 +677,6 @@ public class Vala.Class : ObjectTypeSymbol {
if (a.has_argument ("type_id")) {
type_id = a.get_string ("type_id");
}
- if (a.has_argument ("marshaller_type_name")) {
- marshaller_type_name = a.get_string ("marshaller_type_name");
- }
- if (a.has_argument ("get_value_function")) {
- get_value_function = a.get_string ("get_value_function");
- }
- if (a.has_argument ("set_value_function")) {
- set_value_function = a.get_string ("set_value_function");
- }
- if (a.has_argument ("take_value_function")) {
- take_value_function = a.get_string ("take_value_function");
- }
-
if (a.has_argument ("const_cname")) {
const_cname = a.get_string ("const_cname");
}
@@ -753,22 +736,6 @@ public class Vala.Class : ObjectTypeSymbol {
this.type_id = type_id;
}
- public override string? get_marshaller_type_name () {
- if (marshaller_type_name == null) {
- if (base_class != null) {
- marshaller_type_name = base_class.get_marshaller_type_name ();
- } else if (!is_compact) {
- marshaller_type_name = get_upper_case_cname ();
- } else if (get_type_id () == "G_TYPE_POINTER") {
- marshaller_type_name = "POINTER";
- } else {
- marshaller_type_name = "BOXED";
- }
- }
-
- return marshaller_type_name;
- }
-
public override string? get_param_spec_function () {
if (param_spec_function == null) {
param_spec_function = get_default_param_spec_function ();
@@ -789,54 +756,6 @@ public class Vala.Class : ObjectTypeSymbol {
}
}
- public override string? get_get_value_function () {
- if (get_value_function == null) {
- if (is_fundamental ()) {
- get_value_function = get_lower_case_cname ("value_get_");
- } else if (base_class != null) {
- get_value_function = base_class.get_get_value_function ();
- } else if (get_type_id () == "G_TYPE_POINTER") {
- get_value_function = "g_value_get_pointer";
- } else {
- get_value_function = "g_value_get_boxed";
- }
- }
-
- return get_value_function;
- }
-
- public override string? get_set_value_function () {
- if (set_value_function == null) {
- if (is_fundamental ()) {
- set_value_function = get_lower_case_cname ("value_set_");
- } else if (base_class != null) {
- set_value_function = base_class.get_set_value_function ();
- } else if (get_type_id () == "G_TYPE_POINTER") {
- set_value_function = "g_value_set_pointer";
- } else {
- set_value_function = "g_value_set_boxed";
- }
- }
-
- return set_value_function;
- }
-
- public override string? get_take_value_function () {
- if (take_value_function == null) {
- if (is_fundamental ()) {
- take_value_function = get_lower_case_cname ("value_take_");
- } else if (base_class != null) {
- take_value_function = base_class.get_take_value_function ();
- } else if (get_type_id () == "G_TYPE_POINTER") {
- take_value_function = "g_value_set_pointer";
- } else {
- take_value_function = "g_value_take_boxed";
- }
- }
-
- return take_value_function;
- }
-
public override bool is_reference_counting () {
return get_ref_function () != null;
}
diff --git a/vala/valadelegate.vala b/vala/valadelegate.vala
index e1aa8bd..e1f9bbe 100644
--- a/vala/valadelegate.vala
+++ b/vala/valadelegate.vala
@@ -329,18 +329,6 @@ public class Vala.Delegate : TypeSymbol {
return "G_TYPE_POINTER";
}
- public override string? get_marshaller_type_name () {
- return "POINTER";
- }
-
- public override string? get_get_value_function () {
- return "g_value_get_pointer";
- }
-
- public override string? get_set_value_function () {
- return "g_value_set_pointer";
- }
-
public override void replace_type (DataType old_type, DataType new_type) {
if (return_type == old_type) {
return_type = new_type;
diff --git a/vala/valaenum.vala b/vala/valaenum.vala
index 4f7721c..870120e 100644
--- a/vala/valaenum.vala
+++ b/vala/valaenum.vala
@@ -268,54 +268,6 @@ public class Vala.Enum : TypeSymbol {
return type_id;
}
- public override string? get_marshaller_type_name () {
- if (has_type_id) {
- if (is_flags) {
- return "FLAGS";
- } else {
- return "ENUM";
- }
- } else {
- if (is_flags) {
- return "UINT";
- } else {
- return "INT";
- }
- }
- }
-
- public override string? get_get_value_function () {
- if (has_type_id) {
- if (is_flags) {
- return "g_value_get_flags";
- } else {
- return "g_value_get_enum";
- }
- } else {
- if (is_flags) {
- return "g_value_get_uint";
- } else {
- return "g_value_get_int";
- }
- }
- }
-
- public override string? get_set_value_function () {
- if (has_type_id) {
- if (is_flags) {
- return "g_value_set_flags";
- } else {
- return "g_value_set_enum";
- }
- } else {
- if (is_flags) {
- return "g_value_set_uint";
- } else {
- return "g_value_set_int";
- }
- }
- }
-
public override string? get_default_value () {
return "0";
}
diff --git a/vala/valaerrordomain.vala b/vala/valaerrordomain.vala
index 12f9f37..6b8aeb1 100644
--- a/vala/valaerrordomain.vala
+++ b/vala/valaerrordomain.vala
@@ -201,18 +201,6 @@ public class Vala.ErrorDomain : TypeSymbol {
return "G_TYPE_POINTER";
}
- public override string? get_marshaller_type_name () {
- return "POINTER";
- }
-
- public override string? get_get_value_function () {
- return "g_value_get_pointer";
- }
-
- public override string? get_set_value_function () {
- return "g_value_set_pointer";
- }
-
public override bool check (CodeContext context) {
if (checked) {
return !error;
diff --git a/vala/valainterface.vala b/vala/valainterface.vala
index f9ecc1e..9bbb1c1 100644
--- a/vala/valainterface.vala
+++ b/vala/valainterface.vala
@@ -511,46 +511,6 @@ public class Vala.Interface : ObjectTypeSymbol {
this.type_cname = type_cname;
}
- public override string? get_marshaller_type_name () {
- foreach (DataType prerequisite in prerequisites) {
- string type_name = prerequisite.data_type.get_marshaller_type_name ();
- if (type_name != null) {
- return type_name;
- }
- }
- return "POINTER";
- }
-
- public override string? get_get_value_function () {
- foreach (DataType prerequisite in prerequisites) {
- string get_value_func = prerequisite.data_type.get_get_value_function ();
- if (get_value_func != null) {
- return get_value_func;
- }
- }
- return "g_value_get_pointer";
- }
-
- public override string? get_set_value_function () {
- foreach (DataType prerequisite in prerequisites) {
- string set_value_func = prerequisite.data_type.get_set_value_function ();
- if (set_value_func != null) {
- return set_value_func;
- }
- }
- return "g_value_set_pointer";
- }
-
- public override string? get_take_value_function () {
- foreach (DataType prerequisite in prerequisites) {
- string take_value_func = prerequisite.data_type.get_take_value_function ();
- if (take_value_func != null) {
- return take_value_func;
- }
- }
- return "g_value_set_pointer";
- }
-
public string? get_default_type_id () {
return get_upper_case_cname ("TYPE_");
}
diff --git a/vala/valastruct.vala b/vala/valastruct.vala
index dee6d24..ca23e90 100644
--- a/vala/valastruct.vala
+++ b/vala/valastruct.vala
@@ -44,10 +44,6 @@ public class Vala.Struct : TypeSymbol {
private bool? decimal_floating_type;
private bool? simple_type;
private int? rank;
- private string marshaller_type_name;
- private string get_value_function;
- private string set_value_function;
- private string take_value_function;
private string default_value = null;
private string destroy_function;
@@ -440,18 +436,6 @@ public class Vala.Struct : TypeSymbol {
if (a.has_argument ("type_id")) {
set_type_id (a.get_string ("type_id"));
}
- if (a.has_argument ("marshaller_type_name")) {
- set_marshaller_type_name (a.get_string ("marshaller_type_name"));
- }
- if (a.has_argument ("get_value_function")) {
- set_get_value_function (a.get_string ("get_value_function"));
- }
- if (a.has_argument ("set_value_function")) {
- set_set_value_function (a.get_string ("set_value_function"));
- }
- if (a.has_argument ("take_value_function")) {
- set_take_value_function (a.get_string ("take_value_function"));
- }
if (a.has_argument ("default_value")) {
set_default_value (a.get_string ("default_value"));
}
@@ -530,113 +514,6 @@ public class Vala.Struct : TypeSymbol {
this.type_id = name;
}
- public override string? get_marshaller_type_name () {
- if (marshaller_type_name == null) {
- if (base_type != null) {
- var st = base_struct;
- if (st != null) {
- return st.get_marshaller_type_name ();
- }
- }
- if (is_simple_type ()) {
- Report.error (source_reference, "The type `%s` doesn't declare a marshaller type name".printf (get_full_name ()));
- // set marshaller_type_name to avoid multiple errors
- marshaller_type_name = "";
- return "";
- } else if (has_type_id) {
- return "BOXED";
- } else {
- return "POINTER";
- }
- }
- return marshaller_type_name;
- }
-
- private void set_marshaller_type_name (string? name) {
- this.marshaller_type_name = name;
- }
-
- public override string? get_get_value_function () {
- if (get_value_function == null) {
- if (base_type != null) {
- var st = base_struct;
- if (st != null) {
- return st.get_get_value_function ();
- }
- }
- if (is_simple_type ()) {
- Report.error (source_reference, "The value type `%s` doesn't declare a GValue get function".printf (get_full_name ()));
- // set get_value_function to avoid multiple errors
- get_value_function = "";
- return "";
- } else if (has_type_id) {
- return "g_value_get_boxed";
- } else {
- return "g_value_get_pointer";
- }
- } else {
- return get_value_function;
- }
- }
-
- public override string? get_set_value_function () {
- if (set_value_function == null) {
- if (base_type != null) {
- var st = base_struct;
- if (st != null) {
- return st.get_set_value_function ();
- }
- }
- if (is_simple_type ()) {
- Report.error (source_reference, "The value type `%s` doesn't declare a GValue set function".printf (get_full_name ()));
- // set set_value_function to avoid multiple errors
- set_value_function = "";
- return "";
- } else if (has_type_id) {
- return "g_value_set_boxed";
- } else {
- return "g_value_set_pointer";
- }
- } else {
- return set_value_function;
- }
- }
-
- public override string? get_take_value_function () {
- if (take_value_function == null) {
- if (base_type != null) {
- var st = base_struct;
- if (st != null) {
- return st.get_take_value_function ();
- }
- }
- if (is_simple_type ()) {
- Report.error (source_reference, "The value type `%s` doesn't declare a GValue take function".printf (get_full_name ()));
- // set take_value_function to avoid multiple errors
- take_value_function = "";
- return "";
- } else if (has_type_id) {
- return "g_value_take_boxed";
- } else {
- return "g_value_take_pointer";
- }
- } else {
- return take_value_function;
- }
- }
-
- private void set_get_value_function (string? function) {
- get_value_function = function;
- }
-
- private void set_set_value_function (string? function) {
- set_value_function = function;
- }
-
- private void set_take_value_function (string? function) {
- take_value_function = function;
- }
-
public override string? get_default_value () {
if (default_value != null) {
return default_value;
diff --git a/vala/valatypesymbol.vala b/vala/valatypesymbol.vala
index cc59d83..de82df6 100644
--- a/vala/valatypesymbol.vala
+++ b/vala/valatypesymbol.vala
@@ -140,43 +140,6 @@ public abstract class Vala.TypeSymbol : Symbol {
}
/**
- * Returns the name of this data type as used in C code marshallers
- *
- * @return type name for marshallers
- */
- public virtual string? get_marshaller_type_name () {
- return null;
- }
-
- /**
- * Returns the cname of the GValue parameter spec function.
- */
- public virtual string? get_param_spec_function () {
- return null;
- }
-
- /**
- * Returns the cname of the GValue getter function.
- */
- public virtual string? get_get_value_function () {
- return null;
- }
-
- /**
- * Returns the cname of the GValue setter function.
- */
- public virtual string? get_set_value_function () {
- return null;
- }
-
- /**
- * Returns the cname of the GValue taker function.
- */
- public virtual string? get_take_value_function () {
- return null;
- }
-
- /**
* Returns the C name of this data type in upper case. Words are
* separated by underscores. The upper case C name of the namespace is
* prefix of the result.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]