| 1 | #ifdef _WINDOW_CONFIG |
| 2 | |
| 3 | /* default window dimensions (overwritten via -g option): */ |
| 4 | enum { |
| 5 | WIN_WIDTH = 800, |
| 6 | WIN_HEIGHT = 600 |
| 7 | }; |
| 8 | |
| 9 | /* default color for window background: */ |
| 10 | static const char * const BG_COLOR = "#777777"; |
| 11 | /* default color for thumbnail selection: */ |
| 12 | static const char * const SEL_COLOR = "#DDDDDD"; |
| 13 | /* (see X(7) section "COLOR NAMES" for valid values) */ |
| 14 | |
| 15 | #endif |
| 16 | #ifdef _IMAGE_CONFIG |
| 17 | |
| 18 | /* how should images be scaled when they are loaded? |
| 19 | * (also controllable via -d/-s/-Z/-z options) |
| 20 | * SCALE_DOWN: 100%, but fit large images into window, |
| 21 | * SCALE_FIT: fit all images into window, |
| 22 | * SCALE_ZOOM: use current zoom level, 100% at startup |
| 23 | */ |
| 24 | static const scalemode_t SCALE_MODE = SCALE_DOWN; |
| 25 | |
| 26 | /* levels (percent) to use when zooming via '-' and '+': */ |
| 27 | static const float zoom_levels[] = { |
| 28 | 12.5, 25.0, 50.0, 75.0, |
| 29 | 100.0, 150.0, 200.0, 400.0, 800.0 |
| 30 | }; |
| 31 | |
| 32 | /* default settings for multi-frame gif images: */ |
| 33 | enum { |
| 34 | GIF_DELAY = 100, /* delay time (in ms) */ |
| 35 | GIF_AUTOPLAY = 1, /* autoplay when loaded [0/1] */ |
| 36 | GIF_LOOP = 0 /* endless loop [0/1] */ |
| 37 | }; |
| 38 | |
| 39 | #endif |
| 40 | #ifdef _THUMBS_CONFIG |
| 41 | |
| 42 | /* default dimension of thumbnails (width == height): */ |
| 43 | enum { THUMB_SIZE = 60 }; |
| 44 | |
| 45 | #endif |
| 46 | #ifdef _MAPPINGS_CONFIG |
| 47 | |
| 48 | /* keyboard mappings for image and thumbnail mode: */ |
| 49 | static const keymap_t keys[] = { |
| 50 | /* ctrl key function argument */ |
| 51 | { False, XK_q, it_quit, (arg_t) None }, |
| 52 | { False, XK_Return, it_switch_mode, (arg_t) None }, |
| 53 | { False, XK_f, it_toggle_fullscreen, (arg_t) None }, |
| 54 | |
| 55 | { False, XK_r, it_reload_image, (arg_t) None }, |
| 56 | { False, XK_D, it_remove_image, (arg_t) None }, |
| 57 | |
| 58 | { False, XK_n, i_navigate, (arg_t) +1 }, |
| 59 | { False, XK_space, i_navigate, (arg_t) +1 }, |
| 60 | { False, XK_p, i_navigate, (arg_t) -1 }, |
| 61 | { False, XK_BackSpace, i_navigate, (arg_t) -1 }, |
| 62 | { False, XK_bracketright, i_navigate, (arg_t) +10 }, |
| 63 | { False, XK_bracketleft, i_navigate, (arg_t) -10 }, |
| 64 | { False, XK_g, it_first, (arg_t) None }, |
| 65 | { False, XK_G, it_last, (arg_t) None }, |
| 66 | |
| 67 | { True, XK_n, i_navigate_frame, (arg_t) +1 }, |
| 68 | { True, XK_p, i_navigate_frame, (arg_t) -1 }, |
| 69 | { True, XK_space, i_toggle_animation, (arg_t) None }, |
| 70 | |
| 71 | { False, XK_h, it_move, (arg_t) DIR_LEFT }, |
| 72 | { False, XK_Left, it_move, (arg_t) DIR_LEFT }, |
| 73 | { False, XK_j, it_move, (arg_t) DIR_DOWN }, |
| 74 | { False, XK_Down, it_move, (arg_t) DIR_DOWN }, |
| 75 | { False, XK_k, it_move, (arg_t) DIR_UP }, |
| 76 | { False, XK_Up, it_move, (arg_t) DIR_UP }, |
| 77 | { False, XK_l, it_move, (arg_t) DIR_RIGHT }, |
| 78 | { False, XK_Right, it_move, (arg_t) DIR_RIGHT }, |
| 79 | |
| 80 | { True, XK_h, i_pan_screen, (arg_t) DIR_LEFT }, |
| 81 | { True, XK_Left, i_pan_screen, (arg_t) DIR_LEFT }, |
| 82 | { True, XK_j, i_pan_screen, (arg_t) DIR_DOWN }, |
| 83 | { True, XK_Down, i_pan_screen, (arg_t) DIR_DOWN }, |
| 84 | { True, XK_k, i_pan_screen, (arg_t) DIR_UP }, |
| 85 | { True, XK_Up, i_pan_screen, (arg_t) DIR_UP }, |
| 86 | { True, XK_l, i_pan_screen, (arg_t) DIR_RIGHT }, |
| 87 | { True, XK_Right, i_pan_screen, (arg_t) DIR_RIGHT }, |
| 88 | |
| 89 | { False, XK_H, i_pan_edge, (arg_t) DIR_LEFT }, |
| 90 | { False, XK_J, i_pan_edge, (arg_t) DIR_DOWN }, |
| 91 | { False, XK_K, i_pan_edge, (arg_t) DIR_UP }, |
| 92 | { False, XK_L, i_pan_edge, (arg_t) DIR_RIGHT }, |
| 93 | |
| 94 | { False, XK_plus, i_zoom, (arg_t) +1 }, |
| 95 | { False, XK_equal, i_zoom, (arg_t) +1 }, |
| 96 | { False, XK_KP_Add, i_zoom, (arg_t) +1 }, |
| 97 | { False, XK_minus, i_zoom, (arg_t) -1 }, |
| 98 | { False, XK_KP_Subtract, i_zoom, (arg_t) -1 }, |
| 99 | { False, XK_0, i_zoom, (arg_t) None }, |
| 100 | { False, XK_KP_0, i_zoom, (arg_t) None }, |
| 101 | { False, XK_w, i_fit_to_win, (arg_t) None }, |
| 102 | { False, XK_W, i_fit_to_img, (arg_t) None }, |
| 103 | |
| 104 | { False, XK_less, i_rotate, (arg_t) DIR_LEFT }, |
| 105 | { False, XK_greater, i_rotate, (arg_t) DIR_RIGHT }, |
| 106 | |
| 107 | { False, XK_a, i_toggle_antialias, (arg_t) None }, |
| 108 | { False, XK_A, i_toggle_alpha, (arg_t) None }, |
| 109 | |
| 110 | /* open current image with given program: */ |
| 111 | { True, XK_g, it_open_with, (arg_t) "gimp" }, |
| 112 | |
| 113 | /* run shell command line on current file ("$SXIV_IMG"): */ |
| 114 | { True, XK_less, it_shell_cmd, (arg_t) \ |
| 115 | "mogrify -rotate -90 \"$SXIV_IMG\"" }, |
| 116 | { True, XK_greater, it_shell_cmd, (arg_t) \ |
| 117 | "mogrify -rotate +90 \"$SXIV_IMG\"" }, |
| 118 | { True, XK_comma, it_shell_cmd, (arg_t) \ |
| 119 | "jpegtran -rotate 270 -copy all -outfile \"$SXIV_IMG\" \"$SXIV_IMG\"" }, |
| 120 | { True, XK_period, it_shell_cmd, (arg_t) \ |
| 121 | "jpegtran -rotate 90 -copy all -outfile \"$SXIV_IMG\" \"$SXIV_IMG\"" }, |
| 122 | }; |
| 123 | |
| 124 | /* mouse button mappings for image mode: */ |
| 125 | static const button_t buttons[] = { |
| 126 | /* ctrl shift button function argument */ |
| 127 | { False, False, Button1, i_navigate, (arg_t) +1 }, |
| 128 | { False, False, Button3, i_navigate, (arg_t) -1 }, |
| 129 | { False, False, Button2, i_drag, (arg_t) None }, |
| 130 | { False, False, Button4, it_move, (arg_t) DIR_UP }, |
| 131 | { False, False, Button5, it_move, (arg_t) DIR_DOWN }, |
| 132 | { False, True, Button4, it_move, (arg_t) DIR_LEFT }, |
| 133 | { False, True, Button5, it_move, (arg_t) DIR_RIGHT }, |
| 134 | { True, False, Button4, i_zoom, (arg_t) +1 }, |
| 135 | { True, False, Button5, i_zoom, (arg_t) -1 }, |
| 136 | }; |
| 137 | |
| 138 | #endif |