ecore_wl2: add callback functions for tizen_policy_listener 76/267176/4 accepted/tizen/unified/20220929.080317
authorDoyoun Kang <doyoun.kang@samsung.com>
Mon, 29 Nov 2021 04:45:34 +0000 (13:45 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Fri, 23 Sep 2022 05:40:52 +0000 (14:40 +0900)
add tizen_policy's listener functions for below events
- interactive_move_done
- interactive_resize_done

Change-Id: I09d87f97c590e978312ff88ba1481cde4cb1fc02

src/lib/ecore_wl2/Ecore_Wl2.h
src/lib/ecore_wl2/ecore_wl2_display.c

index 4f73bae..e38dfe7 100644 (file)
@@ -675,6 +675,7 @@ typedef struct _Ecore_Wl2_Event_Window_Interactive_Move_Done
    int y;
    unsigned int w;
    unsigned int h;
+   int angle;
 } Ecore_Wl2_Event_Window_Interactive_Move_Done;
 
 /** @internal */
@@ -685,6 +686,7 @@ typedef struct _Ecore_Wl2_Event_Window_Interactive_Resize_Done
    int y;
    unsigned int w;
    unsigned int h;
+   int angle;
 } Ecore_Wl2_Event_Window_Interactive_Resize_Done;
 //
 
index e53843a..1f4e322 100644 (file)
@@ -503,6 +503,62 @@ _tizen_policy_cb_conformant_region(void *data EINA_UNUSED, struct tizen_policy *
 {
 }
 
+// TIZEN_ONLY(20220923) - for interactive move resize
+ static void
+_cb_interactive_move_resize_done_free(void *data EINA_UNUSED, void *event)
+{
+   free(event);
+}
+
+static void
+_tizen_policy_cb_interactive_move_done(void *data, struct tizen_policy *tizen_policy EINA_UNUSED, struct wl_surface *surface, int32_t x, int32_t y, uint32_t w, uint32_t h, int32_t angle)
+{
+   Ecore_Wl2_Window *win = NULL;
+   Ecore_Wl2_Event_Window_Interactive_Move_Done *ev;
+   Ecore_Wl2_Display *ewd = data;
+
+   if (!surface) return;
+   win = _ecore_wl2_display_window_surface_find(ewd, surface);
+   if (!win) return;
+
+   ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Interactive_Move_Done));
+   if (!ev) return;
+
+   ev->win = win->id;
+   ev->x = x;
+   ev->y = y;
+   ev->w = w;
+   ev->h = h;
+   ev->angle = angle;
+
+   ecore_event_add(ECORE_WL2_EVENT_WINDOW_INTERACTIVE_MOVE_DONE, ev, _cb_interactive_move_resize_done_free, NULL);
+}
+
+static void
+_tizen_policy_cb_interactive_resize_done(void *data, struct tizen_policy *tizen_policy EINA_UNUSED, struct wl_surface *surface, int32_t x, int32_t y, uint32_t w, uint32_t h, int32_t angle)
+{
+   Ecore_Wl2_Window *win = NULL;
+   Ecore_Wl2_Event_Window_Interactive_Resize_Done *ev;
+   Ecore_Wl2_Display *ewd = data;
+
+   if (!surface) return;
+   win = _ecore_wl2_display_window_surface_find(ewd, surface);
+   if (!win) return;
+
+   ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Interactive_Resize_Done));
+   if (!ev) return;
+
+   ev->win = win->id;
+   ev->x = x;
+   ev->y = y;
+   ev->w = w;
+   ev->h = h;
+   ev->angle = angle;
+
+   ecore_event_add(ECORE_WL2_EVENT_WINDOW_INTERACTIVE_RESIZE_DONE, ev, _cb_interactive_move_resize_done_free, NULL);
+}
+//
+
 static const struct tizen_policy_listener _tizen_policy_listener =
 {
    _tizen_policy_cb_conformant,
@@ -515,6 +571,8 @@ static const struct tizen_policy_listener _tizen_policy_listener =
    _tizen_policy_cb_allowed_aux_hint,
    _tizen_policy_cb_aux_message,
    _tizen_policy_cb_conformant_region,
+   _tizen_policy_cb_interactive_move_done,
+   _tizen_policy_cb_interactive_resize_done
 };
 
 // TIZEN_ONLY(20190430): support client appinfo
@@ -828,8 +886,8 @@ _cb_global_add(void *data, struct wl_registry *registry, unsigned int id, const
    // TIZEN_ONLY : To use tizen protocols
    else if (!strcmp(interface, "tizen_policy"))
      {
-        if (version >= 9)
-          client_version = 9;
+        if (version >= 10)
+          client_version = 10;
         else
           client_version = version;