Subversion Repositories Kolibri OS

Rev

Rev 1635 | Rev 2465 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1635 Rev 2434
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
 
Line 9... Line 9...
9
$Revision: 1391 $
9
$Revision: 2434 $
10
 
10
 
11
;==============================================================================
11
;==============================================================================
Line 12... Line 12...
12
;///// public functions ///////////////////////////////////////////////////////
12
;///// public functions ///////////////////////////////////////////////////////
Line 13... Line 13...
13
;==============================================================================
13
;==============================================================================
14
 
-
 
15
button.MAX_BUTTONS = 4095
14
 
16
 
15
button.MAX_BUTTONS = 4095
17
struc SYS_BUTTON
16
 
18
{
17
struct  SYS_BUTTON
19
  .pslot  dw ?
18
        pslot           dw ?
20
  .id_lo  dw ?
19
        id_lo           dw ?
21
  .left   dw ?
20
        left            dw ?
22
  .width  dw ?
21
        width           dw ?
23
  .top    dw ?
-
 
24
  .height dw ?
-
 
25
  .id_hi  dw ?
-
 
26
          dw ?
-
 
27
  .sizeof:
22
        top             dw ?
Line 28... Line 23...
28
}
23
        height          dw ?
29
virtual at 0
24
        id_hi           dw ?
30
  SYS_BUTTON SYS_BUTTON
25
                        dw ?
31
end virtual
26
ends
Line 129... Line 124...
129
        cmp     [buttontype], 0
124
        cmp     [buttontype], 0
130
        je      @f
125
        je      @f
131
        call    button._.incecx2
126
        call    button._.incecx2
Line 132... Line 127...
132
 
127
 
-
 
128
        ; set button height counter
133
        ; set button height counter
129
    @@:
Line 134... Line 130...
134
    @@: mov     edx, edi
130
        mov     edx, edi
135
 
131
 
136
  .next_line:
132
  .next_line:
137
        call    button._.button_dececx
133
        call    button._.button_dececx
Line 213... Line 209...
213
syscall_button.remove_button:
209
syscall_button.remove_button:
214
        and     edx, 0x00ffffff
210
        and     edx, 0x00ffffff
215
        mov     edi, [BTN_ADDR]
211
        mov     edi, [BTN_ADDR]
216
        mov     ebx, [edi]
212
        mov     ebx, [edi]
217
        inc     ebx
213
        inc     ebx
218
        imul    esi, ebx, SYS_BUTTON.sizeof
214
        imul    esi, ebx, sizeof.SYS_BUTTON
219
        add     esi, edi
215
        add     esi, edi
220
        xor     ecx, ecx
216
        xor     ecx, ecx
221
        add     ecx, -SYS_BUTTON.sizeof
217
        add     ecx, -sizeof.SYS_BUTTON
222
        add     esi, SYS_BUTTON.sizeof
218
        add     esi, sizeof.SYS_BUTTON
Line 223... Line 219...
223
 
219
 
224
  .next_button:
220
  .next_button:
225
        dec     ebx
221
        dec     ebx
Line 226... Line 222...
226
        jz      .exit
222
        jz      .exit
227
 
223
 
Line 228... Line 224...
228
        add     ecx, SYS_BUTTON.sizeof
224
        add     ecx, sizeof.SYS_BUTTON
229
        add     esi, -SYS_BUTTON.sizeof
225
        add     esi, -sizeof.SYS_BUTTON
230
 
226
 
231
        ; does it belong to our process?
227
        ; does it belong to our process?
Line 241... Line 237...
241
        jne     .next_button
237
        jne     .next_button
Line 242... Line 238...
242
 
238
 
243
        ; okay, undefine it
239
        ; okay, undefine it
244
        push    ebx
240
        push    ebx
245
        mov     ebx, esi
241
        mov     ebx, esi
246
        lea     eax, [esi + SYS_BUTTON.sizeof]
242
        lea     eax, [esi + sizeof.SYS_BUTTON]
247
        call    memmove
243
        call    memmove
248
        dec     dword[edi]
244
        dec     dword[edi]
249
        add     ecx, -SYS_BUTTON.sizeof
245
        add     ecx, -sizeof.SYS_BUTTON
250
        pop     ebx
246
        pop     ebx
Line 251... Line 247...
251
        jmp     .next_button
247
        jmp     .next_button
252
 
248
 
Line 331... Line 327...
331
        shr     edx, 24
327
        shr     edx, 24
332
        and     eax, 0x0ffffff
328
        and     eax, 0x0ffffff
Line 333... Line 329...
333
 
329
 
334
        mov     edi, [BTN_ADDR]
330
        mov     edi, [BTN_ADDR]
335
        mov     ecx, [edi]
331
        mov     ecx, [edi]
336
        imul    esi, ecx, SYS_BUTTON.sizeof
332
        imul    esi, ecx, sizeof.SYS_BUTTON
337
        add     esi, edi
333
        add     esi, edi
338
        inc     ecx
334
        inc     ecx
Line 339... Line 335...
339
        add     esi, SYS_BUTTON.sizeof
335
        add     esi, sizeof.SYS_BUTTON
340
 
336
 
341
  .next_button:
337
  .next_button:
Line 342... Line 338...
342
        dec     ecx
338
        dec     ecx
Line 343... Line 339...
343
        jz      .not_found
339
        jz      .not_found
344
 
340
 
345
        add     esi, -SYS_BUTTON.sizeof
341
        add     esi, -sizeof.SYS_BUTTON
Line 378... Line 374...
378
;? 
374
;? 
379
;------------------------------------------------------------------------------
375
;------------------------------------------------------------------------------
380
        sub     cl, 0x20
376
        sub     cl, 0x20
381
        jnc     @f
377
        jnc     @f
382
        xor     cl, cl
378
        xor     cl, cl
-
 
379
    @@:
383
    @@: sub     ch, 0x20
380
        sub     ch, 0x20
384
        jnc     @f
381
        jnc     @f
385
        xor     ch, ch
382
        xor     ch, ch
-
 
383
    @@:
386
    @@: rol     ecx, 16
384
        rol     ecx, 16
387
        sub     cl, 0x20
385
        sub     cl, 0x20
388
        jnc     @f
386
        jnc     @f
389
        xor     cl, cl
387
        xor     cl, cl
-
 
388
    @@:
390
    @@: rol     ecx, 16
389
        rol     ecx, 16
391
        ret
390
        ret
Line 392... Line 391...
392
 
391
 
393
;------------------------------------------------------------------------------
392
;------------------------------------------------------------------------------
394
button._.incecx: ;/////////////////////////////////////////////////////////////
393
button._.incecx: ;/////////////////////////////////////////////////////////////
395
;------------------------------------------------------------------------------
394
;------------------------------------------------------------------------------
396
;? 
395
;? 
397
;------------------------------------------------------------------------------
396
;------------------------------------------------------------------------------
398
        add     cl, 0x20
397
        add     cl, 0x20
399
        jnc     @f
398
        jnc     @f
-
 
399
        or      cl, -1
400
        or      cl, -1
400
    @@:
401
    @@: add     ch, 0x20
401
        add     ch, 0x20
402
        jnc     @f
402
        jnc     @f
-
 
403
        or      ch, -1
403
        or      ch, -1
404
    @@:
404
    @@: rol     ecx, 16
405
        rol     ecx, 16
405
        add     cl, 0x20
406
        add     cl, 0x20
406
        jnc     @f
407
        jnc     @f
-
 
408
        or      cl, -1
407
        or      cl, -1
409
    @@:
408
    @@: rol     ecx, 16
410
        rol     ecx, 16
Line 409... Line 411...
409
        ret
411
        ret
410
 
412
 
411
;------------------------------------------------------------------------------
413
;------------------------------------------------------------------------------
412
button._.incecx2: ;////////////////////////////////////////////////////////////
414
button._.incecx2: ;////////////////////////////////////////////////////////////
413
;------------------------------------------------------------------------------
415
;------------------------------------------------------------------------------
414
;? 
416
;? 
415
;------------------------------------------------------------------------------
417
;------------------------------------------------------------------------------
416
        add     cl, 0x14
418
        add     cl, 0x14
-
 
419
        jnc     @f
417
        jnc     @f
420
        or      cl, -1
418
        or      cl, -1
421
    @@:
419
    @@: add     ch, 0x14
422
        add     ch, 0x14
-
 
423
        jnc     @f
420
        jnc     @f
424
        or      ch, -1
421
        or      ch, -1
425
    @@:
422
    @@: rol     ecx, 16
426
        rol     ecx, 16
423
        add     cl, 0x14
427
        add     cl, 0x14
-
 
428
        jnc     @f
424
        jnc     @f
429
        or      cl, -1
425
        or      cl, -1
430
    @@:
Line 426... Line 431...
426
    @@: rol     ecx, 16
431
        rol     ecx, 16
427
        ret
432
        ret
428
 
433
 
Line 438... Line 443...
438
        mov     al, 1
443
        mov     al, 1
439
        cmp     edi, 20
444
        cmp     edi, 20
440
        jg      @f
445
        jg      @f
441
        mov     al, 2
446
        mov     al, 2
Line -... Line 447...
-
 
447
 
442
 
448
    @@:
443
    @@: sub     cl, al
449
        sub     cl, al
444
        jnc     @f
450
        jnc     @f
-
 
451
        xor     cl, cl
445
        xor     cl, cl
452
    @@:
446
    @@: sub     ch, al
453
        sub     ch, al
447
        jnc     @f
454
        jnc     @f
-
 
455
        xor     ch, ch
448
        xor     ch, ch
456
    @@:
449
    @@: rol     ecx, 16
457
        rol     ecx, 16
450
        sub     cl, al
458
        sub     cl, al
451
        jnc     @f
459
        jnc     @f
-
 
460
        xor     cl, cl
452
        xor     cl, cl
461
    @@:
Line 453... Line 462...
453
    @@: rol     ecx, 16
462
        rol     ecx, 16
Line 454... Line 463...
454
 
463
 
455
        pop     eax
464
        pop     eax