Rev 3823 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
31 | halyavin | 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ; ; |
||
2619 | mario79 | 3 | ; TASK PANEL for KolibriOS - Compile with fasm ; |
31 | halyavin | 4 | ; ; |
5 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
2619 | mario79 | 6 | ;------------------------------------------------------------------------------ |
3823 | mario79 | 7 | ; version: 2.25 |
8 | ; last update: 14/07/2013 |
||
9 | ; changed by: Marat Zakiyanov aka Mario79, aka Mario |
||
10 | ; changes: Reinstall screen work area after change screen resolution |
||
11 | ;------------------------------------------------------------------------------ |
||
3672 | hidnplayr | 12 | ; version: 2.24 |
13 | ; last update: 16/06/2013 |
||
14 | ; changed by: hidnplayr |
||
15 | ; changes: Changed keymap hotkeys to only use left alt |
||
16 | ; (Right alt has special function on some keyboards) |
||
17 | ;------------------------------------------------------------------------------ |
||
3670 | hidnplayr | 18 | ; version: 2.23 |
2649 | mario79 | 19 | ; last update: 26/04/2012 |
20 | ; changed by: Marat Zakiyanov aka Mario79, aka Mario |
||
21 | ; changes: Using new f18.23 - minimize all windows |
||
22 | ;------------------------------------------------------------------------------ |
||
3670 | hidnplayr | 23 | ; version: 2.22 |
2638 | mario79 | 24 | ; last update: 20/04/2012 |
25 | ; changed by: Marat Zakiyanov aka Mario79, aka Mario |
||
26 | ; changes: Activation mechanism when trying to run an existing appl. |
||
27 | ; Forced redrawing the background after the clean desktop (Win+D) |
||
28 | ;------------------------------------------------------------------------------ |
||
3670 | hidnplayr | 29 | ; version: 2.2 |
2630 | mario79 | 30 | ; last update: 19/04/2012 |
31 | ; changed by: Marat Zakiyanov aka Mario79, aka Mario |
||
32 | ; changes: Support PrintScreen for SCRSHOOT. |
||
33 | ; Path to run applications from the INI file. |
||
34 | ; Algorithm anti-duplication of applications for run with hotkey. |
||
35 | ; Added color selection for the Alt+Tab. |
||
36 | ; Alt+Ctrl+ArrowLeft - Page list next |
||
37 | ; Alt+Ctrl+ArrowRight - Page list previous |
||
38 | ;------------------------------------------------------------------------------ |
||
3670 | hidnplayr | 39 | ; version: 2.1 |
2626 | mario79 | 40 | ; last update: 18/04/2012 |
41 | ; changed by: Marat Zakiyanov aka Mario79, aka Mario |
||
42 | ; changes: Added color selection for the text. |
||
43 | ; Show "change page list" only if the applications |
||
44 | ; does not fit in the panel. |
||
45 | ; Display file names up to 11 char previously displ. only 8 char. |
||
46 | ;------------------------------------------------------------------------------ |
||
3670 | hidnplayr | 47 | ; version: 2.0 |
2619 | mario79 | 48 | ; last update: 17/04/2012 |
49 | ; changed by: Marat Zakiyanov aka Mario79, aka Mario |
||
50 | ; changes: New logic of switching windows (turnoff/restore) |
||
51 | ; New logic of button "clear desktop". |
||
52 | ; Win+D (restore/clear desktop), Win+R (start RUN application). |
||
53 | ; Using the library LibINI to set the parameters. |
||
54 | ; New style of panel. Start application Menu with boot options. |
||
55 | ; two versions of the location of the panel - |
||
56 | ; the bottom of the desktop and on top of the desktop. |
||
57 | ;------------------------------------------------------------------------------ |
||
2532 | mario79 | 58 | ; last update: 31/03/2012 |
59 | ; changed by: Marat Zakiyanov aka Mario79, aka Mario |
||
60 | ; changes: The program uses only 20 Kb memory is now. |
||
61 | ; Code optimizing and refactoring. |
||
62 | ;------------------------------------------------------------------------------ |
||
3670 | hidnplayr | 63 | format binary as "" |
64 | |||
3672 | hidnplayr | 65 | use32 |
66 | org 0x0 |
||
67 | db 'MENUET01' ; 8 byte id |
||
68 | dd 0x01 ; header version |
||
69 | dd START ; program start |
||
70 | dd IM_END ; program image size |
||
71 | dd I_END ; reguired amount of memory - 10 Kb |
||
72 | dd stack_top ; esp |
||
73 | dd 0x0 ; boot parameters |
||
74 | dd path ; application pach |
||
2619 | mario79 | 75 | ;------------------------------------------------------------------------------ |
31 | halyavin | 76 | include 'lang.inc' |
2619 | mario79 | 77 | include '../../../macros.inc' |
78 | include '../../../proc32.inc' |
||
3013 | dunkaist | 79 | ;include '../../../debug.inc' |
3672 | hidnplayr | 80 | include 'MOI.INC' ;раскладки клавиатуры |
2619 | mario79 | 81 | include '../../../develop/libraries/box_lib/load_lib.mac' |
3672 | hidnplayr | 82 | @use_library ;use load lib macros |
2619 | mario79 | 83 | ;------------------------------------------------------------------------------ |
84 | caps_lock_check fix 1 |
||
85 | ;------------------------------------------------------------------------------ |
||
1440 | diamond | 86 | time_bgr_color = 0x66cc |
2619 | mario79 | 87 | ;PANEL_HEIGHT = 18 |
88 | ML_SIZE = 10 |
||
89 | MR_SIZE = 10 |
||
90 | MENU_SIZE = 50 |
||
91 | CLD_SIZE = 20 |
||
3672 | hidnplayr | 92 | TAB_SIZE = 75 ;60 |
2619 | mario79 | 93 | TRAY_SIZE = 140 |
1440 | diamond | 94 | |
2619 | mario79 | 95 | CLOCK_SIZE = 40 |
96 | CPU_USAGE_SIZE = 10 |
||
97 | CHLANG_SIZE = 20 |
||
98 | PAGE_LIST_SIZE = 36 |
||
99 | ;------------------------------------------------------------------------------ |
||
2532 | mario79 | 100 | align 4 |
93 | diamond | 101 | handle_key: |
3672 | hidnplayr | 102 | mcall 18,7 |
103 | mov [active_process],eax |
||
31 | halyavin | 104 | |
3672 | hidnplayr | 105 | mcall 2 |
106 | |||
3670 | hidnplayr | 107 | ; dps "panel key: " |
108 | ; dph eax |
||
109 | ; newline |
||
2619 | mario79 | 110 | |
3672 | hidnplayr | 111 | cmp al, 2 |
112 | jnz begin_1.ret |
||
2532 | mario79 | 113 | |
3672 | hidnplayr | 114 | mov ebx, exec_fileinfo |
115 | shr eax, 8 |
||
116 | cmp al, 0 |
||
117 | je prod |
||
2532 | mario79 | 118 | |
3672 | hidnplayr | 119 | mov [key_r],al |
120 | sub [key_r],2 |
||
121 | cmp al, 2 |
||
122 | jz alter |
||
2532 | mario79 | 123 | |
3672 | hidnplayr | 124 | cmp al, 3 |
125 | jz alter |
||
2532 | mario79 | 126 | |
3672 | hidnplayr | 127 | cmp al, 4 |
128 | jz alter |
||
2532 | mario79 | 129 | |
3672 | hidnplayr | 130 | cmp al, 5 |
131 | jz alter |
||
2532 | mario79 | 132 | |
3672 | hidnplayr | 133 | cmp al, 6 |
134 | jz alter |
||
2532 | mario79 | 135 | |
3672 | hidnplayr | 136 | cmp al, 7 |
137 | jz alter |
||
2532 | mario79 | 138 | |
3672 | hidnplayr | 139 | cmp al, 8 |
140 | jz alter |
||
2532 | mario79 | 141 | ;-------------------------------------- |
2619 | mario79 | 142 | ;align 4 |
143 | ;prod: |
||
2532 | mario79 | 144 | if caps_lock_check |
3672 | hidnplayr | 145 | cmp al,58 ;CAPS LOCK DOWN |
146 | jne @f |
||
2532 | mario79 | 147 | |
3672 | hidnplayr | 148 | pusha |
149 | mcall 26,2,9 |
||
150 | mov ebx,eax |
||
151 | mov eax,2 |
||
3670 | hidnplayr | 152 | ; call draw_window ;;;??? |
3672 | hidnplayr | 153 | mov [draw_flag_certainly],1 |
154 | call draw_flag ; language |
||
155 | popa |
||
156 | ret |
||
2532 | mario79 | 157 | @@: |
158 | end if |
||
3672 | hidnplayr | 159 | cmp al, 15 ; Alt+Tab DOWN |
160 | jz alt_tab_pressed |
||
2532 | mario79 | 161 | |
3672 | hidnplayr | 162 | cmp al, 88 ; Ctrl+Alt+F12 |
163 | jz start_end_application |
||
2532 | mario79 | 164 | |
3672 | hidnplayr | 165 | |
166 | |||
167 | cmp al, 91 ; RWin DOWN |
||
168 | jz set_win_key_flag |
||
2532 | mario79 | 169 | |
3672 | hidnplayr | 170 | cmp al, 92 ; LWin DOWN |
171 | jz set_win_key_flag |
||
172 | |||
173 | |||
174 | cmp al, 219 ; RWin UP |
||
175 | jz cut_win_key_flag ;start_menu_application |
||
2532 | mario79 | 176 | |
3672 | hidnplayr | 177 | cmp al, 220 ; LWin UP |
178 | jz cut_win_key_flag ;start_menu_application |
||
179 | |||
2619 | mario79 | 180 | |
3672 | hidnplayr | 181 | cmp al, 62 ; Alt+F4 |
182 | jz kill_active_application |
||
2532 | mario79 | 183 | |
3672 | hidnplayr | 184 | cmp al, 205 |
185 | jz page_list_next |
||
2532 | mario79 | 186 | |
3672 | hidnplayr | 187 | cmp al, 203 |
188 | jz page_list_prev |
||
2532 | mario79 | 189 | |
3672 | hidnplayr | 190 | cmp al, 69 ; Alt+Shift+NumLock |
191 | jz start_mousemul_application |
||
192 | |||
193 | cmp al, 19 ; Win+R |
||
194 | jz start_run_application |
||
1920 | Albom | 195 | |
3672 | hidnplayr | 196 | cmp al, 32 ; Win+D |
197 | jz minimize_all_windows |
||
198 | |||
199 | cmp al, 55 ; PrintScreen DOWN |
||
200 | jz start_PrintScreen_application |
||
2619 | mario79 | 201 | ;-------------------------------------- |
202 | align 4 |
||
203 | prod: |
||
3670 | hidnplayr | 204 | ; cmp eax,0x20000 |
205 | ; je start_menu_application |
||
3672 | hidnplayr | 206 | |
3670 | hidnplayr | 207 | ; cmp eax,0x40000 |
208 | ; je start_menu_application |
||
2619 | mario79 | 209 | |
3672 | hidnplayr | 210 | cmp [current_alt_tab_app], -1 |
211 | jz @f |
||
2532 | mario79 | 212 | |
3672 | hidnplayr | 213 | test ah, 0x30 ; Alt+Tab UP |
214 | jz alt_tab_released |
||
2532 | mario79 | 215 | ;-------------------------------------- |
216 | align 4 |
||
443 | diamond | 217 | @@: |
304 | diamond | 218 | ; this is hotkey Ctrl+Shift ;or LShift+RShift |
3672 | hidnplayr | 219 | jmp karu |
3670 | hidnplayr | 220 | ; mov ebx, setup_exec |
221 | ; test ah, 001100b |
||
222 | ; jz change_sys_lang |
||
2619 | mario79 | 223 | ;------------------------------------------------------------------------------ |
2532 | mario79 | 224 | align 4 |
2619 | mario79 | 225 | set_win_key_flag: |
3672 | hidnplayr | 226 | mov [win_key_flag],1 |
227 | ret |
||
2619 | mario79 | 228 | ;------------------------------------------------------------------------------ |
229 | align 4 |
||
230 | cut_win_key_flag: |
||
3672 | hidnplayr | 231 | xor eax,eax |
232 | mov [win_key_flag],al |
||
233 | xchg [start_menu_flag],al |
||
234 | test al,al |
||
235 | jz start_menu_application |
||
236 | ret |
||
2619 | mario79 | 237 | ;------------------------------------------------------------------------------ |
238 | align 4 |
||
304 | diamond | 239 | change_key_lang: |
3672 | hidnplayr | 240 | mov dword [ebx+8], chlang |
241 | mcall 70 |
||
2532 | mario79 | 242 | ;-------------------------------------- |
243 | align 4 |
||
31 | halyavin | 244 | begin_1: |
3672 | hidnplayr | 245 | mov ecx,[active_process] |
246 | mcall 18, 3 |
||
247 | mcall 5, 25 |
||
2532 | mario79 | 248 | ;-------------------------------------- |
249 | align 4 |
||
93 | diamond | 250 | .ret: |
3672 | hidnplayr | 251 | ret |
2619 | mario79 | 252 | ;------------------------------------------------------------------------------ |
2532 | mario79 | 253 | ;align 4 |
304 | diamond | 254 | ;change_sys_lang: |
3670 | hidnplayr | 255 | ; mov dword [ebx+8], syslang |
304 | diamond | 256 | ; mcall 70 |
257 | ; jmp begin_1 |
||
2619 | mario79 | 258 | ;------------------------------------------------------------------------------ |
2532 | mario79 | 259 | align 4 |
260 | start_end_application: |
||
3672 | hidnplayr | 261 | mov esi,end_name |
262 | call algorithm_anti_duplication |
||
263 | test eax,eax |
||
264 | jz @f |
||
2638 | mario79 | 265 | |
3672 | hidnplayr | 266 | mcall 18,3,edi |
267 | ret |
||
2630 | mario79 | 268 | ;-------------------------------------- |
269 | align 4 |
||
270 | @@: |
||
3672 | hidnplayr | 271 | mov ebx, exec_fileinfo |
272 | mov dword [ebx+21],end_name |
||
273 | mcall 70 |
||
274 | ret |
||
2619 | mario79 | 275 | ;------------------------------------------------------------------------------ |
2532 | mario79 | 276 | align 4 |
277 | start_mousemul_application: |
||
3672 | hidnplayr | 278 | mov esi,mousemul_name |
279 | call algorithm_anti_duplication |
||
280 | test eax,eax |
||
281 | jz @f |
||
282 | ret |
||
2630 | mario79 | 283 | ;-------------------------------------- |
284 | align 4 |
||
285 | @@: |
||
3672 | hidnplayr | 286 | mov ebx, exec_fileinfo |
287 | mov dword [ebx+21],mousemul_name |
||
288 | mcall 70 |
||
289 | ret |
||
2619 | mario79 | 290 | ;------------------------------------------------------------------------------ |
2532 | mario79 | 291 | align 4 |
292 | kill_active_application: |
||
3672 | hidnplayr | 293 | mcall 72,1,3,1 |
294 | jmp begin_1.ret |
||
2619 | mario79 | 295 | ;------------------------------------------------------------------------------ |
296 | |||
2532 | mario79 | 297 | align 4 |
298 | start_menu_application: |
||
3672 | hidnplayr | 299 | call menu_handler |
300 | jmp begin_1.ret |
||
2619 | mario79 | 301 | ;------------------------------------------------------------------------------ |
302 | align 4 |
||
303 | start_run_application: |
||
3672 | hidnplayr | 304 | cmp [win_key_flag],1 |
305 | je @f |
||
306 | ret |
||
2626 | mario79 | 307 | ;-------------------------------------- |
308 | align 4 |
||
2619 | mario79 | 309 | @@: |
3672 | hidnplayr | 310 | mov [start_menu_flag],1 |
311 | |||
312 | mov esi,run_name |
||
313 | call algorithm_anti_duplication |
||
314 | test eax,eax |
||
315 | jz @f |
||
2638 | mario79 | 316 | |
3672 | hidnplayr | 317 | mcall 18,3,edi |
318 | ret |
||
2630 | mario79 | 319 | ;-------------------------------------- |
320 | align 4 |
||
321 | @@: |
||
3672 | hidnplayr | 322 | mov ebx, exec_fileinfo |
323 | mov dword [ebx+21], run_name |
||
324 | mcall 70 |
||
325 | jmp begin_1.ret |
||
2619 | mario79 | 326 | ;------------------------------------------------------------------------------ |
327 | align 4 |
||
2630 | mario79 | 328 | start_PrintScreen_application: |
3672 | hidnplayr | 329 | mov esi,printscreen_name |
330 | call algorithm_anti_duplication |
||
331 | test eax,eax |
||
332 | jz @f |
||
333 | mcall 18,3,edi |
||
334 | ret |
||
2630 | mario79 | 335 | ;-------------------------------------- |
336 | align 4 |
||
337 | @@: |
||
3672 | hidnplayr | 338 | mov ebx, exec_fileinfo |
339 | mov dword [ebx+21],printscreen_name |
||
340 | mov [ebx+8],dword bootparam_printscreen |
||
341 | mcall 70 |
||
342 | jmp begin_1.ret |
||
2630 | mario79 | 343 | ;------------------------------------------------------------------------------ |
344 | align 4 |
||
2619 | mario79 | 345 | minimize_all_windows: |
3672 | hidnplayr | 346 | cmp [win_key_flag],1 |
347 | je @f |
||
348 | ret |
||
2626 | mario79 | 349 | ;-------------------------------------- |
350 | align 4 |
||
2619 | mario79 | 351 | @@: |
3672 | hidnplayr | 352 | mov [start_menu_flag],1 |
353 | call clean_desktop |
||
354 | ret |
||
2619 | mario79 | 355 | ;------------------------------------------------------------------------------ |
2630 | mario79 | 356 | align 4 |
357 | algorithm_anti_duplication: |
||
3672 | hidnplayr | 358 | cld |
2630 | mario79 | 359 | ;-------------------------------------- |
360 | align 4 |
||
361 | @@: |
||
3672 | hidnplayr | 362 | lodsb |
363 | test al,al |
||
364 | jnz @r |
||
2630 | mario79 | 365 | ;-------------------------------------- |
366 | align 4 |
||
367 | @@: |
||
3672 | hidnplayr | 368 | std |
369 | lodsb |
||
370 | cmp al,'/' |
||
371 | jnz @r |
||
372 | add esi,2 |
||
373 | mov edx,esi |
||
374 | |||
375 | mov edi,1 |
||
2630 | mario79 | 376 | ;-------------------------------------- |
377 | align 4 |
||
378 | @@: |
||
3672 | hidnplayr | 379 | inc edi |
380 | mov ecx,edi |
||
381 | mcall 9,procinfo_window_tabs |
||
2630 | mario79 | 382 | |
3672 | hidnplayr | 383 | cmp edi,eax |
384 | jg .apply_changes |
||
2630 | mario79 | 385 | |
3670 | hidnplayr | 386 | ; mov eax,[ebx+10] |
387 | ; and eax,not 20202020h |
||
388 | ; cmp eax,'SCRS' |
||
389 | ; jz @f |
||
3672 | hidnplayr | 390 | |
3670 | hidnplayr | 391 | ; mov eax,[ebx+14] |
392 | ; and eax,not 20202020h |
||
393 | ; cmp eax,'HOOT' |
||
394 | ; jne @r |
||
3672 | hidnplayr | 395 | mov esi,edx |
396 | mov ecx,11 |
||
397 | add ebx,9 |
||
398 | cld |
||
2630 | mario79 | 399 | ;-------------------------------------- |
400 | align 4 |
||
401 | .loop: |
||
3672 | hidnplayr | 402 | lodsb |
403 | inc ebx |
||
404 | cmp al,[ebx] |
||
405 | jne @r |
||
2630 | mario79 | 406 | |
3672 | hidnplayr | 407 | loop .loop |
2630 | mario79 | 408 | |
3672 | hidnplayr | 409 | mov eax,1 |
410 | ret |
||
2630 | mario79 | 411 | ;-------------------------------------- |
412 | align 4 |
||
413 | .apply_changes: |
||
3672 | hidnplayr | 414 | xor eax,eax |
415 | ret |
||
2619 | mario79 | 416 | ;------------------------------------------------------------------------------ |
2630 | mario79 | 417 | align 4 |
418 | page_list_next: |
||
3672 | hidnplayr | 419 | cmp [page_list],50 |
420 | je @f |
||
2630 | mario79 | 421 | |
3672 | hidnplayr | 422 | xor eax,eax |
423 | cmp [page_list_enable],eax |
||
424 | je @f |
||
2630 | mario79 | 425 | |
3672 | hidnplayr | 426 | inc [page_list] |
427 | mov [redraw_window_flag],1 |
||
2630 | mario79 | 428 | ;-------------------------------------- |
429 | align 4 |
||
430 | @@: |
||
3672 | hidnplayr | 431 | jmp begin_1.ret |
2619 | mario79 | 432 | ;------------------------------------------------------------------------------ |
2532 | mario79 | 433 | align 4 |
2630 | mario79 | 434 | page_list_prev: |
3672 | hidnplayr | 435 | xor eax,eax |
436 | cmp [page_list],eax |
||
437 | je @f |
||
2630 | mario79 | 438 | |
3672 | hidnplayr | 439 | cmp [page_list_enable],eax |
440 | je @f |
||
2630 | mario79 | 441 | |
3672 | hidnplayr | 442 | dec [page_list] |
443 | mov [redraw_window_flag],1 |
||
2630 | mario79 | 444 | ;-------------------------------------- |
445 | align 4 |
||
446 | @@: |
||
3672 | hidnplayr | 447 | jmp begin_1.ret |
2630 | mario79 | 448 | ;------------------------------------------------------------------------------ |
449 | align 4 |
||
443 | diamond | 450 | alt_tab_pressed: |
451 | ; handle Alt+Tab and Alt+Shift+Tab |
||
3672 | hidnplayr | 452 | mov ebp, eax |
453 | cmp [current_alt_tab_app], -1 |
||
454 | jnz has_alt_tab_app |
||
443 | diamond | 455 | ; заполняем таблицу приложений, подлежащих переключению |
3672 | hidnplayr | 456 | xor edx, edx |
457 | mov ebx, procinfo_window_tabs |
||
458 | mov ecx, 1 |
||
2626 | mario79 | 459 | ;-------------------------------------- |
460 | align 4 |
||
443 | diamond | 461 | .fill: |
3672 | hidnplayr | 462 | inc ecx |
463 | mcall 9 |
||
464 | call need_window_tab |
||
465 | jz @f |
||
2532 | mario79 | 466 | |
3672 | hidnplayr | 467 | cmp edx, 256 |
468 | jz @f |
||
2532 | mario79 | 469 | |
3672 | hidnplayr | 470 | mov [alt_tab_list+edx*8], ecx |
471 | movzx esi, word [ebx+4] |
||
472 | mov [alt_tab_list+edx*8+4], esi |
||
473 | inc edx |
||
2532 | mario79 | 474 | ;-------------------------------------- |
475 | align 4 |
||
443 | diamond | 476 | @@: |
3672 | hidnplayr | 477 | cmp ecx,eax |
478 | jb .fill |
||
2532 | mario79 | 479 | |
3672 | hidnplayr | 480 | mov [alt_tab_list_size], edx |
481 | test edx, edx |
||
482 | jz begin_1.ret |
||
2532 | mario79 | 483 | |
3672 | hidnplayr | 484 | mcall 66,4,0,0 ; ловим момент отпускания всех управляющих клавиш |
485 | test eax, eax |
||
486 | jnz begin_1.ret |
||
2532 | mario79 | 487 | |
3672 | hidnplayr | 488 | xor edx, edx |
489 | mov eax, [alt_tab_list+4] |
||
490 | xor ecx, ecx |
||
491 | inc ecx |
||
2532 | mario79 | 492 | ;-------------------------------------- |
493 | align 4 |
||
443 | diamond | 494 | .findmax: |
3672 | hidnplayr | 495 | cmp [alt_tab_list+ecx*8+4], eax |
496 | jb @f |
||
2532 | mario79 | 497 | |
3672 | hidnplayr | 498 | mov edx, ecx |
499 | mov eax, [alt_tab_list+ecx*8+4] |
||
2532 | mario79 | 500 | ;-------------------------------------- |
501 | align 4 |
||
443 | diamond | 502 | @@: |
3672 | hidnplayr | 503 | inc ecx |
504 | cmp ecx, [alt_tab_list_size] |
||
505 | jb .findmax |
||
2532 | mario79 | 506 | |
3672 | hidnplayr | 507 | mov [current_alt_tab_app], edx |
2532 | mario79 | 508 | ;-------------------------------------- |
509 | align 4 |
||
443 | diamond | 510 | has_alt_tab_app: |
3672 | hidnplayr | 511 | mov eax, [current_alt_tab_app] |
512 | mov edx, [alt_tab_list+eax*8+4] ; slot |
||
513 | xor ecx, ecx |
||
514 | or eax, -1 |
||
515 | test ebp, 300h |
||
516 | jz .notshift |
||
2532 | mario79 | 517 | |
3672 | hidnplayr | 518 | or esi, -1 |
2532 | mario79 | 519 | ;-------------------------------------- |
520 | align 4 |
||
443 | diamond | 521 | .loop1: |
3672 | hidnplayr | 522 | cmp [alt_tab_list+ecx*8+4], edx |
523 | jbe @f |
||
2532 | mario79 | 524 | |
3672 | hidnplayr | 525 | cmp [alt_tab_list+ecx*8+4], esi |
526 | jae @f |
||
2532 | mario79 | 527 | |
3672 | hidnplayr | 528 | mov eax, ecx |
529 | mov esi, [alt_tab_list+ecx*8+4] |
||
2532 | mario79 | 530 | ;-------------------------------------- |
531 | align 4 |
||
443 | diamond | 532 | @@: |
3672 | hidnplayr | 533 | inc ecx |
534 | cmp ecx, [alt_tab_list_size] |
||
535 | jb .loop1 |
||
2532 | mario79 | 536 | |
3672 | hidnplayr | 537 | cmp eax, -1 |
538 | jnz .found |
||
2532 | mario79 | 539 | |
3672 | hidnplayr | 540 | xor edx, edx |
541 | xor ecx, ecx |
||
542 | jmp .loop1 |
||
2532 | mario79 | 543 | ;-------------------------------------- |
544 | align 4 |
||
443 | diamond | 545 | .notshift: |
3672 | hidnplayr | 546 | xor esi, esi |
2532 | mario79 | 547 | ;-------------------------------------- |
548 | align 4 |
||
443 | diamond | 549 | .loop2: |
3672 | hidnplayr | 550 | cmp [alt_tab_list+ecx*8+4], edx |
551 | jae @f |
||
2532 | mario79 | 552 | |
3672 | hidnplayr | 553 | cmp [alt_tab_list+ecx*8+4], esi |
554 | jbe @f |
||
2532 | mario79 | 555 | |
3672 | hidnplayr | 556 | mov eax, ecx |
557 | mov esi, [alt_tab_list+ecx*8+4] |
||
2532 | mario79 | 558 | ;-------------------------------------- |
559 | align 4 |
||
443 | diamond | 560 | @@: |
3672 | hidnplayr | 561 | inc ecx |
562 | cmp ecx, [alt_tab_list_size] |
||
563 | jb .loop2 |
||
2532 | mario79 | 564 | |
3672 | hidnplayr | 565 | cmp eax, -1 |
566 | jnz .found |
||
2532 | mario79 | 567 | |
3672 | hidnplayr | 568 | or edx, -1 |
569 | xor ecx, ecx |
||
570 | jmp .loop2 |
||
2532 | mario79 | 571 | ;-------------------------------------- |
572 | align 4 |
||
443 | diamond | 573 | .found: |
3672 | hidnplayr | 574 | mov [current_alt_tab_app], eax |
575 | push eax |
||
576 | xor edx, edx |
||
577 | div [max_applications] |
||
578 | mov [page_list], eax |
||
579 | mov edi, app_list |
||
580 | push edi |
||
581 | mov ecx, 20 |
||
582 | or eax, -1 |
||
583 | rep stosd |
||
584 | pop edi |
||
585 | pop ecx |
||
586 | sub ecx, edx |
||
2532 | mario79 | 587 | ;-------------------------------------- |
588 | align 4 |
||
443 | diamond | 589 | @@: |
3672 | hidnplayr | 590 | cmp ecx, [alt_tab_list_size] |
591 | jae redraw_window_tabs |
||
2532 | mario79 | 592 | |
3672 | hidnplayr | 593 | mov eax, [alt_tab_list+ecx*8] |
594 | stosd |
||
595 | inc ecx |
||
596 | jmp @b |
||
2532 | mario79 | 597 | ;-------------------------------------- |
598 | align 4 |
||
443 | diamond | 599 | alt_tab_released: |
3672 | hidnplayr | 600 | mcall 66,5,0,0 ; уже поймали, хватит :) |
2619 | mario79 | 601 | |
3672 | hidnplayr | 602 | or eax, -1 |
603 | xchg eax, [current_alt_tab_app] |
||
604 | mov ecx, [alt_tab_list+eax*8] |
||
605 | mcall 18,3 |
||
2619 | mario79 | 606 | |
3672 | hidnplayr | 607 | jmp redraw_window_tabs |
2619 | mario79 | 608 | ;------------------------------------------------------------------------------ |
2532 | mario79 | 609 | align 4 |
3672 | hidnplayr | 610 | active_process dd 0 |
31 | halyavin | 611 | |
2619 | mario79 | 612 | exit: |
3672 | hidnplayr | 613 | mcall -1 |
2619 | mario79 | 614 | ;------------------------------------------------------------------------------ |
615 | START: |
||
3672 | hidnplayr | 616 | mcall 68,11 |
617 | mcall 66,1,1 |
||
618 | |||
619 | mcall 9,process_info_buffer,-1 |
||
620 | mov ecx,[ebx+30] ; PID |
||
621 | mcall 18,21 |
||
622 | mov [my_active_slot],eax ; WINDOW SLOT |
||
623 | |||
624 | |||
2619 | mario79 | 625 | load_libraries l_libs_start,end_l_libs |
31 | halyavin | 626 | |
3672 | hidnplayr | 627 | test eax,eax |
628 | jnz exit |
||
31 | halyavin | 629 | |
3672 | hidnplayr | 630 | call Get_ini |
2619 | mario79 | 631 | |
3672 | hidnplayr | 632 | mcall 48,1,[button_style] |
633 | |||
634 | mcall 66,4,0,2 ; LShift+RShift |
||
635 | mcall 66,,,11h ; Ctrl+Shift |
||
636 | mcall 66,,88,110h ; Alt+Ctrl+F12 |
||
3670 | hidnplayr | 637 | ; mcall 66,,75 ; Alt+Ctrl+ArrowLeft DOWN |
3672 | hidnplayr | 638 | mcall 66,,203 ; Alt+Ctrl+ArrowLeft UP |
3670 | hidnplayr | 639 | ; mcall 66,,77 ; Alt+Ctrl+ArrowRight DOWN |
3672 | hidnplayr | 640 | mcall 66,,205 ; Alt+Ctrl+ArrowRight UP |
641 | |||
642 | mcall 66,,91,0h ; RWin DOWN |
||
643 | mcall 66,,92 ; LWin DOWN |
||
644 | mcall 66,,219 ; RWin UP |
||
645 | mcall 66,,220 ; LWin UP |
||
2619 | mario79 | 646 | |
3670 | hidnplayr | 647 | ; mcall 66,,147,0h ; Win+R UP |
3672 | hidnplayr | 648 | mcall 66,,19,0h ; Win+R DOWN |
2619 | mario79 | 649 | |
3670 | hidnplayr | 650 | ; mcall 66,,23,0h ; Win+I DOWN |
2619 | mario79 | 651 | |
3672 | hidnplayr | 652 | mcall 66,,32,0h ; Win+D DOWN |
3670 | hidnplayr | 653 | ; mcall 66,,160,0h ; Win+D UP |
2619 | mario79 | 654 | |
3713 | mario79 | 655 | mcall 66,,55,10h ; Ctrl+PrintScreen DOWN |
656 | ; mcall 66,,183,10h ; Ctrl+PrintScreen UP |
||
2619 | mario79 | 657 | |
2630 | mario79 | 658 | |
3670 | hidnplayr | 659 | ; mcall 66,,91,100h ; Alt+LWin |
660 | ; mcall 66,,92 ; Alt+RWin |
||
3672 | hidnplayr | 661 | mcall 66,,62,300h ; Alt+F4 |
3670 | hidnplayr | 662 | ; mcall 66,,71 ; Alt+Home |
663 | ; mcall 66,,72 ; Alt+Up |
||
3672 | hidnplayr | 664 | mcall 66,,2 ; Alt+1 |
665 | mcall 66,,3 ; Alt+2 |
||
666 | mcall 66,,4 ; Alt+3 |
||
667 | mcall 66,,5 ; Alt+4 |
||
668 | mcall 66,,6 ; Alt+5 |
||
669 | mcall 66,,7 ; Alt+6 |
||
670 | mcall 66,,8 ; Alt+7 |
||
671 | mcall 66,,15 ; Alt+Tab DOWN |
||
672 | mcall 66,,15,301h ; Alt+Shift+Tab DOWN |
||
673 | mcall 66,,69 ; Alt+Shift+NumLock |
||
870 | barsuk | 674 | |
2532 | mario79 | 675 | if caps_lock_check |
3672 | hidnplayr | 676 | xor edx,edx |
677 | mcall 66,4,58 |
||
2532 | mario79 | 678 | end if |
3672 | hidnplayr | 679 | mcall 14 |
680 | mov [screen_size],eax |
||
31 | halyavin | 681 | |
3823 | mario79 | 682 | call set_work_ares_pf_screen |
51 | mikedld | 683 | |
3672 | hidnplayr | 684 | mcall 9,process_info_buffer,-1 |
685 | mov ecx,[process_info_buffer+30] |
||
686 | mcall 18,21 |
||
687 | mov [this_slot],eax |
||
688 | mov [max_slot],255 |
||
2532 | mario79 | 689 | ;-------------------------------------- |
690 | align 4 |
||
31 | halyavin | 691 | start_after_minimize: |
3672 | hidnplayr | 692 | call draw_window |
3670 | hidnplayr | 693 | ; call draw_tray |
3672 | hidnplayr | 694 | call draw_running_applications |
31 | halyavin | 695 | |
3672 | hidnplayr | 696 | mcall 23,30 |
697 | call load_ini |
||
698 | call fir_lng |
||
2532 | mario79 | 699 | ;------------------------------------------------------------------------------ |
700 | align 4 |
||
31 | halyavin | 701 | still: |
3670 | hidnplayr | 702 | ; call draw_tray |
3672 | hidnplayr | 703 | call draw_time |
704 | call draw_cpu_usage |
||
705 | call draw_running_applications |
||
31 | halyavin | 706 | |
3672 | hidnplayr | 707 | mcall 18,7 ; check if active window changed |
708 | cmp eax, [last_active_window] |
||
709 | jz @f |
||
870 | barsuk | 710 | ; need_window_tab: |
711 | ; in: ebx->process info |
||
712 | ; out: ZF set <=> do not draw |
||
3672 | hidnplayr | 713 | mov ebx,[last_active_window] |
714 | mov [prev_active_window], ebx |
||
715 | mov [last_active_window], eax |
||
870 | barsuk | 716 | |
3672 | hidnplayr | 717 | mov ecx, eax |
718 | mcall 9,process_info_buffer |
||
870 | barsuk | 719 | |
3672 | hidnplayr | 720 | call need_window_tab |
721 | jnz .need_repaint |
||
870 | barsuk | 722 | |
3672 | hidnplayr | 723 | mcall 9,process_info_buffer,[prev_active_window] |
724 | call need_window_tab |
||
725 | jz @f |
||
2532 | mario79 | 726 | ;-------------------------------------- |
727 | align 4 |
||
870 | barsuk | 728 | .need_repaint: |
3672 | hidnplayr | 729 | mov dword [active_window_changed], 1 |
2532 | mario79 | 730 | ;-------------------------------------- |
731 | align 4 |
||
870 | barsuk | 732 | @@: |
3672 | hidnplayr | 733 | mcall 23,20 |
734 | |||
735 | push eax |
||
736 | mcall 18,7 |
||
737 | cmp [my_active_slot],eax |
||
738 | je @f |
||
2630 | mario79 | 739 | |
3672 | hidnplayr | 740 | mov [current_active_slot],eax |
2630 | mario79 | 741 | ;-------------------------------------- |
742 | align 4 |
||
2619 | mario79 | 743 | @@: |
3672 | hidnplayr | 744 | pop eax |
745 | |||
746 | cmp eax,1 ; redraw ? |
||
747 | jz red |
||
870 | barsuk | 748 | |
3672 | hidnplayr | 749 | push eax |
750 | mov eax,[redraw_window_flag] |
||
751 | test eax,eax |
||
752 | jz @f |
||
2630 | mario79 | 753 | |
3672 | hidnplayr | 754 | call draw_window |
2630 | mario79 | 755 | ;-------------------------------------- |
756 | align 4 |
||
2626 | mario79 | 757 | @@: |
3672 | hidnplayr | 758 | pop eax |
759 | |||
760 | cmp eax,2 |
||
761 | jnz @f |
||
762 | call handle_key |
||
763 | jmp .key |
||
2630 | mario79 | 764 | ;-------------------------------------- |
765 | align 4 |
||
2619 | mario79 | 766 | @@: |
3672 | hidnplayr | 767 | cmp eax,3 ; button ? |
768 | jz button |
||
31 | halyavin | 769 | |
3670 | hidnplayr | 770 | ; call handle_key |
2630 | mario79 | 771 | ;-------------------------------------- |
772 | align 4 |
||
2619 | mario79 | 773 | .key: |
3672 | hidnplayr | 774 | cmp dword [active_window_changed], 0 |
775 | jnz red_active |
||
870 | barsuk | 776 | |
3672 | hidnplayr | 777 | call draw_flag ; language |
778 | jmp still |
||
2619 | mario79 | 779 | ;------------------------------------------------------------------------------ |
2532 | mario79 | 780 | align 4 |
3823 | mario79 | 781 | set_work_ares_pf_screen: |
782 | ;eax = [xsize]*65536 + [ysize] |
||
783 | mov ecx,eax |
||
784 | shr ecx,16 |
||
785 | and eax,0xFFFF |
||
786 | cmp [place_attachment],1 |
||
787 | je @f |
||
788 | |||
789 | ror eax,16 |
||
790 | add eax,[height] |
||
791 | rol eax,16 |
||
792 | mov edx,eax |
||
793 | jmp .selected |
||
794 | ;-------------------------------------- |
||
795 | align 4 |
||
796 | @@: |
||
797 | sub eax,[height] |
||
798 | mov edx, eax |
||
799 | ;-------------------------------------- |
||
800 | align 4 |
||
801 | .selected: |
||
802 | mcall 48,6 |
||
803 | ret |
||
804 | ;------------------------------------------------------------------------------ |
||
805 | align 4 |
||
2532 | mario79 | 806 | red_active: |
807 | red: |
||
3672 | hidnplayr | 808 | mov dword [active_window_changed], 0 |
870 | barsuk | 809 | |
3672 | hidnplayr | 810 | mcall 14 |
811 | movzx ecx,ax |
||
812 | mov edx,eax |
||
813 | shr edx,16 |
||
814 | cmp [screen_size.height],ax |
||
815 | jne @f |
||
2532 | mario79 | 816 | |
3672 | hidnplayr | 817 | rol eax,16 |
818 | cmp [screen_size.width],ax |
||
819 | je .lp1 |
||
2630 | mario79 | 820 | |
3672 | hidnplayr | 821 | rol eax,16 |
2630 | mario79 | 822 | ;-------------------------------------- |
823 | align 4 |
||
2532 | mario79 | 824 | @@: |
3672 | hidnplayr | 825 | mov [screen_size],eax |
3823 | mario79 | 826 | |
827 | push ecx edx |
||
828 | call set_work_ares_pf_screen |
||
829 | pop edx ecx |
||
830 | |||
3672 | hidnplayr | 831 | sub ecx,[height] |
832 | mcall 67,0,,,[height] |
||
2532 | mario79 | 833 | ;-------------------------------------- |
834 | align 4 |
||
835 | .lp1: |
||
3672 | hidnplayr | 836 | call draw_window |
3670 | hidnplayr | 837 | ; call draw_tray |
3672 | hidnplayr | 838 | jmp still |
2619 | mario79 | 839 | ;------------------------------------------------------------------------------ |
2532 | mario79 | 840 | align 4 |
841 | button: |
||
3672 | hidnplayr | 842 | mcall 17 |
843 | test eax,0xfffffe00 ; is it close button? (signal from @panel) |
||
844 | jz still ; if so - wait for another event, because @panel shouldn't be closed |
||
51 | mikedld | 845 | |
3672 | hidnplayr | 846 | cmp al, 0 |
847 | jnz right_mouse |
||
870 | barsuk | 848 | |
3672 | hidnplayr | 849 | cmp ah,50 |
850 | jb no_activate |
||
851 | cmp ah,70 |
||
852 | jg no_activate |
||
31 | halyavin | 853 | |
3672 | hidnplayr | 854 | movzx ecx,byte ah |
855 | sub ecx,52 |
||
856 | shl ecx,2 |
||
870 | barsuk | 857 | |
3672 | hidnplayr | 858 | mov ecx,[app_list+ecx] |
859 | |||
860 | mcall 9,process_info_buffer |
||
2619 | mario79 | 861 | |
3672 | hidnplayr | 862 | test [ebx+70],dword 10b ; window is minimized to panel |
863 | jnz @f |
||
2619 | mario79 | 864 | |
3672 | hidnplayr | 865 | cmp ecx,[current_active_slot] |
866 | je .turn_off |
||
2630 | mario79 | 867 | ;-------------------------------------- |
868 | align 4 |
||
2619 | mario79 | 869 | @@: |
3672 | hidnplayr | 870 | mcall 18,3, |
871 | jmp .task_switching |
||
2619 | mario79 | 872 | ;-------------------------------------- |
2532 | mario79 | 873 | align 4 |
2619 | mario79 | 874 | .turn_off: |
3672 | hidnplayr | 875 | mov edx,ecx |
876 | mcall 18,22,0 |
||
2630 | mario79 | 877 | ;-------------------------------------- |
878 | align 4 |
||
2619 | mario79 | 879 | .task_switching: |
3672 | hidnplayr | 880 | mcall 68,1 |
881 | jmp still |
||
2619 | mario79 | 882 | ;------------------------------------------------------------------------------ |
883 | align 4 |
||
2532 | mario79 | 884 | right_mouse: |
3672 | hidnplayr | 885 | cmp ah,50 |
886 | jb still |
||
31 | halyavin | 887 | |
3672 | hidnplayr | 888 | cmp ah,70 |
889 | jg still |
||
870 | barsuk | 890 | |
3672 | hidnplayr | 891 | movzx ecx,byte ah |
892 | sub ecx,52 |
||
870 | barsuk | 893 | |
3672 | hidnplayr | 894 | cmp ecx, [app_tab_count] |
895 | jge still |
||
870 | barsuk | 896 | |
3672 | hidnplayr | 897 | shl ecx,2 |
898 | mcall 37,0 |
||
899 | mov ebx, eax |
||
900 | shr eax, 16 |
||
901 | mov [x_coord], ax |
||
902 | and ebx, 0xFFFF |
||
903 | mov [y_coord], bx |
||
870 | barsuk | 904 | |
3672 | hidnplayr | 905 | mov ecx,[app_list+ecx] ; ecx->selected app.slot |
906 | mov [n_slot], ecx |
||
907 | mcall 9,procinfo_for_detect |
||
870 | barsuk | 908 | |
3672 | hidnplayr | 909 | mcall 51,1,context_menu_start,ctx_menu_stack |
870 | barsuk | 910 | |
3672 | hidnplayr | 911 | mov [ctx_menu_PID], eax |
912 | jmp still |
||
2619 | mario79 | 913 | ;------------------------------------------------------------------------------ |
2532 | mario79 | 914 | align 4 |
915 | no_activate: |
||
3672 | hidnplayr | 916 | cmp ah,101 ; minimize to left |
917 | je left_button |
||
870 | barsuk | 918 | |
3672 | hidnplayr | 919 | cmp ah,102 ; minimize to right |
920 | je right_button |
||
870 | barsuk | 921 | |
3672 | hidnplayr | 922 | cmp ah, 103 |
923 | je clean_desktop_1 ; minimize all windows |
||
870 | barsuk | 924 | |
3670 | hidnplayr | 925 | ; cmp ah, 104 |
926 | ; je restore_desktop ; restore minimized windows |
||
31 | halyavin | 927 | |
3670 | hidnplayr | 928 | ; cmp ah, 105 |
929 | ; je swap_minimized_desktop ; minimize normal windows, and restore minimized windows |
||
31 | halyavin | 930 | |
3672 | hidnplayr | 931 | cmp ah,byte 1 ; start/terminate menu |
932 | jnz noselect |
||
31 | halyavin | 933 | |
3672 | hidnplayr | 934 | call menu_handler |
31 | halyavin | 935 | |
3672 | hidnplayr | 936 | jmp still |
2532 | mario79 | 937 | ;-------------------------------------- |
2619 | mario79 | 938 | align 4 |
939 | clean_desktop_1: |
||
3672 | hidnplayr | 940 | call clean_desktop |
941 | jmp still |
||
2619 | mario79 | 942 | ;-------------------------------------- |
3670 | hidnplayr | 943 | align 4 |
2532 | mario79 | 944 | noselect: |
3672 | hidnplayr | 945 | mov ebx, exec_fileinfo |
946 | cmp ah,byte 2 ; start calendar |
||
947 | jnz noid15 ;noclock |
||
633 | diamond | 948 | |
3672 | hidnplayr | 949 | mov esi,calendar_name |
950 | call algorithm_anti_duplication |
||
951 | test eax,eax |
||
952 | jz @f |
||
2630 | mario79 | 953 | |
3902 | leency | 954 | mcall 18,2,edi |
3672 | hidnplayr | 955 | jmp still |
2638 | mario79 | 956 | ;-------------------------------------- |
957 | align 4 |
||
958 | @@: |
||
3672 | hidnplayr | 959 | mov ebx, exec_fileinfo |
960 | mov dword [ebx+21], calendar_name |
||
961 | mcall 70 |
||
962 | jmp still |
||
2532 | mario79 | 963 | ;-------------------------------------- |
3670 | hidnplayr | 964 | align 4 |
2532 | mario79 | 965 | noid15: |
3672 | hidnplayr | 966 | cmp ah,16 |
967 | jne noid16 |
||
31 | halyavin | 968 | |
3670 | hidnplayr | 969 | ; mov ebx, setup_exec |
970 | ; mov dword [ebx+8], chlang |
||
971 | ; mcall 70 |
||
3672 | hidnplayr | 972 | call karu |
973 | call draw_flag ; language |
||
974 | jmp still |
||
2532 | mario79 | 975 | ;-------------------------------------- |
3670 | hidnplayr | 976 | align 4 |
2532 | mario79 | 977 | noid16: |
3670 | hidnplayr | 978 | ; cmp ah,17 |
979 | ; jne noid17 |
||
304 | diamond | 980 | ; |
3670 | hidnplayr | 981 | ; mov ebx, setup_exec |
982 | ; mov dword [ebx+8], syslang |
||
983 | ; mcall 70 |
||
984 | ; jmp still |
||
2532 | mario79 | 985 | ;-------------------------------------- |
3670 | hidnplayr | 986 | ;align 4 |
304 | diamond | 987 | ; noid17: |
3672 | hidnplayr | 988 | cmp ah,18 |
989 | jne noid18 |
||
2532 | mario79 | 990 | |
3672 | hidnplayr | 991 | mov esi,sysmeter_name |
992 | call algorithm_anti_duplication |
||
993 | test eax,eax |
||
994 | jz @f |
||
2630 | mario79 | 995 | |
3672 | hidnplayr | 996 | mcall 18,3,edi |
997 | jmp still |
||
2638 | mario79 | 998 | ;-------------------------------------- |
3670 | hidnplayr | 999 | align 4 |
2638 | mario79 | 1000 | @@: |
3672 | hidnplayr | 1001 | mov ebx, exec_fileinfo |
1002 | mov dword [ebx+21], sysmeter_name |
||
1003 | mcall 70 |
||
1004 | jmp still |
||
2532 | mario79 | 1005 | ;-------------------------------------- |
3670 | hidnplayr | 1006 | align 4 |
2532 | mario79 | 1007 | noid18: |
3670 | hidnplayr | 1008 | ; cmp ah,19 ; speaker |
1009 | ; jne noid19 |
||
31 | halyavin | 1010 | |
3670 | hidnplayr | 1011 | ; mcall 18,8,2 |
1012 | ; mcall 15,3 |
||
1013 | ; jmp red |
||
2532 | mario79 | 1014 | ;-------------------------------------- |
3670 | hidnplayr | 1015 | ;align 4 |
2619 | mario79 | 1016 | ;noid19: |
3670 | hidnplayr | 1017 | ; cmp ah,20 ; start system setup |
1018 | ; jnz noid20 |
||
2619 | mario79 | 1019 | ; |
3670 | hidnplayr | 1020 | ; mov ebx, setup_exec |
1021 | ; and dword [ebx+8], 0 |
||
1022 | ; mcall 70 |
||
1023 | ; jmp still |
||
2532 | mario79 | 1024 | ;-------------------------------------- |
3670 | hidnplayr | 1025 | ;align 4 |
2619 | mario79 | 1026 | ;noid20: |
3672 | hidnplayr | 1027 | cmp ah,21 |
1028 | jnz noid21 |
||
31 | halyavin | 1029 | |
3672 | hidnplayr | 1030 | cmp [page_list],50 |
1031 | jnc still |
||
1032 | inc [page_list] |
||
1033 | jmp red |
||
2532 | mario79 | 1034 | ;-------------------------------------- |
3670 | hidnplayr | 1035 | align 4 |
2532 | mario79 | 1036 | noid21: |
3672 | hidnplayr | 1037 | cmp ah,22 |
1038 | jnz still |
||
31 | halyavin | 1039 | |
3672 | hidnplayr | 1040 | cmp [page_list],0 |
1041 | je still |
||
31 | halyavin | 1042 | |
3672 | hidnplayr | 1043 | dec [page_list] |
1044 | jmp red |
||
2619 | mario79 | 1045 | ;------------------------------------------------------------------------------ |
2532 | mario79 | 1046 | align 4 |
633 | diamond | 1047 | restore_desktop: |
3672 | hidnplayr | 1048 | mcall 9,process_info_buffer,-1 |
1049 | mov [max_slot], eax |
||
1050 | mov ecx, 2 |
||
1051 | mov edx, 2 |
||
2532 | mario79 | 1052 | ;-------------------------------------- |
3670 | hidnplayr | 1053 | align 4 |
633 | diamond | 1054 | @@: |
3672 | hidnplayr | 1055 | mcall 18, 22 |
1056 | inc edx |
||
1057 | cmp edx, [max_slot] |
||
1058 | jbe @b |
||
1059 | ret |
||
2619 | mario79 | 1060 | ;------------------------------------------------------------------------------ |
2532 | mario79 | 1061 | align 4 |
633 | diamond | 1062 | clean_desktop: |
3672 | hidnplayr | 1063 | mcall 18,23 |
1064 | test eax,eax |
||
1065 | jnz @f |
||
1066 | call restore_desktop |
||
2630 | mario79 | 1067 | ;-------------------------------------- |
1068 | align 4 |
||
443 | diamond | 1069 | @@: |
3672 | hidnplayr | 1070 | ret |
2619 | mario79 | 1071 | ;------------------------------------------------------------------------------ |
2532 | mario79 | 1072 | align 4 |
2619 | mario79 | 1073 | conversion_HEX_to_ASCII: |
3672 | hidnplayr | 1074 | ror eax,12 |
1075 | mov ecx,4 |
||
2532 | mario79 | 1076 | ;-------------------------------------- |
1077 | align 4 |
||
443 | diamond | 1078 | .loop: |
3672 | hidnplayr | 1079 | mov bl,al |
1080 | rol eax,4 |
||
1081 | and bl,0xf |
||
1082 | cmp bl,0xA ; check for ABCDEF |
||
1083 | jae @f |
||
31 | halyavin | 1084 | |
3672 | hidnplayr | 1085 | add bl,0x30 ; 0-9 |
1086 | jmp .store |
||
2532 | mario79 | 1087 | ;-------------------------------------- |
1088 | align 4 |
||
443 | diamond | 1089 | @@: |
3672 | hidnplayr | 1090 | add bl,0x57 ; A-F |
2532 | mario79 | 1091 | ;-------------------------------------- |
1092 | align 4 |
||
2619 | mario79 | 1093 | .store: |
3670 | hidnplayr | 1094 | ; dps "param_store: " |
3672 | hidnplayr | 1095 | mov [edi],bl |
1096 | inc edi |
||
1097 | dec ecx |
||
1098 | jnz .loop |
||
1099 | ret |
||
2619 | mario79 | 1100 | ;------------------------------------------------------------------------------ |
2532 | mario79 | 1101 | align 4 |
2619 | mario79 | 1102 | menu_handler: |
3672 | hidnplayr | 1103 | mov edi,bootparam |
1104 | |||
1105 | mov eax,[menu_button_x.start] |
||
1106 | call conversion_HEX_to_ASCII |
||
31 | halyavin | 1107 | |
3672 | hidnplayr | 1108 | mov eax,[menu_button_x.size] |
1109 | call conversion_HEX_to_ASCII |
||
1110 | |||
1111 | mov eax,[menu_button_y.start] |
||
1112 | call conversion_HEX_to_ASCII |
||
1113 | |||
1114 | mov eax,[menu_button_y.size] |
||
1115 | call conversion_HEX_to_ASCII |
||
1116 | |||
1117 | mov eax,[height] |
||
1118 | call conversion_HEX_to_ASCII |
||
1119 | |||
1120 | mov eax,[place_attachment] |
||
1121 | call conversion_HEX_to_ASCII |
||
1122 | |||
1123 | xor eax,eax ; terminator for boot parameters string |
||
1124 | stosd |
||
1125 | |||
1126 | mov ebx, exec_fileinfo |
||
1127 | mov [ebx+21],dword menu_name |
||
1128 | mov [ebx+8],dword bootparam |
||
1129 | mcall 70 |
||
1130 | mov [ebx+8],dword 0 |
||
1131 | ret |
||
2619 | mario79 | 1132 | ;------------------------------------------------------------------------------ |
2532 | mario79 | 1133 | align 4 |
31 | halyavin | 1134 | draw_small_right: |
3672 | hidnplayr | 1135 | pusha |
1136 | mcall 12,1 |
||
31 | halyavin | 1137 | |
3672 | hidnplayr | 1138 | xor eax,eax |
1139 | mov edx,[wcolor] |
||
1140 | mov esi,edx |
||
1141 | mov edi,edx |
||
1142 | or edx, 0x01000000 |
||
1143 | mcall |
||
31 | halyavin | 1144 | |
3672 | hidnplayr | 1145 | xor ecx,ecx |
1146 | mov cx,[height] |
||
1147 | mcall 8,<0,10>,,1,[wcolor] |
||
31 | halyavin | 1148 | |
3672 | hidnplayr | 1149 | mov ebx,2*65536 ;+6 |
1150 | mov bx,[height] |
||
1151 | shr bx,1 |
||
1152 | sub bx,3 |
||
3670 | hidnplayr | 1153 | ; mov ecx,[wcolor] |
1154 | ; add ecx,0x303030 |
||
3672 | hidnplayr | 1155 | mov edx,[wcolor] |
1156 | mov eax,COLOR_CHANGE_MAGNITUDE_2 |
||
1157 | call add_color_change_magnitude |
||
1158 | mov ecx,edx |
||
1159 | mcall 4,,,hidetext,1 |
||
31 | halyavin | 1160 | |
3672 | hidnplayr | 1161 | mcall 12,2 |
1162 | popa |
||
1163 | ret |
||
2619 | mario79 | 1164 | ;------------------------------------------------------------------------------ |
2532 | mario79 | 1165 | align 4 |
31 | halyavin | 1166 | draw_small_left: |
3672 | hidnplayr | 1167 | pusha |
1168 | mcall 12,1 |
||
31 | halyavin | 1169 | |
3672 | hidnplayr | 1170 | xor eax,eax |
1171 | mov edx,[wcolor] |
||
1172 | mov esi,edx |
||
1173 | mov edi,edx |
||
1174 | or edx, 0x01000000 |
||
1175 | mcall |
||
31 | halyavin | 1176 | |
3672 | hidnplayr | 1177 | xor ecx,ecx |
1178 | mov cx,[height] |
||
1179 | mcall 8,<0,9>,,1,[wcolor] |
||
31 | halyavin | 1180 | |
3672 | hidnplayr | 1181 | mov ebx,3*65536 ;+6 |
1182 | mov bx,[height] |
||
1183 | shr bx,1 |
||
1184 | sub bx,3 |
||
3670 | hidnplayr | 1185 | ; mov ecx,[wcolor] |
1186 | ; add ecx,0x303030 |
||
3672 | hidnplayr | 1187 | mov edx,[wcolor] |
1188 | mov eax,COLOR_CHANGE_MAGNITUDE_2 |
||
1189 | call add_color_change_magnitude |
||
1190 | mov ecx,edx |
||
1191 | mcall 4,,,hidetext+1,1 |
||
31 | halyavin | 1192 | |
3672 | hidnplayr | 1193 | mcall 12,2 |
1194 | popa |
||
1195 | ret |
||
2619 | mario79 | 1196 | ;------------------------------------------------------------------------------ |
2532 | mario79 | 1197 | align 4 |
31 | halyavin | 1198 | right_button: |
3672 | hidnplayr | 1199 | mov [small_draw],dword draw_small_right |
31 | halyavin | 1200 | |
3672 | hidnplayr | 1201 | mcall 14 |
31 | halyavin | 1202 | |
3672 | hidnplayr | 1203 | shr eax, 16 |
1204 | mov ebx, eax |
||
1205 | mov ecx, -1 |
||
1206 | mov edx, 9 |
||
1207 | sub ebx, edx |
||
1208 | mov esi, -1 |
||
1209 | mcall 67 |
||
31 | halyavin | 1210 | |
3672 | hidnplayr | 1211 | call draw_small_right |
1212 | jmp small_wait |
||
2619 | mario79 | 1213 | ;------------------------------------------------------------------------------ |
2532 | mario79 | 1214 | align 4 |
31 | halyavin | 1215 | left_button: |
3672 | hidnplayr | 1216 | mov [small_draw],dword draw_small_left |
31 | halyavin | 1217 | |
3672 | hidnplayr | 1218 | xor ebx,ebx |
1219 | mcall 67,,-1,9,-1 |
||
31 | halyavin | 1220 | |
3672 | hidnplayr | 1221 | call draw_small_left |
2532 | mario79 | 1222 | ;-------------------------------------- |
1223 | align 4 |
||
1224 | small_wait: |
||
3672 | hidnplayr | 1225 | mcall 10 |
1226 | cmp eax,1 |
||
1227 | jne no_win |
||
31 | halyavin | 1228 | |
3672 | hidnplayr | 1229 | call [small_draw] |
1230 | jmp small_wait |
||
2532 | mario79 | 1231 | ;-------------------------------------- |
1232 | align 4 |
||
1233 | no_win: |
||
3672 | hidnplayr | 1234 | cmp eax,2 |
1235 | jne no_key |
||
31 | halyavin | 1236 | |
3672 | hidnplayr | 1237 | call handle_key |
1238 | jmp small_wait |
||
2532 | mario79 | 1239 | ;-------------------------------------- |
1240 | align 4 |
||
93 | diamond | 1241 | no_key: |
3672 | hidnplayr | 1242 | mcall 17 |
1243 | cmp ah,1 |
||
1244 | jne no_full |
||
31 | halyavin | 1245 | |
3672 | hidnplayr | 1246 | mcall 14 ; get screen max x & max y |
31 | halyavin | 1247 | |
3672 | hidnplayr | 1248 | mov edx, eax |
1249 | shr edx, 16 |
||
1250 | xor ebx, ebx |
||
1251 | mcall 67,,-1,,-1 ; x0 y0 xs ys |
||
31 | halyavin | 1252 | |
3672 | hidnplayr | 1253 | jmp still |
2532 | mario79 | 1254 | ;-------------------------------------- |
1255 | align 4 |
||
1256 | no_full: |
||
3672 | hidnplayr | 1257 | call menu_handler |
1258 | jmp small_wait |
||
2619 | mario79 | 1259 | ;------------------------------------------------------------------------------ |
1260 | include 'libini.inc' |
||
1261 | ;------------------------------------------------------------------------------ |
||
3014 | dunkaist | 1262 | include '../../../dll.inc' |
2619 | mario79 | 1263 | ;------------------------------------------------------------------------------ |
1264 | include 'drawappl.inc' |
||
1265 | ;------------------------------------------------------------------------------ |
||
1266 | include 'drawbutt.inc' |
||
1267 | ;------------------------------------------------------------------------------ |
||
1268 | include 'drawwind.inc' |
||
1269 | ;------------------------------------------------------------------------------ |
||
1270 | include 'drawtray.inc' |
||
1271 | ;------------------------------------------------------------------------------ |
||
601 | Rus | 1272 | include 'ctx_menu.asm' |
2619 | mario79 | 1273 | ;------------------------------------------------------------------------------ |
1274 | include 'i_data.inc' |
||
1275 | ;------------------------------------------------------------------------------ |
||
2532 | mario79 | 1276 | IM_END: |
1277 | ;------------------------------------------------------------------------------ |
||
2619 | mario79 | 1278 | include 'u_data.inc' |
1279 | ;------------------------------------------------------------------------------ |
||
1280 | I_END: |
||
1281 | ;------------------------------------------------------------------------------0,9>0,10>=> |