Krolyxon
Commit 8bce80f

Branches

Refs →

nsxivthumbs.h

77 lines · 1.6 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 fileinfo_t *files;
38 thumb_t *thumbs;
39 const int *cnt;
40 int *sel;
41 int initnext;
42 int loadnext;
43 int first, end;
44 int r_first, r_end;
45
46 win_t *win;
47 int x;
48 int y;
49 int cols;
50 int rows;
51 int zl;
52 int bw;
53 int dim;
54
55 bool dirty;
56} tns_t;
57
58void tns_clean_cache(tns_t*);
59
60void tns_init(tns_t*, fileinfo_t*, const int*, int*, win_t*);
61CLEANUP void tns_free(tns_t*);
62
63bool tns_load(tns_t*, int, bool, bool);
64void tns_unload(tns_t*, int);
65
66void tns_render(tns_t*);
67void tns_mark(tns_t*, int, bool);
68void tns_highlight(tns_t*, int, bool);
69
70bool tns_move_selection(tns_t*, direction_t, int);
71bool tns_scroll(tns_t*, direction_t, bool);
72
73bool tns_zoom(tns_t*, int);
74
75int tns_translate(tns_t*, int, int);
76
77#endif /* THUMBS_H */