From: duna.oh Date: Wed, 8 Jun 2022 08:07:24 +0000 (+0900) Subject: input-devicemgr: add input-devicemgr in build scripts X-Git-Tag: accepted/tizen/unified/20220720.034120~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72a88cda5d0ab7eceae7eaebf66fa1bfb9c52372;p=platform%2Fcore%2Fuifw%2Flibds-tizen.git input-devicemgr: add input-devicemgr in build scripts Change-Id: I5fde58ecbf1187b561349f593521a25961535b7e --- diff --git a/clients/meson.build b/clients/meson.build index 5d80f18..c97e3ad 100644 --- a/clients/meson.build +++ b/clients/meson.build @@ -56,15 +56,15 @@ executable('ds-simple-dpms', install: true, ) -# input_generator_files = ['input-generator.c'] -# input_generator_deps = [ -# dependency('wayland-client', required: true), -# tizen_extension_client, -# ] -# -# executable('input-generator', -# input_generator_files, -# dependencies: input_generator_deps, -# install_dir: libds_tizen_bindir, -# install: true, -# ) +input_generator_files = ['input-generator.c'] +input_generator_deps = [ + dependency('wayland-client', required: true), + tizen_extension_client, +] + +executable('input-generator', + input_generator_files, + dependencies: input_generator_deps, + install_dir: libds_tizen_bindir, + install: true, +) diff --git a/examples/meson.build b/examples/meson.build index 5917f02..d9233fb 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -35,16 +35,17 @@ tinyds_tdm_libinput_files = [ 'tinyds-tdm-renderer.c', ] -#executable('tinyds-tdm-libinput', -# tinyds_tdm_libinput_files, -# dependencies: [ -# common_deps, -# dependency('pixman-1', required: true), -# dependency('threads', required: true), -# ], -# install_dir: libds_tizen_bindir, -# install : true -#) +executable('tinyds-tdm-libinput', + tinyds_tdm_libinput_files, + dependencies: [ + common_deps, + dep_libds_tizen_input_devicemgr, + dependency('pixman-1', required: true), + dependency('threads', required: true), + ], + install_dir: libds_tizen_bindir, + install : true +) executable('tinyds-tdm-dpms', 'tinyds-tdm-dpms.c', diff --git a/packaging/libds-tizen.spec b/packaging/libds-tizen.spec index 5c8e2a9..c2e0180 100644 --- a/packaging/libds-tizen.spec +++ b/packaging/libds-tizen.spec @@ -53,18 +53,18 @@ Group: Development/Libraries %description keyrouter-devel Keyrouter Development package for Wayland Compositor Library -%package tizen-input-devicemgr +%package input-devicemgr Summary: Library for tizen input devicemgr Group: Development/Libraries -%description tizen-input-devicemgr +%description input-devicemgr Library for tizen input devicemgr -%package tizen-input-devicemgr-devel +%package input-devicemgr-devel Summary: Development package for tizen input devicemgr Group: Development/Libraries -%description tizen-input-devicemgr-devel +%description input-devicemgr-devel Development package for tizen input devicemgr %prep @@ -102,6 +102,8 @@ ninja -C builddir install %{_bindir}/ds-simple-tbm %{_bindir}/tinyds-tdm-dpms %{_bindir}/ds-simple-dpms +%{_bindir}/tinyds-tdm-libinput +%{_bindir}/input-generator %files keyrouter %manifest %{name}.manifest @@ -117,18 +119,18 @@ ninja -C builddir install %{_libdir}/pkgconfig/libds-tizen-keyrouter.pc %{_libdir}/libds-tizen-keyrouter.so -# %files input-devicemgr -# %manifest %{name}.manifest -# %defattr(-,root,root,-) -# %license LICENSE -# %{_libdir}/libds-tizen-input-devicemgr.so.* -# -# %files input-devicemgr-devel -# %manifest %{name}.manifest -# %defattr(-,root,root,-) -# %license LICENSE -# %{_includedir}/libds-tizen/input-devicemgr.h -# %{_libdir}/pkgconfig/libds-tizen-input-devicemgr.pc -# %{_libdir}/libds-tizen-input-devicemgr.so -# %{_bindir}/tinyds-tdm-libinput -# %{_bindir}/input-generator +%files input-devicemgr +%manifest %{name}.manifest +%defattr(-,root,root,-) +%license LICENSE +%{_libdir}/libds-tizen-input-devicemgr.so.* + +%files input-devicemgr-devel +%manifest %{name}.manifest +%defattr(-,root,root,-) +%license LICENSE +%{_includedir}/libds-tizen/input-devicemgr.h +%{_libdir}/pkgconfig/libds-tizen-input-devicemgr.pc +%{_libdir}/libds-tizen-input-devicemgr.so +%{_bindir}/tinyds-tdm-libinput +%{_bindir}/input-generator diff --git a/src/input-devicemgr/input-devicemgr.c b/src/input-devicemgr/input-devicemgr.c index 84700d7..3e69d0e 100644 --- a/src/input-devicemgr/input-devicemgr.c +++ b/src/input-devicemgr/input-devicemgr.c @@ -5,11 +5,9 @@ #include #include #include -#include #include "util.h" #include "input-devicemgr.h" -#include "src/libds/seat.h" #define TIZEN_INPUT_DEVICEMGR_VERSION 4 #define TIZEN_PRIV_INPUT_GENERATOR "http://tizen.org/privilege/inputgenerator" @@ -128,16 +126,12 @@ ds_tizen_input_devicemgr_create(struct ds_backend *backend, goto err_kbd; } - tz_devicemgr->grab = calloc(1, sizeof(struct ds_seat_keyboard_grab)); - if (!tz_devicemgr->grab) - { + tz_devicemgr->grab = ds_seat_create_keyboard_grab( + tz_devicemgr->seat, &devicemgr_keyboard_grab_iface, tz_devicemgr); + if (!tz_devicemgr->grab) { goto err_grab; } - tz_devicemgr->grab->iface = &devicemgr_keyboard_grab_iface; - tz_devicemgr->grab->seat = tz_devicemgr->seat; - tz_devicemgr->grab->data = tz_devicemgr; - wl_signal_init(&tz_devicemgr->events.destroy); wl_list_init(&tz_devicemgr->clients); wl_list_init(&tz_devicemgr->pressed_keys); @@ -150,6 +144,7 @@ ds_tizen_input_devicemgr_create(struct ds_backend *backend, ds_inf("Global created: ds_tizen_input_devicemgr(%p) ", tz_devicemgr); return tz_devicemgr; + err_grab: free(tz_devicemgr->devices.kbd); err_kbd: @@ -207,6 +202,7 @@ tz_devicemgr_destroy(struct ds_tizen_input_devicemgr *tz_devicemgr) tz_devicemgr_keymap_list_cleanup(tz_devicemgr); tz_devicemgr_blocked_keys_cleanup(tz_devicemgr); tz_devicemgr_ungrab_keyboard(tz_devicemgr); + ds_seat_keyboard_destroy_grab(tz_devicemgr->grab); wl_signal_emit(&tz_devicemgr->events.destroy, tz_devicemgr); wl_list_remove(&tz_devicemgr->backend_destroy.link); @@ -224,7 +220,6 @@ tz_devicemgr_destroy(struct ds_tizen_input_devicemgr *tz_devicemgr) } free(tz_devicemgr->devices.kbd); - free(tz_devicemgr->grab); free(tz_devicemgr); } @@ -846,12 +841,13 @@ static void devicemgr_keyboard_grab_iface_key(struct ds_seat_keyboard_grab *grab, uint32_t time_msec, uint32_t key, uint32_t state) { - struct ds_tizen_input_devicemgr *devicemgr = grab->data; + struct ds_tizen_input_devicemgr *devicemgr; struct ds_tizen_input_devicemgr_key_info *keydata, *tmp; bool key_blocked = false; ds_inf("devicemgr. keyboard_grab_iface_key"); + devicemgr = ds_seat_keyboard_grab_get_data(grab); if (!devicemgr->block_resource) { if (state == WL_KEYBOARD_KEY_STATE_PRESSED) { goto finish; @@ -1060,4 +1056,5 @@ device_manager_handle_unblock_events(struct wl_client *client, finish: tizen_input_device_manager_send_error(resource, ret); -} \ No newline at end of file +} + diff --git a/src/input-devicemgr/input-devicemgr.h b/src/input-devicemgr/input-devicemgr.h index 8418b16..52bd2ef 100644 --- a/src/input-devicemgr/input-devicemgr.h +++ b/src/input-devicemgr/input-devicemgr.h @@ -5,7 +5,7 @@ #include #include #include -#include "libds/interfaces/input_device.h" +#include #include struct ds_tizen_input_devicemgr_device { diff --git a/src/meson.build b/src/meson.build index 28ec46e..1ee9b99 100644 --- a/src/meson.build +++ b/src/meson.build @@ -59,5 +59,5 @@ pkgconfig.generate(lib_libds_tizen, ) subdir('keyrouter') -#subdir('input-devicemgr') +subdir('input-devicemgr')