]> Dogcows Code - chaz/openbox/blobdiff - src/XDisplay.h
XDisplay's nextEvent completed
[chaz/openbox] / src / XDisplay.h
index b65d94c67ce7c517d2a15b1873afbc5069d1a19d..b736fd423dd10dc95f88de702c165378979b1ad7 100644 (file)
 #include <X11/Xlib.h>
 #include <string>
 #include <vector>
+#include "XAtom.h"
+#include "XScreen.h"
 
-class Xdisplay {
-  friend XAtom::XAtom();
-  //friend class XAtom;
+class XDisplay {
+  friend XAtom::XAtom(const XDisplay *);
+  friend XScreen::XScreen(const XDisplay *, const unsigned int);
 
 private:
   Display       *_display;
@@ -39,8 +41,11 @@ private:
 
   typedef std::vector<XScreen*> XScreenList;
   XScreenList    _screens;
-  int XErrorHandler(Display *d, XErrorEvent *e);
+
+  // X error handling
+  static int XErrorHandler(Display *d, XErrorEvent *e);
+  static std::string _app_name;
+  static Window _last_bad_window;
 
   // no copying!!
   XDisplay(const XDisplay &);
@@ -50,18 +55,18 @@ protected:
   virtual void process_event(XEvent *) = 0;
 
 public:
-  Xdisplay(const char *dpyname = 0);
-  virtual ~Xdisplay();
+  XDisplay(const std::string &application_name, const char *dpyname = 0);
+  virtual ~XDisplay();
 
   XScreen *screen(unsigned int s) const;
   inline unsigned int screenCount() const { return _screens.size(); }
   
   inline bool hasShape() const { return _hasshape; }
-  inline int shapeEventBase() const { return shape.event_basep; }
+  inline int shapeEventBase() const { return _shape_event_base; }
 
   //inline Display *display() const { return _display; }
 
-  inline std::string name() const { return name; }
+  inline std::string name() const { return _name; }
 
   // these belong in Xwindow
   //const bool validateWindow(Window);
@@ -72,6 +77,8 @@ public:
   
   void grab();
   void ungrab();
+
+  bool nextEvent(XEvent &e);
 };
 
 #endif // _XDisplay_h
This page took 0.024851 seconds and 4 git commands to generate.