Subversion Repositories Kolibri OS

Rev

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