ADD_DEFINITIONS("-DSCREEN_READER_TV")
ENDIF()
-IF("${X11_ENABLED}" STREQUAL "1")
- MESSAGE(STATUS "X11 is enabled")
- SET(CONDITIONAL_PACKAGES ${CONDITIONAL_PACKAGES} "ecore-x")
- ADD_DEFINITIONS("-DX11_ENABLED")
-ELSE()
- MESSAGE(STATUS "X11 is disabled - using wayland")
- SET(CONDITIONAL_PACKAGES ${CONDITIONAL_PACKAGES} "ecore-wayland")
-ENDIF()
+MESSAGE(STATUS "using wayland")
+SET(CONDITIONAL_PACKAGES ${CONDITIONAL_PACKAGES} "ecore-wayland")
+
INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED
+++ /dev/null
-#ifndef __ETEST_H__
-#define __ETEST_H__
-
-#include <Elementary.h>
-#include <Ecore_X.h>
-#include <Elementary.h>
-#include <Evas.h>
-
-struct appdata {
- Evas_Object *win;
-};
-
-#endif
/*
* @brief Creates listener and initializes eldbus.
*
- * @description If X Window System is enabled uses ecore libraries, otherwise registers
- * connection and interface for eldbus then sets callback for keyboard state change
+ * @description Registers connection and interface for eldbus then sets callback for keyboard state change
* @note Registers asynchronic listener on back button.
* @note Keyboard gesture recognition and broadcasting on dbus is unused and should be removed.
*/
*/
void keyboard_tracker_shutdown(KeyboardTrackerData *ktd);
-#ifndef X11_ENABLED
-
/*
* @brief Sets keyboard geometry
*
* @note there is no listeners for this signal, probably function is obsolete and should be removed
*/
void keyboard_signal_emit(KeyboardTrackerData *ktd, int type, int x, int y);
-#endif //X11_ENABLED
#endif //KEYBOARD_TRACKER_H_
BuildRequires: cmake
BuildRequires: pkgconfig(appcore-efl)
BuildRequires: pkgconfig(ecore)
-%if %{with x}
-BuildRequires: pkgconfig(ecore-x)
-%endif
-%if %{with wayland}
BuildRequires: pkgconfig(ecore-wayland)
-%endif
BuildRequires: pkgconfig(eina)
BuildRequires: pkgconfig(eldbus)
BuildRequires: pkgconfig(elementary)
%define DataDir %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE}%{!?TZ_SYS_RO_SHARE:/usr/share}
%define AppDir %{TZ_SYS_RO_APP}/%{name}
%define Exec screen-reader
-%bcond_with x
-%bcond_with wayland
rm -rf CMakeFiles CMakeCache.txt
-DCMAKE_PACKAGE="%{name}" \
-DTZ_SYS_RO_APP=%{TZ_SYS_RO_APP} \
-DTZ_SYS_RO_PACKAGES=%{TZ_SYS_RO_PACKAGES} \
-%if %{with x}
- -DX11_ENABLED=1 \
-%endif
-DSEC_FEATURE_TAPI_ENABLE=${SEC_FEATURE_TAPI_ENABLE}
make %{?jobs:-j%jobs} \
-DCMAKE_PACKAGE="%{name}" \
-DTZ_SYS_RO_APP=%{TZ_SYS_RO_APP} \
-DTZ_SYS_RO_PACKAGES=%{TZ_SYS_RO_PACKAGES} \
-%if %{with x}
- -DX11_ENABLED=1 \
-%endif
-DSEC_FEATURE_TAPI_ENABLE=${SEC_FEATURE_TAPI_ENABLE}
make %{?jobs:-j%jobs} \
}
}
}
-#ifndef X11_ENABLED
else if (!g_strcmp0(event->type, "object:bounds-changed")) {
AtspiRect *rect;
rect = (AtspiRect *)g_value_get_boxed(&event->any_data);
}
}
}
-#endif
else if (!g_strcmp0(event->type, "object:property-change:accessible-name") && object_has_highlighted_state(event->source)
&& (get_objects_attributes(event->source) & ACCESSIBLE_READING_INFO_TYPE_NAME)) {
gchar *name = atspi_accessible_get_name(event->source, NULL);
#include <atspi/atspi.h>
#include <Ecore.h>
#include <vconf.h>
-#ifdef X11_ENABLED
-#include <Ecore_X.h>
-#endif
-
#include <keyboard_tracker.h>
#include <logger.h>
#include <screen_reader_tts.h>
{
AtspiDeviceListener *listener;
AtspiDeviceListener *async_listener;
-#ifndef X11_ENABLED
Eldbus_Connection *conn;
Eldbus_Service_Interface *iface;
int keyboardX;
int keyboardW;
int keyboardH;
int prev_keyboard_state;
-#else
- Ecore_X_Virtual_Keyboard_State last_keyboard_state;
- Ecore_Event_Handler *root_xwindow_property_changed_hld;
- Ecore_Event_Handler *active_xwindow_property_changed_hld;
-#endif
};
-#ifndef X11_ENABLED
#define E_KEYBOARD_SERVICE_BUS_NAME "org.tizen.keyboard"
#define E_KEYBOARD_SERVICE_NAVI_IFC_NAME "org.tizen.KBGestureNavigation"
#define E_KEYBOARD_SERVICE_NAVI_OBJ_PATH "/org/tizen/KBGestureNavigation"
static const Eldbus_Service_Interface_Desc iface_desc = {
E_KEYBOARD_SERVICE_NAVI_IFC_NAME, NULL, signals
};
-#endif
-
-#ifdef X11_ENABLED
-static void _check_keyboard_state(KeyboardTrackerData *ktd, Ecore_X_Window keyboard_win)
-{
- Ecore_X_Virtual_Keyboard_State keyboard_state;
-
- if (!keyboard_win)
- return;
-
- keyboard_state = ecore_x_e_virtual_keyboard_state_get(keyboard_win);
- if (keyboard_state == ktd->last_keyboard_state)
- return;
-
- ktd->last_keyboard_state = keyboard_state;
-
- if (keyboard_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_ON) {
- tts_speak(_("IDS_IME_BODY_KEYBOARD_DISPLAYED_T_TTS"), EINA_FALSE);
- } else if (keyboard_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) {
- tts_speak(_("IDS_ACCS_BODY_KEYBOARD_HIDDEN_TTS"), EINA_FALSE);
- }
-}
-
-static Eina_Bool _active_xwindow_property_changed_cb(void *data, int type, void *event)
-{
- Ecore_X_Event_Window_Property *wp = (Ecore_X_Event_Window_Property *)event;
-
- KeyboardTrackerData *ktd = data;
-
- if (!ktd) {
- ERROR("input param");
- return EINA_FALSE;
- }
-
- if (!wp)
- return EINA_FALSE;
-
- if (wp->atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE) {
- DEBUG("keyboard state event");
- _check_keyboard_state(ktd, wp->win);
- }
-
- return EINA_TRUE;
-}
-
-static void active_xwindow_property_tracker_register(KeyboardTrackerData *ktd)
-{
- Ecore_X_Window active_window = 0;
- ecore_x_window_prop_xid_get(ecore_x_window_root_first_get(), ECORE_X_ATOM_NET_ACTIVE_WINDOW, ECORE_X_ATOM_WINDOW, &active_window, 1);
- if (active_window) {
- ecore_x_event_mask_set(active_window, ECORE_X_EVENT_MASK_WINDOW_PROPERTY);
- ktd->active_xwindow_property_changed_hld = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, _active_xwindow_property_changed_cb, ktd);
- }
-}
-
-static void active_xwindow_property_tracker_unregister(KeyboardTrackerData *ktd)
-{
- if (ktd->active_xwindow_property_changed_hld) {
- ecore_event_handler_del(ktd->active_xwindow_property_changed_hld);
- ktd->active_xwindow_property_changed_hld = NULL;
- }
-}
-
-static Eina_Bool _root_xwindow_property_changed_cb(void *data, int type, void *event)
-{
- Ecore_X_Event_Window_Property *wp;
- wp = (Ecore_X_Event_Window_Property *)event;
-
- KeyboardTrackerData *ktd = data;
-
- if (!data) {
- ERROR("input params");
- return EINA_FALSE;
- }
-
- if (!wp)
- return EINA_FALSE;
-
- if (wp->atom == ECORE_X_ATOM_NET_ACTIVE_WINDOW) {
- DEBUG("active window change");
- active_xwindow_property_tracker_unregister(ktd);
- active_xwindow_property_tracker_register(ktd);
- }
-
- return EINA_TRUE;
-}
-
-static void root_xwindow_property_tracker_register(KeyboardTrackerData *ktd)
-{
- Ecore_X_Window root_window;
-
- root_window = ecore_x_window_root_first_get();
- if (root_window) {
- ecore_x_event_mask_set(root_window, ECORE_X_EVENT_MASK_WINDOW_PROPERTY);
- ktd->root_xwindow_property_changed_hld = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, _root_xwindow_property_changed_cb, ktd);
- }
-}
-
-static void root_xwindow_property_tracker_unregister(KeyboardTrackerData *ktd)
-{
- if (ktd->root_xwindow_property_changed_hld) {
- ecore_event_handler_del(ktd->root_xwindow_property_changed_hld);
- ktd->root_xwindow_property_changed_hld = NULL;
- }
-}
-#endif
static gboolean async_keyboard_cb(const AtspiDeviceEvent *stroke, void *data)
{
DEBUG("AT-SPI DEVICE EVENT: ID(%d) STRING(%s) TYPE(%d) HW_CODE(%d) MODIFIERS(%d) TIMESTAMP(%d)", stroke->id, stroke->event_string, stroke->type, stroke->hw_code, stroke->modifiers, stroke->timestamp);
return NULL;
}
-#ifndef X11_ENABLED
ktd->keyboardX = 0;
ktd->keyboardY = 0;
ktd->keyboardW = 0;
ktd->keyboardH = 0;
ktd->prev_keyboard_state = VCONFKEY_ISF_INPUT_PANEL_STATE_HIDE;
-#endif
-
ktd->async_listener = atspi_device_listener_new(async_keyboard_cb, NULL, NULL);
if (ktd->async_listener == NULL) {
atspi_register_keystroke_listener(ktd->async_listener, NULL, 0, 1 << ATSPI_KEY_RELEASED_EVENT, ATSPI_KEYLISTENER_NOSYNC, NULL);
-#ifdef X11_ENABLED
- ktd->last_keyboard_state = ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF;
- active_xwindow_property_tracker_register(ktd);
- root_xwindow_property_tracker_register(ktd);
-#else
+
eldbus_init();
ktd->conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
return NULL;
}
_set_vconf_key_changed_callback_keyboard_status(ktd);
-#endif
+
DEBUG("keyboard tracker init");
return ktd;
atspi_deregister_keystroke_listener(ktd->listener, NULL, 0, 1 << ATSPI_KEY_PRESSED, NULL);
atspi_deregister_keystroke_listener(ktd->async_listener, NULL, 0, 1 << ATSPI_KEY_RELEASED_EVENT, NULL);
-#ifdef X11_ENABLED
- root_xwindow_property_tracker_unregister(ktd);
- active_xwindow_property_tracker_unregister(ktd);
-#else
eldbus_name_release(ktd->conn, E_KEYBOARD_SERVICE_BUS_NAME, NULL, NULL);
eldbus_connection_unref(ktd->conn);
eldbus_shutdown();
_unset_vconf_key_changed_callback_keyboard_status();
-#endif
DEBUG("keyboard tracker shutdown");
free(ktd);
}
-#ifndef X11_ENABLED
void keyboard_geometry_set(KeyboardTrackerData *ktd, int x, int y, int width, int height)
{
if (!ktd)
eldbus_service_signal_emit(ktd->iface, KB_GESTURE_SIGNAL, type, x, y);
}
-#endif
+
#include <stdio.h>
/*FIXME: remove this if usleep is not necessary */
#include <unistd.h>
-#ifdef X11_ENABLED
-#include <Ecore_X.h>
-#endif
#include <Ecore.h>
#include <math.h>
#include <atspi/atspi.h>
static void _send_highlighted_object_info(Navigator_Data *nd, AtspiAccessible *obj, Gesture_Info *info)
{
-#ifdef X11_ENABLED
- Ecore_X_Window keyboard_win;
-#else
Eina_Bool keyboard_status;
-#endif
Eldbus_Connection *conn;
Eldbus_Object *dobj;
Eldbus_Proxy *proxy;
highlighted_object_x = rect->x + rect->width / 2;
highlighted_object_y = rect->y + rect->height / 2;
}
-#if defined(ELM_ACCESS_KEYBOARD) && defined(X11_ENABLED)
- keyboard_win = top_window_get(info->x_end, info->y_end);
- if (keyboard_win && ecore_x_e_virtual_keyboard_get(keyboard_win)) {
- highlighted_object_x = info->x_end;
- highlighted_object_y = info->y_end;
- }
-#else
+
keyboard_status = keyboard_event_status(nd->keyboard_tracker_data, info->x_end, info->y_end);
if (keyboard_status) {
highlighted_object_x = info->x_end;
highlighted_object_y = info->y_end;
}
-#endif
eldbus_proxy_call(proxy, "HighlightedObjectInfo", NULL, NULL, -1, "ii", highlighted_object_x, highlighted_object_y);
}
-static void _quickpanel_change_state(gboolean quickpanel_switch)
-{
- DEBUG("START");
-#ifdef X11_ENABLED
- Ecore_X_Window xwin = 0;
-
- if (quickpanel_switch)
- DEBUG("QUICKPANEL STATE ON");
- else
- DEBUG("QUICKPANEL STATE OFF");
-
- Ecore_X_Illume_Quickpanel_State state;
-
- ecore_x_window_prop_xid_get(ecore_x_window_root_first_get(), ECORE_X_ATOM_NET_ACTIVE_WINDOW, ECORE_X_ATOM_WINDOW, &xwin, 1);
-
- state = quickpanel_switch ? ECORE_X_ILLUME_QUICKPANEL_STATE_ON : ECORE_X_ILLUME_QUICKPANEL_STATE_OFF;
-
- ecore_x_e_illume_quickpanel_state_set(xwin, state);
-
- ecore_x_e_illume_quickpanel_state_send(ecore_x_e_illume_zone_get(xwin), state);
-
- ecore_main_loop_iterate();
-#endif
-}
-
/**
* @brief Gets 'deepest' Scrollable accessible containing (x,y) point
*/
return EINA_FALSE;
}
-void start_scroll(int x, int y)
-{
-#ifdef X11_ENABLED
- 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]));
- _get_root_coords(under, &rx, &ry);
- ecore_x_mouse_in_send(under, x - rx, y - ry);
- ecore_x_window_focus(under);
- ecore_x_mouse_down_send(under, x - rx, y - ry, 1);
- scrolled_win = under;
-#endif
-}
-
-void continue_scroll(int x, int y)
-{
-#ifdef X11_ENABLED
- ecore_x_mouse_move_send(scrolled_win, x - rx, y - ry);
-#endif
-}
-
-void end_scroll(int x, int y)
-{
-#ifdef X11_ENABLED
- ecore_x_mouse_up_send(scrolled_win, x - rx, y - ry, 1);
- ecore_x_mouse_out_send(scrolled_win, x - rx, y - ry);
-#endif
-}
-
static void _move_slider(Navigator_Data *nd, Gesture_Info *gi)
{
DEBUG("ONE FINGER DOUBLE TAP AND HOLD");
}
AtspiAccessible *current_accessible = nd->current_obj;
-#ifdef X11_ENABLED
- Ecore_X_Window keyboard_win;
-#else
Eina_Bool keyboard_status;
-#endif
DEBUG("In _on_gestures_detected callback");
Gesture_Info *info = g_malloc0(sizeof(Gesture_Info));
if (!info) return;
return;
}
nd->last_hover_event_time = info->state != 1 ? -1 : info->event_time;
-#if defined(ELM_ACCESS_KEYBOARD) && defined(X11_ENABLED)
- keyboard_win = top_window_get(info->x_end, info->y_end);
- if (keyboard_win && ecore_x_e_virtual_keyboard_get(keyboard_win)) {
- elm_access_adaptor_emit_read(keyboard_win, info->x_end, info->y_end);
- break;
- }
-#else
keyboard_status = keyboard_event_status(nd->keyboard_tracker_data, info->x_end, info->y_end);
if (keyboard_status) {
keyboard_signal_emit(nd->keyboard_tracker_data, info->type, info->x_end, info->y_end);
to make highlight on keypad window. */
//break;
}
-#endif
_focus_widget(nd, info);
}
break;
}
break;
case ONE_FINGER_SINGLE_TAP:
-#if defined(ELM_ACCESS_KEYBOARD) && defined(X11_ENABLED)
- keyboard_win = top_window_get(info->x_end, info->y_end);
- if (keyboard_win && ecore_x_e_virtual_keyboard_get(keyboard_win)) {
- elm_access_adaptor_emit_read(keyboard_win, info->x_end, info->y_end);
- break;
- }
-#else
keyboard_status = keyboard_event_status(nd->keyboard_tracker_data, info->x_end, info->y_end);
if (keyboard_status) {
keyboard_signal_emit(nd->keyboard_tracker_data, info->type, info->x_end, info->y_end);
to make highlight on keypad window. */
//break;
}
-#endif
if (!nd->prepared)
_focus_widget(nd, info);
break;
case ONE_FINGER_DOUBLE_TAP:
-#if defined(ELM_ACCESS_KEYBOARD) && defined(X11_ENABLED)
- keyboard_win = top_window_get(info->x_end, info->y_end);
- if (keyboard_win && ecore_x_e_virtual_keyboard_get(keyboard_win)) {
- elm_access_adaptor_emit_activate(keyboard_win, info->x_end, info->y_end);
- break;
- }
-#else
keyboard_status = keyboard_event_status(nd->keyboard_tracker_data, info->x_end, info->y_end);
if (keyboard_status) {
keyboard_signal_emit(nd->keyboard_tracker_data, info->type, info->x_end, info->y_end);
if (!_current_highlight_on_keyboard_is(nd))
break;
}
-#endif
if (current_accessible == nd->current_obj)
_activate_widget(nd);
else
case THREE_FINGERS_FLICK_DOWN:
granularity_read_type_set(EINA_FALSE);
granularity_read_ui_popup_show();
-
- _quickpanel_change_state(QUICKPANEL_DOWN);
break;
case THREE_FINGERS_FLICK_UP:
granularity_read_type_set(EINA_TRUE);
granularity_read_ui_popup_show();
-
- _quickpanel_change_state(QUICKPANEL_UP);
break;
case ONE_FINGER_FLICK_LEFT_RETURN:
_direct_scroll_back(nd);
#include "logger.h"
#include "utils.h"
-#ifdef X11_ENABLED
-#include <Ecore_X.h>
-#include <Ecore_X_Atoms.h>
-#endif
-
static Window_Tracker_Cb user_cb;
static void *user_data;
static AtspiEventListener *listener;