* Add elm_toolbar_item_show/bring_in.
It show or bring a specific item, when the toolbar can be scrolled.
+2012-11-21 Michael Bouchaud (yoz)
+
+ * update the min size hint on elm_label after a text set
+
2012-11-22 ChunEon Park (Hermet)
* Lets remove contents regardless of the preseve_on_set if naviframe is
* Fixed entry to enable have_selection only when a text is actually selected.
+2012-11-22 Michael Bouchaud (yoz)
+
+ * fix elm_flip to show only one face at a time
+
2012-11-23 ChunEon Park (Hermet)
* Free the text parts of the naviframe item when item is deleted.
* emit the signals for content_set/unset text_set/unset one time!
+2012-12-04 Cedric Bail
+
+ * Fix uninitialized data path in elm_flip.
+ * Fix uninitialized data path in elm_gesture_layer.
+
+2012-12-06 Cedric Bail
+
+ * Fix possible segv in elm_quicklaunch infrastructure.
+
+2012-12-10 Cedric Bail
+
+ * Make sure private data is not NULL in elm_interface_scrollable.
+
2012-12-12 ChunEon Park (Hermet)
* Update mapbuf forcely whenever it's states are changed.
* Let image update right now if the image preloading is disabled.
+2012-12-21 Stefan Schmidt
+
+ * Fix small memory leak in elm_map error path.
+
+2012-12-29 Mike Blumenkrantz
+
+ * Tooltips now correctly set NETWM tooltip window type
+
2013-01-13 Daniel Juyung Seo (SeoZ)
* Added "highlighted" and "unhighlighted" signals to list, genlist, and gengrid.
2013-01-26 ChanWook Jung (jchanwook@gmail.com)
* Expand elm_transit tween_mode and add twee_mode_factor_set(),get() APIs
+
+2013-01-29 ChunEon Park (Hermet)
+
+ * Fix a elm_transit crash issue when user delete all target objects in the effect end callback.
+
+2013-01-29 Jaehwan Kim
+
+ * Fix the scroll position is calculated by the size of pan object, not the size of scroller.
+
+2013-02-05 ChunEon Park (Hermet)
+
+ * Index supports "language,changed" smart callback.
+
+2013-03-04 WooHyun Jung
+
+ * Focus highlight should not be showed on (0, 0).
+
+2013-03-04 Junki Cho
+
+ * Improved gengrid item append performance.
+
+2013-03-05 Jiyoun Park
+
+ * Fix elm_conform didn't set size hint when keypad on.
+
+2013-03-05 Jaehwan Kim
+
+ * Add edje_object_message_signal_process before edje_object_size_min_restricted_calc.
+ If the min size is changed by edje signal in edc, the the function should be called before the calculation.
+
+2013-03-05 Jiyoun Park
+
+ * Fix elm_conform didn't change indicator mode when create.
+
+2013-03-06 ChunEon Park (Hermet)
+
+ * Add elm_object_item_signal_callback_add(), elm_object_item_signal_callback_del().
+
+2013-03-07 Jaehwan Kim
+
+ * Add the config ELM_THUMBSCROLL_HOLD_THRESHOLD.
+ This is the number of pixels the range which can be scrolled, while the scroller is holed.
-Changes since Elementary 1.7.0:
+Elementary 1.7.99
+
+Changes since elementary 1.7.98:
-------------------------
Additions:
* Add virtualkeypad, clipboard state change signals from conformant.
* Add elm_toolbar_item_show/bring_in.
* Add "highlighted" and "unhighlighted" callbacks to list, genlist, and gengrid.
+ * Add elm_index smart callback - "language,changed".
+ * Add smart callback signals of a scroller. "vbar,drag", "vbar,press", "vbar,unpress", "hbar,drag", "hbar,press", "hbar,unpress".
+ * Add elm_glview, elm_gengrid smart callback - "language,changed".
+ * Add APIs - elm_object_item_domain_translatable_part_text_set(), elm_object_item_translatable_part_text_get().
+ * Add APIs - elm_object_domain_translatable_part_text_set(), elm_object_translatable_part_text_get().
+ * Add APIs - elm_object_orientation_mode_disabled_set(), elm_object_orientation_mode_disabled_get().
+ * Add the reorder effect in toolbar.
+ * Added new APIs elm_transit_tween_mode_facator_set()/get()
+ * Support widget orientation mode in order to widgets have multiple styles for each window degree.
+ * Add elm_drop_target_add() elm_drop_target_del() and elm_drag_start()
+ * Add the option about sending signals in content_pos_set.
+ * Add omit feature to elm_index.
+ * Add elm_transit_smooth_set(), elm_transit_smooth_get()
+ * Add edje_object_message_signal_process before edje_object_size_min_restricted_calc.
+ * Add elm_object_item_signal_callback_add(), elm_object_item_signal_callback_del().
+ * Add the config ELM_THUMBSCROLL_HOLD_THRESHOLD.
Improvements:
* Elm_Transit image animation effects supports elm_image object type.
* Expand elm_transit_tween_mode ELM_TRANSIT_TWEEN_MODE_DIVISOR_INTERP, ELM_TRANSIT_TWEEN_MODE_BOUNCE, ELM_TRANSIT_TWEEN_MODE_SPRING
* Added new APIs elm_transit_tween_mode_facator_set()/get()
-Fixes:
- * Now elm_datetime_field_limit_set() can set year limits wihtout problems.
- * Fix re-order animation when it doesn't end correctly.
- * Fix popup to apply the same style to the notify sub-widget.
- * Fix Ctxpopup direction if unknown priority used.
- * Fix diskselector when bounce off and round enabled.
- * Fix bubble info field set.
- * Escape theme filename correctly.
- * Fix diskselector selection of middle item.
- * Fix multibuttonentry list corruption.
- * Fix copy&paste error in elm_flip.
- * Fix possible invalid memory access in elm_access.
- * Fix diskselector bug with more than 4 items.
- * Fix conform widget to be part of focus chain.
- * Fix genlist reorder mode item not being resized on genlist resize.
- * Fix on_focus_region() issue.
- * Fixed gengrid wrong_calc_job parameter.
- * Fix elm_transit image animation that last few frames are skipped.
- * FIx elm_transit to accept proxy object.
+Fixes :
+
* Fix glview crash even if the object is failed allocating.
* Fix the elm_flip to accept proxy object.
* Fix wrong parameter for thumbnail error in elm_icon.
* Fix the naviframe to not have crash even if user deletes the naviframe in the transition finished cb.
* Fix Don't elm_transit image animation use the image preloading to avoid image flickering.
* Fix the image to show the image right now if the image preloading is disabled.
+ * Fix a elm_transit crash issue when user delete all target objects in the effect end callback.
+ * Fix small memory leak in elm_map error path
+ * Focus highlight should not be shown on (0, 0).
Removals:
to deprecation. Thus, people using that (unstable) API will have
to adapt themselves.
+
+Elementary 1.7.5
+
+Changes since Elementary 1.7.4:
+-------------------------
+
+Fixes:
+ * Fix bug where genlist would delete items added during selection callback if a clear was queued
+ * Tooltips now correctly set NETWM tooltip window type
+ * Fix the scroll position is calculated by the size of pan object, not the size of scroller.
+
+
+Elementary 1.7.4
+
+Changes since elementary 1.7.3:
+-------------------------
+
+Fixes:
+
+ * Make sure data is not NULL in elm_interface_scrollable.
+
+
+Elementary 1.7.3
+
+Changes since elementary 1.7.2:
+-------------------------
+
+Fixes:
+
+ * Fix uninitialized data path in elm_flip.
+ * Fix uninitialized data path in elm_gesture_layer.
+ * Fix possible segv in elm_quicklaunch infrastructure.
+
+
+Elementary 1.7.2
+
+Changes since elementary 1.7.1:
+-------------------------
+
+Fixes:
+
+ * Fix promote and demote in genlist when the object isn't yet fully builded
+ * Fix the elm_flip to accept proxy object.
+ * Fix wrong parameter for thumbnail error in elm_icon.
+ * Fix update the min size hint on elm_label after a text set
+ * Fix flip widget who show the two face at same time
+
+
+Changes since elementary 1.7.0:
+-------------------------
+
+Fixes:
+
+ * Now elm_datetime_field_limit_set() can set year limits wihtout problems.
+ * Fix re-order animation when it doesn't end correctly.
+ * Fix popup to apply the same style to the notify sub-widget.
+ * Fix Ctxpopup direction if unknown priority used.
+ * Fix diskselector when bounce off and round enabled.
+ * Fix bubble info field set.
+ * Escape theme filename correctly.
+ * Fix diskselector selection of middle item.
+ * Fix multibuttonentry list corruption.
+ * Fix copy&paste error in elm_flip.
+ * Fix possible invalid memory access in elm_access.
+ * Fix diskselector bug with more than 4 items.
+ * Fix conform widget to be part of focus chain.
+ * Fix genlist reorder mode item not being resized on genlist resize.
+ * Fix on_focus_region() issue.
+ * Fixed gengrid wrong_calc_job parameter.
+ * Fix elm_transit image animation that last few frames are skipped.
+ * FIx elm_transit to accept proxy object.
+
Changes since Elementary 1.0.0:
-------------------------
value "vsync" uchar: 0;
value "thumbscroll_enable" uchar: 1;
value "thumbscroll_threshold" int: 24;
+ value "thumbscroll_hold_threshold" int: 24;
value "thumbscroll_momentum_threshold" double: 100.0;
value "thumbscroll_friction" double: 1.0;
value "thumbscroll_bounce_friction" double: 0.5;
value "vsync" uchar: 1;
value "thumbscroll_enable" uchar: 1;
value "thumbscroll_threshold" int: 24;
+ value "thumbscroll_hold_threshold" int: 100;
value "thumbscroll_momentum_threshold" double: 100.0;
value "thumbscroll_friction" double: 1.0;
value "thumbscroll_bounce_friction" double: 0.5;
value "effect_enable" uchar: 1;
value "password_show_last" uchar: 1;
value "password_show_last_timeout" double: 2.0;
- value "glayer_zoom_finger_enable" uchar: 0;
+ value "glayer_zoom_finger_enable" uchar: 1;
value "glayer_zoom_finger_factor" double: 1.0;
value "glayer_zoom_wheel_factor" double: 0.05;
value "glayer_zoom_distance_tolerance" double: 1.0;
- value "glayer_rotate_finger_enable" uchar: 0;
+ value "glayer_rotate_finger_enable" uchar: 1;
value "glayer_rotate_angular_tolerance" double: 0.034906585;
value "glayer_line_min_length" double: 1.0;
value "glayer_line_distance_tolerance" double: 3.0;
value "vsync" uchar: 0;
value "thumbscroll_enable" uchar: 0;
value "thumbscroll_threshold" int: 4;
+ value "thumbscroll_hold_threshold" int: 4;
value "thumbscroll_momentum_threshold" double: 100.0;
value "thumbscroll_friction" double: 1.0;
value "thumbscroll_bounce_friction" double: 0.5;
AC_DEFINE(HAVE_ENVIRON, 1, [extern environ exists])
])
+AC_TRY_LINK([
+#include <stdlib.h>
+], [
+clearenv();
+], [
+ AC_DEFINE(HAVE_CLEARENV, 1, [extern environ exists])
+])
+
AC_OUTPUT([
Makefile
elementary.spec
#sbs-git:slp/pkgs/e/elementary elementary 1.0.0+svn.70492slp2+build11
Name: elementary
Summary: EFL toolkit for small touchscreens
-Version: 1.7.1+svn.77535+build01r05
+Version: 1.7.1+svn.77535slp2+build73r01
Release: 1
Group: System/Libraries
License: LGPLv2.1
}
static void
+tsht_round(void *data __UNUSED__,
+ Evas_Object *obj,
+ void *event_info __UNUSED__)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 10.0))) / 10.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+tsht_change(void *data __UNUSED__,
+ Evas_Object *obj,
+ void *event_info __UNUSED__)
+{
+ double tst = elm_config_scroll_thumbscroll_hold_threshold_get();
+ double val = elm_slider_value_get(obj);
+
+ if (tst == val) return;
+ elm_config_scroll_thumbscroll_hold_threshold_set(val);
+ elm_config_all_flush();
+}
+
+static void
tsmt_round(void *data __UNUSED__,
Evas_Object *obj,
void *event_info __UNUSED__)
static void
_config_display_update(Evas_Object *win)
{
- int flush_interval, font_c, image_c, edje_file_c, edje_col_c, ts_threshould;
+ int flush_interval, font_c, image_c, edje_file_c, edje_col_c, ts_threshould, ts_hold_threshold;
double scale, s_bounce_friction, ts_momentum_threshold, ts_friction,
ts_border_friction, ts_sensitivity_friction, page_friction, bring_in_friction, zoom_friction;
const char *curr_theme, *curr_engine;
s_bounce_friction = elm_config_scroll_bounce_friction_get();
ts = elm_config_scroll_thumbscroll_enabled_get();
ts_threshould = elm_config_scroll_thumbscroll_threshold_get();
+ ts_hold_threshold = elm_config_scroll_thumbscroll_hold_threshold_get();
ts_momentum_threshold = elm_config_scroll_thumbscroll_momentum_threshold_get();
ts_friction = elm_config_scroll_thumbscroll_friction_get();
ts_border_friction = elm_config_scroll_thumbscroll_border_friction_get();
"thumbscroll_threshold_slider"),
ts_threshould);
elm_slider_value_set(evas_object_data_get(win,
+ "ts_hold_threshold_slider"),
+ ts_hold_threshold);
+ elm_slider_value_set(evas_object_data_get(win,
"ts_momentum_threshold_slider"),
ts_momentum_threshold);
elm_slider_value_set(evas_object_data_get(win,
evas_object_smart_callback_add(sl, "changed", tst_round, NULL);
evas_object_smart_callback_add(sl, "delay,changed", tst_change, NULL);
+ LABEL_FRAME_ADD("<hilight>Thumb scroll hold threshold</>");
+
+ sl = elm_slider_add(win);
+ elm_object_tooltip_text_set(sl, "This is the number of pixels the range<br/>"
+ "which can be scrolled, while the scroller<br/>"
+ "is holed");
+ evas_object_data_set(win, "thumbscroll_hold_threshold_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.0f pixels");
+ elm_slider_indicator_format_set(sl, "%1.0f");
+ elm_slider_min_max_set(sl, 4.0, 500.0);
+ elm_slider_value_set(sl, elm_config_scroll_thumbscroll_threshold_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", tsht_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", tsht_change, NULL);
+
LABEL_FRAME_ADD("<hilight>Thumb scroll momentum threshold</>");
sl = elm_slider_add(win);
argc = ((unsigned long *)(buf))[0];
envnum = ((unsigned long *)(buf))[1];
-
+
if (argc <= 0)
{
CRITICAL("no executable specified");
if (envnum > 0) envir = alloca(envnum * sizeof(char *));
off = ((unsigned long *)(buf))[2 + argc + envnum] - sizeof(unsigned long);
cwd = (char *)(buf + off);
-
+
for (i = 0; i < argc; i++)
{
off = ((unsigned long *)(buf))[2 + i] - sizeof(unsigned long);
elm_object_content_set(fr, lb);
evas_object_show(lb);
+ /* This label will not be read out */
+ elm_access_object_unregister(lb);
+
tg = elm_check_add(win);
elm_object_style_set(tg, "toggle");
elm_object_text_set(tg, "UI-Mirroring:");
ic = elm_icon_add(win);
snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
- elm_icon_file_set(ic, buf, NULL);
- elm_icon_resizable_set(ic, 0, 0);
+ elm_image_file_set(ic, buf, NULL);
+ elm_image_resizable_set(ic, 0, 0);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_HORIZONTAL, 1, 1);
bb = elm_bubble_add(win);
ic = elm_icon_add(win);
snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
- elm_icon_file_set(ic, buf, NULL);
+ elm_image_file_set(ic, buf, NULL);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
bb = elm_bubble_add(win);
ic = elm_icon_add(win);
snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
- elm_icon_file_set(ic, buf, NULL);
- elm_icon_resizable_set(ic, 0, 0);
+ elm_image_file_set(ic, buf, NULL);
+ elm_image_resizable_set(ic, 0, 0);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_HORIZONTAL, 1, 1);
bb = elm_bubble_add(win);
EVAS_SMART_SUBCLASS_NEW
(ELM_CTXPOPUP_SMART_NAME, _elm_ctxpopup, Elm_Ctxpopup_Smart_Class,
Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
+
static Eina_Bool
_elm_ctxpopup_smart_focus_next(const Evas_Object *obj,
Elm_Focus_Direction dir,
Evas_Object **next)
{
+ Eina_List *items = NULL;
+ Eina_List *elist = NULL;
+ Elm_Ctxpopup_Item *it;
+
ELM_CTXPOPUP_DATA_GET(obj, sd);
if (!sd)
elm_widget_focus_next_get(sd->box, dir, next);
}
- return EINA_TRUE;
+ EINA_LIST_FOREACH(sd->items, elist, it)
+ items = eina_list_append(items, it->base.access_obj);
+
+ return elm_widget_focus_list_next_get
+ (obj, items, eina_list_data_get, dir, next);
}
static Eina_Bool
item->func((void*)item->base.data, WIDGET(item), data);
}
+static char *
+_access_info_cb(void *data, Evas_Object *obj __UNUSED__)
+{
+ Elm_Ctxpopup_Item *it = (Elm_Ctxpopup_Item *)data;
+ const char *txt = NULL;
+ Evas_Object *icon = NULL;
+ Eina_Strbuf *buf = NULL;
+ char *str = NULL;
+
+ if (!it) return NULL;
+
+ if ((!txt) && (!icon))
+ {
+ txt = it->label;
+ icon = it->icon;
+ }
+ else if (!txt) txt = it->label;
+ else if (!icon) icon = it->icon;
+
+ if (txt && icon)
+ {
+ buf = eina_strbuf_new();
+ eina_strbuf_append(buf, E_("icon "));
+ eina_strbuf_append(buf, txt);
+ str = eina_strbuf_string_steal(buf);
+ eina_strbuf_free(buf);
+ return str;
+ }
+ else if ((!txt) && icon) return strdup(E_("icon"));
+ else if (txt && (!icon)) return strdup(txt);
+
+ return NULL;
+}
+
+static char *
+_access_state_cb(void *data, Evas_Object *obj __UNUSED__)
+{
+ Elm_Ctxpopup_Item *it = (Elm_Ctxpopup_Item *)data;
+ if (!it) return NULL;
+
+ if (it->base.disabled)
+ return strdup(E_("State: Disabled"));
+
+ return NULL;
+}
+
+static void
+_access_activate_cb(void *data __UNUSED__,
+ Evas_Object *part_obj __UNUSED__,
+ Elm_Object_Item *item)
+{
+ _item_select_cb(item, NULL, NULL, NULL);
+}
+
+static void
+_access_widget_item_register(Elm_Ctxpopup_Item *it, Eina_Bool is_access)
+{
+ Elm_Access_Info *ai;
+
+ if (!is_access) _elm_access_widget_item_unregister((Elm_Widget_Item *)it);
+ else
+ {
+ _elm_access_widget_item_register((Elm_Widget_Item *)it);
+
+ ai = _elm_access_object_get(it->base.access_obj);
+
+ _elm_access_callback_set(ai, ELM_ACCESS_INFO, _access_info_cb, it);
+ _elm_access_callback_set(ai, ELM_ACCESS_STATE, _access_state_cb, it);
+ _elm_access_text_set(ai, ELM_ACCESS_TYPE, E_("Contextual Popup"));
+ _elm_access_activate_callback_set(ai, _access_activate_cb, it);
+ }
+}
+
static void
_item_new(Elm_Ctxpopup_Item *item,
char *group_name)
_item_select_cb, item);
evas_object_size_hint_align_set(VIEW(item), EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(VIEW(item));
+
+ /* access */
+ if (_elm_config->access_mode) _access_widget_item_register(item, EINA_TRUE);
}
static void
//Limit to Max Size
evas_object_size_hint_max_get(obj, &max_size.x, &max_size.y);
+ if ((max_size.x == -1) || (max_size.y == -1))
+ edje_object_size_max_get(sd->layout, &max_size.x, &max_size.y);
if ((max_size.y > 0) && (base_size.y > max_size.y))
base_size.y = max_size.y;
//Limit to Min Size
evas_object_size_hint_min_get(obj, &min_size.x, &min_size.y);
+ if ((min_size.x == 0) || (min_size.y == 0))
+ edje_object_size_min_get(sd->layout, &min_size.x, &min_size.y);
if ((min_size.y > 0) && (base_size.y < min_size.y))
base_size.y = min_size.y;
Evas_Coord_Rectangle arrow_size;
Evas_Coord x, y;
double drag;
+ Evas_Coord_Rectangle shadow_left_top, shadow_right_bottom, arrow_padding;
ELM_CTXPOPUP_DATA_GET(obj, sd);
evas_object_geometry_get
(sd->arrow, NULL, NULL, &arrow_size.w, &arrow_size.h);
+ /* tizen only : since ctxpopup of tizen has shadow, start and end padding of arrow, it should be put together when updating arrow
+ * so there are some differences between open source and tizen */
+ edje_object_part_geometry_get(ELM_WIDGET_DATA(sd)->resize_obj, "frame_shadow_left_top_padding", NULL, NULL, &shadow_left_top.w, &shadow_left_top.h);
+ edje_object_part_geometry_get(ELM_WIDGET_DATA(sd)->resize_obj, "frame_shadow_right_bottom_padding", NULL, NULL, &shadow_right_bottom.w, &shadow_right_bottom.h);
+ edje_object_part_geometry_get(ELM_WIDGET_DATA(sd)->resize_obj, "ctxpopup_frame_left_top", NULL, NULL, &arrow_padding.w, &arrow_padding.h);
+
/* arrow is not being kept as sub-object on purpose, here. the
* design of the widget does not help with the contrary */
if (base_size.h > 0)
{
- if (y < ((arrow_size.h * 0.5) + base_size.y))
+ if (y <= ((arrow_size.h * 0.5) + base_size.y + shadow_left_top.h + arrow_padding.h))
y = 0;
- else if (y > base_size.y + base_size.h - (arrow_size.h * 0.5))
- y = base_size.h - arrow_size.h;
+ else if (y >= (base_size.y + base_size.h - ((arrow_size.h * 0.5) + shadow_right_bottom.h + arrow_padding.h)))
+ y = base_size.h - (arrow_size.h + shadow_right_bottom.h + shadow_left_top.h + (arrow_padding.h * 2));
else
- y = y - base_size.y - (arrow_size.h * 0.5);
- drag = (double)(y) / (double)(base_size.h - arrow_size.h);
+ y = y - base_size.y - ((arrow_size.h * 0.5) + shadow_left_top.h + arrow_padding.h);
+ drag = (double)(y) / (double)(base_size.h - (arrow_size.h + shadow_right_bottom.h + shadow_left_top.h + (arrow_padding.h * 2)));
edje_object_part_drag_value_set
(ELM_WIDGET_DATA(sd)->resize_obj,
(elm_widget_mirrored_get(obj) ? "elm.swallow.arrow_right" :
if (base_size.h > 0)
{
- if (y < ((arrow_size.h * 0.5) + base_size.y))
+ if (y <= ((arrow_size.h * 0.5) + base_size.y + shadow_left_top.h + arrow_padding.h))
y = 0;
- else if (y > (base_size.y + base_size.h - (arrow_size.h * 0.5)))
- y = base_size.h - arrow_size.h;
+ else if (y >= (base_size.y + base_size.h - ((arrow_size.h * 0.5) + shadow_right_bottom.h + arrow_padding.h)))
+ y = base_size.h - (arrow_size.h + shadow_right_bottom.h + shadow_left_top.h + (arrow_padding.h * 2));
else
- y = y - base_size.y - (arrow_size.h * 0.5);
- drag = (double)(y) / (double)(base_size.h - arrow_size.h);
+ y = y - base_size.y - ((arrow_size.h * 0.5) + shadow_left_top.h + arrow_padding.h);
+ drag = (double)(y) / (double)(base_size.h - (arrow_size.h + shadow_right_bottom.h + shadow_left_top.h + (arrow_padding.h * 2)));
edje_object_part_drag_value_set
(ELM_WIDGET_DATA(sd)->resize_obj,
(elm_widget_mirrored_get(obj) ? "elm.swallow.arrow_left" :
if (base_size.w > 0)
{
- if (x < ((arrow_size.w * 0.5) + base_size.x))
+ if (x <= ((arrow_size.w * 0.5) + base_size.x + shadow_left_top.w + arrow_padding.w))
x = 0;
- else if (x > (base_size.x + base_size.w - (arrow_size.w * 0.5)))
- x = base_size.w - arrow_size.w;
+ else if (x >= (base_size.x + base_size.w - ((arrow_size.w * 0.5) + shadow_right_bottom.w + arrow_padding.w)))
+ x = base_size.w - (arrow_size.w + shadow_right_bottom.w + shadow_left_top.w + (arrow_padding.w * 2));
else
- x = x - base_size.x - (arrow_size.w * 0.5);
- drag = (double)(x) / (double)(base_size.w - arrow_size.w);
+ x = x - base_size.x - ((arrow_size.w * 0.5) + shadow_left_top.w + arrow_padding.w);
+ drag = (double)(x) / (double)(base_size.w - (arrow_size.w + shadow_right_bottom.w + shadow_left_top.w + (arrow_padding.w * 2)));
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.arrow_up", drag,
- 1);
+ (ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.arrow_up",
+ drag, 1);
}
break;
if (base_size.w > 0)
{
- if (x < ((arrow_size.w * 0.5) + base_size.x))
+ if (x <= ((arrow_size.w * 0.5) + base_size.x + shadow_left_top.w + arrow_padding.w))
x = 0;
- else if (x > (base_size.x + base_size.w - (arrow_size.w * 0.5)))
- x = base_size.w - arrow_size.w;
- else x = x - base_size.x - (arrow_size.w * 0.5);
- drag = (double)(x) / (double)(base_size.w - arrow_size.w);
+ else if (x >= (base_size.x + base_size.w - ((arrow_size.w * 0.5) + shadow_right_bottom.w + arrow_padding.w)))
+ x = base_size.w - (arrow_size.w + shadow_right_bottom.w + shadow_left_top.w + (arrow_padding.w * 2));
+ else
+ x = x - base_size.x - ((arrow_size.w * 0.5) + shadow_left_top.w + arrow_padding.w);
+ drag = (double)(x) / (double)(base_size.w - (arrow_size.w + shadow_right_bottom.w + shadow_left_top.w + (arrow_padding.w * 2)));
edje_object_part_drag_value_set
(ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.arrow_down",
drag, 0);
switch (dir)
{
case ELM_CTXPOPUP_DIRECTION_UP:
- elm_layout_signal_emit(obj, "elm,state,show,up", "elm");
+ edje_object_signal_emit(sd->layout, "elm,state,show,up", "elm");
break;
case ELM_CTXPOPUP_DIRECTION_LEFT:
- elm_layout_signal_emit(obj,
- (elm_widget_mirrored_get(obj) ? "elm,state,show,right" :
+ edje_object_signal_emit(sd->layout, (elm_widget_mirrored_get(obj) ? "elm,state,show,right" :
"elm,state,show,left"), "elm");
break;
case ELM_CTXPOPUP_DIRECTION_RIGHT:
- elm_layout_signal_emit(obj,
- (elm_widget_mirrored_get(obj) ? "elm,state,show,left" :
+ edje_object_signal_emit(sd->layout, (elm_widget_mirrored_get(obj) ? "elm,state,show,left" :
"elm,state,show,right"), "elm");
break;
case ELM_CTXPOPUP_DIRECTION_DOWN:
- elm_layout_signal_emit(obj, "elm,state,show,down", "elm");
+ edje_object_signal_emit(sd->layout, "elm,state,show,down", "elm");
break;
default:
}
edje_object_signal_emit(sd->bg, "elm,state,show", "elm");
- elm_layout_signal_emit(obj, "elm,state,show", "elm");
+// elm_layout_signal_emit(obj, "elm,state,show", "elm");
}
static void
switch (dir)
{
case ELM_CTXPOPUP_DIRECTION_UP:
- elm_layout_signal_emit(obj, "elm,state,hide,up", "elm");
+ edje_object_signal_emit(sd->layout, "elm,state,hide,up", "elm");
break;
case ELM_CTXPOPUP_DIRECTION_LEFT:
- elm_layout_signal_emit(obj,
- (elm_widget_mirrored_get(obj) ? "elm,state,hide,right" :
+ edje_object_signal_emit(sd->layout, (elm_widget_mirrored_get(obj) ? "elm,state,hide,right" :
"elm,state,hide,left"), "elm");
break;
case ELM_CTXPOPUP_DIRECTION_RIGHT:
- elm_layout_signal_emit(obj,
- (elm_widget_mirrored_get(obj) ? "elm,state,hide,left" :
+ edje_object_signal_emit(sd->layout, (elm_widget_mirrored_get(obj) ? "elm,state,hide,left" :
"elm,state,hide,right"), "elm");
break;
case ELM_CTXPOPUP_DIRECTION_DOWN:
- elm_layout_signal_emit(obj, "elm,state,hide,down", "elm");
+ edje_object_signal_emit(sd->layout, "elm,state,hide,down", "elm");
break;
default:
}
if (!sd->arrow) return; /* simple way to flag "under deletion" */
-
+
if ((!sd->content) && (sd->scr))
{
evas_object_size_hint_min_set(sd->box, box_size.x, box_size.y);
evas_object_smart_calculate(sd->scr);
}
- evas_object_move(ELM_WIDGET_DATA(sd)->resize_obj, rect.x, rect.y);
+ evas_object_size_hint_min_set(ELM_WIDGET_DATA(sd)->resize_obj, rect.w, rect.h);
evas_object_resize(ELM_WIDGET_DATA(sd)->resize_obj, rect.w, rect.h);
+ evas_object_move(sd->layout, rect.x, rect.y);
+ evas_object_resize(sd->layout, rect.w, rect.h);
+
_show_signals_emit(obj, sd->dir);
}
(obj, sd->bg, "ctxpopup", "bg", elm_widget_style_get(obj));
elm_widget_theme_object_set
(obj, sd->arrow, "ctxpopup", "arrow", elm_widget_style_get(obj));
+ elm_widget_theme_object_set
+ (obj, sd->layout, "ctxpopup", "layout", elm_widget_style_get(obj));
//Items
EINA_LIST_FOREACH(sd->items, elist, item)
evas_object_show(sd->bg);
evas_object_show(sd->arrow);
+ evas_object_show(sd->layout);
edje_object_signal_emit(sd->bg, "elm,state,show", "elm");
elm_layout_signal_emit(obj, "elm,state,show", "elm");
evas_object_hide(sd->bg);
evas_object_hide(sd->arrow);
+ evas_object_hide(sd->layout);
_scroller_size_reset(sd);
void *event_info __UNUSED__)
{
ELM_CTXPOPUP_DATA_GET(obj, sd);
-
- evas_object_layer_set(sd->bg, evas_object_layer_get(obj));
+ evas_object_stack_below(sd->bg, obj);
+ evas_object_stack_below(sd->layout, obj);
}
static void
_elm_ctxpopup_smart_add(Evas_Object *obj)
{
EVAS_SMART_DATA_ALLOC(obj, Elm_Ctxpopup_Smart_Data);
+ ELM_CTXPOPUP_DATA_GET(obj, sd);
ELM_WIDGET_CLASS(_elm_ctxpopup_parent_sc)->base.add(obj);
ELM_CONTAINER_CLASS(_elm_ctxpopup_parent_sc)->content_set
(obj, "elm.swallow.content", priv->box);
+ priv->layout = edje_object_add(evas_object_evas_get(obj));
+ elm_widget_theme_object_set(obj, priv->layout, "ctxpopup", "layout", "default");
+
+ edje_object_signal_callback_add
+ (priv->layout, "elm,action,hide,finished", "", _hide_finished_cb, obj);
+ edje_object_part_swallow(priv->layout, "swallow", ELM_WIDGET_DATA(sd)->resize_obj);
+ evas_object_size_hint_weight_set
+ (priv->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _on_show, NULL);
evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _on_hide, NULL);
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _on_move, NULL);
evas_object_del(sd->bg);
sd->bg = NULL;
+ evas_object_del(sd->layout);
+ sd->layout = NULL;
+
ELM_WIDGET_CLASS(_elm_ctxpopup_parent_sc)->base.del(obj);
}
}
static void
+_elm_ctxpopup_smart_access(Evas_Object *obj, Eina_Bool is_access)
+{
+ Eina_List *elist = NULL;
+ Elm_Ctxpopup_Item *it;
+
+ ELM_CTXPOPUP_CHECK(obj);
+ ELM_CTXPOPUP_DATA_GET(obj, sd);
+
+ EINA_LIST_FOREACH(sd->items, elist, it)
+ _access_widget_item_register(it, is_access);
+}
+
+static void
_elm_ctxpopup_smart_set_user(Elm_Ctxpopup_Smart_Class *sc)
{
ELM_WIDGET_CLASS(sc)->base.add = _elm_ctxpopup_smart_add;
ELM_CONTAINER_CLASS(sc)->content_unset = _elm_ctxpopup_smart_content_unset;
ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_ctxpopup_smart_sizing_eval;
+
+ ELM_WIDGET_CLASS(sc)->access = _elm_ctxpopup_smart_access;
}
EAPI const Elm_Ctxpopup_Smart_Class *
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
+ /* access: parent could be any object such as elm_list which does
+ not know elc_ctxpopup as its child object in the focus_next(); */
+ ELM_WIDGET_DATA_GET(obj, sd);
+ sd->highlight_root = EINA_TRUE;
+
return obj;
}
else
edje_object_signal_emit(VIEW(item), "elm,state,separator", "elm");
- _item_disable_hook(item);
+ _item_disable_hook((Elm_Object_Item *)item);
}
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
#include "elm_priv.h"
#include "elm_widget_multibuttonentry.h"
+//#define _VI_EFFECT 0
+
+#ifdef _VI_EFFECT
+#define TRANSIT_DURATION 0.167
+#define ANIMATE_FRAME 10
+#endif
+
EAPI const char ELM_MULTIBUTTONENTRY_SMART_NAME[] = "elm_multibuttonentry";
//widget signals
static const char SIG_EXPANDED[] = "expanded";
static const char SIG_CONTRACTED[] = "contracted";
static const char SIG_EXPAND_STATE_CHANGED[] = "expand,state,changed";
+static const char SIG_LONGPRESSED[] = "longpressed";
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_ITEM_SELECTED, ""},
{SIG_EXPANDED, ""},
{SIG_CONTRACTED, ""},
{SIG_EXPAND_STATE_CHANGED, ""},
+ {SIG_LONGPRESSED, ""},
{NULL, NULL}
};
elm_layout_smart_class_get, _smart_callbacks);
static Eina_Bool
+_elm_multibuttonentry_smart_focus_next(const Evas_Object *obj,
+ Elm_Focus_Direction dir,
+ Evas_Object **next)
+{
+ Eina_List *items = NULL;
+ Eina_List *elist = NULL;
+ Elm_Multibuttonentry_Item *it;
+
+ ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+
+ if (!sd)
+ return EINA_FALSE;
+
+ if (!elm_widget_focus_next_get(sd->box, dir, next))
+ {
+ elm_widget_focused_object_clear(sd->box);
+ elm_widget_focus_next_get(sd->box, dir, next);
+ }
+
+ EINA_LIST_FOREACH(sd->items, elist, it)
+ items = eina_list_append(items, it->base.access_obj);
+
+ return elm_widget_focus_list_next_get
+ (obj, items, eina_list_data_get, dir, next);
+}
+
+static char *
+_access_label_info_cb(void *data, Evas_Object *obj __UNUSED__)
+{
+ Evas_Object *mbe = (Evas_Object *)data;
+ const char *txt = NULL;
+
+ ELM_MULTIBUTTONENTRY_DATA_GET(mbe, sd);
+
+ if (!mbe) return NULL;
+
+ if (!txt)
+ {
+ txt = elm_object_part_text_get(sd->label, "mbe.label");
+ return strdup(txt);
+ }
+ else return strdup(txt);
+
+ return NULL;
+}
+
+static char *
+_access_shrink_info_cb(void *data, Evas_Object *obj __UNUSED__)
+{
+ Evas_Object *mbe = (Evas_Object *)data;
+ const char *txt = NULL;
+ Eina_Strbuf *buf = NULL;
+ char *str = NULL;
+
+ ELM_MULTIBUTTONENTRY_DATA_GET(mbe, sd);
+
+ if (!mbe) return NULL;
+
+ if (!txt) txt = elm_object_text_get(sd->end);
+ if (txt)
+ {
+ buf = eina_strbuf_new();
+ eina_strbuf_append(buf, E_("And "));
+ eina_strbuf_append(buf, txt);
+ eina_strbuf_append(buf, E_(" more"));
+ str = eina_strbuf_string_steal(buf);
+ eina_strbuf_free(buf);
+ return str;
+ }
+ return NULL;
+}
+
+static Eina_Bool
_guide_packed(Evas_Object *obj)
{
Eina_List *children;
{
sd->guide = elm_layout_add(obj);
elm_layout_theme_set
- (sd->guide, "multibuttonentry", "guide", elm_widget_style_get(obj));
+ (sd->guide, "multibuttonentry", "guidetext", elm_widget_style_get(obj));
+ evas_object_size_hint_weight_set
+ (sd->guide, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set
+ (sd->guide, EVAS_HINT_FILL, EVAS_HINT_FILL);
}
elm_object_text_set(sd->guide, text);
elm_layout_theme_set
(sd->label, "multibuttonentry", "label", elm_widget_style_get(obj));
}
- elm_object_text_set(sd->label, text);
+ elm_object_part_text_set(sd->label, "mbe.label", text);
if (strlen(text) && !_label_packed(obj))
{
elm_box_unpack(sd->box, sd->label);
evas_object_hide(sd->label);
}
+
+ // ACCESS
+ if (_elm_config->access_mode)
+ {
+ _elm_access_object_register(obj, ELM_WIDGET_DATA(sd)->resize_obj);
+ _elm_access_callback_set(_elm_access_object_get(obj), ELM_ACCESS_INFO, _access_label_info_cb, obj);
+ }
+}
+
+#ifdef _VI_EFFECT
+static void
+_box_layout_pre_calculate(Evas_Object *obj,
+ Elm_Multibuttonentry_Item *except_it,
+ Evas_Coord *minh_wo_entry,
+ Evas_Coord *minh)
+{
+ Evas_Coord mnw, mnh, x, w, hpad = 0, vpad = 0;
+ Evas_Coord linew = 0, lineh = 0;
+ int line_num;
+ Eina_List *l;
+ Elm_Multibuttonentry_Item *it;
+
+ ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+
+ evas_object_geometry_get(sd->box, &x, NULL, &w, NULL);
+ elm_box_padding_get(sd->box, &hpad, &vpad);
+
+ line_num = 1;
+
+ if (sd->label && _label_packed(obj))
+ {
+ evas_object_size_hint_min_get(sd->label, &mnw, &mnh);
+
+ linew = mnw;
+ linew += hpad;
+ lineh = mnh;
+ }
+
+ EINA_LIST_FOREACH(sd->items, l, it)
+ {
+ if (it == except_it) continue;
+
+ evas_object_size_hint_min_get(VIEW(it), &mnw, &mnh);
+
+ linew += mnw;
+ if (lineh < mnh) lineh = mnh;
+
+ if (linew > w)
+ {
+ linew = mnw;
+ line_num++;
+ }
+
+
+ linew += hpad;
+ }
+
+ if (minh_wo_entry)
+ *minh_wo_entry = lineh * line_num + (line_num - 1) * vpad;
+
+ if (sd->editable)
+ {
+ // get entry size after text is reset
+ elm_object_text_set(sd->entry, "");
+ elm_layout_sizing_eval(sd->entry);
+ evas_object_size_hint_min_get(sd->entry, &mnw, &mnh);
+
+ linew += mnw;
+ if (lineh < mnh) lineh = mnh;
+
+ if (linew > w) line_num++;
+ }
+
+ if (minh)
+ *minh = lineh * line_num + (line_num - 1) * vpad;
+}
+
+static void
+_on_item_expanding_transit_del(void *data,
+ Elm_Transit *transit __UNUSED__)
+{
+ Elm_Multibuttonentry_Item *it = data;
+
+ evas_object_data_set(VIEW(it), "transit", NULL);
+ evas_object_smart_callback_call(WIDGET(it), SIG_ITEM_ADDED, it);
+}
+
+static Eina_Bool
+_rect_expanding_animate(void *data)
+{
+ Evas_Coord w, h, eh;
+ Evas_Object *rect;
+ Elm_Multibuttonentry_Item *it = data;
+
+ ELM_MULTIBUTTONENTRY_DATA_GET(WIDGET(it), sd);
+
+ rect = (Evas_Object *)evas_object_data_get(VIEW(it), "effect_rect");
+ if (!rect) return ECORE_CALLBACK_CANCEL;
+
+ evas_object_geometry_get(sd->entry, NULL, NULL, NULL, &eh);
+ evas_object_size_hint_min_get(rect, &w, &h);
+
+ if (h >= eh)
+ {
+ Eina_List *children;
+ Elm_Multibuttonentry_Item *last_it;
+
+ evas_object_del(rect);
+ evas_object_data_set(VIEW(it), "effect_rect", NULL);
+
+ // if last item is unpacked, add it
+ children = elm_box_children_get(sd->box);
+ last_it = eina_list_data_get(eina_list_last(sd->items));
+ if (VIEW(last_it) != eina_list_data_get(eina_list_last(children)))
+ {
+ elm_box_pack_end(sd->box, VIEW(last_it));
+ evas_object_show(VIEW(last_it));
+ }
+ eina_list_free(children);
+
+ if (sd->editable)
+ {
+ elm_box_pack_end(sd->box, sd->entry);
+ evas_object_show(sd->entry);
+ if (elm_object_focus_get(WIDGET(it)))
+ elm_object_focus_set(sd->entry, EINA_TRUE);
+ }
+
+ return ECORE_CALLBACK_CANCEL;
+ }
+ else
+ evas_object_size_hint_min_set(rect, w, h + eh / ANIMATE_FRAME);
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+static void
+_item_adding_effect_add(Evas_Object *obj,
+ Elm_Multibuttonentry_Item *it)
+{
+ Elm_Transit *trans;
+ Evas_Coord minh_wo_entry, minh;
+ Eina_Bool floating = EINA_FALSE;;
+
+ ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+
+ _box_layout_pre_calculate(obj, NULL, &minh_wo_entry, &minh);
+
+ // if box will be expanded, add resizing effect
+ if (sd->boxh < minh)
+ {
+ Evas_Coord bx, by, bw, bh;
+ Evas_Object *rect;
+ Ecore_Animator *anim;
+
+ evas_object_geometry_get(sd->box, &bx, &by, &bw, &bh);
+
+ // if box will be expanded with item and entry
+ if (minh_wo_entry == minh)
+ {
+ Elm_Multibuttonentry_Item *last_it;
+
+ last_it = eina_list_data_get(eina_list_last(sd->items));
+ if (it == last_it)
+ {
+ Evas_Coord iw, ih, vpad;
+
+ evas_object_size_hint_min_get(VIEW(it), &iw, &ih);
+ elm_box_padding_get(sd->box, NULL, &vpad);
+
+ evas_object_move(VIEW(it), bx, by + bh + vpad);
+ evas_object_resize(VIEW(it), iw, ih);
+ evas_object_show(VIEW(it));
+
+ floating = EINA_TRUE;
+ }
+ else
+ {
+ elm_box_unpack(sd->box, VIEW(last_it));
+ evas_object_hide(VIEW(last_it));
+ }
+ }
+
+ if (sd->editable)
+ {
+ if (elm_object_focus_get(sd->entry))
+ elm_object_focus_set(sd->entry, EINA_FALSE);
+ elm_box_unpack(sd->box, sd->entry);
+ evas_object_hide(sd->entry);
+ elm_entry_input_panel_show(sd->entry);
+ }
+
+ rect = evas_object_rectangle_add(evas_object_evas_get(obj));
+ evas_object_color_set(rect, 0, 0, 0, 0);
+ evas_object_size_hint_min_set(rect, bw, 0);
+ evas_object_data_set(VIEW(it), "effect_rect", rect);
+ elm_box_pack_end(sd->box, rect);
+ evas_object_show(rect);
+
+ anim = ecore_animator_add(_rect_expanding_animate, it);
+ evas_object_data_set(rect, "animator", anim);
+ }
+
+ if (!floating)
+ {
+ Eina_List *cur;
+ cur = eina_list_data_find_list(sd->items, it);
+ if (cur == sd->items)
+ {
+ if (sd->label && _label_packed(obj))
+ elm_box_pack_after(sd->box, VIEW(it), sd->label);
+ else
+ elm_box_pack_start(sd->box, VIEW(it));
+ }
+ else
+ {
+ Elm_Multibuttonentry_Item *prev_it;
+ prev_it = eina_list_data_get(eina_list_prev(cur));
+ elm_box_pack_after(sd->box, VIEW(it), VIEW(prev_it));
+ }
+ evas_object_show(VIEW(it));
+ }
+
+ trans = elm_transit_add();
+ elm_transit_object_add(trans, VIEW(it));
+ elm_transit_effect_zoom_add(trans, 0.9, 1.0);
+ elm_transit_effect_color_add(trans, 0, 0, 0, 0, 255, 255, 255, 255);
+ elm_transit_del_cb_set(trans, _on_item_expanding_transit_del, it);
+ elm_transit_duration_set(trans, TRANSIT_DURATION);
+ evas_object_data_set(VIEW(it), "transit", trans);
+ elm_transit_go(trans);
+}
+
+static void
+_on_item_contracting_transit_del(void *data,
+ Elm_Transit *transit __UNUSED__)
+{
+ Evas_Object *rect;
+ Elm_Multibuttonentry_Item *it = data;
+
+ ELM_MULTIBUTTONENTRY_DATA_GET(WIDGET(it), sd);
+
+ evas_object_data_set(VIEW(it), "transit", NULL);
+
+ rect = (Evas_Object *)evas_object_data_get(VIEW(it), "effect_rect");
+ if (rect)
+ {
+ evas_object_hide(VIEW(it));
+ return;
+ }
+
+ // delete item and set focus to entry
+ if (sd->editable && elm_object_focus_get(WIDGET(it)))
+ elm_object_focus_set(sd->entry, EINA_TRUE);
+
+ elm_object_item_del((Elm_Object_Item *)it);
+}
+
+static Eina_Bool
+_rect_contracting_animate(void *data)
+{
+ Evas_Coord w, h, eh;
+ Evas_Object *rect;
+ Elm_Multibuttonentry_Item *it = data;
+
+ ELM_MULTIBUTTONENTRY_DATA_GET(WIDGET(it), sd);
+
+ rect = (Evas_Object *)evas_object_data_get(VIEW(it), "effect_rect");
+ if (!rect) return ECORE_CALLBACK_CANCEL;
+
+ evas_object_geometry_get(sd->entry, NULL, NULL, NULL, &eh);
+ evas_object_size_hint_min_get(rect, &w, &h);
+
+ if (h <= 0)
+ {
+ Elm_Transit *trans;
+ Elm_Multibuttonentry_Item *last_it;
+
+ evas_object_del(rect);
+ evas_object_data_set(VIEW(it), "effect_rect", NULL);
+
+ // if last item is unpacked, add it
+ last_it = eina_list_data_get(eina_list_last(sd->items));
+ if (it != last_it)
+ {
+ if (!evas_object_visible_get(VIEW(last_it)))
+ {
+ elm_box_pack_end(sd->box, VIEW(last_it));
+ evas_object_show(VIEW(last_it));
+ }
+ }
+
+ if (sd->editable)
+ {
+ elm_box_pack_end(sd->box, sd->entry);
+ evas_object_show(sd->entry);
+ if (elm_object_focus_get(WIDGET(it)))
+ elm_object_focus_set(sd->entry, EINA_TRUE);
+ }
+
+ // delete the button
+ trans = (Elm_Transit *)evas_object_data_get(VIEW(it), "transit");
+ if (!trans)
+ _on_item_contracting_transit_del(it, NULL);
+
+ return ECORE_CALLBACK_CANCEL;
+ }
+ else
+ evas_object_size_hint_min_set(rect, w, h - eh / ANIMATE_FRAME);
+
+ return ECORE_CALLBACK_RENEW;
}
static void
+_item_deleting_effect_add(Evas_Object *obj,
+ Elm_Multibuttonentry_Item *it)
+{
+ Elm_Transit *trans;
+ Evas_Coord minh;
+
+ ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+
+ _box_layout_pre_calculate(obj, it, NULL, &minh);
+
+ // if box will be contracted, add resizing effect
+ if (sd->boxh > minh)
+ {
+ Evas_Coord bx, bw, ix, eh;
+ Ecore_Animator *anim;
+ Evas_Object *rect;
+ Elm_Multibuttonentry_Item *last_it;
+
+ last_it = eina_list_data_get(eina_list_last(sd->items));
+ evas_object_geometry_get(sd->box, &bx, NULL, &bw, NULL);
+ evas_object_geometry_get(VIEW(last_it), &ix, NULL, NULL, NULL);
+
+ // if box will be contracted with item and entry
+ if (ix == bx)
+ {
+ if (it == last_it)
+ elm_box_unpack(sd->box, VIEW(it));
+ else
+ {
+ elm_box_unpack(sd->box, VIEW(last_it));
+ evas_object_hide(VIEW(last_it));
+ }
+ }
+
+ if (sd->editable)
+ {
+ if (elm_object_focus_get(sd->entry))
+ elm_object_focus_set(sd->entry, EINA_FALSE);
+ elm_box_unpack(sd->box, sd->entry);
+ evas_object_hide(sd->entry);
+ elm_entry_input_panel_show(sd->entry);
+ }
+
+ rect = evas_object_rectangle_add(evas_object_evas_get(obj));
+ evas_object_color_set(rect, 0, 0, 0, 0);
+ evas_object_geometry_get(sd->entry, NULL, NULL, NULL, &eh);
+ evas_object_size_hint_min_set(rect, bw, eh);
+ evas_object_data_set(VIEW(it), "effect_rect", rect);
+ elm_box_pack_end(sd->box, rect);
+ evas_object_show(rect);
+
+ anim = ecore_animator_add(_rect_contracting_animate, it);
+ evas_object_data_set(rect, "animator", anim);
+ }
+
+ trans = elm_transit_add();
+ elm_transit_object_add(trans, VIEW(it));
+ elm_transit_effect_zoom_add(trans, 1.0, 0.9);
+ elm_transit_effect_color_add(trans, 255, 255, 255, 255, 0, 0, 0, 0);
+ elm_transit_del_cb_set(trans, _on_item_contracting_transit_del, it);
+ elm_transit_duration_set(trans, TRANSIT_DURATION);
+ evas_object_data_set(VIEW(it), "transit", trans);
+ elm_transit_go(trans);
+
+}
+#endif
+
+static void
_layout_expand(Evas_Object *obj)
{
int count, items_count, i;
children = elm_box_children_get(sd->box);
count = eina_list_count(children);
- if (sd->number)
+ if (sd->end)
{
- evas_object_del(sd->number);
- sd->number = NULL;
+ evas_object_del(sd->end);
+ sd->end = NULL;
count--;
}
if (sd->label && _label_packed(obj)) count--;
Eina_List *l, *children;
Evas_Object *child;
Elm_Multibuttonentry_Item *it;
+#ifdef _VI_EFFECT
+ Elm_Transit *trans;
+ Evas_Object *rect;
+ Ecore_Animator *anim;
+#endif
ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
linew += hpad;
}
- if(!count) return;
+ if (!count) return;
items_count = eina_list_count(sd->items);
if (count < items_count)
{
+ const char *str = NULL;
char buf[16];
- if (!sd->number)
+ str = elm_layout_data_get(obj, "closed_button_type");
+ if (!sd->end)
+ {
+ sd->end = elm_layout_add(obj);
+ if (str && !strcmp(str, "image"))
+ elm_layout_theme_set(sd->end, "multibuttonentry",
+ "closedbutton", elm_widget_style_get(obj));
+ else
+ elm_layout_theme_set(sd->end, "multibuttonentry",
+ "number", elm_widget_style_get(obj));
+ }
+ if (!str || strcmp(str, "image"))
{
- sd->number = elm_layout_add(obj);
- elm_layout_theme_set
- (sd->number, "multibuttonentry", "number",
- elm_widget_style_get(obj));
+ snprintf(buf, sizeof(buf), "+%d", items_count - count);
+ elm_object_text_set(sd->end, buf);
+
+ // ACCESS
+ if (_elm_config->access_mode && sd->end)
+ {
+ _elm_access_object_register(obj, ELM_WIDGET_DATA(sd)->resize_obj);
+ _elm_access_callback_set(_elm_access_object_get(obj), ELM_ACCESS_INFO, _access_shrink_info_cb, obj);
+ }
}
- snprintf(buf, sizeof(buf), "+%d", items_count - count);
- elm_object_text_set(sd->number, buf);
- evas_object_smart_calculate(sd->number);
- evas_object_size_hint_min_get(sd->number, &mnw, NULL);
+ evas_object_smart_calculate(sd->end);
+ evas_object_size_hint_min_get(sd->end, &mnw, NULL);
linew += mnw;
if (linew > w)
{
count--;
- snprintf(buf, sizeof(buf), "+%d", items_count - count);
- elm_object_text_set(sd->number, buf);
+ if (!str || strcmp(str, "image"))
+ {
+ snprintf(buf, sizeof(buf), "+%d", items_count - count);
+ elm_object_text_set(sd->end, buf);
+
+ // ACCESS
+ if (_elm_config->access_mode && sd->end)
+ {
+ _elm_access_object_register(obj, ELM_WIDGET_DATA(sd)->resize_obj);
+ _elm_access_callback_set(_elm_access_object_get(obj), ELM_ACCESS_INFO, _access_shrink_info_cb, obj);
+ }
+ }
}
if (!force)
{
+#ifdef _VI_EFFECT
+ // reset last inserted item's effect_rect
+ it = eina_list_nth(sd->items, count - 1);
+ rect = (Evas_Object *)evas_object_data_get(VIEW(it), "effect_rect");
+ if (rect)
+ {
+ anim = (Ecore_Animator*)evas_object_data_get(rect, "animator");
+ if (anim) ecore_animator_del(anim);
+
+ evas_object_del(rect);
+ evas_object_data_set(VIEW(it), "effect_rect", NULL);
+ }
+#endif
+
for (i = count; i < items_count; i++)
{
it = eina_list_nth(sd->items, i);
+#ifdef _VI_EFFECT
+ // reset all effects
+ trans = (Elm_Transit *)evas_object_data_get(VIEW(it), "transit");
+ if (trans) elm_transit_del(trans);
+
+ rect = (Evas_Object *)evas_object_data_get(VIEW(it), "effect_rect");
+ if (rect)
+ {
+ anim = (Ecore_Animator*)evas_object_data_get(rect, "animator");
+ if (anim) ecore_animator_del(anim);
+
+ evas_object_del(rect);
+ evas_object_data_set(VIEW(it), "effect_rect", NULL);
+ }
+#endif
elm_box_unpack(sd->box, VIEW(it));
evas_object_hide(VIEW(it));
}
{
// if it is called from item_append_xxx, item_del functions,
// all items are unpacked and packed again
+#ifdef _VI_EFFECT
+ // reset last inserted item's effect_rect
+ it = eina_list_nth(sd->items, count - 1);
+ rect = (Evas_Object *)evas_object_data_get(VIEW(it), "effect_rect");
+ if (rect)
+ {
+ anim = (Ecore_Animator*)evas_object_data_get(rect, "animator");
+ if (anim) ecore_animator_del(anim);
+
+ evas_object_del(rect);
+ evas_object_data_set(VIEW(it), "effect_rect", NULL);
+ }
+
+ for (i = count; i < items_count; i++)
+ {
+ it = eina_list_nth(sd->items, i);
+ // reset all effects
+ trans = (Elm_Transit *)evas_object_data_get(VIEW(it), "transit");
+ if (trans) elm_transit_del(trans);
+
+ rect = (Evas_Object *)evas_object_data_get(VIEW(it), "effect_rect");
+ if (rect)
+ {
+ anim = (Ecore_Animator*)evas_object_data_get(rect, "animator");
+ if (anim) ecore_animator_del(anim);
+
+ evas_object_del(rect);
+ evas_object_data_set(VIEW(it), "effect_rect", NULL);
+ }
+ }
+#endif
+
children = elm_box_children_get(sd->box);
EINA_LIST_FREE(children, child)
{
}
}
- elm_box_pack_end(sd->box, sd->number);
- evas_object_show(sd->number);
+ elm_box_pack_end(sd->box, sd->end);
+ evas_object_show(sd->end);
sd->expanded_state = EINA_FALSE;
}
{
if (!force)
{
+#ifdef _VI_EFFECT
+ // reset last inserted item's effect_rect
+ it = eina_list_nth(sd->items, count - 1);
+ rect = (Evas_Object *)evas_object_data_get(VIEW(it), "effect_rect");
+ if (rect)
+ {
+ anim = (Ecore_Animator*)evas_object_data_get(rect, "animator");
+ if (anim) ecore_animator_del(anim);
+
+ evas_object_del(rect);
+ evas_object_data_set(VIEW(it), "effect_rect", NULL);
+
+ if (sd->editable)
+ {
+ elm_box_pack_end(sd->box, sd->entry);
+ evas_object_show(sd->entry);
+ if (elm_object_focus_get(WIDGET(it)))
+ elm_object_focus_set(sd->entry, EINA_TRUE);
+ }
+ }
+#endif
if (sd->editable)
{
evas_object_size_hint_min_get(sd->entry, &mnw, NULL);
}
else
{
- if (sd->number)
+ if (sd->end)
{
- evas_object_del(sd->number);
- sd->number = NULL;
+ evas_object_del(sd->end);
+ sd->end = NULL;
}
// if it is called from item_append_xxx, item_del functions,
// all items are unpacked and packed again
+#ifdef _VI_EFFECT
+ // reset last inserted item's effect_rect
+ it = eina_list_nth(sd->items, count - 1);
+ rect = (Evas_Object *)evas_object_data_get(VIEW(it), "effect_rect");
+ if (rect)
+ {
+ anim = (Ecore_Animator*)evas_object_data_get(rect, "animator");
+ if (anim) ecore_animator_del(anim);
+
+ evas_object_del(rect);
+ evas_object_data_set(VIEW(it), "effect_rect", NULL);
+ }
+#endif
+
children = elm_box_children_get(sd->box);
EINA_LIST_FREE(children, child)
{
evas_object_size_hint_min_get(sd->entry, &mnw, NULL);
linew += mnw;
if (linew > w)
- sd->expanded_state = EINA_FALSE;
+ sd->expanded_state = EINA_FALSE;
else
{
elm_box_pack_end(sd->box, sd->entry);
}
if (!sd->expanded_state && !force)
- evas_object_smart_callback_call(obj, SIG_EXPAND_STATE_CHANGED, NULL);
+ evas_object_smart_callback_call(obj, SIG_EXPAND_STATE_CHANGED, NULL);
}
static Eina_Bool
_box_min_size_calculate(Evas_Object *box,
- Evas_Object_Box_Data *priv,
- int *line_height)
+ Evas_Object_Box_Data *priv,
+ int *line_height)
{
Evas_Coord mnw, mnh, w, minw, minh = 0, linew = 0, lineh = 0;
int line_num;
{
evas_object_size_hint_min_get(opt->obj, &mnw, &mnh);
+#ifdef _VI_EFFECT
+ if (mnw == w &&
+ !strcmp(evas_object_type_get(opt->obj), "rectangle"))
+ break;
+#endif
+
linew += mnw;
if (lineh < mnh) lineh = mnh;
}
if (l != eina_list_last(priv->children))
- linew += priv->pad.h;
+ linew += priv->pad.h;
}
minh = lineh * line_num + (line_num - 1) * priv->pad.v;
+#ifdef _VI_EFFECT
+ // if last item is effect_rect
+ if (opt && opt->obj && mnw == w &&
+ !strcmp(evas_object_type_get(opt->obj), "rectangle"))
+ {
+ minh += priv->pad.v;
+ minh += mnh;
+ }
+#endif
+
evas_object_size_hint_min_set(box, minw, minh);
*line_height = lineh;
Eina_List *l;
Evas_Object *obj;
Evas_Object_Box_Option *opt;
- ELM_MULTIBUTTONENTRY_DATA_GET(data, sd);
if (!_box_min_size_calculate(o, priv, &lineh)) return;
if (fh) oh = hh;
linew += ww;
- if (linew > w)
+ if (linew > w && l != priv->children)
{
xx = x;
yy += hh;
((!rtl) ? (xx) : (x + (w - (xx - x) - ww)))
+ (Evas_Coord)(((double)(ww - ow)) * ax),
yy + (Evas_Coord)(((double)(hh - oh)) * ay));
- evas_object_resize(obj, ow, oh);
+ evas_object_resize(obj, ow, oh);
xx += ww;
xx += priv->pad.h;
}
-
- // when expanded_set is called before box layout is calculated,
- // it should be called again
- if (!elm_object_focus_get(data) && sd->expanded != sd->expanded_state)
- {
- if (sd->expanded)
- _layout_expand(data);
- else
- _layout_shrink(data, EINA_FALSE);
- }
}
static void
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
if (sd->boxh < h)
- evas_object_smart_callback_call(data, SIG_EXPANDED, NULL);
+ evas_object_smart_callback_call(data, SIG_EXPANDED, NULL);
else if (sd->boxh > h)
- evas_object_smart_callback_call(data, SIG_CONTRACTED, NULL);
+ evas_object_smart_callback_call(data, SIG_CONTRACTED, NULL);
// on rotation, items should be packed again in the shrinked layout
if (sd->boxw && sd->boxw != w)
{
if (!elm_object_focus_get(data) && !sd->expanded)
- _layout_shrink(data, EINA_TRUE);
+ _layout_shrink(data, EINA_TRUE);
}
sd->boxh = h;
// handles input panel because it can be hidden by user
if (sd->editable)
- elm_entry_input_panel_show(sd->entry);
+ elm_entry_input_panel_show(sd->entry);
evas_object_smart_callback_call(WIDGET(it), SIG_ITEM_CLICKED, it);
}
if (evas_object_focus_get(obj))
{
if (elm_object_focus_get(sd->entry))
- elm_object_focus_set(sd->entry, EINA_FALSE);
+ elm_object_focus_set(sd->entry, EINA_FALSE);
sd->selected_item = (Elm_Object_Item *)it;
- elm_layout_signal_emit(VIEW(it), "elm,state,bg,focus", "elm");
+ elm_layout_signal_emit(VIEW(it), "focused", "");
if (sd->editable)
- elm_entry_input_panel_show(sd->entry);
+ elm_entry_input_panel_show(sd->entry);
}
else
{
sd->selected_item = NULL;
- elm_layout_signal_emit(VIEW(it), "elm,state,bg,unfocus", "elm");
+ elm_layout_signal_emit(VIEW(it), "default", "");
if (sd->editable)
- elm_entry_input_panel_hide(sd->entry);
+ elm_entry_input_panel_hide(sd->entry);
+ }
+}
+
+static Eina_Bool
+_long_press_cb(void *data)
+{
+ Elm_Multibuttonentry_Item *it = data;
+
+ ELM_MULTIBUTTONENTRY_DATA_GET(WIDGET(it), sd);
+
+ sd->longpress_timer = NULL;
+ sd->long_pressed = EINA_TRUE;
+
+ evas_object_smart_callback_call(WIDGET(it), SIG_LONGPRESSED, it);
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static void
+_mouse_down_cb(Elm_Multibuttonentry_Item *it,
+ Evas *evas __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ Evas_Event_Mouse_Down *ev)
+{
+ ELM_MULTIBUTTONENTRY_DATA_GET(WIDGET(it), sd);
+
+ if (ev->button != 1) return;
+
+ sd->long_pressed = EINA_FALSE;
+
+ if (sd->longpress_timer) ecore_timer_del(sd->longpress_timer);
+ sd->longpress_timer = ecore_timer_add
+ (_elm_config->longpress_timeout, _long_press_cb, it);
+}
+
+static void
+_mouse_up_cb(Elm_Multibuttonentry_Item *it,
+ Evas *evas __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ Evas_Event_Mouse_Down *ev)
+{
+ ELM_MULTIBUTTONENTRY_DATA_GET(WIDGET(it), sd);
+
+ if (sd->longpress_timer)
+ {
+ ecore_timer_del(sd->longpress_timer);
+ sd->longpress_timer = NULL;
}
}
const char *part,
const char *text)
{
- if (part && strcmp(part, "elm.text")) return;
+ if (part && strcmp(part, "elm.btn.text")) return;
if (!text) return;
- elm_object_text_set(VIEW(it), text);
+ elm_object_part_text_set(VIEW(it), "elm.btn.text", text);
}
static const char *
_item_text_get_hook(const Elm_Object_Item *it,
const char *part)
{
- if (part && strcmp(part, "elm.text")) return NULL;
+ if (part && strcmp(part, "elm.btn.text")) return NULL;
- return elm_object_text_get(VIEW(it));
+ return elm_object_part_text_get(VIEW(it), "elm.btn.text");
}
static Eina_Bool
sd->items = eina_list_remove(sd->items, it);
if (!elm_object_focus_get(WIDGET(it)) && !sd->expanded)
- _layout_shrink(WIDGET(it), EINA_TRUE);
+ _layout_shrink(WIDGET(it), EINA_TRUE);
+
+#ifdef _VI_EFFECT
+ Elm_Transit *trans;
+ Evas_Object *rect;
+
+ trans = (Elm_Transit *)evas_object_data_get(VIEW(it), "transit");
+ if (trans)
+ {
+ elm_transit_del_cb_set(trans, NULL, NULL);
+ elm_transit_del(trans);
+ }
+
+ rect = (Evas_Object *)evas_object_data_get(VIEW(it), "effect_rect");
+ if (rect)
+ {
+ Ecore_Animator *anim;
+ anim = (Ecore_Animator*)evas_object_data_get(rect, "animator");
+ if (anim) ecore_animator_del(anim);
+
+ evas_object_del(rect);
+ evas_object_data_set(VIEW(it), "effect_rect", NULL);
+
+ if (sd->editable)
+ {
+ elm_box_pack_end(sd->box, sd->entry);
+ evas_object_show(sd->entry);
+ if (elm_object_focus_get(WIDGET(it)))
+ elm_object_focus_set(sd->entry, EINA_TRUE);
+ }
+ }
+#endif
if (!sd->items && !elm_object_focus_get(WIDGET(it)) &&
sd->guide && !_guide_packed(WIDGET(it)))
return EINA_TRUE;
}
+static char *
+_access_info_cb(void *data, Evas_Object *obj __UNUSED__)
+{
+ Elm_Multibuttonentry_Item *it = (Elm_Multibuttonentry_Item *)data;
+ const char *txt = NULL;
+ Eina_Strbuf *buf = NULL;
+ char *str = NULL;
+
+ if (!it) return NULL;
+
+ if (!txt)txt = elm_object_item_text_get(it);
+ if (txt)
+ {
+ buf = eina_strbuf_new();
+ eina_strbuf_append(buf, E_(" double tap to edit"));
+ eina_strbuf_prepend(buf, txt);
+ str = eina_strbuf_string_steal(buf);
+ eina_strbuf_free(buf);
+ return str;
+ }
+
+ return NULL;
+}
+
+static char *
+_access_state_cb(void *data, Evas_Object *obj __UNUSED__)
+{
+ Elm_Multibuttonentry_Item *it = (Elm_Multibuttonentry_Item *)data;
+ if (!it) return NULL;
+
+ if (it->base.disabled)
+ return strdup(E_("State: Disabled"));
+
+ return NULL;
+}
+
+static void
+_access_activate_cb(void *data __UNUSED__,
+ Evas_Object *part_obj __UNUSED__,
+ Elm_Object_Item *item)
+{
+ _on_item_selected(item, NULL, NULL, NULL);
+}
+
+static void
+_access_widget_item_register(Elm_Multibuttonentry_Item *it, Eina_Bool is_access)
+{
+ Elm_Access_Info *ai;
+
+ if (!is_access) _elm_access_widget_item_unregister((Elm_Widget_Item *)it);
+ else
+ {
+ _elm_access_widget_item_register((Elm_Widget_Item *)it);
+
+ ai = _elm_access_object_get(it->base.access_obj);
+
+ _elm_access_callback_set(ai, ELM_ACCESS_INFO, _access_info_cb, it);
+ _elm_access_callback_set(ai, ELM_ACCESS_STATE, _access_state_cb, it);
+ _elm_access_activate_callback_set(ai, _access_activate_cb, it);
+ }
+}
+
static Elm_Multibuttonentry_Item *
_item_new(Evas_Object *obj,
const char *text,
Elm_Multibuttonentry_Item_Filter *ft;
Eina_List *l;
const char *str;
- Evas_Coord w, maxw = 0;
+ Evas_Coord minw, minh, maxw = 0;
ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
EINA_LIST_FOREACH(sd->filters, l, ft)
{
if (!ft->func(obj, text, data, ft->data))
- return NULL;
+ return NULL;
}
it = elm_widget_item_new(obj, Elm_Multibuttonentry_Item);
VIEW(it) = elm_layout_add(obj);
elm_layout_theme_set
- (VIEW(it), "multibuttonentry", "button", elm_widget_style_get(obj));
+ (VIEW(it), "multibuttonentry", "btn", elm_widget_style_get(obj));
elm_layout_signal_callback_add
(VIEW(it), "elm,action,clicked", "", _on_item_clicked, it);
elm_layout_signal_callback_add
evas_object_event_callback_add
(elm_layout_edje_get(VIEW(it)),
EVAS_CALLBACK_FOCUS_OUT, _on_item_focus, it);
- elm_object_text_set(VIEW(it), text);
+ evas_object_event_callback_add
+ (elm_layout_edje_get(VIEW(it)),
+ EVAS_CALLBACK_MOUSE_DOWN, (Evas_Object_Event_Cb)_mouse_down_cb, it);
+ evas_object_event_callback_add
+ (elm_layout_edje_get(VIEW(it)),
+ EVAS_CALLBACK_MOUSE_UP, (Evas_Object_Event_Cb)_mouse_up_cb, it);
+ elm_object_part_text_set(VIEW(it), "elm.btn.text", text);
it->func = func;
it->base.data = data;
// adjust item size if item is longer than maximum size
evas_object_smart_calculate(VIEW(it));
- evas_object_size_hint_min_get(VIEW(it), &w, NULL);
- str = elm_layout_data_get(VIEW(it), "max_size");
+ evas_object_size_hint_min_get(VIEW(it), &minw, &minh);
+ str = elm_layout_data_get(VIEW(it), "button_max_size");
if (str) maxw = atoi(str);
maxw = maxw * elm_widget_scale_get(obj) * elm_config_scale_get();
- if (w > maxw)
+ if (minw > maxw)
{
- elm_layout_signal_emit(VIEW(it), "elm,state,text,ellipsis", "elm");
+ elm_layout_signal_emit(VIEW(it), "elm,state,text,ellipsis", "");
elm_layout_sizing_eval(VIEW(it));
}
sd->item_be_selected = EINA_TRUE;
+ // ACCESS
+ if (_elm_config->access_mode) _access_widget_item_register(it, EINA_TRUE);
+
return it;
}
if (!it) return;
sd->items = eina_list_append(sd->items, it);
+#ifdef _VI_EFFECT
+ _item_adding_effect_add(data, it);
+#else
elm_box_pack_before(sd->box, VIEW(it), obj);
evas_object_show(VIEW(it));
evas_object_smart_callback_call(data, SIG_ITEM_ADDED, it);
+#endif
elm_object_text_set(obj, "");
}
- free(str);
+ free(str);
}
// handles semicolon, comma (before inserting them to the entry)
ELM_MULTIBUTTONENTRY_DATA_GET(data, sd);
if (!*text || !strlen(*text)) return;
- if (strcmp(*text, ";") && strcmp(*text, ",")) return;
+
+ // cancels item_be_selected when text inserting is started
+ if (strcmp(*text, ";") && strcmp(*text, ","))
+ {
+ sd->item_be_selected = EINA_FALSE;
+ return;
+ }
str = elm_entry_markup_to_utf8(elm_object_text_get(entry));
if (strlen(str))
if (!it) return;
sd->items = eina_list_append(sd->items, it);
+#ifdef _VI_EFFECT
+ _item_adding_effect_add(data, it);
+#else
elm_box_pack_before(sd->box, VIEW(it), entry);
evas_object_show(VIEW(it));
evas_object_smart_callback_call(data, SIG_ITEM_ADDED, it);
+#endif
elm_object_text_set(entry, "");
}
ELM_MULTIBUTTONENTRY_DATA_GET(data, sd);
- // cancels item_be_selected when text inserting is started
+ // cancels item_be_selected when text inserting is started
if (strcmp(ev->keyname, "KP_Enter") && strcmp(ev->keyname, "Return") &&
strcmp(ev->keyname, "BackSpace") && strcmp(ev->keyname, "Delete") &&
strcmp(ev->keyname, "semicolon") && strcmp(ev->keyname, "comma"))
if (!it) return;
sd->items = eina_list_append(sd->items, it);
+#ifdef _VI_EFFECT
+ _item_adding_effect_add(data, it);
+#else
elm_box_pack_before(sd->box, VIEW(it), obj);
evas_object_show(VIEW(it));
evas_object_smart_callback_call(data, SIG_ITEM_ADDED, it);
+#endif
elm_object_text_set(obj, "");
}
}
// handles delete key
-// it can be pressed when button is selected, so it is handled on layout_key_up)
+// it can be pressed when button is selected, so it is handled on layout_key_up
static void
_on_layout_key_up(void *data __UNUSED__,
- Evas *e __UNUSED__,
- Evas_Object *obj,
- void *event_info)
+ Evas *e __UNUSED__,
+ Evas_Object *obj,
+ void *event_info)
{
char *str;
Evas_Event_Key_Up *ev = (Evas_Event_Key_Up *)event_info;
ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
if (strcmp(ev->keyname, "BackSpace") && strcmp(ev->keyname, "Delete"))
- return;
+ return;
str = elm_entry_markup_to_utf8(elm_object_text_get(sd->entry));
if (strlen(str))
if (!sd->selected_item)
{
- if (sd->item_be_selected)
+ if (sd->item_be_selected) // 2nd delete
{
Elm_Multibuttonentry_Item *it;
it = eina_list_data_get(eina_list_last(sd->items));
evas_object_focus_set(elm_layout_edje_get(VIEW(it)), EINA_TRUE);
}
- else
- sd->item_be_selected = EINA_TRUE;
+ else // 1st delete
+ sd->item_be_selected = EINA_TRUE;
}
- else
+ else // 3rd delete
{
+#ifdef _VI_EFFECT
+ Elm_Transit *trans;
+ Evas_Object *rect;
+
+ trans = (Elm_Transit *)evas_object_data_get(VIEW(sd->selected_item), "transit");
+ rect = (Evas_Object *)evas_object_data_get(VIEW(sd->selected_item), "effect_rect");
+
+ if (!trans && !rect)
+ _item_deleting_effect_add
+ (obj, (Elm_Multibuttonentry_Item *)sd->selected_item);
+#else
elm_object_item_del(sd->selected_item);
if (sd->editable)
- elm_object_focus_set(sd->entry, EINA_TRUE);
+ elm_object_focus_set(sd->entry, EINA_TRUE);
+#endif
}
}
}
// when object gets focused, it should be expanded layout
else if (!sd->expanded)
- _layout_expand(obj);
+ _layout_expand(obj);
if (sd->editable)
{
- elm_layout_signal_emit(obj, "elm,state,event,allow", "elm");
+ elm_layout_signal_emit(obj, "elm,state,event,allow", "");
elm_object_focus_set(sd->entry, EINA_TRUE);
}
elm_box_pack_end(sd->box, sd->guide);
evas_object_show(sd->guide);
}
- // if shrinked mode was set, it goes back to shrinked layout
+ // if shrinked mode was set, it goes back to shrinked layout
else if (!sd->expanded)
- _layout_shrink(obj, EINA_FALSE);
+ _layout_shrink(obj, EINA_FALSE);
if (sd->editable)
- elm_layout_signal_emit(obj, "elm,state,event,block", "elm");
-
+ elm_layout_signal_emit(obj, "elm,state,event,block", "");
if (sd->selected_item)
- evas_object_focus_set
- (elm_layout_edje_get(VIEW(sd->selected_item)), EINA_FALSE);
+ evas_object_focus_set
+ (elm_layout_edje_get(VIEW(sd->selected_item)), EINA_FALSE);
evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL);
}
ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
if (!part || !strcmp(part, "label"))
- return elm_object_text_get(sd->label);
+ return elm_object_part_text_get(sd->label, "mbe.label");
else if (!strcmp(part, "guide"))
- return elm_object_text_get(sd->guide);
+ return elm_object_text_get(sd->guide);
else return _elm_multibuttonentry_parent_sc->text_get(obj, part);
}
+static void
+_elm_multibuttonentry_smart_sizing_eval(Evas_Object *obj)
+{
+ Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
+
+ ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+
+ elm_coords_finger_size_adjust(1, &minw, 1, &minh);
+ edje_object_size_min_restricted_calc
+ (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, minw, minh);
+ elm_coords_finger_size_adjust(1, &minw, 1, &minh);
+ evas_object_size_hint_min_set(obj, minw, minh);
+ evas_object_size_hint_max_set(obj, maxw, maxh);
+}
+
static Eina_Bool
_elm_multibuttonentry_smart_theme(Evas_Object *obj)
{
elm_layout_theme_set
(sd->label, "multibuttonentry", "label", elm_widget_style_get(obj));
elm_layout_theme_set
- (sd->guide, "multibuttonentry", "guide", elm_widget_style_get(obj));
+ (sd->guide, "multibuttonentry", "guidetext", elm_widget_style_get(obj));
elm_layout_theme_set
- (sd->number, "multibuttonentry", "number", elm_widget_style_get(obj));
+ (sd->end, "multibuttonentry", "number", elm_widget_style_get(obj));
EINA_LIST_FOREACH(sd->items, l, it)
elm_layout_theme_set
- (VIEW(it), "multibuttonentry", "button", elm_widget_style_get(obj));
+ (VIEW(it), "multibuttonentry", "btn", elm_widget_style_get(obj));
elm_layout_sizing_eval(obj);
ELM_WIDGET_CLASS(_elm_multibuttonentry_parent_sc)->base.add(obj);
elm_layout_theme_set
- (obj, "multibuttonentry", "base", elm_widget_style_get(obj));
+ (obj, "multibuttonentry", "base", elm_widget_style_get(obj));
elm_layout_signal_callback_add
(obj, "elm,action,clicked", "", _on_layout_clicked, NULL);
evas_object_event_callback_add
- (obj, EVAS_CALLBACK_KEY_UP, _on_layout_key_up, NULL);
+ (obj, EVAS_CALLBACK_KEY_UP, _on_layout_key_up, NULL);
priv->box = elm_box_add(obj);
str = elm_layout_data_get(obj, "horizontal_pad");
(priv->box,
hpad * elm_widget_scale_get(obj) * elm_config_scale_get(),
vpad * elm_widget_scale_get(obj) * elm_config_scale_get());
- elm_box_layout_set(priv->box, _box_layout, obj, NULL);
- elm_layout_content_set(obj, "elm.swallow.box", priv->box);
+ elm_box_layout_set(priv->box, _box_layout, NULL, NULL);
+ elm_layout_content_set(obj, "box.swallow", priv->box);
evas_object_event_callback_add
(priv->box, EVAS_CALLBACK_RESIZE, _on_box_resize, obj);
// ACCESS
_elm_access_object_register(obj, ELM_WIDGET_DATA(priv)->resize_obj);
_elm_access_text_set
- (_elm_access_object_get(obj), ELM_ACCESS_TYPE, E_("multi button entry"));
+ (_elm_access_object_get(obj), ELM_ACCESS_TYPE, E_("multi button entry"));
_elm_access_callback_set
- (_elm_access_object_get(obj), ELM_ACCESS_INFO, _access_info_cb, NULL);
+ (_elm_access_object_get(obj), ELM_ACCESS_INFO, _access_info_cb, NULL);
#endif
}
ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+#ifdef _VI_EFFECT
+ EINA_LIST_FREE(sd->items, it)
+ {
+ Elm_Transit *trans;
+ Evas_Object *rect;
+
+ trans = (Elm_Transit *)evas_object_data_get(VIEW(it), "transit");
+ if (trans)
+ {
+ elm_transit_del_cb_set(trans, NULL, NULL);
+ elm_transit_del(trans);
+ }
+
+ rect = (Evas_Object *)evas_object_data_get(VIEW(it), "effect_rect");
+ if (rect)
+ {
+ Ecore_Animator *anim;
+ anim = (Ecore_Animator*)evas_object_data_get(rect, "animator");
+ if (anim) ecore_animator_del(anim);
+
+ evas_object_del(rect);
+ evas_object_data_set(VIEW(it), "effect_rect", NULL);
+ }
+ elm_widget_item_free(it);
+ }
+#else
EINA_LIST_FREE(sd->items, it)
elm_widget_item_free(it);
+#endif
EINA_LIST_FREE(sd->filters, ft)
free(ft);
- if (sd->number) evas_object_del(sd->number);
+ if (sd->end) evas_object_del(sd->end);
if (sd->guide) evas_object_del(sd->guide);
if (sd->label) evas_object_del(sd->label);
if (sd->entry) evas_object_del(sd->entry);
if (sd->box) evas_object_del(sd->box);
+ if (sd->longpress_timer) ecore_timer_del(sd->longpress_timer);
ELM_WIDGET_CLASS(_elm_multibuttonentry_parent_sc)->base.del(obj);
}
static void
+_elm_multibuttonentry_smart_access(Evas_Object *obj, Eina_Bool is_access)
+{
+ Eina_List *elist = NULL;
+ Elm_Multibuttonentry_Item *it;
+
+ ELM_MULTIBUTTONENTRY_CHECK(obj);
+ ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+
+ EINA_LIST_FOREACH(sd->items, elist, it)
+ _access_widget_item_register(it, is_access);
+}
+
+static void
_elm_multibuttonentry_smart_set_user(Elm_Multibuttonentry_Smart_Class *sc)
{
ELM_WIDGET_CLASS(sc)->base.add = _elm_multibuttonentry_smart_add;
ELM_LAYOUT_CLASS(sc)->text_set = _elm_multibuttonentry_smart_text_set;
ELM_LAYOUT_CLASS(sc)->text_get = _elm_multibuttonentry_smart_text_get;
+ ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_multibuttonentry_smart_sizing_eval;
+
// ACCESS
-// if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
-// ELM_WIDGET_CLASS(sc)->focus_next = _elm_multibuttonentry_smart_focus_next;
+ if (_elm_config->access_mode)
+ ELM_WIDGET_CLASS(sc)->focus_next = _elm_multibuttonentry_smart_focus_next;
-// ELM_WIDGET_CLASS(sc)->access = _elm_multibuttonentry_smart_access;
+ ELM_WIDGET_CLASS(sc)->access = _elm_multibuttonentry_smart_access;
}
EAPI const Elm_Multibuttonentry_Smart_Class *
if (!obj) return NULL;
if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
+ ERR("could not add %p as sub object of %p", obj, parent);
return obj;
}
if (elm_object_focus_get(obj)) return;
if (sd->expanded)
- _layout_expand(obj);
+ _layout_expand(obj);
else
- _layout_shrink(obj, EINA_FALSE);
+ _layout_shrink(obj, EINA_FALSE);
}
EAPI Eina_Bool
}
if (!elm_object_focus_get(obj))
- elm_layout_signal_emit(obj, "elm,state,event,block", "elm");
+ elm_layout_signal_emit(obj, "elm,state,event,block", "");
}
else
{
}
if (!elm_object_focus_get(obj))
- elm_layout_signal_emit(obj, "elm,state,event,allow", "elm");
+ elm_layout_signal_emit(obj, "elm,state,event,allow", "");
}
}
sd->items = eina_list_prepend(sd->items, it);
- if (!elm_object_focus_get(obj) && !sd->expanded)
- _layout_shrink(obj, EINA_TRUE);
+ if (!elm_object_focus_get(obj) && !sd->expanded && sd->boxw)
+ {
+#ifdef _VI_EFFECT
+ _item_adding_effect_add(obj, it);
+#endif
+ _layout_shrink(obj, EINA_TRUE);
+ }
else
{
+#ifdef _VI_EFFECT
+ if (sd->boxh && sd->boxw)
+ _item_adding_effect_add(obj, it);
+ else
+ {
+ if (sd->label && _label_packed(obj))
+ elm_box_pack_after(sd->box, VIEW(it), sd->label);
+ else
+ elm_box_pack_start(sd->box, VIEW(it));
+ evas_object_show(VIEW(it));
+ }
+#else
if (sd->label && _label_packed(obj))
- elm_box_pack_after(sd->box, VIEW(it), sd->label);
+ elm_box_pack_after(sd->box, VIEW(it), sd->label);
else
- elm_box_pack_start(sd->box, VIEW(it));
+ elm_box_pack_start(sd->box, VIEW(it));
evas_object_show(VIEW(it));
+#endif
}
+#ifdef _VI_EFFECT
+ if (!sd->boxh || !sd->boxw)
+ evas_object_smart_callback_call(obj, SIG_ITEM_ADDED, it);
+#else
evas_object_smart_callback_call(obj, SIG_ITEM_ADDED, it);
+#endif
return (Elm_Object_Item *)it;
}
sd->items = eina_list_append(sd->items, it);
- if (!elm_object_focus_get(obj) && !sd->expanded)
- _layout_shrink(obj, EINA_TRUE);
+ if (!elm_object_focus_get(obj) && !sd->expanded && sd->boxw)
+ {
+#ifdef _VI_EFFECT
+ _item_adding_effect_add(obj, it);
+#endif
+ _layout_shrink(obj, EINA_TRUE);
+ }
else
{
+#ifdef _VI_EFFECT
+ if (sd->boxh && sd->boxw)
+ _item_adding_effect_add(obj, it);
+ else
+ {
+ if (sd->editable)
+ elm_box_pack_before(sd->box, VIEW(it), sd->entry);
+ else
+ elm_box_pack_end(sd->box, VIEW(it));
+ evas_object_show(VIEW(it));
+ }
+#else
if (sd->editable)
- elm_box_pack_before(sd->box, VIEW(it), sd->entry);
+ elm_box_pack_before(sd->box, VIEW(it), sd->entry);
else
- elm_box_pack_end(sd->box, VIEW(it));
+ elm_box_pack_end(sd->box, VIEW(it));
evas_object_show(VIEW(it));
+#endif
}
+#ifdef _VI_EFFECT
+ if (!sd->boxh || !sd->boxw)
+ evas_object_smart_callback_call(obj, SIG_ITEM_ADDED, it);
+#else
evas_object_smart_callback_call(obj, SIG_ITEM_ADDED, it);
+#endif
return (Elm_Object_Item *)it;
}
sd->items = eina_list_prepend_relative(sd->items, it, before);
- if (!elm_object_focus_get(obj) && !sd->expanded)
- _layout_shrink(obj, EINA_TRUE);
+ if (!elm_object_focus_get(obj) && !sd->expanded && sd->boxw)
+ {
+#ifdef _VI_EFFECT
+ _item_adding_effect_add(obj, it);
+#endif
+ _layout_shrink(obj, EINA_TRUE);
+ }
else
{
+#ifdef _VI_EFFECT
+ if (sd->boxh && sd->boxw)
+ _item_adding_effect_add(obj, it);
+ else
+ {
+ elm_box_pack_before(sd->box, VIEW(it), VIEW(before));
+ evas_object_show(VIEW(it));
+ }
+#else
elm_box_pack_before(sd->box, VIEW(it), VIEW(before));
evas_object_show(VIEW(it));
+#endif
}
+#ifdef _VI_EFFECT
+ if (!sd->boxh || !sd->boxw)
+ evas_object_smart_callback_call(obj, SIG_ITEM_ADDED, it);
+#else
evas_object_smart_callback_call(obj, SIG_ITEM_ADDED, it);
+#endif
return (Elm_Object_Item *)it;
}
sd->items = eina_list_append_relative(sd->items, it, after);
- if (!elm_object_focus_get(obj) && !sd->expanded)
- _layout_shrink(obj, EINA_TRUE);
+ if (!elm_object_focus_get(obj) && !sd->expanded && sd->boxw)
+ {
+#ifdef _VI_EFFECT
+ _item_adding_effect_add(obj, it);
+#endif
+ _layout_shrink(obj, EINA_TRUE);
+ }
else
{
+#ifdef _VI_EFFECT
+ if (sd->boxw && sd->boxh)
+ _item_adding_effect_add(obj, it);
+ else
+ {
+ elm_box_pack_after(sd->box, VIEW(it), VIEW(after));
+ evas_object_show(VIEW(it));
+ }
+#else
elm_box_pack_after(sd->box, VIEW(it), VIEW(after));
evas_object_show(VIEW(it));
+#endif
}
+#ifdef _VI_EFFECT
+ if (!sd->boxh || !sd->boxw)
+ evas_object_smart_callback_call(obj, SIG_ITEM_ADDED, it);
+#else
evas_object_smart_callback_call(obj, SIG_ITEM_ADDED, it);
+#endif
return (Elm_Object_Item *)it;
}
return sd->items;
}
+EAPI Evas_Object *
+elm_multibuttonentry_item_object_get(const Elm_Object_Item *it)
+{
+ ELM_MULTIBUTTONENTRY_ITEM_CHECK_OR_RETURN(it);
+
+ return VIEW(it);
+}
+
EAPI Elm_Object_Item *
elm_multibuttonentry_first_item_get(const Evas_Object *obj)
{
evas_object_focus_set(elm_layout_edje_get(VIEW(it)), EINA_FALSE);
if (sd->editable)
- elm_object_focus_set(sd->entry, EINA_TRUE);
+ elm_object_focus_set(sd->entry, EINA_TRUE);
}
}
if (!elm_object_focus_get(WIDGET(it))) return EINA_FALSE;
if (it == sd->selected_item)
- return EINA_TRUE;
+ return EINA_TRUE;
return EINA_FALSE;
}
ELM_MULTIBUTTONENTRY_CHECK(obj);
ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+#ifdef _VI_EFFECT
+ EINA_LIST_FREE(sd->items, it)
+ {
+ Elm_Transit *trans;
+ Evas_Object *rect;
+
+ trans = (Elm_Transit *)evas_object_data_get(VIEW(it), "transit");
+ if (trans)
+ {
+ elm_transit_del_cb_set(trans, NULL, NULL);
+ elm_transit_del(trans);
+ }
+
+ rect = (Evas_Object *)evas_object_data_get(VIEW(it), "effect_rect");
+ if (rect)
+ {
+ Ecore_Animator *anim;
+
+ anim = (Ecore_Animator*)evas_object_data_get(rect, "animator");
+ if (anim) ecore_animator_del(anim);
+
+ evas_object_del(rect);
+ evas_object_data_set(VIEW(it), "effect_rect", NULL);
+
+ if (sd->editable)
+ {
+ elm_box_pack_end(sd->box, sd->entry);
+ evas_object_show(sd->entry);
+ if (elm_object_focus_get(WIDGET(it)))
+ elm_object_focus_set(sd->entry, EINA_TRUE);
+ }
+ }
+ elm_widget_item_free(it);
+ }
+#else
EINA_LIST_FREE(sd->items, it)
elm_widget_item_free(it);
+#endif
sd->items = NULL;
sd->item_be_selected = EINA_FALSE;
sd->expanded_state = EINA_TRUE;
- if (sd->number)
+ if (sd->end)
{
- evas_object_del(sd->number);
- sd->number = NULL;
+ evas_object_del(sd->end);
+ sd->end = NULL;
}
if (!sd->items && !elm_object_focus_get(obj) &&
* - @c "contracted" - when multi-button entry is contracted.
* - @c "expand,state,changed" - when shrink mode state of
* multi-button entry is changed.
+ * - @c "longpressed" - when multi-button entry is pressed for a long time.
*
* Default text parts of the multi-button entry widget that you can use are:
* @li "default" - A label of the multi-button entry
EAPI const Eina_List *elm_multibuttonentry_items_get(const Evas_Object *obj);
/**
+ * Gets the base object of the item.
+ *
+ * @param it The multibuttonentry item
+ * @return The base object associated with @p item
+ *
+ * Base object is the @c Evas_Object that represents that item.
+ *
+ * @ingroup List
+ */
+EAPI Evas_Object *elm_multibuttonentry_item_object_get(const Elm_Object_Item *it);
+
+/**
* Get the first item in the multibuttonentry
*
* @param obj The multibuttonentry object
static const char PREV_BTN_PART[] = "elm.swallow.prev_btn";
static const char NEXT_BTN_PART[] = "elm.swallow.next_btn";
static const char ICON_PART[] = "elm.swallow.icon";
+static const char TITLE_PART[] = "elm.text.title";
+static const char SUBTITLE_PART[] = "elm.text.subtitle";
+static const char TITLE_ACCESS_PART[] = "access.title";
static const char SIG_TRANSITION_FINISHED[] = "transition,finished";
static const char SIG_TITLE_CLICKED[] = "title,clicked";
(ELM_NAVIFRAME_SMART_NAME, _elm_naviframe, Elm_Naviframe_Smart_Class,
Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
+static const char SIG_CLICKED[] = "clicked";
+
static void
_item_content_del_cb(void *data,
Evas *e __UNUSED__,
Elm_Naviframe_Item *it = data;
it->content = NULL;
- edje_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
}
static void
Elm_Naviframe_Item *it = data;
it->title_prev_btn = NULL;
- edje_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
}
static void
Elm_Naviframe_Item *it = data;
it->title_next_btn = NULL;
- edje_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
}
static void
Elm_Naviframe_Item *it = data;
it->title_icon = NULL;
- edje_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
}
static void
Elm_Naviframe_Content_Item_Pair *pair = data;
Elm_Naviframe_Item *it = pair->it;
snprintf(buf, sizeof(buf), "elm,state,%s,hide", pair->part);
- edje_object_signal_emit(VIEW(it), buf, "elm");
+ elm_object_signal_emit(VIEW(it), buf, "elm");
it->content_list = eina_inlist_remove(it->content_list,
EINA_INLIST_GET(pair));
eina_stringshare_del(pair->part);
eina_stringshare_del(it->title_label);
eina_stringshare_del(it->subtitle_label);
- if (it->title_prev_btn) evas_object_del(it->title_prev_btn);
- if (it->title_next_btn) evas_object_del(it->title_next_btn);
- if (it->title_icon) evas_object_del(it->title_icon);
-
EINA_INLIST_FOREACH_SAFE(it->content_list, l, content_pair)
{
if (content_pair->content)
{
/* so that elm does not delete the contents with the item's
* view after the del_pre_hook */
- edje_object_part_unswallow(VIEW(it), it->content);
+ elm_object_part_content_unset(VIEW(it), CONTENT_PART);
evas_object_event_callback_del
(it->content, EVAS_CALLBACK_DEL, _item_content_del_cb);
}
- else
- evas_object_del(it->content);
}
}
char buf[1024];
//content
if (it->content)
- edje_object_signal_emit(VIEW(it), "elm,state,content,show", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,content,show", "elm");
else
- edje_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
//prev button
if (it->title_prev_btn)
- edje_object_signal_emit(VIEW(it), "elm,state,prev_btn,show", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,show", "elm");
else
- edje_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
//next button
if (it->title_next_btn)
- edje_object_signal_emit(VIEW(it), "elm,state,next_btn,show", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,next_btn,show", "elm");
else
- edje_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
if (it->title_icon)
- edje_object_signal_emit(VIEW(it), "elm,state,icon,show", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,icon,show", "elm");
else
- edje_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
EINA_INLIST_FOREACH(it->content_list, content_pair)
{
snprintf(buf, sizeof(buf), "elm,state,%s,show", content_pair->part);
else
snprintf(buf, sizeof(buf), "elm,state,%s,hide", content_pair->part);
- edje_object_signal_emit(VIEW(it), buf, "elm");
+ elm_object_signal_emit(VIEW(it), buf, "elm");
}
}
char buf[1024];
if ((it->title_label) && (it->title_label[0]))
- edje_object_signal_emit(VIEW(it), "elm,state,title_label,show", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,title_label,show", "elm");
else
- edje_object_signal_emit(VIEW(it), "elm,state,title_label,hide", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,title_label,hide", "elm");
if ((it->subtitle_label) && (it->subtitle_label[0]))
- edje_object_signal_emit(VIEW(it), "elm,state,subtitle,show", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,subtitle,show", "elm");
else
- edje_object_signal_emit(VIEW(it), "elm,state,subtitle,hide", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,subtitle,hide", "elm");
EINA_INLIST_FOREACH(it->text_list, text_pair)
{
- if (edje_object_part_text_get(VIEW(it), text_pair->part))
+ if (elm_object_part_text_get(VIEW(it), text_pair->part))
snprintf(buf, sizeof(buf), "elm,state,%s,show", text_pair->part);
else
snprintf(buf, sizeof(buf), "elm,state,%s,hide", text_pair->part);
- edje_object_signal_emit(VIEW(it), buf, "elm");
+ elm_object_signal_emit(VIEW(it), buf, "elm");
}
}
{
Evas_Object *po, *ao;
- if (!edje_object_part_text_get(VIEW(it), part)) return NULL;
-
- po = (Evas_Object *)edje_object_part_object_get(VIEW(it), part);
+ po = (Evas_Object *)edje_object_part_object_get
+ (elm_layout_edje_get(VIEW(it)), part);
ao = evas_object_data_get(po, "_part_access_obj");
return ao;
return;
}
- ao =_access_object_get(it, "elm.text.title");
+ ao =_access_object_get(it, TITLE_ACCESS_PART);
if (ao) elm_object_focus_set(ao, EINA_TRUE);
else if ((it->title_icon) &&
(elm_widget_can_focus_get(it->title_icon) ||
eina_stringshare_replace(&it->style, item_style);
}
- elm_widget_theme_object_set
- (WIDGET(it), VIEW(it), "naviframe", buf, elm_widget_style_get(WIDGET(it)));
+ elm_layout_theme_set(VIEW(it), "naviframe", buf,
+ elm_widget_style_get(WIDGET(it)));
if (sd->freeze_events)
evas_object_freeze_events_set(VIEW(it), EINA_FALSE);
if (_elm_config->access_mode) _access_focus_set(nit);
if (nit->title_visible)
- edje_object_signal_emit(VIEW(nit), "elm,state,title,show", "elm");
+ elm_object_signal_emit(VIEW(nit), "elm,state,title,show", "elm");
else
- edje_object_signal_emit(VIEW(nit), "elm,state,title,hide", "elm");
- edje_object_message_signal_process(VIEW(nit));
+ elm_object_signal_emit(VIEW(nit), "elm,state,title,hide", "elm");
}
static Eina_Bool
_elm_naviframe_smart_theme(Evas_Object *obj)
{
Elm_Naviframe_Item *it;
+ const char *style, *sstyle;
ELM_NAVIFRAME_DATA_GET(obj, sd);
- if (!ELM_WIDGET_CLASS(_elm_naviframe_parent_sc)->theme(obj))
- return EINA_FALSE;
+ style = elm_widget_style_get(obj);
EINA_INLIST_FOREACH(sd->stack, it)
{
- _item_style_set(it, it->style);
- _item_signals_emit(it);
- _item_title_visible_update(it);
+ /* FIXME: Need to merge with opensource later. smart_theme() is called
+ multiple timese since the elm_widget.c is inefficient. If the
+ elm_widget is merged with the latest opensouce, it's ok to sync with
+ opensource here also */
+ sstyle = elm_widget_style_get(VIEW(it));
+ if ((style && sstyle) && strcmp(style, sstyle))
+ {
+ _item_style_set(it, it->style);
+ _item_signals_emit(it);
+ _item_title_visible_update(it);
+ }
}
elm_layout_sizing_eval(obj);
return EINA_TRUE;
}
+static char *
+_access_info_cb(void *data, Evas_Object *obj __UNUSED__)
+{
+ Evas_Object *layout;
+ Eina_Strbuf *buf;
+ const char *info;
+ char *ret;
+
+ layout = (Evas_Object *)data;
+ info = elm_object_part_text_get(layout, TITLE_PART);
+ if (!info) return NULL;
+
+ buf = eina_strbuf_new();
+ eina_strbuf_append(buf, info);
+
+ info = elm_object_part_text_get(layout, SUBTITLE_PART);
+ if (!info) goto end;
+
+ eina_strbuf_append_printf(buf, ", %s", info);
+
+end:
+ ret = eina_strbuf_string_steal(buf);
+ eina_strbuf_free(buf);
+ return ret;
+}
+
static void
_access_obj_process(Elm_Naviframe_Item *it, Eina_Bool is_access)
{
- Evas_Object *ao;
- Elm_Naviframe_Text_Item_Pair *pair;
+ Evas_Object *ao, *eo;
if (is_access)
{
- if (!_access_object_get(it, "elm.text.title"))
+ if (!_access_object_get(it, TITLE_ACCESS_PART))
{
- ao =_elm_access_edje_object_part_object_register
- (WIDGET(it), VIEW(it), "elm.text.title");
+ eo = elm_layout_edje_get(VIEW(it));
+ ao =_elm_access_edje_object_part_object_register(WIDGET(it), eo,
+ TITLE_ACCESS_PART);
_elm_access_text_set(_elm_access_object_get(ao),
ELM_ACCESS_TYPE, E_("title"));
- }
+ _elm_access_callback_set(_elm_access_object_get(ao),
+ ELM_ACCESS_INFO, _access_info_cb, VIEW(it));
- if (!_access_object_get(it, "elm.text.subtitle"))
- {
- ao =_elm_access_edje_object_part_object_register
- (WIDGET(it), VIEW(it), "elm.text.subtitle");
- _elm_access_text_set(_elm_access_object_get(ao),
- ELM_ACCESS_TYPE, E_("sub title"));
- }
-
- EINA_INLIST_FOREACH(it->text_list, pair)
- {
- if (!_access_object_get(it, pair->part))
- {
- ao = _elm_access_edje_object_part_object_register
- (WIDGET(it), VIEW(it), pair->part);
- _elm_access_text_set(_elm_access_object_get(ao),
- ELM_ACCESS_TYPE, E_(pair->part));
- }
- }
+ /* to access title access object, any idea? */
+ ((Elm_Widget_Item *)it)->access_obj = ao;
+ }
}
else
{
if (it->title_label)
_elm_access_edje_object_part_object_unregister
- (WIDGET(it), VIEW(it), "elm.text.title");
-
- if (it->subtitle_label)
- _elm_access_edje_object_part_object_unregister
- (WIDGET(it), VIEW(it), "elm.text.subtitle");
+ (WIDGET(it), elm_layout_edje_get(VIEW(it)), TITLE_ACCESS_PART);
- EINA_INLIST_FOREACH(it->text_list, pair)
- _elm_access_edje_object_part_object_unregister
- (WIDGET(it), VIEW(it), pair->part);
+ /* to access title access object, any idea? */
+ ao = ((Elm_Widget_Item *)it)->access_obj;
+ if (!ao) return;
+ evas_object_del(ao);
}
}
char buf[1024];
if ((!part) || (!strcmp(part, "default")) ||
- (!strcmp(part, "elm.text.title")))
+ (!strcmp(part, TITLE_PART)))
{
eina_stringshare_replace(&nit->title_label, label);
- snprintf(buf, sizeof(buf), "elm.text.title");
if (label)
- edje_object_signal_emit(VIEW(it), "elm,state,title_label,show", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,title_label,show", "elm");
else
- edje_object_signal_emit(VIEW(it), "elm,state,title_label,hide", "elm");
- edje_object_part_text_set(VIEW(it), buf, label);
+ elm_object_signal_emit(VIEW(it), "elm,state,title_label,hide", "elm");
+ elm_object_part_text_set(VIEW(it), TITLE_PART, label);
}
else if (!strcmp("subtitle", part))
{
eina_stringshare_replace(&nit->subtitle_label, label);
- snprintf(buf, sizeof(buf), "elm.text.subtitle");
if (label)
- edje_object_signal_emit(VIEW(it), "elm,state,subtitle,show", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,subtitle,show", "elm");
else
- edje_object_signal_emit(VIEW(it), "elm,state,subtitle,hide", "elm");
- edje_object_part_text_set(VIEW(it), buf, label);
+ elm_object_signal_emit(VIEW(it), "elm,state,subtitle,hide", "elm");
+ elm_object_part_text_set(VIEW(it), SUBTITLE_PART, label);
}
else
{
- snprintf(buf, sizeof(buf), "%s", part);
EINA_INLIST_FOREACH(nit->text_list, pair)
- if (!strcmp(buf, pair->part)) break;
+ if (!strcmp(part, pair->part)) break;
if (!pair)
{
WIDGET(it));
return;
}
- eina_stringshare_replace(&pair->part, buf);
+ eina_stringshare_replace(&pair->part, part);
nit->text_list = eina_inlist_append(nit->text_list,
EINA_INLIST_GET(pair));
}
snprintf(buf, sizeof(buf), "elm,state,%s,show", part);
else
snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
- edje_object_signal_emit(VIEW(it), buf, "elm");
- edje_object_part_text_set(VIEW(it), part, label);
+ elm_object_signal_emit(VIEW(it), buf, "elm");
+ elm_object_part_text_set(VIEW(it), part, label);
}
/* access */
char buf[1024];
if (!part || !strcmp(part, "default"))
- snprintf(buf, sizeof(buf), "elm.text.title");
+ snprintf(buf, sizeof(buf), TITLE_PART);
else if (!strcmp("subtitle", part))
- snprintf(buf, sizeof(buf), "elm.text.subtitle");
+ snprintf(buf, sizeof(buf), SUBTITLE_PART);
else
snprintf(buf, sizeof(buf), "%s", part);
- return edje_object_part_text_get(VIEW(it), buf);
+ return elm_object_part_text_get(VIEW(it), buf);
}
static Eina_Bool
nit = (Elm_Naviframe_Item *)it;
ELM_NAVIFRAME_DATA_GET(WIDGET(nit), sd);
- if (it == sd->compress_it)
- sd->compress_it = NULL;
-
if (nit->animator) ecore_animator_del(nit->animator);
top = (it == elm_naviframe_top_item_get(WIDGET(nit)));
evas_object_show(VIEW(prev_it));
evas_object_raise(VIEW(prev_it));
- edje_object_signal_emit(VIEW(prev_it), "elm,state,visible", "elm");
- edje_object_message_signal_process(VIEW(prev_it));
+ elm_object_signal_emit(VIEW(prev_it), "elm,state,visible", "elm");
}
end:
if (!content) return;
- edje_object_part_swallow(VIEW(it), CONTENT_PART, content);
- edje_object_signal_emit(VIEW(it), "elm,state,content,show", "elm");
+ elm_object_part_content_set(VIEW(it), CONTENT_PART, content);
+ elm_object_signal_emit(VIEW(it), "elm,state,content,show", "elm");
evas_object_event_callback_add
(content, EVAS_CALLBACK_DEL, _item_content_del_cb, it);
- elm_widget_sub_object_add(WIDGET(it), content);
}
static void
it->title_prev_btn = btn;
if (!btn) return;
- edje_object_part_swallow(VIEW(it), PREV_BTN_PART, btn);
- edje_object_signal_emit(VIEW(it), "elm,state,prev_btn,show", "elm");
+ elm_object_part_content_set(VIEW(it), PREV_BTN_PART, btn);
+ elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,show", "elm");
evas_object_event_callback_add
(btn, EVAS_CALLBACK_DEL, _item_title_prev_btn_del_cb, it);
}
it->title_next_btn = btn;
if (!btn) return;
- edje_object_part_swallow(VIEW(it), NEXT_BTN_PART, btn);
- edje_object_signal_emit(VIEW(it), "elm,state,next_btn,show", "elm");
+ elm_object_part_content_set(VIEW(it), NEXT_BTN_PART, btn);
+ elm_object_signal_emit(VIEW(it), "elm,state,next_btn,show", "elm");
evas_object_event_callback_add
(btn, EVAS_CALLBACK_DEL, _item_title_next_btn_del_cb, it);
it->title_icon = icon;
if (!icon) return;
- edje_object_part_swallow(VIEW(it), ICON_PART, icon);
- edje_object_signal_emit(VIEW(it), "elm,state,icon,show", "elm");
+ elm_object_part_content_set(VIEW(it), ICON_PART, icon);
+ elm_object_signal_emit(VIEW(it), "elm,state,icon,show", "elm");
evas_object_event_callback_add
(icon, EVAS_CALLBACK_DEL, _item_title_icon_del_cb, it);
if (!content) return NULL;
- edje_object_part_unswallow(VIEW(it), content);
- edje_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
+ elm_object_part_content_unset(VIEW(it), CONTENT_PART);
+ elm_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
evas_object_event_callback_del
(content, EVAS_CALLBACK_DEL, _item_content_del_cb);
- elm_widget_sub_object_del(WIDGET(it), content);
+
it->content = NULL;
return content;
}
if (!content) return NULL;
- edje_object_part_unswallow(VIEW(it), it->title_prev_btn);
- edje_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
+ elm_object_part_content_unset(VIEW(it), PREV_BTN_PART);
+ elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
evas_object_event_callback_del
(content, EVAS_CALLBACK_DEL, _item_title_prev_btn_del_cb);
if (!content) return NULL;
- edje_object_part_unswallow(VIEW(it), it->title_next_btn);
- edje_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
+ elm_object_part_content_unset(VIEW(it), NEXT_BTN_PART);
+ elm_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
evas_object_event_callback_del
(content, EVAS_CALLBACK_DEL, _item_title_next_btn_del_cb);
if (!content) return NULL;
- edje_object_part_unswallow(VIEW(it), it->title_icon);
- edje_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
+ elm_object_part_content_unset(VIEW(it), ICON_PART);
+ elm_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
evas_object_event_callback_del
(content, EVAS_CALLBACK_DEL, _item_title_icon_del_cb);
if (pair)
{
if (pair->content == content) return;
- if (content) edje_object_part_swallow(VIEW(it), part, content);
if (pair->content)
- {
- evas_object_event_callback_del(pair->content,
- EVAS_CALLBACK_DEL,
- _title_content_del);
- evas_object_del(pair->content);
- }
+ evas_object_event_callback_del(pair->content,
+ EVAS_CALLBACK_DEL,
+ _title_content_del);
+ if (content) elm_object_part_content_set(VIEW(it), part, content);
}
else
{
eina_stringshare_replace(&pair->part, part);
it->content_list = eina_inlist_append(it->content_list,
EINA_INLIST_GET(pair));
- edje_object_part_swallow(VIEW(it), part, content);
+ elm_object_part_content_set(VIEW(it), part, content);
snprintf(buf, sizeof(buf), "elm,state,%s,show", part);
- edje_object_signal_emit(VIEW(it), buf, "elm");
+ elm_object_signal_emit(VIEW(it), buf, "elm");
}
pair->content = content;
evas_object_event_callback_add(content,
EVAS_CALLBACK_DEL,
_title_content_del,
pair);
+
+ /* access */
+ if (_elm_config->access_mode)
+ _access_obj_process(it, EINA_TRUE);
}
static void
return nit->title_icon;
//common parts
- return edje_object_part_swallow_get(VIEW(nit), part);
+ return elm_object_part_content_get(VIEW(nit), part);
}
static Evas_Object *
if (!content) return NULL;
- edje_object_part_unswallow(VIEW(it), content);
+ elm_object_part_content_unset(VIEW(it), part);
snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
- edje_object_signal_emit(VIEW(it), buf, "elm");
+ elm_object_signal_emit(VIEW(it), buf, "elm");
evas_object_event_callback_del(content,
EVAS_CALLBACK_DEL,
_title_content_del);
const char *emission,
const char *source)
{
- edje_object_signal_emit(VIEW(it), emission, source);
+ elm_object_signal_emit(VIEW(it), emission, source);
}
static void
{
evas_object_move(VIEW(it), x, y);
evas_object_resize(VIEW(it), w, h);
- edje_object_size_min_calc(VIEW(it), &it->minw, &it->minh);
+ edje_object_size_min_calc(elm_layout_edje_get(VIEW(it)),
+ &it->minw, &it->minh);
if (it->minw > minw) minw = it->minw;
if (it->minh > minh) minh = it->minh;
}
multiple times on some heavy environment. This callback del will
prevent those scenario and guarantee only one clicked for it's own
page. */
- evas_object_smart_callback_del(obj, "clicked", _on_item_back_btn_clicked);
+ evas_object_smart_callback_del(obj, SIG_CLICKED, _on_item_back_btn_clicked);
elm_naviframe_item_pop(data);
}
if (!btn) return NULL;
evas_object_smart_callback_add
- (btn, "clicked", _on_item_back_btn_clicked, obj);
+ (btn, SIG_CLICKED, _on_item_back_btn_clicked, obj);
snprintf
(buf, sizeof(buf), "naviframe/back_btn/%s", elm_widget_style_get(obj));
elm_object_style_set(btn, buf);
* set an icon.
*/
ed = elm_layout_edje_get(btn);
- if (edje_object_part_exists(ed, "elm.swallow.content"))
+ if (edje_object_part_exists(ed, CONTENT_PART))
{
Evas_Object *ico = elm_icon_add(btn);
elm_icon_standard_set(ico, "arrow_left");
- elm_layout_content_set(btn, "elm.swallow.content", ico);
+ elm_layout_content_set(btn, CONTENT_PART, ico);
}
return btn;
}
static void
+_elm_naviframe_smart_signal_callback_add(Evas_Object *obj,
+ const char *emission,
+ const char *source,
+ Edje_Signal_Cb func_cb,
+ void *data)
+{
+ ELM_NAVIFRAME_DATA_GET(obj, sd);
+ Elm_Object_Item *it;
+
+ if (!sd->stack) return;
+
+ _elm_naviframe_parent_sc->callback_add(obj, emission, source, func_cb, data);
+
+ it = elm_naviframe_top_item_get(obj);
+ if (!it) return EINA_FALSE;
+
+ elm_object_signal_callback_add(VIEW(it), emission, source, func_cb, data);
+}
+
+static void
_elm_naviframe_smart_signal(Evas_Object *obj,
const char *emission,
const char *source)
ELM_NAVIFRAME_DATA_GET(WIDGET(it), sd);
- edje_object_signal_emit(VIEW(it), "elm,state,visible", "elm");
- edje_object_message_signal_process(VIEW(it));
+ elm_object_signal_emit(VIEW(it), "elm,state,visible", "elm");
elm_widget_tree_unfocusable_set(it->content, it->content_unfocusable);
elm_layout_sizing_eval(data);
}
+static void
+_item_dispmode_set(Elm_Naviframe_Item *it, Evas_Display_Mode dispmode)
+{
+ if (it->dispmode == dispmode) return;
+ switch (dispmode)
+ {
+ case EVAS_DISPLAY_MODE_COMPRESS:
+ elm_object_signal_emit(VIEW(it), "display,mode,compress", "");
+ break;
+ default:
+ elm_object_signal_emit(VIEW(it), "display,mode,default", "");
+ break;
+ }
+ it->dispmode = dispmode;
+}
+
static Elm_Naviframe_Item *
_item_new(Evas_Object *obj,
const Elm_Naviframe_Item *prev_it,
elm_widget_item_signal_emit_hook_set(it, _item_signal_emit_hook);
//item base layout
- VIEW(it) = edje_object_add(evas_object_evas_get(obj));
+ VIEW(it) = elm_layout_add(obj);
evas_object_smart_member_add(VIEW(it), obj);
evas_object_event_callback_add
(VIEW(it), EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_on_item_size_hints_changed, obj);
- edje_object_signal_callback_add
+
+ elm_object_signal_callback_add
(VIEW(it), "elm,action,show,finished", "", _on_item_show_finished, it);
- edje_object_signal_callback_add
+ elm_object_signal_callback_add
(VIEW(it), "elm,action,pushed,finished", "", _on_item_push_finished, it);
- edje_object_signal_callback_add
+ elm_object_signal_callback_add
(VIEW(it), "elm,action,popped,finished", "", _on_item_pop_finished, it);
- edje_object_signal_callback_add
+ elm_object_signal_callback_add
(VIEW(it), "elm,action,title,clicked", "", _on_item_title_clicked, it);
_item_style_set(it, item_style);
if (title_label)
- _item_text_set_hook((Elm_Object_Item *)it, "elm.text.title", title_label);
+ _item_text_set_hook((Elm_Object_Item *)it, TITLE_PART, title_label);
//title buttons
if ((!prev_btn) && sd->auto_pushed && prev_it)
}
if (prev_btn)
- _item_content_set_hook((Elm_Object_Item *)it, PREV_BTN_PART, prev_btn);
+ {
+ _item_content_set_hook((Elm_Object_Item *)it, PREV_BTN_PART, prev_btn);
+
+ if (!elm_layout_text_get(prev_btn, NULL))
+ _elm_access_text_set
+ (_elm_access_object_get(prev_btn), ELM_ACCESS_INFO, E_("Back"));
+ }
if (next_btn)
- _item_content_set_hook((Elm_Object_Item *)it, NEXT_BTN_PART, next_btn);
+ {
+ _item_content_set_hook((Elm_Object_Item *)it, NEXT_BTN_PART, next_btn);
+
+ if (!elm_layout_text_get(next_btn, NULL))
+ _elm_access_text_set
+ (_elm_access_object_get(next_btn), ELM_ACCESS_INFO, E_("Next"));
+ }
_item_content_set(it, content);
+ _item_dispmode_set(it, sd->dispmode);
+
it->title_visible = EINA_TRUE;
return it;
_on_obj_size_hints_changed(void *data __UNUSED__, Evas *e __UNUSED__,
Evas_Object *obj, void *event_info __UNUSED__)
{
- Elm_Object_Item *it;
+ Elm_Naviframe_Item *it;
Evas_Display_Mode dispmode;
ELM_NAVIFRAME_DATA_GET(obj, sd);
- it = elm_naviframe_top_item_get(obj);
- if (!it) return;
-
dispmode = evas_object_size_hint_display_mode_get(obj);
+ if (sd->dispmode == dispmode) return;
+
sd->dispmode = dispmode;
- switch (dispmode)
- {
- case EVAS_DISPLAY_MODE_COMPRESS:
- edje_object_signal_emit(VIEW(it), "display,mode,compress", "");
- sd->compress_it = it;
- break;
- default:
- if (sd->compress_it)
- edje_object_signal_emit(VIEW(sd->compress_it), "display,mode,default", "");
- break;
- }
+ EINA_INLIST_FOREACH(sd->stack, it)
+ _item_dispmode_set(it, dispmode);
}
static Eina_Bool
Eina_List *l = NULL;
Elm_Naviframe_Item *top_it;
Elm_Naviframe_Content_Item_Pair *content_pair = NULL;
- Elm_Naviframe_Text_Item_Pair *text_pair = NULL;
void *(*list_data_get)(const Eina_List *list);
top_it = (Elm_Naviframe_Item *)elm_naviframe_top_item_get(obj);
/* access */
if (_elm_config->access_mode)
{
- ao = _access_object_get(top_it, "elm.text.title");
- if (ao) l = eina_list_append(l, ao);
-
- ao = _access_object_get(top_it, "elm.text.subtitle");
+ ao = _access_object_get(top_it, TITLE_ACCESS_PART);
if (ao) l = eina_list_append(l, ao);
-
-
- EINA_INLIST_FOREACH(top_it->text_list, text_pair)
- {
- ao = _access_object_get(top_it, text_pair->part);
- if (ao) l = eina_list_append(l, ao);
- }
}
/* icon would be able to have an widget. ex: segment control */
l = eina_list_append(l, top_it->content);
EINA_INLIST_FOREACH(top_it->content_list, content_pair)
{
- if (edje_object_part_swallow_get(VIEW(top_it), content_pair->part))
- l = eina_list_append(l, edje_object_part_swallow_get(VIEW(top_it),
- content_pair->part));
+ if (elm_object_part_content_get(VIEW(top_it), content_pair->part))
+ l = eina_list_append(l, elm_object_part_content_get(VIEW(top_it),
+ content_pair->part));
}
l = eina_list_append(l, VIEW(top_it));
evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_on_obj_size_hints_changed, obj);
- elm_widget_can_focus_set(obj, EINA_FALSE);
+ elm_widget_can_focus_set(obj, EINA_TRUE);
}
static Eina_Bool
prev_it = (Elm_Naviframe_Item *) elm_naviframe_top_item_get(WIDGET(it));
if (prev_it)
{
- edje_object_signal_emit(VIEW(prev_it), "elm,state,prev,popped,deferred", "elm");
+ elm_object_signal_emit(VIEW(prev_it), "elm,state,prev,popped,deferred",
+ "elm");
//FIXME: Remove the below line once edje_object_message_signal_process is fixed.
//This API crashes when in the midst of this API processing if edje object passed here is deleted.
- //edje_object_message_signal_process(VIEW(prev_it));
+ //edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it)));
}
- edje_object_signal_emit(VIEW(it), "elm,state,cur,popped,deferred", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,cur,popped,deferred", "elm");
//FIXME: Remove the below line once edje_object_message_signal_process is fixed.
//This API crashes when in the midst of this API processing if edje object passed here is deleted.
- //edje_object_message_signal_process(VIEW(it));
+ //edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
return ECORE_CALLBACK_CANCEL;
}
_elm_naviframe_smart_del(Evas_Object *obj)
{
Elm_Naviframe_Item *it;
- Eina_List *l;
ELM_NAVIFRAME_DATA_GET(obj, sd);
}
//All popping items which are not called yet by animator.
- EINA_LIST_FOREACH(sd->popping, l, it)
+ EINA_LIST_FREE(sd->popping, it)
{
if (it->animator) ecore_animator_del(it->animator);
elm_widget_item_del(it);
_access_obj_process(it, is_access);
}
+static Eina_Bool
+_elm_naviframe_smart_event(Evas_Object *obj,
+ Evas_Object *src __UNUSED__,
+ Evas_Callback_Type type,
+ void *event_info)
+{
+ Elm_Naviframe_Item *it;
+ Evas_Event_Key_Down *ev = event_info;
+
+ if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
+ if (strcmp(ev->keyname, "BackSpace")) return EINA_FALSE;
+
+ it = elm_naviframe_top_item_get(obj);
+ if (!it) return EINA_FALSE;
+
+ if (it->title_prev_btn)
+ evas_object_smart_callback_call(it->title_prev_btn, SIG_CLICKED, NULL);
+
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+
+ return EINA_TRUE;
+}
+
static void
_elm_naviframe_smart_set_user(Elm_Naviframe_Smart_Class *sc)
{
ELM_WIDGET_CLASS(sc)->theme = _elm_naviframe_smart_theme;
ELM_WIDGET_CLASS(sc)->focus_next = _elm_naviframe_smart_focus_next;
ELM_WIDGET_CLASS(sc)->access = _elm_naviframe_smart_access;
+ ELM_WIDGET_CLASS(sc)->event = _elm_naviframe_smart_event;
ELM_CONTAINER_CLASS(sc)->content_set = _elm_naviframe_smart_content_set;
ELM_CONTAINER_CLASS(sc)->content_get = _elm_naviframe_smart_content_get;
ELM_CONTAINER_CLASS(sc)->content_unset = _elm_naviframe_smart_content_unset;
ELM_LAYOUT_CLASS(sc)->signal = _elm_naviframe_smart_signal;
+ ELM_LAYOUT_CLASS(sc)->callback_add = _elm_naviframe_smart_signal_callback_add;
ELM_LAYOUT_CLASS(sc)->text_set = _elm_naviframe_smart_text_set;
ELM_LAYOUT_CLASS(sc)->text_get = _elm_naviframe_smart_text_get;
ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_naviframe_smart_sizing_eval;
{
prev_it = EINA_INLIST_CONTAINER_GET(sd->stack->last->prev,
Elm_Naviframe_Item);
- edje_object_signal_emit(VIEW(prev_it), "elm,state,cur,pushed,deferred",
+ elm_object_signal_emit(VIEW(prev_it), "elm,state,cur,pushed,deferred",
"elm");
- edje_object_message_signal_process(VIEW(prev_it));
+ edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it)));
}
- edje_object_signal_emit(VIEW(it), "elm,state,new,pushed,deferred", "elm");
- edje_object_message_signal_process(VIEW(it));
+ elm_object_signal_emit(VIEW(it), "elm,state,new,pushed,deferred", "elm");
+ edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
return ECORE_CALLBACK_CANCEL;
}
evas_object_freeze_events_set(VIEW(prev_it), EINA_TRUE);
}
- edje_object_signal_emit(VIEW(prev_it), "elm,state,cur,pushed", "elm");
- edje_object_signal_emit(VIEW(it), "elm,state,new,pushed", "elm");
+ elm_object_signal_emit(VIEW(prev_it), "elm,state,cur,pushed", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,new,pushed", "elm");
+ edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it)));
+ edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
- /* animate previous */
- edje_object_message_signal_process(VIEW(prev_it));
if (prev_it->content)
{
prev_it->content_unfocusable =
elm_widget_tree_unfocusable_set(prev_it->content, EINA_TRUE);
}
- /* animate new one */
- edje_object_message_signal_process(VIEW(it));
it->animator = ecore_animator_add(_push_transition_cb, it);
}
it = (Elm_Naviframe_Item *)elm_naviframe_top_item_get(obj);
if (!it) return NULL;
+ if (it->pop_cb) it->pop_cb(it->pop_data, (Elm_Object_Item *)it);
+
if (sd->preserve)
content = it->content;
if (_elm_config->access_mode) _access_focus_set(prev_it);
/* these 2 signals MUST take place simultaneously */
- edje_object_signal_emit(VIEW(it), "elm,state,cur,popped", "elm");
+ elm_object_signal_emit(VIEW(it), "elm,state,cur,popped", "elm");
evas_object_show(VIEW(prev_it));
- edje_object_signal_emit(VIEW(prev_it), "elm,state,prev,popped", "elm");
+ elm_object_signal_emit(VIEW(prev_it), "elm,state,prev,popped", "elm");
- edje_object_message_signal_process(VIEW(it));
- edje_object_message_signal_process(VIEW(prev_it));
+ edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
+ edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it)));
if (it->animator) ecore_animator_del(it->animator);
it->animator = ecore_animator_add(_pop_transition_cb, it);
evas_object_freeze_events_set(VIEW(prev_it), EINA_TRUE);
}
- edje_object_signal_emit(VIEW(prev_it), "elm,state,cur,pushed", "elm");
+ elm_object_signal_emit(VIEW(prev_it), "elm,state,cur,pushed", "elm");
evas_object_show(VIEW(nit));
evas_object_raise(VIEW(nit));
- edje_object_signal_emit(VIEW(nit), "elm,state,new,pushed", "elm");
+ elm_object_signal_emit(VIEW(nit), "elm,state,new,pushed", "elm");
- edje_object_message_signal_process(VIEW(prev_it));
- edje_object_message_signal_process(VIEW(nit));
+ edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it)));
+ edje_object_message_signal_process(elm_layout_edje_get(VIEW(nit)));
if (nit->animator) ecore_animator_del(nit->animator);
nit->animator = ecore_animator_add(_push_transition_cb, nit);
}
EAPI void
+elm_naviframe_item_pop_cb_set(Elm_Object_Item *it, Elm_Naviframe_Item_Pop_Cb func, void *data)
+{
+ Elm_Naviframe_Item *nit = (Elm_Naviframe_Item *)it;
+
+ ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(it);
+
+ nit->pop_cb = func;
+ nit->pop_data = data;
+}
+
+EAPI void
elm_naviframe_prev_btn_auto_pushed_set(Evas_Object *obj,
Eina_Bool auto_pushed)
{
* This widget inherits from the @ref Layout one, so that all the
* functions acting on it also work for naviframe objects.
*
- * Becase this widget is a layout, one places content on those areas
+ * Because this widget is a layout, one places content on those areas
* by using elm_layout_content_set() on the right swallow part names
* expected for each, which are:
* @li @c "default" - The main content of the current page
* - @c "basic" - views are switched sliding horizontally, one after
* the other
* - @c "overlap" - like the previous one, but the previous view stays
- * at its place and is ovelapped by the new
+ * at its place and is overlapped by the new
*
*
* This widget emits the following signals, besides the ones sent from
*/
/**
+ * @typedef Elm_Naviframe_Item_Pop_Cb
+ *
+ * Pop callback called when @c it is going to be popped. @c data is user
+ * specific data.
+ *
+ * @see elm_naviframe_item_pop_cb_set()
+ *
+ * @since 1.8
+ */
+typedef void (*Elm_Naviframe_Item_Pop_Cb)(void *data, Elm_Object_Item *it);
+
+/**
* @addtogroup Naviframe
* @{
*/
* stack will become visible.
*
* @see also elm_naviframe_content_preserve_on_pop_get()
+ * @see also elm_naviframe_item_pop_cb_set()
*
* @ingroup Naviframe
*/
EAPI Eina_Bool elm_naviframe_item_title_visible_get(const Elm_Object_Item *it);
/**
+ * @brief Set a function to be called when @c it of the naviframe is going to be
+ * popped.
+ *
+ * @param it The item to set the callback on
+ * @param func the callback function.
+ *
+ * @warning Don't set "clicked" callback to the prev button additionally if the
+ * function does a exact same logic with this @c func. When hardware back key is
+ * pressed then both callbacks will be called.
+ *
+ * @since 1.8
+ * @ingroup Naviframe
+ */
+EAPI void elm_naviframe_item_pop_cb_set(Elm_Object_Item *it, Elm_Naviframe_Item_Pop_Cb func, void *data);
+
+/**
* @brief Set creating prev button automatically or not
*
* @param obj The naviframe object
static void _button_remove(Evas_Object *, int, Eina_Bool);
+static const char ACCESS_TITLE_PART[] = "access.title";
+static const char ACCESS_BODY_PART[] = "access.body";
+
static const char SIG_BLOCK_CLICKED[] = "block,clicked";
static const char SIG_TIMEOUT[] = "timeout";
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
evas_object_smart_callback_call(data, SIG_TIMEOUT, NULL);
}
+static Evas_Object *
+_access_object_get(const Evas_Object *obj, const char* part)
+{
+ Evas_Object *po, *ao;
+ ELM_POPUP_DATA_GET(obj, sd);
+
+ po = (Evas_Object *)edje_object_part_object_get(ELM_WIDGET_DATA(sd)->resize_obj, part);
+ ao = evas_object_data_get(po, "_part_access_obj");
+
+ return ao;
+}
+
static void
_on_show(void *data __UNUSED__,
Evas *e __UNUSED__,
/* yeah, ugly, but again, this widget needs a rewrite */
elm_object_content_set(sd->notify, obj);
- // XXX: ACCESS
- if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
- {
- evas_object_focus_set(sd->title_access_obj, EINA_TRUE);
- _elm_access_highlight_set(sd->title_access_obj);
- }
elm_object_focus_set(obj, EINA_TRUE);
}
evas_object_hide(sd->notify);
elm_object_content_unset(sd->notify);
+
+/* FIXME:elm_object_content_unset(notify) deletes callback to revert focus status. */
+ elm_object_focus_set(obj, EINA_FALSE);
}
static void
edje_object_mirrored_set(VIEW(item), rtl);
}
+static void
+_access_obj_process(Evas_Object *obj, Eina_Bool is_access)
+{
+ Evas_Object *ao;
+
+ ELM_POPUP_DATA_GET(obj, sd);
+
+ if (is_access)
+ {
+ if (sd->title_text)
+ {
+ ao = _elm_access_edje_object_part_object_register
+ (obj, ELM_WIDGET_DATA(sd)->resize_obj, ACCESS_TITLE_PART);
+ _elm_access_text_set(_elm_access_object_get(ao),
+ ELM_ACCESS_TYPE, E_("Popup Title"));
+ _elm_access_text_set(_elm_access_object_get(ao),
+ ELM_ACCESS_INFO, sd->title_text);
+ }
+
+ if (sd->text_content_obj)
+ {
+ ao = _elm_access_edje_object_part_object_register
+ (obj, ELM_WIDGET_DATA(sd)->resize_obj, ACCESS_BODY_PART);
+ _elm_access_text_set(_elm_access_object_get(ao),
+ ELM_ACCESS_TYPE, E_("Popup Body Text"));
+ _elm_access_text_set(_elm_access_object_get(ao),
+ ELM_ACCESS_INFO, elm_object_text_get(sd->text_content_obj));
+ }
+ }
+ else
+ {
+ if (sd->title_text)
+ {
+ _elm_access_edje_object_part_object_unregister
+ (obj, ELM_WIDGET_DATA(sd)->resize_obj, ACCESS_TITLE_PART);
+ }
+
+ if (sd->text_content_obj)
+ {
+ _elm_access_edje_object_part_object_unregister
+ (obj, ELM_WIDGET_DATA(sd)->resize_obj, ACCESS_BODY_PART);
+ }
+ }
+}
+
static Eina_Bool
_elm_popup_smart_theme(Evas_Object *obj)
{
edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
elm_layout_sizing_eval(obj);
+ /* access */
+ if (_elm_config->access_mode) _access_obj_process(obj, EINA_TRUE);
+
return EINA_TRUE;
}
}
static void
+_access_activate_cb(void *data __UNUSED__,
+ Evas_Object *part_obj __UNUSED__,
+ Elm_Object_Item *item)
+{
+ _item_select_cb(item, NULL, NULL, NULL);
+}
+
+static char *
+_access_state_cb(void *data, Evas_Object *obj __UNUSED__)
+{
+ Elm_Popup_Item *it = (Elm_Popup_Item *)data;
+ if (!it) return NULL;
+
+ if (it->base.disabled)
+ return strdup(E_("State: Disabled"));
+
+ return NULL;
+}
+
+static char *
+_access_info_cb(void *data, Evas_Object *obj __UNUSED__)
+{
+ Elm_Popup_Item *it = (Elm_Popup_Item *)data;
+ const char *txt = NULL;
+ Evas_Object *icon = NULL;
+ Eina_Strbuf *buf = NULL;
+ char *str = NULL;
+
+ if (!it) return NULL;
+
+ txt = it->label;
+ icon = it->icon;
+
+ if (txt && icon)
+ {
+ buf = eina_strbuf_new();
+ eina_strbuf_append(buf, E_("icon "));
+ eina_strbuf_append(buf, txt);
+ str = eina_strbuf_string_steal(buf);
+ eina_strbuf_free(buf);
+ return str;
+ }
+ else if ((!txt) && icon) return strdup(E_("icon"));
+ else if (txt && (!icon)) return strdup(txt);
+
+ return NULL;
+}
+
+static void
+_access_widget_item_register(Elm_Popup_Item *it)
+{
+ Elm_Access_Info *ao;
+
+ _elm_access_widget_item_register((Elm_Widget_Item *)it);
+ ao = _elm_access_object_get(it->base.access_obj);
+ _elm_access_callback_set(ao, ELM_ACCESS_INFO, _access_info_cb, it);
+ _elm_access_callback_set(ao, ELM_ACCESS_STATE, _access_state_cb, it);
+ _elm_access_text_set(ao, ELM_ACCESS_TYPE, E_("Popup_list"));
+ _elm_access_activate_callback_set(ao, _access_activate_cb, it);
+
+}
+
+static void
_item_new(Elm_Popup_Item *item)
{
ELM_POPUP_DATA_GET(WIDGET(item), sd);
(VIEW(item), "elm,action,click", "", _item_select_cb, item);
evas_object_size_hint_align_set
(VIEW(item), EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ /* access */
+ if (_elm_config->access_mode) _access_widget_item_register(item);
+
evas_object_show(VIEW(item));
}
_title_text_set(Evas_Object *obj,
const char *text)
{
+ Evas_Object *ao;
Eina_Bool title_visibility_old, title_visibility_current;
ELM_POPUP_DATA_GET(obj, sd);
edje_object_part_text_escaped_set
(ELM_WIDGET_DATA(sd)->resize_obj, "elm.text.title", text);
- // XXX: ACCESS
- if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
+ /* access */
+ if (_elm_config->access_mode)
{
- sd->title_access_obj = _elm_access_edje_object_part_object_register
- (ELM_WIDGET_DATA(sd)->resize_obj, ELM_WIDGET_DATA(sd)->resize_obj,
- "elm.text.title");
- _elm_access_text_set(_elm_access_object_get(sd->title_access_obj),
- ELM_ACCESS_TYPE, E_("popup title"));
- elm_widget_sub_object_add(obj, sd->title_access_obj);
+ ao = _access_object_get(obj, ACCESS_TITLE_PART);
+ if (!ao)
+ {
+ ao = _elm_access_edje_object_part_object_register
+ (obj, ELM_WIDGET_DATA(sd)->resize_obj, ACCESS_TITLE_PART);
+ _elm_access_text_set(_elm_access_object_get(ao),
+ ELM_ACCESS_TYPE, E_("Popup Title"));
+ }
+ _elm_access_text_set(_elm_access_object_get(ao), ELM_ACCESS_INFO, text);
}
if (sd->title_text)
_content_text_set(Evas_Object *obj,
const char *text)
{
- Evas_Object *prev_content;
+ Evas_Object *prev_content, *ao;
char buf[128];
ELM_POPUP_DATA_GET(obj, sd);
elm_layout_content_set
(sd->content_area, "elm.swallow.content", sd->text_content_obj);
- // XXX: ACCESS
- _elm_access_text_set
- (_elm_access_object_get(sd->text_content_obj),
- ELM_ACCESS_TYPE, E_("popup label"));
+ /* access */
+ if (_elm_config->access_mode)
+ {
+ /* unregister label, ACCESS_BODY_PART will register */
+ elm_access_object_unregister(sd->text_content_obj);
+
+ ao = _access_object_get(obj, ACCESS_BODY_PART);
+ if (!ao)
+ {
+ ao = _elm_access_edje_object_part_object_register
+ (obj, ELM_WIDGET_DATA(sd)->resize_obj, ACCESS_BODY_PART);
+ _elm_access_text_set(_elm_access_object_get(ao),
+ ELM_ACCESS_TYPE, E_("Popup Body Text"));
+ }
+ _elm_access_text_set(_elm_access_object_get(ao), ELM_ACCESS_INFO, text);
+ }
end:
elm_layout_sizing_eval(obj);
Elm_Focus_Direction dir,
Evas_Object **next)
{
+ Evas_Object *ao;
+ Eina_List *items = NULL;
+
ELM_POPUP_DATA_GET(obj, sd);
- if (!elm_widget_focus_next_get(sd->content_area, dir, next) &&
- !elm_widget_focus_next_get(sd->action_area, dir, next)
- )
+ /* access */
+ if (_elm_config->access_mode)
{
- // XXX: ACCESS
- if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
+ if (sd->title_text)
{
- *next = sd->title_access_obj;
- return EINA_TRUE;
+ ao = _access_object_get(obj, ACCESS_TITLE_PART);
+ items = eina_list_append(items, ao);
}
- elm_widget_focused_object_clear((Evas_Object *)obj);
- if (!elm_widget_focus_next_get(sd->content_area, dir, next))
- return elm_widget_focus_next_get(sd->action_area, dir, next);
- return EINA_TRUE;
+
+ ao = _access_object_get(obj, ACCESS_BODY_PART);
+ if (ao) items = eina_list_append(items, ao);
}
+ /* content area */
+ if (sd->content) items = eina_list_append(items, sd->content_area);
+
+ /* action area */
+ if (sd->button_count) items = eina_list_append(items, sd->action_area);
+
+ elm_widget_focus_list_next_get
+ (obj, items, eina_list_data_get, dir, next);
+
return EINA_TRUE;
}
Evas_Object **direction,
double *weight)
{
+ Evas_Object *ao;
+ Eina_List *items = NULL;
+
ELM_POPUP_DATA_GET(obj, sd);
- return elm_widget_focus_direction_get
- (sd->notify, base, degree, direction, weight);
+ /* access */
+ if (_elm_config->access_mode)
+ {
+ if (sd->title_text)
+ {
+ ao = _access_object_get(obj, ACCESS_TITLE_PART);
+ items = eina_list_append(items, ao);
+ }
+
+ ao = _access_object_get(obj, ACCESS_BODY_PART);
+ if (ao) items = eina_list_append(items, ao);
+ }
+
+ /* content area */
+ if (sd->content) items = eina_list_append(items, sd->content_area);
+
+ /* action area */
+ if (sd->button_count) items = eina_list_append(items, sd->action_area);
+
+ elm_widget_focus_list_direction_get
+ (obj, base, items, eina_list_data_get, degree, direction, weight);
+
+ return EINA_TRUE;
}
static void
ELM_WIDGET_CLASS(_elm_popup_parent_sc)->base.add(obj);
- elm_layout_theme_set(obj, "popup", "base", elm_widget_style_get(obj));
-
evas_object_size_hint_weight_set
(ELM_WIDGET_DATA(priv)->resize_obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set
(ELM_WIDGET_DATA(priv)->resize_obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_layout_theme_set(obj, "popup", "base", elm_widget_style_get(obj));
+
priv->notify = elm_notify_add(obj);
elm_notify_orient_set(priv->notify, ELM_NOTIFY_ORIENT_CENTER);
elm_notify_allow_events_set(priv->notify, EINA_FALSE);
}
static void
+_elm_popup_smart_access(Evas_Object *obj, Eina_Bool is_access)
+{
+ _access_obj_process(obj, is_access);
+}
+
+static Eina_Bool
+_elm_popup_smart_event(Evas_Object *obj,
+ Evas_Object *src __UNUSED__,
+ Evas_Callback_Type type,
+ void *event_info)
+{
+ Evas_Event_Key_Down *ev = event_info;
+
+ if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
+
+ if (!strcmp(ev->keyname, "Tab"))
+ {
+ if (evas_key_modifier_is_set(ev->modifiers, "Shift"))
+ elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
+ else
+ elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
+
+ goto success;
+ }
+ else if ((!strcmp(ev->keyname, "Left")) ||
+ ((!strcmp(ev->keyname, "KP_Left")) && (!ev->string)))
+ {
+ elm_widget_focus_direction_go(obj, 270.0);
+ goto success;
+ }
+ else if ((!strcmp(ev->keyname, "Right")) ||
+ ((!strcmp(ev->keyname, "KP_Right")) && (!ev->string)))
+ {
+ elm_widget_focus_direction_go(obj, 90.0);
+ goto success;
+ }
+ else if ((!strcmp(ev->keyname, "Up")) ||
+ ((!strcmp(ev->keyname, "KP_Up")) && (!ev->string)))
+ {
+ elm_widget_focus_direction_go(obj, 0.0);
+ goto success;
+ }
+ else if ((!strcmp(ev->keyname, "Down")) ||
+ ((!strcmp(ev->keyname, "KP_Down")) && (!ev->string)))
+ {
+ elm_widget_focus_direction_go(obj, 180.0);
+ goto success;
+ }
+
+ return EINA_FALSE;
+
+success:
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ return EINA_TRUE;
+}
+
+static void
_elm_popup_smart_set_user(Elm_Popup_Smart_Class *sc)
{
ELM_WIDGET_CLASS(sc)->base.add = _elm_popup_smart_add;
ELM_WIDGET_CLASS(sc)->base.del = _elm_popup_smart_del;
ELM_WIDGET_CLASS(sc)->parent_set = _elm_popup_smart_parent_set;
+ ELM_WIDGET_CLASS(sc)->event = _elm_popup_smart_event;
ELM_WIDGET_CLASS(sc)->theme = _elm_popup_smart_theme;
ELM_WIDGET_CLASS(sc)->focus_next = _elm_popup_smart_focus_next;
+ ELM_WIDGET_CLASS(sc)->access = _elm_popup_smart_access;
ELM_WIDGET_CLASS(sc)->focus_direction = _elm_popup_smart_focus_direction;
ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_popup_smart_sub_object_del;
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
+ /* access: parent could be any object such as elm_list which does
+ not know elc_popup as its child object in the focus_next(); */
+ ELM_WIDGET_DATA_GET(obj, sd);
+ sd->highlight_root = EINA_TRUE;
+
return obj;
}
(ACCESS_SMART_NAME, _elm_access, Elm_Widget_Smart_Class,
Elm_Widget_Smart_Class, elm_widget_smart_class_get, NULL);
+static Eina_Bool mouse_event_enable = EINA_TRUE;
+static Eina_Bool read_mode = EINA_FALSE;
+
static Evas_Object * _elm_access_add(Evas_Object *parent);
static void
mapi = m->api;
}
+static void
+_access_shutdown(void)
+{
+ Elm_Module *m;
+ if (initted == 0) return;
+ if (!(m = _elm_module_find_as("access/api"))) return;
+
+ m->shutdown_func(m);
+
+ initted = 0;
+
+ free(mapi);
+ mapi = NULL;
+}
+
static Elm_Access_Item *
_access_add_set(Elm_Access_Info *ac, int type)
{
return ai;
}
+static Evas_Object *
+_access_highlight_object_get(Evas_Object *obj)
+{
+ Evas_Object *o, *ho;
+
+ o = evas_object_name_find(evas_object_evas_get(obj), "_elm_access_disp");
+ if (!o) return NULL;
+
+ ho = evas_object_data_get(o, "_elm_access_target");
+
+ return ho;
+}
+
static Eina_Bool
_access_obj_over_timeout_cb(void *data)
{
- Elm_Access_Info *ac = evas_object_data_get(data, "_elm_access");
+ Elm_Access_Info *ac;
+ Evas_Object *ho;
+
+ if (!data) return EINA_FALSE;
+
+ ho = _access_highlight_object_get(data);
+ if (ho == data) return EINA_FALSE;
+
+ ac = evas_object_data_get(data, "_elm_access");
if (!ac) return EINA_FALSE;
+
if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
{
if (ac->on_highlight) ac->on_highlight(ac->on_highlight_data);
static void
_access_obj_mouse_in_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
- Elm_Access_Info *ac = evas_object_data_get(data, "_elm_access");
+ Elm_Access_Info *ac;
+ if (!mouse_event_enable) return;
+
+ ac = evas_object_data_get(data, "_elm_access");
if (!ac) return;
if (ac->delay_timer)
static void
_access_obj_mouse_out_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
- Elm_Access_Info *ac = evas_object_data_get(data, "_elm_access");
+ Elm_Access_Info *ac;
+ if (!mouse_event_enable) return;
+
+ ac = evas_object_data_get(data, "_elm_access");
if (!ac) return;
+
_elm_access_object_unhilight(data);
if (ac->delay_timer)
{
evas_object_resize(o, w, h);
}
-static Evas_Object *
-_access_highlight_object_get(Evas_Object *obj)
+void
+_elm_access_mouse_event_enabled_set(Eina_Bool enabled)
{
- Evas_Object *o, *ho;
+ enabled = !!enabled;
+ if (mouse_event_enable == enabled) return;
+ mouse_event_enable = enabled;
+}
- o = evas_object_name_find(evas_object_evas_get(obj), "_elm_access_disp");
- if (!o) return NULL;
+void
+_elm_access_read_mode_set(Eina_Bool enabled)
+{
+ enabled = !!enabled;
+ if (read_mode == enabled) return;
+ read_mode = enabled;
+}
- ho = evas_object_data_get(o, "_elm_access_target");
+Eina_Bool
+_elm_access_read_mode_get()
+{
+ return read_mode;
+}
- return ho;
+void
+_elm_access_shutdown()
+{
+ _access_shutdown();
+}
+
+static void
+_access_order_del_cb(void *data,
+ Evas *e __UNUSED__,
+ Evas_Object *obj,
+ void *event_info __UNUSED__)
+{
+ Elm_Widget_Item *item = data;
+
+ item->access_order = eina_list_remove(item->access_order, obj);
}
+void
+_elm_access_widget_item_access_order_set(Elm_Widget_Item *item,
+ Eina_List *objs)
+{
+ Eina_List *l;
+ Evas_Object *o;
+
+ if (!item) return;
+
+ _elm_access_widget_item_access_order_unset(item);
+
+ EINA_LIST_FOREACH(objs, l, o)
+ {
+ evas_object_event_callback_add(o, EVAS_CALLBACK_DEL,
+ _access_order_del_cb, item);
+ }
+
+ item->access_order = objs;
+}
+
+const Eina_List *
+_elm_access_widget_item_access_order_get(const Elm_Widget_Item *item)
+{
+ if (!item) return NULL;
+ return item->access_order;
+}
+
+void
+_elm_access_widget_item_access_order_unset(Elm_Widget_Item *item)
+{
+ Eina_List *l, *l_next;
+ Evas_Object *o;
+
+ if (!item) return;
+
+ EINA_LIST_FOREACH_SAFE(item->access_order, l, l_next, o)
+ {
+ evas_object_event_callback_del_full
+ (o, EVAS_CALLBACK_DEL, _access_order_del_cb, item);
+ item->access_order = eina_list_remove_list(item->access_order, l);
+ }
+}
//-------------------------------------------------------------------------//
EAPI void
_elm_access_highlight_set(Evas_Object* obj)
}
EAPI void
-_elm_access_callback_set(Elm_Access_Info *ac, int type, Elm_Access_Content_Cb func, const void *data)
+_elm_access_callback_set(Elm_Access_Info *ac, int type, Elm_Access_Info_Cb func, const void *data)
{
Elm_Access_Item *ai = _access_add_set(ac, type);
if (!ai) return;
_elm_access_highlight_object_activate(Evas_Object *obj, Elm_Activate act)
{
Evas_Object *highlight;
- Elm_Access_Info *ac;
highlight = _access_highlight_object_get(obj);
if (!highlight) return;
- if (elm_widget_is(highlight))
- {
- elm_widget_activate(highlight, act);
- return;
- }
+ _elm_access_read_mode_set(EINA_FALSE);
- ac = evas_object_data_get(highlight, "_elm_access");
- if (!ac) return;
+ if (!elm_object_focus_get(highlight))
+ elm_object_focus_set(highlight, EINA_TRUE);
- if (ac->activate)
- ac->activate(ac->activate_data, highlight,
- (Elm_Object_Item *)ac->widget_item);
+ elm_widget_activate(highlight, act);
+ return;
}
EAPI void
_elm_access_highlight_cycle(Evas_Object *obj, Elm_Focus_Direction dir)
{
- Evas_Object *highlight, *focused;
-
- highlight = _access_highlight_object_get(obj);
- focused = elm_widget_focused_object_get(obj);
+ Evas_Object *ho;
+ ho = _access_highlight_object_get(obj);
+ if (!ho) return;
- if (highlight && (highlight != focused))
- elm_object_focus_set(highlight, EINA_TRUE);
+ /* find highlight root */
+ do
+ {
+ ELM_WIDGET_DATA_GET(ho, sd);
+ if (sd->highlight_root)
+ {
+ /* change highlight root */
+ obj = ho;
+ break;
+ }
+ ho = elm_widget_parent_get(ho);
+ }
+ while (ho);
- /* use focus cycle to read next, previous object */
+ _elm_access_read_mode_set(EINA_TRUE);
elm_widget_focus_cycle(obj, dir);
+ _elm_access_read_mode_set(EINA_FALSE);
}
EAPI char *
-_elm_access_text_get(const Elm_Access_Info *ac, int type, Evas_Object *obj)
+_elm_access_text_get(const Elm_Access_Info *ac, int type, const Evas_Object *obj)
{
Elm_Access_Item *ai;
Eina_List *l;
{
if (ai->type == type)
{
- if (ai->func) return ai->func((void *)(ai->data), obj);
+ if (ai->func) return ai->func((void *)(ai->data), (Evas_Object *)obj);
else if (ai->data) return strdup(ai->data);
return NULL;
}
}
EAPI void
-_elm_access_read(Elm_Access_Info *ac, int type, Evas_Object *obj)
+_elm_access_read(Elm_Access_Info *ac, int type, const Evas_Object *obj)
{
char *txt = _elm_access_text_get(ac, type, obj);
+ if (txt && strlen(txt) == 0) return; /* Tizen only: TTS engine does not work properly */
+
_access_init();
if (mapi)
{
}
else
{
- if (txt)
- {
- if (mapi->out_read) mapi->out_read(txt);
- if (mapi->out_read) mapi->out_read(".\n");
- }
+ if (txt && mapi->out_read) mapi->out_read(txt);
}
}
if (txt) free(txt);
EAPI void
_elm_access_say(const char *txt)
{
+ if (!_elm_config->access_mode) return;
+
+ if (txt && strlen(txt) == 0) return; /* Tizen only: TTS engine does not work properly */
+
_access_init();
if (mapi)
{
EAPI void
_elm_access_object_hilight(Evas_Object *obj)
{
- Evas_Object *o, *parent_obj;
+ Evas_Object *o;
Evas_Coord x, y, w, h;
o = evas_object_name_find(evas_object_evas_get(obj), "_elm_access_disp");
if (ptarget)
{
evas_object_data_del(o, "_elm_access_target");
+ elm_widget_parent_highlight_set(ptarget, EINA_FALSE);
+
evas_object_event_callback_del_full(ptarget, EVAS_CALLBACK_DEL,
_access_obj_hilight_del_cb, NULL);
evas_object_event_callback_del_full(ptarget, EVAS_CALLBACK_HIDE,
}
}
evas_object_data_set(o, "_elm_access_target", obj);
+ elm_widget_parent_highlight_set(obj, EINA_TRUE);
- parent_obj = obj;
- if (!elm_widget_is(obj))
- parent_obj = evas_object_data_get(obj, "_elm_access_parent");
-
- elm_widget_theme_object_set(parent_obj, o, "access", "base", "default");
+ elm_widget_theme_object_set(obj, o, "access", "base", "default");
evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
_access_obj_hilight_del_cb, NULL);
evas_object_event_callback_del_full(ptarget, EVAS_CALLBACK_RESIZE,
_access_obj_hilight_resize_cb, NULL);
evas_object_del(o);
+ elm_widget_parent_highlight_set(ptarget, EINA_FALSE);
}
}
evas_object_move(accessobj, x, y);
}
-static char *
-_part_access_info_cb(void *data, Evas_Object *obj)
+static Evas_Object *
+_access_object_register(Evas_Object *obj, Evas_Object *parent)
{
- Evas_Object *eobj = data;
- if (!eobj) return NULL;
+ Evas_Object *ao;
+ Elm_Access_Info *ac;
+ Evas_Coord x, y, w, h;
- const char *part = evas_object_data_get(obj, "_elm_access_part");
- const char *txt = edje_object_part_text_get(eobj, part);
- if (txt) return strdup(txt);
- return NULL;
+ if (!obj) return NULL;
+
+ /* create access object */
+ ao = _elm_access_add(parent);
+ if (!ao) return NULL;
+
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE,
+ _content_resize, ao);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE,
+ _content_move, ao);
+
+ evas_object_geometry_get(obj, &x, &y, &w, &h);
+ evas_object_move(ao, x, y);
+ evas_object_resize(ao, w, h);
+ evas_object_show(ao);
+
+ /* register access object */
+ _elm_access_object_register(ao, obj);
+
+ /* set access object */
+ evas_object_data_set(obj, "_part_access_obj", ao);
+
+ /* set owner part object */
+ ac = evas_object_data_get(ao, "_elm_access");
+ ac->part_object = obj;
+
+ return ao;
}
static void
-_access_obj_del(void *data __UNUSED__, Evas *e __UNUSED__,
- Evas_Object *obj, void *event_info __UNUSED__)
+_access_object_unregister(Evas_Object *obj)
{
- char *part = evas_object_data_get(obj, "_elm_access_part");
- evas_object_data_del(obj, "_elm_access_part");
- if (part) free(part);
+ Elm_Access_Info *ac;
+ Evas_Object *ao;
+
+ if (!obj) return;
+
+ ao = evas_object_data_get(obj, "_part_access_obj");
+
+ if (ao)
+ {
+ evas_object_data_del(obj, "_part_access_obj");
+
+ /* delete callbacks */
+ evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE,
+ _content_resize, ao);
+ evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOVE,
+ _content_move, ao);
+
+ /* unregister access object */
+ _elm_access_object_unregister(ao, obj);
+
+ evas_object_del(ao);
+ }
+ else
+ {
+ /* button, check, label etc. */
+ ac = evas_object_data_get(obj, "_elm_access");
+ if (ac && ac->hoverobj)
+ _elm_access_object_unregister(obj, ac->hoverobj);
+ }
}
EAPI Evas_Object *
const Evas_Object *eobj,
const char* part)
{
- Evas_Object *ao;
- Evas_Object *po = (Evas_Object *)edje_object_part_object_get(eobj, part);
- Evas_Coord x, y, w, h;
- Elm_Access_Info *ac;
+ Evas_Object *ao, *po;
+ po = (Evas_Object *)edje_object_part_object_get(eobj, part);
if (!obj || !po) return NULL;
- // check previous access object
+ /* check previous access object */
ao = evas_object_data_get(po, "_part_access_obj");
if (ao)
_elm_access_edje_object_part_object_unregister(obj, eobj, part);
- // create access object
- ao = _elm_access_add(obj);
- if (!ao) return NULL;
-
- evas_object_event_callback_add(po, EVAS_CALLBACK_RESIZE,
- _content_resize, ao);
- evas_object_event_callback_add(po, EVAS_CALLBACK_MOVE,
- _content_move, ao);
-
- evas_object_geometry_get(po, &x, &y, &w, &h);
- evas_object_move(ao, x, y);
- evas_object_resize(ao, w, h);
- evas_object_show(ao);
-
- // register access object
- _elm_access_object_register(ao, po);
- _elm_access_text_set(_elm_access_object_get(ao),
- ELM_ACCESS_TYPE, evas_object_type_get(po));
- evas_object_data_set(ao, "_elm_access_part", strdup(part));
- evas_object_event_callback_add(ao, EVAS_CALLBACK_DEL,
- _access_obj_del, NULL);
- _elm_access_callback_set(_elm_access_object_get(ao),
- ELM_ACCESS_INFO,
- _part_access_info_cb, eobj);
-
- // set access object
- evas_object_data_set(po, "_part_access_obj", ao);
-
- /* set owner part object */
- ac = evas_object_data_get(ao, "_elm_access");
- ac->part_object = po;
+ ao = _access_object_register(po, obj);
return ao;
}
+//FIXME: unused obj should be removed from here and each widget.
EAPI void
-_elm_access_edje_object_part_object_unregister(Evas_Object* obj,
+_elm_access_edje_object_part_object_unregister(Evas_Object* obj __UNUSED__,
const Evas_Object *eobj,
const char* part)
{
- Evas_Object *ao;
- Evas_Object *po = (Evas_Object *)edje_object_part_object_get(eobj, part);
-
- if (!obj || !po) return;
+ Evas_Object *po;
- ao = evas_object_data_get(po, "_part_access_obj");
- if (!ao) return;
+ po = (Evas_Object *)edje_object_part_object_get(eobj, part);
+ if (!po) return;
- evas_object_data_del(po, "_part_access_obj");
-
- // delete callbacks
- evas_object_event_callback_del_full(po, EVAS_CALLBACK_RESIZE,
- _content_resize, ao);
- evas_object_event_callback_del_full(po, EVAS_CALLBACK_MOVE,
- _content_move, ao);
-
- evas_object_event_callback_del_full(po, EVAS_CALLBACK_MOUSE_IN,
- _access_obj_mouse_in_cb, ao);
- evas_object_event_callback_del_full(po, EVAS_CALLBACK_MOUSE_OUT,
- _access_obj_mouse_out_cb, ao);
- evas_object_event_callback_del_full(po, EVAS_CALLBACK_DEL,
- _access_obj_del_cb, ao);
- evas_object_del(ao);
+ _access_object_unregister(po);
}
EAPI void
_access_obj_hilight_resize_cb, NULL);
}
evas_object_del(o);
+ elm_widget_parent_highlight_set(ptarget, EINA_FALSE);
}
EAPI void
_access_obj_del_cb, obj);
ac = calloc(1, sizeof(Elm_Access_Info));
evas_object_data_set(obj, "_elm_access", ac);
+
+ ac->hoverobj = hoverobj;
}
EAPI void
Evas_Coord x, y, w, h;
Elm_Access_Info *ac;
- if (!item) return;
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
/* check previous access object */
if (item->access_obj)
{
Evas_Object *ho;
- if (!item || !item->access_obj) return;
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+
+ if (!item->access_obj) return;
ho = item->view;
evas_object_event_callback_del_full(ho, EVAS_CALLBACK_RESIZE,
return obj;
}
-EAPI void
-elm_access_text_set(Evas_Object *obj, int type, const char *text)
+EAPI Evas_Object *
+elm_access_object_register(Evas_Object *obj, Evas_Object *parent)
{
- _elm_access_text_set(_elm_access_object_get(obj), type, text);
+ return _access_object_register(obj, parent);
}
-EAPI char *
-elm_access_text_get(Evas_Object *obj, int type)
+EAPI void
+elm_access_object_unregister(Evas_Object *obj)
{
- return _elm_access_text_get(_elm_access_object_get(obj), type, obj);
+ _access_object_unregister(obj);
}
-EAPI void
-elm_access_object_register(Evas_Object *parent, Evas_Object *target)
+EAPI Evas_Object *
+elm_access_object_get(const Evas_Object *obj)
{
- Elm_Access_Info *ai;
-
- if (!parent || !target) return;
-
- evas_object_event_callback_add(target, EVAS_CALLBACK_MOUSE_IN,
- _access_obj_mouse_in_cb, target);
- evas_object_event_callback_add(target, EVAS_CALLBACK_MOUSE_OUT,
- _access_obj_mouse_out_cb, target);
- evas_object_event_callback_add(target, EVAS_CALLBACK_DEL,
- _access_obj_del_cb, target);
- ai = calloc(1, sizeof(Elm_Access_Info));
- evas_object_data_set(target, "_elm_access", ai);
-
- //TODO: evas_object_data_del(); parent should take care of children.
- evas_object_data_set(target, "_elm_access_parent", parent);
+ return evas_object_data_get(obj, "_part_access_obj");
}
EAPI void
-elm_access_object_unregister(Evas_Object *obj)
+elm_access_info_set(Evas_Object *obj, int type, const char *text)
{
- Elm_Access_Info *ac;
-
- evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOUSE_IN,
- _access_obj_mouse_in_cb, obj);
- evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOUSE_OUT,
- _access_obj_mouse_out_cb, obj);
- evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL,
- _access_obj_del_cb, obj);
-
- ac = evas_object_data_get(obj, "_elm_access");
- evas_object_data_del(obj, "_elm_access");
- if (ac)
- {
- _elm_access_clear(ac);
- free(ac);
- }
+ _elm_access_text_set(_elm_access_object_get(obj), type, text);
+}
- evas_object_data_del(obj, "_elm_access_parent");
+EAPI char *
+elm_access_info_get(const Evas_Object *obj, int type)
+{
+ return _elm_access_text_get(_elm_access_object_get(obj), type, obj);
}
EAPI void
-elm_access_content_cb_set(Evas_Object *obj, int type,
- Elm_Access_Content_Cb func, const void *data)
+elm_access_info_cb_set(Evas_Object *obj, int type,
+ Elm_Access_Info_Cb func, const void *data)
{
_elm_access_callback_set(_elm_access_object_get(obj), type, func, data);
}
EAPI void
elm_access_activate_cb_set(Evas_Object *obj,
- Elm_Access_Activate_Cb func, void *data)
+ Elm_Access_Activate_Cb func, void *data)
{
Elm_Access_Info *ac;
}
EAPI void
+elm_access_say(const char *text)
+{
+ if (!text) return;
+
+ _elm_access_say(text);
+}
+
+EAPI void
+elm_access_highlight_set(Evas_Object* obj)
+{
+ _access_obj_over_timeout_cb(obj);
+}
+
+EAPI void
elm_access_external_info_set(Evas_Object *obj, const char *text)
{
_elm_access_text_set
Elm_Access_Info *ac;
ac = _elm_access_object_get(obj);
- return _elm_access_text_get(ac, ELM_ACCESS_CONTEXT_INFO, (Evas_Object *)obj);
+ return _elm_access_text_get(ac, ELM_ACCESS_CONTEXT_INFO, obj);
}
* then read state out */
#define ELM_ACCESS_CONTEXT_INFO 3 /* to give contextual information */
-typedef char *(*Elm_Access_Content_Cb)(void *data, Evas_Object *obj);
+typedef char *(*Elm_Access_Info_Cb)(void *data, Evas_Object *obj);
typedef void (*Elm_Access_Activate_Cb)(void *data, Evas_Object *part_obj, Elm_Object_Item *item);
/**
* @brief Register evas object as an accessible object.
* @since 1.8
*
- * @param parent Accessibility parent object. this should be one of widget.
- * @param target Evas object to register as an accessible object.
+ * @param obj The evas object to register as an accessible object.
+ * @param parent The elementary object which is used for creating
+ * accessible object.
*
* @ingroup Access
*/
-EAPI void elm_access_object_register(Evas_Object *parent, Evas_Object *target);
+EAPI Evas_Object *elm_access_object_register(Evas_Object *obj, Evas_Object *parent);
/**
* @brief Unregister accessible object.
* @since 1.8
*
- * @param obj Accessible object.
+ * @param obj The Evas object to unregister accessible object.
*
* @ingroup Access
*/
-EAPI void elm_access_object_unregister(Evas_Object *target);
+EAPI void elm_access_object_unregister(Evas_Object *obj);
+
+/**
+ * @brief Get an accessible object of the evas object.
+ * @since 1.8
+ *
+ * @param obj The evas object.
+ * @return Accessible object of the evas object or NULL for any error
+ *
+ * @ingroup Access
+ */
+EAPI Evas_Object *elm_access_object_get(const Evas_Object *obj);
/**
* @brief Set text to give information for specific type.
* @param type The type of content that will be read
* @param text The text information that will be read
*
- * @see elm_access_content_cb_set
+ * @see elm_access_info_cb_set
* @ingroup Access
*/
-EAPI void elm_access_text_set(Evas_Object *obj, int type, const char *text);
+EAPI void elm_access_info_set(Evas_Object *obj, int type, const char *text);
/**
* @brief Set text to give information for specific type.
* @param obj Accessible object.
* @param type The type of content that will be read
*
- * @see elm_access_content_cb_set
+ * @see elm_access_info_cb_set
* @ingroup Access
*/
-EAPI char * elm_access_text_get(Evas_Object *obj, int type);
+EAPI char *elm_access_info_get(const Evas_Object *obj, int type);
/**
* @brief Set content callback to give information for specific type.
* In the case of button widget, the content of ELM_ACCESS_TYPE would be
* "button". The label of button such as "ok", "cancel" is for ELM_ACCESS_INFO.
* If the button is disabled, content of ELM_ACCESS_STATE would be "disabled".
- * And if there is contextual information, ELM_ACCESS_CONTEXT_INFO is used.
+ * And if there is contextual information, use ELM_ACCESS_CONTEXT_INFO.
*
* @ingroup Access
*/
-EAPI void elm_access_content_cb_set(Evas_Object *obj, int type, Elm_Access_Content_Cb func, const void *data);
+EAPI void elm_access_info_cb_set(Evas_Object *obj, int type, Elm_Access_Info_Cb func, const void *data);
/**
* @brief Set activate callback to activate highlight object.
*/
EAPI void elm_access_activate_cb_set(Evas_Object *obj, Elm_Access_Activate_Cb func, void *data);
+/**
+ * @brief Read out text information directly.
+ * @since 1.8
+ *
+ * @param text The text information that will be read
+ *
+ * This function will not free the @p text internally.
+ *
+ * @ingroup Access
+ */
+EAPI void elm_access_say(const char *text);
+
+/**
+ * @brief Give the highlight to the object directly.
+ * @since 1.8
+ *
+ * @param obj The object that will have the highlight and its information be read.
+ *
+ * The object should be an elementary object or an access object.
+ *
+ * @see elm_access_object_get
+ * @ingroup Access
+ */
+EAPI void elm_access_highlight_set(Evas_Object* obj);
+
//TODO: remvoe below - use elm_access_text_set(); or elm_access_cb_set();
EINA_DEPRECATED EAPI void elm_access_external_info_set(Evas_Object *obj, const char *text);
-EINA_DEPRECATED EAPI char * elm_access_external_info_get(const Evas_Object *obj);
+EINA_DEPRECATED EAPI char *elm_access_external_info_get(const Evas_Object *obj);
{
if (act != ELM_ACTIVATE_DEFAULT) return EINA_FALSE;
- evas_object_smart_callback_call(obj, SIG_CLICKED, NULL);
- elm_layout_signal_emit(obj, "elm,anim,activate", "elm");
+ if (!elm_widget_disabled_get(obj) &&
+ !evas_object_freeze_events_get(obj))
+ {
+ evas_object_smart_callback_call(obj, SIG_CLICKED, NULL);
+ elm_layout_signal_emit(obj, "elm,anim,activate", "elm");
+ }
return EINA_TRUE;
}
#include "elm_priv.h"
#include "elm_widget_check.h"
+#define _TIZEN_
+
EAPI const char ELM_CHECK_SMART_NAME[] = "elm_check";
static const Elm_Layout_Part_Alias_Description _content_aliases[] =
_activate(data);
}
+#ifdef _TIZEN_
+static void _check_drag_start(void *data,
+ Evas_Object *o __UNUSED__,
+ const char *emission __UNUSED__,
+ const char *source __UNUSED__)
+{
+ Evas_Object *obj = data;
+
+ elm_widget_scroll_freeze_push(obj);
+}
+
+static void _check_drag_stop(void *data,
+ Evas_Object *o __UNUSED__,
+ const char *emission __UNUSED__,
+ const char *source __UNUSED__)
+{
+ Evas_Object *obj = data;
+
+ elm_widget_scroll_freeze_pop(obj);
+}
+#endif
+
static void
_elm_check_smart_add(Evas_Object *obj)
{
(ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,check,toggle", "",
_on_check_toggle, obj);
+ #ifdef _TIZEN_
+ edje_object_signal_callback_add
+ (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,check,drag,start", "",
+ _check_drag_start, obj);
+ edje_object_signal_callback_add
+ (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,check,drag,stop", "",
+ _check_drag_stop, obj);
+ #endif
+
_elm_access_object_register(obj, ELM_WIDGET_DATA(priv)->resize_obj);
_elm_access_text_set
(_elm_access_object_get(obj), ELM_ACCESS_TYPE, E_("Check"));
elm_layout_sizing_eval(obj);
}
+#ifdef _TIZEN_
+static void
+_elm_check_smart_del(Evas_Object *obj)
+{
+
+ if (0 != elm_widget_scroll_freeze_get(obj))
+ elm_widget_scroll_freeze_pop(obj);
+
+ ELM_WIDGET_CLASS(_elm_check_parent_sc)->base.del(obj);
+}
+#endif
+
static void
_elm_check_smart_set_user(Elm_Check_Smart_Class *sc)
{
ELM_WIDGET_CLASS(sc)->base.add = _elm_check_smart_add;
+ #ifdef _TIZEN_
+ ELM_WIDGET_CLASS(sc)->base.del = _elm_check_smart_del;
+ #endif
+
ELM_WIDGET_CLASS(sc)->theme = _elm_check_smart_theme;
ELM_WIDGET_CLASS(sc)->event = _elm_check_smart_event;
ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_check_smart_sub_object_del;
else
sd->statep = NULL;
}
+
+#undef _TIZEN_
static Eina_Bool _x11_general_converter (char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize);
static Eina_Bool _x11_image_converter (char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize);
static Eina_Bool _x11_vcard_send (char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize);
-static Eina_Bool _x11_is_uri_type_data (X11_Cnp_Selection *sel __UNUSED__, Ecore_X_Event_Selection_Notify *notify);
+//TIZEN ONLY : static Eina_Bool _x11_is_uri_type_data (X11_Cnp_Selection *sel __UNUSED__, Ecore_X_Event_Selection_Notify *notify);
static int _x11_response_handler_targets (X11_Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *);
static int _x11_notify_handler_targets (X11_Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify);
static int _x11_notify_handler_text (X11_Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify);
ELM_CONFIG_VAL(D, T, vsync, T_UCHAR);
ELM_CONFIG_VAL(D, T, thumbscroll_enable, T_UCHAR);
ELM_CONFIG_VAL(D, T, thumbscroll_threshold, T_INT);
+ ELM_CONFIG_VAL(D, T, thumbscroll_hold_threshold, T_INT);
ELM_CONFIG_VAL(D, T, thumbscroll_momentum_threshold, T_DOUBLE);
ELM_CONFIG_VAL(D, T, thumbscroll_friction, T_DOUBLE);
ELM_CONFIG_VAL(D, T, thumbscroll_bounce_friction, T_DOUBLE);
if (_elm_config->access_mode == is_access) return;
_elm_config->access_mode = is_access;
_elm_win_access(is_access);
+
+ if (!is_access) _elm_access_shutdown();
}
Eina_Bool _elm_config_selection_unfocused_clear_get(void)
_elm_config->vsync = 0;
_elm_config->thumbscroll_enable = EINA_TRUE;
_elm_config->thumbscroll_threshold = 24;
+ _elm_config->thumbscroll_hold_threshold = 24;
_elm_config->thumbscroll_momentum_threshold = 100.0;
_elm_config->thumbscroll_friction = 1.0;
_elm_config->thumbscroll_bounce_friction = 0.5;
if (s) _elm_config->thumbscroll_enable = !!atoi(s);
s = getenv("ELM_THUMBSCROLL_THRESHOLD");
if (s) _elm_config->thumbscroll_threshold = atoi(s);
+ s = getenv("ELM_THUMBSCROLL_HOLD_THRESHOLD");
+ if (s) _elm_config->thumbscroll_hold_threshold = atoi(s);
// FIXME: floatformat locale issues here 1.0 vs 1,0 - should just be 1.0
s = getenv("ELM_THUMBSCROLL_MOMENTUM_THRESHOLD");
if (s) _elm_config->thumbscroll_momentum_threshold = _elm_atof(s);
_elm_config->thumbscroll_threshold = threshold;
}
+EAPI unsigned int
+elm_config_scroll_thumbscroll_hold_threshold_get(void)
+{
+ return _elm_config->thumbscroll_hold_threshold;
+}
+
+EAPI void
+elm_config_scroll_thumbscroll_hold_threshold_set(unsigned int threshold)
+{
+ _elm_config->thumbscroll_hold_threshold = threshold;
+}
+
EAPI double
elm_config_scroll_thumbscroll_momentum_threshold_get(void)
{
EAPI void elm_config_scroll_thumbscroll_threshold_set(unsigned int threshold);
/**
+ * Get the number of pixels the range which can be scrolled,
+ * while the scroller is holded.
+ *
+ * @return the thumb scroll hold threshold
+ *
+ * @ingroup Scrolling
+ */
+EAPI unsigned int elm_config_scroll_thumbscroll_hold_threshold_get(void);
+
+/**
+ * Set the number of pixels the range which can be scrolled,
+ * while the scroller is holded.
+ *
+ * @param threshold the thumb scroll hold threshold
+ *
+ * @see elm_config_thumbscroll_hold_threshold_get()
+ * @ingroup Scrolling
+ */
+EAPI void elm_config_scroll_thumbscroll_hold_threshold_set(unsigned int threshold);
+
+/**
* Get the minimum speed of mouse cursor movement which will trigger
* list self scrolling animation after a mouse up event
* (pixels/second).
#ifdef HAVE_ELEMENTARY_X
Ecore_X_Window zone = 0;
Evas_Object *top;
+ Ecore_X_Window xwin;
#endif
int sx = -1, sy = -1, sw = -1, sh = -1;
- Ecore_X_Window xwin;
ELM_CONFORMANT_DATA_GET(obj, sd);
{
#ifdef HAVE_ELEMENTARY_X
//No information of the keyboard geometry, reset the geometry.
- if (!ecore_x_e_illume_keyboard_geometry_get
- (zone, &sx, &sy, &sw, &sh))
- sx = sy = sw = sh = 0;
+#ifdef __linux__
+ DBG("[KEYPAD]:pid=%d, xwin=0x%x, zone=0x%x: no env value and check window property.", getpid(), xwin, zone);
+#endif
+ if (!ecore_x_e_illume_keyboard_geometry_get(xwin, &sx, &sy, &sw, &sh))
+ {
+ DBG("[KEYPAD]:no window property, check zone property.");
+ if (!ecore_x_e_illume_keyboard_geometry_get(zone, &sx, &sy, &sw, &sh))
+ {
+ DBG("[KEYPAD]:no zone property, reset value.");
+ sx = sy = sw = sh = 0;
+ }
+ }
#else
;
#endif
}
+ DBG("[KEYPAD]: size(%d,%d, %dx%d).", sx, sy, sw, sh);
_conformant_part_size_hints_set
(obj, sd->virtualkeypad, sx, sy, sw, sh);
}
}
}
+static const char PLUG_KEY[] = "__Plug_Ecore_Evas";
+// procotol version - change this as needed
+#define MSG_DOMAIN_CONTROL_INDICATOR 0x10001
+#define MSG_ID_INDICATOR_REPEAT_EVENT 0x10002
+#define MSG_ID_INDICATOR_ROTATION 0x10003
+#define MSG_ID_INDICATOR_OPACITY 0X1004
+#define MSG_ID_INDICATOR_TYPE 0X1005
+
+static void
+_plug_msg_handle(Ecore_Evas *ee, int msg_domain, int msg_id, void *data, int size)
+{
+ Evas_Object *conformant;
+
+ if (!data) return;
+ DBG("Receive msg from plug ee=%p msg_domain=%x msg_id=%x size=%d", ee, msg_domain, msg_id, size);
+ //get plug object form ee
+ conformant = (Evas_Object *)ecore_evas_data_get(ee, CONFORMANT_KEY);
+ ELM_CONFORMANT_DATA_GET(conformant, sd);
+ if (msg_domain == MSG_DOMAIN_CONTROL_INDICATOR)
+ {
+ if (msg_id == MSG_ID_INDICATOR_REPEAT_EVENT)
+ {
+ int *repeat = data;
+ DBG("Receive repeat event change message:(%d)", *repeat);
+ }
+ if (msg_id == MSG_ID_INDICATOR_TYPE)
+ {
+ Elm_Win_Indicator_Type_Mode *indi_t_mode = data;
+ Evas_Object *win = elm_widget_top_get(conformant);
+ DBG("Receive indicator type change message:(%d)", *indi_t_mode);
+ elm_win_indicator_type_set(win, *indi_t_mode);
+ }
+ }
+}
+
static Evas_Object *
_create_portrait_indicator(Evas_Object *obj)
{
Evas_Object *port_indicator = NULL;
+ Ecore_Evas *indicator_ee = NULL;
const char *port_indicator_serv_name;
ELM_CONFORMANT_DATA_GET(obj, sd);
return NULL;
}
+ //callback to deal with extn socket message
+ indicator_ee = ecore_evas_object_ecore_evas_get(elm_plug_image_object_get(port_indicator));
+ DBG("This is portrait indicator's ee=%p.", indicator_ee);
+ ecore_evas_callback_msg_handle_set(indicator_ee, _plug_msg_handle);
+ ecore_evas_data_set(indicator_ee, CONFORMANT_KEY, obj);
+
+ DBG("The rotation value of portrait indicator was changed:(%d)", sd->rot);
+ ecore_evas_msg_parent_send(indicator_ee, MSG_DOMAIN_CONTROL_INDICATOR, MSG_ID_INDICATOR_ROTATION, &(sd->rot), sizeof(int));
+
elm_widget_sub_object_add(obj, port_indicator);
evas_object_smart_callback_add(port_indicator, "image.deleted", _port_indicator_disconnected, obj);
static Evas_Object *
_create_landscape_indicator(Evas_Object *obj)
{
+ Ecore_Evas *indicator_ee = NULL;
Evas_Object *land_indicator = NULL;
const char *land_indicator_serv_name;
return NULL;
}
+ //callback to deal with extn socket message
+ indicator_ee = ecore_evas_object_ecore_evas_get(elm_plug_image_object_get(land_indicator));
+ ecore_evas_data_set(indicator_ee, CONFORMANT_KEY, obj);
+ DBG("This is landscape indicator's ee=%p.", indicator_ee);
+ ecore_evas_callback_msg_handle_set(indicator_ee, _plug_msg_handle);
+ DBG("The rotation value of landscape indicator was changed:(%d)", sd->rot);
+ ecore_evas_msg_parent_send(indicator_ee, MSG_DOMAIN_CONTROL_INDICATOR, MSG_ID_INDICATOR_ROTATION, &(sd->rot), sizeof(int));
+
elm_widget_sub_object_add(obj, land_indicator);
evas_object_smart_callback_add(land_indicator, "image.deleted",_land_indicator_disconnected, obj);
ELM_CONFORMANT_DATA_GET(conformant, sd);
sd->ind_o_mode = ind_o_mode;
//TODO: opacity change
+ //send indicator information
+ if (sd->landscape_indicator)
+ {
+ Ecore_Evas *indicator_ee = NULL;
+ DBG("The opacity mode of landscape indicator was changed:(%d)", ind_o_mode);
+ indicator_ee = ecore_evas_object_ecore_evas_get(elm_plug_image_object_get(sd->landscape_indicator));
+ ecore_evas_msg_parent_send(indicator_ee, MSG_DOMAIN_CONTROL_INDICATOR, MSG_ID_INDICATOR_OPACITY, &(sd->ind_o_mode), sizeof(Elm_Win_Indicator_Opacity_Mode));
+ }
+ if (sd->portrait_indicator)
+ {
+ Ecore_Evas *indicator_ee = NULL;
+ DBG("The opacity mode of portrait indicator was changed:(%d)", ind_o_mode);
+ indicator_ee = ecore_evas_object_ecore_evas_get(elm_plug_image_object_get(sd->portrait_indicator));
+ ecore_evas_msg_parent_send(indicator_ee, MSG_DOMAIN_CONTROL_INDICATOR, MSG_ID_INDICATOR_OPACITY, &(sd->ind_o_mode), sizeof(Elm_Win_Indicator_Opacity_Mode));
+ }
}
static void
indmode = elm_win_indicator_mode_get(win);
ind_o_mode = elm_win_indicator_opacity_get(win);
- if (indmode == sd->indmode)
- {
- if (ind_o_mode == sd->ind_o_mode) return;
- else _indicator_opacity_set(conformant, ind_o_mode);
- }
- else
+ if (indmode != sd->indmode)
_indicator_mode_set(conformant, indmode);
-
+ if (ind_o_mode != sd->ind_o_mode)
+ _indicator_opacity_set(conformant, ind_o_mode);
}
static void
if (rot == sd->rot) return;
sd->rot = rot;
+ //send indicator information
+ if (sd->landscape_indicator)
+ {
+ Ecore_Evas *indicator_ee = NULL;
+ DBG("The rotation value of landscape indicator was changed:(%d)", rot);
+ indicator_ee = ecore_evas_object_ecore_evas_get(elm_plug_image_object_get(sd->landscape_indicator));
+ ecore_evas_msg_parent_send(indicator_ee, MSG_DOMAIN_CONTROL_INDICATOR, MSG_ID_INDICATOR_ROTATION, &(sd->rot), sizeof(int));
+ }
+ if (sd->portrait_indicator)
+ {
+ Ecore_Evas *indicator_ee = NULL;
+ DBG("The rotation value of portrait indicator was changed:(%d)", rot);
+ indicator_ee = ecore_evas_object_ecore_evas_get(elm_plug_image_object_get(sd->portrait_indicator));
+ ecore_evas_msg_parent_send(indicator_ee, MSG_DOMAIN_CONTROL_INDICATOR, MSG_ID_INDICATOR_ROTATION, &(sd->rot), sizeof(int));
+ }
old_indi = elm_layout_content_unset(conformant, INDICATOR_PART);
/* this means ELM_WIN_INDICATOR_SHOW never be set.we don't need to change indicator type*/
if (!old_indi) return;
Ecore_X_Window zone = ecore_x_e_illume_zone_get(ev->win);
Ecore_X_Virtual_Keyboard_State state =
- ecore_x_e_virtual_keyboard_state_get(zone);
+ ecore_x_e_virtual_keyboard_state_get(ev->win);
+
+ DBG("[KEYPAD]:window's state win=0x%x, state=%d.", ev->win, state);
+ if (state == ECORE_X_VIRTUAL_KEYBOARD_STATE_UNKNOWN)
+ {
+ state = ecore_x_e_virtual_keyboard_state_get(zone);
+ DBG("[KEYPAD]:zone's state zone=0x%x, state=%d.", zone, state);
+ }
if (sd->vkb_state == state) return;
sd->vkb_state = state;
if (state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
{
- evas_object_size_hint_min_set(sd->virtualkeypad, -1, 0);
- evas_object_size_hint_max_set(sd->virtualkeypad, -1, 0);
+ DBG("[KEYPAD]:ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF");
+ _conformant_part_sizing_eval(obj, ELM_CONFORMANT_VIRTUAL_KEYPAD_PART);
// Tizen Only - SIP regions for virtual keypad and clipboard are the same in Tizen
if (sd->clipboard_state == ECORE_X_ILLUME_CLIPBOARD_STATE_OFF)
elm_widget_display_mode_set(obj, EVAS_DISPLAY_MODE_NONE);
}
else if (state == ECORE_X_VIRTUAL_KEYBOARD_STATE_ON)
{
+ DBG("[KEYPAD]:ECORE_X_VIRTUAL_KEYBOARD_STATE_ON");
+ _conformant_part_sizing_eval(obj, ELM_CONFORMANT_VIRTUAL_KEYPAD_PART);
elm_widget_display_mode_set(obj, EVAS_DISPLAY_MODE_COMPRESS);
_autoscroll_objects_update(obj);
evas_object_smart_callback_call(obj, SIG_VIRTUALKEYPAD_STATE_ON, NULL);
Ecore_X_Window zone = ecore_x_e_illume_zone_get(ev->win);
Ecore_X_Illume_Clipboard_State state =
- ecore_x_e_illume_clipboard_state_get(zone);
+ ecore_x_e_illume_clipboard_state_get(ev->win);
+
+ DBG("[CLIPBOARD]:window's state win=0x%x, state=%d.", ev->win, state);
+
+ if (state == ECORE_X_ILLUME_CLIPBOARD_STATE_UNKNOWN)
+ {
+ state = ecore_x_e_illume_clipboard_state_get(ev->win);
+ DBG("[CLIPBOARD]:zone's state zone=0x%x, state=%d.", zone, state);
+ }
if (sd->clipboard_state == state) return;
sd->clipboard_state = state;
{
Ecore_X_Event_Window_Property *ev = event;
+ int pid = 0;
+
+#ifdef __linux__
+ pid = (int)getpid();
+#endif
+
if (ev->atom == ECORE_X_ATOM_E_ILLUME_ZONE)
{
+ DBG("pid=%d, win=0x%x, ECORE_X_ATOM_E_ILLUME_ZONE.\n", pid, ev->win);
Conformant_Part_Type part_type;
part_type = (ELM_CONFORMANT_INDICATOR_PART |
_conformant_part_sizing_eval(data, part_type);
}
else if (ev->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY)
- _conformant_part_sizing_eval(data, ELM_CONFORMANT_INDICATOR_PART);
+ {
+ DBG("pid=%d, win=0x%x, ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY.", pid, ev->win);
+ _conformant_part_sizing_eval(data, ELM_CONFORMANT_INDICATOR_PART);
+ }
else if (ev->atom == ECORE_X_ATOM_E_ILLUME_SOFTKEY_GEOMETRY)
- _conformant_part_sizing_eval(data, ELM_CONFORMANT_SOFTKEY_PART);
+ {
+ DBG("pid=%d, win=0x%x, ECORE_X_ATOM_E_ILLUME_SOFTKEY_GEOMETRY.", pid, ev->win);
+ _conformant_part_sizing_eval(data, ELM_CONFORMANT_SOFTKEY_PART);
+ }
else if (ev->atom == ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY)
- _conformant_part_sizing_eval(data, ELM_CONFORMANT_VIRTUAL_KEYPAD_PART);
+ {
+ DBG("[KEYPAD]:pid=%d, win=0x%x, ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY.", pid, ev->win);
+ _conformant_part_sizing_eval(data, ELM_CONFORMANT_VIRTUAL_KEYPAD_PART);
+ }
else if (ev->atom == ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY)
- _conformant_part_sizing_eval(data, ELM_CONFORMANT_CLIPBOARD_PART);
+ {
+ DBG("pid=%d, win=0x%x, ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY.", pid, ev->win);
+ _conformant_part_sizing_eval(data, ELM_CONFORMANT_CLIPBOARD_PART);
+ }
else if (ev->atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE)
- _virtualkeypad_state_change(data, ev);
+ {
+ DBG("[KEYPAD]:pid=%d, win=0x%x, ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE.", pid, ev->win);
+ _virtualkeypad_state_change(data, ev);
+ }
else if (ev->atom == ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE)
- _clipboard_state_change(data, ev);
+ {
+ DBG("pid=%d, win=0x%x, ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE.", pid, ev->win);
+ _clipboard_state_change(data, ev);
+ }
return ECORE_CALLBACK_PASS_ON;
}
elm_layout_signal_emit(obj, buf, "elm");
snprintf
- (buf, sizeof(buf), EDC_PART_SEPARATOR_STR, field->location);
+ (buf, sizeof(buf), EDC_PART_SEPARATOR_STR, (field->location + 1));
elm_layout_text_set(obj, buf, field->separator);
dt_mod->field_value_display(sd->mod_data, field->item_obj);
}
static Eina_Bool
-_xclient_msg_cb(void *data, int type, void *event)
+_xclient_msg_cb(void *data, int type __UNUSED__, void *event)
{
#ifdef HAVE_ELEMENTARY_X
Evas_Object *obj = (Evas_Object *)data;
sd->mgf_bg = edje_object_add(evas_object_evas_get(data));
if (sd->mgf_type == _ENTRY_MAGNIFIER_FIXEDSIZE)
- _elm_theme_object_set(data, sd->mgf_bg, "entry", "magnifier", "fixed-size");
+ _elm_theme_object_set(data, sd->mgf_bg, "entry", "magnifier",
+ "fixed-size");
else if (sd->mgf_type == _ENTRY_MAGNIFIER_FILLWIDTH)
- _elm_theme_object_set(data, sd->mgf_bg, "entry", "magnifier", "fill-width");
+ _elm_theme_object_set(data, sd->mgf_bg, "entry", "magnifier",
+ "fill-width");
else
return;
evas_event_freeze(evas_object_evas_get(obj));
+ // TIZEN ONLY(130129) : Currently, for freezing cursor movement only.
+ edje_object_part_text_freeze(sd->entry_edje, "elm.text");
+ //
+
edje_object_mirrored_set
(ELM_WIDGET_DATA(sd)->resize_obj, elm_widget_mirrored_get(obj));
_mirrored_set(obj, elm_widget_mirrored_get(obj));
- t = eina_stringshare_add(elm_object_text_get(obj));
+ // TIZEN ONLY(130225) : when password mode, elm_object_text_get returns utf8 string.
+ if (sd->password)
+ t = eina_stringshare_add(elm_entry_utf8_to_markup(elm_object_text_get(obj)));
+ else
+ t = eina_stringshare_add(elm_object_text_get(obj));
elm_widget_theme_object_set
(obj, sd->entry_edje, "entry", _elm_entry_theme_group_get(obj),
evas_event_thaw(evas_object_evas_get(obj));
evas_event_thaw_eval(evas_object_evas_get(obj));
+ // TIZEN ONLY(130129) : Currently, for freezing cursor movement only.
+ edje_object_part_text_thaw(sd->entry_edje, "elm.text");
+ //
+
evas_object_smart_callback_call(obj, SIG_THEME_CHANGED, NULL);
return EINA_TRUE;
formats |= ELM_SEL_FORMAT_IMAGE;
elm_cnp_selection_get(data, ELM_SEL_TYPE_SECONDARY, formats, NULL, NULL);
- return ECORE_CALLBACK_DONE;
+ return ECORE_CALLBACK_DONE;
}
///////////
#endif
txt = elm_widget_access_info_get(obj);
- if (!txt) txt = elm_entry_entry_get(obj);
+ if (!txt) txt = _elm_util_mkup_to_text(elm_entry_entry_get(obj));
if (txt) return strdup(txt);
return NULL;
_access_state_cb(void *data __UNUSED__, Evas_Object *obj)
{
Eina_Strbuf *buf;
- char *txt;
+ char *ret;
ELM_ENTRY_DATA_GET(obj, sd);
+ ret = NULL;
buf = eina_strbuf_new();
if (elm_widget_disabled_get(obj))
else eina_strbuf_append(buf, ", Password");
}
- txt = strdup(eina_strbuf_string_get(buf));
- eina_strbuf_free(buf);
- if (txt) return txt;
+ if (!eina_strbuf_length_get(buf)) goto buf_free;
- return NULL;
+ ret = eina_strbuf_string_steal(buf);
+
+buf_free:
+ eina_strbuf_free(buf);
+ return ret;
}
static void
{
Vertex3 vo[4];
+ memset(vo, 0, sizeof (vo));
+
if (b > 0) nn = num + sd->slices_h - row - 1;
else nn = num + row;
}
else
{
- if (sd->front.content)
- evas_object_show(sd->front.clip);
- else
- evas_object_hide(sd->front.clip);
+ evas_object_hide(sd->front.clip);
if (sd->back.content)
evas_object_show(sd->back.clip);
else
Eina_Bool flipped : 1; /**< a flag that shows the flip status of the item. */
};
+typedef enum
+{
+ ELM_GEN_ITEM_FX_TYPE_SAME,
+ ELM_GEN_ITEM_FX_TYPE_ADD,
+ ELM_GEN_ITEM_FX_TYPE_DEL,
+} Elm_Gen_Item_Fx_Type;
+
+typedef struct _Proxy_Item Proxy_Item;
+struct _Proxy_Item
+{
+ int num;
+ Elm_Gen_Item *it;
+ Evas_Object *proxy;
+ Evas_Coord x, y, w, h;
+};
+
+typedef struct _Elm_Gen_FX_Item Elm_Gen_FX_Item;
+struct _Elm_Gen_FX_Item
+{
+ int num;
+ Elm_Gen_Item *it;
+ Evas_Object *proxy;
+ Elm_Gen_Item_Fx_Type type;
+ Elm_Transit *trans;
+
+ struct
+ {
+ Evas_Coord x, y, w, h;
+ } from;
+
+ struct
+ {
+ Evas_Coord x, y, w, h;
+ } to;
+
+ Eina_Bool update : 1;
+};
+
+typedef enum
+{
+ ELM_GEN_PINCH_ZOOM_NONE = 0,
+ ELM_GEN_PINCH_ZOOM_CONTRACT = 1,
+ ELM_GEN_PINCH_ZOOM_EXPAND = 2
+} Elm_Gen_Pinch_Zoom_Mode;
+
#endif
#define PRELOAD 1
#define REORDER_EFFECT_TIME 0.5
+#define FX_MOVE_TIME 0.5
EAPI const char ELM_GENGRID_SMART_NAME[] = "elm_gengrid";
EAPI const char ELM_GENGRID_PAN_SMART_NAME[] = "elm_gengrid_pan";
(ELM_GENGRID_PAN_SMART_NAME, _elm_gengrid_pan, Elm_Gengrid_Pan_Smart_Class,
Elm_Pan_Smart_Class, elm_pan_smart_class_get, NULL);
+#if GENGRID_FX_SUPPORT
+static Eina_Bool _elm_gengrid_fx_capture(Evas_Object *obj, int level);
+static void _elm_gengrid_fx_play(Evas_Object *obj);
+#endif
+
static void
_elm_gengrid_pan_smart_pos_max_get(const Evas_Object *obj,
Evas_Coord *x,
{
Elm_Gengrid_Smart_Data *sd = data;
Evas_Coord cvw, cvh, it_xpos = 0, it_ypos = 0, col = 0, row = 0, minx = 0, miny = 0;
- Elm_Gen_Item *it, *group_item = NULL;
+ Evas_Coord vw = 0, vh = 0;
+ Elm_Gen_Item *it;
evas_object_geometry_get(sd->pan_obj, NULL, NULL, &cvw, &cvh);
it->y = y;
}
+ sd->s_iface->content_viewport_size_get(WIDGET(it), &vw, &vh);
+
if (sd->show_region)
{
sd->s_iface->content_region_show(WIDGET(it),
- it_xpos, it_ypos, sd->item_width,
- sd->item_height);
+ it_xpos, it_ypos, vw, vh);
sd->show_region = EINA_FALSE;
}
if (sd->bring_in)
{
sd->s_iface->region_bring_in(WIDGET(it),
- it_xpos, it_ypos, sd->item_width,
- sd->item_height);
+ it_xpos, it_ypos, vw, vh);
sd->bring_in = EINA_FALSE;
}
}
_calc_job(void *data)
{
Elm_Gengrid_Smart_Data *sd = data;
- Evas_Coord minw = 0, minh = 0, nmax = 0, cvw, cvh, it_xpos = 0, it_ypos = 0, col = 0, row = 0, minx = 0, miny = 0;
+ Evas_Coord minw = 0, minh = 0, nmax = 0, cvw, cvh;
Elm_Gen_Item *it, *group_item = NULL;
int count_group = 0;
long count = 0;
if (!it->realized) return;
if (GG_IT(it)->wsd->reorder_it == it) return;
-
+#if GENGRID_FX_SUPPORT
+ if ((GG_IT(it)->has_proxy_it) && (!GG_IT(it)->wsd->gengrid_clearing))
+ {
+ if (!eina_list_data_find(GG_IT(it)->wsd->pending_unrealized_items, it))
+ GG_IT(it)->wsd->pending_unrealized_items =
+ eina_list_append(GG_IT(it)->wsd->pending_unrealized_items, it);
+ return;
+ }
+#endif
evas_event_freeze(evas_object_evas_get(WIDGET(it)));
if (!calc)
evas_object_smart_callback_call(WIDGET(it), SIG_UNREALIZED, it);
evas_object_size_hint_min_set(it->spacer, 2 * elm_config_scale_get(), 1);
edje_object_part_swallow(VIEW(it), "elm.swallow.pad", it->spacer);
+ /* access */
+ if (_elm_config->access_mode) _access_widget_item_register(it);
+
if (it->itc->func.text_get)
{
const Eina_List *l;
it->realized = EINA_TRUE;
it->want_unrealize = EINA_FALSE;
-
- // ACCESS
- if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
- _access_widget_item_register(it);
}
static Eina_Bool
}
if (!it->group)
{
+
+#if GENGRID_FX_SUPPORT
+ GG_IT(it)->scrl_x = x;
+ GG_IT(it)->scrl_y = y;
+ GG_IT(it)->w = iw;
+ GG_IT(it)->h = ih;
+#endif
evas_object_move(VIEW(it), x, y);
evas_object_resize(VIEW(it), iw, ih);
}
ELM_GENGRID_PAN_DATA_GET(obj, psd);
+#if GENGRID_FX_SUPPORT
+ if (psd->wsd->fx_playing) return;
+#endif
+
if (!psd->wsd->nmax) return;
psd->wsd->reorder_item_changed = EINA_FALSE;
(ELM_WIDGET_DATA(psd->wsd)->obj, SIG_CHANGED, NULL);
if ((psd->wsd->show_region || psd->wsd->bring_in))
_item_show_region(psd->wsd);
+
+#if GENGRID_FX_SUPPORT
+ psd->wsd->rendered = EINA_TRUE;
+ if (psd->wsd->fx_mode)
+ {
+ if (_elm_gengrid_fx_capture(ELM_WIDGET_DATA(psd->wsd)->obj, 1))
+ _elm_gengrid_fx_play(ELM_WIDGET_DATA(psd->wsd)->obj);
+ }
+#endif
}
static void
else return EINA_FALSE;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- sd->s_iface->content_pos_set(obj, x, y);
+ sd->s_iface->content_pos_set(obj, x, y, EINA_TRUE);
return EINA_TRUE;
}
}
static void
-_elm_gengrid_item_del_serious(Elm_Gen_Item *it)
+_elm_gengrid_item_del_common(Elm_Gen_Item *it)
{
_elm_gengrid_item_del_not_serious(it);
+
GG_IT(it)->wsd->items = eina_inlist_remove
- (GG_IT(it)->wsd->items, EINA_INLIST_GET(it));
+ (GG_IT(it)->wsd->items, EINA_INLIST_GET(it));
+
if (it->tooltip.del_cb)
it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it);
GG_IT(it)->wsd->walking -= it->walking;
}
if (it->group)
GG_IT(it)->wsd->group_items =
- eina_list_remove(GG_IT(it)->wsd->group_items, it);
+ eina_list_remove(GG_IT(it)->wsd->group_items, it);
if (GG_IT(it)->wsd->state)
{
}
if (GG_IT(it)->wsd->calc_job) ecore_job_del(GG_IT(it)->wsd->calc_job);
GG_IT(it)->wsd->calc_job =
- ecore_job_add(GG_IT(it)->wsd->calc_cb, GG_IT(it)->wsd);
+ ecore_job_add(GG_IT(it)->wsd->calc_cb, GG_IT(it)->wsd);
if (GG_IT(it)->wsd->last_selected_item == (Elm_Object_Item *)it)
GG_IT(it)->wsd->last_selected_item = NULL;
GG_IT(it)->wsd->item_count--;
+}
+static void
+_elm_gengrid_item_del_serious(Elm_Gen_Item *it)
+{
+#if GENGRID_FX_SUPPORT
+ if ((!GG_IT(it)->wsd->fx_mode) || (GG_IT(it)->wsd->gengrid_clearing))
+#endif
+ {
+ _elm_gengrid_item_del_common(it);
+ }
free(it->item);
it->item = NULL;
}
Evas_Object *obj = WIDGET(it);
evas_event_freeze(evas_object_evas_get(obj));
+#if GENGRID_FX_SUPPORT
+ GG_IT(it)->has_proxy_it = EINA_FALSE;
+#endif
GG_IT(it)->wsd->selected = eina_list_remove(GG_IT(it)->wsd->selected, it);
if (it->realized) _elm_gengrid_item_unrealize(it, EINA_FALSE);
_elm_gengrid_item_del_serious(it);
}
}
+#if GENGRID_FX_SUPPORT
static void
+_item_del_pre_fx_process(Elm_Gen_Item *it)
+{
+ Evas_Object *obj = WIDGET(it);
+
+ _elm_gengrid_fx_capture(ELM_WIDGET_DATA(GG_IT(it)->wsd)->obj, 0);
+ if (!eina_list_data_find(GG_IT(it)->wsd->pending_del_items, it))
+ GG_IT(it)->wsd->pending_del_items = eina_list_append(GG_IT(it)->wsd->pending_del_items, it);
+
+ evas_event_freeze(evas_object_evas_get(obj));
+ GG_IT(it)->wsd->selected = eina_list_remove(GG_IT(it)->wsd->selected, it);
+
+ _elm_gengrid_item_del_common(it);
+ evas_event_thaw(evas_object_evas_get(obj));
+ evas_event_thaw_eval(evas_object_evas_get(obj));
+}
+#endif
+
+//static void
+static Eina_Bool
_item_del_pre_hook(Elm_Object_Item *item)
{
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
+#if GENGRID_FX_SUPPORT
+ if ((GG_IT(it)->wsd->fx_mode) && (!GG_IT(it)->wsd->gengrid_clearing))
+ {
+ _item_del_pre_fx_process(it);
+ return EINA_FALSE;
+ }
+#endif
if ((it->relcount > 0) || (it->walking > 0))
{
_elm_gengrid_item_del_not_serious(it);
- return;
+ return EINA_TRUE;
}
_item_del(it);
+ return EINA_TRUE;
}
static Evas_Object *
return;
}
evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+
+#if GENGRID_FX_SUPPORT
+ Elm_Gen_FX_Item *fi;
+ Proxy_Item *pi;
+ Elm_Gen_Item *it;
+
+ EINA_LIST_FREE(sd->capture_before_items, pi)
+ {
+ if (pi->proxy) evas_object_del(pi->proxy);
+ free(pi);
+ }
+ EINA_LIST_FREE(sd->capture_after_items, pi)
+ {
+ if (pi->proxy) evas_object_del(pi->proxy);
+ free(pi);
+ }
+ EINA_LIST_FREE(sd->fx_items, fi)
+ {
+ if (fi->trans) elm_transit_del(fi->trans);
+ free(fi);
+ }
+ EINA_LIST_FREE (sd->pending_unrealized_items, it)
+ _elm_gengrid_item_unrealize(it, EINA_FALSE);
+ EINA_LIST_FREE (sd->pending_del_items, it)
+ {
+ _item_del(it);
+ _elm_widget_item_free((Elm_Widget_Item *)it);
+ }
+ sd->gengrid_clearing = EINA_TRUE;
+ sd->fx_playing = EINA_FALSE;
+ sd->fx_first_captured = EINA_FALSE;
+ sd->rendered = EINA_FALSE;
+ if (sd->alpha_bg) evas_object_del(sd->alpha_bg);
+#endif
+
for (l = sd->items, next = l ? l->next : NULL;
l;
l = next, next = next ? next->next : NULL)
{
- Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(l);
+ it = ELM_GEN_ITEM_FROM_INLIST(l);
if (it->generation < sd->generation)
{
evas_object_smart_callback_call(sd->pan_obj, "changed", NULL);
}
sd->s_iface->content_region_show(obj, 0, 0, 0, 0);
+
+#if GENGRID_FX_SUPPORT
+ sd->gengrid_clearing = EINA_FALSE;
+#endif
evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
}
it->unsel_cb = (Ecore_Cb)_item_unselect;
it->unrealize_cb = (Ecore_Cb)_item_unrealize_cb;
+#if GENGRID_FX_SUPPORT
+ it->item->num = sd->item_count;
+ if (sd->fx_mode)
+ _elm_gengrid_fx_capture(ELM_WIDGET_DATA(sd)->obj, 0);
+#endif
+
return it;
}
priv->align_y = 0.5;
priv->highlight = EINA_TRUE;
+#if GENGRID_FX_SUPPORT
+ priv->fx_mode = EINA_FALSE;
+ priv->rendered = EINA_FALSE;
+ priv->fx_first_captured = EINA_FALSE;
+ priv->fx_playing = EINA_FALSE;
+ priv->gengrid_clearing = EINA_FALSE;
+#endif
+
priv->pan_obj = evas_object_smart_add
(evas_object_evas_get(obj), _elm_gengrid_pan_smart_class_new());
pan_data = evas_object_smart_data_get(priv->pan_obj);
EAPI void
elm_gengrid_item_show(Elm_Object_Item *item,
- Elm_Gengrid_Item_Scrollto_Type type)
+ Elm_Gengrid_Item_Scrollto_Type type __UNUSED__)
{
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
Elm_Gengrid_Smart_Data *sd;
- Evas_Coord minx = 0, miny = 0, x = 0, y = 0;
ELM_GENGRID_ITEM_CHECK_OR_RETURN(it);
sd = GG_IT(it)->wsd;
EAPI void
elm_gengrid_item_bring_in(Elm_Object_Item *item,
- Elm_Gengrid_Item_Scrollto_Type type)
+ Elm_Gengrid_Item_Scrollto_Type type __UNUSED__)
{
Elm_Gengrid_Smart_Data *sd;
- Evas_Coord minx = 0, miny = 0, x = 0, y = 0;
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
ELM_GENGRID_ITEM_CHECK_OR_RETURN(it);
return it->select_mode;
}
+
+#if GENGRID_FX_SUPPORT
+EAPI void
+elm_gengrid_fx_mode_set(Evas_Object *obj, Eina_Bool mode)
+{
+ ELM_GENGRID_CHECK(obj);
+ ELM_GENGRID_DATA_GET(obj, sd);
+
+ sd->fx_mode = mode;
+}
+
+EAPI Eina_Bool
+elm_gengrid_fx_mode_get(const Evas_Object *obj)
+{
+ ELM_GENGRID_CHECK(obj) EINA_FALSE;
+ ELM_GENGRID_DATA_GET(obj, sd);
+
+ return sd->fx_mode;
+}
+
+static Proxy_Item *
+_elm_gengrid_proxy_item_new(const Elm_Object_Item *item)
+{
+ Elm_Gen_Item *it = (Elm_Gen_Item *)item;
+ if ((!it) || (!it->item)) return EINA_FALSE;
+ int w, h;
+
+ Proxy_Item *pi = NULL;
+ pi = calloc(1, sizeof(Proxy_Item));
+ if (!pi) return NULL;
+
+ pi->proxy = evas_object_image_filled_add
+ (evas_object_evas_get(ELM_WIDGET_DATA(GG_IT(it)->wsd)->obj));
+ if (!pi->proxy) return EINA_FALSE;
+ evas_object_clip_set(pi->proxy, evas_object_clip_get(GG_IT(it)->wsd->pan_obj));
+
+ evas_object_image_source_set(pi->proxy, VIEW(it));
+
+ GG_IT(it)->has_proxy_it = EINA_TRUE;
+ pi->it = it;
+ pi->num = it->item->num;
+ pi->x = it->item->scrl_x;
+ pi->y = it->item->scrl_y;
+ pi->w = it->item->w;
+ pi->h = it->item->h;
+
+ evas_object_geometry_get(VIEW(it), NULL, NULL, &w, &h);
+
+ if (w <= 0 || h <= 0)
+ {
+ evas_object_size_hint_min_get(VIEW(it), &w, &h);
+ evas_object_size_hint_min_set(pi->proxy, w, h);
+ }
+ else evas_object_resize(pi->proxy, w, h);
+
+ return pi;
+}
+
+static Eina_Bool
+_elm_gengrid_fx_capture(Evas_Object *obj, int level)
+{
+ ELM_GENGRID_DATA_GET(obj, sd);
+
+ Elm_Gen_Item *it;
+ Proxy_Item *pi;
+ Evas_Coord ox, oy, ow, oh;
+
+ if ((!sd->rendered) || (sd->fx_playing)) return EINA_FALSE;
+ if ((!level) && (sd->fx_first_captured)) return EINA_FALSE;
+ if ((level) && (!sd->fx_first_captured)) return EINA_FALSE;
+
+ evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh);
+
+ if (!level)
+ {
+ sd->fx_first_captured = EINA_TRUE;
+ EINA_LIST_FREE(sd->capture_before_items, pi)
+ {
+ if (pi->proxy) evas_object_del(pi->proxy);
+ free(pi);
+ }
+ }
+ else
+ {
+ EINA_LIST_FREE(sd->capture_after_items, pi)
+ {
+ if (pi->proxy) evas_object_del(pi->proxy);
+ free(pi);
+ }
+ }
+ EINA_INLIST_FOREACH(sd->items, it)
+ {
+ if (it->realized)
+ {
+ pi = _elm_gengrid_proxy_item_new((Elm_Object_Item *)it);
+ if (!pi) continue;
+ if (!level)
+ sd->capture_before_items = eina_list_append(sd->capture_before_items, pi);
+ else
+ sd->capture_after_items = eina_list_append(sd->capture_after_items, pi);
+ }
+ }
+ return EINA_TRUE;
+}
+
+static Elm_Gen_FX_Item *
+_elm_gengrid_fx_item_find(const Elm_Object_Item *item)
+{
+ Elm_Gen_Item *it = (Elm_Gen_Item *)item;
+ if (!it) return EINA_FALSE;
+
+ Elm_Gengrid_Smart_Data *sd = GG_IT(it)->wsd;
+ if (!sd) return NULL;
+
+ Elm_Gen_FX_Item *fi = NULL;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(sd->fx_items, l, fi)
+ {
+ if (fi->it == it) return fi;
+ }
+ return NULL;
+}
+
+static Elm_Gen_FX_Item *
+_elm_gengrid_fx_item_new(const Proxy_Item *pi)
+{
+ if ((!pi) || (!pi->it)) return NULL;
+
+ Elm_Gen_FX_Item *fi = NULL;
+ fi = calloc(1, sizeof(Elm_Gen_FX_Item));
+ if (!fi) return NULL;
+
+ fi->it = pi->it;
+ GG_IT(fi->it)->fi = fi;
+ fi->proxy = pi->proxy;
+ fi->num = pi->num;
+ fi->from.x = fi->to.x = pi->x;
+ fi->from.y = fi->to.y = pi->y;
+ fi->from.w = fi->to.w = pi->w;
+ fi->from.h = fi->to.h = pi->h;
+ fi->update = EINA_FALSE;
+
+ return fi;
+}
+
+EAPI void
+_elm_gengrid_fx_items_make(Evas_Object *obj)
+{
+ ELM_GENGRID_CHECK(obj);
+ ELM_GENGRID_DATA_GET(obj, sd);
+
+ Elm_Gen_FX_Item *fi;
+ Proxy_Item *pi;
+ Eina_List *l;
+ Evas_Coord ox, oy, ow, oh;
+
+ evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh);
+
+ EINA_LIST_FOREACH(sd->capture_before_items, l, pi)
+ {
+ fi = _elm_gengrid_fx_item_new(pi);
+ if (fi) sd->fx_items = eina_list_append(sd->fx_items, fi);
+ }
+
+ EINA_LIST_FOREACH(sd->capture_after_items, l, pi)
+ {
+ fi = _elm_gengrid_fx_item_find((Elm_Object_Item *)pi->it);
+
+ if (fi)
+ {
+ fi->type = ELM_GEN_ITEM_FX_TYPE_SAME;
+ fi->update = EINA_TRUE;
+ fi->to.x = pi->x;
+ fi->to.y = pi->y;
+ fi->to.w = pi->w;
+ fi->to.h = pi->h;
+ }
+ else
+ {
+ fi = _elm_gengrid_fx_item_new(pi);
+ if (fi)
+ {
+ fi->type = ELM_GEN_ITEM_FX_TYPE_ADD;
+ fi->update = EINA_TRUE;
+ sd->fx_items = eina_list_append(sd->fx_items, fi);
+ }
+ }
+ }
+
+ EINA_LIST_FOREACH(sd->fx_items, l, fi)
+ {
+ if (!fi->update)
+ {
+ fi->type = ELM_GEN_ITEM_FX_TYPE_DEL;
+ fi->update = EINA_TRUE;
+ }
+ }
+}
+
+static void
+_item_fx_op(Elm_Transit_Effect *data, Elm_Transit *transit __UNUSED__, double progress __UNUSED__)
+{
+ Elm_Gen_FX_Item *fi = data;
+ Elm_Gengrid_Smart_Data *sd = GG_IT(fi->it)->wsd;
+ if (fi->from.y == fi->to.y) evas_object_raise(fi->proxy);
+ evas_object_raise(sd->alpha_bg);
+ return;
+}
+
+
+static void
+_item_fx_done(Elm_Transit_Effect *data, Elm_Transit *transit __UNUSED__)
+{
+ Elm_Gen_FX_Item *fx_done_it = data;
+ Elm_Gengrid_Smart_Data *sd = GG_IT(fx_done_it->it)->wsd;
+
+ if ((!fx_done_it) || (!fx_done_it->it) || (!sd)) return;
+
+ evas_object_image_source_visible_set(fx_done_it->proxy, EINA_TRUE);
+ evas_object_lower(fx_done_it->proxy);
+
+ evas_object_move(VIEW(fx_done_it->it), fx_done_it->to.x, fx_done_it->to.y);
+ GG_IT(fx_done_it->it)->has_proxy_it = EINA_FALSE;
+
+ evas_object_clip_unset(fx_done_it->proxy);
+}
+
+static void
+_item_fx_del_cb(void *data, Elm_Transit *transit __UNUSED__)
+{
+ Elm_Gen_FX_Item *fx_done_it = data;
+ Elm_Gen_Item *it = NULL;
+ Elm_Gengrid_Smart_Data *sd = GG_IT(fx_done_it->it)->wsd;
+
+ if ((!fx_done_it) || (!fx_done_it->it) || (!sd)) return;
+
+ sd->fx_items = eina_list_remove(sd->fx_items, fx_done_it);
+ free(fx_done_it);
+
+ if (!eina_list_count(sd->fx_items))
+ {
+ EINA_LIST_FREE (sd->pending_unrealized_items, it)
+ {
+ GG_IT(it)->has_proxy_it = EINA_FALSE;
+ _elm_gengrid_item_unrealize(it, EINA_FALSE);
+ }
+
+ EINA_LIST_FREE (sd->pending_del_items, it)
+ {
+ _item_del(it);
+ _elm_widget_item_free((Elm_Widget_Item *)it);
+ }
+
+ sd->fx_playing = EINA_FALSE;
+ sd->fx_first_captured = EINA_FALSE;
+ evas_object_hide(sd->alpha_bg);
+
+ sd->pan_changed = EINA_TRUE;
+ evas_object_smart_changed(sd->pan_obj);
+ }
+}
+
+static Evas_Object *
+_tray_alpha_bg_create(const Evas_Object *obj)
+{
+ Evas_Object *bg = NULL;
+ Evas_Coord ox, oy, ow, oh;
+
+ ELM_GENGRID_CHECK(obj) NULL;
+ ELM_GENGRID_DATA_GET(obj, sd);
+
+ evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh);
+ bg = evas_object_rectangle_add
+ (evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ evas_object_color_set(bg, 0, 0, 0, 0);
+ evas_object_resize(bg, ow, oh);
+ evas_object_move(bg, ox, oy);
+
+ return bg;
+}
+
+static void
+_elm_gengrid_fx_play(Evas_Object *obj)
+{
+ ELM_GENGRID_CHECK(obj);
+ ELM_GENGRID_DATA_GET(obj, sd);
+
+ Evas_Coord ox, oy, ow, oh, cvx, cvy, cvw, cvh;
+ Elm_Gen_FX_Item *fi;
+ Eina_List *l;
+
+ if (!sd->fx_mode) return;
+
+ EINA_LIST_FREE(sd->fx_items, fi)
+ {
+ if (fi->trans) elm_transit_del(fi->trans);
+ free(fi);
+ }
+
+ _elm_gengrid_fx_items_make(obj);
+ if (!eina_list_count(sd->fx_items)) return;
+ sd->fx_playing = EINA_TRUE;
+
+ if (!sd->alpha_bg) sd->alpha_bg = _tray_alpha_bg_create(obj);
+ evas_object_show(sd->alpha_bg);
+
+ evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh);
+ evas_output_viewport_get(evas_object_evas_get(obj), &cvx, &cvy, &cvw, &cvh);
+
+ EINA_LIST_FOREACH(sd->fx_items, l, fi)
+ {
+ if (!fi->proxy) continue;
+
+ if ((fi->from.y <= oy) || (fi->from.y + fi->from.h >= oy + oh))
+ {
+ evas_object_move(VIEW(fi->it), fi->to.x, fi->to.y);
+ }
+ else if ((fi->to.y <= oy) || (fi->to.y + fi->to.h >= oy + oh))
+ {
+ evas_object_move(VIEW(fi->it), fi->from.x, fi->from.y);
+ }
+
+ evas_object_resize(fi->proxy, fi->to.w, fi->to.h);
+ evas_object_show(fi->proxy);
+
+ fi->trans = elm_transit_add();
+ elm_transit_object_add(fi->trans, fi->proxy);
+
+ evas_object_image_source_visible_set(fi->proxy, EINA_FALSE);
+ elm_transit_tween_mode_set(fi->trans, ELM_TRANSIT_TWEEN_MODE_DECELERATE);
+
+ if (fi->type == ELM_GEN_ITEM_FX_TYPE_SAME)
+ {
+ evas_object_raise(fi->proxy);
+ elm_transit_effect_translation_add(fi->trans, fi->from.x, fi->from.y, fi->to.x, fi->to.y);
+ }
+
+ else if (fi->type == ELM_GEN_ITEM_FX_TYPE_ADD)
+ {
+ elm_transit_effect_translation_add(fi->trans, fi->from.x, fi->from.y, fi->to.x, fi->to.y);
+ elm_transit_effect_color_add(fi->trans, 0, 0, 0, 0, 255, 255, 255, 255);
+ elm_transit_effect_zoom_add(fi->trans, 0.5, 1.0);
+ }
+ else if (fi->type == ELM_GEN_ITEM_FX_TYPE_DEL)
+ {
+ elm_transit_effect_translation_add(fi->trans, fi->from.x, fi->from.y, fi->to.x, fi->to.y);
+ elm_transit_effect_color_add(fi->trans, 255, 255, 255, 255, 0, 0, 0, 0);
+ elm_transit_effect_zoom_add(fi->trans, 1.0, 0.5);
+ }
+ elm_transit_effect_add(fi->trans, _item_fx_op, fi, _item_fx_done);
+ elm_transit_del_cb_set(fi->trans, _item_fx_del_cb, fi);
+
+ elm_transit_duration_set(fi->trans, FX_MOVE_TIME);
+ elm_transit_objects_final_state_keep_set(fi->trans, EINA_FALSE);
+ elm_transit_go(fi->trans);
+ }
+}
+#endif
#include "elm_priv.h"
#include "elm_widget_genlist.h"
+#define GROUP_ITEMS_FEATURE 0
// internally allocated
#define CLASS_ALLOCATED 0x3a70f11f
#define MAX_ITEMS_PER_BLOCK 32
#define REORDER_EFFECT_TIME 0.1
+#define FX_MOVE_TIME 0.5
EAPI const char ELM_GENLIST_SMART_NAME[] = "elm_genlist";
EAPI const char ELM_GENLIST_PAN_SMART_NAME[] = "elm_genlist_pan";
#define GL_IT(_it) (_it->item)
+#define IS_ROOT_PARENT_IT(_it) \
+ ((_it->group) || (GL_IT(_it)->items && GL_IT(_it)->expanded_depth == 0)) \
+
static const Evas_Smart_Interface *_smart_interfaces[] =
{
(Evas_Smart_Interface *)&ELM_SCROLLABLE_IFACE, NULL
static const char SIG_EDGE_BOTTOM[] = "edge,bottom";
static const char SIG_EDGE_LEFT[] = "edge,left";
static const char SIG_EDGE_RIGHT[] = "edge,right";
+static const char SIG_VBAR_DRAG[] = "vbar,drag";
+static const char SIG_VBAR_PRESS[] = "vbar,press";
+static const char SIG_VBAR_UNPRESS[] = "vbar,unpress";
+static const char SIG_HBAR_DRAG[] = "hbar,drag";
+static const char SIG_HBAR_PRESS[] = "hbar,press";
+static const char SIG_HBAR_UNPRESS[] = "hbar,unpress";
static const char SIG_MULTI_SWIPE_LEFT[] = "multi,swipe,left";
static const char SIG_MULTI_SWIPE_RIGHT[] = "multi,swipe,right";
static const char SIG_MULTI_SWIPE_UP[] = "multi,swipe,up";
{SIG_EDGE_BOTTOM, ""},
{SIG_EDGE_LEFT, ""},
{SIG_EDGE_RIGHT, ""},
+ {SIG_VBAR_DRAG, ""},
+ {SIG_VBAR_PRESS, ""},
+ {SIG_VBAR_UNPRESS, ""},
+ {SIG_HBAR_DRAG, ""},
+ {SIG_HBAR_PRESS, ""},
+ {SIG_HBAR_UNPRESS, ""},
{SIG_MULTI_SWIPE_LEFT, ""},
{SIG_MULTI_SWIPE_RIGHT, ""},
{SIG_MULTI_SWIPE_UP, ""},
static void _elm_genlist_item_state_update(Elm_Gen_Item *it, Item_Cache *ic);
static void _decorate_item_unrealize(Elm_Gen_Item *it);
static void _decorate_all_item_unrealize(Elm_Gen_Item *it);
+static void _decorate_item_set(Elm_Gen_Item *it);
+
+#if GENLIST_FX_SUPPORT
+static Eina_Bool _elm_genlist_fx_capture(Evas_Object *obj, int level);
+static void _elm_genlist_fx_play(Evas_Object *obj);
+static void _elm_genlist_fx_clear(Evas_Object *obj);
+static void _elm_genlist_proxy_item_del(const Elm_Object_Item *item);
+#endif
+
+#if GENLIST_PINCH_ZOOM_SUPPORT
+EAPI Eina_Bool elm_genlist_pinch_zoom_mode_set(Evas_Object *obj, Elm_Gen_Pinch_Zoom_Mode mode);
+#endif
static void
_item_cache_all_free(Elm_Genlist_Smart_Data *sd)
VIEW(it) = ic->base_view;
it->spacer = ic->spacer;
+#if 1 // FIXME: different from upstream
+ // Because of item cache, set state as default after cache item
+ // is popped.
+ edje_object_signal_emit(VIEW(it),"elm,state,default", "elm");
+#endif
edje_object_signal_callback_add
(VIEW(it), "elm,action,expand,toggle", "elm",
_expand_toggle_signal_cb, it);
if (oh < 0) oh = 0;
if (x) *x = ow;
if (y) *y = oh;
+
+#if GENLIST_PINCH_ZOOM_SUPPORT
+ if (psd->wsd->pinch_zoom_mode == ELM_GEN_PINCH_ZOOM_CONTRACT)
+ {
+ evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
+ if (psd->wsd->pinch_zoom_h > oh)
+ *y = psd->wsd->pinch_zoom_h - oh;
+ else *y = 0;
+ }
+#endif
}
static void
if (!it->realized) return;
if (GL_IT(it)->wsd->reorder_it == it) return;
+
+#if GENLIST_FX_SUPPORT
+ if ((GL_IT(it)->has_proxy_it) && (!GL_IT(it)->wsd->genlist_clearing))
+ {
+ if (!eina_list_data_find(GL_IT(it)->wsd->pending_unrealized_items, it))
+ GL_IT(it)->wsd->pending_unrealized_items =
+ eina_list_append(GL_IT(it)->wsd->pending_unrealized_items, it);
+ return;
+ }
+#endif
#if GENLIST_ENTRY_SUPPORT
if (it->item->unrealize_disabled)
{
it->item->unrealize_disabled = EINA_FALSE;
#endif
it->want_unrealize = EINA_FALSE;
+
//evas_event_thaw(evas_object_evas_get(WIDGET(it)));
//evas_event_thaw_eval(evas_object_evas_get(WIDGET(it)));
}
it_y = sd->anchor_y;
sd->s_iface->content_pos_set
(ELM_WIDGET_DATA(sd)->obj, sd->pan_x, it->item->block->y
- + it->y + it_y);
+ + it->y + it_y, EINA_TRUE);
sd->anchor_item = it;
sd->anchor_y = it_y;
}
}
static void
-_item_contract_emit(Elm_Gen_Item *it)
-{
- Elm_Gen_Item *it2;
- Eina_List *l;
-
- edje_object_signal_emit(VIEW(it), "elm,state,contract_flip", "");
- it->item->tree_effect_finished = EINA_FALSE;
-
- EINA_LIST_FOREACH(it->item->items, l, it2)
- if (it2) _item_contract_emit(it2);
-}
-
-static int
-_item_tree_effect_before(Elm_Gen_Item *it)
-{
- Elm_Gen_Item *it2;
- Eina_List *l;
-
- EINA_LIST_FOREACH(it->item->items, l, it2)
- {
- if (it2->parent && (it == it2->parent))
- {
- if (!it2->realized)
- it2->item->tree_effect_hide_me = EINA_TRUE;
- if (GL_IT(it)->wsd->move_effect_mode ==
- ELM_GENLIST_TREE_EFFECT_EXPAND)
- edje_object_signal_emit(VIEW(it2), "elm,state,hide", "");
- else if (GL_IT(it)->wsd->move_effect_mode ==
- ELM_GENLIST_TREE_EFFECT_CONTRACT)
- _item_contract_emit(it2);
- }
- }
- return ECORE_CALLBACK_CANCEL;
-}
-
-static void
_item_position(Elm_Gen_Item *it,
Evas_Object *view,
Evas_Coord it_x,
}
static void
-_item_tree_effect(Elm_Genlist_Smart_Data *sd,
- int y)
-{
- Elm_Gen_Item *it = NULL, *expanded_next_it;
-
- expanded_next_it = sd->expanded_next_item;
-
- if (sd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_EXPAND)
- {
- it = (Elm_Gen_Item *)elm_genlist_item_prev_get
- ((Elm_Object_Item *)expanded_next_it);
- while (it)
- {
- if (it->item->expanded_depth <=
- expanded_next_it->item->expanded_depth) break;
- if (it->item->scrl_y &&
- (it->item->scrl_y <= expanded_next_it->item->old_scrl_y + y)
- && (it->item->expanded_depth >
- expanded_next_it->item->expanded_depth))
- {
- if (!it->item->tree_effect_finished)
- {
- edje_object_signal_emit(VIEW(it), "flip_item", "");
- _item_position
- (it, VIEW(it), it->item->scrl_x, it->item->scrl_y);
- it->item->tree_effect_finished = EINA_TRUE;
- }
- }
- it = (Elm_Gen_Item *)elm_genlist_item_prev_get
- ((Elm_Object_Item *)it);
- }
- }
- else if (sd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_CONTRACT)
- {
- it = (Elm_Gen_Item *)elm_genlist_item_prev_get
- ((Elm_Object_Item *)expanded_next_it);
- while (it)
- {
- if ((it->item->scrl_y > expanded_next_it->item->old_scrl_y + y) &&
- (it->item->expanded_depth >
- expanded_next_it->item->expanded_depth))
- {
- if (!it->item->tree_effect_finished)
- {
- edje_object_signal_emit(VIEW(it), "elm,state,hide", "");
- it->item->tree_effect_finished = EINA_TRUE;
- }
- }
- else
- break;
- it = (Elm_Gen_Item *)elm_genlist_item_prev_get
- ((Elm_Object_Item *)it);
- }
- }
-}
-
-static void
-_item_sub_items_clear(Elm_Gen_Item *it)
+_item_subitems_clear(Elm_Gen_Item *it)
{
Eina_List *l, *ll;
Elm_Object_Item *it2;
{
Elm_Gen_Item *tmp_item = NULL;
+#if GENLIST_FX_SUPPORT
+ if (sd->fx_first_captured) return;
+#endif
if ((sd->expanded_item) && (sd->auto_scroll_enabled))
{
tmp_item = eina_list_data_get
}
static void
-_item_tree_effect_finish(Elm_Genlist_Smart_Data *sd)
-{
- Elm_Gen_Item *it = NULL;
- const Eina_List *l;
-
- if (sd->tree_effect_animator)
- {
- if (sd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_CONTRACT)
- _item_sub_items_clear(sd->expanded_item);
-
- EINA_LIST_FOREACH(sd->expanded_item->item->items, l, it)
- {
- it->item->tree_effect_finished = EINA_TRUE;
- it->item->old_scrl_y = it->item->scrl_y;
- if (GL_IT(it)->wsd->move_effect_mode ==
- ELM_GENLIST_TREE_EFFECT_EXPAND)
- edje_object_signal_emit(VIEW(it), "elm,state,show", "");
- }
- }
-
- _item_auto_scroll(sd);
- evas_object_lower(sd->alpha_bg);
- evas_object_hide(sd->alpha_bg);
- sd->move_effect_mode = ELM_GENLIST_TREE_EFFECT_NONE;
- if (sd->move_items) sd->move_items = eina_list_free(sd->move_items);
-
- evas_object_smart_callback_call(sd->pan_obj, "changed", NULL);
- evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_TREE_EFFECT_FINISHED, NULL);
- evas_object_smart_changed(sd->pan_obj);
-
- sd->tree_effect_animator = NULL;
-}
-
-static void
_elm_genlist_item_odd_even_update(Elm_Gen_Item *it)
{
if (!it->item->nostacking)
{
if (it->deco_all_view)
edje_object_signal_emit
- (it->deco_all_view, "elm,state,selected", "elm");
+ (it->deco_all_view, "elm,state,selected", "elm,nosound");
edje_object_signal_emit
- (VIEW(it), "elm,state,selected", "elm");
+ (VIEW(it), "elm,state,selected", "elm,nosound");
evas_object_smart_callback_call(WIDGET(it), SIG_HIGHLIGHTED, it);
}
}
{
if (it->deco_all_view)
edje_object_signal_emit
- (it->deco_all_view, "elm,state,selected", "elm");
+ (it->deco_all_view, "elm,state,selected", "elm,nosound");
edje_object_signal_emit
- (VIEW(it), "elm,state,selected", "elm");
+ (VIEW(it), "elm,state,selected", "elm,nosound");
evas_object_smart_callback_call(WIDGET(it), SIG_HIGHLIGHTED, it);
}
if (elm_widget_item_disabled_get(it))
_elm_genlist_item_odd_even_update(it);
_elm_genlist_item_state_update(it, NULL);
+#if 1 // FIXME: difference from upstream
+ if (GL_IT(it)->wsd->reorder_mode)
+ {
+ edje_object_signal_emit
+ (VIEW(it), "elm,state,reorder,mode_unset", "elm");
+ edje_object_signal_emit
+ (it->deco_all_view, "elm,state,reorder,mode_set", "elm");
+ }
+#endif
if (effect_on)
{
edje_object_signal_emit
edje_object_signal_emit
(VIEW(it), "elm,state,decorate,enabled", "elm");
}
-#if 1 // FIXME: difference from upstream
- if (GL_IT(it)->wsd->reorder_mode)
- {
- edje_object_signal_emit
- (VIEW(it), "elm,state,reorder,mode_unset", "elm");
- edje_object_signal_emit
- (it->deco_all_view, "elm,state,reorder,mode_set", "elm");
- }
- else
- edje_object_signal_emit
- (it->deco_all_view, "elm,state,reorder,mode_unset", "elm");
-#endif
-
_item_mouse_callbacks_del(it, VIEW(it));
_item_mouse_callbacks_add(it, it->deco_all_view);
static char *
_access_info_cb(void *data, Evas_Object *obj __UNUSED__)
{
+ char *ret;
+ Eina_Strbuf *buf;
+
Elm_Gen_Item *it = (Elm_Gen_Item *)data;
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, NULL);
+ buf = eina_strbuf_new();
+
if (it->itc->func.text_get)
{
const Eina_List *l;
{
char *s = it->itc->func.text_get
((void *)it->base.data, WIDGET(it), key);
- return s;
+
+ s = _elm_util_mkup_to_text(s);
+
+ if (s)
+ {
+ if (eina_strbuf_length_get(buf) > 0) eina_strbuf_append(buf, ", ");
+ eina_strbuf_append(buf, s);
+ free(s);
+ }
}
}
- return NULL;
+ ret = eina_strbuf_string_steal(buf);
+ eina_strbuf_free(buf);
+ return ret;
}
static char *
ai = _elm_access_object_get(it->base.access_obj);
- _elm_access_text_set(ai, ELM_ACCESS_TYPE, E_("Genlist Item"));
_elm_access_callback_set(ai, ELM_ACCESS_INFO, _access_info_cb, it);
_elm_access_callback_set(ai, ELM_ACCESS_STATE, _access_state_cb, it);
_elm_access_on_highlight_hook_set(ai, _access_on_highlight_cb, it);
it->item->order_num_in = in;
if (it->item->nocache_once | it->item->nocache ||
- GL_IT(it)->wsd->tree_effect_enabled ||
it->item->type == ELM_GENLIST_ITEM_TREE || it->parent ||
!_item_cache_pop(it))
{
elm_widget_style_get(WIDGET(it)));
if (it->item->expanded_depth > 0)
- edje_object_signal_emit(VIEW(it), "bg_color_change", "");
+ edje_object_signal_emit(VIEW(it), "bg_color_change", "elm");
stacking_even = edje_object_data_get(VIEW(it), "stacking_even");
if (!stacking_even) stacking_even = "above";
_item_mouse_callbacks_add(it, VIEW(it));
}
- // ACCESS
- if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
- _access_widget_item_register(it);
+ /* access */
+ if (_elm_config->access_mode) _access_widget_item_register(it);
_item_order_update(EINA_INLIST_GET(it), in);
#if 1 // FIXME: difference from upstream
{
edje_object_signal_emit
(VIEW(it), "elm,state,flip,enabled", "elm");
+ // This is needed before contents are swallowed
+ edje_object_message_signal_process(VIEW(it));
+
if (!(it->item->flip_contents))
it->item->flip_contents = elm_widget_stringlist_get
(edje_object_data_get(VIEW(it), "flips"));
&it->item->flip_content_objs);
}
+ /* access: unregister item which have no text and content */
+ if (_elm_config->access_mode && !it->texts && !it->contents)
+ _elm_access_widget_item_unregister((Elm_Widget_Item *)it);
+
#if 0
// FIXME: difference from upstream
if (!it->item->mincalcd || ((GL_IT(it)->wsd->mode == ELM_LIST_COMPRESS) && (it->item->w != it->item->minw)))
it->want_unrealize = EINA_FALSE;
if (!calc || it->item->unrealize_disabled)
- {
- if (it->item->tree_effect_hide_me)
- {
- if (GL_IT(it)->wsd->move_effect_mode
- != ELM_GENLIST_TREE_EFFECT_NONE)
- edje_object_signal_emit(VIEW(it), "elm,state,hide", "");
- it->item->tree_effect_hide_me = EINA_FALSE;
- }
- evas_object_smart_callback_call(WIDGET(it), SIG_REALIZED, it);
- }
+ evas_object_smart_callback_call(WIDGET(it), SIG_REALIZED, it);
if ((!calc) && (GL_IT(it)->wsd->decorate_all_mode) &&
(it->item->type != ELM_GENLIST_ITEM_GROUP))
edje_object_message_signal_process(it->deco_all_view);
}
}
+ if ((!calc) && (it->decorate_it_set) &&
+ (it->item->type != ELM_GENLIST_ITEM_GROUP))
+ {
+ if (it->itc->decorate_item_style)
+ {
+ if (!it->item->deco_it_view)
+ _decorate_item_set(it);
+ edje_object_message_signal_process(it->item->deco_it_view);
+ }
+ }
edje_object_message_signal_process(VIEW(it));
}
-static Eina_Bool
-_tree_effect_animator_cb(void *data)
+#if GENLIST_PINCH_ZOOM_SUPPORT
+static void
+_pinch_items_recalc(void *data)
{
- int in = 0;
- const Eina_List *l;
- int y = 0, dy = 0, dh = 0;
- double effect_duration = 0.3, t;
Elm_Genlist_Smart_Data *sd = data;
- Eina_Bool end = EINA_FALSE, vis = EINA_TRUE;
- Evas_Coord ox, oy, ow, oh, cvx, cvy, cvw, cvh;
- Elm_Gen_Item *it = NULL, *it2, *expanded_next_it;
-
- t = ((0.0 > (t = ecore_time_get() - sd->start_time)) ? 0.0 : t);
- evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh);
- evas_output_viewport_get
- (evas_object_evas_get(sd->pan_obj), &cvx, &cvy, &cvw, &cvh);
- if (t > effect_duration) end = EINA_TRUE;
+ Item_Block *itb;
+ Eina_List *l;
+ Elm_Gen_Item *it;
- // Below while statement is needed, when the genlist is resized.
- it2 = sd->expanded_item;
- while (it2 && vis)
- {
- evas_object_move(VIEW(it2), it2->item->scrl_x, it2->item->scrl_y);
- vis = (ELM_RECTS_INTERSECT(it2->item->scrl_x, it2->item->scrl_y,
- it2->item->w, it2->item->h, cvx, cvy, cvw,
- cvh));
- it2 =
- (Elm_Gen_Item *)elm_genlist_item_prev_get((Elm_Object_Item *)it2);
- }
+ Evas_Coord tot_y = 0, ox, oy;
+ evas_object_geometry_get(sd->pan_obj, &ox, &oy, NULL, NULL);
- if (sd->expanded_next_item)
+ EINA_INLIST_FOREACH(sd->blocks, itb)
{
- expanded_next_it = sd->expanded_next_item;
-
- /* move items */
- EINA_LIST_FOREACH(sd->move_items, l, it)
+ EINA_LIST_FOREACH(itb->items, l, it)
{
- if (sd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_EXPAND)
- {
- expanded_next_it->item->old_scrl_y =
- sd->expanded_item->item->old_scrl_y
- + sd->expanded_item->item->h;
- if (expanded_next_it->item->scrl_y <=
- expanded_next_it->item->old_scrl_y) /* did not
- * calculate
- * next item
- * position */
- expanded_next_it->item->scrl_y = cvy + cvh;
-
- dy = ((expanded_next_it->item->scrl_y >= (cvy + cvh)) ?
- cvy + cvh : expanded_next_it->item->scrl_y) -
- expanded_next_it->item->old_scrl_y;
- }
- else if (sd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_CONTRACT)
+
+ if (IS_ROOT_PARENT_IT(it))
{
- if (expanded_next_it->item->scrl_y >
- expanded_next_it->item->old_scrl_y) /* did not
- * calculate
- * next item
- * position */
- expanded_next_it->item->old_scrl_y = cvy + cvh;
-
- if (expanded_next_it->item->old_scrl_y > (cvy + cvh))
- {
- dy = (sd->expanded_item->item->scrl_y +
- sd->expanded_item->item->h) - cvy + cvh;
- expanded_next_it->item->old_scrl_y = cvy + cvh;
- }
- else
+ if (sd->pinch_zoom_mode == ELM_GEN_PINCH_ZOOM_CONTRACT)
{
- dy = (sd->expanded_item->item->scrl_y +
- sd->expanded_item->item->h) -
- expanded_next_it->item->old_scrl_y;
+ if (!it->realized) _item_realize(it, 0, EINA_FALSE);
+ it->item->scrl_y = oy + tot_y - sd->pan_y;
+ evas_object_resize(VIEW(it), sd->minw, it->item->h);
+ evas_object_move(VIEW(it), it->item->scrl_x, it->item->scrl_y);
+ evas_object_show(VIEW(it));
+ evas_object_raise(VIEW(it));
+ tot_y += it->item->h;
+ sd->pinch_zoom_h = tot_y;
}
- }
-
- if (t <= effect_duration)
- {
- y = ((1 - (1 - (t / effect_duration)) *
- (1 - (t / effect_duration))) * dy);
- }
- else
- {
- end = EINA_TRUE;
- y = dy;
- }
-
- if (!it->realized && !it->item->queued)
- _item_realize(it, in, 0);
- in++;
-
- if (it != expanded_next_it)
- {
- it->item->old_scrl_y =
- expanded_next_it->item->old_scrl_y +
- expanded_next_it->item->h + dh;
-
- dh += it->item->h;
- }
-
- if ((it->item->old_scrl_y + y) < (cvy + cvh))
- _item_position(it, VIEW(it), it->item->scrl_x,
- it->item->old_scrl_y + y);
- }
- /* tree effect */
- _item_tree_effect(sd, y);
- }
- else
- {
- int expanded_item_num = 0;
- int num = 0;
-
- if (sd->expanded_item)
- it = (Elm_Gen_Item *)elm_genlist_item_next_get
- ((Elm_Object_Item *)sd->expanded_item);
-
- it2 = it;
- while (it2)
- {
- expanded_item_num++;
- it2 = (Elm_Gen_Item *)elm_genlist_item_next_get
- ((Elm_Object_Item *)it2);
- }
- while (it)
- {
- num++;
- if (sd->expanded_item->item->expanded_depth >=
- it->item->expanded_depth) break;
- if (sd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_EXPAND)
- {
- if (!it->item->tree_effect_finished)
+ else if (sd->pinch_zoom_mode == ELM_GEN_PINCH_ZOOM_EXPAND)
{
- if (t >= (((num - 1) * effect_duration) /
- expanded_item_num))
- {
- edje_object_signal_emit(VIEW(it), "flip_item", "");
- _item_position(it, VIEW(it), it->item->scrl_x,
- it->item->scrl_y);
- it->item->tree_effect_finished = EINA_TRUE;
- }
+ evas_object_resize(VIEW(it), sd->minw, it->item->h);
+ it->item->scrl_y = oy + it->item->pan_scrl_y - sd->pan_y;
+ evas_object_move(VIEW(it), it->item->scrl_x, it->item->scrl_y);
}
+
}
- it = (Elm_Gen_Item *)elm_genlist_item_next_get
- ((Elm_Object_Item *)it);
}
}
-
- if (end)
- {
- _item_tree_effect_finish(sd);
- return ECORE_CALLBACK_CANCEL;
- }
-
- return ECORE_CALLBACK_RENEW;
}
+#endif
+#if GROUP_ITEMS_FEATURE
static void
_group_items_recalc(void *data)
{
//evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
//evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
}
+#endif
static Eina_Bool
_reorder_move_animator_cb(void *data)
it->item->move_effect_enabled = EINA_TRUE;
GL_IT(it)->wsd->reorder_move_animator =
ecore_animator_add(
- _reorder_move_animator_cb, it);
+ _reorder_move_animator_cb, it);
}
}
if (!it->item->move_effect_enabled)
if ((GL_IT(it)->wsd->decorate_all_mode) &&
(it->itc->decorate_all_item_style))
_decorate_all_item_position
- (it, it->item->scrl_x, it->item->scrl_y);
+ (it, it->item->scrl_x, it->item->scrl_y);
else
{
- if (!GL_IT(it)->wsd->tree_effect_enabled ||
- (GL_IT(it)->wsd->move_effect_mode ==
- ELM_GENLIST_TREE_EFFECT_NONE) ||
- ((GL_IT(it)->wsd->move_effect_mode !=
- ELM_GENLIST_TREE_EFFECT_NONE) &&
- (it->item->old_scrl_y ==
- it->item->scrl_y)))
- {
- if (it->item->deco_it_view)
- _item_position
- (it, it->item->deco_it_view,
- it->item->scrl_x,
- it->item->scrl_y);
- else
- _item_position
- (it, VIEW(it), it->item->scrl_x,
- it->item->scrl_y);
- }
+ if (it->item->deco_it_view)
+ _item_position
+ (it, it->item->deco_it_view,
+ it->item->scrl_x,
+ it->item->scrl_y);
+ else
+ _item_position
+ (it, VIEW(it), it->item->scrl_x,
+ it->item->scrl_y);
}
it->item->old_scrl_y = it->item->scrl_y;
+#if GENLIST_PINCH_ZOOM_SUPPORT
+ if ((GL_IT(it)->wsd->pinch_zoom_mode == ELM_GEN_PINCH_ZOOM_CONTRACT)
+ && (!IS_ROOT_PARENT_IT(it)))
+ {
+ if (it->deco_all_view) evas_object_hide(it->deco_all_view);
+ else evas_object_hide(VIEW(it));
+ }
+#endif
+
}
}
else
{
- if (!GL_IT(it)->wsd->tree_effect_animator)
+ if ((GL_IT(it)->wsd->pinch_zoom_mode == ELM_GEN_PINCH_ZOOM_CONTRACT)
+ && (!IS_ROOT_PARENT_IT(it)))
+ {
+ if (it->deco_all_view) evas_object_hide(it->deco_all_view);
+ else evas_object_hide(VIEW(it));
+ }
+ else
_item_unrealize(it, EINA_FALSE);
}
}
//evas_event_freeze(evas_object_evas_get(obj));
+#if GENLIST_FX_SUPPORT
+ if (psd->wsd->fx_playing) return;
+#endif
if (psd->wsd->pan_changed)
{
_calc_job(psd->wsd);
evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
evas_output_viewport_get(evas_object_evas_get(obj), &cvx, &cvy, &cvw, &cvh);
EINA_LIST_FOREACH(psd->wsd->group_items, l, git)
- {
- git->item->want_realize = EINA_FALSE;
- }
-
- if (psd->wsd->tree_effect_enabled &&
- (psd->wsd->move_effect_mode != ELM_GENLIST_TREE_EFFECT_NONE))
- {
- if (!psd->wsd->tree_effect_animator)
- {
- _item_tree_effect_before(psd->wsd->expanded_item);
- evas_object_raise(psd->wsd->alpha_bg);
- evas_object_show(psd->wsd->alpha_bg);
- psd->wsd->start_time = ecore_time_get();
- psd->wsd->tree_effect_animator =
- ecore_animator_add(_tree_effect_animator_cb, psd->wsd);
- }
- }
+ {
+#if GROUP_ITEMS_FEATURE
+ git->item->want_realize = EINA_FALSE;
+#else
+ _item_unrealize(git, EINA_TRUE);
+#endif
+ }
EINA_INLIST_FOREACH(psd->wsd->blocks, itb)
{
}
in += itb->count;
}
-#if 0 // FIXME: difference from upstream
- // Disable shift movement of group items.
+#if GENLIST_PINCH_ZOOM_SUPPORT
+ if (psd->wsd->pinch_zoom_mode) _pinch_items_recalc(psd->wsd);
+#endif
+
+#if GROUP_ITEMS_FEATURE
if ((!psd->wsd->reorder_it) || (psd->wsd->reorder_pan_move))
_group_items_recalc(psd->wsd);
#endif
psd->wsd->reorder_old_pan_y = psd->wsd->pan_y;
psd->wsd->start_time = ecore_loop_time_get();
}
-
- if (!psd->wsd->tree_effect_enabled ||
- (psd->wsd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_NONE))
_item_auto_scroll(psd->wsd);
psd->wsd->s_iface->content_pos_get(ELM_WIDGET_DATA(psd->wsd)->obj, &vx, &vy);
#if GENLIST_ENTRY_SUPPORT
if (psd->wsd->size_changed) _changed_job(psd->wsd);
#endif
+
+#if GENLIST_FX_SUPPORT
+ psd->wsd->rendered = EINA_TRUE;
+ if ((psd->wsd->fx_mode) && (!psd->wsd->queue))
+ {
+ if (_elm_genlist_fx_capture(ELM_WIDGET_DATA(psd->wsd)->obj, 1))
+ _elm_genlist_fx_play(ELM_WIDGET_DATA(psd->wsd)->obj);
+ }
+#endif
+#if GENLIST_PINCH_ZOOM_SUPPORT
+ if (psd->wsd->pinch_zoom_mode == ELM_GEN_PINCH_ZOOM_EXPAND)
+ psd->wsd->pinch_zoom_mode = ELM_GEN_PINCH_ZOOM_NONE;
+#endif
//evas_event_thaw(evas_object_evas_get(obj));
//evas_event_thaw_eval(evas_object_evas_get(obj));
}
if (y < 0) y = 0;
if (y > pan_max_y) y = pan_max_y;
- sd->s_iface->content_pos_set(obj, x, y);
+ sd->s_iface->content_pos_set(obj, x, y, EINA_TRUE);
return EINA_TRUE;
}
if (ELM_RECTS_INTERSECT
(x + (w / 2), y + (h / 2), 0, 0, sx, sy, sw, sh))
items = eina_list_append(items, it->base.access_obj);
+
+ if (!it->base.access_order) continue;
+
+ Eina_List *subl;
+ Evas_Object *subo;
+ EINA_LIST_FOREACH(it->base.access_order, subl, subo)
+ items = eina_list_append(items, subo);
}
}
}
return;
if (!sd->highlight || it->highlighted) return;
+#if GENLIST_PINCH_ZOOM_SUPPORT
+ if (sd->pinch_zoom_mode) return;
+#endif
selectraise = edje_object_data_get(VIEW(it), "selectraise");
if ((selectraise) && (!strcmp(selectraise, "on")))
(it->select_mode == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY))
return;
+#if GENLIST_PINCH_ZOOM_SUPPORT
+ if (IS_ROOT_PARENT_IT(it) && (sd->pinch_zoom_mode == ELM_GEN_PINCH_ZOOM_CONTRACT))
+ {
+ elm_genlist_pinch_zoom_mode_set(obj, ELM_GEN_PINCH_ZOOM_EXPAND);
+ elm_genlist_item_show((Elm_Object_Item *)it, ELM_GENLIST_ITEM_SCROLLTO_TOP);
+ return;
+ }
+#endif
+
#if 0
// FIXME: difference from upstream
if ((GL_IT(it)->wsd->last_selected_item) &&
if (GL_IT(it)->wsd->calc_job) ecore_job_del(GL_IT(it)->wsd->calc_job);
GL_IT(it)->wsd->calc_job = NULL;
}
+#if GENLIST_FX_SUPPORT
+ it->item->block = NULL;
+#endif
}
static void
if ((!it) || (!it->item->decorate_all_item_realized)) return;
+#if GENLIST_FX_SUPPORT
+ if ((GL_IT(it)->has_proxy_it) && (!GL_IT(it)->wsd->genlist_clearing))
+ {
+ if (!eina_list_data_find(GL_IT(it)->wsd->pending_unrealized_decorate_all_items, it))
+ GL_IT(it)->wsd->pending_unrealized_decorate_all_items =
+ eina_list_append(GL_IT(it)->wsd->pending_unrealized_decorate_all_items, it);
+ return;
+ }
+#endif
+
edje_object_part_unswallow(it->deco_all_view, VIEW(it));
evas_object_smart_member_add(VIEW(it), GL_IT(it)->wsd->pan_obj);
elm_widget_sub_object_add(WIDGET(it), VIEW(it));
_elm_genlist_item_state_update(it, NULL);
edje_object_signal_emit
- (it->deco_all_view, "elm,state,decorate,disabled,effect", "elm");
+ (it->deco_all_view, "elm,state,decorate,disabled", "elm");
edje_object_signal_emit
- (VIEW(it), "elm,state,decorate,disabled", "elm");
+ (VIEW(it), "elm,state,decorate,disabled", "elm");
+ if (it->item->wsd->reorder_mode)
+ {
+ edje_object_signal_emit
+ (VIEW(it), "elm,state,reorder,mode_set", "elm");
+ edje_object_signal_emit
+ (it->deco_all_view, "elm,state,reorder,mode_unset", "elm");
+ }
+
edje_object_message_signal_process(VIEW(it));
edje_object_message_signal_process(it->deco_all_view);
}
static void
-_item_subitems_clear(Elm_Gen_Item *it)
-{
- Elm_Genlist_Smart_Data *sd = GL_IT(it)->wsd;
-
- if (!sd->tree_effect_enabled || !sd->move_effect_mode)
- _item_sub_items_clear(it);
- else
- {
- if (!sd->tree_effect_animator)
- {
- sd->expanded_item = it;
- _item_tree_effect_before(it);
- evas_object_raise(sd->alpha_bg);
- evas_object_show(sd->alpha_bg);
- sd->start_time = ecore_time_get();
- sd->tree_effect_animator =
- ecore_animator_add(_tree_effect_animator_cb, sd);
- }
- else
- _item_sub_items_clear(it);
- }
-}
-
-static void
-_item_free(Elm_Gen_Item *it)
+_item_free_common(Elm_Gen_Item *it)
{
Elm_Genlist_Smart_Data *sd = GL_IT(it)->wsd;
-
elm_widget_item_pre_notify_del(it);
if (it->itc->func.del)
- it->itc->func.del((void *)it->base.data, WIDGET(it));
+ it->itc->func.del((void *)it->base.data, WIDGET(it));
if (it->tooltip.del_cb)
it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it);
-
if (it->item->block) _item_block_del(it);
-
if (it->parent)
it->parent->item->items =
eina_list_remove(it->parent->item->items, it);
// FIXME: relative will be better to be fixed. it is too harsh.
if (it->item->rel)
- it->item->rel->item->rel_revs =
- eina_list_remove(it->item->rel->item->rel_revs, it);
+ it->item->rel->item->rel_revs =
+ eina_list_remove(it->item->rel->item->rel_revs, it);
if (it->item->rel_revs)
{
Elm_Gen_Item *tmp;
EINA_LIST_FREE(it->item->rel_revs, tmp) tmp->item->rel = NULL;
}
_item_subitems_clear(it);
+
#if GENLIST_ENTRY_SUPPORT
it->item->unrealize_disabled = EINA_FALSE;
#endif
- _item_unrealize(it, EINA_FALSE);
- elm_genlist_item_class_unref((Elm_Genlist_Item_Class *)it->itc);
- if (it->item->swipe_timer) ecore_timer_del(it->item->swipe_timer);
- free(it->item);
if (it->selected) sd->selected = eina_list_remove(sd->selected, it);
if (sd->show_item == it) sd->show_item = NULL;
sd->anchor_item =
ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
if (!sd->anchor_item) sd->anchor_item =
- ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
- }
- if (sd->expanded_item == it)
- {
- if (sd->tree_effect_animator)
- {
- _item_tree_effect_finish(sd);
- ecore_animator_del(sd->tree_effect_animator);
- sd->tree_effect_animator = NULL;
- }
- sd->expanded_item = NULL;
- sd->move_effect_mode = ELM_GENLIST_TREE_EFFECT_NONE;
+ ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
}
+ if (sd->expanded_item == it) sd->expanded_item = NULL;
if (sd->expanded_next_item == it) sd->expanded_next_item = NULL;
- if (sd->move_items)
- sd->move_items = eina_list_remove(sd->move_items, it);
if (sd->state) eina_inlist_sorted_state_free(sd->state);
if (sd->last_selected_item == (Elm_Object_Item *)it)
- sd->last_selected_item = NULL;
+ sd->last_selected_item = NULL;
if (it->long_timer)
{
ecore_timer_del(it->long_timer);
it->long_timer = NULL;
}
+ if (it->item->swipe_timer) ecore_timer_del(it->item->swipe_timer);
sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(it));
sd->item_count--;
+}
- if (sd->calc_job) ecore_job_del(sd->calc_job);
+static void
+_item_free(Elm_Gen_Item *it)
+{
+ Elm_Genlist_Smart_Data *sd = GL_IT(it)->wsd;
+
+#if GENLIST_FX_SUPPORT
+ if (sd->fx_mode) GL_IT(it)->has_proxy_it = EINA_FALSE;
+ _elm_genlist_proxy_item_del((Elm_Object_Item *)it);
+ if ((!sd->fx_mode) || (sd->genlist_clearing))
+#endif
+ {
+ _item_free_common(it);
+ }
+ _item_unrealize(it, EINA_FALSE);
+ elm_genlist_item_class_unref((Elm_Genlist_Item_Class *)it->itc);
+ free(it->item);
+
+ if (sd->calc_job) ecore_job_del(sd->calc_job);
sd->calc_job = ecore_job_add(_calc_job, sd);
}
+#if GENLIST_FX_SUPPORT
+static void
+_item_del_pre_fx_process(Elm_Gen_Item *it)
+{
+ Elm_Genlist_Smart_Data *sd = GL_IT(it)->wsd;
+
+ sd->fx_items_deleted = EINA_TRUE;
+ _elm_genlist_fx_capture(ELM_WIDGET_DATA(sd)->obj, 0);
+ if (!eina_list_data_find(sd->pending_del_items, it))
+ sd->pending_del_items = eina_list_append(sd->pending_del_items, it);
+
+ _item_free_common(it);
+
+}
+#endif
+
static void
_item_mouse_move_cb(void *data,
Evas *evas __UNUSED__,
(WIDGET(it), SIG_MULTI_SWIPE_UP, it);
else if (abs(GL_IT(it)->wsd->cur_y - GL_IT(it)->wsd->cur_my) >
abs(GL_IT(it)->wsd->prev_y - GL_IT(it)->wsd->prev_my))
- evas_object_smart_callback_call
- (WIDGET(it), SIG_MULTI_PINCH_OUT, it);
+ {
+ evas_object_smart_callback_call
+ (WIDGET(it), SIG_MULTI_PINCH_OUT, it);
+#if GENLIST_PINCH_ZOOM_SUPPORT
+ if (IS_ROOT_PARENT_IT(it) && (GL_IT(it)->wsd->pinch_zoom_mode == ELM_GEN_PINCH_ZOOM_CONTRACT))
+ {
+ elm_genlist_pinch_zoom_mode_set(ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj, ELM_GEN_PINCH_ZOOM_EXPAND);
+ elm_genlist_item_show((Elm_Object_Item *)it, ELM_GENLIST_ITEM_SCROLLTO_TOP);
+ }
+#endif
+ }
else
- evas_object_smart_callback_call
- (WIDGET(it), SIG_MULTI_PINCH_IN, it);
+ {
+ evas_object_smart_callback_call
+ (WIDGET(it), SIG_MULTI_PINCH_IN, it);
+#if GENLIST_PINCH_ZOOM_SUPPORT
+ elm_genlist_pinch_zoom_mode_set(ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj,
+ ELM_GEN_PINCH_ZOOM_CONTRACT);
+#endif
+ }
}
}
{
return ECORE_CALLBACK_CANCEL;
}
+#if GENLIST_FX_SUPPORT
+ if (sd->fx_first_captured)
+ _elm_genlist_fx_clear(ELM_WIDGET_DATA(sd)->obj);
+#endif
return ECORE_CALLBACK_RENEW;
}
in++;
it->x = 0;
it->y = y;
+#if GENLIST_PINCH_ZOOM_SUPPORT
+ if (IS_ROOT_PARENT_IT(it))
+ it->item->pan_scrl_y = itb->y + it->y;
+#endif
y += it->item->h;
}
if (changed) itb->sd->pan_changed = changed;
}
static void
+_vbar_drag_cb(Evas_Object *obj,
+ void *data __UNUSED__)
+{
+ evas_object_smart_callback_call(obj, SIG_VBAR_DRAG, NULL);
+}
+
+static void
+_vbar_press_cb(Evas_Object *obj,
+ void *data __UNUSED__)
+{
+ evas_object_smart_callback_call(obj, SIG_VBAR_PRESS, NULL);
+}
+
+static void
+_vbar_unpress_cb(Evas_Object *obj,
+ void *data __UNUSED__)
+{
+ evas_object_smart_callback_call(obj, SIG_VBAR_UNPRESS, NULL);
+}
+
+static void
+_hbar_drag_cb(Evas_Object *obj,
+ void *data __UNUSED__)
+{
+ evas_object_smart_callback_call(obj, SIG_HBAR_DRAG, NULL);
+}
+
+static void
+_hbar_press_cb(Evas_Object *obj,
+ void *data __UNUSED__)
+{
+ evas_object_smart_callback_call(obj, SIG_HBAR_PRESS, NULL);
+}
+
+static void
+_hbar_unpress_cb(Evas_Object *obj,
+ void *data __UNUSED__)
+{
+ evas_object_smart_callback_call(obj, SIG_HBAR_UNPRESS, NULL);
+}
+
+static void
_decorate_item_realize(Elm_Gen_Item *it)
{
char buf[1024];
priv->s_iface->edge_right_cb_set(obj, _edge_right_cb);
priv->s_iface->edge_top_cb_set(obj, _edge_top_cb);
priv->s_iface->edge_bottom_cb_set(obj, _edge_bottom_cb);
+ priv->s_iface->vbar_drag_cb_set(obj, _vbar_drag_cb);
+ priv->s_iface->vbar_press_cb_set(obj, _vbar_press_cb);
+ priv->s_iface->vbar_unpress_cb_set(obj, _vbar_unpress_cb);
+ priv->s_iface->hbar_drag_cb_set(obj, _hbar_drag_cb);
+ priv->s_iface->hbar_press_cb_set(obj, _hbar_press_cb);
+ priv->s_iface->hbar_unpress_cb_set(obj, _hbar_unpress_cb);
priv->mode = ELM_LIST_SCROLL;
priv->max_items_per_block = MAX_ITEMS_PER_BLOCK;
priv->longpress_timeout = _elm_config->longpress_timeout;
priv->highlight = EINA_TRUE;
+#if GENLIST_FX_SUPPORT
+ priv->fx_mode = EINA_FALSE;
+ priv->rendered = EINA_FALSE;
+ priv->fx_first_captured = EINA_FALSE;
+ priv->fx_playing = EINA_FALSE;
+ priv->fx_items_deleted = EINA_FALSE;
+ priv->genlist_clearing = EINA_FALSE;
+#endif
+
priv->pan_obj = evas_object_smart_add
(evas_object_evas_get(obj), _elm_genlist_pan_smart_class_new());
pan_data = evas_object_smart_data_get(priv->pan_obj);
if (sd->multi_timer) ecore_timer_del(sd->multi_timer);
if (sd->decorate_it_type) eina_stringshare_del(sd->decorate_it_type);
if (sd->scr_hold_timer) ecore_timer_del(sd->scr_hold_timer);
- if (sd->tree_effect_animator) ecore_animator_del(sd->tree_effect_animator);
evas_object_del(sd->pan_obj);
ELM_WIDGET_CLASS(_elm_genlist_parent_sc)->base.del(obj);
_item_content_get_hook(Elm_Gen_Item *it,
const char *part)
{
- return edje_object_part_swallow_get(VIEW(it), part);
+ Evas_Object *ret = NULL;
+ if (it->deco_all_view)
+ ret = edje_object_part_swallow_get(it->deco_all_view, part);
+ else if (it->decorate_it_set)
+ ret = edje_object_part_swallow_get(it->item->deco_it_view, part);
+ if (!ret)
+ ret = edje_object_part_swallow_get(VIEW(it), part);
+ return ret;
}
static const char *
const char *part)
{
if (!it->itc->func.text_get) return NULL;
- return edje_object_part_text_get(VIEW(it), part);
+ const char *ret = NULL;
+ if (it->deco_all_view)
+ ret = edje_object_part_text_get(it->deco_all_view, part);
+ else if (it->decorate_it_set)
+ ret = edje_object_part_text_get(it->item->deco_it_view, part);
+ if (!ret)
+ ret = edje_object_part_text_get(VIEW(it), part);
+ return ret;
}
static void
_item_del_pre_hook(Elm_Object_Item *item)
{
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
+
+#if GENLIST_FX_SUPPORT
+ if ((GL_IT(it)->wsd->fx_mode) && (!GL_IT(it)->wsd->genlist_clearing))
+ {
+ _item_del_pre_fx_process(it);
+ return EINA_FALSE;
+ }
+#endif
_item_free(it);
return EINA_TRUE;
}
GL_IT(it)->expanded_depth = depth;
sd->item_count++;
+#if GENLIST_FX_SUPPORT
+ it->item->num = sd->item_count;
+ if (sd->fx_mode)
+ {
+ sd->fx_items_deleted = EINA_FALSE;
+ _elm_genlist_fx_capture(ELM_WIDGET_DATA(sd)->obj, 0);
+ }
+#endif
return it;
}
return (Elm_Object_Item *)it;
}
+static void
+_elm_genlist_fx_clear(Evas_Object *obj)
+{
+ ELM_GENLIST_DATA_GET(obj, sd);
+
+ Elm_Gen_FX_Item *fi;
+ Proxy_Item *pi;
+ Elm_Gen_Item *it;
+
+ EINA_LIST_FREE(sd->capture_before_items, pi)
+ {
+ if ((pi->it) && (GL_IT(pi->it))) GL_IT(pi->it)->has_proxy_it = EINA_FALSE;
+ if (pi->proxy) evas_object_smart_member_del(pi->proxy);
+ if (pi->proxy) evas_object_del(pi->proxy);
+ free(pi);
+ }
+ EINA_LIST_FREE(sd->capture_after_items, pi)
+ {
+ if ((pi->it) && (GL_IT(pi->it))) GL_IT(pi->it)->has_proxy_it = EINA_FALSE;
+ if (pi->proxy) evas_object_smart_member_del(pi->proxy);
+ if (pi->proxy) evas_object_del(pi->proxy);
+ free(pi);
+ }
+
+ EINA_LIST_FREE(sd->fx_items, fi)
+ {
+ if (fi->trans) elm_transit_del(fi->trans);
+ free(fi);
+ }
+
+ EINA_LIST_FREE (sd->pending_unrealized_items, it)
+ _item_unrealize(it, EINA_FALSE);
+
+ EINA_LIST_FREE (sd->pending_unrealized_decorate_all_items, it)
+ _decorate_all_item_unrealize(it);
+
+ EINA_LIST_FREE (sd->pending_del_items, it)
+ {
+ _item_free(it);
+ _elm_widget_item_free((Elm_Widget_Item *)it);
+ }
+ if (sd->alpha_bg) evas_object_del(sd->alpha_bg);
+ sd->alpha_bg = NULL;
+
+ sd->genlist_clearing = EINA_TRUE;
+ sd->fx_playing = EINA_FALSE;
+ sd->fx_first_captured = EINA_FALSE;
+ sd->fx_items_deleted = EINA_FALSE;
+}
+
EAPI void
elm_genlist_clear(Evas_Object *obj)
{
ELM_GENLIST_CHECK(obj);
ELM_GENLIST_DATA_GET(obj, sd);
+ Elm_Gen_Item *it;
if (sd->state)
{
sd->state = NULL;
}
+#if GENLIST_FX_SUPPORT
+ if (sd->fx_mode)
+ {
+ _elm_genlist_fx_clear(obj);
+ sd->genlist_clearing = EINA_TRUE;
+ sd->rendered = EINA_FALSE;
+ }
+#endif
+#if GENLIST_PINCH_ZOOM_SUPPORT
+ sd->pinch_zoom_h = 0;
+ sd->realized_top_item = NULL;
+ sd->pinch_zoom_mode = ELM_GEN_PINCH_ZOOM_NONE;
+#endif
+
//evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
// Do not use EINA_INLIST_FOREACH or EINA_INLIST_FOREACH_SAFE
// because sd->items can be modified inside elm_widget_item_del()
while (sd->items)
{
- Elm_Gen_Item *it =
- EINA_INLIST_CONTAINER_GET(sd->items->last, Elm_Gen_Item);
+ it = EINA_INLIST_CONTAINER_GET(sd->items->last, Elm_Gen_Item);
elm_widget_item_del(it);
}
sd->items = NULL;
sd->selected = NULL;
sd->anchor_item = NULL;
- if (sd->tree_effect_animator)
- {
- ecore_animator_del(sd->tree_effect_animator);
- sd->tree_effect_animator = NULL;
- }
if (sd->multi_timer)
{
ecore_timer_del(sd->multi_timer);
}
elm_layout_sizing_eval(ELM_WIDGET_DATA(sd)->obj);
sd->s_iface->content_region_show(obj, 0, 0, 0, 0);
+
+#if GENLIST_FX_SUPPORT
+ sd->genlist_clearing = EINA_FALSE;
+#endif
//evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
//evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
}
return it2;
}
-static void
-_elm_genlist_move_items_set(Elm_Gen_Item *it)
-{
- Eina_List *l, *ll;
- Elm_Gen_Item *it2 = NULL;
- Evas_Coord ox, oy, ow, oh, dh = 0;
-
- GL_IT(it)->wsd->expanded_next_item =
- _elm_genlist_expanded_next_item_get(it);
-
- if (it->item->expanded)
- {
- GL_IT(it)->wsd->move_items = elm_genlist_realized_items_get
- (ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj);
-
- EINA_LIST_FOREACH_SAFE(GL_IT(it)->wsd->move_items, l, ll, it2)
- {
- if (it2 == GL_IT(it)->wsd->expanded_next_item) break;
- GL_IT(it)->wsd->move_items =
- eina_list_remove(GL_IT(it)->wsd->move_items, it2);
- }
- }
- else
- {
- evas_object_geometry_get(GL_IT(it)->wsd->pan_obj, &ox, &oy, &ow, &oh);
- it2 = GL_IT(it)->wsd->expanded_next_item;
-
- while (it2 && (dh < oy + oh))
- {
- dh += it2->item->h;
- GL_IT(it)->wsd->move_items =
- eina_list_append(GL_IT(it)->wsd->move_items, it2);
- it2 = (Elm_Gen_Item *)
- elm_genlist_item_next_get((Elm_Object_Item *)it2);
- }
- }
-}
-
static Evas_Object *
_tray_alpha_bg_create(const Evas_Object *obj)
{
if (it->item->type != ELM_GENLIST_ITEM_TREE) return;
it->item->expanded = expanded;
GL_IT(it)->wsd->expanded_item = it;
- _elm_genlist_move_items_set(it);
-
- if (GL_IT(it)->wsd->tree_effect_enabled && !GL_IT(it)->wsd->alpha_bg)
- GL_IT(it)->wsd->alpha_bg = _tray_alpha_bg_create(WIDGET(it));
+ GL_IT(it)->wsd->expanded_next_item =
+ _elm_genlist_expanded_next_item_get(it);
if (it->item->expanded)
{
- GL_IT(it)->wsd->move_effect_mode = ELM_GENLIST_TREE_EFFECT_EXPAND;
if (it->realized)
edje_object_signal_emit(VIEW(it), "elm,state,expanded", "elm");
evas_object_smart_callback_call(WIDGET(it), SIG_EXPANDED, it);
}
else
{
- GL_IT(it)->wsd->move_effect_mode = ELM_GENLIST_TREE_EFFECT_CONTRACT;
if (it->realized)
edje_object_signal_emit(VIEW(it), "elm,state,contracted", "elm");
evas_object_smart_callback_call(WIDGET(it), SIG_CONTRACTED, it);
#if GENLIST_ENTRY_SUPPORT
it->item->unrealize_disabled = EINA_FALSE;
#endif
+
+#if GENLIST_FX_SUPPORT
+ if (GL_IT(it)->wsd->fx_first_captured)
+ _elm_genlist_fx_clear(ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj);
+#endif
+
if (GL_IT(it)->wsd->update_job) ecore_job_del(GL_IT(it)->wsd->update_job);
GL_IT(it)->wsd->update_job = ecore_job_add(_update_job, GL_IT(it)->wsd);
}
// and user can check whether deocrate_all_mode is enabeld.
sd->decorate_all_mode = decorated;
- if (sd->tree_effect_animator)
- {
- ecore_animator_del(sd->tree_effect_animator);
- sd->tree_effect_animator = NULL;
- }
- sd->move_effect_mode = ELM_GENLIST_TREE_EFFECT_NONE;
-
list = elm_genlist_realized_items_get(obj);
if (!sd->decorate_all_mode)
{
}
}
}
+#if GENLIST_FX_SUPPORT
+ if (sd->fx_first_captured)
+ _elm_genlist_fx_clear(ELM_WIDGET_DATA(sd)->obj);
+
+#endif
if (sd->calc_job) ecore_job_del(sd->calc_job);
sd->calc_job = ecore_job_add(_calc_job, sd);
}
ELM_GENLIST_CHECK(obj);
ELM_GENLIST_DATA_GET(obj, sd);
+ if (sd->reorder_mode == !!reorder_mode) return;
sd->reorder_mode = !!reorder_mode;
#if 1 // FIXME: difference from upstream
list = elm_genlist_realized_items_get(obj);
return it->select_mode;
}
+// will be deprecated
EAPI void
elm_genlist_tree_effect_enabled_set(Evas_Object *obj __UNUSED__,
Eina_Bool enabled __UNUSED__)
{
ELM_GENLIST_CHECK(obj);
- //ELM_GENLIST_DATA_GET(obj, sd);
-
- // FIXME: this is disabed temporarily because of tree animation bug
- //sd->tree_effect_enabled = !!enabled;
}
+// will be deprecated
EAPI Eina_Bool
-elm_genlist_tree_effect_enabled_get(const Evas_Object *obj)
+elm_genlist_tree_effect_enabled_get(const Evas_Object *obj __UNUSED__)
{
ELM_GENLIST_CHECK(obj) EINA_FALSE;
- ELM_GENLIST_DATA_GET(obj, sd);
- return sd->tree_effect_enabled;
+ return EINA_FALSE;
}
EAPI Elm_Object_Item *
return (Elm_Object_Item *)it;
}
+#if GENLIST_FX_SUPPORT
+EAPI void
+elm_genlist_fx_mode_set(Evas_Object *obj, Eina_Bool mode)
+{
+ ELM_GENLIST_CHECK(obj);
+ ELM_GENLIST_DATA_GET(obj, sd);
+
+ sd->fx_mode = mode;
+}
+
+EAPI Eina_Bool
+elm_genlist_fx_mode_get(const Evas_Object *obj)
+{
+ ELM_GENLIST_CHECK(obj) EINA_FALSE;
+ ELM_GENLIST_DATA_GET(obj, sd);
+
+ return sd->fx_mode;
+}
+
+static void
+_elm_genlist_proxy_item_del(const Elm_Object_Item *item)
+{
+ Elm_Gen_Item *it = (Elm_Gen_Item *)item;
+ if ((!it) || (!it->item)) return EINA_FALSE;
+
+ Elm_Genlist_Smart_Data *sd = GL_IT(it)->wsd;
+ Proxy_Item *pi;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(sd->capture_before_items, l, pi)
+ if (pi->it == it) pi->it = NULL;
+
+ EINA_LIST_FOREACH(sd->capture_after_items, l, pi)
+ if (pi->it == it) pi->it = NULL;
+}
+
+static Proxy_Item *
+_elm_genlist_proxy_item_new(const Elm_Object_Item *item)
+{
+ Elm_Gen_Item *it = (Elm_Gen_Item *)item;
+ if ((!it) || (!it->item)) return EINA_FALSE;
+ int w, h;
+
+ Proxy_Item *pi = NULL;
+ pi = calloc(1, sizeof(Proxy_Item));
+ if (!pi) return NULL;
+
+ pi->proxy = evas_object_image_filled_add
+ (evas_object_evas_get(ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj));
+ if (!pi->proxy) return EINA_FALSE;
+ evas_object_clip_set(pi->proxy, evas_object_clip_get(GL_IT(it)->wsd->pan_obj));
+ evas_object_smart_member_add(pi->proxy, GL_IT(it)->wsd->pan_obj);
+ evas_object_hide(pi->proxy);
+
+ if ((GL_IT(it)->wsd->decorate_all_mode) && (it->deco_all_view))
+ evas_object_image_source_set(pi->proxy, it->deco_all_view);
+ else
+ evas_object_image_source_set(pi->proxy, VIEW(it));
+
+ GL_IT(it)->has_proxy_it = EINA_TRUE;
+ pi->it = it;
+ pi->num = it->item->num;
+ pi->x = it->item->scrl_x;
+ pi->y = it->item->scrl_y;
+ pi->w = it->item->w;
+ pi->h = it->item->h;
+
+ evas_object_geometry_get(VIEW(it), NULL, NULL, &w, &h);
+
+ if (w <= 0 || h <= 0)
+ {
+ evas_object_size_hint_min_get(VIEW(it), &w, &h);
+ evas_object_size_hint_min_set(pi->proxy, w, h);
+ }
+ else evas_object_resize(pi->proxy, w, h);
+
+ return pi;
+}
+
+static Eina_Bool
+_elm_genlist_fx_capture(Evas_Object *obj, int level)
+{
+ ELM_GENLIST_DATA_GET(obj, sd);
+
+ Item_Block *itb;
+ Eina_List *l;
+ Eina_Bool done = EINA_FALSE;
+ Elm_Gen_Item *it;
+ Proxy_Item *pi;
+ Evas_Coord ox, oy, ow, oh;
+
+ if ((!sd->rendered) || (sd->fx_playing)) return EINA_FALSE;
+ if ((!level) && (sd->fx_first_captured)) return EINA_FALSE;
+ if ((level) && (!sd->fx_first_captured)) return EINA_FALSE;
+
+ evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh);
+
+ if (!level)
+ {
+ sd->fx_first_captured = EINA_TRUE;
+ EINA_LIST_FREE(sd->capture_before_items, pi)
+ {
+ if ((pi->it) && (GL_IT(pi->it))) GL_IT(pi->it)->has_proxy_it = EINA_FALSE;
+ if (pi->proxy) evas_object_smart_member_del(pi->proxy);
+ if (pi->proxy) evas_object_del(pi->proxy);
+ free(pi);
+ }
+ }
+ else
+ {
+ EINA_LIST_FREE(sd->capture_after_items, pi)
+ {
+ if ((pi->it) && (GL_IT(pi->it))) GL_IT(pi->it)->has_proxy_it = EINA_FALSE;
+ if (pi->proxy) evas_object_smart_member_del(pi->proxy);
+ if (pi->proxy) evas_object_del(pi->proxy);
+ free(pi);
+ }
+
+ EINA_INLIST_FOREACH(sd->blocks, itb)
+ {
+ if (itb->realized)
+ {
+ EINA_LIST_FOREACH(itb->items, l, it)
+ {
+ if (it->realized && it->item->scrl_y >= oy)
+ {
+ sd->realized_top_item = it;
+ break;
+ }
+ }
+ }
+ if (sd->realized_top_item) break;
+ }
+ }
+
+#if GENLIST_PINCH_ZOOM_SUPPORT
+ if (sd->pinch_zoom_mode)
+ {
+ EINA_INLIST_FOREACH(sd->blocks, itb)
+ {
+ EINA_LIST_FOREACH(itb->items, l, it)
+ {
+
+ if (IS_ROOT_PARENT_IT(it) && it->realized
+ && (GL_IT(it)->scrl_y + GL_IT(it)->h >= oy && GL_IT(it)->scrl_y <= oy + oh))
+ {
+ pi = _elm_genlist_proxy_item_new((Elm_Object_Item *)it);
+ if (!level) sd->capture_before_items = eina_list_append(sd->capture_before_items, pi);
+ else sd->capture_after_items = eina_list_append(sd->capture_after_items, pi);
+ }
+ }
+ }
+ if ((sd->pinch_zoom_mode == ELM_GEN_PINCH_ZOOM_CONTRACT) && (level)) return EINA_TRUE;
+ if ((sd->pinch_zoom_mode == ELM_GEN_PINCH_ZOOM_EXPAND) && (!level)) return EINA_TRUE;
+ }
+#endif
+
+ EINA_INLIST_FOREACH(sd->blocks, itb)
+ {
+ if (itb->realized)
+ {
+ done = EINA_TRUE;
+ EINA_LIST_FOREACH(itb->items, l, it)
+ {
+#if GENLIST_PINCH_ZOOM_SUPPORT
+ if ((sd->pinch_zoom_mode) && (IS_ROOT_PARENT_IT(it))) continue;
+#endif
+ if (it->realized)
+ {
+ pi = _elm_genlist_proxy_item_new((Elm_Object_Item *)it);
+ if (!pi) continue;
+ if (!level)
+ sd->capture_before_items = eina_list_append(sd->capture_before_items, pi);
+ else
+ sd->capture_after_items = eina_list_append(sd->capture_after_items, pi);
+ }
+ }
+ }
+ else if (done) break;
+ }
+ return EINA_TRUE;
+}
+
+static Elm_Gen_FX_Item *
+_elm_genlist_fx_item_find(const Elm_Object_Item *item)
+{
+ Elm_Gen_Item *it = (Elm_Gen_Item *)item;
+ if (!it) return EINA_FALSE;
+
+ Elm_Genlist_Smart_Data *sd = GL_IT(it)->wsd;
+ if (!sd) return NULL;
+
+ Elm_Gen_FX_Item *fi = NULL;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(sd->fx_items, l, fi)
+ {
+ if (fi->it == it) return fi;
+ }
+ return NULL;
+}
+
+static Elm_Gen_FX_Item *
+_elm_genlist_fx_item_new(const Proxy_Item *pi)
+{
+ if ((!pi) || (!pi->it)) return NULL;
+
+ Elm_Gen_FX_Item *fi = NULL;
+ fi = calloc(1, sizeof(Elm_Gen_FX_Item));
+ if (!fi) return NULL;
+
+ fi->it = pi->it;
+ GL_IT(fi->it)->fi = fi;
+ fi->proxy = pi->proxy;
+ fi->num = pi->num;
+ fi->from.x = fi->to.x = pi->x;
+ fi->from.y = fi->to.y = pi->y;
+ fi->from.w = fi->to.w = pi->w;
+ fi->from.h = fi->to.h = pi->h;
+ fi->update = EINA_FALSE;
+
+ return fi;
+}
+
+static Elm_Object_Item *
+_elm_genlist_fx_item_prev_get(const Elm_Object_Item *item)
+{
+ Elm_Gen_Item *it;
+ it = (Elm_Gen_Item *)item;
+ if ((!it) || (IS_ROOT_PARENT_IT(it))) return NULL;
+
+ while (it)
+ {
+ it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
+ if (it) break;
+ }
+
+ return (Elm_Object_Item *)it;
+}
+
+EAPI Eina_Bool
+_elm_genlist_fx_items_make(Evas_Object *obj)
+{
+ ELM_GENLIST_CHECK(obj) EINA_FALSE;
+ ELM_GENLIST_DATA_GET(obj, sd);
+
+ Elm_Gen_FX_Item *fi;
+ Proxy_Item *pi;
+ Eina_List *l;
+ Elm_Gen_Item *prev = NULL;
+ Evas_Coord ox, oy, ow, oh, mv_dist, max_mv_dist = 0;
+
+ evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh);
+
+ EINA_LIST_FOREACH(sd->capture_before_items, l, pi)
+ {
+ fi = _elm_genlist_fx_item_new(pi);
+ if (fi) sd->fx_items = eina_list_append(sd->fx_items, fi);
+ }
+
+ EINA_LIST_FOREACH(sd->capture_after_items, l, pi)
+ {
+ fi = _elm_genlist_fx_item_find((Elm_Object_Item *)pi->it);
+
+ if (fi) // pi exists in both before and after capture items
+ {
+ fi->type = ELM_GEN_ITEM_FX_TYPE_SAME;
+ fi->update = EINA_TRUE;
+ fi->to.x = pi->x;
+ fi->to.y = pi->y;
+ fi->to.w = pi->w;
+ fi->to.h = pi->h;
+
+ // find the max distance between before and after capture items
+ mv_dist = abs(fi->to.y - fi->from.y);
+ if (max_mv_dist < mv_dist) max_mv_dist = mv_dist;
+ }
+ else // pi only exists in after capture items
+ {
+ fi = _elm_genlist_fx_item_new(pi);
+ if (fi)
+ {
+ fi->type = ELM_GEN_ITEM_FX_TYPE_ADD;
+ fi->update = EINA_TRUE;
+ sd->fx_items = eina_list_append(sd->fx_items, fi);
+ }
+ }
+ }
+
+ EINA_LIST_FOREACH(sd->fx_items, l, fi)
+ {
+ // find deleted items
+ if (!fi->update) // pi only exists in before capture items
+ {
+ fi->type = ELM_GEN_ITEM_FX_TYPE_DEL;
+ fi->update = EINA_TRUE;
+
+ prev = (Elm_Gen_Item *)_elm_genlist_fx_item_prev_get((Elm_Object_Item *)fi->it);
+ if ((prev) && (GL_IT(prev)->fi))
+ {
+ fi->to.y = GL_IT(prev)->fi->to.y + GL_IT(prev)->fi->to.h;
+ }
+ }
+ else if (fi->type == ELM_GEN_ITEM_FX_TYPE_ADD)
+ {
+ prev = (Elm_Gen_Item *)_elm_genlist_fx_item_prev_get((Elm_Object_Item *)fi->it);
+ if ((prev) && (prev->realized) && (GL_IT(prev)->fi))
+ {
+ fi->from.y = GL_IT(prev)->fi->from.y + GL_IT(prev)->fi->from.h;
+ }
+ else
+ {
+ if (sd->realized_top_item)
+ {
+
+ if (fi->num <= sd->realized_top_item->item->num)
+ fi->from.y -= max_mv_dist;
+ else
+ fi->from.y += max_mv_dist;
+ }
+ }
+ }
+ }
+
+ EINA_LIST_FOREACH(sd->fx_items, l, fi)
+ {
+ if (IS_ROOT_PARENT_IT(fi->it))
+ {
+#if GENLIST_PINCH_ZOOM_SUPPORT
+ if (sd->pinch_zoom_mode == ELM_GEN_PINCH_ZOOM_CONTRACT)
+ {
+ fi->from.y = oy + GL_IT(fi->it)->pan_scrl_y - sd->pinch_pan_y;
+ }
+#endif
+ if (fi->type == ELM_GEN_ITEM_FX_TYPE_DEL)
+ {
+ if (sd->realized_top_item)
+ {
+
+ if (fi->num <= sd->realized_top_item->item->num)
+ fi->to.y = oy - fi->from.h;
+ else
+ fi->to.y = oy + oh;
+ }
+ }
+ }
+ }
+
+ return EINA_TRUE;
+}
+
+static Elm_Gen_FX_Item *
+_fx_cover_item_get(const Elm_Gen_FX_Item *fi)
+{
+ Elm_Gen_FX_Item *cover_fi;
+ Eina_List *l;
+ if (!fi) return NULL;
+
+ Elm_Genlist_Smart_Data *sd = GL_IT(fi->it)->wsd;
+ Evas_Coord ox, oy, ow, oh;
+ evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh);
+
+ EINA_LIST_FOREACH(sd->fx_items, l, cover_fi)
+ {
+ if (fi == cover_fi) continue;
+ if (sd->fx_items_deleted)
+ {
+ if ((cover_fi->from.y >= oy+oh || cover_fi->from.y > fi->to.y) && (cover_fi->from.y - cover_fi->to.y > 0))
+ return cover_fi;
+ }
+ else
+ {
+ if ((cover_fi->to.y > fi->to.y) && (cover_fi->from.y - cover_fi->to.y < 0))
+ return cover_fi;
+ }
+ }
+ return NULL;
+}
+
+static void
+_item_fx_op(Elm_Transit_Effect *data, Elm_Transit *transit __UNUSED__, double progress __UNUSED__)
+{
+ Elm_Gen_FX_Item *fi = data, *cover_it;
+ Elm_Genlist_Smart_Data *sd = GL_IT(fi->it)->wsd;
+ Evas_Coord fi_ox, fi_oy, cover_it_ox, cover_it_oy, ox, oy, ow, oh;
+
+ evas_object_show(VIEW(fi->it));
+ evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh);
+ evas_object_geometry_get(fi->proxy, &fi_ox, &fi_oy, NULL, NULL);
+ evas_object_move(fi->proxy, ox, fi_oy);
+ evas_object_show(fi->proxy);
+#if GENLIST_PINCH_ZOOM_SUPPORT
+ if ((sd->pinch_zoom_mode) && (IS_ROOT_PARENT_IT(fi->it))) evas_object_raise(fi->proxy);
+#endif
+
+ if ((!sd->expanded_next_item) || (sd->expanded_next_item == fi->it)) goto raise_event_block;
+ if (fi->type == ELM_GEN_ITEM_FX_TYPE_SAME) goto raise_event_block;
+
+ // find the closest item that cover current item when deleting
+ cover_it = _fx_cover_item_get(fi);
+ if (cover_it)
+ {
+ evas_object_geometry_get(cover_it->proxy, &cover_it_ox, &cover_it_oy, NULL, NULL);
+
+ if (sd->fx_items_deleted)
+ {
+ if (cover_it_oy
+ && (fi_oy + fi->to.h >= cover_it_oy + cover_it->to.h ) && (fi->from.y < cover_it->from.y))
+ evas_object_hide(fi->proxy);
+ }
+ else if (cover_it_oy && (fi_oy >= cover_it_oy))
+ evas_object_hide(fi->proxy);
+ else
+ evas_object_show(fi->proxy);
+ }
+
+raise_event_block:
+ evas_object_raise(sd->alpha_bg);
+
+ return;
+}
+
+
+static void
+_item_fx_done(Elm_Transit_Effect *data, Elm_Transit *transit __UNUSED__)
+{
+ Elm_Gen_FX_Item *fx_done_it = data;
+ Elm_Genlist_Smart_Data *sd = GL_IT(fx_done_it->it)->wsd;
+
+ if ((!fx_done_it) || (!fx_done_it->it) || (!sd)) return;
+
+ evas_object_image_source_visible_set(fx_done_it->proxy, EINA_TRUE);
+ evas_object_lower(fx_done_it->proxy);
+
+ if ((sd->decorate_all_mode) && (fx_done_it->it->deco_all_view))
+ evas_object_move(fx_done_it->it->deco_all_view, fx_done_it->to.x, fx_done_it->to.y);
+ else
+ evas_object_move(VIEW(fx_done_it->it), fx_done_it->to.x, fx_done_it->to.y);
+ GL_IT(fx_done_it->it)->has_proxy_it = EINA_FALSE;
+
+ evas_object_clip_unset(fx_done_it->proxy);
+}
+
+static void
+_item_fx_del_cb(void *data, Elm_Transit *transit __UNUSED__)
+{
+ Elm_Gen_FX_Item *fx_done_it = data;
+ Elm_Gen_Item *it = NULL;
+ Proxy_Item *pi = NULL;
+ Eina_List *l;
+ Elm_Genlist_Smart_Data *sd = GL_IT(fx_done_it->it)->wsd;
+
+ if ((!fx_done_it) || (!fx_done_it->it) || (!sd)) return;
+
+ sd->fx_items = eina_list_remove(sd->fx_items, fx_done_it);
+ GL_IT(fx_done_it->it)->fi = NULL;
+ free(fx_done_it);
+
+ if (!eina_list_count(sd->fx_items))
+ {
+ EINA_LIST_FREE (sd->pending_unrealized_items, it)
+ {
+ if (GL_IT(it)) GL_IT(it)->has_proxy_it = EINA_FALSE;
+#if GENLIST_PINCH_ZOOM_SUPPORT
+ if ((sd->pinch_zoom_mode) && (IS_ROOT_PARENT_IT(it))) continue;
+#endif
+ _item_unrealize(it, EINA_FALSE);
+ }
+ EINA_LIST_FREE (sd->pending_unrealized_decorate_all_items, it)
+ {
+ if (GL_IT(it)) GL_IT(it)->has_proxy_it = EINA_FALSE;
+#if GENLIST_PINCH_ZOOM_SUPPORT
+ if ((sd->pinch_zoom_mode) && (IS_ROOT_PARENT_IT(it))) continue;
+#endif
+ _decorate_all_item_unrealize(it);
+ }
+
+ EINA_LIST_FREE (sd->pending_del_items, it)
+ {
+ _item_free(it);
+ _elm_widget_item_free((Elm_Widget_Item *)it);
+ }
+
+ EINA_LIST_FOREACH(sd->capture_before_items, l, pi)
+ evas_object_hide(pi->proxy);
+ EINA_LIST_FOREACH(sd->capture_after_items, l, pi)
+ evas_object_hide(pi->proxy);
+
+ sd->fx_playing = EINA_FALSE;
+ sd->fx_first_captured = EINA_FALSE;
+ evas_object_hide(sd->alpha_bg);
+
+ sd->realized_top_item = NULL;
+ sd->pan_changed = EINA_TRUE;
+ evas_object_smart_changed(sd->pan_obj);
+ }
+}
+
+static void
+_elm_genlist_fx_play(Evas_Object *obj)
+{
+ ELM_GENLIST_CHECK(obj);
+ ELM_GENLIST_DATA_GET(obj, sd);
+
+ Evas_Coord ox, oy, ow, oh, cvx, cvy, cvw, cvh;
+ Elm_Gen_FX_Item *fi;
+ Eina_List *l;
+
+ if (!sd->fx_mode) return;
+
+ EINA_LIST_FREE(sd->fx_items, fi)
+ {
+ if (fi->trans) elm_transit_del(fi->trans);
+ free(fi);
+ }
+ _item_cache_all_free(sd);
+
+ _elm_genlist_fx_items_make(obj);
+ if (!eina_list_count(sd->fx_items) || (sd->queue))
+ {
+ _elm_genlist_fx_clear(obj);
+ return;
+ }
+
+ sd->fx_playing = EINA_TRUE;
+
+ if (!sd->alpha_bg) sd->alpha_bg = _tray_alpha_bg_create(obj);
+ evas_object_show(sd->alpha_bg);
+
+ evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh);
+ evas_output_viewport_get(evas_object_evas_get(obj), &cvx, &cvy, &cvw, &cvh);
+
+ EINA_LIST_FOREACH(sd->fx_items, l, fi)
+ {
+ if (!fi->proxy) continue;
+
+ if ((fi->from.y <= oy) || (fi->from.y + fi->from.h >= oy + oh))
+ {
+ if ((sd->decorate_all_mode) && (fi->it->deco_all_view))
+ evas_object_move(fi->it->deco_all_view, cvx, fi->to.y);
+ else
+ evas_object_move(VIEW(fi->it), cvx, fi->to.y);
+ }
+ else if ((fi->to.y <= oy) || (fi->to.y + fi->to.h >= oy + oh))
+ {
+ if ((sd->decorate_all_mode) && (fi->it->deco_all_view))
+ evas_object_move(fi->it->deco_all_view, cvx, fi->from.y);
+ else
+ evas_object_move(VIEW(fi->it), cvx, fi->from.y);
+ }
+
+ evas_object_resize(fi->proxy, ow, fi->to.h);
+ evas_object_show(fi->proxy);
+
+ fi->trans = elm_transit_add();
+ elm_transit_object_add(fi->trans, fi->proxy);
+
+ evas_object_image_source_visible_set(fi->proxy, EINA_FALSE);
+ elm_transit_tween_mode_set(fi->trans, ELM_TRANSIT_TWEEN_MODE_DECELERATE);
+
+ if (fi->type == ELM_GEN_ITEM_FX_TYPE_SAME)
+ {
+ evas_object_raise(fi->proxy);
+ elm_transit_effect_translation_add(fi->trans, fi->from.x, fi->from.y, fi->to.x, fi->to.y);
+ }
+
+ else if (fi->type == ELM_GEN_ITEM_FX_TYPE_ADD)
+ {
+ elm_transit_effect_translation_add(fi->trans, fi->from.x, fi->from.y, fi->to.x, fi->to.y);
+ elm_transit_effect_color_add(fi->trans, 0, 0, 0, 0, 255, 255, 255, 255);
+ }
+ else if (fi->type == ELM_GEN_ITEM_FX_TYPE_DEL)
+ {
+ elm_transit_effect_translation_add(fi->trans, fi->from.x, fi->from.y, fi->to.x, fi->to.y);
+ elm_transit_effect_color_add(fi->trans, 255, 255, 255, 255, 0, 0, 0, 0);
+ }
+ elm_transit_effect_add(fi->trans, _item_fx_op, fi, _item_fx_done);
+ elm_transit_del_cb_set(fi->trans, _item_fx_del_cb, fi);
+
+ elm_transit_duration_set(fi->trans, FX_MOVE_TIME);
+ elm_transit_objects_final_state_keep_set(fi->trans, EINA_FALSE);
+ elm_transit_go(fi->trans);
+ }
+}
+#endif
+
+#if GENLIST_PINCH_ZOOM_SUPPORT
+EAPI Eina_Bool
+elm_genlist_pinch_zoom_mode_set(Evas_Object *obj, Elm_Gen_Pinch_Zoom_Mode mode)
+{
+ ELM_GENLIST_DATA_GET(obj, sd);
+
+ Item_Block *itb;
+ Eina_List *l;
+ Elm_Gen_Item *it;
+ Eina_Bool done = EINA_FALSE;
+
+ if ((sd->queue) || (!sd->rendered) || (sd->queue_idle_enterer)) return EINA_FALSE;
+
+ EINA_INLIST_FOREACH(sd->blocks, itb)
+ {
+ EINA_LIST_FOREACH(itb->items, l, it)
+ {
+
+ if (IS_ROOT_PARENT_IT(it))
+ {
+ done = EINA_TRUE;
+ break;
+ }
+ }
+ if (done) break;
+ }
+ if (!done) return EINA_FALSE;
+
+ sd->pinch_zoom_mode = mode;
+
+ _item_cache_all_free(sd);
+ _elm_genlist_fx_capture(obj, 0);
+
+ sd->pinch_pan_y = sd->pan_y;
+
+ if (sd->pinch_zoom_mode == ELM_GEN_PINCH_ZOOM_CONTRACT)
+ sd->s_iface->content_region_show(obj, 0,0,0,0);
+
+ sd->pan_changed = EINA_TRUE;
+ evas_object_smart_changed(sd->pan_obj);
+
+ return EINA_TRUE;
+}
+#endif
Evas_Callback_Type event_type,
Elm_Gesture_Type g_type)
{
+ Evas_Event_Flags ev_flag = EVAS_EVENT_FLAG_NONE;
+ Gesture_Info *gesture;
+ Rotate_Type *st = NULL;
+
if (!_elm_config->glayer_rotate_finger_enable)
return;
if (!sd->gesture[g_type]) return;
- Gesture_Info *gesture = sd->gesture[g_type];
- Rotate_Type *st;
- if (gesture)
+ gesture = sd->gesture[g_type];
+
+ if (!gesture) return ;
+
+ st = gesture->data;
+ if (!st) /* Allocated once on first time */
{
- st = gesture->data;
- if (!st) /* Allocated once on first time */
- {
- st = calloc(1, sizeof(Rotate_Type));
- gesture->data = st;
- _rotate_test_reset(gesture);
- }
+ st = calloc(1, sizeof(Rotate_Type));
+ gesture->data = st;
+ _rotate_test_reset(gesture);
}
- Evas_Event_Flags ev_flag = EVAS_EVENT_FLAG_NONE;
switch (event_type)
{
case EVAS_CALLBACK_MOUSE_MOVE:
ERR("could not generate thumbnail for %s (key: %s)",
sd->thumb.file.path, sd->thumb.file.key);
- evas_object_smart_callback_call(data, SIG_THUMB_ERROR, NULL);
+ evas_object_smart_callback_call(ELM_WIDGET_DATA(sd)->obj, SIG_THUMB_ERROR, NULL);
_icon_thumb_cleanup(client);
}
EAPI const char ELM_INDEX_SMART_NAME[] = "elm_index";
+#define INDEX_DELAY_CHANGE_TIME 0.2
+
static const char SIG_CHANGED[] = "changed";
static const char SIG_DELAY_CHANGED[] = "delay,changed";
static const char SIG_SELECTED[] = "selected";
static const char SIG_LEVEL_UP[] = "level,up";
static const char SIG_LEVEL_DOWN[] = "level,down";
+static const char SIG_LANG_CHANGED[] = "language,changed";
+
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_CHANGED, ""},
{SIG_DELAY_CHANGED, ""},
{SIG_SELECTED, ""},
{SIG_LEVEL_UP, ""},
{SIG_LEVEL_DOWN, ""},
+ {SIG_LANG_CHANGED, ""},
{NULL, NULL}
};
(ELM_INDEX_SMART_NAME, _elm_index, Elm_Index_Smart_Class,
Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
+static Eina_Bool
+_elm_index_smart_translate(Evas_Object *obj)
+{
+ evas_object_smart_callback_call(obj, SIG_LANG_CHANGED, NULL);
+ return EINA_TRUE;
+}
+
static void
_item_free(Elm_Index_Item *it)
{
ELM_INDEX_DATA_GET(WIDGET(it), sd);
sd->items = eina_list_remove(sd->items, it);
- if (it->letter)
- {
- eina_stringshare_del(it->letter);
- it->letter = NULL;
- }
+
+ if (it->omitted)
+ it->omitted = eina_list_free(it->omitted);
+
+ if (it->letter)
+ eina_stringshare_del(it->letter);
}
static void
}
static void
+_access_widget_item_activate_cb(void *data __UNUSED__,
+ Evas_Object *part_obj __UNUSED__,
+ Elm_Object_Item *it)
+{
+ evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, it);
+}
+
+static void
_access_widget_item_register(Elm_Index_Item *it)
{
Elm_Access_Info *ai;
_elm_access_text_set(ai, ELM_ACCESS_TYPE, E_("Index Item"));
_elm_access_callback_set(ai, ELM_ACCESS_INFO, _access_info_cb, it);
+ _elm_access_activate_callback_set
+ (ai, _access_widget_item_activate_cb, NULL);
}
static void
_omit_calc(void *data, int num_of_items, int max_num_of_items)
{
Elm_Index_Smart_Data *sd = data;
- int max_group_num, num_of_extra_items, i, g, size, sum;
+ int max_group_num, num_of_extra_items, i, g, size, sum, *group_pos, *omit_info;
Elm_Index_Omit *o;
- Elm_Index_Item *it, *it2;
+ Elm_Index_Item *it;
Eina_List *l;
EINA_LIST_FREE(sd->omit, o)
- free(o);
+ free(o);
EINA_LIST_FOREACH(sd->items, l, it)
{
if (it->head) it->head = NULL;
}
- if (max_num_of_items < 3 || num_of_items <= max_num_of_items) return;
+ if ((max_num_of_items < 3) || (num_of_items <= max_num_of_items)) return;
max_group_num = (max_num_of_items - 1) / 2;
num_of_extra_items = num_of_items - max_num_of_items;
- int group_pos[max_group_num];
- int omit_info[max_num_of_items];
+ group_pos = (int *)malloc(sizeof(int) * max_group_num);
+ omit_info = (int *)malloc(sizeof(int) * max_num_of_items);
if (num_of_extra_items >= max_group_num)
{
for (i = 0; i < num_of_extra_items; i++)
omit_info[group_pos[i % max_group_num]]++;
- g = 0;
sum = 0;
for (i = 0; i < max_num_of_items; i++)
{
o->offset = sum;
o->count = omit_info[i];
sd->omit = eina_list_append(sd->omit, o);
- g++;
}
sum += omit_info[i];
}
+
+ free(group_pos);
+ free(omit_info);
}
// FIXME: always have index filled
int i = 0, max_num_of_items = 0, num_of_items = 0, g = 0, skip = 0;
Eina_List *l;
Eina_Bool rtl;
- Elm_Index_Item *it, *head;
- Evas_Coord mw, mh, ih, vh;
+ Elm_Index_Item *it, *head = NULL;
+ Evas_Coord mw, mh, ih;
+ Evas_Object *o;
Elm_Index_Omit *om;
- Evas_Object *o_odd, *o_even;
ELM_INDEX_DATA_GET(obj, sd);
rtl = elm_widget_mirrored_get(obj);
- o_odd = edje_object_add(evas_object_evas_get(obj));
- o_even = edje_object_add(evas_object_evas_get(obj));
-
- if (!sd->horizontal)
+ if (sd->omit_enabled)
{
+ o = edje_object_add(evas_object_evas_get(obj));
elm_widget_theme_object_set
- (obj, o_odd, "index", "item_odd/vertical",
- elm_widget_style_get(obj));
- elm_widget_theme_object_set
- (obj, o_even, "index", "item/vertical",
+ (obj, o, "index", "item/vertical",
elm_widget_style_get(obj));
- edje_object_size_min_restricted_calc(o_odd, NULL, &mh, 0, 0);
- edje_object_size_min_restricted_calc(o_even, NULL, &vh, 0, 0);
- if (vh > mh) mh = vh;
+ edje_object_size_min_restricted_calc(o, NULL, &mh, 0, 0);
EINA_LIST_FOREACH(sd->items, l, it)
- {
- if (it->level == level) num_of_items++;
- }
+ if (it->level == level) num_of_items++;
if (mh != 0)
max_num_of_items = ih / mh;
om = eina_list_nth(sd->omit, g);
EINA_LIST_FOREACH(sd->items, l, it)
{
- Evas_Object *o;
const char *stacking;
if (it->level != level) continue;
- if (om && i == om->offset)
+ if ((om) && (i == om->offset))
{
skip = om->count;
skip--;
i++;
// ACCESS
- if ((it->level == 0) &&
- (_elm_config->access_mode == ELM_ACCESS_MODE_ON))
+ if ((it->level == 0) && (_elm_config->access_mode))
_access_widget_item_register(it);
}
+ // TIZEN ONLY adjust the last item's theme according to winset gui
+ it = eina_list_nth(sd->items, i - 1);
+ edje_object_signal_emit(VIEW(it), "elm,last,item", "elm");
+ // TIZEN ONLY
+
evas_object_smart_calculate(box);
sd->level_active[level] = 1;
}
_elm_index_smart_theme(Evas_Object *obj)
{
Evas_Coord minw = 0, minh = 0;
- Eina_List *l;
Elm_Index_Item *it;
ELM_INDEX_DATA_GET(obj, sd);
}
else elm_layout_signal_emit(obj, "elm,state,inactive", "elm");
- EINA_LIST_FOREACH(sd->items, l, it)
+ it = (Elm_Index_Item *)elm_index_selected_item_get(obj, sd->level);
+ if (it)
{
- if (it->selected)
- edje_object_signal_emit(VIEW(it), "elm,state,active", "elm");
+ if (it->head)
+ edje_object_signal_emit(VIEW(it->head), "elm,state,active", "elm");
+ else
+ edje_object_signal_emit(VIEW(it), "elm,state,active", "elm");
}
return EINA_TRUE;
}
static Eina_Bool
-_delay_change(void *data)
+_delay_change_cb(void *data)
{
Elm_Object_Item *item;
dist = 0x7fffffff;
dh = h / size;
if (dh == 0)
- printf("too many index items to omit\n"); // omit mode not possible
+ printf("too many index items to omit\n"); //FIXME
else
{
for (j = 0; j < size; j++)
it = it_closest;
- if (!(it_last && it_last->head && it_last->head == it_closest))
+ if (!((it_last) && (it_last->head) && (it_last->head == it_closest)))
{
edje_object_signal_emit(VIEW(it), "elm,state,active", "elm");
selectraise = edje_object_data_get(VIEW(it), "selectraise");
if ((selectraise) && (!strcmp(selectraise, "on")))
evas_object_raise(VIEW(it));
}
- // ACCESS
- if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
- {
- char *ret;
- Eina_Strbuf *buf;
- buf = eina_strbuf_new();
-
- if (om_closest)
- eina_strbuf_append_printf(buf, "index item %s clicked", om_closest->letter);
- else
- eina_strbuf_append_printf(buf, "index item %s clicked", it->letter);
- ret = eina_strbuf_string_steal(buf);
- eina_strbuf_free(buf);
-
- _elm_access_highlight_set(it->base.access_obj);
- _elm_access_say(ret);
- }
if (om_closest)
evas_object_smart_callback_call
- (obj, SIG_CHANGED, (void *)om_closest);
+ (obj, SIG_CHANGED, om_closest);
else
evas_object_smart_callback_call
- (obj, SIG_CHANGED, (void *)it);
+ (obj, SIG_CHANGED, it);
if (sd->delay) ecore_timer_del(sd->delay);
- sd->delay = ecore_timer_add(0.2, _delay_change, obj);
+ sd->delay = ecore_timer_add(sd->delay_change_time,
+ _delay_change_cb, obj);
}
}
if (it_closest)
if (!sd->autohide_disabled)
{
_index_box_clear(data, sd->bx[1], 1);
- _index_box_auto_fill(data, sd->bx[0], 0);
elm_layout_signal_emit(data, "elm,state,active", "elm");
}
_sel_eval(data, ev->canvas.x, ev->canvas.y);
}
static void
-_on_mouse_in_access(void *data,
- Evas *e __UNUSED__,
- Evas_Object *o __UNUSED__,
- void *event_info __UNUSED__)
-{
- ELM_INDEX_DATA_GET(data, sd);
-
- if (sd->down) return;
-
- if (!sd->autohide_disabled)
- {
- _index_box_clear(data, sd->bx[1], 1);
- _index_box_auto_fill(data, sd->bx[0], 0);
- elm_layout_signal_emit(data, "elm,state,active", "elm");
- }
-}
-
-static void
-_on_mouse_move_access(void *data,
- Evas *e __UNUSED__,
- Evas_Object *o __UNUSED__,
- void *event_info)
-{
-
- Evas_Event_Mouse_Down *ev = event_info;
- Elm_Index_Item *it, *it_closest;
- Eina_List *l;
- Evas_Coord dist = 0;
- Evas_Coord x, y, w, h, xx, yy;
-
- ELM_INDEX_DATA_GET(data, sd);
-
- it_closest = NULL;
- dist = 0x7fffffff;
-
- EINA_LIST_FOREACH(sd->items, l, it)
- {
- evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
- xx = x + (w / 2);
- yy = y + (h / 2);
- x = ev->canvas.x - xx;
- y = ev->canvas.y - yy;
- x = (x * x) + (y * y);
- if ((x < dist) || (!it_closest))
- {
- it_closest = it;
- dist = x;
- }
- }
-
- if (it_closest)
- _elm_access_highlight_set(it_closest->base.access_obj);
-}
-
-static void
-_on_mouse_out_access(void *data,
- Evas *e __UNUSED__,
- Evas_Object *o __UNUSED__,
- void *event_info __UNUSED__)
+_access_activate_cb(void *data,
+ Evas_Object *part_obj __UNUSED__,
+ Elm_Object_Item *item __UNUSED__)
{
+ Elm_Index_Item *it;
ELM_INDEX_DATA_GET(data, sd);
- if (!sd->autohide_disabled)
- elm_layout_signal_emit(data, "elm,state,inactive", "elm");
+ it = eina_list_nth(sd->items, 0);
+ _elm_access_highlight_set(it->base.access_obj);
+ sd->index_focus = EINA_TRUE;
}
static void
_access_index_register(Evas_Object *obj)
{
Evas_Object *ao;
+ Elm_Access_Info *ai;
elm_widget_can_focus_set(obj, EINA_TRUE);
+
ao = _elm_access_edje_object_part_object_register
(obj, elm_layout_edje_get(obj), "access");
+ ai = _elm_access_object_get(ao);
+
_elm_access_text_set
- (_elm_access_object_get(ao), ELM_ACCESS_TYPE, E_("Index"));
+ (ai, ELM_ACCESS_TYPE, E_("Index"));
+ _elm_access_activate_callback_set
+ (ai, _access_activate_cb, obj);
}
static void
-_index_resize_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+_index_resize_cb(void *data,
+ Evas *e __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
{
ELM_INDEX_DATA_GET_OR_RETURN(data, sd);
- if (sd->horizontal) return;
+ if (!sd->omit_enabled) return;
- Eina_List *l;
Elm_Index_Item *it;
_index_box_clear(data, sd->bx[0], 0);
_index_box_auto_fill(data, sd->bx[0], 0);
- if (sd->autohide_disabled)
- elm_layout_signal_emit(data, "elm,state,active", "elm");
-
- EINA_LIST_FOREACH(sd->items, l, it)
+ it = (Elm_Index_Item *)elm_index_selected_item_get(obj, sd->level);
+ if (it)
{
- if (it->selected)
+ if (it->head)
+ edje_object_signal_emit(VIEW(it->head), "elm,state,active", "elm");
+ else
edje_object_signal_emit(VIEW(it), "elm,state,active", "elm");
}
}
ELM_WIDGET_CLASS(_elm_index_parent_sc)->base.add(obj);
- priv->indicator_disabled = EINA_FALSE;
- priv->horizontal = EINA_FALSE;
- priv->autohide_disabled = EINA_FALSE;
-
elm_layout_theme_set
(obj, "index", "base/vertical", elm_widget_style_get(obj));
evas_object_event_callback_add
(o, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move, obj);
-
- // ACCESS
- if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
- {
- evas_object_event_callback_add
- (o, EVAS_CALLBACK_MOUSE_IN, _on_mouse_in_access, obj);
- evas_object_event_callback_add
- (o, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move_access, obj);
- evas_object_event_callback_add
- (o, EVAS_CALLBACK_MOUSE_OUT, _on_mouse_out_access, obj);
- }
-
if (edje_object_part_exists
(ELM_WIDGET_DATA(priv)->resize_obj, "elm.swallow.event.1"))
{
elm_layout_content_set(obj, "elm.swallow.index.0", priv->bx[0]);
evas_object_show(priv->bx[0]);
+ priv->delay_change_time = INDEX_DELAY_CHANGE_TIME;
+ priv->omit_enabled = 1;
+
if (edje_object_part_exists
(ELM_WIDGET_DATA(priv)->resize_obj, "elm.swallow.index.1"))
{
_mirrored_set(obj, elm_widget_mirrored_get(obj));
elm_layout_sizing_eval(obj);
- elm_widget_can_focus_set(obj, EINA_FALSE); // check!!
+ elm_widget_can_focus_set(obj, EINA_FALSE);
// ACCESS
- if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
- _access_index_register(obj);
+ if (_elm_config->access_mode)
+ {
+ elm_index_autohide_disabled_set(obj, EINA_TRUE);
+ elm_layout_signal_emit(obj, "elm,access,state,active", "elm");
+ _access_index_register(obj);
+ }
}
static void
}
EINA_LIST_FREE(sd->omit, o)
- free(o);
+ free(o);
if (sd->delay) ecore_timer_del(sd->delay);
Elm_Index_Item *it;
Evas_Object *ao;
Evas_Object *po;
+ Eina_Bool ret;
ELM_INDEX_CHECK(obj) EINA_FALSE;
ELM_INDEX_DATA_GET(obj, sd);
ao = evas_object_data_get(po, "_part_access_obj");
items = eina_list_append(items, ao);
- EINA_LIST_FOREACH(sd->items, l, it)
+ if (sd->index_focus)
{
- if (it->level != 0) continue;
- items = eina_list_append(items, it->base.access_obj);
+ EINA_LIST_FOREACH(sd->items, l, it)
+ {
+ if (it->level != 0) continue;
+ items = eina_list_append(items, it->base.access_obj);
+ }
}
- Eina_Bool ret;
ret = elm_widget_focus_list_next_get
(obj, items, eina_list_data_get, dir, next);
- // to hide index item, if there is nothing to focus on autohide disalbe mode
- if ((!sd->autohide_disabled) && (!ret))
- elm_layout_signal_emit((Evas_Object *)obj, "elm,state,inactive", "elm");
+ if (!ret)
+ {
+ sd->index_focus = EINA_FALSE;
+
+ Evas_Object *it_access_obj = eina_list_nth(items, eina_list_count(items) - 1);
+
+ items = eina_list_free(items);
+ items = eina_list_append(items, it_access_obj);
+ items = eina_list_append(items, ao);
+
+ ret = elm_widget_focus_list_next_get(obj, items, eina_list_data_get, dir, next);
+
+ // to hide index item, if there is nothing to focus on autohide disalbe mode
+ if (!sd->autohide_disabled)
+ elm_layout_signal_emit((Evas_Object *)obj, "elm,state,inactive", "elm");
+ }
return ret;
}
if (is_access)
{
+ elm_index_autohide_disabled_set(obj, EINA_TRUE);
+ elm_layout_signal_emit(obj, "elm,access,state,active", "elm");
_access_index_register(obj);
-
- evas_object_event_callback_add
- (sd->event[0], EVAS_CALLBACK_MOUSE_IN, _on_mouse_in_access, obj);
- evas_object_event_callback_add
- (sd->event[0], EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move_access, obj);
- evas_object_event_callback_add
- (sd->event[0], EVAS_CALLBACK_MOUSE_OUT, _on_mouse_out_access, obj);
}
else
{
// opposition of _access_index_register();
+ elm_index_autohide_disabled_set(obj, EINA_FALSE);
+ elm_layout_signal_emit(obj, "elm,access,state,inactive", "elm");
elm_widget_can_focus_set(obj, EINA_FALSE);
_elm_access_edje_object_part_object_unregister
(obj, elm_layout_edje_get(obj), "access");
-
- evas_object_event_callback_del_full
- (sd->event[0], EVAS_CALLBACK_MOUSE_IN, _on_mouse_in_access, obj);
- evas_object_event_callback_del_full
- (sd->event[0], EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move_access, obj);
- evas_object_event_callback_del_full
- (sd->event[0], EVAS_CALLBACK_MOUSE_OUT, _on_mouse_out_access, obj);
}
}
ELM_WIDGET_CLASS(sc)->base.del = _elm_index_smart_del;
ELM_WIDGET_CLASS(sc)->theme = _elm_index_smart_theme;
+ ELM_WIDGET_CLASS(sc)->translate = _elm_index_smart_translate;
/* not a 'focus chain manager' */
ELM_WIDGET_CLASS(sc)->focus_next = NULL;
ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_index_smart_sizing_eval;
- if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
+ if (_elm_config->access_mode)
ELM_WIDGET_CLASS(sc)->focus_next = _elm_index_smart_focus_next;
ELM_WIDGET_CLASS(sc)->access = _access_hook;
if (sd->autohide_disabled)
{
_index_box_clear(obj, sd->bx[1], 1);
- _index_box_auto_fill(obj, sd->bx[0], 0);
elm_layout_signal_emit(obj, "elm,state,active", "elm");
}
else
return sd->level;
}
+//FIXME: Should update indicator based on the autohidden status & indicator visiblility
EAPI void
elm_index_item_selected_set(Elm_Object_Item *it,
Eina_Bool selected)
{
- Evas_Coord x, y, w, h;
+ Elm_Index_Item *it_sel, *it_last;
+ Evas_Object *obj = WIDGET(it);
ELM_INDEX_ITEM_CHECK_OR_RETURN(it);
+ ELM_INDEX_DATA_GET(obj, sd);
- //FIXME: Should be update indicator based on the autohidden status
- //& indicator visiblility
+ selected = !!selected;
+ it_sel = (Elm_Index_Item *)it;
+ if (it_sel->selected == selected) return;
if (selected)
{
- evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
- _sel_eval(WIDGET(it), x + (w / 2), y + (h / 2));
- edje_object_signal_emit(VIEW(it), "elm,state,active", "elm");
+ it_last = (Elm_Index_Item *)elm_index_selected_item_get(obj, sd->level);
+
+ if (it_last)
+ {
+ it_last->selected = 0;
+ if (it_last->head)
+ edje_object_signal_emit(VIEW(it_last->head), "elm,state,inactive", "elm");
+ else
+ edje_object_signal_emit(VIEW(it_last), "elm,state,inactive", "elm");
+ }
+ it_sel->selected = 1;
+ if (it_sel->head)
+ edje_object_signal_emit(VIEW(it_sel->head), "elm,state,active", "elm");
+ else
+ edje_object_signal_emit(VIEW(it_sel), "elm,state,active", "elm");
+
+ evas_object_smart_callback_call
+ (obj, SIG_CHANGED, it);
+ evas_object_smart_callback_call
+ (obj, SIG_SELECTED, it);
+ if (sd->delay) ecore_timer_del(sd->delay);
+ sd->delay = ecore_timer_add(sd->delay_change_time,
+ _delay_change_cb, obj);
+ }
+ else
+ {
+ it_sel->selected = 0;
+ if (it_sel->head)
+ edje_object_signal_emit(VIEW(it_sel->head), "elm,state,inactive", "elm");
+ else
+ edje_object_signal_emit(VIEW(it_sel), "elm,state,inactive", "elm");
}
- else _sel_eval(WIDGET(it), -99999, -9999);
}
EAPI Elm_Object_Item *
ELM_INDEX_CHECK(obj);
ELM_INDEX_DATA_GET(obj, sd);
+ _index_box_clear(obj, sd->bx[0], 0);
_index_box_auto_fill(obj, sd->bx[0], 0);
- if (sd->level == 1) _index_box_auto_fill(obj, sd->bx[1], 1);
+ if (sd->level == 1)
+ {
+ _index_box_clear(obj, sd->bx[1], 1);
+ _index_box_auto_fill(obj, sd->bx[1], 1);
+ }
}
EAPI void
if (horizontal == sd->horizontal) return;
sd->horizontal = horizontal;
+ if (horizontal)
+ sd->omit_enabled = EINA_FALSE;
_elm_index_smart_theme(obj);
}
return sd->horizontal;
}
+
+EAPI void
+elm_index_delay_change_time_set(Evas_Object *obj, double delay_change_time)
+{
+ ELM_INDEX_CHECK(obj);
+ ELM_INDEX_DATA_GET(obj, sd);
+
+ sd->delay_change_time = delay_change_time;
+}
+
+EAPI double
+elm_index_delay_change_time_get(const Evas_Object *obj)
+{
+ ELM_INDEX_CHECK(obj) 0.0;
+ ELM_INDEX_DATA_GET(obj, sd);
+
+ return sd->delay_change_time;
+}
+
+EAPI void
+elm_index_omit_enabled_set(Evas_Object *obj,
+ Eina_Bool enabled)
+{
+ ELM_INDEX_CHECK(obj);
+ ELM_INDEX_DATA_GET(obj, sd);
+
+ if (sd->horizontal) return;
+
+ enabled = !!enabled;
+ if (sd->omit_enabled == enabled) return;
+ sd->omit_enabled = enabled;
+
+ _index_box_clear(obj, sd->bx[0], 0);
+ _index_box_auto_fill(obj, sd->bx[0], 0);
+ if (sd->level == 1)
+ {
+ _index_box_clear(obj, sd->bx[1], 1);
+ _index_box_auto_fill(obj, sd->bx[1], 1);
+ }
+}
+
+EAPI Eina_Bool
+elm_index_omit_enabled_get(const Evas_Object *obj)
+{
+ ELM_INDEX_CHECK(obj) EINA_FALSE;
+ ELM_INDEX_DATA_GET(obj, sd);
+
+ return sd->omit_enabled;
+}
* level to the second level
* - @c "level,down" - when the user moves a finger from the second
* level to the first level
+ * - @c "language,changed" - the program's language changed
*
* The @c "delay,changed" event is so that it'll wait a small time
* before actually reporting those events and, moreover, just the
EAPI void elm_index_item_clear(Evas_Object *obj);
/**
- * Go to a given items level on a index widget
+ * Flush the changes made to the index items so they work correctly
+ *
+ * This flushes any changes made to items indicating the object is ready to
+ * go. You should call this before any changes you expect to work. This
+ * is similar to elm_list_go().
*
* @param obj The index object
- * @param level The index level (one of @c 0 or @c 1)
+ * @param level The index level (one of @c 0 or @c 1) where changes were made
+ *
+ * @warning If not called, it won't display the index properly.
*
* @ingroup Index
*/
EAPI Eina_Bool elm_index_horizontal_get(const Evas_Object *obj);
/**
+ * Set a delay change time for index object.
+ *
+ * @param obj The index object.
+ * @param delay_change_time The delay change time to set.
+ *
+ * @note delay time is 0.2 sec by default.
+ *
+ * @see elm_index_delay_change_time_get
+ *
+ * @ingroup Index
+ */
+EAPI void elm_index_delay_change_time_set(Evas_Object *obj, double delay_change_time);
+
+/**
+ * Get a delay change time for index object.
+ *
+ * @param obj The index object.
+ * @return delay change time in seconds
+ *
+ * @see elm_index_delay_change_time_set
+ *
+ * @ingroup Index
+ */
+EAPI double elm_index_delay_change_time_get(const Evas_Object *obj);
+
+/**
+ * Enable or disable omit feature for a given index widget.
+ *
+ * @param obj The index object
+ * @param enabled @c EINA_TRUE to enable omit feature, @c EINA_FALSE to disable
+ *
+ * @see elm_index_omit_enabled_get()
+ *
+ * @ingroup Index
+ */
+EAPI void elm_index_omit_enabled_set(Evas_Object *obj, Eina_Bool enabled);
+
+/**
+ * Get whether omit feature is enabled or not for a given index widget.
+ *
+ * @param obj The index object
+ * @return @c EINA_TRUE, if omit feature is enabled, @c EINA_FALSE otherwise
+ *
+ * @see elm_index_omit_enabled_set() for more details
+ *
+ * @ingroup Index
+ */
+EAPI Eina_Bool elm_index_omit_enabled_get(const Evas_Object *obj);
+
+/**
* @}
*/
static const char PAN_SMART_NAME[] = "elm_pan";
-#define ELM_PAN_DATA_GET(o, sd) \
- Elm_Pan_Smart_Data * sd = evas_object_smart_data_get(o)
-
-#define ELM_PAN_DATA_GET_OR_RETURN(o, ptr) \
- ELM_PAN_DATA_GET(o, ptr); \
- if (!ptr) \
- { \
- CRITICAL("No smart data for object %p (%s)", \
- o, evas_object_type_get(o)); \
- return; \
+#define ELM_PAN_DATA_GET_OR_RETURN(o, ptr) \
+ Elm_Pan_Smart_Data *ptr = evas_object_smart_data_get(o); \
+ if (!ptr) \
+ { \
+ CRITICAL("No smart data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return; \
}
-#define ELM_PAN_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
- ELM_PAN_DATA_GET(o, ptr); \
- if (!ptr) \
- { \
- CRITICAL("No smart data for object %p (%s)", \
- o, evas_object_type_get(o)); \
- return val; \
+#define ELM_PAN_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
+ Elm_Pan_Smart_Data *ptr = evas_object_smart_data_get(o); \
+ if (!ptr) \
+ { \
+ CRITICAL("No smart data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return val; \
}
static const char SIG_CHANGED[] = "changed";
Evas_Coord x,
Evas_Coord y)
{
- ELM_PAN_DATA_GET(obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(obj, psd);
/* we don't want the clipped smart object version here */
Evas_Coord w,
Evas_Coord h)
{
- ELM_PAN_DATA_GET(obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(obj, psd);
psd->w = w;
psd->h = h;
static void
_elm_pan_smart_show(Evas_Object *obj)
{
- ELM_PAN_DATA_GET(obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(obj, psd);
_elm_pan_parent_sc->show(obj);
static void
_elm_pan_smart_hide(Evas_Object *obj)
{
- ELM_PAN_DATA_GET(obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(obj, psd);
_elm_pan_parent_sc->hide(obj);
Evas_Coord x,
Evas_Coord y)
{
- ELM_PAN_DATA_GET(obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(obj, psd);
if ((x == psd->px) && (y == psd->py)) return;
psd->px = x;
Evas_Coord *x,
Evas_Coord *y)
{
- ELM_PAN_DATA_GET(obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(obj, psd);
if (x) *x = psd->px;
if (y) *y = psd->py;
Evas_Coord *x,
Evas_Coord *y)
{
- ELM_PAN_DATA_GET(obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(obj, psd);
if (x)
{
Evas_Coord *w,
Evas_Coord *h)
{
- ELM_PAN_DATA_GET(obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(obj, psd);
if (w) *w = psd->content_w;
if (h) *h = psd->content_h;
double x,
double y)
{
- ELM_PAN_DATA_GET(obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(obj, psd);
psd->gravity_x = x;
psd->gravity_y = y;
double *x,
double *y)
{
- ELM_PAN_DATA_GET(obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(obj, psd);
if (x) *x = psd->gravity_x;
if (y) *y = psd->gravity_y;
{
Evas_Coord w, h;
- ELM_PAN_DATA_GET(obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(obj, psd);
if (content == psd->content) return;
if (psd->content)
static const char SCROLL_SMART_NAME[] = "elm_scroll";
-#define ELM_SCROLL_IFACE_DATA_GET(o, sid) \
- Elm_Scrollable_Smart_Interface_Data * sid = \
- evas_object_smart_interface_data_get(o, &(ELM_SCROLLABLE_IFACE.base))
-
-#define ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(o, ptr) \
- ELM_SCROLL_IFACE_DATA_GET(o, ptr); \
- if (!ptr) \
- { \
- CRITICAL("No interface data for object %p (%s)", \
- o, evas_object_type_get(o)); \
- return; \
+#define ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(o, ptr) \
+ Elm_Scrollable_Smart_Interface_Data *ptr = \
+ evas_object_smart_interface_data_get(o, &(ELM_SCROLLABLE_IFACE.base)); \
+ if (!ptr) \
+ { \
+ CRITICAL("No interface data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return; \
}
-#define ELM_SCROLL_IFACE_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
- ELM_SCROLL_IFACE_DATA_GET(o, ptr); \
- if (!ptr) \
- { \
- CRITICAL("No interface data for object %p (%s)", \
- o, evas_object_type_get(o)); \
- return val; \
+#define ELM_SCROLL_IFACE_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
+ Elm_Scrollable_Smart_Interface_Data *ptr = \
+ evas_object_smart_interface_data_get(o, &(ELM_SCROLLABLE_IFACE.base)); \
+ if (!ptr) \
+ { \
+ CRITICAL("No interface data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return val; \
}
static void _elm_scroll_scroll_bar_size_adjust(
Evas_Coord *);
static void _elm_scroll_content_pos_set(Evas_Object *,
Evas_Coord,
- Evas_Coord);
+ Evas_Coord,
+ Eina_Bool);
#define LEFT 0
#define RIGHT 1
Evas_Coord x = 0, y = 0, mx = 0, my = 0, minx = 0, miny = 0;
if (!sid->edje_obj || !sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(sid->pan_obj, psd);
psd->api->pos_max_get(sid->pan_obj, &mx, &my);
psd->api->pos_min_get(sid->pan_obj, &minx, &miny);
{
if (!sid->pan_obj || !sid->edje_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(sid->pan_obj, psd);
if ((sid->content) || (sid->extern_pan))
{
if (!sid->edje_obj || !sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(sid->pan_obj, psd);
if ((sid->down.dragged) || (sid->down.bounce_x_animator)
|| (sid->down.bounce_y_animator) || (sid->down.momentum_animator)
}
static void
+_elm_scroll_vbar_drag_cb(void *data,
+ Evas_Object *obj __UNUSED__,
+ const char *emission __UNUSED__,
+ const char *source __UNUSED__)
+{
+ Elm_Scrollable_Smart_Interface_Data *sid = data;
+
+ if (sid->cb_func.vbar_drag)
+ sid->cb_func.vbar_drag(sid->obj, NULL);
+
+ _elm_scroll_scroll_bar_read_and_update(sid);
+}
+
+static void
+_elm_scroll_vbar_press_cb(void *data,
+ Evas_Object *obj __UNUSED__,
+ const char *emission __UNUSED__,
+ const char *source __UNUSED__)
+{
+ Elm_Scrollable_Smart_Interface_Data *sid = data;
+
+ if (sid->cb_func.vbar_press)
+ sid->cb_func.vbar_press(sid->obj, NULL);
+}
+
+static void
+_elm_scroll_vbar_unpress_cb(void *data,
+ Evas_Object *obj __UNUSED__,
+ const char *emission __UNUSED__,
+ const char *source __UNUSED__)
+{
+ Elm_Scrollable_Smart_Interface_Data *sid = data;
+
+ if (sid->cb_func.vbar_unpress)
+ sid->cb_func.vbar_unpress(sid->obj, NULL);
+}
+
+static void
_elm_scroll_edje_drag_v_start_cb(void *data,
Evas_Object *obj __UNUSED__,
const char *emission __UNUSED__,
}
static void
+_elm_scroll_hbar_drag_cb(void *data,
+ Evas_Object *obj __UNUSED__,
+ const char *emission __UNUSED__,
+ const char *source __UNUSED__)
+{
+ Elm_Scrollable_Smart_Interface_Data *sid = data;
+
+ if (sid->cb_func.hbar_drag)
+ sid->cb_func.hbar_drag(sid->obj, NULL);
+
+ _elm_scroll_scroll_bar_read_and_update(sid);
+}
+
+static void
+_elm_scroll_hbar_press_cb(void *data,
+ Evas_Object *obj __UNUSED__,
+ const char *emission __UNUSED__,
+ const char *source __UNUSED__)
+{
+ Elm_Scrollable_Smart_Interface_Data *sid = data;
+
+ if (sid->cb_func.hbar_press)
+ sid->cb_func.hbar_press(sid->obj, NULL);
+}
+
+static void
+_elm_scroll_hbar_unpress_cb(void *data,
+ Evas_Object *obj __UNUSED__,
+ const char *emission __UNUSED__,
+ const char *source __UNUSED__)
+{
+ Elm_Scrollable_Smart_Interface_Data *sid = data;
+
+ if (sid->cb_func.hbar_unpress)
+ sid->cb_func.hbar_unpress(sid->obj, NULL);
+}
+
+static void
_elm_scroll_edje_drag_h_start_cb(void *data,
Evas_Object *obj __UNUSED__,
const char *emission __UNUSED__,
if (!sid->pan_obj) return 0;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN_VAL(sid->pan_obj, psd, 0);
_elm_scroll_content_viewport_size_get(obj, &w, NULL);
psd->api->content_size_get(sid->pan_obj, &cw, &ch);
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(sid->pan_obj, psd);
psd->api->content_size_get(sid->pan_obj, &cw, &ch);
}
x = sid->down.b2x + (int)((double)(dx - odx) * r);
if (!sid->down.cancelled)
- _elm_scroll_content_pos_set(sid->obj, x, y);
+ _elm_scroll_content_pos_set(sid->obj, x, y, EINA_TRUE);
if (dt >= 1.0)
{
if (sid->down.momentum_animator)
}
y = sid->down.b2y + (int)((double)(dy - ody) * r);
if (!sid->down.cancelled)
- _elm_scroll_content_pos_set(sid->obj, x, y);
+ _elm_scroll_content_pos_set(sid->obj, x, y, EINA_TRUE);
if (dt >= 1.0)
{
if (sid->down.momentum_animator)
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(sid->pan_obj, psd);
if (sid->freeze) return;
if ((!sid->bouncemex) && (!sid->bouncemey)) return;
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(sid->pan_obj, psd);
psd->api->pos_get(sid->pan_obj, x, y);
}
static void
_elm_scroll_content_pos_set(Evas_Object *obj,
Evas_Coord x,
- Evas_Coord y)
+ Evas_Coord y,
+ Eina_Bool sig)
{
- Evas_Coord mx = 0, my = 0, px = 0, py = 0, minx = 0, miny = 0;
+ Evas_Coord mx = 0, my = 0, px = 0, py = 0, spx = 0, spy = 0, minx = 0, miny = 0;
Evas_Coord cw =0, ch = 0, ww = 0, wh = 0; //// TIZEN ONLY
double vx, vy;
if (!sid->edje_obj || !sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(sid->pan_obj, psd);
// FIXME: allow for bounce outside of range
psd->api->pos_max_get(sid->pan_obj, &mx, &my);
psd->api->content_size_get(sid->pan_obj, &cw, &ch); //// TIZEN ONLY
_elm_scroll_content_viewport_size_get(obj, &ww, &wh); //// TIZEN ONLY
- if (mx > 0) vx = (double)(x - minx) / (double)mx;
- else vx = 0.0;
-
- if (vx < 0.0) vx = 0.0;
- else if (vx > 1.0)
- vx = 1.0;
-
- if (my > 0) vy = (double)(y - miny) / (double)my;
- else vy = 0.0;
-
- if (vy < 0.0) vy = 0.0;
- else if (vy > 1.0)
- vy = 1.0;
-
- edje_object_part_drag_value_set
- (sid->edje_obj, "elm.dragable.vbar", 0.0, vy);
- edje_object_part_drag_value_set
- (sid->edje_obj, "elm.dragable.hbar", vx, 0.0);
psd->api->pos_get(sid->pan_obj, &px, &py);
//// TIZEN ONLY
if (cw > ww)
}
psd->api->pos_set(sid->pan_obj, x, y);
- if ((px != x) || (py != y))
+ psd->api->pos_get(sid->pan_obj, &spx, &spy);
+
+ if (mx > 0) vx = (double)(spx - minx) / (double)mx;
+ else vx = 0.0;
+
+ if (vx < 0.0) vx = 0.0;
+ else if (vx > 1.0)
+ vx = 1.0;
+
+ if (my > 0) vy = (double)(spy - miny) / (double)my;
+ else vy = 0.0;
+
+ if (vy < 0.0) vy = 0.0;
+ else if (vy > 1.0)
+ vy = 1.0;
+
+ edje_object_part_drag_value_set
+ (sid->edje_obj, "elm.dragable.vbar", 0.0, vy);
+ edje_object_part_drag_value_set
+ (sid->edje_obj, "elm.dragable.hbar", vx, 0.0);
+
+ if (sig && ((px != x) || (py != y)))
edje_object_signal_emit(sid->edje_obj, "elm,action,scroll", "elm");
if (!sid->down.bounce_x_animator)
{
if (sid->cb_func.scroll)
sid->cb_func.scroll(obj, NULL);
}
- if (x != px)
- {
- if (x == minx)
- {
- if (sid->cb_func.edge_left)
- sid->cb_func.edge_left(obj, NULL);
- edje_object_signal_emit(sid->edje_obj, "elm,edge,left", "elm");
- }
- if (x == (mx + minx))
- {
- if (sid->cb_func.edge_right)
- sid->cb_func.edge_right(obj, NULL);
- edje_object_signal_emit(sid->edje_obj, "elm,edge,right", "elm");
- }
- }
- if (y != py)
+ if (sig)
{
- if (y == miny)
+ if (x != px)
{
- if (sid->cb_func.edge_top)
- sid->cb_func.edge_top(obj, NULL);
- edje_object_signal_emit(sid->edje_obj, "elm,edge,top", "elm");
+ if (x == minx)
+ {
+ if (sid->cb_func.edge_left)
+ sid->cb_func.edge_left(obj, NULL);
+ edje_object_signal_emit(sid->edje_obj, "elm,edge,left", "elm");
+ }
+ if (x == (mx + minx))
+ {
+ if (sid->cb_func.edge_right)
+ sid->cb_func.edge_right(obj, NULL);
+ edje_object_signal_emit(sid->edje_obj, "elm,edge,right", "elm");
+ }
}
- if (y == my + miny)
+ if (y != py)
{
- if (sid->cb_func.edge_bottom)
- sid->cb_func.edge_bottom(obj, NULL);
- edje_object_signal_emit(sid->edje_obj, "elm,edge,bottom", "elm");
+ if (y == miny)
+ {
+ if (sid->cb_func.edge_top)
+ sid->cb_func.edge_top(obj, NULL);
+ edje_object_signal_emit(sid->edje_obj, "elm,edge,top", "elm");
+ }
+ if (y == my + miny)
+ {
+ if (sid->cb_func.edge_bottom)
+ sid->cb_func.edge_bottom(obj, NULL);
+ edje_object_signal_emit(sid->edje_obj, "elm,edge,bottom", "elm");
+ }
}
}
-
+
_elm_direction_arrows_eval(sid);
}
else
wx = sid->wx;
- _elm_scroll_content_pos_set(sid->obj, wx, sid->wy);
+ _elm_scroll_content_pos_set(sid->obj, wx, sid->wy, EINA_FALSE);
}
/* returns TRUE when we need to move the scroller, FALSE otherwise.
if (!sid->pan_obj) return EINA_FALSE;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN_VAL(sid->pan_obj, psd, EINA_FALSE);
psd->api->pos_max_get(sid->pan_obj, &mx, &my);
psd->api->pos_min_get(sid->pan_obj, &minx, &miny);
if (_elm_scroll_content_region_show_internal(obj, &x, &y, w, h))
{
- _elm_scroll_content_pos_set(obj, x, y);
+ _elm_scroll_content_pos_set(obj, x, y, EINA_FALSE);
sid->down.sx = x;
sid->down.sy = y;
sid->down.x = sid->down.history[0].x;
sid->wh = h;
if (_elm_scroll_content_region_show_internal(obj, &x, &y, w, h))
{
- _elm_scroll_content_pos_set(obj, x, y);
+ _elm_scroll_content_pos_set(obj, x, y, EINA_TRUE);
sid->down.sx = x;
sid->down.sy = y;
sid->down.x = sid->down.history[0].x;
int direction = 0;
sid = data;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(sid->pan_obj, psd);
ev = event_info;
direction = ev->direction;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
(evas_key_modifier_is_set(ev->modifiers, "Super")))
return;
else if (evas_key_modifier_is_set(ev->modifiers, "Shift"))
- direction = 1;
+ direction = !direction;
_elm_scroll_content_pos_get(sid->obj, &x, &y);
if ((sid->down.bounce_x_animator) || (sid->down.bounce_y_animator) ||
(sid->scrollto.x.animator) || (sid->scrollto.y.animator))
if ((!sid->hold) && (!sid->freeze))
{
_elm_scroll_wanted_coordinates_update(sid, x, y);
- _elm_scroll_content_pos_set(sid->obj, x, y);
+ _elm_scroll_content_pos_set(sid->obj, x, y, EINA_TRUE);
}
}
if (!sid->pan_obj) return ECORE_CALLBACK_CANCEL;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN_VAL(sid->pan_obj, psd, ECORE_CALLBACK_CANCEL);
t = ecore_loop_time_get();
dt = t - sid->down.anim_start;
sid->down.by = sid->down.by0 - dy + sid->down.b0y;
y = py;
}
- _elm_scroll_content_pos_set(sid->obj, x, y);
+ _elm_scroll_content_pos_set(sid->obj, x, y, EINA_TRUE);
_elm_scroll_wanted_coordinates_update(sid, x, y);
psd->api->pos_max_get(sid->pan_obj, &maxx, &maxy);
psd->api->pos_min_get(sid->pan_obj, &minx, &miny);
if (!sid->pan_obj) return 0;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN_VAL(sid->pan_obj, psd, 0);
_elm_scroll_content_pos_get(sid->obj, &x, &y);
_elm_scroll_content_viewport_size_get(sid->obj, &w, &h);
if (!sid->pan_obj) return 0;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN_VAL(sid->pan_obj, psd, 0);
_elm_scroll_content_pos_get(sid->obj, &x, &y);
_elm_scroll_content_viewport_size_get(sid->obj, &w, &h);
if (!sid->pan_obj) return ECORE_CALLBACK_CANCEL;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN_VAL(sid->pan_obj, psd, ECORE_CALLBACK_CANCEL);
t = ecore_loop_time_get();
tt = (t - sid->scrollto.x.t_start) /
if (t >= sid->scrollto.x.t_end)
{
px = sid->scrollto.x.end;
- _elm_scroll_content_pos_set(sid->obj, px, py);
+ _elm_scroll_content_pos_set(sid->obj, px, py, EINA_TRUE);
sid->down.sx = px;
sid->down.x = sid->down.history[0].x;
_elm_scroll_wanted_coordinates_update(sid, px, py);
_elm_scroll_anim_stop(sid);
return ECORE_CALLBACK_CANCEL;
}
- _elm_scroll_content_pos_set(sid->obj, px, py);
+ _elm_scroll_content_pos_set(sid->obj, px, py, EINA_TRUE);
_elm_scroll_wanted_coordinates_update(sid, px, py);
return ECORE_CALLBACK_RENEW;
}
if (!sid->pan_obj) return EINA_FALSE;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN_VAL(sid->pan_obj, psd, EINA_FALSE);
t = ecore_loop_time_get();
tt = (t - sid->scrollto.y.t_start) /
if (t >= sid->scrollto.y.t_end)
{
py = sid->scrollto.y.end;
- _elm_scroll_content_pos_set(sid->obj, px, py);
+ _elm_scroll_content_pos_set(sid->obj, px, py, EINA_TRUE);
sid->down.sy = py;
sid->down.y = sid->down.history[0].y;
_elm_scroll_wanted_coordinates_update(sid, px, py);
_elm_scroll_anim_stop(sid);
return ECORE_CALLBACK_CANCEL;
}
- _elm_scroll_content_pos_set(sid->obj, px, py);
+ _elm_scroll_content_pos_set(sid->obj, px, py, EINA_TRUE);
_elm_scroll_wanted_coordinates_update(sid, px, py);
return ECORE_CALLBACK_RENEW;
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(sid->pan_obj, psd);
if (sid->freeze) return;
if (t_in <= 0.0)
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(sid->pan_obj, psd);
if (sid->freeze) return;
if (t_in <= 0.0)
if (!sid->pan_obj) return;
+ ELM_PAN_DATA_GET_OR_RETURN(sid->pan_obj, psd);
+
ev = event_info;
sid->down.hold_parent = EINA_FALSE;
sid->down.dx = 0;
sid->down.dragged = EINA_FALSE;
sid->down.now = EINA_FALSE;
_elm_scroll_content_pos_get(sid->obj, &x, &y);
- _elm_scroll_content_pos_set(sid->obj, x, y);
+ _elm_scroll_content_pos_set(sid->obj, x, y, EINA_TRUE);
_elm_scroll_wanted_coordinates_update(sid, x, y);
if (sid->content_info.resized)
if (!sid->pan_obj) return EINA_FALSE;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN_VAL(sid->pan_obj, psd, EINA_FALSE);
psd->api->pos_max_get(sid->pan_obj, &mx, &my);
psd->api->pos_min_get(sid->pan_obj, &minx, &miny);
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(sid->pan_obj, psd);
if (sid->down.dir_x) *x = sid->down.sx - (*x - sid->down.x);
else *x = sid->down.sx;
oy = fy;
}
- _elm_scroll_content_pos_set(sid->obj, ox, oy);
+ _elm_scroll_content_pos_set(sid->obj, ox, oy, EINA_TRUE);
return ECORE_CALLBACK_RENEW;
}
{
td = t - sid->down.onhold_tlast;
vx = sid->down.onhold_vx * td *
- (double)_elm_config->thumbscroll_threshold * 2.0;
+ (double)_elm_config->thumbscroll_hold_threshold * 2.0;
vy = sid->down.onhold_vy * td *
- (double)_elm_config->thumbscroll_threshold * 2.0;
+ (double)_elm_config->thumbscroll_hold_threshold * 2.0;
_elm_scroll_content_pos_get(sid->obj, &ox, &oy);
x = ox;
y = oy;
}
}
- _elm_scroll_content_pos_set(sid->obj, x, y);
+ _elm_scroll_content_pos_set(sid->obj, x, y, EINA_TRUE);
}
sid->down.onhold_tlast = t;
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(sid->pan_obj, psd);
ev = event_info;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
}
}
{
- Evas_Coord minx, miny;
+ Evas_Coord minx, miny, mx, my;
psd->api->pos_min_get(sid->pan_obj, &minx, &miny);
+ psd->api->pos_max_get(sid->pan_obj, &mx, &my);
if (y < miny)
y += (miny - y) *
_elm_config->thumbscroll_border_friction;
- else if (sid->content_info.h <= sid->h)
+ else if (my <= 0)
y += (sid->down.sy - y) *
_elm_config->thumbscroll_border_friction;
- else if ((sid->content_info.h - sid->h + miny) < y)
- y += (sid->content_info.h - sid->h + miny - y) *
+ else if ((my + miny) < y)
+ y += (my + miny - y) *
_elm_config->thumbscroll_border_friction;
if (x < minx)
x += (minx - x) *
_elm_config->thumbscroll_border_friction;
- else if (sid->content_info.w <= sid->w)
+ else if (mx <= 0)
x += (sid->down.sx - x) *
_elm_config->thumbscroll_border_friction;
- else if ((sid->content_info.w - sid->w + minx) < x)
- x += (sid->content_info.w - sid->w + minx - x) *
+ else if ((mx + minx) < x)
+ x += (mx + minx - x) *
_elm_config->thumbscroll_border_friction;
}
x = ev->cur.canvas.x - sid->x;
y = ev->cur.canvas.y - sid->y;
- if (x < _elm_config->thumbscroll_threshold)
+ if (x < _elm_config->thumbscroll_hold_threshold)
{
- if (_elm_config->thumbscroll_threshold > 0.0)
- vx = -(double)(_elm_config->thumbscroll_threshold - x)
- / _elm_config->thumbscroll_threshold;
+ if (_elm_config->thumbscroll_hold_threshold > 0.0)
+ vx = -(double)(_elm_config->thumbscroll_hold_threshold - x)
+ / _elm_config->thumbscroll_hold_threshold;
else
vx = -1.0;
}
- else if (x > (sid->w - _elm_config->thumbscroll_threshold))
+ else if (x > (sid->w - _elm_config->thumbscroll_hold_threshold))
{
- if (_elm_config->thumbscroll_threshold > 0.0)
- vx = (double)(_elm_config->thumbscroll_threshold -
+ if (_elm_config->thumbscroll_hold_threshold > 0.0)
+ vx = (double)(_elm_config->thumbscroll_hold_threshold -
(sid->w - x)) /
- _elm_config->thumbscroll_threshold;
+ _elm_config->thumbscroll_hold_threshold;
else
vx = 1.0;
}
- if (y < _elm_config->thumbscroll_threshold)
+ if (y < _elm_config->thumbscroll_hold_threshold)
{
- if (_elm_config->thumbscroll_threshold > 0.0)
- vy = -(double)(_elm_config->thumbscroll_threshold - y)
- / _elm_config->thumbscroll_threshold;
+ if (_elm_config->thumbscroll_hold_threshold > 0.0)
+ vy = -(double)(_elm_config->thumbscroll_hold_threshold - y)
+ / _elm_config->thumbscroll_hold_threshold;
else
vy = -1.0;
}
- else if (y > (sid->h - _elm_config->thumbscroll_threshold))
+ else if (y > (sid->h - _elm_config->thumbscroll_hold_threshold))
{
- if (_elm_config->thumbscroll_threshold > 0.0)
- vy = (double)(_elm_config->thumbscroll_threshold -
+ if (_elm_config->thumbscroll_hold_threshold > 0.0)
+ vy = (double)(_elm_config->thumbscroll_hold_threshold -
(sid->h - y)) /
- _elm_config->thumbscroll_threshold;
+ _elm_config->thumbscroll_hold_threshold;
else
vy = 1.0;
}
(sid->edje_obj, EVAS_CALLBACK_MOVE, _on_edje_move, sid);
edje_object_signal_callback_add
- (sid->edje_obj, "drag", "elm.dragable.vbar", _elm_scroll_edje_drag_v_cb,
+ (sid->edje_obj, "drag", "elm.dragable.vbar", _elm_scroll_vbar_drag_cb,
sid);
edje_object_signal_callback_add
(sid->edje_obj, "drag,set", "elm.dragable.vbar",
(sid->edje_obj, "drag,page", "elm.dragable.vbar",
_elm_scroll_edje_drag_v_cb, sid);
edje_object_signal_callback_add
- (sid->edje_obj, "drag", "elm.dragable.hbar", _elm_scroll_edje_drag_h_cb,
+ (sid->edje_obj, "elm,vbar,press", "elm",
+ _elm_scroll_vbar_press_cb, sid);
+ edje_object_signal_callback_add
+ (sid->edje_obj, "elm,vbar,unpress", "elm",
+ _elm_scroll_vbar_unpress_cb, sid);
+ edje_object_signal_callback_add
+ (sid->edje_obj, "drag", "elm.dragable.hbar", _elm_scroll_hbar_drag_cb,
sid);
edje_object_signal_callback_add
(sid->edje_obj, "drag,set", "elm.dragable.hbar",
edje_object_signal_callback_add
(sid->edje_obj, "drag,page", "elm.dragable.hbar",
_elm_scroll_edje_drag_h_cb, sid);
+ edje_object_signal_callback_add
+ (sid->edje_obj, "elm,hbar,press", "elm",
+ _elm_scroll_hbar_press_cb, sid);
+ edje_object_signal_callback_add
+ (sid->edje_obj, "elm,hbar,unpress", "elm",
+ _elm_scroll_hbar_unpress_cb, sid);
}
static void
(sid->edje_obj, EVAS_CALLBACK_MOVE, _on_edje_move, sid);
edje_object_signal_callback_del_full
- (sid->edje_obj, "drag", "elm.dragable.vbar", _elm_scroll_edje_drag_v_cb,
+ (sid->edje_obj, "drag", "elm.dragable.vbar", _elm_scroll_vbar_drag_cb,
sid);
edje_object_signal_callback_del_full
(sid->edje_obj, "drag,set", "elm.dragable.vbar",
(sid->edje_obj, "drag,page", "elm.dragable.vbar",
_elm_scroll_edje_drag_v_cb, sid);
edje_object_signal_callback_del_full
- (sid->edje_obj, "drag", "elm.dragable.hbar", _elm_scroll_edje_drag_h_cb,
+ (sid->edje_obj, "elm,vbar,press", "elm",
+ _elm_scroll_vbar_press_cb, sid);
+ edje_object_signal_callback_del_full
+ (sid->edje_obj, "elm,vbar,unpress", "elm",
+ _elm_scroll_vbar_unpress_cb, sid);
+ edje_object_signal_callback_del_full
+ (sid->edje_obj, "drag", "elm.dragable.hbar", _elm_scroll_hbar_drag_cb,
sid);
edje_object_signal_callback_del_full
(sid->edje_obj, "drag,set", "elm.dragable.hbar",
edje_object_signal_callback_del_full
(sid->edje_obj, "drag,page", "elm.dragable.hbar",
_elm_scroll_edje_drag_h_cb, sid);
+ edje_object_signal_callback_del_full
+ (sid->edje_obj, "elm,hbar,press", "elm",
+ _elm_scroll_hbar_press_cb, sid);
+ edje_object_signal_callback_del_full
+ (sid->edje_obj, "elm,hbar,unpress", "elm",
+ _elm_scroll_hbar_unpress_cb, sid);
}
static void
}
if (sid->pan_obj)
{
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(sid->pan_obj, psd);
psd->api->pos_min_get(sid->pan_obj, &minx, &miny);
psd->api->pos_get(sid->pan_obj, &px, &py);
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(sid->pan_obj, psd);
psd->api->content_size_get(sid->pan_obj, &w, &h);
if ((w != sid->content_info.w) || (h != sid->content_info.h))
edje_object_part_swallow(sid->edje_obj, "elm.swallow.content", o);
}
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(sid->pan_obj, psd);
evas_object_event_callback_add
(content, EVAS_CALLBACK_DEL, _elm_scroll_content_del_cb, sid);
}
static void
+_elm_scroll_vbar_drag_cb_set(Evas_Object *obj,
+ void (*vbar_drag_cb)(Evas_Object *obj,
+ void *data))
+{
+ ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+
+ sid->cb_func.vbar_drag = vbar_drag_cb;
+}
+
+static void
+_elm_scroll_vbar_press_cb_set(Evas_Object *obj,
+ void (*vbar_press_cb)(Evas_Object *obj,
+ void *data))
+{
+ ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+
+ sid->cb_func.vbar_press = vbar_press_cb;
+}
+
+static void
+_elm_scroll_vbar_unpress_cb_set(Evas_Object *obj,
+ void (*vbar_unpress_cb)(Evas_Object *obj,
+ void *data))
+{
+ ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+
+ sid->cb_func.vbar_unpress = vbar_unpress_cb;
+}
+
+static void
+_elm_scroll_hbar_drag_cb_set(Evas_Object *obj,
+ void (*hbar_drag_cb)(Evas_Object *obj,
+ void *data))
+{
+ ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+
+ sid->cb_func.hbar_drag = hbar_drag_cb;
+}
+
+static void
+_elm_scroll_hbar_press_cb_set(Evas_Object *obj,
+ void (*hbar_press_cb)(Evas_Object *obj,
+ void *data))
+{
+ ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+
+ sid->cb_func.hbar_press = hbar_press_cb;
+}
+
+static void
+_elm_scroll_hbar_unpress_cb_set(Evas_Object *obj,
+ void (*hbar_unpress_cb)(Evas_Object *obj,
+ void *data))
+{
+ ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+
+ sid->cb_func.hbar_unpress = hbar_unpress_cb;
+}
+
+static void
_elm_scroll_content_min_limit_cb_set(Evas_Object *obj,
void (*c_min_limit_cb)(Evas_Object *obj,
Eina_Bool w,
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(sid->pan_obj, psd);
psd->api->content_size_get(sid->pan_obj, &cw, &ch);
if (pagenumber_h)
if (pagenumber_h >= 0) x = sid->pagesize_h * pagenumber_h;
if (pagenumber_v >= 0) y = sid->pagesize_v * pagenumber_v;
if (_elm_scroll_content_region_show_internal(obj, &x, &y, w, h))
- _elm_scroll_content_pos_set(obj, x, y);
+ _elm_scroll_content_pos_set(obj, x, y, EINA_TRUE);
}
static void
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(sid->pan_obj, psd);
psd->api->gravity_set(sid->pan_obj, x, y);
}
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
+ ELM_PAN_DATA_GET_OR_RETURN(sid->pan_obj, psd);
psd->api->gravity_get(sid->pan_obj, x, y);
}
_elm_scroll_edge_right_cb_set,
_elm_scroll_edge_top_cb_set,
_elm_scroll_edge_bottom_cb_set,
+ _elm_scroll_vbar_drag_cb_set,
+ _elm_scroll_vbar_press_cb_set,
+ _elm_scroll_vbar_unpress_cb_set,
+ _elm_scroll_hbar_drag_cb_set,
+ _elm_scroll_hbar_press_cb_set,
+ _elm_scroll_hbar_unpress_cb_set,
_elm_scroll_content_min_limit_cb_set,
_elm_scroll_content_pos_set,
_elm_scroll_content_pos_get,
void *data);
void (*edge_bottom)(Evas_Object *obj,
void *data);
+ void (*vbar_drag)(Evas_Object *obj,
+ void *data);
+ void (*vbar_press)(Evas_Object *obj,
+ void *data);
+ void (*vbar_unpress)(Evas_Object *obj,
+ void *data);
+ void (*hbar_drag)(Evas_Object *obj,
+ void *data);
+ void (*hbar_press)(Evas_Object *obj,
+ void *data);
+ void (*hbar_unpress)(Evas_Object *obj,
+ void *data);
void (*content_min_limit)(Evas_Object *obj,
Eina_Bool w,
Eina_Bool h);
void (*edge_bottom_cb_set)(Evas_Object *obj,
void (*e_bottom_cb)(Evas_Object *obj,
void *data));
+ void (*vbar_drag_cb_set)(Evas_Object *obj,
+ void (*v_drag_cb)(Evas_Object *obj,
+ void *data));
+ void (*vbar_press_cb_set)(Evas_Object *obj,
+ void (*v_press_cb)(Evas_Object *obj,
+ void *data));
+ void (*vbar_unpress_cb_set)(Evas_Object *obj,
+ void (*v_unpress_cb)(Evas_Object *obj,
+ void *data));
+ void (*hbar_drag_cb_set)(Evas_Object *obj,
+ void (*h_drag_cb)(Evas_Object *obj,
+ void *data));
+ void (*hbar_press_cb_set)(Evas_Object *obj,
+ void (*h_press_cb)(Evas_Object *obj,
+ void *data));
+ void (*hbar_unpress_cb_set)(Evas_Object *obj,
+ void (*h_unpress_cb)(Evas_Object *obj,
+ void *data));
void (*content_min_limit_cb_set)(Evas_Object *obj,
void (*c_limit_cb)(Evas_Object *obj,
* immediately */
void (*content_pos_set)(Evas_Object *obj,
Evas_Coord x,
- Evas_Coord y);
+ Evas_Coord y,
+ Eina_Bool sig);
void (*content_pos_get)(const Evas_Object *obj,
Evas_Coord *x,
Evas_Coord *y);
if (!label) label = "";
_label_format_set(ELM_WIDGET_DATA(sd)->resize_obj, sd->format);
- return _elm_label_parent_sc->text_set(obj, item, label);
+ if (_elm_label_parent_sc->text_set(obj, item, label))
+ {
+ sd->lastw = 0;
+ _elm_label_smart_sizing_eval(obj);
+ return EINA_TRUE;
+ }
+
+ return EINA_FALSE;
}
static Eina_Bool
{
const char *txt = elm_widget_access_info_get(obj);
- if (!txt) txt = elm_layout_text_get(obj, NULL);
+ if (!txt) txt = _elm_util_mkup_to_text(elm_layout_text_get(obj, NULL));
if (txt) return strdup(txt);
return NULL;
edje_object_signal_callback_add(ELM_WIDGET_DATA(priv)->resize_obj,
"elm,state,slide,end", "", _on_slide_end,
obj);
-
- elm_widget_can_focus_set(obj, EINA_FALSE);
-
- elm_layout_theme_set(obj, "label", "base", elm_widget_style_get(obj));
- elm_layout_text_set(obj, NULL, "<br>");
+ /* access */
+ elm_widget_can_focus_set(obj, _elm_config->access_mode);
_elm_access_object_register(obj, ELM_WIDGET_DATA(priv)->resize_obj);
_elm_access_text_set
_elm_access_callback_set
(_elm_access_object_get(obj), ELM_ACCESS_INFO, _access_info_cb, NULL);
+ elm_layout_theme_set(obj, "label", "base", elm_widget_style_get(obj));
+ elm_layout_text_set(obj, NULL, "<br>");
elm_layout_sizing_eval(obj);
}
else return EINA_FALSE;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- sd->s_iface->content_pos_set(obj, x, y);
+ sd->s_iface->content_pos_set(obj, x, y, EINA_TRUE);
return EINA_TRUE;
}
ai = _elm_access_object_get(it->base.access_obj);
- _elm_access_text_set(ai, ELM_ACCESS_TYPE, E_("List Item"));
_elm_access_callback_set(ai, ELM_ACCESS_INFO, _access_info_cb, it);
_elm_access_callback_set(ai, ELM_ACCESS_STATE, _access_state_cb, it);
_elm_access_on_highlight_hook_set(ai, _access_on_highlight_cb, it);
char **argv) = NULL;
EAPI Eina_Bool
-elm_quicklaunch_prepare(int argc __UNUSED__,
- char **argv)
+elm_quicklaunch_prepare(int argc,
+ char **argv)
{
#ifdef HAVE_FORK
- char *exe = elm_quicklaunch_exe_path_get(argv[0]);
+ char *exe;
+
+ if (argc <= 0 || argv == NULL) return EINA_FALSE;
+
+ exe = elm_quicklaunch_exe_path_get(argv[0]);
if (!exe)
{
ERR("requested quicklaunch binary '%s' does not exist\n", argv[0]);
}
EAPI void
+elm_object_orientation_mode_disabled_set(Evas_Object *obj, Eina_Bool disabled)
+{
+ elm_widget_orientation_mode_disabled_set(obj, disabled);
+}
+
+EAPI Eina_Bool
+elm_object_orientation_mode_disabled_get(const Evas_Object *obj)
+{
+ return elm_widget_orientation_mode_disabled_get(obj);
+}
+
+EAPI void
elm_object_item_access_info_set(Elm_Object_Item *it, const char *txt)
{
_elm_widget_item_access_info_set((Elm_Widget_Item *)it, txt);
}
+EAPI Evas_Object *
+elm_object_item_access_register(Elm_Object_Item *item)
+{
+ Elm_Widget_Item *it;
+
+ it = (Elm_Widget_Item *)item;
+
+ _elm_access_widget_item_register(it);
+
+ if (it) return it->access_obj;
+ return NULL;
+}
+
+EAPI void
+elm_object_item_access_unregister(Elm_Object_Item *item)
+{
+ _elm_access_widget_item_unregister((Elm_Widget_Item *)item);
+}
+
+EAPI Evas_Object *
+elm_object_item_access_object_get(const Elm_Object_Item *item)
+{
+ if (!item) return NULL;
+ return ((Elm_Widget_Item *)item)->access_obj;
+}
+
+EAPI void
+elm_object_item_access_order_set(Elm_Object_Item *item, Eina_List *objs)
+{
+ _elm_access_widget_item_access_order_set((Elm_Widget_Item *)item, objs);
+}
+
+EAPI const Eina_List *
+elm_object_item_access_order_get(const Elm_Object_Item *item)
+{
+ return _elm_access_widget_item_access_order_get((Elm_Widget_Item *)item);
+}
+
+EAPI void
+elm_object_item_access_order_unset(Elm_Object_Item *item)
+{
+ _elm_access_widget_item_access_order_unset((Elm_Widget_Item *)item);
+}
+
EAPI void *
elm_object_item_data_get(const Elm_Object_Item *it)
{
if (!strcmp(ovl->wsd->engine->name, INTERNAL_ENGINE_NAME))
_obj_place(disp, x - (w / 2), y - (h / 2), w, h);
else
- _obj_place(disp, ovl->x - (w / 2), ovl->y - (h / 2), w, h);
+ {
+ evas_object_geometry_get(ovl->wsd->layout, &x, &y, NULL, NULL);
+ _obj_place(disp, (x + ovl->x) - (w / 2), (y + ovl->y) - (h / 2), w, h);
+ }
}
static void
sz = ftell(f);
if (sz > 0)
{
- char *buf;
-
- fseek(f, 0, SEEK_SET);
- buf = malloc(sz);
+ char *buf = malloc(sz + 1);
if (buf)
{
+ memset(buf, 0, sz + 1);
+ rewind(f);
if (fread(buf, 1, sz, f))
{
eina_simple_xml_parse
(buf, sz, EINA_TRUE, _xml_route_dump_cb, &dump);
}
- free(buf);
+ else
+ free(buf);
}
}
fclose(f);
sz = ftell(f);
if (sz > 0)
{
- char *buf;
-
- fseek(f, 0, SEEK_SET);
- buf = malloc(sz);
+ char *buf = malloc(sz + 1);
if (buf)
{
+ memset(buf, 0, sz + 1);
+ rewind(f);
if (fread(buf, 1, sz, f))
{
eina_simple_xml_parse
sz = ftell(f);
if (sz > 0)
{
- char *buf;
-
- fseek(f, 0, SEEK_SET);
- buf = malloc(sz);
+ char *buf = malloc(sz + 1);
if (buf)
{
+ memset(buf, 0, sz + 1);
+ rewind(f);
if (fread(buf, 1, sz, f))
{
eina_simple_xml_parse
return EVAS_EVENT_FLAG_NONE;
}
-
static Evas_Event_Flags
_pinch_momentum_start_cb(void *data,
void *ei)
sd->pinch_pan.y = mi->y1;
_overlay_place(sd);
}
+ // FIXME: Because n line move has some bouncing bug,
+ // perpect is calculated here
+ if (sd->pinch_pan.perspect >= 90)
+ sd->pinch_pan.perspect = 90;
+ else if (sd->pinch_pan.perspect <= 0)
+ sd->pinch_pan.perspect = 0;
+ sd->pinch_pan.perspect_y = mi->y1;
return EVAS_EVENT_FLAG_NONE;
}
sd->pinch_pan.y = mi->y2;
_overlay_place(sd);
}
+ // FIXME: Because n line move has some bouncing bug,
+ // perpect is calculated here
+ sd->pinch_pan.perspect += (mi->y2 - sd->pinch_pan.perspect_y);
+ sd->pinch_pan.perspect_y = mi->y2;
return EVAS_EVENT_FLAG_NONE;
}
return EVAS_EVENT_FLAG_NONE;
}
+static Evas_Event_Flags
+_pinch_n_lines_move_cb(void *data,
+ void *ei)
+{
+ Elm_Map_Smart_Data *sd = data;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EVAS_EVENT_FLAG_NONE);
+ Elm_Gesture_Line_Info *li = ei;
+
+ if (strcmp(sd->engine->name, INTERNAL_ENGINE_NAME) &&
+ (li->momentum.n == 2) &&
+ (((170 <= li->angle) && (li->angle <=190)) ||
+ (350 <= li->angle) || (li->angle <=10)))
+ {
+ sd->engine->perpective(ELM_WIDGET_DATA(sd)->obj, sd->pinch_pan.perspect, 0);
+ }
+
+ return EVAS_EVENT_FLAG_NONE;
+}
+
+static Evas_Event_Flags
+_pinch_n_lines_end_cb(void *data,
+ void *ei)
+{
+ Elm_Map_Smart_Data *sd = data;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EVAS_EVENT_FLAG_NONE);
+ Elm_Gesture_Line_Info *li = ei;
+
+ if (strcmp(sd->engine->name, INTERNAL_ENGINE_NAME) &&
+ (li->momentum.n == 2) &&
+ (((170 <= li->angle) && (li->angle <=190)) ||
+ (350 <= li->angle) || (li->angle <=10)))
+ {
+ sd->engine->perpective(ELM_WIDGET_DATA(sd)->obj, sd->pinch_pan.perspect, 0);
+ }
+
+ return EVAS_EVENT_FLAG_NONE;
+}
static void
_elm_map_pan_smart_pos_set(Evas_Object *obj,
Evas_Coord x,
if (sd->scr_timer)
{
- sd->scr_timer = NULL;
ecore_timer_del(sd->scr_timer);
+ sd->scr_timer = NULL;
}
if (sd->zoom_animator)
{
else return EINA_FALSE;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- sd->s_iface->content_pos_set(obj, x, y);
+ sd->s_iface->content_pos_set(obj, x, y, EINA_TRUE);
return EINA_TRUE;
}
elm_gesture_layer_cb_set
(priv->g_layer, ELM_GESTURE_MOMENTUM, ELM_GESTURE_STATE_END,
_pinch_momentum_end_cb, priv);
+ elm_gesture_layer_cb_set
+ (priv->g_layer, ELM_GESTURE_N_LINES, ELM_GESTURE_STATE_MOVE,
+ _pinch_n_lines_move_cb, priv);
+ elm_gesture_layer_cb_set
+ (priv->g_layer, ELM_GESTURE_N_LINES, ELM_GESTURE_STATE_END,
+ _pinch_n_lines_end_cb, priv);
priv->mode = ELM_MAP_ZOOM_MODE_MANUAL;
priv->zoom_min = priv->engine->zoom_min;
ELM_NOTIFY_DATA_GET(obj, sd);
+ sd->timer = NULL;
if (!evas_object_visible_get(obj)) goto end;
evas_object_hide(obj);
evas_object_smart_callback_call(obj, SIG_TIMEOUT, NULL);
end:
- sd->timer = NULL;
return ECORE_CALLBACK_CANCEL;
}
* @ingroup General
*/
EAPI void *elm_object_event_callback_del(Evas_Object *obj, Elm_Event_Cb func, const void *data);
+
+/**
+ * Disable the orientation mode of a given widget.
+ *
+ * Orientation Mode is used for widgets to change it's styles or to send signals
+ * whenever it's window degree is changed. If the orientation mode is enabled
+ * and the widget has different looks and styles for the window degree(0, 90,
+ * 180, 270), it will apply a style that is readied for the current degree,
+ * otherwise, it will send signals to it's own edje to change it's states if
+ * the style doesn't be readied.
+ *
+ * @param obj The Elementary object to operate on orientation mode.
+ * @param disabled The state to put in in: @c EINA_TRUE for disabled,
+ * @c EINA_FALSE for enabled.
+ *
+ * @since 1.8
+ *
+ * @ingroup General
+ */
+EAPI void elm_object_orientation_mode_disabled_set(Evas_Object *obj, Eina_Bool disabled);
+
+/**
+ * Get the orientation mode of a given widget.
+ *
+ * @param obj The Elementary widget to query for its orientation mode.
+ * @return @c EINA_TRUE, if the orientation mode is disabled, @c EINA_FALSE
+ * if the orientation mode is enabled (or on errors)
+ * @see elm_object_orientation_mode_disabled_set()
+ *
+ * @since 1.8
+ *
+ * @ingroup General
+ */
+EAPI Eina_Bool elm_object_orientation_mode_disabled_get(const Evas_Object *obj);
+
EAPI void elm_object_item_access_info_set(Elm_Object_Item *it, const char *txt);
/**
+ * @brief Register object item as an accessible object.
+ * @since 1.8
+ *
+ * @param item The elementary object item
+ * @return Accessible object of the object item or NULL for any error
+ *
+ * @ingroup General
+ */
+EAPI Evas_Object *elm_object_item_access_register(Elm_Object_Item *item);
+
+/**
+ * @brief Unregister accessible object of the object item.
+ * @since 1.8
+ *
+ * @param item The elementary object item
+ *
+ * @ingroup General
+ */
+EAPI void elm_object_item_access_unregister(Elm_Object_Item *item);
+
+/**
+ * @brief Get an accessible object of the object item.
+ * @since 1.8
+ *
+ * @param item The elementary object item
+ * @return Accessible object of the object item or NULL for any error
+ *
+ * @ingroup General
+ */
+EAPI Evas_Object *elm_object_item_access_object_get(const Elm_Object_Item *item);
+
+/**
+ * @brief Set highlight order
+ * @since 1.8
+ *
+ * @param item The container object item
+ * @param objs Order of objects to pass highlight
+ *
+ * @ingroup General
+ */
+EAPI void elm_object_item_access_order_set(Elm_Object_Item *item, Eina_List *objs);
+
+/**
+ * @brief Get highlight order
+ * @since 1.8
+ *
+ * @param item The container object item
+ * @return Order of objects to pass highlight
+ *
+ * @ingroup General
+ */
+EAPI const Eina_List *elm_object_item_access_order_get(const Elm_Object_Item *item);
+
+/**
+ * @brief Unset highlight order
+ * @since 1.8
+ *
+ * @param item The container object item
+ *
+ * @ingroup General
+ */
+EAPI void elm_object_item_access_order_unset(Elm_Object_Item *item);
+
+/**
* Get the data associated with an object item
* @param it The Elementary object item
* @return The data associated with @p it
else return EINA_FALSE;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- sd->s_iface->content_pos_set(obj, x, y);
+ sd->s_iface->content_pos_set(obj, x, y, EINA_TRUE);
return EINA_TRUE;
}
unsigned char vsync;
unsigned char thumbscroll_enable;
int thumbscroll_threshold;
+ int thumbscroll_hold_threshold;
double thumbscroll_momentum_threshold;
double thumbscroll_friction;
double thumbscroll_bounce_friction;
Eina_Bool _elm_theme_object_icon_set(Evas_Object *o,
const char *group,
const char *style);
-Eina_Bool _elm_theme_set(Elm_Theme *th,
+Eina_Bool _elm_theme_set(Elm_Theme *th,
Evas_Object *o,
const char *clas,
const char *group,
ELM_WIDGET_CLASS(_elm_radio_parent_sc)->base.del(obj);
}
-static void
+static Eina_Bool
_elm_radio_smart_activate(Evas_Object *obj, Elm_Activate act)
{
if (act != ELM_ACTIVATE_DEFAULT) return EINA_FALSE;
static const char SIG_EDGE_RIGHT[] = "edge,right";
static const char SIG_EDGE_TOP[] = "edge,top";
static const char SIG_EDGE_BOTTOM[] = "edge,bottom";
+static const char SIG_VBAR_DRAG[] = "vbar,drag";
+static const char SIG_VBAR_PRESS[] = "vbar,press";
+static const char SIG_VBAR_UNPRESS[] = "vbar,unpress";
+static const char SIG_HBAR_DRAG[] = "hbar,drag";
+static const char SIG_HBAR_PRESS[] = "hbar,press";
+static const char SIG_HBAR_UNPRESS[] = "hbar,unpress";
static const Evas_Smart_Cb_Description _smart_callbacks[] =
{
{SIG_SCROLL, ""},
{SIG_EDGE_RIGHT, ""},
{SIG_EDGE_TOP, ""},
{SIG_EDGE_BOTTOM, ""},
+ {SIG_VBAR_DRAG, ""},
+ {SIG_VBAR_PRESS, ""},
+ {SIG_VBAR_UNPRESS, ""},
+ {SIG_HBAR_DRAG, ""},
+ {SIG_HBAR_PRESS, ""},
+ {SIG_HBAR_UNPRESS, ""},
{NULL, NULL}
};
else return EINA_FALSE;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- sd->s_iface->content_pos_set(obj, x, y);
+ sd->s_iface->content_pos_set(obj, x, y, EINA_TRUE);
return EINA_TRUE;
}
x += page_x;
}
- sd->s_iface->content_pos_set(obj, x, y);
+ sd->s_iface->content_pos_set(obj, x, y, EINA_TRUE);
return EINA_TRUE;
}
cur = sd->content;
+ /* access */
+ if (_elm_config->access_mode)
+ {
+ if ((elm_widget_can_focus_get(cur)) ||
+ (elm_widget_child_can_focus_get(cur)))
+ return elm_widget_focus_next_get(cur, dir, next);
+
+ return EINA_FALSE;
+ }
+
/* Try focus cycle in subitem */
if (elm_widget_focus_get(obj))
{
}
static void
+_vbar_drag_cb(Evas_Object *obj,
+ void *data __UNUSED__)
+{
+ evas_object_smart_callback_call(obj, SIG_VBAR_DRAG, NULL);
+}
+
+static void
+_vbar_press_cb(Evas_Object *obj,
+ void *data __UNUSED__)
+{
+ evas_object_smart_callback_call(obj, SIG_VBAR_PRESS, NULL);
+}
+
+static void
+_vbar_unpress_cb(Evas_Object *obj,
+ void *data __UNUSED__)
+{
+ evas_object_smart_callback_call(obj, SIG_VBAR_UNPRESS, NULL);
+}
+
+static void
+_hbar_drag_cb(Evas_Object *obj,
+ void *data __UNUSED__)
+{
+ evas_object_smart_callback_call(obj, SIG_HBAR_DRAG, NULL);
+}
+
+static void
+_hbar_press_cb(Evas_Object *obj,
+ void *data __UNUSED__)
+{
+ evas_object_smart_callback_call(obj, SIG_HBAR_PRESS, NULL);
+}
+
+static void
+_hbar_unpress_cb(Evas_Object *obj,
+ void *data __UNUSED__)
+{
+ evas_object_smart_callback_call(obj, SIG_HBAR_UNPRESS, NULL);
+}
+
+static void
_scroll_cb(Evas_Object *obj,
void *data __UNUSED__)
{
priv->s_iface->edge_right_cb_set(obj, _edge_right_cb);
priv->s_iface->edge_top_cb_set(obj, _edge_top_cb);
priv->s_iface->edge_bottom_cb_set(obj, _edge_bottom_cb);
+ priv->s_iface->vbar_drag_cb_set(obj, _vbar_drag_cb);
+ priv->s_iface->vbar_press_cb_set(obj, _vbar_press_cb);
+ priv->s_iface->vbar_unpress_cb_set(obj, _vbar_unpress_cb);
+ priv->s_iface->hbar_drag_cb_set(obj, _hbar_drag_cb);
+ priv->s_iface->hbar_press_cb_set(obj, _hbar_press_cb);
+ priv->s_iface->hbar_unpress_cb_set(obj, _hbar_unpress_cb);
priv->s_iface->scroll_cb_set(obj, _scroll_cb);
priv->s_iface->animate_start_cb_set(obj, _scroll_anim_start_cb);
priv->s_iface->animate_stop_cb_set(obj, _scroll_anim_stop_cb);
{
Eina_Bool rtl;
double posx = 0.0, posy = 0.0, pos = 0.0, val;
+ char text[1024] = {0,};
+ Eina_Strbuf *buf = NULL;
+ char *str = NULL;
ELM_SLIDER_DATA_GET(obj, sd);
evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
if (sd->delay) ecore_timer_del(sd->delay);
sd->delay = ecore_timer_add(0.2, _delay_change, obj);
+
+ if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
+ {
+ buf = eina_strbuf_new();
+ if (sd->indicator_format_func)
+ {
+ str = sd->indicator_format_func(sd->val);
+ eina_strbuf_append(buf, str);
+ if (sd->indicator_format_free) sd->indicator_format_free(str);
+ eina_strbuf_append(buf, E_(" of "));
+ str = sd->indicator_format_func(sd->val_max);
+ eina_strbuf_append(buf, str);
+ if (sd->indicator_format_free) sd->indicator_format_free(str);
+ }
+ else if (sd->indicator)
+ {
+ snprintf(text, sizeof(text), sd->indicator, sd->val);
+ eina_strbuf_append(buf, text);
+ eina_strbuf_append(buf, E_(" of "));
+ snprintf(text, sizeof(text), sd->indicator, sd->val_max);
+ eina_strbuf_append(buf, text);
+ }
+
+ _elm_access_say(eina_strbuf_string_get(buf));
+ eina_strbuf_free(buf);
+ }
}
}
evas_object_event_callback_add(elm, EVAS_CALLBACK_DEL, _elm_theme_idler_clean, NULL);
evas_object_data_set(elm, "elm-theme-reload-idler", ecore_idler_add(_elm_theme_reload_idler, elm));
}
-}
+}
Eina_Bool
_elm_theme_object_set(Evas_Object *parent, Evas_Object *o, const char *clas, const char *group, const char *style)
void *test;
if (parent) th = elm_widget_theme_get(parent);
+ if (!_elm_theme_set(th, o, clas, group, style)) return EINA_FALSE;
+
test = evas_object_data_get(o, "edje,theme,watcher");
if (!test)
{
- edje_object_signal_callback_add(o, "edje,change,file", "edje", _elm_theme_reload, NULL);
+ edje_object_signal_callback_add(o, "edje,change,file", "edje",
+ _elm_theme_reload, NULL);
evas_object_data_set(o, "edje,theme,watcher", (void*) -1);
}
- return _elm_theme_set(th, o, clas, group, style);
+ return EINA_TRUE;
}
/* only issued by elm_icon.c */
{
const char *file;
char buf2[1024];
- Eina_Bool ok;
if ((!clas) || (!group) || (!style)) return EINA_FALSE;
if (!th) th = &(theme_default);
+
snprintf(buf2, sizeof(buf2), "elm/%s/%s/%s", clas, group, style);
file = _elm_theme_group_file_find(th, buf2);
if (file)
{
- ok = edje_object_file_set(o, file, buf2);
- if (ok) return EINA_TRUE;
+ if (edje_object_file_set(o, file, buf2))
+ return EINA_TRUE;
else
DBG("could not set theme group '%s' from file '%s': %s",
buf2, file, edje_load_error_str(edje_object_load_error_get(o)));
}
+
snprintf(buf2, sizeof(buf2), "elm/%s/%s/default", clas, group);
file = _elm_theme_group_file_find(th, buf2);
if (!file) return EINA_FALSE;
- ok = edje_object_file_set(o, file, buf2);
- if (!ok)
- DBG("could not set theme group '%s' from file '%s': %s",
- buf2, file, edje_load_error_str(edje_object_load_error_get(o)));
- return ok;
+ if (edje_object_file_set(o, file, buf2)) return EINA_TRUE;
+ DBG("could not set theme group '%s' from file '%s': %s",
+ buf2, file, edje_load_error_str(edje_object_load_error_get(o)));
+
+ return EINA_FALSE;
}
Eina_Bool
if (it->separator)
{
prev = ELM_TOOLBAR_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
- it->prio.priority = prev->prio.priority;
+ if (prev) it->prio.priority = prev->prio.priority;
}
}
if (sd->vertical)
{
- if (h >= vh) _items_size_fit(obj, &h, vh);
+ if (h > vh) _items_size_fit(obj, &h, vh);
if (sd->item_count - sd->separator_count > 0)
sd->s_iface->paging_set(obj, 0.0, 0.0, 0, (h / (sd->item_count - sd->separator_count)));
}
else
{
- if (w >= vw) _items_size_fit(obj, &w, vw);
+ if (w > vw) _items_size_fit(obj, &w, vw);
if (sd->item_count - sd->separator_count > 0)
sd->s_iface->paging_set(obj, 0.0, 0.0, (w / (sd->item_count - sd->separator_count)), 0);
}
if (!it->separator && !it->object)
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
+ // If the min size is changed by edje signal in edc,
+ //the below function should be called before the calculation.
+ edje_object_message_signal_process(view);
edje_object_size_min_restricted_calc(view, &mw, &mh, mw, mh);
if (!it->separator && !it->object)
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
sd->s_iface->content_viewport_size_get(obj, &vw, &vh);
if (sd->shrink_mode == ELM_TOOLBAR_SHRINK_NONE)
- {
- minw = minw_bx + (w - vw);
- minh = minh_bx + (h - vh);
- }
+ {
+ minw = minw_bx + (w - vw);
+ minh = minh_bx + (h - vh);
+ }
else if (sd->shrink_mode == ELM_TOOLBAR_SHRINK_EXPAND)
- {
- if (sd->vertical)
- {
- minw = minw_bx + (w - vw);
- if (minh_bx < vh) minh_bx = vh;
- else _items_size_fit(obj, &minh_bx, vh);
- }
- else
- {
- minh = minh_bx + (h - vh);
- if (minw_bx < vw) minw_bx = vw;
- else _items_size_fit(obj, &minw_bx, vw);
- }
- }
+ {
+ if (sd->vertical)
+ {
+ minw = minw_bx + (w - vw);
+ if (minh_bx <= vh) minh_bx = vh;
+ else _items_size_fit(obj, &minh_bx, vh);
+ }
+ else
+ {
+ minh = minh_bx + (h - vh);
+ if (minw_bx <= vw) minw_bx = vw;
+ else _items_size_fit(obj, &minw_bx, vw);
+ }
+ }
else
{
if (sd->vertical)
edje_object_signal_emit(VIEW(item), "elm,state,text,hidden", "elm");
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
+ // If the min size is changed by edje signal in edc,
+ //the below function should be called before the calculation.
+ edje_object_message_signal_process(VIEW(item));
edje_object_size_min_restricted_calc(VIEW(item), &mw, &mh, mw, mh);
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
if (sd->shrink_mode != ELM_TOOLBAR_SHRINK_EXPAND)
}
static void
-_items_change(Evas_Object *obj)
+_item_move_cb(void *data,
+ Evas *e __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ Elm_Toolbar_Item *item = data;
+
+ item->on_move = EINA_FALSE;
+
+ evas_object_event_callback_del_full
+ (VIEW(item), EVAS_CALLBACK_MOVE, _item_move_cb, data);
+}
+
+static void
+_items_change(Elm_Toolbar_Item *reorder_from, Elm_Toolbar_Item *reorder_to)
{
Elm_Toolbar_Item *prev = NULL, *next = NULL;
int tmp;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ ELM_TOOLBAR_DATA_GET(WIDGET(reorder_from), sd);
+ if (reorder_from == reorder_to) return;
- if ((sd->reorder_from) && (sd->reorder_to) &&
- (!sd->reorder_from->separator) && (!sd->reorder_to->separator))
+ if ((reorder_from) && (reorder_to) &&
+ (!reorder_from->separator) && (!reorder_to->separator))
{
prev = ELM_TOOLBAR_ITEM_FROM_INLIST
- (EINA_INLIST_GET(sd->reorder_from)->prev);
- if (prev == sd->reorder_to)
- prev = sd->reorder_from;
+ (EINA_INLIST_GET(reorder_from)->prev);
+ if (prev == reorder_to)
+ prev = reorder_from;
if (!prev)
next = ELM_TOOLBAR_ITEM_FROM_INLIST
- (EINA_INLIST_GET(sd->reorder_from)->next);
- if (next == sd->reorder_to)
+ (EINA_INLIST_GET(reorder_from)->next);
+ if (next == reorder_to)
next = NULL;
sd->items = eina_inlist_remove
- (sd->items, EINA_INLIST_GET(sd->reorder_from));
+ (sd->items, EINA_INLIST_GET(reorder_from));
sd->items = eina_inlist_append_relative
- (sd->items, EINA_INLIST_GET(sd->reorder_from),
- EINA_INLIST_GET(sd->reorder_to));
+ (sd->items, EINA_INLIST_GET(reorder_from),
+ EINA_INLIST_GET(reorder_to));
sd->items = eina_inlist_remove
- (sd->items, EINA_INLIST_GET(sd->reorder_to));
+ (sd->items, EINA_INLIST_GET(reorder_to));
if (prev)
sd->items = eina_inlist_append_relative
- (sd->items, EINA_INLIST_GET(sd->reorder_to),
+ (sd->items, EINA_INLIST_GET(reorder_to),
EINA_INLIST_GET(prev));
else if (next)
sd->items = eina_inlist_prepend_relative
- (sd->items, EINA_INLIST_GET(sd->reorder_to),
+ (sd->items, EINA_INLIST_GET(reorder_to),
EINA_INLIST_GET(next));
else
sd->items = eina_inlist_prepend
- (sd->items, EINA_INLIST_GET(sd->reorder_to));
+ (sd->items, EINA_INLIST_GET(reorder_to));
+
+ evas_object_box_remove(sd->bx, VIEW(reorder_from));
+ evas_object_box_insert_after(sd->bx, VIEW(reorder_from),
+ VIEW(reorder_to));
+ evas_object_box_remove(sd->bx, VIEW(reorder_to));
+ if (prev)
+ evas_object_box_insert_after(sd->bx, VIEW(reorder_to),
+ VIEW(prev));
+ else if (next)
+ evas_object_box_insert_before(sd->bx, VIEW(reorder_to),
+ VIEW(next));
+ else
+ evas_object_box_prepend(sd->bx, VIEW(reorder_to));
+
+ tmp = reorder_from->prio.priority;
+ reorder_from->prio.priority = reorder_to->prio.priority;
+ reorder_to->prio.priority = tmp;
+
+ reorder_from->on_move = EINA_TRUE;
+ reorder_to->on_move = EINA_TRUE;
+
+ evas_object_event_callback_add
+ (VIEW(reorder_from), EVAS_CALLBACK_MOVE,
+ _item_move_cb, reorder_from);
+ evas_object_event_callback_add
+ (VIEW(reorder_to), EVAS_CALLBACK_MOVE,
+ _item_move_cb, reorder_to);
+ }
+
+ _resize_cb(WIDGET(reorder_from), NULL, NULL, NULL);
+}
- if (sd->shrink_mode == ELM_TOOLBAR_SHRINK_NONE ||
- sd->shrink_mode == ELM_TOOLBAR_SHRINK_SCROLL)
+static void
+_transit_del_cb(void *data, Elm_Transit *transit __UNUSED__)
+{
+ Elm_Toolbar_Item *it, *item = data;
+ ELM_TOOLBAR_DATA_GET(WIDGET(item), sd);
+
+ if (item->reorder_to)
+ {
+ if (item->reorder_to == sd->reorder_empty)
+ sd->reorder_empty = item;
+ else if (item == sd->reorder_empty)
+ sd->reorder_empty = item->reorder_to;
+
+ _items_change(item->reorder_to, item);
+
+ EINA_INLIST_FOREACH(sd->items, it)
{
- evas_object_box_remove(sd->bx, VIEW(sd->reorder_from));
- evas_object_box_insert_after(sd->bx, VIEW(sd->reorder_from),
- VIEW(sd->reorder_to));
- evas_object_box_remove(sd->bx, VIEW(sd->reorder_to));
- if (prev)
- evas_object_box_insert_after(sd->bx, VIEW(sd->reorder_to),
- VIEW(prev));
- else if (next)
- evas_object_box_insert_before(sd->bx, VIEW(sd->reorder_to),
- VIEW(next));
- else
- evas_object_box_prepend(sd->bx, VIEW(sd->reorder_to));
+ if (it != item)
+ {
+ if (it->reorder_to == item)
+ it->reorder_to = item->reorder_to;
+ else if (it->reorder_to == item->reorder_to)
+ it->reorder_to = item;
+ }
}
+ }
+ if (item->proxy)
+ {
+ evas_object_image_source_visible_set(elm_image_object_get(item->proxy), EINA_TRUE);
+ evas_object_del(item->proxy);
+ item->proxy = NULL;
+ }
+ item->trans = NULL;
- tmp = sd->reorder_from->prio.priority;
- sd->reorder_from->prio.priority = sd->reorder_to->prio.priority;
- sd->reorder_to->prio.priority = tmp;
+ if (item->reorder_to)
+ {
+ EINA_INLIST_FOREACH(sd->items, it)
+ if (it->trans) break;
+
+ if (!it) sd->reorder_empty = sd->reorder_item;
}
+ item->reorder_to = NULL;
+}
- _resize_cb(obj, NULL, NULL, NULL);
+static void
+_item_transition_start
+(Elm_Toolbar_Item *it, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
+{
+ Evas_Coord tx, ty;
+ Evas_Object *obj = WIDGET(it);
+ ELM_TOOLBAR_DATA_GET(obj, sd);
+
+ it->proxy = elm_image_add(obj);
+ elm_image_aspect_fixed_set(it->proxy, EINA_FALSE);
+ evas_object_image_source_set(elm_image_object_get(it->proxy), VIEW(it));
+ evas_object_image_source_visible_set(elm_image_object_get(it->proxy), EINA_FALSE);
+
+ it->trans = elm_transit_add();
+ elm_transit_object_add(it->trans, it->proxy);
+ evas_object_geometry_get(VIEW(sd->reorder_empty), &tx, &ty, NULL, NULL);
+ evas_object_move(it->proxy, x, y);
+ evas_object_resize(it->proxy, w, h);
+ evas_object_show(it->proxy);
+
+ elm_transit_effect_translation_add(it->trans, 0, 0, tx - x, 0);
+ elm_transit_duration_set(it->trans, 0.3);
+ elm_transit_del_cb_set(it->trans, _transit_del_cb, it);
+ elm_transit_go(it->trans);
+
+ it->reorder_to = sd->reorder_empty;
}
static void
-_mouse_move_reorder(Elm_Toolbar_Item *it,
+_animate_missed_items(Elm_Toolbar_Item *prev, Elm_Toolbar_Item *next)
+{
+ ELM_TOOLBAR_DATA_GET(WIDGET(prev), sd);
+ Elm_Toolbar_Item *it, *it2;
+ Eina_List *list, *l;
+ Evas_Object *o;
+ Eina_Bool reverse = EINA_FALSE;
+ Evas_Coord fx, fy, fw, fh;
+
+ list = evas_object_box_children_get(sd->bx);
+
+ EINA_LIST_FOREACH(list, l, o)
+ {
+ if (o == VIEW(prev))
+ break;
+ else if (o == VIEW(next))
+ reverse = EINA_TRUE;
+ }
+
+ if (!reverse)
+ l = eina_list_next(l);
+ else
+ l = eina_list_prev(l);
+
+ while (VIEW(next) != eina_list_data_get(l))
+ {
+ EINA_INLIST_FOREACH(sd->items, it)
+ {
+ if (VIEW(it) == eina_list_data_get(l))
+ {
+ if (!it->trans && it != sd->reorder_item)
+ {
+ evas_object_geometry_get(VIEW(sd->reorder_empty), &fx, &fy, &fw, &fh);
+ _item_transition_start(it, fx, fy, fw, fh);
+ sd->reorder_empty = it;
+ }
+ EINA_INLIST_FOREACH(sd->items, it2)
+ {
+ if (it == it2->reorder_to) break;
+ }
+ if (it2)
+ {
+ it2->reorder_to = NULL;
+ evas_object_geometry_get(it2->proxy, &fx, &fy, &fw, &fh);
+ if (it2->trans) elm_transit_del(it2->trans);
+ _item_transition_start(it2, fx, fy, fw, fh);
+ sd->reorder_empty = it;
+ }
+ }
+ }
+ if (!reverse)
+ l = eina_list_next(l);
+ else
+ l = eina_list_prev(l);
+ }
+}
+
+static void
+_mouse_move_reorder(Elm_Toolbar_Item *item,
Evas *evas __UNUSED__,
Evas_Object *obj __UNUSED__,
Evas_Event_Mouse_Move *ev)
{
- Evas_Coord w, h;
+ Evas_Coord x, y, w, h;
+ Evas_Coord fx, fy, fw, fh;
+ Elm_Toolbar_Item *it, *it2;
- evas_object_geometry_get(VIEW(it), NULL, NULL, &w, &h);
- evas_object_move
- (VIEW(it), ev->cur.canvas.x - (w / 2), ev->cur.canvas.y - (h / 2));
- evas_object_show(VIEW(it));
+ ELM_TOOLBAR_DATA_GET(WIDGET(item), sd);
+
+ evas_object_geometry_get(VIEW(item), &x, &y, &w, &h);
+ if (sd->vertical)
+ evas_object_move(item->proxy, x, ev->cur.canvas.y - (h / 2));
+ else
+ evas_object_move(item->proxy, ev->cur.canvas.x - (w / 2), y);
+ evas_object_show(item->proxy);
+
+ if (sd->reorder_empty->on_move) return;
+
+ evas_object_geometry_get(sd->VIEW(reorder_empty), &x, &y, &w, &h);
+ if (ev->cur.canvas.x < x || ev->cur.canvas.x > x + w)
+ {
+ EINA_INLIST_FOREACH(sd->items, it)
+ {
+ if (it->on_move) continue;
+ evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
+ if (ev->cur.canvas.x > x && ev->cur.canvas.x < x + w) break;
+ }
+ if (it && (it != sd->reorder_empty))
+ {
+ _animate_missed_items(sd->reorder_empty, it);
+ if (!it->trans && it != item)
+ {
+ evas_object_geometry_get(VIEW(it), &fx, &fy, &fw, &fh);
+ _item_transition_start(it, fx, fy, fw, fh);
+ sd->reorder_empty = it;
+ }
+ EINA_INLIST_FOREACH(sd->items, it2)
+ {
+ if (it == it2->reorder_to) break;
+ }
+ if (it2)
+ {
+ it2->reorder_to = NULL;
+ evas_object_geometry_get(it2->proxy, &fx, &fy, &fw, &fh);
+ if (it2->trans) elm_transit_del(it2->trans);
+ _item_transition_start(it2, fx, fy, fw, fh);
+ sd->reorder_empty = it;
+ }
+ }
+ }
}
static void
_mouse_up_reorder(Elm_Toolbar_Item *it,
Evas *evas __UNUSED__,
Evas_Object *obj,
- Evas_Event_Mouse_Up *ev)
+ Evas_Event_Mouse_Up *ev __UNUSED__)
{
- Evas_Coord x, y, w, h;
-
ELM_TOOLBAR_DATA_GET(WIDGET(it), sd);
evas_object_event_callback_del_full
evas_object_event_callback_del_full
(sd->more, EVAS_CALLBACK_MOUSE_UP,
(Evas_Object_Event_Cb)_mouse_up_reorder, it);
- elm_widget_item_del(it);
- EINA_INLIST_FOREACH(sd->items, it)
+ if (it->proxy)
{
- evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
- if ((x < ev->canvas.x) && (ev->canvas.x < x + w) &&
- (y < ev->canvas.y) && (ev->canvas.y < y + h))
- {
- sd->reorder_to = it;
- _items_change(WIDGET(it));
- }
+ evas_object_image_source_visible_set(elm_image_object_get(it->proxy), EINA_TRUE);
+ evas_object_del(it->proxy);
+ it->proxy = NULL;
}
-
sd->s_iface->hold_set(obj, EINA_FALSE);
}
_item_reorder_start(Elm_Toolbar_Item *item)
{
Evas_Object *obj = WIDGET(item);
- Evas_Object *icon_obj;
Evas_Coord x, y, w, h;
- Elm_Toolbar_Item *it;
ELM_TOOLBAR_DATA_GET(obj, sd);
- sd->reorder_from = item;
+ sd->reorder_empty = sd->reorder_item = item;
- icon_obj = elm_icon_add(obj);
- elm_icon_order_lookup_set(icon_obj, sd->lookup_order);
-
- if (!icon_obj) return;
- it = elm_widget_item_new(obj, Elm_Toolbar_Item);
- if (!it)
- {
- evas_object_del(icon_obj);
- return;
- }
-
- it->label = eina_stringshare_add(item->label);
- VIEW(it) = edje_object_add(evas_object_evas_get(obj));
-
- if (_item_icon_set(icon_obj, "toolbar/", item->icon_str))
- {
- it->icon = icon_obj;
- it->icon_str = eina_stringshare_add(item->icon_str);
- }
- else
- {
- it->icon = NULL;
- it->icon_str = NULL;
- evas_object_del(icon_obj);
- }
-
- elm_widget_theme_object_set(obj, VIEW(it), "toolbar", "item",
- elm_widget_style_get(obj));
- if (it->icon)
- {
- int ms = 0;
-
- ms = ((double)sd->icon_size * elm_config_scale_get());
- evas_object_size_hint_min_set(it->icon, ms, ms);
- evas_object_size_hint_max_set(it->icon, ms, ms);
- edje_object_part_swallow(VIEW(it), "elm.swallow.icon", it->icon);
- edje_object_signal_emit(VIEW(it), "elm,state,icon,visible", "elm");
- evas_object_show(it->icon);
- elm_widget_sub_object_add(obj, it->icon);
- }
- if (it->label)
- {
- edje_object_part_text_escaped_set(VIEW(it), "elm.text", it->label);
- edje_object_signal_emit(VIEW(it), "elm,state,text,visible", "elm");
- }
-
- edje_object_signal_emit(VIEW(it), "elm,state,moving", "elm");
+ item->proxy = elm_image_add(obj);
+ elm_image_aspect_fixed_set(item->proxy, EINA_FALSE);
+ evas_object_image_source_set(elm_image_object_get(item->proxy), VIEW(item));
+ evas_object_image_source_visible_set(elm_image_object_get(item->proxy), EINA_FALSE);
+ evas_object_layer_set(item->proxy, 100);
+ edje_object_signal_emit(VIEW(item), "elm,state,moving", "elm");
evas_object_event_callback_add
(obj, EVAS_CALLBACK_MOUSE_MOVE,
- (Evas_Object_Event_Cb)_mouse_move_reorder, it);
+ (Evas_Object_Event_Cb)_mouse_move_reorder, item);
evas_object_event_callback_add
(sd->more, EVAS_CALLBACK_MOUSE_MOVE,
- (Evas_Object_Event_Cb)_mouse_move_reorder, it);
+ (Evas_Object_Event_Cb)_mouse_move_reorder, item);
evas_object_event_callback_add
- (VIEW(it), EVAS_CALLBACK_MOUSE_MOVE,
- (Evas_Object_Event_Cb)_mouse_move_reorder, it);
+ (item->proxy, EVAS_CALLBACK_MOUSE_MOVE,
+ (Evas_Object_Event_Cb)_mouse_move_reorder, item);
evas_object_event_callback_add
(obj, EVAS_CALLBACK_MOUSE_UP,
- (Evas_Object_Event_Cb)_mouse_up_reorder, it);
+ (Evas_Object_Event_Cb)_mouse_up_reorder, item);
evas_object_event_callback_add
(sd->more, EVAS_CALLBACK_MOUSE_UP,
- (Evas_Object_Event_Cb)_mouse_up_reorder, it);
+ (Evas_Object_Event_Cb)_mouse_up_reorder, item);
evas_object_geometry_get(VIEW(item), &x, &y, &w, &h);
- evas_object_resize(VIEW(it), w, h);
- evas_object_move(VIEW(it), x, y);
- evas_object_show(VIEW(it));
+ evas_object_resize(item->proxy, w, h);
+ evas_object_move(item->proxy, x, y);
+ evas_object_show(item->proxy);
- sd->s_iface->hold_set(WIDGET(it), EINA_TRUE);
+ sd->s_iface->hold_set(WIDGET(item), EINA_TRUE);
}
static Eina_Bool
-_long_press(Elm_Toolbar_Item *it)
+_long_press_cb(void *data)
{
+ Elm_Toolbar_Item *it = data;
ELM_TOOLBAR_DATA_GET(WIDGET(it), sd);
sd->long_timer = NULL;
(sd->long_timer, _elm_config->longpress_timeout);
else
sd->long_timer = ecore_timer_add
- (_elm_config->longpress_timeout, (Ecore_Task_Cb)_long_press, it);
+ (_elm_config->longpress_timeout, _long_press_cb, it);
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOUSE_MOVE,
(Evas_Object_Event_Cb)_mouse_move_cb, it);
static Eina_Bool
_item_del_pre_hook(Elm_Object_Item *it)
{
- Elm_Toolbar_Item *item, *next;
+ Elm_Toolbar_Item *item, *next = NULL;
Evas_Object *obj;
item = (Elm_Toolbar_Item *)it;
if (elm_widget_item_disabled_get(it)) return;
- if (it->selected)
- {
- _elm_access_say(E_("Unselected"));
- _item_unselect(it);
- }
- else
+ if (!it->selected)
{
_elm_access_say(E_("Selected"));
_item_select(it);
mw = mh = -1;
if (!it->separator && !it->object)
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
+ // If the min size is changed by edje signal in edc,
+ //the below function should be called before the calculation.
+ edje_object_message_signal_process(VIEW(it));
edje_object_size_min_restricted_calc(VIEW(it), &mw, &mh, mw, mh);
if (!it->separator && !it->object)
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
edje_object_signal_emit(VIEW(item), "elm,state,icon,hidden", "elm");
evas_object_hide(old_icon);
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
+ // If the min size is changed by edje signal in edc,
+ //the below function should be called before the calculation.
+ edje_object_message_signal_process(VIEW(item));
edje_object_size_min_restricted_calc(VIEW(item), &mw, &mh, mw, mh);
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
if (sd->shrink_mode != ELM_TOOLBAR_SHRINK_EXPAND)
Eina_Bool deleted : 1;
Eina_Bool state_keep : 1;
Eina_Bool finished : 1;
+ Eina_Bool smooth : 1;
};
struct _Elm_Transit_Effect_Module
free(obj_data);
}
_remove_obj_from_list(transit, obj);
- if (!transit->objs) elm_transit_del(transit);
+ if (!transit->objs && !transit->deleted) elm_transit_del(transit);
}
static void
Elm_Transit *chain_transit;
Eina_List *elist, *elist_next;
+ transit->deleted = EINA_TRUE;
+
if (transit->animator)
ecore_animator_del(transit->animator);
while (transit->objs)
_transit_obj_remove(transit, eina_list_data_get(transit->objs));
- transit->deleted = EINA_TRUE;
-
if (transit->del_data.func)
transit->del_data.func(transit->del_data.arg, transit);
transit->v1 = 1.0;
transit->v2 = 0.0;
+ transit->smooth = EINA_TRUE;
return transit;
}
{
ELM_TRANSIT_CHECK_OR_RETURN(transit);
- if (transit->walking) transit->deleted = EINA_TRUE;
- else _transit_del(transit);
+ transit->deleted = EINA_TRUE;
+ if (transit->walking) return;
+ _transit_del(transit);
}
EAPI void
}
EAPI void
+elm_transit_smooth_set(Elm_Transit *transit, Eina_Bool smooth)
+{
+ ELM_TRANSIT_CHECK_OR_RETURN(transit);
+ transit->smooth = !!smooth;
+}
+
+EAPI Eina_Bool
+elm_transit_smooth_get(const Elm_Transit *transit)
+{
+ ELM_TRANSIT_CHECK_OR_RETURN(transit, EINA_FALSE);
+ return transit->smooth;
+}
+
+EAPI void
elm_transit_event_enabled_set(Elm_Transit *transit, Eina_Bool enabled)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit);
_recover_image_uv(obj, map, EINA_FALSE, EINA_FALSE);
evas_map_util_3d_perspective(map, x + (w / 2), y + (h / 2), 0,
_TRANSIT_FOCAL);
+ if (!transit->smooth) evas_map_smooth_set(map, EINA_FALSE);
evas_object_map_set(obj, map);
evas_object_map_enable_set(obj, EINA_TRUE);
}
evas_map_util_3d_perspective(map, x + half_w, y + half_h, 0, _TRANSIT_FOCAL);
evas_object_map_enable_set(front, EINA_TRUE);
evas_object_map_enable_set(back, EINA_TRUE);
+ if (!transit->smooth) evas_map_smooth_set(map, EINA_FALSE);
evas_object_map_set(obj, map);
}
evas_map_free(map);
_TRANSIT_FOCAL);
evas_object_map_enable_set(resizable_flip_node->front, EINA_TRUE);
evas_object_map_enable_set(resizable_flip_node->back, EINA_TRUE);
+ if (!transit->smooth) evas_map_smooth_set(map, EINA_FALSE);
evas_object_map_set(obj, map);
}
evas_map_free(map);
_elm_fx_wipe_show(map, wipe->dir, _x, _y, _w, _h, (float)progress);
else
_elm_fx_wipe_hide(map, wipe->dir, _x, _y, _w, _h, (float)progress);
-
+ if (!transit->smooth) evas_map_smooth_set(map, EINA_FALSE);
evas_object_map_enable_set(obj, EINA_TRUE);
evas_object_map_set(obj, map);
}
half_h = (float)h * 0.5;
evas_map_util_rotate(map, degree, x + half_w, y + half_h);
+ if (!transit->smooth) evas_map_smooth_set(map, EINA_FALSE);
evas_object_map_enable_set(obj, EINA_TRUE);
evas_object_map_set(obj, map);
}
EAPI Eina_List *elm_transit_chain_transits_get(const Elm_Transit *transit);
/**
+ * Set the smooth effect for a transit.
+ *
+ * @param obj The transit object
+ * @param enabled enable or disable smooth map rendering
+ *
+ * This sets smoothing for transit map rendering. If the object added in a
+ * transit is a type that has its own smoothing settings, then both the smooth
+ * settings for this object and the map must be turned off. By default smooth
+ * maps are enabled.
+ *
+ * @see evas_map_smooth_set()
+ * @since 1.8
+ *
+ * @ingroup Transit
+ */
+EAPI void elm_transit_smooth_set(Elm_Transit *transit, Eina_Bool smooth);
+
+/**
+ * Get the smooth scaling for transit map rendering
+ *
+ * This gets smooth scaling for transit map rendering.
+ *
+ * @param obj The transit object
+ * @return @c EINA_TRUE if the smooth is enabled, @c EINA_FALSE otherwise.
+ *
+ * @see elm_transit_smooth_set()
+ * @since 1.8
+ *
+ */
+Eina_Bool elm_transit_smooth_get(const Elm_Transit *transit);
+
+/**
* Add the Resizing Effect to Elm_Transit.
*
* @note This API is one of the facades. It creates resizing effect context
if (!sd) \
return
+#define ELM_WIDGET_FOCUS_GET(obj) \
+ ((_elm_access_read_mode_get()) ? (elm_widget_highlight_get(obj)) : \
+ (elm_widget_focus_get(obj)))
typedef struct _Elm_Event_Cb_Data Elm_Event_Cb_Data;
typedef struct _Elm_Translate_String_Data Elm_Translate_String_Data;
return EINA_FALSE;
}
sdc->parent_obj = obj;
+ sdc->orient_mode = sd->orient_mode;
_elm_widget_top_win_focused_set(sobj, sd->top_win_focused);
/* update child focusable-ness on self and parents, now that a
return;
elm_widget_focus_next_get(obj, dir, &target);
if (target)
- elm_widget_focus_steal(target);
+ {
+ /* access */
+ if (_elm_config->access_mode && _elm_access_read_mode_get())
+ {
+ _elm_access_highlight_set(target);
+ _elm_widget_focus_region_show(target);
+ }
+ else elm_widget_focus_steal(target);
+ }
}
/**
if (!elm_widget_can_focus_get(obj))
return EINA_FALSE;
+ /* focusable object but does not have access info */
+ if (_elm_config->access_mode)
+ {
+ if (!_elm_access_object_get(obj)) return EINA_FALSE;
+ }
+
/* Return */
*next = (Evas_Object *)obj;
- return !elm_widget_focus_get(obj);
+ return !ELM_WIDGET_FOCUS_GET(obj);
}
/**
const Eina_List *l = items;
/* Recovery last focused sub item */
- if (elm_widget_focus_get(obj))
+ if (ELM_WIDGET_FOCUS_GET(obj))
{
for (; l; l = list_next(l))
{
Evas_Object *cur = list_data_get(l);
- if (elm_widget_focus_get(cur)) break;
+ if (ELM_WIDGET_FOCUS_GET(cur)) break;
}
/* Focused object, but no focused sub item */
return EINA_FALSE;
}
+EAPI Eina_Bool
+elm_widget_highlight_get(const Evas_Object *obj)
+{
+ API_ENTRY return EINA_FALSE;
+ return sd->highlighted;
+}
+
+EAPI void
+elm_widget_parent_highlight_set(Evas_Object *obj,
+ Eina_Bool highlighted)
+{
+ API_ENTRY return;
+
+ highlighted = !!highlighted;
+
+ Evas_Object *o = elm_widget_parent_get(obj);
+
+ if (o) elm_widget_parent_highlight_set(o, highlighted);
+
+ sd->highlighted = highlighted;
+}
+
EAPI void
elm_widget_signal_emit(Evas_Object *obj,
const char *emission,
if (!sd->api) return;
if (!sd->focused) return;
+
+ // FIXME: evas_object_ref/unref is temporary code to fix logical issue.
+ // After Eo is applied to elementary, remove these.
+ evas_object_ref(obj);
if (sd->resize_obj && elm_widget_focus_get(sd->resize_obj))
elm_widget_focused_object_clear(sd->resize_obj);
else
}
sd->focused = EINA_FALSE;
sd->api->on_focus(obj);
+ evas_object_unref(obj);
}
EAPI void
const char *wstyle)
{
API_ENTRY return EINA_FALSE;
- return _elm_theme_object_set(obj, edj, wname, welement, wstyle);
+ char buf[128];
+ int ret;
+
+ if (!_elm_theme_object_set(obj, edj, wname, welement, wstyle))
+ return EINA_FALSE;
+
+ if (sd->orient_mode != -1)
+ {
+
+ snprintf(buf, sizeof(buf), "elm,state,orient,%d", ret);
+ elm_widget_signal_emit(obj, buf, "elm");
+
+ }
+ return EINA_TRUE;
}
EAPI Eina_Bool
return _widget_name_find(obj, name, recurse);
}
+EAPI void
+elm_widget_orientation_mode_disabled_set(Evas_Object *obj, Eina_Bool disabled)
+{
+ int orient_mode = -1;
+
+ API_ENTRY return;
+
+ if (disabled && (sd->orient_mode == -1)) return;
+ if (!disabled && (sd->orient_mode != -1)) return;
+
+ if (!disabled)
+ {
+ //Get current orient mode from it's parent otherwise, 0.
+ sd->orient_mode = 0;
+ ELM_WIDGET_DATA_GET(sd->parent_obj, sd_parent);
+ if (!sd_parent) orient_mode = 0;
+ else orient_mode = sd_parent->orient_mode;
+ }
+ elm_widget_orientation_set(obj, orient_mode);
+}
+
+EAPI Eina_Bool
+elm_widget_orientation_mode_disabled_get(const Evas_Object *obj)
+{
+ Eina_Bool ret;
+
+ API_ENTRY return EINA_FALSE;
+
+ if (sd->orient_mode == -1) ret = EINA_TRUE;
+ else ret = EINA_FALSE;
+ return ret;
+}
+
+EAPI void
+elm_widget_orientation_set(Evas_Object *obj, int rotation)
+{
+ Evas_Object *child;
+ Eina_List *l;
+
+ API_ENTRY return;
+
+ if ((sd->orient_mode == rotation) || (sd->orient_mode == -1)) return;
+
+ sd->orient_mode = rotation;
+
+ EINA_LIST_FOREACH (sd->subobjs, l, child)
+ elm_widget_orientation_set(child, rotation);
+
+ if (rotation != -1)
+ {
+ char buf[128];
+ snprintf(buf, sizeof(buf), "elm,state,orient,%d", sd->orient_mode);
+ elm_widget_signal_emit(obj, buf, "elm");
+ }
+}
+
/**
* @internal
*
Evas_Object *obj);
int frozen;
+ int orient_mode; /* -1 is disabled */
Eina_Bool drag_x_locked : 1;
Eina_Bool drag_y_locked : 1;
* default */
Eina_Bool still_in : 1;
Eina_Bool can_access : 1;
+ Eina_Bool highlighted : 1;
+ Eina_Bool highlight_root : 1;
} Elm_Widget_Smart_Data;
/**
{
int type;
const void *data;
- Elm_Access_Content_Cb func;
+ Elm_Access_Info_Cb func;
};
struct _Elm_Access_Info
Evas_Object *part_object;
};
+void _elm_access_shutdown();
+void _elm_access_mouse_event_enabled_set(Eina_Bool enabled);
+/* elm_widget_focus_list_next_get();, elm_widget_focus_next_get();
+ and elm_widget_focus_cycle(); use _elm_access_read_mode to use
+ focus chain */
+void _elm_access_read_mode_set(Eina_Bool enabled);
+Eina_Bool _elm_access_read_mode_get();
+void _elm_access_widget_item_access_order_set(Elm_Widget_Item *item, Eina_List *objs);
+const Eina_List *_elm_access_widget_item_access_order_get(const Elm_Widget_Item *item);
+void _elm_access_widget_item_access_order_unset(Elm_Widget_Item *item);
+
EAPI void _elm_access_clear(Elm_Access_Info *ac);
EAPI void _elm_access_text_set(Elm_Access_Info *ac, int type, const char *text);
-EAPI void _elm_access_callback_set(Elm_Access_Info *ac, int type, Elm_Access_Content_Cb func, const void *data);
-EAPI char *_elm_access_text_get(const Elm_Access_Info *ac, int type, Evas_Object *obj); /* this is ok it actually returns a strduped string - it's meant to! */
-EAPI void _elm_access_read(Elm_Access_Info *ac, int type, Evas_Object *obj);
+EAPI void _elm_access_callback_set(Elm_Access_Info *ac, int type, Elm_Access_Info_Cb func, const void *data);
+EAPI char *_elm_access_text_get(const Elm_Access_Info *ac, int type, const Evas_Object *obj); /* this is ok it actually returns a strduped string - it's meant to! */
+EAPI void _elm_access_read(Elm_Access_Info *ac, int type, const Evas_Object *obj);
EAPI void _elm_access_say(const char *txt);
EAPI Elm_Access_Info *_elm_access_object_get(const Evas_Object *obj);
EAPI void _elm_access_object_hilight(Evas_Object *obj);
Elm_Widget_Disable_Cb disable_func;
Evas_Object *access_obj;
const char *access_info;
+ Eina_List *access_order;
Eina_Bool disabled : 1;
Eina_Bool on_deletion : 1;
EAPI void elm_widget_display_mode_set(Evas_Object *obj, Evas_Display_Mode dispmode);
EAPI const Elm_Widget_Smart_Class *elm_widget_smart_class_get(void);
+EAPI Eina_Bool elm_widget_highlight_get(const Evas_Object *obj);
+EAPI void elm_widget_parent_highlight_set(Evas_Object *obj, Eina_Bool highlighted);
/**
* @internal
*
EAPI Evas_Object *elm_widget_content_part_unset(Evas_Object *obj, const char *part);
EAPI void elm_widget_access_info_set(Evas_Object *obj, const char *txt);
EAPI const char *elm_widget_access_info_get(const Evas_Object *obj);
+EAPI void elm_widget_orientation_set(Evas_Object *obj, int rotation);
+EAPI void elm_widget_orientation_mode_disabled_set(Evas_Object *obj, Eina_Bool disabled);
+EAPI Eina_Bool elm_widget_orientation_mode_disabled_get(const Evas_Object *obj);
EAPI Elm_Widget_Item *_elm_widget_item_new(Evas_Object *parent, size_t alloc_size);
EAPI void _elm_widget_item_free(Elm_Widget_Item *item);
EAPI Evas_Object *_elm_widget_item_widget_get(const Elm_Widget_Item *item);
Evas_Object *parent;
Evas_Object *box;
+ Evas_Object *layout;
Evas_Object *arrow;
Evas_Object *scr;
Evas_Object *bg;
#include "elm_interface_scrollable.h"
#include "elm_widget_layout.h"
+#define GENGRID_FX_SUPPORT 1
+
/**
* @addtogroup Widget
* @{
long items_lost;
double align_x, align_y;
+#if GENGRID_FX_SUPPORT
+ Evas_Object *alpha_bg;
+ Eina_List *fx_items;
+ Eina_List *capture_before_items, *capture_after_items;
+ Eina_List *pending_del_items, *pending_unrealized_items;
+ Elm_Gen_Item *realized_top_item;
+#endif
+
Eina_Bool reorder_item_changed : 1;
Eina_Bool move_effect_enabled : 1;
* selection */
Eina_Bool show_region : 1;
Eina_Bool bring_in : 1;
+
+#if GENGRID_FX_SUPPORT
+ Eina_Bool fx_mode : 1;
+ Eina_Bool fx_first_captured : 1;
+ Eina_Bool fx_playing : 1;
+ Eina_Bool rendered : 1;
+ Eina_Bool fx_items_deleted : 1;
+ Eina_Bool gengrid_clearing : 1;
+#endif
};
struct Elm_Gen_Item_Type
Evas_Coord gx, gy, ox, oy, tx, ty, rx, ry;
unsigned int moving_effect_start_time;
int prev_group;
-
+#if GENGRID_FX_SUPPORT
+ Evas_Coord scrl_x, scrl_y, w, h;
+ Elm_Gen_FX_Item *fi;
+ int num;
+ Eina_Bool has_proxy_it : 1;
+#endif
Eina_Bool group_realized : 1;
Eina_Bool moving : 1;
};
// FIXME: Difference from upstream
#define GENLIST_ENTRY_SUPPORT 1
+#define GENLIST_FX_SUPPORT 1
+#define GENLIST_PINCH_ZOOM_SUPPORT 1
/**
* @addtogroup Widget
*/
typedef struct _Elm_Genlist_Smart_Data Elm_Genlist_Smart_Data;
-typedef enum
-{
- ELM_GENLIST_TREE_EFFECT_NONE = 0,
- ELM_GENLIST_TREE_EFFECT_EXPAND = 1,
- ELM_GENLIST_TREE_EFFECT_CONTRACT = 2
-} Elm_Genlist_Item_Move_Effect_Mode;
-
struct _Elm_Genlist_Smart_Data
{
Elm_Layout_Smart_Data base; /* base widget smart data as
* event when tree
* effect is not
* finished */
- Eina_List *move_items; /* items move for
- * tree effect */
Elm_Gen_Item *expanded_next_item;
- Ecore_Animator *tree_effect_animator;
- Elm_Genlist_Item_Move_Effect_Mode move_effect_mode;
+ int reorder_fast;
+
+#if GENLIST_FX_SUPPORT
+ Eina_List *fx_items;
+ Eina_List *capture_before_items, *capture_after_items;
+ Eina_List *pending_del_items, *pending_unrealized_items;
+ Eina_List *pending_unrealized_decorate_all_items;
+ Elm_Gen_Item *realized_top_item;
+#endif
- Eina_Bool tree_effect_enabled : 1;
Eina_Bool auto_scroll_enabled : 1;
Eina_Bool decorate_all_mode : 1;
Eina_Bool height_for_width : 1;
* selection */
Eina_Bool swipe : 1;
- int reorder_fast;
#if GENLIST_ENTRY_SUPPORT
Eina_Bool size_changed : 1;
#endif
+
+#if GENLIST_FX_SUPPORT
+ Eina_Bool fx_mode : 1;
+ Eina_Bool fx_first_captured : 1;
+ Eina_Bool fx_playing : 1;
+ Eina_Bool rendered : 1;
+ Eina_Bool fx_items_deleted : 1;
+ Eina_Bool genlist_clearing : 1;
+#endif
+#if GENLIST_PINCH_ZOOM_SUPPORT
+ Elm_Gen_Pinch_Zoom_Mode pinch_zoom_mode;
+ Evas_Coord pinch_pan_y, pinch_zoom_h;
+#endif
};
typedef struct _Item_Block Item_Block;
Elm_Gen_Item *rel;
Eina_List *rel_revs; // FIXME: find better way not to use this
Evas_Object *deco_it_view;
+#if GENLIST_FX_SUPPORT
+ Elm_Gen_FX_Item *fi;
+ int num;
+#endif
+#if GENLIST_PINCH_ZOOM_SUPPORT
+ Evas_Coord pan_scrl_y;
+#endif
int expanded_depth;
int order_num_in;
Eina_Bool decorate_all_item_realized : 1;
- Eina_Bool tree_effect_finished : 1; /* tree effect */
Eina_Bool move_effect_enabled : 1;
- Eina_Bool tree_effect_hide_me : 1; /* item hide for
- * tree effect */
Eina_Bool stacking_even : 1;
Eina_Bool want_realize : 1;
Eina_Bool show_me : 1;
/* if item is realized once, it is not unrealized & realized again. */
Eina_Bool unrealize_disabled: 1;
+#if GENLIST_FX_SUPPORT
+ Eina_Bool has_proxy_it : 1;
+#endif
};
struct _Item_Block
Eina_List *items; /* 1 list. N levels, but only 2
* for now and # of items will be
* small */
+ Eina_List *omit;
+
int level;
Evas_Coord dx, dy;
Ecore_Timer *delay;
+ double delay_change_time;
Eina_Bool level_active[2];
Eina_Bool down : 1;
Eina_Bool horizontal : 1;
Eina_Bool autohide_disabled : 1;
Eina_Bool indicator_disabled : 1;
-
- Eina_List *omit;
+ Eina_Bool omit_enabled : 1;
+ Eina_Bool index_focus : 1;
};
typedef struct _Elm_Index_Item Elm_Index_Item;
int level;
Evas_Smart_Cb func;
- Eina_Bool selected : 1;
-
Eina_List *omitted;
- Elm_Index_Item *head;
+ Elm_Index_Item *head;
+
+ Eina_Bool selected : 1;
};
typedef struct _Elm_Index_Omit Elm_Index_Omit;
{
unsigned int st;
int x, y;
+ double perspect;
+ double perspect_y;
} pinch_pan;
Eina_List *routes;
Evas_Object *entry;
Evas_Object *label;
Evas_Object *guide;
- Evas_Object *number;
+ Evas_Object *end;
Evas_Coord boxh;
Evas_Coord boxw;
Eina_Bool editable : 1;
Eina_Bool expanded : 1;
Eina_Bool expanded_state : 1;
+ Eina_Bool long_pressed : 1;
+
+ Ecore_Timer *longpress_timer;
} Elm_Multibuttonentry_Smart_Data;
/**
Eina_List *popping;
Evas_Object *dummy_edje;
Evas_Display_Mode dispmode;
- Elm_Object_Item *compress_it;
Eina_Bool preserve : 1;
Eina_Bool on_deletion : 1;
Evas_Object *title_next_btn;
Evas_Object *title_icon;
Ecore_Animator *animator;
+ Evas_Display_Mode dispmode;
+ Elm_Naviframe_Item_Pop_Cb pop_cb;
+ void *pop_data;
const char *style;
const char *title_label;
const char *subtitle_label;
Evas_Object *notify;
Evas_Object *title_icon;
- Evas_Object *title_access_obj;
Evas_Object *content_area;
Evas_Object *text_content_obj;
Evas_Object *action_area;
Evas_Object *menu_parent;
Eina_Inlist *items;
Elm_Toolbar_Item *more_item, *selected_item;
- Elm_Toolbar_Item *reorder_from, *reorder_to;
+ Elm_Toolbar_Item *reorder_empty, *reorder_item;
Elm_Toolbar_Shrink_Mode shrink_mode;
Elm_Icon_Lookup_Order lookup_order;
int theme_icon_size, priv_icon_size,
Evas_Object *object;
Evas_Object *o_menu;
Evas_Object *in_box;
+ Evas_Object *proxy;
Evas_Smart_Cb func;
+ Elm_Transit *trans;
+ Elm_Toolbar_Item *reorder_to;
struct
{
int priority;
Eina_Bool separator : 1;
Eina_Bool selected : 1;
Eina_Bool menu : 1;
+ Eina_Bool on_move : 1;
};
struct _Elm_Toolbar_Item_State
#define ENGINE_GET() (_elm_preferred_engine ? _elm_preferred_engine : (_elm_config->engine ? _elm_config->engine : ""))
#define ENGINE_COMPARE(name) (!strcmp(ENGINE_GET(), name))
+#define EE_ENGINE_COMPARE(ee, name) (!strcmp(ecore_evas_engine_name_get(ee), name))
typedef struct _Elm_Win_Smart_Data Elm_Win_Smart_Data;
Elm_Win_Keyboard_Mode kbdmode;
Elm_Win_Indicator_Mode indmode;
Elm_Win_Indicator_Opacity_Mode ind_o_mode;
+ Elm_Win_Indicator_Type_Mode ind_t_mode;
struct
{
const char *info;
static Ecore_Job *_elm_win_state_eval_job = NULL;
static void
-_elm_win_obj_intercept_move(void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y)
-{
- Elm_Win_Smart_Data *sd = data;
-
- if (sd->img_obj)
- {
- if ((x != sd->screen.x) || (y != sd->screen.y))
- {
- sd->screen.x = x;
- sd->screen.y = y;
- evas_object_smart_callback_call(obj, SIG_MOVED, NULL);
- }
- }
- else
- {
- evas_object_move(obj, x, y);
- }
-}
-
-static void
_elm_win_obj_intercept_show(void *data, Evas_Object *obj)
{
Elm_Win_Smart_Data *sd = data;
TRAP(sd, layer_set, l);
}
- static void
+static void
_ecore_evas_move_(void *data, Evas_Object *obj __UNUSED__, int a, int b)
{
printf("[%s][%d] a=%d, b=%d\n", __FUNCTION__, __LINE__, a, b);
TRAP(sd, move, a, b);
}
-
/* Event Callbacks */
static void
evas_object_geometry_get(ELM_WIDGET_DATA(sd)->obj, NULL, NULL, &w, &h);
evas_object_geometry_get(target, &tx, &ty, &tw, &th);
evas_object_geometry_get(previous, &px, &py, &pw, &ph);
- evas_object_move(obj, 0, 0);
+ evas_object_move(obj, tx, ty);
evas_object_resize(obj, tw, th);
evas_object_clip_unset(obj);
m = alloca(sizeof(*m) + (sizeof(int) * 8));
m->count = 8;
- m->val[0] = px;
- m->val[1] = py;
+ m->val[0] = px - tx;
+ m->val[1] = py - ty;
m->val[2] = pw;
m->val[3] = ph;
- m->val[4] = tx;
- m->val[5] = ty;
+ m->val[4] = 0;
+ m->val[5] = 0;
m->val[6] = tw;
m->val[7] = th;
edje_object_message_send(obj, EDJE_MESSAGE_INT_SET, 1, m);
edje_object_signal_emit(sd->frame_obj, "elm,action,unfocus", "elm");
}
+ /* access */
+ _elm_access_object_hilight_disable(evas_object_evas_get(obj));
+
/* do nothing */
/* if (sd->img_obj) */
/* { */
}
static void
+_elm_win_resize_objects_eval(Evas_Object *obj)
+{
+ const Eina_List *l;
+ const Evas_Object *child;
+
+ ELM_WIN_DATA_GET(obj, sd);
+ Evas_Coord w, h, minw = -1, minh = -1, maxw = -1, maxh = -1;
+ int xx = 1, xy = 1;
+ double wx, wy;
+
+ EINA_LIST_FOREACH(sd->resize_objs, l, child)
+ {
+ evas_object_size_hint_weight_get(child, &wx, &wy);
+ if (wx == 0.0) xx = 0;
+ if (wy == 0.0) xy = 0;
+
+ evas_object_size_hint_min_get(child, &w, &h);
+ if (w < 1) w = 1;
+ if (h < 1) h = 1;
+ if (w > minw) minw = w;
+ if (h > minh) minh = h;
+
+ evas_object_size_hint_max_get(child, &w, &h);
+ if (w < 1) w = -1;
+ if (h < 1) h = -1;
+ if (maxw == -1) maxw = w;
+ else if ((w > 0) && (w < maxw))
+ maxw = w;
+ if (maxh == -1) maxh = h;
+ else if ((h > 0) && (h < maxh))
+ maxh = h;
+ }
+ if (!xx) maxw = minw;
+ else maxw = 32767;
+ if (!xy) maxh = minh;
+ else maxh = 32767;
+ evas_object_size_hint_min_set(obj, minw, minh);
+ evas_object_size_hint_max_set(obj, maxw, maxh);
+ evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+ if (w < minw) w = minw;
+ if (h < minh) h = minh;
+ if ((maxw >= 0) && (w > maxw)) w = maxw;
+ if ((maxh >= 0) && (h > maxh)) h = maxh;
+ evas_object_resize(obj, w, h);
+}
+
+static void
+_elm_win_on_resize_obj_del(void *data,
+ Evas *e __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ ELM_WIN_DATA_GET(data, sd);
+
+ sd->resize_objs = eina_list_remove(sd->resize_objs, obj);
+
+ _elm_win_resize_objects_eval(data);
+}
+
+static void
+_elm_win_on_resize_obj_changed_size_hints(void *data,
+ Evas *e __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ _elm_win_resize_objects_eval(data);
+}
+
+static void
_elm_win_smart_del(Evas_Object *obj)
{
const char *str;
+ const Eina_List *l;
+ const Evas_Object *child;
+
ELM_WIN_DATA_GET(obj, sd);
/* NB: child deletion handled by parent's smart del */
sd->parent = NULL;
}
+ EINA_LIST_FOREACH(sd->resize_objs, l, child)
+ {
+ evas_object_event_callback_del_full
+ (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _elm_win_on_resize_obj_changed_size_hints, obj);
+ evas_object_event_callback_del_full
+ (child, EVAS_CALLBACK_DEL, _elm_win_on_resize_obj_del, obj);
+ }
+
if (sd->autodel_clear) *(sd->autodel_clear) = -1;
_elm_win_list = eina_list_remove(_elm_win_list, obj);
Ecore_X_Window xwin = 0;
if (!ee) return 0;
- if (ENGINE_COMPARE(ELM_SOFTWARE_X11))
+ if (EE_ENGINE_COMPARE(ee, ELM_SOFTWARE_X11))
{
if (ee) xwin = ecore_evas_software_x11_window_get(ee);
}
- else if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
- ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE) ||
- ENGINE_COMPARE(ELM_SOFTWARE_SDL) ||
- ENGINE_COMPARE(ELM_SOFTWARE_16_SDL) ||
- ENGINE_COMPARE(ELM_OPENGL_SDL) ||
- ENGINE_COMPARE(ELM_OPENGL_COCOA))
+ else if (EE_ENGINE_COMPARE(ee, ELM_SOFTWARE_FB) ||
+ EE_ENGINE_COMPARE(ee, ELM_SOFTWARE_16_WINCE) ||
+ EE_ENGINE_COMPARE(ee, ELM_SOFTWARE_SDL) ||
+ EE_ENGINE_COMPARE(ee, ELM_SOFTWARE_16_SDL) ||
+ EE_ENGINE_COMPARE(ee, ELM_OPENGL_SDL) ||
+ EE_ENGINE_COMPARE(ee, ELM_OPENGL_COCOA))
{
}
- else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11))
+ else if (EE_ENGINE_COMPARE(ee, ELM_SOFTWARE_16_X11))
{
if (ee) xwin = ecore_evas_software_x11_16_window_get(ee);
}
- else if (ENGINE_COMPARE(ELM_SOFTWARE_8_X11))
+ else if (EE_ENGINE_COMPARE(ee, ELM_SOFTWARE_8_X11))
{
if (ee) xwin = ecore_evas_software_x11_8_window_get(ee);
}
- else if (ENGINE_COMPARE(ELM_OPENGL_X11))
+ else if (EE_ENGINE_COMPARE(ee, ELM_OPENGL_X11))
{
if (ee) xwin = ecore_evas_gl_x11_window_get(ee);
}
- else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32))
+ else if (EE_ENGINE_COMPARE(ee, ELM_SOFTWARE_WIN32))
{
if (ee) xwin = (long)ecore_evas_win32_window_get(ee);
}
#endif
-static void
-_elm_win_resize_objects_eval(Evas_Object *obj)
-{
- const Eina_List *l;
- const Evas_Object *child;
-
- ELM_WIN_DATA_GET(obj, sd);
- Evas_Coord w, h, minw = -1, minh = -1, maxw = -1, maxh = -1;
- int xx = 1, xy = 1;
- double wx, wy;
-
- EINA_LIST_FOREACH(sd->resize_objs, l, child)
- {
- evas_object_size_hint_weight_get(child, &wx, &wy);
- if (wx == 0.0) xx = 0;
- if (wy == 0.0) xy = 0;
-
- evas_object_size_hint_min_get(child, &w, &h);
- if (w < 1) w = 1;
- if (h < 1) h = 1;
- if (w > minw) minw = w;
- if (h > minh) minh = h;
-
- evas_object_size_hint_max_get(child, &w, &h);
- if (w < 1) w = -1;
- if (h < 1) h = -1;
- if (maxw == -1) maxw = w;
- else if ((w > 0) && (w < maxw))
- maxw = w;
- if (maxh == -1) maxh = h;
- else if ((h > 0) && (h < maxh))
- maxh = h;
- }
- if (!xx) maxw = minw;
- else maxw = 32767;
- if (!xy) maxh = minh;
- else maxh = 32767;
- evas_object_size_hint_min_set(obj, minw, minh);
- evas_object_size_hint_max_set(obj, maxw, maxh);
- evas_object_geometry_get(obj, NULL, NULL, &w, &h);
- if (w < minw) w = minw;
- if (h < minh) h = minh;
- if ((maxw >= 0) && (w > maxw)) w = maxw;
- if ((maxh >= 0) && (h > maxh)) h = maxh;
- evas_object_resize(obj, w, h);
-}
-
-static void
-_elm_win_on_resize_obj_del(void *data,
- Evas *e __UNUSED__,
- Evas_Object *obj __UNUSED__,
- void *event_info __UNUSED__)
-{
- ELM_WIN_DATA_GET(data, sd);
-
- sd->resize_objs = eina_list_remove(sd->resize_objs, obj);
-
- _elm_win_resize_objects_eval(data);
-}
-
-static void
-_elm_win_on_resize_obj_changed_size_hints(void *data,
- Evas *e __UNUSED__,
- Evas_Object *obj __UNUSED__,
- void *event_info __UNUSED__)
-{
- _elm_win_resize_objects_eval(data);
-}
void
_elm_win_shutdown(void)
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ)
{
/* there would be better way to read highlight object */
- ecore_x_mouse_in_send(sd->x.xwin, e->data.l[2], e->data.l[3]);
- ecore_x_mouse_move_send(sd->x.xwin, e->data.l[2], e->data.l[3]);
+ Evas *evas;
+ evas = evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj);
+ if (!evas) return ECORE_CALLBACK_PASS_ON;
+
+ _elm_access_mouse_event_enabled_set(EINA_TRUE);
+
+ evas_event_feed_mouse_in(evas, 0, NULL);
+ evas_event_feed_mouse_move
+ (evas, e->data.l[2], e->data.l[3], 0, NULL);
+
+ _elm_access_mouse_event_enabled_set(EINA_FALSE);
}
else if ((unsigned int)e->data.l[1] ==
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_NEXT)
opt_i++;
opt[opt_i] = 1;
opt_i++;
+ opt[opt_i] = 0;
}
if (opt_i > 0)
tmp_sd.ee = ecore_evas_gl_x11_options_new
(obj, _elm_win_obj_intercept_stack_below, sd);
evas_object_intercept_layer_set_callback_add
(obj, _elm_win_obj_intercept_layer_set, sd);
-// evas_object_intercept_show_callback_add
-// (obj, _elm_win_obj_intercept_show, sd);
+ evas_object_intercept_show_callback_add
+ (obj, _elm_win_obj_intercept_show, sd);
+ evas_object_intercept_move_callback_add
+ (obj, _ecore_evas_move_, sd);
- evas_object_intercept_move_callback_add(obj,
- _ecore_evas_move_, sd);
TRAP(sd, name_class_set, name, _elm_appname);
ecore_evas_callback_delete_request_set(sd->ee, _elm_win_delete_request);
ecore_evas_callback_resize_set(sd->ee, _elm_win_resize);
ecore_evas_manual_render(sd->ee);
}
-EAPI void
-elm_win_rotation_set(Evas_Object *obj,
- int rotation)
+static int
+_win_rotation_degree_check(int rotation)
{
- ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ if ((rotation > 360) || (rotation < 0))
+ {
+ WRN("Rotation degree should be 0 ~ 360 (passed degree: %d)", rotation);
+ rotation %= 360;
+ if (rotation < 0) rotation += 360;
+ }
+ return rotation;
+}
- rotation %= 360;
- if (rotation < 0) rotation += 360;
+static void
+_win_rotate(Evas_Object *obj, Elm_Win_Smart_Data *sd, int rotation, Eina_Bool resize)
+{
+ rotation = _win_rotation_degree_check(rotation);
if (sd->rot == rotation) return;
sd->rot = rotation;
- TRAP(sd, rotation_set, rotation);
+ if (resize) TRAP(sd, rotation_with_resize_set, rotation);
+ else TRAP(sd, rotation_set, rotation);
evas_object_size_hint_min_set(obj, -1, -1);
evas_object_size_hint_max_set(obj, -1, -1);
_elm_win_resize_objects_eval(obj);
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwin_update(sd);
#endif
+ elm_widget_orientation_set(obj, rotation);
evas_object_smart_callback_call(obj, SIG_ROTATION_CHANGED, NULL);
}
EAPI void
+elm_win_rotation_set(Evas_Object *obj,
+ int rotation)
+{
+ ELM_WIN_CHECK(obj);
+ ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ _win_rotate(obj, sd, rotation, EINA_FALSE);
+}
+
+EAPI void
elm_win_rotation_with_resize_set(Evas_Object *obj,
int rotation)
{
ELM_WIN_CHECK(obj);
ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
-
- rotation %= 360;
- if (rotation < 0) rotation += 360;
- if (sd->rot == rotation) return;
- sd->rot = rotation;
- TRAP(sd, rotation_with_resize_set, rotation);
- evas_object_size_hint_min_set(obj, -1, -1);
- evas_object_size_hint_max_set(obj, -1, -1);
- _elm_win_resize_objects_eval(obj);
-
-#ifdef HAVE_ELEMENTARY_X
- _elm_win_xwin_update(sd);
-#endif
- evas_object_smart_callback_call(obj, SIG_ROTATION_CHANGED, NULL);
+ _win_rotate(obj, sd, rotation, EINA_TRUE);
}
EAPI int
}
EAPI void
+elm_win_indicator_type_set(Evas_Object *obj,
+ Elm_Win_Indicator_Type_Mode mode)
+{
+ ELM_WIN_CHECK(obj);
+ ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+
+ if (mode == sd->ind_t_mode) return;
+ sd->ind_t_mode = mode;
+#ifdef HAVE_ELEMENTARY_X
+ _elm_win_xwindow_get(sd);
+ if (sd->x.xwin)
+ {
+ if (sd->ind_t_mode == ELM_WIN_INDICATOR_TYPE_1)
+ ecore_x_e_illume_indicator_type_set
+ (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_TYPE_1);
+ else if (sd->ind_t_mode == ELM_WIN_INDICATOR_TYPE_2)
+ ecore_x_e_illume_indicator_type_set
+ (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_TYPE_2);
+ }
+#endif
+ //evas_object_smart_callback_call(obj, SIG_INDICATOR_PROP_CHANGED, NULL);
+}
+
+EAPI Elm_Win_Indicator_Type_Mode
+elm_win_indicator_type_get(const Evas_Object *obj)
+{
+ ELM_WIN_CHECK(obj) ELM_WIN_INDICATOR_TYPE_UNKNOWN;
+ ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, ELM_WIN_INDICATOR_TYPE_UNKNOWN);
+
+ return sd->ind_t_mode;
+}
+EAPI void
elm_win_screen_position_get(const Evas_Object *obj,
int *x,
int *y)
} Elm_Win_Indicator_Opacity_Mode;
/**
+ * Defines the type modes of indicator that can be shown
+ * If the indicator can support several type of indicator,
+ * you can use this enum value to deal with different type of indicator
+ */
+
+typedef enum
+{
+ ELM_WIN_INDICATOR_TYPE_UNKNOWN, /**< Unknown indicator type mode */
+ ELM_WIN_INDICATOR_TYPE_1, /**< Type 0 the the indicator */
+ ELM_WIN_INDICATOR_TYPE_2, /**< Type 1 the indicator */
+} Elm_Win_Indicator_Type_Mode;
+
+/**
* Available commands that can be sent to the Illume manager.
*
* When running under an Illume session, a window may send commands to the
EAPI Elm_Win_Indicator_Opacity_Mode elm_win_indicator_opacity_get(const Evas_Object *obj);
/**
+ * Sets the indicator type mode of the window.
+ *
+ * @param obj The window object
+ * @param mode The mode to set, one of #Elm_Win_Indicator_Type_Mode
+ *
+ * @ingroup Win
+ */
+EAPI void elm_win_indicator_type_set(Evas_Object *obj, Elm_Win_Indicator_Type_Mode mode);
+
+/**
+ * Gets the indicator type mode of the window.
+ *
+ * @param obj The window object
+ * @return The mode, one of #Elm_Win_Indicator_Type_Mode
+ *
+ * @ingroup Win
+ */
+EAPI Elm_Win_Indicator_Type_Mode elm_win_indicator_type_get(const Evas_Object *obj);
+
+/**
* Get the screen position of a window.
*
* @param obj The window object
return EINA_FALSE;
if (!_elm_theme_object_set(obj, cur->obj, "cursor", cur->cursor_name,
- cur->style ? cur->style : "default"))
+ cur->style ? cur->style : "default"))
{
evas_object_del(cur->obj);
cur->obj = NULL;
{
if ((!cur) || (!cur->obj)) return;
if (!_elm_theme_object_set(cur->eventarea, cur->obj, "cursor",
- cur->cursor_name, cur->style))
+ cur->cursor_name, cur->style))
ERR("Could not apply the theme to the cursor style=%s", cur->style);
else
_elm_cursor_set_hot_spots(cur);
typedef struct _Smart_Data Smart_Data;
#define EVTIME 1
-//#define SCROLLDBG 1
-
-/* smoothness debug calls - for debugging how much smooth your app is */
-#define SMOOTHDBG 1
-
-#ifdef SMOOTHDBG
-#define SMOOTH_DEBUG_COUNT 100
-#define FPS 1/60
-typedef struct _smooth_debug_info smooth_debug_info;
-struct _smooth_debug_info
-{
- double t;
- double dt;
- Evas_Coord pos;
- Evas_Coord dpos;
- double vpos;
-};
-
-static smooth_debug_info smooth_x_history[SMOOTH_DEBUG_COUNT];
-static smooth_debug_info smooth_y_history[SMOOTH_DEBUG_COUNT];
-static int smooth_info_x_count = 0;
-static int smooth_info_y_count = 0;
-static double start_time = 0;
-static int _els_scroller_smooth_debug = 0;
-
-void
-_els_scroller_smooth_debug_init(void)
-{
- start_time = ecore_time_get();
- smooth_info_x_count = 0;
- smooth_info_y_count = 0;
-
- memset(&(smooth_x_history[0]), 0, sizeof(smooth_x_history[0]) * SMOOTH_DEBUG_COUNT);
- memset(&(smooth_y_history[0]), 0, sizeof(smooth_y_history[0]) * SMOOTH_DEBUG_COUNT);
-
- return;
-}
-
-void
-_els_scroller_smooth_debug_shutdown(void)
-{
- int i = 0;
- int info_x_count = 0;
- int info_y_count = 0;
- double x_ave = 0, y_ave = 0;
- double x_sum = 0, y_sum = 0;
- double x_dev = 0, y_dev = 0;
- double x_dev_sum = 0, y_dev_sum = 0;
-
- if (smooth_info_x_count >= SMOOTH_DEBUG_COUNT)
- info_x_count = SMOOTH_DEBUG_COUNT;
- else
- info_x_count = smooth_info_x_count;
-
- if (smooth_info_y_count >= SMOOTH_DEBUG_COUNT)
- info_y_count = SMOOTH_DEBUG_COUNT;
- else
- info_y_count = smooth_info_y_count;
-
- printf("\n\n<<< X-axis Smoothness >>>\n");
- printf("| Num | t(time) | dt | x | dx |vx(dx/1fps) |\n");
-
- for (i = info_x_count -1; i >= 0; i--)
- {
- printf("| %4d | %1.6f | %1.6f | %4d | %4d | %9.3f |\n",info_x_count - i,
- smooth_x_history[i].t,
- smooth_x_history[i].dt,
- smooth_x_history[i].pos,
- smooth_x_history[i].dpos,
- smooth_x_history[i].vpos);
- if (i == info_x_count -1) continue;
- x_sum += smooth_x_history[i].vpos;
- }
- x_ave = x_sum / (info_x_count - 1);
- for (i = 0; i < info_x_count -1; i++)
- {
- x_dev_sum += (smooth_x_history[i].vpos - x_ave) * (smooth_x_history[i].vpos - x_ave);
- }
- x_dev = x_dev_sum / (info_x_count -1);
- printf(" Standard deviation of X-axis velocity: %9.3f\n", sqrt(x_dev));
-
- printf("\n\n<<< Y-axis Smoothness >>>\n");
- printf("| Num | t(time) | dt | y | dy |vy(dy/1fps) |\n");
- for (i = info_y_count -1; i >= 0; i--)
- {
- printf("| %4d | %1.6f | %1.6f | %4d | %4d | %9.3f |\n", info_y_count - i,
- smooth_y_history[i].t,
- smooth_y_history[i].dt,
- smooth_y_history[i].pos,
- smooth_y_history[i].dpos,
- smooth_y_history[i].vpos);
- if (i == info_y_count -1) continue;
- y_sum += smooth_y_history[i].vpos;
- }
- y_ave = y_sum / (info_y_count - 1);
- for (i = 0; i < info_y_count -1; i++)
- {
- y_dev_sum += (smooth_y_history[i].vpos - y_ave) * (smooth_y_history[i].vpos - y_ave);
- }
- y_dev = y_dev_sum / (info_y_count -1);
- printf(" Standard deviation of Y-axis velocity: %9.3f\n", sqrt(y_dev));
-}
-
-void
-_els_scroller_smooth_debug_movetime_add(int x, int y)
-{
- double tim = 0;
- static int bx = 0;
- static int by = 0;
-
- tim = ecore_time_get();
-
- if (bx != x)
- {
- smooth_info_x_count++;
- memmove(&(smooth_x_history[1]), &(smooth_x_history[0]), sizeof(smooth_x_history[0]) * (SMOOTH_DEBUG_COUNT - 1));
- smooth_x_history[0].t = tim - start_time;
- smooth_x_history[0].dt = smooth_x_history[0].t - smooth_x_history[1].t;
- smooth_x_history[0].pos = x;
- smooth_x_history[0].dpos = smooth_x_history[0].pos - smooth_x_history[1].pos;
-
- if (smooth_x_history[0].dpos >= 0)
- smooth_x_history[0].vpos = (double)(smooth_x_history[0].dpos) / smooth_x_history[0].dt * FPS;
- else
- smooth_x_history[0].vpos = -((double)(smooth_x_history[0].dpos) / smooth_x_history[0].dt * FPS);
- }
-
- if (by != y)
- {
- smooth_info_y_count++;
- memmove(&(smooth_y_history[1]), &(smooth_y_history[0]), sizeof(smooth_y_history[0]) * (SMOOTH_DEBUG_COUNT - 1));
- smooth_y_history[0].t = tim - start_time;
- smooth_y_history[0].dt = smooth_y_history[0].t - smooth_y_history[1].t;
- smooth_y_history[0].pos = y;
- smooth_y_history[0].dpos = smooth_y_history[0].pos - smooth_y_history[1].pos;
-
- if (smooth_y_history[0].dpos >= 0)
- smooth_y_history[0].vpos = (double)(smooth_y_history[0].dpos) / smooth_y_history[0].dt * FPS;
- else
- smooth_y_history[0].vpos = -((double)(smooth_y_history[0].dpos) / smooth_y_history[0].dt * FPS);
- }
-
- bx = x;
- by = y;
-}
-#endif
struct _Smart_Data
{
sd = data;
ev = event_info;
-#ifdef SMOOTHDBG
- if (getenv("ELS_SCROLLER_SMOOTH_DEBUG")) _els_scroller_smooth_debug = 1;
- if (_els_scroller_smooth_debug) _els_scroller_smooth_debug_init();
-#endif
-
// if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return ;
if (_elm_config->thumbscroll_enable)
{
oy = fy;
}
-#ifdef SMOOTHDBG
- if (_els_scroller_smooth_debug)
- _els_scroller_smooth_debug_movetime_add(ox, oy);
-#endif
-
elm_smart_scroller_child_pos_set(sd->smart_obj, ox, oy);
return ECORE_CALLBACK_RENEW;
}
Smart_Data *sd;
Evas_Coord x = 0, y = 0, ox = 0, oy = 0;
-#ifdef SMOOTHDBG
- if (_els_scroller_smooth_debug) _els_scroller_smooth_debug_shutdown();
-#endif
-
sd = data;
ev = event_info;
sd->down.hold_parent = EINA_FALSE;
}
if (tt->free_size)
{
- tt->tt_win = elm_win_add(NULL, "tooltip", ELM_WIN_BASIC);
+ tt->tt_win = elm_win_add(NULL, "tooltip", ELM_WIN_TOOLTIP);
elm_win_override_set(tt->tt_win, EINA_TRUE);
tt->tt_evas = evas_object_evas_get(tt->tt_win);
tt->tooltip = edje_object_add(tt->tt_evas);
{
const char *style = tt->style ? tt->style : "default";
const char *str;
- if (!_elm_theme_object_set(tt->tt_win ? NULL : tt->owner, tt->tooltip, "tooltip", "base", style))
+ if (!_elm_theme_object_set(tt->tt_win ? NULL : tt->owner, tt->tooltip,
+ "tooltip", "base", style));
{
ERR("Could not apply the theme to the tooltip! style=%s", style);
if (tt->tt_win) evas_object_del(tt->tt_win);
unsigned int sel_field_value;
};
+static Eina_Bool
+_diskitem_data_del_idler(void *data)
+{
+ if (data) free(data);
+ return ECORE_CALLBACK_CANCEL;
+}
+
static void
_diskselector_item_free_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
- if (data) free(data);
+ if (data)
+ ecore_idler_add(_diskitem_data_del_idler, data);
}
static Eina_Bool
}
if (ctx_mod->sel_field)
elm_object_signal_emit(ctx_mod->sel_field, "elm,state,select", "elm");
+
+ /* Raise the Ctxpopup to show it at the top of its layer */
+ evas_object_raise(ctx_mod->ctxpopup);
evas_object_show(ctx_mod->ctxpopup);
}