Subversion Repositories Kolibri OS

Rev

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

Rev 6031 Rev 6032
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: 6031 $
9
$Revision: 6032 $
Line 10... Line 10...
10
 
10
 
11
button.MAX_BUTTONS = 4095
11
button.MAX_BUTTONS = 4095
Line 91... Line 91...
91
 
91
 
92
        ; do we also need to draw the button?
92
        ; do we also need to draw the button?
93
        test    edx, 0x40000000
93
        test    edx, 0x40000000
Line -... Line 94...
-
 
94
        jnz     .exit
94
        jnz     .exit
95
 
95
 
96
        and     esi, 0xFFFFFF
-
 
97
        xor     edi, edi
-
 
98
        push    ebx ecx esi
96
        xor     edi, edi
99
        dec     cx
97
        push    ebx ecx esi
100
        dec     cx
98
        cmp     [buttontype], 1
101
        cmp     [buttontype], 1
99
        jnz     .draw
102
        jnz     .draw
Line 100... Line 103...
100
        cmp     cx, 129
103
        cmp     cx, 65
101
        jnc     .draw
104
        jnc     .draw
102
 
105
 
Line 108... Line 111...
108
        rol     eax, 8
111
        rol     eax, 8
109
        shl     al, 1
112
        shl     al, 1
110
        jnc     @f
113
        jnc     @f
111
        neg     al
114
        neg     al
112
        jnz     @f
115
        jnz     @f
113
        mov     al, 128
116
        mov     al, 64
114
@@:
117
@@:
-
 
118
        cmp     al, 65
115
        jns     @f
119
        jc      @f
116
        mov     al, 128
120
        mov     al, 64
117
@@:
121
@@:
118
        div     cl
122
        div     cl
119
        shl     ax, 8
123
        shl     ax, 8
120
        dec     edx
124
        dec     edx
121
        jnz     .calculate
125
        jnz     .calculate
Line 141... Line 145...
141
        add     dx, [esp+8]
145
        add     dx, [esp+8]
142
        dec     edx
146
        dec     edx
143
        mov     ebx, ecx
147
        mov     ebx, ecx
144
        mov     ecx, esi
148
        mov     ecx, esi
145
        shr     ecx, 1
149
        shr     ecx, 1
146
        btr     ecx, 7
150
        and     cx, 7F7Fh
147
        btr     ecx, 15
-
 
148
        push    esi
151
        push    esi
149
        mov     esi, edi
152
        mov     esi, edi
150
        xor     edi, edi
153
        xor     edi, edi
151
        call    hline   ; top border
154
        call    hline   ; top border
152
        inc     ebx
155
        inc     ebx
-
 
156
        or      ecx, 808080h
-
 
157
        call    hline   ; top light line
153
        pop     ecx
158
        pop     ecx
-
 
159
        inc     ebx
154
.next_line:
160
.next_line:
155
        call    hline   ; button body
161
        call    hline   ; button body
156
        inc     ebx
162
        inc     ebx
157
        sub     ecx, esi
163
        sub     ecx, esi
158
        dec     ebp
164
        dec     ebp
159
        jnz     .next_line
165
        jnz     .next_line
160
        shr     ecx, 1
166
        shr     ecx, 2
-
 
167
        and     cx, 3F3Fh
-
 
168
        mov     ebp, ecx
161
        btr     ecx, 7
169
        shl     ecx, 1
-
 
170
        add     ecx, ebp
-
 
171
        call    hline   ; bottom dark line
-
 
172
        inc     ebx
162
        btr     ecx, 15
173
        sub     ecx, ebp
163
        call    hline   ; bottom border
174
        call    hline   ; bottom border
164
        pop     ecx
175
        pop     ecx
165
        shr     ecx, 1
176
        shr     ecx, 1
166
        btr     ecx, 7
-
 
167
        btr     ecx, 15
-
 
168
        inc     edx
177
        inc     edx
169
        push    edx
178
        push    edx
170
        mov     edx, ebx
179
        mov     edx, ebx
171
        sub     bx, [esp+4]
180
        sub     bx, [esp+4]
172
        dec     eax
-
 
173
        cmp     [buttontype], 1
-
 
174
        jnz     @f
-
 
175
        dec     edx
181
        dec     edx
176
        inc     ebx
182
        inc     ebx
-
 
183
        cmp     [buttontype], 0
-
 
184
        jnz     @f
-
 
185
        dec     edx
-
 
186
        or      ecx, 808080h
-
 
187
        call    vline   ; left light line
-
 
188
        inc     edx
177
@@:
189
@@:
-
 
190
        and     ecx, 7F7F7Fh
-
 
191
        dec     eax
178
        call    vline   ; left border
192
        call    vline   ; left border
179
        pop     eax
193
        pop     eax
180
        call    vline   ; right border
194
        call    vline   ; right border
-
 
195
        cmp     [buttontype], 0
-
 
196
        jnz     @f
-
 
197
        mov     ebp, ecx
-
 
198
        shr     ecx, 1
-
 
199
        and     cx, 7F7Fh
-
 
200
        add     ecx, ebp
-
 
201
        dec     eax
-
 
202
        inc     ebx
-
 
203
        call    vline   ; right dark line
-
 
204
@@:
181
        pop     ecx ebx
205
        pop     ecx ebx
182
.exit:
206
.exit:
183
        ret
207
        ret
Line 184... Line 208...
184
 
208
 
Line 300... Line 324...
300
        inc     edx
324
        inc     edx
301
        push    edx
325
        push    edx
302
        mov     edx, ebx
326
        mov     edx, ebx
303
        sub     bx, [esp+4]
327
        sub     bx, [esp+4]
304
        dec     eax
328
        dec     eax
305
        cmp     [buttontype], 1
-
 
306
        jnz     @f
-
 
307
        dec     edx
329
        dec     edx
308
        inc     ebx
330
        inc     ebx
309
@@:
-
 
310
        call    vline
331
        call    vline
311
        pop     eax
332
        pop     eax
312
        call    vline
333
        call    vline
313
        pop     eax eax
334
        pop     eax eax
314
        popad
335
        popad