wmi

git clone git://oldgit.suckless.org/wmi/
Log | Files | Refs | LICENSE

clientbar.h (995B)


      1 // Copyright (c) 2003 - 2009 Anselm R Garbe <anselm@garbe.us>
      2 // See LICENSE for license details.
      3 
      4 #ifndef __CLIENTBAR_H
      5 #define __CLIENTBAR_H
      6 
      7 #include "bar.h"
      8 
      9 class Menu;
     10 class Monitor;
     11 
     12 /**
     13  * Represents the floating app bar of WMI.
     14  */
     15 class ClientBar : public Bar {
     16 
     17 public:
     18 
     19     enum Mode {PAGER, CLIENTINFO};
     20 
     21     ClientBar(Monitor *monitor, Rectangle *rect);
     22 
     23     ~ClientBar();
     24 
     25     virtual void illuminate();
     26 
     27     virtual void handleMotionNotify(XMotionEvent *event);
     28     virtual void handleButtonPress(XButtonEvent *event);
     29     virtual void handleButtonRelease(XButtonEvent *event);
     30 
     31     void toggleMenuMode();
     32     void setMode(Mode mode);
     33     Mode mode() const;
     34 
     35     Menu *menu() const;
     36 
     37 private:
     38 
     39     void updateClientInfo();
     40     void updateClientPager();
     41     void updateModeButton();
     42     void updateMenuButton();
     43 
     44     void invokeClickedThing(int xPosition);
     45     bool isModeButtonPressed_;
     46     bool isMenuButtonPressed_;
     47     Mode mode_;
     48     Menu *menu_;
     49 };
     50 
     51 #endif // __CLIENTBAR_H