-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathwkeStruct.py
More file actions
129 lines (93 loc) · 3.44 KB
/
wkeStruct.py
File metadata and controls
129 lines (93 loc) · 3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
from ctypes import (
c_int,
c_short,
c_ushort,
c_ulong,
c_long,
c_longlong,
c_ulonglong,
c_float,
c_char,
c_char_p,
c_wchar_p,
c_bool,
c_void_p,
c_size_t,
Structure,
byref,
POINTER,
create_string_buffer,
sizeof,
windll,
cdll,
CFUNCTYPE,
WINFUNCTYPE,
)
from ctypes.wintypes import (
DWORD,
HWND,
INT,
LONG,
LPARAM,
UINT,
WORD,
WPARAM,
RGB,
MSG,
)
user32 = windll.user32
gdi32 = windll.gdi32
imm32= windll.imm32
# kernel32= windll.kernel32
class wkeProxy(Structure):
_fields_ = [('type', c_int),('hostname', c_char *100),('port', c_ushort ),('username', c_char *50),('password',c_char *50)]
class wkeRect(Structure):
_fields_=[('x',c_int),('y',c_int),('w',c_int),('h',c_int)]
class wkeMemBuf(Structure):
_fields_=[('size',c_int),('data',c_char_p),('length',c_size_t)]
class wkeString(Structure):
...
class wkePostBodyElement(Structure):
_fields_=[('size',c_int),('type',c_int),('data',POINTER(wkeMemBuf)),('filePath',wkeString),('fileStart',c_longlong),('fileLength',c_longlong)]
...
class wkePostBodyElements(Structure):
_fields_ =[('size',c_int),('element',POINTER(POINTER(wkePostBodyElement))),('elementSize',c_size_t),('isDirty',c_bool)]
class wkeScreenshotSettings(Structure):
_fields_=[('structSize',c_int),('width',c_int),('height',c_int)]
class wkeWindowFeatures(Structure):
_fields_=[('x',c_int),('y',c_int),('width',c_int),('height',c_int),('menuBarVisible',c_bool),('statusBarVisible',c_bool),('toolBarVisible',c_bool),('locationBarVisible',c_bool),('scrollbarsVisible',c_bool),('resizable',c_bool),('fullscreen',c_bool)]
class wkePrintSettings(Structure):
_fields_=[('structSize',c_int),('dpi',c_int),('width',c_int),('height',c_int),('marginTop',c_int),('marginBottom',c_int),('marginLeft',c_int),('marginRight',c_int),('isPrintPageHeadAndFooter',c_bool),('isPrintBackgroud',c_bool),('isLandscape',c_bool)]
class wkePdfDatas(Structure):
_fields_=[('count',c_int),('sizes',c_size_t),('datas',c_void_p)]
class Rect(Structure):
_fields_=[('Left',c_int),('Top',c_int),('Right',c_int),('Bottom',c_int)]
class mPos(Structure):
_fields_=[('x',c_int),('y',c_int)]
class mSize(Structure):
_fields_=[('cx',c_int),('cy',c_int)]
class bitMap(Structure):
_fields_=[('bmType',c_int),('bmWidth',c_int),('bmHeight',c_int),('bmWidthBytes',c_int),('bmPlanes',c_short),('bmBitsPixel',c_short),('bmBits',c_int)]
class blendFunction(Structure):
_fields_=[('BlendOp',c_char_p),('BlendFlags',c_char_p),('SourceConstantAlpha',c_char_p),('AlphaFormat',c_char_p)]
class PAINTSTRUCT(Structure):
_fields_=[('hdc',c_int),('fErase',c_int),('rcPaint',Rect),('fRestore',c_int),('fIncUpdate',c_int),('hdc',c_int),('rgbReserved',c_char *32)]
class COMPOSITIONFORM(Structure):
_fields_=[('dwStyle',c_int),('ptCurrentPos',mPos),('rcArea',Rect)]
class BITMAPINFOHEADER(Structure):
""" 关于DIB的尺寸和颜色格式的信息 """
_fields_ = [
("biSize", DWORD),
("biWidth", LONG),
("biHeight", LONG),
("biPlanes", WORD),
("biBitCount", WORD),
("biCompression", DWORD),
("biSizeImage", DWORD),
("biXPelsPerMeter", LONG),
("biYPelsPerMeter", LONG),
("biClrUsed", DWORD),
("biClrImportant", DWORD),
]
class BITMAPINFO(Structure):
_fields_ = [("bmiHeader", BITMAPINFOHEADER), ("bmiColors", DWORD * 3)]