evas/elementary: add set/get frame input area API for clicking border 72/294272/2 accepted/tizen/unified/20230621.023216
authorHosang Kim <hosang12.kim@samsung.com>
Thu, 15 Jun 2023 07:51:15 +0000 (16:51 +0900)
committerHosang Kim <hosang12.kim@samsung.com>
Thu, 15 Jun 2023 09:33:39 +0000 (18:33 +0900)
area.

Change-Id: I66e3ed7f87c16acafab7f826564d771d1ca5d974

src/lib/elementary/efl_ui_win.c
src/lib/evas/Evas_Legacy.h
src/lib/evas/canvas/evas_events.c
src/lib/evas/canvas/evas_main.c
src/lib/evas/include/evas_private.h

index 2e44b73..b98ab05 100644 (file)
@@ -1992,6 +1992,12 @@ _elm_win_frame_obj_update(Efl_Ui_Win_Data *sd, Eina_Bool force)
    else
      edje_object_part_geometry_get(sd->frame_obj, "efl.spacer.content", &cx, &cy, &cw, &ch);
 
+   int bx, by, bw, bh;
+   int tx, ty, tw, th;
+   edje_object_part_geometry_get(sd->frame_obj, "top_clip", &tx, &ty, &tw, &th);
+   edje_object_part_geometry_get(sd->frame_obj, "bottom_clip", &bx, &by, &bw, &bh);
+   evas_output_inputarea_set(sd->evas, tx, ty + th, ow - cw, ty + th + oh - by);
+
    if (!_elm_win_framespace_set(sd, cx, cy, ow - cw, oh - ch) && (!force)) return;
    _elm_win_frame_geometry_adjust(sd);
 
index 658313f..2153c11 100755 (executable)
@@ -8844,6 +8844,16 @@ EAPI void evas_object_image_pixels_noti_callback_set(Evas_Object *obj, Evas_Obje
  * END *
  *******/
 
+/**
+ * @internal
+ */
+EAPI void evas_output_inputarea_set(Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
+
+/**
+ * @internal
+ */
+EAPI void evas_output_inputarea_get(const Evas *e, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
+
 #include "canvas/efl_canvas_event_grabber_eo.legacy.h"
 
 //TIZEN_ONLY(20171215): add heder define
index 2284498..85d3658 100644 (file)
@@ -161,7 +161,7 @@ _evas_event_object_list_raw_in_get_single(Evas *eo_e, Evas_Object_Protected_Data
    int vx = 0, vy = 0, vw = 0, vh = 0;
    int fw = 0, fh = 0;
    evas_output_viewport_get(eo_e, &vx, &vy, &vw, &vh);
-   evas_output_framespace_get(eo_e, NULL, NULL, &fw, &fh);
+   evas_output_inputarea_get(eo_e, NULL, NULL, &fw, &fh);
    if (!usemap)
      {
         if ((!RECTS_INTERSECT(x, y, 1, 1, vx, vy, vw - fw, vh - fh)) && (!obj->is_frame)) return in;
index 9c75464..b0bd35d 100644 (file)
@@ -2031,6 +2031,37 @@ evas_objects_at_xy_get(Eo *eo_e, int x, int y, Eina_Bool include_pass_events_obj
    EVAS_TYPE_CHECK(eo_e, NULL);
    return _efl_canvas_evas_canvas_objects_at_xy_get_helper(eo_e, efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS), x, y, include_pass_events_objects, include_hidden_objects);
 }
+
+EAPI void
+evas_output_inputarea_set(Evas *eo_e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
+{
+   EVAS_TYPE_CHECK(eo_e);
+
+   Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
+
+   if ((x == e->inputarea.x) && (y == e->inputarea.y) &&
+       (w == e->inputarea.w) && (h == e->inputarea.h)) return;
+   evas_canvas_async_block(e);
+   e->inputarea.x = x;
+   e->inputarea.y = y;
+   e->inputarea.w = w;
+   e->inputarea.h = h;
+}
+
+EAPI void
+evas_output_inputarea_get(const Evas *eo_e, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
+{
+   EVAS_TYPE_CHECK(eo_e);
+
+   Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
+
+   if (x) *x = e->inputarea.x;
+   if (y) *y = e->inputarea.y;
+   if (w) *w = e->inputarea.w;
+   if (h) *h = e->inputarea.h;
+}
+
+
 /* Internal EO APIs */
 
 EWAPI const Efl_Event_Description _EVAS_CANVAS_EVENT_RENDER_FLUSH_PRE =
index 82e41af..12c2d0a 100755 (executable)
@@ -420,6 +420,11 @@ struct _Evas_Public_Data
         Eina_Bool changed : 1;
      } framespace;
 
+   struct
+     {
+        Evas_Coord x, y, w, h;
+     } inputarea;
+
    Eina_List        *damages;
    Eina_List        *obscures;