wmi

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

frame.h (1314B)


      1 // Copyright (c) 2003 - 2009 Anselm R Garbe <anselm@garbe.us>
      2 // See LICENSE for license details.
      3 
      4 #ifndef __FRAME_H
      5 #define __FRAME_H
      6 
      7 #include "container.h"
      8 #include "thing.h"
      9 #include "wmi.h"
     10 
     11 // forward declaration
     12 class Client;
     13 class Tree;
     14 class Workspace;
     15 
     16 typedef list<Client *> LClient;
     17 
     18 /**
     19  * Represents a frame of WMI. Frames are container for clients in
     20  * non-overlapping configurations.
     21  */
     22 class Frame
     23     : public Thing,
     24       public Container<Workspace, LClient, LClient::iterator, Client>
     25 {
     26 
     27 public:
     28 
     29     Frame(Workspace *workspace, Rectangle *rect);
     30 
     31     ~Frame();
     32 
     33     void focus(Client *client);
     34 
     35     void attach(Client *client);
     36     Client *detach(Client *client);
     37 
     38     virtual Window window();
     39 
     40     /** Resizes all clients of this frame. */
     41     virtual void resize();
     42 
     43     /** Illuminates this frame. */
     44     virtual void illuminate();
     45 
     46     virtual bool isFocused();
     47 
     48     virtual void handleButtonPress(XButtonEvent *event);
     49     virtual void handleButtonRelease(XButtonEvent *event);
     50 
     51     virtual Cursor cursorForXY(int pointerX, int pointerY);
     52 
     53     /** Matches client size. */
     54     void matchClientSize(Client *client);
     55 
     56     void setTree(Tree *t);
     57 
     58     Tree *tree() const;
     59 
     60     void toggleTiled();
     61     void zoomClient();
     62 
     63 private:
     64 
     65     bool isTiled_;
     66     Tree *tree_;
     67 };
     68 
     69 #endif // __FRAME_H