Krolyxon
Commit 5a68242

Branches

Refs →

nsxivwindow.h

69 lines · 1.6 KB · Objective-C

1/* sxiv: window.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
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19#ifndef WINDOW_H
20#define WINDOW_H
21
22#include <X11/Xlib.h>
23
24#define CLEANMASK(mask) ((mask) & ~LockMask)
25
26typedef enum win_cur_e {
27 CURSOR_ARROW = 0,
28 CURSOR_HAND
29} win_cur_t;
30
31typedef struct win_env_s {
32 Display *dpy;
33 int scr;
34 int scrw, scrh;
35 Visual *vis;
36 Colormap cmap;
37 int depth;
38} win_env_t;
39
40typedef struct win_s {
41 Window xwin;
42 win_env_t env;
43
44 unsigned long bgcol;
45 Pixmap pm;
46
47 int x;
48 int y;
49 unsigned int w;
50 unsigned int h;
51
52 unsigned int bw;
53 unsigned char fullscreen;
54} win_t;
55
56void win_open(win_t*);
57void win_close(win_t*);
58
59void win_set_title(win_t*, const char*);
60
61int win_configure(win_t*, XConfigureEvent*);
62void win_toggle_fullscreen(win_t*);
63
64void win_clear(win_t*);
65void win_draw(win_t*);
66
67void win_set_cursor(win_t*, win_cur_t);
68
69#endif /* WINDOW_H */