From 899fb16c918e53bf37d5ace4f771491dfa29d136 Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Tue, 4 Aug 2020 20:59:49 +0900 Subject: [PATCH] exampleClient: bind tizen_policy Change-Id: Ie71212eab477528d56a9ead604f20b24e64abbf0 --- samples/exampleClient.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++- samples/meson.build | 3 ++- 2 files changed, 73 insertions(+), 2 deletions(-) diff --git a/samples/exampleClient.c b/samples/exampleClient.c index f39d621..b3b254c 100644 --- a/samples/exampleClient.c +++ b/samples/exampleClient.c @@ -11,6 +11,7 @@ #include #include #include +#include struct wl_display *display = NULL; struct wl_compositor *compositor = NULL; @@ -21,7 +22,7 @@ struct wl_keyboard *keyboard = NULL; struct wl_touch *touch = NULL; struct xkb_context *xkb_context = NULL; struct xkb_keymap *keymap = NULL; - +struct tizen_policy *tz_policy = NULL; static void pointer_enter(void *data, struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t surface_x, wl_fixed_t surface_y) { @@ -331,6 +332,70 @@ static const struct wl_seat_listener seat_listener = { seat_handle_name, }; + +static void +_tizen_policy_cb_conformant(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface_resource, uint32_t is_conformant) +{ +} + +static void +_tizen_policy_cb_conformant_area(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface_resource, uint32_t conformant_part, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h) +{ +} + +static void +_tizen_policy_cb_notification_done(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface, int32_t level, uint32_t state) +{ +} + +static void +_tizen_policy_cb_transient_for_done(void *data, struct tizen_policy *tizen_policy, uint32_t child_id) +{ +} + +static void +_tizen_policy_cb_window_screen_mode_done(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface, uint32_t mode, uint32_t state) +{ +} + +static void +_tizen_policy_cb_iconify_state_changed(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface_resource, uint32_t iconified, uint32_t force) +{ +} + +static void +_tizen_policy_cb_supported_aux_hints(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface_resource, struct wl_array *hints, uint32_t num_hints) +{ +} + +static void +_tizen_policy_cb_allowed_aux_hint(void *data, struct tizen_policy *tizen_policy , struct wl_surface *surface_resource, int id) +{ +} + +static void +_tizen_policy_cb_aux_message(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface_resource, const char *key, const char *val, struct wl_array *options) +{ +} + +static void +_tizen_policy_cb_conformant_region(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface, uint32_t conformant_part, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t serial) +{ +} + +static const struct tizen_policy_listener tz_policy_listener = { + _tizen_policy_cb_conformant, + _tizen_policy_cb_conformant_area, + _tizen_policy_cb_notification_done, + _tizen_policy_cb_transient_for_done, + _tizen_policy_cb_window_screen_mode_done, + _tizen_policy_cb_iconify_state_changed, + _tizen_policy_cb_supported_aux_hints, + _tizen_policy_cb_allowed_aux_hint, + _tizen_policy_cb_aux_message, + _tizen_policy_cb_conformant_region, +}; + static void global_registry_handler(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) @@ -346,6 +411,11 @@ global_registry_handler(void *data, struct wl_registry *registry, uint32_t id, seat = wl_registry_bind(registry, id, &wl_seat_interface, 4); wl_seat_add_listener(seat, &seat_listener, NULL); } + else if(strcmp(interface, "tizen_policy") == 0) + { + tz_policy = wl_registry_bind(registry, id, &tizen_policy_interface, 7); + tizen_policy_add_listener(tz_policy, &tz_policy_listener, NULL); + } } static void diff --git a/samples/meson.build b/samples/meson.build index cbc09ce..3fc8fa2 100644 --- a/samples/meson.build +++ b/samples/meson.build @@ -28,10 +28,11 @@ executable('exampleCompositor', # exampleClient written for testing exampleCompositor wayland_client_dep = dependency('wayland-client') +tizen_extension_client_dep = dependency('tizen-extension-client') libxkbcommon_dep = dependency('xkbcommon') executable('exampleClient', 'exampleClient.c', - dependencies : [libds_declared_dep, wayland_client_dep, libxkbcommon_dep], + dependencies : [libds_declared_dep, wayland_client_dep, tizen_extension_client_dep, libxkbcommon_dep], install_dir : libds_prefix_bindir, install : true ) -- 2.7.4