The ones just wrapping their image counterparts should die eventually.
The signal callbacks on icons will die, too, eventually.
SVN revision: 71468
} freedesktop;
#endif
- int in_eval;
+ int in_eval;
- Eina_Bool is_video : 1;
+ /* WARNING: to be deprecated */
+ Eina_List *edje_signals;
+
+ Eina_Bool is_video : 1;
};
#ifdef HAVE_ELEMENTARY_ETHUMB
{
Edje_Signal_Data *esd;
- EINA_LIST_FREE (ELM_IMAGE_DATA(sd)->edje_signals, esd)
+ EINA_LIST_FREE (sd->edje_signals, esd)
{
eina_stringshare_del(esd->emission);
eina_stringshare_del(esd->source);
ELM_WIDGET_CLASS(_elm_icon_parent_sc)->base.del(obj);
}
-static void
-_elm_icon_smart_signal(Evas_Object *obj,
- const char *emission,
- const char *source)
+/* WARNING: to be deprecated */
+void
+_elm_icon_signal_emit(Evas_Object *obj,
+ const char *emission,
+ const char *source)
{
ELM_ICON_DATA_GET(obj, sd);
esd->func(esd->data, esd->obj, emission, source);
}
-static void
-_elm_icon_smart_callback_add(Evas_Object *obj,
- const char *emission,
- const char *source,
- Edje_Signal_Cb func_cb,
- void *data)
+/* WARNING: to be deprecated */
+void
+_elm_icon_signal_callback_add(Evas_Object *obj,
+ const char *emission,
+ const char *source,
+ Edje_Signal_Cb func_cb,
+ void *data)
{
Edje_Signal_Data *esd;
esd->emission = eina_stringshare_add(emission);
esd->source = eina_stringshare_add(source);
esd->data = data;
- ELM_IMAGE_DATA(sd)->edje_signals =
- eina_list_append(ELM_IMAGE_DATA(sd)->edje_signals, esd);
+ sd->edje_signals =
+ eina_list_append(sd->edje_signals, esd);
edje_object_signal_callback_add
(ELM_IMAGE_DATA(sd)->img, emission, source, _edje_signal_callback, esd);
}
-static void *
-_elm_icon_smart_callback_del(Evas_Object *obj,
- const char *emission,
- const char *source,
- Edje_Signal_Cb func_cb)
+/* WARNING: to be deprecated */
+void *
+_elm_icon_signal_callback_del(Evas_Object *obj,
+ const char *emission,
+ const char *source,
+ Edje_Signal_Cb func_cb)
{
Edje_Signal_Data *esd = NULL;
void *data = NULL;
if (!ELM_IMAGE_DATA(sd)->edje) return NULL;
- EINA_LIST_FOREACH (ELM_IMAGE_DATA(sd)->edje_signals, l, esd)
+ EINA_LIST_FOREACH (sd->edje_signals, l, esd)
{
if ((esd->func == func_cb) && (!strcmp(esd->emission, emission)) &&
(!strcmp(esd->source, source)))
{
- ELM_IMAGE_DATA(sd)->edje_signals =
- eina_list_remove_list(ELM_IMAGE_DATA(sd)->edje_signals, l);
+ sd->edje_signals = eina_list_remove_list(sd->edje_signals, l);
eina_stringshare_del(esd->emission);
eina_stringshare_del(esd->source);
data = esd->data;
ELM_WIDGET_CLASS(sc)->theme = _elm_icon_smart_theme;
- sc->callback_add = _elm_icon_smart_callback_add;
- sc->callback_del = _elm_icon_smart_callback_del;
- sc->signal = _elm_icon_smart_signal;
-
sc->file_set = _elm_icon_smart_file_set;
sc->memfile_set = _elm_icon_smart_memfile_set;
sc->sizing_eval = _elm_icon_smart_sizing_eval;
{
ELM_ICON_CHECK(obj) EINA_FALSE;
- return evas_object_image_animated_get(elm_image_object_get(obj));
+ return elm_image_animated_available_get(obj);
}
EAPI void
* This widget inherits from the @ref Image one, so that all the
* functions acting on it also work for icon objects.
*
- * Besides, its API is very similar to the one of its parent object,
- * so that similar calls exist here just wrapping their counterparts
- * on @ref Image.
+ * You should be using an icon, instead of an image, whenever one of
+ * the following apply:
+ * - you need a @b thumbnail version of an original image
+ * - you need freedesktop.org provided icon images
+ * - you need theme provided icon images (Edje groups)
+ *
+ * Various calls on the icon's API are marked as @b deprecated, as
+ * they just wrap the image counterpart functions. Use the ones we
+ * point you to, for each case of deprecation here, instead --
+ * eventually the deprecated ones will be discarded (next major
+ * release).
*
* Default images provided by Elementary's default theme are described
* below.
* (@since 1.1)
* - @c "thumb,error" - elm_icon_thumb_set() has failed (@since 1.1)
*
- * Supported elm_object common APIs.
- * @li @ref elm_object_signal_emit
- * @li @ref elm_object_signal_callback_add
- * @li @ref elm_object_signal_callback_del
+ * Elementary icon objects support the following API calls:
+ * @li elm_object_signal_emit()
+ * @li elm_object_signal_callback_add()
+ * @li elm_object_signal_callback_del()
+ * for emmiting and listening to signals on the object, when the
+ * internal image comes from an Edje object. This behavior was added
+ * unintentionally, though, and is @b deprecated. Expect it to be
+ * dropped on future releases.
*
* An example of usage for this API follows:
* @li @ref tutorial_icon
*
* @see elm_icon_file_get()
*
+ * @deprecated Use elm_image_file_set() instead.
+ *
* @ingroup Icon
*/
EAPI Eina_Bool elm_icon_file_set(Evas_Object *obj, const char *file, const char *group);
* @note The icon image set by this function can be changed by
* elm_icon_standard_set().
*
+ * @deprecated Use elm_image_memfile_set() instead.
+ *
* @ingroup Icon
*/
EAPI Eina_Bool elm_icon_memfile_set(Evas_Object *obj, const void *img, size_t size, const char *format, const char *key);
*
* @see elm_icon_file_set()
*
+ * @deprecated Use elm_image_file_get() instead.
+ *
* @ingroup Icon
*/
EAPI void elm_icon_file_get(const Evas_Object *obj, const char **file, const char **group);
*
* @see elm_icon_smooth_get()
*
+ * @deprecated Use elm_image_smooth_set() instead.
+ *
* @ingroup Icon
*/
EAPI void elm_icon_smooth_set(Evas_Object *obj, Eina_Bool smooth);
*
* @see elm_icon_smooth_set()
*
+ * @deprecated Use elm_image_smooth_get() instead.
+ *
* @ingroup Icon
*/
EAPI Eina_Bool elm_icon_smooth_get(const Evas_Object *obj);
* @see elm_icon_resizable_set()
* @see elm_object_scale_set()
*
+ * @deprecated Use elm_image_no_scale_set() instead.
+ *
* @ingroup Icon
*/
EAPI void elm_icon_no_scale_set(Evas_Object *obj, Eina_Bool no_scale);
*
* @see elm_icon_no_scale_set()
*
+ * @deprecated Use elm_image_no_scale_get() instead.
+ *
* @ingroup Icon
*/
EAPI Eina_Bool elm_icon_no_scale_get(const Evas_Object *obj);
*
* @see elm_icon_resizable_get()
*
+ * @deprecated Use elm_image_resizable_set() instead.
+ *
* @ingroup Icon
*/
EAPI void elm_icon_resizable_set(Evas_Object *obj, Eina_Bool size_up, Eina_Bool size_down);
*
* @see elm_icon_resizable_set()
*
+ * @deprecated Use elm_image_resizable_get() instead.
+ *
* @ingroup Icon
*/
EAPI void elm_icon_resizable_get(const Evas_Object *obj, Eina_Bool *size_up, Eina_Bool *size_down);
* @param w A pointer to store the width in
* @param h A pointer to store the height in
*
+ * @deprecated Use elm_image_object_size_get() instead.
+ *
* @ingroup Icon
*/
EAPI void elm_icon_size_get(const Evas_Object *obj, int *w, int *h);
* Get if the object is filled outside.
*
* @param obj The icon object
- * @return @c EINA_TRUE if the object is filled outside, @c EINA_FALSE otherwise.
+ * @return @c EINA_TRUE if the object is filled outside, @c EINA_FALSE
+ * otherwise.
*
* @see elm_icon_fill_outside_set()
*
+ * @deprecated Use elm_image_fill_outside_get() instead.
+ *
* @ingroup Icon
*/
EAPI Eina_Bool elm_icon_fill_outside_get(const Evas_Object *obj);
* @see elm_icon_prescale_get()
* @see elm_bg_load_size_set()
*
+ * @deprecated Use elm_image_prescale_set() instead.
+ *
* @ingroup Icon
*/
EAPI void elm_icon_prescale_set(Evas_Object *obj, int size);
*
* @see elm_icon_prescale_set()
*
+ * @deprecated Use elm_image_prescale_get() instead.
+ *
* @ingroup Icon
*/
EAPI int elm_icon_prescale_get(const Evas_Object *obj);
* @param obj The icon object
* @return The internal icon object
*
+ * @deprecated Use elm_image_object_get() instead.
+ *
* @ingroup Icon
*/
EAPI Evas_Object *elm_icon_object_get(Evas_Object *obj);
* @param obj The icon object
* @param disabled If EINA_TRUE, preloading will be disabled
* @ingroup Icon
+ *
+ * @deprecated Use elm_image_preload_disabled_set() instead.
+ *
*/
EAPI void elm_icon_preload_disabled_set(Evas_Object *obj, Eina_Bool disabled);
* supports gif animation. If the return value is EINA_FALSE, other
* elm_icon_animated_xxx APIs won't work.
* @ingroup Icon
+ *
+ * @deprecated Use elm_image_animated_available_get() instead.
+ *
*/
EAPI Eina_Bool elm_icon_animated_available_get(const Evas_Object *obj);
* on the icon.
* Set it to EINA_TRUE when the icon needs to be animated.
* @ingroup Icon
+ *
+ * @deprecated Use elm_image_animated_set() instead.
+ *
*/
EAPI void elm_icon_animated_set(Evas_Object *obj, Eina_Bool animated);
* @return The animation mode of the icon object
* @see elm_icon_animated_set
* @ingroup Icon
+ *
+ * @deprecated Use elm_image_animated_get() instead.
+ *
*/
EAPI Eina_Bool elm_icon_animated_get(const Evas_Object *obj);
* 3. If elm icon was playing, set play to EINA_FALSE.
* Then animation will be stopped and vice versa
* @ingroup Icon
+ *
+ * @deprecated Use elm_image_animated_play_set() instead.
+ *
*/
EAPI void elm_icon_animated_play_set(Evas_Object *obj, Eina_Bool play);
*
* @see elm_icon_animated_play_get
* @ingroup Icon
+ *
+ * @deprecated Use elm_image_animated_play_get() instead.
+ *
*/
EAPI Eina_Bool elm_icon_animated_play_get(const Evas_Object *obj);
* @see elm_icon_fill_outside_set()
*
* @ingroup Icon
+ *
+ * @deprecated Use elm_image_aspect_fixed_set() instead.
+ *
*/
-EAPI void elm_icon_aspect_fixed_set(Evas_Object *obj, Eina_Bool fixed);
+EAPI void elm_icon_aspect_fixed_set(Evas_Object *obj, Eina_Bool fixed);
/**
* Get if the object retains the original aspect ratio.
* @return @c EINA_TRUE if the object keeps the original aspect, @c EINA_FALSE
* otherwise.
*
+ * @deprecated Use elm_image_aspect_fixed_get() instead.
+ *
* @ingroup Icon
*/
-EAPI Eina_Bool elm_icon_aspect_fixed_get(const Evas_Object *obj);
+EAPI Eina_Bool elm_icon_aspect_fixed_get(const Evas_Object *obj);
/**
* @}
}
static void
-_unimplemented_smart_callback_add(Evas_Object *obj,
- const char *emission __UNUSED__,
- const char *source __UNUSED__,
- Edje_Signal_Cb func __UNUSED__,
- void *data __UNUSED__)
-{
- WRN("The %s widget does not implement the \"callback_add()\" function.",
- elm_widget_type_get(obj));
-
- return;
-}
-
-static void *
-_unimplemented_smart_callback_del(Evas_Object *obj,
- const char *emission __UNUSED__,
- const char *source __UNUSED__,
- Edje_Signal_Cb func __UNUSED__)
-{
- WRN("The %s widget does not implement the \"callback_del()\" function.",
- elm_widget_type_get(obj));
-
- return NULL;
-}
-
-static void
-_unimplemented_smart_signal(Evas_Object *obj,
- const char *emission __UNUSED__,
- const char *source __UNUSED__)
-{
- WRN("The %s widunadd does not implement the \"signal()\" function.",
- elm_widget_type_get(obj));
-
- return;
-}
-
-static void
_elm_image_smart_set_user(Elm_Image_Smart_Class *sc)
{
ELM_WIDGET_CLASS(sc)->base.add = _elm_image_smart_add;
sc->sizing_eval = _elm_image_smart_sizing_eval;
sc->smooth_scale_get = _elm_image_smart_smooth_scale_get;
sc->smooth_scale_set = _elm_image_smart_smooth_scale_set;
-
- sc->signal = _unimplemented_smart_signal;
- sc->callback_add = _unimplemented_smart_callback_add;
- sc->callback_del = _unimplemented_smart_callback_del;
}
EAPI const Elm_Image_Smart_Class *
void _elm_config_color_set(const char *palette_name, int r, int g, int b, int a);
void _elm_config_colors_free(const char *palette_name);
+/* DEPRECATED, will be removed on next release */
+void _elm_icon_signal_emit(Evas_Object *obj,
+ const char *emission,
+ const char *source);
+void _elm_icon_signal_callback_add(Evas_Object *obj,
+ const char *emission,
+ const char *source,
+ Edje_Signal_Cb func_cb,
+ void *data);
+void *_elm_icon_signal_callback_del(Evas_Object *obj,
+ const char *emission,
+ const char *source,
+ Edje_Signal_Cb func_cb);
+/* end of DEPRECATED */
+
extern char *_elm_appname;
extern Elm_Config *_elm_config;
extern const char *_elm_data_dir;
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_container.h"
-#include "elm_widget_image.h"
static const char SMART_NAME[] = "elm_widget";
static const char SMART_NAME_COMPAT[] = "elm_widget_compat";
COMPAT_SMART_DATA(sd)->signal(obj, emission, source);
else if (evas_object_smart_type_check(obj, "elm_layout"))
elm_layout_signal_emit(obj, emission, source);
- else if (evas_object_smart_type_check(obj, "elm_image"))
- ELM_IMAGE_CLASS(sd->api)->signal(obj, emission, source);
+ else if (evas_object_smart_type_check(obj, "elm_icon"))
+ {
+ WRN("Deprecated function. This functionality on icon objects"
+ " will be dropped on a next release.");
+ _elm_icon_signal_emit(obj, emission, source);
+ }
}
static void
else if (!evas_object_smart_type_check(obj, "elm_layout"))
elm_layout_signal_callback_add(obj, emission, source, func, data);
- else if (evas_object_smart_type_check(obj, "elm_image"))
- ELM_IMAGE_CLASS(sd->api)->callback_add(obj, emission, source, func, data);
+ else if (evas_object_smart_type_check(obj, "elm_icon"))
+ {
+ WRN("Deprecated function. This functionality on icon objects"
+ " will be dropped on a next release.");
+
+ _elm_icon_signal_callback_add(obj, emission, source, func, data);
+ }
}
EAPI void *
COMPAT_SMART_DATA(sd)->callback_del
(obj, emission, source, _edje_signal_callback, esd);
}
-
else if (!evas_object_smart_type_check(obj, "elm_layout"))
elm_layout_signal_callback_del(obj, emission, source, func);
- else if (evas_object_smart_type_check(obj, "elm_image"))
- ELM_IMAGE_CLASS(sd->api)->callback_del(obj, emission, source, func);
+ else if (evas_object_smart_type_check(obj, "elm_icon"))
+ {
+ WRN("Deprecated function. This functionality on icon objects"
+ " will be dropped on a next release.");
+
+ _elm_icon_signal_callback_del(obj, emission, source, func);
+ }
return data;
}
#define ELM_IMAGE_SMART_CLASS_INIT(smart_class_init) \
{smart_class_init, ELM_IMAGE_SMART_CLASS_VERSION, NULL, NULL, NULL, NULL, \
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
/**
* @def ELM_IMAGE_SMART_CLASS_INIT_NULL
int version; /**< Version of this smart class definition */
void (*sizing_eval)(Evas_Object *obj); /* 'Virtual' function on evalutating the object's final geometry */
- void (*signal)(Evas_Object *obj,
- const char *emission,
- const char *source); /* 'Virtual' function on emitting an (Edje) signal to the object, acting on its internal layout */
- void (*callback_add)(Evas_Object *obj,
- const char *emission,
- const char *source,
- Edje_Signal_Cb func,
- void *data); /* 'Virtual' function on adding an (Edje) signal callback to the object, proxyed from its internal layout */
- void *(*callback_del)(Evas_Object * obj,
- const char *emission,
- const char *source,
- Edje_Signal_Cb func); /* 'Virtual' function on deleting an (Edje) signal callback on the object, proxyed from its internal layout */
Eina_Bool (*memfile_set)(Evas_Object *obj,
const void *img,
size_t size,
double scale;
Elm_Image_Orient orient;
- Eina_List *edje_signals;
-
int frame_count;
int cur_frame;
double frame_duration;