Krolyxon
Commit b8fa2e8

Branches

Refs →

nsxivwindow.h

80 lines · 1.9 KB · Objective-C

1/* sxiv: window.h
2 * Copyright (c) 2011 Bert Muennich <be.muennich at googlemail.com>
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 WINDOW_H
20#define WINDOW_H
21
22#include <X11/Xlib.h>
23
24#include "types.h"
25
26typedef struct {
27 Display *dpy;
28 int scr;
29 int scrw, scrh;
30 Visual *vis;
31 Colormap cmap;
32 int depth;
33} win_env_t;
34
35typedef struct {
36 Window xwin;
37 win_env_t env;
38
39 unsigned long black;
40 unsigned long white;
41 unsigned long bgcol;
42 unsigned long selcol;
43 unsigned long barbgcol;
44 unsigned long barfgcol;
45 Pixmap pm;
46
47 int x;
48 int y;
49 unsigned int w;
50 unsigned int h;
51 unsigned int barh;
52 unsigned int bw;
53
54 bool fullscreen;
55
56 const char *lbar;
57 const char *rbar;
58} win_t;
59
60extern Atom wm_delete_win;
61
62void win_init(win_t*);
63void win_open(win_t*);
64void win_close(win_t*);
65
66bool win_configure(win_t*, XConfigureEvent*);
67bool win_moveresize(win_t*, int, int, unsigned int, unsigned int);
68
69void win_toggle_fullscreen(win_t*);
70
71void win_clear(win_t*);
72void win_draw(win_t*);
73void win_draw_rect(win_t*, Pixmap, int, int, int, int, bool, int,
74 unsigned long);
75
76void win_set_title(win_t*, const char*);
77void win_set_bar_info(win_t*, const char*, const char*);
78void win_set_cursor(win_t*, cursor_t);
79
80#endif /* WINDOW_H */