]> Dogcows Code - chaz/openbox/blobdiff - src/BaseDisplay.h
new focus code! working better than ever!
[chaz/openbox] / src / BaseDisplay.h
index 2aa82d76c6ab675693355fed29253c79b8f49f5a..b30a71700cc1a076bbf827fe9b7fd53395122a11 100644 (file)
 class BaseDisplay;
 class ScreenInfo;
 
-#include "LinkedList.h"
 #include "Timer.h"
+#include "Geometry.h"
+#include "Util.h"
+#include <vector>
+#include <list>
 
 #define AttribShaded      (1l << 0)
 #define AttribMaxHoriz    (1l << 1)
@@ -126,8 +129,12 @@ private:
 
   Bool _startup, _shutdown;
   Display *display;
-  LinkedList<ScreenInfo> *screenInfoList;
-  LinkedList<BTimer> *timerList;
+
+  typedef std::vector<ScreenInfo*> ScreenInfoList;
+  ScreenInfoList screenInfoList;
+  typedef std::list<BTimer*> TimerList;
+  TimerList timerList;
 
   char *display_name, *application_name;
   int number_of_screens, server_grabs, colors_per_channel;
@@ -142,7 +149,7 @@ protected:
 
 
 public:
-  BaseDisplay(char *, char * = 0);
+  BaseDisplay(const char *, char * = 0);
   virtual ~BaseDisplay(void);
 
   inline const Atom &getWMChangeStateAtom(void) const
@@ -269,8 +276,10 @@ public:
 
 #endif // NEWWMSPEC
 
-  inline ScreenInfo *getScreenInfo(int s)
-    { return (ScreenInfo *) screenInfoList->find(s); }
+  inline ScreenInfo *getScreenInfo(int s) {
+    ASSERT(s < screenInfoList.size());
+    return screenInfoList[s];
+  }
 
   inline const Bool &hasShapeExtensions(void) const
     { return shape.extensions; }
@@ -328,19 +337,19 @@ public:
 
 class ScreenInfo {
 private:
-  BaseDisplay *basedisplay;
+  BaseDisplay &basedisplay;
   Visual *visual;
   Window root_window;
   Colormap colormap;
 
   int depth, screen_number;
-  unsigned int width, height;
+  Size m_size;
 
 
 public:
-  ScreenInfo(BaseDisplay *, int);
+  ScreenInfo(BaseDisplay &, int);
 
-  inline BaseDisplay *getBaseDisplay(void) { return basedisplay; }
+  inline BaseDisplay &getBaseDisplay(void) { return basedisplay; }
 
   inline Visual *getVisual(void) { return visual; }
   inline const Window &getRootWindow(void) const { return root_window; }
@@ -349,8 +358,9 @@ public:
   inline const int &getDepth(void) const { return depth; }
   inline const int &getScreenNumber(void) const { return screen_number; }
 
-  inline const unsigned int &getWidth(void) const { return width; }
-  inline const unsigned int &getHeight(void) const { return height; }
+//  inline const unsigned int &getWidth(void) const { return width; }
+//  inline const unsigned int &getHeight(void) const { return height; }
+  inline const Size &size() const { return m_size; }
 };
 
 
This page took 0.023441 seconds and 4 git commands to generate.