Browse Source

mconnectctl: move definitions of dbus interfaces to separate files

bboozzoo/share-upload
Maciek Borzecki 7 years ago
parent
commit
b20ae411b6
5 changed files with 99 additions and 34 deletions
  1. +6
    -1
      meson.build
  2. +37
    -0
      src/mconnectctl/device-iface.vala
  3. +28
    -0
      src/mconnectctl/device-manager-iface.vala
  4. +0
    -33
      src/mconnectctl/main.vala
  5. +28
    -0
      src/mconnectctl/share-iface.vala

+ 6
- 1
meson.build View File

@ -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],


+ 37
- 0
src/mconnectctl/device-iface.vala View File

@ -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 <maciek.borzecki (at] gmail.com>
*/
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;}
}
}

+ 28
- 0
src/mconnectctl/device-manager-iface.vala View File

@ -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 <maciek.borzecki (at] gmail.com>
*/
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;
}
}

+ 0
- 33
src/mconnectctl/main.vala View File

@ -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;


+ 28
- 0
src/mconnectctl/share-iface.vala View File

@ -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 <maciek.borzecki (at] gmail.com>
*/
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;
}
}

Loading…
Cancel
Save