2012-07-30 15:36:38 -07:00
|
|
|
#ifndef ELM_WIDGET_ICON_H
|
|
|
|
#define ELM_WIDGET_ICON_H
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
#include "Elementary.h"
|
2012-07-30 15:36:38 -07:00
|
|
|
|
2014-08-07 09:26:47 -07:00
|
|
|
/* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR
|
|
|
|
* CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT
|
|
|
|
* FINAL. CALL elm_widget_api_check(ELM_INTERNAL_API_VERSION) TO CHECK
|
|
|
|
* IT AT RUNTIME.
|
|
|
|
*/
|
|
|
|
|
2012-07-30 15:36:38 -07:00
|
|
|
/**
|
|
|
|
* @addtogroup Widget
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @section elm-icon-class The Elementary Icon Class
|
|
|
|
*
|
|
|
|
* This class defines a common interface for @b icon objects having
|
|
|
|
* an icon as their basic graphics.
|
|
|
|
*/
|
|
|
|
|
2014-03-23 04:35:23 -07:00
|
|
|
typedef struct _Elm_Icon_Data Elm_Icon_Data;
|
|
|
|
struct _Elm_Icon_Data
|
2012-07-30 15:36:38 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *obj; // the object itself
|
2012-07-30 15:36:38 -07:00
|
|
|
const char *stdicon;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
const char *path;
|
|
|
|
const char *key;
|
|
|
|
} file, thumb;
|
|
|
|
|
|
|
|
Ecore_Event_Handler *eeh;
|
|
|
|
|
|
|
|
Ethumb_Thumb_Format format;
|
|
|
|
|
|
|
|
Ethumb_Client_Async *request;
|
|
|
|
|
|
|
|
Eina_Bool retry : 1;
|
|
|
|
} thumb;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int requested_size;
|
|
|
|
Eina_Bool use : 1;
|
|
|
|
} freedesktop;
|
|
|
|
|
|
|
|
int in_eval;
|
|
|
|
|
|
|
|
/* WARNING: to be deprecated */
|
|
|
|
Eina_List *edje_signals;
|
|
|
|
|
|
|
|
Eina_Bool is_video : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define ELM_ICON_DATA_GET(o, sd) \
|
2016-08-15 06:44:41 -07:00
|
|
|
Elm_Icon_Data * sd = efl_data_scope_get(o, ELM_ICON_CLASS)
|
2012-07-30 15:36:38 -07:00
|
|
|
|
|
|
|
#define ELM_ICON_DATA_GET_OR_RETURN(o, ptr) \
|
|
|
|
ELM_ICON_DATA_GET(o, ptr); \
|
2014-01-15 10:33:40 -08:00
|
|
|
if (EINA_UNLIKELY(!ptr)) \
|
2012-07-30 15:36:38 -07:00
|
|
|
{ \
|
2018-01-31 19:16:28 -08:00
|
|
|
ERR("No widget data for object %p (%s)", \
|
2014-01-15 10:33:40 -08:00
|
|
|
o, evas_object_type_get(o)); \
|
2012-07-30 15:36:38 -07:00
|
|
|
return; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define ELM_ICON_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
|
|
|
|
ELM_ICON_DATA_GET(o, ptr); \
|
2014-01-15 10:33:40 -08:00
|
|
|
if (EINA_UNLIKELY(!ptr)) \
|
2012-07-30 15:36:38 -07:00
|
|
|
{ \
|
2018-01-31 19:16:28 -08:00
|
|
|
ERR("No widget data for object %p (%s)", \
|
2014-01-15 10:33:40 -08:00
|
|
|
o, evas_object_type_get(o)); \
|
2012-07-30 15:36:38 -07:00
|
|
|
return val; \
|
|
|
|
}
|
|
|
|
|
2014-01-15 10:33:40 -08:00
|
|
|
#define ELM_ICON_CHECK(obj) \
|
2016-08-15 06:44:41 -07:00
|
|
|
if (EINA_UNLIKELY(!efl_isa((obj), ELM_ICON_CLASS))) \
|
2012-07-30 15:36:38 -07:00
|
|
|
return
|
|
|
|
|
|
|
|
#endif
|