d-bus/generate.sh
author František Kučera <franta-hg@frantovo.cz>
Thu, 29 Aug 2019 17:57:30 +0200
branchv_0
changeset 12 cf77c218b0b1
permissions -rwxr-xr-x
D-Bus interface
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
#!/bin/bash
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
cd "$(dirname "$0")"
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
ADAPTOR_DIR="../cadMousePro-daemon/src/generated-sources"
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
PROXY_DIR="../cadMousePro-gui/src/generated-sources"
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
XML="info.globalcode.mouse.cadMousePro.xml"
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
case "$1" in
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
	adaptor)
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
		qdbusxml2cpp -a DBusAdaptor.h:DBusAdaptor.cpp -c DBusAdaptor -l Daemon -i ../Daemon.h "$XML"
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
		mkdir -p "$ADAPTOR_DIR"
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
		mv DBusAdaptor.h DBusAdaptor.cpp "$ADAPTOR_DIR"
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
		;;
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
	proxy)
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
		qdbusxml2cpp -l Daemon -i ../Daemon.h -p Proxy.h "$XML"
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
		mkdir -p "$PROXY_DIR"
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
		mv Proxy.h "$PROXY_DIR"
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
		;;
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
	*)
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
		echo $"Usage: $0 (adaptor|proxy)"
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
		exit 1
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
esac