Subversion Repositories Kolibri OS

Rev

Rev 5452 | Rev 7181 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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