wmi

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

bar.h (791B)


      1 // Copyright (c) 2003 - 2009 Anselm R Garbe <anselm@garbe.us>
      2 // See LICENSE for license details.
      3 
      4 #ifndef __BAR_H
      5 #define __BAR_H
      6 
      7 extern "C" {
      8 #include <X11/Xlib.h>
      9 }
     10 
     11 #include "widget.h"
     12 
     13 class Label;
     14 class Monitor;
     15 class Theme;
     16 
     17 /** Base class for status and client bars. */
     18 class Bar : public Widget {
     19 
     20 public:
     21 
     22     Bar(Monitor *monitor, Rectangle *rect);
     23     virtual ~Bar();
     24 
     25     virtual void illuminate() = 0;
     26 
     27     virtual void handleButtonPress(XButtonEvent *event) = 0;
     28     virtual void handleButtonRelease(XButtonEvent *event) = 0;
     29     virtual void handleMotionNotify(XMotionEvent *event) = 0;
     30 
     31 protected:
     32 
     33     Label *label_;
     34     Theme *theme_;
     35 
     36     /** Draws border. */
     37     void drawBorder();
     38     bool isButtonVisible_;
     39 
     40 private:
     41 
     42     Rectangle borderRect_;
     43 };
     44 
     45 #endif // __BAR_H