Krolyxon
Commit 5105127

Branches

Refs →

nsxivconfig.def.h

146 lines · 6.4 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/* default slideshow delay (in sec, overwritten via -S option): */
33enum { SLIDESHOW_DELAY = 5 };
34
35/* default settings for multi-frame gif images: */
36enum {
37 GIF_DELAY = 100, /* delay time (in ms) */
38 GIF_AUTOPLAY = 1, /* autoplay when loaded [0/1] */
39 GIF_LOOP = 0 /* endless loop [0/1] */
40};
41
42#endif
43#ifdef _THUMBS_CONFIG
44
45/* default dimension of thumbnails (width == height): */
46enum { THUMB_SIZE = 60 };
47
48#endif
49#ifdef _MAPPINGS_CONFIG
50
51/* keyboard mappings for image and thumbnail mode: */
52static const keymap_t keys[] = {
53 /* ctrl key function argument */
54 { False, XK_q, it_quit, (arg_t) None },
55 { False, XK_Return, it_switch_mode, (arg_t) None },
56 { False, XK_f, it_toggle_fullscreen, (arg_t) None },
57
58 { False, XK_r, it_reload_image, (arg_t) None },
59 { False, XK_D, it_remove_image, (arg_t) None },
60
61 { False, XK_n, i_navigate, (arg_t) +1 },
62 { False, XK_space, i_navigate, (arg_t) +1 },
63 { False, XK_p, i_navigate, (arg_t) -1 },
64 { False, XK_BackSpace, i_navigate, (arg_t) -1 },
65 { False, XK_bracketright, i_navigate, (arg_t) +10 },
66 { False, XK_bracketleft, i_navigate, (arg_t) -10 },
67 { False, XK_g, it_first, (arg_t) None },
68 { False, XK_G, it_last, (arg_t) None },
69
70 { True, XK_n, i_navigate_frame, (arg_t) +1 },
71 { True, XK_p, i_navigate_frame, (arg_t) -1 },
72 { True, XK_space, i_toggle_animation, (arg_t) None },
73
74 { False, XK_h, it_move, (arg_t) DIR_LEFT },
75 { False, XK_Left, it_move, (arg_t) DIR_LEFT },
76 { False, XK_j, it_move, (arg_t) DIR_DOWN },
77 { False, XK_Down, it_move, (arg_t) DIR_DOWN },
78 { False, XK_k, it_move, (arg_t) DIR_UP },
79 { False, XK_Up, it_move, (arg_t) DIR_UP },
80 { False, XK_l, it_move, (arg_t) DIR_RIGHT },
81 { False, XK_Right, it_move, (arg_t) DIR_RIGHT },
82
83 { True, XK_h, i_pan_screen, (arg_t) DIR_LEFT },
84 { True, XK_Left, i_pan_screen, (arg_t) DIR_LEFT },
85 { True, XK_j, i_pan_screen, (arg_t) DIR_DOWN },
86 { True, XK_Down, i_pan_screen, (arg_t) DIR_DOWN },
87 { True, XK_k, i_pan_screen, (arg_t) DIR_UP },
88 { True, XK_Up, i_pan_screen, (arg_t) DIR_UP },
89 { True, XK_l, i_pan_screen, (arg_t) DIR_RIGHT },
90 { True, XK_Right, i_pan_screen, (arg_t) DIR_RIGHT },
91
92 { False, XK_H, i_pan_edge, (arg_t) DIR_LEFT },
93 { False, XK_J, i_pan_edge, (arg_t) DIR_DOWN },
94 { False, XK_K, i_pan_edge, (arg_t) DIR_UP },
95 { False, XK_L, i_pan_edge, (arg_t) DIR_RIGHT },
96
97 { False, XK_plus, i_zoom, (arg_t) +1 },
98 { False, XK_equal, i_zoom, (arg_t) +1 },
99 { False, XK_KP_Add, i_zoom, (arg_t) +1 },
100 { False, XK_minus, i_zoom, (arg_t) -1 },
101 { False, XK_KP_Subtract, i_zoom, (arg_t) -1 },
102 { False, XK_0, i_zoom, (arg_t) None },
103 { False, XK_KP_0, i_zoom, (arg_t) None },
104 { False, XK_w, i_fit_to_win, (arg_t) None },
105 { False, XK_W, i_fit_to_img, (arg_t) None },
106
107 { False, XK_less, i_rotate, (arg_t) DIR_LEFT },
108 { False, XK_greater, i_rotate, (arg_t) DIR_RIGHT },
109
110 { False, XK_s, i_toggle_slideshow, (arg_t) None },
111 { True, XK_plus, i_adjust_slideshow, (arg_t) +1 },
112 { True, XK_equal, i_adjust_slideshow, (arg_t) +1 },
113 { True, XK_minus, i_adjust_slideshow, (arg_t) -1 },
114
115 { False, XK_a, i_toggle_antialias, (arg_t) None },
116 { False, XK_A, it_toggle_alpha, (arg_t) None },
117
118 /* open current image with given program: */
119 { True, XK_g, it_open_with, (arg_t) "gimp" },
120
121 /* run shell command line on current file ("$SXIV_IMG"): */
122 { True, XK_less, it_shell_cmd, (arg_t) \
123 "mogrify -rotate -90 \"$SXIV_IMG\"" },
124 { True, XK_greater, it_shell_cmd, (arg_t) \
125 "mogrify -rotate +90 \"$SXIV_IMG\"" },
126 { True, XK_comma, it_shell_cmd, (arg_t) \
127 "jpegtran -rotate 270 -copy all -outfile \"$SXIV_IMG\" \"$SXIV_IMG\"" },
128 { True, XK_period, it_shell_cmd, (arg_t) \
129 "jpegtran -rotate 90 -copy all -outfile \"$SXIV_IMG\" \"$SXIV_IMG\"" },
130};
131
132/* mouse button mappings for image mode: */
133static const button_t buttons[] = {
134 /* ctrl shift button function argument */
135 { False, False, Button1, i_navigate, (arg_t) +1 },
136 { False, False, Button3, i_navigate, (arg_t) -1 },
137 { False, False, Button2, i_drag, (arg_t) None },
138 { False, False, Button4, it_move, (arg_t) DIR_UP },
139 { False, False, Button5, it_move, (arg_t) DIR_DOWN },
140 { False, True, Button4, it_move, (arg_t) DIR_LEFT },
141 { False, True, Button5, it_move, (arg_t) DIR_RIGHT },
142 { True, False, Button4, i_zoom, (arg_t) +1 },
143 { True, False, Button5, i_zoom, (arg_t) -1 },
144};
145
146#endif