mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-29 00:34:55 +01:00
Implement sc_print
This commit is contained in:
parent
de17088c91
commit
83f55ff24a
4 changed files with 34 additions and 1 deletions
|
@ -252,7 +252,7 @@ cmd_print(girara_session_t* session, girara_list_t* UNUSED(argument_list))
|
|||
return false;
|
||||
}
|
||||
|
||||
print((zathura_t*) session->global.data);
|
||||
print(zathura);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
3
config.c
3
config.c
|
@ -195,6 +195,8 @@ config_load_default(zathura_t* zathura)
|
|||
girara_shortcut_add(gsession, 0, GDK_KEY_space, NULL, sc_navigate_index, INDEX, SELECT, NULL);
|
||||
girara_shortcut_add(gsession, 0, GDK_KEY_Return, NULL, sc_navigate_index, INDEX, SELECT, NULL);
|
||||
|
||||
girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_p, NULL, sc_print, NORMAL, 0, NULL);
|
||||
|
||||
girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_i, NULL, sc_recolor, NORMAL, 0, NULL);
|
||||
|
||||
girara_shortcut_add(gsession, 0, GDK_KEY_R, NULL, sc_reload, NORMAL, 0, NULL);
|
||||
|
@ -290,6 +292,7 @@ config_load_default(zathura_t* zathura)
|
|||
girara_shortcut_mapping_add(gsession, "goto", sc_goto);
|
||||
girara_shortcut_mapping_add(gsession, "navigate_index", sc_navigate_index);
|
||||
girara_shortcut_mapping_add(gsession, "navigate", sc_navigate);
|
||||
girara_shortcut_mapping_add(gsession, "print", sc_print);
|
||||
girara_shortcut_mapping_add(gsession, "quit", sc_quit);
|
||||
girara_shortcut_mapping_add(gsession, "recolor", sc_recolor);
|
||||
girara_shortcut_mapping_add(gsession, "reload", sc_reload);
|
||||
|
|
19
shortcuts.c
19
shortcuts.c
|
@ -15,6 +15,7 @@
|
|||
#include "render.h"
|
||||
#include "utils.h"
|
||||
#include "page.h"
|
||||
#include "print.h"
|
||||
#include "page-widget.h"
|
||||
|
||||
bool
|
||||
|
@ -427,6 +428,24 @@ sc_navigate(girara_session_t* session, girara_argument_t* argument,
|
|||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
sc_print(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);
|
||||
g_return_val_if_fail(session->global.data != NULL, false);
|
||||
zathura_t* zathura = session->global.data;
|
||||
|
||||
if (zathura->document == NULL) {
|
||||
girara_notify(session, GIRARA_ERROR, _("No document opened."));
|
||||
return false;
|
||||
}
|
||||
|
||||
print(zathura);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
sc_recolor(girara_session_t* session, girara_argument_t* UNUSED(argument),
|
||||
girara_event_t* UNUSED(event), unsigned int UNUSED(t))
|
||||
|
|
11
shortcuts.h
11
shortcuts.h
|
@ -105,6 +105,17 @@ bool sc_mouse_zoom(girara_session_t* session, girara_argument_t* argument, girar
|
|||
*/
|
||||
bool sc_navigate(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t);
|
||||
|
||||
/**
|
||||
* Calls the print dialog
|
||||
*
|
||||
* @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_print(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t);
|
||||
|
||||
/**
|
||||
* Recolor the pages
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue