Krolyxon
Commit e82397d

Branches

Refs →

nsxivcommands.h

80 lines · 2.1 KB · Objective-C

1/* Copyright 2011 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 enum {
27 CMD_INVALID = -1,
28 CMD_OK = 0,
29 CMD_DIRTY = 1
30} cmdreturn_t;
31
32typedef void* arg_t;
33typedef cmdreturn_t (*command_f)(arg_t);
34
35typedef struct {
36 unsigned int mask;
37 KeySym ksym;
38 command_f cmd;
39 arg_t arg;
40} keymap_t;
41
42typedef struct {
43 unsigned int mask;
44 unsigned int button;
45 command_f cmd;
46 arg_t arg;
47} button_t;
48
49cmdreturn_t it_quit(arg_t);
50cmdreturn_t it_switch_mode(arg_t);
51cmdreturn_t it_toggle_fullscreen(arg_t);
52cmdreturn_t it_toggle_bar(arg_t);
53cmdreturn_t t_reload_all(arg_t);
54cmdreturn_t it_reload_image(arg_t);
55cmdreturn_t it_remove_image(arg_t);
56cmdreturn_t i_navigate(arg_t);
57cmdreturn_t i_alternate(arg_t);
58cmdreturn_t it_first(arg_t);
59cmdreturn_t it_n_or_last(arg_t);
60cmdreturn_t i_navigate_frame(arg_t);
61cmdreturn_t i_toggle_animation(arg_t);
62cmdreturn_t it_toggle_image_mark(arg_t);
63cmdreturn_t it_reverse_marks(arg_t);
64cmdreturn_t it_navigate_marked(arg_t);
65cmdreturn_t it_scroll_move(arg_t);
66cmdreturn_t it_scroll_screen(arg_t);
67cmdreturn_t i_scroll_to_edge(arg_t);
68cmdreturn_t i_drag(arg_t);
69cmdreturn_t i_zoom(arg_t);
70cmdreturn_t i_set_zoom(arg_t);
71cmdreturn_t i_fit_to_win(arg_t);
72cmdreturn_t i_fit_to_img(arg_t);
73cmdreturn_t i_rotate(arg_t);
74cmdreturn_t i_flip(arg_t);
75cmdreturn_t i_slideshow(arg_t);
76cmdreturn_t i_toggle_antialias(arg_t);
77cmdreturn_t it_toggle_alpha(arg_t);
78cmdreturn_t i_change_gamma(arg_t);
79
80#endif /* COMMANDS_H */