From: nazib.ullah Date: Mon, 28 Nov 2016 09:06:55 +0000 (+0600) Subject: [TBT][tizen_3.0_wearable][IME for wearable modules and IME project added, d2d: wifi... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F99%2F100499%2F1;p=test%2Ftct%2Fnative%2Fbehavior.git [TBT][tizen_3.0_wearable][IME for wearable modules and IME project added, d2d: wifi feature checking added, C89 version of variable declaration issue fixed] Change-Id: Iaf69b85fce42d378d2fefb5757eef1ccacbebb50 --- diff --git a/release/binary-armv7l/install.sh b/release/binary-armv7l/install.sh index f949e77..424e1bd 100644 --- a/release/binary-armv7l/install.sh +++ b/release/binary-armv7l/install.sh @@ -35,6 +35,7 @@ sdb push org.tizen.smartcard.actestapp-1.0.0-arm.tpk /tmp sdb push org.tizen.smartcard.actestapp_signed-1.0.0-arm.tpk /tmp sdb push org.tizen.operationpickviewapp-1.0.0-arm.tpk /tmp sdb push org.tizen.coretbtwidgetapp-1.0.0-arm.tpk /tmp +sdb push org.tizen.tbt-ime-1.0.0-arm.tpk /tmp sdb push org.tizen.tbtcoreapp-1.0.0-arm.tpk /tmp sdb push dog_1024_960.gif /opt/home/owner/media/Images @@ -52,4 +53,5 @@ sdb shell pkgcmd -i -t tpk -p /tmp/org.tizen.smartcard.actestapp-1.0.0-arm.tpk sdb shell pkgcmd -i -t tpk -p /tmp/org.tizen.smartcard.actestapp_signed-1.0.0-arm.tpk sdb shell pkgcmd -i -t tpk -p /tmp/org.tizen.operationpickviewapp-1.0.0-arm.tpk sdb shell pkgcmd -i -t tpk -p /tmp/org.tizen.coretbtwidgetapp-1.0.0-arm.tpk +sdb shell pkgcmd -i -t tpk -p /tmp/org.tizen.tbt-ime-1.0.0-arm.tpk sdb shell pkgcmd -i -t tpk -p /tmp/org.tizen.tbtcoreapp-1.0.0-arm.tpk diff --git a/release/binary-armv7l/org.tizen.tbt-ime-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.tbt-ime-1.0.0-arm.tpk new file mode 100644 index 0000000..aa1e493 Binary files /dev/null and b/release/binary-armv7l/org.tizen.tbt-ime-1.0.0-arm.tpk differ diff --git a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk index 1cddde1..8934c55 100644 Binary files a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk differ diff --git a/release/binary-x86/install.sh b/release/binary-x86/install.sh index 524176a..6246be5 100644 --- a/release/binary-x86/install.sh +++ b/release/binary-x86/install.sh @@ -35,6 +35,7 @@ sdb push org.tizen.smartcard.actestapp-1.0.0-i386.tpk /tmp sdb push org.tizen.smartcard.actestapp_signed-1.0.0-i386.tpk /tmp sdb push org.tizen.operationpickviewapp-1.0.0-i386.tpk /tmp sdb push org.tizen.coretbtwidgetapp-1.0.0-i386.tpk /tmp +sdb push org.tizen.tbt-ime-1.0.0-i386.tpk /tmp sdb push org.tizen.tbtcoreapp-1.0.0-i386.tpk /tmp sdb push dog_1024_960.gif /opt/home/owner/media/Images @@ -52,4 +53,5 @@ sdb shell pkgcmd -i -t tpk -p /tmp/org.tizen.smartcard.actestapp-1.0.0-i386.tpk sdb shell pkgcmd -i -t tpk -p /tmp/org.tizen.smartcard.actestapp_signed-1.0.0-i386.tpk sdb shell pkgcmd -i -t tpk -p /tmp/org.tizen.operationpickviewapp-1.0.0-i386.tpk sdb shell pkgcmd -i -t tpk -p /tmp/org.tizen.coretbtwidgetapp-1.0.0-i386.tpk +sdb shell pkgcmd -i -t tpk -p /tmp/org.tizen.tbt-ime-1.0.0-i386.tpk sdb shell pkgcmd -i -t tpk -p /tmp/org.tizen.tbtcoreapp-1.0.0-i386.tpk diff --git a/release/binary-x86/org.tizen.tbt-ime-1.0.0-i386.tpk b/release/binary-x86/org.tizen.tbt-ime-1.0.0-i386.tpk new file mode 100644 index 0000000..235848b Binary files /dev/null and b/release/binary-x86/org.tizen.tbt-ime-1.0.0-i386.tpk differ diff --git a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk index b4b11de..4127dba 100644 Binary files a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk and b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk differ diff --git a/tbt-ime/.cproject b/tbt-ime/.cproject new file mode 100644 index 0000000..94a7a47 --- /dev/null +++ b/tbt-ime/.cproject @@ -0,0 +1,578 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tbt-ime/.gbs.conf b/tbt-ime/.gbs.conf new file mode 100644 index 0000000..5a50939 --- /dev/null +++ b/tbt-ime/.gbs.conf @@ -0,0 +1,30 @@ +[general] +buildroot=~/GBS-ROOT-TBT-MOBILE +profile = profile.device + +[profile.device] # Profile for Device +obs = obs.device +repos = repo.device + +[profile.sdk] # Profile for SDK +obs = obs.sdk +repos = repo.sdk + +[obs.device] # obs for SDK.Ref_Target +#OBS API URL pointing to a remote OBS. +url = https://168.219.209.58/ + +[obs.sdk] # obs for SDK.Emulator +#OBS API URL pointing to a remote OBS. +url = https://168.219.209.58/ + + +#device +[repo.device] # Repository for Tizen 2.4 SDK Target snapshot +url = http://download.tizen.org/snapshots/tizen/mobile/latest/repos/arm64-wayland/packages/ + +#SDK +[repo.sdk] # Repository for Tizen 2.4 SDK Emulator snapshot +url = http://download.tizen.org/snapshots/tizen/mobile/latest/repos/arm64-wayland/packages/ + + diff --git a/tbt-ime/.gitignore b/tbt-ime/.gitignore new file mode 100644 index 0000000..d023e87 --- /dev/null +++ b/tbt-ime/.gitignore @@ -0,0 +1,4 @@ +/SA_Report +/Debug +/.sign +/res diff --git a/tbt-ime/.package-stamp b/tbt-ime/.package-stamp new file mode 100644 index 0000000..40cbe59 --- /dev/null +++ b/tbt-ime/.package-stamp @@ -0,0 +1 @@ +TPK \ No newline at end of file diff --git a/tbt-ime/.project b/tbt-ime/.project new file mode 100644 index 0000000..f973c34 --- /dev/null +++ b/tbt-ime/.project @@ -0,0 +1,32 @@ + + + tbt-ime + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + org.tizen.nativecore.apichecker.core.builder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + org.tizen.nativecore.apichecker.core.tizenCppNature + + diff --git a/tbt-ime/.rds_delta b/tbt-ime/.rds_delta new file mode 100644 index 0000000..4d084b3 --- /dev/null +++ b/tbt-ime/.rds_delta @@ -0,0 +1,6 @@ +#delete +#add +#modify +author-signature.xml +signature1.xml +lib/libtbt-ime.so diff --git a/tbt-ime/.sdk_delta.info b/tbt-ime/.sdk_delta.info new file mode 100644 index 0000000..e00fb5b Binary files /dev/null and b/tbt-ime/.sdk_delta.info differ diff --git a/tbt-ime/.tproject b/tbt-ime/.tproject new file mode 100644 index 0000000..de5a150 --- /dev/null +++ b/tbt-ime/.tproject @@ -0,0 +1,12 @@ + + + + + wearable-3.0 + + + + + + + diff --git a/tbt-ime/CMakeLists.txt b/tbt-ime/CMakeLists.txt new file mode 100644 index 0000000..c2fc551 --- /dev/null +++ b/tbt-ime/CMakeLists.txt @@ -0,0 +1,51 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +PROJECT(${NAME}) + +SET(project_name ${NAME}) +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) +SET(PKG_MODULES + capi-base-common + dlog + elementary + ecore-imf + evas + libscl-core + isf + capi-appfw-application + capi-ui-inputmethod +) + +INCLUDE(FindPkgConfig) +pkg_check_modules(${project_name} REQUIRED ${PKG_MODULES}) + +INCLUDE_DIRECTORIES( + ${${project_name}_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR}/inc +) +FILE(GLOB_RECURSE SRCS ${CMAKE_SOURCE_DIR}/src/*.c) +ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS}) + + +TARGET_LINK_LIBRARIES(${PROJECT_NAME} + capi-ui-inputmethod + dlog + eina + elementary + evas + +) + + +CONFIGURE_FILE(tizen-manifest.xml ${PACKAGE_NAME}.xml) +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib) +install(FILES ${CMAKE_SOURCE_DIR}/${PACKAGE_NAME}.xml DESTINATION /opt/share/packages) +install(FILES ${CMAKE_SOURCE_DIR}/shared/res/${DESKTOP_ICON} DESTINATION /opt/share/icons/default/small) +install(FILES ${CMAKE_SOURCE_DIR}/shared/res/${DESKTOP_ICON} DESTINATION /opt/usr/apps/${PACKAGE_NAME}/shared/res) + + + +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O2 -Wall -fPIC -pipe -Wl,--allow-shlib-undefined -D__DEBUG_MSG__") +SET(CMAKE_C_FLAGS " -fPIE -Wall -lstdc++") +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -pie") + + diff --git a/tbt-ime/inc/logger.h b/tbt-ime/inc/logger.h new file mode 100644 index 0000000..094bb2a --- /dev/null +++ b/tbt-ime/inc/logger.h @@ -0,0 +1,59 @@ +/******************************************************************************* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *******************************************************************************/ + +/** + * @file logger.h + * @brief This file provide necessary macro for logging information. + * @since_tizen 2.3 + * @author Amlan Chowdhury (amlan.c@samsung.com) + * @date October, 2014 + * @bug + * @credit + */ + +#ifndef __LOGGER_H__ +#define __LOGGER_H__ + +#include + +#define LOG_TAG_CORE "[TBT_IME]_" + +#define DLOG(prio, fmt, arg...) dlog_print(prio, LOG_TAG_CORE, "%s (Line: %d) > " fmt, __func__, __LINE__, ##arg) +#define DBG(fmt, arg...) DLOG(DLOG_DEBUG, fmt, ##arg) +#define ERR(fmt, arg...) DLOG(DLOG_ERROR, fmt, ##arg) + +#define RETM_IF(expr, fmt, arg...) \ +{ \ + if (expr) \ + { \ + ERR(fmt, ##arg); \ + return; \ + } \ +} + +#define RETVM_IF(expr, val, fmt, arg...) \ +{ \ + if (expr) \ + { \ + ERR(fmt, ##arg); \ + return (val); \ + } \ +} + +#define SAFE_DELETE(a) if( (a) != NULL ) free (a); (a) = NULL; + +#endif /* __LOGGER_H__ */ diff --git a/tbt-ime/inc/tbt-ime.h b/tbt-ime/inc/tbt-ime.h new file mode 100644 index 0000000..703effd --- /dev/null +++ b/tbt-ime/inc/tbt-ime.h @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *******************************************************************************/ + + +/** + * @file coretbt_dataprovider.h + * @brief IME app provides testing environment for testing custom inputmethod + * @since_tizen 2.3 + * @author golam kayes(g.kayes@samsung.com) + * @date October, 2014 + * @bug no known bug + * @credit Tizen SDK Version 2.3.0 Sample Example + * + * */ + + +#ifndef _TBT_IME_H_ +#define _TBT_IME_H_ + +#include + +// This method is exported from libtbt-ime.so +EXPORT_API void ime_app_main(int argc, char **argv); + +#endif // _TBT-IME_H_ + diff --git a/tbt-ime/packaging/org.tizen.tbt-ime.spec b/tbt-ime/packaging/org.tizen.tbt-ime.spec new file mode 100644 index 0000000..c7e9b97 --- /dev/null +++ b/tbt-ime/packaging/org.tizen.tbt-ime.spec @@ -0,0 +1,78 @@ +Name: org.tizen.tbt-ime +Version: 0.0.1 +Release: 1 +License: To be filled +Summary: TBT GBS +Group: System/Libraries +Source0: %{name}-%{version}.tar.gz + +Requires(post): /sbin/ldconfig +Requires(postun): /sbin/ldconfig +BuildRequires: cmake +BuildRequires: pkgconfig(capi-base-common) +BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(elementary) +BuildRequires: pkgconfig(ecore-imf) +BuildRequires: pkgconfig(libscl-core) +BuildRequires: pkgconfig(isf) +BuildRequires: pkgconfig(capi-ui-inputmethod) +BuildRequires: pkgconfig(evas) +BuildRequires: pkgconfig(capi-appfw-application) +BuildRequires: pkgconfig(eina) + +%description +Platform Project + +%define _shortname tbt-ime +%define _optdir /opt +%define _usrdir /opt/usr +%define _appdir /opt/usr/apps +%define _pkgdir %{_appdir}/%{name} +%define _bindir %{_pkgdir}/bin +%define _libdir %{_pkgdir}/lib +%define _resdir %{_pkgdir}/res +%define _shareddir %{_pkgdir}/shared +%define _sharedreddir %{_pkgdir}/shared/res +%define _manifestdir /opt/share/packages +%define _desktopicondir /opt/share/icons/default/small +%define _desktopicon %{_shortname}.png + +%prep +%setup -q + +%build +cmake \ + -DCMAKE_INSTALL_PREFIX=%{_pkgdir} \ + -DPACKAGE_NAME=%{name} \ + -DBINDIR=%{_bindir} \ + -DLIBDIR=%{_libdir} \ + -DRESDIR=%{_resdir} \ + -DMANIFESTDIR=%{_manifestdir} \ + -DSHAREDDIR=%{_sharedreddir} \ + -DDESKTOP_ICONDIR=%{_desktopicondir} \ + -DDESKTOP_ICON=%{_desktopicon} \ + -DNAME=%{_shortname} \ + -DVERSION=%{version} \ + -DCMAKE_BUILD_TYPE=%{BUILD_TYPE} \ + +make %{?jobs:-j%jobs} + +%install +%make_install +mkdir -p %{buildroot}%{_appdir}/%{name} +%clean +rm -rf %{buildroot} + +%post +chown -R 5000:5000 %{_resdir} +chsmack -a %{name} %{_resdir} +%postun + +%files +%{_manifestdir}/%{name}.xml +%{_desktopicondir}/%{_desktopicon} +%{_sharedreddir}/%{_desktopicon} +%{_libdir}/lib%{_shortname}.so + + + diff --git a/tbt-ime/project_def.prop b/tbt-ime/project_def.prop new file mode 100644 index 0000000..4e53d4b --- /dev/null +++ b/tbt-ime/project_def.prop @@ -0,0 +1,11 @@ +APPNAME = tbt-ime + +type = sharedLib +profile = mobile-2.4 + +USER_SRCS = src/tbt-ime.c +USER_DEFS = +USER_INC_DIRS = inc +USER_OBJS = +USER_LIBS = +USER_EDCS = diff --git a/tbt-ime/shared/res/tbt-ime.png b/tbt-ime/shared/res/tbt-ime.png new file mode 100644 index 0000000..9765b1b Binary files /dev/null and b/tbt-ime/shared/res/tbt-ime.png differ diff --git a/tbt-ime/src/tbt-ime.c b/tbt-ime/src/tbt-ime.c new file mode 100644 index 0000000..c227416 --- /dev/null +++ b/tbt-ime/src/tbt-ime.c @@ -0,0 +1,1257 @@ +/* + * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include +#include +#include "tbt-ime.h" +#include "logger.h" +#include +#include + +#define SAFE_DELETE(a) if( (a) != NULL ) free (a); (a) = NULL; +#define EDJ_FILE "edje/tbt_ime.edj" +#define GRP_MAIN "main" +#define GRP_1 "group_1" +#define GRP_2 "group_2" + +static Evas_Object* layout = NULL; +static char MSG[100]; +static int Mlayout = -1; +static int Mlvar = -1; +static int Mcursor = -1; +static int Mautocap = -1; +static int Mrkeytype = -1; +static int Mrkeystate = -1; +static int Mpred = -1; +static int Mpassmod = -1; +static int Minhint = -1; +static int Mbidi = -1; +static int Mlanguage = -1; + +typedef struct _ime_data +{ + char *info_msg; + Elm_Input_Panel_Layout ime_layout; + Evas_Object *option_window; + Eina_List *list; + bool is_device_input_event_set; + Evas_Object* rotation_info_btn; + +}ime_data; + +static void ise_template_create_cb(void *user_data); +static void ise_template_terminate_cb(void *user_data); +static void ise_template_show_cb(int ic, ime_context_h context, void *user_data); +static void ise_template_hide_cb(int ic, void *user_data); +static void ise_template_cursor_position_updated_cb(int cursor_pos, void *user_data); +static void ise_template_surrounding_text_updated_cb(int ic, const char *text, int cursor, void *user_data); +static void ise_template_focus_out_cb(int ic, void *user_data); +static void ise_template_focus_in_cb(int ic, void *user_data); +static void ise_template_return_key_type_set_cb(Ecore_IMF_Input_Panel_Return_Key_Type type, void *user_data); +static void ise_template_return_key_state_set_cb(bool disabled, void *user_data); +static void ise_template_layout_set_cb(Ecore_IMF_Input_Panel_Layout layout, void *user_data); +static bool ise_template_process_key_event_cb(ime_key_code_e keycode, ime_key_mask_e keymask, ime_device_info_h dev_info, void *user_data); +static void ise_template_display_language_changed_cb(const char *language, void *user_data); +static void ise_template_rotation_degree_changed_cb(int degree, void *user_data); +static void ise_template_input_context_reset_cb(void *user_data); +static void ise_template_language_set_cb(Ecore_IMF_Input_Panel_Lang language, void *user_data); +static void ise_template_language_requested_cb(void *user_data, char **lang_code); +static void ise_template_geometry_requested_cb(void *user_data, int *x, int *y, int *w, int *h); +static void ise_template_imdata_set_cb(void *data, unsigned int data_length, void *user_data); +static void ise_template_accessibility_state_changed_cb(bool state, void *user_data); +static void ise_template_option_window_created_cb(Evas_Object *window, ime_option_window_type_e type, void *user_data); +static void ise_template_option_window_destroyed_cb(Evas_Object *window, void *user_data); +static char *format_string(const char *format, ...); +static char* get_ecore_imf_device_subclass(Ecore_IMF_Device_Subclass e); +static char* get_ecore_imf_device_class(Ecore_IMF_Device_Class e); +static void _ime_process_input_device_event_cb(ime_input_device_type_e device_type, ime_input_device_event_h device_event, void *user_data); + +/** + * @function _get_ime_error + * @since_tizen 2.3 + * @description Get Ime Error + * @parameter int: Int + * @return static char* + */ +static char* _get_ime_error(int ret) +{ + switch (ret) + { + case IME_ERROR_INVALID_PARAMETER: + return "IME_ERROR_INVALID_PARAMETER"; + case IME_ERROR_NO_CALLBACK_FUNCTION: + return "IME_ERROR_NO_CALLBACK_FUNCTION"; + case IME_ERROR_PERMISSION_DENIED: + return "IME_ERROR_PERMISSION_DENIED"; + case IME_ERROR_NOT_RUNNING: + return "IME_ERROR_NOT_RUNNING"; + case IME_ERROR_NONE: + return "IME_ERROR_NONE"; + case IME_ERROR_OPERATION_FAILED: + return "IME_ERROR_OPERATION_FAILED"; + + } + return NULL; +} + + +/** + * @function _button_clicked + * @since_tizen 2.3 + * @description Button Clicked + * @parameter void*: Void Pointer, Evas_Object*: Evas Object Pointer, void*: Void Pointer + * @return static void + */ +static void _button_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + int result; + const char *str = elm_object_text_get(obj); + DBG("text: %s", str); + result = ime_commit_string(str); + DBG("ime_commit_string %s",_get_ime_error(result)); +} + + +/** + * @function _back_key_clicked + * @since_tizen 2.3 + * @description Back Key Clicked + * @parameter void*: Void Pointer, Evas_Object*: Evas Object Pointer, void*: Void Pointer + * @return static void + */ +static void _back_key_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + int ret = ime_create_option_window(); + RETM_IF(IME_ERROR_NONE!=ret, "ime_create_option_window fails :%s",_get_ime_error(ret)); + ret = ime_send_key_event(IME_KEY_BackSpace, IME_KEY_MASK_PRESSED, false); + RETM_IF(IME_ERROR_NONE!=ret, "ime_send_key_event fails :%s",_get_ime_error(ret)); + ret = ime_send_key_event(IME_KEY_BackSpace, IME_KEY_MASK_RELEASED, false); + RETM_IF(IME_ERROR_NONE!=ret, "ime_send_key_event fails :%s",_get_ime_error(ret)); +} + + +/** + * @function _space_key_clicked + * @since_tizen 2.3 + * @description Space Key Clicked + * @parameter void*: Void Pointer, Evas_Object*: Evas Object Pointer, void*: Void Pointer + * @return static void + */ +static void _space_key_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + int ret = ime_create_option_window(); + _get_ime_error(ret); + ret = ime_send_key_event(IME_KEY_space, IME_KEY_MASK_PRESSED, true); + RETM_IF(IME_ERROR_NONE!=ret, "ime_send_key_event fails :%s",_get_ime_error(ret)); + ret = ime_send_key_event(IME_KEY_space, IME_KEY_MASK_RELEASED, true); + RETM_IF(IME_ERROR_NONE!=ret, "ime_send_key_event fails :%s",_get_ime_error(ret)); +} + + +/** + * @function _get_surrounding_key_clicked + * @since_tizen 2.3 + * @description Get Surrounding Key Clicked + * @parameter void*: Void Pointer, Evas_Object*: Evas Object Pointer, void*: Void Pointer + * @return static void + */ +static void _get_surrounding_key_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + DBG("Get surrounding text"); + int ret = ime_request_surrounding_text(-1, -1); + RETM_IF(IME_ERROR_NONE!=ret, "ime_send_key_event fails :%s",_get_ime_error(ret)); +} + + +/** + * @function _delete_surrounding_key_clicked + * @since_tizen 2.3 + * @description Delete Surrounding Key Clicked + * @parameter void*: Void Pointer, Evas_Object*: Evas Object Pointer, void*: Void Pointer + * @return static void + */ +static void _delete_surrounding_key_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + DBG("Delete surrounding text"); + int ret = ime_delete_surrounding_text(-1, 1); + RETM_IF(IME_ERROR_NONE!=ret, "ime_send_key_event fails :%s",_get_ime_error(ret)); +} + + +/** + * @function _preedit_on_key_clicked + * @since_tizen 2.3 + * @description Preedit On Key Clicked + * @parameter void*: Void Pointer, Evas_Object*: Evas Object Pointer, void*: Void Pointer + * @return static void + */ +static void _preedit_on_key_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + DBG("On Preedit text"); + ime_data *this = (ime_data*)data; + RETM_IF(!this, "data is NULL"); + int ret; + ret = ime_show_preedit_string(); + RETM_IF(IME_ERROR_NONE!=ret, "ime_show_preedit_string fails :%s",_get_ime_error(ret)); + this->list = NULL; + + ime_preedit_attribute *attr = calloc(1, sizeof (ime_preedit_attribute)); + RETM_IF(!attr, "calloc failed"); + attr->start = 0; + attr->length = 1; + attr->type = IME_ATTR_FONTSTYLE; + attr->value = IME_ATTR_FONTSTYLE_UNDERLINE; + this->list = eina_list_append(this->list, attr); + + attr = calloc(1, sizeof (ime_preedit_attribute)); + RETM_IF(!attr, "calloc failed"); + attr->start = 1; + attr->length = 1; + attr->type = IME_ATTR_FONTSTYLE; + attr->value = IME_ATTR_FONTSTYLE_HIGHLIGHT; + this->list = eina_list_append(this->list, attr); + + attr = calloc(1, sizeof (ime_preedit_attribute)); + RETM_IF(!attr, "calloc failed"); + attr->start = 2; + attr->length = 1; + attr->type = IME_ATTR_FONTSTYLE; + attr->value = IME_ATTR_FONTSTYLE_REVERSAL; + this->list = eina_list_append(this->list, attr); + + ret = ime_update_preedit_string("abcd", this->list); + RETM_IF(IME_ERROR_NONE!=ret, "ime_update_preedit_string fails :%s",_get_ime_error(ret)); + if (ret != IME_ERROR_NONE) + { + EINA_LIST_FREE(this->list, attr) + SAFE_DELETE(attr); + } + +} + + +/** + * @function _preedit_off_key_clicked + * @since_tizen 2.3 + * @description Preedit Off Key Clicked + * @parameter void*: Void Pointer, Evas_Object*: Evas Object Pointer, void*: Void Pointer + * @return static void + */ +static void _preedit_off_key_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + DBG("On Preedit text"); + int ret = ime_hide_preedit_string(); + RETM_IF(IME_ERROR_NONE!=ret, "ime_hide_preedit_string fails :%s",_get_ime_error(ret)); +} + + +/** + * @function _create_key_button + * @since_tizen 2.3 + * @description Create Key Button + * @parameter Evas_Object*: Evas Object Pointer, char*: Char Pointer + * @return static Evas_Object* + */ +static Evas_Object *_create_key_button(Evas_Object *parent, char *str) +{ + DBG("_create_key_button"); + char *markup_str = NULL; + Evas_Object *btn = elm_button_add(parent); + elm_object_style_set(btn, "default"); + evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + if (str) + { + markup_str = elm_entry_utf8_to_markup(str); + if (markup_str) + { + elm_object_text_set(btn, markup_str); + SAFE_DELETE(markup_str); + } + } + evas_object_show(btn); + return btn; +} + +void view_init_keypad_theme(char *th) +{ + elm_theme_overlay_add(NULL, th); + elm_theme_extension_add(NULL, th); +} + + +void data_get_resource_path(const char *file_in, char *file_path_out, int file_path_max) +{ + char *res_path = app_get_resource_path(); + if (res_path) { + snprintf(file_path_out, file_path_max, "%s%s", res_path, file_in); + free(res_path); + } +} + +static Evas_Object *view_create_layout(Evas_Object *parent, const char *file_path, const char *group_name, Eext_Event_Cb cb_function, void *user_data) +{ + DBG("view_create_layout"); + Evas_Object *layout = NULL; + if (parent == NULL) + { + dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL."); + return NULL; + } + /* Create layout by EDC(edje file) */ + layout = elm_layout_add(parent); + elm_layout_file_set(layout, file_path, group_name); + /* Layout size setting */ + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + if (cb_function) + eext_object_event_callback_add(layout, EEXT_CALLBACK_BACK, cb_function, user_data); + evas_object_show(layout); + + return layout; +} + +/** + * @function ise_template_create_cb + * @since_tizen 2.3 + * @description Ise Template Create Cb + * @parameter void*: Void Pointer + * @return static void + */ +static void ise_template_create_cb(void *user_data) +{ + DBG("Create"); + ime_data *data = (ime_data*)user_data; + unsigned int i = 0; + Evas_Object *btn = NULL; + int w, h; + char* str; + Evas_Object *ime_win; + int ret; + ime_win = ime_get_main_window(); + RETM_IF(!ime_win, "Can't get main window: %d", get_last_result()); + elm_win_screen_size_get(ime_win, NULL, NULL, &w, &h); + ime_set_size(w, h*3.5/5, h, w*3/5); + + Evas_Object *bg = elm_bg_add(ime_win); + evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(ime_win, bg); + evas_object_show(bg); + + data->is_device_input_event_set = false; + + char file_path[PATH_MAX] = { 0, }; + /* Get the path of EDJ file */ + data_get_resource_path(EDJ_FILE, file_path, sizeof(file_path)); + DBG("EDC FILE PATH: %s", file_path); + /* Initialize the new theme using EDJ file */ + view_init_keypad_theme(file_path); + + + if(data->ime_layout == ELM_INPUT_PANEL_LAYOUT_NUMBER) + { + layout = view_create_layout(ime_win, file_path, GRP_MAIN, NULL, NULL); + // row 1 + char *keypad_row1[] = {"1", "2", "3"}; + for (i=0; i < sizeof(keypad_row1)/sizeof(keypad_row1[0]); i++) + { + btn = _create_key_button(layout, keypad_row1[i]); + evas_object_smart_callback_add(btn, "clicked", _button_clicked, NULL); + str = format_string("%s%d%d", "btn_", 0, i); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + } + btn = _create_key_button(layout, "←"); + evas_object_smart_callback_add(btn, "clicked", _back_key_clicked, NULL); + str = format_string("%s%d%d", "btn_", 0, i); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + + // row 2 + char *keypad_row2[] = {"4", "5", "6", "0"}; + for (i=0; i < sizeof(keypad_row2)/sizeof(keypad_row2[0]); i++) + { + btn = _create_key_button(layout, keypad_row2[i]); + evas_object_smart_callback_add(btn, "clicked", _button_clicked, NULL); + str = format_string("%s%d%d", "btn_", 1, i); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + } + // Add get surrounding text key + btn = _create_key_button(layout, "GS"); + evas_object_smart_callback_add(btn, "clicked", _get_surrounding_key_clicked, NULL); + str = format_string("%s%d%d", "btn_", 1, i); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + + // row 3 + char *keypad_row3[] = {"7", "8", "9"}; + for (i=0; i < sizeof(keypad_row3)/sizeof(keypad_row3[0]); i++) + { + Evas_Object *btn = _create_key_button(layout, keypad_row3[i]); + evas_object_smart_callback_add(btn, "clicked", _button_clicked, NULL); + str = format_string("%s%d%d", "btn_", 2, i); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + } + // Add delete surrounding text key + btn = _create_key_button(layout, "DS"); + evas_object_smart_callback_add(btn, "clicked", _delete_surrounding_key_clicked, NULL); + str = format_string("%s%d%d", "btn_", 2, i); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + // Add space key + btn = _create_key_button(layout, "␣"); + evas_object_smart_callback_add(btn, "clicked", _space_key_clicked, NULL); + str = format_string("%s%d%d", "btn_", 2, i+1); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + + // row 4 + btn = _create_key_button(layout, (data->info_msg == NULL)?"INFO":data->info_msg); + str = format_string("%s%d%d", "btn_", 3, 0); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + } + else if(data->ime_layout == ELM_INPUT_PANEL_LAYOUT_NORMAL) + { + layout = view_create_layout(ime_win, file_path, GRP_MAIN, NULL, NULL); + // row 1 + char *keypad_row1[] = {"a", "b", "c"}; + for (i=0; i < sizeof(keypad_row1)/sizeof(keypad_row1[0]); i++) + { + btn = _create_key_button(layout, keypad_row1[i]); + evas_object_smart_callback_add(btn, "clicked", _button_clicked, NULL); + str = format_string("%s%d%d", "btn_", 0, i); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + } + // Add backspace key + btn = _create_key_button(layout, "←"); + evas_object_smart_callback_add(btn, "clicked", _back_key_clicked, NULL); + str = format_string("%s%d%d", "btn_", 0, i); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + + // row 2 + char *keypad_row2[] = {"d", "e", "f", "g"}; + for (i=0; i < sizeof(keypad_row2)/sizeof(keypad_row2[0]); i++) + { + btn = _create_key_button(layout, keypad_row2[i]); + evas_object_smart_callback_add(btn, "clicked", _button_clicked, NULL); + str = format_string("%s%d%d", "btn_", 1, i); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + } + // Add get surrounding text key + btn = _create_key_button(layout, "Prid On"); + evas_object_smart_callback_add(btn, "clicked", _preedit_on_key_clicked, data); + str = format_string("%s%d%d", "btn_", 1, i); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + + // row 3 + char *keypad_row3[] = {"h", "i", "j"}; + for (i=0; i < sizeof(keypad_row3)/sizeof(keypad_row3[0]); i++) + { + Evas_Object *btn = _create_key_button(layout, keypad_row3[i]); + evas_object_smart_callback_add(btn, "clicked", _button_clicked, NULL); + str = format_string("%s%d%d", "btn_", 2, i); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + } + // Add delete surrounding text key + btn = _create_key_button(layout, "Prid Off"); + evas_object_smart_callback_add(btn, "clicked", _preedit_off_key_clicked, NULL); + str = format_string("%s%d%d", "btn_", 2, i); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + + // Add space key + btn = _create_key_button(layout, "␣"); + evas_object_smart_callback_add(btn, "clicked", _space_key_clicked, NULL); + str = format_string("%s%d%d", "btn_", 2, i+1); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + + // row 4 + btn = _create_key_button(layout, (data->info_msg == NULL)?"INFO":data->info_msg); + str = format_string("%s%d%d", "btn_", 3, 0); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + } + else if(data->ime_layout == ELM_INPUT_PANEL_LAYOUT_IP) + { + layout = view_create_layout(ime_win, file_path, GRP_2, NULL, NULL); + if(data->info_msg) + { + DBG("MSG :%s", MSG); + } + RETM_IF(NULL == data->info_msg, "Message is NULL"); + btn = _create_key_button(layout, ((char*)MSG == NULL || strlen(MSG) == 0)?data->info_msg:MSG); + str = format_string("%s%d%d", "btn_", 0, 0); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + } + else if(data->ime_layout == ELM_INPUT_PANEL_LAYOUT_TERMINAL) //This is dummy type for testing wearable rotary event + { + layout = view_create_layout(ime_win, file_path, GRP_2, NULL, NULL); + data->rotation_info_btn = _create_key_button(layout, "Rotate wearable dial"); + str = format_string("%s%d%d", "btn_", 0, 0); + elm_object_part_content_set(layout, str, data->rotation_info_btn); + SAFE_DELETE(str); + + ret = ime_event_set_process_input_device_event_cb(_ime_process_input_device_event_cb, data); + RETM_IF(ret != IME_ERROR_NONE, "ime_event_set_process_input_device_event_cb failed : %s", _get_ime_error(ret)); + data->is_device_input_event_set = true; + } + else if(data->ime_layout == ELM_INPUT_PANEL_LAYOUT_HEX) + { + layout = view_create_layout(ime_win, file_path, GRP_1, NULL, NULL); + //row 1 + i = 0; + btn = _create_key_button(layout, (Mlayout >= 0)?"Pass":"Fail"); + //elm_table_pack(table, btn, i++, 0, 1, 1); + str = format_string("%s%d%d", "btn_", 0, i++); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + btn = _create_key_button(layout, (Mlvar >= 0)?"Pass":"Fail"); + //elm_table_pack(table, btn, i++, 0, 1, 1); + str = format_string("%s%d%d", "btn_", 0, i++); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + btn = _create_key_button(layout, (Mcursor >= 0)?"Pass":"Fail"); + //elm_table_pack(table, btn, i++, 0, 1, 1); + str = format_string("%s%d%d", "btn_", 0, i++); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + + //row 2 + i = 0; + btn = _create_key_button(layout, (Mautocap >= 0)?"Pass":"Fail"); + //elm_table_pack(table, btn, i++, 1, 1, 1); + str = format_string("%s%d%d", "btn_", 1, i++); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + btn = _create_key_button(layout, (Mrkeytype >= 0)?"Pass":"Fail"); + //elm_table_pack(table, btn, i++, 1, 1, 1); + str = format_string("%s%d%d", "btn_", 1, i++); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + btn = _create_key_button(layout, (Mrkeystate >= 0)?"Pass":"Fail"); + //elm_table_pack(table, btn, i++, 1, 1, 1); + str = format_string("%s%d%d", "btn_", 1, i++); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + + //row 3 + i = 0; + btn = _create_key_button(layout, (Mpred >= 0)?"Pass":"Fail"); + //elm_table_pack(table, btn, i++, 2, 1, 1); + str = format_string("%s%d%d", "btn_", 2, i++); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + btn = _create_key_button(layout, (Mpassmod >= 0)?"Pass":"Fail"); + //elm_table_pack(table, btn, i++, 2, 1, 1); + str = format_string("%s%d%d", "btn_", 2, i++); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + btn = _create_key_button(layout, (Minhint >= 0)?"Pass":"Fail"); + //elm_table_pack(table, btn, i++, 2, 1, 1); + str = format_string("%s%d%d", "btn_", 2, i++); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + + //row 4 + i = 0; + btn = _create_key_button(layout, (Mbidi >= 0)?"Pass":"Fail"); + //elm_table_pack(table, btn, i++, 3, 1, 1); + str = format_string("%s%d%d", "btn_", 3, i++); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + btn = _create_key_button(layout, (Mlanguage >= 0)?"Pass":"Fail"); + //elm_table_pack(table, btn, i++, 3, 1, 1); + str = format_string("%s%d%d", "btn_", 3, i++); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + btn = _create_key_button(layout, "Pass"); + //elm_table_pack(table, btn, i++, 3, 1, 1); + str = format_string("%s%d%d", "btn_", 3, i++); + elm_object_part_content_set(layout, str, btn); + SAFE_DELETE(str); + } + if(layout) + { + elm_win_resize_object_add(ime_win, layout); + evas_object_show(layout); + } +} + +static void _ime_process_input_device_event_cb(ime_input_device_type_e device_type, ime_input_device_event_h device_event, void *user_data) +{ + DBG("_ime_process_input_device_event_cb"); + ime_data *data = (ime_data *) user_data; + int ret; + if(device_type == IME_INPUT_DEVICE_TYPE_ROTARY) + { + if(data->ime_layout == ELM_INPUT_PANEL_LAYOUT_TERMINAL) + { + ime_input_device_rotary_direction_e direction; + ret = ime_input_device_rotary_get_direction(device_event, &direction); + RETM_IF(ret != IME_ERROR_NONE, "ime_input_device_rotary_get_direction failed : %s", _get_ime_error(ret)); + data->info_msg = direction==IME_INPUT_DEVICE_ROTARY_DIRECTION_CLOCKWISE?"IME_INPUT_DEVICE_ROTARY_DIRECTION_CLOCKWISE":"IME_INPUT_DEVICE_ROTARY_DIRECTION_COUNTER_CLOCKWISE"; + DBG("Rotation %s", data->info_msg); + elm_object_text_set(data->rotation_info_btn, data->info_msg); + } + } + else{ + elm_object_text_set(data->rotation_info_btn, "Device is not rotary type"); + } +} + +/** + * @function ise_template_terminate_cb + * @since_tizen 2.3 + * @description Ise Template Terminate Cb + * @parameter void*: Void Pointer + * @return static void + */ +static void ise_template_terminate_cb(void *user_data) +{ + DBG("Terminate"); + ime_data *data = (ime_data *) user_data; + // Release the resources + int ret; + if(data->is_device_input_event_set == true) + { + ret = ime_event_unset_process_input_device_event_cb(); + RETM_IF(IME_ERROR_NONE != ret, "ime_event_unset_process_input_device_event_cb failed: %s",_get_ime_error(ret)); + data->is_device_input_event_set = false; + } + if(data->option_window) + { + ret = ime_destroy_option_window(data->option_window); + RETM_IF(IME_ERROR_NONE != ret, "ime_destroy_option_window failed: %s",_get_ime_error(ret)); + } + eina_list_free(data->list); + +} + + +/** + * @function ise_template_show_cb + * @since_tizen 2.3 + * @description Ise Template Show Cb + * @parameter int: Int, void*: Void Pointer + * @return static void + */ +static void ise_template_show_cb(int ic, ime_context_h context, void *user_data) +{ + ime_data *data = (ime_data*)user_data; + Ecore_IMF_Input_Panel_Layout layout; + ime_layout_variation_e layout_variation; + int cursor_pos; + Ecore_IMF_Autocapital_Type autocapital_type; + Ecore_IMF_Input_Panel_Return_Key_Type return_key_type; + bool return_key_state, prediction_mode, password_mode; + Ecore_IMF_Input_Hints input_hint; + Ecore_IMF_BiDi_Direction bidi; + Ecore_IMF_Input_Panel_Lang language; + + DBG("Show: %d", ic); + + int ret; + if ((ret = ime_context_get_layout(context, &layout)) == IME_ERROR_NONE) + { + DBG("layout: %d", layout); + Mlayout = layout; + } + else + { + RETM_IF(true, "ime_context_get_layout fails: %s",_get_ime_error(ret)); + } + if ((ret = ime_context_get_layout_variation(context, &layout_variation)) == IME_ERROR_NONE) + { + DBG("layout variation: %d", layout_variation); + Mlvar = layout_variation; + } + else + { + RETM_IF(true, "ime_context_get_layout_variation fails: %s",_get_ime_error(ret)); + } + if ((ret = ime_context_get_cursor_position(context, &cursor_pos)) == IME_ERROR_NONE) + { + DBG("cursor position: %d", cursor_pos); + Mcursor = cursor_pos; + } + else + { + RETM_IF(true, "ime_context_get_cursor_position fails: %s",_get_ime_error(ret)); + } + if ((ret = ime_context_get_autocapital_type(context, &autocapital_type)) == IME_ERROR_NONE) + { + DBG("autocapital_type: %d", autocapital_type); + Mautocap = autocapital_type; + } + else + { + RETM_IF(true, "ime_context_get_autocapital_type fails: %s",_get_ime_error(ret)); + } + if ((ret = ime_context_get_return_key_type(context, &return_key_type)) == IME_ERROR_NONE) + { + DBG("return_key_type: %d", return_key_type); + Mrkeytype = return_key_type; + } + else + { + RETM_IF(true, "ime_context_get_return_key_type fails: %s",_get_ime_error(ret)); + } + if ((ret = ime_context_get_return_key_state(context, &return_key_state)) == IME_ERROR_NONE) + { + DBG("return_key_state: %d", return_key_state); + Mrkeystate = return_key_state; + } + else + { + RETM_IF(true, "ime_context_get_return_key_state fails: %s",_get_ime_error(ret)); + } + if ((ret = ime_context_get_prediction_mode(context, &prediction_mode)) == IME_ERROR_NONE) + { + DBG("prediction_mode: %d", prediction_mode); + Mpred = prediction_mode; + } + else + { + RETM_IF(true, "ime_context_get_prediction_mode fails: %s",_get_ime_error(ret)); + } + if ((ret = ime_context_get_password_mode(context, &password_mode)) == IME_ERROR_NONE) + { + DBG("password_mode: %d", password_mode); + Mpassmod = password_mode; + } + else + { + RETM_IF(true, "ime_context_get_password_mode fails: %s",_get_ime_error(ret)); + } + if ((ret = ime_context_get_input_hint(context, &input_hint)) == IME_ERROR_NONE) + { + DBG("input_hint: 0x%04x", input_hint); + Minhint = input_hint; + } + else + { + RETM_IF(true, "ime_context_get_input_hint fails: %s",_get_ime_error(ret)); + } + if ((ret = ime_context_get_bidi_direction(context, &bidi)) == IME_ERROR_NONE) + { + DBG("bidi: %d", bidi); + Mbidi = bidi; + } + else + { + RETM_IF(true, "ime_context_get_bidi_direction fails: %s",_get_ime_error(ret)); + } + if ((ret = ime_context_get_language(context, &language)) == IME_ERROR_NONE) + { + DBG("language: %d", language); + Mlanguage = language; + //sprintf(data->info_msg_lang, "language: %d", (int)language); + data->ime_layout = (Elm_Input_Panel_Layout)layout; + + if(layout != ELM_INPUT_PANEL_LAYOUT_IP) + { + if(language == ELM_INPUT_PANEL_LANG_AUTOMATIC) + data->info_msg = "ELM_INPUT_PANEL_LANG_AUTOMATIC"; + else if(language == ELM_INPUT_PANEL_LANG_ALPHABET) + data->info_msg = "ELM_INPUT_PANEL_LANG_ALPHABET"; + else + data->info_msg = "default"; + } + else if(layout == ELM_INPUT_PANEL_LAYOUT_IP) + { + if(!data->info_msg) + data->info_msg = "Language Default"; + } + } + else + { + RETM_IF(true, "ime_context_get_language fails: %s",_get_ime_error(ret)); + } + Evas_Object *ime_win = ime_get_main_window(); + RETM_IF(NULL == ime_win, "ime_get_main_window failed"); + DBG("Ingoing MSG: %s", data->info_msg); + DBG("In going static MSG: %s", MSG); + ise_template_create_cb(data); + evas_object_show(ime_win); +} + + +/** + * @function ise_template_hide_cb + * @since_tizen 2.3 + * @description Ise Template Hide Cb + * @parameter int: Int, void*: Void Pointer + * @return static void + */ +static void ise_template_hide_cb(int ic, void *user_data) +{ + DBG("Hide: %d", ic); + Evas_Object *ime_win = ime_get_main_window(); + evas_object_hide(ime_win); +} + + +/** + * @function ise_template_cursor_position_updated_cb + * @since_tizen 2.3 + * @description Ise Template Cursor Position Updated Cb + * @parameter int: Int, void*: Void Pointer + * @return static void + */ +static void ise_template_cursor_position_updated_cb(int cursor_pos, void *user_data) +{ + DBG("cursor position: %d", cursor_pos); +} + + +/** + * @function ise_template_surrounding_text_updated_cb + * @since_tizen 2.3 + * @description Ise Template Surrounding Text Updated Cb + * @parameter int: Int, const char*: Const char Pointer, void*: Void Pointer + * @return static void + */ +static void ise_template_surrounding_text_updated_cb(int ic, const char *text, int cursor, void *user_data) +{ + DBG("text: %s, cursor: %d", text, cursor); +} + + +/** + * @function ise_template_focus_out_cb + * @since_tizen 2.3 + * @description Ise Template Focus Out Cb + * @parameter int: Int, void*: Void Pointer + * @return static void + */ +static void ise_template_focus_out_cb(int ic, void *user_data) +{ + DBG("focus out: %d", ic); +} + + +/** + * @function ise_template_focus_in_cb + * @since_tizen 2.3 + * @description Ise Template Focus In Cb + * @parameter int: Int, void*: Void Pointer + * @return static void + */ +static void ise_template_focus_in_cb(int ic, void *user_data) +{ + DBG("focus in: %d", ic); +} + + +/** + * @function ise_template_return_key_type_set_cb + * @since_tizen 2.3 + * @description Ise Template Return Key Type Set Cb + * @parameter Ecore_IMF_Input_Panel_Return_Key_Type: Ecore IMF Input Panel Return Key Type, void*: Void Pointer + * @return static void + */ +static void ise_template_return_key_type_set_cb(Ecore_IMF_Input_Panel_Return_Key_Type type, void *user_data) +{ + dlog_print(DLOG_DEBUG, LOG_TAG,"Return key type: %d", type); + // Do a proper action +} + + +/** + * @function ise_template_return_key_state_set_cb + * @since_tizen 2.3 + * @description Ise Template Return Key State Set Cb + * @parameter bool: Bool, void*: Void Pointer + * @return static void + */ +static void ise_template_return_key_state_set_cb(bool disabled, void *user_data) +{ + DBG("Return key disabled: %d", disabled); + // Do a proper action +} + + +/** + * @function ise_template_layout_set_cb + * @since_tizen 2.3 + * @description Ise Template Layout Set Cb + * @parameter Ecore_IMF_Input_Panel_Layout: Ecore IMF Input Panel Layout, void*: Void Pointer + * @return static void + */ +static void ise_template_layout_set_cb(Ecore_IMF_Input_Panel_Layout layout, void *user_data) +{ + DBG("layout: %d", layout); + // Do a proper action +} + + +/** + * @function ise_template_process_key_event_cb + * @since_tizen 2.3 + * @description Ise Template Process Key Event Cb + * @parameter ime_key_code_e: Ime Key Code E, void*: Void Pointer + * @return static bool + */ +static bool ise_template_process_key_event_cb(ime_key_code_e keycode, ime_key_mask_e keymask, ime_device_info_h dev_info, void *user_data) +{ + DBG("keycode=0x%x, keymask=0x%x", keycode, keymask); + + if ((keymask & IME_KEY_MASK_CONTROL) || + (keymask & IME_KEY_MASK_ALT) || + (keymask & IME_KEY_MASK_META) || + (keymask & IME_KEY_MASK_WIN) || + (keymask & IME_KEY_MASK_HYPER)) + { + return false; + } + + char *dev_name = NULL; + Ecore_IMF_Device_Class dev_class; + Ecore_IMF_Device_Subclass dev_subclass; + int ret; + ret = ime_device_info_get_name(dev_info, &dev_name); + RETVM_IF(ret != IME_ERROR_NONE, false, "ime_device_info_get_name fails : %s", _get_ime_error(ret)); + DBG("dev_name: %s", dev_name==NULL?"NULL":dev_name); + SAFE_DELETE(dev_name); + + // return false; + + ret = ime_device_info_get_class(dev_info, &dev_class); + RETVM_IF(ret!=IME_ERROR_NONE, false, "ime_device_info_get_class fails : %s", _get_ime_error(ret)); + DBG("dev_class: %s", get_ecore_imf_device_class(dev_class)); + + ret = ime_device_info_get_subclass(dev_info, &dev_subclass); + RETVM_IF(ret, false, "ime_device_info_get_subclass fails : %s", _get_ime_error(ret)); + DBG("dev_subclass: %s", get_ecore_imf_device_subclass(dev_subclass)); + + return false; +} + + +/** + * @function ise_template_display_language_changed_cb + * @since_tizen 2.3 + * @description Ise Template Display Language Changed Cb + * @parameter const char*: Const char Pointer, void*: Void Pointer + * @return static void + */ +static void ise_template_display_language_changed_cb(const char *language, void *user_data) +{ + DBG("ise_template_display_language_changed_cb language: %s", language); + ime_data *data = (ime_data*)user_data; + // Do a proper action + if(data->ime_layout == ELM_INPUT_PANEL_LAYOUT_IP) + { + data->info_msg = (char*)language; + snprintf(MSG, sizeof(MSG), "Language changed:%s",data->info_msg); + ise_template_create_cb(data); + DBG("Setting msg: %s", MSG); + } +} + +/** + * @function ise_template_input_context_reset_cb + * @since_tizen 2.3 + * @description Ise Template Input Context Reset Cb + * @parameter void*: Void Pointer + * @return static void + */ +static void ise_template_input_context_reset_cb(void *user_data) +{ + DBG("ime_input_context_reset_cb called"); +} + + +/** + * @function ise_template_rotation_degree_changed_cb + * @since_tizen 2.3 + * @description Ise Template Rotation Degree Changed Cb + * @parameter int: Int, void*: Void Pointer + * @return static void + */ +static void ise_template_rotation_degree_changed_cb(int degree, void *user_data) +{ + DBG("degree=%d", degree); + // Do a proper action +} + + +/** + * @function ise_template_language_set_cb + * @since_tizen 2.3 + * @description Ise Template Language Set Cb + * @parameter Ecore_IMF_Input_Panel_Lang: Ecore IMF Input Panel Lang, void*: Void Pointer + * @return static void + */ +static void ise_template_language_set_cb(Ecore_IMF_Input_Panel_Lang language, void *user_data) +{ + DBG("ise_template_language_set_cb"); + // Do a proper action + //char *info_txt = "Language is set by Entry."; +} + + +/** + * @function ise_template_language_requested_cb + * @since_tizen 2.3 + * @description Ise Template Language Requested Cb + * @parameter void*: Void Pointer + * @return static void + */ +static void ise_template_language_requested_cb(void *user_data, char **lang_code) +{ + DBG("ise_template_language_requested_cb"); + // Do a proper action + //char *info_txt = "Language is requested.."; + +} + + +/** + * @function ise_template_geometry_requested_cb + * @since_tizen 2.3 + * @description Ise Template Geometry Requested Cb + * @parameter void*: Void Pointer, int*: Int Pointer, int*: Int Pointer, int*: Int Pointer, int*: Int Pointer + * @return static void + */ +static void ise_template_geometry_requested_cb(void *user_data, int *x, int *y, int *w, int *h) +{ + DBG("ise_template_geometry_requested_cb x:%d y:%d w:%d h:%d", x, y, w, h); +} + + +/** + * @function ise_template_imdata_set_cb + * @since_tizen 2.3 + * @description Ise Template Imdata Set Cb + * @parameter void*: Void Pointer, void*: Void Pointer + * @return static void + */ +static void ise_template_imdata_set_cb(void *data, unsigned int data_length, void *user_data) +{ + DBG("ise_template_imdata_set_cb "); +} + + +/** + * @function ise_template_accessibility_state_changed_cb + * @since_tizen 2.3 + * @description Ise Template Accessibility State Changed Cb + * @parameter bool: Bool, void*: Void Pointer + * @return static void + */ +static void ise_template_accessibility_state_changed_cb(bool state, void *user_data) +{ + DBG("ise_template_accessibility_state_changed_cb %d", state); +} + + +/** + * @function ise_template_option_window_created_cb + * @since_tizen 2.3 + * @description Ise Template Option Window Created Cb + * @parameter Evas_Object*: Evas Object Pointer, void*: Void Pointer + * @return static void + */ +static void ise_template_option_window_created_cb(Evas_Object *window, ime_option_window_type_e type, void *user_data) +{ + DBG("ise_template_option_window_created_cb"); +} + + +/** + * @function ise_template_option_window_destroyed_cb + * @since_tizen 2.3 + * @description Ise Template Option Window Destroyed Cb + * @parameter Evas_Object*: Evas Object Pointer, void*: Void Pointer + * @return static void + */ +static void ise_template_option_window_destroyed_cb(Evas_Object *window, void *user_data) +{ + DBG("ise_template_option_window_destroyed_cb"); + ime_data *data = (ime_data*) user_data; + data->option_window = window; + Evas_Object *button = _create_key_button(window, "Option"); + evas_object_move(button, 0, 0); + evas_object_resize(button, 50, 50); + evas_object_show(button); + evas_object_show(window); +} + + +/** + * @function ime_app_main + * @since_tizen 2.3 + * @description Ime App Main + * @parameter int: Int + * @return void + */ +void ime_app_main(int argc, char **argv) +{ + DBG("Start! TBT IME template"); + ime_data *data = NULL; + data = calloc(1, sizeof(ime_data)); + ime_callback_s basic_callback = { + ise_template_create_cb, + ise_template_terminate_cb, + ise_template_show_cb, + ise_template_hide_cb, + }; + int result; + // Set the necessary callback functions + result = ime_event_set_focus_in_cb(ise_template_focus_in_cb, data); + DBG("ime_event_set_focus_in_cb =%d", result); + result = ime_event_set_focus_out_cb(ise_template_focus_out_cb, data); + DBG("ise_template_focus_out_cb =%d", result); + result = ime_event_set_surrounding_text_updated_cb(ise_template_surrounding_text_updated_cb, data); + DBG("ime_event_set_surrounding_text_updated_cb =%d", result); + result = ime_event_set_cursor_position_updated_cb(ise_template_cursor_position_updated_cb, data); + DBG("ime_event_set_cursor_position_updated_cb =%d", result); + result = ime_event_set_layout_set_cb(ise_template_layout_set_cb, data); + DBG("ime_event_set_layout_set_cb =%d", result); + result = ime_event_set_return_key_type_set_cb(ise_template_return_key_type_set_cb, data); + DBG("ime_event_set_return_key_type_set_cb =%d", result); + result = ime_event_set_return_key_state_set_cb(ise_template_return_key_state_set_cb, data); + DBG("ime_event_set_return_key_state_set_cb =%d", result); + result = ime_event_set_process_key_event_cb(ise_template_process_key_event_cb, data); + DBG("ime_event_set_process_key_event_cb =%d", result); + result = ime_event_set_display_language_changed_cb(ise_template_display_language_changed_cb, data); + DBG("ime_event_set_display_language_changed_cb =%d", result); + result = ime_event_set_rotation_degree_changed_cb(ise_template_rotation_degree_changed_cb, data); + DBG("ime_event_set_rotation_degree_changed_cb =%d", result); + result = ime_event_set_input_context_reset_cb(ise_template_input_context_reset_cb, data); + DBG("ime_event_set_input_context_reset_cb =%d", result); + result = ime_event_set_language_set_cb(ise_template_language_set_cb, data); + DBG("ime_event_set_language_set_cb =%d", result); + result = ime_event_set_language_requested_cb(ise_template_language_requested_cb, data); + DBG("ise_template_language_requested_cb =%d", result); + result = ime_event_set_geometry_requested_cb(ise_template_geometry_requested_cb, data); + DBG("ime_event_set_geometry_requested_cb =%d", result); + result = ime_event_set_imdata_set_cb(ise_template_imdata_set_cb,data); + DBG("ime_event_set_imdata_set_cb =%d", result); + result = ime_event_set_accessibility_state_changed_cb(ise_template_accessibility_state_changed_cb, data); + DBG("ime_event_set_accessibility_state_changed_cb =%d", result); + result = ime_event_set_option_window_created_cb(ise_template_option_window_created_cb, data); + DBG("ime_event_set_option_window_created_cb =%d", result); + result = ime_event_set_option_window_destroyed_cb(ise_template_option_window_destroyed_cb, data); + // Start IME + ime_run(&basic_callback, data); +} + +static char* get_ecore_imf_device_class(Ecore_IMF_Device_Class e) +{ + char* str = NULL; + switch(e) + { + case ECORE_IMF_DEVICE_CLASS_NONE: + str = "ECORE_IMF_DEVICE_CLASS_NONE"; + break; + case ECORE_IMF_DEVICE_CLASS_SEAT: + str = "ECORE_IMF_DEVICE_CLASS_SEAT"; + break; + case ECORE_IMF_DEVICE_CLASS_KEYBOARD: + str = "ECORE_IMF_DEVICE_CLASS_KEYBOARD"; + break; + case ECORE_IMF_DEVICE_CLASS_MOUSE: + str = "ECORE_IMF_DEVICE_CLASS_MOUSE"; + break; + case ECORE_IMF_DEVICE_CLASS_TOUCH: + str = "ECORE_IMF_DEVICE_CLASS_TOUCH"; + break; + case ECORE_IMF_DEVICE_CLASS_PEN: + str = "ECORE_IMF_DEVICE_CLASS_PEN"; + break; + case ECORE_IMF_DEVICE_CLASS_POINTER: + str = "ECORE_IMF_DEVICE_CLASS_POINTER"; + break; + case ECORE_IMF_DEVICE_CLASS_GAMEPAD: + str = "ECORE_IMF_DEVICE_CLASS_GAMEPAD"; + break; + default: + str = "UNKWON_CLASS"; + break; + } + return str; +} + +static char* get_ecore_imf_device_subclass(Ecore_IMF_Device_Subclass e) +{ + char* str = NULL; + switch(e) + { + case ECORE_IMF_DEVICE_SUBCLASS_NONE: + str = "ECORE_IMF_DEVICE_SUBCLASS_NONE"; + break; + case ECORE_IMF_DEVICE_SUBCLASS_FINGER: + str = "ECORE_IMF_DEVICE_SUBCLASS_FINGER"; + break; + case ECORE_IMF_DEVICE_SUBCLASS_FINGERNAIL: + str = "ECORE_IMF_DEVICE_SUBCLASS_FINGERNAIL"; + break; + case ECORE_IMF_DEVICE_SUBCLASS_KNUCKLE: + str = "ECORE_IMF_DEVICE_SUBCLASS_KNUCKLE"; + break; + case ECORE_IMF_DEVICE_SUBCLASS_PALM: + str = "ECORE_IMF_DEVICE_SUBCLASS_PALM"; + break; + case ECORE_IMF_DEVICE_SUBCLASS_HAND_SIZE: + str = "ECORE_IMF_DEVICE_SUBCLASS_HAND_SIZE"; + break; + case ECORE_IMF_DEVICE_SUBCLASS_HAND_FLAT: + str = "ECORE_IMF_DEVICE_SUBCLASS_HAND_FLAT"; + break; + case ECORE_IMF_DEVICE_SUBCLASS_PEN_TIP: + str = "ECORE_IMF_DEVICE_SUBCLASS_PEN_TIP"; + break; + case ECORE_IMF_DEVICE_SUBCLASS_TRACKPAD: + str = "ECORE_IMF_DEVICE_SUBCLASS_TRACKPAD"; + break; + case ECORE_IMF_DEVICE_SUBCLASS_TRACKPOINT: + str = "ECORE_IMF_DEVICE_SUBCLASS_TRACKPOINT"; + break; + case ECORE_IMF_DEVICE_SUBCLASS_TRACKBALL: + str = "ECORE_IMF_DEVICE_SUBCLASS_TRACKBALL"; + break; + default: + str = "UNKNWON_SUBCLASS"; + break; + } + return str; +} +static char *format_string(const char *format, ...) +{ + va_list arg; + char* chTemp; + chTemp= (char*)malloc(1024 * sizeof(char)); + RETVM_IF(!chTemp, NULL,"malloc failed."); + va_start(arg,format); + vsnprintf(chTemp,1024,format,arg); + va_end(arg); + return chTemp; +} diff --git a/tbt-ime/tizen-manifest.xml b/tbt-ime/tizen-manifest.xml new file mode 100644 index 0000000..de1e0b1 --- /dev/null +++ b/tbt-ime/tizen-manifest.xml @@ -0,0 +1,12 @@ + + + + + + tbt-ime.png + + + + http://tizen.org/privilege/ime + + diff --git a/tbtcoreapp/inc/model/tbt-info.h b/tbtcoreapp/inc/model/tbt-info.h index 66778b0..46dc418 100644 --- a/tbtcoreapp/inc/model/tbt-info.h +++ b/tbtcoreapp/inc/model/tbt-info.h @@ -195,6 +195,8 @@ typedef enum { TBT_APP_IME_CONTEXT_GET, + TBT_APP_IME_WEARABLE_ROTARY_INPUT, + TBT_APP_WIDGET, TBT_APP_MTP, diff --git a/tbtcoreapp/inc/utils/app_module_config.h b/tbtcoreapp/inc/utils/app_module_config.h index 9b7d290..9e9b868 100644 --- a/tbtcoreapp/inc/utils/app_module_config.h +++ b/tbtcoreapp/inc/utils/app_module_config.h @@ -147,11 +147,12 @@ #define TBT_MODULE_EVENT #define TBT_MODULE_APP_EVENT_VIEW -//#define TBT_MODULE_IME -//#define TBT_MODULE_APP_IME_ALPHABATIC -//#define TBT_MODULE_APP_IME_NUMERIC -//#define TBT_MODULE_APP_IME_EVENT -//#define TBT_MODULE_APP_IME_CONTEXT_GET +#define TBT_MODULE_IME +#define TBT_MODULE_APP_IME_ALPHABATIC +#define TBT_MODULE_APP_IME_NUMERIC +#define TBT_MODULE_APP_IME_EVENT +#define TBT_MODULE_APP_IME_CONTEXT_GET +#define TBT_MODULE_APP_IME_WEARABLE_ROTARY_INPUT #define TBT_MODULE_WIDGET #define TBT_MODULE_APP_WIDGET diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_360/input_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/input_viewer.edc index 2abafc3..e1471d2 100644 --- a/tbtcoreapp/res/edje/2.3.1/wearable_360_360/input_viewer.edc +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/input_viewer.edc @@ -14,30 +14,67 @@ * limitations under the License. */ -#define TEXT_HEIGHT 0.08 -#define HEADER_HIGHT 0.0 -#include "wearable_circle_toolbar.edc" - collections { - base_scale: 1.8; - group - { - name: "input_viewer"; - parts{ - part{ - name: "input_text"; - type: SWALLOW; - description{ - state: "default" 0.0; - align: 0.0 0.0; - visible: 1; - rel1 {relative: 0.0 HEADER_HIGHT+0.0; } - rel2 {relative: 1.0 HEADER_HIGHT+0.40; } - } + base_scale: 1.40; + group + { + name: "ime_viewer"; + parts{ + + part{ + name: "base"; + type: RECT; + description{ + state: "default" 0.0; + visible: 1; + color: 0 0 0 255; + } + } + + part{ + name: "input_text"; + type: SWALLOW; + scale: 1; + description{ + state: "default" 0.0; + align: 0.0 0.0; + visible: 1; + rel1{ + relative: 0.0 0.0; + } + rel2{ + relative: 1.0 0.1; + } + fixed: 1 1; } + } - WEARABLE_TOOLBAR_PART - } - } + part { name: "padding"; + type: SPACER; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.1; } + rel2 { relative: 1.0 1.0; } + fixed: 1 1; + } + } + + part { name: "wearable_toolbar"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + rel1 { + relative: 0.0 1.0; + } + rel2 { + relative: 1.0 1.0; + } + visible: 1; + fixed: 1 1; + } + } + } + } } diff --git a/tbtcoreapp/src/model/tbt-list.c b/tbtcoreapp/src/model/tbt-list.c index 9d2169d..bf27508 100644 --- a/tbtcoreapp/src/model/tbt-list.c +++ b/tbtcoreapp/src/model/tbt-list.c @@ -1691,6 +1691,21 @@ static tbt_info tbtapps[] = .required_features_count = 0 }, #endif + #ifdef TBT_MODULE_APP_IME_WEARABLE_ROTARY_INPUT + + //Wearable Rotary Input + { + .name = "IME Wearable Rotary Input", + .parent = "IME", + .apptype = TBT_APP_IME_WEARABLE_ROTARY_INPUT, + .icon_name = "dummy", + .info = "1. Set Default keyboard to TBT keyboard from Settings.
" + "2. Click on click here a IME window will be shown.
" + "3. Rotate wearable dial. and corresponding rotation direction message will be shown
", + .result = 0, + .required_features_count = 0 + }, + #endif #endif #ifdef TBT_MODULE_WIDGET @@ -2351,7 +2366,9 @@ static tbt_info tbtapps[] = "4. Select /tizen/remote-app-control first. Then cortbt_uiapp will be launch in D2D Server.
" "5. Select http://192.168.43.54:8001/api/v2/ then Connect will be shown in D2D Server and Publish will be shown in D2D Client.
" "6. Select Publish on Client side and GoodNews Received will be shown in D2D Server.", - .result = 0 + .result = 0, + .required_features_count = 1, + .features_required = { FEATURE_NETWORK_WIFI } }, #endif #ifdef TBT_MODULE_APP_D2D_SERVER @@ -2363,7 +2380,9 @@ static tbt_info tbtapps[] = .info = "1. Connect D2D Client to Same WiFi Network.
" "2. Run D2D Server Module from TBT again.
" "3. Server Ready Message will be shown", - .result = 0 + .result = 0, + .required_features_count = 1, + .features_required = { FEATURE_NETWORK_WIFI } }, #endif #endif diff --git a/tbtcoreapp/src/view/tbt-bluetooth-view.c b/tbtcoreapp/src/view/tbt-bluetooth-view.c index db31c04..0606318 100644 --- a/tbtcoreapp/src/view/tbt-bluetooth-view.c +++ b/tbtcoreapp/src/view/tbt-bluetooth-view.c @@ -1598,8 +1598,8 @@ static void _bt_pbap_list_vcards_cb(int result, const char *remote_address, cons RETM_IF(NULL == this, "view is NULL"); elm_genlist_clear(this->bluetooth_list); - - for(int i=0; i error: %s", get_bluetooth_error(result)); - - for(int i=0; inavi, info, it); - break; + #ifdef TBT_MODULE_APP_IME_ALPHABATIC + case TBT_APP_IME_ALPHABATIC: + ime_view_add(view->navi, info, it); + break; + #endif + #ifdef TBT_MODULE_APP_IME_NUMERIC case TBT_APP_IME_NUMERIC: ime_view_add(view->navi, info, it); break; + #endif + #ifdef TBT_MODULE_APP_IME_EVENT case TBT_APP_IME_EVENT: ime_view_add(view->navi, info, it); break; + #endif + #ifdef TBT_MODULE_APP_IME_CONTEXT_GET case TBT_APP_IME_CONTEXT_GET: ime_view_add(view->navi, info, it); break; + #endif + #ifdef TBT_MODULE_APP_IME_WEARABLE_ROTARY_INPUT + case TBT_APP_IME_WEARABLE_ROTARY_INPUT: + ime_view_add(view->navi, info, it); + break; + #endif #endif #ifdef TBT_MODULE_WIDGET diff --git a/tbtcoreapp/src/view/tbt-ime-view.c b/tbtcoreapp/src/view/tbt-ime-view.c index 3aefb4e..523b8cb 100644 --- a/tbtcoreapp/src/view/tbt-ime-view.c +++ b/tbtcoreapp/src/view/tbt-ime-view.c @@ -73,7 +73,7 @@ ime_view *ime_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *i RETVM_IF(!this->view, NULL, "calloc failed"); tbt_info->layout_group = "ime_viewer"; - tbt_info->layout_file = get_edje_path("ime_viewer.edj"); + tbt_info->layout_file = get_edje_path("input_viewer.edj"); DBG("EDJ added."); @@ -96,22 +96,28 @@ ime_view *ime_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *i } else if(this->view->tbt_info->apptype == TBT_APP_IME_NUMERIC) { - this->ime_entry1 = ui_utils_entry_add(this, this->view->layout, ELM_INPUT_PANEL_LAYOUT_NUMBER, ""); - elm_entry_input_panel_language_set(this->ime_entry1, ELM_INPUT_PANEL_LANG_AUTOMATIC); - elm_object_part_text_set(this->ime_entry1, PART_ENTRY_GUIDE, "Input Number"); - elm_object_part_content_set(this->view->layout, "input_text", this->ime_entry1); + this->ime_entry1 = ui_utils_entry_add(this, this->view->layout, ELM_INPUT_PANEL_LAYOUT_NUMBER, ""); + elm_entry_input_panel_language_set(this->ime_entry1, ELM_INPUT_PANEL_LANG_AUTOMATIC); + elm_object_part_text_set(this->ime_entry1, PART_ENTRY_GUIDE, "Input Number"); + elm_object_part_content_set(this->view->layout, "input_text", this->ime_entry1); } else if(this->view->tbt_info->apptype == TBT_APP_IME_EVENT) { - this->ime_entry1 = ui_utils_entry_add(this, this->view->layout, ELM_INPUT_PANEL_LAYOUT_IP, ""); - elm_object_part_text_set(this->ime_entry1, PART_ENTRY_GUIDE, "Do event."); - elm_object_part_content_set(this->view->layout, "input_text", this->ime_entry1); + this->ime_entry1 = ui_utils_entry_add(this, this->view->layout, ELM_INPUT_PANEL_LAYOUT_IP, ""); + elm_object_part_text_set(this->ime_entry1, PART_ENTRY_GUIDE, "Do event."); + elm_object_part_content_set(this->view->layout, "input_text", this->ime_entry1); } else if(this->view->tbt_info->apptype == TBT_APP_IME_CONTEXT_GET) { - this->ime_entry1 = ui_utils_entry_add(this, this->view->layout, ELM_INPUT_PANEL_LAYOUT_HEX, ""); - elm_object_part_text_set(this->ime_entry1, PART_ENTRY_GUIDE, "See Context Variables."); - elm_object_part_content_set(this->view->layout, "input_text", this->ime_entry1); + this->ime_entry1 = ui_utils_entry_add(this, this->view->layout, ELM_INPUT_PANEL_LAYOUT_HEX, ""); + elm_object_part_text_set(this->ime_entry1, PART_ENTRY_GUIDE, "See Context Variables."); + elm_object_part_content_set(this->view->layout, "input_text", this->ime_entry1); + } + else if(this->view->tbt_info->apptype == TBT_APP_IME_WEARABLE_ROTARY_INPUT) + { + this->ime_entry1 = ui_utils_entry_add(this, this->view->layout, ELM_INPUT_PANEL_LAYOUT_TERMINAL, ""); //this is dummy Elm_Input_Panel_Layout for testing wearable rotary input + elm_object_part_text_set(this->ime_entry1, PART_ENTRY_GUIDE, "click here"); + elm_object_part_content_set(this->view->layout, "input_text", this->ime_entry1); } Elm_Input_Panel_Layout l; diff --git a/tbtcoreapp/src/view/tbt-stt-view.c b/tbtcoreapp/src/view/tbt-stt-view.c index 474d34e..e25c233 100644 --- a/tbtcoreapp/src/view/tbt-stt-view.c +++ b/tbtcoreapp/src/view/tbt-stt-view.c @@ -346,8 +346,8 @@ static void _stt_recognition_result_cb(stt_h stt, stt_result_event_e event, cons int ret = stt_foreach_detailed_result(stt, _stt_result_time_cb, this); DBG("stt_foreach_detailed_result fail > Error = %s", get_stt_error(ret)); - - for(int i=0; i