Subversion Repositories Kolibri OS

Rev

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

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