# Path: Xlib/X.py
# NONE                = 0
# CWX = (1<<0)
# CWY = (1<<1)
# 
# Path: Xlib/protocol/display.py
#     class bytesview(object):
# class Display(object):
# class ConnectionSetupRequest(rq.GetAttrData):
#         def __init__(self, data, offset=0, size=None):
#         def __len__(self):
#         def __getitem__(self, key):
#     def bytesview(data, offset=0, size=None):
#     def __init__(self, display = None):
#     def get_display_name(self):
#     def get_default_screen(self):
#     def fileno(self):
#     def next_event(self):
#     def pending_events(self):
#     def flush(self):
#     def close(self):
#     def set_error_handler(self, handler):
#     def allocate_resource_id(self):
#     def free_resource_id(self, rid):
#     def get_resource_class(self, class_name, default = None):
#     def set_extension_major(self, extname, major):
#     def get_extension_major(self, extname):
#     def add_extension_event(self, code, evt, subcode=None):
#     def add_extension_error(self, code, err):
#     def check_for_error(self):
#     def send_request(self, request, wait_for_response):
#     def close_internal(self, whom):
#     def send_and_recv(self, flush = None, event = None, request = None, recv = None):
#     def parse_response(self, request):
#     def parse_error_response(self, request):
#     def default_error_handler(self, err):
#     def parse_request_response(self, request):
#     def parse_event_response(self, etype):
#     def get_waiting_request(self, sno):
#     def get_waiting_replyrequest(self):
#     def parse_connection_setup(self):
#     def __init__(self, display, *args, **keys):


import sys
import os
from Xlib import X
from Xlib.protocol import display
from Xlib.protocol.request import *
#    Free Software Foundation, Inc.,
#    59 Temple Place,
#    Suite 330,
#    Boston, MA 02111-1307 USA



# Change path so we find Xlib
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))


# Application window (only one)
class Window(object):
    def __init__(self, display):
        self.d = display
        self.objects = []

        # Find which screen to open the window on
        self.screen = self.d.info.roots[self.d.default_screen]

        # Allocate ids to the window and gc
        self.window = self.d.allocate_resource_id()
        self.gc = self.d.allocate_resource_id()

        # Create a window
        CreateWindow(self.d, None,
                     self.screen.root_depth,
                     self.window,
                     self.screen.root,
                     50, 50, 300, 200, 2,

# Path: Xlib/X.py
# NONE                = 0
# CWX = (1<<0)
# CWY = (1<<1)
# 
# Path: Xlib/protocol/display.py
#     class bytesview(object):
# class Display(object):
# class ConnectionSetupRequest(rq.GetAttrData):
#         def __init__(self, data, offset=0, size=None):
#         def __len__(self):
#         def __getitem__(self, key):
#     def bytesview(data, offset=0, size=None):
#     def __init__(self, display = None):
#     def get_display_name(self):
#     def get_default_screen(self):
#     def fileno(self):
#     def next_event(self):
#     def pending_events(self):
#     def flush(self):
#     def close(self):
#     def set_error_handler(self, handler):
#     def allocate_resource_id(self):
#     def free_resource_id(self, rid):
#     def get_resource_class(self, class_name, default = None):
#     def set_extension_major(self, extname, major):
#     def get_extension_major(self, extname):
#     def add_extension_event(self, code, evt, subcode=None):
#     def add_extension_error(self, code, err):
#     def check_for_error(self):
#     def send_request(self, request, wait_for_response):
#     def close_internal(self, whom):
#     def send_and_recv(self, flush = None, event = None, request = None, recv = None):
#     def parse_response(self, request):
#     def parse_error_response(self, request):
#     def default_error_handler(self, err):
#     def parse_request_response(self, request):
#     def parse_event_response(self, etype):
#     def get_waiting_request(self, sno):
#     def get_waiting_replyrequest(self):
#     def parse_connection_setup(self):
#     def __init__(self, display, *args, **keys):


# Path: examples/draw-proto.py
import sys
import os
from Xlib import X
from Xlib.protocol import display
from Xlib.protocol.request import *

#    Free Software Foundation, Inc.,
#    59 Temple Place,
#    Suite 330,
#    Boston, MA 02111-1307 USA



# Change path so we find Xlib
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))


# Application window (only one)
class Window(object):
    def __init__(self, display):
        self.d = display
        self.objects = []

        # Find which screen to open the window on
        self.screen = self.d.info.roots[self.d.default_screen]

        # Allocate ids to the window and gc
        self.window = self.d.allocate_resource_id()
        self.gc = self.d.allocate_resource_id()

        # Create a window
        CreateWindow(self.d, None,
                     self.screen.root_depth,
                     self.window,
                     self.screen.root,
                     50, 50, 300, 200, 2,

                     X.InputOutput,