Merge the Eo/Evas/Eolian into Clouseau

This commit is contained in:
Daniel Zaoui 2017-05-27 20:43:23 +03:00
parent 5d4e377378
commit a35cbb82ea
6 changed files with 943 additions and 156 deletions

View File

@ -18,6 +18,7 @@ find_package(Elementary REQUIRED)
find_package(Ecore REQUIRED)
find_package(Evas REQUIRED)
find_package(Edebug REQUIRED)
find_package(Ffi REQUIRED)
add_subdirectory(src/bin)
add_subdirectory(src/lib)

View File

@ -24,6 +24,7 @@ add_executable(clouseau_client ${SOURCES})
target_link_libraries(clouseau_client
pthread
clouseau_debug
${EFL_LIBRARIES}
${ELEMENTARY_LIBRARIES}
${EINA_LIBRARIES}

View File

@ -461,7 +461,7 @@ static Eina_Debug_Error
_clients_info_added_cb(Eina_Debug_Session *session EINA_UNUSED, int src EINA_UNUSED, void *buffer, int size)
{
char *buf = buffer;
while (size)
while (size > 0)
{
int cid, pid, len;
EXTRACT(buf, &cid, sizeof(int));

View File

@ -2,8 +2,12 @@ set(CMAKE_BUILD_TYPE Debug)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${EO_INCLUDE_DIRS}
${EINA_INCLUDE_DIRS}
${EOLIAN_INCLUDE_DIRS}
${EO_INCLUDE_DIRS}
${FFI_INCLUDE_DIRS}
${EVAS_INCLUDE_DIRS}
${ELEMENTARY_INCLUDE_DIRS}
)
add_library(clouseau_debug SHARED clouseau_debug.c)
@ -11,6 +15,8 @@ add_library(clouseau_debug SHARED clouseau_debug.c)
target_link_libraries(clouseau_debug
${EINA_LIBRARIES}
${EO_LIBRARIES}
${EOLIAN_LIBRARIES}
${FFI_LIBRARIES}
)
INSTALL(FILES Clouseau.h DESTINATION include)

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +1,13 @@
#include <Eina.h>
#include <Eolian.h>
#include <Eolian_Debug.h>
#include <Eo_Debug.h>
#include <Evas_Debug.h>
#include "../../Clouseau_Debug.h"
#include "../../Clouseau.h"
#include "gui.h"
#define _EET_ENTRY "config"
static int _module_init_op = EINA_DEBUG_OPCODE_INVALID;
static int _eoids_get_op = EINA_DEBUG_OPCODE_INVALID;
static int _klids_get_op = EINA_DEBUG_OPCODE_INVALID;
static int _obj_info_op = EINA_DEBUG_OPCODE_INVALID;
@ -70,10 +67,6 @@ typedef struct
Eina_List *objs_list_tree;
Eina_List *screenshots;
Eina_Debug_Dispatch_Cb old_disp_cb;
Eina_Bool eo_init_done;
Eina_Bool eolian_init_done;
Eina_Bool evas_init_done;
Eina_Bool clouseau_init_done;
} Instance;
static Eet_Data_Descriptor *_config_edd = NULL;
@ -87,7 +80,6 @@ static Elm_Genlist_Item_Class *_obj_func_info_itc = NULL;
static Evas_Object * _obj_info_tootip(void *, Evas_Object *, Evas_Object *, void *);
static Eina_Debug_Error _module_initted_cb(Eina_Debug_Session *, int, void *, int);
static Eina_Debug_Error _eoids_get(Eina_Debug_Session *, int, void *, int);
static Eina_Debug_Error _klids_get(Eina_Debug_Session *, int, void *, int);
static Eina_Debug_Error _obj_info_get(Eina_Debug_Session *, int, void *, int);
@ -96,14 +88,13 @@ static Eina_Debug_Error _win_screenshot_get(Eina_Debug_Session *, int, void *, i
static const Eina_Debug_Opcode _ops[] =
{
{"module/init", &_module_init_op, &_module_initted_cb},
{"Eo/objects_ids_get", &_eoids_get_op, &_eoids_get},
{"Eo/classes_ids_get", &_klids_get_op, &_klids_get},
{"Evas/object/highlight", &_obj_highlight_op, NULL},
{"Evas/window/screenshot", &_win_screenshot_op, &_win_screenshot_get},
{"Eolian/object/info_get", &_obj_info_op, &_obj_info_get},
{"Clouseau/snapshot_do", &_snapshot_do_op, NULL},
{"Clouseau/snapshot_done", &_snapshot_done_op, &_snapshot_done_cb},
{"Clouseau/Snapshot/start",&_snapshot_do_op, NULL},
{"Clouseau/Snapshot/done", &_snapshot_done_op, &_snapshot_done_cb},
{NULL, NULL, NULL}
};
@ -179,6 +170,20 @@ _objs_tree_free(Eina_List *parents)
}
}
static void
_app_snapshot_request(Clouseau_Extension *ext)
{
const char *obj_kl_name = _config->wdgs_show_type == 0 ? "Efl.Canvas.Object" : "Elm.Widget";
const char *canvas_kl_name = "Efl.Canvas";
int size = strlen(obj_kl_name) + 1 + strlen(canvas_kl_name) + 1;
char *buf = alloca(size);
ext->ui_freeze_cb(ext, EINA_TRUE);
memcpy(buf, obj_kl_name, strlen(obj_kl_name) + 1);
memcpy(buf + strlen(obj_kl_name) + 1, canvas_kl_name, strlen(canvas_kl_name) + 1);
eina_debug_session_send(ext->session, ext->app_id, _snapshot_do_op, buf, size);
}
static void
_app_changed(Clouseau_Extension *ext)
{
@ -203,19 +208,11 @@ _app_changed(Clouseau_Extension *ext)
s->eoids_buf.cur_len = 0;
s->obj_infos_buf.cur_len = 0;
s->screenshots_buf.cur_len = 0;
if (app_id != ext->app_id)
{
inst->eo_init_done = EINA_FALSE;
inst->eolian_init_done = EINA_FALSE;
inst->evas_init_done = EINA_FALSE;
inst->clouseau_init_done = EINA_FALSE;
}
if (ext->app_id)
eina_debug_session_send(ext->session, ext->app_id, _module_init_op, "eo", 3);
app_id = ext->app_id;
if (app_id)
{
elm_object_item_disabled_set(inst->wdgs->reload_button, EINA_FALSE);
_app_snapshot_request(ext);
}
}
@ -260,7 +257,7 @@ _post_register_handle(void *data, Eina_Bool flag)
Clouseau_Extension *ext = data;
if(!flag) return;
if (ext->app_id)
eina_debug_session_send(ext->session, ext->app_id, _module_init_op, "eo", 3);
_app_snapshot_request(ext);
}
static void
@ -447,12 +444,12 @@ _func_params_to_string(Eolian_Debug_Function *func, char *buffer, Eina_Bool full
if(full)
{
char c_type[_MAX_LABEL];
_eolian_type_to_string(eolian_parameter_type_get(param->etype), c_type);
_eolian_type_to_string(eolian_parameter_type_get(param->eparam), c_type);
buffer_size += snprintf(buffer + buffer_size,
_MAX_LABEL - buffer_size, "%s ", c_type);
}
buffer_size += snprintf(buffer + buffer_size,
_MAX_LABEL - buffer_size, "%s: ", eolian_parameter_name_get(param->etype));
_MAX_LABEL - buffer_size, "%s: ", eolian_parameter_name_get(param->eparam));
buffer_size += _eolian_value_to_string(&(param->value),
buffer + buffer_size, _MAX_LABEL - buffer_size);
if(full)
@ -845,58 +842,6 @@ _objs_item_content_get(void *data, Evas_Object *obj, const char *part)
return NULL;
}
static Eina_Debug_Error
_module_initted_cb(Eina_Debug_Session *session, int src, void *buffer, int size)
{
const char *obj_kl_name = NULL, *canvas_kl_name = NULL;
Clouseau_Extension *ext = eina_debug_session_data_get(session);
if (size <= 0) return EINA_DEBUG_ERROR;
if (!ext) return EINA_DEBUG_OK;
Instance *inst = ext->data;
char *buf;
Eina_Bool ret = !!((char *)buffer)[size - 1];
if (!ret)
{
printf("Error loading module %s in the target\n", (char *)buffer);
}
if (!strcmp(buffer, "eo")) inst->eo_init_done = ret;
if (!strcmp(buffer, "eolian")) inst->eolian_init_done = ret;
if (!strcmp(buffer, "evas")) inst->evas_init_done = ret;
if (!strcmp(buffer, "clouseau")) inst->clouseau_init_done = ret;
if (!inst->eo_init_done)
{
eina_debug_session_send(session, src, _module_init_op, "eo", 3);
return EINA_DEBUG_OK;
}
if (!inst->eolian_init_done)
{
eina_debug_session_send(session, src, _module_init_op, "eolian", 7);
return EINA_DEBUG_OK;
}
if (!inst->evas_init_done)
{
eina_debug_session_send(session, src, _module_init_op, "evas", 5);
return EINA_DEBUG_OK;
}
if (!inst->clouseau_init_done)
{
eina_debug_session_send(session, src, _module_init_op, "clouseau", 9);
return EINA_DEBUG_OK;
}
ext->ui_freeze_cb(ext, EINA_TRUE);
obj_kl_name = _config->wdgs_show_type == 0 ? "Efl.Canvas.Object" : "Elm.Widget";
canvas_kl_name = "Efl.Canvas";
size = strlen(obj_kl_name) + 1 + strlen(canvas_kl_name) + 1;
buf = alloca(size);
memcpy(buf, obj_kl_name, strlen(obj_kl_name) + 1);
memcpy(buf + strlen(obj_kl_name) + 1, canvas_kl_name, strlen(canvas_kl_name) + 1);
eina_debug_session_send(session, src, _snapshot_do_op, buf, size);
return EINA_DEBUG_OK;
}
static void
_klid_walk(void *data, uint64_t kl, char *name)
{