#include "elm_module_priv.h"
#include "els_scroller.h"
+
/* Maximum chunk size to be inserted to the entry at once
* FIXME: This size is arbitrary, should probably choose a better size.
* Possibly also find a way to set it to a low value for weak computers,
edj = elm_smart_scroller_edje_object_get(wd->scroller);
str = edje_object_data_get(edj, "focus_highlight");
if ((str) && (!strcmp(str, "on")))
- elm_widget_highlight_in_theme_set(obj, EINA_TRUE);
+ elm_widget_highlight_in_theme_set(obj, EINA_TRUE);
else
- elm_widget_highlight_in_theme_set(obj, EINA_FALSE);
+ elm_widget_highlight_in_theme_set(obj, EINA_FALSE);
}
_sizing_eval(obj);
}
{
Evas_Coord cx, cy, cw, ch;
edje_object_part_text_cursor_geometry_get(wd->ent, "elm.text",
- &cx, &cy, &cw, &ch);
+ &cx, &cy, &cw, &ch);
if (wd->cur_changed)
{
elm_widget_show_region_set(obj, cx, cy, cw, ch, EINA_FALSE);
}
}
else
- wd->deferred_cur = EINA_TRUE;
+ wd->deferred_cur = EINA_TRUE;
}
static void
evas_object_resize(wd->scroller, resw, resh);
edje_object_size_min_calc
(elm_smart_scroller_edje_object_get(wd->scroller),
- &vmw, &vmh);
+ &vmw, &vmh);
elm_smart_scroller_child_viewport_size_get(wd->scroller, &vw, &vh);
edje_object_size_min_restricted_calc(wd->ent, &minw, &minh, vw, 0);
wd->entmw = minw;
evas_object_size_hint_min_get(obj, &w, NULL);
evas_object_size_hint_min_set(obj, w, h);
if (wd->single_line)
- evas_object_size_hint_max_set(obj, -1, h);
+ evas_object_size_hint_max_set(obj, -1, h);
else
- evas_object_size_hint_max_set(obj, -1, -1);
+ evas_object_size_hint_max_set(obj, -1, -1);
}
else
{
evas_object_resize(wd->ent, vw, vh);
edje_object_size_min_calc
(elm_smart_scroller_edje_object_get(wd->scroller),
- &vmw, &vmh);
+ &vmw, &vmh);
if (wd->single_line) h = vmh + minh;
else h = vmh;
evas_object_size_hint_min_get(obj, &w, NULL);
evas_object_size_hint_min_set(obj, w, h);
if (wd->single_line)
- evas_object_size_hint_max_set(obj, -1, h);
+ evas_object_size_hint_max_set(obj, -1, h);
else
- evas_object_size_hint_max_set(obj, -1, -1);
+ evas_object_size_hint_max_set(obj, -1, -1);
}
else
{
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
if (wd->single_line)
- evas_object_size_hint_max_set(obj, -1, minh);
+ evas_object_size_hint_max_set(obj, -1, minh);
else
- evas_object_size_hint_max_set(obj, -1, -1);
+ evas_object_size_hint_max_set(obj, -1, -1);
}
}
edje = elm_smart_scroller_edje_object_get(wd->scroller);
}
else
- edje = wd->ent;
+ edje = wd->ent;
if (edje)
content = edje_object_part_swallow_get(edje, part);
return content;
}
-
static void
_translate_hook(Evas_Object *obj)
{
if (!wd) return;
edje_object_signal_callback_add(wd->ent, emission, source, func_cb, data);
if (wd->scroller)
- edje_object_signal_callback_add(elm_smart_scroller_edje_object_get(wd->scroller),
- emission, source, func_cb, data);
+ edje_object_signal_callback_add(elm_smart_scroller_edje_object_get(wd->scroller),
+ emission, source, func_cb, data);
}
static void
edje_object_signal_callback_del_full(wd->ent, emission, source, func_cb,
data);
if (wd->scroller)
- edje_object_signal_callback_del_full(elm_smart_scroller_edje_object_get(wd->scroller),
- emission, source, func_cb, data);
+ edje_object_signal_callback_del_full(elm_smart_scroller_edje_object_get(wd->scroller),
+ emission, source, func_cb, data);
}
static void
{
Widget_Data *wd = elm_widget_data_get(obj);
if (wd->scroll)
- elm_smart_scroller_child_region_show(wd->scroller, x, y, w, h);
+ elm_smart_scroller_child_region_show(wd->scroller, x, y, w, h);
}
static void
if ((wd->autosave) && (wd->file))
wd->delay_write = ecore_timer_add(2.0, _delay_write, data);
-
/* callback - this could call callbacks that delete the entry... thus...
* any access to wd after this could be invalid */
evas_object_smart_callback_call(data, event, NULL);
static Eina_Bool
_event_selection_clear(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
{
-/*
+#if 0
Widget_Data *wd = elm_widget_data_get(data);
Ecore_X_Event_Selection_Clear *ev = event;
if (!wd) return ECORE_CALLBACK_PASS_ON;
{
elm_entry_select_none(data);
}
- return 1; */
+#else
// start for cbhm
Evas_Object *top = elm_widget_top_get(data);
}
// end for cbhm
+#endif
return ECORE_CALLBACK_PASS_ON;
}
wd->append_text_left[wd->append_text_position] = '\0';
edje_object_part_text_append(wd->ent, "elm.text",
- wd->append_text_left + start);
+ wd->append_text_left + start);
wd->append_text_left[wd->append_text_position] = backup;
}
else
{
- int index = 0;
+ int idx = 0;
if (*new_text == '&')
{
- while (*(new_text + index) != ';')
+ while (*(new_text + idx) != ';')
{
- index++;
- if (!*(new_text + index)) break;
+ idx++;
+ if (!*(new_text + idx)) break;
}
}
char *markup;
- index = evas_string_char_next_get(new_text, index, NULL);
- markup = malloc(index + 1);
- strncpy(markup, new_text, index);
- markup[index] = 0;
+ idx = evas_string_char_next_get(new_text, idx, NULL);
+ markup = malloc(idx + 1);
+ strncpy(markup, new_text, idx);
+ markup[idx] = 0;
if (unit == LENGTH_UNIT_BYTE)
unit_size = strlen(elm_entry_markup_to_utf8(markup));
else if (unit == LENGTH_UNIT_CHAR)
return;
}
can_add = 0;
- strncpy(new_text, new_text + index, current_len - ((new_text + index) - *text));
- current_len -= index;
+ strncpy(new_text, new_text + idx, current_len - ((new_text + idx) - *text));
+ current_len -= idx;
(*text)[current_len] = 0;
}
else
{
- new_text += index;
+ new_text += idx;
can_add -= unit_size;
}
i++;
edje_object_part_text_set(wd->ent, item, entry);
return;
}
+
if (wd->text) eina_stringshare_del(wd->text);
wd->text = NULL;
if (wd->password_text) eina_stringshare_del(wd->password_text);
elm_widget_translate_hook_set(obj, _translate_hook);
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, wd);
+
wd->scroller = elm_smart_scroller_add(e);
elm_widget_sub_object_add(obj, wd->scroller);
elm_smart_scroller_widget_set(wd->scroller, obj);
ELM_CHECK_WIDTYPE(obj, widtype) EINA_TRUE;
Widget_Data *wd = elm_widget_data_get(obj);
const Evas_Object *tb;
- //Evas_Textblock_Cursor *cur;
+ Evas_Textblock_Cursor *cur;
Eina_Bool ret;
if (!wd) return EINA_TRUE;
-#if 0
+if (0) {
/* It's a hack until we get the support suggested above.
* We just create a cursor, point it to the begining, and then
* try to advance it, if it can advance, the tb is not empty,
evas_textblock_cursor_free(cur);
return !ret;
-#endif
+}
char *str = elm_entry_markup_to_utf8(elm_entry_entry_get(obj));
if (!str) return EINA_TRUE;