From 1d749382f00bb0bfdb900b6ddb0bb8b3743b99d0 Mon Sep 17 00:00:00 2001 From: Bert Date: Fri, 19 Aug 2011 15:02:10 +0200 Subject: Put event handling back into main.c; events -> commands --- commands.h | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 commands.h (limited to 'commands.h') diff --git a/commands.h b/commands.h new file mode 100644 index 0000000..c249d29 --- /dev/null +++ b/commands.h @@ -0,0 +1,63 @@ +/* sxiv: commands.h + * Copyright (c) 2011 Bert Muennich + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef COMMANDS_H +#define COMMANDS_H + +#include + +typedef void* arg_t; +typedef int (*command_f)(arg_t); + +typedef struct { + Bool ctrl; + KeySym ksym; + command_f cmd; + arg_t arg; +} keymap_t; + +typedef struct { + Bool ctrl; + Bool shift; + unsigned int button; + command_f cmd; + arg_t arg; +} button_t; + +int it_quit(arg_t); +int it_switch_mode(arg_t); +int it_toggle_fullscreen(arg_t); +int it_reload_image(arg_t); +int it_remove_image(arg_t); +int i_navigate(arg_t); +int it_first(arg_t); +int it_last(arg_t); +int it_move(arg_t); +int i_pan_screen(arg_t); +int i_pan_edge(arg_t); +int i_drag(arg_t); +int i_zoom(arg_t); +int i_fit_to_win(arg_t); +int i_fit_to_img(arg_t); +int i_rotate(arg_t); +int i_toggle_antialias(arg_t); +int i_toggle_alpha(arg_t); +int it_open_with(arg_t); +int it_shell_cmd(arg_t); + +#endif /* COMMANDS_H */ -- cgit v1.2.3-54-g00ecf