Commit 5741556d authored by Zeeshan Ali's avatar Zeeshan Ali

Move D-Bus interface XML & code into separate dir

This simplifies the code structure a bit and will make it easy to oxidize
the service in the future.
parent 77d142bf
Pipeline #23460 canceled with stage
...@@ -29,18 +29,16 @@ endif ...@@ -29,18 +29,16 @@ endif
if get_option('demo-agent') if get_option('demo-agent')
include_dirs = [ configinc, include_dirs = [ configinc,
libgeoclue_public_api_inc, libgeoclue_public_api_inc ]
libgeoclue_agent_inc ]
sources = [ 'gclue-service-agent.h', sources = [ 'gclue-service-agent.h',
'gclue-service-agent.c', 'gclue-service-agent.c',
'agent.c', 'agent.c',
libgeoclue_agent_sources[1] ] geoclue_agent_sources ]
deps = base_deps + [ dependency('libnotify') ] deps = base_deps + [ dependency('libnotify') ]
executable('agent', executable('agent',
sources, sources,
include_directories: include_dirs, include_directories: include_dirs,
link_whole: [ libgeoclue_agent ],
dependencies: deps, dependencies: deps,
install: true, install: true,
install_dir: demo_dir) install_dir: demo_dir)
......
...@@ -63,9 +63,9 @@ ...@@ -63,9 +63,9 @@
Geoclue service. Geoclue service.
</para> </para>
</partintro> </partintro>
<xi:include href="../src/docs-org.freedesktop.GeoClue2.Manager.xml"/> <xi:include href="../interface/docs-org.freedesktop.GeoClue2.Manager.xml"/>
<xi:include href="../src/docs-org.freedesktop.GeoClue2.Client.xml"/> <xi:include href="../interface/docs-org.freedesktop.GeoClue2.Client.xml"/>
<xi:include href="../src/docs-org.freedesktop.GeoClue2.Location.xml"/> <xi:include href="../interface/docs-org.freedesktop.GeoClue2.Location.xml"/>
<xi:include href="xml/gclue-enums.xml"/> <xi:include href="xml/gclue-enums.xml"/>
</reference> </reference>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
agents must implement. agents must implement.
</para> </para>
</partintro> </partintro>
<xi:include href="../src/agent/docs-org.freedesktop.GeoClue2.Agent.xml"/> <xi:include href="../interface/docs-org.freedesktop.GeoClue2.Agent.xml"/>
</reference> </reference>
<index> <index>
......
...@@ -9,8 +9,7 @@ version_file = configure_file(output: 'version.xml', ...@@ -9,8 +9,7 @@ version_file = configure_file(output: 'version.xml',
configuration: conf) configuration: conf)
content_files = [ '../COPYING', content_files = [ '../COPYING',
dbus_gen_src, geoclue_iface_sources ]
libgeoclue_agent_sources ]
scan_options = [ '--ignore-headers=config.h', scan_options = [ '--ignore-headers=config.h',
'--rebuild-sections', '--rebuild-sections',
'--rebuild-types' ] '--rebuild-types' ]
......
dbus_interface_dir = join_paths(datadir, 'dbus-1', 'interfaces')
geoclue_iface_sources = []
# Client interface
client_interface_xml = 'org.freedesktop.GeoClue2.Client.xml'
geoclue_iface_sources += gnome.gdbus_codegen(
'gclue-client-interface',
client_interface_xml,
interface_prefix: 'org.freedesktop.GeoClue2.',
namespace: 'GClueDBus',
docbook: 'docs')
# Location interface
location_interface_xml = 'org.freedesktop.GeoClue2.Location.xml'
geoclue_iface_sources += gnome.gdbus_codegen(
'gclue-location-interface',
location_interface_xml,
interface_prefix: 'org.freedesktop.GeoClue2.',
namespace: 'GClueDBus',
docbook: 'docs')
# Manager interface
manager_interface_xml = 'org.freedesktop.GeoClue2.Manager.xml'
geoclue_iface_sources += gnome.gdbus_codegen(
'gclue-manager-interface',
manager_interface_xml,
interface_prefix: 'org.freedesktop.GeoClue2.',
namespace: 'GClueDBus',
docbook: 'docs')
annotations = [[ 'fi.w1.wpa_supplicant1',
'org.gtk.GDBus.C.Name',
'WPA_Supplicant' ],
[ 'fi.w1.wpa_supplicant1.Interface',
'org.gtk.GDBus.C.Name',
'WPA_Interface' ],
[ 'fi.w1.wpa_supplicant1.BSS',
'org.gtk.GDBus.C.Name',
'WPA_BSS' ],
[ 'fi.w1.wpa_supplicant1.BSS:SSID',
'org.gtk.GDBus.C.ForceGVariant',
'whatever' ],
[ 'fi.w1.wpa_supplicant1.BSS:BSSID',
'org.gtk.GDBus.C.ForceGVariant',
'whatever' ],
[ 'fi.w1.wpa_supplicant1.Interface::BSSAdded',
'org.gtk.GDBus.C.Name',
'BSS_Added' ],
[ 'fi.w1.wpa_supplicant1.Interface::BSSRemoved',
'org.gtk.GDBus.C.Name',
'BSS_Removed' ]]
geoclue_agent_sources = gnome.gdbus_codegen(
'geoclue-agent-interface',
'org.freedesktop.GeoClue2.Agent.xml',
interface_prefix: 'org.freedesktop.GeoClue2.',
namespace: 'GClue',
docbook: 'docs')
geoclue_iface_sources += geoclue_agent_sources
#libgeoclue_iface_inc = include_directories('.', '../..')
if get_option('enable-backend')
wpa_supplicant_sources = gnome.gdbus_codegen(
'wpa_supplicant-interface',
'fi.w1.wpa_supplicant1.xml',
interface_prefix: 'fi.w1.wpa_supplicant1.',
annotations: annotations)
compass_iface_sources = gnome.gdbus_codegen(
'compass-interface',
'net.hadess.SensorProxy.xml',
interface_prefix: 'net.hadess.SensorProxy')
endif
install_data('org.freedesktop.GeoClue2.Agent.xml',
install_dir: dbus_interface_dir)
interface_files = [ location_interface_xml,
client_interface_xml,
manager_interface_xml ]
# Provide a single interface file too for backwards compatiblity.
# At least gnome-settings-daemon currently relies on that.
unified_interface_xml = 'org.freedesktop.GeoClue2.xml'
python = find_program('python3')
create_interface = find_program('create-unified-xml.py')
cmd = [python, create_interface, '@OUTPUT@', '@INPUT@' ]
custom_target('gclue-xml-interface',
input: interface_files,
output: unified_interface_xml,
install: true,
install_dir: dbus_interface_dir,
command: cmd)
install_data(interface_files,
install_dir: dbus_interface_dir)
# Client interface # Client interface
gclue_client = gnome.gdbus_codegen('gclue-client', gclue_client = gnome.gdbus_codegen(
'../src/org.freedesktop.GeoClue2.Client.xml', 'gclue-client',
interface_prefix: 'org.freedesktop.GeoClue2.', '../interface/org.freedesktop.GeoClue2.Client.xml',
namespace: 'GClue', interface_prefix: 'org.freedesktop.GeoClue2.',
install_header: true, namespace: 'GClue',
install_dir: include_subdir) install_header: true,
install_dir: include_subdir)
# Location interface # Location interface
gclue_location = gnome.gdbus_codegen('gclue-location', gclue_location = gnome.gdbus_codegen(
'../src/org.freedesktop.GeoClue2.Location.xml', 'gclue-location',
interface_prefix: 'org.freedesktop.GeoClue2.', '../interface/org.freedesktop.GeoClue2.Location.xml',
namespace: 'GClue', interface_prefix: 'org.freedesktop.GeoClue2.',
install_header: true, namespace: 'GClue',
install_dir: include_subdir) install_header: true,
install_dir: include_subdir)
# Manager interface # Manager interface
gclue_manager = gnome.gdbus_codegen('gclue-manager', gclue_manager = gnome.gdbus_codegen(
'../src/org.freedesktop.GeoClue2.Manager.xml', 'gclue-manager',
interface_prefix: 'org.freedesktop.GeoClue2.', '../interface/org.freedesktop.GeoClue2.Manager.xml',
namespace: 'GClue', interface_prefix: 'org.freedesktop.GeoClue2.',
install_header: true, namespace: 'GClue',
install_dir: include_subdir) install_header: true,
install_dir: include_subdir)
libgeoclue_sources = files('gclue-helpers.c', 'gclue-simple.c') libgeoclue_sources = files('gclue-helpers.c', 'gclue-simple.c')
libgeoclue_sources += gclue_client[0] libgeoclue_sources += gclue_client[0]
......
...@@ -50,6 +50,7 @@ if libm.found() ...@@ -50,6 +50,7 @@ if libm.found()
endif endif
subdir('public-api') subdir('public-api')
subdir('interface')
if get_option('enable-backend') if get_option('enable-backend')
subdir('src') subdir('src')
endif endif
......
libgeoclue_agent_sources = gnome.gdbus_codegen(
'geoclue-agent-interface',
'org.freedesktop.GeoClue2.Agent.xml',
interface_prefix: 'org.freedesktop.GeoClue2.',
namespace: 'GClue',
docbook: 'docs')
libgeoclue_agent_inc = include_directories('.', '../..')
libgeoclue_agent = static_library('geoclue-agent',
libgeoclue_agent_sources,
dependencies: base_deps,
include_directories: libgeoclue_agent_inc,
install: false)
install_data('org.freedesktop.GeoClue2.Agent.xml',
install_dir: dbus_interface_dir)
dbus_interface_dir = join_paths(datadir, 'dbus-1', 'interfaces')
subdir('agent')
geoclue_deps = base_deps + [ dependency('json-glib-1.0', version: '>= 0.14.0'), geoclue_deps = base_deps + [ dependency('json-glib-1.0', version: '>= 0.14.0'),
dependency('libsoup-2.4', version: '>= 2.42.0') ] dependency('libsoup-2.4', version: '>= 2.42.0') ]
dbus_gen_src = [] sources = [ libgeoclue_public_api_gen_sources[1],
geoclue_iface_sources,
# Client interface wpa_supplicant_sources,
client_interface_xml = 'org.freedesktop.GeoClue2.Client.xml' compass_iface_sources ]
dbus_gen_src += gnome.gdbus_codegen(
'gclue-client-interface',
client_interface_xml,
interface_prefix: 'org.freedesktop.GeoClue2.',
namespace: 'GClueDBus',
docbook: 'docs')
# Location interface
location_interface_xml = 'org.freedesktop.GeoClue2.Location.xml'
dbus_gen_src += gnome.gdbus_codegen(
'gclue-location-interface',
location_interface_xml,
interface_prefix: 'org.freedesktop.GeoClue2.',
namespace: 'GClueDBus',
docbook: 'docs')
# Manager interface
manager_interface_xml = 'org.freedesktop.GeoClue2.Manager.xml'
dbus_gen_src += gnome.gdbus_codegen(
'gclue-manager-interface',
manager_interface_xml,
interface_prefix: 'org.freedesktop.GeoClue2.',
namespace: 'GClueDBus',
docbook: 'docs')
sources = [ dbus_gen_src, libgeoclue_public_api_gen_sources[1] ]
annotations = [[ 'fi.w1.wpa_supplicant1',
'org.gtk.GDBus.C.Name',
'WPA_Supplicant' ],
[ 'fi.w1.wpa_supplicant1.Interface',
'org.gtk.GDBus.C.Name',
'WPA_Interface' ],
[ 'fi.w1.wpa_supplicant1.BSS',
'org.gtk.GDBus.C.Name',
'WPA_BSS' ],
[ 'fi.w1.wpa_supplicant1.BSS:SSID',
'org.gtk.GDBus.C.ForceGVariant',
'whatever' ],
[ 'fi.w1.wpa_supplicant1.BSS:BSSID',
'org.gtk.GDBus.C.ForceGVariant',
'whatever' ],
[ 'fi.w1.wpa_supplicant1.Interface::BSSAdded',
'org.gtk.GDBus.C.Name',
'BSS_Added' ],
[ 'fi.w1.wpa_supplicant1.Interface::BSSRemoved',
'org.gtk.GDBus.C.Name',
'BSS_Removed' ]]
sources += gnome.gdbus_codegen('wpa_supplicant-interface',
'fi.w1.wpa_supplicant1.xml',
interface_prefix: 'fi.w1.wpa_supplicant1.',
annotations: annotations)
sources += gnome.gdbus_codegen('compass-interface',
'net.hadess.SensorProxy.xml',
interface_prefix: 'net.hadess.SensorProxy')
sources += gnome.genmarshal('gclue-marshal', sources += gnome.genmarshal('gclue-marshal',
prefix: 'gclue_marshal', prefix: 'gclue_marshal',
sources: ['gclue-marshal.list']) sources: ['gclue-marshal.list'])
include_dirs = [ configinc, include_dirs = [ configinc,
libgeoclue_agent_inc,
libgeoclue_public_api_inc, libgeoclue_public_api_inc,
include_directories('..') ] include_directories('..') ]
...@@ -116,7 +58,7 @@ if get_option('nmea-source') ...@@ -116,7 +58,7 @@ if get_option('nmea-source')
endif endif
c_args = [ '-DG_LOG_DOMAIN="Geoclue"' ] c_args = [ '-DG_LOG_DOMAIN="Geoclue"' ]
link_with = [ libgeoclue_public_api, libgeoclue_agent ] link_with = [ libgeoclue_public_api ]
executable('geoclue', executable('geoclue',
sources, sources,
link_with: link_with, link_with: link_with,
...@@ -136,22 +78,3 @@ pkgconf.generate(version: gclue_version, ...@@ -136,22 +78,3 @@ pkgconf.generate(version: gclue_version,
variables: [ 'apiversion=' + gclue_api_version, variables: [ 'apiversion=' + gclue_api_version,
'dbus_interface=' + dbus_interface, 'dbus_interface=' + dbus_interface,
'agent_dbus_interface=' + agent_dbus_interface ]) 'agent_dbus_interface=' + agent_dbus_interface ])
interface_files = [ location_interface_xml,
client_interface_xml,
manager_interface_xml ]
# Provide a single interface file too for backwards compatiblity.
# At least gnome-settings-daemon currently relies on that.
unified_interface_xml = 'org.freedesktop.GeoClue2.xml'
python = find_program('python3')
create_interface = find_program('create-unified-xml.py')
cmd = [python, create_interface, '@OUTPUT@', '@INPUT@' ]
custom_target('gclue-xml-interface',
input: interface_files,
output: unified_interface_xml,
install: true,
install_dir: dbus_interface_dir,
command: cmd)
install_data(interface_files,
install_dir: dbus_interface_dir)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment