Beispiel #1
0
def create(parent, mask, values):
    wid = conn.generate_id()
    core.CreateWindow(rsetup.root_depth, wid, parent, 0, 0, 1, 1, 0,
                      xproto.WindowClass.InputOutput, rsetup.root_visual, mask,
                      values)

    return wid
Beispiel #2
0
def paint_pix(wid, data, w, h):
    pix = conn.generate_id()
    core.CreatePixmap(rsetup.root_depth, pix, root, w, h)

    core.PutImage(xproto.ImageFormat.ZPixmap, pix, stdgc, w, h, 0, 0, 0, 24, 
                  len(data), data)

    core.ChangeWindowAttributes(wid, xproto.CW.BackPixmap, [pix])

    core.ClearArea(0, wid, 0, 0, 0, 0)

    core.FreePixmap(pix)
Beispiel #3
0
from functools import partial
import os.path

import xcb.xproto as xproto
import Image, ImageDraw, ImageFont

import xpybutil.image as image

from state import conn, core, root, rsetup

imgs = os.path.join('/', 'home', 'andrew', 'clones', 'pyndow', 'images')
stdgc = conn.generate_id()
core.CreateGC(stdgc, root, 0, [])

# Load images
p = partial(os.path.join, imgs)
close = Image.open(p('close.png'))
maximize = Image.open(p('maximize.png'))
minimize = Image.open(p('minimize.png'))
restore = Image.open(p('restore.png'))
shade = Image.open(p('shade.png'))
openbox = Image.open(p('openbox.png'))

def paint_pix(wid, data, w, h):
    pix = conn.generate_id()
    core.CreatePixmap(rsetup.root_depth, pix, root, w, h)

    core.PutImage(xproto.ImageFormat.ZPixmap, pix, stdgc, w, h, 0, 0, 0, 24, 
                  len(data), data)

    core.ChangeWindowAttributes(wid, xproto.CW.BackPixmap, [pix])