1 /* Skippy - Seduces Kids Into Perversion
2  *
3  * Copyright (C) 2004 Hyriand <hyriand@thegraveyard.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program 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 this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19 
20 #ifndef SKIPPY_MAINWIN_H
21 #define SKIPPY_MAINWIN_H
22 
23 struct _Tooltip;
24 
25 struct _mainwin_t {
26 	session_t *ps;
27 	Visual *visual;
28 	Colormap colormap;
29 	int depth;
30 	dlist *clients;
31 
32 	/// @brief Whether the KeyRelease events should already be acceptable.
33 	bool pressed_key;
34 	/// @brief Whether the ButtonRelease events should already be acceptable.
35 	bool pressed_mouse;
36 	int poll_time;
37 
38 	Window window;
39 	Picture background;
40 	Pixmap bg_pixmap;
41 	int x, y;
42 	unsigned int width, height, distance;
43 	XRenderPictFormat *format;
44 	XTransform transform;
45 
46 	XRenderColor normalTint, highlightTint;
47 	Pixmap normalPixmap, highlightPixmap;
48 	Picture normalPicture, highlightPicture;
49 
50 	ClientWin *pressed, *focus;
51 	dlist *cod;
52 	struct _Tooltip *tooltip;
53 
54 	KeyCode key_act, key_up, key_down, key_left, key_right,
55 		key_h, key_j, key_k, key_l,
56 		key_enter, key_space, key_q, key_escape;
57 
58 #ifdef CFG_XINERAMA
59 	int xin_screens;
60 	XineramaScreenInfo *xin_info, *xin_active;
61 #endif /* CFG_XINERAMA */
62 
63 	/// @brief Window ID to revert focus to when the main window is unmapped.
64 	Window revert_focus_win;
65 	/// @brief The client window to eventually focus.
66 	ClientWin *client_to_focus;
67 };
68 
69 MainWin *mainwin_create(session_t *ps);
70 void mainwin_destroy(MainWin *);
71 void mainwin_map(MainWin *);
72 void mainwin_unmap(MainWin *);
73 int mainwin_handle(MainWin *, XEvent *);
74 void mainwin_update_background(MainWin *mw);
75 void mainwin_update(MainWin *mw);
76 void mainwin_transform(MainWin *mw, float f);
77 
78 #endif /* SKIPPY_MAINWIN_H */
79