Krolyxon
Commit 1094def

Branches

Refs →

nsxivthumbs.h

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