wmi

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

rectangle.h (706B)


      1 // Copyright (c) 2003 - 2009 Anselm R Garbe <anselm@garbe.us>
      2 // See LICENSE for license details.
      3 
      4 #ifndef __RECTANGLE_H
      5 #define __RECTANGLE_H
      6 
      7 /**
      8  * Basic rectangle used by all viewable items of WMI.
      9  */
     10 class Rectangle
     11 {
     12 
     13 public:
     14 
     15     Rectangle();
     16 
     17     Rectangle(int x, int y, unsigned int w, unsigned int h);
     18 
     19     ~Rectangle();
     20 
     21     int x() const;
     22     void setX(int x);
     23 
     24     int y() const;
     25     void setY(int y);
     26 
     27     unsigned int width() const;
     28     void setWidth(unsigned int w);
     29 
     30     unsigned int height() const;
     31     void setHeight(unsigned int h);
     32 
     33     void copy(Rectangle *source);
     34 
     35     bool fitsInto(Rectangle *rect);
     36 
     37 private:
     38 
     39     int x_, y_;
     40     unsigned int w_, h_;
     41 };
     42 
     43 #endif // __RECTANGLE_H