fi
AC_SUBST(ELM_ETHUMB_DEF)
+ELM_IMF_DEF="#undef"
+have_elementary_imf="no"
+want_elementary_imf="auto"
+AC_ARG_ENABLE([imf],
+ [AC_HELP_STRING([--disable-imf], [disable imf support. @<:@default=detect@:>@])],
+ [want_elementary_imf=$enableval], [])
+
+if test "x$want_elementary_imf" != "xno"; then
+ PKG_CHECK_MODULES([ELEMENTARY_IMF],
+ [
+ ecore-imf
+ ],
+ [
+ AC_DEFINE(HAVE_ELEMENTARY_IMF, 1, [Input Method Framework support for Elementary])
+ have_elementary_imf="yes"
+ ELM_IMF_DEF="#define"
+ requirement_elm="ecore-imf ${requirement_elm}"
+ ],
+ [have_elementary_imf="no"]
+ )
+else
+ have_elementary_imf="no"
+fi
+if test "x$want_elementary_imf" = "xyes" -a "x$have_elementary_imf" = "xno"; then
+ AC_MSG_ERROR([IMF support requested, but no ecore-imf found by pkg-config.])
+fi
+AC_SUBST(ELM_IMF_DEF)
+
+
ELM_ALLOCA_H_DEF="#undef"
AC_CHECK_HEADER(alloca.h, [ELM_ALLOCA_H_DEF="#define"])
AC_SUBST(ELM_ALLOCA_H_DEF)
echo " EFreet.............: ${have_elementary_efreet}"
echo " EWeather...........: ${have_elementary_eweather}"
echo " Ethumb.............: ${have_elementary_ethumb}"
+echo " IMF................: ${have_elementary_imf}"
echo
echo " edje_cc..............: ${edje_cc}"
echo
@ELM_EDBUS_DEF@ ELM_EDBUS
@ELM_EFREET_DEF@ ELM_EFREET
@ELM_ETHUMB_DEF@ ELM_ETHUMB
+@ELM_IMF_DEF@ ELM_IMF
@ELM_ALLOCA_H_DEF@ ELM_ALLOCA_H
@ELM_LIBINTL_H_DEF@ ELM_LIBINTL_H
# include <Ethumb_Client.h>
#endif
+#ifdef ELM_IMF
+# include <Ecore_IMF.h>
+#endif
+
+
#ifdef EAPI
# undef EAPI
#endif
EAPI void elm_entry_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data);
EAPI char *elm_entry_markup_to_utf8(const char *s);
EAPI char *elm_entry_utf8_to_markup(const char *s);
+
+ EAPI void elm_entry_autocapitalization_set(Evas_Object *obj, Eina_Bool on);
+ EAPI void elm_entry_autoenable_returnkey_set(Evas_Object *obj, Eina_Bool on);
+#ifdef ELM_IMF
+ EAPI const Ecore_IMF_Context *elm_entry_imf_context_get(Evas_Object *obj);
+#else
+ EAPI void *elm_entry_imf_context_get(Evas_Object *obj);
+#endif
+
/* smart callbacks called:
* "changed" - the text content changed
* "selection,start" - the user started selecting text
@ELEMENTARY_WINCE_CFLAGS@ \
@ELEMENTARY_EDBUS_CFLAGS@ \
@ELEMENTARY_EFREET_CFLAGS@ \
-@ELEMENTARY_ETHUMB_CFLAGS@
+@ELEMENTARY_ETHUMB_CFLAGS@ \
+@ELEMENTARY_IMF_CFLAGS@
if ELEMENTARY_WINDOWS_BUILD
AM_CPPFLAGS += -DELEMENTARY_BUILD
libelementary_la_CFLAGS =
-libelementary_la_LIBADD = @my_libs@ @dlopen_libs@ @ELEMENTARY_LIBS@ @ELEMENTARY_X_LIBS@ @ELEMENTARY_FB_LIBS@ @ELEMENTARY_SDL_LIBS@ @ELEMENTARY_WIN32_LIBS@ @ELEMENTARY_WINCE_LIBS@ @ELEMENTARY_EDBUS_LIBS@ @ELEMENTARY_EFREET_LIBS@ @ELEMENTARY_ETHUMB_LIBS@
+libelementary_la_LIBADD = @my_libs@ @dlopen_libs@ @ELEMENTARY_LIBS@ @ELEMENTARY_X_LIBS@ @ELEMENTARY_FB_LIBS@ @ELEMENTARY_SDL_LIBS@ @ELEMENTARY_WIN32_LIBS@ @ELEMENTARY_WINCE_LIBS@ @ELEMENTARY_EDBUS_LIBS@ @ELEMENTARY_EFREET_LIBS@ @ELEMENTARY_ETHUMB_LIBS@ @ELEMENTARY_IMF_LIBS@
libelementary_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@
Eina_Bool deferred_cur : 1;
Eina_Bool disabled : 1;
Eina_Bool context_menu : 1;
+ Eina_Bool autoreturnkey : 1;
};
struct _Elm_Entry_Context_Menu_Item
}
static void
+_check_enable_returnkey(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+
+#ifdef HAVE_ELEMENTARY_IMF
+ Ecore_IMF_Context *ic = elm_entry_imf_context_get(obj);
+ if (!ic) return;
+
+ if (!wd->autoreturnkey)
+ {
+ ecore_imf_context_ise_set_disable_key(ic, 1, ISE_KEY_ENTER, EINA_FALSE);
+ return;
+ }
+
+ if (_entry_length_get(obj) == 0) {
+ ecore_imf_context_ise_set_disable_key(ic, 1, ISE_KEY_ENTER, EINA_TRUE);
+ }
+ else {
+ ecore_imf_context_ise_set_disable_key(ic, 1, ISE_KEY_ENTER, EINA_FALSE);
+ }
+#endif
+}
+
+static void
_on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
edje_object_signal_emit(wd->ent, "elm,action,focus", "elm");
if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL);
+ _check_enable_returnkey(obj);
}
else
{
return str;
}
+int
+_entry_length_get(Evas_Object *obj)
+{
+ int len;
+ char *str = elm_entry_entry_get(obj);
+ if (!str) return 0;
+
+ char *plain_str = _mkup_to_text(str);
+ if (!plain_str) return 0;
+
+ len = strlen(plain_str);
+ free(plain_str);
+
+ return len;
+}
+
static char *
_text_to_mkup(const char *text)
{
if (!ss) ss = strdup("");
return ss;
}
+
+#ifdef HAVE_ELEMENTARY_IMF
+EAPI const Ecore_IMF_Context *elm_entry_imf_context_get(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd || !wd->ent) return NULL;
+
+ return edje_object_part_text_imf_context_get(wd->ent, "elm.text");
+}
+#else
+EAPI const Ecore_IMF_Context *elm_entry_imf_context_get(Evas_Object *obj)
+{
+ return NULL;
+}
+#endif
+
+EAPI void
+elm_entry_autoenable_returnkey_set(Evas_Object *obj, Eina_Bool on)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ wd->autoreturnkey = on;
+ _check_enable_returnkey(obj);
+}
+
+EAPI void
+elm_entry_autocapitalization_set(Evas_Object *obj, Eina_Bool on)
+{
+ Eina_Bool autocap = on;
+ Widget_Data *wd = elm_widget_data_get(obj);
+
+ if (!wd->password)
+ autocap = EINA_FALSE;
+ else
+ autocap = on;
+
+ edje_object_part_text_autocapitalization_set(wd->ent, "elm.text", autocap);
+}