X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fopenbox.h;h=009b57fcd3fd6830f8363838900e4ee859b08066;hb=935b35c6a6746b748155351558496604759baae4;hp=eae8bcff544f1901a42811711d11ac9489e684cb;hpb=4602d87180951a4b7a40283a2fb77f31cad4d789;p=chaz%2Fopenbox diff --git a/src/openbox.h b/src/openbox.h index eae8bcff..009b57fc 100644 --- a/src/openbox.h +++ b/src/openbox.h @@ -42,10 +42,13 @@ #endif // TIME_WITH_SYS_TIME #include "Resource.h" -#include "LinkedList.h" #include "BaseDisplay.h" #include "Timer.h" +#include +#include +#include + //forward declaration class BScreen; class Openbox; @@ -74,6 +77,10 @@ public: class Openbox : public BaseDisplay, public TimeoutHandler { private: typedef struct MenuTimestamp { + virtual ~MenuTimestamp() { + if (filename != (char *) 0) + delete [] filename; + } char *filename; time_t timestamp; } MenuTimestamp; @@ -81,29 +88,39 @@ private: struct resource { Time double_click_interval; - char *menu_file, *style_file; + char *style_file; char *titlebar_layout; int colors_per_channel; timeval auto_raise_delay; unsigned long cache_life, cache_max; } resource; - typedef DataSearch WindowSearch; - LinkedList *windowSearchList, *groupSearchList; - typedef DataSearch MenuSearch; - LinkedList *menuSearchList; - typedef DataSearch ToolbarSearch; - LinkedList *toolbarSearchList; + typedef std::map WindowLookup; + typedef WindowLookup::value_type WindowLookupPair; + WindowLookup windowSearchList, groupSearchList; + + typedef std::map MenuLookup; + typedef MenuLookup::value_type MenuLookupPair; + MenuLookup menuSearchList; + + typedef std::map ToolbarLookup; + typedef ToolbarLookup::value_type ToolbarLookupPair; + ToolbarLookup toolbarSearchList; #ifdef SLIT - typedef DataSearch SlitSearch; - LinkedList *slitSearchList; + typedef std::map SlitLookup; + typedef SlitLookup::value_type SlitLookupPair; + SlitLookup slitSearchList; #endif // SLIT - LinkedList *menuTimestamps; - LinkedList *screenList; + typedef std::list MenuTimestampList; + MenuTimestampList menuTimestamps; + + typedef std::vector ScreenList; + ScreenList screenList; - OpenboxWindow *focused_window, *masked_window; + BScreen *current_screen; + OpenboxWindow *masked_window; BTimer *timer; #ifdef HAVE_GETPID @@ -113,7 +130,7 @@ private: Bool no_focus, reconfigure_wait, reread_menu_wait; Time last_time; Window masked; - char *rc_file, **argv; + char *menu_file, *rc_file, **argv; int argc; Resource config; @@ -128,7 +145,7 @@ protected: public: - Openbox(int, char **, char * = 0, char * = 0); + Openbox(int, char **, char * = 0, char * = 0, char * = 0); virtual ~Openbox(); #ifdef HAVE_GETPID @@ -139,10 +156,17 @@ public: OpenboxWindow *searchGroup(Window, OpenboxWindow *); OpenboxWindow *searchWindow(Window); - inline OpenboxWindow *getFocusedWindow() { return focused_window; } + OpenboxWindow *focusedWindow(); + void focusWindow(OpenboxWindow *w); - BScreen *getScreen(int); + inline BScreen *getScreen(unsigned int s) { + ASSERT(s < screenList.size()); + return screenList[s]; + } BScreen *searchScreen(Window); + inline unsigned int managedScreenCount() const { + return screenList.size(); + } inline Resource &getConfig() { return config; @@ -156,7 +180,8 @@ public: inline const char *getStyleFilename() const { return resource.style_file; } inline const char *getMenuFilename() const - { return resource.menu_file; } + { return menu_file; } + void addMenuTimestamp(const char *filename); inline const int &getColorsPerChannel() const { return resource.colors_per_channel; } @@ -172,14 +197,14 @@ public: inline const unsigned long &getCacheMax() const { return resource.cache_max; } + inline OpenboxWindow *getMaskedWindow() const + { return masked_window; } inline void maskWindowEvents(Window w, OpenboxWindow *bw) { masked = w; masked_window = bw; } inline void setNoFocus(Bool f) { no_focus = f; } - void setFocusedWindow(OpenboxWindow *w); void shutdown(); void setStyleFilename(const char *); - void setMenuFilename(const char *); void saveMenuSearch(Window, Basemenu *); void saveWindowSearch(Window, OpenboxWindow *); void saveToolbarSearch(Window, Toolbar *);