forked from enlightenment/efl
Eolian: Integration of Photocam and Photocam Pan
This commit is contained in:
parent
308320ae7d
commit
0112a19293
|
@ -618,7 +618,11 @@ BUILT_SOURCES = \
|
|||
elm_notify.eo.c \
|
||||
elm_notify.eo.h \
|
||||
elm_panes.eo.c \
|
||||
elm_panes.eo.h
|
||||
elm_panes.eo.h \
|
||||
elm_photocam.eo.c \
|
||||
elm_photocam.eo.h \
|
||||
elm_photocam_pan.eo.c \
|
||||
elm_photocam_pan.eo.h
|
||||
|
||||
EXTRA_DIST += \
|
||||
elm_widget.eo \
|
||||
|
@ -667,7 +671,9 @@ EXTRA_DIST += \
|
|||
elm_panel.eo \
|
||||
elm_mapbuf.eo \
|
||||
elm_notify.eo \
|
||||
elm_panes.eo
|
||||
elm_panes.eo \
|
||||
elm_photocam.eo \
|
||||
elm_photocam_pan.eo
|
||||
|
||||
nodist_includesunstable_HEADERS = \
|
||||
elm_widget.eo.h \
|
||||
|
@ -716,5 +722,7 @@ nodist_includesunstable_HEADERS = \
|
|||
elm_panel.eo.h \
|
||||
elm_mapbuf.eo.h \
|
||||
elm_notify.eo.h \
|
||||
elm_panes.eo.h
|
||||
elm_panes.eo.h \
|
||||
elm_photocam.eo.h \
|
||||
elm_photocam_pan.eo.h
|
||||
|
||||
|
|
|
@ -8,15 +8,11 @@
|
|||
#include "elm_widget_photocam.h"
|
||||
#include "elm_interface_scrollable.h"
|
||||
|
||||
EAPI Eo_Op ELM_OBJ_PHOTOCAM_PAN_BASE_ID = EO_NOOP;
|
||||
|
||||
#define MY_PAN_CLASS ELM_OBJ_PHOTOCAM_PAN_CLASS
|
||||
|
||||
#define MY_PAN_CLASS_NAME "Elm_Photocam_Pan"
|
||||
#define MY_PAN_CLASS_NAME_LEGACY "elm_photocam_pan"
|
||||
|
||||
EAPI Eo_Op ELM_OBJ_PHOTOCAM_BASE_ID = EO_NOOP;
|
||||
|
||||
#define MY_CLASS ELM_OBJ_PHOTOCAM_CLASS
|
||||
|
||||
#define MY_CLASS_NAME "Elm_Photocam"
|
||||
|
@ -78,7 +74,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
|||
};
|
||||
|
||||
static inline void
|
||||
_photocam_image_file_set(Evas_Object *obj, Elm_Photocam_Smart_Data *sd)
|
||||
_photocam_image_file_set(Evas_Object *obj, Elm_Photocam_Data *sd)
|
||||
{
|
||||
if (sd->f)
|
||||
evas_object_image_mmap_set(obj, sd->f, NULL);
|
||||
|
@ -129,26 +125,18 @@ _calc_job_cb(void *data)
|
|||
evas_object_smart_changed(sd->pan_obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_photocam_pan_smart_move(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
||||
EOLIAN static void
|
||||
_elm_photocam_pan_evas_smart_move(Eo *obj EINA_UNUSED, Elm_Photocam_Pan_Data *psd, Evas_Coord x EINA_UNUSED, Evas_Coord y EINA_UNUSED)
|
||||
{
|
||||
Elm_Photocam_Pan_Smart_Data *psd = _pd;
|
||||
va_arg(*list, Evas_Coord);
|
||||
va_arg(*list, Evas_Coord);
|
||||
|
||||
ecore_job_del(psd->wsd->calc_job);
|
||||
psd->wsd->calc_job = ecore_job_add(_calc_job_cb, psd->wobj);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_photocam_pan_smart_resize(Eo *obj, void *_pd, va_list *list)
|
||||
EOLIAN static void
|
||||
_elm_photocam_pan_evas_smart_resize(Eo *obj, Elm_Photocam_Pan_Data *psd, Evas_Coord w, Evas_Coord h)
|
||||
{
|
||||
Evas_Coord w = va_arg(*list, Evas_Coord);
|
||||
Evas_Coord h = va_arg(*list, Evas_Coord);
|
||||
Evas_Coord ow, oh;
|
||||
|
||||
Elm_Photocam_Pan_Smart_Data *psd = _pd;
|
||||
|
||||
evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
|
||||
if ((ow == w) && (oh == h)) return;
|
||||
|
||||
|
@ -337,14 +325,13 @@ _grid_place(Evas_Object *obj,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_photocam_pan_smart_calculate(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
||||
EOLIAN static void
|
||||
_elm_photocam_pan_evas_smart_calculate(Eo *obj, Elm_Photocam_Pan_Data *psd)
|
||||
{
|
||||
Elm_Phocam_Grid *g;
|
||||
Eina_List *l;
|
||||
Evas_Coord ox, oy, ow, oh;
|
||||
|
||||
Elm_Photocam_Pan_Smart_Data *psd = _pd;
|
||||
ELM_WIDGET_DATA_GET_OR_RETURN(psd->wobj, wd);
|
||||
|
||||
evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
|
||||
|
@ -363,37 +350,26 @@ _elm_photocam_pan_smart_calculate(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_photocam_pan_smart_pos_set(Eo *obj, void *_pd, va_list *list)
|
||||
EOLIAN static void
|
||||
_elm_photocam_pan_elm_pan_pos_set(Eo *obj, Elm_Photocam_Pan_Data *psd, Evas_Coord x, Evas_Coord y)
|
||||
{
|
||||
Evas_Coord x = va_arg(*list, Evas_Coord);
|
||||
Evas_Coord y = va_arg(*list, Evas_Coord);
|
||||
Elm_Photocam_Pan_Smart_Data *psd = _pd;
|
||||
|
||||
if ((x == psd->wsd->pan_x) && (y == psd->wsd->pan_y)) return;
|
||||
psd->wsd->pan_x = x;
|
||||
psd->wsd->pan_y = y;
|
||||
evas_object_smart_changed(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_photocam_pan_smart_pos_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
||||
EOLIAN static void
|
||||
_elm_photocam_pan_elm_pan_pos_get(Eo *obj EINA_UNUSED, Elm_Photocam_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y)
|
||||
{
|
||||
Evas_Coord *x = va_arg(*list, Evas_Coord *);
|
||||
Evas_Coord *y = va_arg(*list, Evas_Coord *);
|
||||
Elm_Photocam_Pan_Smart_Data *psd = _pd;
|
||||
|
||||
if (x) *x = psd->wsd->pan_x;
|
||||
if (y) *y = psd->wsd->pan_y;
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_photocam_pan_smart_pos_max_get(Eo *obj, void *_pd, va_list *list)
|
||||
EOLIAN static void
|
||||
_elm_photocam_pan_elm_pan_pos_max_get(Eo *obj, Elm_Photocam_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y)
|
||||
{
|
||||
Evas_Coord ow, oh;
|
||||
Evas_Coord *x = va_arg(*list, Evas_Coord *);
|
||||
Evas_Coord *y = va_arg(*list, Evas_Coord *);
|
||||
Elm_Photocam_Pan_Smart_Data *psd = _pd;
|
||||
|
||||
evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
|
||||
ow = psd->wsd->minw - ow;
|
||||
|
@ -404,67 +380,34 @@ _elm_photocam_pan_smart_pos_max_get(Eo *obj, void *_pd, va_list *list)
|
|||
if (y) *y = oh;
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_photocam_pan_smart_pos_min_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
|
||||
EOLIAN static void
|
||||
_elm_photocam_pan_elm_pan_pos_min_get(Eo *obj EINA_UNUSED, Elm_Photocam_Pan_Data *_pd EINA_UNUSED, Evas_Coord *x, Evas_Coord *y)
|
||||
{
|
||||
Evas_Coord *x = va_arg(*list, Evas_Coord *);
|
||||
Evas_Coord *y = va_arg(*list, Evas_Coord *);
|
||||
if (x) *x = 0;
|
||||
if (y) *y = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_photocam_pan_smart_content_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
||||
EOLIAN static void
|
||||
_elm_photocam_pan_elm_pan_content_size_get(Eo *obj EINA_UNUSED, Elm_Photocam_Pan_Data *psd, Evas_Coord *w, Evas_Coord *h)
|
||||
{
|
||||
Evas_Coord *w = va_arg(*list, Evas_Coord *);
|
||||
Evas_Coord *h = va_arg(*list, Evas_Coord *);
|
||||
Elm_Photocam_Pan_Smart_Data *psd = _pd;
|
||||
|
||||
if (w) *w = psd->wsd->minw;
|
||||
if (h) *h = psd->wsd->minh;
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_photocam_pan_destructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
||||
EOLIAN static void
|
||||
_elm_photocam_pan_eo_base_destructor(Eo *obj, Elm_Photocam_Pan_Data *psd)
|
||||
{
|
||||
Elm_Photocam_Pan_Smart_Data *psd = _pd;
|
||||
eo_data_unref(psd->wobj, psd->wsd);
|
||||
eo_do_super(obj, MY_PAN_CLASS, eo_destructor());
|
||||
}
|
||||
|
||||
static void
|
||||
_photocam_pan_class_constructor(Eo_Class *klass)
|
||||
_elm_photocam_pan_class_constructor(Eo_Class *klass)
|
||||
{
|
||||
const Eo_Op_Func_Description func_desc[] = {
|
||||
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_DESTRUCTOR), _elm_photocam_pan_destructor),
|
||||
|
||||
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_photocam_pan_smart_resize),
|
||||
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_photocam_pan_smart_move),
|
||||
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CALCULATE), _elm_photocam_pan_smart_calculate),
|
||||
EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_SET), _elm_photocam_pan_smart_pos_set),
|
||||
EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_GET), _elm_photocam_pan_smart_pos_get),
|
||||
EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_MAX_GET), _elm_photocam_pan_smart_pos_max_get),
|
||||
EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_MIN_GET), _elm_photocam_pan_smart_pos_min_get),
|
||||
EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_CONTENT_SIZE_GET), _elm_photocam_pan_smart_content_size_get),
|
||||
EO_OP_FUNC_SENTINEL
|
||||
};
|
||||
eo_class_funcs_set(klass, func_desc);
|
||||
|
||||
evas_smart_legacy_type_register(MY_PAN_CLASS_NAME_LEGACY, klass);
|
||||
evas_smart_legacy_type_register(MY_PAN_CLASS_NAME_LEGACY, klass);
|
||||
}
|
||||
|
||||
static const Eo_Class_Description _elm_photocam_pan_class_desc = {
|
||||
EO_VERSION,
|
||||
MY_PAN_CLASS_NAME,
|
||||
EO_CLASS_TYPE_REGULAR,
|
||||
EO_CLASS_DESCRIPTION_OPS(NULL, NULL, 0),
|
||||
NULL,
|
||||
sizeof(Elm_Photocam_Pan_Smart_Data),
|
||||
_photocam_pan_class_constructor,
|
||||
NULL
|
||||
};
|
||||
|
||||
EO_DEFINE_CLASS(elm_obj_photocam_pan_class_get, &_elm_photocam_pan_class_desc, ELM_OBJ_PAN_CLASS, NULL);
|
||||
#include "elm_photocam_pan.eo.c"
|
||||
|
||||
static int
|
||||
_nearest_pow2_get(int num)
|
||||
|
@ -877,15 +820,14 @@ _mouse_up_cb(void *data,
|
|||
sd->on_hold = EINA_FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_photocam_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_photocam_elm_widget_on_focus(Eo *obj, Elm_Photocam_Data *_pd EINA_UNUSED)
|
||||
{
|
||||
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
|
||||
Eina_Bool int_ret = EINA_FALSE;
|
||||
|
||||
eo_do_super(obj, MY_CLASS, elm_obj_widget_on_focus(&int_ret));
|
||||
if (!int_ret) return;
|
||||
if (!int_ret) return EINA_FALSE;
|
||||
|
||||
if (elm_widget_focus_get(obj))
|
||||
{
|
||||
|
@ -900,22 +842,19 @@ _elm_photocam_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
|||
evas_object_focus_set(wd->resize_obj, EINA_FALSE);
|
||||
}
|
||||
|
||||
if (ret) *ret = EINA_TRUE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_photocam_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_photocam_elm_widget_theme_apply(Eo *obj, Elm_Photocam_Data *sd EINA_UNUSED)
|
||||
{
|
||||
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
||||
if (ret) *ret = EINA_FALSE;
|
||||
Eina_Bool int_ret = EINA_FALSE;
|
||||
|
||||
eo_do_super(obj, MY_CLASS, elm_obj_widget_theme_apply(&int_ret));
|
||||
if (!int_ret) return;
|
||||
if (!int_ret) return EINA_FALSE;
|
||||
|
||||
_sizing_eval(obj);
|
||||
|
||||
if (ret) *ret = EINA_TRUE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -964,16 +903,11 @@ _scroll_cb(Evas_Object *obj,
|
|||
evas_object_smart_callback_call(obj, SIG_SCROLL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_photocam_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_photocam_elm_widget_event(Eo *obj, Elm_Photocam_Data *_pd EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
Evas_Object *src = va_arg(*list, Evas_Object *);
|
||||
Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
|
||||
Evas_Event_Key_Down *ev = va_arg(*list, void *);
|
||||
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
||||
|
||||
if (ret) *ret = EINA_FALSE;
|
||||
(void) src;
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
||||
double zoom;
|
||||
Evas_Coord x = 0;
|
||||
|
@ -985,9 +919,9 @@ _elm_photocam_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
|||
Evas_Coord page_x = 0;
|
||||
Evas_Coord page_y = 0;
|
||||
|
||||
if (elm_widget_disabled_get(obj)) return;
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
|
||||
if (elm_widget_disabled_get(obj)) return EINA_FALSE;
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
|
||||
eo_do(obj,
|
||||
elm_interface_scrollable_content_pos_get(&x, &y),
|
||||
|
@ -1037,8 +971,7 @@ _elm_photocam_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
|||
zoom -= 0.5;
|
||||
elm_photocam_zoom_mode_set(obj, ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
|
||||
elm_photocam_zoom_set(obj, zoom);
|
||||
if (ret) *ret = EINA_TRUE;
|
||||
return;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
else if ((!strcmp(ev->key, "KP_Subtract")))
|
||||
{
|
||||
|
@ -1046,15 +979,14 @@ _elm_photocam_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
|||
zoom += 0.5;
|
||||
elm_photocam_zoom_mode_set(obj, ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
|
||||
elm_photocam_zoom_set(obj, zoom);
|
||||
if (ret) *ret = EINA_TRUE;
|
||||
return;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
else return;
|
||||
else return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
eo_do(obj, elm_interface_scrollable_content_pos_set(x, y, EINA_TRUE));
|
||||
|
||||
if (ret) *ret = EINA_TRUE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
|
@ -1211,7 +1143,7 @@ static Evas_Event_Flags
|
|||
_g_layer_zoom_move_cb(void *data,
|
||||
void *event_info)
|
||||
{
|
||||
Elm_Photocam_Smart_Data *sd = eo_data_scope_get(data, MY_CLASS);
|
||||
Elm_Photocam_Data *sd = eo_data_scope_get(data, MY_CLASS);
|
||||
Elm_Gesture_Zoom_Info *p = event_info;
|
||||
|
||||
_g_layer_zoom_do(data, sd->zoom_point_x, sd->zoom_point_y, p);
|
||||
|
@ -1316,12 +1248,11 @@ _g_layer_zoom_end_cb(void *data,
|
|||
return EVAS_EVENT_FLAG_NONE;
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_photocam_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
||||
EOLIAN static void
|
||||
_elm_photocam_evas_smart_add(Eo *obj, Elm_Photocam_Data *priv)
|
||||
{
|
||||
Elm_Photocam_Smart_Data *priv = _pd;
|
||||
Eina_Bool bounce = _elm_config->thumbscroll_bounce_enable;
|
||||
Elm_Photocam_Pan_Smart_Data *pan_data;
|
||||
Elm_Photocam_Pan_Data *pan_data;
|
||||
Evas_Object *edje;
|
||||
Evas_Coord minw, minh;
|
||||
|
||||
|
@ -1394,13 +1325,11 @@ _elm_photocam_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
|||
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_photocam_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
||||
EOLIAN static void
|
||||
_elm_photocam_evas_smart_del(Eo *obj, Elm_Photocam_Data *sd)
|
||||
{
|
||||
Elm_Phocam_Grid *g;
|
||||
|
||||
Elm_Photocam_Smart_Data *sd = _pd;
|
||||
|
||||
EINA_LIST_FREE(sd->grids, g)
|
||||
{
|
||||
free(g->grid);
|
||||
|
@ -1422,35 +1351,25 @@ _elm_photocam_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
|||
eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_photocam_smart_move(Eo *obj, void *_pd, va_list *list)
|
||||
EOLIAN static void
|
||||
_elm_photocam_evas_smart_move(Eo *obj, Elm_Photocam_Data *sd, Evas_Coord x, Evas_Coord y)
|
||||
{
|
||||
Evas_Coord x = va_arg(*list, Evas_Coord);
|
||||
Evas_Coord y = va_arg(*list, Evas_Coord);
|
||||
Elm_Photocam_Smart_Data *sd = _pd;
|
||||
|
||||
eo_do_super(obj, MY_CLASS, evas_obj_smart_move(x, y));
|
||||
|
||||
evas_object_move(sd->hit_rect, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_photocam_smart_resize(Eo *obj, void *_pd, va_list *list)
|
||||
EOLIAN static void
|
||||
_elm_photocam_evas_smart_resize(Eo *obj, Elm_Photocam_Data *sd, Evas_Coord w, Evas_Coord h)
|
||||
{
|
||||
Evas_Coord w = va_arg(*list, Evas_Coord);
|
||||
Evas_Coord h = va_arg(*list, Evas_Coord);
|
||||
Elm_Photocam_Smart_Data *sd = _pd;
|
||||
|
||||
eo_do_super(obj, MY_CLASS, evas_obj_smart_resize(w, h));
|
||||
|
||||
evas_object_resize(sd->hit_rect, w, h);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_photocam_smart_member_add(Eo *obj, void *_pd, va_list *list)
|
||||
EOLIAN static void
|
||||
_elm_photocam_evas_smart_member_add(Eo *obj, Elm_Photocam_Data *sd, Evas_Object *member)
|
||||
{
|
||||
Evas_Object *member = va_arg(*list, Evas_Object *);
|
||||
Elm_Photocam_Smart_Data *sd = _pd;
|
||||
|
||||
eo_do_super(obj, MY_CLASS, evas_obj_smart_member_add(member));
|
||||
|
||||
|
@ -1467,8 +1386,8 @@ elm_photocam_add(Evas_Object *parent)
|
|||
return obj;
|
||||
}
|
||||
|
||||
static void
|
||||
_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
|
||||
EOLIAN static void
|
||||
_elm_photocam_eo_base_constructor(Eo *obj, Elm_Photocam_Data *_pd EINA_UNUSED)
|
||||
{
|
||||
eo_do_super(obj, MY_CLASS, eo_constructor());
|
||||
eo_do(obj,
|
||||
|
@ -1476,18 +1395,8 @@ _constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
|
|||
evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
|
||||
}
|
||||
|
||||
EAPI Evas_Load_Error
|
||||
elm_photocam_file_set(Evas_Object *obj,
|
||||
const char *file)
|
||||
{
|
||||
ELM_PHOTOCAM_CHECK(obj) EVAS_LOAD_ERROR_NONE;
|
||||
Evas_Load_Error ret = EVAS_LOAD_ERROR_NONE;
|
||||
eo_do(obj, elm_obj_photocam_file_set(file, &ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
_internal_file_set(Eo *obj, Elm_Photocam_Smart_Data *sd, const char *file, Eina_File *f, Evas_Load_Error *ret)
|
||||
_internal_file_set(Eo *obj, Elm_Photocam_Data *sd, const char *file, Eina_File *f, Evas_Load_Error *ret)
|
||||
{
|
||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
||||
Evas_Load_Error err;
|
||||
|
@ -1550,7 +1459,7 @@ static void
|
|||
_elm_photocam_download_done(void *data, Elm_Url *url EINA_UNUSED, Eina_Binbuf *download)
|
||||
{
|
||||
Eo *obj = data;
|
||||
Elm_Photocam_Smart_Data *sd = eo_data_scope_get(obj, MY_CLASS);
|
||||
Elm_Photocam_Data *sd = eo_data_scope_get(obj, MY_CLASS);
|
||||
Eina_File *f;
|
||||
size_t length;
|
||||
Evas_Load_Error ret = EVAS_LOAD_ERROR_NONE;
|
||||
|
@ -1584,7 +1493,7 @@ static void
|
|||
_elm_photocam_download_cancel(void *data, Elm_Url *url EINA_UNUSED, int error)
|
||||
{
|
||||
Eo *obj = data;
|
||||
Elm_Photocam_Smart_Data *sd = eo_data_scope_get(obj, MY_CLASS);
|
||||
Elm_Photocam_Data *sd = eo_data_scope_get(obj, MY_CLASS);
|
||||
Elm_Photocam_Error err = { error, EINA_FALSE };
|
||||
|
||||
evas_object_smart_callback_call(obj, SIG_DOWNLOAD_ERROR, &err);
|
||||
|
@ -1607,14 +1516,10 @@ static const char *remote_uri[] = {
|
|||
"http://", "https://", "ftp://"
|
||||
};
|
||||
|
||||
static void
|
||||
_file_set(Eo *obj, void *_pd, va_list *list)
|
||||
EOLIAN static Evas_Load_Error
|
||||
_elm_photocam_file_set(Eo *obj, Elm_Photocam_Data *sd, const char *file)
|
||||
{
|
||||
const char *file = va_arg(*list, const char *);
|
||||
Evas_Load_Error *ret = va_arg(*list, Evas_Load_Error *);
|
||||
if (ret) *ret = EVAS_LOAD_ERROR_NONE;
|
||||
|
||||
Elm_Photocam_Smart_Data *sd = _pd;
|
||||
Evas_Load_Error ret = EVAS_LOAD_ERROR_NONE;
|
||||
unsigned int i;
|
||||
|
||||
_grid_clear_all(obj);
|
||||
|
@ -1647,42 +1552,24 @@ _file_set(Eo *obj, void *_pd, va_list *list)
|
|||
if (sd->remote)
|
||||
{
|
||||
evas_object_smart_callback_call(obj, SIG_DOWNLOAD_START, NULL);
|
||||
return ;
|
||||
return ret;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
_internal_file_set(obj, sd, file, NULL, ret);
|
||||
}
|
||||
_internal_file_set(obj, sd, file, NULL, &ret);
|
||||
|
||||
EAPI const char *
|
||||
elm_photocam_file_get(const Evas_Object *obj)
|
||||
{
|
||||
ELM_PHOTOCAM_CHECK(obj) NULL;
|
||||
const char *ret = NULL;
|
||||
eo_do((Eo *) obj, elm_obj_photocam_file_get(&ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
_file_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
||||
EOLIAN static const char*
|
||||
_elm_photocam_file_get(Eo *obj EINA_UNUSED, Elm_Photocam_Data *sd)
|
||||
{
|
||||
const char **ret = va_arg(*list, const char **);
|
||||
Elm_Photocam_Smart_Data *sd = _pd;
|
||||
|
||||
*ret = sd->file;
|
||||
return sd->file;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_photocam_zoom_set(Evas_Object *obj,
|
||||
double zoom)
|
||||
{
|
||||
ELM_PHOTOCAM_CHECK(obj);
|
||||
eo_do(obj, elm_obj_photocam_zoom_set(zoom));
|
||||
}
|
||||
|
||||
static void
|
||||
_zoom_set(Eo *obj, void *_pd, va_list *list)
|
||||
EOLIAN static void
|
||||
_elm_photocam_zoom_set(Eo *obj, Elm_Photocam_Data *sd, double zoom)
|
||||
{
|
||||
double z;
|
||||
Eina_List *l;
|
||||
|
@ -1691,9 +1578,6 @@ _zoom_set(Eo *obj, void *_pd, va_list *list)
|
|||
Evas_Coord pw, ph, rx, ry, rw, rh;
|
||||
int zoom_changed = 0, started = 0;
|
||||
|
||||
double zoom = va_arg(*list, double);
|
||||
Elm_Photocam_Smart_Data *sd = _pd;
|
||||
|
||||
if (zoom <= (1.0 / 256.0)) zoom = (1.0 / 256.0);
|
||||
if (zoom == sd->zoom) return;
|
||||
|
||||
|
@ -1905,40 +1789,17 @@ done:
|
|||
evas_object_smart_callback_call(obj, SIG_ZOOM_CHANGE, NULL);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
elm_photocam_zoom_get(const Evas_Object *obj)
|
||||
EOLIAN static double
|
||||
_elm_photocam_zoom_get(Eo *obj EINA_UNUSED, Elm_Photocam_Data *sd)
|
||||
{
|
||||
ELM_PHOTOCAM_CHECK(obj) 1.0;
|
||||
double ret = 1.0;
|
||||
eo_do((Eo *) obj, elm_obj_photocam_zoom_get(&ret));
|
||||
return ret;
|
||||
return sd->zoom;
|
||||
}
|
||||
|
||||
static void
|
||||
_zoom_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
||||
{
|
||||
double *ret = va_arg(*list, double *);
|
||||
Elm_Photocam_Smart_Data *sd = _pd;
|
||||
|
||||
*ret = sd->zoom;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_photocam_zoom_mode_set(Evas_Object *obj,
|
||||
Elm_Photocam_Zoom_Mode mode)
|
||||
{
|
||||
ELM_PHOTOCAM_CHECK(obj);
|
||||
eo_do(obj, elm_obj_photocam_zoom_mode_set(mode));
|
||||
}
|
||||
|
||||
static void
|
||||
_zoom_mode_set(Eo *obj, void *_pd, va_list *list)
|
||||
EOLIAN static void
|
||||
_elm_photocam_zoom_mode_set(Eo *obj, Elm_Photocam_Data *sd, Elm_Photocam_Zoom_Mode mode)
|
||||
{
|
||||
double tz;
|
||||
|
||||
Elm_Photocam_Zoom_Mode mode = va_arg(*list, Elm_Photocam_Zoom_Mode);
|
||||
Elm_Photocam_Smart_Data *sd = _pd;
|
||||
|
||||
if (sd->mode == mode) return;
|
||||
sd->mode = mode;
|
||||
|
||||
|
@ -1947,66 +1808,24 @@ _zoom_mode_set(Eo *obj, void *_pd, va_list *list)
|
|||
elm_photocam_zoom_set(obj, tz);
|
||||
}
|
||||
|
||||
EAPI Elm_Photocam_Zoom_Mode
|
||||
elm_photocam_zoom_mode_get(const Evas_Object *obj)
|
||||
EOLIAN static Elm_Photocam_Zoom_Mode
|
||||
_elm_photocam_zoom_mode_get(Eo *obj EINA_UNUSED, Elm_Photocam_Data *sd)
|
||||
{
|
||||
ELM_PHOTOCAM_CHECK(obj) ELM_PHOTOCAM_ZOOM_MODE_LAST;
|
||||
Elm_Photocam_Zoom_Mode ret = ELM_PHOTOCAM_ZOOM_MODE_LAST;
|
||||
eo_do((Eo *) obj, elm_obj_photocam_zoom_mode_get(&ret));
|
||||
return ret;
|
||||
return sd->mode;
|
||||
}
|
||||
|
||||
static void
|
||||
_zoom_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
||||
EOLIAN static void
|
||||
_elm_photocam_image_size_get(Eo *obj EINA_UNUSED, Elm_Photocam_Data *sd, int *w, int *h)
|
||||
{
|
||||
Elm_Photocam_Zoom_Mode *ret = va_arg(*list, Elm_Photocam_Zoom_Mode *);
|
||||
Elm_Photocam_Smart_Data *sd = _pd;
|
||||
|
||||
*ret = sd->mode;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_photocam_image_size_get(const Evas_Object *obj,
|
||||
int *w,
|
||||
int *h)
|
||||
{
|
||||
ELM_PHOTOCAM_CHECK(obj);
|
||||
eo_do((Eo *) obj, elm_obj_photocam_image_size_get(w, h));
|
||||
}
|
||||
|
||||
static void
|
||||
_image_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
||||
{
|
||||
int *w = va_arg(*list, int *);
|
||||
int *h = va_arg(*list, int *);
|
||||
Elm_Photocam_Smart_Data *sd = _pd;
|
||||
|
||||
if (w) *w = sd->size.imw;
|
||||
if (h) *h = sd->size.imh;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_photocam_image_region_get(const Evas_Object *obj,
|
||||
int *x,
|
||||
int *y,
|
||||
int *w,
|
||||
int *h)
|
||||
{
|
||||
ELM_PHOTOCAM_CHECK(obj);
|
||||
eo_do((Eo *) obj, elm_obj_photocam_image_region_get(x, y, w, h));
|
||||
}
|
||||
|
||||
static void
|
||||
_image_region_get(Eo *obj, void *_pd, va_list *list)
|
||||
EOLIAN static void
|
||||
_elm_photocam_image_region_get(Eo *obj, Elm_Photocam_Data *sd, int *x, int *y, int *w, int *h)
|
||||
{
|
||||
Evas_Coord sx, sy, sw, sh;
|
||||
|
||||
int *x = va_arg(*list, int *);
|
||||
int *y = va_arg(*list, int *);
|
||||
int *w = va_arg(*list, int *);
|
||||
int *h = va_arg(*list, int *);
|
||||
Elm_Photocam_Smart_Data *sd = _pd;
|
||||
|
||||
eo_do((Eo *)obj, elm_interface_scrollable_content_pos_get(&sx, &sy));
|
||||
eo_do((Eo *)obj, elm_interface_scrollable_content_viewport_size_get(&sw, &sh));
|
||||
if (sd->size.w > 0)
|
||||
|
@ -2052,28 +1871,11 @@ _image_region_get(Eo *obj, void *_pd, va_list *list)
|
|||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_photocam_image_region_show(Evas_Object *obj,
|
||||
int x,
|
||||
int y,
|
||||
int w,
|
||||
int h)
|
||||
{
|
||||
ELM_PHOTOCAM_CHECK(obj);
|
||||
eo_do(obj, elm_obj_photocam_image_region_show(x, y, w, h));
|
||||
}
|
||||
|
||||
static void
|
||||
_image_region_show(Eo *obj, void *_pd, va_list *list)
|
||||
EOLIAN static void
|
||||
_elm_photocam_image_region_show(Eo *obj, Elm_Photocam_Data *sd, int x, int y, int w, int h)
|
||||
{
|
||||
int rx, ry, rw, rh;
|
||||
|
||||
int x = va_arg(*list, int);
|
||||
int y = va_arg(*list, int);
|
||||
int w = va_arg(*list, int);
|
||||
int h = va_arg(*list, int);
|
||||
Elm_Photocam_Smart_Data *sd = _pd;
|
||||
|
||||
if ((sd->size.imw < 1) || (sd->size.imh < 1)) return;
|
||||
rx = (x * sd->size.w) / sd->size.imw;
|
||||
ry = (y * sd->size.h) / sd->size.imh;
|
||||
|
@ -2111,17 +1913,11 @@ elm_photocam_image_region_bring_in(Evas_Object *obj,
|
|||
eo_do(obj, elm_interface_scrollable_region_bring_in(x, y, w, h));
|
||||
}
|
||||
|
||||
static void
|
||||
_image_region_bring_in(Eo *obj, void *_pd, va_list *list)
|
||||
EOLIAN static void
|
||||
_elm_photocam_elm_interface_scrollable_region_bring_in(Eo *obj, Elm_Photocam_Data *sd, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
|
||||
{
|
||||
int x = va_arg(*list, int);
|
||||
int y = va_arg(*list, int);
|
||||
int w = va_arg(*list, int);
|
||||
int h = va_arg(*list, int);
|
||||
int rx, ry, rw, rh;
|
||||
|
||||
Elm_Photocam_Smart_Data *sd = _pd;
|
||||
|
||||
if ((sd->size.imw < 1) || (sd->size.imh < 1)) return;
|
||||
rx = (x * sd->size.w) / sd->size.imw;
|
||||
ry = (y * sd->size.h) / sd->size.imh;
|
||||
|
@ -2149,20 +1945,9 @@ _image_region_bring_in(Eo *obj, void *_pd, va_list *list)
|
|||
eo_do_super(obj, MY_CLASS, elm_interface_scrollable_region_bring_in(rx, ry, rw, rh));
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_photocam_paused_set(Evas_Object *obj,
|
||||
Eina_Bool paused)
|
||||
EOLIAN static void
|
||||
_elm_photocam_paused_set(Eo *obj, Elm_Photocam_Data *sd, Eina_Bool paused)
|
||||
{
|
||||
ELM_PHOTOCAM_CHECK(obj);
|
||||
eo_do(obj, elm_obj_photocam_paused_set(paused));
|
||||
}
|
||||
|
||||
static void
|
||||
_paused_set(Eo *obj, void *_pd, va_list *list)
|
||||
{
|
||||
Eina_Bool paused = va_arg(*list, int);
|
||||
Elm_Photocam_Smart_Data *sd = _pd;
|
||||
|
||||
paused = !!paused;
|
||||
|
||||
if (sd->paused == paused) return;
|
||||
|
@ -2184,40 +1969,16 @@ _paused_set(Eo *obj, void *_pd, va_list *list)
|
|||
}
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_photocam_paused_get(const Evas_Object *obj)
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_photocam_paused_get(Eo *obj EINA_UNUSED, Elm_Photocam_Data *sd)
|
||||
{
|
||||
ELM_PHOTOCAM_CHECK(obj) EINA_FALSE;
|
||||
Eina_Bool ret = EINA_FALSE;
|
||||
eo_do((Eo *) obj, elm_obj_photocam_paused_get(&ret));
|
||||
return ret;
|
||||
return sd->paused;
|
||||
}
|
||||
|
||||
static void
|
||||
_paused_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
||||
EOLIAN static Evas_Object*
|
||||
_elm_photocam_internal_image_get(Eo *obj EINA_UNUSED, Elm_Photocam_Data *sd)
|
||||
{
|
||||
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
||||
Elm_Photocam_Smart_Data *sd = _pd;
|
||||
|
||||
*ret = sd->paused;
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_photocam_internal_image_get(const Evas_Object *obj)
|
||||
{
|
||||
ELM_PHOTOCAM_CHECK(obj) NULL;
|
||||
Evas_Object *ret = NULL;
|
||||
eo_do((Eo *) obj, elm_obj_photocam_internal_image_get(&ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
_internal_image_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
||||
{
|
||||
Evas_Object **ret = va_arg(*list, Evas_Object **);
|
||||
Elm_Photocam_Smart_Data *sd = _pd;
|
||||
|
||||
*ret = sd->img;
|
||||
return sd->img;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -2240,20 +2001,9 @@ elm_photocam_bounce_get(const Evas_Object *obj,
|
|||
eo_do((Eo *)obj, elm_interface_scrollable_bounce_allow_get(h_bounce, v_bounce));
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_photocam_gesture_enabled_set(Evas_Object *obj,
|
||||
Eina_Bool gesture)
|
||||
EOLIAN static void
|
||||
_elm_photocam_gesture_enabled_set(Eo *obj, Elm_Photocam_Data *sd, Eina_Bool gesture)
|
||||
{
|
||||
ELM_PHOTOCAM_CHECK(obj);
|
||||
eo_do(obj, elm_obj_photocam_gesture_enabled_set(gesture));
|
||||
}
|
||||
|
||||
static void
|
||||
_gesture_enabled_set(Eo *obj, void *_pd, va_list *list)
|
||||
{
|
||||
Eina_Bool gesture = va_arg(*list, int);
|
||||
Elm_Photocam_Smart_Data *sd = _pd;
|
||||
|
||||
gesture = !!gesture;
|
||||
|
||||
if (sd->do_gesture == gesture) return;
|
||||
|
@ -2282,91 +2032,16 @@ _gesture_enabled_set(Eo *obj, void *_pd, va_list *list)
|
|||
_g_layer_zoom_end_cb, obj);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_photocam_gesture_enabled_get(const Evas_Object *obj)
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_photocam_gesture_enabled_get(Eo *obj EINA_UNUSED, Elm_Photocam_Data *sd)
|
||||
{
|
||||
ELM_PHOTOCAM_CHECK(obj) EINA_FALSE;
|
||||
Eina_Bool ret = EINA_FALSE;
|
||||
eo_do((Eo *) obj, elm_obj_photocam_gesture_enabled_get(&ret));
|
||||
return ret;
|
||||
return sd->do_gesture;
|
||||
}
|
||||
|
||||
static void
|
||||
_gesture_enabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
||||
_elm_photocam_class_constructor(Eo_Class *klass)
|
||||
{
|
||||
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
||||
Elm_Photocam_Smart_Data *sd = _pd;
|
||||
|
||||
*ret = sd->do_gesture;
|
||||
}
|
||||
|
||||
static void
|
||||
_class_constructor(Eo_Class *klass)
|
||||
{
|
||||
const Eo_Op_Func_Description func_desc[] = {
|
||||
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
|
||||
|
||||
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MEMBER_ADD), _elm_photocam_smart_member_add),
|
||||
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_photocam_smart_add),
|
||||
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_photocam_smart_del),
|
||||
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_photocam_smart_resize),
|
||||
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_photocam_smart_move),
|
||||
|
||||
EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_THEME_APPLY), _elm_photocam_smart_theme),
|
||||
EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_EVENT), _elm_photocam_smart_event),
|
||||
EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_ON_FOCUS), _elm_photocam_smart_on_focus),
|
||||
|
||||
EO_OP_FUNC(ELM_INTERFACE_SCROLLABLE_ID(ELM_INTERFACE_SCROLLABLE_SUB_ID_REGION_BRING_IN), _image_region_bring_in),
|
||||
|
||||
EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_FILE_SET), _file_set),
|
||||
EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_FILE_GET), _file_get),
|
||||
EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_SET), _zoom_set),
|
||||
EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_GET), _zoom_get),
|
||||
EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_MODE_SET), _zoom_mode_set),
|
||||
EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_MODE_GET), _zoom_mode_get),
|
||||
EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_IMAGE_SIZE_GET), _image_size_get),
|
||||
EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_IMAGE_REGION_GET), _image_region_get),
|
||||
EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_IMAGE_REGION_SHOW), _image_region_show),
|
||||
EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_PAUSED_SET), _paused_set),
|
||||
EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_PAUSED_GET), _paused_get),
|
||||
EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_INTERNAL_IMAGE_GET), _internal_image_get),
|
||||
EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_GESTURE_ENABLED_SET), _gesture_enabled_set),
|
||||
EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_GESTURE_ENABLED_GET), _gesture_enabled_get),
|
||||
|
||||
EO_OP_FUNC_SENTINEL
|
||||
};
|
||||
eo_class_funcs_set(klass, func_desc);
|
||||
|
||||
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
|
||||
}
|
||||
|
||||
static const Eo_Op_Description op_desc[] = {
|
||||
EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_FILE_SET, "Set the photo file to be shown."),
|
||||
EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_FILE_GET, "Returns the path of the current image file."),
|
||||
EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_SET, "Set the zoom level of the photo."),
|
||||
EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_GET, "Get the zoom level of the photo."),
|
||||
EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_MODE_SET, "Set the zoom mode."),
|
||||
EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_MODE_GET, "Get the zoom mode."),
|
||||
EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_IMAGE_SIZE_GET, "Get the current image pixel width and height."),
|
||||
EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_IMAGE_REGION_GET, "Get the region of the image that is currently shown."),
|
||||
EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_IMAGE_REGION_SHOW, "Set the viewed region of the image."),
|
||||
EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_PAUSED_SET, "Set the paused state for photocam."),
|
||||
EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_PAUSED_GET, "Get the paused state for photocam."),
|
||||
EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_INTERNAL_IMAGE_GET, "Get the internal low-res image used for photocam."),
|
||||
EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_GESTURE_ENABLED_SET, "Set the gesture state for photocam."),
|
||||
EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_GESTURE_ENABLED_GET, "Get the gesture state for photocam."),
|
||||
EO_OP_DESCRIPTION_SENTINEL
|
||||
};
|
||||
|
||||
static const Eo_Class_Description class_desc = {
|
||||
EO_VERSION,
|
||||
MY_CLASS_NAME,
|
||||
EO_CLASS_TYPE_REGULAR,
|
||||
EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_PHOTOCAM_BASE_ID, op_desc, ELM_OBJ_PHOTOCAM_SUB_ID_LAST),
|
||||
NULL,
|
||||
sizeof(Elm_Photocam_Smart_Data),
|
||||
_class_constructor,
|
||||
NULL
|
||||
};
|
||||
|
||||
EO_DEFINE_CLASS(elm_obj_photocam_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, ELM_INTERFACE_SCROLLABLE_CLASS, NULL);
|
||||
#include "elm_photocam.eo.c"
|
||||
|
|
|
@ -0,0 +1,263 @@
|
|||
class Elm_Photocam (Elm_Widget, Elm_Interface_Scrollable)
|
||||
{
|
||||
eo_prefix: elm_obj_photocam;
|
||||
properties {
|
||||
paused {
|
||||
set {
|
||||
/*@
|
||||
@brief Set the paused state for photocam
|
||||
|
||||
This sets the paused state to on(EINA_TRUE) or off (EINA_FALSE) for
|
||||
photocam. The default is off. This will stop zooming using animation on
|
||||
zoom level changes and change instantly. This will stop any existing
|
||||
animations that are running.
|
||||
|
||||
@ingroup Photocam */
|
||||
}
|
||||
get {
|
||||
/*@
|
||||
@brief Get the paused state for photocam
|
||||
|
||||
@return The current paused state
|
||||
|
||||
This gets the current paused state for the photocam object.
|
||||
|
||||
@see elm_photocam_paused_set()
|
||||
|
||||
@ingroup Photocam */
|
||||
}
|
||||
values {
|
||||
Eina_Bool paused; /*@ The pause state to set */
|
||||
}
|
||||
}
|
||||
file {
|
||||
set {
|
||||
/*@
|
||||
@brief Set the photo file to be shown
|
||||
|
||||
@return The return error (see EVAS_LOAD_ERROR_NONE, EVAS_LOAD_ERROR_GENERIC etc.)
|
||||
|
||||
This sets (and shows) the specified file (with a relative or absolute
|
||||
path) and will return a load error (same error that
|
||||
evas_object_image_load_error_get() will return). The image will change and
|
||||
adjust its size at this point and begin a background load process for this
|
||||
photo that at some time in the future will be displayed at the full
|
||||
quality needed.
|
||||
|
||||
@ingroup Photocam */
|
||||
return Evas_Load_Error;
|
||||
}
|
||||
get {
|
||||
/*@
|
||||
@brief Returns the path of the current image file
|
||||
|
||||
@return Returns the path
|
||||
|
||||
@see elm_photocam_file_set()
|
||||
|
||||
@ingroup Photocam */
|
||||
}
|
||||
values {
|
||||
const char *file; /*@ The photo file */
|
||||
}
|
||||
}
|
||||
gesture_enabled {
|
||||
set {
|
||||
/*@
|
||||
@brief Set the gesture state for photocam.
|
||||
|
||||
This sets the gesture state to on(EINA_TRUE) or off (EINA_FALSE) for
|
||||
photocam. The default is off. This will start multi touch zooming.
|
||||
|
||||
@ingroup Photocam */
|
||||
}
|
||||
get {
|
||||
/*@
|
||||
@brief Get the gesture state for photocam.
|
||||
|
||||
@return The current gesture state
|
||||
|
||||
This gets the current gesture state for the photocam object.
|
||||
|
||||
@see elm_photocam_gesture_enabled_set()
|
||||
|
||||
@ingroup Photocam */
|
||||
}
|
||||
values {
|
||||
Eina_Bool gesture; /*@ The gesture state to set */
|
||||
}
|
||||
}
|
||||
zoom {
|
||||
set {
|
||||
/*@
|
||||
@brief Set the zoom level of the photo
|
||||
|
||||
This sets the zoom level. If @p zoom is 1, it means no zoom. If it's smaller
|
||||
than 1, it means zoom in. If it's bigger than 1, it means zoom out. For
|
||||
example, @p zoom 1 will be 1:1 pixel for pixel. @p zoom 2 will be 2:1
|
||||
(that is 2x2 photo pixels will display as 1 on-screen pixel) which is a zoom
|
||||
out. 4:1 will be 4x4 photo pixels as 1 screen pixel, and so on. The @p zoom
|
||||
parameter must be greater than 0. It is suggested to stick to powers of 2.
|
||||
(1, 2, 4, 8, 16, 32, etc.).
|
||||
|
||||
@ingroup Photocam */
|
||||
}
|
||||
get {
|
||||
/*@
|
||||
@brief Get the zoom level of the photo
|
||||
|
||||
@return The current zoom level
|
||||
|
||||
This returns the current zoom level of the photocam object. Note that if
|
||||
you set the fill mode to other than ELM_PHOTOCAM_ZOOM_MODE_MANUAL
|
||||
(which is the default), the zoom level may be changed at any time by the
|
||||
photocam object itself to account for photo size and photocam viewport
|
||||
size.
|
||||
|
||||
@see elm_photocam_zoom_set()
|
||||
@see elm_photocam_zoom_mode_set()
|
||||
|
||||
@ingroup Photocam */
|
||||
}
|
||||
values {
|
||||
double zoom; /*@ The zoom level to set */
|
||||
}
|
||||
}
|
||||
zoom_mode {
|
||||
set {
|
||||
/*@
|
||||
@brief Set the zoom mode
|
||||
|
||||
This sets the zoom mode to manual or one of several automatic levels.
|
||||
Manual (ELM_PHOTOCAM_ZOOM_MODE_MANUAL) means that zoom is set manually by
|
||||
elm_photocam_zoom_set() and will stay at that level until changed by code
|
||||
or until zoom mode is changed. This is the default mode. The Automatic
|
||||
modes will allow the photocam object to automatically adjust zoom mode
|
||||
based on properties. ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT) will adjust zoom so
|
||||
the photo fits EXACTLY inside the scroll frame with no pixels outside this
|
||||
region. ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL will be similar but ensure no
|
||||
pixels within the frame are left unfilled.
|
||||
|
||||
@ingroup Photocam */
|
||||
}
|
||||
get {
|
||||
/*@
|
||||
@brief Get the zoom mode
|
||||
|
||||
@return The current zoom mode
|
||||
|
||||
This gets the current zoom mode of the photocam object.
|
||||
|
||||
@see elm_photocam_zoom_mode_set()
|
||||
|
||||
@ingroup Photocam */
|
||||
}
|
||||
values {
|
||||
Elm_Photocam_Zoom_Mode mode; /*@ The desired mode */
|
||||
}
|
||||
}
|
||||
image_region {
|
||||
get {
|
||||
/*@
|
||||
@brief Get the region of the image that is currently shown
|
||||
|
||||
@see elm_photocam_image_region_show()
|
||||
@see elm_photocam_image_region_bring_in()
|
||||
|
||||
@ingroup Photocam */
|
||||
}
|
||||
values {
|
||||
int x; /*@ A pointer to the X-coordinate of region */
|
||||
int y; /*@ A pointer to the Y-coordinate of region */
|
||||
int w; /*@ A pointer to the width */
|
||||
int h; /*@ A pointer to the height */
|
||||
}
|
||||
}
|
||||
internal_image {
|
||||
get {
|
||||
/*@
|
||||
@brief Get the internal low-res image used for photocam
|
||||
|
||||
@return The internal image object handle, or NULL if none exists
|
||||
|
||||
This gets the internal image object inside photocam. Do not modify it. It
|
||||
is for inspection only, and hooking callbacks to. Nothing else. It may be
|
||||
deleted at any time as well.
|
||||
|
||||
@ingroup Photocam */
|
||||
return Evas_Object *;
|
||||
}
|
||||
}
|
||||
image_size {
|
||||
get {
|
||||
/*@
|
||||
@brief Get the current image pixel width and height
|
||||
|
||||
This gets the current photo pixel width and height (for the original).
|
||||
The size will be returned in the integers @p w and @p h that are pointed
|
||||
to.
|
||||
|
||||
@ingroup Photocam */
|
||||
}
|
||||
values {
|
||||
int w; /*@ A pointer to the width return */
|
||||
int h; /*@ A pointer to the height return */
|
||||
}
|
||||
}
|
||||
}
|
||||
methods {
|
||||
image_region_show {
|
||||
/*@
|
||||
@brief Set the viewed region of the image
|
||||
|
||||
This shows the region of the image without using animation.
|
||||
|
||||
@ingroup Photocam */
|
||||
|
||||
params {
|
||||
@in int x; /*@ X-coordinate of region in image original pixels */
|
||||
@in int y; /*@ Y-coordinate of region in image original pixels */
|
||||
@in int w; /*@ Width of region in image original pixels */
|
||||
@in int h; /*@ Height of region in image original pixels */
|
||||
}
|
||||
}
|
||||
}
|
||||
implements {
|
||||
class::constructor;
|
||||
Eo_Base::constructor;
|
||||
Evas_Smart::move;
|
||||
Evas_Smart::add;
|
||||
Evas_Smart::del;
|
||||
Evas_Smart::member_add;
|
||||
Evas_Smart::resize;
|
||||
Elm_Widget::theme_apply;
|
||||
Elm_Widget::on_focus;
|
||||
Elm_Widget::event;
|
||||
Elm_Interface_Scrollable::region_bring_in;
|
||||
}
|
||||
events {
|
||||
clicked;
|
||||
press;
|
||||
longpressed;
|
||||
clicked,double;
|
||||
load;
|
||||
loaded;
|
||||
load,detail;
|
||||
loaded,detail;
|
||||
zoom,start;
|
||||
zoom,stop;
|
||||
zoom,change;
|
||||
scroll;
|
||||
scroll,anim,start;
|
||||
scroll,anim,stop;
|
||||
scroll,drag,start;
|
||||
scroll,drag,stop;
|
||||
download,start;
|
||||
download,progress;
|
||||
download,done;
|
||||
download,error;
|
||||
focused;
|
||||
unfocused;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,3 +1,7 @@
|
|||
#include "elm_photocam_pan.eo.h"
|
||||
#include "elm_photocam.eo.h"
|
||||
|
||||
#if 0
|
||||
#define ELM_OBJ_PHOTOCAM_PAN_CLASS elm_obj_photocam_pan_class_get()
|
||||
|
||||
const Eo_Class *elm_obj_photocam_pan_class_get(void) EINA_CONST;
|
||||
|
@ -233,3 +237,4 @@ enum
|
|||
* @ingroup Photocam
|
||||
*/
|
||||
#define elm_obj_photocam_gesture_enabled_get(ret) ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_GESTURE_ENABLED_GET), EO_TYPECHECK(Eina_Bool *, ret)
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
class Elm_Photocam_Pan (Elm_Pan)
|
||||
{
|
||||
eo_prefix: elm_obj_photocam_pan;
|
||||
implements {
|
||||
class::constructor;
|
||||
Eo_Base::destructor;
|
||||
Evas_Smart::calculate;
|
||||
Evas_Smart::move;
|
||||
Evas_Smart::resize;
|
||||
Elm_Pan::content_size::get;
|
||||
Elm_Pan::pos;
|
||||
Elm_Pan::pos_min::get;
|
||||
Elm_Pan::pos_max::get;
|
||||
}
|
||||
events {
|
||||
clicked;
|
||||
press;
|
||||
longpressed;
|
||||
clicked,double;
|
||||
load;
|
||||
loaded;
|
||||
load,detail;
|
||||
loaded,detail;
|
||||
zoom,start;
|
||||
zoom,stop;
|
||||
zoom,change;
|
||||
scroll;
|
||||
scroll,anim,start;
|
||||
scroll,anim,stop;
|
||||
scroll,drag,start;
|
||||
scroll,drag,stop;
|
||||
download,start;
|
||||
download,progress;
|
||||
download,done;
|
||||
download,error;
|
||||
focused;
|
||||
unfocused;
|
||||
}
|
||||
|
||||
}
|
|
@ -17,15 +17,15 @@
|
|||
/**
|
||||
* Base widget smart data extended with photocam instance data.
|
||||
*/
|
||||
typedef struct _Elm_Photocam_Smart_Data Elm_Photocam_Smart_Data;
|
||||
typedef struct _Elm_Photocam_Pan_Smart_Data Elm_Photocam_Pan_Smart_Data;
|
||||
typedef struct _Elm_Photocam_Data Elm_Photocam_Data;
|
||||
typedef struct _Elm_Photocam_Pan_Data Elm_Photocam_Pan_Data;
|
||||
typedef struct _Elm_Phocam_Grid Elm_Phocam_Grid;
|
||||
typedef struct _Elm_Photocam_Grid_Item Elm_Photocam_Grid_Item;
|
||||
|
||||
struct _Elm_Photocam_Grid_Item
|
||||
{
|
||||
Evas_Object *obj;
|
||||
Elm_Photocam_Smart_Data *sd;
|
||||
Elm_Photocam_Data *sd;
|
||||
Evas_Object *img;
|
||||
|
||||
struct
|
||||
|
@ -51,7 +51,7 @@ struct _Elm_Phocam_Grid
|
|||
* over */
|
||||
};
|
||||
|
||||
struct _Elm_Photocam_Smart_Data
|
||||
struct _Elm_Photocam_Data
|
||||
{
|
||||
Evas_Object *hit_rect;
|
||||
Evas_Object *g_layer;
|
||||
|
@ -125,10 +125,10 @@ struct _Elm_Photocam_Smart_Data
|
|||
Eina_Bool paused : 1;
|
||||
};
|
||||
|
||||
struct _Elm_Photocam_Pan_Smart_Data
|
||||
struct _Elm_Photocam_Pan_Data
|
||||
{
|
||||
Evas_Object *wobj;
|
||||
Elm_Photocam_Smart_Data *wsd;
|
||||
Elm_Photocam_Data *wsd;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -136,10 +136,10 @@ struct _Elm_Photocam_Pan_Smart_Data
|
|||
*/
|
||||
|
||||
#define ELM_PHOTOCAM_DATA_GET(o, sd) \
|
||||
Elm_Photocam_Smart_Data * sd = eo_data_scope_get(o, ELM_OBJ_PHOTOCAM_CLASS)
|
||||
Elm_Photocam_Data * sd = eo_data_scope_get(o, ELM_OBJ_PHOTOCAM_CLASS)
|
||||
|
||||
#define ELM_PHOTOCAM_PAN_DATA_GET(o, sd) \
|
||||
Elm_Photocam_Pan_Smart_Data * sd = eo_data_scope_get(o, ELM_OBJ_PHOTOCAM_PAN_CLASS)
|
||||
Elm_Photocam_Pan_Data * sd = eo_data_scope_get(o, ELM_OBJ_PHOTOCAM_PAN_CLASS)
|
||||
|
||||
#define ELM_PHOTOCAM_DATA_GET_OR_RETURN(o, ptr) \
|
||||
ELM_PHOTOCAM_DATA_GET(o, ptr); \
|
||||
|
|
Loading…
Reference in New Issue