rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=5b399da74890eb4a59e3e2f31a7fdf634582d11d
commit 5b399da74890eb4a59e3e2f31a7fdf634582d11d Author: Andrii Kroitor <[email protected]> Date: Tue Jul 5 17:46:15 2016 +0300 shortcuts: use shortcut_send API instead of direct signal calls --- src/bin/common/signals.h | 2 +- src/bin/ui/menu.c | 31 ++++++++++++++++--------------- src/bin/ui/shortcuts/shortcuts.c | 3 +++ src/bin/ui/shortcuts/shortcuts.h | 3 +++ src/bin/ui/tabs.c | 8 ++++---- src/bin/ui/workspace/workspace.c | 7 ++++--- 6 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/bin/common/signals.h b/src/bin/common/signals.h index f5c80ad..a0ffe72 100644 --- a/src/bin/common/signals.h +++ b/src/bin/common/signals.h @@ -486,7 +486,7 @@ typedef struct { #define SIGNAL_SHORTCUT_FILL "SIGNAL_SHORTCUT_FILL" #define SIGNAL_SHORTCUT_FIT "SIGNAL_SHORTCUT_FIT" #define SIGNAL_SHORTCUT_OBJECT_AREA "SIGNAL_SHORTCUT_OBJECT_AREA" -#define SIGNAL_SHORTCUT_RULERS_VISIBLED "SIGNAL_SHORTCUT_RULERS_VISIBLED" +#define SIGNAL_SHORTCUT_RULERS_SHOW "SIGNAL_SHORTCUT_RULERS_SHOW" #define SIGNAL_SHORTCUT_CANCEL "SIGNAL_SHORTCUT_POPUP_CANCEL" #define SIGNAL_SHORTCUT_DONE "SIGNAL_SHORTCUT_POPUP_DONE" diff --git a/src/bin/ui/menu.c b/src/bin/ui/menu.c index 3f9622e..c99f0b4 100644 --- a/src/bin/ui/menu.c +++ b/src/bin/ui/menu.c @@ -21,6 +21,7 @@ #include "preference.h" #include "tabs.h" #include "workspace.h" +#include "shortcuts.h" static int _menu_delayed_event = 0; @@ -137,49 +138,49 @@ _menu_cb(void *data __UNUSED__, /* preferences_window_add(ap.project); */ break; case MENU_VIEW_WORKSPACE_ZOOM_IN: - evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_ZOOM_IN, NULL); + shortcuts_shortcut_send(SHORTCUT_TYPE_ZOOM_IN); break; case MENU_VIEW_WORKSPACE_ZOOM_OUT: - evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_ZOOM_OUT, NULL); + shortcuts_shortcut_send(SHORTCUT_TYPE_ZOOM_OUT); break; case MENU_VIEW_WORKSPACE_ZOOM_RESET: - evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_ZOOM_RESET, NULL); + shortcuts_shortcut_send(SHORTCUT_TYPE_ZOOM_RESET); break; case MENU_VIEW_WORKSPACE_FIT: - evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_FIT, NULL); + shortcuts_shortcut_send(SHORTCUT_TYPE_FIT); break; case MENU_VIEW_WORKSPACE_FILL: - evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_FILL, NULL); + shortcuts_shortcut_send(SHORTCUT_TYPE_FILL); break; case MENU_VIEW_RULERS_SHOW: - evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_RULERS_VISIBLED, NULL); + shortcuts_shortcut_send(SHORTCUT_TYPE_RULERS_SHOW); break; case MENU_VIEW_WORKSPACE_OBJECT_AREA: - evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_OBJECT_AREA, NULL); + shortcuts_shortcut_send(SHORTCUT_TYPE_OBJECT_AREA); break; case MENU_EDIT_UNDO: - evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_UNDO, NULL); + shortcuts_shortcut_send(SHORTCUT_TYPE_UNDO); break; case MENU_EDIT_REDO: - evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_REDO, NULL); + shortcuts_shortcut_send(SHORTCUT_TYPE_REDO); break; case MENU_EDIT_GROUP_ADD: - evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_ADD_GROUP, NULL); + shortcuts_shortcut_send(SHORTCUT_TYPE_ADD_GROUP); break; case MENU_EDIT_PART_ADD: - evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_ADD_PART, NULL); + shortcuts_shortcut_send(SHORTCUT_TYPE_ADD_PART); break; case MENU_EDIT_STATE_ADD: - evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_ADD_STATE, NULL); + shortcuts_shortcut_send(SHORTCUT_TYPE_ADD_STATE); break; case MENU_EDIT_ITEM_ADD: - evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_ADD_ITEM, NULL); + shortcuts_shortcut_send(SHORTCUT_TYPE_ADD_ITEM); break; case MENU_EDIT_PROGRAM_ADD: - evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_ADD_PROGRAM, NULL); + shortcuts_shortcut_send(SHORTCUT_TYPE_ADD_PROGRAM); break; case MENU_EDIT_DATA_ITEM_ADD: - evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_ADD_DATA_ITEM, NULL); + shortcuts_shortcut_send(SHORTCUT_TYPE_ADD_DATA_ITEM); break; case MENU_WINDOW_TAB_HOME: diff --git a/src/bin/ui/shortcuts/shortcuts.c b/src/bin/ui/shortcuts/shortcuts.c index b812d77..a41992c 100644 --- a/src/bin/ui/shortcuts/shortcuts.c +++ b/src/bin/ui/shortcuts/shortcuts.c @@ -195,6 +195,9 @@ _shortcut_handle(Shortcut_Type type) SHORTCUT(ZOOM_IN); SHORTCUT(ZOOM_OUT); SHORTCUT(ZOOM_RESET); + SHORTCUT(FILL); + SHORTCUT(FIT); + SHORTCUT(RULERS_SHOW); SHORTCUT(OBJECT_AREA); SHORTCUT(CANCEL); SHORTCUT(DONE); diff --git a/src/bin/ui/shortcuts/shortcuts.h b/src/bin/ui/shortcuts/shortcuts.h index 22f2fa3..7233bb6 100644 --- a/src/bin/ui/shortcuts/shortcuts.h +++ b/src/bin/ui/shortcuts/shortcuts.h @@ -93,6 +93,9 @@ typedef enum { SHORTCUT_TYPE_ZOOM_IN, SHORTCUT_TYPE_ZOOM_OUT, SHORTCUT_TYPE_ZOOM_RESET, + SHORTCUT_TYPE_FILL, + SHORTCUT_TYPE_FIT, + SHORTCUT_TYPE_RULERS_SHOW, SHORTCUT_TYPE_OBJECT_AREA, SHORTCUT_TYPE_DONE, SHORTCUT_TYPE_CANCEL, diff --git a/src/bin/ui/tabs.c b/src/bin/ui/tabs.c index cfb1ddf..6c6cdbd 100644 --- a/src/bin/ui/tabs.c +++ b/src/bin/ui/tabs.c @@ -931,9 +931,9 @@ _shortcut_object_area_cb(void *data __UNUSED__, } static void -_shortcut_rulers_visible_cb(void *data __UNUSED__, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) +_shortcut_rulers_show_cb(void *data __UNUSED__, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Eina_Bool visible; @@ -1064,7 +1064,7 @@ tabs_add(void) evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_FIT, _shortcut_fit_cb, NULL); evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_FILL, _shortcut_fill_cb, NULL); evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_OBJECT_AREA, _shortcut_object_area_cb, NULL); - evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_RULERS_VISIBLED, _shortcut_rulers_visible_cb, NULL); + evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_RULERS_SHOW, _shortcut_rulers_show_cb, NULL); evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_UNDO, _shortcut_undo_cb, NULL); evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_REDO, _shortcut_redo_cb, NULL); diff --git a/src/bin/ui/workspace/workspace.c b/src/bin/ui/workspace/workspace.c index e3c9bc5..78fe050 100644 --- a/src/bin/ui/workspace/workspace.c +++ b/src/bin/ui/workspace/workspace.c @@ -29,6 +29,7 @@ #include "project_manager.h" #include "change.h" #include "syntax_color.h" +#include "shortcuts.h" #define WORKSPACE_DATA "workspace_data" @@ -665,7 +666,7 @@ _menu_undo(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_UNDO, NULL); + shortcuts_shortcut_send(SHORTCUT_TYPE_UNDO); } static void @@ -673,7 +674,7 @@ _menu_redo(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_REDO, NULL); + shortcuts_shortcut_send(SHORTCUT_TYPE_REDO); } static void @@ -681,7 +682,7 @@ _menu_rulers_visible(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_RULERS_VISIBLED, NULL); + shortcuts_shortcut_send(SHORTCUT_TYPE_RULERS_SHOW); } static void --
