mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-01-24 21:30:23 +01:00
This replaces the connect/connect_done and version/get_version requests. Immediately after connecting, the server sends an ei_protocol_setup event to the client with the ID of the object and the server's highest supported version number (of this object). This is a one-shot object that the client can use to configure its name and whether it is a sender or receiver context. Once .done is sent, the object is discarded. The server version is sent along to the client to allow for requests to be added to this object in the future. As a fixme left: the client now assumes to be connected as soon as the .done request is sent and the following sync event is received. The EIS implementation will not have actually eis_client_connect()ed the client yet, but it's good enough for now. Arguably, the CONNECTED event is superfluous anyway since *any* event other than DISCONNECTED indicates connected status. CONNECTED is a leftover from when the client created devices and needed to know if it's worth doing so.
233 lines
6.1 KiB
Meson
233 lines
6.1 KiB
Meson
project('libei', 'c',
|
|
version: '0.4.1',
|
|
license: 'MIT',
|
|
default_options: [ 'c_std=gnu99', 'warning_level=2' ],
|
|
meson_version: '>= 0.57.0')
|
|
|
|
pkgconfig = import('pkgconfig')
|
|
|
|
cc = meson.get_compiler('c')
|
|
cflags =[
|
|
'-Wno-unused-parameter',
|
|
'-Wmissing-prototypes',
|
|
'-Wno-missing-field-initializers',
|
|
'-Wstrict-prototypes',
|
|
'-Wstrict-prototypes',
|
|
'-Wlogical-op',
|
|
'-Wpointer-arith',
|
|
'-Wuninitialized',
|
|
'-Winit-self',
|
|
'-Wstrict-prototypes',
|
|
'-Wimplicit-fallthrough',
|
|
'-Wredundant-decls',
|
|
'-Wincompatible-pointer-types',
|
|
'-Wformat=2',
|
|
'-Wformat-overflow=2',
|
|
'-Wformat-signedness',
|
|
'-Wformat-truncation=2',
|
|
'-Wmissing-declarations',
|
|
'-Wshift-overflow=2',
|
|
'-Wstrict-overflow=2',
|
|
'-Wswitch',
|
|
]
|
|
|
|
if cc.get_id() == 'clang'
|
|
cflags += [
|
|
# clang doesn't think just using _unref_ is a use of the variable
|
|
# _unref_(foo) *bar = something_that_gives_a_ref
|
|
# but we make heavy use of that in the test suite for convenience
|
|
# of events we know must exist but we don't care about specifically
|
|
'-Wno-unused-variable',
|
|
]
|
|
endif
|
|
|
|
add_project_arguments(cc.get_supported_arguments(cflags), language: 'c')
|
|
|
|
inc_builddir = include_directories('.')
|
|
inc_src = include_directories('src')
|
|
inc_proto = include_directories('proto')
|
|
|
|
protocol_version = 1
|
|
|
|
config_h = configuration_data()
|
|
config_h.set('_GNU_SOURCE', '1')
|
|
config_h.set_quoted('EI_VERSION', meson.project_version())
|
|
config_h.set_quoted('EIS_VERSION', meson.project_version())
|
|
config_h.set('EI_PROTOCOL_VERSION', protocol_version)
|
|
config_h.set('EIS_PROTOCOL_VERSION', protocol_version)
|
|
|
|
subdir('proto')
|
|
|
|
src_libutil = files(
|
|
'src/util-bits.c',
|
|
'src/util-io.c',
|
|
'src/util-list.c',
|
|
'src/util-logger.c',
|
|
'src/util-memfile.c',
|
|
'src/util-sources.c',
|
|
'src/util-strings.c',
|
|
)
|
|
|
|
lib_util = static_library('util', src_libutil)
|
|
|
|
dep_libutil = declare_dependency(link_with: lib_util)
|
|
|
|
src_libei = files(
|
|
'src/brei-shared.c',
|
|
'src/libei.c',
|
|
'src/libei-callback.c',
|
|
'src/libei-connection-setup.c',
|
|
'src/libei-connection.c',
|
|
'src/libei-device.c',
|
|
'src/libei-event.c',
|
|
'src/libei-fd.c',
|
|
'src/libei-log.c',
|
|
'src/libei-region.c',
|
|
'src/libei-region.c',
|
|
'src/libei-seat.c',
|
|
'src/libei-socket.c',
|
|
) + [ei_proto_headers, ei_proto_sources]
|
|
|
|
deps_libei = [
|
|
dep_libutil,
|
|
]
|
|
|
|
lib_libei = shared_library('ei',
|
|
src_libei,
|
|
dependencies: deps_libei,
|
|
include_directories: [inc_proto],
|
|
gnu_symbol_visibility: 'hidden',
|
|
include_directories: ['src'],
|
|
install: true
|
|
)
|
|
install_headers('src/libei.h')
|
|
|
|
dep_libei = declare_dependency(link_with: lib_libei,
|
|
include_directories: [inc_src])
|
|
meson.override_dependency('libei', dep_libei)
|
|
|
|
pkgconfig.generate(lib_libei,
|
|
filebase: 'libei',
|
|
name: 'libEI',
|
|
description: 'Emulated Input client library',
|
|
version: meson.project_version(),
|
|
libraries: lib_libei,
|
|
variables: [
|
|
'protocol_version=' + protocol_version.to_string(),
|
|
],
|
|
)
|
|
|
|
src_libeis = files(
|
|
'src/brei-shared.c',
|
|
'src/libeis.c',
|
|
'src/libeis-callback.c',
|
|
'src/libeis-client.c',
|
|
'src/libeis-connection-setup.c',
|
|
'src/libeis-connection.c',
|
|
'src/libeis-device.c',
|
|
'src/libeis-event.c',
|
|
'src/libeis-fd.c',
|
|
'src/libeis-log.c',
|
|
'src/libeis-region.c',
|
|
'src/libeis-seat.c',
|
|
'src/libeis-socket.c',
|
|
) + [eis_proto_headers, eis_proto_sources]
|
|
|
|
lib_libeis = shared_library('eis',
|
|
src_libeis,
|
|
dependencies: [dep_libutil],
|
|
include_directories: [inc_proto, inc_src],
|
|
gnu_symbol_visibility: 'hidden',
|
|
install: true
|
|
)
|
|
install_headers('src/libeis.h')
|
|
|
|
dep_libeis = declare_dependency(link_with: lib_libeis,
|
|
include_directories: [inc_src])
|
|
meson.override_dependency('libeis', dep_libeis)
|
|
|
|
pkgconfig.generate(lib_libeis,
|
|
filebase: 'libeis',
|
|
name: 'libEIS',
|
|
description: 'Emulated Input server library',
|
|
version: meson.project_version(),
|
|
libraries: lib_libeis,
|
|
variables: [
|
|
'protocol_version=' + protocol_version.to_string(),
|
|
],
|
|
)
|
|
|
|
dep_libxkbcommon = dependency('xkbcommon', required: false)
|
|
config_h.set10('HAVE_LIBXKBCOMMON', dep_libxkbcommon.found())
|
|
dep_libevdev = dependency('libevdev', required: false)
|
|
config_h.set10('HAVE_LIBEVDEV', dep_libevdev.found())
|
|
|
|
src_eis_demo_server = files(
|
|
'tools/eis-demo-server.c',
|
|
)
|
|
if dep_libevdev.found()
|
|
src_eis_demo_server += files(
|
|
'tools/eis-demo-server-uinput.c',
|
|
)
|
|
endif
|
|
|
|
|
|
executable('eis-demo-server',
|
|
src_eis_demo_server,
|
|
dependencies: [
|
|
dep_libutil,
|
|
dep_libeis,
|
|
dep_libxkbcommon,
|
|
dep_libevdev
|
|
])
|
|
|
|
executable('ei-demo-client',
|
|
'tools/ei-demo-client.c',
|
|
dependencies: [dep_libutil, dep_libei, dep_libxkbcommon])
|
|
|
|
executable('ei-debug-events',
|
|
'tools/ei-debug-events.c',
|
|
dependencies: [dep_libutil, dep_libei, dep_libevdev],
|
|
install: true)
|
|
|
|
dep_systemd = dependency('libsystemd', required: get_option('liboeffis'))
|
|
build_oeffis = dep_systemd.found()
|
|
if build_oeffis
|
|
src_liboeffis = files('src/liboeffis.c')
|
|
deps_liboeffis = [dep_libutil, dep_systemd]
|
|
|
|
lib_liboeffis = shared_library('oeffis',
|
|
src_liboeffis,
|
|
dependencies: deps_liboeffis,
|
|
gnu_symbol_visibility: 'hidden',
|
|
install: true
|
|
)
|
|
install_headers('src/liboeffis.h')
|
|
|
|
dep_liboeffis = declare_dependency(link_with: lib_liboeffis,
|
|
include_directories: [inc_src])
|
|
meson.override_dependency('liboeffis', dep_liboeffis)
|
|
|
|
pkgconfig.generate(lib_liboeffis,
|
|
filebase: 'liboeffis',
|
|
name: 'libOeffis',
|
|
description: 'RemoteDesktop portal DBus helper library',
|
|
version: meson.project_version(),
|
|
libraries: lib_liboeffis,
|
|
)
|
|
|
|
executable('oeffis-demo-tool',
|
|
'tools/oeffis-demo-tool.c',
|
|
dependencies: [dep_libutil, dep_liboeffis])
|
|
endif
|
|
|
|
# tests
|
|
if get_option('tests')
|
|
subdir('test')
|
|
endif
|
|
|
|
configure_file(output: 'config.h', configuration: config_h)
|
|
|
|
if get_option('documentation')
|
|
subdir('doc')
|
|
endif
|