Elm_Input_Panel_Return_Key_Type input_panel_return_key_type;
void *input_panel_imdata;
int input_panel_imdata_len;
- struct {
+ struct
+ {
Evas_Object *hover_parent;
Evas_Object *pop, *hover;
const char *hover_style;
- } anchor_hover;
+ } anchor_hover;
Eina_Bool changed : 1;
Eina_Bool single_line : 1;
Eina_Bool password : 1;
static void _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content);
static Evas_Object *_content_unset_hook(Evas_Object *obj, const char *part);
static Evas_Object *_content_get_hook(const Evas_Object *obj, const char *part);
+static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src, Evas_Callback_Type type, void *event_info);
static void _resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
static const char *_getbase(Evas_Object *obj);
static void _signal_entry_changed(void *data, Evas_Object *obj, const char *emission, const char *source);
}
if (wd->delay_write) ecore_timer_del(wd->delay_write);
if (wd->input_panel_imdata) free(wd->input_panel_imdata);
- free(wd);
if (wd->anchor_hover.hover_style) eina_stringshare_del(wd->anchor_hover.hover_style);
evas_event_thaw(evas_object_evas_get(obj));
evas_event_thaw_eval(evas_object_evas_get(obj));
+ free(wd);
}
static void
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
/* This is a hack to workaround the way min size hints are treated.
* If the minimum width is smaller than the restricted width, it means
- * the mininmum doesn't matter. */
+ * the minimum doesn't matter. */
if (minw <= resw)
{
Evas_Coord ominw = -1;
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
/* This is a hack to workaround the way min size hints are treated.
* If the minimum width is smaller than the restricted width, it means
- * the mininmum doesn't matter. */
+ * the minimum doesn't matter. */
if (minw <= vw)
{
Evas_Coord ominw = -1;
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Object *top = elm_widget_top_get(obj);
if (!wd) return;
- if (!wd->editable) return;
+
if (elm_widget_focus_get(obj))
{
printf("[Elm_entry::Focused] obj : %p\n", obj);
evas_object_focus_set(wd->ent, EINA_TRUE);
edje_object_signal_emit(wd->ent, "elm,action,focus", "elm");
- if (top && wd->input_panel_enable)
- elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
- evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL);
- _check_enable_return_key(obj);
wd->mgf_type = _ENTRY_MAGNIFIER_FIXEDSIZE;
+ if (wd->editable)
+ {
+ if (top && wd->input_panel_enable)
+ elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
+ evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL);
+ _check_enable_return_key(obj);
+ }
}
else
{
printf("[Elm_entry::Unfocused] obj : %p\n", obj);
edje_object_signal_emit(wd->ent, "elm,action,unfocus", "elm");
evas_object_focus_set(wd->ent, EINA_FALSE);
- if (top && wd->input_panel_enable)
- elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF);
- evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL);
-
if ((wd->api) && (wd->api->obj_hidemenu))
+ wd->api->obj_hidemenu(obj);
+
+ if (wd->editable)
{
- wd->api->obj_hidemenu(obj);
+ if (top && wd->input_panel_enable)
+ elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF);
+ evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL);
}
}
}
{
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Object *edje;
+ Evas_Object *prev_content;
if ((!wd) || (!content)) return;
if (wd->scroll)
else
edje = wd->ent;
- /* Delete the currently swallowed object */
- Evas_Object *cswallow;
-
if (!part || !strcmp(part, "icon"))
{
- cswallow = edje_object_part_swallow_get(edje, "elm.swallow.icon");
+ prev_content = edje_object_part_swallow_get(edje, "elm.swallow.icon");
edje_object_signal_emit(edje, "elm,action,show,icon", "elm");
}
else if (!strcmp(part, "end"))
{
- cswallow = edje_object_part_swallow_get(edje, "elm.swallow.end");
+ prev_content = edje_object_part_swallow_get(edje, "elm.swallow.end");
edje_object_signal_emit(edje, "elm,action,show,end", "elm");
}
else
- cswallow = edje_object_part_swallow_get(edje, part);
+ prev_content = edje_object_part_swallow_get(edje, part);
- if (cswallow) evas_object_del(cswallow);
+ if (prev_content) evas_object_del(prev_content);
evas_event_freeze(evas_object_evas_get(obj));
elm_widget_sub_object_add(obj, content);
evas_object_smart_callback_call(obj, "language,changed", NULL);
}
+static Eina_Bool
+_event_hook(Evas_Object *obj, Evas_Object *src, Evas_Callback_Type type, void *event_info)
+{
+ if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
+ Evas_Event_Key_Down *ev = event_info;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return EINA_FALSE;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
+ if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ return EINA_TRUE;
+}
+
static void
_signal_emit_hook(Evas_Object *obj, const char *emission, const char *source)
{
while (EINA_TRUE)
{
const char *temp = eina_strbuf_string_get(buf);
-
+
char *startTag = NULL;
char *endTag = NULL;
{
Widget_Data *wd = elm_widget_data_get(obj);
char *str = NULL;
-
+
if (wd->cnp_mode == ELM_CNP_MODE_NO_IMAGE)
{
str = _remove_item_tags(entry);
edje_object_part_text_user_insert(wd->ent, "elm.text", str);
if (str != entry) free(str);
+
+ // start for cbhm
+#ifdef HAVE_ELEMENTARY_X
+ if (cnpwidgetdata == obj)
+ ecore_x_selection_secondary_set(elm_win_xwindow_get(obj), "",1);
+#endif
+ // end for cbhm
}
static void
{
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return;
- wd->selmode = EINA_FALSE;
+ wd->selmode = EINA_TRUE; // TIZEN ONLY
if (!_elm_config->desktop_entry)
{
- edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
+ //edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE); // TIZEN ONLY
edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
elm_widget_scroll_hold_pop(data);
}
{
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return ECORE_CALLBACK_CANCEL;
- //_menu_press(data); /////// TIZEN ONLY
+ if ((!_elm_config->desktop_entry) && (!wd->magnifier_enabled))
+ _menu_press(data); /////// TIZEN ONLY
wd->longpress_timer = NULL;
evas_object_smart_callback_call(data, SIG_LONGPRESSED, NULL);
return ECORE_CALLBACK_CANCEL;
{
_magnifier_hide(data);
elm_object_scroll_freeze_pop(data);
+ if (wd->long_pressed) _menu_press(data);
}
- if (wd->long_pressed)
- _menu_press(data);
if (wd->longpress_timer)
{
ecore_timer_del(wd->longpress_timer);
wd->longpress_timer = NULL;
}
}
- else if (ev->button == 3)
+ else if ((ev->button == 3) && (!_elm_config->desktop_entry))
{
wd->usedown = 1;
_menu_press(data);
_region_get_job(void *data)
{
Widget_Data *wd = elm_widget_data_get(data);
- Evas_Coord_Rectangle ret_rect;
if (!wd) return;
wd->region_get_job = NULL;
_signal_entry_paste_request(void *data, Evas_Object *obj __UNUSED__, const char *emission, const char *source __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
+#ifdef HAVE_ELEMENTARY_X
Elm_Sel_Type type = (emission[sizeof("ntry,paste,request,")] == '1') ?
ELM_SEL_TYPE_PRIMARY : ELM_SEL_TYPE_CLIPBOARD;
+#endif
+
if (!wd) return;
+ if (!wd->editable) return;
evas_object_smart_callback_call(data, SIG_SELECTION_PASTE, NULL);
if (wd->sel_notify_handler)
{
{
evas_object_smart_callback_call(data, SIG_ANCHOR_CLICKED, &ei);
- _entry_hover_anchor_clicked(data, data, &ei);
+ if (!_elm_config->desktop_entry)
+ _entry_hover_anchor_clicked(data, data, &ei);
}
}
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- evas_event_freeze(evas_object_evas_get(obj));
if (!entry) entry = "";
if (item && strcmp(item, "default"))
{
return;
}
+ evas_event_freeze(evas_object_evas_get(obj));
if (wd->text) eina_stringshare_del(wd->text);
wd->text = NULL;
if (wd->password_text) eina_stringshare_del(wd->password_text);
if (item && strcmp(item, "default")) return NULL;
const char *text;
if (!wd) return NULL;
- if (wd->password)
- {
- if(wd->password_text) return wd->password_text;
- }
- else if (wd->text)
- {
- return wd->text;
- }
+
text = edje_object_part_text_get(wd->ent, "elm.text");
if (!text)
{
return NULL;
}
memcpy(tmpbuf, text, tlen);
- memcpy(tmpbuf + tlen, wd->append_text_left, wd->append_text_len);
+ if (wd->append_text_left)
+ memcpy(tmpbuf + tlen, wd->append_text_left, strlen(wd->append_text_left));
tmpbuf[tlen + wd->append_text_len] = '\0';
eina_stringshare_replace(&wd->text, tmpbuf);
free(tmpbuf);
EAPI Evas_Object *
elm_entry_add(Evas_Object *parent)
{
- Evas_Object *obj, *top;
+#ifdef HAVE_ELEMENTARY_X
+ Evas_Object *top;
+#endif
+ Evas_Object *obj;
Evas *e;
Widget_Data *wd;
elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook);
elm_object_cursor_set(obj, ELM_CURSOR_XTERM);
elm_widget_can_focus_set(obj, EINA_TRUE);
- elm_widget_highlight_ignore_set(obj, EINA_TRUE);
elm_widget_text_set_hook_set(obj, _elm_entry_text_set);
elm_widget_text_get_hook_set(obj, _elm_entry_text_get);
elm_widget_content_set_hook_set(obj, _content_set_hook);
elm_widget_content_unset_hook_set(obj, _content_unset_hook);
elm_widget_content_get_hook_set(obj, _content_get_hook);
elm_widget_translate_hook_set(obj, _translate_hook);
+ elm_widget_event_hook_set(obj, _event_hook);
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, wd);
}
EAPI void
+elm_entry_text_style_user_push(Evas_Object *obj, const char *style)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_part_text_style_user_push(wd->ent, "elm.text", style);
+ _theme_hook(obj);
+}
+
+EAPI void
+elm_entry_text_style_user_pop(Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ edje_object_part_text_style_user_pop(wd->ent, "elm.text");
+ _theme_hook(obj);
+}
+
+EAPI const char*
+elm_entry_text_style_user_peek(const Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
+ return edje_object_part_text_style_user_peek(wd->ent, "elm.text");
+}
+
+EAPI void
elm_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line)
{
ELM_CHECK_WIDTYPE(obj, widtype);
* otherwise it is. */
tb = edje_object_part_object_get(wd->ent, "elm.text");
cur = evas_object_textblock_cursor_new((Evas_Object *) tb); /* This is
- actually, ok for the time being, thsese hackish stuff will be removed
+ actually, ok for the time being, these hackish stuff will be removed
once evas 1.0 is out*/
evas_textblock_cursor_pos_set(cur, 0);
ret = evas_textblock_cursor_char_next(cur);
}
EAPI void
-elm_entry_text_filter_append(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data)
-{
- Widget_Data *wd;
- Elm_Entry_Markup_Filter *tf;
- ELM_CHECK_WIDTYPE(obj, widtype);
-
- wd = elm_widget_data_get(obj);
-
- EINA_SAFETY_ON_NULL_RETURN(func);
-
- tf = _filter_new(func, data);
- if (!tf) return;
-
- wd->text_filters = eina_list_append(wd->text_filters, tf);
-}
-
-EAPI void
-elm_entry_text_filter_prepend(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data)
-{
- Widget_Data *wd;
- Elm_Entry_Markup_Filter *tf;
- ELM_CHECK_WIDTYPE(obj, widtype);
-
- wd = elm_widget_data_get(obj);
-
- EINA_SAFETY_ON_NULL_RETURN(func);
-
- tf = _filter_new(func, data);
- if (!tf) return;
-
- wd->text_filters = eina_list_prepend(wd->text_filters, tf);
-}
-
-EAPI void
-elm_entry_text_filter_remove(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data)
-{
- Widget_Data *wd;
- Eina_List *l;
- Elm_Entry_Markup_Filter *tf;
- ELM_CHECK_WIDTYPE(obj, widtype);
-
- wd = elm_widget_data_get(obj);
-
- EINA_SAFETY_ON_NULL_RETURN(func);
-
- EINA_LIST_FOREACH(wd->text_filters, l, tf)
- {
- if ((tf->func == func) && ((!data) || (tf->data == data)))
- {
- wd->text_filters = eina_list_remove_list(wd->text_filters, l);
- _filter_free(tf);
- return;
- }
- }
-}
-
-EAPI void
elm_entry_markup_filter_append(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data)
{
Widget_Data *wd;
if (lim->max_char_count > 0)
{
len = evas_string_char_len_get(current);
- if (len >= lim->max_char_count)
+ newlen = evas_string_char_len_get(utfstr);
+ if ((len >= lim->max_char_count) && (newlen > 0))
{
evas_object_smart_callback_call(entry, "maxlength,reached", NULL);
free(*text);
free(utfstr);
return;
}
- newlen = evas_string_char_len_get(utfstr);
if ((len + newlen) > lim->max_char_count)
_add_chars_till_limit(entry, text, (lim->max_char_count - len), LENGTH_UNIT_CHAR);
}
else if (lim->max_byte_count > 0)
{
len = strlen(current);
- if (len >= lim->max_byte_count)
+ newlen = strlen(utfstr);
+ if ((len >= lim->max_byte_count) && (newlen > 0))
{
evas_object_smart_callback_call(entry, "maxlength,reached", NULL);
free(*text);
free(utfstr);
return;
}
- newlen = strlen(utfstr);
if ((len + newlen) > lim->max_byte_count)
_add_chars_till_limit(entry, text, (lim->max_byte_count - len), LENGTH_UNIT_BYTE);
}
}
EAPI void
-elm_entry_icon_set(Evas_Object *obj, Evas_Object *icon)
-{
- ELM_CHECK_WIDTYPE(obj, widtype);
- EINA_SAFETY_ON_NULL_RETURN(icon);
- _content_set_hook(obj, NULL, icon);
-}
-
-EAPI Evas_Object *
-elm_entry_icon_get(const Evas_Object *obj)
-{
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- return _content_get_hook(obj, NULL);
-}
-
-EAPI Evas_Object *
-elm_entry_icon_unset(Evas_Object *obj)
-{
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- return _content_unset_hook(obj, NULL);
-}
-
-EAPI void
elm_entry_icon_visible_set(Evas_Object *obj, Eina_Bool setting)
{
ELM_CHECK_WIDTYPE(obj, widtype);
}
EAPI void
-elm_entry_end_set(Evas_Object *obj, Evas_Object *end)
-{
- ELM_CHECK_WIDTYPE(obj, widtype);
- EINA_SAFETY_ON_NULL_RETURN(end);
- _content_set_hook(obj, "end", end);
-}
-
-EAPI Evas_Object *
-elm_entry_end_get(const Evas_Object *obj)
-{
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- return _content_get_hook(obj, "end");
-}
-
-EAPI Evas_Object *
-elm_entry_end_unset(Evas_Object *obj)
-{
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- return _content_unset_hook(obj, "end");
-}
-
-EAPI void
elm_entry_end_visible_set(Evas_Object *obj, Eina_Bool setting)
{
ELM_CHECK_WIDTYPE(obj, widtype);
wd->anchor_hover.hover_parent = NULL;
}
+static void
+_anchor_hover_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ Widget_Data *wd = elm_widget_data_get(data);
+ if (!wd) return;
+ if (wd->anchor_hover.pop) evas_object_del(wd->anchor_hover.pop);
+ wd->anchor_hover.pop = NULL;
+ evas_object_event_callback_del_full(wd->anchor_hover.hover, EVAS_CALLBACK_DEL,
+ _anchor_hover_del, obj);
+}
+
EAPI void
elm_entry_anchor_hover_parent_set(Evas_Object *obj, Evas_Object *parent)
{
Elm_Entry_Anchor_Hover_Info ei;
Evas_Coord x, w, y, h, px, py;
if (!wd) return;
+
ei.anchor_info = event_info;
+
wd->anchor_hover.pop = elm_icon_add(obj);
evas_object_move(wd->anchor_hover.pop, info->x, info->y);
evas_object_resize(wd->anchor_hover.pop, info->w, info->h);
+
wd->anchor_hover.hover = elm_hover_add(obj);
+ evas_object_event_callback_add(wd->anchor_hover.hover, EVAS_CALLBACK_DEL,
+ _anchor_hover_del, obj);
elm_widget_mirrored_set(wd->anchor_hover.hover, elm_widget_mirrored_get(obj));
if (wd->anchor_hover.hover_style)
elm_object_style_set(wd->anchor_hover.hover, wd->anchor_hover.hover_style);
+
hover_parent = wd->anchor_hover.hover_parent;
if (!hover_parent) hover_parent = obj;
elm_hover_parent_set(wd->anchor_hover.hover, hover_parent);
elm_hover_target_set(wd->anchor_hover.hover, wd->anchor_hover.pop);
ei.hover = wd->anchor_hover.hover;
+
evas_object_geometry_get(hover_parent, &x, &y, &w, &h);
ei.hover_parent.x = x;
ei.hover_parent.y = y;
!elm_object_part_content_get(wd->anchor_hover.hover, "bottom"))
{
evas_object_del(wd->anchor_hover.hover);
+ wd->anchor_hover.hover = NULL;
}
else
- {
- evas_object_show(wd->anchor_hover.hover);
- }
+ evas_object_show(wd->anchor_hover.hover);
}
/* END - ANCHOR HOVER */