# 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/ffi/cairo.py
# class CairoError(Exception):
# class Context:
# class Cairo:
#     def __init__(self, ctx):
#     def __getattr__(self, name):
#     def encode(self, text):
#     def select_font_face(self, face, slant, weight):
#     def text_extents(self, text, extents):
#     def show_text(self, text):
#     def __init__(self):
#     def __getattr__(self, name):
#     def create(self, surface):


import string
import re
import time
import pwm.windows
import pwm.color
import pwm.keybind
import pwm.xdg
import pwm.spawn
import pwm.bar
import pwm.root
from pwm.config import config
from pwm.ffi.xcb import xcb
from pwm.ffi.cairo import cairo
        _window,
        _width,
        _height)

    global _gc
    _gc = xcb.core.generate_id()
    xcb.core.create_gc(_gc, xcb.screen.root,
                       *xcb.mask([(xcb.GC_FOREGROUND, xcb.screen.white_pixel),
                                  (xcb.GC_BACKGROUND, xcb.screen.black_pixel),
                                  (xcb.GC_GRAPHICS_EXPOSURES, 0)]))

    global _surface
    _surface = cairo.xcb_surface_create(
        xcb.conn,
        _pixmap,
        xcb.aux_find_visual_by_id(xcb.screen, xcb.screen.root_visual),
        _width,
        _height)

    global _ctx
    _ctx = cairo.create(_surface)

    _ctx.select_font_face(config.bar.font.face,
                          cairo.FONT_SLANT_NORMAL,
                          cairo.FONT_WEIGHT_NORMAL)
    _ctx.set_font_size(config.bar.font.size)


def destroy():
    xcb.core.destroy_window(_window)

# 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/ffi/cairo.py
# class CairoError(Exception):
# class Context:
# class Cairo:
#     def __init__(self, ctx):
#     def __getattr__(self, name):
#     def encode(self, text):
#     def select_font_face(self, face, slant, weight):
#     def text_extents(self, text, extents):
#     def show_text(self, text):
#     def __init__(self):
#     def __getattr__(self, name):
#     def create(self, surface):


# Path: pwm/menu.py
import string
import re
import time
import pwm.windows
import pwm.color
import pwm.keybind
import pwm.xdg
import pwm.spawn
import pwm.bar
import pwm.root
from pwm.config import config
from pwm.ffi.xcb import xcb
from pwm.ffi.cairo import cairo

        _window,
        _width,
        _height)

    global _gc
    _gc = xcb.core.generate_id()
    xcb.core.create_gc(_gc, xcb.screen.root,
                       *xcb.mask([(xcb.GC_FOREGROUND, xcb.screen.white_pixel),
                                  (xcb.GC_BACKGROUND, xcb.screen.black_pixel),
                                  (xcb.GC_GRAPHICS_EXPOSURES, 0)]))

    global _surface
    _surface = cairo.xcb_surface_create(
        xcb.conn,
        _pixmap,
        xcb.aux_find_visual_by_id(xcb.screen, xcb.screen.root_visual),
        _width,
        _height)

    global _ctx
    _ctx = cairo.create(_surface)

    _ctx.select_font_face(config.bar.font.face,
                          cairo.FONT_SLANT_NORMAL,
                          cairo.FONT_WEIGHT_NORMAL)
    _ctx.set_font_size(config.bar.font.size)


def destroy():
    xcb.core.destroy_window(_window)

    cairo.surface_destroy(_surface)