Subversion Repositories Kolibri OS

Rev

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