Krolyxon
Commit f7301cf

Branches

Refs →

nsxivthumbs.h

69 lines · 1.4 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 const fileinfo_t *file;
30 Imlib_Image *im;
31 int w;
32 int h;
33 int x;
34 int y;
35} thumb_t;
36
37typedef struct {
38 thumb_t *thumbs;
39 int cap;
40 int cnt;
41 int first;
42 int sel;
43
44 win_t *win;
45 int x;
46 int y;
47 int cols;
48 int rows;
49
50 bool alpha;
51 bool dirty;
52} tns_t;
53
54void tns_clean_cache(tns_t*);
55
56void tns_init(tns_t*, int, win_t*);
57void tns_free(tns_t*);
58
59bool tns_load(tns_t*, int, const fileinfo_t*, bool, bool);
60
61void tns_render(tns_t*);
62void tns_highlight(tns_t*, int, bool);
63
64bool tns_move_selection(tns_t*, direction_t, int);
65bool tns_scroll(tns_t*, direction_t, bool);
66
67int tns_translate(tns_t*, int, int);
68
69#endif /* THUMBS_H */