| 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 TYPES_H |
| 20 | #define TYPES_H |
| 21 | |
| 22 | #include <stdbool.h> |
| 23 | |
| 24 | typedef enum { |
| 25 | BO_BIG_ENDIAN, |
| 26 | BO_LITTLE_ENDIAN |
| 27 | } byteorder_t; |
| 28 | |
| 29 | typedef enum { |
| 30 | MODE_IMAGE, |
| 31 | MODE_THUMB |
| 32 | } appmode_t; |
| 33 | |
| 34 | typedef enum { |
| 35 | DIR_LEFT, |
| 36 | DIR_RIGHT, |
| 37 | DIR_UP, |
| 38 | DIR_DOWN |
| 39 | } direction_t; |
| 40 | |
| 41 | typedef enum { |
| 42 | FLIP_HORIZONTAL, |
| 43 | FLIP_VERTICAL |
| 44 | } flipdir_t; |
| 45 | |
| 46 | typedef enum { |
| 47 | SCALE_DOWN, |
| 48 | SCALE_FIT, |
| 49 | SCALE_WIDTH, |
| 50 | SCALE_HEIGHT, |
| 51 | SCALE_ZOOM |
| 52 | } scalemode_t; |
| 53 | |
| 54 | typedef enum { |
| 55 | CURSOR_ARROW, |
| 56 | CURSOR_NONE, |
| 57 | CURSOR_HAND, |
| 58 | CURSOR_WATCH |
| 59 | } cursor_t; |
| 60 | |
| 61 | typedef struct { |
| 62 | const char *name; /* as given by user */ |
| 63 | const char *path; /* always absolute */ |
| 64 | const char *base; |
| 65 | bool loaded; |
| 66 | } fileinfo_t; |
| 67 | |
| 68 | /* timeouts in milliseconds: */ |
| 69 | enum { |
| 70 | TO_REDRAW_RESIZE = 75, |
| 71 | TO_REDRAW_THUMBS = 200, |
| 72 | TO_CURSOR_HIDE = 1200 |
| 73 | }; |
| 74 | |
| 75 | typedef void (*timeout_f)(void); |
| 76 | |
| 77 | #endif /* TYPES_H */ |