From a97cda9176191364c403d7c5d004046a9944f2b9 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Wed, 9 Feb 2011 23:53:18 +0800 Subject: [PATCH] Update shortcuts function to girara interface --- shortcuts.c | 44 ++++++++++++++++++------------------- shortcuts.h | 63 +++++++++++++++++++++++++++++++++++------------------ 2 files changed, 64 insertions(+), 43 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index 8068938..d5bf8e1 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -8,7 +8,7 @@ #include "zathura.h" bool -sc_abort(girara_session_t* session, girara_argument_t* argument) +sc_abort(girara_session_t* session, girara_argument_t* argument, unsigned int t) { g_return_val_if_fail(session != NULL, false); @@ -18,19 +18,19 @@ sc_abort(girara_session_t* session, girara_argument_t* argument) } bool -sc_adjust_window(girara_session_t* session, girara_argument_t* argument) +sc_adjust_window(girara_session_t* session, girara_argument_t* argument, unsigned int t) { return false; } bool -sc_change_buffer(girara_session_t* session, girara_argument_t* argument) +sc_change_buffer(girara_session_t* session, girara_argument_t* argument, unsigned int t) { return false; } bool -sc_change_mode(girara_session_t* session, girara_argument_t* argument) +sc_change_mode(girara_session_t* session, girara_argument_t* argument, unsigned int t) { g_return_val_if_fail(session != NULL, false); @@ -40,7 +40,7 @@ sc_change_mode(girara_session_t* session, girara_argument_t* argument) } bool -sc_focus_inputbar(girara_session_t* session, girara_argument_t* argument) +sc_focus_inputbar(girara_session_t* session, girara_argument_t* argument, unsigned int t) { g_return_val_if_fail(session != NULL, false); @@ -58,19 +58,19 @@ sc_focus_inputbar(girara_session_t* session, girara_argument_t* argument) } bool -sc_follow(girara_session_t* session, girara_argument_t* argument) +sc_follow(girara_session_t* session, girara_argument_t* argument, unsigned int t) { return false; } bool -sc_goto(girara_session_t* session, girara_argument_t* argument) +sc_goto(girara_session_t* session, girara_argument_t* argument, unsigned int t) { return false; } bool -sc_navigate(girara_session_t* session, girara_argument_t* argument) +sc_navigate(girara_session_t* session, girara_argument_t* argument, unsigned int t) { if (!session || !argument || !Zathura.document) { return false; @@ -91,25 +91,25 @@ sc_navigate(girara_session_t* session, girara_argument_t* argument) } bool -sc_recolor(girara_session_t* session, girara_argument_t* argument) +sc_recolor(girara_session_t* session, girara_argument_t* argument, unsigned int t) { return false; } bool -sc_reload(girara_session_t* session, girara_argument_t* argument) +sc_reload(girara_session_t* session, girara_argument_t* argument, unsigned int t) { return false; } bool -sc_rotate(girara_session_t* session, girara_argument_t* argument) +sc_rotate(girara_session_t* session, girara_argument_t* argument, unsigned int t) { return false; } bool -sc_scroll(girara_session_t* session, girara_argument_t* argument) +sc_scroll(girara_session_t* session, girara_argument_t* argument, unsigned int t) { GtkAdjustment* adjustment = NULL; if ( (argument->n == LEFT) || (argument->n == RIGHT) ) @@ -161,52 +161,52 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument) } bool -sc_search(girara_session_t* session, girara_argument_t* argument) +sc_search(girara_session_t* session, girara_argument_t* argument, unsigned int t) { return false; } bool -sc_switch_goto_mode(girara_session_t* session, girara_argument_t* argument) +sc_switch_goto_mode(girara_session_t* session, girara_argument_t* argument, unsigned int t) { return false; } bool -sc_navigate_index(girara_session_t* session, girara_argument_t* argument) +sc_navigate_index(girara_session_t* session, girara_argument_t* argument, unsigned int t) { return false; } bool -sc_toggle_index(girara_session_t* session, girara_argument_t* argument) +sc_toggle_index(girara_session_t* session, girara_argument_t* argument, unsigned int t) { return false; } bool -sc_toggle_inputbar(girara_session_t* session, girara_argument_t* argument) +sc_toggle_inputbar(girara_session_t* session, girara_argument_t* argument, unsigned int t) { return false; } bool -sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* argument) +sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* argument, unsigned int t) { return false; } bool -sc_toggle_statusbar(girara_session_t* session, girara_argument_t* argument) +sc_toggle_statusbar(girara_session_t* session, girara_argument_t* argument, unsigned int t) { return false; } bool -sc_quit(girara_session_t* session, girara_argument_t* argument) +sc_quit(girara_session_t* session, girara_argument_t* argument, unsigned int t) { girara_argument_t arg = { GIRARA_HIDE, NULL }; - girara_isc_completion(session, &arg); + girara_isc_completion(session, &arg, 0); cb_destroy(NULL, NULL); @@ -216,7 +216,7 @@ sc_quit(girara_session_t* session, girara_argument_t* argument) } bool -sc_zoom(girara_session_t* session, girara_argument_t* argument) +sc_zoom(girara_session_t* session, girara_argument_t* argument, unsigned int t) { return false; } diff --git a/shortcuts.h b/shortcuts.h index 88c21c9..78f87ef 100644 --- a/shortcuts.h +++ b/shortcuts.h @@ -10,188 +10,209 @@ * * @param session The used girara session * @param argument The used argument + * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_abort(girara_session_t* session, girara_argument_t* argument); +bool sc_abort(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Adjust the rendered pages to the window * * @param session The used girara session * @param argument The used argument + * @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); +bool sc_adjust_window(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Modify the current buffer * * @param session The used girara session * @param argument The used argument + * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_change_buffer(girara_session_t* session, girara_argument_t* argument); +bool sc_change_buffer(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Change the current mode * * @param session The used girara session * @param argument The used argument + * @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); +bool sc_change_mode(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Focus the inputbar * * @param session The used girara session * @param argument The used argument + * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_focus_inputbar(girara_session_t* session, girara_argument_t* argument); +bool sc_focus_inputbar(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Follow a link * * @param session The used girara session * @param argument The used argument + * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_follow(girara_session_t* session, girara_argument_t* argument); +bool sc_follow(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Go to a specific page or position * * @param session The used girara session * @param argument The used argument + * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_goto(girara_session_t* session, girara_argument_t* argument); +bool sc_goto(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Navigate through the document * * @param session The used girara session * @param argument The used argument + * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_navigate(girara_session_t* session, girara_argument_t* argument); +bool sc_navigate(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Recolor the pages * * @param session The used girara session * @param argument The used argument + * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_recolor(girara_session_t* session, girara_argument_t* argument); +bool sc_recolor(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Reload the current document * * @param session The used girara session * @param argument The used argument + * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_reload(girara_session_t* session, girara_argument_t* argument); +bool sc_reload(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Rotate the pages * * @param session The used girara session * @param argument The used argument + * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_rotate(girara_session_t* session, girara_argument_t* argument); +bool sc_rotate(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Scroll through the pages * * @param session The used girara session * @param argument The used argument + * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_scroll(girara_session_t* session, girara_argument_t* argument); +bool sc_scroll(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Search through the document for the latest search item * * @param session The used girara session * @param argument The used argument + * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_search(girara_session_t* session, girara_argument_t* argument); +bool sc_search(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Switch go to mode (numeric, labels) * * @param session The used girara session * @param argument The used argument + * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_switch_goto_mode(girara_session_t* session, girara_argument_t* argument); +bool sc_switch_goto_mode(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Navigate through the index of the document * * @param session The used girara session * @param argument The used argument + * @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); +bool sc_navigate_index(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Show/Hide the index of the document * * @param session The used girara session * @param argument The used argument + * @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); +bool sc_toggle_index(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Show/Hide the inputbar * * @param session The used girara session * @param argument The used argument + * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_toggle_inputbar(girara_session_t* session, girara_argument_t* argument); +bool sc_toggle_inputbar(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Toggle fullscreen mode * * @param session The used girara session * @param argument The used argument + * @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); +bool sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Show/Hide the statusbar * * @param session The used girara session * @param argument The used argument + * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_toggle_statusbar(girara_session_t* session, girara_argument_t* argument); +bool sc_toggle_statusbar(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Quit zathura * * @param session The used girara session * @param argument The used argument + * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_quit(girara_session_t* session, girara_argument_t* argument); +bool sc_quit(girara_session_t* session, girara_argument_t* argument, unsigned int t); /** * Change the zoom level * * @param session The used girara session * @param argument The used argument + * @param t Number of executions * @return true if no error occured otherwise false */ -bool sc_zoom(girara_session_t* session, girara_argument_t* argument); +bool sc_zoom(girara_session_t* session, girara_argument_t* argument, unsigned int t); #endif // SHORTCUTS_H