Krolyxon
Commit 0e81802

Branches

Refs →

nsxivconfig.def.h

170 lines · 7.5 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/* bar font:
10 * (see X(7) section "FONT NAMES" for valid values)
11 */
12static const char * const BAR_FONT = "-*-fixed-medium-r-*-*-13-*-*-*-*-60-*-*";
13
14/* colors:
15 * (see X(7) section "COLOR NAMES" for valid values)
16 */
17static const char * const WIN_BG_COLOR = "#777777";
18static const char * const WIN_FS_COLOR = "#000000";
19static const char * const SEL_COLOR = "#DDDDDD";
20static const char * const BAR_BG_COLOR = "#222222";
21static const char * const BAR_FG_COLOR = "#EEEEEE";
22
23#endif
24#ifdef _IMAGE_CONFIG
25
26/* how should images be scaled when they are loaded?
27 * (also controllable via -d/-s/-Z/-z options)
28 * SCALE_DOWN: 100%, but fit large images into window,
29 * SCALE_FIT: fit all images into window,
30 * SCALE_ZOOM: use current zoom level, 100% at startup
31 */
32static const scalemode_t SCALE_MODE = SCALE_DOWN;
33
34/* levels (in percent) to use when zooming via '-' and '+':
35 * (first/last value is used as min/max zoom level)
36 */
37static const float zoom_levels[] = {
38 12.5, 25.0, 50.0, 75.0,
39 100.0, 150.0, 200.0, 400.0, 800.0
40};
41
42/* default settings for multi-frame gif images: */
43enum {
44 GIF_DELAY = 100, /* delay time (in ms) */
45 GIF_AUTOPLAY = 1, /* autoplay when loaded [0/1] */
46 GIF_LOOP = 0 /* loop? [0: no, 1: endless, -1: as specified in file] */
47};
48
49/* gamma correction: the user-visible ranges [-GAMMA_RANGE, 0] and
50 * (0, GAMMA_RANGE] are mapped to the ranges [0, 1], and (1, GAMMA_MAX].
51 * */
52static const double GAMMA_MAX = 10.0;
53static const int GAMMA_RANGE = 32;
54
55#endif
56#ifdef _THUMBS_CONFIG
57
58/* default dimension of thumbnails (width == height): */
59enum { THUMB_SIZE = 60 };
60
61#endif
62#ifdef _RENDER_CONFIG
63
64/* if false, pixelate images at zoom level != 100%,
65 * toggled with 'a' key binding
66 */
67static const bool RENDER_ANTI_ALIAS = true;
68
69/* if true, use white background for alpha layer,
70 * toggled with 'A' key binding
71 */
72static const bool RENDER_WHITE_ALPHA = false;
73
74#endif
75#ifdef _MAPPINGS_CONFIG
76
77/* keyboard mappings for image and thumbnail mode: */
78static const keymap_t keys[] = {
79 /* modifiers key function argument */
80 { 0, XK_q, it_quit, (arg_t) None },
81 { 0, XK_Return, it_switch_mode, (arg_t) None },
82 { 0, XK_f, it_toggle_fullscreen, (arg_t) None },
83 { 0, XK_b, it_toggle_bar, (arg_t) None },
84
85 { 0, XK_r, it_reload_image, (arg_t) None },
86 { 0, XK_R, t_reload_all, (arg_t) None },
87 { 0, XK_D, it_remove_image, (arg_t) None },
88
89 { 0, XK_n, i_navigate, (arg_t) +1 },
90 { 0, XK_space, i_navigate, (arg_t) +1 },
91 { 0, XK_p, i_navigate, (arg_t) -1 },
92 { 0, XK_BackSpace, i_navigate, (arg_t) -1 },
93 { 0, XK_bracketright, i_navigate, (arg_t) +10 },
94 { 0, XK_bracketleft, i_navigate, (arg_t) -10 },
95 { ControlMask, XK_6, i_alternate, (arg_t) None },
96 { 0, XK_g, it_first, (arg_t) None },
97 { 0, XK_G, it_n_or_last, (arg_t) None },
98
99 { ControlMask, XK_n, i_navigate_frame, (arg_t) +1 },
100 { ControlMask, XK_p, i_navigate_frame, (arg_t) -1 },
101 { ControlMask, XK_space, i_toggle_animation, (arg_t) None },
102
103 { 0, XK_m, it_toggle_image_mark, (arg_t) None },
104 { 0, XK_M, it_reverse_marks, (arg_t) None },
105 { 0, XK_N, it_navigate_marked, (arg_t) +1 },
106 { 0, XK_P, it_navigate_marked, (arg_t) -1 },
107
108 { 0, XK_h, it_scroll_move, (arg_t) DIR_LEFT },
109 { 0, XK_Left, it_scroll_move, (arg_t) DIR_LEFT },
110 { 0, XK_j, it_scroll_move, (arg_t) DIR_DOWN },
111 { 0, XK_Down, it_scroll_move, (arg_t) DIR_DOWN },
112 { 0, XK_k, it_scroll_move, (arg_t) DIR_UP },
113 { 0, XK_Up, it_scroll_move, (arg_t) DIR_UP },
114 { 0, XK_l, it_scroll_move, (arg_t) DIR_RIGHT },
115 { 0, XK_Right, it_scroll_move, (arg_t) DIR_RIGHT },
116
117 { ControlMask, XK_h, it_scroll_screen, (arg_t) DIR_LEFT },
118 { ControlMask, XK_Left, it_scroll_screen, (arg_t) DIR_LEFT },
119 { ControlMask, XK_j, it_scroll_screen, (arg_t) DIR_DOWN },
120 { ControlMask, XK_Down, it_scroll_screen, (arg_t) DIR_DOWN },
121 { ControlMask, XK_k, it_scroll_screen, (arg_t) DIR_UP },
122 { ControlMask, XK_Up, it_scroll_screen, (arg_t) DIR_UP },
123 { ControlMask, XK_l, it_scroll_screen, (arg_t) DIR_RIGHT },
124 { ControlMask, XK_Right, it_scroll_screen, (arg_t) DIR_RIGHT },
125
126 { 0, XK_H, i_scroll_to_edge, (arg_t) DIR_LEFT },
127 { 0, XK_J, i_scroll_to_edge, (arg_t) DIR_DOWN },
128 { 0, XK_K, i_scroll_to_edge, (arg_t) DIR_UP },
129 { 0, XK_L, i_scroll_to_edge, (arg_t) DIR_RIGHT },
130
131 { 0, XK_plus, i_zoom, (arg_t) +1 },
132 { 0, XK_KP_Add, i_zoom, (arg_t) +1 },
133 { 0, XK_minus, i_zoom, (arg_t) -1 },
134 { 0, XK_KP_Subtract, i_zoom, (arg_t) -1 },
135 { 0, XK_equal, i_set_zoom, (arg_t) 100 },
136 { 0, XK_w, i_fit_to_win, (arg_t) SCALE_FIT },
137 { 0, XK_e, i_fit_to_win, (arg_t) SCALE_WIDTH },
138 { 0, XK_E, i_fit_to_win, (arg_t) SCALE_HEIGHT },
139 { 0, XK_W, i_fit_to_img, (arg_t) None },
140
141 { 0, XK_less, i_rotate, (arg_t) DEGREE_270 },
142 { 0, XK_greater, i_rotate, (arg_t) DEGREE_90 },
143 { 0, XK_question, i_rotate, (arg_t) DEGREE_180 },
144
145 { 0, XK_bar, i_flip, (arg_t) FLIP_HORIZONTAL },
146 { 0, XK_underscore, i_flip, (arg_t) FLIP_VERTICAL },
147
148 { 0, XK_a, i_toggle_antialias, (arg_t) None },
149 { 0, XK_A, it_toggle_alpha, (arg_t) None },
150
151 { 0, XK_braceleft, i_change_gamma, (arg_t) -1 },
152 { 0, XK_braceright, i_change_gamma, (arg_t) +1 },
153 { ControlMask, XK_G, i_change_gamma, (arg_t) 0 },
154};
155
156/* mouse button mappings for image mode: */
157static const button_t buttons[] = {
158 /* modifiers button function argument */
159 { 0, Button1, i_navigate, (arg_t) +1 },
160 { 0, Button3, i_navigate, (arg_t) -1 },
161 { 0, Button2, i_drag, (arg_t) None },
162 { 0, Button4, it_scroll_move, (arg_t) DIR_UP },
163 { 0, Button5, it_scroll_move, (arg_t) DIR_DOWN },
164 { ShiftMask, Button4, it_scroll_move, (arg_t) DIR_LEFT },
165 { ShiftMask, Button5, it_scroll_move, (arg_t) DIR_RIGHT },
166 { ControlMask, Button4, i_zoom, (arg_t) +1 },
167 { ControlMask, Button5, i_zoom, (arg_t) -1 },
168};
169
170#endif