forked from enlightenment/efl
Ecore_Evas (Wayland): Refactor code to match Ecore_Wayland changes.
NB: Fixes outstanding issues with running EFL apps as wayland clients. SVN revision: 68516
This commit is contained in:
parent
f3cf8efe47
commit
a31808b48b
|
@ -154,6 +154,11 @@ typedef struct _Ecore_Evas Ecore_Evas;
|
||||||
typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee); /**< Callback used for several ecore evas events @since 1.2 */
|
typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee); /**< Callback used for several ecore evas events @since 1.2 */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef _ECORE_WAYLAND_H_
|
||||||
|
#define _ECORE_WAYLAND_WINDOW_PREDEF
|
||||||
|
typedef struct _Ecore_Wl_Window Ecore_Wl_Window;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* module setup/shutdown calls */
|
/* module setup/shutdown calls */
|
||||||
|
|
||||||
EAPI int ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine);
|
EAPI int ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine);
|
||||||
|
@ -849,11 +854,13 @@ EAPI Ecore_Evas *ecore_evas_fb_new(const char *disp_name, int rotation, int
|
||||||
EAPI Ecore_Evas *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h);
|
EAPI Ecore_Evas *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h);
|
||||||
EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee);
|
EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee);
|
||||||
|
|
||||||
EAPI Ecore_Evas *ecore_evas_wayland_shm_new(const char *disp_name, int x, int y, int w, int h, int frame);
|
|
||||||
EAPI Ecore_Evas *ecore_evas_wayland_egl_new(const char *disp_name, int x, int y, int w, int h, int frame);
|
EAPI Ecore_Evas *ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame);
|
||||||
|
EAPI Ecore_Evas *ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame);
|
||||||
EAPI void ecore_evas_wayland_resize(Ecore_Evas *ee, int location);
|
EAPI void ecore_evas_wayland_resize(Ecore_Evas *ee, int location);
|
||||||
EAPI void ecore_evas_wayland_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source);
|
/* EAPI void ecore_evas_wayland_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source); */
|
||||||
EAPI void ecore_evas_wayland_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y);
|
/* EAPI void ecore_evas_wayland_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y); */
|
||||||
|
/* EAPI void ecore_evas_wayland_type_set(Ecore_Evas *ee, int type); */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Create a new @c Ecore_Evas canvas bound to the Evas
|
* @brief Create a new @c Ecore_Evas canvas bound to the Evas
|
||||||
|
|
|
@ -588,12 +588,13 @@ static Ecore_Evas *
|
||||||
_ecore_evas_constructor_wayland_shm(int x, int y, int w, int h, const char *extra_options)
|
_ecore_evas_constructor_wayland_shm(int x, int y, int w, int h, const char *extra_options)
|
||||||
{
|
{
|
||||||
char *disp_name = NULL;
|
char *disp_name = NULL;
|
||||||
unsigned int frame = 0;
|
unsigned int frame = 0, parent = 0;
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
|
|
||||||
_ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
|
_ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
|
||||||
_ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame);
|
_ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame);
|
||||||
ee = ecore_evas_wayland_shm_new(disp_name, x, y, w, h, frame);
|
_ecore_evas_parse_extra_options_uint(extra_options, "parent=", &parent);
|
||||||
|
ee = ecore_evas_wayland_shm_new(disp_name, parent, x, y, w, h, frame);
|
||||||
free(disp_name);
|
free(disp_name);
|
||||||
|
|
||||||
return ee;
|
return ee;
|
||||||
|
@ -605,12 +606,13 @@ static Ecore_Evas *
|
||||||
_ecore_evas_constructor_wayland_egl(int x, int y, int w, int h, const char *extra_options)
|
_ecore_evas_constructor_wayland_egl(int x, int y, int w, int h, const char *extra_options)
|
||||||
{
|
{
|
||||||
char *disp_name = NULL;
|
char *disp_name = NULL;
|
||||||
unsigned int frame = 0;
|
unsigned int frame = 0, parent = 0;
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
|
|
||||||
_ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
|
_ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
|
||||||
_ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame);
|
_ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame);
|
||||||
ee = ecore_evas_wayland_egl_new(disp_name, x, y, w, h, frame);
|
_ecore_evas_parse_extra_options_uint(extra_options, "parent=", &parent);
|
||||||
|
ee = ecore_evas_wayland_egl_new(disp_name, parent, x, y, w, h, frame);
|
||||||
free(disp_name);
|
free(disp_name);
|
||||||
|
|
||||||
return ee;
|
return ee;
|
||||||
|
@ -2844,64 +2846,10 @@ ecore_evas_wayland_resize(Ecore_Evas *ee, int location)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
|
||||||
ecore_evas_wayland_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source)
|
|
||||||
{
|
|
||||||
if ((!ee) || (!source)) return;
|
|
||||||
if (!ee->engine.wl.surface) return;
|
|
||||||
|
|
||||||
if (!strcmp(ee->driver, "wayland_shm"))
|
|
||||||
{
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
|
|
||||||
_ecore_evas_wayland_shm_drag_start(ee, drag_ee, source);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
else if (!strcmp(ee->driver, "wayland_egl"))
|
|
||||||
{
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
|
||||||
_ecore_evas_wayland_egl_drag_start(ee, drag_ee, source);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EAPI void
|
|
||||||
ecore_evas_wayland_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y)
|
|
||||||
{
|
|
||||||
if (!ee) return;
|
|
||||||
if (!ee->engine.wl.surface) return;
|
|
||||||
|
|
||||||
if (!strcmp(ee->driver, "wayland_shm"))
|
|
||||||
{
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
|
|
||||||
_ecore_evas_wayland_shm_pointer_set(ee, hot_x, hot_y);
|
|
||||||
// _ecore_evas_wayland_shm_drag_start(ee, drag_ee, source);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
else if (!strcmp(ee->driver, "wayland_egl"))
|
|
||||||
{
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
|
||||||
_ecore_evas_wayland_egl_pointer_set(ee, hot_x, hot_y);
|
|
||||||
// _ecore_evas_wayland_egl_drag_start(ee, drag_ee, source);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
EAPI void
|
EAPI void
|
||||||
ecore_evas_wayland_resize(Ecore_Evas *ee __UNUSED__, int location __UNUSED__)
|
ecore_evas_wayland_resize(Ecore_Evas *ee __UNUSED__, int location __UNUSED__)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
EAPI void
|
|
||||||
ecore_evas_wayland_drag_start(Ecore_Evas *ee __UNUSED__, Ecore_Evas *drag_ee __UNUSED__, void *source __UNUSED__)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
EAPI void
|
|
||||||
ecore_evas_wayland_pointer_set(Ecore_Evas *ee __UNUSED__, int hot_x __UNUSED__, int hot_y __UNUSED__)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -279,11 +279,20 @@ struct _Ecore_Evas_Engine
|
||||||
#if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
|
#if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
Ecore_Wl_Window *parent, *win;
|
||||||
Evas_Object *frame;
|
Evas_Object *frame;
|
||||||
|
|
||||||
struct wl_shell_surface *shell_surface;
|
# if defined(BUILD_ECORE_EVAS_WAYLAND_SHM)
|
||||||
struct wl_surface *surface;
|
|
||||||
struct wl_buffer *buffer;
|
struct wl_buffer *buffer;
|
||||||
|
# endif
|
||||||
|
# if defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
|
||||||
|
struct wl_egl_window *egl_window;
|
||||||
|
EGLSurface egl_surface;
|
||||||
|
# endif
|
||||||
|
/* struct wl_shell_surface *shell_surface; */
|
||||||
|
/* struct wl_surface *surface; */
|
||||||
|
/* struct wl_buffer *buffer; */
|
||||||
|
/* int type; */
|
||||||
} wl;
|
} wl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -424,12 +433,14 @@ int _ecore_evas_ews_shutdown(void);
|
||||||
void _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location);
|
void _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location);
|
||||||
void _ecore_evas_wayland_shm_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source);
|
void _ecore_evas_wayland_shm_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source);
|
||||||
void _ecore_evas_wayland_shm_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y);
|
void _ecore_evas_wayland_shm_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y);
|
||||||
|
void _ecore_evas_wayland_shm_type_set(Ecore_Evas *ee, int type);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
||||||
void _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location);
|
void _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location);
|
||||||
void _ecore_evas_wayland_egl_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source);
|
void _ecore_evas_wayland_egl_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source);
|
||||||
void _ecore_evas_wayland_egl_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y);
|
void _ecore_evas_wayland_egl_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y);
|
||||||
|
void _ecore_evas_wayland_egl_type_set(Ecore_Evas *ee, int type);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void _ecore_evas_fps_debug_init(void);
|
void _ecore_evas_fps_debug_init(void);
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include <config.h>
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#define LOGFNS 1
|
#define LOGFNS 1
|
||||||
|
|
||||||
#ifdef LOGFNS
|
#ifdef LOGFNS
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
|
@ -28,15 +28,15 @@
|
||||||
#include "Ecore_Evas.h"
|
#include "Ecore_Evas.h"
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
||||||
# include <wayland-egl.h>
|
|
||||||
# include <Evas_Engine_Wayland_Egl.h>
|
# include <Evas_Engine_Wayland_Egl.h>
|
||||||
# include <Ecore_Wayland.h>
|
# include <Ecore_Wayland.h>
|
||||||
|
|
||||||
/* local structures */
|
/* local structures */
|
||||||
typedef struct _EE_Wl_Smart_Data EE_Wl_Smart_Data;
|
typedef struct _EE_Wl_Smart_Data EE_Wl_Smart_Data;
|
||||||
struct _EE_Wl_Smart_Data
|
struct _EE_Wl_Smart_Data
|
||||||
{
|
{
|
||||||
Evas_Object *frame, *text;
|
Evas_Object *frame;
|
||||||
|
Evas_Object *text;
|
||||||
Evas_Coord x, y, w, h;
|
Evas_Coord x, y, w, h;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -51,36 +51,30 @@ static void _ecore_evas_wl_callback_delete_request_set(Ecore_Evas *ee, void (*fu
|
||||||
static void _ecore_evas_wl_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
static void _ecore_evas_wl_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
||||||
static void _ecore_evas_wl_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
static void _ecore_evas_wl_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
||||||
static void _ecore_evas_wl_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
static void _ecore_evas_wl_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
||||||
|
static void _ecore_evas_wl_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
||||||
static void _ecore_evas_wl_move(Ecore_Evas *ee, int x, int y);
|
static void _ecore_evas_wl_move(Ecore_Evas *ee, int x, int y);
|
||||||
static void _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h);
|
static void _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h);
|
||||||
static void _ecore_evas_wl_show(Ecore_Evas *ee);
|
static void _ecore_evas_wl_show(Ecore_Evas *ee);
|
||||||
static void _ecore_evas_wl_hide(Ecore_Evas *ee);
|
static void _ecore_evas_wl_hide(Ecore_Evas *ee);
|
||||||
static void _ecore_evas_wl_raise(Ecore_Evas *ee);
|
static void _ecore_evas_wl_raise(Ecore_Evas *ee);
|
||||||
static void _ecore_evas_wl_lower(Ecore_Evas *ee);
|
static void _ecore_evas_wl_title_set(Ecore_Evas *ee, const char *title);
|
||||||
static void _ecore_evas_wl_activate(Ecore_Evas *ee);
|
|
||||||
static void _ecore_evas_wl_title_set(Ecore_Evas *ee, const char *t);
|
|
||||||
static void _ecore_evas_wl_name_class_set(Ecore_Evas *ee, const char *n, const char *c);
|
static void _ecore_evas_wl_name_class_set(Ecore_Evas *ee, const char *n, const char *c);
|
||||||
static void _ecore_evas_wl_size_min_set(Ecore_Evas *ee, int w, int h);
|
static void _ecore_evas_wl_size_min_set(Ecore_Evas *ee, int w, int h);
|
||||||
static void _ecore_evas_wl_size_max_set(Ecore_Evas *ee, int w, int h);
|
static void _ecore_evas_wl_size_max_set(Ecore_Evas *ee, int w, int h);
|
||||||
static void _ecore_evas_wl_size_base_set(Ecore_Evas *ee, int w, int h);
|
static void _ecore_evas_wl_size_base_set(Ecore_Evas *ee, int w, int h);
|
||||||
static void _ecore_evas_wl_size_step_set(Ecore_Evas *ee, int w, int h);
|
static void _ecore_evas_wl_size_step_set(Ecore_Evas *ee, int w, int h);
|
||||||
static void _ecore_evas_wl_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y);
|
|
||||||
static void _ecore_evas_wl_object_cursor_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__);
|
|
||||||
static void _ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer);
|
static void _ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer);
|
||||||
static void _ecore_evas_wl_focus_set(Ecore_Evas *ee, int focus __UNUSED__);
|
|
||||||
static void _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify);
|
static void _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify);
|
||||||
static void _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max);
|
static void _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max);
|
||||||
static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full);
|
static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full);
|
||||||
static int _ecore_evas_wl_render(Ecore_Evas *ee);
|
static int _ecore_evas_wl_render(Ecore_Evas *ee);
|
||||||
static void _ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h);
|
static void _ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h);
|
||||||
|
|
||||||
static Eina_Bool _ecore_evas_wl_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event);
|
static Eina_Bool _ecore_evas_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event);
|
||||||
static Eina_Bool _ecore_evas_wl_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event);
|
static Eina_Bool _ecore_evas_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event);
|
||||||
static Eina_Bool _ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event);
|
static Eina_Bool _ecore_evas_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event);
|
||||||
static Eina_Bool _ecore_evas_wl_event_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event);
|
static Eina_Bool _ecore_evas_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event);
|
||||||
|
static Eina_Bool _ecore_evas_wl_cb_window_configure(void *data __UNUSED__, int type __UNUSED__, void *event);
|
||||||
static void _ecore_evas_wl_handle_configure(void *data, struct wl_shell_surface *shell_surface __UNUSED__, uint32_t timestamp __UNUSED__, uint32_t edges __UNUSED__, int32_t width, int32_t height);
|
|
||||||
static void _ecore_evas_wl_handle_popup_done(void *data __UNUSED__, struct wl_shell_surface *shell_surface __UNUSED__);
|
|
||||||
|
|
||||||
/* SMART stuff for frame */
|
/* SMART stuff for frame */
|
||||||
static Evas_Smart *_ecore_evas_wl_smart = NULL;
|
static Evas_Smart *_ecore_evas_wl_smart = NULL;
|
||||||
|
@ -96,102 +90,94 @@ static Evas_Object *_ecore_evas_wl_frame_add(Evas *evas);
|
||||||
|
|
||||||
/* local variables */
|
/* local variables */
|
||||||
static int _ecore_evas_wl_init_count = 0;
|
static int _ecore_evas_wl_init_count = 0;
|
||||||
static Ecore_Event_Handler *_ecore_evas_wl_event_handlers[4];
|
static Ecore_Event_Handler *_ecore_evas_wl_event_hdls[5];
|
||||||
|
|
||||||
static const struct wl_shell_surface_listener _ecore_evas_wl_shell_surface_listener =
|
|
||||||
{
|
|
||||||
_ecore_evas_wl_handle_configure,
|
|
||||||
_ecore_evas_wl_handle_popup_done
|
|
||||||
};
|
|
||||||
|
|
||||||
static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
|
static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
|
||||||
{
|
{
|
||||||
_ecore_evas_wl_free,
|
_ecore_evas_wl_free,
|
||||||
_ecore_evas_wl_callback_resize_set,
|
_ecore_evas_wl_callback_resize_set,
|
||||||
_ecore_evas_wl_callback_move_set,
|
_ecore_evas_wl_callback_move_set,
|
||||||
NULL, // callback show set
|
NULL,
|
||||||
NULL, // callback hide set
|
NULL,
|
||||||
_ecore_evas_wl_callback_delete_request_set,
|
_ecore_evas_wl_callback_delete_request_set,
|
||||||
NULL, // callback destroy set
|
NULL,
|
||||||
_ecore_evas_wl_callback_focus_in_set,
|
_ecore_evas_wl_callback_focus_in_set,
|
||||||
_ecore_evas_wl_callback_focus_out_set,
|
_ecore_evas_wl_callback_focus_out_set,
|
||||||
_ecore_evas_wl_callback_mouse_in_set,
|
_ecore_evas_wl_callback_mouse_in_set,
|
||||||
NULL, // callback mouse out set
|
_ecore_evas_wl_callback_mouse_out_set,
|
||||||
NULL, // callback sticky set
|
NULL, // sticky_set
|
||||||
NULL, // callback unsticky set
|
NULL, // unsticky_set
|
||||||
NULL, // callback pre render set
|
NULL, // pre_render_set
|
||||||
NULL, // callback post render set
|
NULL, // post_render_set
|
||||||
_ecore_evas_wl_move,
|
_ecore_evas_wl_move,
|
||||||
NULL, // func managed move
|
NULL, // managed_move
|
||||||
_ecore_evas_wl_resize,
|
_ecore_evas_wl_resize,
|
||||||
NULL, // _ecore_evas_wl_move_resize,
|
NULL, // move_resize
|
||||||
NULL, // func rotation set
|
NULL, // rotation_set
|
||||||
NULL, // func shaped set
|
NULL, // shaped_set
|
||||||
_ecore_evas_wl_show,
|
_ecore_evas_wl_show,
|
||||||
_ecore_evas_wl_hide,
|
_ecore_evas_wl_hide,
|
||||||
_ecore_evas_wl_raise,
|
_ecore_evas_wl_raise,
|
||||||
_ecore_evas_wl_lower,
|
NULL, // lower
|
||||||
_ecore_evas_wl_activate,
|
NULL, // activate
|
||||||
_ecore_evas_wl_title_set,
|
_ecore_evas_wl_title_set,
|
||||||
_ecore_evas_wl_name_class_set,
|
_ecore_evas_wl_name_class_set,
|
||||||
_ecore_evas_wl_size_min_set,
|
_ecore_evas_wl_size_min_set,
|
||||||
_ecore_evas_wl_size_max_set,
|
_ecore_evas_wl_size_max_set,
|
||||||
_ecore_evas_wl_size_base_set,
|
_ecore_evas_wl_size_base_set,
|
||||||
_ecore_evas_wl_size_step_set,
|
_ecore_evas_wl_size_step_set,
|
||||||
_ecore_evas_wl_object_cursor_set,
|
NULL, // object_cursor_set
|
||||||
_ecore_evas_wl_layer_set,
|
_ecore_evas_wl_layer_set,
|
||||||
_ecore_evas_wl_focus_set,
|
NULL, // focus set
|
||||||
_ecore_evas_wl_iconified_set,
|
_ecore_evas_wl_iconified_set,
|
||||||
NULL, // func borderless set
|
NULL, // borderless set
|
||||||
NULL, // func override set
|
NULL, // override set
|
||||||
_ecore_evas_wl_maximized_set,
|
_ecore_evas_wl_maximized_set,
|
||||||
_ecore_evas_wl_fullscreen_set,
|
_ecore_evas_wl_fullscreen_set,
|
||||||
NULL, // _ecore_evas_wl_avoid_damage_set,
|
NULL, // func avoid_damage set
|
||||||
NULL, // func withdrawn set
|
NULL, // func withdrawn set
|
||||||
NULL, // func sticky set
|
NULL, // func sticky set
|
||||||
NULL, // func ignore events set
|
NULL, // func ignore_events set
|
||||||
NULL, // func alpha set
|
NULL, // func alpha set
|
||||||
NULL, // func transparent set
|
NULL, // func transparent set
|
||||||
|
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
|
||||||
_ecore_evas_wl_render,
|
_ecore_evas_wl_render,
|
||||||
_ecore_evas_wl_screen_geometry_get
|
_ecore_evas_wl_screen_geometry_get
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
/* external variables */
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
/* external functions */
|
||||||
EAPI Ecore_Evas *
|
EAPI Ecore_Evas *
|
||||||
ecore_evas_wayland_egl_new(const char *disp_name, int x, int y, int w, int h, int frame)
|
ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame)
|
||||||
{
|
{
|
||||||
|
Ecore_Wl_Window *p = NULL;
|
||||||
Evas_Engine_Info_Wayland_Egl *einfo;
|
Evas_Engine_Info_Wayland_Egl *einfo;
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
int method = 0;
|
int method = 0;
|
||||||
static int _win_id = 1;
|
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (!(method = evas_render_method_lookup("wayland_egl")))
|
if (!(method = evas_render_method_lookup("wayland_egl")))
|
||||||
{
|
{
|
||||||
printf("Render method lookup failed for Wayland Egl");
|
ERR("Render method lookup failed for Wayland_Egl");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ecore_wl_init(disp_name))
|
if (!ecore_wl_init(disp_name))
|
||||||
{
|
{
|
||||||
printf("Failed to initialize Ecore Wayland");
|
ERR("Failed to initialize Ecore_Wayland");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(ee = calloc(1, sizeof(Ecore_Evas))))
|
if (!(ee = calloc(1, sizeof(Ecore_Evas))))
|
||||||
{
|
{
|
||||||
printf("Failed to allocate Ecore_Evas.");
|
ERR("Failed to allocate Ecore_Evas");
|
||||||
ecore_wl_shutdown();
|
ecore_wl_shutdown();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -208,17 +194,21 @@ ecore_evas_wayland_egl_new(const char *disp_name, int x, int y, int w, int h, in
|
||||||
if (w < 1) w = 1;
|
if (w < 1) w = 1;
|
||||||
if (h < 1) h = 1;
|
if (h < 1) h = 1;
|
||||||
|
|
||||||
ee->req.x = ee->x = x;
|
ee->x = x;
|
||||||
ee->req.y = ee->y = y;
|
ee->y = y;
|
||||||
ee->req.w = ee->w = w;
|
ee->w = w;
|
||||||
ee->req.h = ee->h = h;
|
ee->h = h;
|
||||||
|
ee->req.x = ee->x;
|
||||||
|
ee->req.y = ee->y;
|
||||||
|
ee->req.w = ee->w;
|
||||||
|
ee->req.h = ee->h;
|
||||||
ee->rotation = 0;
|
ee->rotation = 0;
|
||||||
ee->prop.max.w = ee->prop.max.h = 32767;
|
ee->prop.max.w = 32767;
|
||||||
|
ee->prop.max.h = 32767;
|
||||||
ee->prop.layer = 4;
|
ee->prop.layer = 4;
|
||||||
ee->prop.request_pos = 0;
|
ee->prop.request_pos = 0;
|
||||||
ee->prop.sticky = 0;
|
ee->prop.sticky = 0;
|
||||||
ee->prop.draw_frame = frame;
|
ee->prop.draw_frame = frame;
|
||||||
ee->prop.window = _win_id++;
|
|
||||||
|
|
||||||
ee->evas = evas_new();
|
ee->evas = evas_new();
|
||||||
evas_data_attach_set(ee->evas, ee);
|
evas_data_attach_set(ee->evas, ee);
|
||||||
|
@ -226,29 +216,40 @@ ecore_evas_wayland_egl_new(const char *disp_name, int x, int y, int w, int h, in
|
||||||
evas_output_size_set(ee->evas, ee->w, ee->h);
|
evas_output_size_set(ee->evas, ee->w, ee->h);
|
||||||
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
||||||
|
|
||||||
if (ee->prop.draw_frame)
|
/* FIXME: This needs to be set based on theme & scale */
|
||||||
|
if (ee->prop.draw_frame)
|
||||||
evas_output_framespace_set(ee->evas, 4, 18, 8, 22);
|
evas_output_framespace_set(ee->evas, 4, 18, 8, 22);
|
||||||
|
|
||||||
if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas)))
|
if (parent)
|
||||||
|
p = ecore_wl_window_find(parent);
|
||||||
|
|
||||||
|
ee->engine.wl.parent = p;
|
||||||
|
ee->engine.wl.win =
|
||||||
|
ecore_wl_window_new(p, x, y, w, h, ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW);
|
||||||
|
ee->prop.window = ee->engine.wl.win->id;
|
||||||
|
|
||||||
|
if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas)))
|
||||||
{
|
{
|
||||||
einfo->info.display = ecore_wl_display_get();
|
einfo->info.display = ecore_wl_display_get();
|
||||||
einfo->info.rotation = ee->rotation;
|
einfo->info.rotation = ee->rotation;
|
||||||
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
||||||
{
|
{
|
||||||
printf("Failed to set Evas Engine Info for '%s'.", ee->driver);
|
ERR("Failed to set Evas Engine Info for '%s'", ee->driver);
|
||||||
ecore_evas_free(ee);
|
ecore_evas_free(ee);
|
||||||
|
_ecore_evas_wl_shutdown();
|
||||||
|
ecore_wl_shutdown();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("Failed to get Evas Engine Info for '%s'.", ee->driver);
|
ERR("Failed to get Evas Engine Info for '%s'", ee->driver);
|
||||||
ecore_evas_free(ee);
|
ecore_evas_free(ee);
|
||||||
|
_ecore_evas_wl_shutdown();
|
||||||
|
ecore_wl_shutdown();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* NB: we need to be notified before 'free' so we can munmap the evas
|
|
||||||
* engine destination */
|
|
||||||
ecore_evas_callback_pre_free_set(ee, _ecore_evas_wl_pre_free);
|
ecore_evas_callback_pre_free_set(ee, _ecore_evas_wl_pre_free);
|
||||||
|
|
||||||
if (ee->prop.draw_frame)
|
if (ee->prop.draw_frame)
|
||||||
|
@ -274,25 +275,28 @@ ecore_evas_wayland_egl_new(const char *disp_name, int x, int y, int w, int h, in
|
||||||
|
|
||||||
/* local functions */
|
/* local functions */
|
||||||
static int
|
static int
|
||||||
_ecore_evas_wl_init(void)
|
_ecore_evas_wl_init(void)
|
||||||
{
|
{
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (++_ecore_evas_wl_init_count != 1)
|
if (++_ecore_evas_wl_init_count != 1)
|
||||||
return _ecore_evas_wl_init_count;
|
return _ecore_evas_wl_init_count;
|
||||||
|
|
||||||
_ecore_evas_wl_event_handlers[0] =
|
_ecore_evas_wl_event_hdls[0] =
|
||||||
ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_IN,
|
ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_IN,
|
||||||
_ecore_evas_wl_event_mouse_in, NULL);
|
_ecore_evas_wl_cb_mouse_in, NULL);
|
||||||
_ecore_evas_wl_event_handlers[1] =
|
_ecore_evas_wl_event_hdls[1] =
|
||||||
ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_OUT,
|
ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_OUT,
|
||||||
_ecore_evas_wl_event_mouse_out, NULL);
|
_ecore_evas_wl_cb_mouse_out, NULL);
|
||||||
_ecore_evas_wl_event_handlers[2] =
|
_ecore_evas_wl_event_hdls[2] =
|
||||||
ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_IN,
|
ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_IN,
|
||||||
_ecore_evas_wl_event_focus_in, NULL);
|
_ecore_evas_wl_cb_focus_in, NULL);
|
||||||
_ecore_evas_wl_event_handlers[3] =
|
_ecore_evas_wl_event_hdls[3] =
|
||||||
ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_OUT,
|
ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_OUT,
|
||||||
_ecore_evas_wl_event_focus_out, NULL);
|
_ecore_evas_wl_cb_focus_out, NULL);
|
||||||
|
_ecore_evas_wl_event_hdls[4] =
|
||||||
|
ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_CONFIGURE,
|
||||||
|
_ecore_evas_wl_cb_window_configure, NULL);
|
||||||
|
|
||||||
ecore_event_evas_init();
|
ecore_event_evas_init();
|
||||||
|
|
||||||
|
@ -300,7 +304,7 @@ _ecore_evas_wl_init(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_ecore_evas_wl_shutdown(void)
|
_ecore_evas_wl_shutdown(void)
|
||||||
{
|
{
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
|
|
||||||
|
@ -309,10 +313,10 @@ _ecore_evas_wl_shutdown(void)
|
||||||
if (--_ecore_evas_wl_init_count != 0)
|
if (--_ecore_evas_wl_init_count != 0)
|
||||||
return _ecore_evas_wl_init_count;
|
return _ecore_evas_wl_init_count;
|
||||||
|
|
||||||
for (i = 0; i < sizeof(_ecore_evas_wl_event_handlers) / sizeof(Ecore_Event_Handler *); i++)
|
for (i = 0; i < sizeof(_ecore_evas_wl_event_hdls) / sizeof(Ecore_Event_Handler *); i++)
|
||||||
{
|
{
|
||||||
if (_ecore_evas_wl_event_handlers[i])
|
if (_ecore_evas_wl_event_hdls[i])
|
||||||
ecore_event_handler_del(_ecore_evas_wl_event_handlers[i]);
|
ecore_event_handler_del(_ecore_evas_wl_event_hdls[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
ecore_event_evas_shutdown();
|
ecore_event_evas_shutdown();
|
||||||
|
@ -330,24 +334,16 @@ _ecore_evas_wl_pre_free(Ecore_Evas *ee)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_evas_wl_free(Ecore_Evas *ee)
|
_ecore_evas_wl_free(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (ee)
|
if (ee->engine.wl.win) ecore_wl_window_free(ee->engine.wl.win);
|
||||||
{
|
ee->engine.wl.win = NULL;
|
||||||
/* destroy shell surface */
|
|
||||||
if (ee->engine.wl.shell_surface)
|
|
||||||
wl_shell_surface_destroy(ee->engine.wl.shell_surface);
|
|
||||||
ee->engine.wl.shell_surface = NULL;
|
|
||||||
|
|
||||||
/* destroy surface */
|
ecore_event_window_unregister(ee->prop.window);
|
||||||
if (ee->engine.wl.surface) wl_surface_destroy(ee->engine.wl.surface);
|
ecore_evas_input_event_unregister(ee);
|
||||||
ee->engine.wl.surface = NULL;
|
|
||||||
|
|
||||||
ecore_event_window_unregister(ee->prop.window);
|
|
||||||
ecore_evas_input_event_unregister(ee);
|
|
||||||
}
|
|
||||||
_ecore_evas_wl_shutdown();
|
_ecore_evas_wl_shutdown();
|
||||||
ecore_wl_shutdown();
|
ecore_wl_shutdown();
|
||||||
}
|
}
|
||||||
|
@ -407,106 +403,90 @@ _ecore_evas_wl_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_evas_wl_move(Ecore_Evas *ee, int x, int y)
|
_ecore_evas_wl_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
|
||||||
|
{
|
||||||
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
|
if (!ee) return;
|
||||||
|
ee->func.fn_mouse_out = func;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_ecore_evas_wl_move(Ecore_Evas *ee, int x, int y)
|
||||||
{
|
{
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (!ee) return;
|
if (!ee) return;
|
||||||
// if ((ee->x == x) && (ee->y == y)) return;
|
|
||||||
ee->req.x = x;
|
ee->req.x = x;
|
||||||
ee->req.y = y;
|
ee->req.y = y;
|
||||||
|
|
||||||
ee->x = x;
|
ee->x = x;
|
||||||
ee->y = y;
|
ee->y = y;
|
||||||
if (ee->engine.wl.shell_surface)
|
if (ee->engine.wl.win) ecore_wl_window_move(ee->engine.wl.win, x, y);
|
||||||
{
|
|
||||||
wl_shell_surface_move(ee->engine.wl.shell_surface,
|
|
||||||
ecore_wl_input_device_get(),
|
|
||||||
ecore_wl_input_timestamp_get());
|
|
||||||
}
|
|
||||||
if (ee->func.fn_move) ee->func.fn_move(ee);
|
if (ee->func.fn_move) ee->func.fn_move(ee);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
|
_ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
|
||||||
{
|
{
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (!ee) return;
|
if (!ee) return;
|
||||||
if (w < 1) w = 1;
|
if (w < 1) w = 1;
|
||||||
if (h < 1) h = 1;
|
if (h < 1) h = 1;
|
||||||
if ((ee->w == w) && (ee->h == h)) return;
|
// if ((ee->w == w) && (ee->h == h)) return;
|
||||||
|
|
||||||
if (ee->prop.min.w > w) w = ee->prop.min.w;
|
if (ee->prop.min.w > w) w = ee->prop.min.w;
|
||||||
else if (w > ee->prop.max.w) w = ee->prop.max.w;
|
else if (w > ee->prop.max.w) w = ee->prop.max.w;
|
||||||
|
|
||||||
if (ee->prop.min.h > h) h = ee->prop.min.h;
|
if (ee->prop.min.h > h) h = ee->prop.min.h;
|
||||||
else if (h > ee->prop.max.h) h = ee->prop.max.h;
|
else if (h > ee->prop.max.h) h = ee->prop.max.h;
|
||||||
|
|
||||||
ee->req.w = w;
|
ee->req.w = w;
|
||||||
ee->req.h = h;
|
ee->req.h = h;
|
||||||
|
|
||||||
/* if (ee->visible) */
|
// ecore_wl_window_damage(ee->engine.wl.win, 0, 0, ee->w, ee->h);
|
||||||
/* { */
|
|
||||||
/* damage old surface, if it exists */
|
|
||||||
|
|
||||||
/* NB: This removes any lingering screen artifacts in the compositor.
|
|
||||||
* This may be a 'HACK' if the issue is actually in the wayland
|
|
||||||
* compositor, but for now lets implement this so we don't have screen
|
|
||||||
* artifacts laying around during a resize */
|
|
||||||
/* if (ee->engine.wl.surface) */
|
|
||||||
/* wl_surface_damage(ee->engine.wl.surface, 0, 0, ee->w, ee->h); */
|
|
||||||
/* } */
|
|
||||||
|
|
||||||
ee->w = w;
|
ee->w = w;
|
||||||
ee->h = h;
|
ee->h = h;
|
||||||
|
|
||||||
// ecore_wl_flush();
|
/* change evas output & viewport sizes */
|
||||||
|
|
||||||
evas_output_size_set(ee->evas, ee->w, ee->h);
|
evas_output_size_set(ee->evas, ee->w, ee->h);
|
||||||
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
||||||
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
||||||
if (ee->engine.wl.frame)
|
if (ee->engine.wl.frame)
|
||||||
evas_object_resize(ee->engine.wl.frame, ee->w, ee->h);
|
evas_object_resize(ee->engine.wl.frame, ee->w, ee->h);
|
||||||
|
|
||||||
/* if ((ee->visible) && (ee->engine.wl.surface)) */
|
/* set new engine destination */
|
||||||
/* wl_surface_damage(ee->engine.wl.surface, 0, 0, ee->w, ee->h); */
|
/* evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); */
|
||||||
|
|
||||||
|
/* ecore_wl_window_damage(ee->engine.wl.win, 0, 0, ee->w, ee->h); */
|
||||||
|
ecore_wl_flush();
|
||||||
|
|
||||||
|
ecore_wl_window_update_size(ee->engine.wl.win, ee->w, ee->h);
|
||||||
|
|
||||||
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_evas_wl_show(Ecore_Evas *ee)
|
_ecore_evas_wl_show(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
Evas_Engine_Info_Wayland_Egl *einfo;
|
Evas_Engine_Info_Wayland_Egl *einfo;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (!ee) return;
|
if ((!ee) || (ee->visible)) return;
|
||||||
if (ee->visible) return;
|
|
||||||
|
if (ee->engine.wl.win)
|
||||||
|
ecore_wl_window_show(ee->engine.wl.win);
|
||||||
|
|
||||||
einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
|
einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
|
||||||
|
if (!einfo)
|
||||||
/* create new surface */
|
{
|
||||||
ee->engine.wl.surface =
|
ERR("Failed to get Evas Engine Info for '%s'", ee->driver);
|
||||||
wl_compositor_create_surface(ecore_wl_compositor_get());
|
return;
|
||||||
wl_surface_set_user_data(ee->engine.wl.surface, (void *)ee->prop.window);
|
}
|
||||||
|
einfo->info.surface = ecore_wl_window_surface_get(ee->engine.wl.win);
|
||||||
/* create new shell surface */
|
|
||||||
ee->engine.wl.shell_surface =
|
|
||||||
wl_shell_get_shell_surface(ecore_wl_shell_get(), ee->engine.wl.surface);
|
|
||||||
|
|
||||||
/* set the engine surface here. This should trigger an egl window create */
|
|
||||||
einfo->info.surface = ee->engine.wl.surface;
|
|
||||||
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
|
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
|
||||||
|
|
||||||
/* add listener for configure events (happen on shell surface resize) */
|
|
||||||
wl_shell_surface_add_listener(ee->engine.wl.shell_surface,
|
|
||||||
&_ecore_evas_wl_shell_surface_listener, ee);
|
|
||||||
|
|
||||||
/* Raise this surface to the top */
|
|
||||||
wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
|
|
||||||
|
|
||||||
if (ee->engine.wl.frame)
|
if (ee->engine.wl.frame)
|
||||||
{
|
{
|
||||||
evas_object_show(ee->engine.wl.frame);
|
evas_object_show(ee->engine.wl.frame);
|
||||||
|
@ -515,36 +495,33 @@ _ecore_evas_wl_show(Ecore_Evas *ee)
|
||||||
|
|
||||||
ecore_wl_flush();
|
ecore_wl_flush();
|
||||||
|
|
||||||
|
/* ecore_wl_window_buffer_attach(ee->engine.wl.win, ee->engine.wl.buffer, 0, 0); */
|
||||||
|
|
||||||
ee->visible = 1;
|
ee->visible = 1;
|
||||||
if (ee->func.fn_show) ee->func.fn_show(ee);
|
if (ee->func.fn_show) ee->func.fn_show(ee);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_evas_wl_hide(Ecore_Evas *ee)
|
_ecore_evas_wl_hide(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
Evas_Engine_Info_Wayland_Egl *einfo;
|
Evas_Engine_Info_Wayland_Egl *einfo;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (!ee) return;
|
if ((!ee) || (!ee->visible)) return;
|
||||||
if (!ee->visible) return;
|
|
||||||
|
if (ee->engine.wl.win) ecore_wl_window_hide(ee->engine.wl.win);
|
||||||
|
|
||||||
/* get engine info */
|
|
||||||
einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
|
einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
|
||||||
einfo->info.surface = NULL;
|
if ((einfo) && (einfo->info.surface))
|
||||||
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
|
{
|
||||||
|
einfo->info.surface = NULL;
|
||||||
/* destroy shell surface */
|
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
|
||||||
if (ee->engine.wl.shell_surface)
|
}
|
||||||
wl_shell_surface_destroy(ee->engine.wl.shell_surface);
|
|
||||||
ee->engine.wl.shell_surface = NULL;
|
|
||||||
|
|
||||||
/* destroy surface */
|
|
||||||
if (ee->engine.wl.surface) wl_surface_destroy(ee->engine.wl.surface);
|
|
||||||
ee->engine.wl.surface = NULL;
|
|
||||||
|
|
||||||
ee->visible = 0;
|
ee->visible = 0;
|
||||||
ee->should_be_visible = 0;
|
ee->should_be_visible = 0;
|
||||||
|
|
||||||
if (ee->func.fn_hide) ee->func.fn_hide(ee);
|
if (ee->func.fn_hide) ee->func.fn_hide(ee);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -554,39 +531,18 @@ _ecore_evas_wl_raise(Ecore_Evas *ee)
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if ((!ee) || (!ee->visible)) return;
|
if ((!ee) || (!ee->visible)) return;
|
||||||
if (!ee->engine.wl.shell_surface) return;
|
ecore_wl_window_raise(ee->engine.wl.win);
|
||||||
wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_evas_wl_lower(Ecore_Evas *ee)
|
_ecore_evas_wl_title_set(Ecore_Evas *ee, const char *title)
|
||||||
{
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
||||||
|
|
||||||
if ((!ee) || (!ee->visible)) return;
|
|
||||||
/* FIXME: Need a way to tell Wayland to lower */
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_ecore_evas_wl_activate(Ecore_Evas *ee)
|
|
||||||
{
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
||||||
|
|
||||||
if ((!ee) || (!ee->visible)) return;
|
|
||||||
if (!ee->engine.wl.shell_surface) return;
|
|
||||||
wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_ecore_evas_wl_title_set(Ecore_Evas *ee, const char *t)
|
|
||||||
{
|
{
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (!ee) return;
|
if (!ee) return;
|
||||||
if (ee->prop.title) free(ee->prop.title);
|
if (ee->prop.title) free(ee->prop.title);
|
||||||
ee->prop.title = NULL;
|
ee->prop.title = NULL;
|
||||||
if (t) ee->prop.title = strdup(t);
|
if (title) ee->prop.title = strdup(title);
|
||||||
|
|
||||||
if ((ee->prop.draw_frame) && (ee->engine.wl.frame))
|
if ((ee->prop.draw_frame) && (ee->engine.wl.frame))
|
||||||
{
|
{
|
||||||
EE_Wl_Smart_Data *sd;
|
EE_Wl_Smart_Data *sd;
|
||||||
|
@ -663,51 +619,6 @@ _ecore_evas_wl_size_step_set(Ecore_Evas *ee, int w, int h)
|
||||||
ee->prop.step.h = h;
|
ee->prop.step.h = h;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
_ecore_evas_wl_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
|
|
||||||
{
|
|
||||||
int x = 0, y = 0;
|
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
||||||
|
|
||||||
if (!ee) return;
|
|
||||||
if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
|
|
||||||
ee->prop.cursor.object = NULL;
|
|
||||||
|
|
||||||
if (!obj)
|
|
||||||
{
|
|
||||||
ee->prop.cursor.layer = 0;
|
|
||||||
ee->prop.cursor.hot.x = 0;
|
|
||||||
ee->prop.cursor.hot.y = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ee->prop.cursor.object = obj;
|
|
||||||
ee->prop.cursor.layer = layer;
|
|
||||||
ee->prop.cursor.hot.x = hot_x;
|
|
||||||
ee->prop.cursor.hot.y = hot_y;
|
|
||||||
|
|
||||||
evas_pointer_output_xy_get(ee->evas, &x, &y);
|
|
||||||
evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
|
|
||||||
evas_object_move(ee->prop.cursor.object,
|
|
||||||
x - ee->prop.cursor.hot.x, y - ee->prop.cursor.hot.y);
|
|
||||||
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_wl_object_cursor_del, ee);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_ecore_evas_wl_object_cursor_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
|
|
||||||
{
|
|
||||||
Ecore_Evas *ee;
|
|
||||||
|
|
||||||
if (!(ee = data)) return;
|
|
||||||
ee->prop.cursor.object = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer)
|
_ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer)
|
||||||
{
|
{
|
||||||
|
@ -720,16 +631,6 @@ _ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer)
|
||||||
ee->prop.layer = layer;
|
ee->prop.layer = layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
_ecore_evas_wl_focus_set(Ecore_Evas *ee, int focus __UNUSED__)
|
|
||||||
{
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
||||||
|
|
||||||
if ((!ee) || (!ee->visible)) return;
|
|
||||||
if (!ee->engine.wl.shell_surface) return;
|
|
||||||
wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify)
|
_ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify)
|
||||||
{
|
{
|
||||||
|
@ -749,7 +650,7 @@ _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max)
|
||||||
if (!ee) return;
|
if (!ee) return;
|
||||||
if (ee->prop.maximized == max) return;
|
if (ee->prop.maximized == max) return;
|
||||||
ee->prop.maximized = max;
|
ee->prop.maximized = max;
|
||||||
/* FIXME: Implement this. Support is in Wayland now */
|
ecore_wl_window_maximized_set(ee->engine.wl.win, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -758,17 +659,13 @@ _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full)
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if ((!ee) || (!ee->visible)) return;
|
if ((!ee) || (!ee->visible)) return;
|
||||||
if (!ee->engine.wl.shell_surface) return;
|
if (ee->prop.fullscreen == full) return;
|
||||||
if (full)
|
ee->prop.fullscreen = full;
|
||||||
wl_shell_surface_set_fullscreen(ee->engine.wl.shell_surface,
|
ecore_wl_window_fullscreen_set(ee->engine.wl.win, full);
|
||||||
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
|
|
||||||
0, NULL);
|
|
||||||
else
|
|
||||||
wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_ecore_evas_wl_render(Ecore_Evas *ee)
|
_ecore_evas_wl_render(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
int rend = 0;
|
int rend = 0;
|
||||||
|
|
||||||
|
@ -792,26 +689,24 @@ _ecore_evas_wl_render(Ecore_Evas *ee)
|
||||||
|
|
||||||
if ((updates = evas_render_updates(ee->evas)))
|
if ((updates = evas_render_updates(ee->evas)))
|
||||||
{
|
{
|
||||||
/* if (ee->engine.wl.surface) */
|
Eina_List *l = NULL;
|
||||||
/* { */
|
Eina_Rectangle *r;
|
||||||
/* Eina_List *l = NULL; */
|
|
||||||
/* Eina_Rectangle *r; */
|
|
||||||
|
|
||||||
/* EINA_LIST_FOREACH(updates, l, r) */
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
/* wl_surface_damage(ee->engine.wl.surface, */
|
|
||||||
/* r->x, r->y, r->w, r->h); */
|
EINA_LIST_FOREACH(updates, l, r)
|
||||||
/* } */
|
ecore_wl_window_damage(ee->engine.wl.win,
|
||||||
|
r->x, r->y, r->w, r->h);
|
||||||
|
|
||||||
|
ecore_wl_flush();
|
||||||
|
|
||||||
evas_render_updates_free(updates);
|
evas_render_updates_free(updates);
|
||||||
_ecore_evas_idle_timeout_update(ee);
|
_ecore_evas_idle_timeout_update(ee);
|
||||||
rend = 1;
|
rend = 1;
|
||||||
|
|
||||||
ecore_wl_flush();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
|
if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
|
||||||
}
|
}
|
||||||
|
|
||||||
return rend;
|
return rend;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -825,8 +720,18 @@ _ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int
|
||||||
ecore_wl_screen_size_get(w, h);
|
ecore_wl_screen_size_get(w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location)
|
||||||
|
{
|
||||||
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
|
if (!ee) return;
|
||||||
|
if (ee->engine.wl.win)
|
||||||
|
ecore_wl_window_resize(ee->engine.wl.win, ee->w, ee->h, location);
|
||||||
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_ecore_evas_wl_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event)
|
_ecore_evas_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
Ecore_Wl_Event_Mouse_In *ev;
|
Ecore_Wl_Event_Mouse_In *ev;
|
||||||
|
@ -834,18 +739,18 @@ _ecore_evas_wl_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
ee = ecore_event_window_match(ev->window);
|
ee = ecore_event_window_match(ev->win);
|
||||||
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
|
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
|
||||||
if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
||||||
if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee);
|
if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee);
|
||||||
ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
|
ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
|
||||||
evas_event_feed_mouse_in(ee->evas, ev->time, NULL);
|
evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL);
|
||||||
_ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->time);
|
_ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp);
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_ecore_evas_wl_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event)
|
_ecore_evas_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
Ecore_Wl_Event_Mouse_Out *ev;
|
Ecore_Wl_Event_Mouse_Out *ev;
|
||||||
|
@ -853,19 +758,19 @@ _ecore_evas_wl_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
ee = ecore_event_window_match(ev->window);
|
ee = ecore_event_window_match(ev->win);
|
||||||
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
|
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
|
||||||
if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
||||||
ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
|
ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
|
||||||
_ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->time);
|
_ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp);
|
||||||
evas_event_feed_mouse_out(ee->evas, ev->time, NULL);
|
evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL);
|
||||||
if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
|
if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
|
||||||
if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
|
if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event)
|
_ecore_evas_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
Ecore_Wl_Event_Focus_In *ev;
|
Ecore_Wl_Event_Focus_In *ev;
|
||||||
|
@ -873,9 +778,9 @@ _ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void *
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
ee = ecore_event_window_match(ev->window);
|
ee = ecore_event_window_match(ev->win);
|
||||||
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
|
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
|
||||||
if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
||||||
ee->prop.focused = 1;
|
ee->prop.focused = 1;
|
||||||
evas_focus_in(ee->evas);
|
evas_focus_in(ee->evas);
|
||||||
if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
|
if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
|
||||||
|
@ -883,44 +788,51 @@ _ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void *
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_ecore_evas_wl_event_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event)
|
_ecore_evas_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
Ecore_Wl_Event_Focus_Out *ev;
|
Ecore_Wl_Event_Focus_In *ev;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
ee = ecore_event_window_match(ev->window);
|
ee = ecore_event_window_match(ev->win);
|
||||||
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
|
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
|
||||||
if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
||||||
evas_focus_out(ee->evas);
|
evas_focus_out(ee->evas);
|
||||||
ee->prop.focused = 0;
|
ee->prop.focused = 0;
|
||||||
if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
|
if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static Eina_Bool
|
||||||
_ecore_evas_wl_handle_configure(void *data, struct wl_shell_surface *shell_surface, uint32_t timestamp __UNUSED__, uint32_t edges __UNUSED__, int32_t width, int32_t height)
|
_ecore_evas_wl_cb_window_configure(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
|
Ecore_Wl_Event_Window_Configure *ev;
|
||||||
|
|
||||||
/* NB: Trap to prevent compositor from crashing */
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
if ((width <= 0) || (height <= 0)) return;
|
|
||||||
|
|
||||||
if (!(ee = data)) return;
|
ev = event;
|
||||||
|
ee = ecore_event_window_match(ev->win);
|
||||||
if ((shell_surface) && (ee->engine.wl.shell_surface))
|
if (!ee) return ECORE_CALLBACK_PASS_ON;
|
||||||
|
if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
||||||
|
if ((ee->x != ev->x) || (ee->y != ev->y))
|
||||||
{
|
{
|
||||||
if (ee->engine.wl.shell_surface != shell_surface) return;
|
ee->x = ev->x;
|
||||||
ecore_evas_resize(ee, width, height);
|
ee->y = ev->y;
|
||||||
|
ee->req.x = ee->x;
|
||||||
|
ee->req.y = ee->y;
|
||||||
|
if (ee->func.fn_move) ee->func.fn_move(ee);
|
||||||
|
}
|
||||||
|
if ((ee->req.w != ev->w) || (ee->req.h != ev->h))
|
||||||
|
{
|
||||||
|
ee->req.w = ev->w;
|
||||||
|
ee->req.h = ev->h;
|
||||||
|
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_ecore_evas_wl_handle_popup_done(void *data __UNUSED__, struct wl_shell_surface *shell_surface __UNUSED__)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1034,41 +946,9 @@ _ecore_evas_wl_frame_add(Evas *evas)
|
||||||
return evas_object_smart_add(evas, _ecore_evas_wl_smart);
|
return evas_object_smart_add(evas, _ecore_evas_wl_smart);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
_ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location)
|
|
||||||
{
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
||||||
|
|
||||||
if ((!ee) || (!ee->engine.wl.shell_surface)) return;
|
|
||||||
wl_shell_surface_resize(ee->engine.wl.shell_surface,
|
|
||||||
ecore_wl_input_device_get(),
|
|
||||||
ecore_wl_input_timestamp_get(), location);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
_ecore_evas_wayland_egl_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source)
|
|
||||||
{
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
||||||
|
|
||||||
if ((!ee) || (!ee->engine.wl.surface)) return;
|
|
||||||
if ((!source) || (!drag_ee)) return;
|
|
||||||
ecore_wl_drag_start(source, ee->engine.wl.surface, drag_ee->engine.wl.buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
_ecore_evas_wayland_egl_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y)
|
|
||||||
{
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
||||||
|
|
||||||
if ((!ee) || (!ee->engine.wl.surface)) return;
|
|
||||||
wl_input_device_attach(ecore_wl_input_device_get(),
|
|
||||||
ecore_wl_input_timestamp_get(),
|
|
||||||
ee->engine.wl.buffer, hot_x, hot_y);
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
EAPI Ecore_Evas *
|
EAPI Ecore_Evas *
|
||||||
ecore_evas_wayland_egl_new(const char *disp_name __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, int frame __UNUSED__)
|
ecore_evas_wayland_egl_new(const char *disp_name __UNUSED__, Ecore_Wl_Window *parent __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, Eina_Bool frame __UNUSED__)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue