Krolyxon
Commit 535c18a

Branches

Refs →

nsxivthumbs.h

64 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
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA.
17 */
18
19#ifndef THUMBS_H
20#define THUMBS_H
21
22#include <Imlib2.h>
23
24#include "types.h"
25#include "window.h"
26
27typedef struct {
28 Imlib_Image *im;
29 const fileinfo_t *file;
30 int x;
31 int y;
32 int w;
33 int h;
34} thumb_t;
35
36typedef struct {
37 thumb_t *thumbs;
38 int cap;
39 int cnt;
40 int x;
41 int y;
42 int cols;
43 int rows;
44 int first;
45 int sel;
46 unsigned char dirty;
47} tns_t;
48
49void tns_clean_cache(tns_t*);
50
51void tns_init(tns_t*, int);
52void tns_free(tns_t*);
53
54int tns_load(tns_t*, int, const fileinfo_t*, unsigned char);
55
56void tns_render(tns_t*, win_t*);
57void tns_highlight(tns_t*, win_t*, int, Bool);
58
59int tns_move_selection(tns_t*, win_t*, direction_t);
60int tns_scroll(tns_t*, direction_t);
61
62int tns_translate(tns_t*, int, int);
63
64#endif /* THUMBS_H */