Rev 6009 | Rev 6032 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6009 | Rev 6031 | ||
---|---|---|---|
Line 4... | Line 4... | ||
4 | ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
4 | ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
5 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; Distributed under terms of the GNU General Public License ;; |
6 | ;; ;; |
6 | ;; ;; |
7 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
7 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 8... | Line 8... | ||
8 | 8 | ||
9 | $Revision: 6009 $ |
- | |
10 | - | ||
11 | ;============================================================================== |
- | |
12 | ;///// public functions /////////////////////////////////////////////////////// |
- | |
Line 13... | Line 9... | ||
13 | ;============================================================================== |
9 | $Revision: 6031 $ |
Line 14... | Line 10... | ||
14 | 10 | ||
15 | button.MAX_BUTTONS = 4095 |
11 | button.MAX_BUTTONS = 4095 |
Line 23... | Line 19... | ||
23 | height dw ? |
19 | height dw ? |
24 | id_hi dw ? |
20 | id_hi dw ? |
25 | dw ? |
21 | dw ? |
26 | ends |
22 | ends |
Line 27... | Line -... | ||
27 | - | ||
28 | align 4 |
23 | |
29 | ;------------------------------------------------------------------------------ |
24 | ;--------------------------------------------------------------- |
30 | syscall_button: ;///// system function 8 ////////////////////////////////////// |
25 | syscall_button: ;////////////// system function 8 ////////////// |
31 | ;------------------------------------------------------------------------------ |
26 | ;--------------------------------------------------------------- |
32 | ;? Define/undefine GUI button object |
27 | ;? Define/undefine GUI button object |
33 | ;------------------------------------------------------------------------------ |
28 | ;--------------------------------------------------------------- |
34 | ;; Define button: |
29 | ;; Define button: |
35 | ;> ebx = pack[16(x), 16(width)] |
30 | ;> ebx = pack[16(x), 16(width)] |
36 | ;> ecx = pack[16(y), 16(height)] |
31 | ;> ecx = pack[16(y), 16(height)] |
37 | ;> edx = pack[8(flags), 24(button identifier)] |
32 | ;> edx = pack[8(flags), 24(button identifier)] |
38 | ;> flags bits: |
33 | ;> flags bits: |
39 | ;> 7 (31) = 0 |
34 | ;> 7 (31) = 0 |
40 | ;> 6 (30) = don't draw button |
35 | ;> 6 (30) = don't draw button |
41 | ;> 5 (29) = don't draw button frame when pressed |
36 | ;> 5 (29) = don't draw button frame when pressed |
42 | ;> esi = button color |
37 | ;> esi = button color |
43 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
38 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
44 | ;; Undefine button: |
39 | ;; Undefine button: |
45 | ;> edx = pack[8(flags), 24(button identifier)] |
40 | ;> edx = pack[8(flags), 24(button identifier)] |
46 | ;> flags bits: |
41 | ;> flags bits: |
47 | ;> 7 (31) = 1 |
42 | ;> 7 (31) = 1 |
48 | ;------------------------------------------------------------------------------ |
43 | ;--------------------------------------------------------------- |
49 | ; do we actually need to undefine the button? |
44 | ; do we actually need to undefine the button? |
50 | test edx, 0x80000000 |
45 | test edx, 0x80000000 |
Line 51... | Line 46... | ||
51 | jnz .remove_button |
46 | jnz .remove_button |
Line 72... | Line 67... | ||
72 | add cx, word[eax + APPDATA.wnd_clientbox.top] |
67 | add cx, word[eax + APPDATA.wnd_clientbox.top] |
73 | rol ecx, 16 |
68 | rol ecx, 16 |
74 | pop eax |
69 | pop eax |
Line 75... | Line 70... | ||
75 | 70 | ||
76 | ; basic checks passed, define the button |
- | |
77 | push ebx ecx edx |
71 | ; basic checks passed, define the button |
78 | inc eax |
72 | inc eax |
79 | mov [edi], ax |
73 | mov [edi], ax |
80 | shl eax, 4 |
74 | shl eax, 4 |
81 | add edi, eax |
75 | add edi, eax |
82 | ; NOTE: this code doesn't rely on SYS_BUTTON struct, please revise it |
76 | ; NOTE: this code doesn't rely on SYS_BUTTON struct, |
83 | ; if you change something |
77 | ; please revise it, if you change something. |
84 | mov ax, [CURRENT_TASK] |
78 | mov ax, [CURRENT_TASK] |
85 | stosw |
79 | stosw |
86 | mov ax, dx |
80 | mov ax, dx |
87 | stosw ; button id number: bits 0-15 |
81 | stosw ; button id number: bits 0-15 |
Line 92... | Line 86... | ||
92 | rol eax, 16 |
86 | rol eax, 16 |
93 | stosd ; y start | y size |
87 | stosd ; y start | y size |
94 | mov eax, edx |
88 | mov eax, edx |
95 | shr eax, 16 |
89 | shr eax, 16 |
96 | stosw ; button id number: bits 16-31 |
90 | stosw ; button id number: bits 16-31 |
97 | pop edx ecx ebx |
- | |
Line 98... | Line 91... | ||
98 | 91 | ||
99 | ; do we also need to draw the button? |
92 | ; do we also need to draw the button? |
100 | test edx, 0x40000000 |
93 | test edx, 0x40000000 |
Line 101... | Line -... | ||
101 | jnz .exit |
- | |
102 | - | ||
103 | ; draw button body |
- | |
104 | - | ||
105 | pushad |
- | |
106 | - | ||
107 | ; calculate window-relative coordinates |
94 | jnz .exit |
108 | movzx edi, cx |
95 | |
109 | shr ebx, 16 |
96 | xor edi, edi |
110 | shr ecx, 16 |
- | |
111 | mov eax, [TASK_BASE] |
- | |
112 | add ebx, [eax - twdw + WDATA.box.left] |
- | |
113 | add ecx, [eax - twdw + WDATA.box.top] |
97 | push ebx ecx esi |
114 | mov eax, ebx |
98 | cmp [buttontype], 1 |
115 | inc eax |
- | |
116 | shl eax, 16 |
- | |
117 | mov ax, bx |
99 | jnz .draw |
118 | add ax, word[esp + 16] |
- | |
119 | dec ax |
- | |
120 | mov ebx, ecx |
- | |
121 | shl ebx, 16 |
- | |
122 | mov bx, cx |
- | |
123 | - | ||
124 | ; calculate initial color |
- | |
125 | mov ecx, esi |
- | |
126 | cmp [buttontype], 0 |
- | |
Line 127... | Line 100... | ||
127 | je @f |
100 | cmp cx, 129 |
- | 101 | jnc .draw |
|
- | 102 | ||
- | 103 | ; calculate gradient data |
|
- | 104 | mov eax, esi |
|
- | 105 | shl eax, 8 |
|
- | 106 | mov edx, 3 |
|
- | 107 | .calculate: |
|
- | 108 | rol eax, 8 |
|
- | 109 | shl al, 1 |
|
- | 110 | jnc @f |
|
128 | call button._.incecx2 |
111 | neg al |
- | 112 | jnz @f |
|
129 | 113 | mov al, 128 |
|
- | 114 | @@: |
|
- | 115 | jns @f |
|
130 | ; set button height counter |
116 | mov al, 128 |
131 | @@: |
117 | @@: |
132 | mov edx, edi |
- | |
133 | add ebx, 0x00010001 |
- | |
134 | dec edx |
- | |
135 | - | ||
136 | .next_line: |
118 | div cl |
137 | call button._.button_dececx |
- | |
138 | push edi |
- | |
139 | xor edi, edi |
119 | shl ax, 8 |
140 | ; call [draw_line] |
- | |
141 | call __sys_draw_line |
120 | dec edx |
142 | pop edi |
121 | jnz .calculate |
143 | add ebx, 0x00010001 |
- | |
144 | dec edx |
122 | mov dl, cl |
145 | jnz .next_line |
- | |
146 | 123 | dec edx |
|
147 | popad |
- | |
148 | 124 | shr edx, 1 |
|
- | 125 | shr eax, 8 |
|
149 | ; draw button frame |
126 | mov edi, eax |
150 | 127 | mul edx |
|
- | 128 | add esi, eax |
|
- | 129 | ||
151 | push ebx ecx |
130 | .draw: ; calculate window-relative coordinates |
152 | 131 | movzx ebp, cx |
|
153 | ; calculate window-relative coordinates |
132 | dec ebp |
154 | shr ebx, 16 |
133 | shr ebx, 16 |
155 | shr ecx, 16 |
134 | shr ecx, 16 |
156 | mov eax, [TASK_BASE] |
- | |
157 | add ebx, [eax - twdw + WDATA.box.left] |
- | |
158 | add ecx, [eax - twdw + WDATA.box.top] |
135 | mov eax, [TASK_BASE] |
159 | 136 | add ebx, [eax - twdw + WDATA.box.left] |
|
160 | ; top border |
137 | add ecx, [eax - twdw + WDATA.box.top] |
161 | mov eax, ebx |
138 | mov eax, ebx |
- | 139 | inc eax |
|
162 | shl eax, 16 |
140 | mov edx, ebx |
163 | mov ax, bx |
- | |
164 | add ax, [esp + 4] |
- | |
165 | mov ebx, ecx |
- | |
166 | shl ebx, 16 |
- | |
167 | mov bx, cx |
141 | add dx, [esp+8] |
- | 142 | dec edx |
|
- | 143 | mov ebx, ecx |
|
168 | push ebx |
144 | mov ecx, esi |
- | 145 | shr ecx, 1 |
|
169 | xor edi, edi |
146 | btr ecx, 7 |
170 | mov ecx, esi |
147 | btr ecx, 15 |
171 | ; call button._.incecx |
- | |
172 | ; call [draw_line] |
148 | push esi |
173 | call __sys_draw_line |
149 | mov esi, edi |
174 | 150 | xor edi, edi |
|
- | 151 | call hline ; top border |
|
175 | ; light line under top border |
152 | inc ebx |
176 | add ebx, 0x00010001 |
153 | pop ecx |
177 | mov ecx, esi |
154 | .next_line: |
178 | call button._.incecx |
155 | call hline ; button body |
179 | call __sys_draw_line |
156 | inc ebx |
180 | sub ebx, 0x00010001 |
157 | sub ecx, esi |
181 | ; bottom border |
158 | dec ebp |
182 | movzx edx, word[esp + 4 + 0] |
159 | jnz .next_line |
183 | add ebx, edx |
160 | shr ecx, 1 |
184 | shl edx, 16 |
161 | btr ecx, 7 |
185 | add ebx, edx |
162 | btr ecx, 15 |
186 | mov ecx, esi |
163 | call hline ; bottom border |
187 | call button._.dececx |
- | |
188 | ; call [draw_line] |
164 | pop ecx |
189 | call __sys_draw_line |
165 | shr ecx, 1 |
190 | 166 | btr ecx, 7 |
|
191 | ; left border |
- | |
192 | pop ebx |
- | |
193 | push edx |
- | |
194 | mov edx, eax |
167 | btr ecx, 15 |
195 | shr edx, 16 |
168 | inc edx |
196 | mov ax, dx |
169 | push edx |
197 | mov edx, ebx |
170 | mov edx, ebx |
198 | shr edx, 16 |
171 | sub bx, [esp+4] |
199 | mov bx, dx |
172 | dec eax |
200 | add bx, [esp + 4 + 0] |
- | |
201 | pop edx |
- | |
202 | mov ecx, esi |
173 | cmp [buttontype], 1 |
203 | call button._.dececx ; button._.incecx |
- | |
204 | ; call [draw_line] |
174 | jnz @f |
205 | dec ebx |
- | |
206 | call __sys_draw_line |
175 | dec edx |
207 | - | ||
208 | ; right border |
- | |
209 | mov dx, [esp + 4] |
- | |
210 | add ax, dx |
- | |
211 | shl edx, 16 |
176 | inc ebx |
212 | add eax, edx |
- | |
213 | add ebx, 0x00010000 |
- | |
214 | mov ecx, esi |
177 | @@: |
215 | call button._.dececx |
- | |
216 | ; call [draw_line] |
178 | call vline ; left border |
217 | call __sys_draw_line |
- | |
218 | 179 | pop eax |
|
219 | pop ecx ebx |
180 | call vline ; right border |
Line 220... | Line 181... | ||
220 | 181 | pop ecx ebx |
|
221 | .exit: |
182 | .exit: |
222 | ret |
183 | ret |
223 | 184 | ||
224 | ; FIXME: mutex needed |
185 | ; FIXME: mutex needed |
225 | syscall_button.remove_button: |
186 | .remove_button: |
226 | and edx, 0x00ffffff |
187 | and edx, 0x00ffffff |
Line 260... | Line 221... | ||
260 | dec dword[edi] |
221 | dec dword[edi] |
261 | add ecx, -sizeof.SYS_BUTTON |
222 | add ecx, -sizeof.SYS_BUTTON |
262 | pop ebx |
223 | pop ebx |
263 | jmp .next_button |
224 | jmp .next_button |
Line 264... | Line -... | ||
264 | - | ||
265 | .exit: |
- | |
266 | ret |
- | |
267 | - | ||
268 | align 4 |
225 | |
269 | ;------------------------------------------------------------------------------ |
226 | ;--------------------------------------------------------------- |
270 | sys_button_activate_handler: ;///////////////////////////////////////////////// |
- | |
271 | ;------------------------------------------------------------------------------ |
227 | sys_button_activate_handler: |
272 | ;? |
228 | sys_button_deactivate_handler: |
273 | ;------------------------------------------------------------------------------ |
229 | ;--------------------------------------------------------------- |
274 | ;> eax = pack[8(process slot), 24(button id)] |
230 | ;> eax = pack[8(process slot), 24(button id)] |
275 | ;> ebx = pack[16(button x coord), 16(button y coord)] |
231 | ;> ebx = pack[16(button x coord), 16(button y coord)] |
276 | ;> cl = mouse button mask this system button was pressed with |
- | |
277 | ;------------------------------------------------------------------------------ |
- | |
278 | call button._.find_button |
- | |
279 | or eax, eax |
- | |
280 | jz .exit |
- | |
281 | - | ||
282 | mov ebx, dword[eax + SYS_BUTTON.id_hi - 2] |
- | |
283 | call button._.negative_button |
- | |
284 | - | ||
285 | .exit: |
- | |
286 | ret |
- | |
287 | - | ||
288 | align 4 |
- | |
289 | ;------------------------------------------------------------------------------ |
- | |
290 | sys_button_deactivate_handler: ;/////////////////////////////////////////////// |
- | |
291 | ;------------------------------------------------------------------------------ |
- | |
292 | ;? |
- | |
293 | ;------------------------------------------------------------------------------ |
- | |
294 | ;> eax = pack[8(process slot), 24(button id)] |
- | |
295 | ;> ebx = pack[16(button x coord), 16(button y coord)] |
- | |
296 | ;> cl = mouse button mask this system button was pressed with |
- | |
297 | ;------------------------------------------------------------------------------ |
- | |
298 | call button._.find_button |
- | |
299 | or eax, eax |
- | |
300 | jz .exit |
- | |
301 | - | ||
302 | mov ebx, dword[eax + SYS_BUTTON.id_hi - 2] |
- | |
303 | call button._.negative_button |
- | |
304 | - | ||
305 | .exit: |
- | |
306 | ret |
- | |
307 | - | ||
308 | align 4 |
- | |
309 | ;------------------------------------------------------------------------------ |
- | |
310 | sys_button_perform_handler: ;////////////////////////////////////////////////// |
- | |
311 | ;------------------------------------------------------------------------------ |
- | |
312 | ;? |
- | |
313 | ;------------------------------------------------------------------------------ |
- | |
314 | ;> eax = pack[8(process slot), 24(button id)] |
- | |
315 | ;> ebx = pack[16(button x coord), 16(button y coord)] |
- | |
316 | ;> cl = mouse button mask this system button was pressed with |
- | |
317 | ;------------------------------------------------------------------------------ |
- | |
318 | shl eax, 8 |
- | |
319 | mov al, cl |
- | |
320 | movzx ebx, byte[BTN_COUNT] |
- | |
321 | mov [BTN_BUFF + ebx * 4], eax |
- | |
322 | inc bl |
- | |
323 | mov [BTN_COUNT], bl |
- | |
324 | ret |
- | |
325 | - | ||
326 | ;============================================================================== |
- | |
327 | ;///// private functions ////////////////////////////////////////////////////// |
- | |
328 | ;============================================================================== |
- | |
329 | - | ||
330 | ;------------------------------------------------------------------------------ |
- | |
331 | button._.find_button: ;//////////////////////////////////////////////////////// |
232 | ;> cl = mouse button mask this system button was pressed with |
332 | ;------------------------------------------------------------------------------ |
233 | ;--------------------------------------------------------------- |
333 | ;? Find system button by specified process slot, id and coordinates |
- | |
334 | ;------------------------------------------------------------------------------ |
- | |
335 | ;> eax = pack[8(process slot), 24(button id)] or 0 |
- | |
336 | ;> ebx = pack[16(button x coord), 16(button y coord)] |
- | |
337 | ;------------------------------------------------------------------------------ |
- | |
338 | ;< eax = pointer to SYS_BUTTON struct or 0 |
- | |
339 | ;------------------------------------------------------------------------------ |
234 | ; find system button by specified process slot, id and coordinates |
340 | push ecx edx esi edi |
- | |
341 | 235 | push ecx edx esi edi |
|
342 | mov edx, eax |
236 | mov edx, eax |
343 | shr edx, 24 |
237 | shr edx, 24 |
344 | and eax, 0x0ffffff |
- | |
345 | 238 | and eax, 0x0ffffff |
|
346 | mov edi, [BTN_ADDR] |
239 | mov edi, [BTN_ADDR] |
347 | mov ecx, [edi] |
240 | mov ecx, [edi] |
348 | imul esi, ecx, sizeof.SYS_BUTTON |
241 | imul esi, ecx, sizeof.SYS_BUTTON |
349 | add esi, edi |
242 | add esi, edi |
350 | inc ecx |
243 | inc ecx |
351 | add esi, sizeof.SYS_BUTTON |
- | |
352 | 244 | add esi, sizeof.SYS_BUTTON |
|
353 | .next_button: |
245 | .next_button: |
354 | dec ecx |
246 | dec ecx |
355 | jz .not_found |
- | |
356 | 247 | jz .popexit |
|
Line 357... | Line 248... | ||
357 | add esi, -sizeof.SYS_BUTTON |
248 | add esi, -sizeof.SYS_BUTTON |
358 | 249 | ||
359 | ; does it belong to our process? |
250 | ; does it belong to our process? |
Line 371... | Line 262... | ||
371 | mov edi, dword[esi + SYS_BUTTON.left - 2] |
262 | mov edi, dword[esi + SYS_BUTTON.left - 2] |
372 | mov di, [esi + SYS_BUTTON.top] |
263 | mov di, [esi + SYS_BUTTON.top] |
373 | cmp ebx, edi |
264 | cmp ebx, edi |
374 | jne .next_button |
265 | jne .next_button |
Line 375... | Line -... | ||
375 | - | ||
376 | ; okay, return it |
266 | |
377 | mov eax, esi |
- | |
378 | jmp .exit |
- | |
379 | - | ||
380 | .not_found: |
- | |
381 | xor eax, eax |
- | |
382 | - | ||
383 | .exit: |
267 | mov eax, esi |
384 | pop edi esi edx ecx |
- | |
385 | ret |
- | |
386 | - | ||
387 | ;------------------------------------------------------------------------------ |
- | |
388 | button._.dececx: ;///////////////////////////////////////////////////////////// |
- | |
389 | ;------------------------------------------------------------------------------ |
- | |
390 | ;? |
- | |
391 | ;------------------------------------------------------------------------------ |
- | |
392 | sub cl, 0x20 |
- | |
393 | jnc @f |
- | |
394 | xor cl, cl |
- | |
395 | @@: |
- | |
396 | sub ch, 0x20 |
- | |
397 | jnc @f |
- | |
398 | xor ch, ch |
- | |
399 | @@: |
- | |
400 | rol ecx, 16 |
- | |
401 | sub cl, 0x20 |
- | |
402 | jnc @f |
- | |
403 | xor cl, cl |
- | |
404 | @@: |
- | |
405 | rol ecx, 16 |
- | |
406 | ret |
- | |
407 | - | ||
408 | ;------------------------------------------------------------------------------ |
- | |
409 | button._.incecx: ;///////////////////////////////////////////////////////////// |
- | |
410 | ;------------------------------------------------------------------------------ |
- | |
411 | ;? |
- | |
412 | ;------------------------------------------------------------------------------ |
- | |
413 | add cl, 0x20 |
- | |
414 | jnc @f |
- | |
415 | or cl, -1 |
- | |
416 | @@: |
- | |
417 | add ch, 0x20 |
- | |
418 | jnc @f |
- | |
419 | or ch, -1 |
- | |
420 | @@: |
- | |
421 | rol ecx, 16 |
- | |
422 | add cl, 0x20 |
- | |
423 | jnc @f |
- | |
424 | or cl, -1 |
- | |
425 | @@: |
- | |
426 | rol ecx, 16 |
- | |
427 | ret |
- | |
428 | - | ||
429 | ;------------------------------------------------------------------------------ |
- | |
430 | button._.incecx2: ;//////////////////////////////////////////////////////////// |
- | |
431 | ;------------------------------------------------------------------------------ |
- | |
432 | ;? |
- | |
433 | ;------------------------------------------------------------------------------ |
- | |
434 | add cl, 0x14 |
- | |
435 | jnc @f |
- | |
436 | or cl, -1 |
- | |
437 | @@: |
- | |
438 | add ch, 0x14 |
- | |
439 | jnc @f |
- | |
440 | or ch, -1 |
- | |
441 | @@: |
- | |
442 | rol ecx, 16 |
- | |
443 | add cl, 0x14 |
- | |
444 | jnc @f |
- | |
445 | or cl, -1 |
- | |
446 | @@: |
- | |
447 | rol ecx, 16 |
- | |
448 | ret |
- | |
449 | - | ||
450 | ;------------------------------------------------------------------------------ |
- | |
451 | button._.button_dececx: ;////////////////////////////////////////////////////// |
- | |
452 | ;------------------------------------------------------------------------------ |
- | |
453 | ;? |
- | |
454 | ;------------------------------------------------------------------------------ |
268 | pop edi esi edx ecx |
455 | cmp [buttontype], 1 |
- | |
456 | jne .finish |
- | |
457 | - | ||
458 | push eax |
- | |
459 | mov al, 1 |
- | |
460 | cmp edi, 20 |
- | |
461 | jg @f |
- | |
462 | mov al, 2 |
- | |
463 | - | ||
464 | @@: |
- | |
465 | sub cl, al |
- | |
466 | jnc @f |
- | |
467 | xor cl, cl |
- | |
468 | @@: |
- | |
469 | sub ch, al |
- | |
470 | jnc @f |
- | |
471 | xor ch, ch |
- | |
472 | @@: |
- | |
473 | rol ecx, 16 |
- | |
474 | sub cl, al |
- | |
475 | jnc @f |
- | |
476 | xor cl, cl |
- | |
477 | @@: |
- | |
478 | rol ecx, 16 |
- | |
479 | - | ||
480 | pop eax |
- | |
481 | - | ||
482 | .finish: |
- | |
Line 483... | Line -... | ||
483 | ret |
- | |
484 | - | ||
485 | ;------------------------------------------------------------------------------ |
- | |
486 | button._.negative_button: ;//////////////////////////////////////////////////// |
- | |
487 | ;------------------------------------------------------------------------------ |
- | |
488 | ;? Invert system button border |
269 | mov ebx, dword[eax + SYS_BUTTON.id_hi - 2] |
489 | ;------------------------------------------------------------------------------ |
270 | |
490 | ; if requested, do not display button border on press. |
271 | ; display button border on press? |
Line -... | Line 272... | ||
- | 272 | test ebx, 0x20000000 |
|
491 | test ebx, 0x20000000 |
273 | jnz .exit |
492 | jnz .exit |
- | |
493 | 274 | ||
494 | pushad |
- | |
495 | 275 | ; invert system button border |
|
496 | xchg esi, eax |
276 | pushad |
497 | 277 | mov esi, eax |
|
498 | movzx ecx, [esi + SYS_BUTTON.pslot] |
- | |
499 | shl ecx, 5 |
278 | movzx ecx, [esi + SYS_BUTTON.pslot] |
500 | add ecx, window_data |
279 | shl ecx, 5 |
501 | 280 | add ecx, window_data |
|
502 | mov eax, dword[esi + SYS_BUTTON.left] |
281 | mov eax, dword[esi + SYS_BUTTON.left] |
503 | mov ebx, dword[esi + SYS_BUTTON.top] |
- | |
504 | add eax, [ecx + WDATA.box.left] |
- | |
505 | add ebx, [ecx + WDATA.box.top] |
282 | mov ebx, dword[esi + SYS_BUTTON.top] |
506 | push eax ebx |
283 | add eax, [ecx + WDATA.box.left] |
- | 284 | add ebx, [ecx + WDATA.box.top] |
|
507 | pop edx ecx |
285 | rol eax, 16 |
508 | rol eax, 16 |
286 | rol ebx, 16 |
509 | rol ebx, 16 |
- | |
- | 287 | push eax ebx |
|
- | 288 | shr eax, 16 |
|
- | 289 | shr ebx, 16 |
|
- | 290 | mov edx, eax |
|
510 | add ax, cx |
291 | add dx, [esp+4] |
- | 292 | dec edx |
|
- | 293 | inc eax |
|
- | 294 | mov ecx, 1000000h |
|
- | 295 | xor edi, edi |
|
- | 296 | inc edi |
|
- | 297 | call hline |
|
- | 298 | add bx, [esp] |
|
- | 299 | call hline |
|
- | 300 | inc edx |
|
- | 301 | push edx |
|
511 | add bx, dx |
302 | mov edx, ebx |
- | 303 | sub bx, [esp+4] |
|
- | 304 | dec eax |
|
- | 305 | cmp [buttontype], 1 |
|
512 | 306 | jnz @f |
|
- | 307 | dec edx |
|
- | 308 | inc ebx |
|
- | 309 | @@: |
|
- | 310 | call vline |
|
513 | mov esi, 0x01000000 |
311 | pop eax |
514 | call draw_rectangle.forced |
- | |
515 | 312 | call vline |
|
516 | popad |
313 | pop eax eax |
- | 314 | popad |
|
- | 315 | .exit: |
|
- | 316 | ret |
|
- | 317 | .popexit: |
|
- | 318 | pop edi esi edx ecx |
|
- | 319 | ret |
|
- | 320 | ||
- | 321 | ;--------------------------------------------------------------- |
|
- | 322 | sys_button_perform_handler: |
|
- | 323 | ;--------------------------------------------------------------- |
|
- | 324 | ;> eax = pack[8(process slot), 24(button id)] |
|
- | 325 | ;> ebx = pack[16(button x coord), 16(button y coord)] |
|
- | 326 | ;> cl = mouse button mask this system button was pressed with |
|
- | 327 | ;--------------------------------------------------------------- |
|
- | 328 | shl eax, 8 |
|
- | 329 | mov al, cl |
|
- | 330 | movzx ebx, byte[BTN_COUNT] |
|
- | 331 | mov [BTN_BUFF + ebx * 4], eax |