Rev 873 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
31 | halyavin | 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ; ; |
||
93 | diamond | 3 | ; MENUBAR for KolibriOS - Compile with fasm ; |
31 | halyavin | 4 | ; ; |
5 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
6 | |||
7 | use32 |
||
8 | org 0x0 |
||
9 | db 'MENUET01' ; 8 byte id |
||
601 | Rus | 10 | dd 0x01 ; header version |
11 | dd START ; program start |
||
12 | dd I_END ; program image size |
||
13 | dd 0xA000 ; reguired amount of memory - 10 Kb |
||
14 | dd 0xA000 ; esp |
||
15 | dd 0x0,0x0 ; param, icon |
||
31 | halyavin | 16 | |
17 | include 'lang.inc' |
||
873 | heavyiron | 18 | include '..\..\..\macros.inc' |
870 | barsuk | 19 | include 'moi.inc' ;раскладки клавиатуры |
31 | halyavin | 20 | |
601 | Rus | 21 | width dd 305 |
22 | buttons dd 1 ; 0 no frames ; 1 frames |
||
23 | soften_up dd 1 ; 0 no ; 1 yes |
||
24 | soften_down dd 0 ; 0 no ; 1 yes |
||
25 | minimize_left dd 1 |
||
26 | minimize_right dd 1 |
||
633 | diamond | 27 | icons_position dd 95 |
601 | Rus | 28 | menu_enable dd 1 |
29 | setup_enable dd 0 |
||
30 | graph_text dd 1 |
||
31 | soften_middle dd 1 ; 0 no ; 1 yes |
||
32 | icons dd 1 ; 0 defaults ; 1 activate |
||
31 | halyavin | 33 | |
42 | mikedld | 34 | PANEL_HEIGHT = 18 |
31 | halyavin | 35 | |
870 | barsuk | 36 | |
93 | diamond | 37 | handle_key: |
31 | halyavin | 38 | |
39 | mcall 18, 7 |
||
40 | mov [active_process],eax |
||
41 | |||
601 | Rus | 42 | mcall 2 |
43 | cmp al, 2 |
||
44 | jnz begin_1.ret |
||
45 | mov ebx, exec_fileinfo |
||
46 | shr eax, 8 |
||
870 | barsuk | 47 | cmp al, 0 |
48 | je prod |
||
49 | mov [key_r],al |
||
50 | sub [key_r],2 |
||
51 | cmp al, 2 |
||
52 | jz alter |
||
53 | cmp al, 3 |
||
54 | jz alter |
||
55 | cmp al, 4 |
||
56 | jz alter |
||
57 | cmp al, 5 |
||
58 | jz alter |
||
59 | cmp al, 6 |
||
60 | jz alter |
||
61 | cmp al, 7 |
||
62 | jz alter |
||
63 | cmp al, 8 |
||
64 | jz alter |
||
65 | prod: |
||
601 | Rus | 66 | cmp al, 15 |
67 | jz alt_tab_pressed |
||
68 | cmp al, 88 |
||
69 | jz start_end_application |
||
70 | cmp al, 91 |
||
71 | jz start_menu_application |
||
72 | cmp al, 92 |
||
73 | jz start_menu_application |
||
74 | cmp al, 62 |
||
75 | jz kill_active_application |
||
1421 | diamond | 76 | ; cmp al, 71 |
77 | ; jz page_list_next |
||
78 | ; cmp al, 72 |
||
79 | ; jz page_list_prev |
||
80 | cmp al, 69 |
||
81 | jz start_mousemul_application |
||
601 | Rus | 82 | cmp [current_alt_tab_app], -1 |
83 | jz @f |
||
84 | test ah, 0x30 |
||
85 | jz alt_tab_released |
||
443 | diamond | 86 | @@: |
304 | diamond | 87 | ; this is hotkey Ctrl+Shift ;or LShift+RShift |
870 | barsuk | 88 | |
89 | jmp karu |
||
90 | ; mov ebx, setup_exec |
||
304 | diamond | 91 | ; test ah, 001100b |
92 | ; jz change_sys_lang |
||
93 | change_key_lang: |
||
601 | Rus | 94 | mov dword [ebx+8], chlang |
95 | mcall 70 |
||
96 | call chlang_music |
||
93 | diamond | 97 | ; mcall 5, 25 |
31 | halyavin | 98 | begin_1: |
99 | mov ecx,[active_process] |
||
100 | mcall 18, 3 |
||
101 | mcall 5, 25 |
||
93 | diamond | 102 | .ret: |
601 | Rus | 103 | ret |
93 | diamond | 104 | |
304 | diamond | 105 | ;change_sys_lang: |
106 | ; mov dword [ebx+8], syslang |
||
107 | ; mcall 70 |
||
108 | ; call syslang_music |
||
109 | ;; mcall 5, 25 |
||
110 | ; jmp begin_1 |
||
93 | diamond | 111 | |
31 | halyavin | 112 | start_end_application: |
601 | Rus | 113 | mov dword [ebx+21], end_name |
114 | mcall 70 |
||
1421 | diamond | 115 | ret |
116 | start_mousemul_application: |
||
117 | mov dword [ebx+21], mousemul_name |
||
118 | mcall 70 |
||
119 | ret |
||
31 | halyavin | 120 | |
121 | kill_active_application: |
||
665 | diamond | 122 | ; mcall 18, 7 |
123 | ; mov ecx,eax |
||
124 | ; |
||
125 | ; ;//{SPraid.simba do not kill panel and icon |
||
126 | ; push eax |
||
127 | ; mov eax,9 |
||
128 | ; mov ebx, process_info_buffer |
||
129 | ; int 0x40 |
||
130 | ; mov eax,process_info_buffer |
||
131 | ; add eax,10 |
||
132 | ; mov ebx,[eax] |
||
133 | ; cmp ebx,'ICON' |
||
134 | ; je no_kill |
||
135 | ; cmp ebx,'@PAN' |
||
136 | ; jne kill_app |
||
137 | ; add eax,4 |
||
138 | ; mov ebx,[eax] |
||
139 | ; and ebx,0x0000FFFF |
||
140 | ; cmp ebx,'EL' |
||
141 | ; je no_kill |
||
870 | barsuk | 142 | ; kill_app: |
665 | diamond | 143 | ; pop ecx |
144 | ; mcall 18, 2 |
||
145 | ; jmp if_kill |
||
146 | ; no_kill: |
||
147 | ; pop eax |
||
148 | ; if_kill: |
||
149 | ; ;// }SPraid.simba |
||
870 | barsuk | 150 | mcall 72,1,3,1 |
633 | diamond | 151 | |
93 | diamond | 152 | jmp begin_1.ret |
153 | |||
31 | halyavin | 154 | start_menu_application: |
601 | Rus | 155 | mov [draw_window_1], 1 |
156 | mov dword [ebx+21], menu_name |
||
157 | mcall 70 |
||
158 | call menu_music |
||
31 | halyavin | 159 | mcall 5,50 |
93 | diamond | 160 | jmp begin_1.ret |
161 | |||
1421 | diamond | 162 | ;page_list_next: |
163 | ; cmp [page_list],15 |
||
164 | ; je @f |
||
165 | ; inc [page_list] |
||
166 | ; mov [draw_window_1],1 |
||
167 | ; @@: |
||
168 | ; jmp begin_1.ret |
||
169 | ; |
||
170 | ;page_list_prev: |
||
171 | ; cmp [page_list],0 |
||
172 | ; je @f |
||
173 | ; dec [page_list] |
||
174 | ; mov [draw_window_1],1 |
||
175 | ; @@: |
||
176 | ; jmp begin_1.ret |
||
51 | mikedld | 177 | |
443 | diamond | 178 | alt_tab_pressed: |
179 | ; handle Alt+Tab and Alt+Shift+Tab |
||
601 | Rus | 180 | mov ebp, eax |
181 | cmp [current_alt_tab_app], -1 |
||
182 | jnz has_alt_tab_app |
||
443 | diamond | 183 | ; заполняем таблицу приложений, подлежащих переключению |
601 | Rus | 184 | xor edx, edx |
185 | mov ebx, 0x8000 |
||
186 | mov ecx, 1 |
||
187 | mov eax, 9 |
||
443 | diamond | 188 | .fill: |
601 | Rus | 189 | inc ecx |
190 | int 0x40 |
||
191 | call need_window_tab |
||
192 | jz @f |
||
193 | cmp edx, 256 |
||
194 | jz @f |
||
195 | mov [alt_tab_list+edx*8], ecx |
||
196 | movzx esi, word [ebx+4] |
||
197 | mov [alt_tab_list+edx*8+4], esi |
||
198 | inc edx |
||
443 | diamond | 199 | @@: |
601 | Rus | 200 | cmp ecx, eax |
201 | mov eax, 9 |
||
202 | jb .fill |
||
203 | mov [alt_tab_list_size], edx |
||
204 | test edx, edx |
||
205 | jz begin_1.ret |
||
206 | mcall 66,4,0,0 ; ловим момент отпускания всех управляющих клавиш |
||
207 | test eax, eax |
||
208 | jnz begin_1.ret |
||
209 | xor edx, edx |
||
210 | mov eax, [alt_tab_list+4] |
||
211 | xor ecx, ecx |
||
212 | inc ecx |
||
443 | diamond | 213 | .findmax: |
601 | Rus | 214 | cmp [alt_tab_list+ecx*8+4], eax |
215 | jb @f |
||
216 | mov edx, ecx |
||
217 | mov eax, [alt_tab_list+ecx*8+4] |
||
443 | diamond | 218 | @@: |
601 | Rus | 219 | inc ecx |
220 | cmp ecx, [alt_tab_list_size] |
||
221 | jb .findmax |
||
222 | mov [current_alt_tab_app], edx |
||
443 | diamond | 223 | has_alt_tab_app: |
601 | Rus | 224 | mov eax, [current_alt_tab_app] |
225 | mov edx, [alt_tab_list+eax*8+4] ; slot |
||
226 | xor ecx, ecx |
||
227 | or eax, -1 |
||
228 | test ebp, 300h |
||
229 | jz .notshift |
||
230 | or esi, -1 |
||
443 | diamond | 231 | .loop1: |
601 | Rus | 232 | cmp [alt_tab_list+ecx*8+4], edx |
233 | jbe @f |
||
234 | cmp [alt_tab_list+ecx*8+4], esi |
||
235 | jae @f |
||
236 | mov eax, ecx |
||
237 | mov esi, [alt_tab_list+ecx*8+4] |
||
443 | diamond | 238 | @@: |
601 | Rus | 239 | inc ecx |
240 | cmp ecx, [alt_tab_list_size] |
||
241 | jb .loop1 |
||
242 | cmp eax, -1 |
||
243 | jnz .found |
||
244 | xor edx, edx |
||
245 | xor ecx, ecx |
||
246 | jmp .loop1 |
||
443 | diamond | 247 | .notshift: |
601 | Rus | 248 | xor esi, esi |
443 | diamond | 249 | .loop2: |
601 | Rus | 250 | cmp [alt_tab_list+ecx*8+4], edx |
251 | jae @f |
||
252 | cmp [alt_tab_list+ecx*8+4], esi |
||
253 | jbe @f |
||
254 | mov eax, ecx |
||
255 | mov esi, [alt_tab_list+ecx*8+4] |
||
443 | diamond | 256 | @@: |
601 | Rus | 257 | inc ecx |
258 | cmp ecx, [alt_tab_list_size] |
||
259 | jb .loop2 |
||
260 | cmp eax, -1 |
||
261 | jnz .found |
||
262 | or edx, -1 |
||
263 | xor ecx, ecx |
||
264 | jmp .loop2 |
||
443 | diamond | 265 | .found: |
601 | Rus | 266 | mov [current_alt_tab_app], eax |
267 | push eax |
||
268 | xor edx, edx |
||
269 | div [max_applications] |
||
270 | mov [page_list], eax |
||
271 | mov [draw_window_1], 1 |
||
272 | mov edi, app_list |
||
273 | push edi |
||
274 | mov ecx, 20 |
||
275 | or eax, -1 |
||
276 | rep stosd |
||
277 | pop edi |
||
278 | pop ecx |
||
279 | sub ecx, edx |
||
443 | diamond | 280 | @@: |
601 | Rus | 281 | cmp ecx, [alt_tab_list_size] |
282 | jae redraw_window_tabs |
||
283 | mov eax, [alt_tab_list+ecx*8] |
||
284 | stosd |
||
285 | inc ecx |
||
286 | jmp @b |
||
443 | diamond | 287 | |
288 | alt_tab_released: |
||
601 | Rus | 289 | mcall 66,5,0,0 ; уже поймали, хватит :) |
290 | or eax, -1 |
||
291 | xchg eax, [current_alt_tab_app] |
||
292 | mov ecx, [alt_tab_list+eax*8] |
||
293 | mov eax, 18 |
||
294 | mov ebx, 3 |
||
295 | int 0x40 |
||
296 | jmp redraw_window_tabs |
||
443 | diamond | 297 | |
601 | Rus | 298 | active_process dd 0 |
31 | halyavin | 299 | |
300 | calendar_music: |
||
301 | mcall 55, eax, , , calendarmusic |
||
302 | ret |
||
303 | setup_music: |
||
304 | mcall 55,eax, , ,setupmusic |
||
305 | ret |
||
306 | sysmeter_music: |
||
307 | mcall 55,eax, , ,sysmetermusic |
||
308 | ret |
||
309 | button_music: |
||
310 | mcall 55,eax, , ,buttonmusic |
||
311 | ret |
||
304 | diamond | 312 | ;syslang_music: |
313 | ; mcall 55, eax, , , syslangmusic |
||
314 | ; ret |
||
31 | halyavin | 315 | chlang_music: |
316 | mcall 55, eax, , , chlangmusic |
||
317 | ret |
||
318 | menu_music: |
||
319 | mcall 55,eax, , ,menumusic |
||
320 | ret |
||
321 | |||
601 | Rus | 322 | chlangmusic: db 0x82,0x60,0x83,0x65,0x82,0x60,0 |
31 | halyavin | 323 | |
304 | diamond | 324 | ;syslangmusic: db 0x82,0x65,0x83,0x70,0x82,0x65,0 |
31 | halyavin | 325 | |
601 | Rus | 326 | menumusic: db 0x82,0x50,0x84,0x48,0x82,0x50,0x84,0x53,0x82,0x51,0 |
31 | halyavin | 327 | |
601 | Rus | 328 | activatemusic: db 0x83,0x30,0x85,0x60,0 |
31 | halyavin | 329 | |
601 | Rus | 330 | buttonmusic: db 0x85,0x25,0x85,0x40,0 |
31 | halyavin | 331 | |
601 | Rus | 332 | sysmetermusic: db 0x85,0x35,0x85,0x45,0 |
31 | halyavin | 333 | |
601 | Rus | 334 | setupmusic: db 0x85,0x40,0x85,0x50,0 |
31 | halyavin | 335 | |
601 | Rus | 336 | calendarmusic: db 0x85,0x37,0x85,0x48,0 |
31 | halyavin | 337 | |
338 | ; .exit: mcall -1 |
||
339 | |||
340 | |||
341 | START: |
||
870 | barsuk | 342 | ; mov eax, 51 |
343 | ; mov ebx, 1 |
||
344 | ; mov ecx, detect_start |
||
345 | ; mov edx, detect_stack |
||
346 | ; int 0x40 |
||
601 | Rus | 347 | mcall 66,4,0,2 ; LShift+RShift |
348 | mcall 66, , ,11h ; Ctrl+Shift |
||
349 | mcall 66,,88,110h ; Alt+Ctrl+F12 |
||
870 | barsuk | 350 | mcall 66,,91,0h ; LWin |
1421 | diamond | 351 | mcall 66,,92 ; RWin |
352 | ; mcall 66,,91,100h ; Alt+LWin |
||
353 | ; mcall 66,,92 ; Alt+RWin |
||
354 | mcall 66,,62,100h ; Alt+F4 |
||
355 | ; mcall 66,,71 ; Alt+Home |
||
356 | ; mcall 66,,72 ; Alt+Up |
||
601 | Rus | 357 | mcall 66,,15 ; Alt+Tab |
870 | barsuk | 358 | mcall 66,,2 ; Alt+1 |
359 | mcall 66,,3 ; Alt+2 |
||
360 | mcall 66,,4 ; Alt+3 |
||
361 | mcall 66,,5 ; Alt+4 |
||
362 | mcall 66,,6 ; Alt+5 |
||
363 | mcall 66,,7 ; Alt+6 |
||
364 | mcall 66,,8 ; Alt+7 |
||
601 | Rus | 365 | mcall 66,,,101h ; Alt+Shift+Tab |
1421 | diamond | 366 | mcall 66,,69 ; Alt+Shift+NumLock |
870 | barsuk | 367 | |
93 | diamond | 368 | mcall 18, 8, 1 |
369 | test eax, eax |
||
370 | jne @f |
||
371 | mcall 18, 8, 2 |
||
372 | @@: |
||
601 | Rus | 373 | mov eax, 70 |
374 | mov ebx, dat_fileinfo |
||
375 | int 0x40 |
||
31 | halyavin | 376 | |
377 | mov edi,width |
||
378 | mov esi,I_END |
||
93 | diamond | 379 | xor eax,eax |
31 | halyavin | 380 | new_number: |
381 | cmp [esi],byte ';' |
||
601 | Rus | 382 | je number_ready |
31 | halyavin | 383 | imul eax,10 |
384 | movzx ebx,byte [esi] |
||
385 | sub ebx,'0' |
||
386 | add eax,ebx |
||
387 | inc esi |
||
388 | jmp new_number |
||
389 | number_ready: |
||
93 | diamond | 390 | stosd |
391 | xor eax,eax |
||
31 | halyavin | 392 | inc esi |
393 | cmp [esi],byte 'x' |
||
394 | jne new_number |
||
395 | |||
601 | Rus | 396 | mcall 14 |
397 | mov [screen_size],eax |
||
31 | halyavin | 398 | |
870 | barsuk | 399 | ;mcall 48,5 ; barsuk { |
400 | mov eax, 14 |
||
401 | int 0x40 |
||
601 | Rus | 402 | mov ecx,eax |
870 | barsuk | 403 | ;eax = [xsize]*65536 + [ysize], где |
404 | shr ecx, 16 |
||
405 | and eax, 0xFFFF |
||
406 | lea edx,[eax-PANEL_HEIGHT-1] |
||
407 | ; barsuk } |
||
408 | |||
601 | Rus | 409 | mcall 48,6 |
51 | mikedld | 410 | |
633 | diamond | 411 | ; // Alver 26.08.2007 // { |
870 | barsuk | 412 | mov eax, 9 ; info of process |
413 | mov ebx, process_info_buffer |
||
414 | mov ecx, -1 |
||
633 | diamond | 415 | mcall |
870 | barsuk | 416 | mov ecx, dword [process_info_buffer+30] |
633 | diamond | 417 | mcall 18,21 |
870 | barsuk | 418 | mov [this_slot], eax |
419 | mov [max_slot], 255 |
||
633 | diamond | 420 | ; } \\ Alver \\ |
421 | |||
31 | halyavin | 422 | call set_variables |
423 | |||
424 | start_after_minimize: |
||
425 | |||
426 | call draw_window |
||
427 | call draw_info |
||
428 | call draw_running_applications |
||
429 | |||
430 | mov eax, 23 |
||
431 | mov ebx, 30 |
||
432 | int 0x40 |
||
870 | barsuk | 433 | call load_ini |
434 | call fir_lng |
||
31 | halyavin | 435 | |
436 | still: |
||
437 | ; mcall 13,<390,70>,<3,11>,0xffffff |
||
438 | ; mov ecx,[button_presssed_alt] |
||
439 | ; mcall 47,0x80100,ecx ,400 shl 16+5,0 |
||
440 | |||
441 | call draw_info |
||
442 | call draw_running_applications |
||
443 | |||
870 | barsuk | 444 | mov eax, 18 ; check if active window changed |
445 | mov ebx, 7 ; barsuk |
||
446 | int 0x40 |
||
447 | cmp eax, [last_active_window] |
||
448 | jz @f |
||
449 | |||
450 | ; need_window_tab: |
||
451 | ; in: ebx->process info |
||
452 | ; out: ZF set <=> do not draw |
||
453 | |||
454 | mov ebx, [last_active_window] |
||
455 | mov [prev_active_window], ebx |
||
456 | mov [last_active_window], eax |
||
457 | |||
458 | mov ecx, eax |
||
459 | mov eax, 9 |
||
460 | mov ebx, process_info_buffer |
||
461 | int 0x40 |
||
462 | |||
463 | call need_window_tab |
||
464 | jnz .need_repaint |
||
465 | |||
466 | mov eax, 9 |
||
467 | mov ebx, process_info_buffer |
||
468 | mov ecx, [prev_active_window] |
||
469 | int 0x40 |
||
470 | call need_window_tab |
||
471 | jz @f |
||
472 | |||
473 | .need_repaint: |
||
474 | mov dword [active_window_changed], 1 |
||
475 | |||
476 | @@: |
||
477 | |||
31 | halyavin | 478 | mov eax, 23 |
479 | mov ebx, 20 |
||
480 | int 0x40 |
||
481 | |||
601 | Rus | 482 | cmp eax,1 ; redraw ? |
483 | jz red |
||
484 | cmp eax,3 ; button ? |
||
485 | jz button |
||
486 | call handle_key |
||
870 | barsuk | 487 | |
488 | cmp dword [active_window_changed], 0 |
||
489 | jnz red_active |
||
490 | |||
601 | Rus | 491 | jmp still |
31 | halyavin | 492 | |
870 | barsuk | 493 | red_active: ; barsuk |
494 | |||
601 | Rus | 495 | red: ; redraw window |
51 | mikedld | 496 | |
870 | barsuk | 497 | mov dword [active_window_changed], 0 |
498 | |||
601 | Rus | 499 | mcall 14 |
500 | movzx ecx,ax |
||
501 | mov edx,eax |
||
502 | shr edx,16 |
||
503 | cmp [screen_size.height],ax |
||
504 | jne @f |
||
505 | rol eax,16 |
||
506 | cmp [screen_size.width],ax |
||
507 | je .lp1 |
||
508 | rol eax,16 |
||
509 | @@: mov [screen_size],eax |
||
510 | sub ecx,PANEL_HEIGHT |
||
511 | mcall 67,0,,,PANEL_HEIGHT |
||
51 | mikedld | 512 | |
513 | .lp1: |
||
870 | barsuk | 514 | |
31 | halyavin | 515 | call draw_window |
516 | call draw_info |
||
517 | jmp still |
||
518 | |||
601 | Rus | 519 | button: ; button |
31 | halyavin | 520 | mov eax,17 |
521 | int 0x40 |
||
522 | |||
870 | barsuk | 523 | cmp al, 0 ; barsuk |
524 | jnz right_mouse |
||
525 | |||
31 | halyavin | 526 | cmp ah,50 |
601 | Rus | 527 | jb no_activate |
31 | halyavin | 528 | cmp ah,70 |
601 | Rus | 529 | jg no_activate |
31 | halyavin | 530 | |
531 | movzx ecx,byte ah |
||
532 | sub ecx,52 |
||
533 | shl ecx,2 |
||
534 | |||
535 | mov eax,18 |
||
536 | mov ebx,3 |
||
537 | mov ecx,[app_list+ecx] |
||
538 | int 0x40 |
||
539 | ; cmp [music_type],0 |
||
540 | ; je still |
||
541 | mcall 55,eax, , ,activatemusic |
||
542 | jmp still |
||
870 | barsuk | 543 | |
544 | right_mouse: ; barsuk |
||
545 | |||
546 | cmp ah,50 |
||
547 | jb still |
||
548 | cmp ah,70 |
||
549 | jg still |
||
550 | |||
551 | movzx ecx,byte ah |
||
552 | sub ecx,52 |
||
553 | |||
554 | cmp ecx, [app_tab_count] |
||
555 | jge still |
||
556 | |||
557 | shl ecx,2 |
||
558 | |||
559 | mov eax, 37 |
||
560 | mov ebx, 0 |
||
561 | int 0x40 |
||
562 | mov ebx, eax |
||
563 | shr eax, 16 |
||
564 | mov [x_coord], ax |
||
565 | and ebx, 0xFFFF |
||
566 | mov [y_coord], bx |
||
567 | |||
568 | mov eax, 9 |
||
569 | mov ecx,[app_list+ecx] ; ecx->selected app.slot |
||
570 | mov [n_slot], ecx |
||
571 | mov ebx, procinfo_for_detect |
||
572 | int 0x40 |
||
573 | |||
574 | ; cmp dword [procinfo_for_detect+process_information.slot_state],9 |
||
575 | ; jz still |
||
576 | |||
577 | mov eax, 51 |
||
578 | mov ebx, 1 |
||
579 | mov ecx, context_menu_start |
||
580 | mov edx, ctx_menu_stack |
||
581 | int 0x40 |
||
582 | |||
583 | mov [ctx_menu_PID], eax |
||
584 | |||
585 | jmp still |
||
586 | |||
587 | |||
31 | halyavin | 588 | no_activate: |
589 | |||
590 | |||
601 | Rus | 591 | cmp ah,101 ; minimize to left |
592 | je left_button |
||
31 | halyavin | 593 | |
601 | Rus | 594 | cmp ah,102 ; minimize to right |
595 | je right_button |
||
31 | halyavin | 596 | |
633 | diamond | 597 | ; // Alver 26.08.2007 // { |
598 | cmp ah, 103 |
||
870 | barsuk | 599 | je clean_desktop ; minimize all windows |
633 | diamond | 600 | cmp ah, 104 |
870 | barsuk | 601 | je restore_desktop ; restore minimized windows |
633 | diamond | 602 | cmp ah, 105 |
870 | barsuk | 603 | je swap_minimized_desktop ; minimize normal windows, and restore minimized windows |
633 | diamond | 604 | ; } \\ Alver \\ |
605 | |||
601 | Rus | 606 | cmp ah,byte 1 ; start/terminate menu |
31 | halyavin | 607 | jnz noselect |
608 | call menu_handler |
||
609 | ; cmp [music_type],0 |
||
610 | ; je still |
||
611 | call menu_music |
||
612 | jmp still |
||
613 | noselect: |
||
614 | |||
601 | Rus | 615 | mov ebx, exec_fileinfo |
616 | cmp ah,byte 2 ; start calendar |
||
31 | halyavin | 617 | jnz noid15 ;noclock |
601 | Rus | 618 | mov dword [ebx+21], calendar_name |
619 | mov eax, 70 |
||
620 | int 0x40 |
||
31 | halyavin | 621 | call calendar_music |
622 | jmp still |
||
623 | |||
624 | noid15: |
||
625 | cmp ah,16 |
||
626 | jne noid16 |
||
601 | Rus | 627 | mov ebx, setup_exec |
628 | mov dword [ebx+8], chlang |
||
629 | mov eax, 70 |
||
630 | int 0x40 |
||
31 | halyavin | 631 | call chlang_music |
632 | mcall 5, 25 |
||
633 | jmp still |
||
634 | |||
635 | noid16: |
||
304 | diamond | 636 | ; cmp ah,17 |
637 | ; jne noid17 |
||
638 | ; mov ebx, setup_exec |
||
639 | ; mov dword [ebx+8], syslang |
||
640 | ; mov eax, 70 |
||
641 | ; int 0x40 |
||
642 | ; call syslang_music |
||
643 | ; mcall 5, 25 |
||
644 | ; jmp still |
||
645 | ; |
||
646 | ; noid17: |
||
31 | halyavin | 647 | cmp ah,18 |
648 | jne noid18 |
||
601 | Rus | 649 | mov dword [ebx+21], sysmeter_name |
650 | mov eax, 70 |
||
651 | int 0x40 |
||
31 | halyavin | 652 | call sysmeter_music |
653 | jmp still |
||
654 | |||
655 | noid18: |
||
656 | cmp ah,19 |
||
657 | jne noid19 |
||
658 | ; inc [music_type] |
||
659 | ; and [music_type],1 |
||
660 | mcall 18,8,2 |
||
661 | ; mcall 18,8 |
||
662 | ; mov [sound_flag],al |
||
663 | |||
664 | ; mcall 15,4,2 |
||
665 | mcall 15,3 |
||
666 | jmp red |
||
667 | |||
668 | noid19: |
||
601 | Rus | 669 | cmp ah,20 ; start system setup |
31 | halyavin | 670 | jnz noid20 |
601 | Rus | 671 | mov ebx, setup_exec |
672 | and dword [ebx+8], 0 |
||
673 | mov eax, 70 |
||
674 | int 0x40 |
||
31 | halyavin | 675 | call setup_music |
93 | diamond | 676 | jmp still |
31 | halyavin | 677 | |
678 | noid20: |
||
51 | mikedld | 679 | cmp ah,21 |
680 | jnz noid21 |
||
633 | diamond | 681 | ; // Alver 25.08.2007 // { |
682 | cmp [page_list], 99 |
||
683 | jnc @f |
||
684 | ; cmp [page_list],15 |
||
870 | barsuk | 685 | ; je @f |
633 | diamond | 686 | ; } \\ Alver \\ |
51 | mikedld | 687 | inc [page_list] |
688 | jmp red |
||
689 | @@: |
||
690 | jmp still |
||
31 | halyavin | 691 | |
51 | mikedld | 692 | noid21: |
693 | cmp ah,22 |
||
694 | jnz noid22 |
||
695 | cmp [page_list],0 |
||
601 | Rus | 696 | je @f |
51 | mikedld | 697 | dec [page_list] |
698 | jmp red |
||
699 | @@: |
||
31 | halyavin | 700 | jmp still |
701 | |||
51 | mikedld | 702 | noid22: |
31 | halyavin | 703 | |
51 | mikedld | 704 | jmp still |
31 | halyavin | 705 | |
633 | diamond | 706 | ; // Alver 26.08.2007 //{ |
707 | restore_desktop: |
||
708 | mcall 9,process_info_buffer,-1 |
||
709 | mov [max_slot], eax |
||
710 | mov ecx, 2 |
||
711 | mov edx, 2 |
||
712 | @@: |
||
713 | mcall 18, 22 |
||
714 | inc edx |
||
715 | cmp edx, [max_slot] |
||
716 | jbe @b |
||
717 | jmp still |
||
51 | mikedld | 718 | |
633 | diamond | 719 | swap_minimized_desktop: |
720 | xor esi, esi |
||
721 | inc esi |
||
722 | jmp min_swap_desktop |
||
723 | clean_desktop: |
||
724 | xor esi,esi |
||
870 | barsuk | 725 | min_swap_desktop: ; input esi 0 - min, <>0 swap |
726 | mov ecx, 2 ; Начальный номер слота процесса |
||
633 | diamond | 727 | mov ebx, process_info_buffer |
51 | mikedld | 728 | |
633 | diamond | 729 | .loop1: |
730 | cmp ecx, [this_slot] |
||
731 | je .loop1xx |
||
732 | mcall 9 |
||
733 | mov [max_slot], eax |
||
734 | mov dx, word [process_info_buffer+50] |
||
870 | barsuk | 735 | cmp dx, 9 ; Проверка свободен ли данный слот |
633 | diamond | 736 | jz .loop1xx |
737 | mov edx, dword [ebx+10] |
||
738 | cmp dl, '@' |
||
739 | je .loop1xx |
||
740 | cmp dword [ebx+10], 'ICON' |
||
741 | jnz @f |
||
742 | cmp [ebx+42], dword 51 |
||
743 | jnz @f |
||
744 | cmp [ebx+46], dword 51 |
||
745 | jz .loop1xx |
||
746 | @@: |
||
747 | cmp [ebx+10], dword ' ' |
||
748 | jz .loop1xx |
||
749 | |||
750 | pushad |
||
751 | mov edx, ecx |
||
752 | xor ecx, ecx |
||
753 | or esi, esi |
||
754 | jz @f |
||
755 | movzx eax, byte [process_info_buffer+70] |
||
870 | barsuk | 756 | and eax, 2 ; mask minimize |
633 | diamond | 757 | jz @f |
870 | barsuk | 758 | mov ecx, 2 ; restore |
633 | diamond | 759 | @@: |
760 | mcall 18, 22 |
||
761 | popad |
||
762 | .loop1xx: |
||
763 | inc ecx |
||
764 | cmp ecx, [max_slot] |
||
765 | jbe .loop1 |
||
766 | jmp still |
||
767 | ; } \\ Alver \\ |
||
768 | |||
31 | halyavin | 769 | draw_running_applications: |
770 | |||
771 | pusha |
||
772 | |||
773 | cmp [icons],1 |
||
774 | jne dr_ret |
||
775 | |||
776 | call calculate_applications |
||
777 | |||
778 | cmp edi,[running_applications] |
||
779 | jne noret |
||
780 | popa |
||
781 | ret |
||
782 | noret: |
||
783 | |||
784 | ; cmp edi,[running_applications] |
||
785 | ; jge no_application_decrease |
||
786 | call draw_window |
||
787 | ; no_application_decrease: |
||
788 | |||
789 | mov [running_applications],edi |
||
790 | |||
601 | Rus | 791 | call redraw_window_tabs |
31 | halyavin | 792 | |
443 | diamond | 793 | dr_ret: |
51 | mikedld | 794 | |
443 | diamond | 795 | popa |
31 | halyavin | 796 | |
443 | diamond | 797 | ret |
31 | halyavin | 798 | |
443 | diamond | 799 | need_window_tab: |
800 | ; in: ebx->process info |
||
801 | ; out: ZF set <=> do not draw |
||
601 | Rus | 802 | cmp byte [ebx+10], '@' |
803 | jz .nodraw |
||
443 | diamond | 804 | ; \begin{diamond}[29.03.2007] |
805 | ; do not draw undefined (zero-sized) windows |
||
601 | Rus | 806 | cmp dword [ebx+42], 0 |
807 | jnz @f |
||
808 | cmp dword [ebx+46], 0 |
||
809 | jz .nodraw |
||
443 | diamond | 810 | @@: |
811 | ; \end{diamond}[29.03.2007] |
||
601 | Rus | 812 | cmp dword [ebx+10], 'ICON' |
813 | jnz @f |
||
814 | cmp [ebx+42], dword 51 |
||
815 | jnz @f |
||
816 | cmp [ebx+46], dword 51 |
||
817 | jz .nodraw |
||
443 | diamond | 818 | @@: |
601 | Rus | 819 | cmp [ebx+10], dword ' ' |
443 | diamond | 820 | .nodraw: |
601 | Rus | 821 | ret |
31 | halyavin | 822 | |
443 | diamond | 823 | redraw_window_tabs: |
601 | Rus | 824 | xor edi, edi |
825 | mov [contrast], 0 |
||
870 | barsuk | 826 | |
827 | push ebp ; barsuk { |
||
828 | mov eax, 18 |
||
829 | mov ebx, 7 |
||
830 | int 0x40 |
||
831 | mov ebp, eax ; barsuk } |
||
832 | |||
443 | diamond | 833 | .loop: |
601 | Rus | 834 | mov ecx, [app_list+edi*4] |
835 | cmp ecx, -1 |
||
836 | jz .done |
||
31 | halyavin | 837 | |
601 | Rus | 838 | push ecx |
839 | mov eax, 9 |
||
840 | mov ebx, 0x8000 |
||
841 | int 0x40 |
||
31 | halyavin | 842 | |
601 | Rus | 843 | mov eax, 13 |
844 | imul ebx, edi, 6*10*10000h |
||
633 | diamond | 845 | ; // Alver 26.08.2007 // { |
870 | barsuk | 846 | ; add ebx, 6*10*10000h + 7*10000h + 54 |
633 | diamond | 847 | add ebx, 12*10*10000h + 7*10000h + 54 |
848 | ; } // Alver // |
||
601 | Rus | 849 | mov ecx, 3*10000h + 14 |
870 | barsuk | 850 | |
851 | ; xor edx, edx |
||
852 | mov edx, 0x383838 ; barsuk |
||
601 | Rus | 853 | int 0x40 |
854 | sub ebx, 10000h + 53 |
||
855 | mov ecx, 4*10000h + 12 |
||
856 | int 0x40 |
||
857 | sub ebx, 10000h |
||
858 | mov ecx, 5*10000h + 10 |
||
859 | int 0x40 |
||
860 | add ebx, 56*10000h |
||
861 | mov ecx, 4*10000h + 12 |
||
862 | int 0x40 |
||
863 | add ebx, 10000h |
||
864 | mov ecx, 5*10000h + 10 |
||
865 | int 0x40 |
||
31 | halyavin | 866 | |
870 | barsuk | 867 | mov edx, [wcolor] ; barsuk |
1421 | diamond | 868 | pop ecx |
869 | cmp ebp, ecx ; ecx=active slot number |
||
870 | barsuk | 870 | jnz @f |
871 | mov edx, [system_colours.work_button] |
||
443 | diamond | 872 | @@: |
1421 | diamond | 873 | mov esi, [current_alt_tab_app] |
874 | cmp esi, -1 |
||
875 | jz @f |
||
876 | cmp ecx, [alt_tab_list+esi*8] |
||
877 | jnz @f |
||
878 | ; xor edx, 0xFFFFFF |
||
879 | mov edx, 0xFF8000 |
||
880 | @@: |
||
601 | Rus | 881 | sub ebx, 55*10000h - 53 |
882 | mov ecx, 4*10000h + 12 |
||
883 | int 0x40 |
||
884 | sub ebx, 10000h + 53 |
||
885 | mov ecx, 5*10000h + 10 |
||
886 | int 0x40 |
||
887 | add ebx, 55*10000h |
||
888 | int 0x40 |
||
31 | halyavin | 889 | |
601 | Rus | 890 | mov eax, 4 |
891 | sub ebx, 51*10000h - 6 |
||
870 | barsuk | 892 | mov ecx, [system_colours.work_button_text] ;0xffffff |
601 | Rus | 893 | mov edx, 0x8000+10 |
894 | mov esi, 11 |
||
895 | int 0x40 |
||
31 | halyavin | 896 | |
870 | barsuk | 897 | .nodraw: |
601 | Rus | 898 | inc edi |
899 | cmp edi, [max_applications] |
||
900 | jb .loop |
||
443 | diamond | 901 | .done: |
870 | barsuk | 902 | pop ebp |
601 | Rus | 903 | ret |
31 | halyavin | 904 | |
905 | calculate_applications: |
||
906 | |||
51 | mikedld | 907 | mov eax,[max_applications] |
93 | diamond | 908 | mul [page_list] |
909 | test eax,eax |
||
601 | Rus | 910 | je @f |
51 | mikedld | 911 | inc eax |
912 | @@: |
||
913 | mov [draw_start_position],eax |
||
914 | |||
31 | halyavin | 915 | mov edi,app_list |
916 | mov ecx,20 |
||
443 | diamond | 917 | mov eax,-1 |
31 | halyavin | 918 | cld |
919 | rep stosd |
||
920 | |||
921 | mov edi,0 |
||
922 | mov ecx,2 |
||
923 | |||
924 | cnewpr: |
||
925 | |||
926 | mov eax,9 |
||
927 | mov ebx,0x8000 |
||
928 | int 0x40 |
||
929 | |||
601 | Rus | 930 | call need_window_tab |
931 | jz cnorpl |
||
932 | sub [draw_start_position], 1 |
||
933 | jg cnorpl |
||
31 | halyavin | 934 | |
935 | mov [app_list+edi*4],ecx |
||
936 | |||
937 | inc edi |
||
938 | |||
939 | cnorpl: |
||
940 | inc ecx |
||
941 | |||
942 | cmp eax,ecx |
||
943 | jge cnewpr |
||
944 | |||
870 | barsuk | 945 | mov [app_tab_count], edi ; barsuk |
946 | |||
31 | halyavin | 947 | ret |
948 | |||
949 | |||
950 | draw_application_buttons: |
||
951 | |||
952 | pusha |
||
953 | |||
954 | cmp [icons],1 |
||
955 | jne da_ret |
||
956 | |||
957 | mov eax,14 |
||
958 | int 0x40 |
||
959 | |||
960 | shr eax,16 |
||
961 | |||
633 | diamond | 962 | ; // Alver 25.08.2007 // { |
963 | ; cmp eax,639 |
||
964 | ; jne now1 |
||
870 | barsuk | 965 | ; mov [max_applications],7 ;6 |
633 | diamond | 966 | ; now1: |
967 | ; cmp eax,799 |
||
968 | ; jne now2 |
||
969 | ; mov [max_applications],9 ;10 ;8 |
||
970 | ; now2: |
||
971 | ; cmp eax,1023 |
||
972 | ; jne now3 |
||
973 | ; mov [max_applications],12 ;13 ;8 |
||
974 | ; now3: |
||
975 | ; cmp eax,1279 |
||
976 | ; jne now4 |
||
977 | ; mov [max_applications],17 ;18 ;8 |
||
978 | ; now4: |
||
979 | ; mov edi,1 |
||
31 | halyavin | 980 | |
633 | diamond | 981 | sub eax, 281 |
982 | jnc ._01 |
||
983 | xor eax, eax |
||
984 | ._01: |
||
985 | mov bl, 60 |
||
986 | div bl |
||
870 | barsuk | 987 | xor ah, ah ; eax - количество умещаюшихся пиктов |
633 | diamond | 988 | mov [max_applications], eax |
989 | mov edi,1 |
||
990 | ; } \\ Alver \\ |
||
991 | |||
31 | halyavin | 992 | nb: |
993 | |||
994 | mov eax,8 |
||
995 | mov ebx,edi |
||
996 | shl ebx,16 |
||
601 | Rus | 997 | imul ebx,6*10 ;13 |
633 | diamond | 998 | add ebx,75*65536+10*6-1 ; << Alver 25.08.2007 >> 15*65536+10*6-1 ;13 |
31 | halyavin | 999 | mov ecx,1*65536+17 |
1000 | mov edx,edi |
||
1001 | add edx,51 |
||
1002 | cmp [buttons],1 |
||
601 | Rus | 1003 | je bufr |
1004 | or edx,0x60000000 |
||
31 | halyavin | 1005 | bufr: |
1006 | mov esi,[wcolor] |
||
1007 | sub ebx,11 shl 16 |
||
1008 | int 0x40 |
||
1009 | |||
1010 | inc edi |
||
1011 | cmp edi,[max_applications] |
||
1012 | jbe nb |
||
1013 | |||
1014 | da_ret: |
||
1015 | |||
1016 | popa |
||
1017 | |||
1018 | ret |
||
1019 | |||
1020 | |||
1021 | menu_handler: |
||
601 | Rus | 1022 | mov eax, 70 |
1023 | mov ebx, exec_fileinfo |
||
1024 | mov dword [ebx+21], menu_name |
||
1025 | int 0x40 |
||
1026 | ret |
||
31 | halyavin | 1027 | |
1028 | draw_small_right: |
||
1029 | |||
1030 | pusha |
||
1031 | |||
1032 | mov eax,12 |
||
1033 | mov ebx,1 |
||
1034 | int 0x40 |
||
1035 | |||
1036 | mov eax,0 |
||
1037 | mov edx,[wcolor] |
||
1038 | mov esi,edx |
||
1039 | mov edi,edx |
||
601 | Rus | 1040 | or edx, 0x01000000 |
31 | halyavin | 1041 | int 0x40 |
1042 | |||
1043 | mov eax,8 |
||
1044 | mov ebx,0*65536+9 |
||
1045 | mov ecx,0*65536 |
||
1046 | mov cx,[b_size_y] |
||
1047 | mov edx,1 |
||
1048 | mov esi,[wcolor] |
||
1049 | int 0x40 |
||
1050 | |||
1051 | mov eax,4 |
||
1052 | mov ebx,2*65536+16 |
||
1053 | cmp [graph_text],1 |
||
1054 | jne nos3 |
||
1055 | mov ebx,2*65536+7 |
||
1056 | nos3: |
||
1057 | mov ecx,[wcolor] |
||
1058 | add ecx,0x303030 |
||
1059 | mov edx,hidetext |
||
1060 | mov esi,1 |
||
1061 | int 0x40 |
||
1062 | |||
1063 | mov eax,12 |
||
1064 | mov ebx,2 |
||
1065 | int 0x40 |
||
1066 | |||
1067 | popa |
||
1068 | |||
1069 | ret |
||
1070 | |||
1071 | |||
1072 | |||
1073 | draw_small_left: |
||
1074 | |||
1075 | pusha |
||
1076 | |||
1077 | mov eax,12 |
||
1078 | mov ebx,1 |
||
1079 | int 0x40 |
||
1080 | |||
1081 | mov eax,0 |
||
1082 | mov edx,[wcolor] |
||
1083 | mov esi,edx |
||
1084 | mov edi,edx |
||
601 | Rus | 1085 | or edx, 0x01000000 |
31 | halyavin | 1086 | int 0x40 |
1087 | |||
1088 | cmp [graph_text],1 |
||
601 | Rus | 1089 | je nos4 |
31 | halyavin | 1090 | |
1091 | mov eax,8 |
||
1092 | mov ebx,0*65536+9 |
||
1093 | mov ecx,0*65536+18-6 |
||
1094 | mov edx,2 |
||
1095 | mov esi,[wcolor] |
||
1096 | int 0x40 |
||
1097 | |||
1098 | mov eax,4 |
||
1099 | mov ebx,2*65536+4 |
||
1100 | mov ecx,[wcolor] |
||
1101 | add ecx,0x303030 |
||
1102 | mov edx,hidetext+2 |
||
1103 | mov esi,1 |
||
1104 | int 0x40 |
||
1105 | |||
1106 | nos4: |
||
1107 | |||
1108 | mov eax,8 |
||
1109 | mov ebx,0*65536+9 |
||
1110 | mov ecx,13*65536+25 |
||
1111 | cmp [graph_text],1 |
||
1112 | jne nos6 |
||
1113 | mov ecx,0*65536 |
||
1114 | mov cx,word [b_size_y] |
||
1115 | nos6: |
||
1116 | mov edx,1 |
||
1117 | mov esi,[wcolor] |
||
1118 | int 0x40 |
||
1119 | |||
1120 | mov eax,4 |
||
1121 | mov ebx,3*65536+22 |
||
1122 | cmp [graph_text],1 |
||
1123 | jne nos7 |
||
1124 | mov ebx,3*65536+7 |
||
1125 | nos7: |
||
1126 | mov ecx,[wcolor] |
||
1127 | add ecx,0x303030 |
||
1128 | mov edx,hidetext+1 |
||
1129 | mov esi,1 |
||
1130 | int 0x40 |
||
1131 | |||
1132 | mov eax,12 |
||
1133 | mov ebx,2 |
||
1134 | int 0x40 |
||
1135 | |||
1136 | popa |
||
1137 | ret |
||
1138 | |||
1139 | |||
1140 | ;------------------------------------------------- |
||
1141 | |||
1142 | right_button: |
||
1143 | |||
1144 | call button_music |
||
1145 | |||
1146 | mov [small_draw],dword draw_small_right |
||
1147 | |||
1148 | mcall 14 |
||
1149 | shr eax, 16 |
||
1150 | mov ebx, eax |
||
1151 | mov ecx, -1 |
||
1152 | mov edx, 9 |
||
1153 | sub ebx, edx |
||
1154 | mov esi, -1 |
||
1155 | mcall 67 |
||
1156 | |||
1157 | call draw_small_right |
||
1158 | |||
1159 | jmp small_wait |
||
1160 | |||
1161 | ;------------------------------------------------- |
||
1162 | |||
1163 | left_button: |
||
1164 | |||
1165 | call button_music |
||
1166 | |||
1167 | mov [small_draw],dword draw_small_left |
||
1168 | |||
1169 | mov ebx, 0 |
||
1170 | mov edx, 9 |
||
1171 | mov ecx, -1 |
||
1172 | mov esi, -1 |
||
1173 | mcall 67 |
||
1174 | |||
1175 | call draw_small_left |
||
1176 | |||
1177 | ;------------------------------------------------- |
||
1178 | |||
1179 | small_wait: |
||
1180 | |||
1181 | mov eax, 10 |
||
1182 | int 0x40 |
||
1183 | |||
1184 | cmp eax,1 |
||
1185 | jne no_win |
||
1186 | call [small_draw] |
||
1187 | jmp small_wait |
||
1188 | no_win: |
||
93 | diamond | 1189 | cmp eax,2 |
1190 | jne no_key |
||
1191 | call handle_key |
||
1192 | jmp small_wait |
||
1193 | no_key: |
||
31 | halyavin | 1194 | |
1195 | mov eax,17 |
||
1196 | int 0x40 |
||
1197 | |||
1198 | cmp ah,1 |
||
1199 | jne no_full |
||
1200 | |||
601 | Rus | 1201 | mov eax, 14 ; get screen max x & max y |
31 | halyavin | 1202 | int 0x40 |
1203 | mov edx, eax |
||
1204 | shr edx, 16 |
||
50 | halyavin | 1205 | xor ebx, ebx |
31 | halyavin | 1206 | mov ecx, -1 |
1207 | mov esi, -1 |
||
1208 | mcall 67 ; x0 y0 xs ys |
||
1209 | |||
1210 | call button_music |
||
1211 | |||
1212 | jmp still |
||
1213 | |||
1214 | |||
1215 | no_full: |
||
1216 | |||
1217 | call menu_handler |
||
1218 | |||
1219 | jmp small_wait |
||
1220 | |||
1221 | |||
1222 | |||
1223 | set_variables: |
||
1224 | |||
1225 | pusha |
||
1226 | |||
1227 | mov [b_size_y],dword 38 |
||
1228 | cmp [graph_text],1 |
||
1229 | jne noy2 |
||
1230 | mov [b_size_y],dword 18 |
||
1231 | noy2: |
||
1232 | |||
1233 | mov [button_frames],0x0 |
||
1234 | cmp [buttons],0 |
||
1235 | jne no_frames |
||
1236 | mov [button_frames],0x40000000 |
||
1237 | no_frames: |
||
1238 | |||
1239 | |||
601 | Rus | 1240 | mov eax,48 ; 3d button look |
31 | halyavin | 1241 | mov ebx,1 |
1242 | mov ecx,1 |
||
1243 | int 0x40 |
||
1244 | |||
1245 | mov eax,0x40404040 ; dividers for processes |
||
1246 | mov edi,pros |
||
1247 | mov ecx,10 |
||
1248 | cld |
||
1249 | rep stosd |
||
1250 | |||
1251 | popa |
||
1252 | ret |
||
1253 | |||
1254 | |||
1255 | |||
1256 | ; eax = number (1 or 2) |
||
1257 | ; ebx = language id |
||
1258 | draw_flag: |
||
1259 | pusha |
||
1260 | |||
1261 | ; cmp [graph_text],0 |
||
1262 | ; je mini_flag |
||
1263 | |||
1264 | ; eax = 2 BIG |
||
1265 | ; eax = 1 small |
||
1266 | |||
1267 | mov edx,ebx |
||
1268 | |||
1269 | mov ebx,[maxx] |
||
1270 | and eax,1 |
||
1271 | imul eax,17 ;17 |
||
1272 | sub ebx,eax |
||
1273 | sub ebx,76 ;79 ;28 |
||
1274 | |||
1275 | pushad |
||
1276 | ; dec ebx |
||
1277 | sub ebx,2 |
||
1278 | shl ebx, 16 |
||
1279 | add ebx, 15 ;25 |
||
1280 | mov ecx, 4*65536+13 |
||
1281 | mov edx,0 |
||
1282 | mov eax,13 |
||
1283 | int 0x40 |
||
1284 | add ebx,1 shl 16 |
||
1285 | sub ebx,2 |
||
1286 | mov ecx, 5 shl 16+11 |
||
1287 | cmp [type_lang],1 |
||
601 | Rus | 1288 | je label_1 |
31 | halyavin | 1289 | mov edx,0xff ;[wcolor] |
1290 | jmp label_2 |
||
1291 | label_1: |
||
1292 | mov edx,0x7700 |
||
1293 | label_2: |
||
1294 | mov eax, 13 |
||
1295 | int 0x40 |
||
1296 | popad |
||
1297 | |||
1298 | shl ebx,16 |
||
601 | Rus | 1299 | add ebx,7 ;24 |
31 | halyavin | 1300 | |
1301 | mov ecx,[bte] ; color |
||
1302 | |||
1303 | dec edx |
||
1304 | shl edx,1 |
||
1305 | add edx,flag_text |
||
1306 | mov esi,2 |
||
1307 | mov eax,4 |
||
1308 | int 0x40 |
||
1309 | |||
1310 | mov ebx,[maxx] |
||
1311 | sub ebx,48 |
||
1312 | shl ebx,16 |
||
1313 | mov bx,34 |
||
1314 | mov ecx,3 shl 16+14 |
||
1315 | xor edx,edx |
||
1316 | mov eax,13 |
||
1317 | int 0x40 |
||
1318 | add ebx,1 shl 16 |
||
1319 | sub ebx,2 |
||
1320 | mov ecx,4 shl 16+12 |
||
1321 | mov edx,0x66cc |
||
1322 | int 0x40 |
||
1323 | |||
1324 | popa |
||
1325 | ret |
||
1326 | |||
1327 | ;mini_flag: |
||
1328 | ; popa |
||
1329 | ; ret |
||
1330 | |||
1331 | |||
1332 | |||
1333 | |||
1334 | ; *************************************************** |
||
1335 | ; ********* WINDOW DEFINITIONS AND DRAW ************* |
||
1336 | ; *************************************************** |
||
1337 | |||
1338 | |||
1339 | draw_window: |
||
1340 | |||
1341 | pusha |
||
1342 | |||
1343 | mov [running_applications],-1 |
||
1344 | mov [checks],-1 |
||
1345 | |||
601 | Rus | 1346 | mov eax, 12 ; tell os about redraw |
31 | halyavin | 1347 | mov ebx, 1 |
1348 | int 0x40 |
||
1349 | |||
1350 | mov eax, 48 |
||
1351 | mov ebx, 3 |
||
1352 | mov ecx, system_colours |
||
1353 | mov edx, 10*4 |
||
1354 | int 0x40 |
||
1355 | |||
1356 | mov eax, [system_colours+4*6] |
||
318 | heavyiron | 1357 | sub eax, 0x101010 |
31 | halyavin | 1358 | mov [wcolor], eax |
1359 | |||
601 | Rus | 1360 | mov eax,14 ; get screen max x & max y |
31 | halyavin | 1361 | int 0x40 |
1362 | |||
1363 | cmp [width],0 |
||
601 | Rus | 1364 | je no_def_width |
31 | halyavin | 1365 | and eax,0xffff |
1366 | mov ebx,[width] |
||
1367 | shl ebx,16 |
||
1368 | add eax,ebx |
||
1369 | no_def_width: |
||
1370 | |||
1371 | mov ebx,eax |
||
1372 | mov [screenxy],ebx |
||
1373 | shr ebx,16 |
||
1374 | sub ax,38 |
||
1375 | shl eax,16 |
||
1376 | mov ecx,eax |
||
1377 | add ecx,0*65536+38 |
||
1378 | cmp [graph_text],1 |
||
1379 | jne no_text_1 |
||
42 | mikedld | 1380 | mov cx,PANEL_HEIGHT |
31 | halyavin | 1381 | add ecx,20*65536 |
1382 | no_text_1: |
||
601 | Rus | 1383 | mov eax, 0 ; DEFINE AND DRAW WINDOW |
31 | halyavin | 1384 | mov edx, [wcolor] |
601 | Rus | 1385 | or edx, 0x01000000 ; do not draw the window |
31 | halyavin | 1386 | mov esi, [wcolor] |
601 | Rus | 1387 | or esi, 0x01000000 ; unmovable window |
31 | halyavin | 1388 | mov edi, [wcolor] |
601 | Rus | 1389 | |
1390 | mov [panel_x_pos], ebx |
||
633 | diamond | 1391 | mov [panel_y_pos], ecx ; Пока что так. |
601 | Rus | 1392 | |
31 | halyavin | 1393 | int 0x40 |
1394 | |||
1395 | movzx ebx,word [screenxy+2] |
||
1396 | mov ecx,0*65536+0 |
||
1397 | mov edx,[wcolor] |
||
1398 | add edx,0x161616 |
||
870 | barsuk | 1399 | newline_: ; debug.inc has macros with the same name |
31 | halyavin | 1400 | sub edx,0x040404 |
1401 | mov eax,38 |
||
1402 | cmp [soften_up],1 |
||
1403 | jne no_su |
||
51 | mikedld | 1404 | and edx,0x00FFFFFF |
31 | halyavin | 1405 | int 0x40 |
1406 | no_su: |
||
1407 | |||
1408 | pusha |
||
1409 | cmp [soften_down],1 |
||
1410 | jne no_sd |
||
1411 | sub edx,0x141414 |
||
1412 | mov edi,[b_size_y] |
||
1413 | shl edi,16 |
||
1414 | add edi,[b_size_y] |
||
1415 | add ecx,edi |
||
1416 | sub ecx,3*65536+3 |
||
51 | mikedld | 1417 | and edx,0x00FFFFFF |
31 | halyavin | 1418 | int 0x40 |
1419 | no_sd: |
||
1420 | popa |
||
1421 | |||
1422 | add ecx,1*65536+1 |
||
1423 | cmp cx,5 |
||
870 | barsuk | 1424 | jb newline_ |
31 | halyavin | 1425 | |
1426 | cmp [soften_middle],1 |
||
1427 | jne no_sm |
||
1428 | |||
1429 | movzx ebx,word [screenxy+2] |
||
1430 | mov ecx,5*65536+5 |
||
1431 | mov esi,stripe |
||
1432 | mov edx,[wcolor] |
||
1433 | newline3: |
||
1434 | add edx,[esi] |
||
1435 | add esi,4 |
||
1436 | |||
1437 | mov eax,38 |
||
51 | mikedld | 1438 | and edx,0x00FFFFFF |
31 | halyavin | 1439 | int 0x40 |
1440 | add ecx,1*65536+1 |
||
1441 | cmp cx,15 |
||
601 | Rus | 1442 | jb newline3 |
31 | halyavin | 1443 | |
1444 | no_sm: |
||
1445 | |||
1446 | cmp [minimize_left],1 |
||
1447 | jne no_mleft |
||
601 | Rus | 1448 | mov eax,8 ; ABS LEFT |
31 | halyavin | 1449 | mov ebx,0 *65536+9 |
1450 | mov ecx,1 *65536 |
||
1451 | add ecx,[b_size_y] |
||
1452 | dec ecx |
||
1453 | mov edx,101 |
||
1454 | add edx,[button_frames] |
||
1455 | mov esi,[wcolor] |
||
1456 | int 0x40 |
||
601 | Rus | 1457 | mov eax,4 ; HIDE TEXT |
31 | halyavin | 1458 | mov ebx,2*65536+17 |
1459 | cmp [graph_text],1 |
||
1460 | jne no_y1 |
||
1461 | mov bx,7 |
||
1462 | no_y1: |
||
1463 | mov ecx,[wcolor] |
||
1464 | add ecx,0x303030 |
||
1465 | mov edx,hidetext |
||
1466 | mov esi,1 |
||
1467 | int 0x40 |
||
1468 | no_mleft: |
||
1469 | |||
1470 | movzx eax,word [screenxy+2] |
||
1471 | mov [maxx],eax |
||
1472 | |||
1473 | cmp [minimize_right],1 |
||
1474 | jne no_mright |
||
1475 | mov eax,[maxx] |
||
1476 | sub eax,77 |
||
1477 | shl eax,16 |
||
1478 | mov ebx,eax |
||
1479 | add ebx,67 |
||
601 | Rus | 1480 | mov eax,8 ; ABS RIGHT |
31 | halyavin | 1481 | mov ecx,1 *65536 |
1482 | add ecx,[b_size_y] |
||
1483 | dec ecx |
||
1484 | add ebx,68*65536 |
||
1485 | mov bx,9 |
||
1486 | mov edx,102 |
||
1487 | add edx,[button_frames] |
||
1488 | mov esi,[wcolor] |
||
1489 | int 0x40 |
||
1490 | mov edx,hidetext+1 |
||
1491 | mov eax,4 |
||
1492 | mov ebx,[maxx] |
||
1493 | sub ebx,6 |
||
1494 | shl ebx,16 |
||
1495 | mov bx,17 |
||
1496 | cmp [graph_text],1 |
||
1497 | jne no_y2 |
||
1498 | mov bx,7 |
||
1499 | no_y2: |
||
1500 | mov ecx,[wcolor] |
||
1501 | add ecx,0x303030 |
||
1502 | mov esi,1 |
||
1503 | int 0x40 |
||
1504 | no_mright: |
||
1505 | |||
1506 | call draw_menuet_icon |
||
1507 | |||
1508 | call draw_program_icons |
||
1509 | |||
1510 | mov [ptime],0 |
||
1511 | call draw_info |
||
1512 | |||
1513 | call draw_application_buttons |
||
1514 | |||
1515 | ; mov ecx,[button_presssed_alt] |
||
1516 | ; mcall 47,0x80100,ecx ,400 shl 16+5,0 |
||
1517 | |||
1518 | mov eax,12 |
||
1519 | mov ebx,2 |
||
1520 | int 0x40 |
||
1521 | |||
1522 | popa |
||
1523 | ret |
||
1524 | |||
633 | diamond | 1525 | ; // Alver 26.08.2007 // { |
1526 | dr_button_clean: |
||
1527 | mov ecx, 3*65536+13 |
||
1528 | mcall 8 |
||
1529 | ret |
||
1530 | ; } \\ Alver \\ |
||
31 | halyavin | 1531 | |
1532 | draw_menuet_icon: |
||
1533 | |||
1534 | pusha |
||
1535 | |||
633 | diamond | 1536 | ; // Alver 26.08.2007 // { |
1537 | ; Inserted code for drowing buttons 103, 104, 105 (Clean, Restore, Exchange windows) |
||
1538 | mov esi, dword [system_colours+24] ; drawing buttons |
||
1539 | and esi, 0x00ffffff |
||
1540 | mov edx, 103 |
||
1541 | mov ebx, 67*65536+13 |
||
1542 | call dr_button_clean |
||
1543 | inc edx |
||
1544 | mov ebx, 86*65536+13 |
||
1545 | call dr_button_clean |
||
1546 | inc edx |
||
1547 | mov ebx, 105*65536+13 |
||
1548 | call dr_button_clean |
||
1549 | mov ecx, dword [system_colours+28] |
||
1550 | and ecx, 0x00ffffff |
||
1551 | xor esi, esi |
||
1552 | inc esi |
||
1553 | mov edx, page_clean_but |
||
1554 | mov eax, 4 |
||
1555 | mov ebx, 71*65536+6 |
||
1556 | int 0x40 |
||
1557 | inc edx |
||
1558 | mov ebx, 90*65536+6 |
||
1559 | int 0x40 |
||
1560 | inc edx |
||
1561 | mov ebx, 109*65536+6 |
||
1562 | int 0x40 |
||
1563 | ; } \\ Alver \\ |
||
1564 | |||
31 | halyavin | 1565 | cmp [menu_enable],1 |
1566 | jne no_menu |
||
1567 | |||
1568 | |||
601 | Rus | 1569 | mov eax, 8 ; M BUTTON |
31 | halyavin | 1570 | mov ebx, 10*65536 + 47 |
1571 | cmp [minimize_left], 0 |
||
1572 | jne @f |
||
1573 | sub ebx, 10*65536 |
||
1574 | @@: |
||
1575 | mov ecx, 1*65536 |
||
1576 | add ecx, [b_size_y] |
||
1577 | dec ecx |
||
1578 | mov edx, 0x20000001 |
||
1579 | add edx, [button_frames] |
||
1580 | mov esi, [wcolor] |
||
1581 | int 0x40 |
||
1582 | |||
1583 | cmp [graph_text], 1 |
||
1584 | jne no_mtext |
||
1585 | |||
1586 | push ebx |
||
1587 | mov eax,13 |
||
1588 | mov ebx,12 shl 16+44 ;51 |
||
1589 | mov ecx,1 shl 16+17 |
||
870 | barsuk | 1590 | ; xor edx,edx |
1591 | mov edx, 0x383838 |
||
31 | halyavin | 1592 | int 0x40 |
1593 | ; mov ebx,63 shl 16+1 |
||
1594 | mov ebx,56 shl 16+1 |
||
1595 | mov ecx,2 shl 16+15 |
||
1596 | int 0x40 |
||
1597 | mov ebx,57 shl 16+1 |
||
1598 | mov ecx,4 shl 16+11 |
||
1599 | int 0x40 |
||
1600 | mov ebx,58 shl 16+1 |
||
601 | Rus | 1601 | mov ecx,6 shl 16+7 |
31 | halyavin | 1602 | int 0x40 |
1603 | ; mov ebx,66 shl 16+1 |
||
1604 | ; mov ecx,9 shl 16+1 |
||
1605 | ; int 0x40 |
||
1606 | mov ebx,13 shl 16+43 ;50 |
||
1607 | mov ecx,2 shl 16+15 |
||
1608 | mov edx,0x7700 |
||
1609 | int 0x40 |
||
1610 | ; mov ebx,62 shl 16+1 |
||
1611 | ; mov ecx,3 shl 16+14 |
||
1612 | ; int 0x40 |
||
1613 | mov ebx,56 shl 16+1 |
||
1614 | mov ecx,4 shl 16+11 |
||
1615 | int 0x40 |
||
1616 | mov ebx,57 shl 16+1 |
||
1617 | mov ecx,6 shl 16+7 |
||
1618 | int 0x40 |
||
1619 | pop ebx |
||
1620 | |||
1621 | mov eax, 4 |
||
1622 | mov bx, 7 |
||
1623 | add ebx, 8*65536 |
||
1624 | mov ecx, 0x10ffffff |
||
1625 | mov edx, m_text |
||
1626 | mov esi, 4 |
||
1627 | int 0x40 |
||
1628 | |||
1629 | popa |
||
1630 | ret |
||
1631 | |||
1632 | no_mtext: |
||
1633 | |||
1634 | |||
1635 | |||
1636 | mov eax,[wcolor] |
||
1637 | mov [m_icon+4],eax |
||
1638 | |||
93 | diamond | 1639 | ; load & display menuet.bmp |
601 | Rus | 1640 | mov eax, 70 |
1641 | mov ebx, m_bmp_fileinfo |
||
1642 | int 0x40 |
||
31 | halyavin | 1643 | |
1644 | mov eax,40 |
||
1645 | mov ebx,0 |
||
1646 | mov edi,image+53 |
||
1647 | |||
1648 | new_m_pix: |
||
1649 | |||
1650 | ; movzx ecx,byte [edi] |
||
1651 | ; shr ecx,5 |
||
1652 | |||
93 | diamond | 1653 | cmp byte [edi], 10 |
601 | Rus | 1654 | jb nopix |
93 | diamond | 1655 | cmp byte [edi+1], 10 |
601 | Rus | 1656 | jb nopix |
93 | diamond | 1657 | cmp byte [edi+2], 10 |
601 | Rus | 1658 | jb nopix |
31 | halyavin | 1659 | |
1660 | pusha |
||
1661 | cmp [minimize_left],0 |
||
1662 | jne no_m_s2 |
||
1663 | sub ebx,10 |
||
1664 | no_m_s2: |
||
1665 | ; mov edx,[ecx*4+m_icon] |
||
1666 | mov edx,[edi+1] |
||
1667 | |||
1668 | mov ecx,eax |
||
1669 | mov eax,1 |
||
1670 | add ebx,12 |
||
1671 | int 0x40 |
||
1672 | popa |
||
1673 | |||
1674 | nopix: |
||
1675 | |||
1676 | add edi,3 |
||
1677 | add ebx,1 |
||
1678 | cmp ebx,40 |
||
1679 | jnz new_m_pix |
||
1680 | |||
1681 | mov ebx,0 |
||
1682 | dec eax |
||
1683 | jnz new_m_pix |
||
1684 | |||
1685 | no_menu: |
||
1686 | |||
1687 | popa |
||
1688 | ret |
||
1689 | |||
1690 | |||
1691 | draw_program_icons: |
||
1692 | |||
1693 | pusha |
||
1694 | |||
1695 | cmp [icons],0 |
||
1696 | jne dp_ret |
||
1697 | |||
1698 | mov edi,1 |
||
1699 | push edi |
||
1700 | |||
1701 | new_icon_file: |
||
1702 | |||
1703 | pusha |
||
1704 | mov edx,[esp+32] |
||
1705 | add edx,10 |
||
1706 | push edx |
||
1707 | mov esi,[wcolor] |
||
1708 | mov ecx,1*65536 |
||
1709 | add ecx,[b_size_y] |
||
1710 | dec ecx |
||
1711 | mov eax,edi |
||
1712 | dec eax |
||
1713 | imul eax,40 |
||
1714 | mov ebx,eax |
||
1715 | add ebx,[icons_position] |
||
1716 | shl ebx,16 |
||
1717 | mov bx,39 |
||
1718 | pop edx |
||
1719 | add edx,[button_frames] |
||
601 | Rus | 1720 | or edx, 0x20000000 |
31 | halyavin | 1721 | mov eax,8 |
1722 | int 0x40 |
||
1723 | popa |
||
1724 | |||
1725 | mov ecx,[esp] |
||
1726 | add ecx,48 |
||
1727 | mov [iconf+6],cl |
||
1728 | |||
601 | Rus | 1729 | mov eax, 70 |
1730 | mov ebx, iconf_fileinfo |
||
1731 | int 0x40 |
||
31 | halyavin | 1732 | |
1733 | mov eax,0 |
||
1734 | mov ebx,32 |
||
1735 | mov edi,image+51+32*33*3 |
||
1736 | |||
601 | Rus | 1737 | np2: ; new pixel of file |
31 | halyavin | 1738 | |
1739 | mov edx,[edi] |
||
1740 | and edx,0xffffff |
||
1741 | |||
601 | Rus | 1742 | cmp eax,3 ; Y draw limits |
1743 | jb nopix2 |
||
31 | halyavin | 1744 | cmp eax,36 |
601 | Rus | 1745 | jg nopix2 |
1746 | cmp ebx,38 ; X draw limits |
||
1747 | jg nopix2 |
||
31 | halyavin | 1748 | cmp ebx,2 |
601 | Rus | 1749 | jb nopix2 |
31 | halyavin | 1750 | |
1751 | cmp edx,0 |
||
601 | Rus | 1752 | jz nopix2 |
31 | halyavin | 1753 | |
1754 | cmp [graph_text],1 |
||
1755 | jne no_icon_text |
||
1756 | |||
1757 | pusha |
||
1758 | |||
1759 | mov ebx,[esp+32] |
||
1760 | dec ebx |
||
1761 | imul ebx,40 |
||
1762 | add ebx,8 |
||
1763 | add ebx,[icons_position] |
||
1764 | shl ebx,16 |
||
1765 | mov bx,7 |
||
1766 | |||
1767 | mov eax,4 |
||
1768 | mov ecx,0xffffff |
||
1769 | mov edx,[esp+32] |
||
1770 | dec edx |
||
1771 | imul edx,4 |
||
1772 | add edx,mi_text |
||
1773 | mov esi,4 |
||
1774 | int 0x40 |
||
1775 | |||
1776 | popa |
||
1777 | |||
1778 | jmp nopix2 |
||
1779 | |||
1780 | no_icon_text: |
||
1781 | |||
1782 | mov esi,[esp] |
||
1783 | pusha |
||
1784 | push edx |
||
1785 | mov ecx,eax |
||
1786 | add ecx,2 |
||
1787 | mov eax,esi |
||
1788 | dec eax |
||
1789 | imul eax,40 |
||
1790 | add ebx,eax |
||
1791 | add ebx,3 |
||
1792 | add ebx,[icons_position] |
||
1793 | pop edx |
||
1794 | mov eax,1 |
||
1795 | int 0x40 |
||
1796 | popa |
||
1797 | |||
1798 | nopix2: |
||
1799 | |||
1800 | sub edi,3 |
||
1801 | dec ebx |
||
1802 | jnz np2 |
||
1803 | |||
1804 | mov ebx,32 |
||
1805 | add eax,1 |
||
1806 | cmp eax,32 |
||
1807 | jnz np2 |
||
1808 | |||
1809 | add dword [esp],1 |
||
1810 | mov edi,[esp] |
||
1811 | cmp dword [esp],4 |
||
1812 | jbe new_icon_file |
||
1813 | add esp,4 |
||
1814 | |||
1815 | mov eax,4 |
||
1816 | mov ebx,40 |
||
1817 | imul ebx,3 |
||
1818 | add ebx,[icons_position] |
||
1819 | add ebx,10 |
||
1820 | shl ebx,16 |
||
1821 | mov bx,23 |
||
1822 | mov ecx,[wcolor] |
||
1823 | mov edx,gpl |
||
1824 | mov esi,3 |
||
1825 | int 0x40 |
||
1826 | |||
1827 | dp_ret: |
||
1828 | |||
1829 | popa |
||
1830 | ret |
||
1831 | |||
1832 | |||
1833 | |||
1834 | draw_info: ; draw cpu usage, time, date |
||
1835 | |||
1836 | pusha |
||
1837 | |||
1838 | cmp [setup_enable],1 |
||
1839 | jne no_setup |
||
1840 | |||
1841 | cmp [minimize_right],0 |
||
1842 | jne no_m_r |
||
1843 | add [maxx],10 |
||
1844 | |||
1845 | no_m_r: |
||
1846 | |||
1847 | mov eax,3 |
||
1848 | int 0x40 |
||
1849 | cmp eax,[ptime] |
||
601 | Rus | 1850 | jz _ret |
31 | halyavin | 1851 | mov [ptime],eax |
1852 | |||
1853 | call draw_cpu_usage |
||
1854 | |||
1855 | mov eax,[maxx] ; blink sec |
||
1856 | sub eax,33 |
||
1857 | shl eax,16 |
||
1858 | mov ebx,eax |
||
1859 | add ebx,9 |
||
1860 | mov eax,3 |
||
1861 | int 0x40 |
||
1862 | cmp [graph_text],1 |
||
1863 | jne no_y4 |
||
1864 | sub bx,2 |
||
1865 | no_y4: |
||
1866 | mov ecx,eax |
||
1867 | shr ecx,16 |
||
1868 | and ecx,1 |
||
1869 | mov edx,[bte] |
||
1870 | sub edx,[wcolor] |
||
1871 | imul ecx,edx |
||
1872 | add ecx,[wcolor] |
||
1873 | mov edx,sec |
||
1874 | mov eax,4 |
||
1875 | mov esi,1 |
||
1876 | int 0x40 |
||
1877 | |||
1878 | |||
304 | diamond | 1879 | ; mov eax,26 ; check for change in time or country |
1880 | ; mov ebx,5 |
||
1881 | ; int 0x40 |
||
1882 | ; mov edx,eax |
||
31 | halyavin | 1883 | mov eax,26 |
1884 | mov ebx,2 |
||
1885 | mov ecx,9 |
||
1886 | int 0x40 |
||
304 | diamond | 1887 | ; add edx,eax |
1888 | mov edx,eax |
||
31 | halyavin | 1889 | mov eax,3 |
1890 | int 0x40 |
||
1891 | and eax,0xffff |
||
1892 | add edx,eax |
||
1893 | cmp edx,[checks] |
||
601 | Rus | 1894 | je _ret |
31 | halyavin | 1895 | mov [checks],edx |
1896 | |||
1897 | mov ebx,[maxx] |
||
1898 | sub ebx,48 ;;94 ;;74 |
||
1899 | shl ebx,16 |
||
1900 | add ebx,33 ;;84 ;;64 |
||
1901 | |||
601 | Rus | 1902 | mov eax,8 ; time/date button |
31 | halyavin | 1903 | mov ecx,3 *65536 |
1904 | add ecx,[b_size_y] |
||
1905 | ; dec ecx |
||
1906 | sub cx,5 |
||
1907 | mov edx,2+0x20000000 |
||
1908 | mov esi,[wcolor] |
||
1909 | int 0x40 |
||
1910 | pusha |
||
1911 | mov eax,13 |
||
1912 | add ebx,10*65536-16 |
||
1913 | add ecx,5*65536-8 |
||
1914 | mov edx,[wcolor] |
||
1915 | int 0x40 |
||
1916 | popa |
||
1917 | and edx,0xffff |
||
1918 | add edx,[button_frames] |
||
1919 | int 0x40 |
||
1920 | |||
1921 | mov eax,8 |
||
1922 | mov ebx,[maxx] |
||
1923 | sub ebx,77 ;80 |
||
1924 | shl ebx,16 |
||
1925 | add ebx,12 |
||
1926 | mov ecx,5 shl 16+10 |
||
1927 | mov edx,16+0x20000000 ;button 16 |
||
1928 | mov esi,[wcolor] |
||
1929 | int 0x40 |
||
1930 | sub ebx,17 shl 16 |
||
601 | Rus | 1931 | inc edx ;button 17 |
304 | diamond | 1932 | ; int 0x40 |
31 | halyavin | 1933 | add ebx,33 shl 16 |
1934 | mov bx,8 |
||
601 | Rus | 1935 | inc edx ;button 18 |
31 | halyavin | 1936 | int 0x40 |
304 | diamond | 1937 | sub ebx,30 shl 16 |
31 | halyavin | 1938 | mov bx,10 |
601 | Rus | 1939 | inc edx ;button 19 |
31 | halyavin | 1940 | int 0x40 |
1941 | sub ebx,14 shl 16 |
||
601 | Rus | 1942 | inc edx ;button 20 |
31 | halyavin | 1943 | int 0x40 |
51 | mikedld | 1944 | sub ebx,12 shl 16 |
1945 | mov bx,8 |
||
1946 | mov ecx,6 shl 16+10 |
||
601 | Rus | 1947 | inc edx ;button 21 |
51 | mikedld | 1948 | int 0x40 |
870 | barsuk | 1949 | sub ebx,24 shl 16 ; << Alver 25.08.2007 >> 18 shl 16 |
601 | Rus | 1950 | inc edx ;button 22 |
51 | mikedld | 1951 | int 0x40 |
1952 | |||
31 | halyavin | 1953 | ; flags |
1954 | |||
304 | diamond | 1955 | ; mov eax,26 |
1956 | ; mov ebx,5 |
||
1957 | ; int 0x40 |
||
1958 | ; mov ebx,eax |
||
1959 | ; |
||
1960 | ; mov eax,1 |
||
1961 | ; mov [type_lang],al |
||
1962 | ; call draw_flag |
||
31 | halyavin | 1963 | |
1964 | mov eax,26 |
||
1965 | mov ebx,2 |
||
1966 | mov ecx,9 |
||
1967 | int 0x40 |
||
1968 | mov ebx,eax |
||
1969 | |||
1970 | mov eax,2 |
||
1971 | mov [type_lang],al |
||
1972 | call draw_flag |
||
1973 | |||
1974 | mcall 18,8,1 |
||
1975 | mov [sound_flag],al |
||
1976 | |||
1977 | mov ebx,[maxx] |
||
304 | diamond | 1978 | sub ebx,92 ;109 ;112 ;28 |
31 | halyavin | 1979 | shl ebx,16 |
1980 | mov bx,12 |
||
1981 | mov ecx, 4*65536+13 |
||
1982 | mov edx,0 |
||
1983 | mov eax,13 |
||
1984 | int 0x40 |
||
1985 | add ebx,1 shl 16 |
||
1986 | sub bx,2 |
||
1987 | mov ecx,5 shl 16+11 |
||
1988 | mov edx,0xcc |
||
1989 | int 0x40 |
||
1990 | add ebx,1 shl 16 |
||
1991 | mov bx,5 |
||
1992 | mov ecx,8 shl 16+5 |
||
1993 | mov edx,0xdddd00 |
||
1994 | int 0x40 |
||
1995 | add ebx,5 shl 16 |
||
1996 | mov bx,1 |
||
1997 | mov ecx,7 shl 16+7 |
||
1998 | int 0x40 |
||
1999 | add ebx,1 shl 16 |
||
2000 | mov ecx,6 shl 16+9 |
||
2001 | int 0x40 |
||
2002 | add ebx,1 shl 16 |
||
2003 | mov ecx,5 shl 16+11 |
||
2004 | int 0x40 |
||
2005 | |||
2006 | ; cmp [music_type],0 |
||
2007 | ; jne dalshe |
||
2008 | cmp [sound_flag],0 |
||
601 | Rus | 2009 | je dalshe |
31 | halyavin | 2010 | |
2011 | sub ebx,8 shl 16 |
||
2012 | ror ebx,16 |
||
2013 | mov cx,bx |
||
2014 | rol ebx,16 |
||
2015 | mov bx,cx |
||
2016 | add bx,8 |
||
2017 | mov ecx,5 shl 16+15 |
||
2018 | mov edx,0xff0000 |
||
2019 | mov eax,38 |
||
2020 | int 0x40 |
||
2021 | add ebx,1 shl 16 |
||
2022 | inc bx |
||
2023 | int 0x40 |
||
2024 | rol ecx,16 |
||
2025 | int 0x40 |
||
2026 | sub ebx,1 shl 16 |
||
2027 | dec bx |
||
2028 | int 0x40 |
||
2029 | |||
2030 | dalshe: |
||
2031 | |||
2032 | mov ebx,[maxx] |
||
304 | diamond | 2033 | sub ebx,106;123 |
31 | halyavin | 2034 | shl ebx,16 |
2035 | mov bx,12 |
||
2036 | mov ecx, 4*65536+13 |
||
2037 | mov edx,0 |
||
2038 | mov eax,13 |
||
2039 | int 0x40 |
||
2040 | add ebx,1 shl 16 |
||
2041 | sub bx,2 |
||
2042 | mov ecx,5 shl 16+11 |
||
2043 | mov edx,0xffcc00 |
||
2044 | int 0x40 |
||
2045 | mov eax,4 |
||
2046 | mov ebx,[maxx] |
||
304 | diamond | 2047 | sub ebx,104;121 |
31 | halyavin | 2048 | shl ebx,16 |
2049 | mov bx,7 |
||
2050 | mov ecx,0x10000000 |
||
2051 | mov edx,file_sys |
||
2052 | mov esi,1 |
||
2053 | int 0x40 |
||
2054 | add ebx,1 shl 16 |
||
2055 | int 0x40 |
||
2056 | |||
51 | mikedld | 2057 | mov edx,0 |
2058 | mov eax,13 |
||
2059 | mov ebx,[maxx] |
||
304 | diamond | 2060 | sub ebx,117;134 |
51 | mikedld | 2061 | shl ebx,16 |
2062 | mov bx,9 |
||
2063 | mov ecx,6 shl 16+11 |
||
2064 | int 0x40 |
||
633 | diamond | 2065 | ; // Alver 25.08.2007 // { |
2066 | ; sub ebx,18 shl 16 |
||
2067 | ; int 0x40 |
||
2068 | ; add ebx,19 shl 16 |
||
2069 | sub ebx,24 shl 16 ; 18 shl 16 |
||
51 | mikedld | 2070 | int 0x40 |
633 | diamond | 2071 | add ebx,25 shl 16 ; 19 shl 16 |
2072 | ; } \\ Alver \\ |
||
51 | mikedld | 2073 | sub bx,2 |
2074 | mov ecx,7 shl 16+9 |
||
2075 | mov edx,0xffffff |
||
2076 | int 0x40 |
||
633 | diamond | 2077 | ; // Alver 25.08.2007 // { |
2078 | ; sub ebx,18 shl 16 |
||
2079 | sub ebx,24 shl 16 |
||
2080 | ; } \\ Alver \\ |
||
51 | mikedld | 2081 | int 0x40 |
2082 | |||
2083 | mov eax,4 |
||
2084 | mov edx,page_a1 |
||
2085 | mov ebx,[maxx] |
||
633 | diamond | 2086 | ; // Alver 25.08.2007 // { |
2087 | ; sub ebx,133;150 |
||
2088 | sub ebx, 139 |
||
2089 | ; } \\ Alver \\ |
||
51 | mikedld | 2090 | shl ebx,16 |
2091 | mov bx,8 |
||
870 | barsuk | 2092 | mov esi,5 ;4 |
51 | mikedld | 2093 | int 0x40 |
2094 | add ebx,1 shl 16 |
||
2095 | int 0x40 |
||
2096 | |||
2097 | mov eax,47 |
||
633 | diamond | 2098 | mov ebx,0x20000 ; 0x10100 ( |
51 | mikedld | 2099 | mov ecx,[page_list] |
2100 | mov edx,[maxx] |
||
633 | diamond | 2101 | sub edx,130 ; 124 ( |
51 | mikedld | 2102 | shl edx,16 |
2103 | mov dx,7 |
||
2104 | mov esi,0xffffff |
||
2105 | int 0x40 |
||
2106 | |||
31 | halyavin | 2107 | ; sub ebx,14 shl 16 |
2108 | ; mov bx,7 |
||
2109 | ; mov edx,turn_text |
||
2110 | ; mov esi,1 |
||
2111 | |||
2112 | ; mov ecx,0x60a060 ;[wcolor] |
||
2113 | ; add ecx,0x303030 |
||
2114 | ; mov eax,4 |
||
2115 | ; int 0x40 |
||
2116 | ; add ebx,1 shl 16 |
||
2117 | ; int 0x40 |
||
2118 | ; add ebx,1 shl 16 |
||
2119 | ; int 0x40 |
||
2120 | ; add ebx,1 shl 16 |
||
2121 | ; int 0x40 |
||
2122 | |||
2123 | ; add ebx,1 shl 16 |
||
2124 | ; mov ecx,0x60a060 ;[wcolor] |
||
2125 | ; int 0x40 |
||
2126 | ; add ebx,1 shl 16 |
||
2127 | ; int 0x40 |
||
2128 | ; add ebx,1 shl 16 |
||
2129 | ; sub ecx,0x303030 |
||
2130 | ; int 0x40 |
||
2131 | |||
2132 | ; sub ebx,6 shl 16 |
||
2133 | ; mov bx,1 |
||
2134 | ; mov ecx,2 shl 16+15 |
||
2135 | ; mov edx,0x60a060 ;[wcolor] |
||
2136 | ; add edx,0x303030 |
||
2137 | ; mov eax,13 |
||
2138 | ; int 0x40 |
||
2139 | ; add ebx,1 shl 16 |
||
2140 | ; mov bx,1 |
||
2141 | ; mov edx,0x60a060 ;[wcolor] |
||
2142 | ; int 0x40 |
||
2143 | ; add ebx,1 shl 16 |
||
2144 | ; mov bx,1 |
||
2145 | ; sub edx,0x303030 |
||
2146 | ; int 0x40 |
||
2147 | ; add ebx,1 shl 16 |
||
2148 | ; mov edx,[wcolor] |
||
2149 | ; int 0x40 |
||
2150 | |||
601 | Rus | 2151 | mov eax,3 ; get time |
31 | halyavin | 2152 | int 0x40 |
2153 | |||
2154 | movzx ebx,al |
||
2155 | shr eax,8 |
||
2156 | movzx ecx,al |
||
2157 | shr eax,8 |
||
2158 | movzx edx,al |
||
2159 | |||
2160 | ; ebx ecx edx h m s |
||
2161 | |||
2162 | push ebx |
||
2163 | push ecx |
||
2164 | |||
2165 | mov eax,[maxx] |
||
2166 | sub eax,32 |
||
2167 | shl eax,16 |
||
2168 | mov ebx,eax |
||
2169 | add ebx,9 |
||
2170 | |||
2171 | mov ecx,[bte] |
||
2172 | |||
2173 | cmp [graph_text],1 |
||
2174 | jne no_y3 |
||
2175 | sub bx,2 |
||
2176 | mov ecx,0xffffff |
||
2177 | no_y3: |
||
2178 | |||
2179 | |||
601 | Rus | 2180 | mov edx,[esp] ; __:_X |
31 | halyavin | 2181 | and edx,15 |
2182 | mov eax,4 |
||
2183 | add ebx,10*65536 |
||
2184 | add edx,text |
||
2185 | mov esi,1 |
||
2186 | int 0x40 |
||
2187 | |||
601 | Rus | 2188 | pop edx ; __:X_ |
31 | halyavin | 2189 | shr edx,4 |
2190 | and edx,15 |
||
2191 | mov eax,4 |
||
2192 | sub ebx,6*65536 |
||
2193 | add edx,text |
||
2194 | mov esi,1 |
||
2195 | int 0x40 |
||
2196 | |||
601 | Rus | 2197 | mov edx,[esp] ; _X:__ |
31 | halyavin | 2198 | and edx,15 |
2199 | mov eax,4 |
||
2200 | sub ebx,11*65536 |
||
2201 | add edx,text |
||
2202 | mov esi,1 |
||
2203 | int 0x40 |
||
2204 | |||
601 | Rus | 2205 | pop edx ; X_:__ |
31 | halyavin | 2206 | shr edx,4 |
2207 | and edx,15 |
||
2208 | mov eax,4 |
||
2209 | sub ebx,6*65536 |
||
2210 | add edx,text |
||
2211 | mov esi,1 |
||
2212 | int 0x40 |
||
2213 | |||
2214 | call draw_cpu_usage |
||
2215 | |||
2216 | _ret: |
||
2217 | |||
2218 | cmp [minimize_right],0 |
||
2219 | jne no_m_r2 |
||
2220 | sub [maxx],10 |
||
2221 | no_m_r2: |
||
2222 | |||
2223 | no_setup: |
||
2224 | |||
2225 | popa |
||
2226 | ret |
||
2227 | |||
2228 | |||
2229 | |||
2230 | draw_cpu_usage: |
||
2231 | |||
318 | heavyiron | 2232 | pushad |
31 | halyavin | 2233 | |
2234 | mov [ysi],30 |
||
2235 | cmp [graph_text],1 |
||
2236 | jne @f |
||
318 | heavyiron | 2237 | mov [ysi],12 |
31 | halyavin | 2238 | @@: |
2239 | |||
2240 | |||
2241 | mov eax,18 ; TSC / SEC |
||
2242 | mov ebx,5 |
||
2243 | int 0x40 |
||
2244 | shr eax,20 |
||
2245 | push eax |
||
2246 | mov eax,18 ; IDLE / SEC |
||
2247 | mov ebx,4 |
||
2248 | int 0x40 |
||
2249 | shr eax,20 |
||
2250 | xor edx,edx |
||
2251 | imul eax,[ysi] |
||
2252 | |||
2253 | cdq |
||
2254 | pop ebx |
||
2255 | inc ebx |
||
2256 | div ebx |
||
318 | heavyiron | 2257 | cmp eax,[ysi] |
2258 | jng no_bug |
||
2259 | mov eax,[ysi] |
||
2260 | no_bug: |
||
31 | halyavin | 2261 | push eax |
2262 | |||
2263 | mov eax,13 |
||
2264 | mov ebx,[maxx] |
||
372 | heavyiron | 2265 | sub ebx,60 |
31 | halyavin | 2266 | shl ebx,16 |
372 | heavyiron | 2267 | add ebx,8 |
2268 | mov ecx,5 shl 16 |
||
318 | heavyiron | 2269 | add ecx,[ysi] |
372 | heavyiron | 2270 | mov edx,0xdd2222 |
31 | halyavin | 2271 | int 0x40 |
372 | heavyiron | 2272 | |
31 | halyavin | 2273 | pop eax |
372 | heavyiron | 2274 | mov ecx,5 shl 16 |
2275 | add ecx,eax |
||
31 | halyavin | 2276 | mov eax,13 |
372 | heavyiron | 2277 | mov edx,0x44aa44 |
31 | halyavin | 2278 | int 0x40 |
2279 | |||
318 | heavyiron | 2280 | popad |
31 | halyavin | 2281 | ret |
2282 | |||
870 | barsuk | 2283 | ;;;include 'detect.asm' |
601 | Rus | 2284 | include 'ctx_menu.asm' |
2285 | |||
31 | halyavin | 2286 | ; DATA |
2287 | |||
2288 | stripe: |
||
601 | Rus | 2289 | dd -0x010101 |
2290 | dd -0x010101 |
||
2291 | dd -0x020202 |
||
2292 | dd -0x010101 |
||
2293 | dd -0x000000 |
||
31 | halyavin | 2294 | |
601 | Rus | 2295 | dd 0x000000 |
2296 | dd 0x010101 |
||
2297 | dd 0x020202 |
||
2298 | dd 0x010101 |
||
2299 | dd 0x010101 |
||
31 | halyavin | 2300 | |
2301 | m_icon: |
||
601 | Rus | 2302 | dd 0x0 |
2303 | dd 0x808080 |
||
2304 | dd 0x000000 |
||
2305 | dd 0x000000 |
||
2306 | dd 0xffffff |
||
31 | halyavin | 2307 | |
2308 | |||
2309 | lsz m_text,\ |
||
2310 | ru, "МЕНЮ",\ |
||
275 | kaitz | 2311 | en, "MENU",\ |
870 | barsuk | 2312 | et, "MEN--" |
31 | halyavin | 2313 | |
2314 | mi_text db 'WAVETETRBGRDGPL ' |
||
2315 | |||
870 | barsuk | 2316 | flag_text db 'EnFiGeRuFrEtUa' |
31 | halyavin | 2317 | |
2318 | type_lang db 0 |
||
2319 | ;music_type db 1 |
||
2320 | sound_flag db 0 |
||
2321 | button_frames dd 0x0 |
||
2322 | |||
601 | Rus | 2323 | checks dd -1 |
31 | halyavin | 2324 | hidetext db 0x11,0x10,0x1e |
2325 | |||
2326 | turn_text db '><' |
||
601 | Rus | 2327 | gpl db 'GPL' |
31 | halyavin | 2328 | |
2329 | chlang db 'LANG',0 |
||
304 | diamond | 2330 | ;syslang db 'SLAN',0 |
31 | halyavin | 2331 | |
2332 | contrast db 0 |
||
2333 | |||
2334 | running_applications dd 0x100 |
||
2335 | max_applications dd 11 |
||
2336 | |||
601 | Rus | 2337 | current_alt_tab_app dd -1 |
443 | diamond | 2338 | |
51 | mikedld | 2339 | page_list dd 0 |
2340 | draw_start_position dd 0 |
||
2341 | draw_window_1 db 0 |
||
2342 | |||
31 | halyavin | 2343 | b_size_y: dd 0x0 |
2344 | ysi dd 0 |
||
2345 | small_draw dd 0x0 |
||
2346 | |||
601 | Rus | 2347 | ptime dd 0x0 |
2348 | maxx dd 0x0 |
||
2349 | text db '0123456789' |
||
633 | diamond | 2350 | ; // Alver 25.08.2007 // { |
2351 | ;page_a1 db '< >' |
||
2352 | page_a1 db '< >' |
||
2353 | page_clean_but db 25,24,18 |
||
2354 | ; } \\ Alver \\ |
||
601 | Rus | 2355 | bte dd 0xccddee |
31 | halyavin | 2356 | |
601 | Rus | 2357 | wcolor dd 0x506070 |
31 | halyavin | 2358 | |
601 | Rus | 2359 | sec db ': ' |
2360 | pros db ' ' |
||
2361 | db ' ' |
||
31 | halyavin | 2362 | |
601 | Rus | 2363 | screenxy dd 0x0 |
2364 | stcount dd 0x0 |
||
31 | halyavin | 2365 | |
93 | diamond | 2366 | setup_exec: |
601 | Rus | 2367 | dd 7 |
2368 | dd 0 |
||
2369 | .cmdline dd ? |
||
2370 | dd 0 |
||
2371 | dd 0 |
||
2372 | db '/sys/' |
||
2373 | file_sys db 'SETUP',0 |
||
93 | diamond | 2374 | |
2375 | exec_fileinfo: |
||
601 | Rus | 2376 | dd 7 |
2377 | dd 0 |
||
2378 | dd 0 |
||
2379 | dd 0 |
||
2380 | dd 0 |
||
2381 | db 0 |
||
2382 | .name dd ? |
||
93 | diamond | 2383 | |
601 | Rus | 2384 | end_name db '/sys/END',0 |
2385 | menu_name db '/sys/@MENU',0 |
||
2386 | calendar_name db '/sys/CALENDAR',0 |
||
2387 | sysmeter_name db '/sys/GMON',0 |
||
1421 | diamond | 2388 | mousemul_name db '/sys/MOUSEMUL',0 |
93 | diamond | 2389 | |
2390 | dat_fileinfo: |
||
601 | Rus | 2391 | dd 0 |
2392 | dd 0 |
||
2393 | dd 0 |
||
2394 | dd 1024 |
||
2395 | dd I_END |
||
2396 | db '/sys/PANEL.DAT',0 |
||
93 | diamond | 2397 | |
2398 | m_bmp_fileinfo: |
||
601 | Rus | 2399 | dd 0 |
2400 | dd 0 |
||
2401 | dd 0 |
||
2402 | dd 8192 |
||
2403 | dd image |
||
2404 | db '/sys/MENUET.BMP',0 |
||
93 | diamond | 2405 | |
2406 | iconf_fileinfo: |
||
601 | Rus | 2407 | dd 0 |
2408 | dd 0 |
||
2409 | dd 0 |
||
2410 | dd 8192 |
||
2411 | dd image |
||
2412 | db '/sys/' |
||
2413 | iconf db 'MBAR_IX.BMP',0 |
||
93 | diamond | 2414 | |
31 | halyavin | 2415 | I_END: |
51 | mikedld | 2416 | |
2417 | screen_size: |
||
2418 | .height dw ? |
||
2419 | .width dw ? |
||
2420 | |||
870 | barsuk | 2421 | this_slot dd 0 ; Slot of this process |
633 | diamond | 2422 | max_slot dd 255 |
870 | barsuk | 2423 | system_colours system_colors ; rd 10 |
31 | halyavin | 2424 | app_list rd 50 |
601 | Rus | 2425 | alt_tab_list rd 256*2 |
2426 | alt_tab_list_size dd ? |
||
494 | spraid | 2427 | process_info_buffer rb 1024 |
633 | diamond | 2428 | procinfo_for_detect rb 1024 |
31 | halyavin | 2429 | tictable: |
2430 | rd 256 |
||
601 | Rus | 2431 | |
2432 | rb 256 |
||
2433 | detect_stack: |
||
2434 | rb 256 |
||
2435 | ctx_menu_stack: |
||
2436 | |||
2437 | panel_x_pos rd 1 |
||
2438 | panel_y_pos rd 1 |
||
870 | barsuk | 2439 | |
2440 | last_active_window dd 0 |
||
2441 | prev_active_window dd 0 |
||
2442 | active_window_changed dd 0 |
||
2443 | app_tab_count dd 0 |
||
2444 | |||
2445 | image:>>' |