clouseau: a little step to cleanup this mess.

NOTE: copy and past is not the same as factoring code with function and macro.
NOTE2: please follow the convention of other EFL project.


SVN revision: 73390
This commit is contained in:
Cedric BAIL 2012-07-06 02:39:11 +00:00
parent afe5b60c8d
commit a0282cf1cf
10 changed files with 1516 additions and 1635 deletions

View File

@ -1,4 +1,24 @@
AC_INIT(clouseau, 0.1.0, tom@stosb.com)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_define([v_maj], [0])
m4_define([v_min], [2])
m4_define([v_mic], [0])
m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v '\(export\|Unversioned directory\)' || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
##-- When released, remove the dnl on the below line
dnl m4_undefine([v_rev])
##-- When doing snapshots - change soname. remove dnl on below line
dnl m4_define([relname], [ver-pre-svn-07])
dnl m4_define([v_rel], [-release relname])
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])], [m4_define([v_ver], [v_maj.v_min.v_mic])])
m4_define([lt_cur], m4_eval(v_maj + v_min))
m4_define([lt_rev], v_mic)
m4_define([lt_age], v_min)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
AC_INIT(clouseau, [v_ver], tom@stosb.com)
AC_PREREQ(2.52)
AC_CONFIG_SRCDIR(configure.ac)
AC_CONFIG_MACRO_DIR([m4])
@ -13,6 +33,23 @@ AM_CONFIG_HEADER(config.h)
AC_GNU_SOURCE
AC_PROG_LIBTOOL
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
m4_ifdef([v_rel], , [m4_define([v_rel], [])])
AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
version_info="lt_cur:lt_rev:lt_age"
release_info="v_rel"
AC_SUBST(version_info)
AC_SUBST(release_info)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
VMAJ=v_maj
AC_SUBST(VMAJ)
PKG_CHECK_MODULES([EFL],
[
elementary >= 0.7.0
@ -21,6 +58,22 @@ PKG_CHECK_MODULES([EFL],
ecore-ipc >= 1.0.0
edje >= 1.0.0
])
]
)
### Checks for linker characteristics
lt_enable_auto_import=""
case "${host_os}" in
mingw*)
lt_enable_auto_import="-Wl,--enable-auto-import"
;;
esac
case "$host_vendor" in
ps3*)
# Escape had already been checked to exist
;;
esac
AC_SUBST([lt_enable_auto_import])
EFL_ATTRIBUTE_UNUSED

View File

@ -2,15 +2,8 @@ MAINTAINERCLEANFILES = Makefile.in
bin_PROGRAMS = clouseaud clouseau_client
clouseaud_SOURCES = \
clouseaud.c \
../lib/eet_data.c \
../lib/obj_information.c
clouseau_client_SOURCES = \
clouseau.c \
../lib/eet_data.c \
../lib/obj_information.c
clouseaud_SOURCES = clouseaud.c
clouseau_client_SOURCES = clouseau.c
AM_CPPFLAGS = \
-I$(top_srcdir)/src/lib \
@ -21,5 +14,5 @@ AM_CPPFLAGS = \
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
@EFL_CFLAGS@
clouseaud_LDADD = @EFL_LIBS@
clouseau_client_LDADD = @EFL_LIBS@
clouseaud_LDADD = $(top_builddir)/src/lib/libclouseau_client.la @EFL_LIBS@
clouseau_client_LDADD = $(top_builddir)/src/lib/libclouseau_client.la @EFL_LIBS@

View File

@ -82,8 +82,9 @@ _titlebar_string_set(gui_elements *g, Eina_Bool online)
}
Eina_Bool
_add(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Add *ev)
_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
{
Ecore_Ipc_Event_Server_Add *ev = event;
void *p;
int size = 0;
@ -93,7 +94,7 @@ _add(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Add *e
if (svr)
{
connect_st t = { getpid(), __FILE__ };
p = packet_compose(GUI_CLIENT_CONNECT, &t, sizeof(t), &size, NULL, 0);
p = packet_compose(CLOUSEAU_GUI_CLIENT_CONNECT, &t, sizeof(t), &size, NULL, 0);
if (p)
{
ecore_ipc_server_send(ev->server, 0,0,0,0,EINA_FALSE, p, size);
@ -171,8 +172,10 @@ _work_offline_popup(void)
}
Eina_Bool
_del(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Del *ev)
_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
{
Ecore_Ipc_Event_Server_Del *ev = event;
if ((!_add_callback_called) || (!ev->server))
{ /* if initial connection with daemon failed - exit */
ecore_ipc_server_del(ev->server);
@ -195,7 +198,7 @@ static Eina_Bool
_load_gui_with_list(gui_elements *g, Eina_List *trees)
{
Eina_List *l;
Tree_Item *treeit;
Clouseau_Tree_Item *treeit;
elm_object_text_set(g->lb, NULL); /* Clear backtrace label */
@ -259,8 +262,8 @@ _close_app_views(app_info_st *app, Eina_Bool clr)
{ /* These are cleared when app data is reloaded */
EINA_LIST_FREE(app->view, view)
{ /* Free memory allocated to show any app screens */
bmp_blob_free(view->data);
variant_free(view);
clouseau_bmp_blob_free(view->data);
clouseau_variant_free(view);
}
app->view = NULL;
@ -370,7 +373,7 @@ _remove_bmp(Eina_List *view, void *ptr)
if (st->bmp)
free(st->bmp);
variant_free(v);
clouseau_variant_free(v);
return eina_list_remove(view, v);
}
@ -380,7 +383,11 @@ _remove_bmp(Eina_List *view, void *ptr)
static app_data_st *
_add_app(gui_elements *g, Variant_st *v)
{
app_data_st *st = malloc(sizeof(app_data_st));
app_data_st *st;
st = malloc(sizeof(app_data_st));
if (!st) return NULL;
st->app = v;
st->td = NULL; /* Will get this on TREE_DATA message */
apps = eina_list_append(apps, st);
@ -393,12 +400,13 @@ _add_app(gui_elements *g, Variant_st *v)
static void
_free_app_tree_data(Variant_st *td)
{
if (td)
{
tree_data_st *ftd = td->data;
item_tree_free(ftd->tree);
variant_free(td);
}
tree_data_st *ftd;
if (!td) return ;
ftd = td->data;
clouseau_tree_free(ftd->tree);
clouseau_variant_free(td);
}
static void
@ -418,10 +426,10 @@ _free_app(app_data_st *st)
if (b->bmp)
free(b->bmp);
variant_free(view);
clouseau_variant_free(view);
}
variant_free(st->app);
clouseau_variant_free(st->app);
_free_app_tree_data(st->td);
free(st);
}
@ -454,7 +462,7 @@ _remove_app(gui_elements *g, Variant_st *v)
}
}
variant_free(v);
clouseau_variant_free(v);
}
static void
@ -555,7 +563,7 @@ _add_bmp(gui_elements *g EINA_UNUSED, Variant_st *v)
This code ignores this case. */
elm_progressbar_pulse(g->pb, EINA_FALSE);
evas_object_hide(g->pb);
variant_free(v);
clouseau_variant_free(v);
/* Make refresh button display: screenshot NOT available */
if (nd)
@ -589,7 +597,7 @@ _add_bmp(gui_elements *g EINA_UNUSED, Variant_st *v)
if (st->bmp)
free(st->bmp);
variant_free(v);
clouseau_variant_free(v);
}
}
@ -664,7 +672,7 @@ reset_view(void *data , void *event_info EINA_UNUSED)
{ /* Cancel ZOOM and remove LINES on double tap */
bmp_info_st *st = data;
st->zoom_val = 1.0;
lines_free(st);
clouseau_lines_free(st);
evas_object_size_hint_min_set(st->o, st->w, st->h);
return EVAS_EVENT_FLAG_ON_HOLD;
@ -708,7 +716,7 @@ zoom_start(void *data , void *event_info)
{
bmp_info_st *st = data;
Elm_Gesture_Zoom_Info *p = (Elm_Gesture_Zoom_Info *) event_info;
lines_free(st);
clouseau_lines_free(st);
_update_zoom(st->o, st->scr, p->x, p->y, st->zoom_val, st->w, st->h);
return EVAS_EVENT_FLAG_ON_HOLD;
@ -737,7 +745,7 @@ zoom_end(void *data , void *event_info)
/* END - Callbacks to handle zoom on app window (screenshot) */
static void
_open_app_window(bmp_info_st *st, Evas_Object *bt, Tree_Item *treeit)
_open_app_window(bmp_info_st *st, Evas_Object *bt, Clouseau_Tree_Item *treeit)
{
#define SHOT_HEADER " - Screenshot"
#define SBAR_PAD_X 4
@ -868,7 +876,7 @@ static void
_show_app_window(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{ /* Open window with currnent bmp, or download it if missing */
app_info_st *st = gui->sel_app->app->data;
Tree_Item *treeit = data;
Clouseau_Tree_Item *treeit = data;
/* First search app->view list if already have the window bmp */
Variant_st *v = (Variant_st *)
@ -885,7 +893,7 @@ _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) treeit->ptr, st->refresh_ctr };
void *p = packet_compose(BMP_REQ, &t, sizeof(t), &size, NULL, 0);
void *p = packet_compose(CLOUSEAU_BMP_REQ, &t, sizeof(t), &size, NULL, 0);
if (p)
{
ecore_ipc_server_send(svr,
@ -911,39 +919,40 @@ _show_app_window(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
}
Eina_Bool
_data(void *data, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Data *ev)
_data(void *data, int type EINA_UNUSED, void *event)
{
Variant_st *v = packet_info_get(ev->data, ev->size);
Ecore_Ipc_Event_Server_Data *ev = event;
Variant_st *v;
if (v)
v = packet_info_get(ev->data, ev->size);
if (!v) return ECORE_CALLBACK_RENEW;
switch (clouseau_packet_mapping_type_get(v->t.type))
{
switch(packet_mapping_type_get(v->t.type))
{
case APP_ADD: /* Add info to list of APPs */
_add_app(data, v); /* v->data is (app_info_st *) */
break;
case CLOUSEAU_APP_ADD: /* Add info to list of APPs */
_add_app(data, v); /* v->data is (app_info_st *) */
break;
case APP_CLOSED: /* Remove and free APP info */
_remove_app(data, v); /* v->data is (app_closed_st *) */
break;
case CLOUSEAU_APP_CLOSED: /* Remove and free APP info */
_remove_app(data, v); /* v->data is (app_closed_st *) */
break;
case TREE_DATA: /* Update genlist with APP TREE info */
_update_tree(data, v); /* data is the gui pointer */
break; /* v->data is (tree_data_st *) */
case CLOUSEAU_TREE_DATA: /* Update genlist with APP TREE info */
_update_tree(data, v); /* data is the gui pointer */
break; /* v->data is (tree_data_st *) */
case BMP_DATA: /* Contains a snapshot of canvas window */
{ /* v->data is (bmp_info_st *) */
_add_bmp(data, v); /* data is the gui pointer */
}
break;
case CLOUSEAU_BMP_DATA: /* Contains a snapshot of canvas window */
{ /* v->data is (bmp_info_st *) */
_add_bmp(data, v); /* data is the gui pointer */
}
break;
default:
break;
}
/* variant_free(v) - freed when removed from app list */
default:
break;
}
/* variant_free(v) - freed when removed from app list */
return ECORE_CALLBACK_RENEW;
}
@ -952,8 +961,8 @@ gl_exp(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Elm_Object_Item *glit = event_info;
Evas_Object *gl = elm_object_item_widget_get(glit);
Tree_Item *parent = elm_object_item_data_get(glit);
Tree_Item *treeit;
Clouseau_Tree_Item *parent = elm_object_item_data_get(glit);
Clouseau_Tree_Item *treeit;
Eina_List *itr;
EINA_LIST_FOREACH(parent->children, itr, treeit)
@ -995,7 +1004,7 @@ gl_con_req(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_inf
static Evas_Object *
item_icon_get(void *data, Evas_Object *parent, const char *part)
{
Tree_Item *treeit = data;
Clouseau_Tree_Item *treeit = data;
char buf[PATH_MAX];
if (!treeit->is_obj)
@ -1113,9 +1122,9 @@ static char *
item_text_get(void *data, Evas_Object *obj EINA_UNUSED,
const char *part EINA_UNUSED)
{
Tree_Item *treeit = data;
Clouseau_Tree_Item *treeit = data;
char buf[256];
snprintf(buf, sizeof(buf), "%p %s", treeit->ptr, treeit->name);
snprintf(buf, sizeof(buf), "%llx %s", treeit->ptr, treeit->name);
return strdup(buf);
}
@ -1161,15 +1170,14 @@ _connect_to_daemon(gui_elements *g)
return NULL;
}
ecore_ipc_server_data_size_max_set(svr, -1);
/* set event handler for server connect */
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_ADD, (Ecore_Event_Handler_Cb)_add, g);
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_ADD, _add, g);
/* set event handler for server disconnect */
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DEL, (Ecore_Event_Handler_Cb)_del, g);
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DEL, _del, g);
/* set event handler for receiving server data */
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DATA, (Ecore_Event_Handler_Cb)_data, g);
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DATA, _data, g);
return svr;
}
@ -1180,7 +1188,7 @@ _gl_selected(void *data EINA_UNUSED, Evas_Object *pobj EINA_UNUSED,
{
clouseau_obj_information_list_clear();
gui_elements *g = data;
Tree_Item *treeit = elm_object_item_data_get(event_info);
Clouseau_Tree_Item *treeit = elm_object_item_data_get(event_info);
const Elm_Object_Item *parent;
const Elm_Object_Item *prt = elm_genlist_item_parent_get(event_info);
if (!prt)
@ -1190,11 +1198,11 @@ _gl_selected(void *data EINA_UNUSED, Evas_Object *pobj EINA_UNUSED,
int size;
app_info_st *app = g->sel_app->app->data;
highlight_st st = { (unsigned long long) (uintptr_t) app->ptr,
(unsigned long long) (uintptr_t) treeit->ptr };
treeit->ptr };
if (svr)
{
void *p = packet_compose(HIGHLIGHT, &st, sizeof(st), &size, NULL, 0);
void *p = packet_compose(CLOUSEAU_HIGHLIGHT, &st, sizeof(st), &size, NULL, 0);
if (p)
{
ecore_ipc_server_send(svr,
@ -1212,16 +1220,17 @@ _gl_selected(void *data EINA_UNUSED, Evas_Object *pobj EINA_UNUSED,
}
while (prt);
Tree_Item *t = elm_object_item_data_get(parent);
Clouseau_Tree_Item *t = elm_object_item_data_get(parent);
Variant_st *v = eina_list_search_unsorted(app->view,
_bmp_object_ptr_cmp, t->ptr);
_bmp_object_ptr_cmp,
(void*) (uintptr_t) t->ptr);
if (v)
{ /* Third param gives evas surface when running offline */
libclouseau_highlight(treeit->ptr,
&treeit->info->evas_props, v->data);
clouseau_object_highlight((void*) (uintptr_t) treeit->ptr,
&treeit->info->evas_props, v->data);
}
/* END - replacing libclouseau_highlight(obj); */
/* END - replacing clouseau_object_highlight(obj); */
clouseau_obj_information_list_populate(treeit, gui->lb);
}
@ -1258,7 +1267,7 @@ _load_list(gui_elements *g)
data_req_st t = { (unsigned long long) (uintptr_t) NULL,
(unsigned long long) (uintptr_t) st->ptr };
void *p = packet_compose(DATA_REQ, &t, sizeof(t), &size,
void *p = packet_compose(CLOUSEAU_DATA_REQ, &t, sizeof(t), &size,
NULL, 0);
if (p)
{
@ -1416,7 +1425,7 @@ _save_file_dialog(void *data,
app_info_st *a = g->sel_app->app->data;
tree_data_st *td = g->sel_app->td->data;
bmp_info_st *bmp;
Tree_Item *treeit;
Clouseau_Tree_Item *treeit;
char buf[256];
EINA_LIST_FOREACH(td->tree, l, treeit)
{ /* First search app->view list if already have the window bmp */
@ -1432,7 +1441,7 @@ _save_file_dialog(void *data,
elm_box_pack_end(ck_bx, ck);
elm_object_disabled_set(ck, !(bmp && bmp->bmp));
evas_object_data_set(ck, BMP_FIELD, bmp); /* Associate ck with bmp */
snprintf(buf, sizeof(buf), "%p %s", treeit->ptr, treeit->name);
snprintf(buf, sizeof(buf), "%llx %s", treeit->ptr, treeit->name);
elm_object_text_set(ck, buf);
evas_object_show(ck);
@ -1504,7 +1513,7 @@ _remove_apps_with_no_tree_data(gui_elements *g)
(((app_info_st *) st->app->data)->ptr);
/* v is freed by _remove_app */
v = variant_alloc(APP_CLOSED, sizeof(t), &t);
v = clouseau_variant_alloc(CLOUSEAU_APP_CLOSED, sizeof(t), &t);
_remove_app(g, v); /* v->data is (app_closed_st *) */
}
}
@ -1597,6 +1606,8 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
/* For inwin popup */
Evas_Object *lb, *bxx, *bt_bx, *bt_ok, *bt_cancel;
Evas_Object *bt_ofl; /* work_offline button */
void *st;
gui = calloc(1, sizeof(gui_elements));
gui->win = win = elm_win_add(NULL, "client", ELM_WIN_BASIC);
@ -1740,6 +1751,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
eina_init();
ecore_init();
ecore_ipc_init();
clouseau_init();
/* START - Popup to get IP, PORT from user */
gui->connect_inwin = elm_win_inwin_add(win);
@ -1811,14 +1823,13 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
elm_run();
/* cleanup - free apps data */
void *st;
EINA_LIST_FREE(apps, st)
_free_app(st);
EINA_LIST_FREE(bmp_req, st)
free(st);
data_descriptors_shutdown();
clouseau_shutdown();
if (gui->address)
free(gui->address);

View File

@ -65,7 +65,7 @@ _daemon_cleanup(void)
gui = app = NULL;
ipc_svr = NULL;
data_descriptors_shutdown();
clouseau_shutdown();
ecore_ipc_shutdown();
ecore_shutdown();
eina_shutdown();
@ -172,7 +172,7 @@ _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 };
Eina_List *l;
int size;
void *p = packet_compose(APP_CLOSED, &t, sizeof(t), &size, NULL, 0);
void *p = packet_compose(CLOUSEAU_APP_CLOSED, &t, sizeof(t), &size, NULL, 0);
if (p)
{
EINA_LIST_FOREACH(gui, l, i)
@ -212,240 +212,241 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Data
* In order to simplify, all messages also contains recipient ptr
* as saved by daemon.
* Thus we only need to peek this info then FWD, reply to this recipient */
if (v)
if (!v)
{
switch(packet_mapping_type_get(v->t.type))
{
case APP_CLIENT_CONNECT:
{ /* Register APP then notify GUI about it */
app_info_st *st;
Eina_List *l;
connect_st *t = v->data;
app_info_st m = { t->pid, (char *) t->name, NULL,
(unsigned long long) (uintptr_t) ev->client, NULL, 0 };
app = _add_client(app, t, ev->client);
p = packet_compose(APP_ADD, &m, sizeof(m), &size, NULL, 0);
if (p)
{
EINA_LIST_FOREACH(gui, l, st)
{ /* Notify all GUI clients to add APP */
ecore_ipc_client_send(
(void *) (uintptr_t) st->ptr,
0,0,0,0,EINA_FALSE, p, size);
ecore_ipc_client_flush(
(void *) (uintptr_t) st->ptr);
}
free(p);
}
}
break;
case GUI_CLIENT_CONNECT:
{ /* Register GUI, then notify about all APP */
app_info_st *st;
Eina_List *l;
connect_st *t = v->data;
gui = _add_client(gui, t, ev->client);
EINA_LIST_FOREACH(app, l, st)
{ /* Add all registered apps to newly open GUI */
p = packet_compose(APP_ADD, st, sizeof(*st), &size,
NULL, 0);
if (p)
{
ecore_ipc_client_send(ev->client,
0,0,0,0,EINA_FALSE, p, size);
ecore_ipc_client_flush(ev->client);
free(p);
}
}
}
break;
case DATA_REQ:
{ /* msg coming from GUI, FWD this to app specified in req */
data_req_st *req = v->data;
if (req->app)
{ /* Requesting specific app data */
if(eina_list_search_unsorted(app,
_client_ptr_cmp,
(void *) (uintptr_t) req->app))
{ /* Do the req only of APP connected to daemon */
data_req_st t = {
(unsigned long long) (uintptr_t) ev->client,
(unsigned long long) (uintptr_t) req->app };
p = packet_compose(DATA_REQ,
&t, sizeof(t), &size, NULL, 0);
if (p)
{
ecore_ipc_client_send(
(void *) (uintptr_t) req->app,
0,0,0,0, EINA_FALSE, p, size);
ecore_ipc_client_flush(
(void *) (uintptr_t) req->app);
free(p);
}
}
}
else
{ /* requesting ALL apps data */
Eina_List *l;
app_info_st *st;
data_req_st t = {
(unsigned long long) (uintptr_t) ev->client,
(unsigned long long) (uintptr_t) NULL };
EINA_LIST_FOREACH(app, l, st)
{
t.app = (unsigned long long) (uintptr_t) st->ptr;
p = packet_compose(DATA_REQ,
&t, sizeof(t), &size, NULL, 0);
if (p)
{
ecore_ipc_client_send(
(void *) (uintptr_t) st->ptr,
0,0,0,0, EINA_FALSE, p, size);
ecore_ipc_client_flush(
(void *) (uintptr_t) st->ptr);
free(p);
}
}
}
}
break;
case TREE_DATA:
{ /* Tree Data comes from APP, GUI client specified in msg */
tree_data_st *td = v->data;
if (td->gui)
{ /* Sending tree data to specific GUI client */
if(eina_list_search_unsorted(gui,
_client_ptr_cmp,
(void *) (uintptr_t) td->gui))
{ /* Do the req only of GUI connected to daemon */
ecore_ipc_client_send(
(void *) (uintptr_t) td->gui, 0,0,0,0,
EINA_FALSE, ev->data, ev->size);
ecore_ipc_client_flush(
(void *) (uintptr_t) td->gui);
}
}
else
{ /* Sending tree data to all GUI clients */
Eina_List *l;
app_info_st *info;
EINA_LIST_FOREACH(gui, l, info)
{
ecore_ipc_client_send(
(void *) (uintptr_t) info->ptr, 0,0,0,0,
EINA_FALSE, ev->data, ev->size);
ecore_ipc_client_flush(
(void *) (uintptr_t) info->ptr);
}
}
item_tree_free(td->tree);
}
break;
case HIGHLIGHT:
{ /* FWD this message to app */
highlight_st *ht = v->data;
if(eina_list_search_unsorted(app,
_client_ptr_cmp, (void *) (uintptr_t) ht->app))
{ /* Do the req only of APP connected to daemon */
ecore_ipc_client_send((void *)
(uintptr_t) ht->app, 0,0,0,0,
EINA_FALSE, ev->data, ev->size);
ecore_ipc_client_flush((void *) (uintptr_t) ht->app);
}
}
break;
case BMP_REQ:
{
bmp_req_st *req = v->data;
if(eina_list_search_unsorted(app,
_client_ptr_cmp, (void *) (uintptr_t) req->app))
{ /* Do the req only of APP connected to daemon */
bmp_req_st t = {
(unsigned long long) (uintptr_t) ev->client,
req->app, req->object, req->ctr };
p = packet_compose(BMP_REQ,
&t, sizeof(t), &size, NULL, 0);
if (p)
{ /* FWD req to app with client data */
ecore_ipc_client_send(
(void *) (uintptr_t) req->app,
0,0,0,0, EINA_FALSE, p, size);
ecore_ipc_client_flush(
(void *) (uintptr_t) req->app);
free(p);
}
}
}
break;
case BMP_DATA:
{ /* Bmp Data comes from APP, GUI client specified in msg */
bmp_info_st *st = v->data;
if (st->gui)
{ /* Sending BMP data to specific GUI client */
if(eina_list_search_unsorted(gui,
_client_ptr_cmp,
(void *) (uintptr_t) st->gui))
{ /* Do the req only of GUI connected to daemon */
ecore_ipc_client_send(
(void *) (uintptr_t) st->gui, 0,0,0,0,
EINA_FALSE, ev->data, ev->size);
ecore_ipc_client_flush(
(void *) (uintptr_t) st->gui);
}
}
else
{ /* Sending BMP data to all GUI clients */
Eina_List *l;
app_info_st *info;
EINA_LIST_FOREACH(gui, l, info)
{
ecore_ipc_client_send(
(void *) (uintptr_t) info->ptr, 0,0,0,0,
EINA_FALSE, ev->data, ev->size);
ecore_ipc_client_flush(
(void *) (uintptr_t) info->ptr);
}
}
if (st->bmp)
free(st->bmp);
}
break;
default:
break;
}
variant_free(v);
log_message(LOG_FILE, "a", "Failed to decode data.");
return ECORE_CALLBACK_RENEW;
}
else
log_message(LOG_FILE, "a", "Failed to decode data.");
switch(clouseau_packet_mapping_type_get(v->t.type))
{
case CLOUSEAU_APP_CLIENT_CONNECT:
{ /* Register APP then notify GUI about it */
app_info_st *st;
Eina_List *l;
connect_st *t = v->data;
app_info_st m = { t->pid, (char *) t->name, NULL,
(unsigned long long) (uintptr_t) ev->client, NULL, 0 };
app = _add_client(app, t, ev->client);
p = packet_compose(CLOUSEAU_APP_ADD, &m, sizeof(m), &size, NULL, 0);
if (p)
{
EINA_LIST_FOREACH(gui, l, st)
{ /* Notify all GUI clients to add APP */
ecore_ipc_client_send(
(void *) (uintptr_t) st->ptr,
0,0,0,0,EINA_FALSE, p, size);
ecore_ipc_client_flush(
(void *) (uintptr_t) st->ptr);
}
free(p);
}
}
break;
case CLOUSEAU_GUI_CLIENT_CONNECT:
{ /* Register GUI, then notify about all APP */
app_info_st *st;
Eina_List *l;
connect_st *t = v->data;
gui = _add_client(gui, t, ev->client);
EINA_LIST_FOREACH(app, l, st)
{ /* Add all registered apps to newly open GUI */
p = packet_compose(CLOUSEAU_APP_ADD, st, sizeof(*st), &size,
NULL, 0);
if (p)
{
ecore_ipc_client_send(ev->client,
0,0,0,0,EINA_FALSE, p, size);
ecore_ipc_client_flush(ev->client);
free(p);
}
}
}
break;
case CLOUSEAU_DATA_REQ:
{ /* msg coming from GUI, FWD this to app specified in req */
data_req_st *req = v->data;
if (req->app)
{ /* Requesting specific app data */
if(eina_list_search_unsorted(app,
_client_ptr_cmp,
(void *) (uintptr_t) req->app))
{ /* Do the req only of APP connected to daemon */
data_req_st t = {
(unsigned long long) (uintptr_t) ev->client,
(unsigned long long) (uintptr_t) req->app };
p = packet_compose(CLOUSEAU_DATA_REQ,
&t, sizeof(t), &size, NULL, 0);
if (p)
{
ecore_ipc_client_send(
(void *) (uintptr_t) req->app,
0,0,0,0, EINA_FALSE, p, size);
ecore_ipc_client_flush(
(void *) (uintptr_t) req->app);
free(p);
}
}
}
else
{ /* requesting ALL apps data */
Eina_List *l;
app_info_st *st;
data_req_st t = {
(unsigned long long) (uintptr_t) ev->client,
(unsigned long long) (uintptr_t) NULL };
EINA_LIST_FOREACH(app, l, st)
{
t.app = (unsigned long long) (uintptr_t) st->ptr;
p = packet_compose(CLOUSEAU_DATA_REQ,
&t, sizeof(t), &size, NULL, 0);
if (p)
{
ecore_ipc_client_send(
(void *) (uintptr_t) st->ptr,
0,0,0,0, EINA_FALSE, p, size);
ecore_ipc_client_flush(
(void *) (uintptr_t) st->ptr);
free(p);
}
}
}
}
break;
case CLOUSEAU_TREE_DATA:
{ /* Tree Data comes from APP, GUI client specified in msg */
tree_data_st *td = v->data;
if (td->gui)
{ /* Sending tree data to specific GUI client */
if(eina_list_search_unsorted(gui,
_client_ptr_cmp,
(void *) (uintptr_t) td->gui))
{ /* Do the req only of GUI connected to daemon */
ecore_ipc_client_send(
(void *) (uintptr_t) td->gui, 0,0,0,0,
EINA_FALSE, ev->data, ev->size);
ecore_ipc_client_flush(
(void *) (uintptr_t) td->gui);
}
}
else
{ /* Sending tree data to all GUI clients */
Eina_List *l;
app_info_st *info;
EINA_LIST_FOREACH(gui, l, info)
{
ecore_ipc_client_send(
(void *) (uintptr_t) info->ptr, 0,0,0,0,
EINA_FALSE, ev->data, ev->size);
ecore_ipc_client_flush(
(void *) (uintptr_t) info->ptr);
}
}
clouseau_tree_free(td->tree);
}
break;
case CLOUSEAU_HIGHLIGHT:
{ /* FWD this message to app */
highlight_st *ht = v->data;
if(eina_list_search_unsorted(app,
_client_ptr_cmp, (void *) (uintptr_t) ht->app))
{ /* Do the req only of APP connected to daemon */
ecore_ipc_client_send((void *)
(uintptr_t) ht->app, 0,0,0,0,
EINA_FALSE, ev->data, ev->size);
ecore_ipc_client_flush((void *) (uintptr_t) ht->app);
}
}
break;
case CLOUSEAU_BMP_REQ:
{
bmp_req_st *req = v->data;
if(eina_list_search_unsorted(app,
_client_ptr_cmp, (void *) (uintptr_t) req->app))
{ /* Do the req only of APP connected to daemon */
bmp_req_st t = {
(unsigned long long) (uintptr_t) ev->client,
req->app, req->object, req->ctr };
p = packet_compose(CLOUSEAU_BMP_REQ,
&t, sizeof(t), &size, NULL, 0);
if (p)
{ /* FWD req to app with client data */
ecore_ipc_client_send(
(void *) (uintptr_t) req->app,
0,0,0,0, EINA_FALSE, p, size);
ecore_ipc_client_flush(
(void *) (uintptr_t) req->app);
free(p);
}
}
}
break;
case CLOUSEAU_BMP_DATA:
{ /* Bmp Data comes from APP, GUI client specified in msg */
bmp_info_st *st = v->data;
if (st->gui)
{ /* Sending BMP data to specific GUI client */
if(eina_list_search_unsorted(gui,
_client_ptr_cmp,
(void *) (uintptr_t) st->gui))
{ /* Do the req only of GUI connected to daemon */
ecore_ipc_client_send(
(void *) (uintptr_t) st->gui, 0,0,0,0,
EINA_FALSE, ev->data, ev->size);
ecore_ipc_client_flush(
(void *) (uintptr_t) st->gui);
}
}
else
{ /* Sending BMP data to all GUI clients */
Eina_List *l;
app_info_st *info;
EINA_LIST_FOREACH(gui, l, info)
{
ecore_ipc_client_send(
(void *) (uintptr_t) info->ptr, 0,0,0,0,
EINA_FALSE, ev->data, ev->size);
ecore_ipc_client_flush(
(void *) (uintptr_t) info->ptr);
}
}
if (st->bmp)
free(st->bmp);
}
break;
default:
break;
}
clouseau_variant_free(v);
log_message(LOG_FILE, "a", "_data() finished");
return ECORE_CALLBACK_RENEW;
}
/* END - Ecore communication callbacks */
int main(void)
{
daemonize();
eina_init();
ecore_init();
ecore_ipc_init();
clouseau_init();
if (!(ipc_svr = ecore_ipc_server_add(ECORE_IPC_REMOTE_SYSTEM,
LISTEN_IP, PORT, NULL)))

View File

@ -13,7 +13,7 @@ EXTRA_DIST = \
eet_data.h
pkgdir = $(libdir)/clouseau
pkg_LTLIBRARIES = libclouseau.la
pkg_LTLIBRARIES = libclouseau.la libclouseau_client.la
libclouseau_la_SOURCES = \
libclouseau.c \
@ -24,3 +24,12 @@ libclouseau_la_LDFLAGS = -module -avoid-version -rdynamic
libclouseau_la_DEPENDENCIES = $(top_builddir)/config.h
libclouseau_la_LIBADD = @EFL_LIBS@
libclouseau_la_CFLAGS = @EFL_CFLAGS@
libclouseau_client_la_SOURCES = obj_information.c \
eet_data.c
libclouseau_client_la_DEPENDENCIES = $(top_builddir)/config.h
libclouseau_client_la_LIBADD = @EFL_LIBS@
libclouseau_client_la_CFLAGS = @EFL_CFLAGS@
libclouseau_client_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@

File diff suppressed because it is too large Load Diff

View File

@ -2,10 +2,6 @@
#define EET_DATA_H
#include "libclouseau.h"
/* Global constants */
#define APP_ADD_ENTRY "/clouseau/app"
#define TREE_DATA_ENTRY "/clouseau/app/tree"
#define BMP_LIST_ENTRY "/clouseau/app/shot_list"
#define BMP_DATA_ENTRY "/clouseau/app/screenshot"
#define BMP_FIELD "bmp"
#define PORT (22522)
@ -17,35 +13,20 @@
#define VARIANT_PACKET 0
#define BMP_RAW_DATA 1
#define DESC_ADD_BASIC(desc, type, member, eet_type) \
EET_DATA_DESCRIPTOR_ADD_BASIC \
(desc, type, #member, member, eet_type)
#define GUI_CONNECT_STR "GUI_CONNECT"
#define APP_CONNECT_STR "APP_CONNECT"
#define APP_ADD_STR "APP_ADD"
#define DATA_REQ_STR "DATA_REQ"
#define TREE_DATA_STR "TREE_DATA"
#define APP_CLOSED_STR "APP_CLOSED"
#define HIGHLIGHT_STR "HIGHLIGHT"
#define BMP_REQ_STR "BMP_REQ"
#define BMP_DATA_STR "BMP_DATA"
enum _message_type
enum _Clouseau_Message_Type
{ /* Add any supported types of packets here */
UNKNOWN = 0,
GUI_CLIENT_CONNECT, /* client PID, name */
APP_CLIENT_CONNECT, /* client PID, name */
APP_ADD, /* client PTR, name, PID fwd to GUI client */
DATA_REQ, /* GUI client PTR (NULL for all),APP client PTR (NULL for all) */
TREE_DATA, /* GUI client PTR (NULL for all),APP client PTR, Tree Data */
APP_CLOSED, /* APP client PTR from DAEMON to GUI */
HIGHLIGHT, /* APP client PTR, object PTR */
BMP_REQ, /* APP client PTR, object PTR */
BMP_DATA /* bmp_info_st header + BMP raw data */
CLOUSEAU_UNKNOWN = 0,
CLOUSEAU_GUI_CLIENT_CONNECT = 1, /* client PID, name */
CLOUSEAU_APP_CLIENT_CONNECT = 2, /* client PID, name */
CLOUSEAU_APP_ADD = 3, /* client PTR, name, PID fwd to GUI client */
CLOUSEAU_DATA_REQ = 4, /* GUI client PTR (NULL for all),APP client PTR (NULL for all) */
CLOUSEAU_TREE_DATA = 5, /* GUI client PTR (NULL for all),APP client PTR, Tree Data */
CLOUSEAU_APP_CLOSED = 6,/* APP client PTR from DAEMON to GUI */
CLOUSEAU_HIGHLIGHT = 7, /* APP client PTR, object PTR */
CLOUSEAU_BMP_REQ = 8, /* APP client PTR, object PTR */
CLOUSEAU_BMP_DATA = 9 /* bmp_info_st header + BMP raw data */
};
typedef enum _message_type message_type;
typedef enum _Clouseau_Message_Type Clouseau_Message_Type;
struct _Variant_Type_st
{
@ -141,13 +122,6 @@ struct _bmp_info_st
};
typedef struct _bmp_info_st bmp_info_st;
struct _eet_message_type_mapping
{
message_type t;
const char *name;
};
typedef struct _eet_message_type_mapping eet_message_type_mapping;
struct _shot_list_st
{ /* This will be used to write a shot list to eet file */
Eina_List *view; /* Screen views eahc is (bmp_info_st *) ptr */
@ -174,39 +148,42 @@ struct _data_desc
typedef struct _data_desc data_desc;
/* 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 *app_add_desc_make(void);
Eet_Data_Descriptor *data_req_desc_make(void);
Eet_Data_Descriptor *bmp_req_desc_make(void);
Eet_Data_Descriptor *bmp_data_desc_make(void);
Eet_Data_Descriptor *bmp_info_desc_make(void);
Eet_Data_Descriptor *shot_list_desc_make(void);
Eet_Data_Descriptor *tree_data_desc_make(void);
Eet_Data_Descriptor *app_closed_desc_make(void);
Eet_Data_Descriptor *highlight_desc_make(void);
Eet_Data_Descriptor *tree_item_desc_make(void);
Obj_Information *obj_information_get(Tree_Item *treeit);
void obj_information_free(Obj_Information *oinfo);
void item_tree_item_free(Tree_Item *parent);
void item_tree_free(Eina_List *tree);
void _item_tree_item_string(Tree_Item *parent);
Clouseau_Object *obj_information_get(Clouseau_Tree_Item *treeit);
void obj_information_free(Clouseau_Object *oinfo);
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 variant_free(Variant_st *v);
Variant_st *variant_alloc(message_type t, size_t size, void *info);
message_type packet_mapping_type_get(const char *name);
const char *packet_mapping_type_str_get(message_type t);
void *packet_compose(message_type t, void *data, int data_size, int *size, void *blob, int blob_size);
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_highlight(Evas_Object *obj, st_evas_props *props, bmp_info_st *view);
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 */
#define CLOUSEAU_APP_ADD_ENTRY "clouseau/app"
#define CLOUSEAU_TREE_DATA_ENTRY "clouseau/app/tree"
#define CLOUSEAU_BMP_LIST_ENTRY "clouseau/app/shot_list"
#define CLOUSEAU_BMP_DATA_ENTRY "clouseau/app/screenshot"
void clouseau_data_descriptors_init(void);
void clouseau_data_descriptors_shutdown(void);
/* Exported function */
int clouseau_init(void);
int clouseau_shutdown(void);
Variant_st *clouseau_variant_alloc(Clouseau_Message_Type t, size_t size, void *info);
void clouseau_variant_free(Variant_st *v);
void clouseau_tree_free(Eina_List *tree);
void clouseau_bmp_blob_free(bmp_info_st *st);
void clouseau_lines_free(bmp_info_st *st);
void clouseau_object_highlight(Evas_Object *obj, Clouseau_Evas_Props *props, bmp_info_st *view);
Clouseau_Message_Type clouseau_packet_mapping_type_get(const char *name);
#endif /* EET_DATA_H */

View File

@ -14,35 +14,31 @@ static Eina_Bool _elm_is_init = EINA_FALSE;
static const char *_my_app_name = NULL;
static void
libclouseau_item_add(Evas_Object *o, Tree_Item *parent)
libclouseau_item_add(Evas_Object *o, Clouseau_Tree_Item *parent)
{
Eina_List *children, *tmp;
Clouseau_Tree_Item *treeit;
Eina_List *children;
Evas_Object *child;
Tree_Item *treeit;
char buf[1024];
treeit = calloc(1, sizeof(Tree_Item));
treeit->ptr = o;
treeit = calloc(1, sizeof(Clouseau_Tree_Item));
if (!treeit) return ;
treeit->ptr = (uintptr_t) o;
treeit->is_obj = EINA_TRUE;
snprintf(buf, sizeof(buf), "%s", evas_object_type_get(o));
treeit->name = eina_stringshare_add(buf);
treeit->name = eina_stringshare_add(evas_object_type_get(o));
treeit->is_clipper = !!evas_object_clipees_get(o);
treeit->is_visible = evas_object_visible_get(o);
treeit->info = obj_information_get(treeit);
parent->children = eina_list_append(parent->children, treeit);
if (evas_object_smart_data_get(o))
{ /* Do this only for smart object */
children = evas_object_smart_members_get(o);
EINA_LIST_FOREACH(children, tmp, child)
{
libclouseau_item_add(child, treeit);
}
/* if (!evas_object_smart_data_get(o)) return ; */
eina_list_free(children);
}
/* Do this only for smart object */
children = evas_object_smart_members_get(o);
EINA_LIST_FREE(children, child)
libclouseau_item_add(child, treeit);
}
static void *
@ -59,6 +55,7 @@ _canvas_bmp_get(Ecore_Evas *ee, Evas_Coord *w_out, Evas_Coord *h_out)
Eina_List *eeitr, *ees = ecore_evas_ecore_evas_list_get();
Ecore_Evas *eel;
Eina_Bool found_evas = EINA_FALSE;
EINA_LIST_FOREACH(ees, eeitr, eel)
if (eel == ee)
{
@ -107,17 +104,16 @@ static Eina_List *
_load_list(void)
{
Eina_List *tree = NULL;
Eina_List *ees, *eeitr;
Eina_List *ees;
Ecore_Evas *ee;
ees = ecore_evas_ecore_evas_list_get();
EINA_LIST_FOREACH(ees, eeitr, ee)
EINA_LIST_FREE(ees, ee)
{
Eina_List *objs, *objitr;
Eina_List *objs;
Evas_Object *obj;
Tree_Item *treeit;
Clouseau_Tree_Item *treeit;
Evas *e;
int w, h;
@ -125,25 +121,22 @@ _load_list(void)
e = ecore_evas_get(ee);
evas_output_size_get(e, &w, &h);
treeit = calloc(1, sizeof(Tree_Item));
treeit = calloc(1, sizeof(Clouseau_Tree_Item));
if (!treeit) continue ;
treeit->name = eina_stringshare_add(ecore_evas_title_get(ee));
treeit->ptr = ee;
treeit->ptr = (uintptr_t) ee;
tree = eina_list_append(tree, treeit);
objs = evas_objects_in_rectangle_get(e, SHRT_MIN, SHRT_MIN,
USHRT_MAX, USHRT_MAX, EINA_TRUE, EINA_TRUE);
EINA_LIST_FOREACH(objs, objitr, obj)
{
libclouseau_item_add(obj, treeit);
}
eina_list_free(objs);
EINA_LIST_FREE(objs, obj)
libclouseau_item_add(obj, treeit);
}
eina_list_free(ees);
return tree; /* User has to call item_tree_free() */
return tree; /* User has to call clouseau_tree_free() */
}
Eina_Bool
@ -155,7 +148,7 @@ _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);
connect_st t = { getpid(), _my_app_name };
p = packet_compose(APP_CLIENT_CONNECT, &t, sizeof(t), &size, NULL, 0);
p = packet_compose(CLOUSEAU_APP_CLIENT_CONNECT, &t, sizeof(t), &size, NULL, 0);
if (p)
{
ecore_ipc_server_send(ev->server, 0,0,0,0,EINA_FALSE, p, size);
@ -187,44 +180,47 @@ _del(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Del *e
Eina_Bool
_data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Data *ev)
{
Variant_st *v = packet_info_get(ev->data, ev->size);
Variant_st *v;
switch(packet_mapping_type_get(v->t.type))
v = packet_info_get(ev->data, ev->size);
switch (clouseau_packet_mapping_type_get(v->t.type))
{
case DATA_REQ:
{ /* data req includes ptr to GUI, to tell which client asking */
int size = 0;
data_req_st *req = v->data;
tree_data_st t;
t.gui = req->gui; /* GUI client requesting data from daemon */
t.app = req->app; /* APP client sending data to daemon */
t.tree = _load_list();
if (t.tree)
{ /* Reply with tree data to data request */
void *p = packet_compose(TREE_DATA, &t, sizeof(t), &size,
NULL, 0);
if (p)
{
ecore_ipc_server_send(ev->server, 0,0,0,0,
EINA_FALSE, p, size);
ecore_ipc_server_flush(ev->server);
free(p);
}
case CLOUSEAU_DATA_REQ:
{ /* data req includes ptr to GUI, to tell which client asking */
int size = 0;
data_req_st *req = v->data;
tree_data_st t;
t.gui = req->gui; /* GUI client requesting data from daemon */
t.app = req->app; /* APP client sending data to daemon */
t.tree = _load_list();
item_tree_free(t.tree);
}
}
break;
if (t.tree)
{ /* Reply with tree data to data request */
void *p = packet_compose(CLOUSEAU_TREE_DATA,
&t, sizeof(t), &size,
NULL, 0);
if (p)
{
ecore_ipc_server_send(ev->server, 0,0,0,0,
EINA_FALSE, p, size);
ecore_ipc_server_flush(ev->server);
free(p);
}
case HIGHLIGHT:
clouseau_tree_free(t.tree);
}
}
break;
case CLOUSEAU_HIGHLIGHT:
{ /* Highlight msg contains PTR of object to highlight */
highlight_st *ht = v->data;
Evas_Object *obj = (Evas_Object *) (uintptr_t) ht->object;
libclouseau_highlight(obj, NULL, NULL);
clouseau_object_highlight(obj, NULL, NULL);
}
break;
case BMP_REQ:
case CLOUSEAU_BMP_REQ:
{ /* Bitmap req msg contains PTR of Ecore Evas */
bmp_req_st *req = v->data;
Evas_Coord w, h;
@ -237,7 +233,7 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Data
NULL,NULL, NULL, 1.0,
NULL, NULL, NULL, NULL, NULL, NULL };
void *p = packet_compose(BMP_DATA, &t, sizeof(t), &size,
void *p = packet_compose(CLOUSEAU_BMP_DATA, &t, sizeof(t), &size,
bmp, (w * h * sizeof(int)));
if (p)
@ -257,7 +253,7 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Data
break;
}
variant_free(v);
clouseau_variant_free(v);
return ECORE_CALLBACK_RENEW;
}
@ -336,9 +332,12 @@ ecore_main_loop_begin(void)
return;
}
clouseau_init();
_ecore_main_loop_begin();
data_descriptors_shutdown();
clouseau_shutdown();
return;
}

View File

@ -10,27 +10,31 @@
#define ELM_INTERNAL_API_ARGESFSDFEFC
#include <elm_widget.h>
typedef struct _Clouseau_Evas_Props Clouseau_Evas_Props;
typedef struct _Clouseau_Evas_Text_Props Clouseau_Evas_Text_Props;
typedef struct _Clouseau_Evas_Image_Props Clouseau_Evas_Image_Props;
typedef struct _Clouseau_Elm_Props Clouseau_Elm_Props;
typedef struct _Clouseau_Edje_Props Clouseau_Edje_Props;
#define CLOUSEAU_OBJ_TYPE_OTHER_STR "CLOUSEAU_OBJ_TYPE_OTHER"
#define CLOUSEAU_OBJ_TYPE_ELM_STR "CLOUSEAU_OBJ_TYPE_ELM"
#define CLOUSEAU_OBJ_TYPE_TEXT_STR "CLOUSEAU_OBJ_TYPE_TEXT"
#define CLOUSEAU_OBJ_TYPE_IMAGE_STR "CLOUSEAU_OBJ_TYPE_IMAGE"
#define CLOUSEAU_OBJ_TYPE_EDJE_STR "CLOUSEAU_OBJ_TYPE_EDJE"
#define CLOUSEAU_OBJ_TYPE_TEXTBLOCK_STR "CLOUSEAU_OBJ_TYPE_TEXTBLOCK"
typedef struct _Clouseau_Extra_Props Clouseau_Extra_Props;
typedef struct _Clouseau_Object Clouseau_Object;
typedef struct _Clouseau_Bitmap Clouseau_Bitmap;
typedef struct _Clouseau_Tree_Item Clouseau_Tree_Item;
/* The color of the highlight */
enum {
HIGHLIGHT_R = 255,
HIGHLIGHT_G = 128,
HIGHLIGHT_B = 128,
HIGHLIGHT_A = 255,
HIGHLIGHT_R = 255,
HIGHLIGHT_G = 128,
HIGHLIGHT_B = 128,
HIGHLIGHT_A = 255,
/* How much padding around the highlight box.
* Currently we don't want any. */
PADDING = 0,
/* How much padding around the highlight box.
* Currently we don't want any. */
PADDING = 0,
};
enum _en_obj_type
typedef enum
{
CLOUSEAU_OBJ_TYPE_UNKNOWN,
CLOUSEAU_OBJ_TYPE_OTHER,
@ -39,17 +43,9 @@ enum _en_obj_type
CLOUSEAU_OBJ_TYPE_IMAGE,
CLOUSEAU_OBJ_TYPE_EDJE,
CLOUSEAU_OBJ_TYPE_TEXTBLOCK
};
typedef enum _en_obj_type en_obj_type;
} Clouseau_Object_Type;
struct _eet_extra_props_mapping
{
en_obj_type u;
const char *name;
};
typedef struct _eet_extra_props_mapping eet_extra_props_mapping;
struct _st_evas_props
struct _Clouseau_Evas_Props
{
const char *name;
const char *bt;
@ -66,9 +62,36 @@ struct _st_evas_props
Eina_Bool is_visible;
Evas_Object_Pointer_Mode mode;
};
typedef struct _st_evas_props st_evas_props;
struct _st_elm
struct _Clouseau_Evas_Text_Props
{
const char *font;
int size;
const char *source;
const char *text;
};
struct _Clouseau_Evas_Image_Props
{
const char *file, *key;
void *source;
const char *load_err;
};
struct _Clouseau_Evas_Textblock_Props
{
const char *style;
const char *text;
};
typedef struct _Clouseau_Evas_Textblock_Props Clouseau_Evas_Textblock_Props;
struct _Clouseau_Edje_Props
{
const char *file, *group;
const char *load_err;
};
struct _Clouseau_Elm_Props
{
const char *type;
const char *style;
@ -78,88 +101,48 @@ struct _st_elm
Eina_Bool is_mirrored;
Eina_Bool is_mirrored_automatic;
};
typedef struct _st_elm st_elm;
struct _st_text
{
const char *font;
int size;
const char *source;
const char *text;
};
typedef struct _st_text st_text;
struct _st_image
{
const char *file, *key;
void *source;
const char *load_err;
};
typedef struct _st_image st_image;
struct _st_edje
{
const char *file, *group;
const char *load_err;
};
typedef struct _st_edje st_edje;
struct _st_textblock
{
const char *style;
const char *text;
};
typedef struct _st_textblock st_textblock;
union _un_extra_props
{
st_elm elm;
st_text text;
st_image image;
st_edje edje;
st_textblock textblock;
};
typedef union _un_extra_props un_extra_props;
struct _st_extra_props
struct _Clouseau_Extra_Props
{ /* as Example_Union */
en_obj_type type;
un_extra_props u;
Clouseau_Object_Type type;
union {
Clouseau_Elm_Props elm;
Clouseau_Evas_Text_Props text;
Clouseau_Evas_Image_Props image;
Clouseau_Edje_Props edje;
Clouseau_Evas_Textblock_Props textblock;
} u;
};
typedef struct _st_extra_props st_extra_props;
struct _Obj_Information
struct _Clouseau_Object
{
st_evas_props evas_props;
st_extra_props extra_props;
Clouseau_Evas_Props evas_props;
Clouseau_Extra_Props extra_props;
};
typedef struct _Obj_Information Obj_Information;
struct _Bmp_Data
struct _Clouseau_Bitmap
{
unsigned char *bmp;
int bmp_count; /* is (w * h), for EET_DATA_DESCRIPTOR_ADD_BASIC_VAR_ARRAY */
Evas_Coord w;
Evas_Coord h;
};
typedef struct _Bmp_Data Bmp_Data;
struct _Tree_Item
struct _Clouseau_Tree_Item
{
Eina_List *children;
const char *name;
void *ptr; /* Just a ptr, we keep the value but not accessing mem */
Obj_Information *info;
unsigned long long ptr; /* Just a ptr, we keep the value but not accessing mem */
Clouseau_Object *info;
Eina_Bool is_obj;
Eina_Bool is_clipper;
Eina_Bool is_visible;
};
typedef struct _Tree_Item Tree_Item;
Obj_Information *_obj_information_get(Tree_Item *treeit);
Eet_Data_Descriptor *Obj_Information_desc_make(void);
void Obj_Information_desc_shutdown(void);
Clouseau_Object *_obj_information_get(Clouseau_Tree_Item *treeit);
Eet_Data_Descriptor *clouseau_object_desc_make(void);
void clouseau_object_desc_shutdown(void);
Evas_Object *clouseau_obj_information_list_add(Evas_Object *parent);
void clouseau_obj_information_list_populate(Tree_Item *treeit, Evas_Object *lb);
void clouseau_obj_information_list_populate(Clouseau_Tree_Item *treeit, Evas_Object *lb);
void clouseau_obj_information_list_clear();
#endif

View File

@ -1,332 +1,12 @@
#include "libclouseau.h"
typedef struct _Inf_Tree_Item Inf_Tree_Item;
struct _Inf_Tree_Item
typedef struct _Inf_Clouseau_Tree_Item Inf_Clouseau_Tree_Item;
struct _Inf_Clouseau_Tree_Item
{
Eina_List *children;
Evas_Object *icon;
const char *string;
};
/* START EET stuff */
struct _extra_props_descs
{
Eet_Data_Descriptor *elm;
Eet_Data_Descriptor *text;
Eet_Data_Descriptor *image;
Eet_Data_Descriptor *edje;
Eet_Data_Descriptor *textblock;
Eet_Data_Descriptor *_union_unified_descriptor;
Eet_Data_Descriptor_Class eddc;
};
typedef struct _extra_props_descs extra_props_descs;
static extra_props_descs *props_descs = NULL; /* to be used later for union */
static eet_extra_props_mapping eet_props_mapping[] =
{ /* As eet_mapping */
{ CLOUSEAU_OBJ_TYPE_OTHER, CLOUSEAU_OBJ_TYPE_OTHER_STR },
{ CLOUSEAU_OBJ_TYPE_ELM, CLOUSEAU_OBJ_TYPE_ELM_STR },
{ CLOUSEAU_OBJ_TYPE_TEXT, CLOUSEAU_OBJ_TYPE_TEXT_STR },
{ CLOUSEAU_OBJ_TYPE_IMAGE, CLOUSEAU_OBJ_TYPE_IMAGE_STR },
{ CLOUSEAU_OBJ_TYPE_EDJE, CLOUSEAU_OBJ_TYPE_EDJE_STR },
{ CLOUSEAU_OBJ_TYPE_TEXTBLOCK, CLOUSEAU_OBJ_TYPE_TEXTBLOCK_STR },
{ CLOUSEAU_OBJ_TYPE_UNKNOWN, NULL }
};
static const char *
_props_union_type_get(const void *data, Eina_Bool *unknow)
{ /* _union_type_get */
const en_obj_type *u = data;
int i;
if (unknow)
*unknow = EINA_FALSE;
for (i = 0; eet_props_mapping[i].name != NULL; ++i)
if (*u == eet_props_mapping[i].u)
return eet_props_mapping[i].name;
if (unknow)
*unknow = EINA_TRUE;
return NULL;
}
static Eina_Bool
_props_union_type_set(const char *type, void *data, Eina_Bool unknow)
{ /* same as _union_type_set */
en_obj_type *u = data;
int i;
if (unknow)
return EINA_FALSE;
for (i = 0; eet_props_mapping[i].name != NULL; ++i)
if (strcmp(eet_props_mapping[i].name, type) == 0)
{
*u = eet_props_mapping[i].u;
return EINA_TRUE;
}
return EINA_FALSE;
}
Eet_Data_Descriptor *
elm_desc_make(void)
{
Eet_Data_Descriptor *d;
Eet_Data_Descriptor_Class eddc;
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, st_elm);
d = eet_data_descriptor_stream_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_elm, "type", type, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_elm, "style", style, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_elm, "scale", scale, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_elm, "has_focus",
has_focus, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_elm, "is_disabled",
is_disabled, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_elm, "is_mirrored",
is_mirrored, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_elm, "is_mirrored_automatic",
is_mirrored_automatic, EET_T_UCHAR);
return d;
}
Eet_Data_Descriptor *
text_desc_make(void)
{
Eet_Data_Descriptor *d;
Eet_Data_Descriptor_Class eddc;
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, st_text);
d = eet_data_descriptor_stream_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_text, "font", font, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_text, "size", size, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_text, "source", source, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_text, "text", text, EET_T_STRING);
return d;
}
Eet_Data_Descriptor *
image_desc_make(void)
{
Eet_Data_Descriptor *d;
Eet_Data_Descriptor_Class eddc;
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, st_image);
d = eet_data_descriptor_stream_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_image, "file", file, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_image, "key", key, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_image, "source", source, EET_T_UINT);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_image, "load_err",
load_err, EET_T_STRING);
return d;
}
Eet_Data_Descriptor *
edje_desc_make(void)
{
Eet_Data_Descriptor *d;
Eet_Data_Descriptor_Class eddc;
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, st_edje);
d = eet_data_descriptor_stream_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_edje, "file", file, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_edje, "group", group, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_edje, "load_err",
load_err, EET_T_STRING);
return d;
}
Eet_Data_Descriptor *
textblock_desc_make(void)
{
Eet_Data_Descriptor *d;
Eet_Data_Descriptor_Class eddc;
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, st_textblock);
d = eet_data_descriptor_stream_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_textblock, "style",
style, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, st_textblock, "text",
text, EET_T_STRING);
return d;
}
Eet_Data_Descriptor *
Obj_Information_desc_make(void)
{
Eet_Data_Descriptor *d;
Eet_Data_Descriptor_Class eddc;
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Obj_Information);
d = eet_data_descriptor_stream_new(&eddc);
/* START - evas_props Struct desc */
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.name",
evas_props.name, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.bt",
evas_props.bt, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.layer",
evas_props.layer, EET_T_SHORT);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.x",
evas_props.x, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.y",
evas_props.y, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.w",
evas_props.w, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.h",
evas_props.h, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.scale",
evas_props.scale, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.min_w",
evas_props.min_w, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.min_h",
evas_props.min_h, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.max_w",
evas_props.max_w, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.max_h",
evas_props.max_h, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.req_w",
evas_props.req_w, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.req_h",
evas_props.req_h, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information,
"evas_props.align_x", evas_props.align_x, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information,
"evas_props.align_y", evas_props.align_y, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information,
"evas_props.weight_x", evas_props.weight_x, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information,
"evas_props.weight_y", evas_props.weight_y, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.r",
evas_props.r, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.g",
evas_props.g, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.b",
evas_props.b, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information, "evas_props.a",
evas_props.a, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information,
"evas_props.pass_events", evas_props.pass_events, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information,
"evas_props.has_focus", evas_props.has_focus, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information,
"evas_props.is_clipper", evas_props.is_clipper, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information,
"evas_props.is_visible", evas_props.is_visible, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(d, Obj_Information,
"evas_props.mode", evas_props.mode, EET_T_INT);
/* END - evas_props Struct desc */
if (!props_descs)
{ /* Free later in desc shutdown */
props_descs = calloc(1, sizeof(extra_props_descs));
props_descs->elm = elm_desc_make();
props_descs->text = text_desc_make();
props_descs->image = image_desc_make();
props_descs->edje = edje_desc_make();
props_descs->textblock = textblock_desc_make();
}
/* for union */
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&(props_descs->eddc),
st_extra_props);
props_descs->eddc.version = EET_DATA_DESCRIPTOR_CLASS_VERSION;
props_descs->eddc.func.type_get = _props_union_type_get;
props_descs->eddc.func.type_set = _props_union_type_set;
props_descs->_union_unified_descriptor =
eet_data_descriptor_file_new(&(props_descs->eddc));
/* START handle UNION desc */
EET_DATA_DESCRIPTOR_ADD_MAPPING(props_descs->_union_unified_descriptor,
CLOUSEAU_OBJ_TYPE_ELM_STR, props_descs->elm);
EET_DATA_DESCRIPTOR_ADD_MAPPING(props_descs->_union_unified_descriptor,
CLOUSEAU_OBJ_TYPE_TEXT_STR, props_descs->text);
EET_DATA_DESCRIPTOR_ADD_MAPPING(props_descs->_union_unified_descriptor,
CLOUSEAU_OBJ_TYPE_IMAGE_STR, props_descs->image);
EET_DATA_DESCRIPTOR_ADD_MAPPING(props_descs->_union_unified_descriptor,
CLOUSEAU_OBJ_TYPE_EDJE_STR, props_descs->edje);
EET_DATA_DESCRIPTOR_ADD_MAPPING(props_descs->_union_unified_descriptor,
CLOUSEAU_OBJ_TYPE_TEXTBLOCK_STR, props_descs->textblock);
EET_DATA_DESCRIPTOR_ADD_UNION(d, Obj_Information, "u", extra_props.u,
extra_props.type, props_descs->_union_unified_descriptor);
/* END handle UNION desc */
return d;
}
void
Obj_Information_desc_shutdown(void)
{
if (props_descs)
{
eet_data_descriptor_free(props_descs->elm);
eet_data_descriptor_free(props_descs->text);
eet_data_descriptor_free(props_descs->image);
eet_data_descriptor_free(props_descs->edje);
eet_data_descriptor_free(props_descs->textblock);
eet_data_descriptor_free(props_descs->_union_unified_descriptor);
free(props_descs);
props_descs = NULL;
}
}
/* END EET stuff */
static Eina_List *information_tree = NULL;
static Evas_Object *prop_list = NULL;
static Elm_Genlist_Item_Class itc;
@ -343,8 +23,8 @@ static void
gl_exp(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Elm_Object_Item *glit = event_info;
Inf_Tree_Item *parent = elm_object_item_data_get(glit);
Inf_Tree_Item *tit;
Inf_Clouseau_Tree_Item *parent = elm_object_item_data_get(glit);
Inf_Clouseau_Tree_Item *tit;
Eina_List *itr;
EINA_LIST_FOREACH(parent->children, itr, tit)
@ -388,7 +68,7 @@ static char *
item_text_get(void *data, Evas_Object *obj EINA_UNUSED,
const char *part EINA_UNUSED)
{
Inf_Tree_Item *tit = data;
Inf_Clouseau_Tree_Item *tit = data;
return strdup(tit->string);
}
@ -415,9 +95,9 @@ clouseau_obj_information_list_add(Evas_Object *parent)
}
static void
_item_tree_item_free(Inf_Tree_Item *parent)
_item_tree_item_free(Inf_Clouseau_Tree_Item *parent)
{
Inf_Tree_Item *treeit;
Inf_Clouseau_Tree_Item *treeit;
EINA_LIST_FREE(parent->children, treeit)
{
@ -431,7 +111,7 @@ _item_tree_item_free(Inf_Tree_Item *parent)
static void
_item_tree_free(void)
{
Inf_Tree_Item *treeit;
Inf_Clouseau_Tree_Item *treeit;
EINA_LIST_FREE(information_tree, treeit)
{
@ -440,7 +120,7 @@ _item_tree_free(void)
}
void
obj_information_free(Obj_Information *oinfo)
obj_information_free(Clouseau_Object *oinfo)
{
if (!oinfo)
return;
@ -481,15 +161,15 @@ obj_information_free(Obj_Information *oinfo)
free(oinfo);
}
Obj_Information *
obj_information_get(Tree_Item *treeit)
Clouseau_Object *
obj_information_get(Clouseau_Tree_Item *treeit)
{
if (!treeit->is_obj)
return NULL;
Obj_Information *oinfo;
Evas_Object *obj = treeit->ptr;
oinfo = calloc(1, sizeof(Obj_Information));
Clouseau_Object *oinfo;
Evas_Object *obj = (void*) (uintptr_t) treeit->ptr;
oinfo = calloc(1, sizeof(Clouseau_Object));
oinfo->evas_props.pass_events = evas_object_pass_events_get(obj);
oinfo->evas_props.has_focus = evas_object_focus_get(obj);
@ -608,16 +288,133 @@ static const struct {
const char *text;
Evas_Object_Pointer_Mode mode;
} pointer_mode[3] = {
# define POINTER_MODE(Value) { "Pointer mode : "#Value, Value }
# define POINTER_MODE(Value) { #Value, Value }
POINTER_MODE(EVAS_OBJECT_POINTER_MODE_AUTOGRAB),
POINTER_MODE(EVAS_OBJECT_POINTER_MODE_NOGRAB),
POINTER_MODE(EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN)
# undef POINTER_MODE
};
void
clouseau_obj_information_list_populate(Tree_Item *treeit, Evas_Object *lb)
static void
_clouseau_information_buffer_to_tree(Inf_Clouseau_Tree_Item *parent, const char *buffer)
{
Inf_Clouseau_Tree_Item *item;
item = calloc(1, sizeof (Inf_Clouseau_Tree_Item));
if (!item) return ;
item->string = eina_stringshare_add(buffer);
parent->children = eina_list_append(parent->children, item);
}
static void
_clouseau_information_string_to_tree(Inf_Clouseau_Tree_Item *parent, const char *name, const char *value)
{
char *buffer;
int length;
if (!value) return ;
length = strlen(name) + 5;
length += strlen(value);
buffer = alloca(length);
snprintf(buffer, length, "%s: '%s'", name, value);
_clouseau_information_buffer_to_tree(parent, buffer);
}
static void
_clouseau_information_geometry_to_tree(Inf_Clouseau_Tree_Item *parent, const char *name, int xw, int yh)
{
char *buffer;
int length;
length = strlen(name) + 4 + 20;
buffer = alloca(length);
snprintf(buffer, length, "%s: %d %d", name, xw, yh);
_clouseau_information_buffer_to_tree(parent, buffer);
}
static void
_clouseau_information_bool_to_tree(Inf_Clouseau_Tree_Item *parent, const char *name, Eina_Bool value)
{
_clouseau_information_string_to_tree(parent, name, value ? "EINA_TRUE" : "EINA_FALSE");
}
static void
_clouseau_information_double_to_tree(Inf_Clouseau_Tree_Item *parent, const char *name, double d)
{
char *buffer;
int length;
length = strlen(name) + 3 + 64;
buffer = alloca(length);
snprintf(buffer, length, "%s: %.6lg", name, d);
_clouseau_information_buffer_to_tree(parent, buffer);
}
static void
_clouseau_information_hint_to_tree(Inf_Clouseau_Tree_Item *parent, const char *name, double xw, double yh)
{
char *buffer;
int length;
length = strlen(name) + 3 + 128;
buffer = alloca(length);
snprintf(buffer, length, "%s: %.6lg %.61g", name, xw, yh);
_clouseau_information_buffer_to_tree(parent, buffer);
}
static const struct {
Clouseau_Object_Type type;
const char *name;
} _clouseau_types[] = {
{ CLOUSEAU_OBJ_TYPE_ELM, "Elementary" },
{ CLOUSEAU_OBJ_TYPE_TEXT, "Text" },
{ CLOUSEAU_OBJ_TYPE_IMAGE, "Image" },
{ CLOUSEAU_OBJ_TYPE_EDJE, "Edje" },
{ CLOUSEAU_OBJ_TYPE_TEXTBLOCK, "Textblock" }
};
static const char *
_clouseau_type_to_string(Clouseau_Object_Type type)
{
unsigned int i;
for (i = 0; i < sizeof (_clouseau_types) / sizeof (_clouseau_types[0]); ++i)
if (_clouseau_types[i].type == type)
return eina_stringshare_add(_clouseau_types[i].name);
return NULL;
}
static Inf_Clouseau_Tree_Item *
_clouseau_type_to_parent(Eina_List **main, const char *name)
{
Inf_Clouseau_Tree_Item *item;
if (!name) return NULL;
item = calloc(1, sizeof(Inf_Clouseau_Tree_Item));
item->string = eina_stringshare_add(name);
*main = eina_list_append(*main, item);
return item;
}
void
clouseau_obj_information_list_populate(Clouseau_Tree_Item *treeit, Evas_Object *lb)
{
Inf_Clouseau_Tree_Item *main_tit;
Clouseau_Object *oinfo;
char buf[1024];
unsigned int i;
clouseau_obj_information_list_clear();
@ -625,333 +422,129 @@ clouseau_obj_information_list_populate(Tree_Item *treeit, Evas_Object *lb)
if (!treeit->is_obj)
return;
Inf_Tree_Item *main_tit;
Obj_Information *oinfo = treeit->info;
oinfo = treeit->info;
/* Populate evas properties list */
main_tit = calloc(1, sizeof(Inf_Tree_Item));
main_tit->string = eina_stringshare_add("Evas");
information_tree = eina_list_append(information_tree, main_tit);
main_tit = _clouseau_type_to_parent(&information_tree, "Evas");
{
Inf_Tree_Item *tit;
char buf[1024];
_clouseau_information_bool_to_tree(main_tit, "Visibility",
oinfo->evas_props.is_visible);
_clouseau_information_string_to_tree(main_tit, "Name", oinfo->evas_props.name);
snprintf(buf, sizeof(buf), "Visibility: %d",
(int) oinfo->evas_props.is_visible);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
if (oinfo->evas_props.name)
{
snprintf(buf, sizeof(buf), "Name: %s", oinfo->evas_props.name);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
}
snprintf(buf, sizeof(buf), "Layer: %hd", oinfo->evas_props.layer);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
snprintf(buf, sizeof(buf), "Position: %d %d", oinfo->evas_props.x,
oinfo->evas_props.y);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
snprintf(buf, sizeof(buf), "Size: %d %d", oinfo->evas_props.w,
oinfo->evas_props.h);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
snprintf(buf, sizeof(buf), "Scale: %.6lg", oinfo->evas_props.scale);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
snprintf(buf, sizeof(buf), "Layer: %hd", oinfo->evas_props.layer);
_clouseau_information_buffer_to_tree(main_tit, buf);
_clouseau_information_geometry_to_tree(main_tit, "Position",
oinfo->evas_props.x,
oinfo->evas_props.y);
_clouseau_information_geometry_to_tree(main_tit, "Size",
oinfo->evas_props.w,
oinfo->evas_props.h);
_clouseau_information_double_to_tree(main_tit, "Scale", oinfo->evas_props.scale);
#if 0
if (evas_object_clip_get(obj))
{
evas_object_geometry_get(
evas_object_clip_get(obj), &x, &y, &w, &h);
snprintf(buf, sizeof(buf), "Clipper position: %d %d", x, y);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
snprintf(buf, sizeof(buf), "Clipper size: %d %d", w, h);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
}
if (evas_object_clip_get(obj))
{
evas_object_geometry_get(evas_object_clip_get(obj), &x, &y, &w, &h);
_clouseau_information_geometry_to_tree(main_tit, "Clipper position", x, y);
_clouseau_information_geometry_to_tree(main_tit, "Clipper size", w, h);
}
#endif
snprintf(buf, sizeof(buf), "Min size: %d %d", oinfo->evas_props.min_w,
oinfo->evas_props.min_h);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
snprintf(buf, sizeof(buf), "Max size: %d %d", oinfo->evas_props.max_w,
oinfo->evas_props.max_h);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
snprintf(buf, sizeof(buf), "Request size: %d %d",
oinfo->evas_props.req_w, oinfo->evas_props.req_h);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
snprintf(buf, sizeof(buf), "Align: %.6lg %.6lg",
oinfo->evas_props.align_x, oinfo->evas_props.align_y);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
snprintf(buf, sizeof(buf), "Weight: %.6lg %.6lg",
oinfo->evas_props.weight_x, oinfo->evas_props.weight_y);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
_clouseau_information_geometry_to_tree(main_tit, "Min size",
oinfo->evas_props.min_w,
oinfo->evas_props.min_h);
_clouseau_information_geometry_to_tree(main_tit, "Max size",
oinfo->evas_props.max_w,
oinfo->evas_props.max_h);
_clouseau_information_geometry_to_tree(main_tit, "Request size",
oinfo->evas_props.req_w,
oinfo->evas_props.req_h);
_clouseau_information_hint_to_tree(main_tit, "Align",
oinfo->evas_props.align_x,
oinfo->evas_props.align_y);
_clouseau_information_hint_to_tree(main_tit, "Weight",
oinfo->evas_props.weight_x,
oinfo->evas_props.weight_y);
#if 0
evas_object_size_hint_aspect_get(obj, &w, &h);
snprintf(buf, sizeof(buf), "Aspect: %d %d", w, h);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
evas_object_size_hint_aspect_get(obj, &w, &h);
_clouseau_information_geometry_to_tree(main_tit, "Aspect", w, h);
#endif
snprintf(buf, sizeof(buf), "Color: %d %d %d %d",
oinfo->evas_props.r, oinfo->evas_props.g, oinfo->evas_props.b,
oinfo->evas_props.a);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
snprintf(buf, sizeof(buf), "Color: %d %d %d %d",
oinfo->evas_props.r, oinfo->evas_props.g, oinfo->evas_props.b,
oinfo->evas_props.a);
_clouseau_information_buffer_to_tree(main_tit, buf);
snprintf(buf, sizeof(buf), "Has focus: %d",
(int) oinfo->evas_props.has_focus);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
_clouseau_information_bool_to_tree(main_tit, "Has focus",
oinfo->evas_props.has_focus);
for (i = 0; i < sizeof (pointer_mode) / sizeof (pointer_mode[0]); ++i)
if (pointer_mode[i].mode == oinfo->evas_props.mode)
{
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(pointer_mode[i].text);
main_tit->children = eina_list_append(main_tit->children, tit);
break;
}
for (i = 0; i < sizeof (pointer_mode) / sizeof (pointer_mode[0]); ++i)
if (pointer_mode[i].mode == oinfo->evas_props.mode)
{
_clouseau_information_string_to_tree(main_tit, "Pointer mode",
pointer_mode[i].text);
break;
}
snprintf(buf, sizeof(buf), "Pass events: %d",
(int) oinfo->evas_props.pass_events);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
_clouseau_information_bool_to_tree(main_tit, "Pass events",
oinfo->evas_props.pass_events);
_clouseau_information_bool_to_tree(main_tit, "Has clipees",
oinfo->evas_props.is_clipper);
if (oinfo->evas_props.is_clipper)
{
snprintf(buf, sizeof(buf), "Has clipees");
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
}
}
if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_ELM)
main_tit = _clouseau_type_to_parent(&information_tree,
_clouseau_type_to_string(oinfo->extra_props.type));
if (main_tit)
{
Inf_Tree_Item *tit;
char buf[1024];
main_tit = calloc(1, sizeof(Inf_Tree_Item));
main_tit->string = eina_stringshare_add("Elementary");
information_tree = eina_list_append(information_tree, main_tit);
snprintf(buf, sizeof(buf), "Wid-Type: %s", oinfo->extra_props.u.elm.type);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_ELM)
{
_clouseau_information_string_to_tree(main_tit, "Wid-Type", oinfo->extra_props.u.elm.type);
#if 0
/* Extract actual data from theme? */
snprintf(buf, sizeof(buf), "Theme: %s", elm_widget_theme_get(obj));
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
/* Extract actual data from theme? */
_clouseau_information_string_to_tree(main_tit, "Theme", elm_widget_theme_get(obj));
#endif
snprintf(buf, sizeof(buf), "Style: %s",
oinfo->extra_props.u.elm.style);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
snprintf(buf, sizeof(buf), "Scale: %.6lg",
oinfo->extra_props.u.elm.scale);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
snprintf(buf, sizeof(buf), "Disabled: %d",
oinfo->extra_props.u.elm.is_disabled);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
snprintf(buf, sizeof(buf), "Has focus: %d",
oinfo->extra_props.u.elm.has_focus);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
snprintf(buf, sizeof(buf), "Mirrored: %d",
oinfo->extra_props.u.elm.is_mirrored);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
snprintf(buf, sizeof(buf), "Automatic mirroring: %d",
oinfo->extra_props.u.elm.is_mirrored_automatic);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
}
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_TEXT)
{
Inf_Tree_Item *tit;
char buf[1024];
const char *font;
const char *text;
main_tit = calloc(1, sizeof(Inf_Tree_Item));
main_tit->string = eina_stringshare_add("Text");
information_tree = eina_list_append(information_tree, main_tit);
snprintf(buf, sizeof(buf), "Font: %s", oinfo->extra_props.u.text.font);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
snprintf(buf, sizeof(buf), "Size: %d", oinfo->extra_props.u.text.size);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
font = oinfo->extra_props.u.text.source;
if (font)
{
snprintf(buf, sizeof(buf), "Source: %s", font);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
_clouseau_information_string_to_tree(main_tit, "Style", oinfo->extra_props.u.elm.style);
_clouseau_information_double_to_tree(main_tit, "Scale",
oinfo->extra_props.u.elm.scale);
_clouseau_information_bool_to_tree(main_tit, "Disabled",
oinfo->extra_props.u.elm.is_disabled);
_clouseau_information_bool_to_tree(main_tit, "Has focus",
oinfo->extra_props.u.elm.has_focus);
_clouseau_information_bool_to_tree(main_tit, "Mirrored",
oinfo->extra_props.u.elm.is_mirrored);
_clouseau_information_bool_to_tree(main_tit, "Automatic mirroring",
oinfo->extra_props.u.elm.is_mirrored_automatic);
}
text = oinfo->extra_props.u.text.text;
if (text)
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_TEXT)
{
snprintf(buf, sizeof(buf), "Text: %s", text);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
_clouseau_information_string_to_tree(main_tit, "Font", oinfo->extra_props.u.text.font);
snprintf(buf, sizeof(buf), "Size: %d", oinfo->extra_props.u.text.size);
_clouseau_information_buffer_to_tree(main_tit, buf);
_clouseau_information_string_to_tree(main_tit, "Source", oinfo->extra_props.u.text.source);
_clouseau_information_string_to_tree(main_tit, "Text", oinfo->extra_props.u.text.text);
}
}
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_IMAGE)
{
Inf_Tree_Item *tit;
char buf[1024];
main_tit = calloc(1, sizeof(Inf_Tree_Item));
main_tit->string = eina_stringshare_add("Image");
information_tree = eina_list_append(information_tree, main_tit);
snprintf(buf, sizeof(buf), "File name: %s",
oinfo->extra_props.u.image.file);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
if (oinfo->extra_props.u.image.key)
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_IMAGE)
{
snprintf(buf, sizeof(buf), "File key: %s",
oinfo->extra_props.u.image.key);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
_clouseau_information_string_to_tree(main_tit, "Filename", oinfo->extra_props.u.image.file);
_clouseau_information_string_to_tree(main_tit, "File key", oinfo->extra_props.u.image.key);
_clouseau_information_string_to_tree(main_tit, "Source", oinfo->extra_props.u.image.source);
_clouseau_information_string_to_tree(main_tit, "Load error", oinfo->extra_props.u.image.load_err);
}
if (oinfo->extra_props.u.image.source)
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_EDJE)
{
snprintf(buf, sizeof(buf), "Source: %p",
oinfo->extra_props.u.image.source);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
_clouseau_information_string_to_tree(main_tit, "File", oinfo->extra_props.u.edje.file);
_clouseau_information_string_to_tree(main_tit, "Group", oinfo->extra_props.u.edje.group);
_clouseau_information_string_to_tree(main_tit, "Load error", oinfo->extra_props.u.edje.load_err);
}
if (oinfo->extra_props.u.image.load_err)
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_TEXTBLOCK)
{
snprintf(buf, sizeof(buf), "Load error: %s",
oinfo->extra_props.u.image.load_err);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
_clouseau_information_string_to_tree(main_tit, "Style", oinfo->extra_props.u.textblock.style);
_clouseau_information_string_to_tree(main_tit, "Text", oinfo->extra_props.u.textblock.text);
}
}
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_EDJE)
{
Inf_Tree_Item *tit;
char buf[1024];
main_tit = calloc(1, sizeof(Inf_Tree_Item));
main_tit->string = eina_stringshare_add("Edje");
information_tree = eina_list_append(information_tree, main_tit);
snprintf(buf, sizeof(buf), "File: %s", oinfo->extra_props.u.edje.file);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
snprintf(buf, sizeof(buf), "Group: %s", oinfo->extra_props.u.edje.group);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
if (oinfo->extra_props.u.edje.load_err)
{
snprintf(buf, sizeof(buf), "Load error: %s",
oinfo->extra_props.u.edje.load_err);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
}
}
else if (oinfo->extra_props.type == CLOUSEAU_OBJ_TYPE_TEXTBLOCK)
{
Inf_Tree_Item *tit;
char buf[1024];
main_tit = calloc(1, sizeof(Inf_Tree_Item));
main_tit->string = eina_stringshare_add("Textblock");
information_tree = eina_list_append(information_tree, main_tit);
snprintf(buf, sizeof(buf), "Style: '%s'",
oinfo->extra_props.u.textblock.style);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
snprintf(buf, sizeof(buf), "Text: '%s'",
oinfo->extra_props.u.textblock.text);
tit = calloc(1, sizeof(Inf_Tree_Item));
tit->string = eina_stringshare_add(buf);
main_tit->children = eina_list_append(main_tit->children, tit);
}
/* Update backtrace text */
if (oinfo->evas_props.bt)
@ -970,24 +563,24 @@ clouseau_obj_information_list_populate(Tree_Item *treeit, Evas_Object *lb)
/* Actually populate the genlist */
{
Eina_List *itr;
Inf_Tree_Item *tit;
Eina_Bool first_it = EINA_TRUE;
{
Eina_List *itr;
Inf_Clouseau_Tree_Item *tit;
Eina_Bool first_it = EINA_TRUE;
EINA_LIST_FOREACH(information_tree, itr, tit)
{
Elm_Object_Item *git;
git = elm_genlist_item_append(prop_list, &itc, tit, NULL,
ELM_GENLIST_ITEM_TREE, _gl_selected, NULL);
if (first_it)
EINA_LIST_FOREACH(information_tree, itr, tit)
{
Elm_Object_Item *git;
git = elm_genlist_item_append(prop_list, &itc, tit, NULL,
ELM_GENLIST_ITEM_TREE, _gl_selected, NULL);
if (first_it)
{
/* Start with all the base item expanded */
elm_genlist_item_expanded_set(git, EINA_TRUE);
first_it = EINA_FALSE;
}
}
}
}
}
}
void