Merged commands.h into config.h

This commit is contained in:
Bert 2011-04-14 12:00:35 +02:00
parent 75c79bef6f
commit c58307ba38
3 changed files with 33 additions and 29 deletions

View File

@ -1,13 +0,0 @@
typedef struct {
KeySym ksym;
Bool reload;
const char *cmdline;
} command_t;
static 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 #" }
};

View File

@ -24,5 +24,18 @@ static const float zoom_levels[] = {
/* default dimension of thumbnails (width == height): */
#define THUMB_SIZE 60
/* support for external commands (defined in commands.h): */
/* enable support for external commands (see below)?: */
#define 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 #" }
};
#endif
#endif

14
main.c
View File

@ -29,17 +29,12 @@
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include "config.h"
#include "image.h"
#include "options.h"
#include "thumbs.h"
#include "util.h"
#include "window.h"
#if EXT_COMMANDS
#include "commands.h"
#endif
#define FNAME_CNT 1024
#define TITLE_LEN 256
@ -48,11 +43,20 @@
#define TO_CURSOR_HIDE 1500000
#define TO_THUMBS_LOAD 75000
typedef struct {
KeySym ksym;
Bool reload;
const char *cmdline;
} command_t;
typedef enum {
MODE_NORMAL = 0,
MODE_THUMBS
} appmode_t;
#define MAIN_C
#include "config.h"
void run();
appmode_t mode;