# Path: pwm/config.py
# class Config:
#     def __init__(self):
#     def load(self, default=False):
#     def _load_default(self):
#     def _ensure_config_exists(self, path):
#     def __getattr__(self, name):
# def setup_keys():
# def handle_key_press_event(event):
# def create_arguments(func):
#     def wrapper(*args, **kwargs):
# 
# Path: pwm/ffi/xcb.py
# class XcbError(Exception):
# class Cookie:
# class Xcb:
#     def __init__(self, error):
#     def __str__(self):
#     def __init__(self, name, value):
#     def __getattr__(self, name):
#     def reply(self):
#     def check(self):
#     def __init__(self):
#     def __getattr__(self, name):
#         def request(func, *args, **kwargs):
#     def connect(self, display=None):
#     def mask(self, masks):


import logging
import pwm.bar
import pwm.windows
import pwm.layout
import pwm.events
from pwm.config import config
from pwm.ffi.xcb import xcb
# Copyright (c) 2013 Michael Bitzi
# Licensed under the MIT license http://opensource.org/licenses/MIT



workspaces = []
current_workspace_index = 0


class Workspace:
    def __init__(self):
        self.windows = []

        self.x = 0
        self.y = pwm.bar.calculate_height()

        self.width = xcb.screen.width_in_pixels
        self.height = xcb.screen.height_in_pixels - self.y

        self.tiling = pwm.layout.Tiling(self)
        self.floating = pwm.layout.Floating(self)
        self.fullscreen = pwm.layout.Fullscreen(self)

        self.layouts = (self.tiling, self.floating, self.fullscreen)

    def hide(self):
        for w in self.windows:
            # The next UnmapNotifyEvent for this window has to be ignored
            pwm.windows.managed[w].ignore_unmaps += 1

# Path: pwm/config.py
# class Config:
#     def __init__(self):
#     def load(self, default=False):
#     def _load_default(self):
#     def _ensure_config_exists(self, path):
#     def __getattr__(self, name):
# def setup_keys():
# def handle_key_press_event(event):
# def create_arguments(func):
#     def wrapper(*args, **kwargs):
# 
# Path: pwm/ffi/xcb.py
# class XcbError(Exception):
# class Cookie:
# class Xcb:
#     def __init__(self, error):
#     def __str__(self):
#     def __init__(self, name, value):
#     def __getattr__(self, name):
#     def reply(self):
#     def check(self):
#     def __init__(self):
#     def __getattr__(self, name):
#         def request(func, *args, **kwargs):
#     def connect(self, display=None):
#     def mask(self, masks):


# Path: pwm/workspaces.py
import logging
import pwm.bar
import pwm.windows
import pwm.layout
import pwm.events
from pwm.config import config
from pwm.ffi.xcb import xcb

# Copyright (c) 2013 Michael Bitzi
# Licensed under the MIT license http://opensource.org/licenses/MIT



workspaces = []
current_workspace_index = 0


class Workspace:
    def __init__(self):
        self.windows = []

        self.x = 0
        self.y = pwm.bar.calculate_height()

        self.width = xcb.screen.width_in_pixels
        self.height = xcb.screen.height_in_pixels - self.y

        self.tiling = pwm.layout.Tiling(self)
        self.floating = pwm.layout.Floating(self)
        self.fullscreen = pwm.layout.Fullscreen(self)

        self.layouts = (self.tiling, self.floating, self.fullscreen)

    def hide(self):
        for w in self.windows:
            # The next UnmapNotifyEvent for this window has to be ignored
            pwm.windows.managed[w].ignore_unmaps += 1

            xcb.core.unmap_window(w)