Subversion Repositories Kolibri OS

Rev

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