2 * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
4 * Licensed under the Flora License, Version 1.1 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "elm_access_adapter.h"
21 static void _get_root_coords(Ecore_X_Window win, int *x, int *y)
23 Ecore_X_Window root = ecore_x_window_root_first_get();
24 Ecore_X_Window parent = ecore_x_window_parent_get(win);
32 while (parent && (root != parent)) {
33 ecore_x_window_geometry_get(parent, &wx, &wy, NULL, NULL);
38 parent = ecore_x_window_parent_get(parent);
41 static void _send_ecore_x_client_msg(Ecore_X_Window win, int x, int y, Eina_Bool activate)
45 _get_root_coords(win, &x_win, &y_win);
46 DEBUG("Window screen size:%d %d", x_win, y_win);
47 DEBUG("activate keyboard: %d %d", x, y);
50 type = ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ACTIVATE;
52 type = ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ;
54 ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL, ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, win, type, x - x_win, y - y_win, 0);
57 void elm_access_adaptor_emit_activate(Ecore_X_Window win, int x, int y)
59 _send_ecore_x_client_msg(win, x, y, EINA_TRUE);
62 void elm_access_adaptor_emit_read(Ecore_X_Window win, int x, int y)
64 _send_ecore_x_client_msg(win, x, y, EINA_FALSE);
67 void elm_access_adaptor_emit_activate(Ecore_Wl_Window *win, int x, int y)
72 void elm_access_adaptor_emit_read(Ecore_Wl_Window *win, int x, int y)