From a4304e372322ed307b75fce9a451bc5c3e155670 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 3 Jun 2015 10:02:14 +0900 Subject: [PATCH 01/16] Replace X dependent code Change-Id: I525d40cc4dfc10d2baf4bfe72415f5fd7ddecc8c --- src/sclcoreui-efl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sclcoreui-efl.cpp b/src/sclcoreui-efl.cpp index 0a24933..a89f99d 100644 --- a/src/sclcoreui-efl.cpp +++ b/src/sclcoreui-efl.cpp @@ -457,7 +457,7 @@ sclwindow CSCLCoreUIEFL::create_option_window(SCLOptionWindowType type) elm_win_borderless_set(window, EINA_TRUE); Evas_Coord win_w = 0, win_h = 0; - ecore_x_window_size_get(ecore_x_window_root_first_get(), &win_w, &win_h); + elm_win_screen_size_get (window, NULL, NULL, &win_w, &win_h); int degree = get_screen_rotation_degree(); if(degree == 90 || degree == 270){ evas_object_resize(window, win_h, win_w); -- 2.7.4 From fb8e8c71148bedea165971db89fd62810ccdc901 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 3 Jun 2015 10:04:04 +0900 Subject: [PATCH 02/16] update package version to 0.4.0 Change-Id: I444324ec79fc753d9f5d2ec80fee5823a9dca219 --- packaging/libscl-core.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libscl-core.spec b/packaging/libscl-core.spec index 59d7a60..c2d29c3 100644 --- a/packaging/libscl-core.spec +++ b/packaging/libscl-core.spec @@ -3,7 +3,7 @@ Name: libscl-core Summary: A library for developing software keyboards -Version: 0.0.1 +Version: 0.4.0 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From a11180bf3355880330502294287f5e76826dd8c5 Mon Sep 17 00:00:00 2001 From: Sungwook Park Date: Wed, 3 Jun 2015 19:54:49 +0900 Subject: [PATCH 03/16] modify Non-virtual destructor issue Change-Id: Ia7c458572a2f8d03fa953cebbf3548c3b1388fa0 --- src/sclconnection.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sclconnection.h b/src/sclconnection.h index 58cc7a3..d4c5642 100644 --- a/src/sclconnection.h +++ b/src/sclconnection.h @@ -37,7 +37,7 @@ class CSCLConnection { public: CSCLConnection(); - ~CSCLConnection(); + virtual ~CSCLConnection(); std::string get_backend_indentifier(); -- 2.7.4 From cce88c4ce074f8334e457f32bd727de9dfc281f7 Mon Sep 17 00:00:00 2001 From: Sungwook Park Date: Wed, 3 Jun 2015 20:04:10 +0900 Subject: [PATCH 04/16] Empty virtual destructor (VIRTUAL_DTOR) issue resolve Change-Id: I3474bf335cc1a4cc0f4d50d18aad5023ff9d10ab --- src/sclcoreui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sclcoreui.h b/src/sclcoreui.h index 01650fd..76d7998 100644 --- a/src/sclcoreui.h +++ b/src/sclcoreui.h @@ -36,7 +36,7 @@ class CSCLCoreUI { public: CSCLCoreUI(); - ~CSCLCoreUI(); + virtual ~CSCLCoreUI(); std::string get_backend_indentifier(); -- 2.7.4 From ea5282deaed888f552d6300b842d2c7f7858f811 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 10 Jun 2015 17:07:03 +0900 Subject: [PATCH 05/16] Support build in wayland environment Change-Id: Ibeafeb0f9d4f69608686cbb051739779d107e148 --- CMakeLists.txt | 12 ++++++++++-- packaging/libscl-core.spec | 11 +++++++++++ src/sclconnection-isf.cpp | 2 ++ src/sclcoreui-efl.cpp | 28 ++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a9ff9c4..4bb3989 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,15 +25,23 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src ) INCLUDE(FindPkgConfig) -pkg_check_modules(pkgs REQUIRED + +SET(PKGS_CHECK_MODULES elementary dlog isf vconf - ecore-x + libscl-common ) +IF (with_wayland) + ADD_DEFINITIONS("-DWAYLAND") + pkg_check_modules(pkgs REQUIRED ${PKGS_CHECK_MODULES}) +ELSE (with_wayland) + pkg_check_modules(pkgs REQUIRED ${PKGS_CHECK_MODULES} ecore-x) +ENDIF(with_wayland) + FOREACH(flag ${pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) diff --git a/packaging/libscl-core.spec b/packaging/libscl-core.spec index c2d29c3..c346554 100644 --- a/packaging/libscl-core.spec +++ b/packaging/libscl-core.spec @@ -1,3 +1,6 @@ +%bcond_with x +%bcond_with wayland + %define _optdir /opt %define _appdir %{_optdir}/apps @@ -14,7 +17,10 @@ BuildRequires: pkgconfig(elementary) BuildRequires: pkgconfig(vconf) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(isf) +%if %{with wayland} +%else BuildRequires: pkgconfig(ecore-x) +%endif BuildRequires: pkgconfig(libscl-common) @@ -40,7 +46,12 @@ export FFLAGS+=" -DTIZEN_DEBUG_ENABLE" rm -rf CMakeFiles rm -rf CMakeCache.txt + +%if %{with wayland} +cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -Dwith_wayland=TRUE +%else cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} +%endif make %{?jobs:-j%jobs} %install diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index 4a11f22..96bbb22 100644 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -625,6 +625,7 @@ void CSCLConnectionISF::open_connection(const sclchar *display) if (impl) { main_window = NATIVE_WINDOW_CAST(impl->get_main_window()); } +#ifndef WAYLAND Ecore_X_Window xwindow = elm_win_xwindow_get(main_window); char xid[255]; snprintf(xid, 255, "%d", xwindow); @@ -632,6 +633,7 @@ void CSCLConnectionISF::open_connection(const sclchar *display) scim::PropertyList props; props.push_back(prop); m_helper_agent.register_properties(props); +#endif m_fd_handler = ecore_main_fd_handler_add(fd, ECORE_FD_READ, input_handler, &m_helper_agent, NULL, NULL); } diff --git a/src/sclcoreui-efl.cpp b/src/sclcoreui-efl.cpp index a89f99d..4ffd69d 100644 --- a/src/sclcoreui-efl.cpp +++ b/src/sclcoreui-efl.cpp @@ -24,8 +24,12 @@ #include #include +#ifdef WAYLAND +#include +#else #include #include +#endif using namespace scl; @@ -74,10 +78,15 @@ sclwindow CSCLCoreUIEFL::get_main_window() void CSCLCoreUIEFL::set_keyboard_size_hints(SclSize portrait, SclSize landscape) { Evas_Object *main_window = NATIVE_WINDOW_CAST(m_main_window); + +#ifdef WAYLAND + evas_object_resize(main_window, portrait.width, portrait.height); +#else ecore_x_e_window_rotation_geometry_set(elm_win_xwindow_get(main_window), 0, 0, 0, portrait.width, portrait.height); ecore_x_e_window_rotation_geometry_set(elm_win_xwindow_get(main_window), 90, 0, 0, landscape.height, landscape.width); ecore_x_e_window_rotation_geometry_set(elm_win_xwindow_get(main_window), 180, 0, 0, portrait.width, portrait.height); ecore_x_e_window_rotation_geometry_set(elm_win_xwindow_get(main_window), 270, 0, 0, landscape.height, landscape.width); +#endif } const char * extract_themename_from_theme_file_path(const char *filepath) { @@ -145,6 +154,7 @@ void accessibility_changed_cb(keynode_t *key, void* data) } } +#ifndef WAYLAND static Eina_Bool _client_message_cb(void *data, int type, void *event) { Ecore_X_Event_Client_Message *ev = (Ecore_X_Event_Client_Message *)event; @@ -197,10 +207,13 @@ static Eina_Bool _client_message_cb(void *data, int type, void *event) return ECORE_CALLBACK_RENEW; } +#endif int CSCLCoreUIEFL::get_screen_rotation_degree() { int angle = 0; + +#ifndef WAYLAND if (m_rotation_degree == -1) { int ret = 0; Atom type_return; @@ -250,6 +263,7 @@ int CSCLCoreUIEFL::get_screen_rotation_degree() } else { angle = m_rotation_degree; } +#endif return angle; } @@ -289,12 +303,14 @@ void CSCLCoreUIEFL::run(const sclchar *display) int rots[] = { 0, 90, 180, 270 }; elm_win_wm_rotation_available_rotations_set(main_window, rots, (sizeof(rots) / sizeof(int))); +#ifndef WAYLAND unsigned int set = 1; ecore_x_window_prop_card32_set(elm_win_xwindow_get(main_window), ECORE_X_ATOM_E_WINDOW_ROTATION_SUPPORTED, &set, 1); ecore_x_icccm_name_class_set(elm_win_xwindow_get(main_window), "Virtual Keyboard", "ISF"); +#endif vconf_notify_key_changed(VCONFKEY_LANGSET, language_changed_cb, NULL); vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, accessibility_changed_cb, NULL); @@ -305,8 +321,10 @@ void CSCLCoreUIEFL::run(const sclchar *display) impl->init(display); +#ifndef WAYLAND Ecore_Event_Handler *XClientMsgHandler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, _client_message_cb, this); +#endif signal(SIGQUIT, signal_handler); signal(SIGTERM, signal_handler); @@ -320,10 +338,12 @@ void CSCLCoreUIEFL::run(const sclchar *display) vconf_ignore_key_changed(VCONFKEY_LANGSET, language_changed_cb); vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, accessibility_changed_cb); +#ifndef WAYLAND if (XClientMsgHandler) { ecore_event_handler_del(XClientMsgHandler); XClientMsgHandler = NULL; } +#endif elm_shutdown(); } @@ -360,6 +380,7 @@ set_transient_for_app_window(Evas_Object *window) { /* Set a transient window for window stack */ /* Gets the current XID of the active window into the root window property */ +#ifndef WAYLAND Atom type_return; unsigned long nitems_return; unsigned long bytes_after_return; @@ -385,6 +406,7 @@ set_transient_for_app_window(Evas_Object *window) XFree(data); } } +#endif } static void @@ -392,6 +414,7 @@ set_transient_for_isf_setting_window(Evas_Object *window) { /* Set a transient window for window stack */ /* Gets the current XID of the active window into the root window property */ +#ifndef WAYLAND Atom type_return; unsigned long nitems_return; unsigned long bytes_after_return; @@ -421,6 +444,7 @@ set_transient_for_isf_setting_window(Evas_Object *window) XFree(data); } } +#endif } sclwindow CSCLCoreUIEFL::create_option_window(SCLOptionWindowType type) @@ -476,7 +500,11 @@ sclwindow CSCLCoreUIEFL::create_option_window(SCLOptionWindowType type) Ecore_Event_Handler *handler = NULL; if (type == OPTION_WINDOW_TYPE_NORMAL) { +#ifdef WAYLAND + handler = ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_OUT, focus_out_cb, &m_option_window_info[type]); +#else handler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_OUT, focus_out_cb, &m_option_window_info[type]); +#endif set_transient_for_app_window(window); } else if (type == OPTION_WINDOW_TYPE_SETTING_APPLICATION) { set_transient_for_isf_setting_window(window); -- 2.7.4 From 7f074f078c7ca019f0b86689e889988ada8583b6 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 11 Jun 2015 17:59:35 +0900 Subject: [PATCH 06/16] Remove unsupported signal temporarily Change-Id: Id6375603e9ea1be5ce439cbcd557aae6913f35a1 --- src/sclconnection-isf.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index 96bbb22..b178d9a 100644 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -597,8 +597,6 @@ sclboolean CSCLConnectionISF::init() m_helper_agent.signal_connect_associate_table_page_up (scim::slot (slot_associate_table_page_up)); m_helper_agent.signal_connect_associate_table_page_down (scim::slot (slot_associate_table_page_down)); m_helper_agent.signal_connect_update_associate_table_page_size (scim::slot (slot_update_associate_table_page_size)); - m_helper_agent.signal_connect_show_option_window (scim::slot (slot_show_ise_option_window)); - m_helper_agent.signal_connect_check_option_window (scim::slot (slot_check_ise_option_window)); m_helper_agent.signal_connect_process_key_event (scim::slot (slot_process_key_event)); m_initialized = TRUE; -- 2.7.4 From 555cc6cc1b9a6d4681959dc17270a71764845cda Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 11 Jun 2015 18:46:54 +0900 Subject: [PATCH 07/16] Support 64bit architecture Change-Id: I9ee26cbdee99f19b051879e819802ea430e8f3d6 --- CMakeLists.txt | 4 ++-- packaging/libscl-core.spec | 4 ++-- src/sclconnection-isf.cpp | 7 +++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bb3989..d84b5e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ SET(SRCS SET(PACKAGE ${PROJECT_NAME}) SET(PKGNAME ${PACKAGE}) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) -SET(LIBDIR "${PREFIX}/lib") +SET(LIBDIR ${LIB_INSTALL_DIR}) IF("${CMAKE_BUILD_TYPE}" STREQUAL "") SET(CMAKE_BUILD_TYPE "Release") @@ -67,4 +67,4 @@ INSTALL(FILES "${CMAKE_SOURCE_DIR}/src/sclcoretypes.h" DESTINATION include/libsc INSTALL(FILES "${CMAKE_SOURCE_DIR}/src/sclcorecallback.h" DESTINATION include/libscl-core) CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY) -INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig) +INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIBDIR}/pkgconfig) diff --git a/packaging/libscl-core.spec b/packaging/libscl-core.spec index c346554..0a6da98 100644 --- a/packaging/libscl-core.spec +++ b/packaging/libscl-core.spec @@ -48,9 +48,9 @@ rm -rf CMakeFiles rm -rf CMakeCache.txt %if %{with wayland} -cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -Dwith_wayland=TRUE +cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -Dwith_wayland=TRUE %else -cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} +cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} %endif make %{?jobs:-j%jobs} diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index b178d9a..2a47667 100644 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -211,7 +211,8 @@ static void slot_set_imdata (const scim::HelperAgent *agent, char *buf, size_t & if (impl) { ISCLCoreEventCallback *callback = impl->get_core_event_callback(); if (callback) { - callback->on_set_imdata(buf, len); + scl32 _len = static_cast(reinterpret_cast(len) & 0xffffffff); + callback->on_set_imdata(buf, _len); } } } @@ -221,7 +222,9 @@ static void slot_get_imdata (const scim::HelperAgent *, char **buf, size_t &len) if (impl) { ISCLCoreEventCallback *callback = impl->get_core_event_callback(); if (callback) { - callback->on_get_imdata(buf, &len); + sclu32 _len = 0; + callback->on_get_imdata(buf, &_len); + len = _len; } } } -- 2.7.4 From 03914f65a6411fbf51b698b71a4267b23412bf45 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 11 Jun 2015 21:26:19 +0900 Subject: [PATCH 08/16] Fix build error on X11 Change-Id: I520d80bb87356fb6eb6f877b3f5701513321c0f1 --- CMakeLists.txt | 1 - packaging/libscl-core.spec | 1 + src/sclcoreui-efl.cpp | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d84b5e2..80c1b23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,6 @@ SET(PKGS_CHECK_MODULES dlog isf vconf - libscl-common ) diff --git a/packaging/libscl-core.spec b/packaging/libscl-core.spec index 0a6da98..80384c0 100644 --- a/packaging/libscl-core.spec +++ b/packaging/libscl-core.spec @@ -20,6 +20,7 @@ BuildRequires: pkgconfig(isf) %if %{with wayland} %else BuildRequires: pkgconfig(ecore-x) +BuildRequires: pkgconfig(x11) %endif BuildRequires: pkgconfig(libscl-common) diff --git a/src/sclcoreui-efl.cpp b/src/sclcoreui-efl.cpp index 4ffd69d..a0606f6 100644 --- a/src/sclcoreui-efl.cpp +++ b/src/sclcoreui-efl.cpp @@ -27,6 +27,7 @@ #ifdef WAYLAND #include #else +#include #include #include #endif -- 2.7.4 From 28fc04e21b31ec5b94f667d577504f0a0fe59dc2 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 12 Jun 2015 20:00:13 +0900 Subject: [PATCH 09/16] Fix build warning Change-Id: I6e0e0ddb8ac810c6e053af2883008738dc236f81 --- src/sclconnection-isf.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index 2a47667..8793790 100644 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -621,12 +621,13 @@ void CSCLConnectionISF::open_connection(const sclchar *display) int fd = m_helper_agent.get_connection_number(); if (fd >= 0) { +#ifndef WAYLAND Evas_Object *main_window = NULL; CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); if (impl) { main_window = NATIVE_WINDOW_CAST(impl->get_main_window()); } -#ifndef WAYLAND + Ecore_X_Window xwindow = elm_win_xwindow_get(main_window); char xid[255]; snprintf(xid, 255, "%d", xwindow); -- 2.7.4 From fac5c3b58de9ab73db4cda2460d1bddff4abffc5 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 12 Jun 2015 20:24:06 +0900 Subject: [PATCH 10/16] Register input panel surface in wayland Change-Id: I62bdcd7c268874380b8643eacf178d97a6ae1c32 --- CMakeLists.txt | 10 +- packaging/libscl-core.spec | 2 + src/input-method-client-protocol.h | 446 +++++++++++++++++++++++++++++++++++++ src/input-method-protocol.c | 126 +++++++++++ src/sclcoreui-efl.cpp | 133 +++++++++++ 5 files changed, 715 insertions(+), 2 deletions(-) create mode 100644 src/input-method-client-protocol.h create mode 100644 src/input-method-protocol.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 80c1b23..31d0203 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(libscl-core CXX) +PROJECT(libscl-core) SET(SRCS src/sclcoreui.cpp @@ -10,6 +10,12 @@ SET(SRCS src/sclcore.cpp ) +IF (with_wayland) + SET(SRCS ${SRCS} src/input-method-protocol.c) +ELSE (with_wayland) + SET(SRCS ${SRCS}) +ENDIF (with_wayland) + SET(PACKAGE ${PROJECT_NAME}) SET(PKGNAME ${PACKAGE}) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) @@ -36,7 +42,7 @@ SET(PKGS_CHECK_MODULES IF (with_wayland) ADD_DEFINITIONS("-DWAYLAND") - pkg_check_modules(pkgs REQUIRED ${PKGS_CHECK_MODULES}) + pkg_check_modules(pkgs REQUIRED ${PKGS_CHECK_MODULES} ecore-wayland wayland-client) ELSE (with_wayland) pkg_check_modules(pkgs REQUIRED ${PKGS_CHECK_MODULES} ecore-x) ENDIF(with_wayland) diff --git a/packaging/libscl-core.spec b/packaging/libscl-core.spec index 80384c0..2c7e07d 100644 --- a/packaging/libscl-core.spec +++ b/packaging/libscl-core.spec @@ -18,6 +18,8 @@ BuildRequires: pkgconfig(vconf) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(isf) %if %{with wayland} +BuildRequires: pkgconfig(ecore-wayland) +BuildRequires: pkgconfig(wayland-client) %else BuildRequires: pkgconfig(ecore-x) BuildRequires: pkgconfig(x11) diff --git a/src/input-method-client-protocol.h b/src/input-method-client-protocol.h new file mode 100644 index 0000000..070a97d --- /dev/null +++ b/src/input-method-client-protocol.h @@ -0,0 +1,446 @@ +/* + * Copyright © 2012, 2013 Intel Corporation + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation, and that the name of + * the copyright holders not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + +#ifndef INPUT_METHOD_CLIENT_PROTOCOL_H +#define INPUT_METHOD_CLIENT_PROTOCOL_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include "wayland-client.h" + +struct wl_client; +struct wl_resource; + +struct wl_input_method_context; +struct wl_input_method; +struct wl_input_panel; +struct wl_input_panel_surface; + +extern const struct wl_interface wl_input_method_context_interface; +extern const struct wl_interface wl_input_method_interface; +extern const struct wl_interface wl_input_panel_interface; +extern const struct wl_interface wl_input_panel_surface_interface; + +/** + * wl_input_method_context - input method context + * @surrounding_text: surrounding text event + * @reset: (none) + * @content_type: (none) + * @invoke_action: (none) + * @commit_state: (none) + * @preferred_language: (none) + * + * Corresponds to a text model on input method side. An input method + * context is created on text mode activation on the input method side. It + * allows to receive information about the text model from the application + * via events. Input method contexts do not keep state after deactivation + * and should be destroyed after deactivation is handled. + * + * Text is generally UTF-8 encoded, indices and lengths are in bytes. + * + * Serials are used to synchronize the state between the text input and an + * input method. New serials are sent by the text input in the commit_state + * request and are used by the input method to indicate the known text + * input state in events like preedit_string, commit_string, and keysym. + * The text input can then ignore events from the input method which are + * based on an outdated state (for example after a reset). + */ +struct wl_input_method_context_listener { + /** + * surrounding_text - surrounding text event + * @text: (none) + * @cursor: (none) + * @anchor: (none) + * + * The plain surrounding text around the input position. Cursor + * is the position in bytes within the surrounding text relative to + * the beginning of the text. Anchor is the position in bytes of + * the selection anchor within the surrounding text relative to the + * beginning of the text. If there is no selected text anchor is + * the same as cursor. + */ + void (*surrounding_text)(void *data, + struct wl_input_method_context *wl_input_method_context, + const char *text, + uint32_t cursor, + uint32_t anchor); + /** + * reset - (none) + */ + void (*reset)(void *data, + struct wl_input_method_context *wl_input_method_context); + /** + * content_type - (none) + * @hint: (none) + * @purpose: (none) + */ + void (*content_type)(void *data, + struct wl_input_method_context *wl_input_method_context, + uint32_t hint, + uint32_t purpose); + /** + * invoke_action - (none) + * @button: (none) + * @index: (none) + */ + void (*invoke_action)(void *data, + struct wl_input_method_context *wl_input_method_context, + uint32_t button, + uint32_t index); + /** + * commit_state - (none) + * @serial: serial of text input state + */ + void (*commit_state)(void *data, + struct wl_input_method_context *wl_input_method_context, + uint32_t serial); + /** + * preferred_language - (none) + * @language: (none) + */ + void (*preferred_language)(void *data, + struct wl_input_method_context *wl_input_method_context, + const char *language); +}; + +static inline int +wl_input_method_context_add_listener(struct wl_input_method_context *wl_input_method_context, + const struct wl_input_method_context_listener *listener, void *data) +{ + return wl_proxy_add_listener((struct wl_proxy *) wl_input_method_context, + (void (**)(void)) listener, data); +} + +#define WL_INPUT_METHOD_CONTEXT_DESTROY 0 +#define WL_INPUT_METHOD_CONTEXT_COMMIT_STRING 1 +#define WL_INPUT_METHOD_CONTEXT_PREEDIT_STRING 2 +#define WL_INPUT_METHOD_CONTEXT_PREEDIT_STYLING 3 +#define WL_INPUT_METHOD_CONTEXT_PREEDIT_CURSOR 4 +#define WL_INPUT_METHOD_CONTEXT_DELETE_SURROUNDING_TEXT 5 +#define WL_INPUT_METHOD_CONTEXT_CURSOR_POSITION 6 +#define WL_INPUT_METHOD_CONTEXT_MODIFIERS_MAP 7 +#define WL_INPUT_METHOD_CONTEXT_KEYSYM 8 +#define WL_INPUT_METHOD_CONTEXT_GRAB_KEYBOARD 9 +#define WL_INPUT_METHOD_CONTEXT_KEY 10 +#define WL_INPUT_METHOD_CONTEXT_MODIFIERS 11 +#define WL_INPUT_METHOD_CONTEXT_LANGUAGE 12 +#define WL_INPUT_METHOD_CONTEXT_TEXT_DIRECTION 13 + +static inline void +wl_input_method_context_set_user_data(struct wl_input_method_context *wl_input_method_context, void *user_data) +{ + wl_proxy_set_user_data((struct wl_proxy *) wl_input_method_context, user_data); +} + +static inline void * +wl_input_method_context_get_user_data(struct wl_input_method_context *wl_input_method_context) +{ + return wl_proxy_get_user_data((struct wl_proxy *) wl_input_method_context); +} + +static inline void +wl_input_method_context_destroy(struct wl_input_method_context *wl_input_method_context) +{ + wl_proxy_marshal((struct wl_proxy *) wl_input_method_context, + WL_INPUT_METHOD_CONTEXT_DESTROY); + + wl_proxy_destroy((struct wl_proxy *) wl_input_method_context); +} + +static inline void +wl_input_method_context_commit_string(struct wl_input_method_context *wl_input_method_context, uint32_t serial, const char *text) +{ + wl_proxy_marshal((struct wl_proxy *) wl_input_method_context, + WL_INPUT_METHOD_CONTEXT_COMMIT_STRING, serial, text); +} + +static inline void +wl_input_method_context_preedit_string(struct wl_input_method_context *wl_input_method_context, uint32_t serial, const char *text, const char *commit) +{ + wl_proxy_marshal((struct wl_proxy *) wl_input_method_context, + WL_INPUT_METHOD_CONTEXT_PREEDIT_STRING, serial, text, commit); +} + +static inline void +wl_input_method_context_preedit_styling(struct wl_input_method_context *wl_input_method_context, uint32_t index, uint32_t length, uint32_t style) +{ + wl_proxy_marshal((struct wl_proxy *) wl_input_method_context, + WL_INPUT_METHOD_CONTEXT_PREEDIT_STYLING, index, length, style); +} + +static inline void +wl_input_method_context_preedit_cursor(struct wl_input_method_context *wl_input_method_context, int32_t index) +{ + wl_proxy_marshal((struct wl_proxy *) wl_input_method_context, + WL_INPUT_METHOD_CONTEXT_PREEDIT_CURSOR, index); +} + +static inline void +wl_input_method_context_delete_surrounding_text(struct wl_input_method_context *wl_input_method_context, int32_t index, uint32_t length) +{ + wl_proxy_marshal((struct wl_proxy *) wl_input_method_context, + WL_INPUT_METHOD_CONTEXT_DELETE_SURROUNDING_TEXT, index, length); +} + +static inline void +wl_input_method_context_cursor_position(struct wl_input_method_context *wl_input_method_context, int32_t index, int32_t anchor) +{ + wl_proxy_marshal((struct wl_proxy *) wl_input_method_context, + WL_INPUT_METHOD_CONTEXT_CURSOR_POSITION, index, anchor); +} + +static inline void +wl_input_method_context_modifiers_map(struct wl_input_method_context *wl_input_method_context, struct wl_array *map) +{ + wl_proxy_marshal((struct wl_proxy *) wl_input_method_context, + WL_INPUT_METHOD_CONTEXT_MODIFIERS_MAP, map); +} + +static inline void +wl_input_method_context_keysym(struct wl_input_method_context *wl_input_method_context, uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers) +{ + wl_proxy_marshal((struct wl_proxy *) wl_input_method_context, + WL_INPUT_METHOD_CONTEXT_KEYSYM, serial, time, sym, state, modifiers); +} + +static inline struct wl_keyboard * +wl_input_method_context_grab_keyboard(struct wl_input_method_context *wl_input_method_context) +{ + struct wl_proxy *keyboard; + + keyboard = wl_proxy_create((struct wl_proxy *) wl_input_method_context, + &wl_keyboard_interface); + if (!keyboard) + return NULL; + + wl_proxy_marshal((struct wl_proxy *) wl_input_method_context, + WL_INPUT_METHOD_CONTEXT_GRAB_KEYBOARD, keyboard); + + return (struct wl_keyboard *) keyboard; +} + +static inline void +wl_input_method_context_key(struct wl_input_method_context *wl_input_method_context, uint32_t serial, uint32_t time, uint32_t key, uint32_t state) +{ + wl_proxy_marshal((struct wl_proxy *) wl_input_method_context, + WL_INPUT_METHOD_CONTEXT_KEY, serial, time, key, state); +} + +static inline void +wl_input_method_context_modifiers(struct wl_input_method_context *wl_input_method_context, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) +{ + wl_proxy_marshal((struct wl_proxy *) wl_input_method_context, + WL_INPUT_METHOD_CONTEXT_MODIFIERS, serial, mods_depressed, mods_latched, mods_locked, group); +} + +static inline void +wl_input_method_context_language(struct wl_input_method_context *wl_input_method_context, uint32_t serial, const char *language) +{ + wl_proxy_marshal((struct wl_proxy *) wl_input_method_context, + WL_INPUT_METHOD_CONTEXT_LANGUAGE, serial, language); +} + +static inline void +wl_input_method_context_text_direction(struct wl_input_method_context *wl_input_method_context, uint32_t serial, uint32_t direction) +{ + wl_proxy_marshal((struct wl_proxy *) wl_input_method_context, + WL_INPUT_METHOD_CONTEXT_TEXT_DIRECTION, serial, direction); +} + +/** + * wl_input_method - input method + * @activate: activate event + * @deactivate: activate event + * + * An input method object is responsible to compose text in response to + * input from hardware or virtual keyboards. There is one input method + * object per seat. On activate there is a new input method context object + * created which allows the input method to communicate with the text + * model. + */ +struct wl_input_method_listener { + /** + * activate - activate event + * @id: (none) + * + * A text model was activated. Creates an input method context + * object which allows communication with the text model. + */ + void (*activate)(void *data, + struct wl_input_method *wl_input_method, + struct wl_input_method_context *id); + /** + * deactivate - activate event + * @context: (none) + * + * The text model corresponding to the context argument was + * deactivated. The input method context should be destroyed after + * deactivation is handled. + */ + void (*deactivate)(void *data, + struct wl_input_method *wl_input_method, + struct wl_input_method_context *context); +}; + +static inline int +wl_input_method_add_listener(struct wl_input_method *wl_input_method, + const struct wl_input_method_listener *listener, void *data) +{ + return wl_proxy_add_listener((struct wl_proxy *) wl_input_method, + (void (**)(void)) listener, data); +} + +static inline void +wl_input_method_set_user_data(struct wl_input_method *wl_input_method, void *user_data) +{ + wl_proxy_set_user_data((struct wl_proxy *) wl_input_method, user_data); +} + +static inline void * +wl_input_method_get_user_data(struct wl_input_method *wl_input_method) +{ + return wl_proxy_get_user_data((struct wl_proxy *) wl_input_method); +} + +static inline void +wl_input_method_destroy(struct wl_input_method *wl_input_method) +{ + wl_proxy_destroy((struct wl_proxy *) wl_input_method); +} + +#define WL_INPUT_PANEL_GET_INPUT_PANEL_SURFACE 0 + +static inline void +wl_input_panel_set_user_data(struct wl_input_panel *wl_input_panel, void *user_data) +{ + wl_proxy_set_user_data((struct wl_proxy *) wl_input_panel, user_data); +} + +static inline void * +wl_input_panel_get_user_data(struct wl_input_panel *wl_input_panel) +{ + return wl_proxy_get_user_data((struct wl_proxy *) wl_input_panel); +} + +static inline void +wl_input_panel_destroy(struct wl_input_panel *wl_input_panel) +{ + wl_proxy_destroy((struct wl_proxy *) wl_input_panel); +} + +static inline struct wl_input_panel_surface * +wl_input_panel_get_input_panel_surface(struct wl_input_panel *wl_input_panel, struct wl_surface *surface) +{ + struct wl_proxy *id; + + id = wl_proxy_create((struct wl_proxy *) wl_input_panel, + &wl_input_panel_surface_interface); + if (!id) + return NULL; + + wl_proxy_marshal((struct wl_proxy *) wl_input_panel, + WL_INPUT_PANEL_GET_INPUT_PANEL_SURFACE, id, surface); + + return (struct wl_input_panel_surface *) id; +} + +#ifndef WL_INPUT_PANEL_SURFACE_POSITION_ENUM +#define WL_INPUT_PANEL_SURFACE_POSITION_ENUM +enum wl_input_panel_surface_position { + WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM = 0, +}; +#endif /* WL_INPUT_PANEL_SURFACE_POSITION_ENUM */ + +struct wl_input_panel_surface_listener { + /** + * cursor_rectangle - cursor rectangle + * @x: (none) + * @y: (none) + * @width: (none) + * @height: (none) + * + * Notify when the cursor rectangle relative to the input panel + * surface change. + */ + void (*cursor_rectangle)(void *data, + struct wl_input_panel_surface *wl_input_panel_surface, + int32_t x, + int32_t y, + int32_t width, + int32_t height); +}; + +static inline int +wl_input_panel_surface_add_listener(struct wl_input_panel_surface *wl_input_panel_surface, + const struct wl_input_panel_surface_listener *listener, void *data) +{ + return wl_proxy_add_listener((struct wl_proxy *) wl_input_panel_surface, + (void (**)(void)) listener, data); +} + +#define WL_INPUT_PANEL_SURFACE_SET_TOPLEVEL 0 +#define WL_INPUT_PANEL_SURFACE_SET_OVERLAY_PANEL 1 + +static inline void +wl_input_panel_surface_set_user_data(struct wl_input_panel_surface *wl_input_panel_surface, void *user_data) +{ + wl_proxy_set_user_data((struct wl_proxy *) wl_input_panel_surface, user_data); +} + +static inline void * +wl_input_panel_surface_get_user_data(struct wl_input_panel_surface *wl_input_panel_surface) +{ + return wl_proxy_get_user_data((struct wl_proxy *) wl_input_panel_surface); +} + +static inline void +wl_input_panel_surface_destroy(struct wl_input_panel_surface *wl_input_panel_surface) +{ + wl_proxy_destroy((struct wl_proxy *) wl_input_panel_surface); +} + +static inline void +wl_input_panel_surface_set_toplevel(struct wl_input_panel_surface *wl_input_panel_surface, struct wl_output *output, uint32_t position) +{ + wl_proxy_marshal((struct wl_proxy *) wl_input_panel_surface, + WL_INPUT_PANEL_SURFACE_SET_TOPLEVEL, output, position); +} + +static inline void +wl_input_panel_surface_set_overlay_panel(struct wl_input_panel_surface *wl_input_panel_surface) +{ + wl_proxy_marshal((struct wl_proxy *) wl_input_panel_surface, + WL_INPUT_PANEL_SURFACE_SET_OVERLAY_PANEL); +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/input-method-protocol.c b/src/input-method-protocol.c new file mode 100644 index 0000000..ee297f9 --- /dev/null +++ b/src/input-method-protocol.c @@ -0,0 +1,126 @@ +/* + * Copyright © 2012, 2013 Intel Corporation + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation, and that the name of + * the copyright holders not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ +//#ifdef __cplusplus +#pragma message("extern C-----") +//extern "C" { +//#endif + +#include +#include +#include "wayland-util.h" + +extern const struct wl_interface wl_keyboard_interface; +extern const struct wl_interface wl_input_method_context_interface; +extern const struct wl_interface wl_input_method_context_interface; +extern const struct wl_interface wl_input_panel_surface_interface; +extern const struct wl_interface wl_surface_interface; +extern const struct wl_interface wl_output_interface; + +static const struct wl_interface *types[] = { + NULL, + NULL, + NULL, + NULL, + NULL, + &wl_keyboard_interface, + &wl_input_method_context_interface, + &wl_input_method_context_interface, + &wl_input_panel_surface_interface, + &wl_surface_interface, + &wl_output_interface, + NULL, +}; + +static const struct wl_message wl_input_method_context_requests[] = { + { "destroy", "", types + 0 }, + { "commit_string", "us", types + 0 }, + { "preedit_string", "uss", types + 0 }, + { "preedit_styling", "uuu", types + 0 }, + { "preedit_cursor", "i", types + 0 }, + { "delete_surrounding_text", "iu", types + 0 }, + { "cursor_position", "ii", types + 0 }, + { "modifiers_map", "a", types + 0 }, + { "keysym", "uuuuu", types + 0 }, + { "grab_keyboard", "n", types + 5 }, + { "key", "uuuu", types + 0 }, + { "modifiers", "uuuuu", types + 0 }, + { "language", "us", types + 0 }, + { "text_direction", "uu", types + 0 }, +}; + +static const struct wl_message wl_input_method_context_events[] = { + { "surrounding_text", "suu", types + 0 }, + { "reset", "", types + 0 }, + { "content_type", "uu", types + 0 }, + { "invoke_action", "uu", types + 0 }, + { "commit_state", "u", types + 0 }, + { "preferred_language", "s", types + 0 }, +}; + +WL_EXPORT const struct wl_interface wl_input_method_context_interface = { + "wl_input_method_context", 1, + 14, wl_input_method_context_requests, + 6, wl_input_method_context_events, +}; + +static const struct wl_message wl_input_method_events[] = { + { "activate", "n", types + 6 }, + { "deactivate", "o", types + 7 }, +}; + +WL_EXPORT const struct wl_interface wl_input_method_interface = { + "wl_input_method", 1, + 0, NULL, + 2, wl_input_method_events, +}; + +static const struct wl_message wl_input_panel_requests[] = { + { "get_input_panel_surface", "no", types + 8 }, +}; + +WL_EXPORT const struct wl_interface wl_input_panel_interface = { + "wl_input_panel", 1, + 1, wl_input_panel_requests, + 0, NULL, +}; + +static const struct wl_message wl_input_panel_surface_requests[] = { + { "set_toplevel", "ou", types + 10 }, + { "set_overlay_panel", "", types + 0 }, +}; + +static const struct wl_message wl_input_panel_surface_events[] = { + { "cursor_rectangle", "iiii", types + 0 }, +}; + +WL_EXPORT const struct wl_interface wl_input_panel_surface_interface = { + "wl_input_panel_surface", 1, + 2, wl_input_panel_surface_requests, + 1, wl_input_panel_surface_events, +}; + +//#ifdef __cplusplus +//} +//#endif diff --git a/src/sclcoreui-efl.cpp b/src/sclcoreui-efl.cpp index a0606f6..b071dda 100644 --- a/src/sclcoreui-efl.cpp +++ b/src/sclcoreui-efl.cpp @@ -26,12 +26,27 @@ #include #ifdef WAYLAND #include +#include "input-method-client-protocol.h" #else #include #include #include #endif +#ifdef WAYLAND +struct WaylandKeyboard +{ + Ecore_Evas *ee; + Ecore_Wl_Window *wl_win; + const char *ee_engine; + + struct wl_surface *surface; + struct wl_input_panel *ip; + struct wl_output *output; +}; + +struct WaylandKeyboard wlkb = {0}; +#endif using namespace scl; @@ -273,6 +288,100 @@ void signal_handler(int sig) { elm_exit(); } +#ifdef WAYLAND +static bool +_wayland_setup(struct WaylandKeyboard *wlkb, Evas_Object *main_window) +{ + Eina_Inlist *globals; + struct wl_registry *registry; + Ecore_Wl_Global *global; + struct wl_input_panel_surface *ips; + + if (!(registry = ecore_wl_registry_get())) + return false; + + if (!(globals = ecore_wl_globals_get())) + return false; + + EINA_INLIST_FOREACH(globals, global) + { + if (strcmp(global->interface, "wl_input_panel") == 0) + wlkb->ip = (wl_input_panel *)wl_registry_bind(registry, global->id, &wl_input_panel_interface, 1); + else if (strcmp(global->interface, "wl_output") == 0) + wlkb->output = (wl_output *)wl_registry_bind(registry, global->id, &wl_output_interface, 1); + } + + if (!wlkb->ip) { + LOGW ("Can't get wayland input panel interface\n"); + return false; + } + + if (!wlkb->output) { + LOGW ("Can't get wayland output interface\n"); + return false; + } + + wlkb->ee = ecore_evas_ecore_evas_get(evas_object_evas_get(main_window)); + if (!wlkb->ee) { + LOGW ("ERROR: Unable to create Ecore_Evas object"); + return false; + } + + /* Set input panel surface */ + LOGD ("Setting up input panel\n"); + wlkb->wl_win = ecore_evas_wayland_window_get(wlkb->ee); + if (!wlkb->wl_win) { + LOGW ("Couldn't get wayland window\n"); + return false; + } + + ecore_wl_window_type_set(wlkb->wl_win, ECORE_WL_WINDOW_TYPE_NONE); + wlkb->surface = ecore_wl_window_surface_create(wlkb->wl_win); + if (!wlkb->surface) { + LOGW ("Couldn't create surface\n"); + return false; + } + + ips = wl_input_panel_get_input_panel_surface(wlkb->ip, wlkb->surface); + if (!ips) { + LOGW ("Couldn't get input panel surface\n"); + return false; + } + + wl_input_panel_surface_set_toplevel(ips, wlkb->output, WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM); + + return true; +} + +static Eina_Bool +check_evas_engine(struct WaylandKeyboard *wlkb) +{ + Eina_Bool ret = EINA_FALSE; + char *env = getenv("ECORE_EVAS_ENGINE"); + + if (!env) { + if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_WAYLAND_SHM)) + env = "wayland_shm"; + else if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_WAYLAND_EGL)) + env = "wayland_egl"; + else { + LOGW ("ERROR: Ecore_Evas does must be compiled with support for Wayland engines\n"); + goto err; + } + } + else if (strcmp(env, "wayland_shm") != 0 && strcmp(env, "wayland_egl") != 0) { + LOGW ("ERROR: ECORE_EVAS_ENGINE must be set to either 'wayland_shm' or 'wayland_egl'\n"); + goto err; + } + + wlkb->ee_engine = env; + ret = EINA_TRUE; + +err: + return ret; +} +#endif + void CSCLCoreUIEFL::run(const sclchar *display) { char *argv[4]; @@ -291,11 +400,33 @@ void CSCLCoreUIEFL::run(const sclchar *display) elm_init(argc, argv); +#ifdef WAYLAND + if (!check_evas_engine(&wlkb)) { + LOGW ("_wlkb_check_evas_engine error!\n"); + elm_shutdown (); + return; + } + LOGD ("Selected engine: '%s'\n", wlkb.ee_engine); +#endif + elm_policy_set(ELM_POLICY_THROTTLE, ELM_POLICY_THROTTLE_NEVER); Evas_Object *main_window = elm_win_add(NULL, uuid, ELM_WIN_UTILITY); + if (!main_window) { + LOGE("Failed to create main window\n"); + return; + } + m_main_window = SCL_WINDOW_CAST(main_window); +#ifdef WAYLAND + if (!_wayland_setup(&wlkb, main_window)) { + LOGW ("ERROR: Unable to setup input panel.\n"); + elm_shutdown(); + return; + } +#endif + elm_win_borderless_set(main_window, EINA_TRUE); elm_win_keyboard_win_set(main_window, EINA_TRUE); elm_win_autodel_set(main_window, EINA_TRUE); @@ -332,6 +463,8 @@ void CSCLCoreUIEFL::run(const sclchar *display) signal(SIGINT, signal_handler); signal(SIGHUP, signal_handler); + evas_object_show(main_window); + elm_run(); impl->fini(); -- 2.7.4 From 1a18fd4cbce225b405298fbd6dff7177da6fa03b Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 22 Jun 2015 03:31:12 -0700 Subject: [PATCH 11/16] Revert "Remove unsupported signal temporarily" This reverts commit 7f074f078c7ca019f0b86689e889988ada8583b6. Change-Id: I7b9aaab5863a8d0de18418826a5400a0204410b4 --- src/sclconnection-isf.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index b178d9a..96bbb22 100644 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -597,6 +597,8 @@ sclboolean CSCLConnectionISF::init() m_helper_agent.signal_connect_associate_table_page_up (scim::slot (slot_associate_table_page_up)); m_helper_agent.signal_connect_associate_table_page_down (scim::slot (slot_associate_table_page_down)); m_helper_agent.signal_connect_update_associate_table_page_size (scim::slot (slot_update_associate_table_page_size)); + m_helper_agent.signal_connect_show_option_window (scim::slot (slot_show_ise_option_window)); + m_helper_agent.signal_connect_check_option_window (scim::slot (slot_check_ise_option_window)); m_helper_agent.signal_connect_process_key_event (scim::slot (slot_process_key_event)); m_initialized = TRUE; -- 2.7.4 From 78196b9bb6243d756158601c9533f026131da995 Mon Sep 17 00:00:00 2001 From: Wonkeun Oh Date: Wed, 17 Jun 2015 19:10:13 +0900 Subject: [PATCH 12/16] Modified window acceleration unit to fix graphic issue Change-Id: I3a191890c7275155834495040a18847bf1cc90de --- src/sclcoreui-efl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sclcoreui-efl.cpp b/src/sclcoreui-efl.cpp index b071dda..3efd14d 100644 --- a/src/sclcoreui-efl.cpp +++ b/src/sclcoreui-efl.cpp @@ -409,6 +409,7 @@ void CSCLCoreUIEFL::run(const sclchar *display) LOGD ("Selected engine: '%s'\n", wlkb.ee_engine); #endif + elm_config_accel_preference_set("3d"); elm_policy_set(ELM_POLICY_THROTTLE, ELM_POLICY_THROTTLE_NEVER); Evas_Object *main_window = elm_win_add(NULL, uuid, ELM_WIN_UTILITY); -- 2.7.4 From fe33cfa99a409ed91f5e98e7c04f3d2b895f2694 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 2 Jul 2015 10:36:24 +0900 Subject: [PATCH 13/16] Add manifest file Change-Id: Ideb3aa101595ea3a8cb9987be630c2fa787800f3 --- libscl-core.manifest | 5 +++++ packaging/libscl-core.spec | 1 + 2 files changed, 6 insertions(+) create mode 100644 libscl-core.manifest diff --git a/libscl-core.manifest b/libscl-core.manifest new file mode 100644 index 0000000..017d22d --- /dev/null +++ b/libscl-core.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/libscl-core.spec b/packaging/libscl-core.spec index 2c7e07d..031ae7a 100644 --- a/packaging/libscl-core.spec +++ b/packaging/libscl-core.spec @@ -71,6 +71,7 @@ cp LICENSE %{buildroot}/usr/share/license/%{name} %postun %files +%manifest %{name}.manifest %defattr(-,root,root,-) %{_libdir}/libscl-core.so /usr/share/license/%{name} -- 2.7.4 From 4ded716c428a960f927b7e9625e5d9f739e8cf7c Mon Sep 17 00:00:00 2001 From: Sungmin Kwak Date: Fri, 10 Jul 2015 13:27:44 +0900 Subject: [PATCH 14/16] Delete unnecessary file Change-Id: Ib06f02d0c3e87db909d61c239c97e8ea3c1fd1fa --- packaging/libscl-core.manifest | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 packaging/libscl-core.manifest diff --git a/packaging/libscl-core.manifest b/packaging/libscl-core.manifest deleted file mode 100644 index 017d22d..0000000 --- a/packaging/libscl-core.manifest +++ /dev/null @@ -1,5 +0,0 @@ - - - - - -- 2.7.4 From bde4cbece55e4e378da5e57c6c5b7a23773c522a Mon Sep 17 00:00:00 2001 From: Sungmin Kwak Date: Fri, 10 Jul 2015 13:28:41 +0900 Subject: [PATCH 15/16] Update package version to 0.4.1 Change-Id: Ib6ae5bac73b6cd8d583ee342df03e47715e3e6ee --- packaging/libscl-core.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libscl-core.spec b/packaging/libscl-core.spec index 031ae7a..2eb49a0 100644 --- a/packaging/libscl-core.spec +++ b/packaging/libscl-core.spec @@ -6,7 +6,7 @@ Name: libscl-core Summary: A library for developing software keyboards -Version: 0.4.0 +Version: 0.4.1 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 87bc7b46150a8438939577ccde06deb573b3b3ee Mon Sep 17 00:00:00 2001 From: Sungmin Kwak Date: Mon, 13 Jul 2015 19:04:39 +0900 Subject: [PATCH 16/16] Add x11 dependency Change-Id: I4e3f41114dd76fd9a551a6c81df98d003e59a54c --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31d0203..b828496 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,7 @@ IF (with_wayland) ADD_DEFINITIONS("-DWAYLAND") pkg_check_modules(pkgs REQUIRED ${PKGS_CHECK_MODULES} ecore-wayland wayland-client) ELSE (with_wayland) - pkg_check_modules(pkgs REQUIRED ${PKGS_CHECK_MODULES} ecore-x) + pkg_check_modules(pkgs REQUIRED ${PKGS_CHECK_MODULES} ecore-x x11) ENDIF(with_wayland) FOREACH(flag ${pkgs_CFLAGS}) -- 2.7.4