Rev 9709 | Rev 9926 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9709 | Rev 9911 | ||
---|---|---|---|
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: 9709 $ |
9 | $Revision: 9911 $ |
Line 10... | Line 10... | ||
10 | 10 | ||
11 | button.MAX_BUTTONS = 4095 |
11 | button.MAX_BUTTONS = 4095 |
Line 18... | Line 18... | ||
18 | top dw ? |
18 | top dw ? |
19 | height dw ? |
19 | height dw ? |
20 | id_hi dw ? |
20 | id_hi dw ? |
21 | dw ? |
21 | dw ? |
22 | ends |
22 | ends |
23 | - | ||
24 | ;--------------------------------------------------------------- |
23 | ;--------------------------------------------------------------- |
- | 24 | align 4 |
|
- | 25 | ; @brief system function 17 - Get the identifier of the pressed button |
|
- | 26 | ; @param eax 17 - number function |
|
- | 27 | ; @return eax = 1 - buffer empty, |
|
25 | syscall_button: ;////////////// system function 8 ////////////// |
28 | ; eax = high 24 bits contain button identifier, |
- | 29 | ; al = 0 - the button was pressed with left mouse button, |
|
- | 30 | ; al = bit corresponding to used mouse button otherwise |
|
- | 31 | sys_getbutton: |
|
- | 32 | mov ebx, [current_slot_idx] ; TOP OF WINDOW STACK |
|
- | 33 | mov [esp + SYSCALL_STACK.eax], dword 1 |
|
- | 34 | movzx ecx, word [WIN_STACK + ebx * 2] |
|
- | 35 | mov edx, [thread_count] ; less than 256 processes |
|
- | 36 | cmp ecx, edx |
|
- | 37 | jne .exit |
|
- | 38 | movzx eax, byte [BTN_COUNT] |
|
- | 39 | test eax, eax |
|
- | 40 | jz .exit |
|
- | 41 | mov eax, [BTN_BUFF] |
|
- | 42 | and al, 0xFE ; delete left button bit |
|
- | 43 | mov [BTN_COUNT], byte 0 |
|
- | 44 | mov [esp + SYSCALL_STACK.eax], eax |
|
- | 45 | ;-------------------------------------- |
|
- | 46 | align 4 |
|
- | 47 | .exit: |
|
- | 48 | ret |
|
- | 49 | ;--------------------------------------------------------------- |
|
- | 50 | ; @brief system function 8 - define/delete the button |
|
- | 51 | ; @param eax = 8 - number function |
|
- | 52 | ; @param ebx = [offset_x]*65536 + [width] |
|
- | 53 | ; @param ecx = [offset_y]*65536 + [height] |
|
- | 54 | ; @param edx = 0xXYnnnnnn, where: |
|
- | 55 | ; nnnnnn = identifier of the button |
|
- | 56 | ; 31 bit - delete button |
|
- | 57 | ; 30 bit - don't draw button |
|
- | 58 | ; 29 bit - don't draw button frame when pressed |
|
- | 59 | ; @param esi = 0x00RRGGBB - button color |
|
- | 60 | ; @return function does not return value |
|
- | 61 | syscall_button: |
|
26 | ;--------------------------------------------------------------- |
62 | ;--------------------------------------------------------------- |
27 | ;? Define/undefine GUI button object |
63 | ;? Define/undefine GUI button object |
28 | ;--------------------------------------------------------------- |
64 | ;--------------------------------------------------------------- |
29 | ;; Define button: |
65 | ;; Define button: |
30 | ;> ebx = pack[16(x), 16(width)] |
66 | ;> ebx = pack[16(x), 16(width)] |