2009-12-26 14:30:50 +01:00
|
|
|
/* settings */
|
2009-12-28 18:34:00 +01:00
|
|
|
static const int DEFAULT_WIDTH = 800;
|
|
|
|
static const int DEFAULT_HEIGHT = 600;
|
2009-12-28 19:24:15 +01:00
|
|
|
static const float ZOOM_STEP = 10;
|
|
|
|
static const float ZOOM_MIN = 10;
|
|
|
|
static const float ZOOM_MAX = 400;
|
2009-12-30 00:21:29 +01:00
|
|
|
static const float SCROLL_STEP = 40;
|
2010-01-02 14:23:49 +01:00
|
|
|
static const float TRANSPARENCY = 0.4;
|
2009-12-26 14:30:50 +01:00
|
|
|
|
|
|
|
/* completion */
|
|
|
|
static const char FORMAT_COMMAND[] = "<b>%s</b>";
|
|
|
|
static const char FORMAT_DESCRIPTION[] = "<i>%s</i>";
|
|
|
|
|
|
|
|
/* look */
|
|
|
|
static const char font[] = "monospace normal 9";
|
|
|
|
static const char default_bgcolor[] = "#000000";
|
|
|
|
static const char default_fgcolor[] = "#DDDDDD";
|
|
|
|
static const char inputbar_bgcolor[] = "#141414";
|
|
|
|
static const char inputbar_fgcolor[] = "#9FBC00";
|
|
|
|
static const char statusbar_bgcolor[] = "#000000";
|
|
|
|
static const char statusbar_fgcolor[] = "#FFFFFF";
|
|
|
|
static const char completion_fgcolor[] = "#DDDDDD";
|
|
|
|
static const char completion_bgcolor[] = "#232323";
|
|
|
|
static const char completion_g_fgcolor[] = "#DEDEDE";
|
|
|
|
static const char completion_g_bgcolor[] = "#FF00FF";
|
|
|
|
static const char completion_hl_fgcolor[] = "#232323";
|
|
|
|
static const char completion_hl_bgcolor[] = "#9FBC00";
|
|
|
|
static const char notification_e_bgcolor[] = "#FF1212";
|
|
|
|
static const char notification_e_fgcolor[] = "#FFFFFF";
|
|
|
|
static const char notification_w_bgcolor[] = "#FFF712";
|
|
|
|
static const char notification_w_fgcolor[] = "#000000";
|
|
|
|
|
2010-01-02 14:23:49 +01:00
|
|
|
static const char search_highlight[] = "#9FBC00";
|
|
|
|
|
2010-01-01 20:46:07 +01:00
|
|
|
/* statusbar */
|
|
|
|
static const char DEFAULT_TEXT[] = "[No Name]";
|
|
|
|
|
2010-01-02 00:25:18 +01:00
|
|
|
/* printing */
|
|
|
|
#define LIST_PRINTER_COMMAND "lpstat -v | sed -n '/^.*device for \\(.*\\): .*$/s//\\1/p'"
|
2010-01-02 00:36:32 +01:00
|
|
|
#define PRINT_COMMAND "lp -d '%s' -p %s %s" /* printer / pages / file */
|
2010-01-02 00:25:18 +01:00
|
|
|
|
2009-12-30 00:47:29 +01:00
|
|
|
/* additional settings */
|
|
|
|
#define SHOW_SCROLLBARS 0
|
|
|
|
|
2009-12-26 14:30:50 +01:00
|
|
|
/* shortcuts */
|
|
|
|
Shortcut shortcuts[] = {
|
|
|
|
/* mask, key, function, mode, argument */
|
2009-12-26 16:05:03 +01:00
|
|
|
{GDK_CONTROL_MASK, GDK_n, sc_toggle_statusbar, -1, {0} },
|
|
|
|
{GDK_CONTROL_MASK, GDK_m, sc_toggle_inputbar, -1, {0} },
|
|
|
|
{GDK_CONTROL_MASK, GDK_q, sc_quit, -1, {0} },
|
2009-12-26 15:55:32 +01:00
|
|
|
{GDK_CONTROL_MASK, GDK_c, sc_abort, -1, {0} },
|
2010-01-01 15:34:01 +01:00
|
|
|
{GDK_CONTROL_MASK, GDK_i, sc_revert_video, -1, {0} },
|
2009-12-26 14:30:50 +01:00
|
|
|
{GDK_SHIFT_MASK, GDK_slash, sc_focus_inputbar, -1, { .data = "/" } },
|
|
|
|
{GDK_SHIFT_MASK, GDK_question, sc_focus_inputbar, -1, { .data = "?" } },
|
2010-01-01 22:52:45 +01:00
|
|
|
{0, GDK_Tab, sc_toggle_index, -1, {0} },
|
2009-12-26 18:16:51 +01:00
|
|
|
{0, GDK_J, sc_navigate, -1, { NEXT } },
|
|
|
|
{0, GDK_K, sc_navigate, -1, { PREVIOUS } },
|
2009-12-26 16:05:03 +01:00
|
|
|
{0, GDK_Escape, sc_abort, -1, {0} },
|
|
|
|
{0, GDK_i, sc_change_mode, NORMAL, { INSERT } },
|
|
|
|
{0, GDK_v, sc_change_mode, NORMAL, { VISUAL } },
|
|
|
|
{0, GDK_colon, sc_focus_inputbar, -1, { .data = ":" } },
|
2009-12-26 17:44:13 +01:00
|
|
|
{0, GDK_o, sc_focus_inputbar, -1, { .data = ":open " } },
|
2009-12-26 15:55:32 +01:00
|
|
|
{0, GDK_r, sc_rotate, -1, {0} },
|
|
|
|
{0, GDK_h, sc_scroll, -1, { LEFT } },
|
|
|
|
{0, GDK_j, sc_scroll, -1, { UP } },
|
|
|
|
{0, GDK_k, sc_scroll, -1, { DOWN } },
|
|
|
|
{0, GDK_l, sc_scroll, -1, { RIGHT } },
|
|
|
|
{0, GDK_n, sc_search, -1, { FORWARD } },
|
|
|
|
{0, GDK_N, sc_search, -1, { BACKWARD } },
|
2010-01-01 15:34:01 +01:00
|
|
|
{0, GDK_a, sc_adjust_window, -1, { ADJUST_BESTFIT } },
|
|
|
|
{0, GDK_s, sc_adjust_window, -1, { ADJUST_WIDTH } },
|
2009-12-26 14:30:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* inputbar shortcuts */
|
|
|
|
InputbarShortcut inputbar_shortcuts[] = {
|
|
|
|
/* mask, key, function, argument */
|
|
|
|
{0, GDK_Escape, isc_abort, {0} },
|
|
|
|
{0, GDK_Up, isc_command_history, {0} },
|
|
|
|
{0, GDK_Down, isc_command_history, {0} },
|
|
|
|
{0, GDK_Tab, isc_completion, { NEXT } },
|
|
|
|
{GDK_CONTROL_MASK, GDK_Tab, isc_completion, { NEXT_GROUP } },
|
|
|
|
{0, GDK_ISO_Left_Tab, isc_completion, { PREVIOUS } },
|
|
|
|
{GDK_CONTROL_MASK, GDK_ISO_Left_Tab, isc_completion, { PREVIOUS_GROUP } },
|
|
|
|
{GDK_CONTROL_MASK, GDK_w, isc_string_manipulation, { DELETE_LAST_WORD } },
|
|
|
|
};
|
|
|
|
|
|
|
|
/* commands */
|
|
|
|
Command commands[] = {
|
|
|
|
/* command, abbreviation, function, completion, description */
|
2010-01-01 20:46:07 +01:00
|
|
|
{"close", "c", cmd_close, 0, "Close current file" },
|
2010-01-03 16:25:51 +01:00
|
|
|
{"export", "e", cmd_export, cc_export, "Export images or attached files" },
|
2010-01-02 02:04:43 +01:00
|
|
|
{"info", "i", cmd_info, 0, "Show information about the document" },
|
2009-12-26 17:18:45 +01:00
|
|
|
{"open", "o", cmd_open, cc_open, "Open a file" },
|
2010-01-02 00:25:18 +01:00
|
|
|
{"print", "p", cmd_print, cc_print, "Print the document" },
|
2009-12-26 15:55:32 +01:00
|
|
|
{"rotate", "r", cmd_rotate, 0, "Rotate the page" },
|
2010-01-01 19:52:20 +01:00
|
|
|
{"set", "s", cmd_set, cc_set, "Set an option" },
|
2009-12-26 14:30:50 +01:00
|
|
|
{"quit", "q", cmd_quit, 0, "Quit zjui" },
|
2009-12-26 15:55:32 +01:00
|
|
|
{"write", "w", cmd_save, 0, "Save the document" },
|
2009-12-26 14:30:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* buffer commands */
|
|
|
|
BufferCommand buffer_commands[] = {
|
|
|
|
/* regex, function, argument */
|
|
|
|
{"^gg$", bcmd_goto, { TOP } },
|
2009-12-30 00:55:03 +01:00
|
|
|
{"^G$", bcmd_goto, { BOTTOM } },
|
2009-12-26 14:30:50 +01:00
|
|
|
{"^[0-9]+G$", bcmd_goto, {0} },
|
2009-12-26 15:55:32 +01:00
|
|
|
{"^zI$", bcmd_zoom, { ZOOM_IN } },
|
|
|
|
{"^zO$", bcmd_zoom, { ZOOM_OUT } },
|
|
|
|
{"^z0$", bcmd_zoom, { ZOOM_ORIGINAL } },
|
2009-12-26 14:30:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* special commands */
|
|
|
|
SpecialCommand special_commands[] = {
|
|
|
|
/* identifier, function, a, argument */
|
|
|
|
{'/', scmd_search, 1, { DOWN } },
|
|
|
|
{'?', scmd_search, 1, { UP } },
|
|
|
|
};
|
2010-01-01 19:52:20 +01:00
|
|
|
|
|
|
|
/* settings */
|
|
|
|
Setting settings[] = {
|
|
|
|
/* name, variable, type, render, description */
|
|
|
|
{"revertvideo", &(Zathura.Global.reverse_video), 'b', TRUE, "Invert the image"},
|
|
|
|
};
|