Subversion Repositories Kolibri OS

Rev

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