pkgconfig_DATA = isf.pc scim.pc \
$(GTK_UTILS_PKGCONFIG)
+if ISF_BUILD_KBD_MODE_CHANGER
+kbdmodechangerxmldir = /usr/share/packages/
+kbdmodechangerxml_DATA = org.tizen.isf-kbd-mode-changer.xml
+endif
if ISF_INSTALL_SYSTEMD_SCRIPT
SYSTEMD_SCRIPT = scim.service
# Check App Control
PKG_CHECK_MODULES(APP_CONTROL, [capi-appfw-app-control])
+# Check appfw library
+PKG_CHECK_MODULES(APPFW, [capi-appfw-application])
+
# Check core package manager
PKG_CHECK_MODULES(PKGMGR_INFO, [pkgmgr-info],
[ISF_HAS_PKGMGR_INFO=yes],
AM_CONDITIONAL(ISF_INSTALL_SYSTEMD_SCRIPT,
[test "$enable_lazy_launch" = "no"])
+AM_CONDITIONAL(ISF_BUILD_KBD_MODE_CHANGER,
+ [test "$ISF_HAS_ECOREX" = "yes"])
+
AC_SUBST(SCIM_BUILD_TESTS)
AC_SUBST(SCIM_BUILD_CONFIG_SIMPLE)
AC_SUBST(SCIM_BUILD_CONFIG_SOCKET)
AC_SUBST(ISF_BUILD_WITH_GCONF)
AC_SUBST(ISF_BUILD_DB_UTIL)
AC_SUBST(ISF_INSTALL_SYSTEMD_SCRIPT)
+AC_SUBST(ISF_BUILD_KBD_MODE_CHANGER)
ISF_BUILDING_DLL="-DISF_BUILDING_DLL"
AC_SUBST(ISF_BUILDING_DLL)
ism/extras/gtk2_immodule/Makefile
ism/extras/efl_immodule/Makefile
ism/extras/efl_panel/Makefile
+ ism/extras/kbd_mode_changer/Makefile
ism/extras/efl_wsm/Makefile
ism/extras/efl_wsc/Makefile
ism/demos/Makefile
MAINTAINERCLEANFILES = Makefile.in
CLEANFILES = *.bak
-SUBDIRS = gtk2_immodule efl_panel efl_immodule efl_wsm efl_wsc
+SUBDIRS = gtk2_immodule efl_panel efl_immodule kbd_mode_changer efl_wsm efl_wsc
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+CLEANFILES = *.bak
+
+INCLUDES = -I$(top_builddir) \
+ -I$(top_builddir)/ism/src \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/ism/src \
+ -I$(top_srcdir)/ism/intl \
+ -I$(top_srcdir)/ism/data \
+ -I$(top_srcdir)/ism/utils \
+ -I$(top_srcdir)/ism/extras/kbd_mode_changer/include \
+ -I$(includedir) \
+ -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@\"
+
+
+noinst_HEADERS =
+
+if ISF_BUILD_KBD_MODE_CHANGER
+ISF_KBD_MODE_CHANGER = isf-kbd-mode-changer
+endif
+
+appexecdir = /usr/apps/org.tizen.isf-kbd-mode-changer/bin/
+appexec_PROGRAMS = $(ISF_KBD_MODE_CHANGER)
+
+isf_kbd_mode_changer_SOURCES = main.cpp
+
+isf_kbd_mode_changer_CXXFLAGS = @EFL_CFLAGS@ \
+ @DLOG_CFLAGS@ \
+ @APPFW_CFLAGS@
+
+isf_kbd_mode_changer_LDFLAGS = @EFL_LIBS@ -rpath $(libdir)\
+ @DLOG_LIBS@ \
+ @APPFW_LIBS@
+
+isf_kbd_mode_changer_LDADD = $(top_builddir)/ism/src/libscim@SCIM_EPOCH@.la
--- /dev/null
+/*
+ * ISF(Input Service Framework)
+ *
+ * ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable.
+ * Copyright (c) 2012-2014 Samsung Electronics Co., Ltd.
+ *
+ * Contact: Wonkeun Oh <wonkeun.oh@samsung.com>, Jihoon Kim <jihoon48.kim@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 __MAIN_H__
+#define __MAIN_H__
+
+#include <Elementary.h>
+#include <app.h>
+#include <dlog.h>
+
+#if !defined(PACKAGE)
+# define PACKAGE "isf-kbd-mode-changer"
+#endif
+
+#if !defined(PKGNAME)
+# define PKGNAME "org.tizen.isf-kbd-mode-changer"
+#endif
+
+#ifdef LOG_TAG
+# undef LOG_TAG
+#endif
+#define LOG_TAG "ISF_KBD_MODE_CHANGER"
+
+#endif /* __MAIN_H__ */
--- /dev/null
+/*
+ * ISF(Input Service Framework)
+ *
+ * ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable.
+ * Copyright (c) 2012-2014 Samsung Electronics Co., Ltd.
+ *
+ * Contact: Wonkeun Oh <wonkeun.oh@samsung.com>, Jihoon Kim <jihoon48.kim@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
+ *
+ */
+
+#include <Ecore_X.h>
+#include <Elementary.h>
+#include "main.h"
+
+typedef enum
+{
+ TOOLBAR_KEYBOARD_MODE = 0, /* Hardware keyboard ISE */
+ TOOLBAR_HELPER_MODE /* Software keyboard ISE */
+} TOOLBAR_MODE_T;
+
+
+#define E_PROP_DEVICEMGR_INPUTWIN "DeviceMgr Input Window"
+#define E_PROP_DEVICEMGR_CONTROLWIN "_ISF_CONTROL_WINDOW"
+#define PROP_X_EXT_KEYBOARD_INPUT_DETECTED "HW Keyboard Input Started"
+#define PROP_X_EXT_KEYBOARD_EXIST "X External Keyboard Exist"
+
+
+bool app_create (void *user_data)
+{
+ LOGD ("app create");
+ return true;
+}
+
+void app_control (app_control_h app_control, void *user_data)
+{
+ LOGD ("%s", __func__);
+
+ Ecore_X_Atom prop_x_keyboard_input_detected = 0;
+ TOOLBAR_MODE_T kbd_mode = TOOLBAR_HELPER_MODE;
+ Ecore_X_Window _control_win = 0;
+ Ecore_X_Window _input_win = 0;
+ int ret = 0;
+ unsigned int val = 0;
+
+ LOGD ("isf_extra_hwkbd_module start");
+
+ Ecore_X_Atom atom = ecore_x_atom_get (E_PROP_DEVICEMGR_CONTROLWIN);
+ ecore_x_window_prop_xid_get (ecore_x_window_root_first_get (), atom, ECORE_X_ATOM_WINDOW, &_control_win, 1);
+
+ if (!prop_x_keyboard_input_detected)
+ prop_x_keyboard_input_detected = ecore_x_atom_get (PROP_X_EXT_KEYBOARD_INPUT_DETECTED);
+
+ if (ecore_x_window_prop_card32_get (_control_win, prop_x_keyboard_input_detected, &val, 1) > 0) {
+ if (val == 1) {
+ kbd_mode = TOOLBAR_KEYBOARD_MODE;
+ } else {
+ kbd_mode = TOOLBAR_HELPER_MODE;
+ }
+ } else {
+ kbd_mode = TOOLBAR_HELPER_MODE;
+ }
+
+ // get the input window
+ atom = ecore_x_atom_get (E_PROP_DEVICEMGR_INPUTWIN);
+ ret = ecore_x_window_prop_xid_get (ecore_x_window_root_first_get (), atom, ECORE_X_ATOM_WINDOW, &_input_win, 1);
+
+ //Set the window property value;
+ if (kbd_mode == TOOLBAR_KEYBOARD_MODE) {
+ val = 0;
+ ecore_x_window_prop_card32_set (_input_win, ecore_x_atom_get (PROP_X_EXT_KEYBOARD_EXIST), &val, 1);
+ LOGD ("keyboard mode is changed HW -> SW by isf-kbd-mode-changer");
+ }
+ ui_app_exit ();
+}
+
+void app_terminate (void *user_data)
+{
+ LOGD ("app terminated");
+}
+
+int main (int argc, char *argv [])
+{
+
+ ui_app_lifecycle_callback_s event_callback = {0,};
+
+ event_callback.create = app_create;
+ event_callback.terminate = app_terminate;
+ event_callback.app_control = app_control;
+
+ LOGD ("start org.tizen.isf-kbd-mode-changer");
+
+ return ui_app_main (argc, argv, &event_callback, NULL);
+
+}
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.isf-kbd-mode-changer" version="0.0.1-1" install-location="internal-only" support-mode="screen-reader">
+ <label>isf-kbd-mode-changer</label>
+ <author email="jihoon48.kim@samsung.com" href="www.samsung.com">Jihoon Kim</author>
+ <description>isf-kbd-mode-changer</description>
+ <ui-application appid="org.tizen.isf-kbd-mode-changer" exec="/usr/apps/org.tizen.isf-kbd-mode-changer/bin/isf-kbd-mode-changer" nodisplay="true" multiple="false" type="capp" taskmanage="false">
+ <label>isf-kbd-mode-changer</label>
+ </ui-application>
+</manifest>
BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: pkgconfig(db-util)
BuildRequires: pkgconfig(capi-appfw-app-control)
+BuildRequires: pkgconfig(capi-appfw-application)
BuildRequires: capi-appfw-package-manager-devel
Requires(post): /sbin/ldconfig /usr/bin/vconftool
Requires(postun): /sbin/ldconfig
%define _optexecdir /opt/usr/devel/usr/bin/
+%define APP_PREFIX %{_prefix}/apps/org.tizen.isf-kbd-mode-changer/bin/
%description
Input Service Framewok (ISF) is an input method (IM) platform, and it has been derived from SCIM.
%description devel
This package contains ISF header files for ISE development.
+%if %{without wayland}
+%package -n org.tizen.isf-kbd-mode-changer
+Summary: isf-kbd-mode-changer
+Group: Application
+Requires: %{name} = %{version}-%{release}
+
+%description -n org.tizen.isf-kbd-mode-changer
+isf-kbd-mode-changer
+%endif
+
%prep
%setup -q
cp %{SOURCE1001} .
%{_libdir}/libscim-*.so
%{_libdir}/pkgconfig/isf.pc
%{_libdir}/pkgconfig/scim.pc
+
+%if %{without wayland}
+%post -n org.tizen.isf-kbd-mode-changer
+mkdir -p /usr/apps/org.tizen.isf-kbd-mode-changer
+
+%files -n org.tizen.isf-kbd-mode-changer
+%manifest org.tizen.isf-kbd-mode-changer.manifest
+/usr/share/packages/org.tizen.isf-kbd-mode-changer.xml
+%{APP_PREFIX}/*
+%endif