# Path: venster/gdi.py
# class BITMAP(Structure):
# class LOGFONT(Structure):
# class LOGBRUSH(Structure):
# class ENUMLOGFONTEX(Structure):
# class BITMAPINFOHEADER(Structure):
# class RGBQUAD(Structure):
# class BITMAPINFO(Structure):
# class BITMAPFILEHEADER(Structure):
# class Bitmap(WindowsObject):
# class SolidBrush(WindowsObject):
# class Pen(WindowsObject):
# class Font(WindowsObject):
# LF_FACESIZE = 32
# MONO_FONT = 8
# OBJ_FONT = 6
# ANSI_FIXED_FONT  = 11
# ANSI_VAR_FONT = 12
# DEVICE_DEFAULT_FONT= 14
# DEFAULT_GUI_FONT= 17
# OEM_FIXED_FONT= 10
# SYSTEM_FONT= 13
# SYSTEM_FIXED_FONT= 16
# ANSI_CHARSET          =  0
# DEFAULT_CHARSET       =  1
# SYMBOL_CHARSET        =  2
# SHIFTJIS_CHARSET      =  128
# HANGEUL_CHARSET       =  129
# HANGUL_CHARSET        =  129
# GB2312_CHARSET        =  134
# CHINESEBIG5_CHARSET   =  136
# OEM_CHARSET           =  255
# FIXED_PITCH = 1
# CLR_NONE = 0xffffffff
# HS_BDIAGONAL   =3
# HS_CROSS       =4
# HS_DIAGCROSS   =5
# HS_FDIAGONAL   =2
# HS_HORIZONTAL  =0
# HS_VERTICAL    =1
# PATINVERT     =  0x5A0049
# OUT_DEFAULT_PRECIS  =  0
# CLIP_DEFAULT_PRECIS  = 0
# DEFAULT_QUALITY      =  0
# DEFAULT_PITCH        =  0
# FF_DONTCARE   =  (0<<4)
# FF_MODERN     =  (3<<4)
# PS_GEOMETRIC=   65536
# PS_COSMETIC  =  0
# PS_ALTERNATE  = 8
# PS_SOLID      = 0
# PS_DASH       = 1
# PS_DOT= 2
# PS_DASHDOT    = 3
# PS_DASHDOTDOT = 4
# PS_NULL       = 5
# PS_USERSTYLE  = 7
# PS_INSIDEFRAME= 6
# PS_ENDCAP_ROUND =       0
# PS_ENDCAP_SQUARE=       256
# PS_ENDCAP_FLAT= 512
# PS_JOIN_BEVEL = 4096
# PS_JOIN_MITER = 8192
# PS_JOIN_ROUND = 0
# PS_STYLE_MASK = 15
# PS_ENDCAP_MASK= 3840
# PS_TYPE_MASK  = 983040
# BS_SOLID     =  0
# BS_NULL       = 1
# BS_HOLLOW     = 1
# BS_HATCHED    = 2
# BS_PATTERN    = 3
# BS_INDEXED    = 4
# BS_DIBPATTERN = 5
# BS_DIBPATTERNPT =       6
# BS_PATTERN8X8 = 7
# BS_DIBPATTERN8X8 =      8
# BI_RGB        =0
# BI_RLE8       =1
# BI_RLE4       =2
# BI_BITFIELDS  =3
# BI_JPEG       =4
# BI_PNG        =5
# DIB_RGB_COLORS   =   0
# DIB_PAL_COLORS   =   1
#     def __init__(self, path):
#     def getWidth(self):
#     def getHeight(self):
#     def __init__(self, colorRef):
#     def Create(cls, fnPenStyle = PS_SOLID,  nWidth = 1, crColor = 0x00000000):
#     def CreateEx(cls, dwPenStyle = PS_COSMETIC | PS_SOLID, dwWidth = 1, lbStyle = BS_SOLID,
#                  lbColor = 0x00000000, lbHatch = 0,
#                  dwStyleCount = 0, lpStyle = 0):
#     def __init__(self, **kwargs):


from venster.windows import *
from venster.wtl import *
from venster import gdi
                y = 10 + self.dragOffset
            if y > self.clientRect.height - 10 - self.splitWidth + self.dragOffset:
                y = self.clientRect.height - 10 - self.splitWidth + self.dragOffset
            
        return x, y
    
    def OnMouseMove(self, event):
        if event.wParam & MK_LBUTTON and GetCapture() == self.handle:
            x, y = GET_XY_LPARAM(event.lParam)
            x, y = self.Clamp(x, y)
            if self.orientation == VERTICAL:
                self.PatBlt(self.splitPos, x, 1)
            elif self.orientation == HORIZONTAL:
                self.PatBlt(self.splitPos, y, 1)
            
    def PatBlt(self, oldPos, newPos, eraseOld):
        if oldPos == newPos: return
        
        hdc = self.GetDCEx(NULL, DCX_PARENTCLIP)
        hbr = gdi.SelectObject(hdc, self.brush)

        if eraseOld:
            if self.orientation == VERTICAL:
                gdi.PatBlt(hdc, oldPos - self.dragOffset, 0,
                           self.splitWidth, self.clientRect.height, gdi.PATINVERT)
            elif self.orientation == HORIZONTAL:
                gdi.PatBlt(hdc, 0, oldPos - self.dragOffset,
                           self.clientRect.width, self.splitWidth, gdi.PATINVERT)

        if self.orientation == VERTICAL:

# Path: venster/gdi.py
# class BITMAP(Structure):
# class LOGFONT(Structure):
# class LOGBRUSH(Structure):
# class ENUMLOGFONTEX(Structure):
# class BITMAPINFOHEADER(Structure):
# class RGBQUAD(Structure):
# class BITMAPINFO(Structure):
# class BITMAPFILEHEADER(Structure):
# class Bitmap(WindowsObject):
# class SolidBrush(WindowsObject):
# class Pen(WindowsObject):
# class Font(WindowsObject):
# LF_FACESIZE = 32
# MONO_FONT = 8
# OBJ_FONT = 6
# ANSI_FIXED_FONT  = 11
# ANSI_VAR_FONT = 12
# DEVICE_DEFAULT_FONT= 14
# DEFAULT_GUI_FONT= 17
# OEM_FIXED_FONT= 10
# SYSTEM_FONT= 13
# SYSTEM_FIXED_FONT= 16
# ANSI_CHARSET          =  0
# DEFAULT_CHARSET       =  1
# SYMBOL_CHARSET        =  2
# SHIFTJIS_CHARSET      =  128
# HANGEUL_CHARSET       =  129
# HANGUL_CHARSET        =  129
# GB2312_CHARSET        =  134
# CHINESEBIG5_CHARSET   =  136
# OEM_CHARSET           =  255
# FIXED_PITCH = 1
# CLR_NONE = 0xffffffff
# HS_BDIAGONAL   =3
# HS_CROSS       =4
# HS_DIAGCROSS   =5
# HS_FDIAGONAL   =2
# HS_HORIZONTAL  =0
# HS_VERTICAL    =1
# PATINVERT     =  0x5A0049
# OUT_DEFAULT_PRECIS  =  0
# CLIP_DEFAULT_PRECIS  = 0
# DEFAULT_QUALITY      =  0
# DEFAULT_PITCH        =  0
# FF_DONTCARE   =  (0<<4)
# FF_MODERN     =  (3<<4)
# PS_GEOMETRIC=   65536
# PS_COSMETIC  =  0
# PS_ALTERNATE  = 8
# PS_SOLID      = 0
# PS_DASH       = 1
# PS_DOT= 2
# PS_DASHDOT    = 3
# PS_DASHDOTDOT = 4
# PS_NULL       = 5
# PS_USERSTYLE  = 7
# PS_INSIDEFRAME= 6
# PS_ENDCAP_ROUND =       0
# PS_ENDCAP_SQUARE=       256
# PS_ENDCAP_FLAT= 512
# PS_JOIN_BEVEL = 4096
# PS_JOIN_MITER = 8192
# PS_JOIN_ROUND = 0
# PS_STYLE_MASK = 15
# PS_ENDCAP_MASK= 3840
# PS_TYPE_MASK  = 983040
# BS_SOLID     =  0
# BS_NULL       = 1
# BS_HOLLOW     = 1
# BS_HATCHED    = 2
# BS_PATTERN    = 3
# BS_INDEXED    = 4
# BS_DIBPATTERN = 5
# BS_DIBPATTERNPT =       6
# BS_PATTERN8X8 = 7
# BS_DIBPATTERN8X8 =      8
# BI_RGB        =0
# BI_RLE8       =1
# BI_RLE4       =2
# BI_BITFIELDS  =3
# BI_JPEG       =4
# BI_PNG        =5
# DIB_RGB_COLORS   =   0
# DIB_PAL_COLORS   =   1
#     def __init__(self, path):
#     def getWidth(self):
#     def getHeight(self):
#     def __init__(self, colorRef):
#     def Create(cls, fnPenStyle = PS_SOLID,  nWidth = 1, crColor = 0x00000000):
#     def CreateEx(cls, dwPenStyle = PS_COSMETIC | PS_SOLID, dwWidth = 1, lbStyle = BS_SOLID,
#                  lbColor = 0x00000000, lbHatch = 0,
#                  dwStyleCount = 0, lpStyle = 0):
#     def __init__(self, **kwargs):


# Path: venster/lib/splitter.py
from venster.windows import *
from venster.wtl import *
from venster import gdi

                y = 10 + self.dragOffset
            if y > self.clientRect.height - 10 - self.splitWidth + self.dragOffset:
                y = self.clientRect.height - 10 - self.splitWidth + self.dragOffset
            
        return x, y
    
    def OnMouseMove(self, event):
        if event.wParam & MK_LBUTTON and GetCapture() == self.handle:
            x, y = GET_XY_LPARAM(event.lParam)
            x, y = self.Clamp(x, y)
            if self.orientation == VERTICAL:
                self.PatBlt(self.splitPos, x, 1)
            elif self.orientation == HORIZONTAL:
                self.PatBlt(self.splitPos, y, 1)
            
    def PatBlt(self, oldPos, newPos, eraseOld):
        if oldPos == newPos: return
        
        hdc = self.GetDCEx(NULL, DCX_PARENTCLIP)
        hbr = gdi.SelectObject(hdc, self.brush)

        if eraseOld:
            if self.orientation == VERTICAL:
                gdi.PatBlt(hdc, oldPos - self.dragOffset, 0,
                           self.splitWidth, self.clientRect.height, gdi.PATINVERT)
            elif self.orientation == HORIZONTAL:
                gdi.PatBlt(hdc, 0, oldPos - self.dragOffset,
                           self.clientRect.width, self.splitWidth, gdi.PATINVERT)

        if self.orientation == VERTICAL:

            gdi.PatBlt(hdc, newPos - self.dragOffset, 0,