* Ecore Msg sent to window manager to support accessibility features in virtual keyboard
Change-Id: Ifd98a2d903f5beb36ffa9df7307ded3d69ed98f9
Signed-off-by: Patryk Kaczmarek <patryk.k@samsung.com>
--- /dev/null
+#ifndef ELM_ACCESS_KEYBOARD_ADAPTER_H_
+#define ELM_ACCESS_KEYBOARD_ADAPTER_H_
+
+#include <Ecore.h>
+#include <Ecore_X.h>
+
+/**
+ * @brief Send ecore x message with elm access read action
+ *
+ * @param win keyboard window
+ * @param x x coordinate of gesture relative to X root window
+ * @param y y coordinate of gesture relative to X root window
+ *
+ */
+void elm_access_adaptor_emit_read(Ecore_X_Window win, int x, int y);
+
+/**
+ * @brief Send ecore x message with elm access activate action
+ *
+ * @param win keyboard window
+ * @param x x coordinate of gesture relative to X root window
+ * @param y y coordinate of gesture relative to X root window
+ *
+ */
+void elm_access_adaptor_emit_activate(Ecore_X_Window win, int x, int y);
+
+#endif
*/
void end_scroll(int x, int y);
+/**
+ * @brief Get top window object on which gesture occure
+ *
+ * @param x Gesture X coordinate
+ * @param y Gesture Y coordinate
+ *
+ * @return Ecore_X_Window Object which represents top window on which gesture occure
+ */
+Ecore_X_Window top_window_get (int x, int y);
#endif
%if "%{?tizen_profile_name}" == "tv"
export CFLAGS+=" -DSCREEN_READER_TV"
%endif
+export CFLAGS+=" -DELM_ACCESS_KEYBOARD"
rm -rf CMakeFiles CMakeCache.txt && cmake . -DCMAKE_INSTALL_PREFIX="%{AppInstallPath}" -DCMAKE_TARGET="%{Exec}" -DCMAKE_PACKAGE="%{name}"
make %{?jobs:-j%jobs} \
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "elm_access_adapter.h"
+#include "logger.h"
+
+static void
+_get_root_coords(Ecore_X_Window win, int *x, int *y)
+{
+ Ecore_X_Window root = ecore_x_window_root_first_get();
+ Ecore_X_Window parent = ecore_x_window_parent_get(win);
+ int wx, wy;
+
+ if (x) *x = 0;
+ if (y) *y = 0;
+
+ while (parent && (root != parent))
+ {
+ ecore_x_window_geometry_get(parent, &wx, &wy, NULL, NULL);
+ if (x) *x += wx;
+ if (y) *y += wy;
+ parent = ecore_x_window_parent_get(parent);
+ }
+}
+
+static void
+_send_ecore_x_client_msg (Ecore_X_Window win, int x, int y, Eina_Bool activate)
+{
+ int x_win, y_win;
+ long type;
+ _get_root_coords(win, &x_win, &y_win);
+ DEBUG("Window screen size:%d %d", x_win, y_win);
+ DEBUG("activate keyboard: %d %d", x, y);
+
+ if (activate)
+ type = ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ACTIVATE;
+ else
+ type = ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ;
+
+ 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);
+}
+void
+elm_access_adaptor_emit_activate (Ecore_X_Window win, int x, int y)
+{
+ _send_ecore_x_client_msg(win, x, y, EINA_TRUE);
+}
+
+void
+elm_access_adaptor_emit_read (Ecore_X_Window win, int x, int y)
+{
+ _send_ecore_x_client_msg(win, x, y, EINA_FALSE);
+}
#include "screen_reader_tts.h"
#include "screen_reader_gestures.h"
#include "dbus_gesture_adapter.h"
+#include "elm_access_adapter.h"
#define QUICKPANEL_DOWN TRUE
#define QUICKPANEL_UP FALSE
static void on_gesture_detected(void *data, Gesture_Info *info)
{
+
+#ifdef ELM_ACCESS_KEYBOARD
+ Ecore_X_Window keyboard_win = top_window_get(info->x_end, info->y_end);
+ if (keyboard_win && ecore_x_e_virtual_keyboard_get(keyboard_win))
+ {
+ DEBUG("Gesture is on virtural keyboard screen");
+ if (info->type == ONE_FINGER_SINGLE_TAP || info->type == ONE_FINGER_HOVER)
+ {
+ elm_access_adaptor_emit_read (keyboard_win, info->x_end, info->y_end);
+ return;
+ }
+ else if (info->type == ONE_FINGER_DOUBLE_TAP)
+ {
+ elm_access_adaptor_emit_activate (keyboard_win, info->x_end, info->y_end);
+ return;
+ }
+ }
+#endif
+
dbus_gesture_adapter_emit(info);
_on_auto_review_stop();
}
}
+Ecore_X_Window top_window_get (int x, int y)
+{
+ Ecore_X_Window wins[1] = { win };
+ Ecore_X_Window under = ecore_x_window_at_xy_with_skip_get(x, y, wins, sizeof(wins)/sizeof(wins[0]));
+ if (under)
+ {
+ _get_root_coords(under, &rx, &ry);
+ DEBUG("Recieved window with coords:%d %d", rx, ry);
+ return under;
+ }
+ return 0;
+}
+
void
start_scroll(int x, int y)
{
void *event)
{
Ecore_Event_Mouse_Button *ev = event;
- int x, y;
-
- if (ecore_x_e_virtual_keyboard_get(ev->window))
- {
- _get_root_coords(ev->window, &x, &y);
- ecore_x_mouse_in_send(ev->window, ev->x - x, ev->y - y);
- ecore_x_mouse_down_send(ev->window, ev->x - x, ev->y -y, 1);
- }
cov->n_taps++;
cov->event_time = ev->timestamp;
void *event)
{
Ecore_Event_Mouse_Button *ev = event;
- int x, y;
-
- if (ecore_x_e_virtual_keyboard_get(ev->window))
- {
- _get_root_coords(ev->window, &x, &y);
- ecore_x_mouse_out_send(ev->window, ev->x - x, ev->y - y);
- ecore_x_mouse_up_send(ev->window, ev->x - x, ev->y -y, 1);
- }
cov->n_taps--;
cov->event_time = ev->timestamp;
void *event)
{
Ecore_Event_Mouse_Move *ev = event;
- int x, y;
-
- if (ecore_x_e_virtual_keyboard_get(ev->window))
- {
- _get_root_coords(ev->window, &x, &y);
- ecore_x_window_geometry_get(ev->window, &x, &y, NULL, NULL);
- ecore_x_mouse_move_send(ev->window, ev->x - x, ev->y - y);
- }
cov->event_time = ev->timestamp;