]> Dogcows Code - chaz/openbox/blobdiff - src/Toolbar.hh
had an extra window placement menu
[chaz/openbox] / src / Toolbar.hh
index 5ec3029c148329604c3f90673edeaa740401dd68..45464e77e027e7ac890c4320cef54fc913dcc0c5 100644 (file)
@@ -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);
This page took 0.026631 seconds and 4 git commands to generate.