# 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):


from pwm.config import config
from pwm.ffi.xcb import xcb
from pwm.ffi.cairo import cairo
import pwm.color as color
import pwm.events
import pwm.windows
import pwm.widgets

    def create_gc(self):
        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)]))

        return gc

    def create_cairo_context(self):
        surface = cairo.xcb_surface_create(
            xcb.conn,
            self.pixmap,
            xcb.aux_find_visual_by_id(xcb.screen, xcb.screen.root_visual),
            self.width,
            self.height)

        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)

        return (surface, ctx)

    def font_extents(self):

# 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/bar.py
from pwm.config import config
from pwm.ffi.xcb import xcb
from pwm.ffi.cairo import cairo
import pwm.color as color
import pwm.events
import pwm.windows
import pwm.widgets


    def create_gc(self):
        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)]))

        return gc

    def create_cairo_context(self):
        surface = cairo.xcb_surface_create(
            xcb.conn,
            self.pixmap,
            xcb.aux_find_visual_by_id(xcb.screen, xcb.screen.root_visual),
            self.width,
            self.height)

        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)

        return (surface, ctx)

    def font_extents(self):

        extents = cairo.ffi.new("cairo_font_extents_t*")