2012-07-30 15:36:06 -07:00
|
|
|
#ifndef ELM_WIDGET_PHOTOCAM_H
|
|
|
|
#define ELM_WIDGET_PHOTOCAM_H
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
#include "Elementary.h"
|
2012-07-30 15:36:06 -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:06 -07:00
|
|
|
/**
|
|
|
|
* @addtogroup Widget
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @section elm-photocam-class The Elementary Photocam Class
|
|
|
|
*
|
|
|
|
* Elementary, besides having the @ref Photocam widget, exposes its
|
|
|
|
* foundation -- the Elementary Photocam Class -- in order to create
|
|
|
|
* other widgets which are a photocam with some more logic on top.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Base widget smart data extended with photocam instance data.
|
|
|
|
*/
|
2014-03-25 01:49:47 -07:00
|
|
|
typedef struct _Elm_Photocam_Data Elm_Photocam_Data;
|
|
|
|
typedef struct _Elm_Photocam_Pan_Data Elm_Photocam_Pan_Data;
|
2012-07-30 15:36:06 -07:00
|
|
|
typedef struct _Elm_Phocam_Grid Elm_Phocam_Grid;
|
|
|
|
typedef struct _Elm_Photocam_Grid_Item Elm_Photocam_Grid_Item;
|
|
|
|
|
|
|
|
struct _Elm_Photocam_Grid_Item
|
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *obj;
|
2014-03-25 01:49:47 -07:00
|
|
|
Elm_Photocam_Data *sd;
|
2012-07-30 15:36:06 -07:00
|
|
|
Evas_Object *img;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int x, y, w, h;
|
|
|
|
} src, out;
|
|
|
|
|
|
|
|
Eina_Bool want : 1;
|
|
|
|
Eina_Bool have : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Elm_Phocam_Grid
|
|
|
|
{
|
|
|
|
int tsize; /* size of tile (tsize x tsize pixels) */
|
|
|
|
int zoom; /* zoom level tiles want for optimal
|
|
|
|
* display (1, 2, 4, 8) */
|
|
|
|
int iw, ih; /* size of image in pixels */
|
|
|
|
int w, h; /* size of grid image in pixels
|
|
|
|
* (represented by grid) */
|
|
|
|
int gw, gh; /* size of grid in tiles */
|
|
|
|
Elm_Photocam_Grid_Item *grid; /* the grid (gw * gh items) */
|
|
|
|
Eina_Bool dead : 1; /* old grid. will die as soon as anim is
|
|
|
|
* over */
|
|
|
|
};
|
|
|
|
|
2014-03-25 01:49:47 -07:00
|
|
|
struct _Elm_Photocam_Data
|
2012-07-30 15:36:06 -07:00
|
|
|
{
|
|
|
|
Evas_Object *hit_rect;
|
|
|
|
Evas_Object *g_layer;
|
|
|
|
|
|
|
|
Evas_Object *pan_obj;
|
|
|
|
|
|
|
|
Evas_Coord pan_x, pan_y, minw, minh;
|
|
|
|
|
|
|
|
double g_layer_start;
|
|
|
|
double zoom;
|
|
|
|
Elm_Photocam_Zoom_Mode mode;
|
|
|
|
Evas_Coord pvx, pvy, px, py, zoom_point_x,
|
|
|
|
zoom_point_y;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int imx, imy;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int x_start, y_start;
|
|
|
|
int x_end, y_end;
|
|
|
|
double t_start;
|
|
|
|
double t_end;
|
|
|
|
} bounce;
|
|
|
|
} g_layer_zoom;
|
|
|
|
|
|
|
|
const char *file;
|
2013-08-11 20:14:45 -07:00
|
|
|
Eina_File *f;
|
|
|
|
|
|
|
|
Elm_Url *remote;
|
|
|
|
void *remote_data;
|
2012-07-30 15:36:06 -07:00
|
|
|
|
|
|
|
Ecore_Job *calc_job;
|
|
|
|
Ecore_Timer *scr_timer;
|
|
|
|
Ecore_Timer *long_timer;
|
|
|
|
double t_start, t_end;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int imw, imh;
|
|
|
|
int w, h;
|
|
|
|
int ow, oh, nw, nh;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
double x, y;
|
|
|
|
} spos;
|
|
|
|
} size;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
Eina_Bool show : 1;
|
|
|
|
Evas_Coord x, y, w, h;
|
|
|
|
} show;
|
|
|
|
|
|
|
|
int tsize;
|
|
|
|
Evas_Object *img; /* low res version of image (scale down == 8) */
|
|
|
|
int no_smooth;
|
|
|
|
int preload_num;
|
|
|
|
|
|
|
|
Eina_List *grids;
|
2015-02-20 05:33:04 -08:00
|
|
|
Evas_Image_Orient orient; /**< This stores the current orientation of Photocam. By default this is set to EVAS_IMAGE_ORIENT_NONE */
|
2012-07-30 15:36:06 -07:00
|
|
|
|
|
|
|
Eina_Bool main_load_pending : 1;
|
|
|
|
Eina_Bool longpressed : 1;
|
|
|
|
Eina_Bool do_gesture : 1;
|
|
|
|
Eina_Bool do_region : 1;
|
|
|
|
Eina_Bool zoom_g_layer : 1;
|
|
|
|
Eina_Bool resized : 1;
|
|
|
|
Eina_Bool on_hold : 1;
|
|
|
|
Eina_Bool paused : 1;
|
2015-04-21 21:24:19 -07:00
|
|
|
Eina_Bool orientation_changed : 1;
|
2012-07-30 15:36:06 -07:00
|
|
|
};
|
|
|
|
|
2014-03-25 01:49:47 -07:00
|
|
|
struct _Elm_Photocam_Pan_Data
|
2012-07-30 15:36:06 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *wobj;
|
2014-03-25 01:49:47 -07:00
|
|
|
Elm_Photocam_Data *wsd;
|
2012-07-30 15:36:06 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define ELM_PHOTOCAM_DATA_GET(o, sd) \
|
2014-06-03 03:35:28 -07:00
|
|
|
Elm_Photocam_Data * sd = eo_data_scope_get(o, ELM_PHOTOCAM_CLASS)
|
2012-07-30 15:36:06 -07:00
|
|
|
|
|
|
|
#define ELM_PHOTOCAM_PAN_DATA_GET(o, sd) \
|
2014-06-03 03:35:28 -07:00
|
|
|
Elm_Photocam_Pan_Data * sd = eo_data_scope_get(o, ELM_PHOTOCAM_PAN_CLASS)
|
2012-07-30 15:36:06 -07:00
|
|
|
|
|
|
|
#define ELM_PHOTOCAM_DATA_GET_OR_RETURN(o, ptr) \
|
|
|
|
ELM_PHOTOCAM_DATA_GET(o, ptr); \
|
2014-01-15 10:33:40 -08:00
|
|
|
if (EINA_UNLIKELY(!ptr)) \
|
2012-07-30 15:36:06 -07:00
|
|
|
{ \
|
2014-01-15 10:33:40 -08:00
|
|
|
CRI("No widget data for object %p (%s)", \
|
|
|
|
o, evas_object_type_get(o)); \
|
2012-07-30 15:36:06 -07:00
|
|
|
return; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define ELM_PHOTOCAM_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
|
|
|
|
ELM_PHOTOCAM_DATA_GET(o, ptr); \
|
2014-01-15 10:33:40 -08:00
|
|
|
if (EINA_UNLIKELY(!ptr)) \
|
2012-07-30 15:36:06 -07:00
|
|
|
{ \
|
2014-01-15 10:33:40 -08:00
|
|
|
CRI("No widget data for object %p (%s)", \
|
|
|
|
o, evas_object_type_get(o)); \
|
2012-07-30 15:36:06 -07:00
|
|
|
return val; \
|
|
|
|
}
|
|
|
|
|
2014-01-15 10:33:40 -08:00
|
|
|
#define ELM_PHOTOCAM_CHECK(obj) \
|
2014-06-03 03:35:28 -07:00
|
|
|
if (EINA_UNLIKELY(!eo_isa((obj), ELM_PHOTOCAM_CLASS))) \
|
2012-07-30 15:36:06 -07:00
|
|
|
return
|
|
|
|
|
|
|
|
#endif
|