| 1 | /* sxiv: events.h |
| 2 | * Copyright (c) 2011 Bert Muennich <muennich at informatik.hu-berlin.de> |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; either version 2 |
| 7 | * of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA. |
| 17 | */ |
| 18 | |
| 19 | #ifndef EVENTS_H |
| 20 | #define EVENTS_H |
| 21 | |
| 22 | #include <X11/Xlib.h> |
| 23 | |
| 24 | typedef void* arg_t; |
| 25 | |
| 26 | typedef struct { |
| 27 | Bool ctrl; |
| 28 | KeySym ksym; |
| 29 | int (*handler)(arg_t); |
| 30 | arg_t arg; |
| 31 | } keymap_t; |
| 32 | |
| 33 | typedef struct { |
| 34 | Bool ctrl; |
| 35 | Bool shift; |
| 36 | unsigned int button; |
| 37 | int (*handler)(arg_t); |
| 38 | arg_t arg; |
| 39 | } button_t; |
| 40 | |
| 41 | void run(); |
| 42 | |
| 43 | /* handler functions for key and button mappings: */ |
| 44 | int quit(arg_t); |
| 45 | int reload(arg_t); |
| 46 | int toggle_fullscreen(arg_t); |
| 47 | int toggle_antialias(arg_t); |
| 48 | int toggle_alpha(arg_t); |
| 49 | int switch_mode(arg_t); |
| 50 | int navigate(arg_t); |
| 51 | int first(arg_t); |
| 52 | int last(arg_t); |
| 53 | int remove_image(arg_t); |
| 54 | int move(arg_t); |
| 55 | int pan_screen(arg_t); |
| 56 | int pan_edge(arg_t); |
| 57 | int drag(arg_t); |
| 58 | int rotate(arg_t); |
| 59 | int zoom(arg_t); |
| 60 | int fit_to_win(arg_t); |
| 61 | int fit_to_img(arg_t); |
| 62 | int open_with(arg_t); |
| 63 | int run_command(arg_t); |
| 64 | |
| 65 | #endif /* EVENTS_H */ |