clouseau: using ulong long for pointers This is done for all EET transferred pointer for compat issue

Signed-off-by: Aharon Hillel <a.hillel@partner.samsung.com>

SVN revision: 71040
This commit is contained in:
Aharon Hillel 2012-05-14 14:39:49 +00:00 committed by Tom Hacohen
parent 100d6e8974
commit 5c4d247093
5 changed files with 82 additions and 50 deletions

View File

@ -5,6 +5,7 @@
#include <Edje.h>
#include <Evas.h>
#include <Elementary.h>
#include <stdint.h>
#include "libclouseau.h"
#include "helper.h" /* Our own helper functions */
@ -124,7 +125,7 @@ _app_ptr_cmp(const void *d1, const void *d2)
const app_data_st *info = d1;
app_info_st *app = info->app->data;
return ((app->ptr) - d2);
return ((app->ptr) - (unsigned long long) (uintptr_t) d2);
}
static void
@ -157,7 +158,8 @@ _remove_app(gui_elements *gui, Variant_st *v)
app_closed_st *app = v->data;
app_info_st *sel_app = gui->sel_app->app->data;
app_data_st *st = (app_data_st *)
eina_list_search_unsorted(apps, _app_ptr_cmp, app->ptr);
eina_list_search_unsorted(apps, _app_ptr_cmp,
(void *) (uintptr_t) app->ptr);
if (app->ptr == sel_app->ptr)
{
@ -194,7 +196,8 @@ _update_tree(gui_elements *gui, Variant_st *v)
{ /* Update Tree for app, then update GUI if its displayed */
tree_data_st *td = v->data;
app_data_st *st = (app_data_st *)
eina_list_search_unsorted(apps, _app_ptr_cmp, td->app);
eina_list_search_unsorted(apps, _app_ptr_cmp,
(void *) (uintptr_t) td->app);
if (st)
{
@ -421,7 +424,9 @@ _gl_selected(void *data __UNUSED__, Evas_Object *pobj __UNUSED__,
int size;
gui_elements *g = data;
app_info_st *app = g->sel_app->app->data;
highlight_st st = { app->ptr, treeit->ptr };
highlight_st st = { (unsigned long long) (uintptr_t) app->ptr,
(unsigned long long) (uintptr_t) treeit->ptr };
Ecore_Ipc_Server *svr = _connect_to_daemon(g);
void *p = packet_compose(HIGHLIGHT, &st, sizeof(st), &size);
if (p)
@ -460,11 +465,14 @@ _load_list(gui_elements *gui)
elm_genlist_clear(gui->prop_list);
app_info_st *st = gui->sel_app->app->data;
if (eina_list_search_unsorted(apps, _app_ptr_cmp, st->ptr))
if (eina_list_search_unsorted(apps, _app_ptr_cmp,
(void *) (uintptr_t) st->ptr))
{ /* do it only if app selected AND found in apps list */
int size;
Ecore_Ipc_Server *svr = _connect_to_daemon(gui);
data_req_st t = { NULL, st->ptr };
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);
if (p)
{

View File

@ -3,6 +3,7 @@
#include <fcntl.h>
#include <Ecore.h>
#include <Ecore_Ipc.h>
#include <stdint.h>
#include "helper.h"
#include "eet_dump.h"
@ -137,7 +138,7 @@ void daemonize(void)
static int
_client_ptr_cmp(const void *d1, const void *d2)
{
return (((app_info_st *) d1)->ptr - d2);
return (((app_info_st *) d1)->ptr - ((unsigned long long) (uintptr_t) d2));
}
static Eina_List *
@ -148,7 +149,7 @@ _add_client(Eina_List *clients, connect_st *t, void *client)
app_info_st *st = malloc(sizeof(app_info_st));
st->name = strdup(t->name);
st->pid = t->pid;
st->ptr = client;
st->ptr = (unsigned long long) (uintptr_t) client;
return eina_list_append(clients, st);
}
@ -202,7 +203,7 @@ _del(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Del *e
i = eina_list_search_unsorted(app, _client_ptr_cmp, ev->client);
if (i)
{ /* Notify all GUI clients to remove this APP */
app_closed_st t = { ev->client };
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);
@ -210,9 +211,9 @@ _del(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Del *e
{
EINA_LIST_FOREACH(gui, l, i)
{
ecore_ipc_client_send(i->ptr,
ecore_ipc_client_send((void *) (uintptr_t) i->ptr,
0,0,0,0,EINA_FALSE, p, size);
ecore_ipc_client_flush(i->ptr);
ecore_ipc_client_flush((void *) (uintptr_t) i->ptr);
}
free(p);
@ -245,16 +246,20 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Data
app_info_st *st;
Eina_List *l;
connect_st *t = v->data;
app_info_st m = { t->pid, (char *) t->name, ev->client};
app_info_st m = { t->pid, (char *) t->name,
(unsigned long long) (uintptr_t) ev->client};
app = _add_client(app, t, ev->client);
p = packet_compose(APP_ADD, &m, sizeof(m), &size);
if (p)
{
EINA_LIST_FOREACH(gui, l, st)
{ /* Notify all GUI clients to add APP */
ecore_ipc_client_send(st->ptr,
ecore_ipc_client_send(
(void *) (uintptr_t) st->ptr,
0,0,0,0,EINA_FALSE, p, size);
ecore_ipc_client_flush(st->ptr);
ecore_ipc_client_flush(
(void *) (uintptr_t) st->ptr);
}
free(p);
@ -289,16 +294,22 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Data
if (req->app)
{ /* Requesting specific app data */
if(eina_list_search_unsorted(app,
_client_ptr_cmp, req->app))
_client_ptr_cmp,
(void *) (uintptr_t) req->app))
{ /* Do the req only of APP connected to daemon */
data_req_st t = { ev->client, req->app };
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);
if (p)
{
ecore_ipc_client_send(req->app, 0,0,0,0,
EINA_FALSE, p, size);
ecore_ipc_client_flush(req->app);
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);
}
}
@ -307,17 +318,22 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Data
{ /* requesting ALL apps data */
Eina_List *l;
app_info_st *st;
data_req_st t = { ev->client, NULL };
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 = st->ptr;
t.app = (unsigned long long) (uintptr_t) st->ptr;
p = packet_compose(DATA_REQ,
&t, sizeof(t), &size);
if (p)
{
ecore_ipc_client_send(st->ptr, 0,0,0,0,
EINA_FALSE, p, size);
ecore_ipc_client_flush(st->ptr);
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);
}
}
@ -331,11 +347,14 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Data
if (td->gui)
{ /* Sending tree data to specific GUI client */
if(eina_list_search_unsorted(gui,
_client_ptr_cmp, td->gui))
_client_ptr_cmp,
(void *) (uintptr_t) td->gui))
{ /* Do the req only of GUI connected to daemon */
ecore_ipc_client_send(td->gui, 0,0,0,0,
ecore_ipc_client_send(
(void *) (uintptr_t) td->gui, 0,0,0,0,
EINA_FALSE, ev->data, ev->size);
ecore_ipc_client_flush(td->gui);
ecore_ipc_client_flush(
(void *) (uintptr_t) td->gui);
}
}
else
@ -344,9 +363,11 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Data
app_info_st *p;
EINA_LIST_FOREACH(gui, l, p)
{
ecore_ipc_client_send(p->ptr, 0,0,0,0,
ecore_ipc_client_send(
(void *) (uintptr_t) p->ptr, 0,0,0,0,
EINA_FALSE, ev->data, ev->size);
ecore_ipc_client_flush(p->ptr);
ecore_ipc_client_flush(
(void *) (uintptr_t) p->ptr);
}
}
}
@ -356,11 +377,12 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Client_Data
{ /* FWD this message to app */
highlight_st *ht = v->data;
if(eina_list_search_unsorted(app,
_client_ptr_cmp, ht->app))
_client_ptr_cmp, (void *) (uintptr_t) ht->app))
{ /* Do the req only of APP connected to daemon */
ecore_ipc_client_send(ht->app, 0,0,0,0,
ecore_ipc_client_send((void *)
(uintptr_t) ht->app, 0,0,0,0,
EINA_FALSE, ev->data, ev->size);
ecore_ipc_client_flush(ht->app);
ecore_ipc_client_flush((void *) (uintptr_t) ht->app);
}
}
break;

View File

@ -155,7 +155,7 @@ app_add_desc_make(void)
EET_DATA_DESCRIPTOR_ADD_BASIC (d, app_info_st, "pid", pid, EET_T_UINT);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, app_info_st, "name", name, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, app_info_st, "ptr", ptr, EET_T_UINT);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, app_info_st, "ptr", ptr, EET_T_ULONG_LONG);
return d;
}
@ -169,8 +169,8 @@ data_req_desc_make(void)
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, data_req_st);
d = eet_data_descriptor_stream_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, data_req_st, "gui", gui, EET_T_UINT);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, data_req_st, "app", app, EET_T_UINT);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, data_req_st, "gui", gui, EET_T_ULONG_LONG);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, data_req_st, "app", app, EET_T_ULONG_LONG);
return d;
}
@ -184,8 +184,8 @@ tree_data_desc_make(void)
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, tree_data_st);
d = eet_data_descriptor_stream_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, tree_data_st, "gui", gui, EET_T_UINT);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, tree_data_st, "app", app, EET_T_UINT);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, tree_data_st, "gui", gui, EET_T_ULONG_LONG);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, tree_data_st, "app", app, EET_T_ULONG_LONG);
EET_DATA_DESCRIPTOR_ADD_LIST (d, tree_data_st,
"tree", tree, desc->tree); /* Carefull - init this first */
@ -201,7 +201,8 @@ app_closed_desc_make(void)
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, app_closed_st);
d = eet_data_descriptor_stream_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, app_closed_st, "ptr", ptr, EET_T_UINT);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, app_closed_st, "ptr",
ptr, EET_T_ULONG_LONG);
return d;
}
@ -215,9 +216,10 @@ highlight_desc_make(void)
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, highlight_st);
d = eet_data_descriptor_stream_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, highlight_st, "app", app, EET_T_UINT);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, highlight_st, "app",
app, EET_T_ULONG_LONG);
EET_DATA_DESCRIPTOR_ADD_BASIC (d, highlight_st,
"object", object, EET_T_UINT);
"object", object, EET_T_ULONG_LONG);
return d;
}

View File

@ -56,35 +56,35 @@ struct _app_info_st
{ /* This will be used to register new APP in GUI client */
unsigned int pid;
char *name;
void *ptr; /* client ptr of this app as saved by daemon */
unsigned long long ptr; /* (void *) client ptr of app as saved by daemon */
};
typedef struct _app_info_st app_info_st;
struct _data_req_st
{ /* This will be used to ask for tree data by DAEMON or GUI */
void *gui; /* client ptr of GUI, NULL if send by GUI client */
void *app; /* client ptr APP, NULL if asking for all APP data */
unsigned long long gui; /* (void *) client ptr of GUI */
unsigned long long app; /* (void *) client ptr APP */
};
typedef struct _data_req_st data_req_st;
struct _tree_data_st
{ /* This will be used to send tree data to/from APP/DAEMON */
void *gui; /* client ptr of GUI, NULL if need to FWD to all */
void *app; /* client ptr APP, NULL if asking for all APP data */
unsigned long long gui; /* (void *) client ptr of GUI */
unsigned long long app; /* (void *) client ptr APP */
Eina_List *tree; /* The actual (Tree_Item *) list */
};
typedef struct _tree_data_st tree_data_st;
struct _app_closed_st
{ /* This will be used to notify GUI of app closed */
void *ptr; /* client ptr of APP */
{ /* This will be used to notify GUI of app closed */
unsigned long long ptr; /* (void *) client ptr APP */
};
typedef struct _app_closed_st app_closed_st;
struct _highlight_st
{ /* This will be used to highlight object in APP */
void *app; /* client ptr of APP */
void *object; /* object ptr of object to highlight */
unsigned long long app; /* (void *) client ptr of APP */
unsigned long long object; /* (void *) object ptr of object to highlight */
};
typedef struct _highlight_st highlight_st;

View File

@ -166,7 +166,7 @@ _data(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Ipc_Event_Server_Data
case HIGHLIGHT:
{
highlight_st *ht = v->data;
libclouseau_highlight(ht->object);
libclouseau_highlight((Evas_Object *) (uintptr_t) ht->object);
}
break;