Support back key 41/17441/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Wed, 19 Jun 2013 12:00:34 +0000 (21:00 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 7 Mar 2014 01:35:46 +0000 (10:35 +0900)
Change-Id: I68e77aa95129dd7c3a89f6d4aa8c054a9f45f526

configure.ac
ism/demos/Makefile.am
ism/demos/isf_demo_efl.cpp
ism/extras/efl_setting/Makefile.am
ism/extras/efl_setting/isf_setting_efl.cpp
packaging/isf.spec

index 66fe843..966f99f 100755 (executable)
@@ -230,6 +230,9 @@ if test "$ISF_HAS_EFL" = "yes"; then
   AC_SUBST(EFL_IM_MODULEDIR)
 fi
 
+# Check EFL assist library
+PKG_CHECK_MODULES(EFL_ASSIST, [efl-assist])
+
 # Check x11 library
 PKG_CHECK_MODULES(X11, [x11])
 
index 41af462..b42a9ea 100644 (file)
@@ -43,11 +43,15 @@ isf_demo_efl_SOURCES  = isf_demo_efl.cpp \
 isf_demo_efl_CXXFLAGS = @EFL_CFLAGS@ \
                         @APPCORE_EFL_CFLAGS@ \
                         @UIGADGET_CFLAGS@ \
-                        @VCONF_CFLAGS@ @PRIVILEGE_CONTROL_CFLAGS@
+                        @VCONF_CFLAGS@ \
+                        @PRIVILEGE_CONTROL_CFLAGS@ \
+                        @EFL_ASSIST_CFLAGS@
 
 isf_demo_efl_LDFLAGS  = @EFL_LIBS@ @LTLIBINTL@ -rpath $(libdir) \
                         @VCONF_LIBS@ \
                         @APPCORE_EFL_LIBS@ \
-                        @UIGADGET_LIBS@ @PRIVILEGE_CONTROL_LIBS@
+                        @UIGADGET_LIBS@ \
+                        @PRIVILEGE_CONTROL_LIBS@ \
+                        @EFL_ASSIST_LIBS@
 
 isf_demo_efl_LDADD    = $(top_builddir)/ism/src/libscim@SCIM_EPOCH@.la
index c762589..3753867 100644 (file)
@@ -27,6 +27,7 @@
 #include <Elementary.h>
 #include <Ecore_X.h>
 #include <privilege-control.h>
+#include <efl_assist.h>
 #include "isf_demo_efl.h"
 #include "isf_imcontrol_efl.h"
 #include "isf_layout_efl.h"
@@ -251,9 +252,23 @@ static Evas_Object* create_layout_main (struct appdata *ad)
     return layout;
 }
 
+static void
+_naviframe_back_cb (void *data, Evas_Object *obj, void *event_info)
+{
+    Elm_Object_Item *top_it = elm_naviframe_top_item_get (obj);
+    Elm_Object_Item *bottom_it = elm_naviframe_bottom_item_get (obj);
+    if (top_it && bottom_it && (elm_object_item_content_get (top_it) == elm_object_item_content_get (bottom_it))) {
+        elm_exit ();
+    } else {
+        elm_naviframe_item_pop (obj);
+    }
+}
+
 static Evas_Object* _create_naviframe_layout (Evas_Object *parent)
 {
     Evas_Object *naviframe = elm_naviframe_add (parent);
+    elm_naviframe_prev_btn_auto_pushed_set (naviframe, EINA_FALSE);
+    ea_object_event_callback_add (naviframe, EA_CALLBACK_BACK, _naviframe_back_cb, NULL);
     elm_object_part_content_set (parent, "elm.swallow.content", naviframe);
 
     evas_object_show (naviframe);
@@ -265,7 +280,6 @@ static Eina_Bool _keydown_event (void *data, int type, void *event)
 {
     Ecore_Event_Key *ev = (Ecore_Event_Key *)event;
     struct appdata *ad = (struct appdata *)data;
-    Elm_Object_Item *top_it, *bottom_it;
     if (ad == NULL || ev == NULL) return ECORE_CALLBACK_RENEW;
 
     printf ("[ecore key down] keyname : '%s', key : '%s', string : '%s', compose : '%s'\n", ev->keyname, ev->key, ev->string, ev->compose);
index 0889851..b7af7ff 100644 (file)
@@ -31,7 +31,8 @@ libug_isfsetting_efl_la_CXXFLAGS = @EFL_CFLAGS@ \
                                    @VCONF_CFLAGS@ \
                                    @UIGADGET_CFLAGS@ \
                                    @DLOG_CFLAGS@ \
-                                   @PKGMGR_INFO_CFLAGS@
+                                   @PKGMGR_INFO_CFLAGS@ \
+                                   @EFL_ASSIST_CFLAGS@
 
 libug_isfsetting_efl_la_LDFLAGS  = -avoid-version \
                                    -export-dynamic \
@@ -44,6 +45,7 @@ libug_isfsetting_efl_la_LIBADD  =  @LIBTOOL_EXPORT_OPTIONS@ \
                                    @DLOG_LIBS@ \
                                    @UIGADGET_LIBS@ \
                                    @PKGMGR_INFO_LIBS@ \
+                                   @EFL_ASSIST_LIBS@ \
                                    $(top_builddir)/ism/src/libscim@SCIM_EPOCH@.la \
                                    $(top_builddir)/ism/extras/efl_immodule/libisf-imf-module.la
 
index 84aa05f..816066a 100644 (file)
 #include <vconf.h>
 #include <ui-gadget-module.h>
 #include <ui-gadget.h>
+#include <pkgmgr-info.h>
+#include <efl_assist.h>
 #include "scim.h"
 #include "scim_stl_map.h"
 #include "isf_setting_efl.h"
 #include "../efl_panel/isf_panel_utility.h"
 #include "scim_setup_module_efl.h"
 #include "isf_control.h"
-#include <pkgmgr-info.h>
 
 using namespace scim;
 using namespace std;
@@ -232,6 +233,8 @@ static Evas_Object *create_frameview (Evas_Object *parent, struct ug_data *ugd)
 static Evas_Object *create_naviframe_layout (Evas_Object* parent)
 {
     Evas_Object *naviframe = elm_naviframe_add (parent);
+    elm_naviframe_prev_btn_auto_pushed_set (naviframe, EINA_FALSE);
+    ea_object_event_callback_add (naviframe, EA_CALLBACK_BACK, ea_naviframe_back_cb, NULL);
     elm_object_part_content_set (parent, "elm.swallow.content", naviframe);
     evas_object_show (naviframe);
 
@@ -1308,8 +1311,7 @@ static Evas_Object *create_setting_main_view (ug_data *ugd)
         Evas_Object *back_btn = elm_button_add (ugd->naviframe);
         elm_object_style_set (back_btn, "naviframe/back_btn/default");
         nf_main_it = elm_naviframe_item_push (ugd->naviframe, _T("Keyboard"), back_btn, NULL, genlist, NULL);
-        elm_naviframe_item_pop_cb_set(nf_main_it, back_cb, ugd);
-
+        elm_naviframe_item_pop_cb_set (nf_main_it, back_cb, ugd);
     }
     return ugd->naviframe;
 }
index 67ed8fe..1e4391a 100644 (file)
@@ -25,6 +25,7 @@ BuildRequires:  pkgconfig(x11)
 BuildRequires:  pkgconfig(notification)
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(tts)
+BuildRequires:  efl-assist-devel
 Requires(post): /sbin/ldconfig /usr/bin/vconftool
 Requires(postun): /sbin/ldconfig