Introduce the extensions feature
The objects introspection, that has always been as a core part, is now an extension, and can be not used. The directories structure allows other extensions to be developed inside the Clouseau tree, even if they can be developed outside. Other extensions will be added and the extensions feature will be adapted to fit all their requirements.
This commit is contained in:
parent
88420d78d4
commit
9fc5c432bf
|
@ -2,23 +2,20 @@ set(CMAKE_BUILD_TYPE Debug)
|
|||
|
||||
LIST(APPEND SOURCES clouseau_client.c gui.c)
|
||||
|
||||
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}" -DGUI_IMAGES_PATH="${CMAKE_HOME_DIRECTORY}/data/images")
|
||||
add_definitions(-DEFL_EO_API_SUPPORT -DGUI_IMAGES_PATH="${CMAKE_HOME_DIRECTORY}/data/images")
|
||||
add_definitions(-DINSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
link_directories (${PC_LIBELEMENTARY_LIBRARY_DIRS})
|
||||
|
||||
include_directories(
|
||||
${CMAKE_SOURCE_DIR}/src/lib
|
||||
${ELEMENTARY_INCLUDE_DIRS}
|
||||
${EINA_INCLUDE_DIRS}
|
||||
${EET_INCLUDE_DIRS}
|
||||
${EFREET_INCLUDE_DIRS}
|
||||
${EO_INCLUDE_DIRS}
|
||||
${EOLIAN_INCLUDE_DIRS}
|
||||
${ECORE_INCLUDE_DIRS}
|
||||
${EVAS_INCLUDE_DIRS}
|
||||
${EDEBUG_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(EOLIAN_INCLUDE_FLAG -I \"${EOLIAN_EO_DIR}/eo-1\" -I${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
@ -33,10 +30,8 @@ target_link_libraries(clouseau_client
|
|||
${EET_LIBRARIES}
|
||||
${EFREET_LIBRARIES}
|
||||
${EO_LIBRARIES}
|
||||
${EOLIAN_LIBRARIES}
|
||||
${ECORE_LIBRARIES}
|
||||
${EVAS_LIBRARIES}
|
||||
${EDEBUG_LIBRARIES}
|
||||
ecore_file
|
||||
)
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
261
src/bin/gui.c
261
src/bin/gui.c
|
@ -14,44 +14,10 @@
|
|||
#include "elm_interface_fileselector.h"
|
||||
#include "gui.h"
|
||||
|
||||
static const char* objs_types_strings[] =
|
||||
{
|
||||
"Show all canvas objects",
|
||||
"Only show Elementary widgets",
|
||||
NULL
|
||||
};
|
||||
|
||||
static Gui_Widgets g_pub_widgets;
|
||||
|
||||
extern void gui_new_profile_win_create_done(Gui_New_Profile_Win_Widgets *wdgs);
|
||||
|
||||
#ifdef GUI_IMAGES_PATH
|
||||
const char *SHOW_SCREENSHOT_ICON = GUI_IMAGES_PATH"/show-screenshot.png";
|
||||
const char *TAKE_SCREENSHOT_ICON = GUI_IMAGES_PATH"/take-screenshot.png";
|
||||
#else
|
||||
#error "Please define GUI_IMAGES_PATH"
|
||||
#endif
|
||||
|
||||
extern void
|
||||
screenshot_req_cb(void *data, const Efl_Event *event);
|
||||
extern void
|
||||
conn_menu_show(void *data, Evas_Object *obj, void *event_info);
|
||||
extern void
|
||||
reload_perform(void *data, Evas_Object *obj, void *event_info);
|
||||
extern void
|
||||
save_load_perform(void *data, Evas_Object *obj, void *event_info);
|
||||
extern void
|
||||
jump_entry_changed(void *data, const Efl_Event *event);
|
||||
extern void
|
||||
take_screenshot_button_clicked(void *data, const Efl_Event *event);
|
||||
extern void
|
||||
show_screenshot_button_clicked(void *data, const Efl_Event *event);
|
||||
extern void
|
||||
snapshot_do(void *data, Evas_Object *fs, void *event_info);
|
||||
extern void
|
||||
objs_type_changed(void *data, Evas_Object *obj, void *event_info);
|
||||
extern void
|
||||
highlight_changed(void *data, Evas_Object *obj, void *event_info);
|
||||
|
||||
static void
|
||||
_pubs_free_cb(void *data, const Efl_Event *event EINA_UNUSED)
|
||||
|
@ -59,121 +25,61 @@ _pubs_free_cb(void *data, const Efl_Event *event EINA_UNUSED)
|
|||
free(data);
|
||||
}
|
||||
|
||||
static void
|
||||
_jump_to_ptr_inwin_show(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
elm_win_inwin_activate(data);
|
||||
}
|
||||
|
||||
Gui_Main_Win_Widgets *
|
||||
gui_main_win_create(Eo *__main_parent)
|
||||
{
|
||||
Gui_Main_Win_Widgets *pub_widgets = calloc(1, sizeof(*pub_widgets));
|
||||
|
||||
Eo *main_win;
|
||||
Eo *elm_bg1;
|
||||
Eo *elm_box1;
|
||||
Eo *bg;
|
||||
Eo *main_box, *ext_box;
|
||||
Eo *tb;
|
||||
Eo *conn_selector;
|
||||
Eo *jump2ptr_inwin;
|
||||
Eo *jump_to_entry;
|
||||
Eo *ext_selector;
|
||||
Eo *freeze_pulse;
|
||||
Eo *freeze_inwin;
|
||||
Eo *elm_panes1;
|
||||
Eo *object_infos_list;
|
||||
Eo *objects_list;
|
||||
|
||||
main_win = elm_win_add(__main_parent, "Window", ELM_WIN_BASIC);
|
||||
pub_widgets->main_win = main_win;
|
||||
elm_win_autodel_set(main_win, EINA_TRUE);
|
||||
evas_object_size_hint_weight_set(main_win, 1.000000, 1.000000);
|
||||
efl_gfx_size_set(main_win, 478, 484);
|
||||
elm_bg1 = efl_add(ELM_BG_CLASS, main_win);
|
||||
evas_object_size_hint_weight_set(elm_bg1, 1.000000, 1.000000);
|
||||
efl_gfx_visible_set(elm_bg1, EINA_TRUE);
|
||||
efl_gfx_position_set(elm_bg1, 0, 0);
|
||||
|
||||
elm_box1 = elm_box_add(main_win);
|
||||
evas_object_size_hint_weight_set(elm_box1, 1.000000, 1.000000);
|
||||
efl_gfx_visible_set(elm_box1, EINA_TRUE);
|
||||
efl_gfx_size_set(elm_box1, 643, 598);
|
||||
efl_gfx_position_set(elm_box1, -7, -2);
|
||||
elm_box_padding_set(elm_box1, 0, 0);
|
||||
elm_box_align_set(elm_box1, 0.000000, 0.000000);
|
||||
elm_win_resize_object_add(main_win, elm_bg1);
|
||||
elm_win_resize_object_add(main_win, elm_box1);
|
||||
bg = efl_add(ELM_BG_CLASS, 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, 0, 0);
|
||||
elm_win_resize_object_add(main_win, bg);
|
||||
|
||||
tb = elm_toolbar_add(elm_box1);
|
||||
pub_widgets->tb = tb;
|
||||
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);
|
||||
elm_win_resize_object_add(main_win, main_box);
|
||||
|
||||
tb = elm_toolbar_add(main_win);
|
||||
elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_MENU);
|
||||
evas_object_size_hint_weight_set(tb, 0, 0);
|
||||
evas_object_size_hint_align_set(tb, -1, 0);
|
||||
elm_toolbar_menu_parent_set(tb, main_win);
|
||||
evas_object_size_hint_weight_set(tb, 1.000000, 0.000000);
|
||||
evas_object_size_hint_align_set(tb, -1.00000, 0);
|
||||
efl_gfx_visible_set(tb, EINA_TRUE);
|
||||
|
||||
conn_selector = elm_toolbar_item_append(tb, "call-start", "Connection", conn_menu_show, NULL);
|
||||
pub_widgets->conn_selector = conn_selector;
|
||||
elm_toolbar_item_menu_set(conn_selector, EINA_TRUE);
|
||||
elm_toolbar_item_priority_set(conn_selector, -9999);
|
||||
pub_widgets->conn_selector = elm_toolbar_item_append(tb, "call-start", "Connection", conn_menu_show, NULL);
|
||||
elm_toolbar_item_menu_set(pub_widgets->conn_selector, EINA_TRUE);
|
||||
|
||||
pub_widgets->conn_selector_menu = elm_toolbar_item_menu_get(conn_selector);
|
||||
|
||||
pub_widgets->reload_button = elm_toolbar_item_append(tb, "view-refresh", "Reload", reload_perform, NULL);
|
||||
pub_widgets->conn_selector_menu = elm_toolbar_item_menu_get(pub_widgets->conn_selector);
|
||||
|
||||
pub_widgets->apps_selector = elm_toolbar_item_append(tb, "view-list-details", "Select App", NULL, NULL);
|
||||
elm_toolbar_item_menu_set(pub_widgets->apps_selector, EINA_TRUE);
|
||||
elm_toolbar_item_priority_set(pub_widgets->apps_selector, -9999);
|
||||
|
||||
pub_widgets->apps_selector_menu = elm_toolbar_item_menu_get(pub_widgets->apps_selector);
|
||||
|
||||
jump2ptr_inwin = elm_win_inwin_add(main_win);
|
||||
jump_to_entry = elm_entry_add(jump2ptr_inwin);
|
||||
elm_entry_scrollable_set(jump_to_entry, EINA_TRUE);
|
||||
elm_entry_single_line_set(jump_to_entry, EINA_TRUE);
|
||||
elm_object_part_text_set(jump_to_entry, "guide", "Jump To Pointer");
|
||||
efl_event_callback_add(jump_to_entry, ELM_ENTRY_EVENT_ACTIVATED, jump_entry_changed, jump2ptr_inwin);
|
||||
evas_object_show(jump_to_entry);
|
||||
elm_win_inwin_content_set(jump2ptr_inwin, jump_to_entry);
|
||||
ext_selector = elm_toolbar_item_append(tb, "system-reboot", "Extensions", NULL, NULL);
|
||||
elm_toolbar_item_menu_set(ext_selector, EINA_TRUE);
|
||||
|
||||
elm_toolbar_item_append(tb, "edit-find", "Jump To Pointer", _jump_to_ptr_inwin_show, jump2ptr_inwin);
|
||||
pub_widgets->ext_selector_menu = elm_toolbar_item_menu_get(ext_selector);
|
||||
|
||||
/*
|
||||
extensions_bt = elm_button_add(tb);
|
||||
evas_object_size_hint_weight_set(extensions_bt, 1.000000, 1.000000);
|
||||
evas_object_size_hint_align_set(extensions_bt, -1.00000, -1.000000);
|
||||
efl_gfx_visible_set(extensions_bt, EINA_TRUE);
|
||||
elm_obj_widget_part_text_set(extensions_bt, NULL, "Extensions");
|
||||
elm_box_pack_end(tb, extensions_bt);
|
||||
*/
|
||||
Eo *settings_it = elm_toolbar_item_append(tb, "system-run", "Settings", NULL, NULL);
|
||||
elm_toolbar_item_menu_set(settings_it, EINA_TRUE);
|
||||
|
||||
{
|
||||
int i;
|
||||
Eo *settings_it = elm_toolbar_item_append(tb, "system-run", "Settings", NULL, NULL);
|
||||
elm_toolbar_item_menu_set(settings_it, EINA_TRUE);
|
||||
elm_toolbar_item_priority_set(settings_it, -9999);
|
||||
|
||||
Eo *settings_menu = elm_toolbar_item_menu_get(settings_it);
|
||||
Eo *objs_type_it = elm_menu_item_add(settings_menu, NULL, NULL,
|
||||
"Objects types display", NULL, NULL);
|
||||
while (objs_types_strings[i])
|
||||
{
|
||||
Eo *it = elm_menu_item_add(settings_menu, objs_type_it, NULL,
|
||||
objs_types_strings[i], objs_type_changed, (void *)(uintptr_t)i);
|
||||
Eo *rd = elm_radio_add(settings_menu);
|
||||
elm_radio_state_value_set(rd, i);
|
||||
if (!i) pub_widgets->objs_type_radio = rd;
|
||||
else elm_radio_group_add(rd, pub_widgets->objs_type_radio);
|
||||
elm_object_item_content_set(it, rd);
|
||||
i++;
|
||||
}
|
||||
Eo *highlight_it = elm_menu_item_add(settings_menu, NULL, NULL,
|
||||
"Hightlight", highlight_changed, NULL);
|
||||
Eo *ck = elm_check_add(settings_menu);
|
||||
elm_object_item_content_set(highlight_it, ck);
|
||||
pub_widgets->highlight_ck = ck;
|
||||
}
|
||||
|
||||
pub_widgets->save_load_bt = elm_toolbar_item_append(tb, "document-export", "Save", save_load_perform, NULL);
|
||||
elm_box_pack_end(main_box, tb);
|
||||
efl_gfx_visible_set(tb, EINA_TRUE);
|
||||
|
||||
freeze_pulse = elm_progressbar_add(main_win);
|
||||
pub_widgets->freeze_pulse = freeze_pulse;
|
||||
|
@ -185,29 +91,17 @@ gui_main_win_create(Eo *__main_parent)
|
|||
evas_object_size_hint_weight_set(freeze_pulse, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_win_resize_object_add(main_win, freeze_pulse);
|
||||
|
||||
ext_box = elm_box_add(main_box);
|
||||
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);
|
||||
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");
|
||||
|
||||
elm_panes1 = efl_add(ELM_PANES_CLASS, elm_box1);
|
||||
elm_obj_panes_content_right_size_set(elm_panes1, 0.600000);
|
||||
evas_object_size_hint_weight_set(elm_panes1, 1.000000, 1.000000);
|
||||
efl_gfx_size_set(elm_panes1, 75, 75);
|
||||
efl_gfx_visible_set(elm_panes1, EINA_TRUE);
|
||||
evas_object_size_hint_weight_set(elm_panes1, 1.000000, 1.000000);
|
||||
evas_object_size_hint_align_set(elm_panes1, -1.000000, -1.000000);
|
||||
elm_box_pack_end(elm_box1, tb);
|
||||
elm_box_pack_end(elm_box1, elm_panes1);
|
||||
object_infos_list = elm_genlist_add(elm_panes1);
|
||||
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);
|
||||
objects_list = efl_add(ELM_GENLIST_CLASS, elm_panes1);
|
||||
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);
|
||||
elm_object_part_content_set(elm_panes1, "left", objects_list);
|
||||
elm_object_part_content_set(elm_panes1, "right", object_infos_list);
|
||||
efl_gfx_visible_set(main_win, EINA_TRUE);
|
||||
efl_event_callback_add(main_win, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
|
||||
|
||||
|
@ -306,92 +200,3 @@ gui_new_profile_win_create(Eo *__main_parent)
|
|||
return pub_widgets;
|
||||
}
|
||||
|
||||
|
||||
Gui_Take_Screenshot_Button_Widgets *
|
||||
gui_take_screenshot_button_create(Eo *__main_parent)
|
||||
{
|
||||
Gui_Take_Screenshot_Button_Widgets *pub_widgets = calloc(1, sizeof(*pub_widgets));
|
||||
|
||||
Eo *bt;
|
||||
Eo *elm_icon1;
|
||||
|
||||
bt = efl_add(ELM_BUTTON_CLASS, __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, 73, 30);
|
||||
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_visible_set(elm_icon1, EINA_TRUE);
|
||||
efl_gfx_size_set(elm_icon1, 40, 40);
|
||||
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);
|
||||
|
||||
return pub_widgets;
|
||||
}
|
||||
|
||||
Gui_Show_Screenshot_Button_Widgets *
|
||||
gui_show_screenshot_button_create(Eo *__main_parent)
|
||||
{
|
||||
Gui_Show_Screenshot_Button_Widgets *pub_widgets = calloc(1, sizeof(*pub_widgets));
|
||||
|
||||
Eo *bt;
|
||||
Eo *elm_icon1;
|
||||
|
||||
bt = efl_add(ELM_BUTTON_CLASS, __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, 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_visible_set(elm_icon1, EINA_TRUE);
|
||||
efl_gfx_size_set(elm_icon1, 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);
|
||||
|
||||
return pub_widgets;
|
||||
}
|
||||
|
||||
Gui_Show_Screenshot_Win_Widgets *
|
||||
gui_show_screenshot_win_create(Eo *__main_parent)
|
||||
{
|
||||
Gui_Show_Screenshot_Win_Widgets *pub_widgets = calloc(1, sizeof(*pub_widgets));
|
||||
|
||||
Eo *win;
|
||||
Eo *bg;
|
||||
|
||||
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, 300, 300);
|
||||
evas_object_size_hint_weight_set(win, 1.000000, 1.000000);
|
||||
elm_win_title_set(win, "Screenshot");
|
||||
elm_win_modal_set(win, EINA_TRUE);
|
||||
bg = efl_add(ELM_BG_CLASS, win);
|
||||
pub_widgets->bg = bg;
|
||||
evas_object_size_hint_weight_set(bg, 1.000000, 1.000000);
|
||||
efl_gfx_visible_set(bg, EINA_TRUE);
|
||||
elm_win_resize_object_add(win, bg);
|
||||
efl_gfx_visible_set(win, EINA_TRUE);
|
||||
efl_event_callback_add(win, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
|
||||
|
||||
return pub_widgets;
|
||||
}
|
||||
|
||||
Gui_Widgets *gui_gui_get()
|
||||
{
|
||||
static Eina_Bool initialized = EINA_FALSE;
|
||||
if (!initialized)
|
||||
{
|
||||
g_pub_widgets.main_win = gui_main_win_create(NULL);
|
||||
initialized = EINA_TRUE;
|
||||
}
|
||||
return &g_pub_widgets;
|
||||
}
|
||||
|
|
|
@ -6,17 +6,12 @@
|
|||
typedef struct
|
||||
{
|
||||
Eo *main_win;
|
||||
Eo *tb;
|
||||
Eo *ext_box;
|
||||
Eo *conn_selector;
|
||||
Eo *conn_selector_menu;
|
||||
Eo *reload_button;
|
||||
Eo *apps_selector;
|
||||
Eo *apps_selector_menu;
|
||||
Eo *objs_type_radio;
|
||||
Eo *highlight_ck;
|
||||
Eo *save_load_bt;
|
||||
Eo *object_infos_list;
|
||||
Eo *objects_list;
|
||||
Eo *ext_selector_menu;
|
||||
Eo *freeze_pulse;
|
||||
Eo *freeze_inwin;
|
||||
} Gui_Main_Win_Widgets;
|
||||
|
@ -30,34 +25,8 @@ typedef struct
|
|||
Eo *command_entry;
|
||||
} Gui_New_Profile_Win_Widgets;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Eo *bt;
|
||||
} Gui_Take_Screenshot_Button_Widgets;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Eo *bt;
|
||||
} Gui_Show_Screenshot_Button_Widgets;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Eo *win;
|
||||
Eo *bg;
|
||||
} Gui_Show_Screenshot_Win_Widgets;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Gui_Main_Win_Widgets *main_win;
|
||||
} Gui_Widgets;
|
||||
|
||||
Gui_Main_Win_Widgets *gui_main_win_create(Eo *parent);
|
||||
|
||||
Gui_New_Profile_Win_Widgets *gui_new_profile_win_create(Eo *parent);
|
||||
|
||||
Gui_Take_Screenshot_Button_Widgets *gui_take_screenshot_button_create(Eo *parent);
|
||||
Gui_Show_Screenshot_Button_Widgets *gui_show_screenshot_button_create(Eo *parent);
|
||||
Gui_Show_Screenshot_Win_Widgets *gui_show_screenshot_win_create(Eo *parent);
|
||||
|
||||
Gui_Widgets *gui_gui_get();
|
||||
#endif
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
set(CMAKE_BUILD_TYPE Debug)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
include_directories(
|
||||
${EINA_INCLUDE_DIRS}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${EO_INCLUDE_DIRS}
|
||||
${EINA_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
add_library(clouseau_debug SHARED clouseau_debug.c)
|
||||
|
@ -13,4 +13,8 @@ target_link_libraries(clouseau_debug
|
|||
${EO_LIBRARIES}
|
||||
)
|
||||
|
||||
INSTALL(FILES Clouseau.h DESTINATION include)
|
||||
|
||||
INSTALL(TARGETS clouseau_debug LIBRARY DESTINATION lib)
|
||||
|
||||
add_subdirectory(extensions)
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
#ifndef _CLOUSEAU_H
|
||||
#define _CLOUSEAU_H
|
||||
|
||||
#ifdef EAPI
|
||||
# undef EAPI
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# ifdef DEBUG_BUILD
|
||||
# ifdef DLL_EXPORT
|
||||
# define EAPI __declspec(dllexport)
|
||||
# else
|
||||
# define EAPI
|
||||
# endif /* ! DLL_EXPORT */
|
||||
# else
|
||||
# define EAPI __declspec(dllimport)
|
||||
# endif /* ! DEBUG_BUILD */
|
||||
#else
|
||||
# ifdef __GNUC__
|
||||
# if __GNUC__ >= 4
|
||||
# define EAPI __attribute__ ((visibility("default")))
|
||||
# else
|
||||
# define EAPI
|
||||
# endif
|
||||
# else
|
||||
# define EAPI
|
||||
# endif
|
||||
#endif /* ! _WIN32 */
|
||||
|
||||
#include <Eina.h>
|
||||
|
||||
typedef struct _Extension_Config Extension_Config;
|
||||
typedef struct _Clouseau_Extension Clouseau_Extension;
|
||||
|
||||
typedef Eo *(*Ui_Get_Cb)(Clouseau_Extension *ext, Eo *parent);
|
||||
typedef void (*Session_Changed_Cb)(Clouseau_Extension *ext);
|
||||
typedef void (*App_Changed_Cb)(Clouseau_Extension *ext);
|
||||
|
||||
typedef Eo *(*Inwin_Create_Cb)();
|
||||
typedef void (*Ui_Freeze_Cb)(Clouseau_Extension *ext, Eina_Bool freeze);
|
||||
|
||||
struct _Clouseau_Extension
|
||||
{
|
||||
const char *name; /* Name filled by the extension */
|
||||
Eina_Debug_Session *session; /* Current session */
|
||||
int app_id; /* Current application */
|
||||
Eina_Stringshare *path_to_config; /* Path to configuration directory */
|
||||
Eo *ui_object; /* Main object of the UI extension */
|
||||
Session_Changed_Cb session_changed_cb; /* Function called when the session changed */
|
||||
App_Changed_Cb app_changed_cb; /* Function called when the app changed */
|
||||
Inwin_Create_Cb inwin_create_cb; /* Function to call to create a Inwin */
|
||||
Ui_Freeze_Cb ui_freeze_cb; /* Function to call to freeze/thaw the UI */
|
||||
void *data; /* Data allocated and managed by the extension */
|
||||
Extension_Config *ext_cfg; /* Extention configuration - used by Clouseau */
|
||||
};
|
||||
|
||||
#endif
|
|
@ -133,7 +133,7 @@ clouseau_debug_init(void)
|
|||
{
|
||||
eina_init();
|
||||
|
||||
eina_debug_opcodes_register(NULL, _debug_ops, NULL);
|
||||
eina_debug_opcodes_register(NULL, _debug_ops, NULL, NULL);
|
||||
|
||||
printf("%s - In\n", __FUNCTION__);
|
||||
return EINA_TRUE;
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
add_subdirectory(objects_introspection)
|
|
@ -0,0 +1,37 @@
|
|||
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(-DEFL_EO_API_SUPPORT -DGUI_IMAGES_PATH="${CMAKE_HOME_DIRECTORY}/data/images")
|
||||
|
||||
set(EOLIAN_INCLUDE_FLAG -I \"${EOLIAN_EO_DIR}/eo-1\" -I${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${ELEMENTARY_INCLUDE_DIRS}
|
||||
${EVAS_INCLUDE_DIRS}
|
||||
${EO_INCLUDE_DIRS}
|
||||
${EINA_INCLUDE_DIRS}
|
||||
${EET_INCLUDE_DIRS}
|
||||
${EOLIAN_INCLUDE_DIRS}
|
||||
${EDEBUG_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
link_directories (${PC_LIBELEMENTARY_LIBRARY_DIRS})
|
||||
|
||||
add_library(clouseau_objects_introspection SHARED main.c gui.c)
|
||||
|
||||
target_link_libraries(clouseau_objects_introspection
|
||||
${ELEMENTARY_LIBRARIES}
|
||||
${EVAS_LIBRARIES}
|
||||
${EO_LIBRARIES}
|
||||
${EINA_LIBRARIES}
|
||||
${EET_LIBRARIES}
|
||||
${EOLIAN_LIBRARIES}
|
||||
${EDEBUG_LIBRARIES}
|
||||
)
|
||||
|
||||
INSTALL(TARGETS clouseau_objects_introspection LIBRARY DESTINATION lib)
|
|
@ -0,0 +1,210 @@
|
|||
#ifndef EFL_BETA_API_SUPPORT
|
||||
#define EFL_BETA_API_SUPPORT
|
||||
#endif
|
||||
#ifndef EFL_EO_API_SUPPORT
|
||||
#define EFL_EO_API_SUPPORT
|
||||
#endif
|
||||
#ifndef ELM_INTERNAL_API_ARGESFSDFEFC
|
||||
#define ELM_INTERNAL_API_ARGESFSDFEFC
|
||||
#endif
|
||||
#include <Elementary.h>
|
||||
#include <elm_fileselector_button.eo.h>
|
||||
#include "elm_widget_container.h"
|
||||
#include "elm_interface_scrollable.h"
|
||||
#include "elm_interface_fileselector.h"
|
||||
#include "gui.h"
|
||||
|
||||
static const char* objs_types_strings[] =
|
||||
{
|
||||
"Show all canvas objects",
|
||||
"Only show Elementary widgets",
|
||||
NULL
|
||||
};
|
||||
|
||||
#ifdef GUI_IMAGES_PATH
|
||||
const char *SHOW_SCREENSHOT_ICON = GUI_IMAGES_PATH"/show-screenshot.png";
|
||||
const char *TAKE_SCREENSHOT_ICON = GUI_IMAGES_PATH"/take-screenshot.png";
|
||||
#else
|
||||
#error "Please define GUI_IMAGES_PATH"
|
||||
#endif
|
||||
|
||||
extern void
|
||||
screenshot_req_cb(void *data, const Efl_Event *event);
|
||||
extern void
|
||||
reload_perform(void *data, Evas_Object *obj, void *event_info);
|
||||
extern void
|
||||
save_load_perform(void *data, Evas_Object *obj, void *event_info);
|
||||
extern void
|
||||
take_screenshot_button_clicked(void *data, const Efl_Event *event);
|
||||
extern void
|
||||
show_screenshot_button_clicked(void *data, const Efl_Event *event);
|
||||
extern void
|
||||
snapshot_do(void *data, Evas_Object *fs, void *event_info);
|
||||
extern void
|
||||
objs_type_changed(void *data, Evas_Object *obj, void *event_info);
|
||||
extern void
|
||||
highlight_changed(void *data, Evas_Object *obj, void *event_info);
|
||||
extern void
|
||||
jump_to_ptr_inwin_show(void *data, Evas_Object *obj, void *event_info);
|
||||
|
||||
static void
|
||||
_pubs_free_cb(void *data, const Efl_Event *event EINA_UNUSED)
|
||||
{
|
||||
free(data);
|
||||
}
|
||||
|
||||
Gui_Win_Widgets *
|
||||
gui_win_create(Eo *__main_parent)
|
||||
{
|
||||
Gui_Win_Widgets *pub_widgets = calloc(1, sizeof(*pub_widgets));
|
||||
|
||||
Eo *box, *tb;
|
||||
Eo *panes;
|
||||
Eo *object_infos_list;
|
||||
Eo *objects_list;
|
||||
|
||||
box = elm_box_add(__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_event_callback_add(box, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
|
||||
|
||||
tb = elm_toolbar_add(__main_parent);
|
||||
pub_widgets->tb = tb;
|
||||
elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_MENU);
|
||||
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);
|
||||
|
||||
pub_widgets->reload_button = elm_toolbar_item_append(tb, "view-refresh", "Reload", reload_perform, NULL);
|
||||
|
||||
elm_toolbar_item_append(tb, "edit-find", "Jump To Pointer", jump_to_ptr_inwin_show, NULL);
|
||||
|
||||
{
|
||||
int i = 0;
|
||||
Eo *settings_it = elm_toolbar_item_append(tb, "system-run", "Settings", NULL, NULL);
|
||||
elm_toolbar_item_menu_set(settings_it, EINA_TRUE);
|
||||
|
||||
Eo *settings_menu = elm_toolbar_item_menu_get(settings_it);
|
||||
Eo *objs_type_it = elm_menu_item_add(settings_menu, NULL, NULL,
|
||||
"Objects types display", NULL, NULL);
|
||||
while (objs_types_strings[i])
|
||||
{
|
||||
Eo *it = elm_menu_item_add(settings_menu, objs_type_it, NULL,
|
||||
objs_types_strings[i], objs_type_changed, (void *)(uintptr_t)i);
|
||||
Eo *rd = elm_radio_add(settings_menu);
|
||||
elm_radio_state_value_set(rd, i);
|
||||
if (!i) pub_widgets->objs_type_radio = rd;
|
||||
else elm_radio_group_add(rd, pub_widgets->objs_type_radio);
|
||||
elm_object_item_content_set(it, rd);
|
||||
i++;
|
||||
}
|
||||
Eo *highlight_it = elm_menu_item_add(settings_menu, NULL, NULL,
|
||||
"Hightlight", highlight_changed, NULL);
|
||||
Eo *ck = elm_check_add(settings_menu);
|
||||
elm_object_item_content_set(highlight_it, ck);
|
||||
pub_widgets->highlight_ck = ck;
|
||||
}
|
||||
|
||||
pub_widgets->save_load_bt = elm_toolbar_item_append(tb, "document-export", "Save", save_load_perform, NULL);
|
||||
|
||||
panes = efl_add(ELM_PANES_CLASS, box);
|
||||
elm_obj_panes_content_right_size_set(panes, 0.600000);
|
||||
evas_object_size_hint_weight_set(panes, 1.000000, 1.000000);
|
||||
efl_gfx_size_set(panes, 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);
|
||||
elm_box_pack_end(box, panes);
|
||||
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);
|
||||
objects_list = efl_add(ELM_GENLIST_CLASS, 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);
|
||||
elm_object_part_content_set(panes, "left", objects_list);
|
||||
elm_object_part_content_set(panes, "right", object_infos_list);
|
||||
|
||||
return pub_widgets;
|
||||
}
|
||||
|
||||
Gui_Take_Screenshot_Button_Widgets *
|
||||
gui_take_screenshot_button_create(Eo *__main_parent)
|
||||
{
|
||||
Gui_Take_Screenshot_Button_Widgets *pub_widgets = calloc(1, sizeof(*pub_widgets));
|
||||
|
||||
Eo *bt;
|
||||
Eo *elm_icon1;
|
||||
|
||||
bt = efl_add(ELM_BUTTON_CLASS, __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);
|
||||
|
||||
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);
|
||||
elm_object_part_content_set(bt, "icon", elm_icon1);
|
||||
efl_event_callback_add(bt, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
|
||||
|
||||
return pub_widgets;
|
||||
}
|
||||
|
||||
Gui_Show_Screenshot_Button_Widgets *
|
||||
gui_show_screenshot_button_create(Eo *__main_parent)
|
||||
{
|
||||
Gui_Show_Screenshot_Button_Widgets *pub_widgets = calloc(1, sizeof(*pub_widgets));
|
||||
|
||||
Eo *bt;
|
||||
Eo *elm_icon1;
|
||||
|
||||
bt = efl_add(ELM_BUTTON_CLASS, __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, 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_visible_set(elm_icon1, EINA_TRUE);
|
||||
efl_gfx_size_set(elm_icon1, 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);
|
||||
|
||||
return pub_widgets;
|
||||
}
|
||||
|
||||
Gui_Show_Screenshot_Win_Widgets *
|
||||
gui_show_screenshot_win_create(Eo *__main_parent)
|
||||
{
|
||||
Gui_Show_Screenshot_Win_Widgets *pub_widgets = calloc(1, sizeof(*pub_widgets));
|
||||
|
||||
Eo *win;
|
||||
Eo *bg;
|
||||
|
||||
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, 300, 300);
|
||||
evas_object_size_hint_weight_set(win, 1.000000, 1.000000);
|
||||
elm_win_title_set(win, "Screenshot");
|
||||
elm_win_modal_set(win, EINA_TRUE);
|
||||
bg = efl_add(ELM_BG_CLASS, win);
|
||||
pub_widgets->bg = bg;
|
||||
evas_object_size_hint_weight_set(bg, 1.000000, 1.000000);
|
||||
efl_gfx_visible_set(bg, EINA_TRUE);
|
||||
elm_win_resize_object_add(win, bg);
|
||||
efl_gfx_visible_set(win, EINA_TRUE);
|
||||
efl_event_callback_add(win, EFL_EVENT_DEL, _pubs_free_cb, pub_widgets);
|
||||
|
||||
return pub_widgets;
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
#ifndef _gui_h_
|
||||
#define _gui_h_
|
||||
#include <Eo.h>
|
||||
#include <Elementary.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Eo *main;
|
||||
Eo *tb;
|
||||
Eo *reload_button;
|
||||
Eo *objs_type_radio;
|
||||
Eo *highlight_ck;
|
||||
Eo *save_load_bt;
|
||||
Eo *object_infos_list;
|
||||
Eo *objects_list;
|
||||
} Gui_Win_Widgets;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Eo *bt;
|
||||
} Gui_Take_Screenshot_Button_Widgets;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Eo *bt;
|
||||
} Gui_Show_Screenshot_Button_Widgets;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Eo *win;
|
||||
Eo *bg;
|
||||
} Gui_Show_Screenshot_Win_Widgets;
|
||||
|
||||
Gui_Win_Widgets *gui_win_create(Eo *parent);
|
||||
|
||||
Gui_Take_Screenshot_Button_Widgets *gui_take_screenshot_button_create(Eo *parent);
|
||||
Gui_Show_Screenshot_Button_Widgets *gui_show_screenshot_button_create(Eo *parent);
|
||||
Gui_Show_Screenshot_Win_Widgets *gui_show_screenshot_win_create(Eo *parent);
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue