+elementary (1.0.0+svn.58393slp2+build35) unstable; urgency=low
+
+ * [store] Fixed the crash problem of store item info
+ * Git: 165.213.180.234:slp/pkgs/e/elementary
+ * Tag: elementary_1.0.0+svn.58393slp2+build35
+
+ -- Ilkook Yun <ilkook.yun@samsung.com> Wed, 29 Jun 2011 14:29:50 +0900
+
+elementary (1.0.0+svn.58393slp2+build34) unstable; urgency=low
+
+ * repackaging
+ * Git: 165.213.180.234:slp/pkgs/e/elementary
+ * Tag: elementary_1.0.0+svn.58393slp2+build34
+
+ -- ChunEon Park <chuneon.park@samsung.com> Tue, 28 Jun 2011 19:41:58 +0900
+
+elementary (1.0.0+svn.58393slp2+build33) unstable; urgency=low
+
+ * repackaging
+ * Git: 165.213.180.234:slp/pkgs/e/elementary
+ * Tag: elementary_1.0.0+svn.58393slp2+build33
+
+ -- ChunEon Park <chuneon.park@samsung.com> Mon, 27 Jun 2011 20:35:25 +0900
+
+elementary (1.0.0+svn.58393slp2+build32) unstable; urgency=low
+
+ * [store] Fixed the store item check
+ * Git: 165.213.180.234:slp/pkgs/e/elementary
+ * Tag: elementary_1.0.0+svn.58393slp2+build32
+
+ -- Ilkook Yun <ilkook.yun@samsung.com> Mon, 27 Jun 2011 17:03:28 +0900
+
elementary (1.0.0+svn.58393slp2+build31) unstable; urgency=low
* [store] Fixed the unnecessary code
}Elm_Params_Nocontents;
static void
-external_nocontents_state_set(void *data __UNUSED__, Evas_Object *obj, const void *from_params, const void *to_params, float pos __UNUSED__)
+external_nocontents_state_set(void *data __UNUSED__, Evas_Object *obj __UNUSED__,
+ const void *from_params, const void *to_params,
+ float pos __UNUSED__)
{
const Elm_Params_Nocontents *p;
}
static void *
-external_nocontents_params_parse(void *data, Evas_Object *obj, const Eina_List *params)
+external_nocontents_params_parse(void *data __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ const Eina_List *params __UNUSED__)
{
- Elm_Params_Nocontents *mem;
+ Elm_Params_Nocontents *mem = NULL;
//mem = external_common_params_parse(Elm_Params_Nocontents, data, obj, params);
if (!mem)
}
static Evas_Object *external_nocontents_content_get(void *data __UNUSED__,
- const Evas_Object *obj, const char *content)
+ const Evas_Object *obj __UNUSED__,
+ const char *content __UNUSED__)
{
ERR("so content");
return NULL;
}
static Evas_Object *external_page_control_content_get(void *data __UNUSED__,
- const Evas_Object *obj, const char *content)
+ const Evas_Object *obj __UNUSED__,
+ const char *content __UNUSED__)
{
ERR("so content");
return NULL;
}
static void *
-external_searchbar_params_parse(void *data, Evas_Object *obj, const Eina_List *params)
+external_searchbar_params_parse(void *data __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ const Eina_List *params)
{
- Elm_Params_Searchbar *mem;
+ Elm_Params_Searchbar *mem = NULL;
Edje_External_Param *param;
const Eina_List *l;
}
static Evas_Object *external_searchbar_content_get(void *data __UNUSED__,
- const Evas_Object *obj, const char *content)
+ const Evas_Object *obj __UNUSED__,
+ const char *content __UNUSED__)
{
ERR("so content");
return NULL;
EAPI Elm_Image_Orient elm_image_orient_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
EAPI void elm_image_editable_set(Evas_Object *obj, Eina_Bool set) EINA_ARG_NONNULL(1);
EAPI Eina_Bool elm_image_editable_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+ EAPI void elm_image_aspect_ratio_retained_set(Evas_Object *obj, Eina_Bool retained) EINA_ARG_NONNULL(1);
+ EAPI Eina_Bool elm_image_aspect_ratio_retained_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+
/* smart callbacks called:
* "clicked" - the user clicked the image
*/
/* multibuttonentry */
typedef struct _Multibuttonentry_Item Elm_Multibuttonentry_Item;
+ typedef Eina_Bool (*Elm_Multibuttonentry_Item_Verify_Callback) (Evas_Object *obj, const char *item_label, void *item_data, void *data);
EAPI Evas_Object *elm_multibuttonentry_add(Evas_Object *parent);
EAPI const char *elm_multibuttonentry_label_get(Evas_Object *obj);
EAPI void elm_multibuttonentry_label_set(Evas_Object *obj, const char *label);
EAPI Elm_Multibuttonentry_Item *elm_multibuttonentry_item_next(Elm_Multibuttonentry_Item *item);
EAPI void *elm_multibuttonentry_item_data_get(Elm_Multibuttonentry_Item *item);
EAPI void elm_multibuttonentry_item_data_set(Elm_Multibuttonentry_Item *item, void *data);
+ EAPI void elm_multibuttonentry_item_verify_callback_set(Evas_Object *obj, Elm_Multibuttonentry_Item_Verify_Callback func, void *data);
/* smart callback called:
* "selected" - This signal is emitted when the selected item of multibuttonentry is changed.
* "added" - This signal is emitted when a new multibuttonentry item is added.
it = evas_object_data_get(content, _navigationbar_key);
if (!it) return;
if (it->titleobj_visible == visible) return;
+ it->titleobj_visible = visible;
_titleobj_switching(obj, it);
}
/*
* callback functions
*/
-static void _icon_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _icon_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _icon_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _icon_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__);
+static void _icon_move_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__);
+static void _icon_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__);
/*
* internal functions
static void
_disable_hook(Evas_Object *obj)
{
-// Widget_Data *wd = elm_widget_data_get(obj);
-/*
- TODO
+ Widget_Data *wd = elm_widget_data_get(obj);
+
if (elm_widget_disabled_get(obj))
- edje_object_signal_emit(wd->btn, "elm,state,disabled", "elm");
+ edje_object_signal_emit(wd->icon, "elm,state,disabled", "elm");
else
- edje_object_signal_emit(wd->btn, "elm,state,enabled", "elm");
-*/
-}
+ edje_object_signal_emit(wd->icon, "elm,state,enabled", "elm");
-static void
-_sub_del(void *data, Evas_Object *obj, void *event_info)
-{
-// Widget_Data *wd = elm_widget_data_get(obj);
-// Evas_Object *sub = event_info;
}
static void
-_icon_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+_icon_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get((Evas_Object *)data);
if (!wd) return;
}
static void
-_icon_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+_icon_move_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Evas_Object *as = (Evas_Object *)data;
Widget_Data *wd = elm_widget_data_get(as);
}
static void
-_icon_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+_icon_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
{
Evas_Object *as = (Evas_Object *)data;
Widget_Data *wd = elm_widget_data_get((Evas_Object *)data);
edje_object_part_swallow(wd->as, "elm.swallow.space", wd->icon_fake);
// event callbacks
- evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
evas_object_event_callback_add(wd->icon, EVAS_CALLBACK_MOUSE_DOWN, _icon_down_cb, obj);
evas_object_event_callback_add(wd->icon, EVAS_CALLBACK_MOUSE_MOVE, _icon_move_cb, obj);
evas_object_event_callback_add(wd->icon, EVAS_CALLBACK_MOUSE_UP, _icon_up_cb, obj);
Evas_Object *shelf, *panel, *virtualkeypad;
Evas_Object *content;
Evas_Object *scroller;
- Ecore_Event_Handler *prop_hdl;
#ifdef HAVE_ELEMENTARY_X
+ Ecore_Event_Handler *prop_hdl;
Ecore_X_Virtual_Keyboard_State vkb_state;
#endif
struct {
/* local function prototypes */
static const char *widtype = NULL;
+static void _del_pre_hook(Evas_Object *obj);
static void _del_hook(Evas_Object *obj);
static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
Evas_Coord sy, Evas_Coord sw, Evas_Coord sh);
static void
_conformant_part_sizing_eval(Evas_Object *obj, Conformant_Part_Type part_type);
+static void
+_conformant_move_resize_event_cb(void *data, Evas *e, Evas_Object *obj,
+ void *event_info);
static void _sizing_eval(Evas_Object *obj);
static Eina_Bool _prop_change(void *data, int type, void *event);
/* local functions */
static void
-_del_hook(Evas_Object *obj)
+_del_pre_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+#ifdef HAVE_ELEMENTARY_X
if (wd->prop_hdl) ecore_event_handler_del(wd->prop_hdl);
+#endif
+ evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE, _conformant_move_resize_event_cb, obj);
+ evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOVE, _conformant_move_resize_event_cb, obj);
+}
+
+static void
+_del_hook(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
free(wd);
}
*/
static void
-_conformant_move_resize_event_cb(void *data, Evas *e, Evas_Object *obj,
- void *event_info)
+_conformant_move_resize_event_cb(void *data __UNUSED__, Evas *e __UNUSED__,
+ Evas_Object *obj,
+ void *event_info __UNUSED__)
{
Conformant_Part_Type part_type;
Widget_Data *wd = elm_widget_data_get(obj);
}
static void
-_content_resize_event_cb(void *data, Evas *e, Evas_Object *obj,
- void *event_info)
+_content_resize_event_cb(void *data, Evas *e __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
{
Evas_Object *focus_obj;
Evas_Object *conformant = (Evas_Object *) data;
ELM_CONFORM_VIRTUAL_KEYPAD_PART |
ELM_CONFORM_SOFTKEY_PART);
_conformant_part_sizing_eval(data, part_type);
- evas_object_event_callback_add(data, EVAS_CALLBACK_RESIZE,
- _conformant_move_resize_event_cb, data);
- evas_object_event_callback_add(data, EVAS_CALLBACK_MOVE,
- _conformant_move_resize_event_cb, data);
}
else if (ev->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY)
_conformant_part_sizing_eval(data, ELM_CONFORM_INDICATOR_PART);
elm_widget_type_set(obj, "conformant");
elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
+ elm_widget_del_pre_hook_set(obj, _del_pre_hook);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
elm_widget_can_focus_set(obj, EINA_FALSE);
#endif
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE,
+ _conformant_move_resize_event_cb, obj);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE,
+ _conformant_move_resize_event_cb, obj);
_mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
Evas_Object *time[TIME_MAX];
Ecore_Event_Handler *handler;
Ecore_Idler *idler;
- int layout;
+ unsigned int layout;
int year, month, day, hour, min;
int y_max, m_max, d_max;
static void _del_hook(Evas_Object *obj);
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
-static void _on_focus_hook(void *data, Evas_Object *obj);
+static void _on_focus_hook(void *data __UNUSED__, Evas_Object *obj);
-static void _signal_rect_mouse_down(void *data, Evas_Object *obj, const char *emission, const char *source);
-static void _signal_ampm_clicked(void *data, Evas_Object *obj, const char *emission, const char *source);
-static void _entry_focused_cb(void *data, Evas_Object *obj, void *event_info);
-static void _entry_unfocused_cb(void *data, Evas_Object *obj, void *event_info);
-static void _entry_key_up_cb(void *data, Evas *e , Evas_Object *obj , void *event_info);
-static Eina_Bool _imf_event_commit_cb(void *data, int type, void *event);
-static void _input_panel_event_callback(void *data, Ecore_IMF_Context *ctx, int value);
+static void _signal_rect_mouse_down(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source);
+static void _entry_focused_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__);
+static void _entry_unfocused_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__);
+static void _entry_key_up_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj , void *event_info);
+static Eina_Bool _imf_event_commit_cb(void *data, int type __UNUSED__, void *event);
+static void _input_panel_event_callback(void *data, Ecore_IMF_Context *ctx __UNUSED__, int value);
static void _date_entry_add(Evas_Object *obj);
static void _time_entry_add(Evas_Object *obj);
}
static void
-_on_focus_hook(void *data, Evas_Object *obj)
+_on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd || !wd->base) return ;
}
static void
-_ampm_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+_ampm_clicked_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
char *str;
}
static void
-_signal_rect_mouse_down(void *data, Evas_Object *obj, const char *emission, const char *source)
+_signal_rect_mouse_down(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source)
{
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return;
}
static void
-_entry_focused_cb(void *data, Evas_Object *obj, void *event_info)
+_entry_focused_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
if (!wd || !wd->base) return;
}
static void
-_entry_unfocused_cb(void *data, Evas_Object *obj, void *event_info)
+_entry_unfocused_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
char str[YEAR_MAX_LENGTH+1] = {0,};
}
static void
-_entry_key_up_cb(void *data, Evas *e , Evas_Object *obj , void *event_info)
+_entry_key_up_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj , void *event_info)
{
Evas_Event_Key_Up *ev = (Evas_Event_Key_Up *) event_info;
}
static Eina_Bool
-_imf_event_commit_cb(void *data, int type, void *event)
+_imf_event_commit_cb(void *data , int type __UNUSED__, void *event)
{
Widget_Data *wd = elm_widget_data_get(data);
Ecore_IMF_Event_Commit *ev = (Ecore_IMF_Event_Commit *) event;
}
static void
-_input_panel_event_callback(void *data, Ecore_IMF_Context *ctx, int value)
+_input_panel_event_callback(void *data, Ecore_IMF_Context *ctx __UNUSED__, int value)
{
Widget_Data *wd = elm_widget_data_get(data);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if (layout < ELM_DATEFIELD_LAYOUT_TIME ||layout > ELM_DATEFIELD_LAYOUT_DATEANDTIME) return;
+ if (layout > ELM_DATEFIELD_LAYOUT_DATEANDTIME) return;
if (wd->layout != layout)
{
static void _theme_hook(Evas_Object *obj);
//static void _sizing_eval(Evas_Object* obj);
//static void _dayselector_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
-//static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _changed_size_hints(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__);
static void
_del_hook(Evas_Object *obj)
}
*/
static void
-_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
+_changed_size_hints(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
{
Evas_Coord w, h;
Widget_Data *wd = elm_widget_data_get(obj);
}
static void
-_check_clicked(void *data, Evas_Object *obj, void *event_info)
+_check_clicked(void *data, Evas_Object *obj, void *event_info __UNUSED__)
{
static Elm_DaySelector_Day day;
Widget_Data* wd = (Widget_Data*) elm_widget_data_get(data);
evas_object_hide(it->base.view);
}
}
- it->old_scrl_x = it->scrl_x;
- it->old_scrl_y = it->scrl_y;
}
}
else
{
if (vis) it->want_realize = EINA_TRUE;
}
+ if (!it->wd->effect_mode || it->wd->move_effect_mode == ELM_GENLIST_ITEM_MOVE_EFFECT_NONE || ((it->wd->move_effect_mode != ELM_GENLIST_ITEM_MOVE_EFFECT_DELETE) && it->parent == it->wd->expand_item))
+ {
+ it->old_scrl_x = it->scrl_x;
+ it->old_scrl_y = it->scrl_y;
+ }
y += it->h;
}
evas_event_thaw(evas_object_evas_get(itb->wd->obj));
}
-/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
+/**
+ * Enable/disable retaining up the aspect ratio of the image.
+ *
+ * @param obj The image object.
+ * @param retained Retaining or Non retaining.
+ *
+ * @ingroup Image
+ */
+EAPI void
+elm_image_aspect_ratio_retained_set(Evas_Object *obj, Eina_Bool retained)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ return _els_smart_icon_aspect_ratio_retained_set(wd->img, retained);
+}
+
+/**
+ * Get if the object retains the aspect ratio.
+ *
+ * @param obj The image object.
+ * @return If the object retains the aspect ratio.
+ *
+ * @ingroup Image
+ */
+EAPI Eina_Bool
+elm_image_aspect_ratio_retained_get(const Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return EINA_FALSE;
+ return _els_smart_icon_aspect_ratio_retained_get(wd->img);
+}
+
+/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-3f0^-2{2(0W1st0 :*/
Evas_Coord w_box, h_box;
int contracted;
- Eina_Bool focused: 1;
+ Eina_Bool focused: 1;
+ Eina_Bool last_btn_select: 1;
Ecore_IMF_Context *imf_context;
+ Elm_Multibuttonentry_Item_Verify_Callback add_callback;
+ void *add_callback_data;
};
static const char *widtype = NULL;
static void _sizing_eval(Evas_Object *obj);
static void _changed_size_hint_cb(void *data, Evas *evas, Evas_Object *obj, void *event);
static void _resize_cb(void *data, Evas *evas, Evas_Object *obj, void *event);
-static void _event_init(Evas_Object *obj);
+static void _event_init(Evas_Object *obj);
static void _contracted_state_set(Evas_Object *obj, int contracted);
static void _view_update(Evas_Object *obj);
-static void _set_label(Evas_Object *obj, const char* str);
+static void _set_label(Evas_Object *obj, const char* str);
static void _change_current_button_state(Evas_Object *obj, Multibuttonentry_Button_State state);
-static void _change_current_button(Evas_Object *obj, Evas_Object *btn);
-static void _button_clicked(void *data, Evas_Object *obj, const char *emission, const char *source);
-static void _del_button_obj(Evas_Object *obj, Evas_Object *btn);
-static void _del_button_item(Elm_Multibuttonentry_Item *item);
-static void _del_button(Evas_Object *obj);
-static void _select_button(Evas_Object *obj, Evas_Object *btn);
+static void _change_current_button(Evas_Object *obj, Evas_Object *btn);
+static void _button_clicked(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _del_button_obj(Evas_Object *obj, Evas_Object *btn);
+static void _del_button_item(Elm_Multibuttonentry_Item *item);
+static void _del_button(Evas_Object *obj);
+static void _select_button(Evas_Object *obj, Evas_Object *btn);
static Elm_Multibuttonentry_Item* _add_button_item(Evas_Object *obj, const char *str, Multibuttonentry_Pos pos, const Elm_Multibuttonentry_Item *reference, void *data);
-static void _add_button(Evas_Object *obj, char *str);
-static void _evas_mbe_key_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _entry_key_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _entry_focus_in_cb(void *data, Evas *e, __UNUSED__ void *event_info);
-static void _entry_focus_out_cb(void *data, Evas *e, __UNUSED__ void *event_info);
-static void _view_init(Evas_Object *obj);
+static void _add_button(Evas_Object *obj, char *str);
+static void _evas_mbe_key_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _entry_changed_cb(void *data, Evas_Object *obj, void *event_info);
+static void _entry_key_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _entry_key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _entry_focus_in_cb(void *data, Evas *e, __UNUSED__ void *event_info);
+static void _entry_focus_out_cb(void *data, Evas *e, __UNUSED__ void *event_info);
+static void _view_init(Evas_Object *obj);
static void _set_vis_guidetext(Evas_Object *obj);
static void _calculate_box_min_size(Evas_Object *box, Evas_Object_Box_Data *priv);
static Evas_Coord _calculate_item_max_height(Evas_Object *box, Evas_Object_Box_Data *priv, int obj_index);
if (wd->entry)
{
evas_object_event_callback_add(wd->entry, EVAS_CALLBACK_KEY_UP, _entry_key_up_cb, obj);
+ evas_object_event_callback_add(wd->entry, EVAS_CALLBACK_KEY_DOWN, _entry_key_down_cb, obj);
+ evas_object_smart_callback_add(wd->entry, "changed", _entry_changed_cb, obj);
evas_object_smart_callback_add(wd->entry, "focused", _entry_focus_in_cb, obj);
evas_object_smart_callback_add(wd->entry, "unfocused", _entry_focus_out_cb, obj);
}
_set_vis_guidetext(obj);
}
-
static void
_select_button(Evas_Object *obj, Evas_Object *btn)
{
if (btn)
{
_change_current_button(obj, btn);
- elm_object_unfocus(wd->entry);
- evas_object_focus_set(btn, EINA_TRUE);
+ if (elm_widget_focus_get(obj))
+ {
+ elm_object_unfocus(wd->entry);
+ evas_object_focus_set(btn, EINA_TRUE);
+ }
}
else
{
_change_current_button_state(obj, MULTIBUTONENTRY_BUTTON_STATE_DEFAULT);
- elm_object_focus(wd->entry);
+ if (elm_widget_focus_get(obj))
+ elm_object_focus(wd->entry);
}
}
if (!wd || !wd->box || !wd->entry) return NULL;
+ if ((wd->add_callback) && !wd->add_callback(obj, str, data, wd->add_callback_data)) return NULL;
+
// add button
btn = edje_object_add(evas_object_evas_get(obj));
str_utf8 = elm_entry_markup_to_utf8(str);
strncpy(str, elm_scrolled_entry_entry_get(wd->entry), MAX_STR);
str[MAX_STR - 1] = 0;
-
Evas_Event_Key_Up *ev = (Evas_Event_Key_Up*)event_info;
- if ( (wd->current) && ( (strcmp (ev->keyname, "BackSpace") == 0) || (strcmp (ev->keyname, "BackSpace (") == 0)))
+ if (wd->last_btn_select)
{
- item = eina_list_data_get(wd->current);
- if (item)
+ if ((wd->current) && ( (strcmp (ev->keyname, "BackSpace") == 0) || (strcmp (ev->keyname, "BackSpace (") == 0)))
+ {
+ item = eina_list_data_get(wd->current);
+ if (item)
+ {
+ _del_button_item(item);
+ elm_object_focus(wd->entry);
+ }
+ }
+ else if (((!wd->current) && (wd->n_str == 0) && (strcmp (ev->keyname, "BackSpace") == 0) || (strcmp (ev->keyname, "BackSpace (") == 0)))
{
- _del_button_item(item);
- elm_object_focus(wd->entry);
+ item = eina_list_data_get(eina_list_last(wd->items));
+ if (item)
+ _select_button(data, item->button);
}
}
- else if (( (!wd->current) && (wd->n_str == 0) && (strcmp (ev->keyname, "BackSpace") == 0) || (strcmp (ev->keyname, "BackSpace (") == 0)))
- {
- item = eina_list_data_get(eina_list_last(wd->items));
- if (item)
- _select_button(data, item->button);
- }
else
- {
- // nothing
- }
- wd->n_str = strlen(str);
+ wd->last_btn_select = EINA_TRUE;
+}
+
+static void
+_entry_key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Widget_Data *wd = elm_widget_data_get(data);
+ Evas_Event_Key_Down *ev = (Evas_Event_Key_Down *)event_info;
+
+ if (!wd) return;
+
+ if ( (wd->n_str == 1) && (strcmp (ev->keyname, "BackSpace") == 0 || (strcmp (ev->keyname, "BackSpace (") == 0 )))
+ wd->last_btn_select = EINA_FALSE;
}
static void
wd->n_str = 0;
return;
}
- else
- {
- //
- }
}
static void
_entry_focus_in_cb(void *data, Evas *e, __UNUSED__ void *event_info)
{
Widget_Data *wd = elm_widget_data_get(data);
+ if (!wd) return;
_change_current_button_state(data, MULTIBUTONENTRY_BUTTON_STATE_DEFAULT);
}
_entry_focus_out_cb(void *data, Evas *e, __UNUSED__ void *event_info)
{
Widget_Data *wd = elm_widget_data_get(data);
+ if (!wd) return;
+
static char str[MAX_STR];
strncpy(str,elm_scrolled_entry_entry_get(wd->entry), MAX_STR);
}
static void
+_entry_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ Widget_Data *wd = elm_widget_data_get(data);
+ if (!wd) return;
+
+ static char str[MAX_STR];
+
+ strncpy(str, elm_scrolled_entry_entry_get(wd->entry), MAX_STR);
+ str[MAX_STR -1] = 0;
+
+ wd->n_str = strlen(str);
+}
+
+static void
_view_init(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
wd->view_state = MULTIBUTTONENTRY_VIEW_NONE;
wd->focused = EINA_FALSE;
+ wd->last_btn_select = EINA_TRUE;
wd->n_str = 0;
wd->rectForEnd = NULL;
wd->imf_context = NULL;
+ wd->add_callback = NULL;
+ wd->add_callback_data = NULL;
_view_init(obj);
_event_init(obj);
item->data = data;
}
+/**
+ * Set the multibuttonentry item_verify_callback function
+ *
+ * @param obj The multibuttonentry object
+ * @param func The function pointer to be called, it it's NULL, callback function will be deleted.
+ * @param data user data to be passed to the callback function
+ *
+ * @ingroup Multibuttonentry
+ */
+EAPI void
+elm_multibuttonentry_item_verify_callback_set(Evas_Object *obj, Elm_Multibuttonentry_Item_Verify_Callback func, void *data)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+
+ wd->add_callback = func;
+ wd->add_callback_data = data;
+}
if (!wd) return;
if (!custom) return;
- elm_widget_sub_object_add(obj, custom);
+ elm_widget_sub_object_add((Evas_Object *)obj, custom);
edje_object_part_swallow(wd->noc, "custom", custom);
wd->custom = custom;
}
* @ingroup Elementary
*
* A page control is a succession of dots centered in the control.
- * Each dot corresponds to a page in the application\92s document (or other data-model entity),
+ * Each dot corresponds to a page in the application's document (or other data-model entity),
* with the white dot indicating the currently viewed page.
*/
{
Evas_Object *base;
Evas_Object *hbox;
- int page_count;
+ unsigned int page_count;
Eina_List *page_list;
unsigned int cur_page_id;
Evas_Object *parent;
{
Evas_Object *obj;
Evas_Object *base;
- int page_id;
+ unsigned int page_id;
};
Page_Item *it;
Eina_List *l;
- int i = 0;
+ unsigned int i = 0;
EINA_LIST_FOREACH(wd->page_list, l, it)
{
- if (i == index) return it;
- i++;
+ if (i == index) return it;
+ i++;
}
return NULL;
}
static void
-_indicator_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
+_indicator_clicked_cb(void *data, Evas_Object *obj,
+ const char *emission __UNUSED__,
+ const char *source __UNUSED__)
{
Evas_Object *wd_obj = (Evas_Object *)data;
Widget_Data *wd = elm_widget_data_get(wd_obj);
Page_Item *it;
Eina_List *l;
-
- int page_id = 0;
+
+ unsigned int page_id = 0;
EINA_LIST_FOREACH(wd->page_list, l, it)
{
- if (it->base == obj)
- page_id = it->page_id;
+ if (it->base == obj)
+ page_id = it->page_id;
}
-
+
if (page_id == wd->cur_page_id) return;
-
+
it = _page_find(wd_obj, wd->cur_page_id);
if (!it) return;
-
+
edje_object_signal_emit(it->base, "elm,state,indicator,off", "elm");
-
+
it = _page_find(wd_obj, page_id);
if (!it) return;
-
+
edje_object_signal_emit(it->base, "elm,state,indicator,on", "elm");
wd->cur_page_id = page_id;
evas_object_smart_callback_call(it->obj, "changed", NULL);
Page_Item *it;
Evas_Coord mw, mh;
- int i;
+ unsigned int i;
for (i = 0; i < page_count; i++)
{
it = _create_item(obj, i);
it = l->data;
wd->stack = eina_list_remove_list(wd->stack, l);
evas_object_event_callback_del_full
- (data, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, it);
+ (obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, it);
evas_object_del(it->base);
_eval_top(data);
free(it);
}
static void
-_on_focus_hook(void *data, Evas_Object *obj)
+_on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd || !wd->base)
evas_object_size_hint_max_set(obj, maxw, maxh);
}
-static void _clicked(void *data, Evas_Object *obj, void *event_info)
+static void _clicked(void *data, Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return;
{
Widget_Data *wd = elm_widget_data_get(data);
- if (!wd) return;
+ if (!wd) return ECORE_CALLBACK_CANCEL;
+
evas_object_smart_callback_call(data, "delay-changed", NULL);
wd->idler = NULL;
return ECORE_CALLBACK_CANCEL;
}
-static void _changed(void *data, Evas_Object *obj, void *event_info)
+static void _changed(void *data, Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
wd->idler = ecore_idler_add(_delay_changed, data);
}
-static void _cancel_clicked(void *data, Evas_Object *obj, void *event_info)
+static void _cancel_clicked(void *data, Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return;
}
static void
-_basebg_clicked(void *data, Evas_Object *obj, const char *emission, const char *source)
+_basebg_clicked(void *data, Evas_Object *obj, const char *emission __UNUSED__,
+ const char *source)
{
Widget_Data *wd = elm_widget_data_get(data);
}
static void
-_searchsymbol_clicked(void *data, Evas_Object *obj, const char *emission, const char *source)
+_searchsymbol_clicked(void *data, Evas_Object *obj __UNUSED__,
+ const char *emission __UNUSED__,
+ const char *source __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
{
if(sti)
{
- if (sti->fetch_th)
+ if (st->fetch_thread && sti->fetch_th)
{
ecore_thread_cancel(sti->fetch_th);
sti->fetch_th = NULL;
}
- if (st->cb.item_free.func)
- {
- st->cb.item_free.func(st->cb.item_free.data, sti->item_info);
- }
if (sti->fetched)
{
int index = elm_store_item_index_get(sti);
if (index != -1) _item_unfetch(st, index);
}
- header_list = eina_list_remove(header_list, sti);
+ if (st->cb.item_free.func)
+ {
+ st->cb.item_free.func(st->cb.item_free.data, sti->item_info);
+ sti->item_info = NULL;
+ }
LKD(sti->lock);
- free(sti);
}
}
st->header_items = eina_list_remove(st->header_items, header_list);
{
Elm_Store_Item *sti = data;
LKL(sti->lock);
- if (th == sti->fetch_th) sti->fetch_th = NULL;
+ if(sti->data) elm_genlist_item_update(sti->item);
LKU(sti->lock);
+ if (th == sti->fetch_th) sti->fetch_th = NULL;
}
static void
Elm_Store_Item *sti = data;
LKL(sti->lock);
if (th == sti->fetch_th) sti->fetch_th = NULL;
+ if(sti->data) elm_genlist_item_update(sti->item);
LKU(sti->lock);
}
if (!EINA_MAGIC_CHECK(sti, ELM_STORE_ITEM_MAGIC)) return NULL;
const Elm_Store_Item_Mapping *m;
+ if(!sti->item_info)
+ {
+ return NULL;
+ }
+
for (m = sti->item_info->mapping; m; m++)
{
if (m->type == ELM_STORE_ITEM_MAPPING_NONE) break;
if(header_list)
{
Elm_Store_Item *item = eina_list_nth(header_list, 0);
- if (item->item_info->group_index == sti->item_info->group_index)
+ if(item && item->item_info)
{
- header_add = EINA_FALSE;
- break;
+ if (item->item_info->group_index == sti->item_info->group_index)
+ {
+ header_add = EINA_FALSE;
+ break;
+ }
}
}
}
if (header_list)
{
Elm_Store_Item *group_sti = eina_list_nth(header_list, 0);
- if(group_sti->item_info->item_type == ELM_GENLIST_ITEM_GROUP)
+ if(group_sti && group_sti->item_info)
{
- int sort;
- if (st->cb.item_sort.func)
+ if(group_sti->item_info->item_type == ELM_GENLIST_ITEM_GROUP)
{
- sort = st->cb.item_sort.func(st->cb.item_sort.data, sti->item_info, group_sti->item_info);
+ int sort;
+ if (st->cb.item_sort.func)
+ {
+ sort = st->cb.item_sort.func(st->cb.item_sort.data, sti->item_info, group_sti->item_info);
- if(sort == ELM_STORE_ITEM_SORT_LOW)
+ if(sort == ELM_STORE_ITEM_SORT_LOW)
+ {
+ st->header_items = eina_list_prepend_relative(st->header_items, new_header_list, header_list);
+ sti->item = elm_genlist_item_insert_before(st->genlist,
+ itc,
+ sti,
+ NULL,
+ group_sti->item,
+ ELM_GENLIST_ITEM_GROUP,
+ NULL,
+ NULL);
+ last_header = EINA_FALSE;
+ break;
+ }
+ }
+ else
{
- st->header_items = eina_list_prepend_relative(st->header_items, new_header_list, header_list);
- sti->item = elm_genlist_item_insert_before(st->genlist,
- itc,
- sti,
- NULL,
- group_sti->item,
- ELM_GENLIST_ITEM_GROUP,
- NULL,
- NULL);
- last_header = EINA_FALSE;
break;
}
}
- else
- {
- break;
- }
}
}
}
if(header_list)
{
Elm_Store_Item *header_item = eina_list_nth(header_list, 0);
- if (header_item->item_info->group_index == sti->item_info->group_index)
+ if(header_item && header_item->item_info)
{
- Eina_List *in_l;
- Eina_List *in_l_next;
- Elm_Store_Item *item;
-
- EINA_LIST_FOREACH_SAFE(header_list, in_l, in_l_next, item)
+ if (header_item->item_info->group_index == sti->item_info->group_index)
{
- if(item)
+ Eina_List *in_l;
+ Eina_List *in_l_next;
+ Elm_Store_Item *item;
+
+ EINA_LIST_FOREACH_SAFE(header_list, in_l, in_l_next, item)
{
- int sort;
- if (st->cb.item_sort.func)
+ if(item)
{
- sort = st->cb.item_sort.func(st->cb.item_sort.data, sti->item_info, item->item_info);
+ int sort;
+ if (st->cb.item_sort.func)
+ {
+ sort = st->cb.item_sort.func(st->cb.item_sort.data, sti->item_info, item->item_info);
- if(sort == ELM_STORE_ITEM_SORT_SAME)
+ if(sort == ELM_STORE_ITEM_SORT_SAME)
+ {
+ elm_store_item_update(item);
+ }
+ }
+ else
{
- elm_store_item_update(item);
+ break;
}
- }
- else
- {
- break;
- }
+ }
}
}
}
if(header_list)
{
Elm_Store_Item *header_item = eina_list_nth(header_list, 0);
- if (header_item->item_info->group_index == sti->item_info->pre_group_index)
+ if(header_item && header_item->item_info)
{
- Eina_Bool removed = EINA_FALSE;
- Eina_List *in_l;
- Eina_List *in_l_next;
- Elm_Store_Item *remove_item;
-
- EINA_LIST_FOREACH_SAFE(header_list, in_l, in_l_next, remove_item)
+ if (header_item->item_info->group_index == sti->item_info->pre_group_index)
{
- if(remove_item)
+ Eina_Bool removed = EINA_FALSE;
+ Eina_List *in_l;
+ Eina_List *in_l_next;
+ Elm_Store_Item *remove_item;
+
+ EINA_LIST_FOREACH_SAFE(header_list, in_l, in_l_next, remove_item)
{
- if (removed == EINA_TRUE)
+ if(remove_item)
{
- remove_item->item_info->index--;
- }
- else
- {
- int sort;
- if (st->cb.item_sort.func)
+ if (removed == EINA_TRUE)
{
- sort = st->cb.item_sort.func(st->cb.item_sort.data, sti->item_info, remove_item->item_info);
-
- if(sort == ELM_STORE_ITEM_SORT_SAME)
+ remove_item->item_info->index--;
+ }
+ else
+ {
+ int sort;
+ if (st->cb.item_sort.func)
{
- if (st->cb.item_free.func)
- {
- st->cb.item_free.func(st->cb.item_free.data, remove_item->item_info);
- }
- if (remove_item->fetched)
+ sort = st->cb.item_sort.func(st->cb.item_sort.data, sti->item_info, remove_item->item_info);
+
+ if(sort == ELM_STORE_ITEM_SORT_SAME)
{
- int index = elm_store_item_index_get(remove_item);
- if (index != -1)
+ if (remove_item->fetched)
{
- _item_unfetch(st, index);
+ int index = elm_store_item_index_get(remove_item);
+ if (index != -1)
+ {
+ _item_unfetch(st, index);
+ }
+ else
+ {
+ return;
+ }
}
- else
+ if (st->cb.item_free.func)
{
- return;
+ st->cb.item_free.func(st->cb.item_free.data, remove_item->item_info);
+ remove_item->item_info = NULL;
}
- }
- header_list = eina_list_remove(header_list, remove_item);
- st->total_item_count--;
- LKD(remove_item->lock);
- elm_genlist_item_del(remove_item->item);
- free(remove_item);
- if (eina_list_count(header_list) == 0)
- {
- st->header_items = eina_list_remove(st->header_items, header_list);
- header_list = eina_list_free(header_list);
- }
- else if(eina_list_count(header_list) == 1)
- {
- Elm_Store_Item *temp_sti = eina_list_nth(header_list, 0);
- if (temp_sti->item_info->item_type == ELM_GENLIST_ITEM_GROUP)
+ Eina_List *temp_header_list = header_list;
+ header_list = eina_list_remove(header_list, remove_item);
+ st->total_item_count--;
+ LKD(remove_item->lock);
+ elm_genlist_item_del(remove_item->item);
+ free(remove_item);
+
+ if (eina_list_count(header_list) == 0)
{
- if (st->cb.item_free.func)
- {
- st->cb.item_free.func(st->cb.item_free.data, temp_sti->item_info);
- }
- if (temp_sti->fetched)
+ st->header_items = eina_list_remove(st->header_items, temp_header_list);
+ header_list = eina_list_free(header_list);
+ }
+ else if(eina_list_count(header_list) == 1)
+ {
+ Elm_Store_Item *temp_sti = eina_list_nth(header_list, 0);
+ if(temp_sti && temp_sti->item_info)
{
- int index = elm_store_item_index_get(temp_sti);
- if (index != -1)
+ if (temp_sti->item_info->item_type == ELM_GENLIST_ITEM_GROUP)
{
- _item_unfetch(st, index);
- }
- else
- {
- return;
+ if (temp_sti->fetched)
+ {
+ int index = elm_store_item_index_get(temp_sti);
+ if (index != -1)
+ {
+ _item_unfetch(st, index);
+ }
+ else
+ {
+ return;
+ }
+ }
+
+ if (st->cb.item_free.func)
+ {
+ st->cb.item_free.func(st->cb.item_free.data, temp_sti->item_info);
+ temp_sti->item_info = NULL;
+ }
+
+ header_list = eina_list_remove(header_list, temp_sti);
+ st->total_item_count--;
+ LKD(temp_sti->lock);
+ elm_genlist_item_del(temp_sti->item);
+ free(temp_sti);
+ st->header_items = eina_list_remove(st->header_items, temp_header_list);
+ header_list = eina_list_free(header_list);
}
}
- header_list = eina_list_remove(header_list, temp_sti);
- st->total_item_count--;
- LKD(temp_sti->lock);
- elm_genlist_item_del(temp_sti->item);
- free(temp_sti);
- st->header_items = eina_list_remove(st->header_items, header_list);
- header_list = eina_list_free(header_list);
}
+ temp_header_list = eina_list_free(temp_header_list);
+ removed = EINA_TRUE;
}
- removed = EINA_TRUE;
}
- }
- else
- {
- break;
+ else
+ {
+ break;
+ }
}
}
}
}
- }
- else if (header_item->item_info->group_index == sti->item_info->group_index)
- {
- Eina_Bool last_add = EINA_TRUE;
- Eina_List *in_l;
- Eina_List *in_l_next;
- Elm_Store_Item *comp_item;
-
- EINA_LIST_FOREACH_SAFE(header_list, in_l, in_l_next, comp_item)
+ else if (header_item->item_info->group_index == sti->item_info->group_index)
{
- if(comp_item)
+ Eina_Bool last_add = EINA_TRUE;
+ Eina_List *in_l;
+ Eina_List *in_l_next;
+ Elm_Store_Item *comp_item;
+
+ EINA_LIST_FOREACH_SAFE(header_list, in_l, in_l_next, comp_item)
{
- if(last_add == EINA_FALSE)
- {
- comp_item->item_info->index++;
- }
- else
+ if(comp_item)
{
- int sort;
- if (st->cb.item_sort.func)
+ if(last_add == EINA_FALSE)
{
- sort = st->cb.item_sort.func(st->cb.item_sort.data, sti->item_info, comp_item->item_info);
+ comp_item->item_info->index++;
+ }
+ else
+ {
+ int sort;
+ if (st->cb.item_sort.func)
+ {
+ sort = st->cb.item_sort.func(st->cb.item_sort.data, sti->item_info, comp_item->item_info);
- if(sort == ELM_STORE_ITEM_SORT_LOW)
+ if(sort == ELM_STORE_ITEM_SORT_LOW)
+ {
+ sti->item_info->index = comp_item->item_info->index;
+ comp_item->item_info->index++;
+ header_list = eina_list_prepend_relative(header_list, sti, comp_item);
+ st->total_item_count++;
+ sti->item = elm_genlist_item_insert_before(st->genlist,
+ itc,
+ sti,
+ header_item->item,
+ comp_item->item,
+ ELM_GENLIST_ITEM_NONE,
+ (Evas_Smart_Cb)sti->store->cb.item_select.func,
+ (void *)sti->store->cb.item_select.data);
+ elm_store_item_update(sti);
+ last_add = EINA_FALSE;
+ }
+ }
+ else
{
- sti->item_info->index = comp_item->item_info->index;
- comp_item->item_info->index++;
- header_list = eina_list_prepend_relative(header_list, sti, comp_item);
+ Elm_Store_Item *last_sti = eina_list_nth(header_list, eina_list_count(header_list) - 1);
+ sti->item_info->index = eina_list_count(header_list);
+ header_list = eina_list_append(header_list, sti);
st->total_item_count++;
- sti->item = elm_genlist_item_insert_before(st->genlist,
- itc,
- sti,
- header_item->item,
- comp_item->item,
- ELM_GENLIST_ITEM_NONE,
- (Evas_Smart_Cb)sti->store->cb.item_select.func,
- (void *)sti->store->cb.item_select.data);
+ sti->item = elm_genlist_item_insert_after(st->genlist,
+ itc,
+ sti,
+ header_item->item,
+ last_sti->item,
+ ELM_GENLIST_ITEM_NONE,
+ (Evas_Smart_Cb)sti->store->cb.item_select.func,
+ (void *)sti->store->cb.item_select.data);
elm_store_item_update(sti);
last_add = EINA_FALSE;
+ break;
}
}
- else
- {
- Elm_Store_Item *last_sti = eina_list_nth(header_list, eina_list_count(header_list) - 1);
- sti->item_info->index = eina_list_count(header_list);
- header_list = eina_list_append(header_list, sti);
- st->total_item_count++;
- sti->item = elm_genlist_item_insert_after(st->genlist,
- itc,
- sti,
- header_item->item,
- last_sti->item,
- ELM_GENLIST_ITEM_NONE,
- (Evas_Smart_Cb)sti->store->cb.item_select.func,
- (void *)sti->store->cb.item_select.data);
- elm_store_item_update(sti);
- last_add = EINA_FALSE;
- break;
- }
}
}
- }
- if(last_add)
- {
- Elm_Store_Item *last_sti = eina_list_nth(header_list, eina_list_count(header_list) - 1);
- sti->item_info->index = eina_list_count(header_list);
- header_list = eina_list_append(header_list, sti);
- st->total_item_count++;
- sti->item = elm_genlist_item_insert_after(st->genlist,
- itc,
- sti,
- header_item->item,
- last_sti->item,
- ELM_GENLIST_ITEM_NONE,
- (Evas_Smart_Cb)sti->store->cb.item_select.func,
- (void *)sti->store->cb.item_select.data);
- elm_store_item_update(sti);
+ if(last_add)
+ {
+ Elm_Store_Item *last_sti = eina_list_nth(header_list, eina_list_count(header_list) - 1);
+ sti->item_info->index = eina_list_count(header_list);
+ header_list = eina_list_append(header_list, sti);
+ st->total_item_count++;
+ sti->item = elm_genlist_item_insert_after(st->genlist,
+ itc,
+ sti,
+ header_item->item,
+ last_sti->item,
+ ELM_GENLIST_ITEM_NONE,
+ (Evas_Smart_Cb)sti->store->cb.item_select.func,
+ (void *)sti->store->cb.item_select.data);
+ elm_store_item_update(sti);
+ }
}
}
-
}
}
}
{
Elm_Store_Item *header_item = eina_list_nth(header_list, 0);
- if(header_item)
+ if(header_item && header_item->item_info)
{
if (header_item->item_info->group_index == sti->item_info->group_index)
{
if (header_list)
{
Elm_Store_Item *temp_sti = eina_list_nth(header_list, 0);
- if(temp_sti)
+ if(temp_sti && temp_sti->item_info && sti->item_info)
{
if (sti->item_info->group_index == temp_sti->item_info->group_index)
{
if (header_list)
{
Elm_Store_Item *temp_sti = eina_list_nth(header_list, 0);
-
- if(temp_sti->item_info->item_type == ELM_GENLIST_ITEM_GROUP)
+ if(temp_sti && temp_sti->item_info && sti->item_info)
{
- group_item_count++;
- }
- if (temp_sti->item_info->group_index == sti->item_info->group_index)
- {
- Eina_List *in_l;
- Eina_List *in_l_next;
- Elm_Store_Item *comp_item;
+ if(temp_sti->item_info->item_type == ELM_GENLIST_ITEM_GROUP)
+ {
+ group_item_count++;
+ }
- EINA_LIST_FOREACH_SAFE(header_list, in_l, in_l_next, comp_item)
+ if (temp_sti->item_info->group_index == sti->item_info->group_index)
{
- if(comp_item)
+ Eina_List *in_l;
+ Eina_List *in_l_next;
+ Elm_Store_Item *comp_item;
+
+ EINA_LIST_FOREACH_SAFE(header_list, in_l, in_l_next, comp_item)
{
- if (comp_item->item_info->index == sti->item_info->index)
- {
- return (index - group_item_count);
- }
- else
+ if(comp_item)
{
- index++;
+ if (comp_item->item_info->index == sti->item_info->index)
+ {
+ return (index - group_item_count);
+ }
+ else
+ {
+ index++;
+ }
}
}
}
if (header_list)
{
Elm_Store_Item *header_item = eina_list_nth(header_list, 0);
-
- if (header_item->item_info->group_index == sti->item_info->group_index)
+ if(header_item && header_item->item_info && sti->item_info)
{
- Eina_Bool removed = EINA_FALSE;
- Eina_List *in_l;
- Eina_List *in_l_next;
- Elm_Store_Item *remove_sti;
- EINA_LIST_FOREACH_SAFE(header_list, in_l, in_l_next, remove_sti)
+
+ if (header_item->item_info->group_index == sti->item_info->group_index)
{
- if(remove_sti)
+ Eina_Bool removed = EINA_FALSE;
+ Eina_List *in_l;
+ Eina_List *in_l_next;
+ Elm_Store_Item *remove_sti;
+ EINA_LIST_FOREACH_SAFE(header_list, in_l, in_l_next, remove_sti)
{
- if (removed == EINA_TRUE)
+ if(remove_sti)
{
- remove_sti->item_info->index--;
- }
- else
- {
- if (remove_sti->item_info->index == sti->item_info->index)
+ if (removed == EINA_TRUE)
{
- if (st->cb.item_free.func)
- {
- st->cb.item_free.func(st->cb.item_free.data, remove_sti->item_info);
- }
- if (remove_sti->fetched)
+ remove_sti->item_info->index--;
+ }
+ else
+ {
+ if (remove_sti->item_info->index == sti->item_info->index)
{
- int index = elm_store_item_index_get(remove_sti);
- if (index != -1)
+ if (remove_sti->fetched)
{
- _item_unfetch(st, index);
+ int index = elm_store_item_index_get(remove_sti);
+ if (index != -1)
+ {
+ _item_unfetch(st, index);
+ }
+ else
+ {
+ return;
+ }
}
- else
+ if (st->cb.item_free.func)
{
- return;
+ st->cb.item_free.func(st->cb.item_free.data, remove_sti->item_info);
+ remove_sti->item_info = NULL;
}
- }
- header_list = eina_list_remove(header_list, remove_sti);
- st->total_item_count--;
- LKD(remove_sti->lock);
- elm_genlist_item_del(remove_sti->item);
- free(remove_sti);
- if (eina_list_count(header_list) == 0)
- {
- st->header_items = eina_list_remove(st->header_items, header_list);
- header_list = eina_list_free(header_list);
- }
- else if (eina_list_count(header_list) == 1)
- {
- Elm_Store_Item *temp_sti = eina_list_nth(header_list, 0);
- if (temp_sti->item_info->item_type == ELM_GENLIST_ITEM_GROUP)
+ Eina_List *temp_header_list = header_list;
+ header_list = eina_list_remove(header_list, remove_sti);
+ st->total_item_count--;
+ LKD(remove_sti->lock);
+ elm_genlist_item_del(remove_sti->item);
+ free(remove_sti);
+
+ if (eina_list_count(header_list) == 0)
{
- if (st->cb.item_free.func)
- {
- st->cb.item_free.func(st->cb.item_free.data, temp_sti->item_info);
- }
- if (temp_sti->fetched)
+ st->header_items = eina_list_remove(st->header_items, temp_header_list);
+ header_list = eina_list_free(header_list);
+ }
+ else if (eina_list_count(header_list) == 1)
+ {
+ Elm_Store_Item *temp_sti = eina_list_nth(header_list, 0);
+ if(temp_sti && temp_sti->item_info)
{
- int index = elm_store_item_index_get(temp_sti);
- if (index != -1)
- {
- _item_unfetch(st, index);
- }
- else
+ if (temp_sti->item_info->item_type == ELM_GENLIST_ITEM_GROUP)
{
- return;
+ if (temp_sti->fetched)
+ {
+ int index = elm_store_item_index_get(temp_sti);
+ if (index != -1)
+ {
+ _item_unfetch(st, index);
+ }
+ else
+ {
+ return;
+ }
+ }
+ if (st->cb.item_free.func)
+ {
+ st->cb.item_free.func(st->cb.item_free.data, temp_sti->item_info);
+ temp_sti->item_info = NULL;
+ }
+
+ header_list = eina_list_remove(header_list, temp_sti);
+ st->total_item_count--;
+ LKD(temp_sti->lock);
+ elm_genlist_item_del(temp_sti->item);
+ free(temp_sti);
+ st->header_items = eina_list_remove(st->header_items, temp_header_list);
+ header_list = eina_list_free(header_list);
}
}
- header_list = eina_list_remove(header_list, temp_sti);
- st->total_item_count--;
- LKD(temp_sti->lock);
- elm_genlist_item_del(temp_sti->item);
- free(temp_sti);
- st->header_items = eina_list_remove(st->header_items, header_list);
- header_list = eina_list_free(header_list);
}
+ temp_header_list = eina_list_free(temp_header_list);
+ removed = EINA_TRUE;
}
- removed = EINA_TRUE;
}
}
}
}
#endif
-static void _detail_show_cb (void *data, Evas_Object *obj, const char *emission, const char *source)
+static void _detail_show_cb (void *data, Evas_Object *obj __UNUSED__,
+ const char *emission __UNUSED__,
+ const char *source __UNUSED__)
{
evas_object_smart_callback_call ((Evas_Object *)data, "detail,show", NULL);
}
-static void _detail_hide_cb (void *data, Evas_Object *obj, const char *emission, const char *source)
+static void _detail_hide_cb (void *data, Evas_Object *obj __UNUSED__,
+ const char *emission __UNUSED__,
+ const char *source __UNUSED__)
{
evas_object_smart_callback_call ((Evas_Object *)data, "detail,hide", NULL);
}
}
static void
-_show(void *data, Evas *e, Evas_Object *obj, void *event_info)
-{
- Widget_Data *wd = elm_widget_data_get(obj);
+_show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
+ void *event_info __UNUSED__)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->mode == ELM_TICKERNOTI_DEFAULT)
}
static void
-_hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
+_hide(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
+ void *event_info __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(obj);
{
effect_module = EINA_INLIST_CONTAINER_GET(transit->effect_list, Elm_Transit_Effect_Module);
transit->effect_list = eina_inlist_remove(transit->effect_list, transit->effect_list);
+ _elm_transit_effect_del(transit, effect_module);
}
while (transit->objs)
Eina_Bool show : 1;
Eina_Bool edit : 1;
Eina_Bool edje : 1;
+ Eina_Bool aspect_ratio_retained: 1;
Elm_Image_Orient orient;
};
return sd->obj;
}
+void
+_els_smart_icon_aspect_ratio_retained_set(Evas_Object *obj, Eina_Bool retained)
+{
+ Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+
+ retained = !!retained;
+ if (sd->aspect_ratio_retained == retained) return;
+ sd->aspect_ratio_retained = retained;
+ _smart_reconfigure(sd);
+}
+
+Eina_Bool
+_els_smart_icon_aspect_ratio_retained_get(const Evas_Object *obj)
+{
+ Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return EINA_FALSE;
+ return sd->aspect_ratio_retained;
+}
+
/* local subsystem globals */
static void
_smart_reconfigure(Smart_Data *sd)
Evas_Coord x, y, w, h;
if (!sd->obj) return;
+
+ w = sd->w;
+ h = sd->h;
+
if (!strcmp(evas_object_type_get(sd->obj), "edje"))
{
- w = sd->w;
- h = sd->h;
x = sd->x;
y = sd->y;
evas_object_move(sd->obj, x, y);
if (iw < 1) iw = 1;
if (ih < 1) ih = 1;
- if (sd->fill_inside)
+ if (sd->aspect_ratio_retained)
{
- w = sd->w;
h = ((double)ih * w) / (double)iw;
- if (h > sd->h)
+ if (sd->fill_inside)
{
- h = sd->h;
- w = ((double)iw * h) / (double)ih;
+ if (h > sd->h)
+ {
+ h = sd->h;
+ w = ((double)iw * h) / (double)ih;
+ }
}
- }
- else
- {
- w = sd->w;
- h = ((double)ih * w) / (double)iw;
- if (h < sd->h)
+ else
{
- h = sd->h;
- w = ((double)iw * h) / (double)ih;
+ if (h < sd->h)
+ {
+ h = sd->h;
+ w = ((double)iw * h) / (double)ih;
+ }
}
}
if (!sd->scale_up)
{
- if ((w > iw) || (h > ih))
- {
- w = iw;
- h = ih;
- }
+ if (w > iw) w = iw;
+ if (h > ih) h = ih;
}
if (!sd->scale_down)
{
- if ((w < iw) || (h < ih))
- {
- w = iw;
- h = ih;
- }
+ if (w < iw) w = iw;
+ if (h < ih) h = ih;
}
x = sd->x + ((sd->w - w) / 2);
y = sd->y + ((sd->h - h) / 2);
sd->fill_inside = EINA_TRUE;
sd->scale_up = EINA_TRUE;
sd->scale_down = EINA_TRUE;
+ sd->aspect_ratio_retained = EINA_TRUE;
sd->size = 64;
sd->scale = 1.0;
evas_object_smart_member_add(sd->obj, obj);
void _els_smart_icon_edit_set (Evas_Object *obj, Eina_Bool, Evas_Object *parent);
Eina_Bool _els_smart_icon_edit_get (const Evas_Object *obj);
Evas_Object *_els_smart_icon_edje_get(Evas_Object *obj);
+void _els_smart_icon_aspect_ratio_retained_set(Evas_Object *obj, Eina_Bool retained);
+Eina_Bool _els_smart_icon_aspect_ratio_retained_get(const Evas_Object *obj);
+