Krolyxon
Commit 8fa7247

Branches

Refs →

nsxivthumbs.h

75 lines · 1.5 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 THUMBS_H
20#define THUMBS_H
21
22#include <X11/Xlib.h>
23#include <Imlib2.h>
24
25#include "types.h"
26#include "window.h"
27
28typedef struct {
29 Imlib_Image im;
30 int w;
31 int h;
32 int x;
33 int y;
34} thumb_t;
35
36typedef struct {
37 const fileinfo_t *files;
38 thumb_t *thumbs;
39 int cnt;
40 int loadnext;
41 int first, end;
42 int r_first, r_end;
43 int *sel;
44
45 win_t *win;
46 int x;
47 int y;
48 int cols;
49 int rows;
50 int zl;
51 int dim;
52
53 bool dirty;
54} tns_t;
55
56void tns_clean_cache(tns_t*);
57
58void tns_init(tns_t*, const fileinfo_t*, int, int*, win_t*);
59void tns_free(tns_t*);
60
61bool tns_load(tns_t*, int, bool);
62void tns_unload(tns_t*, int);
63
64void tns_render(tns_t*);
65void tns_mark(tns_t*, int, bool);
66void tns_highlight(tns_t*, int, bool);
67
68bool tns_move_selection(tns_t*, direction_t, int);
69bool tns_scroll(tns_t*, direction_t, bool);
70
71bool tns_zoom(tns_t*, int);
72
73int tns_translate(tns_t*, int, int);
74
75#endif /* THUMBS_H */