diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/dconf-client.vala | 26 | ||||
-rw-r--r-- | client/engine.vapi | 14 |
2 files changed, 21 insertions, 19 deletions
diff --git a/client/dconf-client.vala b/client/dconf-client.vala index 2be8be9..810348e 100644 --- a/client/dconf-client.vala +++ b/client/dconf-client.vala @@ -11,23 +11,23 @@ namespace DConf { void call_sync (EngineMessage dcem, out string tag, Cancellable? cancellable) throws Error { DBusConnection connection; - if (dcem.bus_type == 'e') { + if (dcem.bus_types[0] == 'e') { if (session == null) { session = Bus.get_sync (BusType.SESSION, cancellable); } connection = session; } else { - assert (dcem.bus_type == 'y'); + assert (dcem.bus_types[0] == 'y'); if (system == null) { system = Bus.get_sync (BusType.SYSTEM, cancellable); } connection = system; } - foreach (var message in dcem.body) { - var reply = connection.call_sync (dcem.destination, dcem.object_path, dcem.@interface, dcem.method, + foreach (var message in dcem.parameters) { + var reply = connection.call_sync (dcem.bus_name, dcem.object_path, dcem.interface_name, dcem.method_name, message, dcem.reply_type, DBusCallFlags.NONE, -1, cancellable); - if (dcem.tagged) { + if (dcem.reply_type != VariantType.UNIT) { reply.get ("(s)", out tag); } } @@ -36,23 +36,23 @@ namespace DConf { async void call_async (EngineMessage dcem, out string tag, Cancellable? cancellable) throws Error { DBusConnection connection; - if (dcem.bus_type == 'e') { + if (dcem.bus_types[0] == 'e') { if (session == null) { session = yield Bus.get (BusType.SESSION, cancellable); } connection = session; } else { - assert (dcem.bus_type == 'y'); + assert (dcem.bus_types[0] == 'y'); if (system == null) { system = yield Bus.get (BusType.SYSTEM, cancellable); } connection = system; } - foreach (var message in dcem.body) { - var reply = yield connection.call (dcem.destination, dcem.object_path, dcem.@interface, dcem.method, + foreach (var message in dcem.parameters) { + var reply = yield connection.call (dcem.bus_name, dcem.object_path, dcem.interface_name, dcem.method_name, message, dcem.reply_type, DBusCallFlags.NONE, -1, cancellable); - if (dcem.tagged) { + if (dcem.reply_type != VariantType.UNIT) { reply.get ("(s)", out tag); } } @@ -356,10 +356,10 @@ namespace DConf { static Variant? service_func (EngineMessage dcem) { try { - assert (dcem.bus_type == 'e'); + assert (dcem.bus_types[0] == 'e'); var connection = Bus.get_sync (BusType.SESSION, null); - return connection.call_sync (dcem.destination, dcem.object_path, dcem.@interface, dcem.method, - dcem.body, dcem.reply_type, DBusCallFlags.NONE, -1, null); + return connection.call_sync (dcem.bus_name, dcem.object_path, dcem.interface_name, dcem.method_name, + dcem.parameters[0], dcem.reply_type, DBusCallFlags.NONE, -1, null); } catch { return null; } diff --git a/client/engine.vapi b/client/engine.vapi index eb3e7bc..8ed9c92 100644 --- a/client/engine.vapi +++ b/client/engine.vapi @@ -17,14 +17,16 @@ namespace DConf { } struct EngineMessage { - int bus_type; - string destination; + string bus_name; string object_path; - string @interface; - string method; - bool tagged; + string interface_name; + string method_name; + int n_messages; + [CCode (array_length_cname = "n_messages")] + GLib.Variant[] parameters; + [CCode (array_length_cname = "n_messages")] + char[] bus_types; GLib.VariantType reply_type; - GLib.Variant body; } [CCode (has_target = false)] |