Krolyxon
Commit a4b90ae

Branches

Refs →

nsxivconfig.h

126 lines · 5.7 KB · Objective-C

1#ifdef _WINDOW_CONFIG
2
3/* default window dimensions (overwritten via -g option): */
4enum {
5 WIN_WIDTH = 800,
6 WIN_HEIGHT = 600
7};
8
9/* default color for window background: */
10static const char * const BG_COLOR = "#777777";
11/* default color for thumbnail selection: */
12static 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 */
24static const scalemode_t SCALE_MODE = SCALE_DOWN;
25
26/* levels (percent) to use when zooming via '-' and '+': */
27static 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#endif
33#ifdef _THUMBS_CONFIG
34
35/* default dimension of thumbnails (width == height): */
36enum { THUMB_SIZE = 60 };
37
38#endif
39#ifdef _MAPPINGS_CONFIG
40
41/* keyboard mappings for image and thumbnail mode: */
42static const keymap_t keys[] = {
43 /* ctrl key function argument */
44 { False, XK_q, it_quit, (arg_t) None },
45 { False, XK_Return, it_switch_mode, (arg_t) None },
46 { False, XK_f, it_toggle_fullscreen, (arg_t) None },
47
48 { False, XK_r, it_reload_image, (arg_t) None },
49 { False, XK_D, it_remove_image, (arg_t) None },
50
51 { False, XK_n, i_navigate, (arg_t) +1 },
52 { False, XK_space, i_navigate, (arg_t) +1 },
53 { False, XK_p, i_navigate, (arg_t) -1 },
54 { False, XK_BackSpace, i_navigate, (arg_t) -1 },
55 { False, XK_bracketright, i_navigate, (arg_t) +10 },
56 { False, XK_bracketleft, i_navigate, (arg_t) -10 },
57 { False, XK_g, it_first, (arg_t) None },
58 { False, XK_G, it_last, (arg_t) None },
59
60 { False, XK_N, i_navigate_frame, (arg_t) +1 },
61 { False, XK_P, i_navigate_frame, (arg_t) -1 },
62
63 { False, XK_h, it_move, (arg_t) DIR_LEFT },
64 { False, XK_Left, it_move, (arg_t) DIR_LEFT },
65 { False, XK_j, it_move, (arg_t) DIR_DOWN },
66 { False, XK_Down, it_move, (arg_t) DIR_DOWN },
67 { False, XK_k, it_move, (arg_t) DIR_UP },
68 { False, XK_Up, it_move, (arg_t) DIR_UP },
69 { False, XK_l, it_move, (arg_t) DIR_RIGHT },
70 { False, XK_Right, it_move, (arg_t) DIR_RIGHT },
71
72 { True, XK_h, i_pan_screen, (arg_t) DIR_LEFT },
73 { True, XK_Left, i_pan_screen, (arg_t) DIR_LEFT },
74 { True, XK_j, i_pan_screen, (arg_t) DIR_DOWN },
75 { True, XK_Down, i_pan_screen, (arg_t) DIR_DOWN },
76 { True, XK_k, i_pan_screen, (arg_t) DIR_UP },
77 { True, XK_Up, i_pan_screen, (arg_t) DIR_UP },
78 { True, XK_l, i_pan_screen, (arg_t) DIR_RIGHT },
79 { True, XK_Right, i_pan_screen, (arg_t) DIR_RIGHT },
80
81 { False, XK_H, i_pan_edge, (arg_t) DIR_LEFT },
82 { False, XK_J, i_pan_edge, (arg_t) DIR_DOWN },
83 { False, XK_K, i_pan_edge, (arg_t) DIR_UP },
84 { False, XK_L, i_pan_edge, (arg_t) DIR_RIGHT },
85
86 { False, XK_plus, i_zoom, (arg_t) +1 },
87 { False, XK_equal, i_zoom, (arg_t) +1 },
88 { False, XK_KP_Add, i_zoom, (arg_t) +1 },
89 { False, XK_minus, i_zoom, (arg_t) -1 },
90 { False, XK_KP_Subtract, i_zoom, (arg_t) -1 },
91 { False, XK_0, i_zoom, (arg_t) None },
92 { False, XK_KP_0, i_zoom, (arg_t) None },
93 { False, XK_w, i_fit_to_win, (arg_t) None },
94 { False, XK_W, i_fit_to_img, (arg_t) None },
95
96 { False, XK_less, i_rotate, (arg_t) DIR_LEFT },
97 { False, XK_greater, i_rotate, (arg_t) DIR_RIGHT },
98
99 { False, XK_a, i_toggle_antialias, (arg_t) None },
100 { False, XK_A, i_toggle_alpha, (arg_t) None },
101
102 /* open current image with given program: */
103 { True, XK_g, it_open_with, (arg_t) "gimp" },
104
105 /* run shell command line on current file ('#' is replaced by file path: */
106 { True, XK_less, it_shell_cmd, (arg_t) "mogrify -rotate -90 #" },
107 { True, XK_greater, it_shell_cmd, (arg_t) "mogrify -rotate +90 #" },
108 { True, XK_comma, it_shell_cmd, (arg_t) "jpegtran -rotate 270 -copy all -outfile # #" },
109 { True, XK_period, it_shell_cmd, (arg_t) "jpegtran -rotate 90 -copy all -outfile # #" },
110};
111
112/* mouse button mappings for image mode: */
113static const button_t buttons[] = {
114 /* ctrl shift button function argument */
115 { False, False, Button1, i_navigate, (arg_t) +1 },
116 { False, False, Button3, i_navigate, (arg_t) -1 },
117 { False, False, Button2, i_drag, (arg_t) None },
118 { False, False, Button4, it_move, (arg_t) DIR_UP },
119 { False, False, Button5, it_move, (arg_t) DIR_DOWN },
120 { False, True, Button4, it_move, (arg_t) DIR_LEFT },
121 { False, True, Button5, it_move, (arg_t) DIR_RIGHT },
122 { True, False, Button4, i_zoom, (arg_t) +1 },
123 { True, False, Button5, i_zoom, (arg_t) -1 },
124};
125
126#endif