Krolyxon
Commit 348707a

Branches

Refs →

nsxivthumbs.h

66 lines · 1.5 KB · Objective-C

1/* sxiv: thumbs.h
2 * Copyright (c) 2011 Bert Muennich <muennich at informatik.hu-berlin.de>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
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 const fileinfo_t *file;
31 int x;
32 int y;
33 int w;
34 int h;
35} thumb_t;
36
37typedef struct {
38 thumb_t *thumbs;
39 int cap;
40 int cnt;
41 int x;
42 int y;
43 int cols;
44 int rows;
45 int first;
46 int sel;
47 unsigned char alpha;
48 unsigned char dirty;
49} tns_t;
50
51void tns_clean_cache(tns_t*);
52
53void tns_init(tns_t*, int);
54void tns_free(tns_t*);
55
56int tns_load(tns_t*, int, const fileinfo_t*, Bool, Bool);
57
58void tns_render(tns_t*, win_t*);
59void tns_highlight(tns_t*, win_t*, int, Bool);
60
61int tns_move_selection(tns_t*, win_t*, direction_t);
62int tns_scroll(tns_t*, direction_t);
63
64int tns_translate(tns_t*, int, int);
65
66#endif /* THUMBS_H */