X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fopenbox.h;h=61d5fdb2a5a9d925974c3544ca66907b9a8a9794;hb=f75083669f65aadd6b32f8ed25880ca362296a2f;hp=7881d6020d0da03acaa439c13399919252c55322;hpb=43e9d583c5fa8378013169929d0ef54e1dccb6fa;p=chaz%2Fopenbox diff --git a/src/openbox.h b/src/openbox.h index 7881d602..61d5fdb2 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; @@ -66,14 +68,18 @@ private: public: DataSearch(Window w, Z *d): window(w), data(d) {} - inline const Window &getWindow(void) const { return window; } - inline Z *getData(void) { return data; } + inline const Window &getWindow() const { return window; } + inline Z *getData() { return data; } }; class Openbox : public BaseDisplay, public TimeoutHandler { private: typedef struct MenuTimestamp { + virtual ~MenuTimestamp() { + if (filename != (char *) 0) + delete [] filename; + } char *filename; time_t timestamp; } MenuTimestamp; @@ -88,22 +94,32 @@ private: 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 @@ -119,28 +135,28 @@ private: protected: - void load_rc(void); - void save_rc(void); - void reload_rc(void); - void real_rereadMenu(void); - void real_reconfigure(void); + void load(); + void save(); + void real_rereadMenu(); + void real_reconfigure(); virtual void process_event(XEvent *); public: Openbox(int, char **, char * = 0, char * = 0); - virtual ~Openbox(void); + virtual ~Openbox(); #ifdef HAVE_GETPID - inline const Atom &getOpenboxPidAtom(void) const { return openbox_pid; } + inline const Atom &getOpenboxPidAtom() const { return openbox_pid; } #endif // HAVE_GETPID Basemenu *searchMenu(Window); OpenboxWindow *searchGroup(Window, OpenboxWindow *); OpenboxWindow *searchWindow(Window); - inline OpenboxWindow *getFocusedWindow(void) { return focused_window; } + OpenboxWindow *focusedWindow(); + void focusWindow(OpenboxWindow *w); BScreen *getScreen(int); BScreen *searchScreen(Window); @@ -148,40 +164,40 @@ public: inline Resource &getConfig() { return config; } - inline const Time &getDoubleClickInterval(void) const + inline const Time &getDoubleClickInterval() const { return resource.double_click_interval; } - inline const Time &getLastTime(void) const { return last_time; } + inline const Time &getLastTime() const { return last_time; } Toolbar *searchToolbar(Window); - inline const char *getStyleFilename(void) const + inline const char *getStyleFilename() const { return resource.style_file; } - inline const char *getMenuFilename(void) const + inline const char *getMenuFilename() const { return resource.menu_file; } - inline const int &getColorsPerChannel(void) const + inline const int &getColorsPerChannel() const { return resource.colors_per_channel; } - inline const timeval &getAutoRaiseDelay(void) const + inline const timeval &getAutoRaiseDelay() const { return resource.auto_raise_delay; } - inline const char *getTitleBarLayout(void) const + inline const char *getTitleBarLayout() const { return resource.titlebar_layout; } - inline const unsigned long &getCacheLife(void) const + inline const unsigned long &getCacheLife() const { return resource.cache_life; } - inline const unsigned long &getCacheMax(void) const + 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); - void load_rc(BScreen *); - void saveStyleFilename(const char *); - void saveMenuFilename(const char *); + void shutdown(); + void setStyleFilename(const char *); + void setMenuFilename(const char *); void saveMenuSearch(Window, Basemenu *); void saveWindowSearch(Window, OpenboxWindow *); void saveToolbarSearch(Window, Toolbar *); @@ -191,13 +207,13 @@ public: void removeToolbarSearch(Window); void removeGroupSearch(Window); void restart(const char * = 0); - void reconfigure(void); - void rereadMenu(void); - void checkMenu(void); + void reconfigure(); + void rereadMenu(); + void checkMenu(); virtual Bool handleSignal(int); - virtual void timeout(void); + virtual void timeout(); #ifdef SLIT Slit *searchSlit(Window);