From b20ae411b61af89ad96900d52c5b74cd18570362 Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Wed, 11 Oct 2017 22:06:10 +0200 Subject: [PATCH] mconnectctl: move definitions of dbus interfaces to separate files --- meson.build | 7 ++++- src/mconnectctl/device-iface.vala | 37 +++++++++++++++++++++++ src/mconnectctl/device-manager-iface.vala | 28 +++++++++++++++++ src/mconnectctl/main.vala | 33 -------------------- src/mconnectctl/share-iface.vala | 28 +++++++++++++++++ 5 files changed, 99 insertions(+), 34 deletions(-) create mode 100644 src/mconnectctl/device-iface.vala create mode 100644 src/mconnectctl/device-manager-iface.vala create mode 100644 src/mconnectctl/share-iface.vala diff --git a/meson.build b/meson.build index b2cbc1d..4328731 100644 --- a/meson.build +++ b/meson.build @@ -67,7 +67,12 @@ mconnect_prog = executable('mconnect', mconnect_src, posix_dep, gtk_dep], install: true) -mconnectctl_src = 'src/mconnectctl/main.vala' +mconnectctl_src = [ + 'src/mconnectctl/main.vala', + 'src/mconnectctl/device-manager-iface.vala', + 'src/mconnectctl/device-iface.vala', + 'src/mconnectctl/share-iface.vala', +] executable('mconnectctl', mconnectctl_src, dependencies : [glib_dep, gobject_dep, gio_dep, gio_unix_dep], diff --git a/src/mconnectctl/device-iface.vala b/src/mconnectctl/device-iface.vala new file mode 100644 index 0000000..c3bc3ac --- /dev/null +++ b/src/mconnectctl/device-iface.vala @@ -0,0 +1,37 @@ +/** + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * AUTHORS + * Maciek Borzecki + */ +namespace Mconnect { + + [DBus (name = "org.mconnect.Device")] + public interface DeviceIface : Object { + + public abstract string id { owned get;} + public abstract string name { owned get;} + public abstract string device_type { owned get;} + public abstract uint protocol_version { owned get;} + public abstract string address { owned get;} + public abstract bool is_paired { owned get;} + public abstract bool allowed { owned get;} + public abstract bool is_active { owned get;} + public abstract bool is_connected { owned get;} + public abstract string[] outgoing_capabilities { owned get;} + public abstract string[] incoming_capabilities { owned get;} + public abstract string certificate { owned get;} + } + +} \ No newline at end of file diff --git a/src/mconnectctl/device-manager-iface.vala b/src/mconnectctl/device-manager-iface.vala new file mode 100644 index 0000000..6ae2d47 --- /dev/null +++ b/src/mconnectctl/device-manager-iface.vala @@ -0,0 +1,28 @@ +/** + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * AUTHORS + * Maciek Borzecki + */ +namespace Mconnect { + + [DBus (name = "org.mconnect.DeviceManager")] + public interface DeviceManagerIface : Object { + + public const string OBJECT_PATH = "/org/mconnect/manager"; + + public abstract ObjectPath[] ListDevices() throws IOError; + public abstract void AllowDevice(string path) throws IOError; + } +} \ No newline at end of file diff --git a/src/mconnectctl/main.vala b/src/mconnectctl/main.vala index 41aba3c..36fb396 100644 --- a/src/mconnectctl/main.vala +++ b/src/mconnectctl/main.vala @@ -20,39 +20,6 @@ namespace Mconnect { - [DBus (name = "org.mconnect.DeviceManager")] - public interface DeviceManagerIface : Object { - - public const string OBJECT_PATH = "/org/mconnect/manager"; - - public abstract ObjectPath[] ListDevices() throws IOError; - public abstract void AllowDevice(string path) throws IOError; - } - - [DBus (name = "org.mconnect.Device")] - public interface DeviceIface : Object { - - public abstract string id { owned get;} - public abstract string name { owned get;} - public abstract string device_type { owned get;} - public abstract uint protocol_version { owned get;} - public abstract string address { owned get;} - public abstract bool is_paired { owned get;} - public abstract bool allowed { owned get;} - public abstract bool is_active { owned get;} - public abstract bool is_connected { owned get;} - public abstract string[] outgoing_capabilities { owned get;} - public abstract string[] incoming_capabilities { owned get;} - public abstract string certificate { owned get;} - } - - [DBus (name = "org.mconnect.Device.Share")] - public interface ShareIface : Object { - - public abstract void share_url(string url) throws IOError; - public abstract void share_text(string text) throws IOError; - } - public class Client { private static bool log_debug = false; diff --git a/src/mconnectctl/share-iface.vala b/src/mconnectctl/share-iface.vala new file mode 100644 index 0000000..efca59f --- /dev/null +++ b/src/mconnectctl/share-iface.vala @@ -0,0 +1,28 @@ +/** + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * AUTHORS + * Maciek Borzecki + */ + +namespace Mconnect { + + [DBus (name = "org.mconnect.Device.Share")] + public interface ShareIface : Object { + + public abstract void share_url(string url) throws IOError; + public abstract void share_text(string text) throws IOError; + } + +} \ No newline at end of file