clouseau: Fixed naming and func visiblity
Signed-off-by: Aharon Hillel <a.hillel@samsung.com> SVN revision: 75252
This commit is contained in:
parent
a2d81eac14
commit
03d9eab42c
|
@ -95,7 +95,9 @@ _add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||||
if (svr)
|
if (svr)
|
||||||
{
|
{
|
||||||
connect_st t = { getpid(), __FILE__ };
|
connect_st t = { getpid(), __FILE__ };
|
||||||
p = packet_compose(CLOUSEAU_GUI_CLIENT_CONNECT, &t, sizeof(t), &size, NULL, 0);
|
p = clouseau_data_packet_compose(CLOUSEAU_GUI_CLIENT_CONNECT,
|
||||||
|
&t, sizeof(t), &size, NULL, 0);
|
||||||
|
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
ecore_ipc_server_send(ev->server, 0,0,0,0,EINA_FALSE, p, size);
|
ecore_ipc_server_send(ev->server, 0,0,0,0,EINA_FALSE, p, size);
|
||||||
|
@ -194,6 +196,26 @@ _del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||||
return ECORE_CALLBACK_RENEW;
|
return ECORE_CALLBACK_RENEW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clouseau_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;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clouseau_bmp_blob_free(bmp_info_st *st)
|
||||||
|
{ /* We also free all lines drawn in this bmp canvas */
|
||||||
|
clouseau_lines_free(st);
|
||||||
|
|
||||||
|
if (st->bmp)
|
||||||
|
free(st->bmp);
|
||||||
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_load_gui_with_list(gui_elements *g, Eina_List *trees)
|
_load_gui_with_list(gui_elements *g, Eina_List *trees)
|
||||||
|
@ -264,7 +286,7 @@ _close_app_views(app_info_st *app, Eina_Bool clr)
|
||||||
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 */
|
||||||
clouseau_bmp_blob_free(view->data);
|
clouseau_bmp_blob_free(view->data);
|
||||||
clouseau_variant_free(view);
|
clouseau_data_variant_free(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
app->view = NULL;
|
app->view = NULL;
|
||||||
|
@ -374,7 +396,7 @@ _remove_bmp(Eina_List *view, void *ptr)
|
||||||
if (st->bmp)
|
if (st->bmp)
|
||||||
free(st->bmp);
|
free(st->bmp);
|
||||||
|
|
||||||
clouseau_variant_free(v);
|
clouseau_data_variant_free(v);
|
||||||
return eina_list_remove(view, v);
|
return eina_list_remove(view, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,8 +428,8 @@ _free_app_tree_data(Variant_st *td)
|
||||||
if (!td) return ;
|
if (!td) return ;
|
||||||
|
|
||||||
ftd = td->data;
|
ftd = td->data;
|
||||||
clouseau_tree_free(ftd->tree);
|
clouseau_data_tree_free(ftd->tree);
|
||||||
clouseau_variant_free(td);
|
clouseau_data_variant_free(td);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -427,10 +449,10 @@ _free_app(app_data_st *st)
|
||||||
if (b->bmp)
|
if (b->bmp)
|
||||||
free(b->bmp);
|
free(b->bmp);
|
||||||
|
|
||||||
clouseau_variant_free(view);
|
clouseau_data_variant_free(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
clouseau_variant_free(st->app);
|
clouseau_data_variant_free(st->app);
|
||||||
_free_app_tree_data(st->td);
|
_free_app_tree_data(st->td);
|
||||||
free(st);
|
free(st);
|
||||||
}
|
}
|
||||||
|
@ -463,7 +485,7 @@ _remove_app(gui_elements *g, Variant_st *v)
|
||||||
_add_app_to_dd_list(g->dd_list, st);
|
_add_app_to_dd_list(g->dd_list, st);
|
||||||
}
|
}
|
||||||
|
|
||||||
clouseau_variant_free(v);
|
clouseau_data_variant_free(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -564,7 +586,7 @@ _add_bmp(gui_elements *g EINA_UNUSED, Variant_st *v)
|
||||||
This code ignores this case. */
|
This code ignores this case. */
|
||||||
elm_progressbar_pulse(g->pb, EINA_FALSE);
|
elm_progressbar_pulse(g->pb, EINA_FALSE);
|
||||||
evas_object_hide(g->pb);
|
evas_object_hide(g->pb);
|
||||||
clouseau_variant_free(v);
|
clouseau_data_variant_free(v);
|
||||||
|
|
||||||
/* Make refresh button display: screenshot NOT available */
|
/* Make refresh button display: screenshot NOT available */
|
||||||
if (nd)
|
if (nd)
|
||||||
|
@ -598,10 +620,48 @@ _add_bmp(gui_elements *g EINA_UNUSED, Variant_st *v)
|
||||||
if (st->bmp)
|
if (st->bmp)
|
||||||
free(st->bmp);
|
free(st->bmp);
|
||||||
|
|
||||||
clouseau_variant_free(v);
|
clouseau_data_variant_free(v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clouseau_make_lines(bmp_info_st *st, Evas_Coord xx, Evas_Coord yy)
|
||||||
|
{ /* and no, we are NOT talking about WHITE lines */
|
||||||
|
Evas_Coord x_rgn, y_rgn, w_rgn, h_rgn;
|
||||||
|
|
||||||
|
clouseau_lines_free(st);
|
||||||
|
|
||||||
|
elm_scroller_region_get(st->scr, &x_rgn, &y_rgn, &w_rgn, &h_rgn);
|
||||||
|
|
||||||
|
st->lx = evas_object_line_add(evas_object_evas_get(st->o));
|
||||||
|
st->ly = evas_object_line_add(evas_object_evas_get(st->o));
|
||||||
|
evas_object_repeat_events_set(st->lx, EINA_TRUE);
|
||||||
|
evas_object_repeat_events_set(st->ly, EINA_TRUE);
|
||||||
|
|
||||||
|
evas_object_line_xy_set(st->lx, 0, yy, w_rgn, yy);
|
||||||
|
evas_object_line_xy_set(st->ly, xx, 0, xx, h_rgn);
|
||||||
|
|
||||||
|
evas_object_color_set(st->lx, HIGHLIGHT_R, HIGHLIGHT_G, HIGHLIGHT_B,
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clouseau_lines_cb(void *data,
|
||||||
|
Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||||
|
void *event_info)
|
||||||
|
{
|
||||||
|
if (((Evas_Event_Mouse_Down *) event_info)->button == 1)
|
||||||
|
return; /* Draw line only if not left mouse button */
|
||||||
|
|
||||||
|
clouseau_make_lines(data,
|
||||||
|
(((Evas_Event_Mouse_Move *) event_info)->cur.canvas.x),
|
||||||
|
(((Evas_Event_Mouse_Move *) event_info)->cur.canvas.y));
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_mouse_out(void *data,
|
_mouse_out(void *data,
|
||||||
Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||||
|
@ -639,7 +699,7 @@ _mouse_move(void *data,
|
||||||
elm_object_text_set(st->lb_mouse, s_bar);
|
elm_object_text_set(st->lb_mouse, s_bar);
|
||||||
|
|
||||||
if (((Evas_Event_Mouse_Move *) event_info)->buttons > 1)
|
if (((Evas_Event_Mouse_Move *) event_info)->buttons > 1)
|
||||||
libclouseau_make_lines(st, mp_x, mp_y);
|
clouseau_make_lines(st, mp_x, mp_y);
|
||||||
|
|
||||||
if (((xx >= 0) && (xx < ((Evas_Coord) st->w))) &&
|
if (((xx >= 0) && (xx < ((Evas_Coord) st->w))) &&
|
||||||
((yy >= 0) && (yy < ((Evas_Coord) st->h))))
|
((yy >= 0) && (yy < ((Evas_Coord) st->h))))
|
||||||
|
@ -663,7 +723,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_lines_cb);
|
clouseau_lines_cb);
|
||||||
st->win = st->bt = st->lb_mouse = st->o = NULL;
|
st->win = st->bt = st->lb_mouse = st->o = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -846,7 +906,7 @@ _open_app_window(bmp_info_st *st, Evas_Object *bt, Clouseau_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_lines_cb, st);
|
clouseau_lines_cb, st);
|
||||||
|
|
||||||
evas_object_resize(st->scr, st->w, st->h);
|
evas_object_resize(st->scr, st->w, st->h);
|
||||||
elm_win_resize_object_add(st->win, bx);
|
elm_win_resize_object_add(st->win, bx);
|
||||||
|
@ -894,7 +954,9 @@ _show_app_window(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||||
(unsigned long long) (uintptr_t) st->ptr,
|
(unsigned long long) (uintptr_t) st->ptr,
|
||||||
(unsigned long long) (uintptr_t) treeit->ptr, st->refresh_ctr };
|
(unsigned long long) (uintptr_t) treeit->ptr, st->refresh_ctr };
|
||||||
|
|
||||||
void *p = packet_compose(CLOUSEAU_BMP_REQ, &t, sizeof(t), &size, NULL, 0);
|
void *p = clouseau_data_packet_compose(CLOUSEAU_BMP_REQ,
|
||||||
|
&t, sizeof(t), &size, NULL, 0);
|
||||||
|
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
ecore_ipc_server_send(svr,
|
ecore_ipc_server_send(svr,
|
||||||
|
@ -925,10 +987,10 @@ _data(void *data, int type EINA_UNUSED, void *event)
|
||||||
Ecore_Ipc_Event_Server_Data *ev = event;
|
Ecore_Ipc_Event_Server_Data *ev = event;
|
||||||
Variant_st *v;
|
Variant_st *v;
|
||||||
|
|
||||||
v = packet_info_get(ev->data, ev->size);
|
v = clouseau_data_packet_info_get(ev->data, ev->size);
|
||||||
if (!v) return ECORE_CALLBACK_RENEW;
|
if (!v) return ECORE_CALLBACK_RENEW;
|
||||||
|
|
||||||
switch (clouseau_packet_mapping_type_get(v->type))
|
switch (clouseau_data_packet_mapping_type_get(v->type))
|
||||||
{
|
{
|
||||||
case CLOUSEAU_APP_ADD: /* Add info to list of APPs */
|
case CLOUSEAU_APP_ADD: /* Add info to list of APPs */
|
||||||
_add_app(data, v); /* v->data is (app_info_st *) */
|
_add_app(data, v); /* v->data is (app_info_st *) */
|
||||||
|
@ -1196,7 +1258,7 @@ _gl_selected(void *data EINA_UNUSED, Evas_Object *pobj EINA_UNUSED,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Populate object information, then do highlight */
|
/* Populate object information, then do highlight */
|
||||||
clouseau_obj_information_list_populate(treeit, g->lb);
|
clouseau_object_information_list_populate(treeit, g->lb);
|
||||||
|
|
||||||
if (!do_highlight)
|
if (!do_highlight)
|
||||||
return;
|
return;
|
||||||
|
@ -1209,7 +1271,9 @@ _gl_selected(void *data EINA_UNUSED, Evas_Object *pobj EINA_UNUSED,
|
||||||
|
|
||||||
if (svr)
|
if (svr)
|
||||||
{
|
{
|
||||||
void *p = packet_compose(CLOUSEAU_HIGHLIGHT, &st, sizeof(st), &size, NULL, 0);
|
void *p = clouseau_data_packet_compose(CLOUSEAU_HIGHLIGHT,
|
||||||
|
&st, sizeof(st), &size, NULL, 0);
|
||||||
|
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
ecore_ipc_server_send(svr,
|
ecore_ipc_server_send(svr,
|
||||||
|
@ -1234,7 +1298,7 @@ _gl_selected(void *data EINA_UNUSED, Evas_Object *pobj EINA_UNUSED,
|
||||||
|
|
||||||
if (v)
|
if (v)
|
||||||
{ /* Third param gives evas surface when running offline */
|
{ /* Third param gives evas surface when running offline */
|
||||||
clouseau_object_highlight((void*) (uintptr_t) treeit->ptr,
|
clouseau_data_object_highlight((void*) (uintptr_t) treeit->ptr,
|
||||||
&treeit->info->evas_props, v->data);
|
&treeit->info->evas_props, v->data);
|
||||||
}
|
}
|
||||||
/* END - replacing clouseau_object_highlight(obj); */
|
/* END - replacing clouseau_object_highlight(obj); */
|
||||||
|
@ -1272,8 +1336,9 @@ _load_list(gui_elements *g)
|
||||||
data_req_st t = { (unsigned long long) (uintptr_t) NULL,
|
data_req_st t = { (unsigned long long) (uintptr_t) NULL,
|
||||||
(unsigned long long) (uintptr_t) st->ptr };
|
(unsigned long long) (uintptr_t) st->ptr };
|
||||||
|
|
||||||
void *p = packet_compose(CLOUSEAU_DATA_REQ, &t, sizeof(t), &size,
|
void *p = clouseau_data_packet_compose(CLOUSEAU_DATA_REQ,
|
||||||
NULL, 0);
|
&t, sizeof(t), &size, NULL, 0);
|
||||||
|
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
elm_progressbar_pulse(g->pb, EINA_TRUE);
|
elm_progressbar_pulse(g->pb, EINA_TRUE);
|
||||||
|
@ -1341,7 +1406,7 @@ _bt_load_file(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||||
/* app_info_st *app = NULL; */
|
/* app_info_st *app = NULL; */
|
||||||
if (event_info)
|
if (event_info)
|
||||||
{
|
{
|
||||||
Eina_Bool s = eet_info_read(event_info,
|
Eina_Bool s = clouseau_data_eet_info_read(event_info,
|
||||||
(app_info_st **) &app->data,
|
(app_info_st **) &app->data,
|
||||||
(tree_data_st **) &td->data);
|
(tree_data_st **) &td->data);
|
||||||
|
|
||||||
|
@ -1372,7 +1437,7 @@ _bt_save_file(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||||
if (event_info)
|
if (event_info)
|
||||||
{
|
{
|
||||||
/* FIXME: Handle failure. */
|
/* FIXME: Handle failure. */
|
||||||
eet_info_save(event_info, app, ftd, data);
|
clouseau_data_eet_info_save(event_info, app, ftd, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
eina_list_free(data);
|
eina_list_free(data);
|
||||||
|
@ -1525,7 +1590,9 @@ _remove_apps_with_no_tree_data(gui_elements *g)
|
||||||
(((app_info_st *) st->app->data)->ptr);
|
(((app_info_st *) st->app->data)->ptr);
|
||||||
|
|
||||||
/* v is freed by _remove_app */
|
/* v is freed by _remove_app */
|
||||||
v = clouseau_variant_alloc(CLOUSEAU_APP_CLOSED, sizeof(t), &t);
|
v = clouseau_data_variant_alloc(CLOUSEAU_APP_CLOSED,
|
||||||
|
sizeof(t), &t);
|
||||||
|
|
||||||
_remove_app(g, v); /* v->data is (app_closed_st *) */
|
_remove_app(g, v); /* v->data is (app_closed_st *) */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1727,7 +1794,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
|
||||||
/* Properties list */
|
/* Properties list */
|
||||||
{
|
{
|
||||||
Evas_Object *prop_list = NULL;
|
Evas_Object *prop_list = NULL;
|
||||||
prop_list = clouseau_obj_information_list_add(panes);
|
prop_list = clouseau_object_information_list_add(panes);
|
||||||
gui->prop_list = prop_list;
|
gui->prop_list = prop_list;
|
||||||
evas_object_size_hint_align_set(prop_list,
|
evas_object_size_hint_align_set(prop_list,
|
||||||
EVAS_HINT_FILL, EVAS_HINT_FILL);
|
EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
@ -1774,7 +1841,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
|
||||||
eina_init();
|
eina_init();
|
||||||
ecore_init();
|
ecore_init();
|
||||||
ecore_ipc_init();
|
ecore_ipc_init();
|
||||||
clouseau_init();
|
clouseau_data_init();
|
||||||
|
|
||||||
/* START - Popup to get IP, PORT from user */
|
/* START - Popup to get IP, PORT from user */
|
||||||
gui->connect_inwin = elm_win_inwin_add(win);
|
gui->connect_inwin = elm_win_inwin_add(win);
|
||||||
|
@ -1852,7 +1919,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
|
||||||
EINA_LIST_FREE(bmp_req, st)
|
EINA_LIST_FREE(bmp_req, st)
|
||||||
free(st);
|
free(st);
|
||||||
|
|
||||||
clouseau_shutdown();
|
clouseau_data_shutdown();
|
||||||
if (gui->address)
|
if (gui->address)
|
||||||
free(gui->address);
|
free(gui->address);
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ _daemon_cleanup(void)
|
||||||
gui = app = NULL;
|
gui = app = NULL;
|
||||||
ipc_svr = NULL;
|
ipc_svr = NULL;
|
||||||
|
|
||||||
clouseau_shutdown();
|
clouseau_data_shutdown();
|
||||||
ecore_ipc_shutdown();
|
ecore_ipc_shutdown();
|
||||||
ecore_shutdown();
|
ecore_shutdown();
|
||||||
eina_shutdown();
|
eina_shutdown();
|
||||||
|
@ -172,7 +172,9 @@ _del(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Del *e
|
||||||
app_closed_st t = { (unsigned long long) (uintptr_t) ev->client };
|
app_closed_st t = { (unsigned long long) (uintptr_t) ev->client };
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
int size;
|
int size;
|
||||||
void *p = packet_compose(CLOUSEAU_APP_CLOSED, &t, sizeof(t), &size, NULL, 0);
|
void *p = clouseau_data_packet_compose(CLOUSEAU_APP_CLOSED,
|
||||||
|
&t, sizeof(t), &size, NULL, 0);
|
||||||
|
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
EINA_LIST_FOREACH(gui, l, i)
|
EINA_LIST_FOREACH(gui, l, i)
|
||||||
|
@ -207,7 +209,7 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Data
|
||||||
sprintf(msg_buf, "<%s> msg from <%p>", __func__, ev->client);
|
sprintf(msg_buf, "<%s> msg from <%p>", __func__, ev->client);
|
||||||
log_message(LOG_FILE, "a", msg_buf);
|
log_message(LOG_FILE, "a", msg_buf);
|
||||||
|
|
||||||
Variant_st *v = packet_info_get(ev->data, ev->size);
|
Variant_st *v = clouseau_data_packet_info_get(ev->data, ev->size);
|
||||||
/* This is where daemon impl communication protocol.
|
/* This is where daemon impl communication protocol.
|
||||||
* In order to simplify, all messages also contains recipient ptr
|
* In order to simplify, all messages also contains recipient ptr
|
||||||
* as saved by daemon.
|
* as saved by daemon.
|
||||||
|
@ -218,7 +220,7 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Data
|
||||||
return ECORE_CALLBACK_RENEW;
|
return ECORE_CALLBACK_RENEW;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(clouseau_packet_mapping_type_get(v->type))
|
switch(clouseau_data_packet_mapping_type_get(v->type))
|
||||||
{
|
{
|
||||||
case CLOUSEAU_APP_CLIENT_CONNECT:
|
case CLOUSEAU_APP_CLIENT_CONNECT:
|
||||||
{ /* Register APP then notify GUI about it */
|
{ /* Register APP then notify GUI about it */
|
||||||
|
@ -229,7 +231,9 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Data
|
||||||
(unsigned long long) (uintptr_t) ev->client, NULL, 0 };
|
(unsigned long long) (uintptr_t) ev->client, NULL, 0 };
|
||||||
|
|
||||||
app = _add_client(app, t, ev->client);
|
app = _add_client(app, t, ev->client);
|
||||||
p = packet_compose(CLOUSEAU_APP_ADD, &m, sizeof(m), &size, NULL, 0);
|
p = clouseau_data_packet_compose(CLOUSEAU_APP_ADD,
|
||||||
|
&m, sizeof(m), &size, NULL, 0);
|
||||||
|
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
EINA_LIST_FOREACH(gui, l, st)
|
EINA_LIST_FOREACH(gui, l, st)
|
||||||
|
@ -254,8 +258,9 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Data
|
||||||
gui = _add_client(gui, t, ev->client);
|
gui = _add_client(gui, t, ev->client);
|
||||||
EINA_LIST_FOREACH(app, l, st)
|
EINA_LIST_FOREACH(app, l, st)
|
||||||
{ /* Add all registered apps to newly open GUI */
|
{ /* Add all registered apps to newly open GUI */
|
||||||
p = packet_compose(CLOUSEAU_APP_ADD, st, sizeof(*st), &size,
|
p = clouseau_data_packet_compose(CLOUSEAU_APP_ADD,
|
||||||
NULL, 0);
|
st, sizeof(*st), &size, NULL, 0);
|
||||||
|
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
ecore_ipc_client_send(ev->client,
|
ecore_ipc_client_send(ev->client,
|
||||||
|
@ -281,8 +286,9 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Data
|
||||||
(unsigned long long) (uintptr_t) ev->client,
|
(unsigned long long) (uintptr_t) ev->client,
|
||||||
(unsigned long long) (uintptr_t) req->app };
|
(unsigned long long) (uintptr_t) req->app };
|
||||||
|
|
||||||
p = packet_compose(CLOUSEAU_DATA_REQ,
|
p = clouseau_data_packet_compose(CLOUSEAU_DATA_REQ,
|
||||||
&t, sizeof(t), &size, NULL, 0);
|
&t, sizeof(t), &size, NULL, 0);
|
||||||
|
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
ecore_ipc_client_send(
|
ecore_ipc_client_send(
|
||||||
|
@ -305,8 +311,9 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Data
|
||||||
EINA_LIST_FOREACH(app, l, st)
|
EINA_LIST_FOREACH(app, l, st)
|
||||||
{
|
{
|
||||||
t.app = (unsigned long long) (uintptr_t) st->ptr;
|
t.app = (unsigned long long) (uintptr_t) st->ptr;
|
||||||
p = packet_compose(CLOUSEAU_DATA_REQ,
|
p = clouseau_data_packet_compose(CLOUSEAU_DATA_REQ,
|
||||||
&t, sizeof(t), &size, NULL, 0);
|
&t, sizeof(t), &size, NULL, 0);
|
||||||
|
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
ecore_ipc_client_send(
|
ecore_ipc_client_send(
|
||||||
|
@ -351,7 +358,7 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
clouseau_tree_free(td->tree);
|
clouseau_data_tree_free(td->tree);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -379,8 +386,9 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Data
|
||||||
(unsigned long long) (uintptr_t) ev->client,
|
(unsigned long long) (uintptr_t) ev->client,
|
||||||
req->app, req->object, req->ctr };
|
req->app, req->object, req->ctr };
|
||||||
|
|
||||||
p = packet_compose(CLOUSEAU_BMP_REQ,
|
p = clouseau_data_packet_compose(CLOUSEAU_BMP_REQ,
|
||||||
&t, sizeof(t), &size, NULL, 0);
|
&t, sizeof(t), &size, NULL, 0);
|
||||||
|
|
||||||
if (p)
|
if (p)
|
||||||
{ /* FWD req to app with client data */
|
{ /* FWD req to app with client data */
|
||||||
ecore_ipc_client_send(
|
ecore_ipc_client_send(
|
||||||
|
@ -433,7 +441,7 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Data
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
clouseau_variant_free(v);
|
clouseau_data_variant_free(v);
|
||||||
|
|
||||||
log_message(LOG_FILE, "a", "_data() finished");
|
log_message(LOG_FILE, "a", "_data() finished");
|
||||||
return ECORE_CALLBACK_RENEW;
|
return ECORE_CALLBACK_RENEW;
|
||||||
|
@ -446,7 +454,7 @@ int main(void)
|
||||||
eina_init();
|
eina_init();
|
||||||
ecore_init();
|
ecore_init();
|
||||||
ecore_ipc_init();
|
ecore_ipc_init();
|
||||||
clouseau_init();
|
clouseau_data_init();
|
||||||
|
|
||||||
if (!(ipc_svr = ecore_ipc_server_add(ECORE_IPC_REMOTE_SYSTEM,
|
if (!(ipc_svr = ecore_ipc_server_add(ECORE_IPC_REMOTE_SYSTEM,
|
||||||
LISTEN_IP, PORT, NULL)))
|
LISTEN_IP, PORT, NULL)))
|
||||||
|
|
|
@ -149,10 +149,9 @@ struct _Clouseau_Tree_Item
|
||||||
|
|
||||||
Eet_Data_Descriptor *clouseau_object_desc_make(void);
|
Eet_Data_Descriptor *clouseau_object_desc_make(void);
|
||||||
void clouseau_object_desc_shutdown(void);
|
void clouseau_object_desc_shutdown(void);
|
||||||
Evas_Object *clouseau_obj_information_list_add(Evas_Object *parent);
|
void clouseau_object_information_list_clear(void);
|
||||||
void clouseau_obj_information_list_populate(Clouseau_Tree_Item *treeit, Evas_Object *lb);
|
|
||||||
|
|
||||||
/* Public */
|
/* Public */
|
||||||
EAPI void clouseau_object_information_list_clear(void);
|
EAPI Evas_Object *clouseau_object_information_list_add(Evas_Object *parent);
|
||||||
|
EAPI void clouseau_object_information_list_populate(Clouseau_Tree_Item *treeit, Evas_Object *lb);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -148,7 +148,9 @@ _add(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Add *e
|
||||||
ecore_ipc_server_data_size_max_set(ev->server, -1);
|
ecore_ipc_server_data_size_max_set(ev->server, -1);
|
||||||
|
|
||||||
connect_st t = { getpid(), _my_app_name };
|
connect_st t = { getpid(), _my_app_name };
|
||||||
p = packet_compose(CLOUSEAU_APP_CLIENT_CONNECT, &t, sizeof(t), &size, NULL, 0);
|
p = clouseau_data_packet_compose(CLOUSEAU_APP_CLIENT_CONNECT,
|
||||||
|
&t, sizeof(t), &size, NULL, 0);
|
||||||
|
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
ecore_ipc_server_send(ev->server, 0,0,0,0,EINA_FALSE, p, size);
|
ecore_ipc_server_send(ev->server, 0,0,0,0,EINA_FALSE, p, size);
|
||||||
|
@ -182,8 +184,8 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Data
|
||||||
{
|
{
|
||||||
Variant_st *v;
|
Variant_st *v;
|
||||||
|
|
||||||
v = packet_info_get(ev->data, ev->size);
|
v = clouseau_data_packet_info_get(ev->data, ev->size);
|
||||||
switch (clouseau_packet_mapping_type_get(v->type))
|
switch (clouseau_data_packet_mapping_type_get(v->type))
|
||||||
{
|
{
|
||||||
case CLOUSEAU_DATA_REQ:
|
case CLOUSEAU_DATA_REQ:
|
||||||
{ /* data req includes ptr to GUI, to tell which client asking */
|
{ /* data req includes ptr to GUI, to tell which client asking */
|
||||||
|
@ -196,9 +198,9 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Data
|
||||||
|
|
||||||
if (t.tree)
|
if (t.tree)
|
||||||
{ /* Reply with tree data to data request */
|
{ /* Reply with tree data to data request */
|
||||||
void *p = packet_compose(CLOUSEAU_TREE_DATA,
|
void *p = clouseau_data_packet_compose(CLOUSEAU_TREE_DATA,
|
||||||
&t, sizeof(t), &size,
|
&t, sizeof(t), &size, NULL, 0);
|
||||||
NULL, 0);
|
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
ecore_ipc_server_send(ev->server, 0,0,0,0,
|
ecore_ipc_server_send(ev->server, 0,0,0,0,
|
||||||
|
@ -207,7 +209,7 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Data
|
||||||
free(p);
|
free(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
clouseau_tree_free(t.tree);
|
clouseau_data_tree_free(t.tree);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -216,7 +218,7 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Data
|
||||||
{ /* Highlight msg contains PTR of object to highlight */
|
{ /* Highlight msg contains PTR of object to highlight */
|
||||||
highlight_st *ht = v->data;
|
highlight_st *ht = v->data;
|
||||||
Evas_Object *obj = (Evas_Object *) (uintptr_t) ht->object;
|
Evas_Object *obj = (Evas_Object *) (uintptr_t) ht->object;
|
||||||
clouseau_object_highlight(obj, NULL, NULL);
|
clouseau_data_object_highlight(obj, NULL, NULL);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -233,8 +235,8 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Data
|
||||||
NULL,NULL, NULL, 1.0,
|
NULL,NULL, NULL, 1.0,
|
||||||
NULL, NULL, NULL, NULL, NULL, NULL };
|
NULL, NULL, NULL, NULL, NULL, NULL };
|
||||||
|
|
||||||
void *p = packet_compose(CLOUSEAU_BMP_DATA, &t, sizeof(t), &size,
|
void *p = clouseau_data_packet_compose(CLOUSEAU_BMP_DATA,
|
||||||
bmp, (w * h * sizeof(int)));
|
&t, sizeof(t), &size, bmp, (w * h * sizeof(int)));
|
||||||
|
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
|
@ -253,7 +255,7 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Data
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
clouseau_variant_free(v);
|
clouseau_data_variant_free(v);
|
||||||
return ECORE_CALLBACK_RENEW;
|
return ECORE_CALLBACK_RENEW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,11 +334,11 @@ ecore_main_loop_begin(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
clouseau_init();
|
clouseau_data_init();
|
||||||
|
|
||||||
_ecore_main_loop_begin();
|
_ecore_main_loop_begin();
|
||||||
|
|
||||||
clouseau_shutdown();
|
clouseau_data_shutdown();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,27 +23,6 @@ static Eet_Data_Descriptor *clouseau_variant_edd = NULL;
|
||||||
static Eet_Data_Descriptor *clouseau_protocol_edd = NULL;
|
static Eet_Data_Descriptor *clouseau_protocol_edd = NULL;
|
||||||
static Eet_Data_Descriptor *clouseau_map_point_props_edd = NULL;
|
static Eet_Data_Descriptor *clouseau_map_point_props_edd = NULL;
|
||||||
|
|
||||||
EAPI void
|
|
||||||
clouseau_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;
|
|
||||||
}
|
|
||||||
|
|
||||||
EAPI void
|
|
||||||
clouseau_bmp_blob_free(bmp_info_st *st)
|
|
||||||
{ /* We also free all lines drawn in this bmp canvas */
|
|
||||||
clouseau_lines_free(st);
|
|
||||||
|
|
||||||
if (st->bmp)
|
|
||||||
free(st->bmp);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_clouseau_tree_item_free(Clouseau_Tree_Item *parent)
|
_clouseau_tree_item_free(Clouseau_Tree_Item *parent)
|
||||||
{
|
{
|
||||||
|
@ -58,7 +37,7 @@ _clouseau_tree_item_free(Clouseau_Tree_Item *parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
clouseau_tree_free(Eina_List *tree)
|
clouseau_data_tree_free(Eina_List *tree)
|
||||||
{
|
{
|
||||||
Clouseau_Tree_Item *treeit;
|
Clouseau_Tree_Item *treeit;
|
||||||
|
|
||||||
|
@ -83,7 +62,7 @@ static const struct {
|
||||||
};
|
};
|
||||||
|
|
||||||
EAPI Clouseau_Message_Type
|
EAPI Clouseau_Message_Type
|
||||||
clouseau_packet_mapping_type_get(const char *name)
|
clouseau_data_packet_mapping_type_get(const char *name)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
if (!name)
|
if (!name)
|
||||||
|
@ -132,7 +111,7 @@ _clouseau_variant_type_set(const char *type,
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
clouseau_variant_free(Variant_st *v)
|
clouseau_data_variant_free(Variant_st *v)
|
||||||
{
|
{
|
||||||
if (v->data)
|
if (v->data)
|
||||||
free(v->data);
|
free(v->data);
|
||||||
|
@ -141,7 +120,7 @@ clouseau_variant_free(Variant_st *v)
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Variant_st *
|
EAPI Variant_st *
|
||||||
clouseau_variant_alloc(Clouseau_Message_Type t, size_t size, void *info)
|
clouseau_data_variant_alloc(Clouseau_Message_Type t, size_t size, void *info)
|
||||||
{
|
{
|
||||||
Variant_st *v;
|
Variant_st *v;
|
||||||
|
|
||||||
|
@ -188,7 +167,7 @@ _clouseau_app_add_desc_make(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_clouseau_data_req_desc_make(void)
|
_clouseau_req_desc_make(void)
|
||||||
{
|
{
|
||||||
Eet_Data_Descriptor_Class eddc;
|
Eet_Data_Descriptor_Class eddc;
|
||||||
|
|
||||||
|
@ -583,7 +562,7 @@ _clouseau_object_desc_make(void)
|
||||||
extra_props.type, clouseau_union_edd);
|
extra_props.type, clouseau_union_edd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
clouseau_data_descriptors_init(void)
|
clouseau_data_descriptors_init(void)
|
||||||
{
|
{
|
||||||
Eet_Data_Descriptor_Class eddc;
|
Eet_Data_Descriptor_Class eddc;
|
||||||
|
@ -595,7 +574,7 @@ clouseau_data_descriptors_init(void)
|
||||||
_clouseau_tree_item_desc_make();
|
_clouseau_tree_item_desc_make();
|
||||||
_clouseau_connect_desc_make();
|
_clouseau_connect_desc_make();
|
||||||
_clouseau_app_add_desc_make();
|
_clouseau_app_add_desc_make();
|
||||||
_clouseau_data_req_desc_make();
|
_clouseau_req_desc_make();
|
||||||
_clouseau_tree_data_desc_make();
|
_clouseau_tree_data_desc_make();
|
||||||
_clouseau_app_closed_desc_make();
|
_clouseau_app_closed_desc_make();
|
||||||
_clouseau_highlight_desc_make();
|
_clouseau_highlight_desc_make();
|
||||||
|
@ -631,7 +610,7 @@ clouseau_data_descriptors_init(void)
|
||||||
"data", data, type, clouseau_variant_edd);
|
"data", data, type, clouseau_variant_edd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
clouseau_data_descriptors_shutdown(void)
|
clouseau_data_descriptors_shutdown(void)
|
||||||
{
|
{
|
||||||
eet_data_descriptor_free(clouseau_connect_edd);
|
eet_data_descriptor_free(clouseau_connect_edd);
|
||||||
|
@ -702,8 +681,8 @@ _net_to_host_blob_get(void *blob, int blob_size)
|
||||||
return h_blob;
|
return h_blob;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
EAPI void *
|
||||||
packet_compose(Clouseau_Message_Type t, void *data,
|
clouseau_data_packet_compose(Clouseau_Message_Type t, void *data,
|
||||||
int data_size, int *size,
|
int data_size, int *size,
|
||||||
void *blob, int blob_size)
|
void *blob, int blob_size)
|
||||||
{
|
{
|
||||||
|
@ -729,9 +708,9 @@ packet_compose(Clouseau_Message_Type t, void *data,
|
||||||
void *net_blob;
|
void *net_blob;
|
||||||
char *b;
|
char *b;
|
||||||
|
|
||||||
v = clouseau_variant_alloc(t, data_size, data);
|
v = clouseau_data_variant_alloc(t, data_size, data);
|
||||||
p = eet_data_descriptor_encode(clouseau_protocol_edd, v, &e_size);
|
p = eet_data_descriptor_encode(clouseau_protocol_edd, v, &e_size);
|
||||||
clouseau_variant_free(v);
|
clouseau_data_variant_free(v);
|
||||||
|
|
||||||
/* Save encoded size in network format */
|
/* Save encoded size in network format */
|
||||||
enc_size = htonl((uint32_t) e_size);
|
enc_size = htonl((uint32_t) e_size);
|
||||||
|
@ -761,9 +740,9 @@ packet_compose(Clouseau_Message_Type t, void *data,
|
||||||
{
|
{
|
||||||
/* All others are variant packets with EET encoding */
|
/* All others are variant packets with EET encoding */
|
||||||
/* Variant is composed of message type + ptr to data */
|
/* Variant is composed of message type + ptr to data */
|
||||||
v = clouseau_variant_alloc(t, data_size, data);
|
v = clouseau_data_variant_alloc(t, data_size, data);
|
||||||
p = eet_data_descriptor_encode(clouseau_protocol_edd, v, size);
|
p = eet_data_descriptor_encode(clouseau_protocol_edd, v, size);
|
||||||
clouseau_variant_free(v);
|
clouseau_data_variant_free(v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -776,8 +755,8 @@ packet_compose(Clouseau_Message_Type t, void *data,
|
||||||
return pb; /* User has to free(pb) */
|
return pb; /* User has to free(pb) */
|
||||||
}
|
}
|
||||||
|
|
||||||
Variant_st *
|
EAPI Variant_st *
|
||||||
packet_info_get(void *data, int size)
|
clouseau_data_packet_info_get(void *data, int size)
|
||||||
{
|
{
|
||||||
/* user has to use variant_free() to free return struct */
|
/* user has to use variant_free() to free return struct */
|
||||||
char *ch = data;
|
char *ch = data;
|
||||||
|
@ -820,98 +799,6 @@ packet_info_get(void *data, int size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Eina_Bool
|
|
||||||
eet_info_save(const char *filename,
|
|
||||||
app_info_st *a, tree_data_st *ftd, Eina_List *ck_list)
|
|
||||||
{
|
|
||||||
Eina_List *shots = NULL;
|
|
||||||
Eina_List *l;
|
|
||||||
Eet_File *fp;
|
|
||||||
Evas_Object *ck;
|
|
||||||
|
|
||||||
fp = eet_open(filename, EET_FILE_MODE_WRITE);
|
|
||||||
if (!fp) return EINA_FALSE;
|
|
||||||
|
|
||||||
eet_data_write(fp, clouseau_app_add_edd, CLOUSEAU_APP_ADD_ENTRY,
|
|
||||||
a, EINA_TRUE);
|
|
||||||
eet_data_write(fp, clouseau_tree_data_edd, CLOUSEAU_TREE_DATA_ENTRY,
|
|
||||||
ftd, EINA_TRUE);
|
|
||||||
|
|
||||||
/* Build list of (bmp_info_st *) according to user selection */
|
|
||||||
EINA_LIST_FOREACH(ck_list, l , ck)
|
|
||||||
if (elm_check_state_get(ck))
|
|
||||||
{
|
|
||||||
void *data;
|
|
||||||
|
|
||||||
data = evas_object_data_get(ck, BMP_FIELD);
|
|
||||||
if (data)
|
|
||||||
shots = eina_list_append(shots, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shots)
|
|
||||||
{
|
|
||||||
/* Write list and bitmaps */
|
|
||||||
char buf[1024];
|
|
||||||
shot_list_st t;
|
|
||||||
bmp_info_st *st;
|
|
||||||
|
|
||||||
t.view = shots;
|
|
||||||
eet_data_write(fp, clouseau_shot_list_edd, CLOUSEAU_BMP_LIST_ENTRY,
|
|
||||||
&t, EINA_TRUE);
|
|
||||||
EINA_LIST_FREE(shots, st)
|
|
||||||
{
|
|
||||||
sprintf(buf, CLOUSEAU_BMP_DATA_ENTRY"/%llx", st->object);
|
|
||||||
eet_data_image_write(fp, buf, st->bmp,
|
|
||||||
st->w, st->h, 1, 0, 100, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
eet_close(fp);
|
|
||||||
|
|
||||||
return EINA_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
Eina_Bool
|
|
||||||
eet_info_read(const char *filename,
|
|
||||||
app_info_st **a, tree_data_st **ftd)
|
|
||||||
{
|
|
||||||
bmp_info_st *st;
|
|
||||||
shot_list_st *t;
|
|
||||||
Eet_File *fp;
|
|
||||||
|
|
||||||
fp = eet_open(filename, EET_FILE_MODE_READ);
|
|
||||||
if (!fp) return EINA_FALSE;
|
|
||||||
|
|
||||||
*a = eet_data_read(fp, clouseau_app_add_edd, CLOUSEAU_APP_ADD_ENTRY);
|
|
||||||
*ftd = eet_data_read(fp, clouseau_tree_data_edd, CLOUSEAU_TREE_DATA_ENTRY);
|
|
||||||
t = eet_data_read(fp, clouseau_shot_list_edd, CLOUSEAU_BMP_LIST_ENTRY);
|
|
||||||
|
|
||||||
EINA_LIST_FREE(t->view, st)
|
|
||||||
{
|
|
||||||
Variant_st *v;
|
|
||||||
char buf[1024];
|
|
||||||
int alpha;
|
|
||||||
int compress;
|
|
||||||
int quality;
|
|
||||||
int lossy;
|
|
||||||
|
|
||||||
sprintf(buf, CLOUSEAU_BMP_DATA_ENTRY"/%llx", st->object);
|
|
||||||
st->bmp = eet_data_image_read(fp, buf,
|
|
||||||
(unsigned int *) &st->w,
|
|
||||||
(unsigned int *) &st->h,
|
|
||||||
&alpha, &compress, &quality, &lossy);
|
|
||||||
|
|
||||||
/* Add the bitmaps to the actuall app data struct */
|
|
||||||
v = clouseau_variant_alloc(CLOUSEAU_BMP_DATA, sizeof(*st), st);
|
|
||||||
(*a)->view = eina_list_append((*a)->view, v);
|
|
||||||
}
|
|
||||||
|
|
||||||
free(t);
|
|
||||||
eet_close(fp);
|
|
||||||
|
|
||||||
return EINA_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* HIGHLIGHT code. */
|
/* HIGHLIGHT code. */
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_clouseau_highlight_fade(void *_rect)
|
_clouseau_highlight_fade(void *_rect)
|
||||||
|
@ -1003,7 +890,7 @@ _clouseau_highlight_del(void *data,
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
clouseau_object_highlight(Evas_Object *obj, Clouseau_Evas_Props *props, bmp_info_st *view)
|
clouseau_data_object_highlight(Evas_Object *obj, Clouseau_Evas_Props *props, bmp_info_st *view)
|
||||||
{
|
{
|
||||||
Ecore_Animator *t;
|
Ecore_Animator *t;
|
||||||
Evas_Object *r;
|
Evas_Object *r;
|
||||||
|
@ -1057,47 +944,100 @@ clouseau_object_highlight(Evas_Object *obj, Clouseau_Evas_Props *props, bmp_info
|
||||||
fprintf(stderr, "Creation backtrace :\n%s*******\n", tmp); */
|
fprintf(stderr, "Creation backtrace :\n%s*******\n", tmp); */
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
EAPI Eina_Bool
|
||||||
libclouseau_make_lines(bmp_info_st *st, Evas_Coord xx, Evas_Coord yy)
|
clouseau_data_eet_info_save(const char *filename,
|
||||||
|
app_info_st *a, tree_data_st *ftd, Eina_List *ck_list)
|
||||||
{
|
{
|
||||||
/* and no, we are NOT talking about WHITE lines */
|
Eina_List *shots = NULL;
|
||||||
Evas_Coord x_rgn, y_rgn, w_rgn, h_rgn;
|
Eina_List *l;
|
||||||
|
Eet_File *fp;
|
||||||
|
Evas_Object *ck;
|
||||||
|
|
||||||
clouseau_lines_free(st);
|
fp = eet_open(filename, EET_FILE_MODE_WRITE);
|
||||||
|
if (!fp) return EINA_FALSE;
|
||||||
|
|
||||||
elm_scroller_region_get(st->scr, &x_rgn, &y_rgn, &w_rgn, &h_rgn);
|
eet_data_write(fp, clouseau_app_add_edd, CLOUSEAU_APP_ADD_ENTRY,
|
||||||
|
a, EINA_TRUE);
|
||||||
|
eet_data_write(fp, clouseau_tree_data_edd, CLOUSEAU_TREE_DATA_ENTRY,
|
||||||
|
ftd, EINA_TRUE);
|
||||||
|
|
||||||
st->lx = evas_object_line_add(evas_object_evas_get(st->o));
|
/* Build list of (bmp_info_st *) according to user selection */
|
||||||
st->ly = evas_object_line_add(evas_object_evas_get(st->o));
|
EINA_LIST_FOREACH(ck_list, l , ck)
|
||||||
evas_object_repeat_events_set(st->lx, EINA_TRUE);
|
if (elm_check_state_get(ck))
|
||||||
evas_object_repeat_events_set(st->ly, EINA_TRUE);
|
{
|
||||||
|
void *data;
|
||||||
|
|
||||||
evas_object_line_xy_set(st->lx, 0, yy, w_rgn, yy);
|
data = evas_object_data_get(ck, BMP_FIELD);
|
||||||
evas_object_line_xy_set(st->ly, xx, 0, xx, h_rgn);
|
if (data)
|
||||||
|
shots = eina_list_append(shots, data);
|
||||||
|
}
|
||||||
|
|
||||||
evas_object_color_set(st->lx, HIGHLIGHT_R, HIGHLIGHT_G, HIGHLIGHT_B,
|
if (shots)
|
||||||
HIGHLIGHT_A);
|
{
|
||||||
evas_object_color_set(st->ly, HIGHLIGHT_R, HIGHLIGHT_G, HIGHLIGHT_B,
|
/* Write list and bitmaps */
|
||||||
HIGHLIGHT_A);
|
char buf[1024];
|
||||||
evas_object_show(st->lx);
|
shot_list_st t;
|
||||||
evas_object_show(st->ly);
|
bmp_info_st *st;
|
||||||
|
|
||||||
|
t.view = shots;
|
||||||
|
eet_data_write(fp, clouseau_shot_list_edd, CLOUSEAU_BMP_LIST_ENTRY,
|
||||||
|
&t, EINA_TRUE);
|
||||||
|
EINA_LIST_FREE(shots, st)
|
||||||
|
{
|
||||||
|
sprintf(buf, CLOUSEAU_BMP_DATA_ENTRY"/%llx", st->object);
|
||||||
|
eet_data_image_write(fp, buf, st->bmp,
|
||||||
|
st->w, st->h, 1, 0, 100, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
eet_close(fp);
|
||||||
|
|
||||||
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
EAPI Eina_Bool
|
||||||
libclouseau_lines_cb(void *data,
|
clouseau_data_eet_info_read(const char *filename,
|
||||||
Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
app_info_st **a, tree_data_st **ftd)
|
||||||
void *event_info)
|
|
||||||
{
|
{
|
||||||
if (((Evas_Event_Mouse_Down *) event_info)->button == 1)
|
bmp_info_st *st;
|
||||||
return; /* Draw line only if not left mouse button */
|
shot_list_st *t;
|
||||||
|
Eet_File *fp;
|
||||||
|
|
||||||
libclouseau_make_lines(data,
|
fp = eet_open(filename, EET_FILE_MODE_READ);
|
||||||
(((Evas_Event_Mouse_Move *) event_info)->cur.canvas.x),
|
if (!fp) return EINA_FALSE;
|
||||||
(((Evas_Event_Mouse_Move *) event_info)->cur.canvas.y));
|
|
||||||
|
*a = eet_data_read(fp, clouseau_app_add_edd, CLOUSEAU_APP_ADD_ENTRY);
|
||||||
|
*ftd = eet_data_read(fp, clouseau_tree_data_edd, CLOUSEAU_TREE_DATA_ENTRY);
|
||||||
|
t = eet_data_read(fp, clouseau_shot_list_edd, CLOUSEAU_BMP_LIST_ENTRY);
|
||||||
|
|
||||||
|
EINA_LIST_FREE(t->view, st)
|
||||||
|
{
|
||||||
|
Variant_st *v;
|
||||||
|
char buf[1024];
|
||||||
|
int alpha;
|
||||||
|
int compress;
|
||||||
|
int quality;
|
||||||
|
int lossy;
|
||||||
|
|
||||||
|
sprintf(buf, CLOUSEAU_BMP_DATA_ENTRY"/%llx", st->object);
|
||||||
|
st->bmp = eet_data_image_read(fp, buf,
|
||||||
|
(unsigned int *) &st->w,
|
||||||
|
(unsigned int *) &st->h,
|
||||||
|
&alpha, &compress, &quality, &lossy);
|
||||||
|
|
||||||
|
/* Add the bitmaps to the actuall app data struct */
|
||||||
|
v = clouseau_data_variant_alloc(CLOUSEAU_BMP_DATA, sizeof(*st), st);
|
||||||
|
(*a)->view = eina_list_append((*a)->view, v);
|
||||||
|
}
|
||||||
|
|
||||||
|
free(t);
|
||||||
|
eet_close(fp);
|
||||||
|
|
||||||
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
clouseau_init(void)
|
clouseau_data_init(void)
|
||||||
{
|
{
|
||||||
if (clouseau_init_count++ != 0)
|
if (clouseau_init_count++ != 0)
|
||||||
return clouseau_init_count;
|
return clouseau_init_count;
|
||||||
|
@ -1112,7 +1052,7 @@ clouseau_init(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
clouseau_shutdown(void)
|
clouseau_data_shutdown(void)
|
||||||
{
|
{
|
||||||
if (--clouseau_init_count != 0)
|
if (--clouseau_init_count != 0)
|
||||||
return clouseau_init_count;
|
return clouseau_init_count;
|
||||||
|
|
|
@ -72,8 +72,8 @@ item_text_get(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
return strdup(tit->string);
|
return strdup(tit->string);
|
||||||
}
|
}
|
||||||
|
|
||||||
Evas_Object *
|
EAPI Evas_Object *
|
||||||
clouseau_obj_information_list_add(Evas_Object *parent)
|
clouseau_object_information_list_add(Evas_Object *parent)
|
||||||
{
|
{
|
||||||
prop_list = elm_genlist_add(parent);
|
prop_list = elm_genlist_add(parent);
|
||||||
elm_genlist_mode_set(prop_list, ELM_LIST_COMPRESS);
|
elm_genlist_mode_set(prop_list, ELM_LIST_COMPRESS);
|
||||||
|
@ -119,7 +119,7 @@ _clouseau_item_tree_free(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
EAPI void
|
||||||
clouseau_object_information_free(Clouseau_Object *oinfo)
|
clouseau_object_information_free(Clouseau_Object *oinfo)
|
||||||
{
|
{
|
||||||
if (!oinfo)
|
if (!oinfo)
|
||||||
|
@ -165,7 +165,7 @@ clouseau_object_information_free(Clouseau_Object *oinfo)
|
||||||
free(oinfo);
|
free(oinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
Clouseau_Object *
|
EAPI Clouseau_Object *
|
||||||
clouseau_object_information_get(Clouseau_Tree_Item *treeit)
|
clouseau_object_information_get(Clouseau_Tree_Item *treeit)
|
||||||
{
|
{
|
||||||
Clouseau_Object *oinfo;
|
Clouseau_Object *oinfo;
|
||||||
|
@ -434,8 +434,8 @@ _clouseau_type_to_parent(Eina_List **main, const char *name)
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
EAPI void
|
||||||
clouseau_obj_information_list_populate(Clouseau_Tree_Item *treeit, Evas_Object *lb)
|
clouseau_object_information_list_populate(Clouseau_Tree_Item *treeit, Evas_Object *lb)
|
||||||
{
|
{
|
||||||
Inf_Clouseau_Tree_Item *main_tit;
|
Inf_Clouseau_Tree_Item *main_tit;
|
||||||
Clouseau_Object *oinfo;
|
Clouseau_Object *oinfo;
|
||||||
|
|
|
@ -142,45 +142,28 @@ struct _data_desc
|
||||||
};
|
};
|
||||||
typedef struct _data_desc data_desc;
|
typedef struct _data_desc data_desc;
|
||||||
|
|
||||||
/* Function Declarations */
|
|
||||||
Clouseau_Object *obj_information_get(Clouseau_Tree_Item *treeit);
|
|
||||||
void item_tree_item_free(Clouseau_Tree_Item *parent);
|
|
||||||
void _item_tree_item_string(Clouseau_Tree_Item *parent);
|
|
||||||
data_desc *data_descriptors_init(void);
|
|
||||||
void data_descriptors_shutdown(void);
|
|
||||||
void *packet_compose(Clouseau_Message_Type t, void *data, int data_size, int *size, void *blob, int blob_size);
|
|
||||||
Variant_st *packet_info_get(void *data, int size);
|
|
||||||
Eina_Bool eet_info_save(const char *filename, app_info_st *a, tree_data_st *ftd, Eina_List *ck_list);
|
|
||||||
Eina_Bool eet_info_read(const char *filename, app_info_st **app, tree_data_st **ftd);
|
|
||||||
|
|
||||||
/* Highlight code, we may choose to move this to other file later */
|
|
||||||
void libclouseau_make_lines(bmp_info_st *st, Evas_Coord xx, Evas_Coord yy);
|
|
||||||
void libclouseau_lines_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info);
|
|
||||||
|
|
||||||
/* Private function */
|
/* Private function */
|
||||||
#define CLOUSEAU_APP_ADD_ENTRY "clouseau/app"
|
#define CLOUSEAU_APP_ADD_ENTRY "clouseau/app"
|
||||||
#define CLOUSEAU_TREE_DATA_ENTRY "clouseau/app/tree"
|
#define CLOUSEAU_TREE_DATA_ENTRY "clouseau/app/tree"
|
||||||
#define CLOUSEAU_BMP_LIST_ENTRY "clouseau/app/shot_list"
|
#define CLOUSEAU_BMP_LIST_ENTRY "clouseau/app/shot_list"
|
||||||
#define CLOUSEAU_BMP_DATA_ENTRY "clouseau/app/screenshot"
|
#define CLOUSEAU_BMP_DATA_ENTRY "clouseau/app/screenshot"
|
||||||
|
|
||||||
void clouseau_data_descriptors_init(void);
|
|
||||||
void clouseau_data_descriptors_shutdown(void);
|
|
||||||
|
|
||||||
Clouseau_Object *clouseau_object_information_get(Clouseau_Tree_Item *treeit);
|
/* Exported From Object information */
|
||||||
void clouseau_object_information_free(Clouseau_Object *oinfo);
|
EAPI void clouseau_object_information_free(Clouseau_Object *oinfo);
|
||||||
|
EAPI Clouseau_Object * clouseau_object_information_get(Clouseau_Tree_Item *treeit);
|
||||||
|
|
||||||
/* Exported function */
|
/* Exported function */
|
||||||
EAPI int clouseau_init(void);
|
EAPI void clouseau_data_tree_free(Eina_List *tree);
|
||||||
EAPI int clouseau_shutdown(void);
|
EAPI Clouseau_Message_Type clouseau_data_packet_mapping_type_get(const char *name);
|
||||||
|
EAPI void clouseau_data_variant_free(Variant_st *v);
|
||||||
Variant_st *clouseau_variant_alloc(Clouseau_Message_Type t, size_t size, void *info);
|
EAPI Variant_st *clouseau_data_variant_alloc(Clouseau_Message_Type t, size_t size, void *info);
|
||||||
EAPI void clouseau_variant_free(Variant_st *v);
|
EAPI void * clouseau_data_packet_compose(Clouseau_Message_Type t, void *data, int data_size, int *size, void *blob, int blob_size);
|
||||||
EAPI void clouseau_tree_free(Eina_List *tree);
|
EAPI Variant_st *
|
||||||
EAPI void clouseau_bmp_blob_free(bmp_info_st *st);
|
clouseau_data_packet_info_get(void *data, int size);
|
||||||
EAPI void clouseau_lines_free(bmp_info_st *st);
|
EAPI void clouseau_data_object_highlight(Evas_Object *obj, Clouseau_Evas_Props *props, bmp_info_st *view);
|
||||||
|
EAPI Eina_Bool clouseau_data_eet_info_save(const char *filename, app_info_st *a, tree_data_st *ftd, Eina_List *ck_list);
|
||||||
EAPI void clouseau_object_highlight(Evas_Object *obj, Clouseau_Evas_Props *props, bmp_info_st *view);
|
EAPI Eina_Bool clouseau_data_eet_info_read(const char *filename, app_info_st **a, tree_data_st **ftd);
|
||||||
|
EAPI int clouseau_data_init(void);
|
||||||
EAPI Clouseau_Message_Type clouseau_packet_mapping_type_get(const char *name);
|
EAPI int clouseau_data_shutdown(void);
|
||||||
|
|
||||||
#endif /* EET_DATA_H */
|
#endif /* EET_DATA_H */
|
||||||
|
|
Loading…
Reference in New Issue