]> Dogcows Code - chaz/openbox/blobdiff - src/Toolbar.h
Added a runtime option for hiding the toolbar totally. Will be cleaner
[chaz/openbox] / src / Toolbar.h
index 17c4698440fa53aeffb9157777d6c9aee23045fe..47a9dd2c388088ec23624c3cc02a4d8c0f682b86 100644 (file)
@@ -35,16 +35,16 @@ class Toolbarmenu : public Basemenu {
 private:
   class Placementmenu : public Basemenu {
   private:
-    Toolbarmenu *toolbarmenu;
+    Toolbarmenu &toolbarmenu;
 
   protected:
     virtual void itemSelected(int, int);
 
   public:
-    Placementmenu(Toolbarmenu *);
+    Placementmenu(Toolbarmenu &);
   };
 
-  Toolbar *toolbar;
+  Toolbar &toolbar;
   Placementmenu *placementmenu;
 
   friend class Placementmenu;
@@ -56,7 +56,7 @@ protected:
   virtual void internal_hide(void);
 
 public:
-  Toolbarmenu(Toolbar *);
+  Toolbarmenu(Toolbar &);
   ~Toolbarmenu(void);
 
   inline Basemenu *getPlacementmenu(void) { return placementmenu; }
@@ -67,7 +67,7 @@ public:
 
 class Toolbar : public TimeoutHandler {
 private:
-  Bool on_top, editing, hidden, do_auto_hide;
+  Bool on_top, editing, hidden, do_auto_hide, do_hide;
   Display *display;
 
   struct frame {
@@ -88,9 +88,9 @@ private:
     virtual void timeout(void);
   } hide_handler;
 
-  Openbox *openbox;
+  Openbox &openbox;
   BImageControl *image_ctrl;
-  BScreen *screen;
+  BScreen &screen;
   BTimer *clock_timer, *hide_timer;
   Toolbarmenu *toolbarmenu;
 
@@ -103,7 +103,7 @@ private:
 
 
 public:
-  Toolbar(BScreen *);
+  Toolbar(BScreen &);
   virtual ~Toolbar(void);
 
   inline Toolbarmenu *getMenu(void) { return toolbarmenu; }
@@ -117,13 +117,17 @@ public:
 
   inline const unsigned int &getWidth(void) const { return frame.width; }
   inline const unsigned int &getHeight(void) const { return frame.height; }
-  inline const unsigned int &getExposedHeight(void) const
-  { return ((do_auto_hide) ? frame.bevel_w : frame.height); }
+  inline const unsigned int getExposedHeight(void) const {
+    if (do_hide) return 0;
+    else if (do_auto_hide) return frame.bevel_w;
+    else return frame.height;
+  }
+  
   inline const int &getX(void) const
   { return ((hidden) ? frame.x_hidden : frame.x); }
-  inline const int &getY(void) const
-  { return ((hidden) ? frame.y_hidden : frame.y); }
-
+  inline const int getY(void) const 
+    { return ((hidden || do_hide) ? frame.y_hidden : frame.y); }
+  
   void buttonPressEvent(XButtonEvent *);
   void buttonReleaseEvent(XButtonEvent *);
   void enterNotifyEvent(XCrossingEvent *);
@@ -139,7 +143,8 @@ public:
   void redrawNextWindowButton(Bool = False, Bool = False);
   void edit(void);
   void reconfigure(void);
-
+  void mapToolbar(void);
+  void unMapToolbar(void);
 #ifdef    HAVE_STRFTIME
   void checkClock(Bool = False);
 #else //  HAVE_STRFTIME
This page took 0.022613 seconds and 4 git commands to generate.