Compare commits

...

33 Commits

Author SHA1 Message Date
Daniel Zaoui 73668cfb0e Fix APIs change
Related to Eolian and Text

Still there are compilation issues with focus feature
2020-01-19 22:08:35 +02:00
Daniel Zaoui 243e4c4dc8 Fix compilation after event rename 2019-09-08 21:27:32 +03:00
Daniel Zaoui ff15ac77f4 Fix unused variable 2019-06-24 20:06:36 +03:00
Daniel Zaoui 4664d39e13 Adapt code to latest EFL 2019-06-24 20:04:29 +03:00
Mykyta Biliavskyi af282ab41a Fix build with efl 1.22 release.
Fixed using efl API accordingly to the latest changes.
2019-05-01 12:09:44 +03:00
Marcel Hollerbach 1baa498b55 clouseau: fixup previous patches
the function arguments were passed in the wrong order, which resulted in
a wonderfull backtrace. Further more, eolian decided to return NULL as
class parents, and extensions. This _at_least_ brings back the basic
works.
2018-11-26 16:32:35 +01:00
Daniel Zaoui a3b3135d33 Remove useless union 2018-11-26 13:26:44 +02:00
Daniel Zaoui b23b7f9ab6 CMake: remove useless Eolian definition 2018-11-26 13:26:44 +02:00
Daniel Zaoui e0cbb82680 Adapt code to Eolian APIs changes 2018-11-26 13:26:42 +02:00
Daniel Zaoui d813400307 Support of structs parameters
@fix T7102
2018-07-12 15:54:02 +03:00
Marcel Hollerbach 1f7667819b updates class names 2018-07-03 16:31:11 +02:00
Daniel Zaoui 0ddf1692a5 ObjIntrospection: freeze only after the snapshot starts
If, for some reason, the application didn't load clouseau_debug.so, the
snapshot opcodes are not known, resulting in Clouseau freezing forever.

fix T7017
2018-06-18 10:28:29 +03:00
Daniel Zaoui 669bb5390c Remove useless dependency on library
The client binary doesn't depend on clouseau_debug.so. Only the objects
introspection extension does.
2018-06-18 10:27:31 +03:00
Daniel Zaoui aee290a401 Inform the user about the connection establishment
For the local mode, in case the connection cannot be established, the
user is proposed to launch the daemon, in which case the connection is
retried right after that step.
For the remote mode, the user is just informed that the setup has to be
verified.
2018-06-17 23:02:12 +03:00
Daniel Zaoui e032a521d9 Move break statement into case braces 2018-06-17 10:52:02 +03:00
Daniel Zaoui 41ad146676 Add clouseau script
This script launches the daemon, the given program and the Clouseau
client.

fix T5856
2018-06-16 23:35:59 +03:00
Daniel Zaoui 64ac1ca966 Add pid support as argument
By using -p pid, clouseau_client can connect to the program directly.
The connection mode must be given anyway.
2018-06-16 22:41:10 +03:00
Daniel Zaoui 24eee06b53 Add README 2018-06-15 11:09:39 +03:00
Hermet Park 4b6a03e963 fix a crash on vector drawing.
Basically, our efl objects need parents.
This code just obeys that efl programming rule.
2018-06-14 20:50:14 +09:00
Marcel Hollerbach 5fdd956379 focus_inspector: do not leak memory 2018-05-06 11:43:22 +02:00
Marcel Hollerbach 1d05baf59f focus_inspector: add a reload button 2018-05-06 11:43:22 +02:00
Marcel Hollerbach 92e3461f5b focus_inspector: clear out visuals when reloading 2018-05-06 11:43:22 +02:00
Daniel Zaoui 31732fbf5c Fix screenshot handling 2018-05-06 12:29:28 +03:00
Daniel Zaoui 6367fbdf86 Fix after Eolian validation changes 2018-05-06 09:34:10 +03:00
Daniel Zaoui 8627aacaeb Fix compilation after EFL Eo API changes 2018-05-05 23:54:23 +03:00
Marcel Hollerbach 19fe1c898e clouseau: use correct data type 2018-04-01 20:34:38 +02:00
Marcel Hollerbach 1060bd4b23 clouseau-focus: better displaying of the appearing focus managers
now with name and pointer
2018-04-01 20:22:17 +02:00
Marcel Hollerbach a5b70e6903 clouseu_debug: remove old leftover 2018-04-01 18:37:16 +02:00
Marcel Hollerbach 5b20f26f76 clouseu: filter the manager objects better 2018-04-01 18:34:54 +02:00
q66 70e1087187 fix build by updating an Eolian API name 2018-03-27 17:05:21 +02:00
Daniel Zaoui 28713189a0 Update code after Eolian changes in EFL
Use latest EFL from GIT
2018-03-14 12:48:43 +02:00
Davide Andreoli c64d481e70 Make clouseau works again after recent eolian changes
Note: you need latest efl from git
2018-03-01 18:12:40 +01:00
Marcel Hollerbach 5fd8f312a5 clouseau: make it run with python
we can now debug python apps!
2018-02-25 10:32:15 +01:00
21 changed files with 718 additions and 304 deletions

1
.gitignore vendored
View File

@ -11,7 +11,6 @@ Makefile.in
.*.sw[po]
*.gcov
*.gcno
/README
/aclocal.m4
/autom4te.cache/
/config.cache

View File

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

28
README Normal file
View File

@ -0,0 +1,28 @@
Clouseau
Clouseau is a UI inspection tool aimed to debug EFL applications.
Requirements:
efl (1.20 +)
Compiling:
1. mkdir build
2. cd build
3. cmake -DCMAKE_INSTALL_PREFIX=/your_install_path ..
4. make
5. (sudo) make install
How to use it?
1. Run efl_debugd on the machine where the program to debug has to run
2. Run your program
3. Run clouseau_client -l / -r [port]
4. Choose the extension you want to use
5. Choose your application
clouseau_client can run in three modes:
- locally: it connects to the local daemon (efl_debugd)
- remotely: you have to establish a connection (SSH...) and to supply the port to use to Clouseau
- offline: this is for the case you want to visualize a snapshot saved earlier

View File

@ -24,7 +24,6 @@ add_executable(clouseau_client ${SOURCES})
target_link_libraries(clouseau_client
pthread
clouseau_debug
${EFL_LIBRARIES}
${ELEMENTARY_LIBRARIES}
${EINA_LIBRARIES}
@ -37,3 +36,4 @@ target_link_libraries(clouseau_client
)
install(TARGETS clouseau_client DESTINATION bin)
install(PROGRAMS clouseau DESTINATION bin)

11
src/bin/clouseau Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
if [ $# -lt 1 ]
then
echo "Usage: clouseau <executable> [executable parameters]"
else
# Start the local daemon. In case it is already running, it exits directly.
efl_debugd &
# Start the application
$@ &
clouseau_client -l -p $!
fi

View File

@ -10,9 +10,11 @@
#include <getopt.h>
#include <Efreet.h>
#include <Efl_Ui.h>
#include <Elementary.h>
#include <Evas.h>
#include <Ecore_File.h>
#include <Eo.h>
#include "gui.h"
#include "Clouseau.h"
@ -117,6 +119,7 @@ static Config *_config = NULL;
static Eina_List *_extensions = NULL;
static int _selected_port = -1;
static int _arg_pid = -1;
static Eina_Bool _clients_info_added_cb(Eina_Debug_Session *, int, void *, int);
static Eina_Bool _clients_info_deleted_cb(Eina_Debug_Session *, int, void *, int);
@ -124,6 +127,8 @@ static Eina_Bool _clients_info_deleted_cb(Eina_Debug_Session *, int, void *, int
static void _extension_view(void *, Evas_Object *, void *);
static void _fs_extension_import_show(void *, Evas_Object *, void *);
static void _connection_type_change(Connection_Type);
EINA_DEBUG_OPCODES_ARRAY_DEFINE(_ops,
{"Daemon/Client/register_observer", &_cl_stat_reg_op, NULL},
{"Daemon/Client/added", NULL, _clients_info_added_cb},
@ -206,8 +211,8 @@ static void
_ui_freeze(Clouseau_Extension *ext EINA_UNUSED, Eina_Bool on)
{
elm_progressbar_pulse(_main_widgets->freeze_pulse, on);
efl_gfx_visible_set(_main_widgets->freeze_pulse, on);
efl_gfx_visible_set(_main_widgets->freeze_inwin, on);
efl_gfx_entity_visible_set(_main_widgets->freeze_pulse, on);
efl_gfx_entity_visible_set(_main_widgets->freeze_inwin, on);
}
static Extension_Config *
@ -427,6 +432,10 @@ _clients_info_added_cb(Eina_Debug_Session *session EINA_UNUSED, int src EINA_UNU
NULL, "home", name, _menu_selected_app, ai);
efl_wref_add(ai->menu_item, &ai->menu_item);
}
if (_arg_pid == pid)
{
_menu_selected_app(ai, _main_widgets->apps_selector_menu, ai->menu_item);
}
}
len = strlen(buf) + 1;
buf += len;
@ -496,8 +505,8 @@ _session_populate()
case OFFLINE:
{
if (ext->session_changed_cb) ext->session_changed_cb(ext);
break;
}
break;
case LOCAL_CONNECTION:
{
ext->session = eina_debug_local_connect(EINA_TRUE);
@ -517,6 +526,89 @@ _session_populate()
}
}
static void
_dialog_cancel(void *data, const Efl_Event *ev EINA_UNUSED)
{
Eo *win = data;
efl_del(win);
}
static void
_dialog_box_create(const char *title, const char *content, const char *but1_str, const char *but2_str,
Efl_Event_Cb cb1, Efl_Event_Cb cb2)
{
Eo *win, *bx, *lb;
win = efl_add(EFL_UI_WIN_CLASS, _main_widgets->main_win,
efl_ui_win_type_set(efl_added, ELM_WIN_DIALOG_BASIC),
efl_ui_win_autodel_set(efl_added, EINA_TRUE),
efl_text_set(efl_added, title),
efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
bx = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL),
efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
efl_content_set(win, bx);
lb = efl_add(EFL_UI_TEXTBOX_CLASS, bx,
efl_text_multiline_set(efl_added, EINA_TRUE),
efl_text_interactive_editable_set(efl_added, EINA_FALSE),
efl_text_horizontal_align_set(efl_added, 0.5),
efl_text_set(efl_added, content),
efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
efl_pack(bx, lb);
if (but1_str || but2_str)
{
Eo *bx2;
bx2 = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL),
efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
efl_pack(bx, bx2);
if (but1_str)
{
Eo *bt1 = efl_add(EFL_UI_BUTTON_CLASS, bx2,
efl_text_set(efl_added, but1_str),
efl_gfx_hint_weight_set(efl_added, 0, 0),
efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
if (cb1) efl_event_callback_add(bt1, EFL_INPUT_EVENT_CLICKED, cb1, win);
efl_pack(bx2, bt1);
}
if (but2_str)
{
Eo *bt2 = efl_add(EFL_UI_BUTTON_CLASS, bx2,
efl_text_set(efl_added, but2_str),
efl_gfx_hint_weight_set(efl_added, 0, 0),
efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
if (cb2) efl_event_callback_add(bt2, EFL_INPUT_EVENT_CLICKED, cb2, win);
efl_pack(bx2, bt2);
}
}
}
static Eina_Bool
_local_reconnect(void *data EINA_UNUSED)
{
_connection_type_change(LOCAL_CONNECTION);
return ECORE_CALLBACK_CANCEL;
}
static void
_daemon_launch(void *data, const Efl_Event *ev EINA_UNUSED)
{
Eo *win = data;
ecore_exe_pipe_run("efl_debugd", ECORE_EXE_NONE, NULL);
ecore_timer_add(1.0, _local_reconnect, NULL);
efl_del(win);
}
static void
_connection_type_change(Connection_Type conn_type)
{
@ -544,16 +636,40 @@ _connection_type_change(Connection_Type conn_type)
case LOCAL_CONNECTION:
{
_selected_port = -1;
elm_object_item_disabled_set(_main_widgets->apps_selector, EINA_FALSE);
_session = eina_debug_local_connect(EINA_TRUE);
eina_debug_session_dispatch_override(_session, _disp_cb);
if (!_session)
{
_dialog_box_create("Can't connect",
"Clouseau cannot connect to the local daemon.\nDo you want Clouseau to launch it?",
"Launch", "Don't launch and stay offline",
_daemon_launch, _dialog_cancel);
_connection_type_change(OFFLINE);
return;
}
else
{
elm_object_item_disabled_set(_main_widgets->apps_selector, EINA_FALSE);
eina_debug_session_dispatch_override(_session, _disp_cb);
}
break;
}
case REMOTE_CONNECTION:
{
elm_object_item_disabled_set(_main_widgets->apps_selector, EINA_FALSE);
_session = eina_debug_remote_connect(_selected_port);
eina_debug_session_dispatch_override(_session, _disp_cb);
if (!_session)
{
_dialog_box_create("Can't connect",
"Clouseau cannot connect to the remote daemon.\nCheck it is running on the remote device and\nthat the port forwarding (e.g SSH) has been set.",
"Ok", NULL,
_dialog_cancel, NULL);
_connection_type_change(OFFLINE);
return;
}
else
{
eina_debug_session_dispatch_override(_session, _disp_cb);
}
break;
}
default: return;
@ -779,13 +895,13 @@ _extensions_cfgs_inwin_create(const char *filename)
Eo *box = elm_box_add(inwin);
evas_object_size_hint_weight_set(box, 1, 1);
evas_object_size_hint_align_set(box, -1, -1);
efl_gfx_visible_set(box, EINA_TRUE);
efl_gfx_entity_visible_set(box, EINA_TRUE);
Eo *label = elm_label_add(box);
elm_object_text_set(label, "Choose an extension to open the file with:");
evas_object_size_hint_align_set(label, 0, -1);
evas_object_size_hint_weight_set(label, 1, 1);
efl_gfx_visible_set(label, EINA_TRUE);
efl_gfx_entity_visible_set(label, EINA_TRUE);
elm_box_pack_end(box, label);
Eo *list = elm_list_add(inwin);
@ -962,12 +1078,13 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{"help", no_argument, 0, 'h'},
{"local", no_argument, 0, 'l'},
{"remote", required_argument, 0, 'r'},
{"pid", required_argument, 0, 'p'},
{"file", required_argument, 0, 'f'},
{0, 0, 0, 0}
};
while ((opt = getopt_long(argc, argv,"hlr:f:", long_options, &long_index )) != -1)
while ((opt = getopt_long(argc, argv,"hlr:p:f:", long_options, &long_index )) != -1)
{
if (conn_type != OFFLINE || offline_filename)
if (opt != 'p' && (conn_type != OFFLINE || offline_filename))
{
printf("You cannot use more than one option at a time\n");
help = EINA_TRUE;
@ -991,6 +1108,11 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
offline_filename = eina_stringshare_add(optarg);
break;
}
case 'p':
{
_arg_pid = atoi(optarg);
break;
}
case 'h': help = EINA_TRUE; break;
default: help = EINA_TRUE;
}
@ -1001,6 +1123,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
printf(" --help/-h Print that help\n");
printf(" --local/-l Create a local connection\n");
printf(" --remote/-r Create a remote connection by using the given port\n");
printf(" --pid/-p PID of the program to connect to\n");
printf(" --file/-f Run in offline mode and load the given file\n");
return 0;
}

View File

@ -40,17 +40,17 @@ gui_main_win_create(Eo *__main_parent)
pub_widgets->main_win = main_win;
elm_win_autodel_set(main_win, EINA_TRUE);
elm_win_title_set(main_win, "Clouseau");
efl_gfx_size_set(main_win, EINA_SIZE2D(478, 484));
efl_gfx_entity_size_set(main_win, EINA_SIZE2D(478, 484));
bg = elm_bg_add(main_win);
evas_object_size_hint_weight_set(bg, 1.000000, 1.000000);
efl_gfx_visible_set(bg, EINA_TRUE);
efl_gfx_position_set(bg, EINA_POSITION2D(0, 0));
efl_gfx_entity_visible_set(bg, EINA_TRUE);
efl_gfx_entity_position_set(bg, EINA_POSITION2D(0, 0));
elm_win_resize_object_add(main_win, bg);
main_box = elm_box_add(main_win);
evas_object_size_hint_weight_set(main_box, 1.000000, 1.000000);
efl_gfx_visible_set(main_box, EINA_TRUE);
efl_gfx_entity_visible_set(main_box, EINA_TRUE);
elm_win_resize_object_add(main_win, main_box);
tb = elm_toolbar_add(main_win);
@ -82,7 +82,7 @@ gui_main_win_create(Eo *__main_parent)
*/
elm_box_pack_end(main_box, tb);
efl_gfx_visible_set(tb, EINA_TRUE);
efl_gfx_entity_visible_set(tb, EINA_TRUE);
freeze_pulse = elm_progressbar_add(main_win);
pub_widgets->freeze_pulse = freeze_pulse;
@ -98,14 +98,14 @@ gui_main_win_create(Eo *__main_parent)
pub_widgets->ext_box = ext_box;
evas_object_size_hint_weight_set(ext_box, 1.000000, 1.000000);
evas_object_size_hint_align_set(ext_box, -1.000000, -1.000000);
efl_gfx_visible_set(ext_box, EINA_TRUE);
efl_gfx_entity_visible_set(ext_box, EINA_TRUE);
elm_box_pack_end(main_box, ext_box);
freeze_inwin = elm_win_inwin_add(main_win);
pub_widgets->freeze_inwin = freeze_inwin;
elm_object_style_set(freeze_inwin, "minimal");
efl_gfx_visible_set(main_win, EINA_TRUE);
efl_gfx_entity_visible_set(main_win, EINA_TRUE);
efl_event_callback_add(main_win, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
return pub_widgets;

View File

@ -16,6 +16,8 @@ target_link_libraries(clouseau_debug
${EINA_LIBRARIES}
${EO_LIBRARIES}
${EOLIAN_LIBRARIES}
${EVAS_LIBRARIES}
${ELEMENTARY_LIBRARIES}
${FFI_LIBRARIES}
)

View File

@ -51,16 +51,14 @@ typedef enum
EOLIAN_DEBUG_UINT,
EOLIAN_DEBUG_LIST,
EOLIAN_DEBUG_OBJECT,
EOLIAN_DEBUG_VOID
EOLIAN_DEBUG_VOID,
EOLIAN_DEBUG_STRUCT
} Eolian_Debug_Basic_Type;
typedef struct
{
Eolian_Debug_Basic_Type type;
union
{
uint64_t value;
} value;
uint64_t value;
Eina_List *complex_type_values;
} Eolian_Debug_Value;
@ -121,6 +119,14 @@ typedef struct {
Evas_Object *vis;
} Clouseau_Focus_Relation;
typedef struct {
uintptr_t ptr;
const char *helper_name;
} Clouseau_Focus_List_Item;
typedef struct {
Eina_List *managers;
} Clouseau_Focus_Managers;
EAPI void *eo_debug_eoids_request_prepare(int *size, ...);

View File

@ -9,7 +9,6 @@
#include <Evas.h>
#include <Elementary.h>
#define ELM_INTERNAL_API_ARGESFSDFEFC
#include <elm_widget.h>
#include "Clouseau_Debug.h"
@ -74,9 +73,9 @@ static int _win_screenshot_op = EINA_DEBUG_OPCODE_INVALID;
static int _focus_manager_list_op = EINA_DEBUG_OPCODE_INVALID;
static int _focus_manager_detail_op = EINA_DEBUG_OPCODE_INVALID;
static Eolian *eos = NULL;
static Eolian_State *eos = NULL;
static Eet_Data_Descriptor *manager_details = NULL;
static Eet_Data_Descriptor *manager_details = NULL, *manager_list = NULL;
#include "clouseau_focus_serialization.x"
enum {
@ -133,6 +132,8 @@ const Debug_Param_Info debug_types[] =
{EOLIAN_DEBUG_UINT, "%u", &ffi_type_uint, 4},
{EOLIAN_DEBUG_LIST, "%p", &ffi_type_pointer, 8},
{EOLIAN_DEBUG_OBJECT, "%p", &ffi_type_pointer, 8},
{EOLIAN_DEBUG_VOID, "%p", &ffi_type_pointer, 8},
{EOLIAN_DEBUG_STRUCT, "%p", &ffi_type_pointer, 8},
{0, NULL, 0, 0}
};
@ -142,8 +143,6 @@ typedef struct
const Eolian_Class *kl;
} Eolian_Info;
static Eina_Hash *_eolian_kls_hash = NULL;
static Eolian_Debug_Basic_Type
_eolian_type_resolve(const Eolian_Type *eo_type)
{
@ -154,13 +153,14 @@ _eolian_type_resolve(const Eolian_Type *eo_type)
if (type_base == EOLIAN_TYPE_REGULAR)
{
const char *full_name = eolian_type_full_name_get(eo_type);
const Eolian_Typedecl *alias = eolian_typedecl_alias_get_by_name((Eolian_Unit*) eos, full_name);
const Eolian_Typedecl *tdecl;
const char *full_name = eolian_type_name_get(eo_type);
const Eolian_Typedecl *alias = eolian_state_alias_by_name_get(eos, full_name);
if (alias)
{
eo_type = eolian_typedecl_base_type_get(alias);
type_base = eolian_type_type_get(eo_type);
full_name = eolian_type_full_name_get(eo_type);
full_name = eolian_type_name_get(eo_type);
}
if (full_name)
@ -170,11 +170,65 @@ _eolian_type_resolve(const Eolian_Type *eo_type)
if (!strcmp(full_name, eolian_types[i].name) &&
eolian_types[i].etype == type) return i;
}
tdecl = eolian_type_typedecl_get(eo_type);
if (tdecl && eolian_typedecl_type_get(tdecl) == EOLIAN_TYPEDECL_STRUCT)
return EOLIAN_DEBUG_STRUCT;
}
return EOLIAN_DEBUG_INVALID_TYPE;
}
static ffi_type *
_ffi_type_struct_get(const Eolian_Type *eo_type)
{
const Eolian_Struct_Type_Field *f;
const Eolian_Typedecl *tdecl;
Eina_Iterator *iter;
int i = 0, count = 0;
ffi_type **types;
ffi_type *s_type = calloc(1, sizeof(*s_type));
s_type->type = FFI_TYPE_STRUCT;
tdecl = eolian_type_typedecl_get(eo_type);
iter = eolian_typedecl_struct_fields_get(tdecl);
EINA_ITERATOR_FOREACH(iter, f) count++;
eina_iterator_free(iter);
types = calloc(1, count * sizeof(ffi_type *));
s_type->elements = types;
iter = eolian_typedecl_struct_fields_get(tdecl);
EINA_ITERATOR_FOREACH(iter, f)
{
const Eolian_Type *feo_type = eolian_typedecl_struct_field_type_get(f);
Eolian_Debug_Basic_Type ftype = _eolian_type_resolve(feo_type);
types[i++] = debug_types[ftype].ffi_type_p;
}
types[i] = NULL;
eina_iterator_free(iter);
return s_type;
}
unsigned int
_struct_mem_len_get(const Eolian_Type *eo_type)
{
const Eolian_Struct_Type_Field *f;
const Eolian_Typedecl *tdecl;
Eina_Iterator *iter;
unsigned int len = 0;
tdecl = eolian_type_typedecl_get(eo_type);
iter = eolian_typedecl_struct_fields_get(tdecl);
EINA_ITERATOR_FOREACH(iter, f)
{
const Eolian_Type *feo_type = eolian_typedecl_struct_field_type_get(f);
Eolian_Debug_Basic_Type ftype = _eolian_type_resolve(feo_type);
len += debug_types[ftype].size;
}
eina_iterator_free(iter);
return len;
}
static int
_function_invoke(Eo *ptr, const Eolian_Function *foo, Eolian_Function_Type foo_type,
Eolian_Debug_Parameter *params, Eolian_Debug_Return *ret)
@ -184,7 +238,9 @@ _function_invoke(Eo *ptr, const Eolian_Function *foo, Eolian_Function_Type foo_t
ffi_type *types[EOLIAN_DEBUG_MAXARGS]; /* FFI types */
void *values[EOLIAN_DEBUG_MAXARGS]; /* FFI Values */
void *pointers[EOLIAN_DEBUG_MAXARGS]; /* Used as values for out params, as we have to give a pointer to a pointer */
void *result = NULL;
Eolian_Function_Parameter *eo_param;
const Eolian_Type *eo_type;
Eina_Iterator *itr;
Eolian_Debug_Basic_Type ed_type;
int argc, ffi_argc = 0;
@ -202,11 +258,12 @@ _function_invoke(Eo *ptr, const Eolian_Function *foo, Eolian_Function_Type foo_t
EINA_ITERATOR_FOREACH(itr, eo_param)
{
/* Not verified */
ed_type = _eolian_type_resolve(eolian_parameter_type_get(eo_param));
eo_type = eolian_parameter_type_get(eo_param);
ed_type = _eolian_type_resolve(eo_type);
if (!ed_type) goto error;
types[ffi_argc] = debug_types[ed_type].ffi_type_p;
values[ffi_argc] = &(params[argc].value.value.value);
values[ffi_argc] = &(params[argc].value.value);
params[argc].eparam = eo_param;
ffi_argc++;
argc++;
@ -216,31 +273,41 @@ _function_invoke(Eo *ptr, const Eolian_Function *foo, Eolian_Function_Type foo_t
eolian_property_values_get(foo, foo_type);
EINA_ITERATOR_FOREACH(itr, eo_param)
{
ed_type = _eolian_type_resolve(eolian_parameter_type_get(eo_param));
eo_type = eolian_parameter_type_get(eo_param);
ed_type = _eolian_type_resolve(eo_type);
if (!ed_type) goto error;
params[argc].eparam = eo_param;
if (foo_type == EOLIAN_PROP_GET ||
(foo_type == EOLIAN_METHOD && eolian_parameter_direction_get(eo_param) == EOLIAN_OUT_PARAM))
(foo_type == EOLIAN_METHOD && eolian_parameter_direction_get(eo_param) == EOLIAN_PARAMETER_OUT))
{
/* Out parameter */
params[argc].value.value.value = 0;
if (ed_type == EOLIAN_DEBUG_STRUCT)
{
params[argc].value.value = (uint64_t) calloc(_struct_mem_len_get(eo_type), 1);
pointers[ffi_argc] = (char *)params[argc].value.value;
}
else
{
params[argc].value.value = 0;
pointers[ffi_argc] = &(params[argc].value.value);
}
params[argc].value.type = ed_type;
types[ffi_argc] = &ffi_type_pointer;
pointers[ffi_argc] = &(params[argc].value.value.value);
values[ffi_argc] = &pointers[ffi_argc];
}
else
{
/* In parameter */
types[ffi_argc] = debug_types[ed_type].ffi_type_p;
values[ffi_argc] = &(params[argc].value.value.value);
values[ffi_argc] = &(params[argc].value.value);
}
ffi_argc++;
argc++;
}
const Eolian_Type *eo_type = eolian_function_return_type_get(foo, foo_type);
eo_type = eolian_function_return_type_get(foo, foo_type);
Eina_Bool param_as_ret = EINA_FALSE;
ffi_type *ffi_ret_type = &ffi_type_void;
if (eo_type)
{
@ -251,35 +318,45 @@ _function_invoke(Eo *ptr, const Eolian_Function *foo, Eolian_Function_Type foo_t
}
else if (argc == 1 && foo_type == EOLIAN_PROP_GET)
{
param_as_ret = EINA_TRUE;
eo_type = eolian_parameter_type_get(params[0].eparam);
ed_type = _eolian_type_resolve(eo_type);
if (ed_type == EOLIAN_DEBUG_STRUCT)
{
ffi_ret_type = _ffi_type_struct_get(eo_type);
}
else
{
ffi_ret_type = debug_types[params[0].value.type].ffi_type_p;
}
result = (char *)params[0].value.value;
/* If there is no return type but only one value is present, the value will
* be returned by the function.
* So we need FFI to not take it into account when invoking the function.
*/
ffi_ret_type = debug_types[params[0].value.type].ffi_type_p;
ffi_argc--;
}
const char *full_func_name = eolian_function_full_c_name_get(foo, EOLIAN_PROP_GET, EINA_FALSE);
const char *full_func_name = eolian_function_full_c_name_get(foo, EOLIAN_PROP_GET);
void *eo_func = dlsym(RTLD_DEFAULT, full_func_name);
if (!eo_func) goto error;
ffi_cif cif;
if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, ffi_argc,
ffi_ret_type, types) == FFI_OK)
{
void *result;
ffi_call(&cif, eo_func, &result, values);
if (ret) ret->value.type = EOLIAN_DEBUG_VOID;
ffi_call(&cif, eo_func, result?result:&result, values);
ret->value.type = EOLIAN_DEBUG_VOID;
if (eo_type)
{
if (ret)
if (!param_as_ret)
{
ret->value.value.value = (uint64_t) result;
ret->value.value = (uint64_t) result;
ret->value.type = ed_type;
ret->etype = eo_type;
}
else
params[0].value.value = (uint64_t) result;
}
else if (argc == 1 && foo_type == EOLIAN_PROP_GET)
params[0].value.value.value = (uint64_t) result;
goto success;
}
@ -422,6 +499,24 @@ _complex_buffer_fill(char *buf, const Eolian_Type *eo_type, uint64_t value)
return size;
}
static int
_struct_buffer_fill(char *buf, const Eolian_Type *eo_type, char *str_buf)
{
int size = 0;
const Eolian_Struct_Type_Field *f;
const Eolian_Typedecl *tdecl = eolian_type_typedecl_get(eo_type);
Eina_Iterator *iter = eolian_typedecl_struct_fields_get(tdecl);
EINA_ITERATOR_FOREACH(iter, f)
{
const Eolian_Type *feo_type = eolian_typedecl_struct_field_type_get(f);
Eolian_Debug_Basic_Type ftype = _eolian_type_resolve(feo_type);
size += _param_buffer_fill(buf+size, *((uint64_t *)str_buf), debug_types[ftype].size);
str_buf += debug_types[ftype].size;
}
eina_iterator_free(iter);
return size;
}
static Eina_Bool
_api_resolvable(Eo *obj, const Eolian_Function *function)
{
@ -430,7 +525,7 @@ _api_resolvable(Eo *obj, const Eolian_Function *function)
const char *func_c_name;
void *func_api;
func_c_name = eolian_function_full_c_name_get(function, EOLIAN_PROP_GET, EINA_FALSE);
func_c_name = eolian_function_full_c_name_get(function, EOLIAN_PROP_GET);
func_api = dlsym(RTLD_DEFAULT, func_c_name);
op = _efl_object_op_api_id_get(func_api, obj, func_c_name, __FILE__, __LINE__);
_efl_object_call_resolve(obj, func_c_name, &call_data, op, __FILE__, __LINE__);
@ -464,7 +559,7 @@ _class_buffer_fill(Eo *obj, const Eolian_Class *ekl, char *buf)
int len, i;
if (!size) // only if its the first func to succeed
{
const char *class_name = eolian_class_full_name_get(ekl);
const char *class_name = eolian_class_name_get(ekl);
len = strlen(class_name) + 1;
memcpy(buf, class_name, len);
size += len;
@ -484,21 +579,26 @@ _class_buffer_fill(Eo *obj, const Eolian_Class *ekl, char *buf)
// if its a string we wont copy the pointer but the value
if (params[i].value.type == EOLIAN_DEBUG_STRING)
{
if((char *)params[i].value.value.value == NULL)
params[i].value.value.value = (uint64_t)"";
len = strlen((char *)params[i].value.value.value) + 1;
memcpy(buf + size, (char *)params[i].value.value.value, len);
if((char *)params[i].value.value == NULL)
params[i].value.value = (uint64_t)"";
len = strlen((char *)params[i].value.value) + 1;
memcpy(buf + size, (char *)params[i].value.value, len);
size += len;
}
else if (params[i].value.type == EOLIAN_DEBUG_STRUCT)
{
const Eolian_Type *eo_type = eolian_parameter_type_get(params[i].eparam);
size += _struct_buffer_fill(buf+size, eo_type, (char *)params[i].value.value);
}
else
{
const Eolian_Type *eo_type = eolian_parameter_type_get(params[i].eparam);
size += _param_buffer_fill(buf+size, params[i].value.value.value,
size += _param_buffer_fill(buf+size, params[i].value.value,
debug_types[params[i].value.type].size);
if (params[i].value.type == EOLIAN_DEBUG_LIST)
{
size += _complex_buffer_fill(buf+size, eo_type,
params[i].value.value.value);
params[i].value.value);
}
}
}
@ -514,20 +614,20 @@ _class_buffer_fill(Eo *obj, const Eolian_Class *ekl, char *buf)
//if its a string we wont copy the pointer but the values
if (ret.value.type == EOLIAN_DEBUG_STRING)
{
if((char *)ret.value.value.value == NULL)
ret.value.value.value = (uint64_t)"";
len = strlen((char *)ret.value.value.value) + 1;
memcpy(buf + size, (char *)ret.value.value.value, len);
if((char *)ret.value.value == NULL)
ret.value.value = (uint64_t)"";
len = strlen((char *)ret.value.value) + 1;
memcpy(buf + size, (char *)ret.value.value, len);
size += len;
}
else
{
size += _param_buffer_fill(buf+size, ret.value.value.value,
size += _param_buffer_fill(buf+size, ret.value.value,
debug_types[ret.value.type].size);
if (ret.value.type == EOLIAN_DEBUG_LIST)
{
size += _complex_buffer_fill(buf+size,
ret.etype, ret.value.value.value);
ret.etype, ret.value.value);
}
}
}
@ -548,7 +648,7 @@ static const char *legacy_installed_map[][2] =
{ "Efl.Ui.Frame_Legacy", "Efl.Ui.Flip" },
{ "Efl.Ui.Image_Legacy", "Efl.Ui.Image" },
{ "Efl.Ui.Image_Zoomable_Legacy", "Efl.Ui.Image_Zoomable" },
{ "Efl.Ui.Layout_Legacy", "Efl.Ui.Layout" },
{ "Efl.Ui.Layout_Legacy", "Efl.Ui.Layout.Object" },
{ "Efl.Ui.Multibuttonentry_Legacy", "Efl.Ui.Multibuttonentry" },
{ "Efl.Ui.Panes_Legacy", "Efl.Ui.Panes" },
{ "Efl.Ui.Progressbar_Legacy", "Efl.Ui.Progressbar" },
@ -557,15 +657,15 @@ static const char *legacy_installed_map[][2] =
{ "Efl.Ui.Video_Legacy", "Efl.Ui.Video" },
{ "Efl.Ui.Win_Legacy", "Efl.Ui.Win" },
{ "Elm.Code_Widget_Legacy", "Elm.Code_Widget" },
{ "Elm.Ctxpopup", "Efl.Ui.Layout" },
{ "Elm.Entry", "Efl.Ui.Layout" },
{ "Elm.Colorselector", "Efl.Ui.Layout" },
{ "Elm.List", "Efl.Ui.Layout" },
{ "Elm.Ctxpopup", "Efl.Ui.Layout.Object" },
{ "Elm.Entry", "Efl.Ui.Layout.Object" },
{ "Elm.Colorselector", "Efl.Ui.Layout.Object" },
{ "Elm.List", "Efl.Ui.Layout.Object" },
{ "Elm.Photo", "Efl.Ui.Widget" },
{ "Elm.Actionslider", "Efl.Ui.Layout" },
{ "Elm.Actionslider", "Efl.Ui.Layout.Object" },
{ "Elm.Box", "Efl.Ui.Widget" },
{ "Elm.Table", "Efl.Ui.Widget" },
{ "Elm.Thumb", "Efl.Ui.Layout" },
{ "Elm.Thumb", "Efl.Ui.Layout.Object" },
{ "Elm.Menu", "Efl.Ui.Widget" },
{ "Elm.Icon", "Efl.Ui.Image" },
{ "Elm.Prefs", "Efl.Ui.Widget" },
@ -577,31 +677,31 @@ static const char *legacy_installed_map[][2] =
{ "Elm.Diskselector", "Efl.Ui.Widget" },
{ "Elm.Notify", "Efl.Ui.Widget" },
{ "Elm.Mapbuf", "Efl.Ui.Widget" },
{ "Elm.Separator", "Efl.Ui.Layout" },
{ "Elm.Calendar", "Efl.Ui.Layout" },
{ "Elm.Inwin", "Efl.Ui.Layout" },
{ "Elm.Gengrid", "Efl.Ui.Layout" },
{ "Elm.Scroller", "Efl.Ui.Layout" },
{ "Elm.Player", "Efl.Ui.Layout" },
{ "Elm.Segment_Control", "Efl.Ui.Layout" },
{ "Elm.Fileselector", "Efl.Ui.Layout" },
{ "Elm.Separator", "Efl.Ui.Layout.Object" },
{ "Elm.Calendar", "Efl.Ui.Layout.Object" },
{ "Elm.Inwin", "Efl.Ui.Layout.Object" },
{ "Elm.Gengrid", "Efl.Ui.Layout.Object" },
{ "Elm.Scroller", "Efl.Ui.Layout.Object" },
{ "Elm.Player", "Efl.Ui.Layout.Object" },
{ "Elm.Segment_Control", "Efl.Ui.Layout.Object" },
{ "Elm.Fileselector", "Efl.Ui.Layout.Object" },
{ "Elm.Fileselector_Button", "Efl.Ui.Button" },
{ "Elm.Fileselector_Entry", "Efl.Ui.Layout" },
{ "Elm.Flipselector", "Efl.Ui.Layout" },
{ "Elm.Fileselector_Entry", "Efl.Ui.Layout.Object" },
{ "Elm.Flipselector", "Efl.Ui.Layout.Object" },
{ "Elm.Hoversel", "Efl.Ui.Button" },
{ "Elm.Naviframe", "Efl.Ui.Layout" },
{ "Elm.Popup", "Efl.Ui.Layout" },
{ "Elm.Bubble", "Efl.Ui.Layout" },
{ "Elm.Clock", "Efl.Ui.Layout" },
{ "Elm.Conformant", "Efl.Ui.Layout" },
{ "Elm.Dayselector", "Efl.Ui.Layout" },
{ "Elm.Genlist", "Efl.Ui.Layout" },
{ "Elm.Hover", "Efl.Ui.Layout" },
{ "Elm.Index", "Efl.Ui.Layout" },
{ "Elm.Label", "Efl.Ui.Layout" },
{ "Elm.Panel", "Efl.Ui.Layout" },
{ "Elm.Slideshow", "Efl.Ui.Layout" },
{ "Elm.Spinner", "Efl.Ui.Layout" },
{ "Elm.Naviframe", "Efl.Ui.Layout.Object" },
{ "Elm.Popup", "Efl.Ui.Layout.Object" },
{ "Elm.Bubble", "Efl.Ui.Layout.Object" },
{ "Elm.Clock", "Efl.Ui.Layout.Object" },
{ "Elm.Conformant", "Efl.Ui.Layout.Object" },
{ "Elm.Dayselector", "Efl.Ui.Layout.Object" },
{ "Elm.Genlist", "Efl.Ui.Layout.Object" },
{ "Elm.Hover", "Efl.Ui.Layout.Object" },
{ "Elm.Index", "Efl.Ui.Layout.Object" },
{ "Elm.Label", "Efl.Ui.Layout.Object" },
{ "Elm.Panel", "Efl.Ui.Layout.Object" },
{ "Elm.Slideshow", "Efl.Ui.Layout.Object" },
{ "Elm.Spinner", "Efl.Ui.Layout.Object" },
{ "Elm.Plug", "Efl.Ui.Widget" },
{ "Elm.Web.None", "Efl.Ui.Widget" },
{ NULL, NULL }
@ -610,11 +710,13 @@ static const char *legacy_installed_map[][2] =
static Eina_Bool
_obj_info_req_cb(Eina_Debug_Session *session, int srcid, void *buffer, int size EINA_UNUSED)
{
static Eina_Hash *_parsed_kls = NULL;
uint64_t ptr64;
memcpy(&ptr64, buffer, sizeof(ptr64));
Eo *obj = (Eo *)SWAP_64(ptr64);
const char *class_name = NULL;
const Eolian_Class *kl, *okl;
Eolian_State *s;
unsigned int size_curr = 0;
char *buf;
@ -634,7 +736,29 @@ _obj_info_req_cb(Eina_Debug_Session *session, int srcid, void *buffer, int size
}
}
okl = eolian_class_get_by_name((Eolian_Unit*) eos, class_name);
if (!_parsed_kls) _parsed_kls = eina_hash_string_superfast_new(NULL);
s = eina_hash_find(_parsed_kls, class_name);
if (!s)
{
const char *fname;
Eina_Strbuf *sb = eina_strbuf_new();
s = eos = eolian_state_new();
eina_strbuf_append(sb, class_name);
eina_strbuf_replace_all(sb, ".", "_");
eina_strbuf_tolower(sb);
eina_strbuf_append(sb, ".eo");
fname = eina_strbuf_string_get(sb);
eolian_state_system_directory_add(s);
if (!eolian_state_file_parse(s, fname))
{
printf("File %s cannot be parsed.\n", fname);
goto end;
}
eina_strbuf_free(sb);
eina_hash_add(_parsed_kls, class_name, s);
}
okl = eolian_state_class_by_name_get(s, class_name);
if (!okl)
{
printf("Class %s not found.\n", class_name);
@ -648,16 +772,20 @@ _obj_info_req_cb(Eina_Debug_Session *session, int srcid, void *buffer, int size
Eina_List *list = eina_list_append(NULL, okl);
EINA_LIST_FOREACH(list, itr, kl)
{
const Eolian_Class *inherit;
const Eolian_Class *inherit, *parent;
Eina_Iterator *inherits_itr;
inherits_itr = eolian_class_inherits_get(kl);
parent = eolian_class_parent_get(kl);
if (parent && !eina_list_data_find(list, parent))
list2 = eina_list_append(list, parent);
inherits_itr = eolian_class_extensions_get(kl);
size_curr += _class_buffer_fill(obj, kl, buf + size_curr);
EINA_ITERATOR_FOREACH(inherits_itr, inherit)
{
/* Avoid duplicates in MRO list. */
if (!eina_list_data_find(list, inherit))
if (inherit && !eina_list_data_find(list, inherit))
list2 = eina_list_append(list, inherit);
}
eina_iterator_free(inherits_itr);
@ -736,6 +864,8 @@ _main_loop_snapshot_start_cb(Eina_Debug_Session *session, int srcid, void *buffe
Eina_List *kls_strs = NULL;
int nb_kls = 0;
eina_debug_session_send(session, srcid, _snapshot_start_op, NULL, 0);
tmp = buffer;
while (size > 0)
{
@ -839,14 +969,14 @@ _main_loop_obj_highlight_cb(Eina_Debug_Session *session EINA_UNUSED, int srcid E
if (size != sizeof(uint64_t)) return;
memcpy(&ptr64, buffer, sizeof(ptr64));
Eo *obj = (Eo *)SWAP_64(ptr64);
if (!efl_isa(obj, EFL_GFX_INTERFACE) && !efl_isa(obj, EFL_CANVAS_INTERFACE)) return;
if (!efl_isa(obj, EFL_GFX_ENTITY_INTERFACE) && !efl_isa(obj, EFL_CANVAS_SCENE_INTERFACE)) return;
Evas *e = evas_object_evas_get(obj);
Eo *rect = evas_object_polygon_add(e);
evas_object_move(rect, 0, 0);
if (efl_isa(obj, EFL_GFX_INTERFACE))
if (efl_isa(obj, EFL_GFX_ENTITY_INTERFACE))
{
Eina_Rect obj_geom = {.x = 0, .y = 0, .w = 0, .h = 0};
obj_geom = efl_gfx_geometry_get(obj);
obj_geom = efl_gfx_entity_geometry_get(obj);
if (efl_isa(obj, EFL_UI_WIN_CLASS)) obj_geom.x = obj_geom.y = 0;
evas_object_polygon_point_add(rect, obj_geom.x, obj_geom.y);
@ -938,8 +1068,9 @@ _main_loop_win_screenshot_cb(Eina_Debug_Session *session, int srcid, void *buffe
if (size != sizeof(uint64_t)) return;
memcpy(&ptr64, buffer, sizeof(ptr64));
Eo *e = (Eo *)SWAP_64(ptr64);
if (!efl_isa(e, EFL_CANVAS_INTERFACE)) return;
Eo *obj = (Eo *)SWAP_64(ptr64);
Eo *e = evas_object_evas_get(obj);
if (!e) return;
snapshot = evas_object_image_filled_add(e);
if (!snapshot) return;
@ -953,39 +1084,12 @@ _main_loop_win_screenshot_cb(Eina_Debug_Session *session, int srcid, void *buffe
evas_output_size_get(e, &w, &h);
evas_object_geometry_set(snapshot, 0, 0, w, h);
efl_gfx_visible_set(snapshot, EINA_TRUE);
efl_gfx_entity_visible_set(snapshot, EINA_TRUE);
evas_event_callback_add(e, EVAS_CALLBACK_RENDER_POST, _screenshot_pixels_cb, info);
}
WRAPPER_TO_XFER_MAIN_LOOP(_win_screenshot_cb)
static Eina_Bool
_only_manager(const void *container EINA_UNUSED, void *data, void *fdata EINA_UNUSED)
{
return efl_isa(data, EFL_UI_FOCUS_MANAGER_INTERFACE);
}
static void
_main_loop_focus_manager_list_cb(Eina_Debug_Session *session, int srcid, void *buffer EINA_UNUSED, int size EINA_UNUSED)
{
Eina_Iterator *obj_iterator, *manager_iterator;
Eina_Array *array;
Eo *obj;
array = eina_array_new(10);
obj_iterator = eo_objects_iterator_new();
manager_iterator = eina_iterator_filter_new(obj_iterator, _only_manager, NULL, NULL);
EINA_ITERATOR_FOREACH(manager_iterator, obj)
{
eina_array_push(array, obj);
}
eina_debug_session_send(session, srcid, _focus_manager_list_op, array->data, array->count * sizeof(void*));
}
WRAPPER_TO_XFER_MAIN_LOOP(_focus_manager_list_cb)
EAPI Efl_Dbg_Info*
clouseau_eo_info_find(Efl_Dbg_Info *root, const char *name)
{
@ -1007,6 +1111,55 @@ clouseau_eo_info_find(Efl_Dbg_Info *root, const char *name)
return NULL;
}
static Eina_Bool
_only_manager(const void *container EINA_UNUSED, void *data, void *fdata EINA_UNUSED)
{
Efl_Dbg_Info *manager_data, *root;
if (!efl_isa(data, EFL_UI_FOCUS_MANAGER_INTERFACE)) return EINA_FALSE;
//check for debug information
root = EFL_DBG_INFO_LIST_APPEND(NULL, "Root");
efl_dbg_info_get(data, root);
manager_data = clouseau_eo_info_find(root, "Efl.Ui.Focus.Manager");
if (!manager_data) return EINA_FALSE;
return EINA_TRUE;
}
static void
_main_loop_focus_manager_list_cb(Eina_Debug_Session *session, int srcid, void *buffer EINA_UNUSED, int size EINA_UNUSED)
{
Eina_Iterator *obj_iterator, *manager_iterator;
Clouseau_Focus_Managers *managers;
Eo *obj;
if (!manager_list) _init_data_descriptors();
managers = alloca(sizeof(Clouseau_Focus_Managers));
managers->managers = NULL;
obj_iterator = eo_objects_iterator_new();
manager_iterator = eina_iterator_filter_new(obj_iterator, _only_manager, NULL, NULL);
EINA_ITERATOR_FOREACH(manager_iterator, obj)
{
Clouseau_Focus_List_Item *item = alloca(sizeof(Clouseau_Focus_List_Item));
item->ptr = (uintptr_t)(void*)obj;
item->helper_name = efl_class_name_get(efl_ui_focus_manager_root_get(obj));
managers->managers = eina_list_append(managers->managers, item);
}
int blob_size;
void *blob = eet_data_descriptor_encode(manager_list, managers, &blob_size);
eina_debug_session_send(session, srcid, _focus_manager_list_op, blob, blob_size);
managers->managers = eina_list_free(managers->managers);
}
WRAPPER_TO_XFER_MAIN_LOOP(_focus_manager_list_cb)
static Eina_List*
_fetch_children(Efl_Ui_Focus_Manager *m)
{
@ -1086,10 +1239,6 @@ _main_loop_focus_manager_detail_cb(Eina_Debug_Session *session, int srcid, void
int blob_size;
void *blob = eet_data_descriptor_encode(manager_details, res, &blob_size);
Clouseau_Focus_Manager_Data *aaah = eet_data_descriptor_decode(manager_details, blob, blob_size);
if (eina_list_count(aaah->relations) != eina_list_count(res->relations)) abort();
eina_debug_session_send(session, srcid, _focus_manager_detail_op, blob, blob_size);
return EINA_TRUE;
@ -1117,14 +1266,6 @@ clouseau_debug_init(void)
eolian_init();
evas_init();
eos = eolian_new();
_eolian_kls_hash = eina_hash_string_superfast_new(NULL);
eolian_system_directory_scan(eos);
EINA_SAFETY_ON_FALSE_RETURN_VAL(eolian_all_eo_files_parse(eos), EINA_FALSE);
EINA_SAFETY_ON_FALSE_RETURN_VAL(eolian_all_eot_files_parse(eos), EINA_FALSE);
eina_debug_opcodes_register(NULL, _debug_ops(), NULL, NULL);
printf("%s - In\n", __FUNCTION__);
@ -1216,7 +1357,7 @@ eolian_debug_object_information_free(Eolian_Debug_Object_Information *main)
EINA_LIST_FREE(func->params, param)
{
if (param->value.type == EOLIAN_DEBUG_STRING)
eina_stringshare_del((char *)param->value.value.value);
eina_stringshare_del((char *)param->value.value);
free(param);
}
free(func);
@ -1256,6 +1397,61 @@ _complex_buffer_decode(char *buffer, const Eolian_Type *eo_type,
return size;
}
static Eina_Bool
_value_decode(char **buffer, unsigned int *size, const Eolian_Type *eo_type, Eolian_Debug_Value *v)
{
int len;
Eolian_Debug_Basic_Type type = _eolian_type_resolve(eo_type);
v->type = type;
if (type)
{
v->type = type;
if (type == EOLIAN_DEBUG_STRING)
{
len = strlen(*buffer) + 1;
v->value = (uint64_t) eina_stringshare_add(*buffer);
*buffer += len;
*size -= len;
}
else if (type == EOLIAN_DEBUG_STRUCT)
{
const Eolian_Struct_Type_Field *f;
Eina_List *list = NULL;
const Eolian_Typedecl *tdecl = eolian_type_typedecl_get(eo_type);
Eina_Iterator *iter = eolian_typedecl_struct_fields_get(tdecl);
EINA_ITERATOR_FOREACH(iter, f)
{
const Eolian_Type *feo_type = eolian_typedecl_struct_field_type_get(f);
Eolian_Debug_Value *v2 = calloc(1, sizeof(*v2));
_value_decode(buffer, size, feo_type, v2);
list = eina_list_append(list, v2);
}
eina_iterator_free(iter);
v->complex_type_values = list;
}
else
{
uint64_t value = 0;;
EXTRACT(*buffer, &value, debug_types[type].size);
v->value = SWAP_64(value);
*size -= debug_types[type].size;
if (type == EOLIAN_DEBUG_LIST)
{
len = _complex_buffer_decode(*buffer, eo_type, v);
*buffer += len;
*size -= len;
}
}
}
else
{
printf("Unknown parameter type %s\n", eolian_type_name_get(eo_type));
return EINA_FALSE;
}
return EINA_TRUE;
}
/*
* receive buffer of the following format:
* Eo *pointer (uint64_t)
@ -1265,6 +1461,7 @@ _complex_buffer_decode(char *buffer, const Eolian_Type *eo_type,
EAPI Eolian_Debug_Object_Information *
eolian_debug_object_information_decode(char *buffer, unsigned int size)
{
static Eina_Hash *_parsed_kls = NULL;
if (size < sizeof(uint64_t)) return NULL;
Eolian_Debug_Object_Information *ret = calloc(1, sizeof(*ret));
Eolian_Debug_Class *kl = NULL;
@ -1283,8 +1480,31 @@ eolian_debug_object_information_decode(char *buffer, unsigned int size)
int len = strlen(buffer) + 1;
if (len > 1) // if class_name is not NULL, we begin a new class
{
Eolian_State *s;
if (!_parsed_kls) _parsed_kls = eina_hash_string_superfast_new(NULL);
s = eina_hash_find(_parsed_kls, buffer);
if (!s)
{
const char *fname;
Eina_Strbuf *sb = eina_strbuf_new();
s = eos = eolian_state_new();
eina_strbuf_append(sb, buffer);
eina_strbuf_replace_all(sb, ".", "_");
eina_strbuf_tolower(sb);
eina_strbuf_append(sb, ".eo");
fname = eina_strbuf_string_get(sb);
eolian_state_system_directory_add(s);
if (!eolian_state_file_parse(s, fname))
{
printf("File %s cannot be parsed.\n", fname);
goto error;
}
eina_strbuf_free(sb);
eina_hash_add(_parsed_kls, buffer, s);
}
kl = calloc(1, sizeof(*kl));
kl->ekl = eolian_class_get_by_name((Eolian_Unit*) eos, buffer);
kl->ekl = eolian_state_class_by_name_get(s, buffer);
ret->classes = eina_list_append(ret->classes, kl);
}
if (!kl)
@ -1298,7 +1518,7 @@ eolian_debug_object_information_decode(char *buffer, unsigned int size)
func = calloc(1, sizeof(*func));
// printf("Class name = %s function = %s\n", eolian_class_name_get(kl->ekl), buffer);
kl->functions = eina_list_append(kl->functions, func);
func->efunc = eolian_class_function_get_by_name(kl->ekl, buffer, EOLIAN_PROP_GET);
func->efunc = eolian_class_function_by_name_get(kl->ekl, buffer, EOLIAN_PROP_GET);
if(!func->efunc)
{
printf("Function %s not found!\n", buffer);
@ -1312,77 +1532,20 @@ eolian_debug_object_information_decode(char *buffer, unsigned int size)
itr = eolian_property_values_get(func->efunc, EOLIAN_PROP_GET);
EINA_ITERATOR_FOREACH(itr, eo_param)
{
Eolian_Debug_Parameter *p = calloc(1, sizeof(*p));
p->eparam = eo_param;
eo_type = eolian_parameter_type_get(eo_param);
Eolian_Debug_Basic_Type type = _eolian_type_resolve(eo_type);
if (type)
{
Eolian_Debug_Parameter *p = calloc(1, sizeof(*p));
p->eparam = eo_param;
p->value.type = type;
if (type == EOLIAN_DEBUG_STRING)
{
len = strlen(buffer) + 1;
p->value.value.value = (uint64_t) eina_stringshare_add(buffer);
buffer += len;
size -= len;
}
else
{
uint64_t value = 0;;
EXTRACT(buffer, &value, debug_types[type].size);
p->value.value.value = SWAP_64(value);
size -= debug_types[type].size;
if (type == EOLIAN_DEBUG_LIST)
{
len = _complex_buffer_decode(buffer, eo_type, &(p->value));
buffer += len;
size -= len;
}
}
func->params = eina_list_append(func->params, p);
}
else
{
printf("Unknown parameter type %s\n", eolian_type_full_name_get(eo_type));
goto error;
}
if (!_value_decode(&buffer, &size, eo_type, &(p->value)))
goto error;
func->params = eina_list_append(func->params, p);
}
func->ret.etype = eo_type = eolian_function_return_type_get(
func->efunc, EOLIAN_PROP_GET);
func->ret.value.type = EOLIAN_DEBUG_VOID;
if(eo_type)
{
Eolian_Debug_Basic_Type type = _eolian_type_resolve(eo_type);
if (type)
{
func->ret.value.type = type;
if (type == EOLIAN_DEBUG_STRING)
{
len = strlen(buffer) + 1;
func->ret.value.value.value = (uint64_t) eina_stringshare_add(buffer);
buffer += len;
size -= len;
}
else
{
uint64_t value;
EXTRACT(buffer, &value, debug_types[type].size);
func->ret.value.value.value = SWAP_64(value);
size -= debug_types[type].size;
if (type == EOLIAN_DEBUG_LIST)
{
len = _complex_buffer_decode(buffer, eo_type, &(func->ret.value));
buffer += len;
size -= len;
}
}
}
else
{
printf("Unknown parameter type %s\n", eolian_type_full_name_get(eo_type));
goto error;
}
if (!_value_decode(&buffer, &size, eo_type, &(func->ret.value)))
goto error;
}
eina_iterator_free(itr);
}

View File

@ -1,6 +1,6 @@
static void
_init_data_descriptors(void)
_init_manager_details_descriptors(void)
{
Eet_Data_Descriptor_Class klass;
Eet_Data_Descriptor *relations_eed;
@ -10,12 +10,12 @@ _init_data_descriptors(void)
#define BASIC(field, type) EET_DATA_DESCRIPTOR_ADD_BASIC(relations_eed, Clouseau_Focus_Relation, #field , field, type)
BASIC(class_name, EET_T_STRING);
BASIC(relation.next, EET_T_UINT);
BASIC(relation.prev, EET_T_UINT);
BASIC(relation.next, EET_T_LONG_LONG);
BASIC(relation.prev, EET_T_LONG_LONG);
BASIC(relation.logical, EET_T_CHAR);
BASIC(relation.parent, EET_T_UINT);
BASIC(relation.redirect, EET_T_UINT);
BASIC(relation.node, EET_T_UINT);
BASIC(relation.parent, EET_T_LONG_LONG);
BASIC(relation.redirect, EET_T_LONG_LONG);
BASIC(relation.node, EET_T_LONG_LONG);
BASIC(relation.position_in_history, EET_T_INT);
#undef BASIC
@ -31,8 +31,39 @@ _init_data_descriptors(void)
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&klass, Clouseau_Focus_Manager_Data);
manager_details = eet_data_descriptor_file_new(&klass);
EET_DATA_DESCRIPTOR_ADD_BASIC(manager_details, Clouseau_Focus_Manager_Data, "redirect_manager", redirect_manager, EET_T_UINT);
EET_DATA_DESCRIPTOR_ADD_BASIC(manager_details, Clouseau_Focus_Manager_Data, "focused", focused, EET_T_UINT);
EET_DATA_DESCRIPTOR_ADD_BASIC(manager_details, Clouseau_Focus_Manager_Data, "redirect_manager", redirect_manager, EET_T_LONG_LONG);
EET_DATA_DESCRIPTOR_ADD_BASIC(manager_details, Clouseau_Focus_Manager_Data, "focused", focused, EET_T_LONG_LONG);
EET_DATA_DESCRIPTOR_ADD_BASIC(manager_details, Clouseau_Focus_Manager_Data, "class_name", class_name, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_LIST(manager_details, Clouseau_Focus_Manager_Data, "relations", relations, relations_eed);
}
static void
_init_manager_list_descriptors(void)
{
Eet_Data_Descriptor_Class klass;
Eet_Data_Descriptor *detail_eed;
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&klass, Clouseau_Focus_List_Item);
detail_eed = eet_data_descriptor_file_new(&klass);
#define BASIC(field, type) EET_DATA_DESCRIPTOR_ADD_BASIC(detail_eed, Clouseau_Focus_List_Item, #field , field, type)
BASIC(helper_name, EET_T_STRING);
BASIC(ptr, EET_T_LONG_LONG);
#undef BASIC
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&klass, Clouseau_Focus_Managers);
manager_list = eet_data_descriptor_file_new(&klass);
EET_DATA_DESCRIPTOR_ADD_LIST(manager_list, Clouseau_Focus_Managers, "managers", managers, detail_eed);
}
static void
_init_data_descriptors(void)
{
_init_manager_list_descriptors();
_init_manager_details_descriptors();
}

View File

@ -1501,7 +1501,7 @@ _ui_get(Clouseau_Extension *ext, Eo *parent)
o2 = elm_button_add(bar_box);
elm_object_part_content_set(o2, "icon", o);
elm_box_pack_end(bar_box, o2);
efl_gfx_visible_set(o2, EINA_TRUE);
efl_gfx_entity_visible_set(o2, EINA_TRUE);
evas_object_smart_callback_add(o2, "clicked", _evlog_clear, ext);
inf->record_icon = o = elm_icon_add(bar_box);
@ -1511,23 +1511,23 @@ _ui_get(Clouseau_Extension *ext, Eo *parent)
inf->record_button = o = elm_button_add(bar_box);
elm_object_part_content_set(o, "icon", inf->record_icon);
elm_box_pack_end(bar_box, o);
efl_gfx_visible_set(o, EINA_TRUE);
efl_gfx_entity_visible_set(o, EINA_TRUE);
evas_object_smart_callback_add(o, "clicked", _process_recording, ext);
o = elm_separator_add(bar_box);
elm_box_pack_end(bar_box, o);
efl_gfx_visible_set(o, EINA_TRUE);
efl_gfx_entity_visible_set(o, EINA_TRUE);
o = elm_label_add(bar_box);
elm_object_text_set(o, "Refresh interval (in seconds):");
elm_box_pack_end(bar_box, o);
efl_gfx_visible_set(o, EINA_TRUE);
efl_gfx_entity_visible_set(o, EINA_TRUE);
inf->refresh_interval_entry = o = elm_entry_add(bar_box);
elm_entry_single_line_set(o, EINA_TRUE);
elm_object_text_set(o, "0.2");
elm_box_pack_end(bar_box, o);
efl_gfx_visible_set(o, EINA_TRUE);
efl_gfx_entity_visible_set(o, EINA_TRUE);
inf->zoom_slider = o = elm_slider_add(inf->main);
evas_object_data_set(o, "inf", inf);

View File

@ -1,14 +1,10 @@
set(CMAKE_BUILD_TYPE Debug)
STRING(REGEX REPLACE "\n" "" EOLIAN_EO_DIR ${EOLIAN_EO_DIR})
STRING(REGEX REPLACE " " "" EOLIAN_EO_DIR ${EOLIAN_EO_DIR})
add_definitions(${CLI_COMMON_DEFINITIONS} -DEFL_EO_API_SUPPORT
-DEOLIAN_EO_DIR="${EOLIAN_EO_DIR}" -DFOCUS_EDJ="${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME_LOWER}/clouseau_focus_inspector.edj")
-DFOCUS_EDJ="${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME_LOWER}/clouseau_focus_inspector.edj")
add_definitions(-DEFL_EO_API_SUPPORT -DGUI_IMAGES_PATH="${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME_LOWER}")
set(EOLIAN_INCLUDE_FLAG -I \"${EOLIAN_EO_DIR}/eo-1\" -I${CMAKE_CURRENT_SOURCE_DIR})
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${ELEMENTARY_INCLUDE_DIRS}

View File

@ -4,14 +4,15 @@
static Evas_Object *table, *managers, *redirect, *history, *scroller;
static Elm_Genlist_Item_Class *itc;
static Clouseau_Focus_List_Item *selected_manager = NULL;
static char*
_text_get(void *data, Elm_Genlist *list EINA_UNUSED, const char *part EINA_UNUSED)
{
Efl_Ui_Focus_Manager *manager = data;
Clouseau_Focus_List_Item *it = data;
Eina_Strbuf *res = eina_strbuf_new();
eina_strbuf_append_printf(res, "%p", manager);
eina_strbuf_append_printf(res, "%s - %p", it->helper_name, (void*)it->ptr);
return eina_strbuf_release(res);
}
@ -23,44 +24,61 @@ _sel_relation_func(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EI
elm_radio_value_set(obj, elm_radio_state_value_get(obj));
}
static void
_reload(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
if (selected_manager)
com_defailt_manager(data, (void*)selected_manager->ptr);
}
EAPI Evas_Object*
ui_create(Instance *inst, Evas_Object *obj)
{
Evas_Object *o, *table2, *group = NULL;
Evas_Object *o, *ic, *table2, *group = NULL;
o = table = elm_table_add(obj);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(o);
ic = elm_icon_add(obj);
elm_icon_standard_set(ic, "edit-redo");
evas_object_show(ic);
o = elm_button_add(obj);
elm_object_part_content_set(o, "icon", ic);
evas_object_show(o);
elm_table_pack(table, o, 0, 0, 1, 1);
evas_object_smart_callback_add(o, "clicked", _reload, inst);
o = managers = elm_combobox_add(obj);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_part_text_set(o, "guide", "Manager to inspect");
evas_object_show(o);
elm_table_pack(table, o, 0, 0, 1, 1);
elm_table_pack(table, o, 1, 0, 1, 1);
itc = elm_genlist_item_class_new();
itc->func.text_get = _text_get;
o = elm_label_add(obj);
elm_object_text_set(o, "Redirect:");
evas_object_show(o);
elm_table_pack(table, o, 1, 0, 1, 1);
elm_table_pack(table, o, 2, 0, 1, 1);
o = redirect = elm_label_add(obj);
evas_object_show(o);
elm_table_pack(table, o, 2, 0, 1, 1);
elm_table_pack(table, o, 3, 0, 1, 1);
o = history = elm_hoversel_add(obj);
elm_object_text_set(o, "History");
evas_object_show(o);
elm_table_pack(table, o, 3, 0, 1, 1);
elm_table_pack(table, o, 4, 0, 1, 1);
o = scroller = elm_scroller_add(table);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(o);
elm_table_pack(table, o, 0, 1, 4, 1);
elm_table_pack(table, o, 0, 1, 5, 1);
o = table2 = elm_table_add(obj);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
@ -78,7 +96,7 @@ ui_create(Instance *inst, Evas_Object *obj)
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_text_set(o, text[i]);
evas_object_show(o);
elm_table_pack(table2, o, i % 4, i/4, 1, 1);
elm_table_pack(table2, o, i % 5, i/5, 1, 1);
if (!group)
group = o;
@ -89,7 +107,7 @@ ui_create(Instance *inst, Evas_Object *obj)
}
elm_radio_value_set(group, RELATION_NONE);
elm_table_pack(table, table2, 0, 2, 4, 1);
elm_table_pack(table, table2, 0, 2, 5, 1);
return table;
}
@ -97,18 +115,28 @@ ui_create(Instance *inst, Evas_Object *obj)
static void
_sel(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
{
com_defailt_manager(data, elm_object_item_data_get(event_info));
Clouseau_Focus_List_Item *it = elm_object_item_data_get(event_info);
com_defailt_manager(data, (void*)it->ptr);
selected_manager = it;
}
EAPI void
ui_managers_add(Instance *inst, Efl_Ui_Focus_Manager **manager, int size)
ui_managers_add(Instance *inst, Clouseau_Focus_Managers *clouseau_managers)
{
elm_genlist_clear(managers);
Clouseau_Focus_List_Item *it;
Eina_List *n;
for (int i = 0; i < size; ++i)
elm_genlist_clear(managers);
selected_manager = NULL;
if (!clouseau_managers) return;
EINA_LIST_FOREACH(clouseau_managers->managers, n, it)
{
elm_genlist_item_append(managers, itc, manager[i], NULL, 0, _sel, inst);
elm_genlist_item_append(managers, itc, it, NULL, 0, _sel, inst);
}
free(clouseau_managers);
}
static int
@ -137,10 +165,15 @@ ui_manager_data_arrived(Instance *inst, Clouseau_Focus_Manager_Data *data)
inst->realized.focusable_to_cfr = eina_hash_pointer_new(NULL);
if (inst->realized.data)
free(inst->realized.data);
inst->realized.data = data;
elm_hoversel_clear(history);
if (!inst->realized.data) return;
EINA_LIST_FOREACH(data->relations, n, rel)
{
if (rel->relation.position_in_history != -1)

View File

@ -25,8 +25,7 @@ typedef enum {
EAPI void tree_view_update(Instance *inst, Evas_Object *scroller);
EAPI void tree_view_relation_display(Instance *inst, Relations rel);
EAPI void ui_managers_add(Instance *inst, Efl_Ui_Focus_Manager **manager, int size);
EAPI void ui_managers_add(Instance *inst, Clouseau_Focus_Managers *clouseau_managers);
EAPI void ui_manager_data_arrived(Instance *inst, Clouseau_Focus_Manager_Data *data);
EAPI Evas_Object* ui_create(Instance *inst, Evas_Object *obj);

View File

@ -9,19 +9,19 @@ static Instance inst;
static int _focus_manager_list_op = EINA_DEBUG_OPCODE_INVALID;
static int _focus_manager_detail_op = EINA_DEBUG_OPCODE_INVALID;
static Eet_Data_Descriptor *manager_details = NULL;
static Eet_Data_Descriptor *manager_details = NULL, *manager_list = NULL;
#include "../../clouseau_focus_serialization.x"
static Eina_Bool
_main_loop_focus_manager_list_cb(Eina_Debug_Session *session, int src EINA_UNUSED, void *buffer, int size)
{
int nb_managers = size / sizeof(Efl_Ui_Focus_Manager*);
Efl_Ui_Focus_Manager *manager_arr[nb_managers];
Clouseau_Extension *ext = eina_debug_session_data_get(session);
Clouseau_Focus_Managers *managers;
if (!manager_list) _init_manager_list_descriptors();
memcpy(manager_arr, buffer, size);
managers = eet_data_descriptor_decode(manager_list, buffer, size);
ui_managers_add(ext->data, manager_arr, nb_managers);
ui_managers_add(ext->data, managers);
return EINA_TRUE;
}
@ -65,10 +65,18 @@ _session_changed(Clouseau_Extension *ext)
eina_debug_session_data_set(ext->session, ext);
eina_debug_opcodes_register(ext->session, ops, NULL, ext);
}
ui_managers_add(ext->data, NULL);
ui_manager_data_arrived(ext->data, NULL);
}
static void
_app_changed(Clouseau_Extension *ext)
{
ui_managers_add(ext->data, NULL);
ui_manager_data_arrived(ext->data, NULL);
com_refresh_managers(ext->data);
}

View File

@ -102,7 +102,7 @@ _create_arrow(Evas *e)
vg = evas_object_vg_add(e);
cont = evas_vg_container_add(NULL);
cont = evas_vg_container_add(vg);
tail = evas_vg_shape_add(cont);
evas_vg_node_color_set(tail, 0, 0, 0, 255);

View File

@ -1,14 +1,9 @@
set(CMAKE_BUILD_TYPE Debug)
STRING(REGEX REPLACE "\n" "" EOLIAN_EO_DIR ${EOLIAN_EO_DIR})
STRING(REGEX REPLACE " " "" EOLIAN_EO_DIR ${EOLIAN_EO_DIR})
add_definitions(${CLI_COMMON_DEFINITIONS} -DEFL_EO_API_SUPPORT
-DEOLIAN_EO_DIR="${EOLIAN_EO_DIR}")
add_definitions(${CLI_COMMON_DEFINITIONS} -DEFL_EO_API_SUPPORT)
add_definitions(-DEFL_EO_API_SUPPORT -DGUI_IMAGES_PATH="${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME_LOWER}")
set(EOLIAN_INCLUDE_FLAG -I \"${EOLIAN_EO_DIR}/eo-1\" -I${CMAKE_CURRENT_SOURCE_DIR})
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${ELEMENTARY_INCLUDE_DIRS}

View File

@ -7,6 +7,7 @@
#ifndef ELM_INTERNAL_API_ARGESFSDFEFC
#define ELM_INTERNAL_API_ARGESFSDFEFC
#endif
#include <Efl_Ui.h>
#include <Elementary.h>
#include "gui.h"
@ -61,7 +62,7 @@ gui_win_create(Eo *__main_parent)
pub_widgets->main = box;
evas_object_size_hint_weight_set(box, 1, 1);
evas_object_size_hint_align_set(box, -1, -1);
efl_gfx_visible_set(box, EINA_TRUE);
efl_gfx_entity_visible_set(box, EINA_TRUE);
efl_event_callback_add(box, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
tb = elm_toolbar_add(__main_parent);
@ -70,7 +71,7 @@ gui_win_create(Eo *__main_parent)
elm_toolbar_menu_parent_set(tb, __main_parent);
evas_object_size_hint_weight_set(tb, 0, 0);
evas_object_size_hint_align_set(tb, -1, 0);
efl_gfx_visible_set(tb, EINA_TRUE);
efl_gfx_entity_visible_set(tb, EINA_TRUE);
pub_widgets->reload_button = elm_toolbar_item_append(tb, "view-refresh", "Reload", reload_perform, NULL);
@ -106,8 +107,8 @@ gui_win_create(Eo *__main_parent)
panes = efl_add(EFL_UI_PANES_CLASS, box);
elm_panes_content_right_size_set(panes, 0.600000);
evas_object_size_hint_weight_set(panes, 1.000000, 1.000000);
efl_gfx_size_set(panes, EINA_SIZE2D(75, 75));
efl_gfx_visible_set(panes, EINA_TRUE);
efl_gfx_entity_size_set(panes, EINA_SIZE2D(75, 75));
efl_gfx_entity_visible_set(panes, EINA_TRUE);
evas_object_size_hint_weight_set(panes, 1.000000, 1.000000);
evas_object_size_hint_align_set(panes, -1.000000, -1.000000);
elm_box_pack_end(box, tb);
@ -115,11 +116,11 @@ gui_win_create(Eo *__main_parent)
object_infos_list = elm_genlist_add(panes);
pub_widgets->object_infos_list = object_infos_list;
evas_object_size_hint_weight_set(object_infos_list, 1.000000, 1.000000);
efl_gfx_visible_set(object_infos_list, EINA_TRUE);
efl_gfx_entity_visible_set(object_infos_list, EINA_TRUE);
objects_list = elm_genlist_add(panes);
pub_widgets->objects_list = objects_list;
evas_object_size_hint_weight_set(objects_list, 1.000000, 1.000000);
efl_gfx_visible_set(objects_list, EINA_TRUE);
efl_gfx_entity_visible_set(objects_list, EINA_TRUE);
elm_object_part_content_set(panes, "left", objects_list);
elm_object_part_content_set(panes, "right", object_infos_list);
@ -134,16 +135,16 @@ gui_take_screenshot_button_create(Eo *__main_parent)
Eo *bt;
Eo *elm_icon1;
bt = efl_add(EFL_UI_BUTTON_CLASS, __main_parent);
bt = elm_button_add(__main_parent);
pub_widgets->bt = bt;
evas_object_size_hint_weight_set(bt, 1.000000, 1.000000);
efl_gfx_visible_set(bt, EINA_TRUE);
efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, take_screenshot_button_clicked, NULL);
evas_object_show(bt);
efl_event_callback_add(bt, EFL_INPUT_EVENT_CLICKED, take_screenshot_button_clicked, NULL);
elm_icon1 = elm_icon_add(bt);
evas_object_size_hint_weight_set(elm_icon1, 1.000000, 1.000000);
efl_gfx_visible_set(elm_icon1, EINA_TRUE);
efl_file_set(elm_icon1, TAKE_SCREENSHOT_ICON, NULL);
efl_gfx_entity_visible_set(elm_icon1, EINA_TRUE);
efl_file_set(elm_icon1, TAKE_SCREENSHOT_ICON);
elm_object_part_content_set(bt, "icon", elm_icon1);
efl_event_callback_add(bt, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
@ -158,18 +159,18 @@ gui_show_screenshot_button_create(Eo *__main_parent)
Eo *bt;
Eo *elm_icon1;
bt = efl_add(EFL_UI_BUTTON_CLASS, __main_parent);
bt = elm_button_add(__main_parent);
pub_widgets->bt = bt;
evas_object_size_hint_weight_set(bt, 1.000000, 1.000000);
efl_gfx_visible_set(bt, EINA_TRUE);
efl_gfx_size_set(bt, EINA_SIZE2D(73, 30));
efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, show_screenshot_button_clicked, NULL);
evas_object_show(bt);
evas_object_resize(bt, 73, 30);
efl_event_callback_add(bt, EFL_INPUT_EVENT_CLICKED, show_screenshot_button_clicked, NULL);
elm_icon1 = elm_icon_add(bt);
evas_object_size_hint_weight_set(elm_icon1, 1.000000, 1.000000);
efl_gfx_visible_set(elm_icon1, EINA_TRUE);
efl_gfx_size_set(elm_icon1, EINA_SIZE2D(40, 40));
efl_file_set(elm_icon1, SHOW_SCREENSHOT_ICON, NULL);
efl_gfx_entity_visible_set(elm_icon1, EINA_TRUE);
efl_gfx_entity_size_set(elm_icon1, EINA_SIZE2D(40, 40));
efl_file_set(elm_icon1, SHOW_SCREENSHOT_ICON);
elm_object_part_content_set(bt, "icon", elm_icon1);
efl_event_callback_add(bt, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
@ -187,15 +188,15 @@ gui_show_screenshot_win_create(Eo *__main_parent)
win = elm_win_add(__main_parent, "Screenshot", ELM_WIN_BASIC);
pub_widgets->win = win;
elm_win_autodel_set(win, EINA_TRUE);
efl_gfx_size_set(win, EINA_SIZE2D(300, 300));
efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 300));
evas_object_size_hint_weight_set(win, 1.000000, 1.000000);
elm_win_title_set(win, "Screenshot");
bg = elm_bg_add(win);
pub_widgets->bg = bg;
evas_object_size_hint_weight_set(bg, 1.000000, 1.000000);
efl_gfx_visible_set(bg, EINA_TRUE);
efl_gfx_entity_visible_set(bg, EINA_TRUE);
elm_win_resize_object_add(win, bg);
efl_gfx_visible_set(win, EINA_TRUE);
efl_gfx_entity_visible_set(win, EINA_TRUE);
efl_event_callback_add(win, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
return pub_widgets;

View File

@ -99,6 +99,7 @@ static Evas_Object * _obj_info_tootip(void *, Evas_Object *, Evas_Object *, void
static Eina_Bool _eoids_get(Eina_Debug_Session *, int, void *, int);
static Eina_Bool _klids_get(Eina_Debug_Session *, int, void *, int);
static Eina_Bool _obj_info_get(Eina_Debug_Session *, int, void *, int);
static Eina_Bool _snapshot_started_cb(Eina_Debug_Session *, int, void *, int);
static Eina_Bool _snapshot_done_cb(Eina_Debug_Session *, int, void *, int);
static Eina_Bool _win_screenshot_get(Eina_Debug_Session *, int, void *, int);
@ -108,7 +109,7 @@ EINA_DEBUG_OPCODES_ARRAY_DEFINE(_ops,
{"Clouseau/Evas/object/highlight", &_obj_highlight_op, NULL},
{"Clouseau/Evas/window/screenshot", &_win_screenshot_op, &_win_screenshot_get},
{"Clouseau/Eolian/object/info_get", &_obj_info_op, &_obj_info_get},
{"Clouseau/Object_Introspection/snapshot_start",&_snapshot_do_op, NULL},
{"Clouseau/Object_Introspection/snapshot_start",&_snapshot_do_op, &_snapshot_started_cb},
{"Clouseau/Object_Introspection/snapshot_done", &_snapshot_done_op, &_snapshot_done_cb},
{NULL, NULL, NULL}
);
@ -202,7 +203,6 @@ _app_snapshot_request(Clouseau_Extension *ext)
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);
@ -368,7 +368,7 @@ _ptr_highlight(Clouseau_Extension *ext, Eolian_Debug_Value *v)
{
case EOLIAN_DEBUG_POINTER:
{
_obj_highlight(ext, v->value.value);
_obj_highlight(ext, v->value);
break;
}
case EOLIAN_DEBUG_LIST:
@ -376,7 +376,7 @@ _ptr_highlight(Clouseau_Extension *ext, Eolian_Debug_Value *v)
Eina_List *itr;
EINA_LIST_FOREACH(v->complex_type_values, itr, v)
{
_obj_highlight(ext, v->value.value);
_obj_highlight(ext, v->value);
}
break;
}
@ -435,7 +435,7 @@ _eolian_type_to_string(const Eolian_Type *param_eolian_type, Eina_Strbuf *buf)
if ((type == EOLIAN_TYPE_REGULAR || type == EOLIAN_TYPE_CLASS) &&
!eolian_type_base_type_get(param_eolian_type))
{
eina_strbuf_append_printf(buf, "%s", eolian_type_full_name_get(param_eolian_type));
eina_strbuf_append_printf(buf, "%s", eolian_type_name_get(param_eolian_type));
}
else
{
@ -443,7 +443,7 @@ _eolian_type_to_string(const Eolian_Type *param_eolian_type, Eina_Strbuf *buf)
if ((eolian_type_type_get(base) == EOLIAN_TYPE_REGULAR) ||
(eolian_type_type_get(base) == EOLIAN_TYPE_CLASS))
{
eina_strbuf_append_printf(buf, "%s *", eolian_type_full_name_get(base));
eina_strbuf_append_printf(buf, "%s *", eolian_type_name_get(base));
}
else if (eolian_type_type_get(base) == EOLIAN_TYPE_VOID)
{
@ -464,71 +464,81 @@ _eolian_value_to_string(Eolian_Debug_Value *value, Eina_Strbuf *buf)
case EOLIAN_DEBUG_STRING:
{
eina_strbuf_append_printf(buf, "\"%s\" ",
(char *)value->value.value);
(char *)value->value);
break;
}
case EOLIAN_DEBUG_POINTER:
{
eina_strbuf_append_printf(buf, "%p ",
(void *)value->value.value);
(void *)value->value);
break;
}
case EOLIAN_DEBUG_CHAR:
{
eina_strbuf_append_printf(buf, "%c ",
(char)value->value.value);
(char)value->value);
break;
}
case EOLIAN_DEBUG_INT:
{
eina_strbuf_append_printf(buf, "%d ",
(int)value->value.value);
(int)value->value);
break;
}
case EOLIAN_DEBUG_SHORT:
{
eina_strbuf_append_printf(buf, "%u ",
(unsigned int)value->value.value);
(unsigned int)value->value);
break;
}
case EOLIAN_DEBUG_DOUBLE:
{
eina_strbuf_append_printf(buf, "%f ",
(double)value->value.value);
(double)value->value);
break;
}
case EOLIAN_DEBUG_BOOLEAN:
{
eina_strbuf_append_printf(buf, "%s ",
(value->value.value ? "true" : "false"));
(value->value ? "true" : "false"));
break;
}
case EOLIAN_DEBUG_LONG:
{
eina_strbuf_append_printf(buf, "%ld ",
(long)value->value.value);
(long)value->value);
break;
}
case EOLIAN_DEBUG_UINT:
{
eina_strbuf_append_printf(buf, "%u ",
(unsigned int)value->value.value);
(unsigned int)value->value);
break;
}
case EOLIAN_DEBUG_LIST:
{
Eina_List *l = value->complex_type_values, *itr;
eina_strbuf_append_printf(buf, "%lX [", value->value.value);
eina_strbuf_append_printf(buf, "%lX [", value->value);
EINA_LIST_FOREACH(l, itr, value)
{
eina_strbuf_append_printf(buf, "%s%lX",
l != itr ? ", " : "",
value->value.value);
value->value);
}
eina_strbuf_append(buf, "]");
break;
}
default: eina_strbuf_append_printf(buf, "%lX ", value->value.value);
case EOLIAN_DEBUG_STRUCT:
{
Eina_List *l = value->complex_type_values, *itr;
EINA_LIST_FOREACH(l, itr, value)
{
if (l != itr) eina_strbuf_append(buf, ", ");
_eolian_value_to_string(value, buf);
}
break;
}
default: eina_strbuf_append_printf(buf, "%lX ", value->value);
}
}
@ -584,7 +594,7 @@ _obj_kl_info_item_label_get(void *data, Evas_Object *obj EINA_UNUSED,
const char *part EINA_UNUSED)
{
Eolian_Debug_Class *kl = data;
return strdup(eolian_class_full_name_get(kl->ekl));
return strdup(eolian_class_name_get(kl->ekl));
}
static char *
@ -811,10 +821,10 @@ show_screenshot_button_clicked(void *data EINA_UNUSED, const Efl_Event *event)
info->screenshots_menu = elm_menu_add(inst->wdgs->main);
efl_wref_add(info->screenshots_menu, &info->screenshots_menu);
bt_pos = efl_gfx_position_get(bt);
bt_size = efl_gfx_size_get(bt);
bt_pos = efl_gfx_entity_position_get(bt);
bt_size = efl_gfx_entity_size_get(bt);
elm_menu_move(info->screenshots_menu, bt_pos.x, bt_pos.y + bt_size.w);
efl_gfx_visible_set(info->screenshots_menu, EINA_TRUE);
efl_gfx_entity_visible_set(info->screenshots_menu, EINA_TRUE);
EINA_LIST_FOREACH(info->screenshots, itr, s)
{
char str[200];
@ -826,6 +836,15 @@ show_screenshot_button_clicked(void *data EINA_UNUSED, const Efl_Event *event)
}
}
static Eina_Bool
_snapshot_started_cb(Eina_Debug_Session *session, int src EINA_UNUSED,
void *buffer EINA_UNUSED, int size EINA_UNUSED)
{
Clouseau_Extension *ext = eina_debug_session_data_get(session);
ext->ui_freeze_cb(ext, EINA_TRUE);
return EINA_TRUE;
}
static Eina_Bool
_snapshot_done_cb(Eina_Debug_Session *session, int src EINA_UNUSED,
void *buffer EINA_UNUSED, int size EINA_UNUSED)
@ -891,7 +910,7 @@ _objs_item_content_get(void *data, Evas_Object *obj, const char *part)
Instance *inst = ext->data;
if (!canvas_id)
{
Class_Info *kl_info = eina_hash_find(inst->classes_hash_by_name, "Evas.Canvas");
Class_Info *kl_info = eina_hash_find(inst->classes_hash_by_name, "Efl.Ui.Win_Legacy");
if (kl_info) canvas_id = kl_info->id;
}
if (info->kl_id == canvas_id && !strcmp(part, "elm.swallow.end"))
@ -899,7 +918,7 @@ _objs_item_content_get(void *data, Evas_Object *obj, const char *part)
Eo *box = elm_box_add(obj);
evas_object_size_hint_weight_set(box, 1.000000, 1.000000);
elm_box_horizontal_set(box, EINA_TRUE);
efl_gfx_visible_set(box, EINA_TRUE);
efl_gfx_entity_visible_set(box, EINA_TRUE);
if (info->screenshots)
{

View File

@ -2,8 +2,8 @@ set(CMAKE_BUILD_TYPE Debug)
STRING(REGEX REPLACE "\n" "" EOLIAN_EO_DIR ${EOLIAN_EO_DIR})
STRING(REGEX REPLACE " " "" EOLIAN_EO_DIR ${EOLIAN_EO_DIR})
STRING(REGEX REPLACE "\n" "" EOLIAN_EO_DIR "${EOLIAN_EO_DIR}")
STRING(REGEX REPLACE " " "" EOLIAN_EO_DIR "${EOLIAN_EO_DIR}")
add_definitions(${CLI_COMMON_DEFINITIONS} -DEFL_EO_API_SUPPORT
-DEOLIAN_EO_DIR="${EOLIAN_EO_DIR}")