# Process this file with autoconf to produce a configure script
#AC_INIT(scim, 1.4.7, suzhe@tsinghua.org.cn)
-AC_INIT(isf, 3.0.158, isf@samsung.com)
+AC_INIT(isf, 3.0.165, isf@samsung.com)
AC_CONFIG_SRCDIR([ism/src/scim.h])
###########################################################
# ISF version
ISF_MAJOR_VERSION=3
ISF_MINOR_VERSION=0
-ISF_MICRO_VERSION=158
+ISF_MICRO_VERSION=165
ISF_VERSION=$ISF_MAJOR_VERSION.$ISF_MINOR_VERSION.$ISF_MICRO_VERSION
isf_panel_efl_CXXFLAGS = @ECOREX_CFLAGS@ \
@ECORE_WL_CFLAGS@ \
+ @EINA_CFLAGS@ \
@EDJE_CFLAGS@ \
@ELEMENTARY_CFLAGS@ \
@VCONF_CFLAGS@ \
isf_panel_efl_LDFLAGS = @LTLIBINTL@ -rpath $(libdir) \
@ECOREX_LIBS@ \
@ECORE_WL_LIBS@ \
+ @EINA_LIBS@ \
@EDJE_LIBS@ \
@ELEMENTARY_LIBS@ \
@VCONF_LIBS@ \
#include <stdlib.h>
#include <string.h>
#include <glib.h>
+#include <Eina.h>
#include <Evas.h>
#include <Ecore.h>
#include <malloc.h>
#include <math.h>
#include <Ecore_Wayland.h>
#include <xkbcommon/xkbcommon.h>
+#include "isf_debug.h"
#ifdef LOG_TAG
# undef LOG_TAG
-I$(top_srcdir)/ism/intl \
-I$(top_srcdir)/ism/utils \
-I$(includedir) \
+ -DSCIM_LIBEXECDIR=\"@SCIM_LIBEXECDIR@\" \
@ISF_BUILDING_DLL@
CONFIG_IMEPARSER_MODULE = libimeparser.la
#define EXPORT_API __attribute__((visibility("default")))
#endif
-#define SCIM_HELPER_LAUNCHER_PROGRAM "/usr/lib/scim-1.0/scim-helper-launcher"
+#define SCIM_HELPER_LAUNCHER_PROGRAM (SCIM_LIBEXECDIR "/scim-helper-launcher")
#ifdef LOG_TAG
#undef LOG_TAG
static Eina_Bool _custom_conformant_event = EINA_FALSE;
static Eina_Bool _received_will_hide_event = EINA_FALSE;
static Eina_Bool _conformant_reset_done = EINA_FALSE;
+static Eina_Bool _conformant_reset_started = EINA_FALSE;
static Evas *_active_context_canvas = NULL;
static unsigned int _active_context_window_id = 0;
break;
}
- if (imcontext->cursor_position == 0)
- return EINA_TRUE;
-
if (imcontext->preedit_text && strcmp (imcontext->preedit_text, "") != 0)
return EINA_FALSE;
+ if (imcontext->cursor_position == 0)
+ return EINA_TRUE;
+
ecore_imf_context_surrounding_get (ctx, &plain_str, &cursor_pos);
if (!plain_str) goto done;
ev->state = 0;
ecore_event_add(ECORE_WL_EVENT_CONFORMANT_CHANGE, ev, NULL, NULL);
}
+
+ _conformant_reset_started = EINA_TRUE;
}
return reset;
ev->state = 0;
ecore_event_add(ECORE_WL_EVENT_CONFORMANT_CHANGE, ev, NULL, NULL);
}
+ _conformant_reset_started = EINA_FALSE;
}
}
Ecore_IMF_Context *ctx = (Ecore_IMF_Context *)data;
_send_input_panel_hide_request(ctx);
- if (!reset_conformant_area(ctx)) {
+ if (!reset_conformant_area(ctx) && !_conformant_reset_started) {
LOGD("No need to reset conformant, sending ACK right away");
_send_will_hide_ack((WaylandIMContext *)ecore_imf_context_data_get(ctx));
}
if (!ctx) return;
will_hide = EINA_TRUE;
+ _conformant_reset_started = EINA_FALSE;
if (instant || (_hide_timer && ecore_timer_pending_get(_hide_timer) <= 0.0)) {
_clear_hide_timer();
_send_input_panel_hide_request(ctx);
- if (!reset_conformant_area(ctx)) {
+ if (!reset_conformant_area(ctx) && !_conformant_reset_started) {
LOGD("No need to reset conformant, sending ACK right away");
_send_will_hide_ack((WaylandIMContext *)ecore_imf_context_data_get(ctx));
}
}
}
-static void
+static Eina_Bool
set_focus(Ecore_IMF_Context *ctx)
{
LOGD("");
WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
- if (!imcontext) return;
+ if (!imcontext) return EINA_FALSE;
if (!imcontext->window) {
LOGW("window is not given\n");
- return;
+ return EINA_FALSE;
}
Ecore_Wl_Input *input = ecore_wl_window_keyboard_get(imcontext->window);
if (!input) {
LOGW("Can't get Wl_Input\n");
- return;
+ return EINA_FALSE;
}
struct wl_seat *seat = ecore_wl_input_seat_get(input);
if (!seat) {
LOGW("Can't get Wl_seat\n");
- return;
+ return EINA_FALSE;
}
imcontext->input = input;
wl_text_input_activate(imcontext->text_input, seat,
ecore_wl_window_surface_get(imcontext->window));
+
+ return EINA_TRUE;
}
static void
{
void *callback = evas_event_callback_del(e, EVAS_CALLBACK_RENDER_POST, _render_post_cb);
_conformant_reset_done = EINA_TRUE;
+ _conformant_reset_started = EINA_FALSE;
LOGD("[_render_post_cb], _conformant_reset_done = 1 , %p\n", callback);
send_will_hide_ack(NULL);
}
LOGD("_conformant_reset_done = 0, registering _render_post_cb : %p %p\n", _active_context_canvas, window);
_conformant_reset_done = EINA_FALSE;
if (_active_context_canvas && ecore_wl_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);
}
} else {
if ((!imcontext) || (!imcontext->text_input))
return EINA_FALSE;
- if (hw_keyboard_mode) {
- LOGD ("H/W keyboard is existed.\n");
- return EINA_FALSE;
- }
-
if (!imcontext->input) {
set_focus(ctx);
if (!imcontext->input) {
Ecore_Wl_Window *window = imcontext->window;
if (!window) return;
- if (!reset_conformant_area(imcontext->ctx)) {
+ if (!reset_conformant_area(imcontext->ctx) && !_conformant_reset_started) {
+ LOGD("Could not reset conformant area, send will_hide_ack right away %d", _conformant_reset_started);
+ _send_will_hide_ack(imcontext);
+ } else if (_conformant_reset_done) {
+ LOGD("Conformant reset has been already finished, send will_hide_ack right away");
_send_will_hide_ack(imcontext);
}
} else if (strncmp(command, szConformantRestore, strlen(szConformantRestore)) == 0) {
_focused_ctx = ctx;
//
- set_focus(ctx);
+ if (!set_focus(ctx)) {
+ _focused_ctx = NULL;
+ LOGW("Fail to set focus!");
+ return;
+ }
LOGD ("ctx : %p. on demand : %d\n", ctx, ecore_imf_context_input_panel_show_on_demand_get (ctx));
if (!imcontext || !imcontext->input) return;
- if (imcontext->text_input) {
- if (ecore_imf_context_input_panel_enabled_get(ctx)) {
- ecore_imf_context_input_panel_hide(ctx);
- }
+ if (ecore_imf_context_input_panel_enabled_get(ctx)) {
+ ecore_imf_context_input_panel_hide(ctx);
}
set_focus_out(ctx);
set_autocapital (ctx);
- if (!imcontext->preedit_text)
+ if (!imcontext->preedit_text || strlen(imcontext->preedit_text) == 0)
wl_text_input_set_cursor_position (imcontext->text_input, cursor_pos);
}
}
Socket client_socket(client);
m_send_trans.write_to_socket(client_socket);
}
-private:
- static void send_fail_reply (int client_id)
+ void send_fail_reply (int client)
{
- Socket client_socket (client_id);
+ SCIM_DEBUG_MAIN(4) << __FUNCTION__ << " (" << client << ")\n";
+ LOGD ("client id:%d\n", client);
+
+ Socket client_socket (client);
Transaction trans;
trans.clear ();
trans.put_command (SCIM_TRANS_CMD_REPLY);
trans.write_to_socket (client_socket);
}
+private:
+
bool filter_event(int fd) {
SCIM_DEBUG_MAIN(1) << "PanelAgent::filter_event ()\n";
#endif
static void
-_wsc_im_activate (void *data, struct wl_input_method *input_method, struct wl_input_method_context *im_ctx, uint32_t text_input_id)
+_wsc_im_activate (void *data, struct wl_input_method *input_method, struct wl_input_method_context *im_ctx, uint32_t text_input_id, uint32_t focus_in_event)
{
struct weescim *wsc = (weescim*)data;
if (!wsc) return;
isf_wsc_context_add (wsc_ctx);
- isf_wsc_context_focus_in (wsc_ctx);
+ if (focus_in_event)
+ isf_wsc_context_focus_in (wsc_ctx);
}
static void
-_wsc_im_deactivate (void *data, struct wl_input_method *input_method, struct wl_input_method_context *im_ctx)
+_wsc_im_deactivate (void *data, struct wl_input_method *input_method, struct wl_input_method_context *im_ctx, uint32_t focus_out_event)
{
struct weescim *wsc = (weescim*)data;
if (!wsc || !wsc->wsc_ctx) return;
WSCContextISF *wsc_ctx = wsc->wsc_ctx;
- isf_wsc_context_focus_out (wsc_ctx);
+ if (focus_out_event)
+ isf_wsc_context_focus_out (wsc_ctx);
#if ENABLE_GRAB_KEYBOARD
if (wsc_ctx->keyboard) {
int len = read (fd, buff, sizeof (buff) - 1);
if (len == 0) {
- LOGD ("update");
+ SECURE_LOGD ("remote_surrounding_text : %s, surrounding_cursor : %d\n", wsc_ctx->remote_surrounding_text, wsc_ctx->surrounding_cursor);
isf_wsc_context_send_surrounding_text (wsc_ctx, wsc_ctx->remote_surrounding_text ? wsc_ctx->remote_surrounding_text : "", wsc_ctx->surrounding_cursor);
} else if (len < 0) {
LOGW ("failed");
} else {
buff[len] = '\0';
if (wsc_ctx->remote_surrounding_text == NULL) {
- wsc_ctx->remote_surrounding_text = (char*)malloc (len + 1);
- if (wsc_ctx->remote_surrounding_text) {
- memcpy (wsc_ctx->remote_surrounding_text, buff, len);
- wsc_ctx->remote_surrounding_text[len] = '\0';
- return ECORE_CALLBACK_RENEW;
- } else {
- LOGE ("malloc failed");
+ if (len >= (int)sizeof(int)) {
+ /* Add one byte for terminating NULL character and subtract <int> byte for cursor position */
+ wsc_ctx->remote_surrounding_text = (char*)malloc (len + 1 - sizeof(int));
+ if (wsc_ctx->remote_surrounding_text) {
+ memcpy(&(wsc_ctx->surrounding_cursor), buff, sizeof(int));
+ memcpy (wsc_ctx->remote_surrounding_text, buff + sizeof(int), len - sizeof(int));
+ wsc_ctx->remote_surrounding_text[len - sizeof(int)] = '\0';
+ return ECORE_CALLBACK_RENEW;
+ } else {
+ LOGE ("malloc failed");
+ }
}
} else {
int old_len = strlen (wsc_ctx->remote_surrounding_text);
return;
}
check_input_resource (ic, INPUT_RESOURCE_REMOTE);
+
+ if (ic->impl->panel_layout == ECORE_IMF_INPUT_PANEL_LAYOUT_URL)
+ wsc_context_delete_surrounding (ic, -ic->impl->cursor_pos, ic->impl->surrounding_text.length ());
} else {
check_input_resource (ic, INPUT_RESOURCE_LOCAL);
}
isf_remote_client.cpp
libscim@SCIM_EPOCH@_la_CXXFLAGS = @EVAS_CFLAGS@ \
- @ECORE_CFLAGS@ \
+ @EINA_CFLAGS@ \
@ECORE_IMF_CFLAGS@ \
@DLOG_CFLAGS@ \
@DB_UTIL_CFLAGS@ \
@TZPLATFORM_CONFIG_CFLAGS@ \
@PKGMGR_INFO_CFLAGS@ \
- @VCONF_CFLAGS@
+ @VCONF_CFLAGS@ \
+ @GLIB_CFLAGS@
libscim@SCIM_EPOCH@_la_LDFLAGS = -version-info $(SCIM_CURRENT):$(SCIM_REVISION):$(SCIM_AGE) \
-export-dynamic \
@LIBTOOL_EXPORT_OPTIONS@ \
@LIBICONV@ \
@LTLIBINTL@ \
- @ECORE_LIBS@ \
+ @EINA_LIBS@ \
@DLOG_LIBS@ \
@DB_UTIL_LIBS@ \
@TZPLATFORM_CONFIG_LIBS@ \
@PKGMGR_INFO_LIBS@ \
@VCONF_LIBS@ \
+ @GLIB_LIBS@ \
-lstdc++
libscim@SCIM_EPOCH@_la_LIBADD = libltdlc.la
context = ((helper_ic >> 16) & 0x7FFF);
}
+static bool
+clients_equal (int first, int second)
+{
+ return ((first & 0xFFFF) == (second & 0xFFFF));
+}
+
+static bool
+contexts_equal (uint32 first, uint32 second)
+{
+ return ((first & 0x7FFF) == (second & 0x7FFF));
+}
+
//==================================== InfoManager ===========================
class InfoManager::InfoManagerImpl
{
SCIM_DEBUG_MAIN (5) << "Target UUID = " << target_uuid << " Focused UUId = " << focused_uuid << "\nTarget Client = " << target_client << "\n";
if (client_info.type == FRONTEND_CLIENT) {
+ /* If the original context value is greater than 0x7FFF, the line below would not work properly
+ since the target_context acquired by get_imengnie_client_context() is always smaller than 0x7FFF.
+ But since the send_imengine_event() of scim_helper module will call IMEngine's
+ process_helper_event() function directly, instead of sending SEND_IMENGINE_EVENT message.
+ So we are not going to handle this kind of exceptional case for now. */
m_panel_agent_manager.process_helper_event (target_client, target_context, target_uuid, hiit->second.uuid, nest_trans);
}
}
if (target_client == -1) {
/* FIXUP: monitor 'Invalid Window' error */
LOGW ("focused target client is NULL");
- } else if (target_client == focused_client && target_context == focused_context && target_uuid == focused_uuid) {
- ClientInfo client_info = socket_get_client_info (target_client);
+ } else if (target_uuid == focused_uuid &&
+ clients_equal (target_client, focused_client) &&
+ contexts_equal (target_context, focused_context)) {
+ ClientInfo client_info = socket_get_client_info (focused_client);
if (client_info.type == FRONTEND_CLIENT) {
- m_panel_agent_manager.socket_helper_key_event (target_client, target_context, cmd, key);
+ m_panel_agent_manager.socket_helper_key_event (focused_client, focused_context, cmd, key);
}
+ } else {
+ LOGD ("[target_client : %d, focused_client : %d] => %d, [target_context : %u, focused_context : %u] => %d",
+ target_client, focused_client, clients_equal (target_client, focused_client),
+ target_context, focused_context, contexts_equal (target_context, focused_context));
}
}
}
if (target_uuid.length () == 0)
target_uuid = focused_uuid;
- if (target_client == focused_client &&
- target_context == focused_context &&
- target_uuid == focused_uuid) {
- ClientInfo client_info = socket_get_client_info (target_client);
+ if (target_uuid == focused_uuid &&
+ clients_equal (target_client, focused_client) &&
+ contexts_equal (target_context, focused_context)) {
+ ClientInfo client_info = socket_get_client_info (focused_client);
if (client_info.type == FRONTEND_CLIENT) {
- m_panel_agent_manager.commit_string (target_client, target_context, wstr);
+ m_panel_agent_manager.commit_string (focused_client, focused_context, wstr);
} else {
std::cerr << "target client is not existed!!!" << "\n";
}
if (target_uuid.length () == 0)
target_uuid = focused_uuid;
- if (target_client == focused_client &&
- target_context == focused_context &&
- target_uuid == focused_uuid) {
- ClientInfo client_info = socket_get_client_info (target_client);
+ if (target_uuid == focused_uuid &&
+ clients_equal (target_client, focused_client) &&
+ contexts_equal (target_context, focused_context)) {
+ ClientInfo client_info = socket_get_client_info (focused_client);
if (client_info.type == FRONTEND_CLIENT) {
- m_panel_agent_manager.show_preedit_string (target_client, target_context);
+ m_panel_agent_manager.show_preedit_string (focused_client, focused_context);
}
}
}
if (target_uuid.length () == 0)
target_uuid = focused_uuid;
- if (target_client == focused_client &&
- target_context == focused_context &&
- target_uuid == focused_uuid) {
- ClientInfo client_info = socket_get_client_info (target_client);
+ if (target_uuid == focused_uuid &&
+ clients_equal (target_client, focused_client) &&
+ contexts_equal (target_context, focused_context)) {
+ ClientInfo client_info = socket_get_client_info (focused_client);
if (client_info.type == FRONTEND_CLIENT) {
- m_panel_agent_manager.hide_preedit_string (target_client, target_context);
+ m_panel_agent_manager.hide_preedit_string (focused_client, focused_context);
}
}
}
if (target_uuid.length () == 0)
target_uuid = focused_uuid;
- if (target_client == focused_client &&
- target_context == focused_context &&
- target_uuid == focused_uuid) {
- ClientInfo client_info = socket_get_client_info (target_client);
+ if (target_uuid == focused_uuid &&
+ clients_equal (target_client, focused_client) &&
+ contexts_equal (target_context, focused_context)) {
+ ClientInfo client_info = socket_get_client_info (focused_client);
if (client_info.type == FRONTEND_CLIENT) {
- m_panel_agent_manager.update_preedit_string (target_client, target_context, preedit, commit, attrs, caret);
+ m_panel_agent_manager.update_preedit_string (focused_client, focused_context, preedit, commit, attrs, caret);
}
}
}
if (icit != m_start_helper_ic_index.end ()) {
m_panel_agent_manager.helper_attach_input_context_and_update_screen (client, icit->second, m_current_screen);
m_start_helper_ic_index.erase (icit);
+ result = true;
+ } else {
+ m_panel_agent_manager.send_fail_reply(client);
}
-
- result = true;
+ } else {
+ m_panel_agent_manager.send_fail_reply(client);
}
}
LOGW ("not implemented for %s", m_name.c_str ());
}
+void PanelAgentBase::send_fail_reply (int client)
+{
+ LOGW ("not implemented for %s", m_name.c_str ());
+}
} /* namespace scim */
/*
* @return none.
*/
virtual void set_prediction_allow (int client, uint32 context, String uuid, int mode);
+
+ /**
+ * @brief send_fail_reply.
+ *
+ * @param
+ *
+ * @return none.
+ */
+ virtual void send_fail_reply (int client);
+
};
/** @} */
_p->set_prediction_allow (id, context_id, uuid, mode);
}
+void PanelAgentManager::send_fail_reply (int id)
+{
+ PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
+
+ if (!_p.null ())
+ _p->send_fail_reply (id);
+}
+
} /* namespace scim */
/*
void remote_commit_string (int target_client, uint32 target_context, const WideString& wstr);
void remote_delete_surrounding_text (int client, uint32 context_id, uint32 offset, uint32 len);
void set_prediction_allow (int id, uint32 context_id, String uuid, int mode);
+ void send_fail_reply (int client);
};
/** @} */
#include <string.h>
#include <dlog.h>
#include "scim.h"
+#include "isf_debug.h"
#ifdef LOG_TAG
# undef LOG_TAG
#define Uses_ISF_REMOTE_CLIENT
#define Uses_STL_STRING
-#include <Ecore.h>
+#include <glib.h>
#include <dlog.h>
#include "scim.h"
#include "isf_remote_control.h"
+#include "isf_debug.h"
#ifdef LOG_TAG
# undef LOG_TAG
struct _remote_control_client {
RemoteInputClient remote_client;
- Ecore_Fd_Handler *remote_fd_handler = NULL;
+ GIOChannel *remote_client_iochannel = NULL;
+ guint remote_client_iochannel_read;
+ guint remote_client_iochannel_err;
+ guint remote_client_iochannel_hup;
int remote_client_id;
remote_control_focus_in_cb focus_in_cb;
void* focus_in_cb_user_data;
void* input_resource_changed_cb_user_data;
};
-static Eina_Bool
-remote_handler(void *data, Ecore_Fd_Handler *fd_handler)
+static gboolean
+remote_handler(GIOChannel *source, GIOCondition condition, gpointer user_data)
{
- remote_control_client *client = static_cast<remote_control_client*>(data);
-
- if (client->remote_client.has_pending_event()) {
- switch (client->remote_client.recv_callback_message()) {
- case REMOTE_CONTROL_CALLBACK_FOCUS_IN:
- {
- LOGD ("REMOTE_CONTROL_CALLBACK_FOCUS_IN");
- focus_flag = true;
- client->focus_in_cb (client->focus_in_cb_user_data);
- break;
- }
- case REMOTE_CONTROL_CALLBACK_FOCUS_OUT:
- {
- LOGD ("REMOTE_CONTROL_CALLBACK_FOCUS_OUT");
- focus_flag = false;
- client->focus_out_cb (client->focus_out_cb_user_data);
- break;
- }
- case REMOTE_CONTROL_CALLBACK_ENTRY_METADATA:
- {
- if (focus_flag) {
- remote_control_entry_metadata_s *data = new remote_control_entry_metadata_s;
- int hint = 0, layout = 0, variation = 0, autocapital_type = 0, return_key_disabled = 0;
-
- client->remote_client.get_entry_metadata (&hint, &layout, &variation, &autocapital_type, &return_key_disabled);
- data->hint = static_cast<Ecore_IMF_Input_Hints> (hint);
- data->layout = static_cast<Ecore_IMF_Input_Panel_Layout> (layout);
- data->variation = variation;
- data->autocapital_type = static_cast<Ecore_IMF_Autocapital_Type> (autocapital_type);
- data->return_key_disabled = return_key_disabled;
-
- LOGD ("REMOTE_CONTROL_CALLBACK_ENTRY_METADATA hint: 0x%04x, layout: %d, variation: %d, autocapital: %d, return_key: %d",
- data->hint, data->layout, data->variation, data->autocapital_type, data->return_key_disabled);
- client->metadata_cb (client->metadata_cb_user_data, data);
- delete data;
+ if (condition == G_IO_IN) {
+ remote_control_client *client = static_cast<remote_control_client*>(user_data);
+ if (client->remote_client.has_pending_event()) {
+ switch (client->remote_client.recv_callback_message()) {
+ case REMOTE_CONTROL_CALLBACK_FOCUS_IN:
+ {
+ LOGD ("REMOTE_CONTROL_CALLBACK_FOCUS_IN");
+ focus_flag = true;
+ client->focus_in_cb (client->focus_in_cb_user_data);
+ break;
}
- break;
- }
- case REMOTE_CONTROL_CALLBACK_TEXT_UPDATED:
- {
- if (focus_flag) {
- String surrounding_text;
- int cursor = -1;
-
- client->remote_client.get_surrounding_text (surrounding_text, &cursor);
- SECURE_LOGD ("REMOTE_CONTROL_CALLBACK_TEXT_UPDATED \"%s\" %d", surrounding_text.c_str (), cursor);
- client->text_updated_cb (client->text_updated_cb_user_data, surrounding_text.c_str (), cursor);
+ case REMOTE_CONTROL_CALLBACK_FOCUS_OUT:
+ {
+ LOGD ("REMOTE_CONTROL_CALLBACK_FOCUS_OUT");
+ focus_flag = false;
+ client->focus_out_cb (client->focus_out_cb_user_data);
+ break;
}
- break;
- }
- case REMOTE_CONTROL_CALLBACK_INPUT_RESOURCE:
- {
- if (focus_flag) {
- int resource = 0;
-
- client->remote_client.get_input_resource (&resource);
- LOGD ("REMOTE_CONTROL_CALLBACK_INPUT_RESOURCE: %s", (resource ? "REMOTE" : "LOCAL"));
- client->input_resource_changed_cb (client->input_resource_changed_cb_user_data,
- static_cast<remote_control_input_resource> (resource));
+ case REMOTE_CONTROL_CALLBACK_ENTRY_METADATA:
+ {
+ if (focus_flag) {
+ remote_control_entry_metadata_s *data = new remote_control_entry_metadata_s;
+ int hint = 0, layout = 0, variation = 0, autocapital_type = 0, return_key_disabled = 0;
+
+ client->remote_client.get_entry_metadata (&hint, &layout, &variation, &autocapital_type, &return_key_disabled);
+ data->hint = static_cast<Ecore_IMF_Input_Hints> (hint);
+ data->layout = static_cast<Ecore_IMF_Input_Panel_Layout> (layout);
+ data->variation = variation;
+ data->autocapital_type = static_cast<Ecore_IMF_Autocapital_Type> (autocapital_type);
+ data->return_key_disabled = return_key_disabled;
+
+ LOGD ("REMOTE_CONTROL_CALLBACK_ENTRY_METADATA hint: 0x%04x, layout: %d, variation: %d, autocapital: %d, return_key: %d",
+ data->hint, data->layout, data->variation, data->autocapital_type, data->return_key_disabled);
+ client->metadata_cb (client->metadata_cb_user_data, data);
+ delete data;
+ }
+ break;
+ }
+ case REMOTE_CONTROL_CALLBACK_TEXT_UPDATED:
+ {
+ if (focus_flag) {
+ String surrounding_text;
+ int cursor = -1;
+
+ client->remote_client.get_surrounding_text (surrounding_text, &cursor);
+ SECURE_LOGD ("REMOTE_CONTROL_CALLBACK_TEXT_UPDATED \"%s\" %d", surrounding_text.c_str (), cursor);
+ client->text_updated_cb (client->text_updated_cb_user_data, surrounding_text.c_str (), cursor);
+ }
+ break;
+ }
+ case REMOTE_CONTROL_CALLBACK_INPUT_RESOURCE:
+ {
+ if (focus_flag) {
+ int resource = 0;
+
+ client->remote_client.get_input_resource (&resource);
+ LOGD ("REMOTE_CONTROL_CALLBACK_INPUT_RESOURCE: %s", (resource ? "REMOTE" : "LOCAL"));
+ client->input_resource_changed_cb (client->input_resource_changed_cb_user_data,
+ static_cast<remote_control_input_resource> (resource));
+ }
+ break;
}
- break;
+ case REMOTE_CONTROL_CALLBACK_ERROR:
+ break;
+ default:
+ break;
}
- case REMOTE_CONTROL_CALLBACK_ERROR:
- break;
- default:
- break;
+ } else {
+ LOGE ("Failed to receive callback message\n");
+ return (gboolean)FALSE;
}
+ } else if (condition == G_IO_ERR || condition == G_IO_HUP) {
+ LOGE ("Failed to receive callback message\n");
+ return (gboolean)FALSE;
}
- return ECORE_CALLBACK_RENEW;
+
+ return (gboolean)TRUE;
}
EXAPI remote_control_client * remote_control_connect(void)
client->remote_client_id = client->remote_client.get_panel2remote_connection_number();
if (client->remote_client_id >= 0) {
- client->remote_fd_handler = ecore_main_fd_handler_add(client->remote_client_id, ECORE_FD_READ, remote_handler, client, NULL, NULL);
+ client->remote_client_iochannel = g_io_channel_unix_new(client->remote_client_id);
- if (client->remote_fd_handler == NULL) {
+ if (client->remote_client_iochannel == NULL) {
LOGE ("REMOTE_CONTROL_INVALID_OPERATION");
goto cleanup;
}
+
+ client->remote_client_iochannel_read = g_io_add_watch (client->remote_client_iochannel, G_IO_IN, remote_handler, client);
+ client->remote_client_iochannel_err = g_io_add_watch (client->remote_client_iochannel, G_IO_ERR, remote_handler, client);
+ client->remote_client_iochannel_hup = g_io_add_watch (client->remote_client_iochannel, G_IO_HUP, remote_handler, client);
}
else {
LOGE ("REMOTE_CONTROL_INVALID_OPERATION");
if (error_e)
return error_e;
- if (client->remote_fd_handler)
- ecore_main_fd_handler_del(client->remote_fd_handler);
+ if (client->remote_client_iochannel)
+ g_io_channel_unref (client->remote_client_iochannel);
+
+ if (client->remote_client_iochannel_read)
+ g_source_remove (client->remote_client_iochannel_read);
+
+ if (client->remote_client_iochannel_err)
+ g_source_remove (client->remote_client_iochannel_err);
+
+ if (client->remote_client_iochannel_hup)
+ g_source_remove (client->remote_client_iochannel_hup);
+
+ client->remote_client_iochannel = NULL;
+ client->remote_client_iochannel_read = 0;
+ client->remote_client_iochannel_err = 0;
+ client->remote_client_iochannel_hup = 0;
client->remote_client.close_connection();
PrivilegeChecker::PrivilegeChecker (int sockfd)
{
m_client = NULL;
- m_session = NULL;
m_user = NULL;
m_sockfd = sockfd;
}
if (m_client)
free (m_client);
- if (m_session)
- free (m_session);
-
if (m_user)
free (m_user);
}
goto CLEANUP;
}
- m_session = cynara_session_from_pid (pid);
- if (!m_session) {
- SCIM_DEBUG_MAIN(1) << "cynara_session_from_pid(): failed";
- goto CLEANUP;
- }
-
return true;
CLEANUP:
if (m_client)
free (m_client);
- if (m_session)
- free (m_session);
-
if (m_user)
free (m_user);
m_client = NULL;
- m_session = NULL;
m_user = NULL;
return false;
if (!p_cynara)
return false;
- int ret = cynara_check (p_cynara, m_client, m_session, m_user, privilege);
+ int ret = cynara_check (p_cynara, m_client, "", m_user, privilege);
cynara_log("cynara_check()", ret);
if (ret != CYNARA_API_ACCESS_ALLOWED)
return false;
%bcond_with wayland
Name: isf
Summary: Input Service Framework
-Version: 3.0.158
+Version: 3.0.165
Release: 1
Group: Graphics & UI Framework/Input
License: LGPL-2.1+
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(tts)
%endif
+BuildRequires: pkgconfig(eina)
BuildRequires: pkgconfig(ecore)
BuildRequires: pkgconfig(evas)
BuildRequires: pkgconfig(edje)
export GC_SECTIONS_FLAGS="-fdata-sections -ffunction-sections -Wl,--gc-sections"
-CFLAGS+=" -fvisibility=hidden -fvisibility-inlines-hidden ${GC_SECTIONS_FLAGS} "; export CFLAGS
+CFLAGS+=" -fvisibility=hidden ${GC_SECTIONS_FLAGS} "; export CFLAGS
CXXFLAGS+=" -fvisibility=hidden -fvisibility-inlines-hidden ${GC_SECTIONS_FLAGS} ";export CXXFLAGS