# Check gio library
PKG_CHECK_MODULES(GIO, [gio-2.0])
-# Check dbus library
-PKG_CHECK_MODULES(DBUS, [dbus-1])
-
# Check tzplatform-config library
PKG_CHECK_MODULES(TZPLATFORM_CONFIG, [libtzplatform-config])
[ISF_HAS_PKGMGR_INFO=yes],
[ISF_HAS_PKGMGR_INFO=no])
-# Check db-util library
-PKG_CHECK_MODULES(DB_UTIL, [db-util],
- [ISF_HAS_DB_UTIL=yes],
- [ISF_HAS_DB_UTIL=no])
+PKG_CHECK_MODULES(SQLITE3, [sqlite3])
# Ignore checked modules if --disable option is added
AC_ARG_ENABLE(include-notification,
-I$(top_srcdir)/ism/utils \
-I$(top_srcdir)/engine-loader/include \
-I$(includedir) \
+ -DISF_VERSION=\"@ISF_VERSION@\" \
+ -DSCIM_BINDIR=\"@SCIM_BINDIR@\" \
-DSCIM_DATADIR=\"@SCIM_DATADIR@\" \
-DSCIM_LOCALEDIR=\"@SCIM_LOCALEDIR@\" \
-DSCIM_SYSCONFDIR=\"@SCIM_SYSCONFDIR@\" \
-DSCIM_LIBEXECDIR=\"@SCIM_LIBEXECDIR@\" \
-DSCIM_ICONDIR=\"@SCIM_ICONDIR@\" \
- -DSCIM_MODULE_PATH=\"@SCIM_MODULE_PATH@\" \
- -DSCIM_TEMPDIR=\"@SCIM_TEMPDIR@\"
+ -DSCIM_MODULE_PATH=\"@SCIM_MODULE_PATH@\"
noinst_HEADERS =
ise_engine_loader_SOURCES = src/engine_loader.cpp \
src/engine_loader_main.cpp \
- src/engine_loader_dbus.cpp
-
-
-ise_engine_loader_CXXFLAGS = @DLOG_CFLAGS@ \
- @GLIB_CFLAGS@ \
+ src/engine_loader_dbus.cpp \
+ ../ism/src/scim_imengine.cpp \
+ ../ism/src/scim_imengine_module.cpp \
+ ../ism/src/scim_signals.cpp \
+ ../ism/src/scim_slot.cpp \
+ ../ism/src/scim_connection.cpp \
+ ../ism/src/scim_transaction.cpp \
+ ../ism/src/scim_object.cpp \
+ ../ism/src/scim_lookup_table.cpp \
+ ../ism/src/scim_config_base.cpp \
+ ../ism/src/scim_config_module.cpp \
+ ../ism/src/scim_global_config.cpp \
+ ../ism/src/scim_debug.cpp \
+ ../ism/src/scim_module.cpp \
+ ../ism/src/scim_utility.cpp \
+ ../ism/src/scim_socket.cpp \
+ ../ism/src/isf_query_utility.cpp
+
+ise_engine_loader_CXXFLAGS = @GLIB_CFLAGS@ \
@GIO_CFLAGS@ \
- @PKGMGR_INFO_CFLAGS@ \
+ @DLOG_CFLAGS@ \
+ @SQLITE3_CFLAGS@ \
-fPIE
ise_engine_loader_LDFLAGS = @LTLIBINTL@ -rpath $(libdir) \
- @DLOG_LIBS@ \
@GLIB_LIBS@ \
@GIO_LIBS@ \
- @PKGMGR_INFO_LIBS@ \
+ @DLOG_LIBS@ \
+ @SQLITE3_LIBS@ \
-pie
-ise_engine_loader_LDADD = $(top_builddir)/ism/src/libscim@SCIM_EPOCH@.la \
- $(top_builddir)/ism/src/libprofile.la
+ise_engine_loader_LDADD = $(top_builddir)/ism/src/libltdlc.la
EngineLoader();
~EngineLoader();
- bool set_keyboard_ise_by_uuid(const scim::String &uuid);
+ bool set_keyboard_ise_by_uuid(const scim::String &uuid, const scim::String &module_name);
void flush_imengine();
void reset_imengine();
void send_imengine_event(int command, uint32_t value);
--- /dev/null
+/*
+ * ISF(Input Service Framework)
+ *
+ * ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable.
+ * Copyright (c) 2012-2020 Samsung Electronics Co., Ltd.
+ *
+ * Contact: Inhong Han <inhong1.han@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 __ENGINE_LOADER_ERROR_H
+#define __ENGINE_LOADER_ERROR_H
+
+enum {
+ ENGINE_LOADER_ERROR_NONE,
+ ENGINE_LOADER_ERROR_OUT_OF_MEMORY,
+ ENGINE_LOADER_ERROR_UNKNOWN,
+ ENGINE_LOADER_ERROR_INVALID_PARAMETER,
+ ENGINE_LOADER_ERROR_IO_ERROR
+};
+
+#endif /* __ENGINE_LOADER_ERROR_H */
#include <string.h>
#include <string>
#include <vector>
-#include <tizen.h>
#include <dlog.h>
-#include <pkgmgr-info.h>
#include <gio/gio.h>
+#include "engine_loader_error.h"
#include "engine_loader.h"
#include "engine_loader_dbus.h"
#include "scim_imengine.h"
EngineLoaderImpl(EngineLoader *thiz) : thiz(thiz), layout(0), is_focused(false)
{
- m_config = ConfigBase::get(true, "socket");
+ m_config = ConfigBase::get(false, "socket");
if (m_config.null())
m_config = new scim::DummyConfig();
}
void slot_show_preedit_string(IMEngineInstanceBase *si)
{
int ret = engine_loader_send_message(g_variant_new("()"), "show_preedit_string");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to show preedit string");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGE("Failed to show preedit string");
}
void slot_show_aux_string(IMEngineInstanceBase *si)
{
int ret = engine_loader_send_message(g_variant_new("()"), "show_aux_string");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to show aux string");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGE("Failed to show aux string");
}
void slot_show_lookup_table(IMEngineInstanceBase *si)
{
int ret = engine_loader_send_message(g_variant_new("()"), "show_lookup_table");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to show lookup table");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGE("Failed to show lookup table");
}
void slot_hide_preedit_string(IMEngineInstanceBase *si)
{
int ret = engine_loader_send_message(g_variant_new("()"), "hide_preedit_string");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to hide preedit string");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGE("Failed to hide preedit string");
}
void slot_hide_aux_string(IMEngineInstanceBase *si)
{
int ret = engine_loader_send_message(g_variant_new("()"), "hide_aux_string");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to hide aux string");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGE("Failed to hide aux string");
}
void slot_hide_lookup_table(IMEngineInstanceBase *si)
{
int ret = engine_loader_send_message(g_variant_new("()"), "hide_lookup_table");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to hide lookup table");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGE("Failed to hide lookup table");
}
void slot_update_preedit_caret(IMEngineInstanceBase *si, int caret)
{
int ret = engine_loader_send_message(g_variant_new("(i)", caret), "update_preedit_caret");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to update preedit caret");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGE("Failed to update preedit caret");
}
void slot_update_preedit_string(IMEngineInstanceBase *si,
generate_attr_builder(builder, attrs);
int ret = engine_loader_send_message(g_variant_new("(a(v)s)", builder, utf8_wcstombs(str).c_str()), "update_preedit_string");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to update preedit string");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGE("Failed to update preedit string");
if (builder)
g_variant_builder_unref(builder);
int ret = engine_loader_send_message(g_variant_new("(a(v)ssi)", builder, utf8_wcstombs(preedit).c_str(),
utf8_wcstombs(commit).c_str(), caret), "update_preedit_string_with_commit");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to update preedit string with commit");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGE("Failed to update preedit string with commit");
if (builder)
g_variant_builder_unref(builder);
generate_attr_builder(builder, attrs);
int ret = engine_loader_send_message(g_variant_new("(a(v)s)", builder, utf8_wcstombs(str).c_str()), "update_aux_string");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to update aux string");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGD("Failed to update aux string");
if (builder)
g_variant_builder_unref(builder);
void slot_commit_string(IMEngineInstanceBase *si, const WideString &str)
{
int ret = engine_loader_send_message(g_variant_new("(s)", utf8_wcstombs(str).c_str()), "commit_string");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to commit string");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGE("Failed to commit string");
}
void slot_recapture_string(IMEngineInstanceBase *si,
int ret = engine_loader_send_message(g_variant_new("(a(v)ssii)", builder, utf8_wcstombs(preedit).c_str(),
utf8_wcstombs(commit).c_str(), offset, len), "recapture_string");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to update recapture string");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGE("Failed to update recapture string");
if (builder)
g_variant_builder_unref(builder);
g_variant_builder_add(key_event_builder, "{sv}", "key_dev_subclass", g_variant_new_uint16(key.dev_subclass));
int ret = engine_loader_send_message(g_variant_new("(a{sv}s)", key_event_builder, key.dev_name.c_str()), "forward_key_event");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to forward key event");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGD("Failed to forward key event");
if (key_event_builder)
g_variant_builder_unref(key_event_builder);
}
int ret = engine_loader_send_message(g_variant_new("(a(a(v))a(v)ii)", attr_builder, candidate_builder, page_size, cursor_pos), "update_lookup_table");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to update lookup table");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGD("Failed to update lookup table");
if (attr_builder)
g_variant_builder_unref(attr_builder);
}
int ret = engine_loader_send_message(g_variant_new("(a(v))", builder), "register_properties");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to register properties");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGD("Failed to register properties");
if (builder)
g_variant_builder_unref(builder);
const char *tip = property.get_tip().c_str();
int ret = engine_loader_send_message(g_variant_new("(ssss)", key, label, icon, tip), "update_property");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to update property");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGD("Failed to update property");
}
void slot_send_helper_event(IMEngineInstanceBase *si,
int len)
{
int ret = engine_loader_send_message(g_variant_new("(ii)", offset, len), "delete_surrounding_text");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to delete surrounding text");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGD("Failed to delete surrounding text");
return true;
}
int end)
{
int ret = engine_loader_send_message(g_variant_new("(ii)", start, end), "set_selection");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to delete surrounding text");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGD("Failed to delete surrounding text\n");
return true;
}
void slot_expand_candidate (IMEngineInstanceBase *si)
{
int ret = engine_loader_send_message(g_variant_new("()"), "expand_candidate");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to hide lookup table");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGD("Failed to hide lookup table");
}
void slot_contract_candidate (IMEngineInstanceBase *si)
{
int ret = engine_loader_send_message(g_variant_new("()"), "contract_candidate");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to hide lookup table");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGD("Failed to hide lookup table");
}
void slot_set_candidate_style (IMEngineInstanceBase *si, ISF_CANDIDATE_PORTRAIT_LINE_T portrait_line, ISF_CANDIDATE_MODE_T mode)
{
int ret = engine_loader_send_message(g_variant_new("(ii)", (int)portrait_line, (int)mode), "set_candidate_style");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to hide lookup table");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGD("Failed to hide lookup table");
}
void slot_send_private_command (IMEngineInstanceBase *si, const String &command)
{
int ret = engine_loader_send_message(g_variant_new("(s)", command.c_str()), "send_private_command");
- if (ret != TIZEN_ERROR_NONE)
- LOGD("Falied to send private command");
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGE("Failed to send private command");
}
void attach_instance()
delete m_impl;
}
-bool EngineLoader::set_keyboard_ise_by_uuid(const scim::String &uuid)
+bool EngineLoader::set_keyboard_ise_by_uuid(const scim::String &uuid, const scim::String &module_name)
{
ImeInfoDB imeInfo;
IMEngineFactoryPointer factory;
static int instance_count = 1;
if ((!m_impl->si.null ()) && m_impl->si->get_factory_uuid () == uuid) {
- LOGD("Already in UUID : %s", uuid.c_str());
+ LOGW("Already in UUID : %s", uuid.c_str());
return false;
}
}
if (m_impl->m_config.null ()) {
- LOGD("config is not working");
+ LOGE("config is not working");
return false;
}
- int ret = 0;
- char *pkgid = NULL;
- pkgmgrinfo_appinfo_h handle;
- ret = pkgmgrinfo_appinfo_get_appinfo(uuid.c_str(), &handle);
- if (ret != PMINFO_R_OK) {
- LOGD("Retrieve app info failed : %s", uuid.c_str ());
- return false;
- }
-
- ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
- if (ret != PMINFO_R_OK) {
- LOGD("Retrieve pkgid failed : %s, %p", uuid.c_str(), handle);
- pkgmgrinfo_appinfo_destroy_appinfo(handle);
- return false;
- }
-
- imeInfo.module_name = pkgid;
- pkgmgrinfo_appinfo_destroy_appinfo(handle);
+ imeInfo.module_name = module_name;
engine_module = &m_impl->engine_module;
if (engine_module->valid() && imeInfo.module_name != engine_module->get_module_name()) {
- LOGD("imengine module %s unloaded", engine_module->get_module_name().c_str());
+ LOGE("imengine module %s unloaded", engine_module->get_module_name().c_str());
engine_module->unload();
}
if (!engine_module->valid()) {
if (engine_module->load (imeInfo.module_name, m_impl->m_config) == false) {
- LOGD("load module %s failed", imeInfo.module_name.c_str());
+ LOGE("load module %s failed", imeInfo.module_name.c_str());
return false;
}
- LOGD("imengine module %s loaded", imeInfo.module_name.c_str());
+ LOGE("imengine module %s loaded", imeInfo.module_name.c_str());
}
for (size_t j = 0; j < engine_module->number_of_factories (); ++j) {
}
if (factory.null()) {
- LOGD("imengine uuid %s is not found", uuid.c_str());
+ LOGE("imengine uuid %s is not found", uuid.c_str());
return false;
}
m_impl->si = factory->create_instance ("UTF-8", instance_count++);
if (m_impl->si.null ()) {
- LOGD("create_instance %s failed", uuid.c_str ());
+ LOGE("create_instance %s failed", uuid.c_str ());
return false;
}
m_impl->attach_instance ();
- LOGD("Require UUID: %s Current UUID: %s", uuid.c_str(), m_impl->si->get_factory_uuid().c_str());
+ LOGE("Require UUID: %s Current UUID: %s", uuid.c_str(), m_impl->si->get_factory_uuid().c_str());
m_impl->si->set_layout (m_impl->layout);
if (m_impl->is_focused)
m_impl->si->focus_in ();
#define Uses_SCIM_IMENGINE_MODULE
-#include <tizen.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <cstdint>
+#include <string.h>
#include <dlog.h>
+#include "engine_loader_error.h"
#include "engine_loader_dbus.h"
#include "engine_loader.h"
#include "scim.h"
GVariant *reply_body = NULL;
g_sender = std::string(sender);
- int ret = TIZEN_ERROR_UNKNOWN;
+ int ret = ENGINE_LOADER_ERROR_UNKNOWN;
if (g_strcmp0(method_name, "loader_service_register") == 0) {
ret = engine_loader_server_register(parameters, &reply_body, sender, _on_name_appeared, _on_name_vanished);
ret = engine_loader_long_press_candidate_item(parameters, &reply_body);
}
- if (ret == TIZEN_ERROR_NONE)
+ if (ret == ENGINE_LOADER_ERROR_NONE)
g_dbus_method_invocation_return_value(invocation, reply_body);
else
g_dbus_method_invocation_return_error(invocation, G_DBUS_ERROR, ret, "engine loader error");
" <method name='set_imengine'>"
" <arg type='s' name='engine_id' direction='in'/>"
+ " <arg type='s' name='module_name' direction='in'/>"
" <arg type='b' name='result' direction='out'/>"
" </method>"
{
int ret;
ret = _register_dbus_interface();
- if (ret != TIZEN_ERROR_NONE)
- LOGE("Failed to register dbus interface : %s", get_error_message(ret));
+ if (ret != ENGINE_LOADER_ERROR_NONE)
+ LOGE("Failed to register dbus interface : %d", ret);
return ret;
}
int engine_loader_server_register_dbus_interface(char *introspection_xml, GDBusInterfaceVTable interface_vtable)
{
- int ret = TIZEN_ERROR_NONE;
+ int ret = ENGINE_LOADER_ERROR_NONE;
int own_id, registration_id;
GError *error = NULL;
GDBusNodeInfo *introspection_data = NULL;
LOGE("g_bus_get_sync error message = %s", error->message);
g_error_free(error);
}
- ret = TIZEN_ERROR_UNKNOWN;
+ ret = ENGINE_LOADER_ERROR_UNKNOWN;
goto cleanup;
}
}
NULL, NULL);
if (own_id == 0) {
LOGE("Failed to register bus name");
- ret = TIZEN_ERROR_UNKNOWN;
+ ret = ENGINE_LOADER_ERROR_UNKNOWN;
goto cleanup;
}
introspection_data = g_dbus_node_info_new_for_xml(introspection_xml, &error);
if (introspection_data == NULL) {
LOGE("Failed to get GDBusNodeInfo");
- ret = TIZEN_ERROR_UNKNOWN;
+ ret = ENGINE_LOADER_ERROR_UNKNOWN;
if (error != NULL) {
LOGE("g_dbus_node_info_new_for_xml error message = %s", error->message);
g_error_free(error);
if (error != NULL) {
LOGE("Failed to register object. error message = %s", error->message);
g_error_free(error);
- ret = TIZEN_ERROR_UNKNOWN;
+ ret = ENGINE_LOADER_ERROR_UNKNOWN;
}
goto cleanup;
}
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
cleanup:
if (introspection_data)
int engine_loader_server_register(GVariant *parameters, GVariant **reply_body, const gchar *sender,
GBusNameAppearedCallback appeared_handler, GBusNameVanishedCallback vanished_handler)
{
- int ret = TIZEN_ERROR_NONE;
+ int ret = ENGINE_LOADER_ERROR_NONE;
monitoring_info_s *m_info = NULL;
if (reply_body == NULL)
- return TIZEN_ERROR_INVALID_PARAMETER;
+ return ENGINE_LOADER_ERROR_INVALID_PARAMETER;
if (sender == NULL)
- return TIZEN_ERROR_INVALID_PARAMETER;
+ return ENGINE_LOADER_ERROR_INVALID_PARAMETER;
m_info = (monitoring_info_s *)calloc(1, sizeof(monitoring_info_s));
if (m_info == NULL) {
LOGE("Failed to alloc memory");
- ret = TIZEN_ERROR_OUT_OF_MEMORY;
+ ret = ENGINE_LOADER_ERROR_OUT_OF_MEMORY;
goto cleanup;
}
if (m_info->watcher_id == 0) {
LOGE("Failed to get identifier");
- ret = TIZEN_ERROR_UNKNOWN;
+ ret = ENGINE_LOADER_ERROR_UNKNOWN;
goto cleanup;
}
*reply_body = g_variant_new("(i)", m_info->watcher_id);
if (*reply_body == NULL) {
LOGE("Failed to make reply");
- ret = TIZEN_ERROR_OUT_OF_MEMORY;
+ ret = ENGINE_LOADER_ERROR_OUT_OF_MEMORY;
goto cleanup;
}
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
cleanup:
if (m_info) {
int watcher_id = 0;
g_variant_get(parameters, "(i)", &watcher_id);
g_bus_unwatch_name(watcher_id);
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_send_message(GVariant *body, const char *cmd)
g_error_free(err);
}
- return TIZEN_ERROR_IO_ERROR;
+ return ENGINE_LOADER_ERROR_IO_ERROR;
}
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_set_imengine(GVariant *parameters, GVariant **reply_body)
{
bool result = false;
char *engine_id = NULL;
+ char *module_name = NULL;
- g_variant_get(parameters, "(&s)", &engine_id);
+ g_variant_get(parameters, "(&ss)", &engine_id, &module_name);
if (engine_id)
- result = m_engine_loader.set_keyboard_ise_by_uuid(scim::String(engine_id));
+ result = m_engine_loader.set_keyboard_ise_by_uuid(scim::String(engine_id), scim::String(module_name));
*reply_body = g_variant_new("(b)", result);
if (*reply_body == NULL) {
LOGE("Failed to create reply_body");
- return TIZEN_ERROR_OUT_OF_MEMORY;
+ return ENGINE_LOADER_ERROR_OUT_OF_MEMORY;
}
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_flush_imengine(GVariant *parameters, GVariant **reply_body)
{
m_engine_loader.flush_imengine();
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_reset_imengine(GVariant *parameters, GVariant **reply_body)
{
m_engine_loader.reset_imengine();
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_send_imengine_event(GVariant *parameters, GVariant **reply_body)
g_variant_get(parameters, "(iu)", &command, &value);
m_engine_loader.send_imengine_event(command, value);
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_process_key_event(GVariant *parameters, GVariant **reply_body)
*reply_body = g_variant_new("(b)", result);
if (*reply_body == NULL) {
LOGE("Failed to create reply_body");
- return TIZEN_ERROR_OUT_OF_MEMORY;
+ return ENGINE_LOADER_ERROR_OUT_OF_MEMORY;
}
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_focus_in(GVariant *parameters, GVariant **reply_body)
{
m_engine_loader.focus_in();
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_focus_out(GVariant *parameters, GVariant **reply_body)
{
m_engine_loader.focus_out();
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_update_cursor_position(GVariant *parameters, GVariant **reply_body)
if (cursor_pos >= 0)
m_engine_loader.update_cursor_position(cursor_pos);
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_set_autocapital_type(GVariant *parameters, GVariant **reply_body)
g_variant_get(parameters, "(u)", &type);
m_engine_loader.set_autocapital_type(type);
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_set_prediction_allow(GVariant *parameters, GVariant **reply_body)
g_variant_get(parameters, "(u)", &prediction_allow);
m_engine_loader.set_prediction_allow(prediction_allow);
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_reset_input_context(GVariant *parameters, GVariant **reply_body)
{
m_engine_loader.reset_input_context();
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_set_layout(GVariant *parameters, GVariant **reply_body)
g_variant_get(parameters, "(u)", &layout);
m_engine_loader.set_layout(layout);
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_set_imdata(GVariant *parameters, GVariant **reply_body)
g_variant_get(parameters, "(&su)", &imdata, &len);
m_engine_loader.set_imdata(imdata, len);
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_set_input_hint(GVariant *parameters, GVariant **reply_body)
g_variant_get(parameters, "(u)", &hint);
m_engine_loader.set_input_hint(hint);
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_update_bidi_direction(GVariant *parameters, GVariant **reply_body)
g_variant_get(parameters, "(u)", &direction);
m_engine_loader.update_bidi_direction(direction);
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_set_trigger_property(GVariant *parameters, GVariant **reply_body)
g_variant_get(parameters, "(&s)", &property);
m_engine_loader.set_trigger_property(property);
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_show_candidate_more_window(GVariant *parameters, GVariant **reply_body)
{
m_engine_loader.show_candidate_more_window();
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_hide_candidate_more_window(GVariant *parameters, GVariant **reply_body)
{
m_engine_loader.hide_candidate_more_window();
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_select_aux(GVariant *parameters, GVariant **reply_body)
g_variant_get(parameters, "(u)", &item);
m_engine_loader.select_aux(item);
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_select_candidate(GVariant *parameters, GVariant **reply_body)
g_variant_get(parameters, "(u)", &item);
m_engine_loader.select_candidate(item);
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_candidate_table_page_up(GVariant *parameters, GVariant **reply_body)
{
m_engine_loader.candidate_table_page_up();
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_candidate_table_page_down(GVariant *parameters, GVariant **reply_body)
{
m_engine_loader.candidate_table_page_down();
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_change_candidate_page_size(GVariant *parameters, GVariant **reply_body)
g_variant_get(parameters, "(u)", &size);
m_engine_loader.change_candidate_page_size(size);
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_set_candidate_item_layout(GVariant *parameters, GVariant **reply_body)
g_variant_get(parameters, "(a(v))", &item_iter);
if (!item_iter) {
- LOGD("Failed to get iter");
+ LOGE("Failed to get iter");
result = false;
}
*reply_body = g_variant_new("(b)", result);
if (*reply_body == NULL) {
LOGE("Failed to create reply_body");
- return TIZEN_ERROR_OUT_OF_MEMORY;
+ return ENGINE_LOADER_ERROR_OUT_OF_MEMORY;
}
if (value)
g_variant_unref(value);
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_change_candidate_number(GVariant *parameters, GVariant **reply_body)
g_variant_get(parameters, "(u)", &page_num);
m_engine_loader.change_candidate_number(page_num);
- return TIZEN_ERROR_NONE;
+ return ENGINE_LOADER_ERROR_NONE;
}
int engine_loader_long_press_candidate_item(GVariant *parameters, GVariant **reply_body)
g_variant_get(parameters, "(u)", &index);
m_engine_loader.long_press_candidate_item(index);
- return TIZEN_ERROR_NONE;
-}
\ No newline at end of file
+ return ENGINE_LOADER_ERROR_NONE;
+}
*
*/
-#include <tizen.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <glib.h>
#include <sys/signalfd.h>
#include <signal.h>
+#include <string.h>
+#include <errno.h>
+#include "engine_loader_error.h"
#include "engine_loader_dbus.h"
#ifdef LOG_TAG
}
ret = engine_loader_dbus_init();
- if (ret != TIZEN_ERROR_NONE)
+ if (ret != ENGINE_LOADER_ERROR_NONE)
LOGW("Failed to init dbus");
register_signal_handler();
@XKBCOMMON_CFLAGS@ \
@APP_CONTROL_CFLAGS@ \
@PKGMGR_INFO_CFLAGS@ \
+ @PACKAGE_MANAGER_CFLAGS@ \
@AUL_CFLAGS@ \
-fPIE
@XKBCOMMON_LIBS@ \
@APP_CONTROL_LIBS@ \
@PKGMGR_INFO_LIBS@ \
+ @PACKAGE_MANAGER_LIBS@ \
@AUL_LIBS@ \
-pie
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
+#include <malloc.h>
+
#include <Eina.h>
#include <Ecore.h>
#include <Ecore_File.h>
-#include <malloc.h>
+#include <tzplatform_config.h>
+
#include "scim_private.h"
#include "scim.h"
#include "scim_stl_map.h"
libprofile_la_LIBADD = @SYSTEM_INFO_LIBS@
libisf_pkg_la_SOURCES = isf_pkg.cpp
-libisf_pkg_la_CXXFLAGS = @DLOG_CFLAGS@ @PKGMGR_INFO_CFLAGS@ @PACKAGE_MANAGER_CFLAGS@ @TZPLATFORM_CONFIG_CFLAGS@
-libisf_pkg_la_LIBADD = @DLOG_LIBS@ @PKGMGR_INFO_LIBS@ @PACKAGE_MANAGER_LIBS@ @TZPLATFORM_CONFIG_LIBS@
+libisf_pkg_la_CXXFLAGS = @DLOG_CFLAGS@ @PKGMGR_INFO_CFLAGS@ @TZPLATFORM_CONFIG_CFLAGS@
+libisf_pkg_la_LIBADD = @DLOG_LIBS@ @PKGMGR_INFO_LIBS@ @TZPLATFORM_CONFIG_LIBS@
if SCIM_LD_VERSION_SCRIPT
LD_VERSION_SCRIPT_OPTION="-Wl,--version-script=$(srcdir)/libscim.version-script"
@ECORE_IMF_CFLAGS@ \
@ECORE_INPUT_CFLAGS@ \
@DLOG_CFLAGS@ \
- @DB_UTIL_CFLAGS@ \
+ @SQLITE3_CFLAGS@ \
@TZPLATFORM_CONFIG_CFLAGS@ \
@PKGMGR_INFO_CFLAGS@ \
@VCONF_CFLAGS@ \
@ECORE_INPUT_LIBS@ \
@EINA_LIBS@ \
@DLOG_LIBS@ \
- @DB_UTIL_LIBS@ \
+ @SQLITE3_LIBS@ \
@TZPLATFORM_CONFIG_LIBS@ \
@PKGMGR_INFO_LIBS@ \
@VCONF_LIBS@ \
lib@ISF_CONTROL@_la_CXXFLAGS = @EINA_CFLAGS@ \
@DLOG_CFLAGS@ \
- @TZPLATFORM_CONFIG_CFLAGS@ \
@VCONF_CFLAGS@
lib@ISF_CONTROL@_la_LDFLAGS = -version-info $(SCIM_CURRENT):$(SCIM_REVISION):$(SCIM_AGE) \
-rpath $(libdir) \
@EINA_LIBS@ \
@DLOG_LIBS@ \
- @TZPLATFORM_CONFIG_LIBS@ \
@VCONF_LIBS@ \
-lstdc++
#include "scim.h"
#include "isf_query_utility.h"
#include "scim_helper.h"
-#include <db-util.h>
-#include "isf_debug.h"
-
+#include <sqlite3.h>
using namespace scim;
///////////////////////////////////////////////////////////////////////////////////////////////////
// DATABASE
///////////////////////////////////////////////////////////////////////////////////////////////////
-#define DB_PATH tzplatform_mkpath(TZ_USER_DB, ".ime_info.db")
+#define USER_DB "/opt/usr/home/owner/.applications/dbspace/"
+#define DB_PATH USER_DB".ime_info.db"
static struct {
const char* pPath;
sqlite3* pHandle;
return ret;
}
+static int _db_open(const char *pszFilePath, sqlite3 **ppDB)
+{
+ int rc = sqlite3_open(pszFilePath, ppDB);
+ if (SQLITE_OK != rc) {
+ return rc;
+ }
+
+ return rc;
+}
+
static inline int _db_init(void)
{
if (!isf_db_check_path_available()) {
}
struct stat stat;
- int ret = db_util_open(databaseInfo.pPath, &databaseInfo.pHandle, DB_UTIL_REGISTER_HOOK_METHOD);
+ int ret = _db_open(databaseInfo.pPath, &databaseInfo.pHandle);
if (ret != SQLITE_OK) {
LOGE ("db_util_open(\"%s\", ~) returned %d: %s", databaseInfo.pPath, ret, sqlite3_errmsg(databaseInfo.pHandle));
if (databaseInfo.pHandle)
- db_util_close(databaseInfo.pHandle);
+ sqlite3_close(databaseInfo.pHandle);
databaseInfo.pHandle = NULL;
databaseInfo.need_reset = true;
return -EIO;
char buf_err[256];
LOGE("lstat failed. %s", strerror_r (errno, buf_err, sizeof (buf_err)));
if (databaseInfo.pHandle)
- db_util_close(databaseInfo.pHandle);
+ sqlite3_close(databaseInfo.pHandle);
databaseInfo.pHandle = NULL;
databaseInfo.need_reset = true;
return -ENOENT;
if (!S_ISREG(stat.st_mode)) {
LOGE ("S_ISREG failed.");
if (databaseInfo.pHandle)
- db_util_close(databaseInfo.pHandle);
+ sqlite3_close(databaseInfo.pHandle);
databaseInfo.pHandle = NULL;
databaseInfo.need_reset = true;
return -EINVAL;
if (_db_create_table() != 0) {
LOGE ("CREATE TABLE IF NOT EXISTS ime_info ~ failed.");
if (databaseInfo.pHandle)
- db_util_close(databaseInfo.pHandle);
+ sqlite3_close(databaseInfo.pHandle);
databaseInfo.pHandle = NULL;
databaseInfo.need_reset = true;
return -EIO;
if (!databaseInfo.pHandle)
return 0;
- db_util_close(databaseInfo.pHandle);
+ sqlite3_close(databaseInfo.pHandle);
databaseInfo.pHandle = NULL;
*/
EXAPI int isf_db_check_path_available(void)
{
- const char *user_db_path = tzplatform_getenv(TZ_USER_DB);
+ const char *user_db_path = USER_DB;
char buf_err[256];
if (access(user_db_path, F_OK) != 0) {
LOGW("access failed : %s, errno(%d) - %s", user_db_path, errno, strerror_r(errno, buf_err, sizeof(buf_err)));
#ifndef __ISF_QUERY_UTILITY_H__
#define __ISF_QUERY_UTILITY_H__
-/* For multi-user support */
-#include <tzplatform_config.h>
-
using namespace scim;
bool
Module::unload ()
{
- if (!m_impl->handle)
+ if (!m_impl || !m_impl->handle)
return true;
if (is_resident ())
bool
Module::make_resident () const
{
- if (m_impl->handle) {
+ if (m_impl && m_impl->handle) {
return lt_dlmakeresident (m_impl->handle) == 0;
}
return false;
bool
Module::is_resident () const
{
- if (m_impl->handle) {
+ if (m_impl && m_impl->handle) {
return lt_dlisresident (m_impl->handle) == 1;
}
return false;
bool
Module::valid () const
{
- return (m_impl->handle && m_impl->init);
+ return (m_impl && m_impl->handle && m_impl->init);
}
String
BuildRequires: pkgconfig(efl-extension)
BuildRequires: pkgconfig(libtzplatform-config)
BuildRequires: pkgconfig(pkgmgr-info)
-BuildRequires: pkgconfig(db-util)
+BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(aul)
BuildRequires: pkgconfig(capi-appfw-app-control)
BuildRequires: pkgconfig(capi-appfw-application)
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(notification)
-BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(gio-2.0)
Requires(postun): /sbin/ldconfig
Requires: org.tizen.isf-kbd-mode-changer