Krolyxon
Commit 390d771

Branches

Refs →

nsxivthumbs.h

76 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 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 bw;
52 int dim;
53
54 bool dirty;
55} tns_t;
56
57void tns_clean_cache(tns_t*);
58
59void tns_init(tns_t*, const fileinfo_t*, int, int*, win_t*);
60void tns_free(tns_t*);
61
62bool tns_load(tns_t*, int, bool);
63void tns_unload(tns_t*, int);
64
65void tns_render(tns_t*);
66void tns_mark(tns_t*, int, bool);
67void tns_highlight(tns_t*, int, bool);
68
69bool tns_move_selection(tns_t*, direction_t, int);
70bool tns_scroll(tns_t*, direction_t, bool);
71
72bool tns_zoom(tns_t*, int);
73
74int tns_translate(tns_t*, int, int);
75
76#endif /* THUMBS_H */