2011-12-29 23:20:48 -08:00
|
|
|
/**
|
|
|
|
* @defgroup Icon Icon
|
2012-04-16 18:35:46 -07:00
|
|
|
* @ingroup Elementary
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
2012-06-05 15:41:21 -07:00
|
|
|
* @image html icon_inheritance_tree.png
|
|
|
|
* @image latex icon_inheritance_tree.eps
|
|
|
|
*
|
2011-12-29 23:20:48 -08:00
|
|
|
* @image html img/widget/icon/preview-00.png
|
|
|
|
* @image latex img/widget/icon/preview-00.eps
|
|
|
|
*
|
2012-05-25 12:53:59 -07:00
|
|
|
* An icon object is used to display standard icon images ("delete",
|
|
|
|
* "edit", "arrows", etc.) or images coming from a custom file (PNG,
|
|
|
|
* JPG, EDJE, etc.), on icon contexts.
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
2012-05-25 12:53:59 -07:00
|
|
|
* The icon image requested can be in the Elementary theme in use, or
|
|
|
|
* in the @c freedesktop.org theme paths. It's possible to set the
|
|
|
|
* order of preference from where an image will be fetched.
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
2012-05-25 12:53:59 -07:00
|
|
|
* This widget inherits from the @ref Image one, so that all the
|
|
|
|
* functions acting on it also work for icon objects.
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
2012-05-28 13:35:35 -07:00
|
|
|
* 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).
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
2012-05-25 12:53:59 -07:00
|
|
|
* Default images provided by Elementary's default theme are described
|
|
|
|
* below.
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
2012-05-25 12:53:59 -07:00
|
|
|
* These are names for icons that were first intended to be used in
|
|
|
|
* toolbars, but can be used in many other places too:
|
|
|
|
* @li @c "home"
|
|
|
|
* @li @c "close"
|
|
|
|
* @li @c "apps"
|
|
|
|
* @li @c "arrow_up"
|
|
|
|
* @li @c "arrow_down"
|
|
|
|
* @li @c "arrow_left"
|
|
|
|
* @li @c "arrow_right"
|
|
|
|
* @li @c "chat"
|
|
|
|
* @li @c "clock"
|
|
|
|
* @li @c "delete"
|
|
|
|
* @li @c "edit"
|
|
|
|
* @li @c "refresh"
|
|
|
|
* @li @c "folder"
|
|
|
|
* @li @c "file"
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
2012-05-25 12:53:59 -07:00
|
|
|
* These are names for icons that were designed to be used in menus
|
|
|
|
* (but again, you can use them anywhere else):
|
|
|
|
* @li @c "menu/home"
|
|
|
|
* @li @c "menu/close"
|
|
|
|
* @li @c "menu/apps"
|
|
|
|
* @li @c "menu/arrow_up"
|
|
|
|
* @li @c "menu/arrow_down"
|
|
|
|
* @li @c "menu/arrow_left"
|
|
|
|
* @li @c "menu/arrow_right"
|
|
|
|
* @li @c "menu/chat"
|
|
|
|
* @li @c "menu/clock"
|
|
|
|
* @li @c "menu/delete"
|
|
|
|
* @li @c "menu/edit"
|
|
|
|
* @li @c "menu/refresh"
|
|
|
|
* @li @c "menu/folder"
|
|
|
|
* @li @c "menu/file"
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
2012-05-25 12:53:59 -07:00
|
|
|
* And these are names for some media player specific icons:
|
|
|
|
* @li @c "media_player/forward"
|
|
|
|
* @li @c "media_player/info"
|
|
|
|
* @li @c "media_player/next"
|
|
|
|
* @li @c "media_player/pause"
|
|
|
|
* @li @c "media_player/play"
|
|
|
|
* @li @c "media_player/prev"
|
|
|
|
* @li @c "media_player/rewind"
|
|
|
|
* @li @c "media_player/stop"
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
2012-05-25 12:53:59 -07:00
|
|
|
* This widget emits the following signals, besides the ones sent from
|
|
|
|
* @ref Image:
|
|
|
|
* - @c "thumb,done" - elm_icon_thumb_set() has completed with success
|
2012-07-09 03:20:21 -07:00
|
|
|
* (@since 1.7)
|
|
|
|
* - @c "thumb,error" - elm_icon_thumb_set() has failed (@since 1.7)
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
2012-05-28 13:35:35 -07:00
|
|
|
* 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.
|
2012-01-08 22:55:51 -08:00
|
|
|
*
|
2011-12-29 23:20:48 -08:00
|
|
|
* An example of usage for this API follows:
|
|
|
|
* @li @ref tutorial_icon
|
|
|
|
*/
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
#define ELM_OBJ_ICON_CLASS elm_obj_icon_class_get()
|
|
|
|
|
|
|
|
const Eo_Class *elm_obj_icon_class_get(void) EINA_CONST;
|
|
|
|
|
|
|
|
extern EAPI Eo_Op ELM_OBJ_ICON_BASE_ID;
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
ELM_OBJ_ICON_SUB_ID_THUMB_SET,
|
|
|
|
ELM_OBJ_ICON_SUB_ID_STANDARD_SET,
|
|
|
|
ELM_OBJ_ICON_SUB_ID_STANDARD_GET,
|
|
|
|
ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_SET,
|
|
|
|
ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_GET,
|
|
|
|
ELM_OBJ_ICON_SUB_ID_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
#define ELM_OBJ_ICON_ID(sub_id) (ELM_OBJ_ICON_BASE_ID + sub_id)
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def elm_obj_icon_thumb_set
|
|
|
|
* @since 1.8
|
|
|
|
*
|
|
|
|
* Set the file that will be used, but use a generated thumbnail.
|
|
|
|
*
|
|
|
|
* @param[in] file
|
|
|
|
* @param[in] group
|
|
|
|
*
|
|
|
|
* @see elm_icon_thumb_set
|
|
|
|
*/
|
|
|
|
#define elm_obj_icon_thumb_set(file, group) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_THUMB_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(const char *, group)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def elm_obj_icon_standard_set
|
|
|
|
* @since 1.8
|
|
|
|
*
|
|
|
|
* Set the icon by icon standards names.
|
|
|
|
*
|
|
|
|
* @param[in] name
|
|
|
|
* @param[out] ret
|
|
|
|
*
|
|
|
|
* @see elm_icon_standard_set
|
|
|
|
*/
|
|
|
|
#define elm_obj_icon_standard_set(name, ret) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_STANDARD_SET), EO_TYPECHECK(const char *, name), EO_TYPECHECK(Eina_Bool *, ret)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def elm_obj_icon_standard_get
|
|
|
|
* @since 1.8
|
|
|
|
*
|
|
|
|
* Get the icon name set by icon standard names.
|
|
|
|
*
|
|
|
|
* @param[out] ret
|
|
|
|
*
|
|
|
|
* @see elm_icon_standard_get
|
|
|
|
*/
|
|
|
|
#define elm_obj_icon_standard_get(ret) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_STANDARD_GET), EO_TYPECHECK(const char **, ret)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def elm_obj_icon_order_lookup_set
|
|
|
|
* @since 1.8
|
|
|
|
*
|
|
|
|
* Sets the icon lookup order used by elm_icon_standard_set().
|
|
|
|
*
|
|
|
|
* @param[in] order
|
|
|
|
*
|
|
|
|
* @see elm_icon_order_lookup_set
|
|
|
|
*/
|
|
|
|
#define elm_obj_icon_order_lookup_set(order) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_SET), EO_TYPECHECK(Elm_Icon_Lookup_Order, order)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def elm_obj_icon_order_lookup_get
|
|
|
|
* @since 1.8
|
|
|
|
*
|
|
|
|
* Gets the icon lookup order.
|
|
|
|
*
|
|
|
|
* @param[out] ret
|
|
|
|
*
|
|
|
|
* @see elm_icon_order_lookup_get
|
|
|
|
*/
|
|
|
|
#define elm_obj_icon_order_lookup_get(ret) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_GET), EO_TYPECHECK(Elm_Icon_Lookup_Order *, ret)
|
|
|
|
|
|
|
|
|
2011-12-29 23:20:48 -08:00
|
|
|
/**
|
|
|
|
* @addtogroup Icon
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2011-12-30 01:41:11 -08:00
|
|
|
typedef enum
|
2011-12-29 23:20:48 -08:00
|
|
|
{
|
|
|
|
ELM_ICON_NONE,
|
|
|
|
ELM_ICON_FILE,
|
|
|
|
ELM_ICON_STANDARD
|
|
|
|
} Elm_Icon_Type;
|
|
|
|
|
|
|
|
/**
|
2012-04-27 05:55:21 -07:00
|
|
|
* @enum Elm_Icon_Lookup_Order
|
2011-12-29 23:20:48 -08:00
|
|
|
* @typedef Elm_Icon_Lookup_Order
|
|
|
|
*
|
|
|
|
* Lookup order used by elm_icon_standard_set(). Should look for icons in the
|
|
|
|
* theme, FDO paths, or both?
|
|
|
|
*
|
|
|
|
* @ingroup Icon
|
|
|
|
*/
|
2011-12-30 01:41:11 -08:00
|
|
|
typedef enum
|
2011-12-29 23:20:48 -08:00
|
|
|
{
|
|
|
|
ELM_ICON_LOOKUP_FDO_THEME, /**< icon look up order: freedesktop, theme */
|
|
|
|
ELM_ICON_LOOKUP_THEME_FDO, /**< icon look up order: theme, freedesktop */
|
|
|
|
ELM_ICON_LOOKUP_FDO, /**< icon look up order: freedesktop */
|
|
|
|
ELM_ICON_LOOKUP_THEME /**< icon look up order: theme */
|
|
|
|
} Elm_Icon_Lookup_Order;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a new icon object to the parent.
|
|
|
|
*
|
|
|
|
* @param parent The parent object
|
|
|
|
* @return The new object or NULL if it cannot be created
|
|
|
|
*
|
2012-06-07 04:40:54 -07:00
|
|
|
* @see elm_image_file_set()
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
|
|
|
* @ingroup Icon
|
|
|
|
*/
|
2011-12-30 01:48:46 -08:00
|
|
|
EAPI Evas_Object *elm_icon_add(Evas_Object *parent);
|
2011-12-29 23:20:48 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the file that will be used, but use a generated thumbnail.
|
|
|
|
*
|
|
|
|
* @param obj The icon object
|
|
|
|
* @param file The path to file that will be used as icon image
|
|
|
|
* @param group The group that the icon belongs to an edje file
|
|
|
|
*
|
2012-06-07 04:40:54 -07:00
|
|
|
* This functions like elm_image_file_set() but requires the Ethumb library
|
2011-12-29 23:20:48 -08:00
|
|
|
* support to be enabled successfully with elm_need_ethumb(). When set
|
|
|
|
* the file indicated has a thumbnail generated and cached on disk for
|
|
|
|
* future use or will directly use an existing cached thumbnail if it
|
|
|
|
* is valid.
|
|
|
|
*
|
2012-06-07 04:40:54 -07:00
|
|
|
* @see elm_image_file_set()
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
|
|
|
* @ingroup Icon
|
|
|
|
*/
|
2011-12-30 01:48:46 -08:00
|
|
|
EAPI void elm_icon_thumb_set(Evas_Object *obj, const char *file, const char *group);
|
2011-12-29 23:20:48 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the icon by icon standards names.
|
|
|
|
*
|
|
|
|
* @param obj The icon object
|
|
|
|
* @param name The icon name
|
|
|
|
*
|
|
|
|
* @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
|
|
|
|
*
|
|
|
|
* For example, freedesktop.org defines standard icon names such as "home",
|
|
|
|
* "network", etc. There can be different icon sets to match those icon
|
|
|
|
* keys. The @p name given as parameter is one of these "keys", and will be
|
|
|
|
* used to look in the freedesktop.org paths and elementary theme. One can
|
|
|
|
* change the lookup order with elm_icon_order_lookup_set().
|
|
|
|
*
|
|
|
|
* If name is not found in any of the expected locations and it is the
|
|
|
|
* absolute path of an image file, this image will be used.
|
|
|
|
*
|
|
|
|
* @note The icon image set by this function can be changed by
|
2012-06-07 04:40:54 -07:00
|
|
|
* elm_image_file_set().
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
2013-03-11 04:44:27 -07:00
|
|
|
* @note This function does not accept relative icon path.
|
|
|
|
*
|
2011-12-29 23:20:48 -08:00
|
|
|
* @see elm_icon_standard_get()
|
2012-06-07 04:40:54 -07:00
|
|
|
* @see elm_image_file_set()
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
|
|
|
* @ingroup Icon
|
|
|
|
*/
|
2011-12-30 01:48:46 -08:00
|
|
|
EAPI Eina_Bool elm_icon_standard_set(Evas_Object *obj, const char *name);
|
2011-12-29 23:20:48 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the icon name set by icon standard names.
|
|
|
|
*
|
|
|
|
* @param obj The icon object
|
|
|
|
* @return The icon name
|
|
|
|
*
|
2012-06-07 04:40:54 -07:00
|
|
|
* If the icon image was set using elm_image_file_set() instead of
|
2011-12-29 23:20:48 -08:00
|
|
|
* elm_icon_standard_set(), then this function will return @c NULL.
|
|
|
|
*
|
|
|
|
* @see elm_icon_standard_set()
|
|
|
|
*
|
|
|
|
* @ingroup Icon
|
|
|
|
*/
|
2011-12-30 01:48:46 -08:00
|
|
|
EAPI const char *elm_icon_standard_get(const Evas_Object *obj);
|
2011-12-29 23:20:48 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the icon lookup order used by elm_icon_standard_set().
|
|
|
|
*
|
|
|
|
* @param obj The icon object
|
|
|
|
* @param order The icon lookup order (can be one of
|
|
|
|
* ELM_ICON_LOOKUP_FDO_THEME, ELM_ICON_LOOKUP_THEME_FDO, ELM_ICON_LOOKUP_FDO
|
|
|
|
* or ELM_ICON_LOOKUP_THEME)
|
|
|
|
*
|
|
|
|
* @see elm_icon_order_lookup_get()
|
|
|
|
* @see Elm_Icon_Lookup_Order
|
|
|
|
*
|
|
|
|
* @ingroup Icon
|
|
|
|
*/
|
2011-12-30 01:48:46 -08:00
|
|
|
EAPI void elm_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order);
|
2011-12-29 23:20:48 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the icon lookup order.
|
|
|
|
*
|
|
|
|
* @param obj The icon object
|
|
|
|
* @return The icon lookup order
|
|
|
|
*
|
|
|
|
* @see elm_icon_order_lookup_set()
|
|
|
|
* @see Elm_Icon_Lookup_Order
|
|
|
|
*
|
|
|
|
* @ingroup Icon
|
|
|
|
*/
|
2011-12-30 01:48:46 -08:00
|
|
|
EAPI Elm_Icon_Lookup_Order elm_icon_order_lookup_get(const Evas_Object *obj);
|
2011-12-29 23:20:48 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|