<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>contrib/layouts/hybridlayout.py</filename>
    </added>
    <added>
      <filename>libqtile/layout/sublayout/__init__.py</filename>
    </added>
    <added>
      <filename>libqtile/layout/sublayout/clientstack.py</filename>
    </added>
    <added>
      <filename>libqtile/layout/sublayout/subfloating.py</filename>
    </added>
    <added>
      <filename>libqtile/layout/sublayout/sublayout.py</filename>
    </added>
    <added>
      <filename>libqtile/layout/sublayout/submagnify.py</filename>
    </added>
    <added>
      <filename>libqtile/layout/sublayout/submax.py</filename>
    </added>
    <added>
      <filename>libqtile/layout/sublayout/subtile.py</filename>
    </added>
    <added>
      <filename>libqtile/layout/sublayout/subverttile.py</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -2,14 +2,11 @@ from stack import Stack
 from max import Max
 from magnify import Magnify
 from tile import Tile
-from clientstack import ClientStack
-
-from base import Rect
 
 # sublayouts
-from subtile import SubTile
-from subverttile import SubVertTile
-from submax import SubMax
-from subfloating import SubFloating
-from submagnify import SubMagnify
-from hybridlayoutdemo import HybridLayoutDemo
+from sublayout.clientstack import ClientStack
+from sublayout.subtile import SubTile
+from sublayout.subverttile import SubVertTile
+from sublayout.submax import SubMax
+from sublayout.subfloating import SubFloating
+from sublayout.submagnify import SubMagnify</diff>
      <filename>libqtile/layout/__init__.py</filename>
    </modified>
    <modified>
      <diff>@@ -103,201 +103,3 @@ class Layout(command.CommandObject):
         return self.info()
 
 
-class Rect:
-    def __init__(self, x=0, y=0, w=0, h=0):
-        self.x = x
-        self.y = y
-        self.w = w
-        self.h = h
-
-    def split_vertical(self, ratio=0.5, width=None):
-        if not width:
-            width = int(ratio*self.w)
-        if width &gt; self.w:
-            raise Exception, &quot;You're trying to take too much of the rectangle&quot;
-        return (Rect(self.x,
-                     self.y,
-                     width,
-                     self.h),
-                Rect(self.x + width,
-                     self.y,
-                     self.w - width,
-                     self.h)
-                )
-    
-    def split_horizontal(self, ratio=0.5, height=None):
-        if not height:
-            height = int(ratio*self.h)
-        if height &gt; self.h:
-            raise Exception, &quot;You're trying to take too much of this rectange&quot;
-        return (Rect(self.x,
-                     self.y,
-                     self.w,
-                     height),
-                Rect(self.x,
-                     self.y + height,
-                     self.w,
-                     self.h - height)
-                )
-    
-
-    def __repr__(self):
-        return &quot;(%s, %s, %s, %s)&quot; % (self.x, self.y, self.w, self.h)
-
-class SubLayout:
-    def __init__(self, clientStack, theme, parent=None, autohide=True):
-        &quot;&quot;&quot;
-           autohide - does it hide itself if there are no clients
-        &quot;&quot;&quot;
-        self.clientStack = clientStack
-        self.clients = []
-        self.sublayouts = []
-        self.theme = theme
-        self.parent = parent
-        self.autohide = autohide
-        self.windows = []
-        self._init_sublayouts()
-        self.active_border = None
-    
-    def _init_bordercolors(self):
-        colormap = self.clientStack.group.qtile.display.screen().default_colormap
-        color = lambda color: colormap.alloc_named_color(color).pixel
-        name = self.__class__.__name__.lower()
-        theme = self.theme
-        self.active_border = color(theme[&quot;%s_border_active&quot; % name])
-        self.focused_border = color(theme[&quot;%s_border_focus&quot; % name])
-        self.normal_border = color(theme[&quot;%s_border_normal&quot; % name])
-        self.border_width = theme[&quot;%s_border_width&quot; % name]
-            
-
-    def _init_sublayouts(self):
-        &quot;&quot;&quot;
-           Define sublayouts here, and so, only override init if you really must
-        &quot;&quot;&quot;
-        pass
-
-    def filter_windows(self, windows):
-        return [w for w in windows if self.filter(w)]
-
-    def filter(self, client):
-        raise NotImplementedError
-
-    def add(self, client):
-        &quot;&quot;&quot;
-            Receives a client that this SubLayout may be interested in.
-        &quot;&quot;&quot;
-        self.clients.append(client) #keep a copy regardless
-        if self.sublayouts:
-            for sl in self.sublayouts:
-                sl.add(client)
-
-
-    def focus(self, client):
-        &quot;&quot;&quot;
-           Some client in the ClientStack got focus, no clue if it concerns us
-        &quot;&quot;&quot;
-
-    def remove(self, client):
-        if client in self.clients:
-            self.clients.remove(client)
-
-    def request_rectangle(self, rectangle, windows):
-        &quot;&quot;&quot;
-            Define what rectangle this sublayout 'wants'. Don't be greedy.. well.. if you have to
-            :rectangle - the total rectangle available. DON'T BE GREEDY!
-            :windows - the windows that will be layed out with this - so you can know if you're gonna not have anything to lay out
-            The last sublayout to lay out won't get a choice - they'll get whatever's left
-            Return a tuple containing the rectangle you want, and the rectangle that's left.
-        &quot;&quot;&quot;
-        raise NotImplementedError, &quot;The Sublayout %s needs to implement request_rectangle&quot; % self.__class__.__name__
-
-    def layout(self, rectangle, windows):
-        &quot;&quot;&quot;
-           Layout the list of windows in the specified rectangle
-        &quot;&quot;&quot;
-        self.windows = windows
-        # setup colors
-        if not self.active_border:
-            self._init_bordercolors()
-        # done
-        if self.sublayouts:
-            sls = []
-            for sl in self.sublayouts:
-                filtered = sl.filter_windows(windows)
-                rect, rect_remaining = sl.request_rectangle(rectangle, 
-                                                              filtered)
-                sls.append((sl, rect, filtered))
-                rectangle = rect_remaining
-                windows = [w for w in windows if w not in filtered]
-            for sl, rect, clients in sls:
-                sl.layout(rect, clients)
-            
-        else:
-            for c in self.windows:
-                self.configure(rectangle, c)
-
-    def index_of(self, client):
-        if self.parent:
-            return self.parent.windows.index(client)
-        else:
-            return self.clientStack.index_of(client)
-
-    def configure(self, rectangle, client):
-        &quot;&quot;&quot;
-            Place a window
-        &quot;&quot;&quot;
-        raise NotImplementedError, &quot;this is %s&quot; % self.__class__.__name__
-
-    def place(self, client, x, y, w, h):
-        bc, opacity = ((self.focused_border, 1.0) \
-                  if self.clientStack.focus_history \
-                  and self.clientStack.focus_history[0] is client \
-                  else (self.normal_border, 0.5)
-              )
-        client.place(x,
-                     y,
-                     w - 2*self.border_width,
-                     h - 2*self.border_width,
-                     self.border_width,
-                     bc
-                     )
-        client.unhide()
-        client.setOpacity(opacity)
-
-    def command_get_arg(self, args, kwargs, name, default):
-        if name in kwargs:
-            return kwargs['name']
-        elif args:
-            if name &lt; len(args):
-                return args[name]
-            else:
-                return args[0]
-        else:
-            return default
-        
-
-    def command(self, mask, command, *args, **kwargs):
-
-        print &quot;dealing with command %s %s in %s&quot; % (mask, command, self.__class__.__name__)
-
-        def split_command(command):
-            parts = command.split('_')
-            if len(parts) &gt; 1:
-                mask = parts[0]
-                com = '_'.join(parts[1:])
-            else:
-                mask = '*'
-                com = '_'.join(parts)
-            return (mask, com)
-            
-        for sl in self.sublayouts:
-            if mask == '*':
-                sl.command(mask, command, *args, **kwargs)
-            elif mask == '?':
-                ma, com = split_command(command)
-                self.command(ma, com, *args, **kwargs)
-            elif mask == sl.__class__.__name__:
-                ma, com = split_command(command)
-                self.comand(ma, com, *args, **kwargs)
-            else:
-                print &quot;command ('%s' '%s') not passed on&quot; % (mask, command)</diff>
      <filename>libqtile/layout/base.py</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 import libpry, time, pprint
 from libqtile import layout
-from libqtile.layout import sublayouts, Rect
+from libqtile.layout.sublayout.sublayout import Rect, VerticalStack
 import libqtile.manager
 import utils
 
@@ -229,7 +229,7 @@ class uSelectors(utils.QtileTests):
 
 class ClientStackConfig:
     groups = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;d&quot;]
-    class VertStack(sublayouts.VerticalStack):
+    class VertStack(VerticalStack):
         def filter(self, c):
             return True
         def request_rectangle(self, r, windows):</diff>
      <filename>test/test_layout.py</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>libqtile/layout/clientstack.py</filename>
    </removed>
    <removed>
      <filename>libqtile/layout/hybridlayoutdemo.py</filename>
    </removed>
    <removed>
      <filename>libqtile/layout/subfloating.py</filename>
    </removed>
    <removed>
      <filename>libqtile/layout/sublayouts.py</filename>
    </removed>
    <removed>
      <filename>libqtile/layout/submagnify.py</filename>
    </removed>
    <removed>
      <filename>libqtile/layout/submax.py</filename>
    </removed>
    <removed>
      <filename>libqtile/layout/subtile.py</filename>
    </removed>
    <removed>
      <filename>libqtile/layout/subverttile.py</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>f800283fdbe795f6b5e6b910829ef0c7c925c096</id>
    </parent>
  </parents>
  <author>
    <name>Aldo Cortesi</name>
    <email>aldo@nullcube.com</email>
  </author>
  <url>http://github.com/cortesi/qtile/commit/b54845c91a8b080c46c067a52ca574d343139da6</url>
  <id>b54845c91a8b080c46c067a52ca574d343139da6</id>
  <committed-date>2009-02-25T14:54:16-08:00</committed-date>
  <authored-date>2009-02-25T14:54:16-08:00</authored-date>
  <message>Segregate sublayouts into their own module. Note that this may break people's configurations.

We have to decide what the public API for sublayouts is, and expose it
in layouts/__init__.py.</message>
  <tree>045a22b8f144b4d18ddce873240b36383dcc843a</tree>
  <committer>
    <name>Aldo Cortesi</name>
    <email>aldo@nullcube.com</email>
  </committer>
</commit>
