2012-10-08 07:09:53 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
#include "ecore_evas_wayland_private.h"
|
2013-06-05 20:30:40 -07:00
|
|
|
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
|
|
|
# include <Evas_Engine_Wayland_Egl.h>
|
|
|
|
#endif
|
2012-12-05 13:15:42 -08:00
|
|
|
|
2013-03-21 16:45:44 -07:00
|
|
|
#define _smart_frame_type "ecore_evas_wl_frame"
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static const char *interface_wl_name = "wayland";
|
2013-02-05 04:47:27 -08:00
|
|
|
static const int interface_wl_version = 1;
|
2012-10-08 07:09:53 -07:00
|
|
|
|
2013-03-21 16:45:44 -07:00
|
|
|
/* local structures for the frame smart object */
|
2012-10-08 07:09:53 -07:00
|
|
|
typedef struct _EE_Wl_Smart_Data EE_Wl_Smart_Data;
|
|
|
|
struct _EE_Wl_Smart_Data
|
|
|
|
{
|
2013-03-21 16:45:44 -07:00
|
|
|
Evas_Object_Smart_Clipped_Data base;
|
2012-10-08 07:09:53 -07:00
|
|
|
Evas_Object *text;
|
|
|
|
Evas_Coord x, y, w, h;
|
2013-04-22 12:44:43 -07:00
|
|
|
Evas_Object *border[4]; // 0 = top, 1 = bottom, 2 = left, 3 = right
|
|
|
|
Evas_Coord border_size[4]; // same as border
|
2012-10-08 07:09:53 -07:00
|
|
|
};
|
|
|
|
|
2013-03-21 16:45:44 -07:00
|
|
|
static const Evas_Smart_Cb_Description _smart_callbacks[] =
|
|
|
|
{
|
2013-07-03 06:30:40 -07:00
|
|
|
{NULL, NULL}
|
2013-03-21 16:45:44 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
EVAS_SMART_SUBCLASS_NEW(_smart_frame_type, _ecore_evas_wl_frame,
|
|
|
|
Evas_Smart_Class, Evas_Smart_Class,
|
|
|
|
evas_object_smart_clipped_class_get, _smart_callbacks);
|
2012-10-08 07:09:53 -07:00
|
|
|
|
|
|
|
/* local variables */
|
|
|
|
static int _ecore_evas_wl_init_count = 0;
|
|
|
|
static Ecore_Event_Handler *_ecore_evas_wl_event_hdls[5];
|
|
|
|
|
2013-02-27 14:12:58 -08:00
|
|
|
static void _ecore_evas_wayland_resize(Ecore_Evas *ee, int location);
|
2013-02-27 01:49:23 -08:00
|
|
|
|
|
|
|
/* local function prototypes */
|
|
|
|
static int _ecore_evas_wl_common_render_updates_process(Ecore_Evas *ee, Eina_List *updates);
|
2013-03-25 19:48:23 -07:00
|
|
|
void _ecore_evas_wl_common_render_updates(void *data, Evas *evas EINA_UNUSED, void *event);
|
2013-05-06 10:48:03 -07:00
|
|
|
static void _rotation_do(Ecore_Evas *ee, int rotation, int resize);
|
|
|
|
static void _ecore_evas_wayland_alpha_do(Ecore_Evas *ee, int alpha);
|
|
|
|
static void _ecore_evas_wayland_transparent_do(Ecore_Evas *ee, int transparent);
|
2013-05-08 15:18:55 -07:00
|
|
|
static void _ecore_evas_wl_common_border_update(Ecore_Evas *ee);
|
2013-02-27 01:49:23 -08:00
|
|
|
|
|
|
|
/* local functions */
|
2013-11-01 01:41:30 -07:00
|
|
|
static void
|
|
|
|
_ecore_evas_wl_common_state_update(Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
|
|
|
|
}
|
|
|
|
|
2013-02-27 01:49:23 -08:00
|
|
|
static int
|
|
|
|
_ecore_evas_wl_common_render_updates_process(Ecore_Evas *ee, Eina_List *updates)
|
|
|
|
{
|
|
|
|
int rend = 0;
|
|
|
|
|
2015-10-08 10:37:30 -07:00
|
|
|
if (((ee->visible) && (ee->draw_ok)) ||
|
|
|
|
((ee->should_be_visible) && (ee->prop.fullscreen)) ||
|
|
|
|
((ee->should_be_visible) && (ee->prop.override)))
|
2013-02-27 01:49:23 -08:00
|
|
|
{
|
2015-10-08 10:37:30 -07:00
|
|
|
if (updates)
|
|
|
|
{
|
|
|
|
_ecore_evas_idle_timeout_update(ee);
|
|
|
|
rend = 1;
|
|
|
|
}
|
2013-02-27 01:49:23 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
evas_norender(ee->evas);
|
|
|
|
|
|
|
|
if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
|
|
|
|
|
|
|
|
return rend;
|
|
|
|
}
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
static Eina_Bool
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_wl_common_cb_mouse_in(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2012-10-08 07:09:53 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
2015-09-28 10:42:38 -07:00
|
|
|
Ecore_Event_Mouse_IO *ev;
|
2012-10-08 07:09:53 -07:00
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
ev = event;
|
|
|
|
ee = ecore_event_window_match(ev->window);
|
|
|
|
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
|
|
|
|
if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
2013-10-29 01:04:05 -07:00
|
|
|
if (ee->in) return ECORE_CALLBACK_PASS_ON;
|
2013-05-08 10:01:23 -07:00
|
|
|
|
2013-10-29 01:04:05 -07:00
|
|
|
if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee);
|
2012-12-02 23:01:02 -08:00
|
|
|
ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
|
|
|
|
evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL);
|
2013-10-31 02:19:38 -07:00
|
|
|
_ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp);
|
2012-12-02 23:01:02 -08:00
|
|
|
ee->in = EINA_TRUE;
|
2012-10-08 07:09:53 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_wl_common_cb_mouse_out(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2012-10-08 07:09:53 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
2015-09-30 10:14:26 -07:00
|
|
|
Ecore_Event_Mouse_IO *ev;
|
2012-10-08 07:09:53 -07:00
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
ev = event;
|
|
|
|
ee = ecore_event_window_match(ev->window);
|
|
|
|
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
|
|
|
|
if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
2013-10-29 01:04:05 -07:00
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (ee->in)
|
|
|
|
{
|
|
|
|
ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
|
2013-10-31 02:19:38 -07:00
|
|
|
_ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp);
|
2012-10-08 07:09:53 -07:00
|
|
|
evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL);
|
|
|
|
if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
|
|
|
|
if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
|
|
|
|
ee->in = EINA_FALSE;
|
|
|
|
}
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_wl_common_cb_focus_in(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2012-10-08 07:09:53 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
2015-09-30 10:14:26 -07:00
|
|
|
Ecore_Wl2_Event_Focus_In *ev;
|
2012-10-08 07:09:53 -07:00
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
ev = event;
|
2015-09-30 10:14:26 -07:00
|
|
|
ee = ecore_event_window_match(ev->window);
|
2012-10-08 07:09:53 -07:00
|
|
|
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
|
2015-09-30 10:14:26 -07:00
|
|
|
if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
2013-10-29 01:41:48 -07:00
|
|
|
if (ee->prop.focused) return ECORE_CALLBACK_PASS_ON;
|
2014-01-11 01:19:43 -08:00
|
|
|
ee->prop.focused = EINA_TRUE;
|
2012-10-08 07:09:53 -07:00
|
|
|
evas_focus_in(ee->evas);
|
|
|
|
if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_wl_common_cb_focus_out(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2012-10-08 07:09:53 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
2015-09-30 10:14:26 -07:00
|
|
|
Ecore_Wl2_Event_Focus_Out *ev;
|
2012-10-08 07:09:53 -07:00
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
ev = event;
|
2015-09-30 10:14:26 -07:00
|
|
|
ee = ecore_event_window_match(ev->window);
|
2012-10-08 07:09:53 -07:00
|
|
|
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
|
2015-09-30 10:14:26 -07:00
|
|
|
if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
2013-10-29 01:41:48 -07:00
|
|
|
if (!ee->prop.focused) return ECORE_CALLBACK_PASS_ON;
|
2012-10-08 07:09:53 -07:00
|
|
|
evas_focus_out(ee->evas);
|
2014-01-11 01:19:43 -08:00
|
|
|
ee->prop.focused = EINA_FALSE;
|
2012-10-08 07:09:53 -07:00
|
|
|
if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2012-10-08 07:09:53 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
2013-04-30 12:29:00 -07:00
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
2015-09-28 10:42:38 -07:00
|
|
|
Ecore_Wl2_Event_Window_Configure *ev;
|
2012-10-08 07:09:53 -07:00
|
|
|
int nw = 0, nh = 0;
|
2015-11-17 10:51:19 -08:00
|
|
|
int fw = 0, fh = 0;
|
2013-04-30 12:29:00 -07:00
|
|
|
Eina_Bool prev_max, prev_full;
|
2012-10-08 07:09:53 -07:00
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
ev = event;
|
|
|
|
ee = ecore_event_window_match(ev->win);
|
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON;
|
|
|
|
if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
|
|
|
|
2013-04-30 12:29:00 -07:00
|
|
|
wdata = ee->engine.data;
|
|
|
|
if (!wdata) return ECORE_CALLBACK_PASS_ON;
|
|
|
|
|
|
|
|
prev_max = ee->prop.maximized;
|
|
|
|
prev_full = ee->prop.fullscreen;
|
2015-12-03 11:55:42 -08:00
|
|
|
ee->prop.maximized = ecore_wl2_window_maximized_get(wdata->win);
|
|
|
|
ee->prop.fullscreen = ecore_wl2_window_fullscreen_get(wdata->win);
|
2013-04-30 12:29:00 -07:00
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
nw = ev->w;
|
|
|
|
nh = ev->h;
|
Add code to deal with min, max, step, aspect, and base sizes.
Properly fix efl wayland elm window resize problem.
This adds support for min, max, step, aspect, and base size properties
when resizing a canvas under EFL Wayland.
This Also Properly fixes raster's report for EFL Wayland elm windows not
resizing properly. Previously, when resizing an elm window in wayland,
a portion of the window would draw outside the frame.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-12-05 03:48:25 -08:00
|
|
|
if (nw < 1) nw = 1;
|
|
|
|
if (nh < 1) nh = 1;
|
2013-10-31 10:21:33 -07:00
|
|
|
|
2015-11-17 15:21:11 -08:00
|
|
|
if (prev_full != ee->prop.fullscreen)
|
|
|
|
_ecore_evas_wl_common_border_update(ee);
|
|
|
|
|
|
|
|
if ((prev_max != ee->prop.maximized) ||
|
|
|
|
(prev_full != ee->prop.fullscreen))
|
|
|
|
_ecore_evas_wl_common_state_update(ee);
|
|
|
|
|
2015-11-17 15:21:11 -08:00
|
|
|
/* NB: We receive window configure sizes based on xdg surface
|
|
|
|
* window geometry, so we need to subtract framespace here */
|
2015-11-17 10:51:19 -08:00
|
|
|
evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
|
2015-11-17 15:21:11 -08:00
|
|
|
|
2015-11-17 10:51:19 -08:00
|
|
|
if (ECORE_EVAS_PORTRAIT(ee))
|
|
|
|
{
|
|
|
|
nw -= fw;
|
|
|
|
nh -= fh;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
nw -= fh;
|
|
|
|
nh -= fw;
|
|
|
|
}
|
|
|
|
|
2015-11-17 15:21:11 -08:00
|
|
|
if (ee->prop.fullscreen || (ee->x != ev->x) || (ee->y != ev->y))
|
2013-11-15 00:11:09 -08:00
|
|
|
_ecore_evas_wl_common_move(ee, ev->x, ev->y);
|
|
|
|
|
2015-11-17 15:21:11 -08:00
|
|
|
if (ee->prop.fullscreen || (ee->req.w != nw) || (ee->req.h != nh))
|
2013-11-15 00:11:09 -08:00
|
|
|
_ecore_evas_wl_common_resize(ee, nw, nh);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
2013-05-06 10:48:03 -07:00
|
|
|
static void
|
|
|
|
_rotation_do(Ecore_Evas *ee, int rotation, int resize)
|
2013-04-24 11:21:44 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
|
|
|
int rot_dif;
|
|
|
|
|
|
|
|
wdata = ee->engine.data;
|
|
|
|
|
2013-09-16 23:37:07 -07:00
|
|
|
/* calculate difference in rotation */
|
2013-04-24 11:21:44 -07:00
|
|
|
rot_dif = ee->rotation - rotation;
|
|
|
|
if (rot_dif < 0) rot_dif = -rot_dif;
|
|
|
|
|
2013-09-16 23:37:07 -07:00
|
|
|
/* set ecore_wayland window rotation */
|
2015-09-28 10:42:38 -07:00
|
|
|
ecore_wl2_window_rotation_set(wdata->win, rotation);
|
2013-09-16 23:37:07 -07:00
|
|
|
|
|
|
|
/* check if rotation is just a flip */
|
2013-04-24 11:21:44 -07:00
|
|
|
if (rot_dif != 180)
|
|
|
|
{
|
2013-09-16 23:37:07 -07:00
|
|
|
int minw, minh, maxw, maxh;
|
|
|
|
int basew, baseh, stepw, steph;
|
2013-04-24 11:21:44 -07:00
|
|
|
|
2013-09-16 23:37:07 -07:00
|
|
|
/* check if we are rotating with resize */
|
2013-04-24 11:21:44 -07:00
|
|
|
if (!resize)
|
|
|
|
{
|
2013-09-16 23:37:07 -07:00
|
|
|
int fw, fh;
|
2013-11-26 08:01:35 -08:00
|
|
|
int ww, hh;
|
2013-09-16 23:37:07 -07:00
|
|
|
|
|
|
|
/* grab framespace width & height */
|
|
|
|
evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
|
|
|
|
|
|
|
|
/* check for fullscreen */
|
2013-04-24 11:21:44 -07:00
|
|
|
if (!ee->prop.fullscreen)
|
|
|
|
{
|
2013-09-16 23:37:07 -07:00
|
|
|
/* resize the ecore_wayland window */
|
2015-09-28 10:42:38 -07:00
|
|
|
ecore_wl2_window_resize(wdata->win,
|
|
|
|
ee->req.h + fw, ee->req.w + fh, 0);
|
2013-09-16 23:37:07 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* resize the canvas based on rotation */
|
2014-01-18 05:04:25 -08:00
|
|
|
if ((rotation == 0) || (rotation == 180))
|
2013-04-24 13:14:15 -07:00
|
|
|
{
|
2013-09-16 23:37:07 -07:00
|
|
|
/* resize the ecore_wayland window */
|
2015-09-28 10:42:38 -07:00
|
|
|
ecore_wl2_window_resize(wdata->win,
|
|
|
|
ee->req.w, ee->req.h, 0);
|
2013-09-16 23:37:07 -07:00
|
|
|
|
|
|
|
/* resize the canvas */
|
|
|
|
evas_output_size_set(ee->evas, ee->req.w, ee->req.h);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0,
|
|
|
|
ee->req.w, ee->req.h);
|
2013-04-30 23:32:54 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-09-16 23:37:07 -07:00
|
|
|
/* resize the ecore_wayland window */
|
2015-09-28 10:42:38 -07:00
|
|
|
ecore_wl2_window_resize(wdata->win,
|
|
|
|
ee->req.h, ee->req.w, 0);
|
2013-09-16 23:37:07 -07:00
|
|
|
|
|
|
|
/* resize the canvas */
|
|
|
|
evas_output_size_set(ee->evas, ee->req.h, ee->req.w);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0,
|
|
|
|
ee->req.h, ee->req.w);
|
2013-04-24 13:14:15 -07:00
|
|
|
}
|
2013-04-24 11:21:44 -07:00
|
|
|
}
|
2013-09-16 23:37:07 -07:00
|
|
|
|
|
|
|
/* add canvas damage */
|
2014-01-18 05:26:10 -08:00
|
|
|
if (ECORE_EVAS_PORTRAIT(ee))
|
2013-09-16 23:37:07 -07:00
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->req.w, ee->req.h);
|
2013-04-24 11:21:44 -07:00
|
|
|
else
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->req.h, ee->req.w);
|
2013-11-26 08:01:35 -08:00
|
|
|
ww = ee->h;
|
|
|
|
hh = ee->w;
|
|
|
|
ee->w = ww;
|
|
|
|
ee->h = hh;
|
|
|
|
ee->req.w = ww;
|
|
|
|
ee->req.h = hh;
|
2013-04-24 11:21:44 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-09-16 23:37:07 -07:00
|
|
|
/* resize the canvas based on rotation */
|
2014-01-18 05:04:25 -08:00
|
|
|
if ((rotation == 0) || (rotation == 180))
|
2013-04-24 11:21:44 -07:00
|
|
|
{
|
|
|
|
evas_output_size_set(ee->evas, ee->w, ee->h);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
evas_output_size_set(ee->evas, ee->h, ee->w);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
|
|
|
|
}
|
2013-09-16 23:37:07 -07:00
|
|
|
|
|
|
|
/* call the ecore_evas' resize function */
|
2013-04-24 11:21:44 -07:00
|
|
|
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
2013-09-16 23:37:07 -07:00
|
|
|
|
|
|
|
/* add canvas damage */
|
2014-01-18 05:26:10 -08:00
|
|
|
if (ECORE_EVAS_PORTRAIT(ee))
|
2013-04-24 11:21:44 -07:00
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
2013-09-16 23:37:07 -07:00
|
|
|
else
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
|
2013-04-24 11:21:44 -07:00
|
|
|
}
|
2013-09-16 23:37:07 -07:00
|
|
|
|
|
|
|
/* get min, max, base, & step sizes */
|
2013-04-24 11:21:44 -07:00
|
|
|
ecore_evas_size_min_get(ee, &minw, &minh);
|
|
|
|
ecore_evas_size_max_get(ee, &maxw, &maxh);
|
|
|
|
ecore_evas_size_base_get(ee, &basew, &baseh);
|
|
|
|
ecore_evas_size_step_get(ee, &stepw, &steph);
|
2013-09-16 23:37:07 -07:00
|
|
|
|
|
|
|
/* record the current rotation of the ecore_evas */
|
2013-04-24 11:21:44 -07:00
|
|
|
ee->rotation = rotation;
|
2013-09-16 23:37:07 -07:00
|
|
|
|
|
|
|
/* reset min, max, base, & step sizes */
|
2013-04-24 11:21:44 -07:00
|
|
|
ecore_evas_size_min_set(ee, minh, minw);
|
|
|
|
ecore_evas_size_max_set(ee, maxh, maxw);
|
|
|
|
ecore_evas_size_base_set(ee, baseh, basew);
|
|
|
|
ecore_evas_size_step_set(ee, steph, stepw);
|
2013-09-16 23:37:07 -07:00
|
|
|
|
|
|
|
/* send a mouse_move process
|
2013-11-26 08:10:15 -08:00
|
|
|
*
|
|
|
|
* NB: Is This Really Needed ?
|
|
|
|
* Yes, it's required to update the mouse position, relatively to
|
|
|
|
* widgets. After a rotation change, e.g., the mouse might not be over
|
|
|
|
* a button anymore. */
|
2013-04-24 11:21:44 -07:00
|
|
|
_ecore_evas_mouse_move_process(ee, ee->mouse.x, ee->mouse.y,
|
|
|
|
ecore_loop_time_get());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-09-16 23:37:07 -07:00
|
|
|
/* resize the ecore_wayland window */
|
2015-09-28 10:42:38 -07:00
|
|
|
ecore_wl2_window_resize(wdata->win, ee->w, ee->h, 0);
|
2013-09-16 23:37:07 -07:00
|
|
|
|
|
|
|
/* record the current rotation of the ecore_evas */
|
2013-04-24 11:21:44 -07:00
|
|
|
ee->rotation = rotation;
|
2013-09-16 23:37:07 -07:00
|
|
|
|
|
|
|
/* send a mouse_move process
|
2013-11-26 08:10:15 -08:00
|
|
|
*
|
|
|
|
* NB: Is This Really Needed ? Yes, it's required to update the mouse
|
|
|
|
* position, relatively to widgets. */
|
2013-04-24 11:21:44 -07:00
|
|
|
_ecore_evas_mouse_move_process(ee, ee->mouse.x, ee->mouse.y,
|
|
|
|
ecore_loop_time_get());
|
2013-09-16 23:37:07 -07:00
|
|
|
|
|
|
|
/* call the ecore_evas' resize function */
|
2013-04-24 11:21:44 -07:00
|
|
|
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
|
|
|
|
2013-09-16 23:37:07 -07:00
|
|
|
/* add canvas damage */
|
2014-01-18 05:26:10 -08:00
|
|
|
if (ECORE_EVAS_PORTRAIT(ee))
|
2013-04-24 11:21:44 -07:00
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
2013-09-16 23:37:07 -07:00
|
|
|
else
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
|
2013-04-24 11:21:44 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-06 10:48:03 -07:00
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_rotation_set(Ecore_Evas *ee, int rotation, int resize)
|
|
|
|
{
|
|
|
|
if (ee->in_async_render)
|
|
|
|
{
|
|
|
|
ee->delayed.rotation = rotation;
|
|
|
|
ee->delayed.rotation_resize = resize;
|
|
|
|
ee->delayed.rotation_changed = EINA_TRUE;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
_rotation_do(ee, rotation, resize);
|
|
|
|
}
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
int
|
|
|
|
_ecore_evas_wl_common_init(void)
|
|
|
|
{
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (++_ecore_evas_wl_init_count != 1)
|
|
|
|
return _ecore_evas_wl_init_count;
|
|
|
|
|
|
|
|
_ecore_evas_wl_event_hdls[0] =
|
2015-09-28 10:42:38 -07:00
|
|
|
ecore_event_handler_add(ECORE_EVENT_MOUSE_IN,
|
2012-10-08 07:09:53 -07:00
|
|
|
_ecore_evas_wl_common_cb_mouse_in, NULL);
|
|
|
|
_ecore_evas_wl_event_hdls[1] =
|
2015-09-28 10:42:38 -07:00
|
|
|
ecore_event_handler_add(ECORE_EVENT_MOUSE_OUT,
|
2012-10-08 07:09:53 -07:00
|
|
|
_ecore_evas_wl_common_cb_mouse_out, NULL);
|
|
|
|
_ecore_evas_wl_event_hdls[2] =
|
2015-09-28 10:42:38 -07:00
|
|
|
ecore_event_handler_add(ECORE_WL2_EVENT_FOCUS_IN,
|
2012-10-08 07:09:53 -07:00
|
|
|
_ecore_evas_wl_common_cb_focus_in, NULL);
|
|
|
|
_ecore_evas_wl_event_hdls[3] =
|
2015-09-28 10:42:38 -07:00
|
|
|
ecore_event_handler_add(ECORE_WL2_EVENT_FOCUS_OUT,
|
2012-10-08 07:09:53 -07:00
|
|
|
_ecore_evas_wl_common_cb_focus_out, NULL);
|
|
|
|
_ecore_evas_wl_event_hdls[4] =
|
2015-09-28 10:42:38 -07:00
|
|
|
ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_CONFIGURE,
|
2012-10-08 07:09:53 -07:00
|
|
|
_ecore_evas_wl_common_cb_window_configure, NULL);
|
|
|
|
|
|
|
|
ecore_event_evas_init();
|
|
|
|
|
|
|
|
return _ecore_evas_wl_init_count;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
_ecore_evas_wl_common_shutdown(void)
|
|
|
|
{
|
|
|
|
unsigned int i = 0;
|
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (--_ecore_evas_wl_init_count != 0)
|
|
|
|
return _ecore_evas_wl_init_count;
|
|
|
|
|
|
|
|
for (i = 0; i < sizeof(_ecore_evas_wl_event_hdls) / sizeof(Ecore_Event_Handler *); i++)
|
|
|
|
{
|
|
|
|
if (_ecore_evas_wl_event_hdls[i])
|
|
|
|
ecore_event_handler_del(_ecore_evas_wl_event_hdls[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
ecore_event_evas_shutdown();
|
|
|
|
|
|
|
|
return _ecore_evas_wl_init_count;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_pre_free(Ecore_Evas *ee)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (!ee) return;
|
2012-12-05 13:15:42 -08:00
|
|
|
wdata = ee->engine.data;
|
|
|
|
if (wdata->frame) evas_object_del(wdata->frame);
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_free(Ecore_Evas *ee)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2015-01-05 06:09:02 -08:00
|
|
|
if (!ee) return;
|
2015-09-28 10:42:38 -07:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
wdata = ee->engine.data;
|
2015-09-28 10:42:38 -07:00
|
|
|
|
|
|
|
if (wdata->anim_callback) wl_callback_destroy(wdata->anim_callback);
|
|
|
|
wdata->anim_callback = NULL;
|
|
|
|
|
|
|
|
if (wdata->win) ecore_wl2_window_free(wdata->win);
|
2012-12-05 13:15:42 -08:00
|
|
|
wdata->win = NULL;
|
2015-09-28 10:42:38 -07:00
|
|
|
|
|
|
|
ecore_wl2_display_disconnect(wdata->display);
|
2012-12-05 13:15:42 -08:00
|
|
|
free(wdata);
|
2012-10-08 07:09:53 -07:00
|
|
|
|
|
|
|
ecore_event_window_unregister(ee->prop.window);
|
|
|
|
ecore_evas_input_event_unregister(ee);
|
|
|
|
|
|
|
|
_ecore_evas_wl_common_shutdown();
|
2015-09-28 10:42:38 -07:00
|
|
|
|
|
|
|
ecore_wl2_shutdown();
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
|
|
|
|
{
|
2015-09-30 07:58:13 -07:00
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
2013-11-15 00:11:09 -08:00
|
|
|
int orig_w, orig_h;
|
|
|
|
int ow, oh;
|
2012-12-05 13:15:42 -08:00
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2015-01-05 06:09:02 -08:00
|
|
|
if (!ee) return;
|
2015-09-30 07:58:13 -07:00
|
|
|
|
|
|
|
wdata = ee->engine.data;
|
|
|
|
if (!wdata) return;
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (w < 1) w = 1;
|
|
|
|
if (h < 1) h = 1;
|
|
|
|
|
|
|
|
ee->req.w = w;
|
|
|
|
ee->req.h = h;
|
2013-11-15 00:11:09 -08:00
|
|
|
orig_w = w;
|
|
|
|
orig_h = h;
|
2012-10-08 07:09:53 -07:00
|
|
|
|
|
|
|
if (!ee->prop.fullscreen)
|
|
|
|
{
|
|
|
|
int fw = 0, fh = 0;
|
2015-01-07 11:47:55 -08:00
|
|
|
int maxw = 0, maxh = 0;
|
|
|
|
int minw = 0, minh = 0;
|
|
|
|
double a = 0.0;
|
2015-01-07 10:37:55 -08:00
|
|
|
|
Add code to deal with min, max, step, aspect, and base sizes.
Properly fix efl wayland elm window resize problem.
This adds support for min, max, step, aspect, and base size properties
when resizing a canvas under EFL Wayland.
This Also Properly fixes raster's report for EFL Wayland elm windows not
resizing properly. Previously, when resizing an elm window in wayland,
a portion of the window would draw outside the frame.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-12-05 03:48:25 -08:00
|
|
|
evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
|
|
|
|
|
2014-01-18 05:26:10 -08:00
|
|
|
if (ECORE_EVAS_PORTRAIT(ee))
|
Add code to deal with min, max, step, aspect, and base sizes.
Properly fix efl wayland elm window resize problem.
This adds support for min, max, step, aspect, and base size properties
when resizing a canvas under EFL Wayland.
This Also Properly fixes raster's report for EFL Wayland elm windows not
resizing properly. Previously, when resizing an elm window in wayland,
a portion of the window would draw outside the frame.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-12-05 03:48:25 -08:00
|
|
|
{
|
2015-01-07 11:47:55 -08:00
|
|
|
if (ee->prop.min.w > 0)
|
|
|
|
minw = (ee->prop.min.w - fw);
|
|
|
|
if (ee->prop.min.h > 0)
|
|
|
|
minh = (ee->prop.min.h - fh);
|
|
|
|
if (ee->prop.max.w > 0)
|
|
|
|
maxw = (ee->prop.max.w + fw);
|
|
|
|
if (ee->prop.max.h > 0)
|
|
|
|
maxh = (ee->prop.max.h + fh);
|
Add code to deal with min, max, step, aspect, and base sizes.
Properly fix efl wayland elm window resize problem.
This adds support for min, max, step, aspect, and base size properties
when resizing a canvas under EFL Wayland.
This Also Properly fixes raster's report for EFL Wayland elm windows not
resizing properly. Previously, when resizing an elm window in wayland,
a portion of the window would draw outside the frame.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-12-05 03:48:25 -08:00
|
|
|
}
|
2014-01-18 05:26:10 -08:00
|
|
|
else
|
|
|
|
{
|
2015-01-07 11:47:55 -08:00
|
|
|
if (ee->prop.min.w > 0)
|
|
|
|
minw = (ee->prop.min.w - fh);
|
|
|
|
if (ee->prop.min.h > 0)
|
|
|
|
minh = (ee->prop.min.h - fw);
|
|
|
|
if (ee->prop.max.w > 0)
|
|
|
|
maxw = (ee->prop.max.w + fh);
|
|
|
|
if (ee->prop.max.h > 0)
|
|
|
|
maxh = (ee->prop.max.h + fw);
|
2014-01-18 05:26:10 -08:00
|
|
|
}
|
Add code to deal with min, max, step, aspect, and base sizes.
Properly fix efl wayland elm window resize problem.
This adds support for min, max, step, aspect, and base size properties
when resizing a canvas under EFL Wayland.
This Also Properly fixes raster's report for EFL Wayland elm windows not
resizing properly. Previously, when resizing an elm window in wayland,
a portion of the window would draw outside the frame.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-12-05 03:48:25 -08:00
|
|
|
|
|
|
|
/* adjust size using aspect */
|
|
|
|
if ((ee->prop.base.w >= 0) && (ee->prop.base.h >= 0))
|
|
|
|
{
|
|
|
|
int bw, bh;
|
|
|
|
|
|
|
|
bw = (w - ee->prop.base.w);
|
|
|
|
bh = (h - ee->prop.base.h);
|
|
|
|
if (bw < 1) bw = 1;
|
|
|
|
if (bh < 1) bh = 1;
|
|
|
|
a = ((double)bw / (double)bh);
|
|
|
|
if ((ee->prop.aspect != 0.0) && (a < ee->prop.aspect))
|
|
|
|
{
|
|
|
|
if ((h < ee->h) > 0)
|
|
|
|
bw = bh * ee->prop.aspect;
|
|
|
|
else
|
|
|
|
bw = bw / ee->prop.aspect;
|
|
|
|
|
|
|
|
w = bw + ee->prop.base.w;
|
|
|
|
h = bh + ee->prop.base.h;
|
|
|
|
}
|
|
|
|
else if ((ee->prop.aspect != 0.0) && (a > ee->prop.aspect))
|
|
|
|
{
|
|
|
|
bw = bh * ee->prop.aspect;
|
|
|
|
w = bw + ee->prop.base.w;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
a = ((double)w / (double)h);
|
|
|
|
if ((ee->prop.aspect != 0.0) && (a < ee->prop.aspect))
|
|
|
|
{
|
|
|
|
if ((h < ee->h) > 0)
|
|
|
|
w = h * ee->prop.aspect;
|
|
|
|
else
|
|
|
|
h = w / ee->prop.aspect;
|
|
|
|
}
|
|
|
|
else if ((ee->prop.aspect != 0.0) && (a > ee->prop.aspect))
|
|
|
|
w = h * ee->prop.aspect;
|
|
|
|
}
|
|
|
|
|
2015-10-30 12:12:41 -07:00
|
|
|
if (!ee->prop.maximized)
|
Add code to deal with min, max, step, aspect, and base sizes.
Properly fix efl wayland elm window resize problem.
This adds support for min, max, step, aspect, and base size properties
when resizing a canvas under EFL Wayland.
This Also Properly fixes raster's report for EFL Wayland elm windows not
resizing properly. Previously, when resizing an elm window in wayland,
a portion of the window would draw outside the frame.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-12-05 03:48:25 -08:00
|
|
|
{
|
2015-10-30 12:12:41 -07:00
|
|
|
/* calc new size using base size & step size */
|
|
|
|
if (ee->prop.step.w > 0)
|
|
|
|
{
|
|
|
|
if (ee->prop.base.w >= 0)
|
|
|
|
w = (ee->prop.base.w +
|
|
|
|
(((w - ee->prop.base.w) / ee->prop.step.w) *
|
|
|
|
ee->prop.step.w));
|
|
|
|
else
|
|
|
|
w = (minw + (((w - minw) / ee->prop.step.w) * ee->prop.step.w));
|
|
|
|
}
|
Add code to deal with min, max, step, aspect, and base sizes.
Properly fix efl wayland elm window resize problem.
This adds support for min, max, step, aspect, and base size properties
when resizing a canvas under EFL Wayland.
This Also Properly fixes raster's report for EFL Wayland elm windows not
resizing properly. Previously, when resizing an elm window in wayland,
a portion of the window would draw outside the frame.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-12-05 03:48:25 -08:00
|
|
|
|
2015-10-30 12:12:41 -07:00
|
|
|
if (ee->prop.step.h > 0)
|
|
|
|
{
|
|
|
|
if (ee->prop.base.h >= 0)
|
|
|
|
h = (ee->prop.base.h +
|
|
|
|
(((h - ee->prop.base.h) / ee->prop.step.h) *
|
|
|
|
ee->prop.step.h));
|
|
|
|
else
|
|
|
|
h = (minh + (((h - minh) / ee->prop.step.h) * ee->prop.step.h));
|
|
|
|
}
|
Add code to deal with min, max, step, aspect, and base sizes.
Properly fix efl wayland elm window resize problem.
This adds support for min, max, step, aspect, and base size properties
when resizing a canvas under EFL Wayland.
This Also Properly fixes raster's report for EFL Wayland elm windows not
resizing properly. Previously, when resizing an elm window in wayland,
a portion of the window would draw outside the frame.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-12-05 03:48:25 -08:00
|
|
|
}
|
2012-10-08 07:09:53 -07:00
|
|
|
|
2015-01-07 11:47:55 -08:00
|
|
|
if ((maxw > 0) && (w > maxw))
|
|
|
|
w = maxw;
|
|
|
|
else if (w < minw)
|
|
|
|
w = minw;
|
|
|
|
|
|
|
|
if ((maxh > 0) && (h > maxh))
|
|
|
|
h = maxh;
|
|
|
|
else if (h < minh)
|
|
|
|
h = minh;
|
2012-10-08 07:09:53 -07:00
|
|
|
|
2013-11-15 00:11:09 -08:00
|
|
|
orig_w = w;
|
|
|
|
orig_h = h;
|
|
|
|
|
2014-01-18 05:26:10 -08:00
|
|
|
if (ECORE_EVAS_PORTRAIT(ee))
|
2013-11-15 00:11:09 -08:00
|
|
|
{
|
2014-01-18 05:26:10 -08:00
|
|
|
w += fw;
|
|
|
|
h += fh;
|
2013-11-15 00:11:09 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-01-18 05:26:10 -08:00
|
|
|
w += fh;
|
|
|
|
h += fw;
|
2013-11-15 00:11:09 -08:00
|
|
|
}
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
|
2013-11-15 00:11:09 -08:00
|
|
|
evas_output_size_get(ee->evas, &ow, &oh);
|
|
|
|
if ((ow != w) || (oh != h))
|
2012-10-08 07:09:53 -07:00
|
|
|
{
|
2013-11-15 00:11:09 -08:00
|
|
|
ee->w = orig_w;
|
|
|
|
ee->h = orig_h;
|
2013-12-04 03:30:36 -08:00
|
|
|
ee->req.w = orig_w;
|
|
|
|
ee->req.h = orig_h;
|
2012-10-08 07:09:53 -07:00
|
|
|
|
2014-01-18 05:26:10 -08:00
|
|
|
if (ECORE_EVAS_PORTRAIT(ee))
|
2012-10-08 07:09:53 -07:00
|
|
|
{
|
2014-01-18 05:26:10 -08:00
|
|
|
evas_output_size_set(ee->evas, w, h);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, w, h);
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-01-18 05:26:10 -08:00
|
|
|
evas_output_size_set(ee->evas, h, w);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, h, w);
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
if (ee->prop.avoid_damage)
|
|
|
|
{
|
|
|
|
int pdam = 0;
|
|
|
|
|
|
|
|
pdam = ecore_evas_avoid_damage_get(ee);
|
|
|
|
ecore_evas_avoid_damage_set(ee, 0);
|
|
|
|
ecore_evas_avoid_damage_set(ee, pdam);
|
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
if (wdata->frame)
|
|
|
|
evas_object_resize(wdata->frame, w, h);
|
2013-11-15 00:11:09 -08:00
|
|
|
|
2015-09-28 10:42:38 -07:00
|
|
|
if (wdata->win)
|
|
|
|
{
|
2015-11-09 08:55:21 -08:00
|
|
|
if (ECORE_EVAS_PORTRAIT(ee))
|
|
|
|
ecore_wl2_window_geometry_set(wdata->win, 0, 0, w, h);
|
|
|
|
else
|
|
|
|
ecore_wl2_window_geometry_set(wdata->win, 0, 0, h, w);
|
2015-09-28 10:42:38 -07:00
|
|
|
}
|
|
|
|
|
2013-11-15 00:11:09 -08:00
|
|
|
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_callback_resize_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
|
|
|
|
{
|
|
|
|
if (!ee) return;
|
|
|
|
ee->func.fn_resize = func;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_callback_move_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
|
|
|
|
{
|
|
|
|
if (!ee) return;
|
|
|
|
ee->func.fn_move = func;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_callback_delete_request_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
|
|
|
|
{
|
|
|
|
if (!ee) return;
|
|
|
|
ee->func.fn_delete_request = func;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
|
|
|
|
{
|
|
|
|
if (!ee) return;
|
|
|
|
ee->func.fn_focus_in = func;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
|
|
|
|
{
|
|
|
|
if (!ee) return;
|
|
|
|
ee->func.fn_focus_out = func;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
|
|
|
|
{
|
|
|
|
if (!ee) return;
|
|
|
|
ee->func.fn_mouse_in = func;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
|
|
|
|
{
|
|
|
|
if (!ee) return;
|
|
|
|
ee->func.fn_mouse_out = func;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_move(Ecore_Evas *ee, int x, int y)
|
|
|
|
{
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (!ee) return;
|
|
|
|
|
|
|
|
ee->req.x = x;
|
|
|
|
ee->req.y = y;
|
|
|
|
|
|
|
|
if ((ee->x != x) || (ee->y != y))
|
|
|
|
{
|
|
|
|
ee->x = x;
|
|
|
|
ee->y = y;
|
|
|
|
if (ee->func.fn_move) ee->func.fn_move(ee);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-22 12:44:43 -07:00
|
|
|
/* Frame border:
|
|
|
|
*
|
|
|
|
* |------------------------------------------|
|
|
|
|
* | top border |
|
|
|
|
* |------------------------------------------|
|
|
|
|
* | | | |
|
|
|
|
* | | | |
|
|
|
|
* | | | |
|
|
|
|
* | | | |
|
|
|
|
* |left | | right |
|
|
|
|
* |border | | border |
|
|
|
|
* | | | |
|
|
|
|
* | | | |
|
|
|
|
* | | | |
|
|
|
|
* |------------------------------------------|
|
|
|
|
* | bottom border |
|
|
|
|
* |------------------------------------------|
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
_border_size_eval(Evas_Object *obj EINA_UNUSED, EE_Wl_Smart_Data *sd)
|
|
|
|
{
|
2013-04-30 23:32:54 -07:00
|
|
|
|
2013-04-22 12:44:43 -07:00
|
|
|
/* top border */
|
|
|
|
if (sd->border[0])
|
|
|
|
{
|
|
|
|
evas_object_move(sd->border[0], sd->x, sd->y);
|
|
|
|
evas_object_resize(sd->border[0], sd->w, sd->border_size[0]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* bottom border */
|
|
|
|
if (sd->border[1])
|
|
|
|
{
|
2015-10-21 06:09:18 -07:00
|
|
|
evas_object_move(sd->border[1], sd->x,
|
|
|
|
sd->y + sd->h - sd->border_size[1]);
|
2013-04-22 12:44:43 -07:00
|
|
|
evas_object_resize(sd->border[1], sd->w, sd->border_size[1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* left border */
|
|
|
|
if (sd->border[2])
|
|
|
|
{
|
|
|
|
evas_object_move(sd->border[2], sd->x, sd->y + sd->border_size[0]);
|
|
|
|
evas_object_resize(sd->border[2], sd->border_size[2],
|
|
|
|
sd->h - sd->border_size[0] - sd->border_size[1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* right border */
|
|
|
|
if (sd->border[3])
|
|
|
|
{
|
|
|
|
evas_object_move(sd->border[3], sd->x + sd->w - sd->border_size[3],
|
|
|
|
sd->y + sd->border_size[0]);
|
|
|
|
evas_object_resize(sd->border[3], sd->border_size[3],
|
|
|
|
sd->h - sd->border_size[0] - sd->border_size[1]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
static void
|
|
|
|
_ecore_evas_wl_common_smart_add(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
EE_Wl_Smart_Data *sd;
|
|
|
|
Evas *evas;
|
2013-04-22 12:44:43 -07:00
|
|
|
int i;
|
2012-10-08 07:09:53 -07:00
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2013-03-21 16:45:44 -07:00
|
|
|
EVAS_SMART_DATA_ALLOC(obj, EE_Wl_Smart_Data);
|
|
|
|
|
|
|
|
_ecore_evas_wl_frame_parent_sc->add(obj);
|
|
|
|
|
|
|
|
sd = priv;
|
2012-10-08 07:09:53 -07:00
|
|
|
|
|
|
|
evas = evas_object_evas_get(obj);
|
|
|
|
|
|
|
|
sd->x = 0;
|
|
|
|
sd->y = 0;
|
|
|
|
sd->w = 1;
|
|
|
|
sd->h = 1;
|
|
|
|
|
2013-04-22 12:44:43 -07:00
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
{
|
|
|
|
sd->border[i] = NULL;
|
|
|
|
sd->border_size[i] = 0;
|
|
|
|
}
|
2012-10-08 07:09:53 -07:00
|
|
|
|
|
|
|
sd->text = evas_object_text_add(evas);
|
|
|
|
evas_object_color_set(sd->text, 0, 0, 0, 255);
|
|
|
|
evas_object_text_style_set(sd->text, EVAS_TEXT_STYLE_PLAIN);
|
|
|
|
evas_object_text_font_set(sd->text, "Sans", 10);
|
|
|
|
evas_object_text_text_set(sd->text, "Smart Test");
|
2013-03-22 11:01:02 -07:00
|
|
|
evas_object_show(sd->text);
|
2012-10-16 04:56:57 -07:00
|
|
|
evas_object_smart_member_add(sd->text, obj);
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_wl_common_smart_del(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
EE_Wl_Smart_Data *sd;
|
2013-04-22 12:44:43 -07:00
|
|
|
int i;
|
2012-10-08 07:09:53 -07:00
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (!(sd = evas_object_smart_data_get(obj))) return;
|
|
|
|
evas_object_del(sd->text);
|
2013-04-22 12:44:43 -07:00
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
{
|
|
|
|
evas_object_del(sd->border[i]);
|
|
|
|
}
|
2013-03-21 16:45:44 -07:00
|
|
|
_ecore_evas_wl_frame_parent_sc->del(obj);
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
|
2013-04-22 12:44:43 -07:00
|
|
|
static void
|
|
|
|
_ecore_evas_wl_common_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
|
|
|
{
|
|
|
|
EE_Wl_Smart_Data *sd;
|
|
|
|
|
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
|
|
|
_ecore_evas_wl_frame_parent_sc->move(obj, x, y);
|
|
|
|
|
|
|
|
if (!(sd = evas_object_smart_data_get(obj))) return;
|
|
|
|
if ((sd->x == x) && (sd->y == y)) return;
|
|
|
|
sd->x = x;
|
|
|
|
sd->y = y;
|
|
|
|
|
|
|
|
evas_object_smart_changed(obj);
|
|
|
|
}
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
static void
|
|
|
|
_ecore_evas_wl_common_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
|
|
|
{
|
|
|
|
EE_Wl_Smart_Data *sd;
|
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (!(sd = evas_object_smart_data_get(obj))) return;
|
|
|
|
if ((sd->w == w) && (sd->h == h)) return;
|
|
|
|
sd->w = w;
|
|
|
|
sd->h = h;
|
2013-04-22 12:44:43 -07:00
|
|
|
|
|
|
|
evas_object_smart_changed(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_smart_calculate(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
EE_Wl_Smart_Data *sd;
|
|
|
|
|
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
|
|
|
if (!(sd = evas_object_smart_data_get(obj))) return;
|
|
|
|
|
|
|
|
_border_size_eval(obj, sd);
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-03-21 16:45:44 -07:00
|
|
|
_ecore_evas_wl_frame_smart_set_user(Evas_Smart_Class *sc)
|
2012-10-08 07:09:53 -07:00
|
|
|
{
|
2013-03-21 16:45:44 -07:00
|
|
|
sc->add = _ecore_evas_wl_common_smart_add;
|
|
|
|
sc->del = _ecore_evas_wl_common_smart_del;
|
2013-04-22 12:44:43 -07:00
|
|
|
sc->move = _ecore_evas_wl_common_smart_move;
|
2013-03-21 16:45:44 -07:00
|
|
|
sc->resize = _ecore_evas_wl_common_smart_resize;
|
2013-04-22 12:44:43 -07:00
|
|
|
sc->calculate = _ecore_evas_wl_common_smart_calculate;
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
Evas_Object *
|
|
|
|
_ecore_evas_wl_common_frame_add(Evas *evas)
|
|
|
|
{
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2013-03-21 16:45:44 -07:00
|
|
|
return evas_object_smart_add(evas, _ecore_evas_wl_frame_smart_class_new());
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
|
2013-04-22 12:44:43 -07:00
|
|
|
/*
|
|
|
|
* Size is received in the same format as it is used to set the framespace
|
|
|
|
* offset size.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_frame_border_size_set(Evas_Object *obj, int fx, int fy, int fw, int fh)
|
|
|
|
{
|
|
|
|
EE_Wl_Smart_Data *sd;
|
|
|
|
Evas *e;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
|
|
|
if (!(sd = evas_object_smart_data_get(obj))) return;
|
|
|
|
|
|
|
|
e = evas_object_evas_get(obj);
|
|
|
|
|
|
|
|
sd->border_size[0] = fy;
|
|
|
|
sd->border_size[1] = fh - fy;
|
|
|
|
sd->border_size[2] = fx;
|
|
|
|
sd->border_size[3] = fw - fx;
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
{
|
|
|
|
if ((sd->border_size[i] <= 0) && (sd->border[i]))
|
|
|
|
{
|
|
|
|
evas_object_del(sd->border[i]);
|
|
|
|
sd->border[i] = NULL;
|
|
|
|
}
|
|
|
|
else if ((sd->border_size[i] > 0) && (!sd->border[i]))
|
|
|
|
{
|
|
|
|
sd->border[i] = evas_object_rectangle_add(e);
|
|
|
|
evas_object_color_set(sd->border[i], 249, 249, 249, 255);
|
|
|
|
evas_object_show(sd->border[i]);
|
|
|
|
evas_object_smart_member_add(sd->border[i], obj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
evas_object_raise(sd->text);
|
|
|
|
}
|
|
|
|
|
2013-05-08 15:18:55 -07:00
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_frame_border_size_get(Evas_Object *obj, int *fx, int *fy, int *fw, int *fh)
|
|
|
|
{
|
|
|
|
EE_Wl_Smart_Data *sd;
|
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
|
|
|
if (!(sd = evas_object_smart_data_get(obj))) return;
|
|
|
|
|
|
|
|
if (fx) *fx = sd->border_size[2];
|
|
|
|
if (fy) *fy = sd->border_size[0];
|
|
|
|
if (fw) *fw = sd->border_size[2] + sd->border_size[3];
|
|
|
|
if (fh) *fh = sd->border_size[0] + sd->border_size[1];
|
|
|
|
}
|
|
|
|
|
2013-07-08 03:02:58 -07:00
|
|
|
void
|
2015-09-28 10:42:38 -07:00
|
|
|
_ecore_evas_wl_common_pointer_xy_get(const Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y)
|
2013-07-08 03:02:58 -07:00
|
|
|
{
|
2015-09-28 10:42:38 -07:00
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
|
|
|
|
2013-07-08 03:02:58 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2015-09-28 10:42:38 -07:00
|
|
|
wdata = ee->engine.data;
|
|
|
|
ecore_wl2_window_pointer_xy_get(wdata->win, x, y);
|
2013-07-08 03:02:58 -07:00
|
|
|
}
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_raise(Ecore_Evas *ee)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if ((!ee) || (!ee->visible)) return;
|
2012-12-05 13:15:42 -08:00
|
|
|
wdata = ee->engine.data;
|
2015-09-28 10:42:38 -07:00
|
|
|
ecore_wl2_window_raise(wdata->win);
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_title_set(Ecore_Evas *ee, const char *title)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (!ee) return;
|
2015-01-22 11:37:56 -08:00
|
|
|
if (eina_streq(ee->prop.title, title)) return;
|
2012-10-08 07:09:53 -07:00
|
|
|
if (ee->prop.title) free(ee->prop.title);
|
|
|
|
ee->prop.title = NULL;
|
|
|
|
if (title) ee->prop.title = strdup(title);
|
2012-12-05 13:15:42 -08:00
|
|
|
wdata = ee->engine.data;
|
|
|
|
if ((ee->prop.draw_frame) && (wdata->frame))
|
2012-10-08 07:09:53 -07:00
|
|
|
{
|
|
|
|
EE_Wl_Smart_Data *sd;
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
if ((sd = evas_object_smart_data_get(wdata->frame)))
|
2012-10-16 04:57:16 -07:00
|
|
|
evas_object_text_text_set(sd->text, ee->prop.title);
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
|
2013-11-01 06:38:05 -07:00
|
|
|
if (ee->prop.title)
|
2015-09-28 10:42:38 -07:00
|
|
|
ecore_wl2_window_title_set(wdata->win, ee->prop.title);
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (!ee) return;
|
2012-12-05 13:15:42 -08:00
|
|
|
wdata = ee->engine.data;
|
2015-01-22 11:37:56 -08:00
|
|
|
if (!eina_streq(ee->prop.name, n))
|
|
|
|
{
|
|
|
|
if (ee->prop.name) free(ee->prop.name);
|
|
|
|
ee->prop.name = NULL;
|
|
|
|
if (n) ee->prop.name = strdup(n);
|
|
|
|
}
|
|
|
|
if (!eina_streq(ee->prop.clas, c))
|
|
|
|
{
|
|
|
|
if (ee->prop.clas) free(ee->prop.clas);
|
|
|
|
ee->prop.clas = NULL;
|
|
|
|
if (c) ee->prop.clas = strdup(c);
|
|
|
|
}
|
2015-09-28 10:42:38 -07:00
|
|
|
|
2013-11-01 06:38:05 -07:00
|
|
|
if (ee->prop.clas)
|
2015-11-22 15:48:00 -08:00
|
|
|
ecore_wl2_window_class_set(wdata->win, ee->prop.clas);
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h)
|
|
|
|
{
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (!ee) return;
|
|
|
|
if (w < 0) w = 0;
|
|
|
|
if (h < 0) h = 0;
|
|
|
|
if ((ee->prop.min.w == w) && (ee->prop.min.h == h)) return;
|
|
|
|
ee->prop.min.w = w;
|
|
|
|
ee->prop.min.h = h;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h)
|
|
|
|
{
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (!ee) return;
|
|
|
|
if (w < 0) w = 0;
|
|
|
|
if (h < 0) h = 0;
|
|
|
|
if ((ee->prop.max.w == w) && (ee->prop.max.h == h)) return;
|
|
|
|
ee->prop.max.w = w;
|
|
|
|
ee->prop.max.h = h;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_size_base_set(Ecore_Evas *ee, int w, int h)
|
|
|
|
{
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (!ee) return;
|
|
|
|
if (w < 0) w = 0;
|
|
|
|
if (h < 0) h = 0;
|
|
|
|
if ((ee->prop.base.w == w) && (ee->prop.base.h == h)) return;
|
|
|
|
ee->prop.base.w = w;
|
|
|
|
ee->prop.base.h = h;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_size_step_set(Ecore_Evas *ee, int w, int h)
|
|
|
|
{
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (!ee) return;
|
|
|
|
if (w < 0) w = 0;
|
|
|
|
if (h < 0) h = 0;
|
|
|
|
if ((ee->prop.step.w == w) && (ee->prop.step.h == h)) return;
|
|
|
|
ee->prop.step.w = w;
|
|
|
|
ee->prop.step.h = h;
|
|
|
|
}
|
|
|
|
|
Add code to deal with min, max, step, aspect, and base sizes.
Properly fix efl wayland elm window resize problem.
This adds support for min, max, step, aspect, and base size properties
when resizing a canvas under EFL Wayland.
This Also Properly fixes raster's report for EFL Wayland elm windows not
resizing properly. Previously, when resizing an elm window in wayland,
a portion of the window would draw outside the frame.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-12-05 03:48:25 -08:00
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_aspect_set(Ecore_Evas *ee, double aspect)
|
|
|
|
{
|
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2015-01-05 06:09:02 -08:00
|
|
|
if (!ee) return;
|
Add code to deal with min, max, step, aspect, and base sizes.
Properly fix efl wayland elm window resize problem.
This adds support for min, max, step, aspect, and base size properties
when resizing a canvas under EFL Wayland.
This Also Properly fixes raster's report for EFL Wayland elm windows not
resizing properly. Previously, when resizing an elm window in wayland,
a portion of the window would draw outside the frame.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-12-05 03:48:25 -08:00
|
|
|
if (ee->prop.aspect == aspect) return;
|
|
|
|
ee->prop.aspect = aspect;
|
|
|
|
}
|
|
|
|
|
2012-11-07 08:12:14 -08:00
|
|
|
static void
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2012-11-07 08:12:14 -08:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
|
|
|
|
ee = data;
|
|
|
|
if (ee) ee->prop.cursor.object = NULL;
|
|
|
|
}
|
|
|
|
|
2015-02-06 14:54:08 -08:00
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_object_cursor_unset(Ecore_Evas *ee)
|
|
|
|
{
|
2015-10-21 06:09:18 -07:00
|
|
|
evas_object_event_callback_del_full(ee->prop.cursor.object,
|
|
|
|
EVAS_CALLBACK_DEL,
|
|
|
|
_ecore_evas_object_cursor_del, ee);
|
2015-02-06 14:54:08 -08:00
|
|
|
}
|
|
|
|
|
2012-11-07 08:12:14 -08:00
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
|
|
|
|
{
|
2012-11-07 08:12:18 -08:00
|
|
|
int x, y, fx, fy;
|
2015-09-28 10:42:38 -07:00
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
2014-04-02 04:29:03 -07:00
|
|
|
Evas_Object *old;
|
2014-06-25 10:20:13 -07:00
|
|
|
|
2015-01-05 06:09:02 -08:00
|
|
|
if (!ee) return;
|
2015-09-28 10:42:38 -07:00
|
|
|
wdata = ee->engine.data;
|
2014-04-02 04:29:03 -07:00
|
|
|
old = ee->prop.cursor.object;
|
|
|
|
if (obj == NULL)
|
2012-11-07 08:12:14 -08:00
|
|
|
{
|
2015-09-28 10:42:38 -07:00
|
|
|
ecore_wl2_window_pointer_set(wdata->win, NULL, 0, 0);
|
2012-11-07 08:12:14 -08:00
|
|
|
ee->prop.cursor.object = NULL;
|
|
|
|
ee->prop.cursor.layer = 0;
|
|
|
|
ee->prop.cursor.hot.x = 0;
|
|
|
|
ee->prop.cursor.hot.y = 0;
|
2014-04-02 04:29:03 -07:00
|
|
|
goto end;
|
2012-11-07 08:12:14 -08:00
|
|
|
}
|
2014-06-25 10:20:13 -07:00
|
|
|
|
2012-11-07 08:12:14 -08:00
|
|
|
ee->prop.cursor.object = obj;
|
|
|
|
ee->prop.cursor.layer = layer;
|
|
|
|
ee->prop.cursor.hot.x = hot_x;
|
|
|
|
ee->prop.cursor.hot.y = hot_y;
|
2014-06-25 10:20:13 -07:00
|
|
|
|
2014-06-25 10:11:16 -07:00
|
|
|
evas_pointer_output_xy_get(ee->evas, &x, &y);
|
|
|
|
|
2014-04-02 04:29:03 -07:00
|
|
|
if (obj != old)
|
|
|
|
{
|
2015-09-28 10:42:38 -07:00
|
|
|
ecore_wl2_window_pointer_set(wdata->win, NULL, 0, 0);
|
2014-04-02 04:29:03 -07:00
|
|
|
evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
|
|
|
|
evas_object_pass_events_set(ee->prop.cursor.object, 1);
|
|
|
|
if (evas_pointer_inside_get(ee->evas))
|
|
|
|
evas_object_show(ee->prop.cursor.object);
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
|
|
|
|
_ecore_evas_object_cursor_del, ee);
|
|
|
|
}
|
2014-06-25 10:20:13 -07:00
|
|
|
|
2012-11-07 08:12:18 -08:00
|
|
|
evas_output_framespace_get(ee->evas, &fx, &fy, NULL, NULL);
|
2014-06-25 10:20:13 -07:00
|
|
|
evas_object_move(ee->prop.cursor.object, x - fx - ee->prop.cursor.hot.x,
|
2012-11-07 08:12:18 -08:00
|
|
|
y - fy - ee->prop.cursor.hot.y);
|
2014-06-25 10:20:13 -07:00
|
|
|
|
2014-04-02 04:29:03 -07:00
|
|
|
end:
|
|
|
|
if ((old) && (obj != old))
|
|
|
|
{
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(old, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
|
|
|
|
evas_object_del(old);
|
|
|
|
}
|
2012-11-07 08:12:14 -08:00
|
|
|
}
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_layer_set(Ecore_Evas *ee, int layer)
|
|
|
|
{
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (!ee) return;
|
|
|
|
if (ee->prop.layer == layer) return;
|
|
|
|
if (layer < 1) layer = 1;
|
|
|
|
else if (layer > 255) layer = 255;
|
|
|
|
ee->prop.layer = layer;
|
2013-10-31 04:47:53 -07:00
|
|
|
_ecore_evas_wl_common_state_update(ee);
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2014-01-11 01:19:43 -08:00
|
|
|
_ecore_evas_wl_common_iconified_set(Ecore_Evas *ee, Eina_Bool on)
|
2012-10-08 07:09:53 -07:00
|
|
|
{
|
2014-08-23 06:00:04 -07:00
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (!ee) return;
|
2014-01-11 01:19:43 -08:00
|
|
|
ee->prop.iconified = on;
|
2014-08-23 06:00:04 -07:00
|
|
|
|
|
|
|
wdata = ee->engine.data;
|
2015-09-28 10:42:38 -07:00
|
|
|
ecore_wl2_window_iconified_set(wdata->win, on);
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
|
2013-05-08 15:18:55 -07:00
|
|
|
static void
|
|
|
|
_ecore_evas_wl_common_border_update(Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
|
|
|
|
|
|
|
wdata = ee->engine.data;
|
|
|
|
if (!wdata->frame)
|
|
|
|
return;
|
|
|
|
|
2013-11-14 04:45:33 -08:00
|
|
|
if ((ee->prop.borderless) || (ee->prop.fullscreen))
|
2013-05-08 15:18:55 -07:00
|
|
|
{
|
|
|
|
evas_object_hide(wdata->frame);
|
|
|
|
evas_output_framespace_set(ee->evas, 0, 0, 0, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-06-23 04:53:53 -07:00
|
|
|
int fx = 0, fy = 0, fw = 0, fh = 0;
|
|
|
|
|
2013-05-08 15:18:55 -07:00
|
|
|
evas_object_show(wdata->frame);
|
|
|
|
_ecore_evas_wl_common_frame_border_size_get(wdata->frame,
|
|
|
|
&fx, &fy, &fw, &fh);
|
|
|
|
evas_output_framespace_set(ee->evas, fx, fy, fw, fh);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2014-01-12 21:26:36 -08:00
|
|
|
_ecore_evas_wl_common_borderless_set(Ecore_Evas *ee, Eina_Bool on)
|
2013-05-08 15:18:55 -07:00
|
|
|
{
|
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
|
|
|
if (!ee) return;
|
2014-01-12 21:26:36 -08:00
|
|
|
if (ee->prop.borderless == on) return;
|
|
|
|
ee->prop.borderless = on;
|
2013-05-08 15:18:55 -07:00
|
|
|
|
|
|
|
_ecore_evas_wl_common_border_update(ee);
|
2013-10-31 04:47:53 -07:00
|
|
|
_ecore_evas_wl_common_state_update(ee);
|
2013-05-08 15:18:55 -07:00
|
|
|
}
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
void
|
2014-01-12 21:26:36 -08:00
|
|
|
_ecore_evas_wl_common_maximized_set(Ecore_Evas *ee, Eina_Bool on)
|
2012-10-08 07:09:53 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (!ee) return;
|
2014-01-12 21:26:36 -08:00
|
|
|
if (ee->prop.maximized == on) return;
|
2015-09-28 10:42:38 -07:00
|
|
|
|
2013-11-14 04:45:33 -08:00
|
|
|
wdata = ee->engine.data;
|
2015-09-28 10:42:38 -07:00
|
|
|
ecore_wl2_window_maximized_set(wdata->win, on);
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2014-01-12 21:26:36 -08:00
|
|
|
_ecore_evas_wl_common_fullscreen_set(Ecore_Evas *ee, Eina_Bool on)
|
2012-10-08 07:09:53 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (!ee) return;
|
2014-01-12 21:26:36 -08:00
|
|
|
if (ee->prop.fullscreen == on) return;
|
2015-09-28 10:42:38 -07:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
wdata = ee->engine.data;
|
2015-09-28 10:42:38 -07:00
|
|
|
ecore_wl2_window_fullscreen_set(wdata->win, on);
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_ignore_events_set(Ecore_Evas *ee, int ignore)
|
|
|
|
{
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (!ee) return;
|
|
|
|
ee->ignore_events = ignore;
|
|
|
|
/* NB: Hmmm, may need to pass this to ecore_wl_window in the future */
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-10-08 07:22:17 -07:00
|
|
|
_ecore_evas_wl_common_pre_render(Ecore_Evas *ee)
|
2012-10-08 07:09:53 -07:00
|
|
|
{
|
|
|
|
int rend = 0;
|
2012-10-08 07:22:17 -07:00
|
|
|
Eina_List *ll = NULL;
|
|
|
|
Ecore_Evas *ee2 = NULL;
|
2012-10-08 07:09:53 -07:00
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2015-01-05 09:13:43 -08:00
|
|
|
if (!ee) return 0;
|
2013-02-27 01:49:23 -08:00
|
|
|
if (ee->in_async_render)
|
|
|
|
{
|
|
|
|
/* EDBG("ee=%p is rendering asynchronously, skip", ee); */
|
|
|
|
return 0;
|
|
|
|
}
|
2012-10-08 07:22:17 -07:00
|
|
|
|
|
|
|
EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
|
2012-10-08 07:09:53 -07:00
|
|
|
{
|
2012-10-08 07:22:17 -07:00
|
|
|
if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
|
|
|
|
if (ee2->engine.func->fn_render)
|
|
|
|
rend |= ee2->engine.func->fn_render(ee2);
|
|
|
|
if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
|
|
|
|
}
|
2012-10-08 07:09:53 -07:00
|
|
|
|
2013-02-27 01:49:23 -08:00
|
|
|
if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
|
|
|
|
|
2012-10-08 07:22:17 -07:00
|
|
|
return rend;
|
|
|
|
}
|
2012-10-08 07:09:53 -07:00
|
|
|
|
2015-10-16 12:51:06 -07:00
|
|
|
static void
|
|
|
|
_anim_cb_animate(void *data, struct wl_callback *callback, uint32_t serial EINA_UNUSED)
|
|
|
|
{
|
2015-10-20 13:41:28 -07:00
|
|
|
Ecore_Evas *ee = data;
|
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
2015-10-16 12:51:06 -07:00
|
|
|
|
2015-10-20 13:41:28 -07:00
|
|
|
wdata = ee->engine.data;
|
2015-10-16 12:51:06 -07:00
|
|
|
wl_callback_destroy(callback);
|
|
|
|
wdata->anim_callback = NULL;
|
2015-10-20 13:41:28 -07:00
|
|
|
ecore_evas_manual_render_set(ee, 0);
|
2015-10-16 12:51:06 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static const struct wl_callback_listener _anim_listener =
|
|
|
|
{
|
|
|
|
_anim_cb_animate
|
|
|
|
};
|
|
|
|
|
2015-10-20 13:41:28 -07:00
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_render_pre(void *data, Evas *evas EINA_UNUSED, void *event EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Ecore_Evas *ee = data;
|
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
|
|
|
|
|
|
|
wdata = ee->engine.data;
|
2015-10-21 06:09:18 -07:00
|
|
|
wdata->anim_callback =
|
2015-10-21 09:51:43 -07:00
|
|
|
wl_surface_frame(ecore_wl2_window_surface_get(wdata->win));
|
2015-10-20 13:41:28 -07:00
|
|
|
wl_callback_add_listener(wdata->anim_callback, &_anim_listener, ee);
|
|
|
|
ecore_evas_manual_render_set(ee, 1);
|
|
|
|
}
|
|
|
|
|
2013-03-25 19:48:23 -07:00
|
|
|
void
|
2013-02-27 01:49:23 -08:00
|
|
|
_ecore_evas_wl_common_render_updates(void *data, Evas *evas EINA_UNUSED, void *event)
|
2013-01-28 11:45:41 -08:00
|
|
|
{
|
2013-03-25 19:48:23 -07:00
|
|
|
Evas_Event_Render_Post *ev = event;
|
|
|
|
Ecore_Evas *ee = data;
|
2013-01-28 11:45:41 -08:00
|
|
|
|
2013-03-25 19:48:23 -07:00
|
|
|
if (!(ee) || !(ev)) return;
|
2013-01-28 11:45:41 -08:00
|
|
|
|
2013-02-27 01:49:23 -08:00
|
|
|
ee->in_async_render = EINA_FALSE;
|
2013-01-28 11:45:41 -08:00
|
|
|
|
2013-05-06 10:48:03 -07:00
|
|
|
if (ee->delayed.alpha_changed)
|
|
|
|
{
|
|
|
|
_ecore_evas_wayland_alpha_do(ee, ee->delayed.alpha);
|
|
|
|
ee->delayed.alpha_changed = EINA_FALSE;
|
|
|
|
}
|
|
|
|
if (ee->delayed.transparent_changed)
|
|
|
|
{
|
|
|
|
_ecore_evas_wayland_transparent_do(ee, ee->delayed.transparent);
|
|
|
|
ee->delayed.transparent_changed = EINA_FALSE;
|
|
|
|
}
|
|
|
|
if (ee->delayed.rotation_changed)
|
|
|
|
{
|
|
|
|
_rotation_do(ee, ee->delayed.rotation, ee->delayed.rotation_resize);
|
|
|
|
ee->delayed.rotation_changed = EINA_FALSE;
|
|
|
|
}
|
2015-10-19 07:42:09 -07:00
|
|
|
|
|
|
|
_ecore_evas_wl_common_render_updates_process(ee, ev->updated_area);
|
2013-01-28 11:45:41 -08:00
|
|
|
}
|
|
|
|
|
2012-10-08 07:22:17 -07:00
|
|
|
void
|
|
|
|
_ecore_evas_wl_common_post_render(Ecore_Evas *ee)
|
|
|
|
{
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:22:17 -07:00
|
|
|
_ecore_evas_idle_timeout_update(ee);
|
|
|
|
if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
_ecore_evas_wl_common_render(Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
int rend = 0;
|
2013-02-27 01:49:23 -08:00
|
|
|
Eina_List *l;
|
|
|
|
Ecore_Evas *ee2;
|
2013-01-28 12:28:19 -08:00
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
2012-10-17 22:43:07 -07:00
|
|
|
|
2015-01-05 09:13:43 -08:00
|
|
|
if (!ee) return 0;
|
2013-02-27 01:49:23 -08:00
|
|
|
if (!(wdata = ee->engine.data)) return 0;
|
|
|
|
|
|
|
|
/* TODO: handle comp no sync */
|
|
|
|
|
|
|
|
if (ee->in_async_render) return 0;
|
2013-03-20 14:04:16 -07:00
|
|
|
if (!ee->visible)
|
|
|
|
{
|
|
|
|
evas_norender(ee->evas);
|
|
|
|
return 0;
|
|
|
|
}
|
2013-02-27 01:49:23 -08:00
|
|
|
|
|
|
|
EINA_LIST_FOREACH(ee->sub_ecore_evas, l, ee2)
|
2012-10-08 07:22:17 -07:00
|
|
|
{
|
2013-02-27 01:49:23 -08:00
|
|
|
if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
|
|
|
|
if (ee2->engine.func->fn_render)
|
|
|
|
rend |= ee2->engine.func->fn_render(ee2);
|
|
|
|
if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
2012-10-08 07:22:17 -07:00
|
|
|
|
2013-02-27 01:49:23 -08:00
|
|
|
if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
|
2013-01-28 12:28:19 -08:00
|
|
|
|
2013-02-27 01:49:23 -08:00
|
|
|
if (!ee->can_async_render)
|
2013-01-28 12:28:19 -08:00
|
|
|
{
|
2014-08-22 10:31:09 -07:00
|
|
|
Eina_List *updates;
|
|
|
|
|
|
|
|
updates = evas_render_updates(ee->evas);
|
|
|
|
rend = _ecore_evas_wl_common_render_updates_process(ee, updates);
|
|
|
|
evas_render_updates_free(updates);
|
2013-01-28 12:28:19 -08:00
|
|
|
}
|
2013-03-25 19:48:23 -07:00
|
|
|
else if (evas_render_async(ee->evas))
|
2013-02-27 01:49:23 -08:00
|
|
|
{
|
|
|
|
ee->in_async_render = EINA_TRUE;
|
|
|
|
rend = 1;
|
|
|
|
}
|
2014-08-22 10:31:09 -07:00
|
|
|
else if (ee->func.fn_post_render)
|
|
|
|
ee->func.fn_post_render(ee);
|
2013-02-27 01:49:23 -08:00
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
return rend;
|
|
|
|
}
|
|
|
|
|
2013-11-30 04:14:05 -08:00
|
|
|
void
|
2014-01-12 21:26:36 -08:00
|
|
|
_ecore_evas_wl_common_withdrawn_set(Ecore_Evas *ee, Eina_Bool on)
|
2013-11-30 04:14:05 -08:00
|
|
|
{
|
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2014-01-12 23:52:24 -08:00
|
|
|
if (ee->prop.withdrawn == on) return;
|
2013-12-04 12:50:19 -08:00
|
|
|
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.withdrawn = on;
|
2014-01-12 23:52:24 -08:00
|
|
|
|
|
|
|
if (on)
|
2013-11-30 04:14:05 -08:00
|
|
|
ecore_evas_hide(ee);
|
|
|
|
else
|
|
|
|
ecore_evas_show(ee);
|
2014-01-12 23:52:24 -08:00
|
|
|
|
2013-12-04 12:50:19 -08:00
|
|
|
_ecore_evas_wl_common_state_update(ee);
|
2013-11-30 04:14:05 -08:00
|
|
|
}
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
void
|
2015-09-28 10:42:38 -07:00
|
|
|
_ecore_evas_wl_common_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h)
|
2012-10-08 07:09:53 -07:00
|
|
|
{
|
2015-09-28 10:42:38 -07:00
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (x) *x = 0;
|
|
|
|
if (y) *y = 0;
|
2015-09-28 10:42:38 -07:00
|
|
|
|
|
|
|
wdata = ee->engine.data;
|
|
|
|
ecore_wl2_display_screen_size_get(wdata->display, w, h);
|
2012-10-08 07:09:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_wl_common_screen_dpi_get(const Ecore_Evas *ee EINA_UNUSED, int *xdpi, int *ydpi)
|
2012-10-08 07:09:53 -07:00
|
|
|
{
|
|
|
|
int dpi = 0;
|
|
|
|
|
2012-10-17 22:43:07 -07:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
if (xdpi) *xdpi = 0;
|
|
|
|
if (ydpi) *ydpi = 0;
|
2015-09-28 10:42:38 -07:00
|
|
|
|
2012-10-08 07:09:53 -07:00
|
|
|
/* FIXME: Ideally this needs to get the DPI from a specific screen */
|
2015-09-28 10:42:38 -07:00
|
|
|
|
|
|
|
/* TODO */
|
|
|
|
/* dpi = ecore_wl_dpi_get(); */
|
2012-10-08 07:09:53 -07:00
|
|
|
if (xdpi) *xdpi = dpi;
|
|
|
|
if (ydpi) *ydpi = dpi;
|
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_wayland_resize(Ecore_Evas *ee, int location)
|
|
|
|
{
|
|
|
|
if (!ee) return;
|
|
|
|
if (!strcmp(ee->driver, "wayland_shm"))
|
|
|
|
{
|
|
|
|
#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
|
|
|
|
_ecore_evas_wayland_shm_resize(ee, location);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
else if (!strcmp(ee->driver, "wayland_egl"))
|
|
|
|
{
|
|
|
|
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
|
|
|
_ecore_evas_wayland_egl_resize(ee, location);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-06 10:48:03 -07:00
|
|
|
static void
|
|
|
|
_ecore_evas_wayland_alpha_do(Ecore_Evas *ee, int alpha)
|
|
|
|
{
|
|
|
|
if (!ee) return;
|
|
|
|
if (!strcmp(ee->driver, "wayland_shm"))
|
|
|
|
{
|
|
|
|
#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
|
|
|
|
_ecore_evas_wayland_shm_alpha_do(ee, alpha);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_wayland_transparent_do(Ecore_Evas *ee, int transparent)
|
|
|
|
{
|
|
|
|
if (!ee) return;
|
|
|
|
if (!strcmp(ee->driver, "wayland_shm"))
|
|
|
|
{
|
|
|
|
#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
|
|
|
|
_ecore_evas_wayland_shm_transparent_do(ee, transparent);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_wayland_move(Ecore_Evas *ee, int x, int y)
|
|
|
|
{
|
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
|
|
|
|
|
|
|
if (!ee) return;
|
|
|
|
if (!strncmp(ee->driver, "wayland", 7))
|
|
|
|
{
|
|
|
|
wdata = ee->engine.data;
|
|
|
|
if (wdata->win)
|
2015-09-28 10:42:38 -07:00
|
|
|
ecore_wl2_window_move(wdata->win, x, y);
|
2012-12-05 13:15:42 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-09-30 07:58:13 -07:00
|
|
|
static void
|
|
|
|
_ecore_evas_wayland_type_set(Ecore_Evas *ee, int type)
|
|
|
|
{
|
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
2012-12-05 13:15:42 -08:00
|
|
|
|
2015-09-30 07:58:13 -07:00
|
|
|
if (!ee) return;
|
|
|
|
wdata = ee->engine.data;
|
2012-12-05 13:15:42 -08:00
|
|
|
|
2015-09-30 07:58:13 -07:00
|
|
|
ecore_wl2_window_type_set(wdata->win, type);
|
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
|
2015-09-30 07:58:13 -07:00
|
|
|
static Ecore_Wl2_Window *
|
|
|
|
_ecore_evas_wayland_window_get(const Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
2012-12-05 13:15:42 -08:00
|
|
|
|
2015-09-28 10:42:38 -07:00
|
|
|
if (!(!strncmp(ee->driver, "wayland", 7)))
|
|
|
|
return NULL;
|
|
|
|
|
2015-09-30 07:58:13 -07:00
|
|
|
wdata = ee->engine.data;
|
|
|
|
return wdata->win;
|
|
|
|
}
|
2013-06-05 20:30:40 -07:00
|
|
|
|
|
|
|
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
|
|
|
static void
|
|
|
|
_ecore_evas_wayland_pre_post_swap_callback_set(const Ecore_Evas *ee, void *data, void (*pre_cb) (void *data, Evas *e), void (*post_cb) (void *data, Evas *e))
|
|
|
|
{
|
|
|
|
Evas_Engine_Info_Wayland_Egl *einfo;
|
|
|
|
|
|
|
|
if (!(!strcmp(ee->driver, "wayland_egl"))) return;
|
|
|
|
|
|
|
|
if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas)))
|
|
|
|
{
|
|
|
|
einfo->callback.pre_swap = pre_cb;
|
|
|
|
einfo->callback.post_swap = post_cb;
|
|
|
|
einfo->callback.data = data;
|
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
|
|
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-09-28 10:42:38 -07:00
|
|
|
/* static void */
|
|
|
|
/* _ecore_evas_wayland_pointer_set(Ecore_Evas *ee EINA_UNUSED, int hot_x EINA_UNUSED, int hot_y EINA_UNUSED) */
|
|
|
|
/* { */
|
2012-12-05 13:15:42 -08:00
|
|
|
|
2015-09-28 10:42:38 -07:00
|
|
|
/* } */
|
2012-12-05 13:15:42 -08:00
|
|
|
|
|
|
|
Ecore_Evas_Interface_Wayland *
|
|
|
|
_ecore_evas_wl_interface_new(void)
|
|
|
|
{
|
|
|
|
Ecore_Evas_Interface_Wayland *iface;
|
|
|
|
|
|
|
|
iface = calloc(1, sizeof(Ecore_Evas_Interface_Wayland));
|
|
|
|
if (!iface) return NULL;
|
|
|
|
|
|
|
|
iface->base.name = interface_wl_name;
|
|
|
|
iface->base.version = interface_wl_version;
|
|
|
|
|
|
|
|
iface->resize = _ecore_evas_wayland_resize;
|
|
|
|
iface->move = _ecore_evas_wayland_move;
|
2015-09-28 10:42:38 -07:00
|
|
|
/* iface->pointer_set = _ecore_evas_wayland_pointer_set; */
|
2015-09-30 07:58:13 -07:00
|
|
|
iface->type_set = _ecore_evas_wayland_type_set;
|
2015-09-30 10:14:26 -07:00
|
|
|
iface->window_get2 = _ecore_evas_wayland_window_get;
|
2012-12-05 13:15:42 -08:00
|
|
|
|
2013-06-05 20:30:40 -07:00
|
|
|
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
|
|
|
iface->pre_post_swap_callback_set =
|
|
|
|
_ecore_evas_wayland_pre_post_swap_callback_set;
|
|
|
|
#endif
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
return iface;
|
|
|
|
}
|