discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=17bb2d60caa9680f6265163c67e4208f3826b18c

commit 17bb2d60caa9680f6265163c67e4208f3826b18c
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Thu Mar 24 12:46:42 2016 -0500

    ecore_evas wayland: store relevant www data in engine info
    
    this accumulates all data relevant to client-side www into
    the Evas_Engine_Info_Wayland_Egl struct so the client can react to it.
    
    Signed-off-by: Derek Foreman <der...@osg.samsung.com>
---
 .../engines/wayland/ecore_evas_wayland_egl.c       | 64 ++++++++++++++++++++++
 .../engines/wayland_egl/Evas_Engine_Wayland_Egl.h  | 13 +++++
 2 files changed, 77 insertions(+)

diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c 
b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
index 46e9e03..47904d2 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
@@ -173,6 +173,8 @@ _ee_cb_sync_done(void *data, int type EINA_UNUSED, void 
*event EINA_UNUSED)
                        evas_engine_info_set(ee->evas, (Evas_Engine_Info 
*)einfo);
                        evas_damage_rectangle_add(ee->evas, 0, 0, ee->w + fw, 
ee->h + fh);
                     }
+                  einfo->www_avail = !!wdata->win->www_surface;
+                  einfo->just_mapped = EINA_TRUE;
                }
           }
 
@@ -197,6 +199,62 @@ _ee_cb_sync_done(void *data, int type EINA_UNUSED, void 
*event EINA_UNUSED)
    return ECORE_CALLBACK_PASS_ON;
 }
 
+static void
+_ecore_evas_wl_egl_render_flush_pre(void *data, Evas *e, void *event_info 
EINA_UNUSED)
+{
+   Ecore_Evas *ee = data;
+   Evas_Engine_Info_Wayland_Egl *einfo;
+   Ecore_Evas_Engine_Wl_Data *wdata;
+   int fx, fy;
+
+   einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(e);
+   wdata = ee->engine.data;
+   einfo->window.x = wdata->win->geometry.x;
+   einfo->window.y = wdata->win->geometry.y;
+   einfo->window.w = wdata->win->geometry.w;
+   einfo->window.h = wdata->win->geometry.h;
+   if (einfo->resizing)
+     {
+        einfo->x_rel = 0;
+        einfo->y_rel = 0;
+     }
+   else
+     {
+        einfo->x_rel = wdata->x_rel;
+        einfo->y_rel = wdata->y_rel;
+     }
+   einfo->timestamp = wdata->timestamp;
+   evas_canvas_pointer_canvas_xy_get(e, &einfo->x_cursor, &einfo->y_cursor);
+   evas_output_framespace_get(e, &fx, &fy, NULL, NULL);
+   einfo->x_cursor -= fx;
+   einfo->y_cursor -= fy;
+   wdata->x_rel = wdata->y_rel = 0;
+   einfo->resizing = wdata->win->resizing;
+   einfo->dragging = wdata->dragging;
+   einfo->drag_start = EINA_FALSE;
+   einfo->drag_stop = EINA_FALSE;
+   if (einfo->drag_ack && !einfo->dragging) einfo->drag_stop = EINA_TRUE;
+   if (einfo->dragging && !einfo->drag_ack) einfo->drag_start = EINA_TRUE;
+   einfo->drag_ack = wdata->dragging;
+}
+
+static void
+_ecore_evas_wl_egl_render_post(void *data, Evas *e, void *event_info 
EINA_UNUSED)
+{
+   Ecore_Evas *ee = data;
+   Evas_Engine_Info_Wayland_Egl *einfo;
+   Ecore_Evas_Engine_Wl_Data *wdata;
+   int fw, fh;
+
+   einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(e);
+   wdata = ee->engine.data;
+   if (!einfo->wobbling) return;
+   evas_output_framespace_get(e, NULL, NULL, &fw, &fh);
+   evas_damage_rectangle_add(e, 0, 0, ee->w + fw, ee->h + fh);
+   ecore_wl2_window_opaque_region_set(wdata->win,
+     wdata->win->opaque.x, wdata->win->opaque.y, wdata->win->opaque.w, 
wdata->win->opaque.h);
+}
+
 /* external functions */
 EAPI Ecore_Evas *
 ecore_evas_wayland_egl_new_internal(const char *disp_name, unsigned int parent,
@@ -319,6 +377,10 @@ ecore_evas_wayland_egl_new_internal(const char *disp_name, 
unsigned int parent,
 
    evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
                            _ecore_evas_wl_common_render_flush_pre, ee);
+   evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
+                           _ecore_evas_wl_egl_render_flush_pre, ee);
+   evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_POST,
+                           _ecore_evas_wl_egl_render_post, ee);
 
    /* FIXME: This needs to be set based on theme & scale */
    if (ee->prop.draw_frame)
@@ -452,6 +514,8 @@ _ecore_evas_wl_show(Ecore_Evas *ee)
                   evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
                   evas_damage_rectangle_add(ee->evas, 0, 0, ee->w + fw, ee->h 
+ fh);
                }
+             einfo->www_avail = !!wdata->win->www_surface;
+             einfo->just_mapped = EINA_TRUE;
           }
      }
 
diff --git a/src/modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h 
b/src/modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h
index e06f82c..54dee26 100644
--- a/src/modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h
+++ b/src/modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h
@@ -44,6 +44,19 @@ struct _Evas_Engine_Info_Wayland_Egl
    Eina_Bool vsync : 1;
    Eina_Bool indirect : 1;
    unsigned char swap_mode : 4;
+
+   Eina_Bool wobbling : 1;
+   Eina_Bool www_avail : 1;
+   Eina_Bool just_mapped : 1;
+   Eina_Rectangle window;
+   int x_rel, y_rel;
+   int x_cursor, y_cursor;
+   int resizing;
+   uint32_t timestamp;
+   Eina_Bool dragging : 1;
+   Eina_Bool drag_start : 1;
+   Eina_Bool drag_stop : 1;
+   Eina_Bool drag_ack : 1;
 };
 
 #endif

-- 


Reply via email to