Compare commits
2 Commits
master
...
devs/bu5hm
Author | SHA1 | Date |
---|---|---|
Marcel Hollerbach | 6b4097e97b | |
Marcel Hollerbach | 940bd4044d |
|
@ -11,6 +11,7 @@ Makefile.in
|
|||
.*.sw[po]
|
||||
*.gcov
|
||||
*.gcno
|
||||
/README
|
||||
/aclocal.m4
|
||||
/autom4te.cache/
|
||||
/config.cache
|
||||
|
|
|
@ -18,7 +18,7 @@ find_package(Elementary REQUIRED)
|
|||
find_package(Ecore REQUIRED)
|
||||
find_package(Evas REQUIRED)
|
||||
find_package(Ffi REQUIRED)
|
||||
find_package(efl_profiler QUIET)
|
||||
find_package(efl_profiler)
|
||||
|
||||
add_subdirectory(src/bin)
|
||||
add_subdirectory(src/lib)
|
||||
|
|
28
README
28
README
|
@ -1,28 +0,0 @@
|
|||
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
|
|
@ -24,6 +24,7 @@ add_executable(clouseau_client ${SOURCES})
|
|||
|
||||
target_link_libraries(clouseau_client
|
||||
pthread
|
||||
clouseau_debug
|
||||
${EFL_LIBRARIES}
|
||||
${ELEMENTARY_LIBRARIES}
|
||||
${EINA_LIBRARIES}
|
||||
|
@ -36,4 +37,3 @@ target_link_libraries(clouseau_client
|
|||
)
|
||||
|
||||
install(TARGETS clouseau_client DESTINATION bin)
|
||||
install(PROGRAMS clouseau DESTINATION bin)
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
#!/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
|
|
@ -10,11 +10,9 @@
|
|||
#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"
|
||||
|
||||
|
@ -119,7 +117,6 @@ 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);
|
||||
|
@ -127,8 +124,6 @@ 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},
|
||||
|
@ -211,8 +206,8 @@ static void
|
|||
_ui_freeze(Clouseau_Extension *ext EINA_UNUSED, Eina_Bool on)
|
||||
{
|
||||
elm_progressbar_pulse(_main_widgets->freeze_pulse, on);
|
||||
efl_gfx_entity_visible_set(_main_widgets->freeze_pulse, on);
|
||||
efl_gfx_entity_visible_set(_main_widgets->freeze_inwin, on);
|
||||
efl_gfx_visible_set(_main_widgets->freeze_pulse, on);
|
||||
efl_gfx_visible_set(_main_widgets->freeze_inwin, on);
|
||||
}
|
||||
|
||||
static Extension_Config *
|
||||
|
@ -432,10 +427,6 @@ _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;
|
||||
|
@ -505,8 +496,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);
|
||||
|
@ -526,89 +517,6 @@ _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)
|
||||
{
|
||||
|
@ -636,40 +544,16 @@ _connection_type_change(Connection_Type conn_type)
|
|||
case LOCAL_CONNECTION:
|
||||
{
|
||||
_selected_port = -1;
|
||||
_session = eina_debug_local_connect(EINA_TRUE);
|
||||
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);
|
||||
_session = eina_debug_local_connect(EINA_TRUE);
|
||||
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);
|
||||
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;
|
||||
|
@ -895,13 +779,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_entity_visible_set(box, EINA_TRUE);
|
||||
efl_gfx_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_entity_visible_set(label, EINA_TRUE);
|
||||
efl_gfx_visible_set(label, EINA_TRUE);
|
||||
elm_box_pack_end(box, label);
|
||||
|
||||
Eo *list = elm_list_add(inwin);
|
||||
|
@ -1078,13 +962,12 @@ 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:p:f:", long_options, &long_index )) != -1)
|
||||
while ((opt = getopt_long(argc, argv,"hlr:f:", long_options, &long_index )) != -1)
|
||||
{
|
||||
if (opt != 'p' && (conn_type != OFFLINE || offline_filename))
|
||||
if (conn_type != OFFLINE || offline_filename)
|
||||
{
|
||||
printf("You cannot use more than one option at a time\n");
|
||||
help = EINA_TRUE;
|
||||
|
@ -1108,11 +991,6 @@ 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;
|
||||
}
|
||||
|
@ -1123,7 +1001,6 @@ 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;
|
||||
}
|
||||
|
|
|
@ -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_entity_size_set(main_win, EINA_SIZE2D(478, 484));
|
||||
efl_gfx_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_entity_visible_set(bg, EINA_TRUE);
|
||||
efl_gfx_entity_position_set(bg, EINA_POSITION2D(0, 0));
|
||||
efl_gfx_visible_set(bg, EINA_TRUE);
|
||||
efl_gfx_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_entity_visible_set(main_box, EINA_TRUE);
|
||||
efl_gfx_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_entity_visible_set(tb, EINA_TRUE);
|
||||
efl_gfx_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_entity_visible_set(ext_box, EINA_TRUE);
|
||||
efl_gfx_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_entity_visible_set(main_win, EINA_TRUE);
|
||||
efl_gfx_visible_set(main_win, EINA_TRUE);
|
||||
efl_event_callback_add(main_win, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
|
||||
|
||||
return pub_widgets;
|
||||
|
|
|
@ -51,14 +51,16 @@ typedef enum
|
|||
EOLIAN_DEBUG_UINT,
|
||||
EOLIAN_DEBUG_LIST,
|
||||
EOLIAN_DEBUG_OBJECT,
|
||||
EOLIAN_DEBUG_VOID,
|
||||
EOLIAN_DEBUG_STRUCT
|
||||
EOLIAN_DEBUG_VOID
|
||||
} Eolian_Debug_Basic_Type;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Eolian_Debug_Basic_Type type;
|
||||
union
|
||||
{
|
||||
uint64_t value;
|
||||
} value;
|
||||
Eina_List *complex_type_values;
|
||||
} Eolian_Debug_Value;
|
||||
|
||||
|
@ -119,14 +121,6 @@ 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, ...);
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <Evas.h>
|
||||
#include <Elementary.h>
|
||||
#define ELM_INTERNAL_API_ARGESFSDFEFC
|
||||
#include <elm_widget.h>
|
||||
|
||||
#include "Clouseau_Debug.h"
|
||||
|
||||
|
@ -73,9 +74,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_State *eos = NULL;
|
||||
static Eolian *eos = NULL;
|
||||
|
||||
static Eet_Data_Descriptor *manager_details = NULL, *manager_list = NULL;
|
||||
static Eet_Data_Descriptor *manager_details = NULL;
|
||||
#include "clouseau_focus_serialization.x"
|
||||
|
||||
enum {
|
||||
|
@ -132,8 +133,6 @@ 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}
|
||||
};
|
||||
|
||||
|
@ -143,6 +142,8 @@ 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)
|
||||
{
|
||||
|
@ -153,14 +154,13 @@ _eolian_type_resolve(const Eolian_Type *eo_type)
|
|||
|
||||
if (type_base == EOLIAN_TYPE_REGULAR)
|
||||
{
|
||||
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);
|
||||
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);
|
||||
if (alias)
|
||||
{
|
||||
eo_type = eolian_typedecl_base_type_get(alias);
|
||||
type_base = eolian_type_type_get(eo_type);
|
||||
full_name = eolian_type_name_get(eo_type);
|
||||
full_name = eolian_type_full_name_get(eo_type);
|
||||
}
|
||||
|
||||
if (full_name)
|
||||
|
@ -170,65 +170,11 @@ _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)
|
||||
|
@ -238,9 +184,7 @@ _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;
|
||||
|
@ -258,12 +202,11 @@ _function_invoke(Eo *ptr, const Eolian_Function *foo, Eolian_Function_Type foo_t
|
|||
EINA_ITERATOR_FOREACH(itr, eo_param)
|
||||
{
|
||||
/* Not verified */
|
||||
eo_type = eolian_parameter_type_get(eo_param);
|
||||
ed_type = _eolian_type_resolve(eo_type);
|
||||
ed_type = _eolian_type_resolve(eolian_parameter_type_get(eo_param));
|
||||
if (!ed_type) goto error;
|
||||
|
||||
types[ffi_argc] = debug_types[ed_type].ffi_type_p;
|
||||
values[ffi_argc] = &(params[argc].value.value);
|
||||
values[ffi_argc] = &(params[argc].value.value.value);
|
||||
params[argc].eparam = eo_param;
|
||||
ffi_argc++;
|
||||
argc++;
|
||||
|
@ -273,41 +216,31 @@ _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)
|
||||
{
|
||||
eo_type = eolian_parameter_type_get(eo_param);
|
||||
ed_type = _eolian_type_resolve(eo_type);
|
||||
ed_type = _eolian_type_resolve(eolian_parameter_type_get(eo_param));
|
||||
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_PARAMETER_OUT))
|
||||
(foo_type == EOLIAN_METHOD && eolian_parameter_direction_get(eo_param) == EOLIAN_OUT_PARAM))
|
||||
{
|
||||
/* Out parameter */
|
||||
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.value.value = 0;
|
||||
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);
|
||||
values[ffi_argc] = &(params[argc].value.value.value);
|
||||
}
|
||||
ffi_argc++;
|
||||
argc++;
|
||||
}
|
||||
|
||||
eo_type = eolian_function_return_type_get(foo, foo_type);
|
||||
Eina_Bool param_as_ret = EINA_FALSE;
|
||||
const Eolian_Type *eo_type = eolian_function_return_type_get(foo, foo_type);
|
||||
ffi_type *ffi_ret_type = &ffi_type_void;
|
||||
if (eo_type)
|
||||
{
|
||||
|
@ -318,45 +251,35 @@ _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);
|
||||
const char *full_func_name = eolian_function_full_c_name_get(foo, EOLIAN_PROP_GET, EINA_FALSE);
|
||||
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)
|
||||
{
|
||||
ffi_call(&cif, eo_func, result?result:&result, values);
|
||||
ret->value.type = EOLIAN_DEBUG_VOID;
|
||||
void *result;
|
||||
ffi_call(&cif, eo_func, &result, values);
|
||||
if (ret) ret->value.type = EOLIAN_DEBUG_VOID;
|
||||
if (eo_type)
|
||||
{
|
||||
if (!param_as_ret)
|
||||
if (ret)
|
||||
{
|
||||
ret->value.value = (uint64_t) result;
|
||||
ret->value.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;
|
||||
}
|
||||
|
||||
|
@ -499,24 +422,6 @@ _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)
|
||||
{
|
||||
|
@ -525,7 +430,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);
|
||||
func_c_name = eolian_function_full_c_name_get(function, EOLIAN_PROP_GET, EINA_FALSE);
|
||||
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__);
|
||||
|
@ -559,7 +464,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_name_get(ekl);
|
||||
const char *class_name = eolian_class_full_name_get(ekl);
|
||||
len = strlen(class_name) + 1;
|
||||
memcpy(buf, class_name, len);
|
||||
size += len;
|
||||
|
@ -579,26 +484,21 @@ _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 == NULL)
|
||||
params[i].value.value = (uint64_t)"";
|
||||
len = strlen((char *)params[i].value.value) + 1;
|
||||
memcpy(buf + size, (char *)params[i].value.value, len);
|
||||
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);
|
||||
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,
|
||||
size += _param_buffer_fill(buf+size, params[i].value.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);
|
||||
params[i].value.value.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -614,20 +514,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 == NULL)
|
||||
ret.value.value = (uint64_t)"";
|
||||
len = strlen((char *)ret.value.value) + 1;
|
||||
memcpy(buf + size, (char *)ret.value.value, len);
|
||||
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);
|
||||
size += len;
|
||||
}
|
||||
else
|
||||
{
|
||||
size += _param_buffer_fill(buf+size, ret.value.value,
|
||||
size += _param_buffer_fill(buf+size, ret.value.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);
|
||||
ret.etype, ret.value.value.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -648,7 +548,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.Object" },
|
||||
{ "Efl.Ui.Layout_Legacy", "Efl.Ui.Layout" },
|
||||
{ "Efl.Ui.Multibuttonentry_Legacy", "Efl.Ui.Multibuttonentry" },
|
||||
{ "Efl.Ui.Panes_Legacy", "Efl.Ui.Panes" },
|
||||
{ "Efl.Ui.Progressbar_Legacy", "Efl.Ui.Progressbar" },
|
||||
|
@ -657,15 +557,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.Object" },
|
||||
{ "Elm.Entry", "Efl.Ui.Layout.Object" },
|
||||
{ "Elm.Colorselector", "Efl.Ui.Layout.Object" },
|
||||
{ "Elm.List", "Efl.Ui.Layout.Object" },
|
||||
{ "Elm.Ctxpopup", "Efl.Ui.Layout" },
|
||||
{ "Elm.Entry", "Efl.Ui.Layout" },
|
||||
{ "Elm.Colorselector", "Efl.Ui.Layout" },
|
||||
{ "Elm.List", "Efl.Ui.Layout" },
|
||||
{ "Elm.Photo", "Efl.Ui.Widget" },
|
||||
{ "Elm.Actionslider", "Efl.Ui.Layout.Object" },
|
||||
{ "Elm.Actionslider", "Efl.Ui.Layout" },
|
||||
{ "Elm.Box", "Efl.Ui.Widget" },
|
||||
{ "Elm.Table", "Efl.Ui.Widget" },
|
||||
{ "Elm.Thumb", "Efl.Ui.Layout.Object" },
|
||||
{ "Elm.Thumb", "Efl.Ui.Layout" },
|
||||
{ "Elm.Menu", "Efl.Ui.Widget" },
|
||||
{ "Elm.Icon", "Efl.Ui.Image" },
|
||||
{ "Elm.Prefs", "Efl.Ui.Widget" },
|
||||
|
@ -677,31 +577,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.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.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.Fileselector_Button", "Efl.Ui.Button" },
|
||||
{ "Elm.Fileselector_Entry", "Efl.Ui.Layout.Object" },
|
||||
{ "Elm.Flipselector", "Efl.Ui.Layout.Object" },
|
||||
{ "Elm.Fileselector_Entry", "Efl.Ui.Layout" },
|
||||
{ "Elm.Flipselector", "Efl.Ui.Layout" },
|
||||
{ "Elm.Hoversel", "Efl.Ui.Button" },
|
||||
{ "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.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.Plug", "Efl.Ui.Widget" },
|
||||
{ "Elm.Web.None", "Efl.Ui.Widget" },
|
||||
{ NULL, NULL }
|
||||
|
@ -710,13 +610,11 @@ 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;
|
||||
|
||||
|
@ -736,29 +634,7 @@ _obj_info_req_cb(Eina_Debug_Session *session, int srcid, void *buffer, int size
|
|||
}
|
||||
}
|
||||
|
||||
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);
|
||||
okl = eolian_class_get_by_name((Eolian_Unit*) eos, class_name);
|
||||
if (!okl)
|
||||
{
|
||||
printf("Class %s not found.\n", class_name);
|
||||
|
@ -772,20 +648,16 @@ _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, *parent;
|
||||
const Eolian_Class *inherit;
|
||||
Eina_Iterator *inherits_itr;
|
||||
|
||||
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);
|
||||
inherits_itr = eolian_class_inherits_get(kl);
|
||||
size_curr += _class_buffer_fill(obj, kl, buf + size_curr);
|
||||
|
||||
EINA_ITERATOR_FOREACH(inherits_itr, inherit)
|
||||
{
|
||||
/* Avoid duplicates in MRO list. */
|
||||
if (inherit && !eina_list_data_find(list, inherit))
|
||||
if (!eina_list_data_find(list, inherit))
|
||||
list2 = eina_list_append(list, inherit);
|
||||
}
|
||||
eina_iterator_free(inherits_itr);
|
||||
|
@ -864,8 +736,6 @@ _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)
|
||||
{
|
||||
|
@ -969,14 +839,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_ENTITY_INTERFACE) && !efl_isa(obj, EFL_CANVAS_SCENE_INTERFACE)) return;
|
||||
if (!efl_isa(obj, EFL_GFX_INTERFACE) && !efl_isa(obj, EFL_CANVAS_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_ENTITY_INTERFACE))
|
||||
if (efl_isa(obj, EFL_GFX_INTERFACE))
|
||||
{
|
||||
Eina_Rect obj_geom = {.x = 0, .y = 0, .w = 0, .h = 0};
|
||||
obj_geom = efl_gfx_entity_geometry_get(obj);
|
||||
obj_geom = efl_gfx_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);
|
||||
|
@ -1068,9 +938,8 @@ _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 *obj = (Eo *)SWAP_64(ptr64);
|
||||
Eo *e = evas_object_evas_get(obj);
|
||||
if (!e) return;
|
||||
Eo *e = (Eo *)SWAP_64(ptr64);
|
||||
if (!efl_isa(e, EFL_CANVAS_INTERFACE)) return;
|
||||
|
||||
snapshot = evas_object_image_filled_add(e);
|
||||
if (!snapshot) return;
|
||||
|
@ -1084,12 +953,39 @@ _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_entity_visible_set(snapshot, EINA_TRUE);
|
||||
efl_gfx_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)
|
||||
{
|
||||
|
@ -1111,55 +1007,6 @@ 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)
|
||||
{
|
||||
|
@ -1239,6 +1086,10 @@ _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;
|
||||
|
@ -1266,6 +1117,14 @@ 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__);
|
||||
|
@ -1357,7 +1216,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);
|
||||
eina_stringshare_del((char *)param->value.value.value);
|
||||
free(param);
|
||||
}
|
||||
free(func);
|
||||
|
@ -1397,61 +1256,6 @@ _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)
|
||||
|
@ -1461,7 +1265,6 @@ _value_decode(char **buffer, unsigned int *size, const Eolian_Type *eo_type, Eol
|
|||
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;
|
||||
|
@ -1480,31 +1283,8 @@ 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_state_class_by_name_get(s, buffer);
|
||||
kl->ekl = eolian_class_get_by_name((Eolian_Unit*) eos, buffer);
|
||||
ret->classes = eina_list_append(ret->classes, kl);
|
||||
}
|
||||
if (!kl)
|
||||
|
@ -1518,7 +1298,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_by_name_get(kl->ekl, buffer, EOLIAN_PROP_GET);
|
||||
func->efunc = eolian_class_function_get_by_name(kl->ekl, buffer, EOLIAN_PROP_GET);
|
||||
if(!func->efunc)
|
||||
{
|
||||
printf("Function %s not found!\n", buffer);
|
||||
|
@ -1531,22 +1311,79 @@ eolian_debug_object_information_decode(char *buffer, unsigned int size)
|
|||
//go over function params using eolian
|
||||
itr = eolian_property_values_get(func->efunc, EOLIAN_PROP_GET);
|
||||
EINA_ITERATOR_FOREACH(itr, 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;
|
||||
eo_type = eolian_parameter_type_get(eo_param);
|
||||
if (!_value_decode(&buffer, &size, eo_type, &(p->value)))
|
||||
goto error;
|
||||
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;
|
||||
}
|
||||
}
|
||||
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)
|
||||
{
|
||||
if (!_value_decode(&buffer, &size, eo_type, &(func->ret.value)))
|
||||
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;
|
||||
}
|
||||
}
|
||||
eina_iterator_free(itr);
|
||||
}
|
||||
return ret;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
static void
|
||||
_init_manager_details_descriptors(void)
|
||||
_init_data_descriptors(void)
|
||||
{
|
||||
Eet_Data_Descriptor_Class klass;
|
||||
Eet_Data_Descriptor *relations_eed;
|
||||
|
@ -10,12 +10,12 @@ _init_manager_details_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_LONG_LONG);
|
||||
BASIC(relation.prev, EET_T_LONG_LONG);
|
||||
BASIC(relation.next, EET_T_UINT);
|
||||
BASIC(relation.prev, EET_T_UINT);
|
||||
BASIC(relation.logical, EET_T_CHAR);
|
||||
BASIC(relation.parent, EET_T_LONG_LONG);
|
||||
BASIC(relation.redirect, EET_T_LONG_LONG);
|
||||
BASIC(relation.node, EET_T_LONG_LONG);
|
||||
BASIC(relation.parent, EET_T_UINT);
|
||||
BASIC(relation.redirect, EET_T_UINT);
|
||||
BASIC(relation.node, EET_T_UINT);
|
||||
BASIC(relation.position_in_history, EET_T_INT);
|
||||
|
||||
#undef BASIC
|
||||
|
@ -31,39 +31,8 @@ _init_manager_details_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_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, "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, "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();
|
||||
}
|
||||
|
|
|
@ -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_entity_visible_set(o2, EINA_TRUE);
|
||||
efl_gfx_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_entity_visible_set(o, EINA_TRUE);
|
||||
efl_gfx_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_entity_visible_set(o, EINA_TRUE);
|
||||
efl_gfx_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_entity_visible_set(o, EINA_TRUE);
|
||||
efl_gfx_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_entity_visible_set(o, EINA_TRUE);
|
||||
efl_gfx_visible_set(o, EINA_TRUE);
|
||||
|
||||
inf->zoom_slider = o = elm_slider_add(inf->main);
|
||||
evas_object_data_set(o, "inf", inf);
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
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
|
||||
-DFOCUS_EDJ="${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME_LOWER}/clouseau_focus_inspector.edj")
|
||||
-DEOLIAN_EO_DIR="${EOLIAN_EO_DIR}" -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}
|
||||
|
|
|
@ -4,15 +4,14 @@
|
|||
|
||||
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)
|
||||
{
|
||||
Clouseau_Focus_List_Item *it = data;
|
||||
Efl_Ui_Focus_Manager *manager = data;
|
||||
Eina_Strbuf *res = eina_strbuf_new();
|
||||
|
||||
eina_strbuf_append_printf(res, "%s - %p", it->helper_name, (void*)it->ptr);
|
||||
eina_strbuf_append_printf(res, "%p", manager);
|
||||
return eina_strbuf_release(res);
|
||||
}
|
||||
|
||||
|
@ -24,61 +23,44 @@ _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, *ic, *table2, *group = NULL;
|
||||
Evas_Object *o, *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, 1, 0, 1, 1);
|
||||
elm_table_pack(table, o, 0, 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, 2, 0, 1, 1);
|
||||
elm_table_pack(table, o, 1, 0, 1, 1);
|
||||
|
||||
o = redirect = elm_label_add(obj);
|
||||
evas_object_show(o);
|
||||
elm_table_pack(table, o, 3, 0, 1, 1);
|
||||
elm_table_pack(table, o, 2, 0, 1, 1);
|
||||
|
||||
o = history = elm_hoversel_add(obj);
|
||||
elm_object_text_set(o, "History");
|
||||
evas_object_show(o);
|
||||
elm_table_pack(table, o, 4, 0, 1, 1);
|
||||
elm_table_pack(table, o, 3, 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, 5, 1);
|
||||
elm_table_pack(table, o, 0, 1, 4, 1);
|
||||
|
||||
o = table2 = elm_table_add(obj);
|
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
|
||||
|
@ -96,7 +78,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 % 5, i/5, 1, 1);
|
||||
elm_table_pack(table2, o, i % 4, i/4, 1, 1);
|
||||
|
||||
if (!group)
|
||||
group = o;
|
||||
|
@ -107,7 +89,7 @@ ui_create(Instance *inst, Evas_Object *obj)
|
|||
}
|
||||
|
||||
elm_radio_value_set(group, RELATION_NONE);
|
||||
elm_table_pack(table, table2, 0, 2, 5, 1);
|
||||
elm_table_pack(table, table2, 0, 2, 4, 1);
|
||||
|
||||
return table;
|
||||
}
|
||||
|
@ -115,28 +97,18 @@ ui_create(Instance *inst, Evas_Object *obj)
|
|||
static void
|
||||
_sel(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
Clouseau_Focus_List_Item *it = elm_object_item_data_get(event_info);
|
||||
com_defailt_manager(data, (void*)it->ptr);
|
||||
selected_manager = it;
|
||||
com_defailt_manager(data, elm_object_item_data_get(event_info));
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ui_managers_add(Instance *inst, Clouseau_Focus_Managers *clouseau_managers)
|
||||
ui_managers_add(Instance *inst, Efl_Ui_Focus_Manager **manager, int size)
|
||||
{
|
||||
Clouseau_Focus_List_Item *it;
|
||||
Eina_List *n;
|
||||
|
||||
elm_genlist_clear(managers);
|
||||
selected_manager = NULL;
|
||||
|
||||
if (!clouseau_managers) return;
|
||||
|
||||
EINA_LIST_FOREACH(clouseau_managers->managers, n, it)
|
||||
for (int i = 0; i < size; ++i)
|
||||
{
|
||||
elm_genlist_item_append(managers, itc, it, NULL, 0, _sel, inst);
|
||||
elm_genlist_item_append(managers, itc, manager[i], NULL, 0, _sel, inst);
|
||||
}
|
||||
|
||||
free(clouseau_managers);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -165,15 +137,10 @@ 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)
|
||||
|
|
|
@ -25,7 +25,8 @@ 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, Clouseau_Focus_Managers *clouseau_managers);
|
||||
|
||||
EAPI void ui_managers_add(Instance *inst, Efl_Ui_Focus_Manager **manager, int size);
|
||||
EAPI void ui_manager_data_arrived(Instance *inst, Clouseau_Focus_Manager_Data *data);
|
||||
EAPI Evas_Object* ui_create(Instance *inst, Evas_Object *obj);
|
||||
|
||||
|
|
|
@ -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, *manager_list = NULL;
|
||||
static Eet_Data_Descriptor *manager_details = 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();
|
||||
|
||||
managers = eet_data_descriptor_decode(manager_list, buffer, size);
|
||||
memcpy(manager_arr, buffer, size);
|
||||
|
||||
ui_managers_add(ext->data, managers);
|
||||
ui_managers_add(ext->data, manager_arr, nb_managers);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
@ -65,18 +65,10 @@ _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);
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ _create_arrow(Evas *e)
|
|||
|
||||
vg = evas_object_vg_add(e);
|
||||
|
||||
cont = evas_vg_container_add(vg);
|
||||
cont = evas_vg_container_add(NULL);
|
||||
|
||||
tail = evas_vg_shape_add(cont);
|
||||
evas_vg_node_color_set(tail, 0, 0, 0, 255);
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
set(CMAKE_BUILD_TYPE Debug)
|
||||
|
||||
add_definitions(${CLI_COMMON_DEFINITIONS} -DEFL_EO_API_SUPPORT)
|
||||
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(-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}
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#ifndef ELM_INTERNAL_API_ARGESFSDFEFC
|
||||
#define ELM_INTERNAL_API_ARGESFSDFEFC
|
||||
#endif
|
||||
#include <Efl_Ui.h>
|
||||
#include <Elementary.h>
|
||||
#include "gui.h"
|
||||
|
||||
|
@ -62,7 +61,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_entity_visible_set(box, EINA_TRUE);
|
||||
efl_gfx_visible_set(box, EINA_TRUE);
|
||||
efl_event_callback_add(box, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
|
||||
|
||||
tb = elm_toolbar_add(__main_parent);
|
||||
|
@ -71,7 +70,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_entity_visible_set(tb, EINA_TRUE);
|
||||
efl_gfx_visible_set(tb, EINA_TRUE);
|
||||
|
||||
pub_widgets->reload_button = elm_toolbar_item_append(tb, "view-refresh", "Reload", reload_perform, NULL);
|
||||
|
||||
|
@ -107,8 +106,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_entity_size_set(panes, EINA_SIZE2D(75, 75));
|
||||
efl_gfx_entity_visible_set(panes, EINA_TRUE);
|
||||
efl_gfx_size_set(panes, EINA_SIZE2D(75, 75));
|
||||
efl_gfx_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);
|
||||
|
@ -116,11 +115,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_entity_visible_set(object_infos_list, EINA_TRUE);
|
||||
efl_gfx_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_entity_visible_set(objects_list, EINA_TRUE);
|
||||
efl_gfx_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);
|
||||
|
||||
|
@ -135,16 +134,16 @@ gui_take_screenshot_button_create(Eo *__main_parent)
|
|||
Eo *bt;
|
||||
Eo *elm_icon1;
|
||||
|
||||
bt = elm_button_add(__main_parent);
|
||||
bt = efl_add(EFL_UI_BUTTON_CLASS, __main_parent);
|
||||
pub_widgets->bt = bt;
|
||||
evas_object_size_hint_weight_set(bt, 1.000000, 1.000000);
|
||||
evas_object_show(bt);
|
||||
efl_event_callback_add(bt, EFL_INPUT_EVENT_CLICKED, take_screenshot_button_clicked, NULL);
|
||||
efl_gfx_visible_set(bt, EINA_TRUE);
|
||||
efl_event_callback_add(bt, EFL_UI_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_entity_visible_set(elm_icon1, EINA_TRUE);
|
||||
efl_file_set(elm_icon1, TAKE_SCREENSHOT_ICON);
|
||||
efl_gfx_visible_set(elm_icon1, EINA_TRUE);
|
||||
efl_file_set(elm_icon1, TAKE_SCREENSHOT_ICON, NULL);
|
||||
elm_object_part_content_set(bt, "icon", elm_icon1);
|
||||
efl_event_callback_add(bt, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
|
||||
|
||||
|
@ -159,18 +158,18 @@ gui_show_screenshot_button_create(Eo *__main_parent)
|
|||
Eo *bt;
|
||||
Eo *elm_icon1;
|
||||
|
||||
bt = elm_button_add(__main_parent);
|
||||
bt = efl_add(EFL_UI_BUTTON_CLASS, __main_parent);
|
||||
pub_widgets->bt = bt;
|
||||
evas_object_size_hint_weight_set(bt, 1.000000, 1.000000);
|
||||
evas_object_show(bt);
|
||||
evas_object_resize(bt, 73, 30);
|
||||
efl_event_callback_add(bt, EFL_INPUT_EVENT_CLICKED, show_screenshot_button_clicked, NULL);
|
||||
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);
|
||||
|
||||
elm_icon1 = elm_icon_add(bt);
|
||||
evas_object_size_hint_weight_set(elm_icon1, 1.000000, 1.000000);
|
||||
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);
|
||||
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);
|
||||
elm_object_part_content_set(bt, "icon", elm_icon1);
|
||||
efl_event_callback_add(bt, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
|
||||
|
||||
|
@ -188,15 +187,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_entity_size_set(win, EINA_SIZE2D(300, 300));
|
||||
efl_gfx_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_entity_visible_set(bg, EINA_TRUE);
|
||||
efl_gfx_visible_set(bg, EINA_TRUE);
|
||||
elm_win_resize_object_add(win, bg);
|
||||
efl_gfx_entity_visible_set(win, EINA_TRUE);
|
||||
efl_gfx_visible_set(win, EINA_TRUE);
|
||||
efl_event_callback_add(win, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
|
||||
|
||||
return pub_widgets;
|
||||
|
|
|
@ -99,7 +99,6 @@ 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);
|
||||
|
||||
|
@ -109,7 +108,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, &_snapshot_started_cb},
|
||||
{"Clouseau/Object_Introspection/snapshot_start",&_snapshot_do_op, NULL},
|
||||
{"Clouseau/Object_Introspection/snapshot_done", &_snapshot_done_op, &_snapshot_done_cb},
|
||||
{NULL, NULL, NULL}
|
||||
);
|
||||
|
@ -203,6 +202,7 @@ _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);
|
||||
_obj_highlight(ext, v->value.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);
|
||||
_obj_highlight(ext, v->value.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_name_get(param_eolian_type));
|
||||
eina_strbuf_append_printf(buf, "%s", eolian_type_full_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_name_get(base));
|
||||
eina_strbuf_append_printf(buf, "%s *", eolian_type_full_name_get(base));
|
||||
}
|
||||
else if (eolian_type_type_get(base) == EOLIAN_TYPE_VOID)
|
||||
{
|
||||
|
@ -464,81 +464,71 @@ _eolian_value_to_string(Eolian_Debug_Value *value, Eina_Strbuf *buf)
|
|||
case EOLIAN_DEBUG_STRING:
|
||||
{
|
||||
eina_strbuf_append_printf(buf, "\"%s\" ",
|
||||
(char *)value->value);
|
||||
(char *)value->value.value);
|
||||
break;
|
||||
}
|
||||
case EOLIAN_DEBUG_POINTER:
|
||||
{
|
||||
eina_strbuf_append_printf(buf, "%p ",
|
||||
(void *)value->value);
|
||||
(void *)value->value.value);
|
||||
break;
|
||||
}
|
||||
case EOLIAN_DEBUG_CHAR:
|
||||
{
|
||||
eina_strbuf_append_printf(buf, "%c ",
|
||||
(char)value->value);
|
||||
(char)value->value.value);
|
||||
break;
|
||||
}
|
||||
case EOLIAN_DEBUG_INT:
|
||||
{
|
||||
eina_strbuf_append_printf(buf, "%d ",
|
||||
(int)value->value);
|
||||
(int)value->value.value);
|
||||
break;
|
||||
}
|
||||
case EOLIAN_DEBUG_SHORT:
|
||||
{
|
||||
eina_strbuf_append_printf(buf, "%u ",
|
||||
(unsigned int)value->value);
|
||||
(unsigned int)value->value.value);
|
||||
break;
|
||||
}
|
||||
case EOLIAN_DEBUG_DOUBLE:
|
||||
{
|
||||
eina_strbuf_append_printf(buf, "%f ",
|
||||
(double)value->value);
|
||||
(double)value->value.value);
|
||||
break;
|
||||
}
|
||||
case EOLIAN_DEBUG_BOOLEAN:
|
||||
{
|
||||
eina_strbuf_append_printf(buf, "%s ",
|
||||
(value->value ? "true" : "false"));
|
||||
(value->value.value ? "true" : "false"));
|
||||
break;
|
||||
}
|
||||
case EOLIAN_DEBUG_LONG:
|
||||
{
|
||||
eina_strbuf_append_printf(buf, "%ld ",
|
||||
(long)value->value);
|
||||
(long)value->value.value);
|
||||
break;
|
||||
}
|
||||
case EOLIAN_DEBUG_UINT:
|
||||
{
|
||||
eina_strbuf_append_printf(buf, "%u ",
|
||||
(unsigned int)value->value);
|
||||
(unsigned int)value->value.value);
|
||||
break;
|
||||
}
|
||||
case EOLIAN_DEBUG_LIST:
|
||||
{
|
||||
Eina_List *l = value->complex_type_values, *itr;
|
||||
eina_strbuf_append_printf(buf, "%lX [", value->value);
|
||||
eina_strbuf_append_printf(buf, "%lX [", value->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;
|
||||
}
|
||||
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);
|
||||
default: eina_strbuf_append_printf(buf, "%lX ", value->value.value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -594,7 +584,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_name_get(kl->ekl));
|
||||
return strdup(eolian_class_full_name_get(kl->ekl));
|
||||
}
|
||||
|
||||
static char *
|
||||
|
@ -821,10 +811,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_entity_position_get(bt);
|
||||
bt_size = efl_gfx_entity_size_get(bt);
|
||||
bt_pos = efl_gfx_position_get(bt);
|
||||
bt_size = efl_gfx_size_get(bt);
|
||||
elm_menu_move(info->screenshots_menu, bt_pos.x, bt_pos.y + bt_size.w);
|
||||
efl_gfx_entity_visible_set(info->screenshots_menu, EINA_TRUE);
|
||||
efl_gfx_visible_set(info->screenshots_menu, EINA_TRUE);
|
||||
EINA_LIST_FOREACH(info->screenshots, itr, s)
|
||||
{
|
||||
char str[200];
|
||||
|
@ -836,15 +826,6 @@ 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)
|
||||
|
@ -910,7 +891,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, "Efl.Ui.Win_Legacy");
|
||||
Class_Info *kl_info = eina_hash_find(inst->classes_hash_by_name, "Evas.Canvas");
|
||||
if (kl_info) canvas_id = kl_info->id;
|
||||
}
|
||||
if (info->kl_id == canvas_id && !strcmp(part, "elm.swallow.end"))
|
||||
|
@ -918,7 +899,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_entity_visible_set(box, EINA_TRUE);
|
||||
efl_gfx_visible_set(box, EINA_TRUE);
|
||||
|
||||
if (info->screenshots)
|
||||
{
|
||||
|
|
|
@ -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}")
|
||||
|
||||
|
|
Loading…
Reference in New Issue