Krolyxon
Commit 535c18a

Branches

Refs →

nsxivconfig.h

119 lines · 5.6 KB · Objective-C

1#ifdef _WINDOW_CONFIG
2
3/* default window dimensions (overwritten via -g option): */
4enum { WIN_WIDTH = 800, WIN_HEIGHT = 600 };
5
6/* default color for window background: *
7 * (see X(7) "COLOR NAMES" section for valid values) */
8static const char * const BG_COLOR = "#777777";
9/* default color for thumbnail selection: */
10static 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 */
20static const scalemode_t SCALE_MODE = SCALE_DOWN;
21
22/* levels (percent) to use when zooming via '-' and '+': */
23static 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): */
32enum { THUMB_SIZE = 60 };
33
34#endif
35#ifdef _MAPPINGS_CONFIG
36
37/* keyboard mappings for image and thumbnail mode: */
38static 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 { True, XK_h, pan_screen, (arg_t) DIR_LEFT },
68 { True, XK_Left, pan_screen, (arg_t) DIR_LEFT },
69 { True, XK_j, pan_screen, (arg_t) DIR_DOWN },
70 { True, XK_Down, pan_screen, (arg_t) DIR_DOWN },
71 { True, XK_k, pan_screen, (arg_t) DIR_UP },
72 { True, XK_Up, pan_screen, (arg_t) DIR_UP },
73 { True, XK_l, pan_screen, (arg_t) DIR_RIGHT },
74 { True, XK_Right, pan_screen, (arg_t) DIR_RIGHT },
75
76 { False, XK_H, pan_edge, (arg_t) DIR_LEFT },
77 { False, XK_J, pan_edge, (arg_t) DIR_DOWN },
78 { False, XK_K, pan_edge, (arg_t) DIR_UP },
79 { False, XK_L, pan_edge, (arg_t) DIR_RIGHT },
80
81 { False, XK_plus, zoom, (arg_t) +1 },
82 { False, XK_equal, zoom, (arg_t) +1 },
83 { False, XK_KP_Add, zoom, (arg_t) +1 },
84 { False, XK_minus, zoom, (arg_t) -1 },
85 { False, XK_KP_Subtract, zoom, (arg_t) -1 },
86 { False, XK_0, zoom, (arg_t) None },
87 { False, XK_KP_0, zoom, (arg_t) None },
88 { False, XK_w, fit_to_win, (arg_t) None },
89 { False, XK_W, fit_to_img, (arg_t) None },
90
91 { False, XK_less, rotate, (arg_t) DIR_LEFT },
92 { False, XK_greater, rotate, (arg_t) DIR_RIGHT },
93
94 /* open the current image with given program: */
95 { True, XK_g, open_with, (arg_t) "gimp" },
96
97 /* run shell command line on the current file,
98 * '#' is replaced by filename: */
99 { True, XK_less, run_command, (arg_t) "mogrify -rotate -90 #" },
100 { True, XK_greater, run_command, (arg_t) "mogrify -rotate +90 #" },
101 { True, XK_comma, run_command, (arg_t) "jpegtran -rotate 270 -copy all -outfile # #" },
102 { True, XK_period, run_command, (arg_t) "jpegtran -rotate 90 -copy all -outfile # #" },
103};
104
105/* mouse button mappings for image mode: */
106static const button_t buttons[] = {
107 /* ctrl shift button function argument */
108 { False, False, Button1, navigate, (arg_t) +1 },
109 { False, False, Button3, navigate, (arg_t) -1 },
110 { False, False, Button2, drag, (arg_t) None },
111 { False, False, Button4, move, (arg_t) DIR_UP },
112 { False, False, Button5, move, (arg_t) DIR_DOWN },
113 { False, True, Button4, move, (arg_t) DIR_LEFT },
114 { False, True, Button5, move, (arg_t) DIR_RIGHT },
115 { True, False, Button4, zoom, (arg_t) +1 },
116 { True, False, Button5, zoom, (arg_t) -1 },
117};
118
119#endif