]> icculus.org git repositories - dana/openbox.git/blob - loco/screen.h
ff46aa546054b653b72c731c6d82a552a1721080
[dana/openbox.git] / loco / screen.h
1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
2
3    screen.h for the Openbox compositor
4    Copyright (c) 2008        Dana Jansens
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    See the COPYING file for a copy of the GNU General Public License.
17 */
18
19 #ifndef loco__screen_h
20 #define loco__screen_h
21
22 #include <X11/Xlib.h>
23 #include <glib.h>
24 #include <GL/glx.h>
25
26 #define LOCO_SCREEN_MAX_DEPTH 32
27
28 struct _LocoWindow;
29 struct _LocoList;
30
31 typedef void (*BindEXTFunc)(Display *, GLXDrawable, int, const int *);
32 typedef void (*ReleaseEXTFunc)(Display *, GLXDrawable, int);
33
34 typedef struct _LocoScreen {
35     gint         ref;
36
37     gint         number;
38
39     //struct _Window *root;
40     Window          root;
41     Window          overlay;
42
43     GLXFBConfig  glxFBConfig[LOCO_SCREEN_MAX_DEPTH + 1];
44
45     gboolean     redraw;
46
47     /* Maps X Window ID -> LocoList* which is in the stacking_top/bottom list
48      */
49     GHashTable       *stacking_map;
50     /* The stacking list goes from top-most to bottom-most window */
51     struct _LocoList *stacking_top;
52     struct _LocoList *stacking_bottom;
53
54     BindEXTFunc    bindTexImageEXT;
55     ReleaseEXTFunc releaseTexImageEXT;
56 } LocoScreen;
57
58 LocoScreen* loco_screen_new(gint number);
59 void loco_screen_ref(LocoScreen *sc);
60 void loco_screen_unref(LocoScreen *sc);
61
62 void loco_screen_add_window(LocoScreen *sc, Window xwin);
63 void loco_screen_remove_window(LocoScreen *sc, struct _LocoWindow *lw);
64
65 struct _LocoWindow* loco_screen_find_window(LocoScreen *sc, Window xwin);
66 struct _LocoList* loco_screen_find_stacking(LocoScreen *sc, Window xwin);
67
68 void loco_screen_redraw(LocoScreen *sc);
69
70 void loco_screen_redraw_done(LocoScreen *sc);
71
72 #endif