Krolyxon
Commit e46b1fa

Branches

Refs →

nsxivtypes.h

96 lines · 1.8 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 TYPES_H
20#define TYPES_H
21
22#include <stdbool.h>
23
24/*
25 * Annotation for functions called in cleanup().
26 * These functions are not allowed to call error(!0, ...) or exit().
27 */
28#define CLEANUP
29
30typedef enum {
31 BO_BIG_ENDIAN,
32 BO_LITTLE_ENDIAN
33} byteorder_t;
34
35typedef enum {
36 MODE_IMAGE,
37 MODE_THUMB
38} appmode_t;
39
40typedef enum {
41 DIR_LEFT = 1,
42 DIR_RIGHT = 2,
43 DIR_UP = 4,
44 DIR_DOWN = 8
45} direction_t;
46
47typedef enum {
48 DEGREE_90 = 1,
49 DEGREE_180 = 2,
50 DEGREE_270 = 3
51} degree_t;
52
53typedef enum {
54 FLIP_HORIZONTAL = 1,
55 FLIP_VERTICAL = 2
56} flipdir_t;
57
58typedef enum {
59 SCALE_DOWN,
60 SCALE_FIT,
61 SCALE_WIDTH,
62 SCALE_HEIGHT,
63 SCALE_ZOOM
64} scalemode_t;
65
66typedef enum {
67 CURSOR_ARROW,
68 CURSOR_NONE,
69 CURSOR_HAND,
70 CURSOR_WATCH
71} cursor_t;
72
73typedef enum {
74 FF_WARN = 1,
75 FF_MARK = 2,
76 FF_TN_INIT = 4
77} fileflags_t;
78
79typedef struct {
80 const char *name; /* as given by user */
81 const char *path; /* always absolute */
82 const char *base;
83 fileflags_t flags;
84} fileinfo_t;
85
86/* timeouts in milliseconds: */
87enum {
88 TO_REDRAW_RESIZE = 75,
89 TO_REDRAW_THUMBS = 200,
90 TO_CURSOR_HIDE = 1200,
91 TO_DOUBLE_CLICK = 300
92};
93
94typedef void (*timeout_f)(void);
95
96#endif /* TYPES_H */