| 1 | #ifdef _GENERAL_CONFIG |
| 2 | |
| 3 | /* enable external commands (defined below)? 0 = off, 1 = on: */ |
| 4 | enum { EXT_COMMANDS = 0 }; |
| 5 | |
| 6 | #endif |
| 7 | #ifdef _WINDOW_CONFIG |
| 8 | |
| 9 | /* default window dimensions (overwritten via -g option): */ |
| 10 | enum { WIN_WIDTH = 800, WIN_HEIGHT = 600 }; |
| 11 | |
| 12 | /* default color for window background: * |
| 13 | * (see X(7) "COLOR NAMES" section for valid values) */ |
| 14 | static const char * const BG_COLOR = "#777777"; |
| 15 | /* default color for thumbnail selection: */ |
| 16 | static const char * const SEL_COLOR = "#DDDDDD"; |
| 17 | |
| 18 | #endif |
| 19 | #ifdef _IMAGE_CONFIG |
| 20 | |
| 21 | /* how should images be scaled when they are loaded?: * |
| 22 | * (also controllable via -d/-s/-Z/-z options) * |
| 23 | * SCALE_DOWN: 100%, but fit large images into window, * |
| 24 | * SCALE_FIT: fit all images into window, * |
| 25 | * SCALE_ZOOM: use current zoom level, 100% at startup */ |
| 26 | static const scalemode_t SCALE_MODE = SCALE_DOWN; |
| 27 | |
| 28 | /* levels (percent) to use when zooming via '-' and '+': */ |
| 29 | static const float zoom_levels[] = { |
| 30 | 12.5, 25.0, 50.0, 75.0, |
| 31 | 100.0, 150.0, 200.0, 400.0, 800.0 |
| 32 | }; |
| 33 | |
| 34 | #endif |
| 35 | #ifdef _THUMBS_CONFIG |
| 36 | |
| 37 | /* default dimension of thumbnails (width == height): */ |
| 38 | enum { THUMB_SIZE = 60 }; |
| 39 | |
| 40 | #endif |
| 41 | #ifdef _MAPPINGS_CONFIG |
| 42 | |
| 43 | /* keyboard mappings for image and thumbnail mode: */ |
| 44 | static const keymap_t keys[] = { |
| 45 | /* key function argument */ |
| 46 | { XK_q, quit, None }, |
| 47 | { XK_r, reload, None }, |
| 48 | { XK_f, toggle_fullscreen, None }, |
| 49 | { XK_a, toggle_antialias, None }, |
| 50 | { XK_A, toggle_alpha, None }, |
| 51 | { XK_Return, switch_mode, None }, |
| 52 | |
| 53 | { XK_g, first, None }, |
| 54 | { XK_G, last, None }, |
| 55 | { XK_n, navigate, +1 }, |
| 56 | { XK_space, navigate, +1 }, |
| 57 | { XK_p, navigate, -1 }, |
| 58 | { XK_BackSpace, navigate, -1 }, |
| 59 | { XK_bracketright, navigate, +10 }, |
| 60 | { XK_bracketleft, navigate, -10 }, |
| 61 | |
| 62 | { XK_D, remove_image, None }, |
| 63 | |
| 64 | { XK_h, move, DIR_LEFT }, |
| 65 | { XK_Left, move, DIR_LEFT }, |
| 66 | { XK_j, move, DIR_DOWN }, |
| 67 | { XK_Down, move, DIR_DOWN }, |
| 68 | { XK_k, move, DIR_UP }, |
| 69 | { XK_Up, move, DIR_UP }, |
| 70 | { XK_l, move, DIR_RIGHT }, |
| 71 | { XK_Right, move, DIR_RIGHT }, |
| 72 | |
| 73 | { XK_braceleft, scroll, DIR_LEFT }, |
| 74 | { XK_Next, scroll, DIR_DOWN }, |
| 75 | { XK_Prior, scroll, DIR_UP }, |
| 76 | { XK_braceright, scroll, DIR_RIGHT }, |
| 77 | |
| 78 | { XK_H, pan_edge, DIR_LEFT }, |
| 79 | { XK_J, pan_edge, DIR_DOWN }, |
| 80 | { XK_K, pan_edge, DIR_UP }, |
| 81 | { XK_L, pan_edge, DIR_RIGHT }, |
| 82 | |
| 83 | { XK_plus, zoom, +1 }, |
| 84 | { XK_equal, zoom, +1 }, |
| 85 | { XK_KP_Add, zoom, +1 }, |
| 86 | { XK_minus, zoom, -1 }, |
| 87 | { XK_KP_Subtract, zoom, -1 }, |
| 88 | { XK_0, zoom, 0 }, |
| 89 | { XK_KP_0, zoom, 0 }, |
| 90 | { XK_w, fit_to_win, None }, |
| 91 | { XK_W, fit_to_img, None }, |
| 92 | |
| 93 | { XK_less, rotate, DIR_LEFT }, |
| 94 | { XK_greater, rotate, DIR_RIGHT }, |
| 95 | }; |
| 96 | |
| 97 | /* external commands and corresponding key mappings: */ |
| 98 | static const command_t commands[] = { |
| 99 | /* ctrl-... reload? command, '#' is replaced by filename */ |
| 100 | { XK_comma, True, "jpegtran -rotate 270 -copy all -outfile # #" }, |
| 101 | { XK_period, True, "jpegtran -rotate 90 -copy all -outfile # #" }, |
| 102 | { XK_less, True, "mogrify -rotate -90 #" }, |
| 103 | { XK_greater, True, "mogrify -rotate +90 #" } |
| 104 | }; |
| 105 | |
| 106 | /* mouse button mappings for image mode: */ |
| 107 | static const button_t buttons[] = { |
| 108 | /* modifier button function argument */ |
| 109 | { None, Button1, navigate, +1 }, |
| 110 | { None, Button3, navigate, -1 }, |
| 111 | { None, Button2, drag, None }, |
| 112 | { None, Button4, move, DIR_UP }, |
| 113 | { None, Button5, move, DIR_DOWN }, |
| 114 | { ShiftMask, Button4, move, DIR_LEFT }, |
| 115 | { ShiftMask, Button5, move, DIR_RIGHT }, |
| 116 | { ControlMask, Button4, zoom, +1 }, |
| 117 | { ControlMask, Button5, zoom, -1 }, |
| 118 | }; |
| 119 | |
| 120 | #endif |