X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2FBaseDisplay.h;h=b30a71700cc1a076bbf827fe9b7fd53395122a11;hb=f00ed578baacb73a36227fed1419e9d451ee7bb0;hp=2aa82d76c6ab675693355fed29253c79b8f49f5a;hpb=dfc5f034581f5a26cba5c4811500438f89f0634a;p=chaz%2Fopenbox diff --git a/src/BaseDisplay.h b/src/BaseDisplay.h index 2aa82d76..b30a7170 100644 --- a/src/BaseDisplay.h +++ b/src/BaseDisplay.h @@ -30,8 +30,11 @@ class BaseDisplay; class ScreenInfo; -#include "LinkedList.h" #include "Timer.h" +#include "Geometry.h" +#include "Util.h" +#include +#include #define AttribShaded (1l << 0) #define AttribMaxHoriz (1l << 1) @@ -126,8 +129,12 @@ private: Bool _startup, _shutdown; Display *display; - LinkedList *screenInfoList; - LinkedList *timerList; + + typedef std::vector ScreenInfoList; + ScreenInfoList screenInfoList; + + typedef std::list 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; } };