* - @c item_style - This is a constant string and simply defines the name
* of the item style. It @b must be specified and the default should be @c
* "default".
- * - @c mode_item_style - This is a constant string and simply defines the
- * name of the style that will be used for mode animations. It can be left
- * as @c NULL if you don't plan to use Genlist mode. See
- * elm_genlist_item_mode_set() for more info.
*
* - @c func - A struct with pointers to functions that will be called when
* an item is going to be actually created. All of them receive a @c data
Elm_Genlist_Item_State_Get_Cb state_get; /**< State fetching class function for genlist item classes. */
Elm_Genlist_Item_Del_Cb del; /**< Deletion class function for genlist item classes. */
} func;
- const char *mode_item_style;
};
/**
*/
EAPI const Eina_List *elm_genlist_selected_items_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
+ * Get the mode item style of items in the genlist
+ * @param obj The genlist object
+ * @return The mode item style string, or NULL if none is specified
+ *
+ * This is a constant string and simply defines the name of the
+ * style that will be used for mode animations. It can be
+ * @c NULL if you don't plan to use Genlist mode. See
+ * elm_genlist_item_mode_set() for more info.
+ *
+ * @ingroup Genlist
+ */
+ EAPI const char *elm_genlist_mode_item_style_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+ /**
+ * Set the mode item style of items in the genlist
+ * @param obj The genlist object
+ * @param style The mode item style string, or NULL if none is desired
+ *
+ * This is a constant string and simply defines the name of the
+ * style that will be used for mode animations. It can be
+ * @c NULL if you don't plan to use Genlist mode. See
+ * elm_genlist_item_mode_set() for more info.
+ *
+ * @ingroup Genlist
+ */
+ EAPI void elm_genlist_mode_item_style_set(Evas_Object *obj, const char *style) EINA_ARG_NONNULL(1);
+ /**
* Get a list of realized items in genlist
*
* @param obj The genlist object
} Elm_Fileselector_Type;
static Elm_Genlist_Item_Class list_itc[ELM_FILE_LAST] = {
- { "default", { NULL, NULL, NULL, NULL }, NULL },
- { "default", { NULL, NULL, NULL, NULL }, NULL },
- { "default", { NULL, NULL, NULL, NULL }, NULL }
+ { "default", { NULL, NULL, NULL, NULL } },
+ { "default", { NULL, NULL, NULL, NULL } },
+ { "default", { NULL, NULL, NULL, NULL } }
};
static Elm_Gengrid_Item_Class grid_itc[ELM_FILE_LAST] = {
{ "default", { NULL, NULL, NULL, NULL } },
Ecore_Timer *multi_timer, *scr_hold_timer;
Ecore_Animator *reorder_move_animator;
const char *mode_type;
+ const char *mode_item_style;
unsigned int start_time;
Evas_Coord prev_x, prev_y, prev_mx, prev_my;
Evas_Coord cur_x, cur_y, cur_mx, cur_my;
}
static void
-_mode_item_realize(Elm_Genlist_Item *it)
+_mode_item_realize_theme(Elm_Genlist_Item *it)
{
char buf[1024];
+ strncpy(buf, "item", sizeof(buf));
+ if (it->wd->compress)
+ strncat(buf, "_compress", sizeof(buf) - strlen(buf));
+
+ if (it->order_num_in & 0x1) strncat(buf, "_odd", sizeof(buf) - strlen(buf));
+ strncat(buf, "/", sizeof(buf) - strlen(buf));
+ strncat(buf, it->wd->mode_item_style, sizeof(buf) - strlen(buf));
+
+ _elm_theme_object_set(WIDGET(it), it->mode_view, "genlist", buf,
+ elm_widget_style_get(WIDGET(it)));
+}
+
+static void
+_mode_item_realize(Elm_Genlist_Item *it)
+{
if ((it->mode_view) || (it->delete_me)) return;
evas_event_freeze(evas_object_evas_get(it->wd->obj));
evas_object_smart_member_add(it->mode_view, it->wd->pan_smart);
elm_widget_sub_object_add(WIDGET(it), it->mode_view);
- strncpy(buf, "item", sizeof(buf));
- if (it->wd->compress)
- strncat(buf, "_compress", sizeof(buf) - strlen(buf));
-
- if (it->order_num_in & 0x1) strncat(buf, "_odd", sizeof(buf) - strlen(buf));
- strncat(buf, "/", sizeof(buf) - strlen(buf));
- strncat(buf, it->itc->mode_item_style, sizeof(buf) - strlen(buf));
-
- _elm_theme_object_set(WIDGET(it), it->mode_view, "genlist", buf,
- elm_widget_style_get(WIDGET(it)));
+ _mode_item_realize_theme(it);
edje_object_mirrored_set(it->mode_view,
elm_widget_mirrored_get(WIDGET(it)));
(!strcmp(mode_type, wd->mode_type)) &&
(mode_set))
return;
- if (!it->itc->mode_item_style) return;
+ if (!wd->mode_item_style) return;
if (wd->multi)
{
}
EAPI const char *
+elm_genlist_mode_item_style_get(const Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
+ return wd->mode_item_style;
+}
+
+EAPI void
+elm_genlist_mode_item_style_set(Evas_Object *obj, const char *style)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ if ((style == wd->mode_item_style) || (style && wd->mode_item_style &&
+ (!strcmp(style, wd->mode_item_style))))
+ return;
+ eina_stringshare_replace(&wd->mode_item_style, style);
+ elm_genlist_realized_items_update(obj);
+}
+
+EAPI const char *
elm_genlist_mode_get(const Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;