2017-02-07 13:36:40 -08:00
|
|
|
#ifndef EFL_UI_WIDGET_IMAGE_H
|
|
|
|
#define EFL_UI_WIDGET_IMAGE_H
|
2012-05-25 12:53:59 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
#include "Elementary.h"
|
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
|
2015-09-03 21:39:26 -07:00
|
|
|
typedef enum
|
|
|
|
{
|
2016-05-31 03:38:21 -07:00
|
|
|
EFL_UI_IMAGE_PRELOAD_ENABLED,
|
|
|
|
EFL_UI_IMAGE_PRELOADING,
|
|
|
|
EFL_UI_IMAGE_PRELOADED,
|
|
|
|
EFL_UI_IMAGE_PRELOAD_DISABLED
|
|
|
|
} Efl_Ui_Image_Preload_Status;
|
2015-04-09 01:09:53 -07:00
|
|
|
|
2012-05-25 12:53:59 -07:00
|
|
|
/**
|
|
|
|
* @addtogroup Widget
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @section elm-image-class The Elementary Image Class
|
|
|
|
*
|
|
|
|
* This class defines a common interface for @b image objects having
|
|
|
|
* an image as their basic graphics. This interface is so that one can
|
|
|
|
* tune various properties of the image, like:
|
|
|
|
* - smooth scaling,
|
|
|
|
* - orientation,
|
|
|
|
* - aspect ratio during resizes, etc.
|
|
|
|
*
|
|
|
|
* Image files may be set via memory buffers, image files, EET files
|
|
|
|
* with image data or Edje files. On the last case (which is
|
|
|
|
* exceptional), most of the properties cited above will @b not be
|
|
|
|
* changeable anymore.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Base widget smart data extended with image instance data.
|
|
|
|
*/
|
2016-05-31 03:38:21 -07:00
|
|
|
typedef struct _Efl_Ui_Image_Data Efl_Ui_Image_Data;
|
|
|
|
struct _Efl_Ui_Image_Data
|
2012-05-25 12:53:59 -07:00
|
|
|
{
|
2016-09-07 11:42:29 -07:00
|
|
|
Eo *self;
|
2012-11-27 01:29:16 -08:00
|
|
|
Evas_Object *hit_rect;
|
2012-05-25 12:53:59 -07:00
|
|
|
Evas_Object *img;
|
|
|
|
Evas_Object *prev_img;
|
2013-08-09 03:00:16 -07:00
|
|
|
Ecore_Timer *anim_timer;
|
|
|
|
|
2016-11-22 07:24:16 -08:00
|
|
|
struct {
|
|
|
|
Eo *copier;
|
|
|
|
Eina_Binbuf *binbuf;
|
|
|
|
const char *key;
|
|
|
|
} remote;
|
2013-08-09 05:12:29 -07:00
|
|
|
|
2013-08-09 03:00:16 -07:00
|
|
|
double scale;
|
|
|
|
double frame_duration;
|
2016-05-27 04:58:25 -07:00
|
|
|
double align_x, align_y;
|
2012-05-25 12:53:59 -07:00
|
|
|
|
|
|
|
Evas_Coord img_x, img_y, img_w, img_h;
|
|
|
|
|
2017-12-18 00:33:49 -08:00
|
|
|
Eina_Size2D load_size;
|
2012-05-28 13:35:29 -07:00
|
|
|
int frame_count;
|
|
|
|
int cur_frame;
|
2013-08-09 03:00:16 -07:00
|
|
|
|
2016-04-05 18:46:04 -07:00
|
|
|
Elm_Image_Orient image_orient; // to support EAPI
|
2019-05-22 11:16:16 -07:00
|
|
|
Efl_Gfx_Image_Orientation orient;
|
2012-05-28 13:35:29 -07:00
|
|
|
|
2015-03-30 19:58:10 -07:00
|
|
|
struct {
|
|
|
|
Ecore_Thread *th;
|
2015-04-09 01:09:53 -07:00
|
|
|
Eina_Stringshare *file, *key; // only for file_get()
|
2016-09-07 23:00:22 -07:00
|
|
|
void *todo; // opaque internal
|
2015-03-30 19:58:10 -07:00
|
|
|
} async;
|
|
|
|
|
2016-05-31 03:38:21 -07:00
|
|
|
Efl_Ui_Image_Preload_Status preload_status;
|
2018-04-19 04:26:59 -07:00
|
|
|
Efl_Gfx_Image_Scale_Type scale_type;
|
2015-09-03 21:39:26 -07:00
|
|
|
|
2016-04-27 06:35:23 -07:00
|
|
|
const char *stdicon;
|
|
|
|
|
2018-01-26 11:37:00 -08:00
|
|
|
struct {
|
|
|
|
Eina_Stringshare *file;
|
|
|
|
Eina_Stringshare *key;
|
|
|
|
|
|
|
|
Eina_Bool icon : 1;
|
|
|
|
} property;
|
2016-04-27 06:35:23 -07:00
|
|
|
|
|
|
|
struct {
|
|
|
|
int requested_size;
|
|
|
|
Eina_Bool use : 1;
|
|
|
|
} freedesktop;
|
|
|
|
|
2012-05-25 12:53:59 -07:00
|
|
|
Eina_Bool aspect_fixed : 1;
|
|
|
|
Eina_Bool fill_inside : 1;
|
|
|
|
Eina_Bool no_scale : 1;
|
|
|
|
Eina_Bool smooth : 1;
|
|
|
|
Eina_Bool show : 1;
|
|
|
|
Eina_Bool edit : 1;
|
|
|
|
Eina_Bool edje : 1;
|
2012-05-28 13:35:29 -07:00
|
|
|
Eina_Bool anim : 1;
|
|
|
|
Eina_Bool play : 1;
|
2015-03-30 19:58:10 -07:00
|
|
|
Eina_Bool async_enable : 1;
|
2016-05-11 21:25:13 -07:00
|
|
|
Eina_Bool scale_up : 1;
|
|
|
|
Eina_Bool scale_down : 1;
|
2017-07-06 00:14:06 -07:00
|
|
|
Eina_Bool legacy_align : 1;
|
2019-07-10 17:56:20 -07:00
|
|
|
Eina_Bool property_watch : 1;
|
2012-05-25 12:53:59 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
2016-05-31 03:38:21 -07:00
|
|
|
#define EFL_UI_IMAGE_DATA_GET(o, sd) \
|
2016-08-15 06:44:41 -07:00
|
|
|
Efl_Ui_Image_Data * sd = efl_data_scope_get(o, EFL_UI_IMAGE_CLASS)
|
2012-07-30 15:36:19 -07:00
|
|
|
|
2016-05-31 03:38:21 -07:00
|
|
|
#define EFL_UI_IMAGE_DATA_GET_OR_RETURN(o, ptr) \
|
|
|
|
EFL_UI_IMAGE_DATA_GET(o, ptr); \
|
2014-01-15 10:33:40 -08:00
|
|
|
if (EINA_UNLIKELY(!ptr)) \
|
2012-07-30 15:36:19 -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:19 -07:00
|
|
|
return; \
|
|
|
|
}
|
|
|
|
|
2016-05-31 03:38:21 -07:00
|
|
|
#define EFL_UI_IMAGE_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
|
|
|
|
EFL_UI_IMAGE_DATA_GET(o, ptr); \
|
2014-01-15 10:33:40 -08:00
|
|
|
if (EINA_UNLIKELY(!ptr)) \
|
2012-07-30 15:36:19 -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:19 -07:00
|
|
|
return val; \
|
|
|
|
}
|
|
|
|
|
2016-05-31 03:38:21 -07:00
|
|
|
#define EFL_UI_IMAGE_CHECK(obj) \
|
2016-08-15 06:44:41 -07:00
|
|
|
if (EINA_UNLIKELY(!efl_isa((obj), EFL_UI_IMAGE_CLASS))) \
|
2012-07-30 15:36:19 -07:00
|
|
|
return
|
|
|
|
|
2012-05-25 12:53:59 -07:00
|
|
|
#endif
|