| 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 modify |
| 5 | * it under the terms of the GNU General Public License as published by |
| 6 | * the Free Software Foundation; either version 2 of the License, or |
| 7 | * (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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 17 | */ |
| 18 | |
| 19 | #ifndef EVENTS_H |
| 20 | #define EVENTS_H |
| 21 | |
| 22 | #include <X11/Xlib.h> |
| 23 | |
| 24 | typedef struct { |
| 25 | KeySym ksym; |
| 26 | Bool reload; |
| 27 | const char *cmdline; |
| 28 | } command_t; |
| 29 | |
| 30 | typedef int arg_t; |
| 31 | |
| 32 | typedef struct { |
| 33 | KeySym ksym; |
| 34 | int (*handler)(XEvent*, arg_t); |
| 35 | arg_t arg; |
| 36 | } keymap_t; |
| 37 | |
| 38 | typedef struct { |
| 39 | unsigned int mod; |
| 40 | unsigned int button; |
| 41 | int (*handler)(XEvent*, arg_t); |
| 42 | arg_t arg; |
| 43 | } button_t; |
| 44 | |
| 45 | void run(); |
| 46 | |
| 47 | /* handler functions for key and button mappings: */ |
| 48 | int quit(XEvent*, arg_t); |
| 49 | int reload(XEvent*, arg_t); |
| 50 | int toggle_fullscreen(XEvent*, arg_t); |
| 51 | int toggle_antialias(XEvent*, arg_t); |
| 52 | int toggle_alpha(XEvent*, arg_t); |
| 53 | int switch_mode(XEvent*, arg_t); |
| 54 | int navigate(XEvent*, arg_t); |
| 55 | int first(XEvent*, arg_t); |
| 56 | int last(XEvent*, arg_t); |
| 57 | int remove_image(XEvent*, arg_t); |
| 58 | int move(XEvent*, arg_t); |
| 59 | int pan_screen(XEvent*, arg_t); |
| 60 | int pan_edge(XEvent*, arg_t); |
| 61 | int drag(XEvent*, arg_t); |
| 62 | int rotate(XEvent*, arg_t); |
| 63 | int zoom(XEvent*, arg_t); |
| 64 | int fit_to_win(XEvent*, arg_t); |
| 65 | int fit_to_img(XEvent*, arg_t); |
| 66 | |
| 67 | #endif /* EVENTS_H */ |