summaryrefslogtreecommitdiffstats
path: root/config.h
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-07-22 14:49:06 +0200
committerBert <ber.t@gmx.com>2011-07-22 14:49:06 +0200
commita271e167443aedca2ed9c28b51fc6de33692dadb (patch)
tree01d2e58d2aa579de2abf8e609612721eb4a7b7dd /config.h
parent5f780fc3e77aef1f1b87fdd6662a7caee6efbc3b (diff)
downloadnsxiv-a271e167443aedca2ed9c28b51fc6de33692dadb.tar.zst
Reduced usage of preprocessor macros
Diffstat (limited to 'config.h')
-rw-r--r--config.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/config.h b/config.h
index 3bfd61f..d852091 100644
--- a/config.h
+++ b/config.h
@@ -1,19 +1,18 @@
/* default window dimensions (overwritten via -g option): */
-#define WIN_WIDTH 800
-#define WIN_HEIGHT 600
+enum { WIN_WIDTH = 800, WIN_HEIGHT = 600 };
/* default color for window background: *
* (see X(7) "COLOR NAMES" section for valid values) */
-#define BG_COLOR "#999999"
+static const char * const BG_COLOR = "#999999";
/* default color for thumbnail selection: */
-#define SEL_COLOR "#0066FF"
+static const char * const SEL_COLOR = "#0066FF";
/* how should images be scaled when they are loaded?: *
* (also controllable via -d/-s/-Z/-z options) *
* SCALE_DOWN: 100%, but fit large images into window, *
* SCALE_FIT: fit all images into window, *
* SCALE_ZOOM: use current zoom level, 100% at startup */
-#define SCALE_MODE SCALE_DOWN
+static const scalemode_t SCALE_MODE = SCALE_DOWN;
/* levels (percent) to use when zooming via '-' and '+': */
static const float zoom_levels[] = {
@@ -22,20 +21,16 @@ static const float zoom_levels[] = {
};
/* default dimension of thumbnails (width == height): */
-#define THUMB_SIZE 60
+enum { THUMB_SIZE = 60 };
/* enable external commands (defined below)? 0=off, 1=on: */
-#define EXT_COMMANDS 0
+enum { EXT_COMMANDS = 0 };
/* external commands and corresponding key mappings: */
-#ifdef MAIN_C
-#if EXT_COMMANDS
static const command_t commands[] = {
- /* ctrl-... reload? command, '#' is replaced by filename */
- { XK_comma, True, "jpegtran -rotate 270 -copy all -outfile # #" },
- { XK_period, True, "jpegtran -rotate 90 -copy all -outfile # #" },
- { XK_less, True, "mogrify -rotate -90 #" },
- { XK_greater, True, "mogrify -rotate +90 #" }
+ /* ctrl-... reload? command, '#' is replaced by filename */
+ { ',', 1, "jpegtran -rotate 270 -copy all -outfile # #" },
+ { '.', 1, "jpegtran -rotate 90 -copy all -outfile # #" },
+ { '<', 1, "mogrify -rotate -90 #" },
+ { '>', 1, "mogrify -rotate +90 #" }
};
-#endif
-#endif