270, 0, 0, land_height, land_width);
*/
#else
- ecore_wl_window_rotation_geometry_set (elm_win_wl_window_get (_candidate_window),
+ ecore_wl2_window_rotation_geometry_set ((Ecore_Wl2_Window *)elm_win_wl_window_get (_candidate_window),
0, 0, 0, port_width, port_height);
- ecore_wl_window_rotation_geometry_set (elm_win_wl_window_get (_candidate_window),
+ ecore_wl2_window_rotation_geometry_set ((Ecore_Wl2_Window *)elm_win_wl_window_get (_candidate_window),
90, 0, 0, land_height, land_width);
- ecore_wl_window_rotation_geometry_set (elm_win_wl_window_get (_candidate_window),
+ ecore_wl2_window_rotation_geometry_set ((Ecore_Wl2_Window *)elm_win_wl_window_get (_candidate_window),
180, 0, 0, port_width, port_height);
- ecore_wl_window_rotation_geometry_set (elm_win_wl_window_get (_candidate_window),
+ ecore_wl2_window_rotation_geometry_set ((Ecore_Wl2_Window *)elm_win_wl_window_get (_candidate_window),
270, 0, 0, land_height, land_width);
#endif
}
270, 0, 0, _candidate_land_height_min, _candidate_land_width);
*/
#else
- ecore_wl_window_rotation_geometry_set (elm_win_wl_window_get (_candidate_window),
+ ecore_wl2_window_rotation_geometry_set ((Ecore_Wl2_Window *)elm_win_wl_window_get (_candidate_window),
0, 0, 0, _candidate_port_width, _candidate_port_height_min);
- ecore_wl_window_rotation_geometry_set (elm_win_wl_window_get (_candidate_window),
+ ecore_wl2_window_rotation_geometry_set ((Ecore_Wl2_Window *)elm_win_wl_window_get (_candidate_window),
90, 0, 0, _candidate_land_height_min, _candidate_land_width);
- ecore_wl_window_rotation_geometry_set (elm_win_wl_window_get (_candidate_window),
+ ecore_wl2_window_rotation_geometry_set ((Ecore_Wl2_Window *)elm_win_wl_window_get (_candidate_window),
180, 0, 0, _candidate_port_width, _candidate_port_height_min);
- ecore_wl_window_rotation_geometry_set (elm_win_wl_window_get (_candidate_window),
+ ecore_wl2_window_rotation_geometry_set ((Ecore_Wl2_Window *)elm_win_wl_window_get (_candidate_window),
270, 0, 0, _candidate_land_height_min, _candidate_land_width);
#endif
/* Add dim background */
ecore_x_window_size_get (ecore_x_window_root_first_get (), &scr_w, &scr_h);
}
#else
- ecore_wl_screen_size_get(&scr_w, &scr_h);
+ Ecore_Wl2_Display *wl2_display = ecore_wl2_connected_display_get(NULL);
+ if (wl2_display)
+ ecore_wl2_display_screen_size_get(wl2_display, &scr_w, &scr_h);
#endif
}
#include <Ecore.h>
#include <Ecore_Evas.h>
#include <Ecore_Input.h>
-#include <Ecore_Wayland.h>
+#define EFL_BETA_API_SUPPORT
+#include <Ecore_Wl2.h>
#include <dlog.h>
#include <wctype.h>
#include <app_common.h>
struct wl_text_input_manager *text_input_manager;
struct wl_text_input *text_input;
- Ecore_Wl_Window *window;
- Ecore_Wl_Input *input;
+ Ecore_Wl2_Window *window;
+ Ecore_Wl2_Input *input;
Evas *canvas;
char *preedit_text;
static void
reset_keyboard_geometry ()
{
- if (g_scr_w == 0 || g_scr_h == 0) {
- ecore_wl_sync();
- ecore_wl_screen_size_get(&g_scr_w, &g_scr_h);
+ Ecore_Wl2_Display *wl2_display = ecore_wl2_connected_display_get(NULL);
+ if (wl2_display && (g_scr_w == 0 || g_scr_h == 0)) {
+ ecore_wl2_sync();
+ ecore_wl2_display_screen_size_get(wl2_display, &g_scr_w, &g_scr_h);
}
_keyboard_geometry.x = 0;
_keyboard_geometry.y = g_scr_h;
static void _conformant_area_free (void *data EINA_UNUSED, void *ev)
{
- Ecore_Wl_Event_Conformant_Change *e = ev;
+ Ecore_Wl2_Event_Conformant_Change *e = ev;
free(e);
e = NULL;
}
-static void add_conformant_change_event(Ecore_Wl_Window *window)
+static void add_conformant_change_event(Ecore_Wl2_Window *window)
{
- Ecore_Wl_Event_Conformant_Change *ev;
- ev = calloc(1, sizeof(Ecore_Wl_Event_Conformant_Change));
+ Ecore_Wl2_Event_Conformant_Change *ev;
+ ev = calloc(1, sizeof(Ecore_Wl2_Event_Conformant_Change));
if (ev) {
- ev->win = ecore_wl_window_id_get(window);
+ ev->win = ecore_wl2_window_id_get(window);
ev->part_type = 1;
ev->state = 0;
- ecore_event_add(ECORE_WL_EVENT_CONFORMANT_CHANGE, ev, _conformant_area_free, NULL);
+ ecore_event_add(ECORE_WL2_EVENT_CONFORMANT_CHANGE, ev, _conformant_area_free, NULL);
}
}
{
Eina_Bool reset = EINA_FALSE;
Eina_Bool has_conformant = EINA_FALSE;
- Ecore_Wl_Window *window = NULL;
+ Ecore_Wl2_Window *window = NULL;
if (!ctx) return EINA_FALSE;
if (window) {
int x = 0, y = 0, w = 0, h = 0;
- Eina_Bool result = ecore_wl_window_keyboard_geometry_get(window, &x, &y, &w, &h);
+ Eina_Bool result = ecore_wl2_window_keyboard_geometry_get(window, &x, &y, &w, &h);
if (result) {
if (ecore_imf_context_client_canvas_get(ctx) && has_conformant && (w != 0 || h != 0)) {
}
LOGD("reset %d", reset);
if (reset) {
- ecore_wl_window_keyboard_geometry_set(window, 0, 0, 0, 0);
+ ecore_wl2_window_keyboard_geometry_set(window, 0, 0, 0, 0);
add_conformant_change_event(window);
{
Eina_Bool restore = EINA_FALSE;
Eina_Bool has_conformant = EINA_FALSE;
- Ecore_Wl_Window *window = NULL;
+ Ecore_Wl2_Window *window = NULL;
if (!ctx) return;
if (window) {
int x = 0, y = 0, w = 0, h = 0;
- Eina_Bool result = ecore_wl_window_keyboard_geometry_get(window, &x, &y, &w, &h);
+ Eina_Bool result = ecore_wl2_window_keyboard_geometry_get(window, &x, &y, &w, &h);
if (result) {
if (ecore_imf_context_client_canvas_get(ctx) && has_conformant && (w == 0 || h == 0)) {
}
LOGD("restore %d", restore);
if (restore) {
- ecore_wl_window_keyboard_geometry_set(window,
+ ecore_wl2_window_keyboard_geometry_set(window,
_conformant_area_backup.x, _conformant_area_backup.y,
_conformant_area_backup.w, _conformant_area_backup.h);
return EINA_FALSE;
}
- Ecore_Wl_Input *input = ecore_wl_window_keyboard_get(imcontext->window);
+ Ecore_Wl2_Input *input = ecore_wl2_window_input_get(imcontext->window);
if (!input) {
LOGW("ctx : %p, Can't get Wl_Input", ctx);
return EINA_FALSE;
}
- struct wl_seat *seat = ecore_wl_input_seat_get(input);
+ struct wl_seat *seat = ecore_wl2_input_seat_get(input);
if (!seat) {
LOGW("ctx : %p, Can't get Wl_seat", ctx);
return EINA_FALSE;
_focused_ctx = ctx;
wl_text_input_activate(imcontext->text_input, seat,
- ecore_wl_window_surface_get(imcontext->window));
+ ecore_wl2_window_surface_get(imcontext->window));
return EINA_TRUE;
}
// deactivate
if (imcontext->text_input)
wl_text_input_deactivate(imcontext->text_input,
- ecore_wl_input_seat_get(imcontext->input));
+ ecore_wl2_input_seat_get(imcontext->input));
if (ctx == _focused_ctx)
_focused_ctx = NULL;
static Eina_Bool _client_window_focus_out_cb(void *data, int ev_type, void *ev)
{
- Ecore_Wl_Event_Focus_Out *e = (Ecore_Wl_Event_Focus_Out *)ev;
+ Ecore_Wl2_Event_Focus_Out *e = (Ecore_Wl2_Event_Focus_Out *)ev;
Ecore_IMF_Context *ctx = (Ecore_IMF_Context *)data;
if (!ctx || !e) return ECORE_CALLBACK_PASS_ON;
WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get (ctx);
if (!imcontext || !imcontext->window) return ECORE_CALLBACK_PASS_ON;
- unsigned int client_win_id = ecore_wl_window_id_get (imcontext->window);
+ unsigned int client_win_id = ecore_wl2_window_id_get (imcontext->window);
- LOGD ("ctx : %p, client_window id : %#x, focus-out win : %#x", ctx, client_win_id, e->win);
+ LOGD ("ctx : %p, client_window id : %#x, focus-out win : %#x", ctx, client_win_id, e->window);
if (client_win_id > 0) {
- if (e->win == client_win_id) {
+ if (e->window == client_win_id) {
LOGD ("window focus out");
if (_focused_ctx == ctx) {
static Eina_Bool _conformant_change_cb(void *data, int ev_type, void *ev)
{
- Ecore_Wl_Event_Conformant_Change *e = (Ecore_Wl_Event_Conformant_Change *)ev;
+ Ecore_Wl2_Event_Conformant_Change *e = (Ecore_Wl2_Event_Conformant_Change *)ev;
Ecore_IMF_Context *ctx = (Ecore_IMF_Context *)data;
if (!e || !ctx) return ECORE_CALLBACK_PASS_ON;
if (_active_context_window_id != e->win)
return ECORE_CALLBACK_PASS_ON;
- Ecore_Wl_Window *window = ecore_wl_window_find(e->win);
+ Ecore_Wl2_Display *wl2_display = ecore_wl2_connected_display_get(NULL);
+ if (!wl2_display) return ECORE_CALLBACK_PASS_ON;
+
+ Ecore_Wl2_Window *window = ecore_wl2_display_window_find(wl2_display, e->win);
if (!window) return ECORE_CALLBACK_PASS_ON;
if (!(e->state)) {
LOGD("_conformant_reset_done = 0, registering _render_post_cb : %p %p", _active_context_canvas, window);
_conformant_reset_done = EINA_FALSE;
- if (_active_context_canvas && ecore_wl_window_conformant_get(window) && !_custom_conformant_event) {
+ if (_active_context_canvas && ecore_wl2_window_conformant_get(window) && !_custom_conformant_event) {
evas_event_callback_del(_active_context_canvas, EVAS_CALLBACK_RENDER_POST, _render_post_cb);
evas_event_callback_add(_active_context_canvas, EVAS_CALLBACK_RENDER_POST, _render_post_cb, ctx);
}
int x = 0, y = 0, w = 0, h = 0;
if (_TV) {
- /* TV IME consists of two or three windows, so ecore_wl_window_keyboard_geometry_get() may return wrong size. */
+ /* TV IME consists of two or three windows, so ecore_wl2_window_keyboard_geometry_get() may return wrong size. */
x = _keyboard_geometry.x, y = _keyboard_geometry.y, w = _keyboard_geometry.w, h = _keyboard_geometry.h;
if (_keyboard_geometry.w == 0 || _keyboard_geometry.h == 0) {
- result = ecore_wl_window_keyboard_geometry_get(window, &x, &y, &w, &h);
+ result = ecore_wl2_window_keyboard_geometry_get(window, &x, &y, &w, &h);
}
} else {
/* Since the input_panel_geometry is not delivered right at the moment, we use conformant geometry instead */
x = 0, y = 0, w = 0, h = 0;
- result = ecore_wl_window_keyboard_geometry_get(window, &x, &y, &w, &h);
+ result = ecore_wl2_window_keyboard_geometry_get(window, &x, &y, &w, &h);
}
if (result) {
Evas_Coord scr_w = 0, scr_h = 0;
- ecore_wl_sync();
- ecore_wl_screen_size_get(&scr_w, &scr_h);
- int rot = ecore_wl_window_rotation_get(window);
+ ecore_wl2_sync();
+ Ecore_Wl2_Display *wl2_display = ecore_wl2_connected_display_get(NULL);
+ if (wl2_display)
+ ecore_wl2_display_screen_size_get(wl2_display ,&scr_w, &scr_h);
+ int rot = ecore_wl2_window_rotation_get(window);
/* Assume we are using keyboard that has the same width to the screen width*/
switch (rot) {
case 90:
ignore_hide = EINA_TRUE;
- _win_focus_out_handler = ecore_event_handler_add (ECORE_WL_EVENT_FOCUS_OUT, _client_window_focus_out_cb, ctx);
+ _win_focus_out_handler = ecore_event_handler_add (ECORE_WL2_EVENT_FOCUS_OUT, _client_window_focus_out_cb, ctx);
_conformant_change_handler_del ();
- _conformant_change_handler = ecore_event_handler_add(ECORE_WL_EVENT_CONFORMANT_CHANGE, _conformant_change_cb, ctx);
+ _conformant_change_handler = ecore_event_handler_add(ECORE_WL2_EVENT_CONFORMANT_CHANGE, _conformant_change_cb, ctx);
// TIZEN_ONLY(20160217): ignore the duplicate show request
if ((_show_req_ctx == ctx) && _compare_context(_show_req_ctx, ctx) && (!will_hide)) {
_active_context_canvas = ecore_imf_context_client_canvas_get(ctx);
if (imcontext->window) {
- _active_context_window_id = ecore_wl_window_id_get(imcontext->window);
- imcontext->has_conformant = ecore_wl_window_conformant_get(imcontext->window);
+ _active_context_window_id = ecore_wl2_window_id_get(imcontext->window);
+ imcontext->has_conformant = ecore_wl2_window_conformant_get(imcontext->window);
} else {
imcontext->has_conformant = EINA_FALSE;
}
strncpy((char *)e->key, key, strlen(key));
strncpy((char *)e->string, string, strlen(string));
- e->window = (Ecore_Window)ecore_wl_window_id_get(imcontext->window);
- e->event_window = (Ecore_Window)ecore_wl_window_id_get(imcontext->window);
+ e->window = (Ecore_Window)ecore_wl2_window_id_get(imcontext->window);
+ e->event_window = (Ecore_Window)ecore_wl2_window_id_get(imcontext->window);
e->dev = _ime_device;
e->timestamp = 0; /* For distinguishing S/W keyboard event */
LOGD("Checking command : %s", command);
if (strncmp(command, szConformantReset, strlen(szConformantReset)) == 0) {
- Ecore_Wl_Window *window = imcontext->window;
+ Ecore_Wl2_Window *window = imcontext->window;
if (!window) return;
if (!reset_conformant_area(imcontext->ctx) && !_conformant_reset_started) {
_send_will_hide_ack(imcontext);
}
} else if (strncmp(command, szConformantRestore, strlen(szConformantRestore)) == 0) {
- Ecore_Wl_Window *window = imcontext->window;
+ Ecore_Wl2_Window *window = imcontext->window;
if (!window) return;
restore_conformant_area(imcontext->ctx);
LOGD("client window set (window: %p)", window);
if (imcontext && window) {
- imcontext->window = ecore_wl_window_find((Ecore_Window)window);
+ Ecore_Wl2_Display *wl2_display = ecore_wl2_connected_display_get(NULL);
+
+ if (wl2_display)
+ imcontext->window = ecore_wl2_display_window_find(wl2_display, (Ecore_Window)window);
if (_ime_device && imcontext->window)
- _device_info_send (ecore_wl_window_id_get (imcontext->window), EINA_TRUE);
+ _device_info_send (ecore_wl2_window_id_get (imcontext->window), EINA_TRUE);
}
}
LOGD("client canvas set (canvas: %p)", canvas);
if (imcontext && canvas) {
+ Ecore_Wl2_Display *wl2_display = ecore_wl2_connected_display_get(NULL);
imcontext->canvas = canvas;
- if (!imcontext->window)
- imcontext->window = ecore_wl_window_find(ecore_evas_window_get(ecore_evas_ecore_evas_get(canvas)));
+ if (wl2_display && !imcontext->window)
+ imcontext->window = ecore_wl2_display_window_find(wl2_display, ecore_evas_window_get(ecore_evas_ecore_evas_get(canvas)));
if (_ime_device && imcontext->window)
- _device_info_send (ecore_wl_window_id_get (imcontext->window), EINA_TRUE);
+ _device_info_send (ecore_wl2_window_id_get (imcontext->window), EINA_TRUE);
}
}
modifiers, (key_dev_name ? key_dev_name : ""), key_dev_class, key_dev_subclass);
//Waiting for filter_key_event_done from IME.
//This function should return IME filtering result with boolean type.
- struct wl_display *display = ecore_wl_display_get();
+ Ecore_Wl2_Display *wl2_display = ecore_wl2_connected_display_get(NULL);
+ struct wl_display *display = NULL;
+ if (wl2_display)
+ display = ecore_wl2_display_get(wl2_display);
+
if (display) {
while (ecore_time_get() - start_time < WAIT_FOR_FILTER_DONE_SECOND && _focused_ctx == ctx && wl_display_roundtrip(display) != -1) {
if (imcontext->last_key_event_filter.serial == serial) {
#include <Eina.h>
#include <Ecore.h>
-#include <Ecore_Wayland.h>
+#define EFL_BETA_API_SUPPORT
+#include <Ecore_Wl2.h>
#include <vconf.h>
#include <vconf-keys.h>
#include <input-method-client-protocol.h>
struct _WSCContextISFImpl {
WSCContextISF *parent;
- Ecore_Wl_Window *client_window;
+ Ecore_Wl2_Window *client_window;
Ecore_IMF_Input_Mode input_mode;
WideString surrounding_text;
WideString preedit_string;
static bool _need_wl_im_init = false;
static struct _wl_im *_wl_im_ctx = NULL;
-static int _ecore_wl_init_count = 0;
+static int _ecore_wl2_init_count = 0;
#define WAYLAND_MODULE_CLIENT_ID (0)
#define MAX_PREEDIT_BUFSIZE 4000
static bool
_wsc_setup (struct weescim *wsc)
{
- Eina_Inlist *globals;
+ Eina_Iterator *globals;
struct wl_registry *registry;
- Ecore_Wl_Global *global;
+ Ecore_Wl2_Global *global;
if (!wsc) return false;
- if (!(registry = ecore_wl_registry_get ())) {
+ Ecore_Wl2_Display *wl2_display = ecore_wl2_connected_display_get (NULL);
+ if (!wl2_display) {
+ LOGW ("failed to get wl2_display, try connecting");
+ wl2_display = ecore_wl2_display_connect (NULL);
+
+ if (!wl2_display) {
+ LOGW ("failed to connect");
+ return false;
+ }
+ }
+
+ if (!(registry = ecore_wl2_display_registry_get (wl2_display))) {
LOGW ("failed to get wl_registry");
return false;
}
- if (!(globals = ecore_wl_globals_get ())) {
+ if (!(globals = ecore_wl2_display_globals_get (wl2_display))) {
LOGW ("failed to get wl_globals");
return false;
}
- EINA_INLIST_FOREACH(globals, global) {
+ EINA_ITERATOR_FOREACH(globals, global) {
if (strcmp (global->interface, "wl_input_method") == 0)
wsc->im = (wl_input_method*)wl_registry_bind (registry, global->id, &wl_input_method_interface, 1);
}
+ eina_iterator_free (globals);
if (wsc->im == NULL) {
LOGW ("Failed because wl_input_method is null");
LOGD ("");
if (!_scim_initialized) {
- _ecore_wl_init_count = ecore_wl_init (NULL);
- if (_ecore_wl_init_count > 0) {
+ _ecore_wl2_init_count = ecore_wl2_init ();
+ if (_ecore_wl2_init_count > 0) {
initialize ();
_scim_initialized = true;
isf_wsc_input_panel_init ();
isf_wsc_input_panel_shutdown ();
finalize ();
- if (_ecore_wl_init_count > 0) {
- ecore_wl_shutdown ();
- _ecore_wl_init_count = 0;
+ if (_ecore_wl2_init_count > 0) {
+ Ecore_Wl2_Display *wl2_display = ecore_wl2_connected_display_get (NULL);
+ if (wl2_display) {
+ ecore_wl2_display_disconnect (wl2_display);
+ }
+ ecore_wl2_shutdown ();
+ _ecore_wl2_init_count = 0;
}
}
}
LOGD("%d,%d", filedes[0], filedes[1]);
if (wsc_ctx && wsc_ctx->im_ctx) {
wl_input_method_context_get_surrounding_text (wsc_ctx->im_ctx, UINT_MAX, UINT_MAX, filedes[1]);
- ecore_wl_flush ();
+ Ecore_Wl2_Display *wl2_display = ecore_wl2_connected_display_get (NULL);
+ if (wl2_display)
+ ecore_wl2_display_flush (wl2_display);
}
close (filedes[1]);
if (ic->im_ctx)
wl_input_method_context_get_surrounding_text (ic->im_ctx, maxlen_before, maxlen_after, filedes[1]);
- ecore_wl_flush ();
+ Ecore_Wl2_Display *wl2_display = ecore_wl2_connected_display_get (NULL);
+ if (wl2_display)
+ ecore_wl2_display_flush (wl2_display);
close (filedes[1]);
if (ic->surrounding_text_fd_read_handler) {
if (!ic) return;
wl_input_method_context_get_selection_text (ic->im_ctx, filedes[1]);
- ecore_wl_flush ();
+ Ecore_Wl2_Display *wl2_display = ecore_wl2_connected_display_get (NULL);
+ if (wl2_display)
+ ecore_wl2_display_flush (wl2_display);
close (filedes[1]);
if (ic->selection_text_fd_read_handler) {