From: Jihoon Kim Date: Mon, 12 Jul 2010 00:04:25 +0000 (+0900) Subject: check widget type in entry X-Git-Tag: beat-winset-test_0.1.1-40~189^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=08d456e8807616fdbeda87e720bd08a8c80ae855;p=framework%2Fuifw%2Felementary.git check widget type in entry --- diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index fadf95d..6040079 100755 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -158,6 +158,7 @@ static int _string_key_value_replace(char *oldstring, char *key, char *value, ch static int _is_width_over(Evas_Object *obj); static void _ellipsis_entry_to_width(Evas_Object *obj); static int _textinput_control_function(void *data,void *input_data); +static int _entry_length_get(Evas_Object *obj); #define MIN_ENTRY_FONT_SIZE 8 #define MAX_ENTRY_FONT_SIZE 60 @@ -364,10 +365,10 @@ _check_enable_returnkey(Evas_Object *obj) if (!wd->autoreturnkey) return; if (_entry_length_get(obj) == 0) { - ecore_imf_context_ise_set_disable_key(ic, ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL, ECORE_IMF_INPUT_PANEL_KEY_ENTER, EINA_TRUE); + ecore_imf_context_input_panel_key_disabled_set(ic, ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL, ECORE_IMF_INPUT_PANEL_KEY_ENTER, EINA_TRUE); } else { - ecore_imf_context_ise_set_disable_key(ic, ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL, ECORE_IMF_INPUT_PANEL_KEY_ENTER, EINA_FALSE); + ecore_imf_context_input_panel_key_disabled_set(ic, ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL, ECORE_IMF_INPUT_PANEL_KEY_ENTER, EINA_FALSE); } } @@ -917,7 +918,7 @@ _mkup_to_text(const char *mkup) return str; } -int +static int _entry_length_get(Evas_Object *obj) { int len; @@ -1510,7 +1511,7 @@ _ellipsis_entry_to_width(Evas_Object *obj) char *oldstring, *value, *textlocater, *entrystring; char *string, fontbuf[16]; - if (!wd) return NULL; + if (!wd) return; entrystring = edje_object_part_text_get(wd->ent, "elm.text"); @@ -2661,6 +2662,7 @@ elm_entry_utf8_to_markup(const char *s) EAPI Ecore_IMF_Context *elm_entry_imf_context_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); if (!wd || !wd->ent) return NULL; @@ -2670,16 +2672,21 @@ EAPI Ecore_IMF_Context *elm_entry_imf_context_get(Evas_Object *obj) 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); + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + + wd->autoreturnkey = on; + _check_enable_returnkey(obj); } EAPI void elm_entry_autocapitalization_set(Evas_Object *obj, Eina_Bool on) { + ELM_CHECK_WIDTYPE(obj, widtype); Eina_Bool autocap = on; Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; if (!wd->password) autocap = EINA_FALSE; @@ -2700,6 +2707,7 @@ elm_entry_autocapitalization_set(Evas_Object *obj, Eina_Bool on) EAPI void elm_entry_fontsize_set(Evas_Object *obj, const int fontsize) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); char *string, fontvalue[16], *entrystring; int len; @@ -2729,6 +2737,7 @@ elm_entry_fontsize_set(Evas_Object *obj, const int fontsize) EAPI void elm_entry_text_align_set(Evas_Object *obj, char *alignmode) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); char *string, *entrystring; int len; @@ -2760,6 +2769,7 @@ elm_entry_text_align_set(Evas_Object *obj, char *alignmode) EAPI void elm_entry_text_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); char *string, *entrystring, colorstring[16]; int len; @@ -2792,6 +2802,7 @@ elm_entry_text_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsig EAPI void elm_entry_background_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); evas_object_color_set(wd->bg, r, g, b, a); @@ -2812,6 +2823,7 @@ elm_entry_background_color_set(Evas_Object *obj, unsigned int r, unsigned int g, EAPI void elm_entry_ellipsis_set(Evas_Object *obj, Eina_Bool ellipsis) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); const char *t; if (wd->ellipsis == ellipsis) return; @@ -2831,7 +2843,10 @@ elm_entry_ellipsis_set(Evas_Object *obj, Eina_Bool ellipsis) EAPI void elm_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + wd->input_panel_enable = enabled; edje_object_part_text_input_panel_enabled_set(wd->ent, "elm.text", enabled); } @@ -2847,7 +2862,7 @@ elm_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled) EAPI void elm_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout) { - Widget_Data *wd = elm_widget_data_get(obj); + ELM_CHECK_WIDTYPE(obj, widtype); Ecore_IMF_Context *ic = elm_entry_imf_context_get(obj); if (!ic) return;