Eina_List *items;
Evas_Coord w, h, minw, minh;
Elm_Gen_Item *group_item;
- Elm_Genlist_Item_Flags flags;
+ Elm_Genlist_Item_Type type;
Eina_List *mode_texts, *mode_contents, *mode_states, *mode_content_objs;
Eina_List *edit_texts, *edit_contents, *edit_states, *edit_content_objs;
Ecore_Timer *swipe_timer;
evas_object_hide(itc->base_view);
evas_object_move(itc->base_view, -9999, -9999);
itc->item_style = eina_stringshare_add(it->itc->item_style);
- if (it->item->flags & ELM_GENLIST_ITEM_SUBITEMS) itc->tree = 1;
+ if (it->item->type & ELM_GENLIST_ITEM_SUBITEMS) itc->tree = 1;
itc->compress = (it->wd->compress);
itc->selected = it->selected;
itc->disabled = elm_widget_item_disabled_get(it);
Item_Cache *itc;
Eina_Bool tree = 0;
- if (it->item->flags & ELM_GENLIST_ITEM_SUBITEMS) tree = 1;
+ if (it->item->type & ELM_GENLIST_ITEM_SUBITEMS) tree = 1;
EINA_INLIST_FOREACH(it->wd->item_cache, itc)
{
if ((itc->selected) || (itc->disabled) || (itc->expanded))
evas_object_smart_member_add(VIEW(it), it->wd->pan_smart);
elm_widget_sub_object_add(WIDGET(it), VIEW(it));
- if (it->item->flags & ELM_GENLIST_ITEM_SUBITEMS)
+ if (it->item->type & ELM_GENLIST_ITEM_SUBITEMS)
snprintf(buf, sizeof(buf), "tree%s/%s", it->wd->compress ? "_compress" : "", it->itc->item_style ?: "default");
else
snprintf(buf, sizeof(buf), "item%s/%s", it->wd->compress ? "_compress" : "", it->itc->item_style ?: "default");
_multi_move, it);
if ((it->wd->edit_mode) && (!it->edit_obj) &&
- (it->item->flags != ELM_GENLIST_ITEM_GROUP) && (it->itc->edit_item_style))
+ (it->item->type != ELM_GENLIST_ITEM_GROUP) && (it->itc->edit_item_style))
_edit_mode_item_realize(it, EINA_FALSE);
_elm_genlist_item_state_update(it, itc);
it->wd->group_item_width = mw;
it->wd->group_item_height = mh;
}
- else if ((!it->wd->item_width) && (it->item->flags == ELM_GENLIST_ITEM_NONE))
+ else if ((!it->wd->item_width) && (it->item->type == ELM_GENLIST_ITEM_NONE))
{
it->wd->item_width = mw;
it->wd->item_height = mh;
if (!calc)
evas_object_smart_callback_call(WIDGET(it), SIG_REALIZED, it);
- if ((!calc) && (it->wd->edit_mode) && (it->item->flags != ELM_GENLIST_ITEM_GROUP))
+ if ((!calc) && (it->wd->edit_mode) && (it->item->type != ELM_GENLIST_ITEM_GROUP))
{
if (it->itc->edit_item_style)
{
evas_object_smart_member_add(it->edit_obj, it->wd->pan_smart);
elm_widget_sub_object_add(WIDGET(it), it->edit_obj);
- if (it->item->flags & ELM_GENLIST_ITEM_SUBITEMS)
+ if (it->item->type & ELM_GENLIST_ITEM_SUBITEMS)
strncpy(buf, "tree", sizeof(buf));
else strncpy(buf, "item", sizeof(buf));
if (it->wd->compress)
const Elm_Genlist_Item_Class *itc,
const void *data,
Elm_Gen_Item *parent,
- Elm_Genlist_Item_Flags flags,
+ Elm_Genlist_Item_Type type,
Evas_Smart_Cb func,
const void *func_data)
{
it = _elm_genlist_item_new(wd, itc, data, parent, func, func_data);
if (!it) return NULL;
it->item = ELM_NEW(Elm_Gen_Item_Type);
- it->item->flags = flags;
- if (flags & ELM_GENLIST_ITEM_GROUP) it->group++;
+ it->item->type = type;
+ if (type & ELM_GENLIST_ITEM_GROUP) it->group++;
it->item->expanded_depth = 0;
ELM_GEN_ITEM_SETUP(it);
if (it->parent)
const Elm_Genlist_Item_Class *itc,
const void *data,
Elm_Object_Item *parent,
- Elm_Genlist_Item_Flags flags,
+ Elm_Genlist_Item_Type type,
Evas_Smart_Cb func,
const void *func_data)
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return NULL;
- Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, flags,
+ Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, type,
func, func_data);
if (!it) return NULL;
if (!it->parent)
const Elm_Genlist_Item_Class *itc,
const void *data,
Elm_Object_Item *parent,
- Elm_Genlist_Item_Flags flags,
+ Elm_Genlist_Item_Type type,
Evas_Smart_Cb func,
const void *func_data)
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return NULL;
- Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, flags,
+ Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, type,
func, func_data);
if (!it) return NULL;
if (!it->parent)
const void *data,
Elm_Object_Item *parent,
Elm_Object_Item *after,
- Elm_Genlist_Item_Flags flags,
+ Elm_Genlist_Item_Type type,
Evas_Smart_Cb func,
const void *func_data)
{
/* It makes no sense to insert after in an empty list with after != NULL, something really bad is happening in your app. */
EINA_SAFETY_ON_NULL_RETURN_VAL(wd->items, NULL);
- Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, flags,
+ Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, type,
func, func_data);
if (!it) return NULL;
if (!it->parent)
const void *data,
Elm_Object_Item *parent,
Elm_Object_Item *before,
- Elm_Genlist_Item_Flags flags,
+ Elm_Genlist_Item_Type type,
Evas_Smart_Cb func,
const void *func_data)
{
/* It makes no sense to insert before in an empty list with before != NULL, something really bad is happening in your app. */
EINA_SAFETY_ON_NULL_RETURN_VAL(wd->items, NULL);
- Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, flags,
+ Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, type,
func, func_data);
if (!it) return NULL;
if (!it->parent)
const Elm_Genlist_Item_Class *itc,
const void *data,
Elm_Object_Item *parent,
- Elm_Genlist_Item_Flags flags,
+ Elm_Genlist_Item_Type type,
Eina_Compare_Cb comp,
Evas_Smart_Cb func,
const void *func_data)
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return NULL;
Elm_Gen_Item *rel = NULL;
- Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, flags,
+ Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, type,
func, func_data);
if (!it) return NULL;
EAPI void
elm_genlist_item_fields_update(Elm_Object_Item *it,
const char *parts,
- Elm_Genlist_Item_Field_Flags itf)
+ Elm_Genlist_Item_Field_Type itf)
{
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
{
EINA_LIST_FOREACH(list, l, it)
{
- if (it->item->flags != ELM_GENLIST_ITEM_GROUP)
+ if (it->item->type != ELM_GENLIST_ITEM_GROUP)
_edit_mode_item_unrealize(it);
}
_item_cache_zero(wd);
{
EINA_LIST_FOREACH(list, l, it)
{
- if (it->item->flags != ELM_GENLIST_ITEM_GROUP)
+ if (it->item->type != ELM_GENLIST_ITEM_GROUP)
{
if (it->selected) _item_unselect(it);
if (it->itc->edit_item_style)
return wd->reorder_mode;
}
-EAPI Elm_Genlist_Item_Flags
-elm_genlist_item_flags_get(const Elm_Object_Item *it)
+EAPI Elm_Genlist_Item_Type
+elm_genlist_item_type_get(const Elm_Object_Item *it)
{
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, ELM_GENLIST_ITEM_MAX);
Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
- return _it->item->flags;
+ return _it->item->type;
+}
+
+EINA_DEPRECATED EAPI Elm_Genlist_Item_Type
+elm_genlist_item_flags_get(const Elm_Object_Item *it)
+{
+ return elm_genlist_item_type_get(it);
}
EAPI Elm_Genlist_Item_Class *
*
* @ingroup Genlist
*/
-//XXX: Elm_Genlist_Item_Type
typedef enum
{
ELM_GENLIST_ITEM_NONE = 0, /**< simple item */
ELM_GENLIST_ITEM_GROUP = (1 << 1), /**< index of a group of items */
ELM_GENLIST_ITEM_MAX = (1 << 2)
-} Elm_Genlist_Item_Flags;
+} Elm_Genlist_Item_Type;
-//XXX: Elm_Genlist_Item_Field_Type
typedef enum
{
ELM_GENLIST_ITEM_FIELD_ALL = 0,
ELM_GENLIST_ITEM_FIELD_TEXT = (1 << 0),
ELM_GENLIST_ITEM_FIELD_CONTENT = (1 << 1),
ELM_GENLIST_ITEM_FIELD_STATE = (1 << 2)
-} Elm_Genlist_Item_Field_Flags;
+} Elm_Genlist_Item_Field_Type;
typedef struct _Elm_Genlist_Item_Class Elm_Genlist_Item_Class; /**< Genlist item class definition structs */
#define Elm_Genlist_Item_Class Elm_Gen_Item_Class
* @param itc The item class for the item
* @param data The item data
* @param parent The parent item, or NULL if none
- * @param flags Item flags
+ * @param type Item type
* @param func Convenience function called when the item is selected
* @param func_data Data passed to @p func above.
* @return A handle to the item added or @c NULL if not possible
*
* @ingroup Genlist
*/
-EAPI Elm_Object_Item *elm_genlist_item_append(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data);
+EAPI Elm_Object_Item *elm_genlist_item_append(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data);
/**
* Prepend a new item in a given genlist widget.
* @param itc The item class for the item
* @param data The item data
* @param parent The parent item, or NULL if none
- * @param flags Item flags
+ * @param type Item type
* @param func Convenience function called when the item is selected
* @param func_data Data passed to @p func above.
* @return A handle to the item added or NULL if not possible
*
* @ingroup Genlist
*/
-EAPI Elm_Object_Item *elm_genlist_item_prepend(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data);
+EAPI Elm_Object_Item *elm_genlist_item_prepend(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data);
/**
* Insert an item before another in a genlist widget
* @param data The item data
* @param parent The parent item, or NULL if none
* @param before The item to place this new one before.
- * @param flags Item flags
+ * @param type Item type
* @param func Convenience function called when the item is selected
* @param func_data Data passed to @p func above.
* @return A handle to the item added or @c NULL if not possible
*
* @ingroup Genlist
*/
-EAPI Elm_Object_Item *elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Object_Item *before, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data);
+EAPI Elm_Object_Item *elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Object_Item *before, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data);
/**
* Insert an item after another in a genlist widget
* @param data The item data
* @param parent The parent item, or NULL if none
* @param after The item to place this new one after.
- * @param flags Item flags
+ * @param type Item type
* @param func Convenience function called when the item is selected
* @param func_data Data passed to @p func above.
* @return A handle to the item added or @c NULL if not possible
*
* @ingroup Genlist
*/
-EAPI Elm_Object_Item *elm_genlist_item_insert_after(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Object_Item *after, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data);
+EAPI Elm_Object_Item *elm_genlist_item_insert_after(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Object_Item *after, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data);
/**
* Insert a new item into the sorted genlist object
* @param itc The item class for the item
* @param data The item data
* @param parent The parent item, or NULL if none
- * @param flags Item flags
+ * @param type Item type
* @param comp The function called for the sort
* @param func Convenience function called when item selected
* @param func_data Data passed to @p func above.
* @ingroup Genlist
*/
-EAPI Elm_Object_Item *elm_genlist_item_sorted_insert(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Flags flags, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data);
+EAPI Elm_Object_Item *elm_genlist_item_sorted_insert(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Type type, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data);
/* operations to retrieve existing items */
/**
*
* @param it The item
* @param parts The name of item's part
- * @param itf The flags of item's part type
+ * @param itf The type of item's part type
*
* This updates an item's part by calling item's fetching functions again
* to get the contents, texts and states. Use this when the original
*
* @ingroup Genlist
*/
-EAPI void elm_genlist_item_fields_update(Elm_Object_Item *it, const char *parts, Elm_Genlist_Item_Field_Flags itf);
+EAPI void elm_genlist_item_fields_update(Elm_Object_Item *it, const char *parts, Elm_Genlist_Item_Field_Type itf);
/**
* Activate a genlist mode on an item
EAPI Eina_Bool elm_genlist_reorder_mode_get(const Evas_Object *obj);
/**
- * Get the Item's Flags
+ * Get the Item's Type
*
* @param it The genlist item
- * @return The item flags.
+ * @return The item type.
*
* This function returns the item's type. Normally the item's type.
* If it failed, return value is ELM_GENLIST_ITEM_MAX
*
* @ingroup Genlist
*/
-//XXX: type would be more intuitive...
-EAPI Elm_Genlist_Item_Flags elm_genlist_item_flags_get(const Elm_Object_Item *it);
+EAPI Elm_Genlist_Item_Type elm_genlist_item_type_get(const Elm_Object_Item *it);
/**
* Set Genlist edit mode