clouseau: Fixed highlight handling Added delete fade-timer on close window Added lines asociated with each bmp
Signed-off-by: Aharon Hillel <a.hillel@samsung.com> SVN revision: 72354
This commit is contained in:
parent
16edf65bca
commit
dddca2b897
|
@ -254,10 +254,7 @@ _close_app_views(app_info_st *app, Eina_Bool clr)
|
||||||
{ /* These are cleared when app data is reloaded */
|
{ /* These are cleared when app data is reloaded */
|
||||||
EINA_LIST_FREE(app->view, view)
|
EINA_LIST_FREE(app->view, view)
|
||||||
{ /* Free memory allocated to show any app screens */
|
{ /* Free memory allocated to show any app screens */
|
||||||
bmp_info_st *b = view->data;
|
bmp_blob_free(view->data);
|
||||||
if (b->bmp)
|
|
||||||
free(b->bmp);
|
|
||||||
|
|
||||||
variant_free(view);
|
variant_free(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -632,7 +629,7 @@ _app_win_del(void *data,
|
||||||
evas_object_event_callback_del(st->o, EVAS_CALLBACK_MOUSE_OUT,
|
evas_object_event_callback_del(st->o, EVAS_CALLBACK_MOUSE_OUT,
|
||||||
_mouse_out);
|
_mouse_out);
|
||||||
evas_object_event_callback_del(st->o, EVAS_CALLBACK_MOUSE_DOWN,
|
evas_object_event_callback_del(st->o, EVAS_CALLBACK_MOUSE_DOWN,
|
||||||
libclouseau_make_line);
|
libclouseau_make_lines);
|
||||||
st->win = st->bt = st->lb_mouse = st->o = NULL;
|
st->win = st->bt = st->lb_mouse = st->o = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -717,7 +714,7 @@ _open_app_window(bmp_info_st *st, Evas_Object *bt, Tree_Item *treeit)
|
||||||
_mouse_out, st);
|
_mouse_out, st);
|
||||||
|
|
||||||
evas_object_event_callback_add(st->o, EVAS_CALLBACK_MOUSE_DOWN,
|
evas_object_event_callback_add(st->o, EVAS_CALLBACK_MOUSE_DOWN,
|
||||||
libclouseau_make_line, st);
|
libclouseau_make_lines, st);
|
||||||
|
|
||||||
evas_object_resize(scr, st->w, st->h);
|
evas_object_resize(scr, st->w, st->h);
|
||||||
elm_win_resize_object_add(st->win, bx);
|
elm_win_resize_object_add(st->win, bx);
|
||||||
|
|
|
@ -1,6 +1,27 @@
|
||||||
#include "eet_data.h"
|
#include "eet_data.h"
|
||||||
static data_desc *desc = NULL;
|
static data_desc *desc = NULL;
|
||||||
|
|
||||||
|
void
|
||||||
|
lines_free(bmp_info_st *st)
|
||||||
|
{ /* Free lines asociated with a bmp */
|
||||||
|
if (st->lx)
|
||||||
|
evas_object_del(st->lx);
|
||||||
|
|
||||||
|
if (st->ly)
|
||||||
|
evas_object_del(st->ly);
|
||||||
|
|
||||||
|
st->lx = st->ly = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
bmp_blob_free(bmp_info_st *st)
|
||||||
|
{ /* We also free all lines drawn in this bmp canvas */
|
||||||
|
lines_free(st);
|
||||||
|
|
||||||
|
if (st->bmp)
|
||||||
|
free(st->bmp);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
item_tree_item_free(Tree_Item *parent)
|
item_tree_item_free(Tree_Item *parent)
|
||||||
{
|
{
|
||||||
|
@ -676,6 +697,15 @@ _verify_e_obj(Evas_Object *obj)
|
||||||
return rt;
|
return rt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
libclouseau_highlight_del(void *data,
|
||||||
|
EINA_UNUSED Evas *e,
|
||||||
|
EINA_UNUSED Evas_Object *obj,
|
||||||
|
EINA_UNUSED void *event_info)
|
||||||
|
{ /* Delete timer for this rect */
|
||||||
|
ecore_timer_del(data);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
libclouseau_highlight(Evas_Object *obj, st_evas_props *props, bmp_info_st *view)
|
libclouseau_highlight(Evas_Object *obj, st_evas_props *props, bmp_info_st *view)
|
||||||
{
|
{
|
||||||
|
@ -717,39 +747,42 @@ libclouseau_highlight(Evas_Object *obj, st_evas_props *props, bmp_info_st *view)
|
||||||
evas_object_color_set(r, HIGHLIGHT_R, HIGHLIGHT_G, HIGHLIGHT_B,
|
evas_object_color_set(r, HIGHLIGHT_R, HIGHLIGHT_G, HIGHLIGHT_B,
|
||||||
HIGHLIGHT_A);
|
HIGHLIGHT_A);
|
||||||
evas_object_show(r);
|
evas_object_show(r);
|
||||||
ecore_timer_add(0.1, libclouseau_highlight_fade, r);
|
|
||||||
|
/* Add Timer for fade and a callback to delete timer on obj del */
|
||||||
|
evas_object_event_callback_add(r, EVAS_CALLBACK_DEL,
|
||||||
|
libclouseau_highlight_del,
|
||||||
|
ecore_timer_add(0.1, libclouseau_highlight_fade, r));
|
||||||
/* Print backtrace info, saved for future ref
|
/* Print backtrace info, saved for future ref
|
||||||
tmp = evas_object_data_get(obj, ".clouseau.bt");
|
tmp = evas_object_data_get(obj, ".clouseau.bt");
|
||||||
fprintf(stderr, "Creation backtrace :\n%s*******\n", tmp); */
|
fprintf(stderr, "Creation backtrace :\n%s*******\n", tmp); */
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
libclouseau_make_line(void *data,
|
libclouseau_make_lines(void *data,
|
||||||
Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||||
void *event_info)
|
void *event_info)
|
||||||
{
|
{ /* and no, we are NOT talking about WHITE lines */
|
||||||
if (((Evas_Event_Mouse_Down *) event_info)->button == 1)
|
if (((Evas_Event_Mouse_Down *) event_info)->button == 1)
|
||||||
return; /* make line only if not left mouse button */
|
return; /* make line only if not left mouse button */
|
||||||
|
|
||||||
bmp_info_st *st = data;
|
bmp_info_st *st = data;
|
||||||
Evas_Coord xx, yy, x_bmp, y_bmp, w_bmp, h_bmp;
|
Evas_Coord xx, yy, x_bmp, y_bmp, w_bmp, h_bmp;
|
||||||
|
lines_free(st);
|
||||||
|
|
||||||
evas_object_geometry_get(st->o, &x_bmp, &y_bmp, &w_bmp, &h_bmp);
|
evas_object_geometry_get(st->o, &x_bmp, &y_bmp, &w_bmp, &h_bmp);
|
||||||
xx = (((Evas_Event_Mouse_Move *) event_info)->cur.canvas.x);
|
xx = (((Evas_Event_Mouse_Move *) event_info)->cur.canvas.x);
|
||||||
yy = (((Evas_Event_Mouse_Move *) event_info)->cur.canvas.y);
|
yy = (((Evas_Event_Mouse_Move *) event_info)->cur.canvas.y);
|
||||||
|
|
||||||
Evas_Object *lx = evas_object_line_add(evas_object_evas_get(st->o));
|
st->lx = evas_object_line_add(evas_object_evas_get(st->o));
|
||||||
evas_object_line_xy_set(lx, 0, yy, w_bmp, yy);
|
st->ly = evas_object_line_add(evas_object_evas_get(st->o));
|
||||||
Evas_Object *ly = evas_object_line_add(evas_object_evas_get(st->o));
|
|
||||||
evas_object_line_xy_set(ly, xx, 0, xx, h_bmp);
|
|
||||||
|
|
||||||
evas_object_color_set(lx, HIGHLIGHT_R, HIGHLIGHT_G, HIGHLIGHT_B,
|
evas_object_line_xy_set(st->lx, 0, yy, w_bmp, yy);
|
||||||
HIGHLIGHT_A);
|
evas_object_line_xy_set(st->ly, xx, 0, xx, h_bmp);
|
||||||
evas_object_color_set(ly, HIGHLIGHT_R, HIGHLIGHT_G, HIGHLIGHT_B,
|
|
||||||
HIGHLIGHT_A);
|
|
||||||
evas_object_show(lx);
|
|
||||||
evas_object_show(ly);
|
|
||||||
|
|
||||||
ecore_timer_add(0.1, libclouseau_highlight_fade, lx);
|
evas_object_color_set(st->lx, HIGHLIGHT_R, HIGHLIGHT_G, HIGHLIGHT_B,
|
||||||
ecore_timer_add(0.1, libclouseau_highlight_fade, ly);
|
HIGHLIGHT_A);
|
||||||
|
evas_object_color_set(st->ly, HIGHLIGHT_R, HIGHLIGHT_G, HIGHLIGHT_B,
|
||||||
|
HIGHLIGHT_A);
|
||||||
|
evas_object_show(st->lx);
|
||||||
|
evas_object_show(st->ly);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,6 +131,8 @@ struct _bmp_info_st
|
||||||
Evas_Object *lb_mouse; /* Label contains mouse cords */
|
Evas_Object *lb_mouse; /* Label contains mouse cords */
|
||||||
Evas_Object *lb_argb; /* Current mouse pos argb val */
|
Evas_Object *lb_argb; /* Current mouse pos argb val */
|
||||||
Evas_Object *bt; /* Button opening win */
|
Evas_Object *bt; /* Button opening win */
|
||||||
|
Evas_Object *lx; /* Line on X axis */
|
||||||
|
Evas_Object *ly; /* Line on Y axis */
|
||||||
void *bmp; /* Bitmap BLOB, size (w * h * sizeof(int)) */
|
void *bmp; /* Bitmap BLOB, size (w * h * sizeof(int)) */
|
||||||
};
|
};
|
||||||
typedef struct _bmp_info_st bmp_info_st;
|
typedef struct _bmp_info_st bmp_info_st;
|
||||||
|
@ -168,6 +170,9 @@ struct _data_desc
|
||||||
typedef struct _data_desc data_desc;
|
typedef struct _data_desc data_desc;
|
||||||
|
|
||||||
/* Function Declarations */
|
/* Function Declarations */
|
||||||
|
void lines_free(bmp_info_st *st);
|
||||||
|
void bmp_blob_free(bmp_info_st *st);
|
||||||
|
|
||||||
Eet_Data_Descriptor *connect_desc_make(void);
|
Eet_Data_Descriptor *connect_desc_make(void);
|
||||||
Eet_Data_Descriptor *app_add_desc_make(void);
|
Eet_Data_Descriptor *app_add_desc_make(void);
|
||||||
Eet_Data_Descriptor *data_req_desc_make(void);
|
Eet_Data_Descriptor *data_req_desc_make(void);
|
||||||
|
@ -198,5 +203,5 @@ Eina_Bool eet_info_read(const char *filename, app_info_st **app, tree_data_st **
|
||||||
|
|
||||||
/* Highlight code, we may choose to move this to other file later */
|
/* Highlight code, we may choose to move this to other file later */
|
||||||
void libclouseau_highlight(Evas_Object *obj, st_evas_props *props, bmp_info_st *view);
|
void libclouseau_highlight(Evas_Object *obj, st_evas_props *props, bmp_info_st *view);
|
||||||
void libclouseau_make_line(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info);
|
void libclouseau_make_lines(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info);
|
||||||
#endif /* EET_DATA_H */
|
#endif /* EET_DATA_H */
|
||||||
|
|
|
@ -218,7 +218,7 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Data
|
||||||
|
|
||||||
bmp_info_st t = { req->gui,
|
bmp_info_st t = { req->gui,
|
||||||
req->app, req->object , req->ctr, w, h,
|
req->app, req->object , req->ctr, w, h,
|
||||||
NULL, NULL, NULL, NULL, NULL, NULL };
|
NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL };
|
||||||
|
|
||||||
void *p = packet_compose(BMP_DATA, &t, sizeof(t), &size,
|
void *p = packet_compose(BMP_DATA, &t, sizeof(t), &size,
|
||||||
bmp, (w * h * sizeof(int)));
|
bmp, (w * h * sizeof(int)));
|
||||||
|
|
Loading…
Reference in New Issue