X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FToolbar.hh;h=45464e77e027e7ac890c4320cef54fc913dcc0c5;hb=dba5b809ec6f961324dbb5dff2dfc9c887958053;hp=5ec3029c148329604c3f90673edeaa740401dd68;hpb=8794d357e67abddf9fda9db77b235e294d0ec590;p=chaz%2Fopenbox diff --git a/src/Toolbar.hh b/src/Toolbar.hh index 5ec3029c..45464e77 100644 --- a/src/Toolbar.hh +++ b/src/Toolbar.hh @@ -41,12 +41,15 @@ private: private: Placementmenu(const Placementmenu&); Placementmenu& operator=(const Placementmenu&); + Toolbar *toolbar; protected: virtual void itemSelected(int button, unsigned int index); + virtual void setValues(void); public: Placementmenu(Toolbarmenu *tm); + virtual void reconfigure(void); }; Toolbar *toolbar; @@ -61,6 +64,7 @@ private: protected: virtual void itemSelected(int button, unsigned int index); virtual void internal_hide(void); + virtual void setValues(void); public: Toolbarmenu(Toolbar *tb); @@ -68,13 +72,16 @@ public: inline Basemenu *getPlacementmenu(void) { return placementmenu; } - void reconfigure(void); + virtual void reconfigure(void); }; class Toolbar : public TimeoutHandler { private: bool on_top, editing, hidden, do_auto_hide; + unsigned int width_percent; + int placement; + std::string toolbarstr; Display *display; struct ToolbarFrame { @@ -83,7 +90,7 @@ private: Window window, workspace_label, window_label, clock, psbutton, nsbutton, pwbutton, nwbutton; - int x_hidden, y_hidden, hour, minute, grab_x, grab_y; + int x_hidden, y_hidden, hour, minute; unsigned int window_label_w, workspace_label_w, clock_w, button_w, bevel_w, label_h; @@ -99,6 +106,7 @@ private: Blackbox *blackbox; BScreen *screen; + Configuration *config; BTimer *clock_timer, *hide_timer; Toolbarmenu *toolbarmenu; Strut strut; @@ -110,6 +118,7 @@ private: friend class Toolbarmenu; friend class Toolbarmenu::Placementmenu; + void drawArrow(Drawable surface, bool left) const; void redrawPrevWorkspaceButton(bool pressed = False, bool redraw = False); void redrawNextWorkspaceButton(bool pressed = False, bool redraw = False); void redrawPrevWindowButton(bool preseed = False, bool redraw = False); @@ -136,6 +145,19 @@ public: inline bool isOnTop(void) const { return on_top; } inline bool isHidden(void) const { return hidden; } inline bool doAutoHide(void) const { return do_auto_hide; } + inline unsigned int getWidthPercent(void) const { return width_percent; } + inline int getPlacement(void) const { return placement; } + + void saveOnTop(bool); + void saveAutoHide(bool); + void saveWidthPercent(unsigned int); + void savePlacement(int); + + void save_rc(void); + void load_rc(void); + + void mapToolbar(void); + void unmapToolbar(void); inline Window getWindowID(void) const { return frame.window; } @@ -143,18 +165,20 @@ public: inline unsigned int getWidth(void) const { return frame.rect.width(); } inline unsigned int getHeight(void) const { return frame.rect.height(); } inline unsigned int getExposedHeight(void) const - { return ((do_auto_hide) ? frame.bevel_w : frame.rect.height()); } + { return (screen->doHideToolbar() ? 0 : + ((do_auto_hide) ? frame.bevel_w : + frame.rect.height())); } inline int getX(void) const { return ((hidden) ? frame.x_hidden : frame.rect.x()); } inline int getY(void) const { return ((hidden) ? frame.y_hidden : frame.rect.y()); } - void buttonPressEvent(XButtonEvent *be); - void buttonReleaseEvent(XButtonEvent *re); - void enterNotifyEvent(XCrossingEvent * /*unused*/); - void leaveNotifyEvent(XCrossingEvent * /*unused*/); - void exposeEvent(XExposeEvent *ee); - void keyPressEvent(XKeyEvent *ke); + void buttonPressEvent(const XButtonEvent *be); + void buttonReleaseEvent(const XButtonEvent *re); + void enterNotifyEvent(const XCrossingEvent * /*unused*/); + void leaveNotifyEvent(const XCrossingEvent * /*unused*/); + void exposeEvent(const XExposeEvent *ee); + void keyPressEvent(const XKeyEvent *ke); void edit(void); void reconfigure(void);