[vala] Drop deprecated support for D-Bus GLib
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Drop deprecated support for D-Bus GLib
- Date: Mon, 4 Apr 2011 07:47:24 +0000 (UTC)
commit 7c9b78ab70fd38f6bb3dfcd0f28074f407fd261f
Author: Jürg Billeter <j bitron ch>
Date: Mon Apr 4 09:44:26 2011 +0200
Drop deprecated support for D-Bus GLib
GDBus should be used instead.
codegen/Makefile.am | 3 -
codegen/valaccodebasemodule.vala | 13 -
codegen/valadbusclientmodule.vala | 2831 -------------------------------------
codegen/valadbusmodule.vala | 1077 --------------
codegen/valadbusservermodule.vala | 1705 ----------------------
codegen/valagsignalmodule.vala | 98 +-
compiler/valacompiler.vala | 15 +-
doc/valac.1 | 3 -
vala/valacodecontext.vala | 5 -
vapi/glib-2.0.vapi | 2 -
10 files changed, 28 insertions(+), 5724 deletions(-)
---
diff --git a/codegen/Makefile.am b/codegen/Makefile.am
index 3232849..c2dafce 100644
--- a/codegen/Makefile.am
+++ b/codegen/Makefile.am
@@ -27,9 +27,6 @@ libvala_la_VALASOURCES = \
valaccodestructmodule.vala \
valaclassregisterfunction.vala \
valactype.vala \
- valadbusclientmodule.vala \
- valadbusmodule.vala \
- valadbusservermodule.vala \
valadovaarraymodule.vala \
valadovaassignmentmodule.vala \
valadovabasemodule.vala \
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 764815c..69b2659 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -291,7 +291,6 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
public Struct mutex_type;
public TypeSymbol type_module_type;
public TypeSymbol dbus_proxy_type;
- public TypeSymbol dbus_object_type;
public bool in_plugin = false;
public string module_init_param_name;
@@ -448,11 +447,6 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
}
dbus_proxy_type = (TypeSymbol) glib_ns.scope.lookup ("DBusProxy");
-
- var dbus_ns = root_symbol.scope.lookup ("DBus");
- if (dbus_ns != null) {
- dbus_object_type = (TypeSymbol) dbus_ns.scope.lookup ("Object");
- }
}
header_file = new CCodeFile ();
@@ -5879,13 +5873,6 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
return "";
}
- public virtual void generate_marshaller (List<Parameter> params, DataType return_type, bool dbus = false) {
- }
-
- public virtual string get_marshaller_function (List<Parameter> params, DataType return_type, string? prefix = null, bool dbus = false) {
- return "";
- }
-
public virtual string get_array_length_cname (string array_cname, int dim) {
return "";
}
diff --git a/codegen/valagsignalmodule.vala b/codegen/valagsignalmodule.vala
index 5ee461e..faf6e85 100644
--- a/codegen/valagsignalmodule.vala
+++ b/codegen/valagsignalmodule.vala
@@ -24,51 +24,37 @@
public class Vala.GSignalModule : GObjectModule {
- private string get_marshaller_type_name (DataType t, bool dbus = false) {
+ private string get_marshaller_type_name (DataType t) {
if (t is PointerType || t.type_parameter != null) {
return ("POINTER");
} else if (t is ErrorType) {
return ("POINTER");
} else if (t is ArrayType) {
- if (dbus) {
- return ("BOXED");
+ if (((ArrayType) t).element_type.data_type == string_type.data_type) {
+ return ("BOXED,INT");
} else {
- if (((ArrayType) t).element_type.data_type == string_type.data_type) {
- return ("BOXED,INT");
- } else {
- return ("POINTER,INT");
- }
+ return ("POINTER,INT");
}
} else if (t is VoidType) {
return ("VOID");
- } else if (dbus && DBusModule.get_type_signature (t).has_prefix ("(")) {
- return ("BOXED");
} else if (t.data_type is Enum) {
var en = (Enum) t.data_type;
- if (dbus) {
- if (en.is_flags) {
- return ("UINT");
- } else {
- return ("INT");
- }
- } else {
- return en.get_marshaller_type_name ();
- }
+ return en.get_marshaller_type_name ();
} else {
return t.data_type.get_marshaller_type_name ();
}
}
- private string get_marshaller_type_name_for_parameter (Parameter param, bool dbus = false) {
+ private string get_marshaller_type_name_for_parameter (Parameter param) {
if (param.direction != ParameterDirection.IN) {
return ("POINTER");
} else {
- return get_marshaller_type_name (param.variable_type, dbus);
+ return get_marshaller_type_name (param.variable_type);
}
}
- public override string get_marshaller_function (List<Parameter> params, DataType return_type, string? prefix = null, bool dbus = false) {
- var signature = get_marshaller_signature (params, return_type, dbus);
+ string get_marshaller_function (List<Parameter> params, DataType return_type, string? prefix = null) {
+ var signature = get_marshaller_signature (params, return_type);
string ret;
if (prefix == null) {
@@ -79,13 +65,13 @@ public class Vala.GSignalModule : GObjectModule {
}
}
- ret = "%s_%s_".printf (prefix, get_marshaller_type_name (return_type, dbus));
+ ret = "%s_%s_".printf (prefix, get_marshaller_type_name (return_type));
if (params == null || params.size == 0) {
ret = ret + "_VOID";
} else {
foreach (Parameter p in params) {
- ret = "%s_%s".printf (ret, get_marshaller_type_name_for_parameter (p, dbus).replace (",", "_"));
+ ret = "%s_%s".printf (ret, get_marshaller_type_name_for_parameter (p).replace (",", "_"));
}
}
@@ -127,20 +113,20 @@ public class Vala.GSignalModule : GObjectModule {
}
}
- private string get_marshaller_signature (List<Parameter> params, DataType return_type, bool dbus = false) {
+ private string get_marshaller_signature (List<Parameter> params, DataType return_type) {
string signature;
- signature = "%s:".printf (get_marshaller_type_name (return_type, dbus));
+ signature = "%s:".printf (get_marshaller_type_name (return_type));
if (params == null || params.size == 0) {
signature = signature + "VOID";
} else {
bool first = true;
foreach (Parameter p in params) {
if (first) {
- signature = signature + get_marshaller_type_name_for_parameter (p, dbus);
+ signature = signature + get_marshaller_type_name_for_parameter (p);
first = false;
} else {
- signature = "%s,%s".printf (signature, get_marshaller_type_name_for_parameter (p, dbus));
+ signature = "%s,%s".printf (signature, get_marshaller_type_name_for_parameter (p));
}
}
}
@@ -206,17 +192,17 @@ public class Vala.GSignalModule : GObjectModule {
generate_marshaller (sig.get_parameters (), sig.return_type);
}
- public override void generate_marshaller (List<Parameter> params, DataType return_type, bool dbus = false) {
+ void generate_marshaller (List<Parameter> params, DataType return_type) {
string signature;
int n_params, i;
/* check whether a signal with the same signature already exists for this source file (or predefined) */
- signature = get_marshaller_signature (params, return_type, dbus);
+ signature = get_marshaller_signature (params, return_type);
if (predefined_marshal_set.contains (signature) || user_marshal_set.contains (signature)) {
return;
}
- var signal_marshaller = new CCodeFunction (get_marshaller_function (params, return_type, null, dbus), "void");
+ var signal_marshaller = new CCodeFunction (get_marshaller_function (params, return_type, null), "void");
signal_marshaller.modifiers = CCodeModifiers.STATIC;
signal_marshaller.add_parameter (new CCodeParameter ("closure", "GClosure *"));
@@ -230,13 +216,13 @@ public class Vala.GSignalModule : GObjectModule {
var marshaller_body = new CCodeBlock ();
- var callback_decl = new CCodeFunctionDeclarator (get_marshaller_function (params, return_type, "GMarshalFunc", dbus));
+ var callback_decl = new CCodeFunctionDeclarator (get_marshaller_function (params, return_type, "GMarshalFunc"));
callback_decl.add_parameter (new CCodeParameter ("data1", "gpointer"));
n_params = 1;
foreach (Parameter p in params) {
callback_decl.add_parameter (new CCodeParameter ("arg_%d".printf (n_params), get_value_type_name_from_parameter (p)));
n_params++;
- if (p.variable_type.is_array () && !dbus) {
+ if (p.variable_type.is_array ()) {
callback_decl.add_parameter (new CCodeParameter ("arg_%d".printf (n_params), "gint"));
n_params++;
}
@@ -244,7 +230,7 @@ public class Vala.GSignalModule : GObjectModule {
callback_decl.add_parameter (new CCodeParameter ("data2", "gpointer"));
marshaller_body.add_statement (new CCodeTypeDefinition (get_value_type_name_from_type_reference (return_type), callback_decl));
- var var_decl = new CCodeDeclaration (get_marshaller_function (params, return_type, "GMarshalFunc", dbus));
+ var var_decl = new CCodeDeclaration (get_marshaller_function (params, return_type, "GMarshalFunc"));
var_decl.modifiers = CCodeModifiers.REGISTER;
var_decl.add_declarator (new CCodeVariableDeclarator ("callback"));
marshaller_body.add_statement (var_decl);
@@ -288,7 +274,7 @@ public class Vala.GSignalModule : GObjectModule {
false_block.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeIdentifier ("data2"), data)));
marshaller_body.add_statement (new CCodeIfStatement (cond, true_block, false_block));
- var c_assign = new CCodeAssignment (new CCodeIdentifier ("callback"), new CCodeCastExpression (new CCodeConditionalExpression (new CCodeIdentifier ("marshal_data"), new CCodeIdentifier ("marshal_data"), new CCodeMemberAccess (new CCodeIdentifier ("cc"), "callback", true)), get_marshaller_function (params, return_type, "GMarshalFunc", dbus)));
+ var c_assign = new CCodeAssignment (new CCodeIdentifier ("callback"), new CCodeCastExpression (new CCodeConditionalExpression (new CCodeIdentifier ("marshal_data"), new CCodeIdentifier ("marshal_data"), new CCodeMemberAccess (new CCodeIdentifier ("cc"), "callback", true)), get_marshaller_function (params, return_type, "GMarshalFunc")));
marshaller_body.add_statement (new CCodeExpressionStatement (c_assign));
fc = new CCodeFunctionCall (new CCodeIdentifier ("callback"));
@@ -300,28 +286,15 @@ public class Vala.GSignalModule : GObjectModule {
if (p.direction != ParameterDirection.IN) {
get_value_function = "g_value_get_pointer";
} else if (is_array) {
- if (dbus) {
+ if (((ArrayType) p.variable_type).element_type.data_type == string_type.data_type) {
get_value_function = "g_value_get_boxed";
} else {
- if (((ArrayType) p.variable_type).element_type.data_type == string_type.data_type) {
- get_value_function = "g_value_get_boxed";
- } else {
- get_value_function = "g_value_get_pointer";
- }
+ get_value_function = "g_value_get_pointer";
}
} else if (p.variable_type is PointerType || p.variable_type.type_parameter != null) {
get_value_function = "g_value_get_pointer";
} else if (p.variable_type is ErrorType) {
get_value_function = "g_value_get_pointer";
- } else if (dbus && DBusModule.get_type_signature (p.variable_type).has_prefix ("(")) {
- get_value_function = "g_value_get_boxed";
- } else if (dbus && p.variable_type.data_type is Enum) {
- var en = (Enum) p.variable_type.data_type;
- if (en.is_flags) {
- get_value_function = "g_value_get_uint";
- } else {
- get_value_function = "g_value_get_int";
- }
} else {
get_value_function = p.variable_type.data_type.get_get_value_function ();
}
@@ -329,7 +302,7 @@ public class Vala.GSignalModule : GObjectModule {
inner_fc.add_argument (new CCodeBinaryExpression (CCodeBinaryOperator.PLUS, new CCodeIdentifier ("param_values"), new CCodeIdentifier (i.to_string ())));
fc.add_argument (inner_fc);
i++;
- if (is_array && !dbus) {
+ if (is_array) {
inner_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_get_int"));
inner_fc.add_argument (new CCodeBinaryExpression (CCodeBinaryOperator.PLUS, new CCodeIdentifier ("param_values"), new CCodeIdentifier (i.to_string ())));
fc.add_argument (inner_fc);
@@ -343,14 +316,10 @@ public class Vala.GSignalModule : GObjectModule {
CCodeFunctionCall set_fc;
if (return_type.is_array ()) {
- if (dbus) {
+ if (((ArrayType) return_type).element_type.data_type == string_type.data_type) {
set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_take_boxed"));
} else {
- if (((ArrayType) return_type).element_type.data_type == string_type.data_type) {
- set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_take_boxed"));
- } else {
- set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_set_pointer"));
- }
+ set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_set_pointer"));
}
} else if (return_type.type_parameter != null) {
set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_set_pointer"));
@@ -360,15 +329,6 @@ public class Vala.GSignalModule : GObjectModule {
set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_take_string"));
} else if (return_type.data_type is Class || return_type.data_type is Interface) {
set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_take_object"));
- } else if (dbus && DBusModule.get_type_signature (return_type).has_prefix ("(")) {
- set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_take_boxed"));
- } else if (dbus && return_type.data_type is Enum) {
- var en = (Enum) return_type.data_type;
- if (en.is_flags) {
- set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_set_uint"));
- } else {
- set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_set_int"));
- }
} else {
set_fc = new CCodeFunctionCall (new CCodeIdentifier (return_type.data_type.get_set_value_function ()));
}
@@ -475,10 +435,6 @@ public class Vala.GSignalModule : GObjectModule {
return csignew;
}
- public virtual CCodeExpression get_dbus_g_type (DataType data_type) {
- return new CCodeConstant (data_type.data_type.get_type_id ());
- }
-
public override void visit_element_access (ElementAccess expr) {
if (expr.container is MemberAccess && expr.container.symbol_reference is Signal && expr.parent_node is MethodCall) {
// detailed signal emission
diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala
index 02f2303..e268bb6 100644
--- a/compiler/valacompiler.vala
+++ b/compiler/valacompiler.vala
@@ -60,7 +60,6 @@ class Vala.Compiler {
static bool deprecated;
static bool experimental;
static bool experimental_non_null;
- static bool disable_dbus_transformation;
static bool disable_warnings;
static string cc_command;
[CCode (array_length = false, array_null_terminated = true)]
@@ -119,7 +118,6 @@ class Vala.Compiler {
{ "disable-warnings", 0, 0, OptionArg.NONE, ref disable_warnings, "Disable warnings", null },
{ "fatal-warnings", 0, 0, OptionArg.NONE, ref fatal_warnings, "Treat warnings as fatal", null },
{ "enable-experimental-non-null", 0, 0, OptionArg.NONE, ref experimental_non_null, "Enable experimental enhancements for non-null types", null },
- { "disable-dbus-transformation", 0, 0, OptionArg.NONE, ref disable_dbus_transformation, "Disable transformation of D-Bus member names", null },
{ "cc", 0, 0, OptionArg.STRING, ref cc_command, "Use COMMAND as C compiler command", "COMMAND" },
{ "Xcc", 'X', 0, OptionArg.STRING_ARRAY, ref cc_options, "Pass OPTION to the C compiler", "OPTION..." },
{ "dump-tree", 0, 0, OptionArg.FILENAME, ref dump_tree, "Write code tree to FILE", "FILE" },
@@ -170,7 +168,6 @@ class Vala.Compiler {
context.deprecated = deprecated;
context.experimental = experimental;
context.experimental_non_null = experimental_non_null;
- context.dbus_transformation = !disable_dbus_transformation;
context.report.enable_warnings = !disable_warnings;
context.report.set_verbose_errors (!quiet_mode);
context.verbose_mode = verbose_mode;
@@ -270,9 +267,6 @@ class Vala.Compiler {
if (packages != null) {
foreach (string package in packages) {
context.add_external_package (package);
- if (context.profile == Profile.GOBJECT && package == "dbus-glib-1") {
- context.add_define ("DBUS_GLIB");
- }
}
packages = null;
}
@@ -290,14 +284,7 @@ class Vala.Compiler {
}
if (context.profile == Profile.GOBJECT) {
- if (context.has_package ("dbus-glib-1")) {
- if (!context.deprecated) {
- Report.warning (null, "D-Bus GLib is deprecated, use GDBus");
- }
- context.codegen = new DBusServerModule ();
- } else {
- context.codegen = new GDBusServerModule ();
- }
+ context.codegen = new GDBusServerModule ();
} else if (context.profile == Profile.DOVA) {
context.codegen = new DovaErrorModule ();
} else {
diff --git a/doc/valac.1 b/doc/valac.1
index aa0e262..98d2e03 100644
--- a/doc/valac.1
+++ b/doc/valac.1
@@ -111,9 +111,6 @@ Treat warnings as fatal
.B \--enable-experimental-non-null
Enable experimental enhancements for non-null types
.TP
-.B \--disable-dbus-transformation
-Disable transformation of D-Bus member names
-.TP
.B \--cc=\fICOMMAND\fR
Use \fICOMMAND\fR as C compiler command
.TP
diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala
index 30d05f3..da6df1f 100644
--- a/vala/valacodecontext.vala
+++ b/vala/valacodecontext.vala
@@ -52,11 +52,6 @@ public class Vala.CodeContext {
public bool experimental_non_null { get; set; }
/**
- * Enable transformation of D-Bus member names in dynamic client support.
- */
- public bool dbus_transformation { get; set; }
-
- /**
* Output C code, don't compile to object code.
*/
public bool ccode_only { get; set; }
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index afa0b90..ecac606 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -4515,7 +4515,6 @@ namespace GLib {
public Variant end ();
}
-#if !DBUS_GLIB
[CCode (cname = "char", const_cname = "const char", copy_function = "g_strdup", free_function = "g_free", cheader_filename = "stdlib.h,string.h,glib.h", type_id = "G_TYPE_STRING", marshaller_type_name = "STRING", param_spec_function = "g_param_spec_string", get_value_function = "g_value_get_string", set_value_function = "g_value_set_string", take_value_function = "g_value_take_string", type_signature = "o")]
public class ObjectPath : string {
[CCode (cname = "g_strdup")]
@@ -4527,7 +4526,6 @@ namespace GLib {
[CCode (cname = "g_strdup")]
public BusName (string bus_name);
}
-#endif
[CCode (cname = "G_LIKELY", cheader_filename = "glib.h")]
public static bool likely (bool expression);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]