Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
882 serge 1
 
2
DLL_ENTRY        =  1
3
4
 
5
HS_VERTICAL      =  1
6
HS_FDIAGONAL     =  2
7
HS_BDIAGONAL     =  3
8
HS_CROSS         =  4
9
HS_DIAGCROSS     =  5
10
11
 
12
13
 
14
PX_MEM_LOCAL     =  1
15
PX_MEM_GART      =  2
16
17
 
18
19
 
20
21
 
22
{
23
           pushd fcolor
24
           pushd bkcolor
25
           pushd hatch
26
           call [imp_CreateHatch]
27
           add esp, 3*4
28
}
29
30
 
31
{
32
           pushd brush
33
           call [imp_DestroyBrush]
34
           add esp, 4
35
}
36
37
 
38
{
39
           pushd flags
40
           pushd format
41
           pushd height
42
           pushd width
43
           call [imp_CreatePixmap]
44
           add esp, 4*4
45
}
46
47
 
48
{
49
          pushd pixmap
50
          call [imp_DestroyPixmap]
51
          add esp, 4
52
};
53
54
 
55
{
56
           pushd pixmap
57
           call [imp_LockPixmap]
58
           add esp, 4
59
}
60
61
 
62
{
63
           pushd pixmap
64
           call [imp_UnlockPixmap]
65
           add esp, 4
66
}
67
68
 
69
{
70
           pushd color
71
           pushd pixmap
72
           call [imp_ClearPixmap]
73
           add esp, 2*4
74
}
75
76
 
77
{
78
           pushd color
79
           pushd y1
80
           pushd x1
81
           pushd y0
82
           pushd x0
83
           pushd pixmap
84
           call [imp_Line]
85
           add esp, 6*4
86
};
87
88
 
89
{
90
           pushd border
91
           pushd color
92
           pushd h
93
           pushd w
94
           pushd y
95
           pushd x
96
           pushd pixmap
97
           call [imp_DrawRect]
98
           add esp, 7*4
99
}
100
101
 
102
{
103
           pushd border
104
           pushd brush
105
           pushd h
106
           pushd w
107
           pushd y
108
           pushd x
109
           pushd pixmap
110
           call [imp_FillRect]
111
           add esp, 7*4
112
}
113
114
 
115
{
116
           pushd h
117
           pushd w
118
           pushd srcy
119
           pushd srcx
120
           pushd srcpix
121
           pushd dsty
122
           pushd dstx
123
           pushd dstpix
124
           call [imp_Blit]
125
           add esp, 8*4
126
}
127
128
 
129
{
130
           pushd key
131
           pushd h
132
           pushd w
133
           pushd srcy
134
           pushd srcx
135
           pushd srcpix
136
           pushd dsty
137
           pushd dstx
138
           pushd dstpix
139
           call [imp_TransparentBlit]
140
           add esp, 9*4
141
}
142
143
 
144
145
 
146
szVersion            db  'version',0
147
148
 
149
szDestroyPixmap      db  'DestroyPixmap',0
150
szLockPixmap         db  'LockPixmap',0
151
szUnlockPixmap       db  'UnlockPixmap',0
152
szGetPixmapPitch     db  'GetPixmapPitch',0
153
154
 
155
szCreateMonoBrush    db  'CreateMonoBrush',0
156
szDestroyBrush       db  'DestroyBrush',0
157
158
 
159
szLine               db  'Line',0
160
szDrawRect           db  'DrawRect',0
161
szFillRect           db  'FillRect',0
162
szBlit               db  'Blit',0
163
szTransparentBlit    db  'TransparentBlit',0
164
165
 
166
167
 
168
169
 
170
imp_ver              dd  szVersion
171
172
 
173
imp_DestroyPixmap    dd  szDestroyPixmap
174
imp_LockPixmap       dd  szLockPixmap
175
imp_UnlockPixmap     dd  szUnlockPixmap
176
imp_GetPixmapPitch   dd  szGetPixmapPitch
177
178
 
179
imp_CreateMonoBrush  dd  szCreateMonoBrush
180
imp_DestroyBrush     dd  szDestroyBrush
181
182
 
183
imp_Line             dd  szLine
184
imp_DrawRect         dd  szDrawRect
185
imp_FillRect         dd  szFillRect
186
imp_Blit             dd  szBlit
187
imp_TransparentBlit  dd  szTransparentBlit
188
189
 
190
191
 
192
 
193
;szLineClip           db  'LineClip',0
194
;imp_BlockClip        dd  szBlockClip
195
;imp_LineClip         dd  szLineClip
196
197
 
198
 
199
200
 
201
           mov  eax, 68
202
           mov  ebx, 19
203
           mov  ecx, szPxlib
204
           int  0x40
205
           test eax, eax
206
           jz   .fail
207
208
 
209
           mov  esi, px_import
210
.import_loop:
211
           lodsd
212
           test eax, eax
213
           jz   .import_done
214
           push edx
215
.import_find:
216
           mov ebx, [edx]
217
           test ebx, ebx
218
           jz .fail         ;import_not_found
219
220
 
221
@@:
222
           mov cl, [eax]
223
           cmp cl, [ebx]
224
           jnz .import_find_next
225
226
 
227
           jz .import_found
228
229
 
230
           inc ebx
231
           jmp @b
232
.import_find_next:
233
           pop eax
234
           add edx, 8
235
           jmp .import_find
236
.import_found:
237
           pop eax
238
           mov eax, [edx+4]
239
           mov [esi-4], eax
240
           pop edx
241
           jmp .import_loop
242
.import_done:
243
244
 
245
           jb .fail
246
           cmp word [imp_ver+2], REQ_DLL_VER
247
           ja .fail
248
249
 
250
           call [imp_start]
251
           test eax, eax
252
           jz .fail
253
254
 
255
.fail:
256
           xor eax, eax
257
           ret
258