1 /* treewm - an X11 window manager.
2  * Copyright (c) 2001-2002 Thomas J�ger <TheHunter2000 at web dot de>
3  * This code is released under the terms of the GNU GPL.
4  * See the included file LICENSE for details.
5  *
6  * changed<05.02.2003> by Rudolf Polzer: replaced hash_map by map (for gcc 3.2)
7  */
8 
9 #ifndef CLIENTTREE_H
10 #define CLIENTTREE_H
11 
12 #include "global.h"
13 #include "desktop.h" // because of inline functions
14 #include "manager.h"
15 #include "uehandler.h"
16 #include <map>
17 #include <regex.h>
18 
19 struct WatchList {
20   ClientInfo *ci;
21   char *cmd;
22   Desktop *parent;
23   regex_t *preg;
24   char *wmclass;
25   long flags;
26   WatchList *next;
27 };
28 
29 typedef map<Window,TWindow *> Wmap;
30 typedef Wmap::value_type WmapPair;
31 typedef Wmap::iterator WmapIter;
32 
33 
34 class ClientTree {
35   public:
36     ClientTree();
37     ~ClientTree();
38     Client *AddWindow(Window);
39     char *GetWindowCommand(Window);
40     WatchList *GetWatches(char *, char *,XClassHint, Desktop *&);
41     void AddWatch(Desktop *,ClientInfo *,char *,char *,char *,long);
42     Client *FindClient(Window, Icon **);
43     void RemoveClientReferences(Client *);
44     inline Client *FindPointerClient();
45     Wmap windows;
46     Desktop *RootDesktop,*CurrentDesktop;
47     Client *Focus;
48     Client *MaxWindow;
49     char *notitle;
50     char *rootname;
51     int numregex,numcmd,numwmclass;
52     WatchList *watch;
53     Window RootBorder[4];
54 #ifdef VIDMODE
55     int ctVX,ctVY,ctVHeight,ctVWidth;
56 #endif
57 };
58 
FindPointerClient()59 inline Client *ClientTree::FindPointerClient() {
60   return RootDesktop->FindPointerClient();
61 };
62 
63 
64 extern ClientTree *ct;
65 
66 #endif
67