#include "isf_debug.h"
#include "wayland_imcontext.h"
#include "tizen_profile.h"
+#include "isf_device_event.h"
#ifdef LOG_TAG
# undef LOG_TAG
WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(active_ctx);
if (imcontext && imcontext->input && imcontext->text_input) {
+ isf_device_type_e type = find_device_type_from_ecore_event(ECORE_EVENT_DETENT_ROTATE);
wl_text_input_process_input_device_event(imcontext->text_input,
- (unsigned int)ECORE_EVENT_DETENT_ROTATE, (char*)event, sizeof(Ecore_Event_Detent_Rotate));
+ (unsigned int)type, (char*)event, sizeof(Ecore_Event_Detent_Rotate));
}
return EINA_FALSE;
--- /dev/null
+/*
+ * ISF(Input Service Framework)
+ *
+ * ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable.
+ * Copyright (c) 2012-2017 Samsung Electronics Co., Ltd.
+ *
+ * Contact: Jihoon Kim <jihoon48.kim@samsung.com>, Ji-hoon Lee <dalton.lee@samsung.com>
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifndef __ISF_DEVICE_EVENT_H
+#define __ISF_DEVICE_EVENT_H
+
+#include <Ecore_Input.h>
+#include <Eina.h>
+
+/**
+ * @brief Enumeration of unconventional input devices
+ *
+ */
+typedef enum {
+ ISF_DEVICE_TYPE_CONVENTIONAL, /**< Conventional input device */
+ ISF_DEVICE_TYPE_UNKNOWN, /**< Undefined unconventional input device */
+ ISF_DEVICE_TYPE_ROTARY, /**< A rotary input device such as bezel that can be found on a wearable device */
+
+ ISF_DEVICE_TYPE_MAX /**< Note that this MAX variable is fixed at compile time */
+} isf_device_type_e;
+
+typedef struct {
+ int ecore_event_id;
+ isf_device_type_e device_type;
+} isf_device_type_conv_table;
+
+static isf_device_type_conv_table g_conv_table[ISF_DEVICE_TYPE_MAX] = {
+ { -1, ISF_DEVICE_TYPE_CONVENTIONAL },
+ { -1, ISF_DEVICE_TYPE_UNKNOWN },
+ { -1, ISF_DEVICE_TYPE_ROTARY },
+};
+static Eina_Bool g_conv_table_initalized = EINA_FALSE;
+
+static void initialize_conv_table()
+{
+ if (!g_conv_table_initalized) {
+ g_conv_table[ISF_DEVICE_TYPE_ROTARY].ecore_event_id = ECORE_EVENT_DETENT_ROTATE;
+ g_conv_table_initalized = EINA_TRUE;
+ }
+}
+
+static inline isf_device_type_e find_device_type_from_ecore_event(int ecore_event_id)
+{
+ initialize_conv_table();
+
+ isf_device_type_e device_type = ISF_DEVICE_TYPE_UNKNOWN;
+ for (unsigned int loop = 0; loop < sizeof(g_conv_table) / sizeof(isf_device_type_conv_table); loop++) {
+ if (g_conv_table[loop].ecore_event_id == ecore_event_id) {
+ device_type = g_conv_table[loop].device_type;
+ }
+ }
+ return device_type;
+}
+
+static inline int find_ecore_event_from_device_type(isf_device_type_e device_type)
+{
+ initialize_conv_table();
+
+ int ecore_event = -1;
+ for (unsigned int loop = 0; loop < sizeof(g_conv_table) / sizeof(isf_device_type_conv_table); loop++) {
+ if (g_conv_table[loop].device_type == device_type) {
+ ecore_event = g_conv_table[loop].ecore_event_id;
+ }
+ }
+ return ecore_event;
+}
+
+#endif /* __ISF_DEVICE_EVENT_H */
+
+/*
+vi:ts=4:expandtab:nowrap
+*/
#ifdef HAVE_PKGMGR_INFO
#include <pkgmgr-info.h>
#endif // HAVE_PKGMGR_INFO
+#include "isf_device_event.h"
#ifdef LOG_TAG
# undef LOG_TAG
{
MessageItemProcessInputDeviceEvent *subclass = static_cast<MessageItemProcessInputDeviceEvent*>(message);
uint32 ret = 0;
+ unsigned int ecore_event_id = find_ecore_event_from_device_type((isf_device_type_e)(subclass->get_type_ref()));
m_impl->signal_process_input_device_event(this,
- subclass->get_type_ref(), *(subclass->get_data_ptr()), subclass->get_len_ref(), ret);
+ ecore_event_id, *(subclass->get_data_ptr()), subclass->get_len_ref(), ret);
break;
}
case SCIM_TRANS_CMD_SET_AUTOCAPITAL_TYPE: