wmi

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

split.h (1008B)


      1 // Copyright (c) 2003 - 2009 Anselm R Garbe <anselm@garbe.us>
      2 // See LICENSE for license details.
      3 
      4 #ifndef __SPLIT_H
      5 #define __SPLIT_H
      6 
      7 #include "wmi.h"
      8 
      9 class Frame;
     10 class Tree;
     11 
     12 /**
     13  * This class contains all necessary splitting algorithm for managing
     14  * windows in a non-overlapping manner.
     15  */
     16 class Split {
     17 
     18 public:
     19 
     20     static void resize(Tree *root, Tree *origin,
     21                        Direction dir, int stepW, int stepH);
     22 
     23     static Tree *neighbor(Tree *root, Tree *origin, Direction dir);
     24     static bool isNeighbor(Tree *origin, Tree *target, Direction dir);
     25 
     26     static void adjustSize(Tree *tree, bool ignoreVert);
     27 
     28     static void detach(Tree *root, Tree *origin);
     29 
     30     static Frame *firstLeaf(Tree *tree);
     31 
     32     static void attach(Tree *root, Frame *frame, Direction dir);
     33 
     34 private:
     35 
     36     /** Helper for neighbor stuff. */
     37     static int distance(Tree *origin, Tree *target);
     38 
     39     /** Helper for resize stuff. */
     40     static Tree *topMostRoot(Tree *first, Tree *last);
     41 
     42 };
     43 
     44 #endif // __SPLIT_H