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: including namespace "std" (C++)
7  */
8 
9 #ifndef GLOBAL_H
10 #define GLOBAL_H
11 
12 #ifdef DEBUG2
13 #define DEBUG
14 #endif
15 
16 using namespace std;
17 
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include <X11/Xlib.h>
21 #include <X11/Xutil.h>
22 #include <cstring>
23 
24 #ifdef SHAPE
25 #include <X11/extensions/shape.h>
26 #endif
27 #ifdef DEBUG
28 #include <stdarg.h>
29 #endif
30 
31 #define TF_ISICON    (1L<<0)
32 
33 //Class Declarations
34 class TWindow {
35   public:
36   unsigned long flags;
37 };
38 class Manager;
39 class Client;
40 class Desktop;
41 class Icon;
42 class Action;
43 class ClientInfo;
44 class RPixmap;
45 class ClientTree;
46 class Section;
47 class ResManager;
48 class Sceme;
49 class UEHandler;
50 class Menu;
51 class Info {
52   public:
53     virtual ~Info();
54     virtual void Init() = 0;
55 };
56 class TextDialog;
57 
58 #define ButtonMask (ButtonPressMask|ButtonReleaseMask|ButtonMotionMask)
59 #define ChildMask (SubstructureRedirectMask|SubstructureNotifyMask)
60 #define MouseMask (ButtonPressMask|ButtonReleaseMask|PointerMotionMask)
61 
62 
63 extern Display *dpy;
64 extern ClientTree *ct;
65 extern UEHandler *UEH;
66 extern Manager *man;
67 extern ResManager *rman;
68 extern int screen;
69 extern Window root;
70 extern Atom wm_state, wm_change_state, wm_protos, wm_delete, wm_cmapwins, wm_client_leader,
71             mwm_hints;
72 
73 int handle_xerror(Display *dpy, XErrorEvent *e);
74 
75 #ifdef SHAPE
76 extern Bool shape;
77 extern int shape_event;
78 #endif
79 
80 void lower(char * str);
81 
82 #ifdef DEBUG
83 void ShowEvent(XEvent);
84 void err(const char *fmt, ...);
85 extern bool error;
86 #endif
87 
88 #define MAXTITLE 150
89 #define MAXICON 30
90 
91 #define UNDEF (-32768)
92 
93 
94 #endif
95