diff options
author | InHong Han <inhong1.han@samsung.com> | 2019-10-08 13:03:14 +0900 |
---|---|---|
committer | InHong Han <inhong1.han@samsung.com> | 2019-10-08 13:03:35 +0900 |
commit | b029a86a277b25610b006f9bdab9d1e2e0983802 (patch) | |
tree | 1181a80e491af339fb5ae73fc6d95187bff44557 | |
parent | 7a8747f7957f3e944c2a8f7ca2590ebd7fc20602 (diff) | |
download | isf-b029a86a277b25610b006f9bdab9d1e2e0983802.tar.gz isf-b029a86a277b25610b006f9bdab9d1e2e0983802.tar.bz2 isf-b029a86a277b25610b006f9bdab9d1e2e0983802.zip |
Add floating IME test in demo
Change-Id: I37053f5eed70046bb1d3d82ea649dab85370bf18
Signed-off-by: InHong Han <inhong1.han@samsung.com>
-rw-r--r-- | ism/demos/Makefile.am | 3 | ||||
-rw-r--r-- | ism/demos/include/isf_position_set_efl.h | 36 | ||||
-rw-r--r-- | ism/demos/isf_demo_efl.cpp | 2 | ||||
-rw-r--r-- | ism/demos/isf_position_set_efl.cpp | 72 |
4 files changed, 112 insertions, 1 deletions
diff --git a/ism/demos/Makefile.am b/ism/demos/Makefile.am index c0ed8263..aa0bedc8 100644 --- a/ism/demos/Makefile.am +++ b/ism/demos/Makefile.am @@ -42,7 +42,8 @@ isf_demo_efl_SOURCES = isf_demo_efl.cpp \ isf_input_hint_efl.cpp \ isf_password_mode_efl.cpp \ isf_mime_type_efl.cpp \ - isf_demo_autotest.cpp + isf_demo_autotest.cpp \ + isf_position_set_efl.cpp isf_demo_efl_CXXFLAGS = @ECOREX_CFLAGS@ \ @ELEMENTARY_CFLAGS@ \ diff --git a/ism/demos/include/isf_position_set_efl.h b/ism/demos/include/isf_position_set_efl.h new file mode 100644 index 00000000..b8e0423c --- /dev/null +++ b/ism/demos/include/isf_position_set_efl.h @@ -0,0 +1,36 @@ +/* + * ISF(Input Service Framework) + * + * ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable. + * Copyright (c) 2012-2019 Samsung Electronics Co., Ltd. + * + * Contact: Jihoon Kim <jihoon48.kim@samsung.com>, Inhong Han <inhong1.han@samsung.com> + * + * This library is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef __ISE_POSITION_SET_H +#define __ISE_POSITION_SET_H + +#include <Elementary.h> + +void ise_position_set_bt (void *data, Evas_Object *obj, void *event_info); + +#endif /* __ISE_POSITION_SET_H */ + +/* +vi:ts=4:ai:nowrap:expandtab +*/ diff --git a/ism/demos/isf_demo_efl.cpp b/ism/demos/isf_demo_efl.cpp index 512ef68a..c8710165 100644 --- a/ism/demos/isf_demo_efl.cpp +++ b/ism/demos/isf_demo_efl.cpp @@ -48,6 +48,7 @@ #include "isf_password_mode_efl.h" #include "isf_mime_type_efl.h" #include "isf_demo_autotest.h" +#include "isf_position_set_efl.h" #include "tizen_profile.h" #include <string> @@ -84,6 +85,7 @@ static struct _menu_item isf_demo_menu_its[] = { { "ISF Popup test", isf_popup_bt }, { "ISF Event", isf_event_demo_bt }, { "ISF IM Control", imcontrolapi_bt }, + { "ISF Floating Position", ise_position_set_bt }, /* do not delete below */ { NULL, NULL } diff --git a/ism/demos/isf_position_set_efl.cpp b/ism/demos/isf_position_set_efl.cpp new file mode 100644 index 00000000..70ff62d3 --- /dev/null +++ b/ism/demos/isf_position_set_efl.cpp @@ -0,0 +1,72 @@ +/* + * ISF(Input Service Framework) + * + * ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable. + * Copyright (c) 2012-2019 Samsung Electronics Co., Ltd. + * + * Contact: Jihoon Kim <jihoon48.kim@samsung.com>, Inhong Han <inhong1.han@samsung.com> + * + * This library is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include "isf_demo_efl.h" +#include "isf_position_set_efl.h" + +static Evas_Object *_create_ef_layout (Evas_Object *parent, const char *label, const char *guide_text, int x, int y) +{ + Evas_Object *en; + Evas_Object *ef = create_ef (parent, label, guide_text, &en); + if (!ef || !en) return NULL; + + Ecore_IMF_Context *ic = NULL; + ic = (Ecore_IMF_Context *)elm_entry_imf_context_get (en); + + ecore_imf_context_input_panel_position_set(ic, x, y); + + return ef; +} + +static Evas_Object * create_inner_layout (void *data) +{ + struct appdata *ad = (struct appdata *)data; + Evas_Object *bx = NULL; + Evas_Object *ef = NULL; + + Evas_Object *parent = ad->naviframe; + + bx = elm_box_add (parent); + evas_object_size_hint_weight_set (bx, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set (bx, EVAS_HINT_FILL, 0.0); + evas_object_show (bx); + + ef = _create_ef_layout (parent, _("X = 100, Y = 100"), _("click to enter"), 100, 100); + elm_box_pack_end (bx, ef); + + ef = _create_ef_layout (parent, _("X = 300, Y = 300"), _("click to enter"), 300, 300); + elm_box_pack_end (bx, ef); + + return bx; +} + +void ise_position_set_bt (void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *lay_inner = create_inner_layout (data); + add_layout_to_naviframe (data, lay_inner, _("Test Floating IME Position")); +} + +/* +vi:ts=4:ai:nowrap:expandtab +*/ |