Subversion Repositories Kolibri OS

Rev

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