From 226dfae14c56655a6a5f54507fda5e23efda7876 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Tue, 24 Jan 2012 01:34:09 +0100 Subject: [PATCH] Update shortcuts --- callbacks.c | 2 +- shortcuts.c | 48 ++++++++++++++++++++++++------------------------ shortcuts.h | 48 ++++++++++++++++++++++++++++++++---------------- 3 files changed, 57 insertions(+), 41 deletions(-) diff --git a/callbacks.c b/callbacks.c index e8df477..526a687 100644 --- a/callbacks.c +++ b/callbacks.c @@ -121,7 +121,7 @@ cb_index_row_activated(GtkTreeView* tree_view, GtkTreePath* path, } if (index_element->type == ZATHURA_LINK_TO_PAGE) { - sc_toggle_index(zathura->ui.session, NULL, 0); + sc_toggle_index(zathura->ui.session, NULL, NULL, 0); page_set_delayed(zathura, index_element->target.page_number); } else if (index_element->type == ZATHURA_LINK_EXTERNAL) { if (girara_xdg_open(index_element->target.uri) == false) { diff --git a/shortcuts.c b/shortcuts.c index 4c81595..3b7e0d3 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -15,7 +15,7 @@ bool sc_abort(girara_session_t* session, girara_argument_t* UNUSED(argument), - unsigned int UNUSED(t)) + girara_event_t* UNUSED(event), unsigned int UNUSED(t)) { g_return_val_if_fail(session != NULL, false); @@ -26,7 +26,7 @@ sc_abort(girara_session_t* session, girara_argument_t* UNUSED(argument), bool sc_adjust_window(girara_session_t* session, girara_argument_t* argument, - unsigned int UNUSED(t)) + girara_event_t* UNUSED(event), unsigned int UNUSED(t)) { g_return_val_if_fail(session != NULL, false); g_return_val_if_fail(session->global.data != NULL, false); @@ -88,8 +88,8 @@ error_ret: } bool -sc_change_mode(girara_session_t* session, girara_argument_t* argument, unsigned - int UNUSED(t)) +sc_change_mode(girara_session_t* session, girara_argument_t* argument, + girara_event_t* UNUSED(event), unsigned int UNUSED(t)) { g_return_val_if_fail(session != NULL, false); @@ -100,7 +100,7 @@ sc_change_mode(girara_session_t* session, girara_argument_t* argument, unsigned bool sc_follow(girara_session_t* session, girara_argument_t* UNUSED(argument), - unsigned int UNUSED(t)) + girara_event_t* UNUSED(event), unsigned int UNUSED(t)) { g_return_val_if_fail(session != NULL, false); g_return_val_if_fail(session->global.data != NULL, false); @@ -165,7 +165,7 @@ sc_follow(girara_session_t* session, girara_argument_t* UNUSED(argument), } bool -sc_goto(girara_session_t* session, girara_argument_t* argument, unsigned int t) +sc_goto(girara_session_t* session, girara_argument_t* argument, girara_event_t* UNUSED(event), unsigned int t) { g_return_val_if_fail(session != NULL, false); g_return_val_if_fail(session->global.data != NULL, false); @@ -188,8 +188,8 @@ sc_goto(girara_session_t* session, girara_argument_t* argument, unsigned int t) } bool -sc_navigate(girara_session_t* session, girara_argument_t* argument, unsigned int - t) +sc_navigate(girara_session_t* session, girara_argument_t* argument, + girara_event_t* UNUSED(event), unsigned int t) { g_return_val_if_fail(session != NULL, false); g_return_val_if_fail(session->global.data != NULL, false); @@ -214,7 +214,7 @@ sc_navigate(girara_session_t* session, girara_argument_t* argument, unsigned int bool sc_recolor(girara_session_t* session, girara_argument_t* UNUSED(argument), - unsigned int UNUSED(t)) + girara_event_t* UNUSED(event), unsigned int UNUSED(t)) { g_return_val_if_fail(session != NULL, false); g_return_val_if_fail(session->global.data != NULL, false); @@ -228,7 +228,7 @@ sc_recolor(girara_session_t* session, girara_argument_t* UNUSED(argument), bool sc_reload(girara_session_t* session, girara_argument_t* UNUSED(argument), - unsigned int UNUSED(t)) + girara_event_t* UNUSED(event), unsigned int UNUSED(t)) { g_return_val_if_fail(session != NULL, false); g_return_val_if_fail(session->global.data != NULL, false); @@ -257,7 +257,7 @@ sc_reload(girara_session_t* session, girara_argument_t* UNUSED(argument), bool sc_rotate(girara_session_t* session, girara_argument_t* UNUSED(argument), - unsigned int UNUSED(t)) + girara_event_t* UNUSED(event), unsigned int UNUSED(t)) { g_return_val_if_fail(session != NULL, false); g_return_val_if_fail(session->global.data != NULL, false); @@ -275,8 +275,8 @@ sc_rotate(girara_session_t* session, girara_argument_t* UNUSED(argument), } bool -sc_scroll(girara_session_t* session, girara_argument_t* argument, unsigned int - UNUSED(t)) +sc_scroll(girara_session_t* session, girara_argument_t* argument, + girara_event_t* UNUSED(event), unsigned int UNUSED(t)) { g_return_val_if_fail(session != NULL, false); g_return_val_if_fail(session->global.data != NULL, false); @@ -341,8 +341,8 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument, unsigned int } bool -sc_search(girara_session_t* session, girara_argument_t* argument, unsigned int - UNUSED(t)) +sc_search(girara_session_t* session, girara_argument_t* argument, + girara_event_t* UNUSED(event), unsigned int UNUSED(t)) { g_return_val_if_fail(session != NULL, false); g_return_val_if_fail(session->global.data != NULL, false); @@ -355,7 +355,7 @@ sc_search(girara_session_t* session, girara_argument_t* argument, unsigned int bool sc_navigate_index(girara_session_t* session, girara_argument_t* argument, - unsigned int UNUSED(t)) + girara_event_t* UNUSED(event), unsigned int UNUSED(t)) { g_return_val_if_fail(session != NULL, false); g_return_val_if_fail(session->global.data != NULL, false); @@ -438,7 +438,7 @@ sc_navigate_index(girara_session_t* session, girara_argument_t* argument, bool sc_toggle_index(girara_session_t* session, girara_argument_t* UNUSED(argument), - unsigned int UNUSED(t)) + girara_event_t* UNUSED(event), unsigned int UNUSED(t)) { g_return_val_if_fail(session != NULL, false); g_return_val_if_fail(session->global.data != NULL, false); @@ -541,7 +541,7 @@ error_ret: bool sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* - UNUSED(argument), unsigned int UNUSED(t)) + UNUSED(argument), girara_event_t* UNUSED(event), unsigned int UNUSED(t)) { g_return_val_if_fail(session != NULL, false); @@ -572,7 +572,7 @@ sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* /* adjust window */ girara_argument_t argument = { ADJUST_BESTFIT, NULL }; - sc_adjust_window(session, &argument, 0); + sc_adjust_window(session, &argument, NULL, 0); /* hide status and inputbar */ gtk_widget_hide(GTK_WIDGET(session->gtk.inputbar)); @@ -588,13 +588,13 @@ sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* } bool -sc_quit(girara_session_t* session, girara_argument_t* UNUSED(argument), unsigned - int UNUSED(t)) +sc_quit(girara_session_t* session, girara_argument_t* UNUSED(argument), + girara_event_t* UNUSED(event), unsigned int UNUSED(t)) { g_return_val_if_fail(session != NULL, false); girara_argument_t arg = { GIRARA_HIDE, NULL }; - girara_isc_completion(session, &arg, 0); + girara_isc_completion(session, &arg, NULL, 0); cb_destroy(NULL, NULL); @@ -602,8 +602,8 @@ sc_quit(girara_session_t* session, girara_argument_t* UNUSED(argument), unsigned } bool -sc_zoom(girara_session_t* session, girara_argument_t* argument, unsigned int - UNUSED(t)) +sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t* + UNUSED(event), unsigned int UNUSED(t)) { g_return_val_if_fail(session != NULL, false); g_return_val_if_fail(session->global.data != NULL, false); diff --git a/shortcuts.h b/shortcuts.h index 8bf9284..7c265ca 100644 --- a/shortcuts.h +++ b/shortcuts.h @@ -10,159 +10,175 @@ * * @param session The used girara session * @param argument The used argument + * @param event Girara event * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_abort(girara_session_t* session, girara_argument_t* argument, unsigned int t); +bool sc_abort(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t); /** * Adjust the rendered pages to the window * * @param session The used girara session * @param argument The used argument + * @param event Girara event * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_adjust_window(girara_session_t* session, girara_argument_t* argument, unsigned int t); +bool sc_adjust_window(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t); /** * Change the current mode * * @param session The used girara session * @param argument The used argument + * @param event Girara event * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_change_mode(girara_session_t* session, girara_argument_t* argument, unsigned int t); +bool sc_change_mode(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t); /** * Follow a link * * @param session The used girara session * @param argument The used argument + * @param event Girara event * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_follow(girara_session_t* session, girara_argument_t* argument, unsigned int t); +bool sc_follow(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t); /** * Go to a specific page or position * * @param session The used girara session * @param argument The used argument + * @param event Girara event * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_goto(girara_session_t* session, girara_argument_t* argument, unsigned int t); +bool sc_goto(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t); /** * Navigate through the document * * @param session The used girara session * @param argument The used argument + * @param event Girara event * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_navigate(girara_session_t* session, girara_argument_t* argument, unsigned int t); +bool sc_navigate(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t); /** * Recolor the pages * * @param session The used girara session * @param argument The used argument + * @param event Girara event * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_recolor(girara_session_t* session, girara_argument_t* argument, unsigned int t); +bool sc_recolor(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t); /** * Reload the current document * * @param session The used girara session * @param argument The used argument + * @param event Girara event * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_reload(girara_session_t* session, girara_argument_t* argument, unsigned int t); +bool sc_reload(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t); /** * Rotate the pages * * @param session The used girara session * @param argument The used argument + * @param event Girara event * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_rotate(girara_session_t* session, girara_argument_t* argument, unsigned int t); +bool sc_rotate(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t); /** * Scroll through the pages * * @param session The used girara session * @param argument The used argument + * @param event Girara event * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_scroll(girara_session_t* session, girara_argument_t* argument, unsigned int t); +bool sc_scroll(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t); /** * Search through the document for the latest search item * * @param session The used girara session * @param argument The used argument + * @param event Girara event * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_search(girara_session_t* session, girara_argument_t* argument, unsigned int t); +bool sc_search(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t); /** * Navigate through the index of the document * * @param session The used girara session * @param argument The used argument + * @param event Girara event * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_navigate_index(girara_session_t* session, girara_argument_t* argument, unsigned int t); +bool sc_navigate_index(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t); /** * Show/Hide the index of the document * * @param session The used girara session * @param argument The used argument + * @param event Girara event * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_toggle_index(girara_session_t* session, girara_argument_t* argument, unsigned int t); +bool sc_toggle_index(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t); /** * Toggle fullscreen mode * * @param session The used girara session * @param argument The used argument + * @param event Girara event * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* argument, unsigned int t); +bool sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t); /** * Quit zathura * * @param session The used girara session * @param argument The used argument + * @param event Girara event * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_quit(girara_session_t* session, girara_argument_t* argument, unsigned int t); +bool sc_quit(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t); /** * Change the zoom level * * @param session The used girara session * @param argument The used argument + * @param event Girara event * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_zoom(girara_session_t* session, girara_argument_t* argument, unsigned int t); +bool sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t); #endif // SHORTCUTS_H