forked from enlightenment/efl
elementary / slider, radio, separator, photocam, photo, store, scroller, slideshow, spinner, progressbar - removed white spacesw
SVN revision: 58250
This commit is contained in:
parent
22588576be
commit
711b428aae
|
@ -5,8 +5,8 @@
|
||||||
* @defgroup Photo Photo
|
* @defgroup Photo Photo
|
||||||
*
|
*
|
||||||
* For displaying the photo of a person (contact). Simple yet
|
* For displaying the photo of a person (contact). Simple yet
|
||||||
* with a very specific purpose.
|
* with a very specific purpose.
|
||||||
*
|
*
|
||||||
* Signals that you can add callbacks for are:
|
* Signals that you can add callbacks for are:
|
||||||
*
|
*
|
||||||
* - clicked: This is called when a user has clicked the photo
|
* - clicked: This is called when a user has clicked the photo
|
||||||
|
@ -57,10 +57,10 @@ _theme_hook(Evas_Object *obj)
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
_elm_widget_mirrored_reload(obj);
|
_elm_widget_mirrored_reload(obj);
|
||||||
_mirrored_set(wd->frm, elm_widget_mirrored_get(obj));
|
_mirrored_set(wd->frm, elm_widget_mirrored_get(obj));
|
||||||
_elm_theme_object_set(obj, wd->frm, "photo", "base",
|
_elm_theme_object_set(obj, wd->frm, "photo", "base",
|
||||||
elm_widget_style_get(obj));
|
elm_widget_style_get(obj));
|
||||||
edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->img);
|
edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->img);
|
||||||
edje_object_scale_set(wd->frm, elm_widget_scale_get(obj) *
|
edje_object_scale_set(wd->frm, elm_widget_scale_get(obj) *
|
||||||
_elm_config->scale);
|
_elm_config->scale);
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ _sizing_eval(Evas_Object *obj)
|
||||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||||
|
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (wd->size > 0)
|
if (wd->size > 0)
|
||||||
{
|
{
|
||||||
double scale = 0.0;
|
double scale = 0.0;
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ _icon_move_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v
|
||||||
Widget_Data *wd = elm_widget_data_get(data);
|
Widget_Data *wd = elm_widget_data_get(data);
|
||||||
|
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (wd->fill)
|
if (wd->fill)
|
||||||
{
|
{
|
||||||
Edje_Message_Int_Set *msg;
|
Edje_Message_Int_Set *msg;
|
||||||
Evas_Object *icon = _els_smart_icon_object_get(wd->img);
|
Evas_Object *icon = _els_smart_icon_object_get(wd->img);
|
||||||
|
@ -218,7 +218,7 @@ elm_photo_add(Evas_Object *parent)
|
||||||
Evas_Object *icon;
|
Evas_Object *icon;
|
||||||
|
|
||||||
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
||||||
|
|
||||||
ELM_SET_WIDTYPE(widtype, "photo");
|
ELM_SET_WIDTYPE(widtype, "photo");
|
||||||
elm_widget_type_set(obj, "photo");
|
elm_widget_type_set(obj, "photo");
|
||||||
elm_widget_sub_object_add(parent, obj);
|
elm_widget_sub_object_add(parent, obj);
|
||||||
|
@ -238,12 +238,12 @@ elm_photo_add(Evas_Object *parent)
|
||||||
_els_smart_icon_fill_inside_set(wd->img, 0);
|
_els_smart_icon_fill_inside_set(wd->img, 0);
|
||||||
_els_smart_icon_scale_size_set(wd->img, 0);
|
_els_smart_icon_scale_size_set(wd->img, 0);
|
||||||
wd->fill = EINA_FALSE;
|
wd->fill = EINA_FALSE;
|
||||||
_els_smart_icon_scale_set(wd->img,
|
_els_smart_icon_scale_set(wd->img,
|
||||||
elm_widget_scale_get(obj) * _elm_config->scale);
|
elm_widget_scale_get(obj) * _elm_config->scale);
|
||||||
evas_object_event_callback_add(wd->img, EVAS_CALLBACK_MOUSE_UP,
|
evas_object_event_callback_add(wd->img, EVAS_CALLBACK_MOUSE_UP,
|
||||||
_mouse_up, obj);
|
_mouse_up, obj);
|
||||||
evas_object_event_callback_add(wd->img, EVAS_CALLBACK_MOUSE_DOWN,
|
evas_object_event_callback_add(wd->img, EVAS_CALLBACK_MOUSE_DOWN,
|
||||||
_mouse_down, obj);
|
_mouse_down, obj);
|
||||||
evas_object_repeat_events_set(wd->img, 1);
|
evas_object_repeat_events_set(wd->img, 1);
|
||||||
edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->img);
|
edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->img);
|
||||||
evas_object_show(wd->img);
|
evas_object_show(wd->img);
|
||||||
|
@ -253,9 +253,9 @@ elm_photo_add(Evas_Object *parent)
|
||||||
|
|
||||||
icon = _els_smart_icon_object_get(wd->img);
|
icon = _els_smart_icon_object_get(wd->img);
|
||||||
evas_object_event_callback_add(icon, EVAS_CALLBACK_MOVE,
|
evas_object_event_callback_add(icon, EVAS_CALLBACK_MOVE,
|
||||||
_icon_move_resize, obj);
|
_icon_move_resize, obj);
|
||||||
evas_object_event_callback_add(icon, EVAS_CALLBACK_RESIZE,
|
evas_object_event_callback_add(icon, EVAS_CALLBACK_RESIZE,
|
||||||
_icon_move_resize, obj);
|
_icon_move_resize, obj);
|
||||||
|
|
||||||
_mirrored_set(obj, elm_widget_mirrored_get(obj));
|
_mirrored_set(obj, elm_widget_mirrored_get(obj));
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
|
|
|
@ -9,35 +9,35 @@
|
||||||
* and zooming and panning as well as fitting logic. It is entirely focused
|
* and zooming and panning as well as fitting logic. It is entirely focused
|
||||||
* on jpeg images, and takes advantage of properties of the jpeg format (via
|
* on jpeg images, and takes advantage of properties of the jpeg format (via
|
||||||
* evas loader features in the jpeg loader).
|
* evas loader features in the jpeg loader).
|
||||||
*
|
*
|
||||||
* Signals that you can add callbacks for are:
|
* Signals that you can add callbacks for are:
|
||||||
*
|
*
|
||||||
* clicked - This is called when a user has clicked the photo without dragging
|
* clicked - This is called when a user has clicked the photo without dragging
|
||||||
* around.
|
* around.
|
||||||
*
|
*
|
||||||
* press - This is called when a user has pressed down on the photo.
|
* press - This is called when a user has pressed down on the photo.
|
||||||
*
|
*
|
||||||
* longpressed - This is called when a user has pressed down on the photo for
|
* longpressed - This is called when a user has pressed down on the photo for
|
||||||
* a long time without dragging around.
|
* a long time without dragging around.
|
||||||
*
|
*
|
||||||
* clicked,double - This is called when a user has double-clicked the photo.
|
* clicked,double - This is called when a user has double-clicked the photo.
|
||||||
*
|
*
|
||||||
* load - Photo load begins.
|
* load - Photo load begins.
|
||||||
*
|
*
|
||||||
* loaded - This is called when the image file load is complete for the first
|
* loaded - This is called when the image file load is complete for the first
|
||||||
* view (low resolution blurry version).
|
* view (low resolution blurry version).
|
||||||
*
|
*
|
||||||
* load,details - Photo detailed data load begins.
|
* load,details - Photo detailed data load begins.
|
||||||
*
|
*
|
||||||
* loaded,details - This is called when the image file load is complete for the
|
* loaded,details - This is called when the image file load is complete for the
|
||||||
* detailed image data (full resolution needed).
|
* detailed image data (full resolution needed).
|
||||||
*
|
*
|
||||||
* zoom,start - Zoom animation started.
|
* zoom,start - Zoom animation started.
|
||||||
*
|
*
|
||||||
* zoom,stop - Zoom animation stopped.
|
* zoom,stop - Zoom animation stopped.
|
||||||
*
|
*
|
||||||
* zoom,change - Zoom changed when using an auto zoom mode.
|
* zoom,change - Zoom changed when using an auto zoom mode.
|
||||||
*
|
*
|
||||||
* scroll - the content has been scrolled (moved)
|
* scroll - the content has been scrolled (moved)
|
||||||
*
|
*
|
||||||
* scroll,anim,start - scrolling animation has started
|
* scroll,anim,start - scrolling animation has started
|
||||||
|
@ -47,11 +47,11 @@
|
||||||
* scroll,drag,start - dragging the contents around has started
|
* scroll,drag,start - dragging the contents around has started
|
||||||
*
|
*
|
||||||
* scroll,drag,stop - dragging the contents around has stopped
|
* scroll,drag,stop - dragging the contents around has stopped
|
||||||
*
|
*
|
||||||
* ---
|
* ---
|
||||||
*
|
*
|
||||||
* TODO (maybe - optional future stuff):
|
* TODO (maybe - optional future stuff):
|
||||||
*
|
*
|
||||||
* 1. wrap photo in theme edje so u can have styling around photo (like white
|
* 1. wrap photo in theme edje so u can have styling around photo (like white
|
||||||
* photo bordering).
|
* photo bordering).
|
||||||
* 2. exif handling
|
* 2. exif handling
|
||||||
|
@ -67,7 +67,7 @@ struct _Grid_Item
|
||||||
{
|
{
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
Evas_Object *img;
|
Evas_Object *img;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
} src, out;
|
} src, out;
|
||||||
|
@ -97,26 +97,26 @@ struct _Widget_Data
|
||||||
double zoom;
|
double zoom;
|
||||||
Elm_Photocam_Zoom_Mode mode;
|
Elm_Photocam_Zoom_Mode mode;
|
||||||
const char *file;
|
const char *file;
|
||||||
|
|
||||||
Ecore_Job *calc_job;
|
Ecore_Job *calc_job;
|
||||||
Ecore_Timer *scr_timer;
|
Ecore_Timer *scr_timer;
|
||||||
Ecore_Timer *long_timer;
|
Ecore_Timer *long_timer;
|
||||||
Ecore_Animator *zoom_animator;
|
Ecore_Animator *zoom_animator;
|
||||||
double t_start, t_end;
|
double t_start, t_end;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int imw, imh;
|
int imw, imh;
|
||||||
int w, h;
|
int w, h;
|
||||||
int ow, oh, nw, nh;
|
int ow, oh, nw, nh;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
double x, y;
|
double x, y;
|
||||||
} spos;
|
} spos;
|
||||||
} size;
|
} size;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
Eina_Bool show : 1;
|
Eina_Bool show : 1;
|
||||||
Evas_Coord x, y ,w ,h;
|
Evas_Coord x, y ,w ,h;
|
||||||
} show;
|
} show;
|
||||||
int tsize;
|
int tsize;
|
||||||
Evas_Object *img; // low res version of image (scale down == 8)
|
Evas_Object *img; // low res version of image (scale down == 8)
|
||||||
|
@ -179,8 +179,8 @@ img_place(Evas_Object *obj, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_Co
|
||||||
|
|
||||||
if (wd->show.show)
|
if (wd->show.show)
|
||||||
{
|
{
|
||||||
wd->show.show = EINA_FALSE;
|
wd->show.show = EINA_FALSE;
|
||||||
elm_smart_scroller_child_region_show(wd->scr, wd->show.x, wd->show.y, wd->show.w, wd->show.h);
|
elm_smart_scroller_child_region_show(wd->scr, wd->show.x, wd->show.y, wd->show.w, wd->show.h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ grid_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord o
|
||||||
for (x = 0; x < g->gw; x++)
|
for (x = 0; x < g->gw; x++)
|
||||||
{
|
{
|
||||||
int tn, xx, yy, ww, hh;
|
int tn, xx, yy, ww, hh;
|
||||||
|
|
||||||
tn = (y * g->gw) + x;
|
tn = (y * g->gw) + x;
|
||||||
xx = g->grid[tn].out.x;
|
xx = g->grid[tn].out.x;
|
||||||
yy = g->grid[tn].out.y;
|
yy = g->grid[tn].out.y;
|
||||||
|
@ -240,7 +240,7 @@ grid_clear(Evas_Object *obj, Grid *g)
|
||||||
for (x = 0; x < g->gw; x++)
|
for (x = 0; x < g->gw; x++)
|
||||||
{
|
{
|
||||||
int tn;
|
int tn;
|
||||||
|
|
||||||
tn = (y * g->gw) + x;
|
tn = (y * g->gw) + x;
|
||||||
evas_object_del(g->grid[tn].img);
|
evas_object_del(g->grid[tn].img);
|
||||||
if (g->grid[tn].want)
|
if (g->grid[tn].want)
|
||||||
|
@ -295,15 +295,15 @@ grid_create(Evas_Object *obj)
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
int x, y;
|
int x, y;
|
||||||
Grid *g;
|
Grid *g;
|
||||||
|
|
||||||
if (!wd) return NULL;
|
if (!wd) return NULL;
|
||||||
g = calloc(1, sizeof(Grid));
|
g = calloc(1, sizeof(Grid));
|
||||||
|
|
||||||
g->zoom = grid_zoom_calc(wd->zoom);
|
g->zoom = grid_zoom_calc(wd->zoom);
|
||||||
g->tsize = wd->tsize;
|
g->tsize = wd->tsize;
|
||||||
g->iw = wd->size.imw;
|
g->iw = wd->size.imw;
|
||||||
g->ih = wd->size.imh;
|
g->ih = wd->size.imh;
|
||||||
|
|
||||||
g->w = g->iw / g->zoom;
|
g->w = g->iw / g->zoom;
|
||||||
g->h = g->ih / g->zoom;
|
g->h = g->ih / g->zoom;
|
||||||
if (g->zoom >= 8) return NULL;
|
if (g->zoom >= 8) return NULL;
|
||||||
|
@ -321,7 +321,7 @@ grid_create(Evas_Object *obj)
|
||||||
for (x = 0; x < g->gw; x++)
|
for (x = 0; x < g->gw; x++)
|
||||||
{
|
{
|
||||||
int tn;
|
int tn;
|
||||||
|
|
||||||
tn = (y * g->gw) + x;
|
tn = (y * g->gw) + x;
|
||||||
g->grid[tn].src.x = x * g->tsize;
|
g->grid[tn].src.x = x * g->tsize;
|
||||||
if (x == (g->gw - 1))
|
if (x == (g->gw - 1))
|
||||||
|
@ -333,25 +333,25 @@ grid_create(Evas_Object *obj)
|
||||||
g->grid[tn].src.h = g->h - ((g->gh - 1) * g->tsize);
|
g->grid[tn].src.h = g->h - ((g->gh - 1) * g->tsize);
|
||||||
else
|
else
|
||||||
g->grid[tn].src.h = g->tsize;
|
g->grid[tn].src.h = g->tsize;
|
||||||
|
|
||||||
g->grid[tn].out.x = g->grid[tn].src.x;
|
g->grid[tn].out.x = g->grid[tn].src.x;
|
||||||
g->grid[tn].out.y = g->grid[tn].src.y;
|
g->grid[tn].out.y = g->grid[tn].src.y;
|
||||||
g->grid[tn].out.w = g->grid[tn].src.w;
|
g->grid[tn].out.w = g->grid[tn].src.w;
|
||||||
g->grid[tn].out.h = g->grid[tn].src.h;
|
g->grid[tn].out.h = g->grid[tn].src.h;
|
||||||
|
|
||||||
g->grid[tn].wd = wd;
|
g->grid[tn].wd = wd;
|
||||||
g->grid[tn].img =
|
g->grid[tn].img =
|
||||||
evas_object_image_add(evas_object_evas_get(obj));
|
evas_object_image_add(evas_object_evas_get(obj));
|
||||||
evas_object_image_scale_hint_set
|
evas_object_image_scale_hint_set
|
||||||
(g->grid[tn].img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
|
(g->grid[tn].img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
|
||||||
evas_object_pass_events_set(g->grid[tn].img, EINA_TRUE);
|
evas_object_pass_events_set(g->grid[tn].img, EINA_TRUE);
|
||||||
evas_object_smart_member_add(g->grid[tn].img,
|
evas_object_smart_member_add(g->grid[tn].img,
|
||||||
wd->pan_smart);
|
wd->pan_smart);
|
||||||
elm_widget_sub_object_add(obj, g->grid[tn].img);
|
elm_widget_sub_object_add(obj, g->grid[tn].img);
|
||||||
evas_object_image_filled_set(g->grid[tn].img, 1);
|
evas_object_image_filled_set(g->grid[tn].img, 1);
|
||||||
evas_object_event_callback_add(g->grid[tn].img,
|
evas_object_event_callback_add(g->grid[tn].img,
|
||||||
EVAS_CALLBACK_IMAGE_PRELOADED,
|
EVAS_CALLBACK_IMAGE_PRELOADED,
|
||||||
_tile_preloaded,
|
_tile_preloaded,
|
||||||
&(g->grid[tn]));
|
&(g->grid[tn]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -375,7 +375,7 @@ grid_load(Evas_Object *obj, Grid *g)
|
||||||
{
|
{
|
||||||
int tn, xx, yy, ww, hh;
|
int tn, xx, yy, ww, hh;
|
||||||
Eina_Bool visible = EINA_FALSE;
|
Eina_Bool visible = EINA_FALSE;
|
||||||
|
|
||||||
tn = (y * g->gw) + x;
|
tn = (y * g->gw) + x;
|
||||||
xx = g->grid[tn].out.x;
|
xx = g->grid[tn].out.x;
|
||||||
yy = g->grid[tn].out.y;
|
yy = g->grid[tn].out.y;
|
||||||
|
@ -393,7 +393,7 @@ grid_load(Evas_Object *obj, Grid *g)
|
||||||
yy = (gh * yy) / g->h;
|
yy = (gh * yy) / g->h;
|
||||||
hh = ((gh * (ty + hh)) / g->h) - yy;
|
hh = ((gh * (ty + hh)) / g->h) - yy;
|
||||||
}
|
}
|
||||||
if (ELM_RECTS_INTERSECT(xx - wd->pan_x + ox,
|
if (ELM_RECTS_INTERSECT(xx - wd->pan_x + ox,
|
||||||
yy - wd->pan_y + oy,
|
yy - wd->pan_y + oy,
|
||||||
ww, hh,
|
ww, hh,
|
||||||
cvx, cvy, cvw, cvh))
|
cvx, cvy, cvw, cvh))
|
||||||
|
@ -409,7 +409,7 @@ grid_load(Evas_Object *obj, Grid *g)
|
||||||
g->grid[tn].src.y,
|
g->grid[tn].src.y,
|
||||||
g->grid[tn].src.w,
|
g->grid[tn].src.w,
|
||||||
g->grid[tn].src.h);
|
g->grid[tn].src.h);
|
||||||
evas_object_image_file_set(g->grid[tn].img, wd->file, NULL);
|
evas_object_image_file_set(g->grid[tn].img, wd->file, NULL);
|
||||||
evas_object_image_preload(g->grid[tn].img, 0);
|
evas_object_image_preload(g->grid[tn].img, 0);
|
||||||
wd->preload_num++;
|
wd->preload_num++;
|
||||||
if (wd->preload_num == 1)
|
if (wd->preload_num == 1)
|
||||||
|
@ -472,7 +472,7 @@ _smooth_update(Evas_Object *obj)
|
||||||
for (x = 0; x < g->gw; x++)
|
for (x = 0; x < g->gw; x++)
|
||||||
{
|
{
|
||||||
int tn;
|
int tn;
|
||||||
|
|
||||||
tn = (y * g->gw) + x;
|
tn = (y * g->gw) + x;
|
||||||
evas_object_image_smooth_scale_set(g->grid[tn].img, (!wd->nosmooth));
|
evas_object_image_smooth_scale_set(g->grid[tn].img, (!wd->nosmooth));
|
||||||
}
|
}
|
||||||
|
@ -485,13 +485,13 @@ static void
|
||||||
_grid_raise(Grid *g)
|
_grid_raise(Grid *g)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
for (y = 0; y < g->gh; y++)
|
for (y = 0; y < g->gh; y++)
|
||||||
{
|
{
|
||||||
for (x = 0; x < g->gw; x++)
|
for (x = 0; x < g->gw; x++)
|
||||||
{
|
{
|
||||||
int tn;
|
int tn;
|
||||||
|
|
||||||
tn = (y * g->gw) + x;
|
tn = (y * g->gw) + x;
|
||||||
evas_object_raise(g->grid[tn].img);
|
evas_object_raise(g->grid[tn].img);
|
||||||
}
|
}
|
||||||
|
@ -578,7 +578,7 @@ zoom_do(Evas_Object *obj, double t)
|
||||||
{
|
{
|
||||||
Eina_List *l, *l_next;
|
Eina_List *l, *l_next;
|
||||||
Grid *g;
|
Grid *g;
|
||||||
|
|
||||||
EINA_LIST_FOREACH_SAFE(wd->grids, l, l_next, g)
|
EINA_LIST_FOREACH_SAFE(wd->grids, l, l_next, g)
|
||||||
{
|
{
|
||||||
if (g->dead)
|
if (g->dead)
|
||||||
|
@ -626,7 +626,7 @@ static void
|
||||||
_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(data);
|
Widget_Data *wd = elm_widget_data_get(data);
|
||||||
// Evas_Event_Mouse_Move *ev = event_info;
|
// Evas_Event_Mouse_Move *ev = event_info;
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -658,7 +658,7 @@ _mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void
|
||||||
if (wd->long_timer) ecore_timer_del(wd->long_timer);
|
if (wd->long_timer) ecore_timer_del(wd->long_timer);
|
||||||
wd->long_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press, data);
|
wd->long_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
_mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
||||||
{
|
{
|
||||||
|
@ -677,7 +677,7 @@ _mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *
|
||||||
evas_object_smart_callback_call(data, "clicked", NULL);
|
evas_object_smart_callback_call(data, "clicked", NULL);
|
||||||
wd->on_hold = EINA_FALSE;
|
wd->on_hold = EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_NULL;
|
static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_NULL;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -708,13 +708,13 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (elm_widget_focus_get(obj))
|
if (elm_widget_focus_get(obj))
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->obj, "elm,action,focus", "elm");
|
edje_object_signal_emit(wd->obj, "elm,action,focus", "elm");
|
||||||
evas_object_focus_set(wd->obj, EINA_TRUE);
|
evas_object_focus_set(wd->obj, EINA_TRUE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->obj, "elm,action,unfocus", "elm");
|
edje_object_signal_emit(wd->obj, "elm,action,unfocus", "elm");
|
||||||
evas_object_focus_set(wd->obj, EINA_FALSE);
|
evas_object_focus_set(wd->obj, EINA_FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -724,21 +724,21 @@ _theme_hook(Evas_Object *obj)
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
elm_smart_scroller_object_theme_set(obj, wd->scr, "photocam", "base", elm_widget_style_get(obj));
|
elm_smart_scroller_object_theme_set(obj, wd->scr, "photocam", "base", elm_widget_style_get(obj));
|
||||||
// edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
|
// edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
static void
|
static void
|
||||||
_show_region_hook(void *data, Evas_Object *obj)
|
_show_region_hook(void *data, Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(data);
|
Widget_Data *wd = elm_widget_data_get(data);
|
||||||
Evas_Coord x, y, w, h;
|
Evas_Coord x, y, w, h;
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
elm_widget_show_region_get(obj, &x, &y, &w, &h);
|
elm_widget_show_region_get(obj, &x, &y, &w, &h);
|
||||||
elm_smart_scroller_child_region_show(wd->scr, x, y, w, h);
|
elm_smart_scroller_child_region_show(wd->scr, x, y, w, h);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_sizing_eval(Evas_Object *obj)
|
_sizing_eval(Evas_Object *obj)
|
||||||
|
@ -746,11 +746,11 @@ _sizing_eval(Evas_Object *obj)
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
// evas_object_size_hint_min_get(wd->scr, &minw, &minh);
|
// evas_object_size_hint_min_get(wd->scr, &minw, &minh);
|
||||||
evas_object_size_hint_max_get(wd->scr, &maxw, &maxh);
|
evas_object_size_hint_max_get(wd->scr, &maxw, &maxh);
|
||||||
// minw = -1;
|
// minw = -1;
|
||||||
// minh = -1;
|
// minh = -1;
|
||||||
// if (wd->mode != ELM_LIST_LIMIT) minw = -1;
|
// if (wd->mode != ELM_LIST_LIMIT) minw = -1;
|
||||||
evas_object_size_hint_min_set(obj, minw, minh);
|
evas_object_size_hint_min_set(obj, minw, minh);
|
||||||
evas_object_size_hint_max_set(obj, maxw, maxh);
|
evas_object_size_hint_max_set(obj, maxw, maxh);
|
||||||
}
|
}
|
||||||
|
@ -959,9 +959,9 @@ _scr_scroll(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__
|
||||||
evas_object_smart_callback_call(data, "scroll", NULL);
|
evas_object_smart_callback_call(data, "scroll", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__,
|
_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__,
|
||||||
Evas_Callback_Type type, void *event_info)
|
Evas_Callback_Type type, void *event_info)
|
||||||
{
|
{
|
||||||
double zoom;
|
double zoom;
|
||||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||||
|
@ -984,41 +984,41 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__,
|
||||||
elm_smart_scroller_page_size_get(wd->scr, &page_x, &page_y);
|
elm_smart_scroller_page_size_get(wd->scr, &page_x, &page_y);
|
||||||
elm_smart_scroller_child_viewport_size_get(wd->scr, &v_w, &v_h);
|
elm_smart_scroller_child_viewport_size_get(wd->scr, &v_w, &v_h);
|
||||||
|
|
||||||
if ((!strcmp(ev->keyname, "Left")) ||
|
if ((!strcmp(ev->keyname, "Left")) ||
|
||||||
(!strcmp(ev->keyname, "KP_Left")))
|
(!strcmp(ev->keyname, "KP_Left")))
|
||||||
{
|
{
|
||||||
x -= step_x;
|
x -= step_x;
|
||||||
}
|
}
|
||||||
else if ((!strcmp(ev->keyname, "Right")) ||
|
else if ((!strcmp(ev->keyname, "Right")) ||
|
||||||
(!strcmp(ev->keyname, "KP_Right")))
|
(!strcmp(ev->keyname, "KP_Right")))
|
||||||
{
|
{
|
||||||
x += step_x;
|
x += step_x;
|
||||||
}
|
}
|
||||||
else if ((!strcmp(ev->keyname, "Up")) ||
|
else if ((!strcmp(ev->keyname, "Up")) ||
|
||||||
(!strcmp(ev->keyname, "KP_Up")))
|
(!strcmp(ev->keyname, "KP_Up")))
|
||||||
{
|
{
|
||||||
y -= step_y;
|
y -= step_y;
|
||||||
}
|
}
|
||||||
else if ((!strcmp(ev->keyname, "Down")) ||
|
else if ((!strcmp(ev->keyname, "Down")) ||
|
||||||
(!strcmp(ev->keyname, "KP_Down")))
|
(!strcmp(ev->keyname, "KP_Down")))
|
||||||
{
|
{
|
||||||
y += step_y;
|
y += step_y;
|
||||||
}
|
}
|
||||||
else if ((!strcmp(ev->keyname, "Prior")) ||
|
else if ((!strcmp(ev->keyname, "Prior")) ||
|
||||||
(!strcmp(ev->keyname, "KP_Prior")))
|
(!strcmp(ev->keyname, "KP_Prior")))
|
||||||
{
|
{
|
||||||
if (page_y < 0)
|
if (page_y < 0)
|
||||||
y -= -(page_y * v_h) / 100;
|
y -= -(page_y * v_h) / 100;
|
||||||
else
|
else
|
||||||
y -= page_y;
|
y -= page_y;
|
||||||
}
|
}
|
||||||
else if ((!strcmp(ev->keyname, "Next")) ||
|
else if ((!strcmp(ev->keyname, "Next")) ||
|
||||||
(!strcmp(ev->keyname, "KP_Next")))
|
(!strcmp(ev->keyname, "KP_Next")))
|
||||||
{
|
{
|
||||||
if (page_y < 0)
|
if (page_y < 0)
|
||||||
y += -(page_y * v_h) / 100;
|
y += -(page_y * v_h) / 100;
|
||||||
else
|
else
|
||||||
y += page_y;
|
y += page_y;
|
||||||
}
|
}
|
||||||
else if ((!strcmp(ev->keyname, "KP_Add")))
|
else if ((!strcmp(ev->keyname, "KP_Add")))
|
||||||
{
|
{
|
||||||
|
@ -1027,7 +1027,7 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__,
|
||||||
elm_photocam_zoom_mode_set(obj, ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
|
elm_photocam_zoom_mode_set(obj, ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
|
||||||
elm_photocam_zoom_set(obj, zoom);
|
elm_photocam_zoom_set(obj, zoom);
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
else if ((!strcmp(ev->keyname, "KP_Subtract")))
|
else if ((!strcmp(ev->keyname, "KP_Subtract")))
|
||||||
{
|
{
|
||||||
zoom = elm_photocam_zoom_get(obj);
|
zoom = elm_photocam_zoom_get(obj);
|
||||||
|
@ -1063,7 +1063,7 @@ elm_photocam_add(Evas_Object *parent)
|
||||||
Eina_Bool bounce = _elm_config->thumbscroll_bounce_enable;
|
Eina_Bool bounce = _elm_config->thumbscroll_bounce_enable;
|
||||||
|
|
||||||
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
||||||
|
|
||||||
ELM_SET_WIDTYPE(widtype, "photocam");
|
ELM_SET_WIDTYPE(widtype, "photocam");
|
||||||
elm_widget_type_set(obj, "photocam");
|
elm_widget_type_set(obj, "photocam");
|
||||||
elm_widget_sub_object_add(parent, obj);
|
elm_widget_sub_object_add(parent, obj);
|
||||||
|
@ -1086,7 +1086,7 @@ elm_photocam_add(Evas_Object *parent)
|
||||||
evas_object_smart_callback_add(wd->scr, "drag,start", _scr_drag_start, obj);
|
evas_object_smart_callback_add(wd->scr, "drag,start", _scr_drag_start, obj);
|
||||||
evas_object_smart_callback_add(wd->scr, "drag,stop", _scr_drag_stop, obj);
|
evas_object_smart_callback_add(wd->scr, "drag,stop", _scr_drag_stop, obj);
|
||||||
evas_object_smart_callback_add(wd->scr, "scroll", _scr_scroll, obj);
|
evas_object_smart_callback_add(wd->scr, "scroll", _scr_scroll, obj);
|
||||||
|
|
||||||
elm_smart_scroller_bounce_allow_set(wd->scr, bounce, bounce);
|
elm_smart_scroller_bounce_allow_set(wd->scr, bounce, bounce);
|
||||||
|
|
||||||
wd->obj = obj;
|
wd->obj = obj;
|
||||||
|
@ -1095,38 +1095,38 @@ elm_photocam_add(Evas_Object *parent)
|
||||||
evas_object_smart_callback_add(obj, "scroll-hold-off", _hold_off, obj);
|
evas_object_smart_callback_add(obj, "scroll-hold-off", _hold_off, obj);
|
||||||
evas_object_smart_callback_add(obj, "scroll-freeze-on", _freeze_on, obj);
|
evas_object_smart_callback_add(obj, "scroll-freeze-on", _freeze_on, obj);
|
||||||
evas_object_smart_callback_add(obj, "scroll-freeze-off", _freeze_off, obj);
|
evas_object_smart_callback_add(obj, "scroll-freeze-off", _freeze_off, obj);
|
||||||
|
|
||||||
if (!smart)
|
if (!smart)
|
||||||
{
|
{
|
||||||
static Evas_Smart_Class sc;
|
static Evas_Smart_Class sc;
|
||||||
|
|
||||||
evas_object_smart_clipped_smart_set(&_pan_sc);
|
evas_object_smart_clipped_smart_set(&_pan_sc);
|
||||||
sc = _pan_sc;
|
sc = _pan_sc;
|
||||||
sc.name = "elm_photocam_pan";
|
sc.name = "elm_photocam_pan";
|
||||||
sc.version = EVAS_SMART_CLASS_VERSION;
|
sc.version = EVAS_SMART_CLASS_VERSION;
|
||||||
sc.add = _pan_add;
|
sc.add = _pan_add;
|
||||||
sc.del = _pan_del;
|
sc.del = _pan_del;
|
||||||
sc.resize = _pan_resize;
|
sc.resize = _pan_resize;
|
||||||
sc.move = _pan_move;
|
sc.move = _pan_move;
|
||||||
sc.calculate = _pan_calculate;
|
sc.calculate = _pan_calculate;
|
||||||
smart = evas_smart_class_new(&sc);
|
smart = evas_smart_class_new(&sc);
|
||||||
}
|
}
|
||||||
if (smart)
|
if (smart)
|
||||||
{
|
{
|
||||||
wd->pan_smart = evas_object_smart_add(e, smart);
|
wd->pan_smart = evas_object_smart_add(e, smart);
|
||||||
wd->pan = evas_object_smart_data_get(wd->pan_smart);
|
wd->pan = evas_object_smart_data_get(wd->pan_smart);
|
||||||
wd->pan->wd = wd;
|
wd->pan->wd = wd;
|
||||||
}
|
}
|
||||||
|
|
||||||
elm_smart_scroller_extern_pan_set(wd->scr, wd->pan_smart,
|
elm_smart_scroller_extern_pan_set(wd->scr, wd->pan_smart,
|
||||||
_pan_set, _pan_get, _pan_max_get,
|
_pan_set, _pan_get, _pan_max_get,
|
||||||
_pan_min_get, _pan_child_size_get);
|
_pan_min_get, _pan_child_size_get);
|
||||||
|
|
||||||
wd->zoom = 1;
|
wd->zoom = 1;
|
||||||
wd->mode = ELM_PHOTOCAM_ZOOM_MODE_MANUAL;
|
wd->mode = ELM_PHOTOCAM_ZOOM_MODE_MANUAL;
|
||||||
|
|
||||||
wd->tsize = 512;
|
wd->tsize = 512;
|
||||||
|
|
||||||
wd->img = evas_object_image_add(e);
|
wd->img = evas_object_image_add(e);
|
||||||
evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
|
evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
|
||||||
evas_object_event_callback_add(wd->img, EVAS_CALLBACK_MOUSE_DOWN,
|
evas_object_event_callback_add(wd->img, EVAS_CALLBACK_MOUSE_DOWN,
|
||||||
|
@ -1141,8 +1141,8 @@ elm_photocam_add(Evas_Object *parent)
|
||||||
evas_object_image_filled_set(wd->img, 1);
|
evas_object_image_filled_set(wd->img, 1);
|
||||||
evas_object_event_callback_add(wd->img, EVAS_CALLBACK_IMAGE_PRELOADED,
|
evas_object_event_callback_add(wd->img, EVAS_CALLBACK_IMAGE_PRELOADED,
|
||||||
_main_preloaded, obj);
|
_main_preloaded, obj);
|
||||||
|
|
||||||
edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr),
|
edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr),
|
||||||
&minw, &minh);
|
&minw, &minh);
|
||||||
evas_object_size_hint_min_set(obj, minw, minh);
|
evas_object_size_hint_min_set(obj, minw, minh);
|
||||||
|
|
||||||
|
@ -1175,7 +1175,7 @@ elm_photocam_file_set(Evas_Object *obj, const char *file)
|
||||||
if (!wd) return EVAS_LOAD_ERROR_GENERIC;
|
if (!wd) return EVAS_LOAD_ERROR_GENERIC;
|
||||||
if (!eina_stringshare_replace(&wd->file, file)) return EVAS_LOAD_ERROR_NONE;
|
if (!eina_stringshare_replace(&wd->file, file)) return EVAS_LOAD_ERROR_NONE;
|
||||||
grid_clearall(obj);
|
grid_clearall(obj);
|
||||||
|
|
||||||
evas_object_hide(wd->img);
|
evas_object_hide(wd->img);
|
||||||
evas_object_image_smooth_scale_set(wd->img, (wd->nosmooth == 0));
|
evas_object_image_smooth_scale_set(wd->img, (wd->nosmooth == 0));
|
||||||
evas_object_image_file_set(wd->img, NULL, NULL);
|
evas_object_image_file_set(wd->img, NULL, NULL);
|
||||||
|
@ -1220,7 +1220,7 @@ elm_photocam_file_set(Evas_Object *obj, const char *file)
|
||||||
* Returns the path of the current image file
|
* Returns the path of the current image file
|
||||||
*
|
*
|
||||||
* @param obj The photocam object
|
* @param obj The photocam object
|
||||||
* @return Returns the path
|
* @return Returns the path
|
||||||
*
|
*
|
||||||
* @ingroup Photocam
|
* @ingroup Photocam
|
||||||
*/
|
*/
|
||||||
|
@ -1240,7 +1240,7 @@ elm_photocam_file_get(const Evas_Object *obj)
|
||||||
* (that is 2x2 photo pixels will display as 1 on-screen pixel). 4:1 will be
|
* (that is 2x2 photo pixels will display as 1 on-screen pixel). 4:1 will be
|
||||||
* 4x4 photo pixels as 1 screen pixel, and so on. The @p zoom parameter must
|
* 4x4 photo pixels as 1 screen pixel, and so on. The @p zoom parameter must
|
||||||
* be greater than 0. It is usggested to stick to powers of 2. (1, 2, 4, 8,
|
* be greater than 0. It is usggested to stick to powers of 2. (1, 2, 4, 8,
|
||||||
* 16, 32, etc.).
|
* 16, 32, etc.).
|
||||||
*
|
*
|
||||||
* @param obj The photocam object
|
* @param obj The photocam object
|
||||||
* @param zoom The zoom level to set
|
* @param zoom The zoom level to set
|
||||||
|
@ -1379,7 +1379,7 @@ elm_photocam_zoom_set(Evas_Object *obj, double zoom)
|
||||||
free(g);
|
free(g);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
wd->t_start = ecore_loop_time_get();
|
wd->t_start = ecore_loop_time_get();
|
||||||
wd->t_end = wd->t_start + _elm_config->zoom_friction;
|
wd->t_end = wd->t_start + _elm_config->zoom_friction;
|
||||||
if ((wd->size.w > 0) && (wd->size.h > 0))
|
if ((wd->size.w > 0) && (wd->size.h > 0))
|
||||||
|
@ -1531,9 +1531,9 @@ elm_photocam_image_size_get(const Evas_Object *obj, int *w, int *h)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current area of the image that is currently shown
|
* Get the current area of the image that is currently shown
|
||||||
*
|
*
|
||||||
* This gets the region
|
* This gets the region
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_photocam_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h)
|
elm_photocam_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h)
|
||||||
|
@ -1561,8 +1561,8 @@ elm_photocam_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (x) *x = 0;
|
if (x) *x = 0;
|
||||||
if (w) *w = 0;
|
if (w) *w = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wd->size.h > 0)
|
if (wd->size.h > 0)
|
||||||
|
@ -1582,8 +1582,8 @@ elm_photocam_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (y) *y = 0;
|
if (y) *y = 0;
|
||||||
if (h) *h = 0;
|
if (h) *h = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1614,7 +1614,7 @@ elm_photocam_image_region_show(Evas_Object *obj, int x, int y, int w, int h __UN
|
||||||
rh = (w * wd->size.h) / wd->size.imh;
|
rh = (w * wd->size.h) / wd->size.imh;
|
||||||
if (rw < 1) rw = 1;
|
if (rw < 1) rw = 1;
|
||||||
if (rh < 1) rh = 1;
|
if (rh < 1) rh = 1;
|
||||||
if ((rx + rw) > wd->size.w) rx = wd->size.w - rw;
|
if ((rx + rw) > wd->size.w) rx = wd->size.w - rw;
|
||||||
if ((ry + rh) > wd->size.h) ry = wd->size.h - rh;
|
if ((ry + rh) > wd->size.h) ry = wd->size.h - rh;
|
||||||
if (wd->zoom_animator)
|
if (wd->zoom_animator)
|
||||||
{
|
{
|
||||||
|
@ -1654,7 +1654,7 @@ elm_photocam_image_region_bring_in(Evas_Object *obj, int x, int y, int w, int h
|
||||||
rh = (w * wd->size.h) / wd->size.imh;
|
rh = (w * wd->size.h) / wd->size.imh;
|
||||||
if (rw < 1) rw = 1;
|
if (rw < 1) rw = 1;
|
||||||
if (rh < 1) rh = 1;
|
if (rh < 1) rh = 1;
|
||||||
if ((rx + rw) > wd->size.w) rx = wd->size.w - rw;
|
if ((rx + rw) > wd->size.w) rx = wd->size.w - rw;
|
||||||
if ((ry + rh) > wd->size.h) ry = wd->size.h - rh;
|
if ((ry + rh) > wd->size.h) ry = wd->size.h - rh;
|
||||||
if (wd->zoom_animator)
|
if (wd->zoom_animator)
|
||||||
{
|
{
|
||||||
|
@ -1664,17 +1664,17 @@ elm_photocam_image_region_bring_in(Evas_Object *obj, int x, int y, int w, int h
|
||||||
wd->zoom_animator = NULL;
|
wd->zoom_animator = NULL;
|
||||||
zoom_do(obj, 1.0);
|
zoom_do(obj, 1.0);
|
||||||
evas_object_smart_callback_call(obj, "zoom,stop", NULL);
|
evas_object_smart_callback_call(obj, "zoom,stop", NULL);
|
||||||
}
|
}
|
||||||
elm_smart_scroller_region_bring_in(wd->scr, rx, ry, rw, rh);
|
elm_smart_scroller_region_bring_in(wd->scr, rx, ry, rw, rh);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the paused state for photocam
|
* Set the paused state for photocam
|
||||||
*
|
*
|
||||||
* This sets the paused state to on (1) or off (0) for photocam. The default
|
* This sets the paused state to on (1) or off (0) for photocam. The default
|
||||||
* is on. This will stop zooming using animation ch change zoom levels and
|
* is on. This will stop zooming using animation ch change zoom levels and
|
||||||
* change instantly. This will stop any existing animations that are running.
|
* change instantly. This will stop any existing animations that are running.
|
||||||
*
|
*
|
||||||
* @param obj The photocam object
|
* @param obj The photocam object
|
||||||
* @param paused The pause state to set
|
* @param paused The pause state to set
|
||||||
*
|
*
|
||||||
|
@ -1702,9 +1702,9 @@ elm_photocam_paused_set(Evas_Object *obj, Eina_Bool paused)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the paused state for photocam
|
* Get the paused state for photocam
|
||||||
*
|
*
|
||||||
* This gets the current paused state for the photocam object.
|
* This gets the current paused state for the photocam object.
|
||||||
*
|
*
|
||||||
* @param obj The photocam object
|
* @param obj The photocam object
|
||||||
* @return The current paused state
|
* @return The current paused state
|
||||||
*
|
*
|
||||||
|
@ -1721,7 +1721,7 @@ elm_photocam_paused_get(const Evas_Object *obj)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the internal low-res image used for photocam
|
* Get the internal low-res image used for photocam
|
||||||
*
|
*
|
||||||
* This gets the internal image object inside photocam. Do not modify it. It
|
* 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
|
* is for inspection only, and hooking callbacks to. Nothing else. It may be
|
||||||
* deleted at any time as well.
|
* deleted at any time as well.
|
||||||
|
|
|
@ -82,11 +82,11 @@ _theme_hook(Evas_Object *obj)
|
||||||
_elm_theme_object_set(obj, wd->progressbar, "progressbar", "horizontal", elm_widget_style_get(obj));
|
_elm_theme_object_set(obj, wd->progressbar, "progressbar", "horizontal", elm_widget_style_get(obj));
|
||||||
else
|
else
|
||||||
_elm_theme_object_set(obj, wd->progressbar, "progressbar", "vertical", elm_widget_style_get(obj));
|
_elm_theme_object_set(obj, wd->progressbar, "progressbar", "vertical", elm_widget_style_get(obj));
|
||||||
|
|
||||||
if (wd->icon)
|
if (wd->icon)
|
||||||
{
|
{
|
||||||
edje_object_part_swallow(wd->progressbar, "elm.swallow.content", wd->icon);
|
edje_object_part_swallow(wd->progressbar, "elm.swallow.content", wd->icon);
|
||||||
edje_object_signal_emit(wd->progressbar, "elm,state,icon,visible", "elm");
|
edje_object_signal_emit(wd->progressbar, "elm,state,icon,visible", "elm");
|
||||||
}
|
}
|
||||||
if (wd->label)
|
if (wd->label)
|
||||||
{
|
{
|
||||||
|
@ -94,15 +94,15 @@ _theme_hook(Evas_Object *obj)
|
||||||
edje_object_signal_emit(wd->progressbar, "elm,state,text,visible", "elm");
|
edje_object_signal_emit(wd->progressbar, "elm,state,text,visible", "elm");
|
||||||
}
|
}
|
||||||
if (wd->pulse)
|
if (wd->pulse)
|
||||||
edje_object_signal_emit(wd->progressbar, "elm,state,pulse", "elm");
|
edje_object_signal_emit(wd->progressbar, "elm,state,pulse", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(wd->progressbar, "elm,state,fraction", "elm");
|
edje_object_signal_emit(wd->progressbar, "elm,state,fraction", "elm");
|
||||||
if (wd->pulse_state)
|
if (wd->pulse_state)
|
||||||
edje_object_signal_emit(wd->progressbar, "elm,state,pulse,start", "elm");
|
edje_object_signal_emit(wd->progressbar, "elm,state,pulse,start", "elm");
|
||||||
|
|
||||||
if ((wd->units) && (!wd->pulse))
|
if ((wd->units) && (!wd->pulse))
|
||||||
edje_object_signal_emit(wd->progressbar, "elm,state,units,visible", "elm");
|
edje_object_signal_emit(wd->progressbar, "elm,state,units,visible", "elm");
|
||||||
|
|
||||||
if (wd->horizontal)
|
if (wd->horizontal)
|
||||||
evas_object_size_hint_min_set(wd->spacer, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale, 1);
|
evas_object_size_hint_min_set(wd->spacer, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale, 1);
|
||||||
else
|
else
|
||||||
|
@ -111,8 +111,8 @@ _theme_hook(Evas_Object *obj)
|
||||||
edje_object_part_swallow(wd->progressbar, "elm.swallow.bar", wd->spacer);
|
edje_object_part_swallow(wd->progressbar, "elm.swallow.bar", wd->spacer);
|
||||||
|
|
||||||
if (wd->inverted)
|
if (wd->inverted)
|
||||||
edje_object_signal_emit(wd->progressbar, "elm,state,inverted,on", "elm");
|
edje_object_signal_emit(wd->progressbar, "elm,state,inverted,on", "elm");
|
||||||
|
|
||||||
_units_set(obj);
|
_units_set(obj);
|
||||||
edje_object_message_signal_process(wd->progressbar);
|
edje_object_message_signal_process(wd->progressbar);
|
||||||
edje_object_scale_set(wd->progressbar, elm_widget_scale_get(obj) * _elm_config->scale);
|
edje_object_scale_set(wd->progressbar, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||||
|
@ -148,12 +148,12 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (sub == wd->icon)
|
if (sub == wd->icon)
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->progressbar, "elm,state,icon,hidden", "elm");
|
edje_object_signal_emit(wd->progressbar, "elm,state,icon,hidden", "elm");
|
||||||
evas_object_event_callback_del_full
|
evas_object_event_callback_del_full
|
||||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
|
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
|
||||||
wd->icon = NULL;
|
wd->icon = NULL;
|
||||||
edje_object_message_signal_process(wd->progressbar);
|
edje_object_message_signal_process(wd->progressbar);
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,8 +167,8 @@ _val_set(Evas_Object *obj)
|
||||||
pos = wd->val;
|
pos = wd->val;
|
||||||
rtl = elm_widget_mirrored_get(obj);
|
rtl = elm_widget_mirrored_get(obj);
|
||||||
if ((!rtl && wd->inverted) || (rtl &&
|
if ((!rtl && wd->inverted) || (rtl &&
|
||||||
((!wd->horizontal && wd->inverted) ||
|
((!wd->horizontal && wd->inverted) ||
|
||||||
(wd->horizontal && !wd->inverted)))) pos = MAX_RATIO_LVL - pos;
|
(wd->horizontal && !wd->inverted)))) pos = MAX_RATIO_LVL - pos;
|
||||||
edje_object_part_drag_value_set(wd->progressbar, "elm.cur.progressbar", pos, pos);
|
edje_object_part_drag_value_set(wd->progressbar, "elm.cur.progressbar", pos, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ elm_progressbar_add(Evas_Object *parent)
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
|
|
||||||
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
||||||
|
|
||||||
ELM_SET_WIDTYPE(widtype, "progressbar");
|
ELM_SET_WIDTYPE(widtype, "progressbar");
|
||||||
elm_widget_type_set(obj, "progressbar");
|
elm_widget_type_set(obj, "progressbar");
|
||||||
elm_widget_sub_object_add(parent, obj);
|
elm_widget_sub_object_add(parent, obj);
|
||||||
|
@ -359,13 +359,13 @@ elm_progressbar_label_set(Evas_Object *obj, const char *label)
|
||||||
eina_stringshare_replace(&wd->label, label);
|
eina_stringshare_replace(&wd->label, label);
|
||||||
if (label)
|
if (label)
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->progressbar, "elm,state,text,visible", "elm");
|
edje_object_signal_emit(wd->progressbar, "elm,state,text,visible", "elm");
|
||||||
edje_object_message_signal_process(wd->progressbar);
|
edje_object_message_signal_process(wd->progressbar);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->progressbar, "elm,state,text,hidden", "elm");
|
edje_object_signal_emit(wd->progressbar, "elm,state,text,hidden", "elm");
|
||||||
edje_object_message_signal_process(wd->progressbar);
|
edje_object_message_signal_process(wd->progressbar);
|
||||||
}
|
}
|
||||||
edje_object_part_text_set(wd->progressbar, "elm.text", label);
|
edje_object_part_text_set(wd->progressbar, "elm.text", label);
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
|
@ -411,12 +411,12 @@ elm_progressbar_icon_set(Evas_Object *obj, Evas_Object *icon)
|
||||||
wd->icon = icon;
|
wd->icon = icon;
|
||||||
if (icon)
|
if (icon)
|
||||||
{
|
{
|
||||||
elm_widget_sub_object_add(obj, icon);
|
elm_widget_sub_object_add(obj, icon);
|
||||||
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||||
_changed_size_hints, obj);
|
_changed_size_hints, obj);
|
||||||
edje_object_part_swallow(wd->progressbar, "elm.swallow.content", icon);
|
edje_object_part_swallow(wd->progressbar, "elm.swallow.content", icon);
|
||||||
edje_object_signal_emit(wd->progressbar, "elm,state,icon,visible", "elm");
|
edje_object_signal_emit(wd->progressbar, "elm,state,icon,visible", "elm");
|
||||||
edje_object_message_signal_process(wd->progressbar);
|
edje_object_message_signal_process(wd->progressbar);
|
||||||
}
|
}
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
}
|
}
|
||||||
|
@ -530,13 +530,13 @@ elm_progressbar_unit_format_set(Evas_Object *obj, const char *units)
|
||||||
eina_stringshare_replace(&wd->units, units);
|
eina_stringshare_replace(&wd->units, units);
|
||||||
if (units)
|
if (units)
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->progressbar, "elm,state,units,visible", "elm");
|
edje_object_signal_emit(wd->progressbar, "elm,state,units,visible", "elm");
|
||||||
edje_object_message_signal_process(wd->progressbar);
|
edje_object_message_signal_process(wd->progressbar);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->progressbar, "elm,state,units,hidden", "elm");
|
edje_object_signal_emit(wd->progressbar, "elm,state,units,hidden", "elm");
|
||||||
edje_object_message_signal_process(wd->progressbar);
|
edje_object_message_signal_process(wd->progressbar);
|
||||||
}
|
}
|
||||||
_units_set(obj);
|
_units_set(obj);
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
|
|
|
@ -108,13 +108,13 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (elm_widget_focus_get(obj))
|
if (elm_widget_focus_get(obj))
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->radio, "elm,action,focus", "elm");
|
edje_object_signal_emit(wd->radio, "elm,action,focus", "elm");
|
||||||
evas_object_focus_set(wd->radio, EINA_TRUE);
|
evas_object_focus_set(wd->radio, EINA_TRUE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->radio, "elm,action,unfocus", "elm");
|
edje_object_signal_emit(wd->radio, "elm,action,unfocus", "elm");
|
||||||
evas_object_focus_set(wd->radio, EINA_FALSE);
|
evas_object_focus_set(wd->radio, EINA_FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,11 +201,11 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (sub == wd->icon)
|
if (sub == wd->icon)
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->radio, "elm,state,icon,hidden", "elm");
|
edje_object_signal_emit(wd->radio, "elm,state,icon,hidden", "elm");
|
||||||
evas_object_event_callback_del_full
|
evas_object_event_callback_del_full
|
||||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
|
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
|
||||||
wd->icon = NULL;
|
wd->icon = NULL;
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,11 +216,11 @@ _state_set(Evas_Object *obj, Eina_Bool state)
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if ((state != wd->state) && (!elm_widget_disabled_get(obj)))
|
if ((state != wd->state) && (!elm_widget_disabled_get(obj)))
|
||||||
{
|
{
|
||||||
wd->state = state;
|
wd->state = state;
|
||||||
if (wd->state)
|
if (wd->state)
|
||||||
edje_object_signal_emit(wd->radio, "elm,state,radio,on", "elm");
|
edje_object_signal_emit(wd->radio, "elm,state,radio,on", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(wd->radio, "elm,state,radio,off", "elm");
|
edje_object_signal_emit(wd->radio, "elm,state,radio,off", "elm");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,14 +232,14 @@ _state_set_all(Widget_Data *wd)
|
||||||
Eina_Bool disabled = EINA_FALSE;
|
Eina_Bool disabled = EINA_FALSE;
|
||||||
EINA_LIST_FOREACH(wd->group->radios, l, child)
|
EINA_LIST_FOREACH(wd->group->radios, l, child)
|
||||||
{
|
{
|
||||||
Widget_Data *wd2 = elm_widget_data_get(child);
|
Widget_Data *wd2 = elm_widget_data_get(child);
|
||||||
if (wd2->state) selected = child;
|
if (wd2->state) selected = child;
|
||||||
if (wd2->value == wd->group->value)
|
if (wd2->value == wd->group->value)
|
||||||
{
|
{
|
||||||
_state_set(child, 1);
|
_state_set(child, 1);
|
||||||
if (!wd2->state) disabled = EINA_TRUE;
|
if (!wd2->state) disabled = EINA_TRUE;
|
||||||
}
|
}
|
||||||
else _state_set(child, 0);
|
else _state_set(child, 0);
|
||||||
}
|
}
|
||||||
if ((disabled) && (selected)) _state_set(selected, 1);
|
if ((disabled) && (selected)) _state_set(selected, 1);
|
||||||
}
|
}
|
||||||
|
@ -269,13 +269,13 @@ _signal_radio_on(void *data, Evas_Object *obj __UNUSED__, const char *emission _
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new radio to the parent
|
* Add a new radio to the parent
|
||||||
*
|
*
|
||||||
* @param parent The parent object
|
* @param parent The parent object
|
||||||
* @return The new object or NULL if it cannot be created
|
* @return The new object or NULL if it cannot be created
|
||||||
*
|
*
|
||||||
* @ingroup Radio
|
* @ingroup Radio
|
||||||
*/
|
*/
|
||||||
EAPI Evas_Object *
|
EAPI Evas_Object *
|
||||||
elm_radio_add(Evas_Object *parent)
|
elm_radio_add(Evas_Object *parent)
|
||||||
{
|
{
|
||||||
|
@ -284,7 +284,7 @@ elm_radio_add(Evas_Object *parent)
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
|
|
||||||
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
||||||
|
|
||||||
ELM_SET_WIDTYPE(widtype, "radio");
|
ELM_SET_WIDTYPE(widtype, "radio");
|
||||||
elm_widget_type_set(obj, "radio");
|
elm_widget_type_set(obj, "radio");
|
||||||
elm_widget_sub_object_add(parent, obj);
|
elm_widget_sub_object_add(parent, obj);
|
||||||
|
@ -335,13 +335,13 @@ elm_radio_label_set(Evas_Object *obj, const char *label)
|
||||||
eina_stringshare_replace(&wd->label, label);
|
eina_stringshare_replace(&wd->label, label);
|
||||||
if (label)
|
if (label)
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->radio, "elm,state,text,visible", "elm");
|
edje_object_signal_emit(wd->radio, "elm,state,text,visible", "elm");
|
||||||
edje_object_message_signal_process(wd->radio);
|
edje_object_message_signal_process(wd->radio);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->radio, "elm,state,text,hidden", "elm");
|
edje_object_signal_emit(wd->radio, "elm,state,text,hidden", "elm");
|
||||||
edje_object_message_signal_process(wd->radio);
|
edje_object_message_signal_process(wd->radio);
|
||||||
}
|
}
|
||||||
edje_object_part_text_set(wd->radio, "elm.text", label);
|
edje_object_part_text_set(wd->radio, "elm.text", label);
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
|
@ -387,12 +387,12 @@ elm_radio_icon_set(Evas_Object *obj, Evas_Object *icon)
|
||||||
wd->icon = icon;
|
wd->icon = icon;
|
||||||
if (icon)
|
if (icon)
|
||||||
{
|
{
|
||||||
elm_widget_sub_object_add(obj, icon);
|
elm_widget_sub_object_add(obj, icon);
|
||||||
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||||
_changed_size_hints, obj);
|
_changed_size_hints, obj);
|
||||||
edje_object_part_swallow(wd->radio, "elm.swallow.content", icon);
|
edje_object_part_swallow(wd->radio, "elm.swallow.content", icon);
|
||||||
edje_object_signal_emit(wd->radio, "elm,state,icon,visible", "elm");
|
edje_object_signal_emit(wd->radio, "elm,state,icon,visible", "elm");
|
||||||
edje_object_message_signal_process(wd->radio);
|
edje_object_message_signal_process(wd->radio);
|
||||||
}
|
}
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
}
|
}
|
||||||
|
@ -460,19 +460,19 @@ elm_radio_group_add(Evas_Object *obj, Evas_Object *group)
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (!wd2)
|
if (!wd2)
|
||||||
{
|
{
|
||||||
if (eina_list_count(wd->group->radios) == 1)
|
if (eina_list_count(wd->group->radios) == 1)
|
||||||
return;
|
return;
|
||||||
wd->group->radios = eina_list_remove(wd->group->radios, obj);
|
wd->group->radios = eina_list_remove(wd->group->radios, obj);
|
||||||
wd->group = calloc(1, sizeof(Group));
|
wd->group = calloc(1, sizeof(Group));
|
||||||
wd->group->radios = eina_list_append(wd->group->radios, obj);
|
wd->group->radios = eina_list_append(wd->group->radios, obj);
|
||||||
}
|
}
|
||||||
else if (wd->group == wd2->group) return;
|
else if (wd->group == wd2->group) return;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wd->group->radios = eina_list_remove(wd->group->radios, obj);
|
wd->group->radios = eina_list_remove(wd->group->radios, obj);
|
||||||
if (!wd->group->radios) free(wd->group);
|
if (!wd->group->radios) free(wd->group);
|
||||||
wd->group = wd2->group;
|
wd->group = wd2->group;
|
||||||
wd->group->radios = eina_list_append(wd->group->radios, obj);
|
wd->group->radios = eina_list_append(wd->group->radios, obj);
|
||||||
}
|
}
|
||||||
if (wd->value == wd->group->value) _state_set(obj, 1);
|
if (wd->value == wd->group->value) _state_set(obj, 1);
|
||||||
else _state_set(obj, 0);
|
else _state_set(obj, 0);
|
||||||
|
@ -581,15 +581,15 @@ elm_radio_value_pointer_set(Evas_Object *obj, int *valuep)
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (valuep)
|
if (valuep)
|
||||||
{
|
{
|
||||||
wd->group->valuep = valuep;
|
wd->group->valuep = valuep;
|
||||||
if (*(wd->group->valuep) != wd->group->value)
|
if (*(wd->group->valuep) != wd->group->value)
|
||||||
{
|
{
|
||||||
wd->group->value = *(wd->group->valuep);
|
wd->group->value = *(wd->group->valuep);
|
||||||
_state_set_all(wd);
|
_state_set_all(wd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wd->group->valuep = NULL;
|
wd->group->valuep = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,17 +129,17 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty
|
||||||
}
|
}
|
||||||
else if ((!strcmp(ev->keyname, "Prior")) || (!strcmp(ev->keyname, "KP_Prior")))
|
else if ((!strcmp(ev->keyname, "Prior")) || (!strcmp(ev->keyname, "KP_Prior")))
|
||||||
{
|
{
|
||||||
if (page_y < 0)
|
if (page_y < 0)
|
||||||
y -= -(page_y * v_h) / 100;
|
y -= -(page_y * v_h) / 100;
|
||||||
else
|
else
|
||||||
y -= page_y;
|
y -= page_y;
|
||||||
}
|
}
|
||||||
else if ((!strcmp(ev->keyname, "Next")) || (!strcmp(ev->keyname, "KP_Next")))
|
else if ((!strcmp(ev->keyname, "Next")) || (!strcmp(ev->keyname, "KP_Next")))
|
||||||
{
|
{
|
||||||
if (page_y < 0)
|
if (page_y < 0)
|
||||||
y += -(page_y * v_h) / 100;
|
y += -(page_y * v_h) / 100;
|
||||||
else
|
else
|
||||||
y += page_y;
|
y += page_y;
|
||||||
}
|
}
|
||||||
else return EINA_FALSE;
|
else return EINA_FALSE;
|
||||||
|
|
||||||
|
@ -194,10 +194,10 @@ _theme_hook(Evas_Object *obj)
|
||||||
const char *str;
|
const char *str;
|
||||||
|
|
||||||
_mirrored_set(obj, elm_widget_mirrored_get(obj));
|
_mirrored_set(obj, elm_widget_mirrored_get(obj));
|
||||||
elm_smart_scroller_object_theme_set(obj, wd->scr,
|
elm_smart_scroller_object_theme_set(obj, wd->scr,
|
||||||
wd->widget_name, wd->widget_base,
|
wd->widget_name, wd->widget_base,
|
||||||
elm_widget_style_get(obj));
|
elm_widget_style_get(obj));
|
||||||
// edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
|
// edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||||
edj = elm_smart_scroller_edje_object_get(wd->scr);
|
edj = elm_smart_scroller_edje_object_get(wd->scr);
|
||||||
str = edje_object_data_get(edj, "focus_highlight");
|
str = edje_object_data_get(edj, "focus_highlight");
|
||||||
if ((str) && (!strcmp(str, "on")))
|
if ((str) && (!strcmp(str, "on")))
|
||||||
|
@ -221,7 +221,7 @@ _elm_scroller_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, E
|
||||||
|
|
||||||
/* Try Focus cycle in subitem */
|
/* Try Focus cycle in subitem */
|
||||||
if ((elm_widget_can_focus_get(cur)) || (elm_widget_child_can_focus_get(cur)))
|
if ((elm_widget_can_focus_get(cur)) || (elm_widget_child_can_focus_get(cur)))
|
||||||
return elm_widget_focus_next_get(cur, dir, next);
|
return elm_widget_focus_next_get(cur, dir, next);
|
||||||
|
|
||||||
/* Return */
|
/* Return */
|
||||||
*next = (Evas_Object *)obj;
|
*next = (Evas_Object *)obj;
|
||||||
|
@ -234,7 +234,7 @@ _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source)
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr),
|
edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr),
|
||||||
emission, source);
|
emission, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -243,7 +243,7 @@ _signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *so
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
edje_object_signal_callback_add(elm_smart_scroller_edje_object_get(wd->scr),
|
edje_object_signal_callback_add(elm_smart_scroller_edje_object_get(wd->scr),
|
||||||
emission, source, func_cb, data);
|
emission, source, func_cb, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -251,8 +251,8 @@ _signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *so
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
edje_object_signal_callback_del_full(
|
edje_object_signal_callback_del_full(
|
||||||
elm_smart_scroller_edje_object_get(wd->scr), emission, source,
|
elm_smart_scroller_edje_object_get(wd->scr), emission, source,
|
||||||
func_cb, data);
|
func_cb, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -331,11 +331,11 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (sub == wd->content)
|
if (sub == wd->content)
|
||||||
{
|
{
|
||||||
elm_widget_on_show_region_hook_set(wd->content, NULL, NULL);
|
elm_widget_on_show_region_hook_set(wd->content, NULL, NULL);
|
||||||
evas_object_event_callback_del_full (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
evas_object_event_callback_del_full (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||||
_changed_size_hints, obj);
|
_changed_size_hints, obj);
|
||||||
wd->content = NULL;
|
wd->content = NULL;
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
}
|
}
|
||||||
else if (sub == wd->scr)
|
else if (sub == wd->scr)
|
||||||
wd->scr = NULL;
|
wd->scr = NULL;
|
||||||
|
@ -458,7 +458,7 @@ elm_scroller_add(Evas_Object *parent)
|
||||||
Evas_Coord minw, minh;
|
Evas_Coord minw, minh;
|
||||||
|
|
||||||
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
||||||
|
|
||||||
ELM_SET_WIDTYPE(widtype, "scroller");
|
ELM_SET_WIDTYPE(widtype, "scroller");
|
||||||
elm_widget_type_set(obj, "scroller");
|
elm_widget_type_set(obj, "scroller");
|
||||||
elm_widget_sub_object_add(parent, obj);
|
elm_widget_sub_object_add(parent, obj);
|
||||||
|
@ -476,13 +476,13 @@ elm_scroller_add(Evas_Object *parent)
|
||||||
|
|
||||||
wd->widget_name = eina_stringshare_add("scroller");
|
wd->widget_name = eina_stringshare_add("scroller");
|
||||||
wd->widget_base = eina_stringshare_add("base");
|
wd->widget_base = eina_stringshare_add("base");
|
||||||
|
|
||||||
wd->scr = elm_smart_scroller_add(e);
|
wd->scr = elm_smart_scroller_add(e);
|
||||||
elm_smart_scroller_widget_set(wd->scr, obj);
|
elm_smart_scroller_widget_set(wd->scr, obj);
|
||||||
_theme_hook(obj);
|
_theme_hook(obj);
|
||||||
elm_widget_resize_object_set(obj, wd->scr);
|
elm_widget_resize_object_set(obj, wd->scr);
|
||||||
evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||||
_changed_size_hints, obj);
|
_changed_size_hints, obj);
|
||||||
|
|
||||||
edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr), &minw, &minh);
|
edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr), &minw, &minh);
|
||||||
evas_object_size_hint_min_set(obj, minw, minh);
|
evas_object_size_hint_min_set(obj, minw, minh);
|
||||||
|
@ -545,12 +545,12 @@ elm_scroller_content_set(Evas_Object *obj, Evas_Object *content)
|
||||||
wd->content = content;
|
wd->content = content;
|
||||||
if (content)
|
if (content)
|
||||||
{
|
{
|
||||||
elm_widget_on_show_region_hook_set(content, _show_region_hook, obj);
|
elm_widget_on_show_region_hook_set(content, _show_region_hook, obj);
|
||||||
elm_widget_sub_object_add(obj, content);
|
elm_widget_sub_object_add(obj, content);
|
||||||
if (wd->scr)
|
if (wd->scr)
|
||||||
elm_smart_scroller_child_set(wd->scr, content);
|
elm_smart_scroller_child_set(wd->scr, content);
|
||||||
evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||||
_changed_size_hints, obj);
|
_changed_size_hints, obj);
|
||||||
}
|
}
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
}
|
}
|
||||||
|
@ -601,7 +601,7 @@ elm_scroller_content_unset(Evas_Object *obj)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set custom theme elements for the scroller
|
* Set custom theme elements for the scroller
|
||||||
*
|
*
|
||||||
* @param obj The scroller object
|
* @param obj The scroller object
|
||||||
* @param widget The widget name to use (default is "scroller")
|
* @param widget The widget name to use (default is "scroller")
|
||||||
* @param base The base name to use (default is "base")
|
* @param base The base name to use (default is "base")
|
||||||
|
@ -691,9 +691,9 @@ elm_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scro
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
const Elm_Scroller_Policy map[3] =
|
const Elm_Scroller_Policy map[3] =
|
||||||
{
|
{
|
||||||
ELM_SMART_SCROLLER_POLICY_AUTO,
|
ELM_SMART_SCROLLER_POLICY_AUTO,
|
||||||
ELM_SMART_SCROLLER_POLICY_ON,
|
ELM_SMART_SCROLLER_POLICY_ON,
|
||||||
ELM_SMART_SCROLLER_POLICY_OFF
|
ELM_SMART_SCROLLER_POLICY_OFF
|
||||||
};
|
};
|
||||||
if ((!wd) || (!wd->scr)) return;
|
if ((!wd) || (!wd->scr)) return;
|
||||||
if ((policy_h >= 3) || (policy_v >= 3)) return;
|
if ((policy_h >= 3) || (policy_v >= 3)) return;
|
||||||
|
@ -892,7 +892,7 @@ elm_scroller_region_bring_in(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_
|
||||||
*
|
*
|
||||||
* This enables or disabled event propagation from the scroller content to
|
* This enables or disabled event propagation from the scroller content to
|
||||||
* the scroller and its parent. By default event propagation is disabled.
|
* the scroller and its parent. By default event propagation is disabled.
|
||||||
*
|
*
|
||||||
* @param obj The scroller object
|
* @param obj The scroller object
|
||||||
* @param propagation If propagation is enabled or not
|
* @param propagation If propagation is enabled or not
|
||||||
*
|
*
|
||||||
|
@ -911,9 +911,9 @@ elm_scroller_propagate_events_set(Evas_Object *obj, Eina_Bool propagation)
|
||||||
/**
|
/**
|
||||||
* Get event propagation for a scroller
|
* Get event propagation for a scroller
|
||||||
*
|
*
|
||||||
* This gets the event propagation for a scroller. See
|
* This gets the event propagation for a scroller. See
|
||||||
* elm_scroller_propagate_events_set() for more information
|
* elm_scroller_propagate_events_set() for more information
|
||||||
*
|
*
|
||||||
* @param obj The scroller object
|
* @param obj The scroller object
|
||||||
* @return The propagation state
|
* @return The propagation state
|
||||||
*
|
*
|
||||||
|
|
|
@ -82,7 +82,7 @@ elm_separator_add(Evas_Object *parent)
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
|
|
||||||
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
||||||
|
|
||||||
ELM_SET_WIDTYPE(widtype, "separator");
|
ELM_SET_WIDTYPE(widtype, "separator");
|
||||||
wd->horizontal = EINA_FALSE;
|
wd->horizontal = EINA_FALSE;
|
||||||
elm_widget_type_set(obj, "separator");
|
elm_widget_type_set(obj, "separator");
|
||||||
|
|
|
@ -174,13 +174,13 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (elm_widget_focus_get(obj))
|
if (elm_widget_focus_get(obj))
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->slider, "elm,action,focus", "elm");
|
edje_object_signal_emit(wd->slider, "elm,action,focus", "elm");
|
||||||
evas_object_focus_set(wd->slider, EINA_TRUE);
|
evas_object_focus_set(wd->slider, EINA_TRUE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->slider, "elm,action,unfocus", "elm");
|
edje_object_signal_emit(wd->slider, "elm,action,unfocus", "elm");
|
||||||
evas_object_focus_set(wd->slider, EINA_FALSE);
|
evas_object_focus_set(wd->slider, EINA_FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,18 +217,18 @@ _theme_hook(Evas_Object *obj)
|
||||||
edje_object_part_text_set(wd->slider, "elm.text", wd->label);
|
edje_object_part_text_set(wd->slider, "elm.text", wd->label);
|
||||||
edje_object_signal_emit(wd->slider, "elm,state,text,visible", "elm");
|
edje_object_signal_emit(wd->slider, "elm,state,text,visible", "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wd->units)
|
if (wd->units)
|
||||||
edje_object_signal_emit(wd->slider, "elm,state,units,visible", "elm");
|
edje_object_signal_emit(wd->slider, "elm,state,units,visible", "elm");
|
||||||
|
|
||||||
if (wd->horizontal)
|
if (wd->horizontal)
|
||||||
evas_object_size_hint_min_set(wd->spacer, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale, 1);
|
evas_object_size_hint_min_set(wd->spacer, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale, 1);
|
||||||
else
|
else
|
||||||
evas_object_size_hint_min_set(wd->spacer, 1, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale);
|
evas_object_size_hint_min_set(wd->spacer, 1, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale);
|
||||||
|
|
||||||
if (wd->inverted)
|
if (wd->inverted)
|
||||||
edje_object_signal_emit(wd->slider, "elm,state,inverted,on", "elm");
|
edje_object_signal_emit(wd->slider, "elm,state,inverted,on", "elm");
|
||||||
|
|
||||||
edje_object_part_swallow(wd->slider, "elm.swallow.bar", wd->spacer);
|
edje_object_part_swallow(wd->slider, "elm.swallow.bar", wd->spacer);
|
||||||
_units_set(obj);
|
_units_set(obj);
|
||||||
_indicator_set(obj);
|
_indicator_set(obj);
|
||||||
|
@ -244,14 +244,14 @@ _disable_hook(Evas_Object *obj)
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (elm_widget_disabled_get(obj))
|
if (elm_widget_disabled_get(obj))
|
||||||
edje_object_signal_emit(wd->slider, "elm,state,disabled", "elm");
|
edje_object_signal_emit(wd->slider, "elm,state,disabled", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(wd->slider, "elm,state,enabled", "elm");
|
edje_object_signal_emit(wd->slider, "elm,state,enabled", "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_sizing_eval(Evas_Object *obj)
|
_sizing_eval(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
@ -279,12 +279,12 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (sub == wd->icon)
|
if (sub == wd->icon)
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->slider, "elm,state,icon,hidden", "elm");
|
edje_object_signal_emit(wd->slider, "elm,state,icon,hidden", "elm");
|
||||||
evas_object_event_callback_del_full
|
evas_object_event_callback_del_full
|
||||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
|
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
|
||||||
wd->icon = NULL;
|
wd->icon = NULL;
|
||||||
edje_object_message_signal_process(wd->slider);
|
edje_object_message_signal_process(wd->slider);
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
}
|
}
|
||||||
if (sub == wd->end)
|
if (sub == wd->end)
|
||||||
{
|
{
|
||||||
|
@ -316,21 +316,21 @@ _val_fetch(Evas_Object *obj)
|
||||||
double posx = 0.0, posy = 0.0, pos = 0.0, val;
|
double posx = 0.0, posy = 0.0, pos = 0.0, val;
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
edje_object_part_drag_value_get(wd->slider, "elm.dragable.slider",
|
edje_object_part_drag_value_get(wd->slider, "elm.dragable.slider",
|
||||||
&posx, &posy);
|
&posx, &posy);
|
||||||
if (wd->horizontal) pos = posx;
|
if (wd->horizontal) pos = posx;
|
||||||
else pos = posy;
|
else pos = posy;
|
||||||
|
|
||||||
rtl = elm_widget_mirrored_get(obj);
|
rtl = elm_widget_mirrored_get(obj);
|
||||||
if ((!rtl && wd->inverted) || (rtl &&
|
if ((!rtl && wd->inverted) || (rtl &&
|
||||||
((!wd->horizontal && wd->inverted) ||
|
((!wd->horizontal && wd->inverted) ||
|
||||||
(wd->horizontal && !wd->inverted)))) pos = 1.0 - pos;
|
(wd->horizontal && !wd->inverted)))) pos = 1.0 - pos;
|
||||||
val = (pos * (wd->val_max - wd->val_min)) + wd->val_min;
|
val = (pos * (wd->val_max - wd->val_min)) + wd->val_min;
|
||||||
if (val != wd->val)
|
if (val != wd->val)
|
||||||
{
|
{
|
||||||
wd->val = val;
|
wd->val = val;
|
||||||
evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
|
evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
|
||||||
if (wd->delay) ecore_timer_del(wd->delay);
|
if (wd->delay) ecore_timer_del(wd->delay);
|
||||||
wd->delay = ecore_timer_add(0.2, _delay_change, obj);
|
wd->delay = ecore_timer_add(0.2, _delay_change, obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -350,8 +350,8 @@ _val_set(Evas_Object *obj)
|
||||||
|
|
||||||
rtl = elm_widget_mirrored_get(obj);
|
rtl = elm_widget_mirrored_get(obj);
|
||||||
if ((!rtl && wd->inverted) || (rtl &&
|
if ((!rtl && wd->inverted) || (rtl &&
|
||||||
((!wd->horizontal && wd->inverted) ||
|
((!wd->horizontal && wd->inverted) ||
|
||||||
(wd->horizontal && !wd->inverted)))) pos = 1.0 - pos;
|
(wd->horizontal && !wd->inverted)))) pos = 1.0 - pos;
|
||||||
edje_object_part_drag_value_set(wd->slider, "elm.dragable.slider", pos, pos);
|
edje_object_part_drag_value_set(wd->slider, "elm.dragable.slider", pos, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -362,10 +362,10 @@ _units_set(Evas_Object *obj)
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (wd->units)
|
if (wd->units)
|
||||||
{
|
{
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), wd->units, wd->val);
|
snprintf(buf, sizeof(buf), wd->units, wd->val);
|
||||||
edje_object_part_text_set(wd->slider, "elm.units", buf);
|
edje_object_part_text_set(wd->slider, "elm.units", buf);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
edje_object_part_text_set(wd->slider, "elm.units", NULL);
|
edje_object_part_text_set(wd->slider, "elm.units", NULL);
|
||||||
|
@ -378,15 +378,15 @@ _indicator_set(Evas_Object *obj)
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (wd->indicator_format_func)
|
if (wd->indicator_format_func)
|
||||||
{
|
{
|
||||||
const char *buf;
|
const char *buf;
|
||||||
buf = wd->indicator_format_func(wd->val);
|
buf = wd->indicator_format_func(wd->val);
|
||||||
edje_object_part_text_set(wd->slider, "elm.dragable.slider:elm.indicator", buf);
|
edje_object_part_text_set(wd->slider, "elm.dragable.slider:elm.indicator", buf);
|
||||||
}
|
}
|
||||||
else if (wd->indicator)
|
else if (wd->indicator)
|
||||||
{
|
{
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
snprintf(buf, sizeof(buf), wd->indicator, wd->val);
|
snprintf(buf, sizeof(buf), wd->indicator, wd->val);
|
||||||
edje_object_part_text_set(wd->slider, "elm.dragable.slider:elm.indicator", buf);
|
edje_object_part_text_set(wd->slider, "elm.dragable.slider:elm.indicator", buf);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
edje_object_part_text_set(wd->slider, "elm.dragable.slider:elm.indicator", NULL);
|
edje_object_part_text_set(wd->slider, "elm.dragable.slider:elm.indicator", NULL);
|
||||||
|
@ -463,7 +463,7 @@ _spacer_cb(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *event_info)
|
||||||
Evas_Event_Mouse_Down *ev = event_info;
|
Evas_Event_Mouse_Down *ev = event_info;
|
||||||
Evas_Coord x, y, w, h;
|
Evas_Coord x, y, w, h;
|
||||||
double button_x, button_y;
|
double button_x, button_y;
|
||||||
|
|
||||||
evas_object_geometry_get(wd->spacer, &x, &y, &w, &h);
|
evas_object_geometry_get(wd->spacer, &x, &y, &w, &h);
|
||||||
edje_object_part_drag_value_get(wd->slider, "elm.dragable.slider", &button_x, &button_y);
|
edje_object_part_drag_value_get(wd->slider, "elm.dragable.slider", &button_x, &button_y);
|
||||||
if (wd->horizontal)
|
if (wd->horizontal)
|
||||||
|
@ -472,7 +472,7 @@ _spacer_cb(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *event_info)
|
||||||
if (button_x > 1) button_x = 1;
|
if (button_x > 1) button_x = 1;
|
||||||
if (button_x < 0) button_x = 0;
|
if (button_x < 0) button_x = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
button_y = ((double)ev->output.y - (double)y) / (double)h;
|
button_y = ((double)ev->output.y - (double)y) / (double)h;
|
||||||
if (button_y > 1) button_y = 1;
|
if (button_y > 1) button_y = 1;
|
||||||
|
@ -480,7 +480,7 @@ _spacer_cb(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *event_info)
|
||||||
}
|
}
|
||||||
edje_object_part_drag_value_set(wd->slider, "elm.dragable.slider", button_x, button_y);
|
edje_object_part_drag_value_set(wd->slider, "elm.dragable.slider", button_x, button_y);
|
||||||
evas_event_feed_mouse_cancel(e, 0, NULL);
|
evas_event_feed_mouse_cancel(e, 0, NULL);
|
||||||
evas_event_feed_mouse_down(e, 1, EVAS_BUTTON_NONE, 0, NULL);
|
evas_event_feed_mouse_down(e, 1, EVAS_BUTTON_NONE, 0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -499,7 +499,7 @@ elm_slider_add(Evas_Object *parent)
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
|
|
||||||
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
||||||
|
|
||||||
ELM_SET_WIDTYPE(widtype, "slider");
|
ELM_SET_WIDTYPE(widtype, "slider");
|
||||||
elm_widget_type_set(obj, "slider");
|
elm_widget_type_set(obj, "slider");
|
||||||
elm_widget_sub_object_add(parent, obj);
|
elm_widget_sub_object_add(parent, obj);
|
||||||
|
@ -525,7 +525,7 @@ elm_slider_add(Evas_Object *parent)
|
||||||
edje_object_signal_callback_add(wd->slider, "drag,stop", "*", _drag_stop, obj);
|
edje_object_signal_callback_add(wd->slider, "drag,stop", "*", _drag_stop, obj);
|
||||||
edje_object_signal_callback_add(wd->slider, "drag,step", "*", _drag_step, obj);
|
edje_object_signal_callback_add(wd->slider, "drag,step", "*", _drag_step, obj);
|
||||||
edje_object_signal_callback_add(wd->slider, "drag,page", "*", _drag_stop, obj);
|
edje_object_signal_callback_add(wd->slider, "drag,page", "*", _drag_stop, obj);
|
||||||
// edje_object_signal_callback_add(wd->slider, "drag,set", "*", _drag_stop, obj);
|
// edje_object_signal_callback_add(wd->slider, "drag,set", "*", _drag_stop, obj);
|
||||||
edje_object_part_drag_value_set(wd->slider, "elm.dragable.slider", 0.0, 0.0);
|
edje_object_part_drag_value_set(wd->slider, "elm.dragable.slider", 0.0, 0.0);
|
||||||
|
|
||||||
wd->spacer = evas_object_rectangle_add(e);
|
wd->spacer = evas_object_rectangle_add(e);
|
||||||
|
@ -562,13 +562,13 @@ elm_slider_label_set(Evas_Object *obj, const char *label)
|
||||||
eina_stringshare_replace(&wd->label, label);
|
eina_stringshare_replace(&wd->label, label);
|
||||||
if (label)
|
if (label)
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->slider, "elm,state,text,visible", "elm");
|
edje_object_signal_emit(wd->slider, "elm,state,text,visible", "elm");
|
||||||
edje_object_message_signal_process(wd->slider);
|
edje_object_message_signal_process(wd->slider);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->slider, "elm,state,text,hidden", "elm");
|
edje_object_signal_emit(wd->slider, "elm,state,text,hidden", "elm");
|
||||||
edje_object_message_signal_process(wd->slider);
|
edje_object_message_signal_process(wd->slider);
|
||||||
}
|
}
|
||||||
edje_object_part_text_set(wd->slider, "elm.text", label);
|
edje_object_part_text_set(wd->slider, "elm.text", label);
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
|
@ -617,12 +617,12 @@ elm_slider_icon_set(Evas_Object *obj, Evas_Object *icon)
|
||||||
wd->icon = icon;
|
wd->icon = icon;
|
||||||
if (icon)
|
if (icon)
|
||||||
{
|
{
|
||||||
elm_widget_sub_object_add(obj, icon);
|
elm_widget_sub_object_add(obj, icon);
|
||||||
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||||
_changed_size_hints, obj);
|
_changed_size_hints, obj);
|
||||||
edje_object_part_swallow(wd->slider, "elm.swallow.icon", icon);
|
edje_object_part_swallow(wd->slider, "elm.swallow.icon", icon);
|
||||||
edje_object_signal_emit(wd->slider, "elm,state,icon,visible", "elm");
|
edje_object_signal_emit(wd->slider, "elm,state,icon,visible", "elm");
|
||||||
edje_object_message_signal_process(wd->slider);
|
edje_object_message_signal_process(wd->slider);
|
||||||
}
|
}
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
}
|
}
|
||||||
|
@ -648,12 +648,12 @@ elm_slider_icon_unset(Evas_Object *obj)
|
||||||
if (!wd) return NULL;
|
if (!wd) return NULL;
|
||||||
if (wd->icon)
|
if (wd->icon)
|
||||||
{
|
{
|
||||||
elm_widget_sub_object_del(obj, wd->icon);
|
elm_widget_sub_object_del(obj, wd->icon);
|
||||||
ret = wd->icon;
|
ret = wd->icon;
|
||||||
edje_object_part_unswallow(wd->slider, wd->icon);
|
edje_object_part_unswallow(wd->slider, wd->icon);
|
||||||
edje_object_signal_emit(wd->slider, "elm,state,icon,hidden", "elm");
|
edje_object_signal_emit(wd->slider, "elm,state,icon,hidden", "elm");
|
||||||
wd->icon = NULL;
|
wd->icon = NULL;
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -702,9 +702,9 @@ elm_slider_span_size_set(Evas_Object *obj, Evas_Coord size)
|
||||||
else
|
else
|
||||||
evas_object_size_hint_min_set(wd->spacer, 1, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale);
|
evas_object_size_hint_min_set(wd->spacer, 1, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale);
|
||||||
if (wd->indicator_show)
|
if (wd->indicator_show)
|
||||||
edje_object_signal_emit(wd->slider, "elm,state,val,show", "elm");
|
edje_object_signal_emit(wd->slider, "elm,state,val,show", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(wd->slider, "elm,state,val,hide", "elm");
|
edje_object_signal_emit(wd->slider, "elm,state,val,hide", "elm");
|
||||||
edje_object_part_swallow(wd->slider, "elm.swallow.bar", wd->spacer);
|
edje_object_part_swallow(wd->slider, "elm.swallow.bar", wd->spacer);
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
}
|
}
|
||||||
|
@ -753,13 +753,13 @@ elm_slider_unit_format_set(Evas_Object *obj, const char *units)
|
||||||
eina_stringshare_replace(&wd->units, units);
|
eina_stringshare_replace(&wd->units, units);
|
||||||
if (units)
|
if (units)
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->slider, "elm,state,units,visible", "elm");
|
edje_object_signal_emit(wd->slider, "elm,state,units,visible", "elm");
|
||||||
edje_object_message_signal_process(wd->slider);
|
edje_object_message_signal_process(wd->slider);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->slider, "elm,state,units,hidden", "elm");
|
edje_object_signal_emit(wd->slider, "elm,state,units,hidden", "elm");
|
||||||
edje_object_message_signal_process(wd->slider);
|
edje_object_message_signal_process(wd->slider);
|
||||||
}
|
}
|
||||||
_units_set(obj);
|
_units_set(obj);
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
|
@ -1053,12 +1053,12 @@ elm_slider_end_set(Evas_Object *obj, Evas_Object *end)
|
||||||
wd->end = end;
|
wd->end = end;
|
||||||
if (end)
|
if (end)
|
||||||
{
|
{
|
||||||
elm_widget_sub_object_add(obj, end);
|
elm_widget_sub_object_add(obj, end);
|
||||||
evas_object_event_callback_add(end, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
evas_object_event_callback_add(end, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||||
_changed_size_hints, obj);
|
_changed_size_hints, obj);
|
||||||
edje_object_part_swallow(wd->slider, "elm.swallow.end", end);
|
edje_object_part_swallow(wd->slider, "elm.swallow.end", end);
|
||||||
edje_object_signal_emit(wd->slider, "elm,state,end,visible", "elm");
|
edje_object_signal_emit(wd->slider, "elm,state,end,visible", "elm");
|
||||||
edje_object_message_signal_process(wd->slider);
|
edje_object_message_signal_process(wd->slider);
|
||||||
}
|
}
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
}
|
}
|
||||||
|
@ -1084,12 +1084,12 @@ elm_slider_end_unset(Evas_Object *obj)
|
||||||
if (!wd) return NULL;
|
if (!wd) return NULL;
|
||||||
if (wd->end)
|
if (wd->end)
|
||||||
{
|
{
|
||||||
elm_widget_sub_object_del(obj, wd->end);
|
elm_widget_sub_object_del(obj, wd->end);
|
||||||
ret = wd->end;
|
ret = wd->end;
|
||||||
edje_object_part_unswallow(wd->slider, wd->end);
|
edje_object_part_unswallow(wd->slider, wd->end);
|
||||||
edje_object_signal_emit(wd->slider, "elm,state,end,hidden", "elm");
|
edje_object_signal_emit(wd->slider, "elm,state,end,hidden", "elm");
|
||||||
wd->end = NULL;
|
wd->end = NULL;
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1130,12 +1130,12 @@ elm_slider_indicator_show_set(Evas_Object *obj, Eina_Bool show)
|
||||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
if (show) {
|
if (show) {
|
||||||
wd->indicator_show = EINA_TRUE;
|
wd->indicator_show = EINA_TRUE;
|
||||||
edje_object_signal_emit(wd->slider, "elm,state,val,show", "elm");
|
edje_object_signal_emit(wd->slider, "elm,state,val,show", "elm");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
wd->indicator_show = EINA_FALSE;
|
wd->indicator_show = EINA_FALSE;
|
||||||
edje_object_signal_emit(wd->slider, "elm,state,val,hide", "elm");
|
edje_object_signal_emit(wd->slider, "elm,state,val,hide", "elm");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,8 +45,8 @@ struct _Widget_Data
|
||||||
Eina_Bool loop:1;
|
Eina_Bool loop:1;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
const char *current;
|
const char *current;
|
||||||
Eina_List *list; //list of const char *
|
Eina_List *list; //list of const char *
|
||||||
} layout;
|
} layout;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ _del_hook(Evas_Object *obj)
|
||||||
elm_widget_stringlist_free(wd->transitions);
|
elm_widget_stringlist_free(wd->transitions);
|
||||||
if (wd->timer) ecore_timer_del(wd->timer);
|
if (wd->timer) ecore_timer_del(wd->timer);
|
||||||
EINA_LIST_FREE(wd->layout.list, layout)
|
EINA_LIST_FREE(wd->layout.list, layout)
|
||||||
eina_stringshare_del(layout);
|
eina_stringshare_del(layout);
|
||||||
free(wd);
|
free(wd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,13 +123,13 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (elm_widget_focus_get(obj))
|
if (elm_widget_focus_get(obj))
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->slideshow, "elm,action,focus", "elm");
|
edje_object_signal_emit(wd->slideshow, "elm,action,focus", "elm");
|
||||||
evas_object_focus_set(wd->slideshow, EINA_TRUE);
|
evas_object_focus_set(wd->slideshow, EINA_TRUE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->slideshow, "elm,action,unfocus", "elm");
|
edje_object_signal_emit(wd->slideshow, "elm,action,unfocus", "elm");
|
||||||
evas_object_focus_set(wd->slideshow, EINA_FALSE);
|
evas_object_focus_set(wd->slideshow, EINA_FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,20 +168,20 @@ _sizing_eval(Evas_Object *obj)
|
||||||
|
|
||||||
static Elm_Slideshow_Item* _item_prev_get(Elm_Slideshow_Item* item)
|
static Elm_Slideshow_Item* _item_prev_get(Elm_Slideshow_Item* item)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
||||||
Elm_Slideshow_Item* prev = eina_list_data_get(eina_list_prev(item->l));
|
Elm_Slideshow_Item* prev = eina_list_data_get(eina_list_prev(item->l));
|
||||||
if((!prev) && (wd->loop))
|
if((!prev) && (wd->loop))
|
||||||
prev = eina_list_data_get(eina_list_last(item->l));
|
prev = eina_list_data_get(eina_list_last(item->l));
|
||||||
return prev;
|
return prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Elm_Slideshow_Item* _item_next_get(Elm_Slideshow_Item* item)
|
static Elm_Slideshow_Item* _item_next_get(Elm_Slideshow_Item* item)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
||||||
Elm_Slideshow_Item* next = eina_list_data_get(eina_list_next(item->l));
|
Elm_Slideshow_Item* next = eina_list_data_get(eina_list_next(item->l));
|
||||||
if((!next) && (wd->loop))
|
if((!next) && (wd->loop))
|
||||||
next = eina_list_data_get(wd->items);
|
next = eina_list_data_get(wd->items);
|
||||||
return next;
|
return next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -256,28 +256,28 @@ _item_realize(Elm_Slideshow_Item *item)
|
||||||
static void
|
static void
|
||||||
_end(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
|
_end(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
|
||||||
{
|
{
|
||||||
Elm_Slideshow_Item *item;
|
Elm_Slideshow_Item *item;
|
||||||
Widget_Data *wd = elm_widget_data_get(data);
|
Widget_Data *wd = elm_widget_data_get(data);
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
item = wd->previous;
|
item = wd->previous;
|
||||||
if(item)
|
if(item)
|
||||||
{
|
{
|
||||||
edje_object_part_unswallow(NULL, item->base.view);
|
edje_object_part_unswallow(NULL, item->base.view);
|
||||||
evas_object_hide(item->base.view);
|
evas_object_hide(item->base.view);
|
||||||
wd->previous = NULL;
|
wd->previous = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
item = wd->current;
|
item = wd->current;
|
||||||
if ((!item) || (!item->base.view)) return;
|
if ((!item) || (!item->base.view)) return;
|
||||||
|
|
||||||
_item_realize(item);
|
_item_realize(item);
|
||||||
edje_object_part_unswallow(NULL, item->base.view);
|
edje_object_part_unswallow(NULL, item->base.view);
|
||||||
evas_object_show(item->base.view);
|
evas_object_show(item->base.view);
|
||||||
|
|
||||||
edje_object_signal_emit(wd->slideshow, "anim,end", "slideshow");
|
edje_object_signal_emit(wd->slideshow, "anim,end", "slideshow");
|
||||||
edje_object_part_swallow(wd->slideshow, "elm.swallow.1", item->base.view);
|
edje_object_part_swallow(wd->slideshow, "elm.swallow.1", item->base.view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ elm_slideshow_add(Evas_Object *parent)
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
|
|
||||||
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
||||||
|
|
||||||
ELM_SET_WIDTYPE(widtype, "slideshow");
|
ELM_SET_WIDTYPE(widtype, "slideshow");
|
||||||
elm_widget_type_set(obj, "slideshow");
|
elm_widget_type_set(obj, "slideshow");
|
||||||
elm_widget_sub_object_add(parent, obj);
|
elm_widget_sub_object_add(parent, obj);
|
||||||
|
@ -336,7 +336,7 @@ elm_slideshow_add(Evas_Object *parent)
|
||||||
|
|
||||||
wd->layout.list = elm_widget_stringlist_get(edje_object_data_get(wd->slideshow, "layouts"));
|
wd->layout.list = elm_widget_stringlist_get(edje_object_data_get(wd->slideshow, "layouts"));
|
||||||
if (eina_list_count(wd->layout.list) > 0)
|
if (eina_list_count(wd->layout.list) > 0)
|
||||||
wd->layout.current = eina_list_data_get(wd->layout.list);
|
wd->layout.current = eina_list_data_get(wd->layout.list);
|
||||||
|
|
||||||
edje_object_signal_callback_add(wd->slideshow, "end", "slideshow", _end, obj);
|
edje_object_signal_callback_add(wd->slideshow, "end", "slideshow", _end, obj);
|
||||||
|
|
||||||
|
@ -404,7 +404,7 @@ elm_slideshow_show(Elm_Slideshow_Item *item)
|
||||||
|
|
||||||
if (wd->timer) ecore_timer_del(wd->timer);
|
if (wd->timer) ecore_timer_del(wd->timer);
|
||||||
if (wd->timeout > 0.0)
|
if (wd->timeout > 0.0)
|
||||||
wd->timer = ecore_timer_add(wd->timeout, _timer_cb, item->base.widget);
|
wd->timer = ecore_timer_add(wd->timeout, _timer_cb, item->base.widget);
|
||||||
_item_realize(next);
|
_item_realize(next);
|
||||||
edje_object_part_swallow(wd->slideshow, "elm.swallow.2", next->base.view);
|
edje_object_part_swallow(wd->slideshow, "elm.swallow.2", next->base.view);
|
||||||
evas_object_show(next->base.view);
|
evas_object_show(next->base.view);
|
||||||
|
@ -431,9 +431,9 @@ elm_slideshow_next(Evas_Object *obj)
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
|
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
if (wd->current)
|
if (wd->current)
|
||||||
next = _item_next_get(wd->current);
|
next = _item_next_get(wd->current);
|
||||||
|
|
||||||
if ((!next) || (next == wd->current)) return;
|
if ((!next) || (next == wd->current)) return;
|
||||||
|
|
||||||
|
@ -441,7 +441,7 @@ elm_slideshow_next(Evas_Object *obj)
|
||||||
|
|
||||||
if (wd->timer) ecore_timer_del(wd->timer);
|
if (wd->timer) ecore_timer_del(wd->timer);
|
||||||
if (wd->timeout > 0.0)
|
if (wd->timeout > 0.0)
|
||||||
wd->timer = ecore_timer_add(wd->timeout, _timer_cb, obj);
|
wd->timer = ecore_timer_add(wd->timeout, _timer_cb, obj);
|
||||||
|
|
||||||
_item_realize(next);
|
_item_realize(next);
|
||||||
|
|
||||||
|
@ -482,7 +482,7 @@ elm_slideshow_previous(Evas_Object *obj)
|
||||||
|
|
||||||
if (wd->timer) ecore_timer_del(wd->timer);
|
if (wd->timer) ecore_timer_del(wd->timer);
|
||||||
if (wd->timeout > 0.0)
|
if (wd->timeout > 0.0)
|
||||||
wd->timer = ecore_timer_add(wd->timeout, _timer_cb, obj);
|
wd->timer = ecore_timer_add(wd->timeout, _timer_cb, obj);
|
||||||
|
|
||||||
_item_realize(prev);
|
_item_realize(prev);
|
||||||
|
|
||||||
|
@ -686,24 +686,24 @@ elm_slideshow_loop_get(const Evas_Object *obj)
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_slideshow_clear(Evas_Object *obj)
|
elm_slideshow_clear(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Elm_Slideshow_Item *item;
|
Elm_Slideshow_Item *item;
|
||||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
wd->previous = NULL;
|
wd->previous = NULL;
|
||||||
wd->current = NULL;
|
wd->current = NULL;
|
||||||
EINA_LIST_FREE(wd->items_built, item)
|
EINA_LIST_FREE(wd->items_built, item)
|
||||||
{
|
{
|
||||||
if (item->itc->func.del)
|
if (item->itc->func.del)
|
||||||
item->itc->func.del((void*)item->base.data, item->base.view);
|
item->itc->func.del((void*)item->base.data, item->base.view);
|
||||||
evas_object_del(item->base.view);
|
evas_object_del(item->base.view);
|
||||||
item->base.view = NULL;
|
item->base.view = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
EINA_LIST_FREE(wd->items, item)
|
EINA_LIST_FREE(wd->items, item)
|
||||||
{
|
{
|
||||||
elm_widget_item_del(item);
|
elm_widget_item_del(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -718,28 +718,28 @@ EAPI void
|
||||||
elm_slideshow_item_del(Elm_Slideshow_Item *item)
|
elm_slideshow_item_del(Elm_Slideshow_Item *item)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
||||||
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (wd->previous == item) wd->previous = NULL;
|
if (wd->previous == item) wd->previous = NULL;
|
||||||
if (wd->current == item)
|
if (wd->current == item)
|
||||||
{
|
{
|
||||||
Eina_List *l = eina_list_data_find_list(wd->items, item);
|
Eina_List *l = eina_list_data_find_list(wd->items, item);
|
||||||
Eina_List *l2 = eina_list_next(l);
|
Eina_List *l2 = eina_list_next(l);
|
||||||
wd->current = NULL;
|
wd->current = NULL;
|
||||||
if (!l2)
|
if (!l2)
|
||||||
l2 = eina_list_nth_list(wd->items, eina_list_count(wd->items) - 1);
|
l2 = eina_list_nth_list(wd->items, eina_list_count(wd->items) - 1);
|
||||||
if (l2)
|
if (l2)
|
||||||
elm_slideshow_show(eina_list_data_get(l2));
|
elm_slideshow_show(eina_list_data_get(l2));
|
||||||
}
|
}
|
||||||
|
|
||||||
wd->items = eina_list_remove_list(wd->items, item->l);
|
wd->items = eina_list_remove_list(wd->items, item->l);
|
||||||
wd->items_built = eina_list_remove_list(wd->items_built, item->l_built);
|
wd->items_built = eina_list_remove_list(wd->items_built, item->l_built);
|
||||||
|
|
||||||
if ((item->base.view) && (item->itc->func.del))
|
if ((item->base.view) && (item->itc->func.del))
|
||||||
item->itc->func.del((void*)item->base.data, item->base.view);
|
item->itc->func.del((void*)item->base.data, item->base.view);
|
||||||
if (item->base.view)
|
if (item->base.view)
|
||||||
evas_object_del(item->base.view);
|
evas_object_del(item->base.view);
|
||||||
free(item);
|
free(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -150,13 +150,13 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (elm_widget_focus_get(obj))
|
if (elm_widget_focus_get(obj))
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->spinner, "elm,action,focus", "elm");
|
edje_object_signal_emit(wd->spinner, "elm,action,focus", "elm");
|
||||||
evas_object_focus_set(wd->spinner, EINA_TRUE);
|
evas_object_focus_set(wd->spinner, EINA_TRUE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->spinner, "elm,action,unfocus", "elm");
|
edje_object_signal_emit(wd->spinner, "elm,action,unfocus", "elm");
|
||||||
evas_object_focus_set(wd->spinner, EINA_FALSE);
|
evas_object_focus_set(wd->spinner, EINA_FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,31 +183,31 @@ _entry_show(Widget_Data *wd)
|
||||||
const char *start = strchr(wd->label, '%');
|
const char *start = strchr(wd->label, '%');
|
||||||
while (start)
|
while (start)
|
||||||
{
|
{
|
||||||
/* handle %% */
|
/* handle %% */
|
||||||
if (start[1] != '%')
|
if (start[1] != '%')
|
||||||
break;
|
break;
|
||||||
else
|
else
|
||||||
start = strchr(start + 2, '%');
|
start = strchr(start + 2, '%');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (start)
|
if (start)
|
||||||
{
|
{
|
||||||
const char *itr, *end = NULL;
|
const char *itr, *end = NULL;
|
||||||
for (itr = start + 1; *itr != '\0'; itr++)
|
for (itr = start + 1; *itr != '\0'; itr++)
|
||||||
{
|
{
|
||||||
/* allowing '%d' is quite dangerous, remove it? */
|
/* allowing '%d' is quite dangerous, remove it? */
|
||||||
if ((*itr == 'd') || (*itr == 'f'))
|
if ((*itr == 'd') || (*itr == 'f'))
|
||||||
{
|
{
|
||||||
end = itr + 1;
|
end = itr + 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((end) && ((size_t)(end - start + 1) < sizeof(fmt)))
|
if ((end) && ((size_t)(end - start + 1) < sizeof(fmt)))
|
||||||
{
|
{
|
||||||
memcpy(fmt, start, end - start);
|
memcpy(fmt, start, end - start);
|
||||||
fmt[end - start] = '\0';
|
fmt[end - start] = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
snprintf(buf, sizeof(buf), fmt, wd->val);
|
snprintf(buf, sizeof(buf), fmt, wd->val);
|
||||||
|
@ -240,7 +240,7 @@ apply:
|
||||||
if (wd->entry_visible) _entry_show(wd);
|
if (wd->entry_visible) _entry_show(wd);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_value_set(Evas_Object *obj, double delta)
|
_value_set(Evas_Object *obj, double delta)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
|
@ -286,12 +286,12 @@ _sizing_eval(Evas_Object *obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
static void
|
static void
|
||||||
_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
_sizing_eval(data);
|
_sizing_eval(data);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_val_set(Evas_Object *obj)
|
_val_set(Evas_Object *obj)
|
||||||
|
@ -303,7 +303,7 @@ _val_set(Evas_Object *obj)
|
||||||
pos = ((wd->val - wd->val_min) / (wd->val_max - wd->val_min));
|
pos = ((wd->val - wd->val_min) / (wd->val_max - wd->val_min));
|
||||||
if (pos < 0.0) pos = 0.0;
|
if (pos < 0.0) pos = 0.0;
|
||||||
else if (pos > 1.0) pos = 1.0;
|
else if (pos > 1.0) pos = 1.0;
|
||||||
edje_object_part_drag_value_set(wd->spinner, "elm.dragable.slider",
|
edje_object_part_drag_value_set(wd->spinner, "elm.dragable.slider",
|
||||||
pos, pos);
|
pos, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ _drag(void *data, Evas_Object *_obj __UNUSED__, const char *emission __UNUSED__,
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (wd->entry_visible) return;
|
if (wd->entry_visible) return;
|
||||||
edje_object_part_drag_value_get(wd->spinner, "elm.dragable.slider",
|
edje_object_part_drag_value_get(wd->spinner, "elm.dragable.slider",
|
||||||
&pos, NULL);
|
&pos, NULL);
|
||||||
offset = wd->step;
|
offset = wd->step;
|
||||||
delta = (pos - wd->drag_start_pos) * offset;
|
delta = (pos - wd->drag_start_pos) * offset;
|
||||||
/* If we are on rtl mode, change the delta to be negative on such changes */
|
/* If we are on rtl mode, change the delta to be negative on such changes */
|
||||||
|
@ -334,7 +334,7 @@ _drag_start(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUS
|
||||||
double pos;
|
double pos;
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
edje_object_part_drag_value_get(wd->spinner, "elm.dragable.slider",
|
edje_object_part_drag_value_get(wd->spinner, "elm.dragable.slider",
|
||||||
&pos, NULL);
|
&pos, NULL);
|
||||||
wd->drag_start_pos = pos;
|
wd->drag_start_pos = pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,7 +372,7 @@ _apply_entry_value(Evas_Object *obj)
|
||||||
const char *str;
|
const char *str;
|
||||||
char *end;
|
char *end;
|
||||||
double val;
|
double val;
|
||||||
|
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
_hide_entry(obj);
|
_hide_entry(obj);
|
||||||
str = elm_entry_entry_get(wd->ent);
|
str = elm_entry_entry_get(wd->ent);
|
||||||
|
@ -398,10 +398,10 @@ _toggle_entry(void *data, Evas_Object *obj __UNUSED__, const char *emission __UN
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wd->orig_val = wd->val;
|
wd->orig_val = wd->val;
|
||||||
edje_object_signal_emit(wd->spinner, "elm,state,active", "elm");
|
edje_object_signal_emit(wd->spinner, "elm,state,active", "elm");
|
||||||
_entry_show(wd);
|
_entry_show(wd);
|
||||||
elm_entry_select_all(wd->ent);
|
elm_entry_select_all(wd->ent);
|
||||||
elm_widget_focus_set(wd->ent, 1);
|
elm_widget_focus_set(wd->ent, 1);
|
||||||
wd->entry_visible = 1;
|
wd->entry_visible = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -551,13 +551,13 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty
|
||||||
|| !strcmp(ev->keyname, "Up") || !strcmp(ev->keyname, "KP_Up"))
|
|| !strcmp(ev->keyname, "Up") || !strcmp(ev->keyname, "KP_Up"))
|
||||||
_val_inc_stop(obj);
|
_val_inc_stop(obj);
|
||||||
else if (!strcmp(ev->keyname, "Left") || !strcmp(ev->keyname, "KP_Left")
|
else if (!strcmp(ev->keyname, "Left") || !strcmp(ev->keyname, "KP_Left")
|
||||||
|| !strcmp(ev->keyname, "Down") || !strcmp(ev->keyname, "KP_Down"))
|
|| !strcmp(ev->keyname, "Down") || !strcmp(ev->keyname, "KP_Down"))
|
||||||
_val_dec_stop(obj);
|
_val_dec_stop(obj);
|
||||||
else return EINA_FALSE;
|
else return EINA_FALSE;
|
||||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -576,7 +576,7 @@ elm_spinner_add(Evas_Object *parent)
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
|
|
||||||
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
||||||
|
|
||||||
ELM_SET_WIDTYPE(widtype, "spinner");
|
ELM_SET_WIDTYPE(widtype, "spinner");
|
||||||
elm_widget_type_set(obj, "spinner");
|
elm_widget_type_set(obj, "spinner");
|
||||||
elm_widget_sub_object_add(parent, obj);
|
elm_widget_sub_object_add(parent, obj);
|
||||||
|
@ -605,31 +605,31 @@ elm_spinner_add(Evas_Object *parent)
|
||||||
_elm_theme_object_set(obj, wd->spinner, "spinner", "base", "default");
|
_elm_theme_object_set(obj, wd->spinner, "spinner", "base", "default");
|
||||||
elm_widget_resize_object_set(obj, wd->spinner);
|
elm_widget_resize_object_set(obj, wd->spinner);
|
||||||
edje_object_signal_callback_add(wd->spinner, "drag", "*", _drag, obj);
|
edje_object_signal_callback_add(wd->spinner, "drag", "*", _drag, obj);
|
||||||
edje_object_signal_callback_add(wd->spinner, "drag,start", "*",
|
edje_object_signal_callback_add(wd->spinner, "drag,start", "*",
|
||||||
_drag_start, obj);
|
_drag_start, obj);
|
||||||
edje_object_signal_callback_add(wd->spinner, "drag,stop", "*",
|
edje_object_signal_callback_add(wd->spinner, "drag,stop", "*",
|
||||||
_drag_stop, obj);
|
_drag_stop, obj);
|
||||||
edje_object_signal_callback_add(wd->spinner, "drag,step", "*",
|
edje_object_signal_callback_add(wd->spinner, "drag,step", "*",
|
||||||
_drag_stop, obj);
|
_drag_stop, obj);
|
||||||
edje_object_signal_callback_add(wd->spinner, "drag,page", "*",
|
edje_object_signal_callback_add(wd->spinner, "drag,page", "*",
|
||||||
_drag_stop, obj);
|
_drag_stop, obj);
|
||||||
|
|
||||||
edje_object_signal_callback_add(wd->spinner, "elm,action,increment,start",
|
edje_object_signal_callback_add(wd->spinner, "elm,action,increment,start",
|
||||||
"*", _button_inc_start, obj);
|
"*", _button_inc_start, obj);
|
||||||
edje_object_signal_callback_add(wd->spinner, "elm,action,increment,stop",
|
edje_object_signal_callback_add(wd->spinner, "elm,action,increment,stop",
|
||||||
"*", _button_inc_stop, obj);
|
"*", _button_inc_stop, obj);
|
||||||
edje_object_signal_callback_add(wd->spinner, "elm,action,decrement,start",
|
edje_object_signal_callback_add(wd->spinner, "elm,action,decrement,start",
|
||||||
"*", _button_dec_start, obj);
|
"*", _button_dec_start, obj);
|
||||||
edje_object_signal_callback_add(wd->spinner, "elm,action,decrement,stop",
|
edje_object_signal_callback_add(wd->spinner, "elm,action,decrement,stop",
|
||||||
"*", _button_dec_stop, obj);
|
"*", _button_dec_stop, obj);
|
||||||
edje_object_part_drag_value_set(wd->spinner, "elm.dragable.slider",
|
edje_object_part_drag_value_set(wd->spinner, "elm.dragable.slider",
|
||||||
0.0, 0.0);
|
0.0, 0.0);
|
||||||
|
|
||||||
wd->ent = elm_entry_add(obj);
|
wd->ent = elm_entry_add(obj);
|
||||||
elm_entry_single_line_set(wd->ent, 1);
|
elm_entry_single_line_set(wd->ent, 1);
|
||||||
evas_object_smart_callback_add(wd->ent, "activated", _entry_activated, obj);
|
evas_object_smart_callback_add(wd->ent, "activated", _entry_activated, obj);
|
||||||
edje_object_part_swallow(wd->spinner, "elm.swallow.entry", wd->ent);
|
edje_object_part_swallow(wd->spinner, "elm.swallow.entry", wd->ent);
|
||||||
edje_object_signal_callback_add(wd->spinner, "elm,action,entry,toggle",
|
edje_object_signal_callback_add(wd->spinner, "elm,action,entry,toggle",
|
||||||
"*", _toggle_entry, obj);
|
"*", _toggle_entry, obj);
|
||||||
|
|
||||||
_mirrored_set(obj, elm_widget_mirrored_get(obj));
|
_mirrored_set(obj, elm_widget_mirrored_get(obj));
|
||||||
|
@ -847,18 +847,18 @@ elm_spinner_wrap_get(const Evas_Object *obj)
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_spinner_special_value_add(Evas_Object *obj, double value, const char *label)
|
elm_spinner_special_value_add(Evas_Object *obj, double value, const char *label)
|
||||||
{
|
{
|
||||||
Elm_Spinner_Special_Value *sv;
|
Elm_Spinner_Special_Value *sv;
|
||||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
sv = calloc(1, sizeof(*sv));
|
sv = calloc(1, sizeof(*sv));
|
||||||
if (!sv) return;
|
if (!sv) return;
|
||||||
sv->value = value;
|
sv->value = value;
|
||||||
sv->label = eina_stringshare_add(label);
|
sv->label = eina_stringshare_add(label);
|
||||||
|
|
||||||
wd->special_values = eina_list_append(wd->special_values, sv);
|
wd->special_values = eina_list_append(wd->special_values, sv);
|
||||||
_write_label(obj);
|
_write_label(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue