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