Krolyxon
Commit 5c607ad

Branches

Refs →

nsxivcommands.h

59 lines · 1.2 KB · Objective-C

1/* Copyright 2011, 2014 Bert Muennich
2 *
3 * This file is part of sxiv.
4 *
5 * sxiv is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published
7 * by the Free Software Foundation; either version 2 of the License,
8 * or (at your option) any later version.
9 *
10 * sxiv is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with sxiv. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef COMMANDS_H
20#define COMMANDS_H
21
22#include <X11/Xlib.h>
23
24#include "types.h"
25
26typedef int arg_t;
27typedef bool (*cmd_f)(arg_t);
28
29#define G_CMD(c) g_##c,
30#define I_CMD(c) i_##c,
31#define T_CMD(c) t_##c,
32
33typedef enum {
34#include "commands.lst"
35 CMD_COUNT
36} cmd_id_t;
37
38typedef struct {
39 int mode;
40 cmd_f func;
41} cmd_t;
42
43typedef struct {
44 unsigned int mask;
45 KeySym ksym;
46 cmd_id_t cmd;
47 arg_t arg;
48} keymap_t;
49
50typedef struct {
51 unsigned int mask;
52 unsigned int button;
53 cmd_id_t cmd;
54 arg_t arg;
55} button_t;
56
57const extern cmd_t cmds[CMD_COUNT];
58
59#endif /* COMMANDS_H */