X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fopenbox.h;h=a98b2f14b7ce8026207f06dd5a0f328518826e5d;hb=a3a23c28f0fa4ed8b42ccde4a4b99aec60583df5;hp=144888bbcdb7d508c4100e1ad8cc906e9598fd4c;hpb=9cd9d92bb1d66db9329bf5cd6e42e8b0096945e6;p=chaz%2Fopenbox diff --git a/src/openbox.h b/src/openbox.h index 144888bb..a98b2f14 100644 --- a/src/openbox.h +++ b/src/openbox.h @@ -42,10 +42,12 @@ #endif // TIME_WITH_SYS_TIME #include "Resource.h" -#include "LinkedList.h" #include "BaseDisplay.h" #include "Timer.h" +#include +#include + //forward declaration class BScreen; class Openbox; @@ -74,6 +76,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 +87,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::list ScreenList; + ScreenList screenList; - OpenboxWindow *focused_window, *masked_window; + BScreen *current_screen; + OpenboxWindow *masked_window; BTimer *timer; #ifdef HAVE_GETPID @@ -113,7 +129,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 +144,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,7 +155,8 @@ public: OpenboxWindow *searchGroup(Window, OpenboxWindow *); OpenboxWindow *searchWindow(Window); - inline OpenboxWindow *getFocusedWindow() { return focused_window; } + OpenboxWindow *focusedWindow(); + void focusWindow(OpenboxWindow *w); BScreen *getScreen(int); BScreen *searchScreen(Window); @@ -156,7 +173,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 +190,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 saveStyleFilename(const char *); - void saveMenuFilename(const char *); + void setStyleFilename(const char *); void saveMenuSearch(Window, Basemenu *); void saveWindowSearch(Window, OpenboxWindow *); void saveToolbarSearch(Window, Toolbar *);