Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
6444 pathoswith 1
;-----------------------;
2
; CPU - process manager ;
3
;-----------------------;
4
 
3408 hidnplayr 5
format binary as ""
6
 
7
        use32
8
        org 0x0
9
        db 'MENUET01'           ; 8 byte id
10
        dd 0x01                 ; header version
11
        dd START                ; start of code
12
        dd IM_END               ; size of image
13
        dd U_END                ; memory for app
14
        dd stack_area           ; esp
15
        dd 0x0                  ; boot parameters
8533 IgorA 16
        dd cur_dir_path         ; path
2559 mario79 17
;------------------------------------------------------------------------------
31 halyavin 18
include 'lang.inc'
1209 diamond 19
include '../../../macros.inc'
1373 IgorA 20
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
8533 IgorA 21
include '../../../KOSfuncs.inc'
22
include '../../../load_lib.mac'
2559 mario79 23
;------------------------------------------------------------------------------
3408 hidnplayr 24
display_processes=24    ;32             ; number of processes to show
2559 mario79 25
window_x_size=524
26
window_y_size=430
27
;------------------------------------------------------------------------------
3408 hidnplayr 28
@use_library    ;use load lib macros
2559 mario79 29
;------------------------------------------------------------------------------
3408 hidnplayr 30
START:                          ; start of execution
8533 IgorA 31
        mcall   SF_SYS_MISC,SSF_HEAP_INIT
32
sys_load_library  library_name, library_path, system_path, myimport
3408 hidnplayr 33
        inc     eax
34
        jz      close
2559 mario79 35
;------------------------------------------------------------------------------
8533 IgorA 36
        mcall   SF_SET_EVENTS_MASK,0x80000027 ;set event
2559 mario79 37
;------------------------------------------------------------------------------
38
;set window size and position for 0 function
39
;to [winxpos] and [winypos] variables
40
;get screen size
8533 IgorA 41
        mcall   SF_GET_SCREEN_SIZE
3408 hidnplayr 42
        mov     ebx,eax
3587 fedesco 43
;calculate (x_screen-window_x_size)/2
3408 hidnplayr 44
        shr     ebx,16+1
45
        sub     ebx,window_x_size/2
46
        shl     ebx,16
47
        mov     bx,window_x_size
3587 fedesco 48
;winxpos=xcoord*65536+xsize
3408 hidnplayr 49
        mov     [winxpos],ebx
3587 fedesco 50
;calculate (y_screen-window_y_size)/2
3408 hidnplayr 51
        and     eax,0xffff
52
        shr     eax,1
53
        sub     eax,window_y_size/2
54
        shl     eax,16
55
        mov     ax,window_y_size
3587 fedesco 56
;winypos=ycoord*65536+ysize
3408 hidnplayr 57
        mov     [winypos],eax
3587 fedesco 58
;------------------------------------------------------------------------------
3408 hidnplayr 59
        init_checkboxes2 check1,check1_end
8533 IgorA 60
        mcall   SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,40
3408 hidnplayr 61
        edit_boxes_set_sys_color edit1,edit1_end,sc             ;set color
7519 leency 62
        ;check_boxes_set_sys_color2 check1,check1_end,sc ;set color
2559 mario79 63
;------------------------------------------------------------------------------
3587 fedesco 64
align 4
65
;main loop when process name isn't edited.
66
red:
3408 hidnplayr 67
        call    draw_window             ; redraw all window
2559 mario79 68
;------------------------------------------------------------------------------
3587 fedesco 69
align 4
31 halyavin 70
still:
8533 IgorA 71
        mcall   SF_WAIT_EVENT_TIMEOUT,100          ; wait here for event 1 sec.
6444 pathoswith 72
 
3955 mario79 73
	test	eax,eax
74
	jz	still_end
31 halyavin 75
 
3408 hidnplayr 76
        dec     eax                   ; redraw request ?
77
        jz      red
1205 Lrz 78
 
3408 hidnplayr 79
        dec     eax                   ; key in buffer ?
80
        jz      key
2559 mario79 81
 
3408 hidnplayr 82
        dec     eax                   ; button in buffer ?
83
        jz      button
2559 mario79 84
 
3408 hidnplayr 85
        push    dword edit1
86
        call    [edit_box_mouse]
3587 fedesco 87
 
3408 hidnplayr 88
        push    dword[check1.flags]
3587 fedesco 89
 
3408 hidnplayr 90
        push    dword check1
91
        call    [check_box_mouse]
3587 fedesco 92
 
3408 hidnplayr 93
        pop     eax
3587 fedesco 94
 
3408 hidnplayr 95
        cmp     eax, dword[check1.flags]
96
        jz      still_end
3587 fedesco 97
 
3408 hidnplayr 98
        push    dword check1
99
        call    [check_box_draw]
2559 mario79 100
;--------------------------------------
3587 fedesco 101
align 4
102
show_process_info_1:
8533 IgorA 103
        mcall   SF_SYSTEM_GET,SSF_TIME_COUNT
3408 hidnplayr 104
        add     eax,100
105
        mov     [time_counter],eax
1205 Lrz 106
 
3408 hidnplayr 107
        call    show_process_info       ; draw new state of processes
108
        jmp     still
2559 mario79 109
;------------------------------------------------------------------------------
3587 fedesco 110
align 4
2559 mario79 111
still_end:
8533 IgorA 112
        mcall   SF_SYSTEM_GET,SSF_TIME_COUNT
3408 hidnplayr 113
        cmp     [time_counter],eax
114
        ja      still
31 halyavin 115
 
3408 hidnplayr 116
        add     eax,100
117
        mov     [time_counter],eax
1212 Lrz 118
 
3408 hidnplayr 119
        call    show_process_info       ; draw new state of processes
120
        jmp     still
2559 mario79 121
;------------------------------------------------------------------------------
3587 fedesco 122
align 4
3408 hidnplayr 123
key:                            ; key
8533 IgorA 124
        mcall   SF_GET_KEY
1205 Lrz 125
 
3408 hidnplayr 126
        cmp     ah,184          ; PageUp
127
        jz      pgdn
1205 Lrz 128
 
3408 hidnplayr 129
        cmp     ah,183
130
        jz      pgup                    ; PageDown
2559 mario79 131
 
3408 hidnplayr 132
        cmp     ah,27
133
        jz      close                   ; Esc
2559 mario79 134
 
3408 hidnplayr 135
        push    dword edit1
136
        call    [edit_box_key]
137
                                ; Check ENTER with ed_focus edit_box
138
        lea     edi,[edit1]
139
        test    word ed_flags,ed_focus
3587 fedesco 140
        jz      still_end
1205 Lrz 141
 
3408 hidnplayr 142
        sub     ah,13                   ; ENTER?
143
        jz      program_start           ; RUN a program
1212 Lrz 144
 
3408 hidnplayr 145
        jmp     still
2559 mario79 146
;------------------------------------------------------------------------------
3587 fedesco 147
align 4
148
button:
149
; get button id
8533 IgorA 150
        mcall   SF_GET_BUTTON
4968 0CodErr 151
        mov     bl, al ; save mouse button to bl
3587 fedesco 152
        shr     eax,8
31 halyavin 153
;id in [10,50] corresponds to terminate buttons.
3408 hidnplayr 154
        cmp     eax,10
3587 fedesco 155
        jb      noterm
31 halyavin 156
 
3408 hidnplayr 157
        cmp     eax,50
158
        jg      noterm
3587 fedesco 159
;calculate button index
3408 hidnplayr 160
        sub     eax,11
3587 fedesco 161
;calculate process slot
3408 hidnplayr 162
        mov     ecx,[tasklist+4*eax]
31 halyavin 163
;ignore empty buttons
3408 hidnplayr 164
        test    ecx,ecx
165
        jle     still_end
4968 0CodErr 166
        test    bl, bl ; check mouse button
167
        jz     .terminate
168
        mov    eax, ecx
169
        mov    edi, tinfo.params_buf
170
;; number in eax
171
;; buffer in edi
172
; int2str:
173
        push   0
174
        mov    ecx, 10
6444 pathoswith 175
.push:
4968 0CodErr 176
        xor    edx, edx
177
        div    ecx
178
        add    edx, 48
179
        push   edx
6444 pathoswith 180
        test   eax, eax
4968 0CodErr 181
        jnz     .push
6444 pathoswith 182
.pop:
4968 0CodErr 183
        pop    eax
184
        stosb
185
        test   eax, eax
186
        jnz    .pop
6444 pathoswith 187
; launch tinfo app
4968 0CodErr 188
        mov     ebx, tinfo
8533 IgorA 189
        mov     eax, SF_FILE
4968 0CodErr 190
        int     64
191
        jmp     show_process_info_1
6444 pathoswith 192
.terminate:
3587 fedesco 193
;terminate application
8533 IgorA 194
        mcall   SF_SYSTEM,SSF_TERMINATE_THREAD
3587 fedesco 195
        jmp     show_process_info_1
2559 mario79 196
;--------------------------------------
197
align 4
198
noterm:
199
;special buttons
3408 hidnplayr 200
        dec     eax
201
        jz      close
1212 Lrz 202
 
3408 hidnplayr 203
        sub     eax,50
204
        jz      pgdn      ;51
31 halyavin 205
 
3408 hidnplayr 206
        dec     eax
207
        jz      pgup      ;52
1203 Lrz 208
 
3408 hidnplayr 209
        dec     eax
210
        jz      program_start   ;53
1212 Lrz 211
 
3408 hidnplayr 212
        dec     eax
213
        jz      reboot  ;54
1212 Lrz 214
 
3408 hidnplayr 215
        jmp     still_end
3587 fedesco 216
;buttons handlers
2559 mario79 217
;------------------------------------------------------------------------------
3587 fedesco 218
align 4
2559 mario79 219
pgdn:
3408 hidnplayr 220
        sub     [list_start],display_processes
3587 fedesco 221
        jge     show_process_info_1
3408 hidnplayr 222
        mov     [list_start],0
223
        jmp     show_process_info_1
2559 mario79 224
;------------------------------------------------------------------------------
3587 fedesco 225
align 4
2559 mario79 226
pgup:
3408 hidnplayr 227
        mov     eax,[list_add]  ;maximal displayed process slot
228
        mov     [list_start],eax
229
        jmp     show_process_info_1
2559 mario79 230
;------------------------------------------------------------------------------
3587 fedesco 231
align 4
232
program_start:
8533 IgorA 233
        mcall   SF_FILE,file_start
3408 hidnplayr 234
        jmp     show_process_info_1
2559 mario79 235
;------------------------------------------------------------------------------
3587 fedesco 236
align 4
237
reboot:
8533 IgorA 238
        mcall   SF_FILE,sys_reboot
31 halyavin 239
;close program if we going to reboot
2559 mario79 240
;------------------------------------------------------------------------------
3587 fedesco 241
align 4
2559 mario79 242
close:
8533 IgorA 243
        or      eax,SF_TERMINATE_PROCESS ; close this program
3408 hidnplayr 244
        mcall
2559 mario79 245
;------------------------------------------------------------------------------
3587 fedesco 246
align 4
247
draw_empty_slot:
3408 hidnplayr 248
        cmp     [draw_window_flag],1
249
        je      @f
250
        mov     ecx,[curposy]
251
        shl     ecx,16
252
        mov     cx,10   ; button height
8533 IgorA 253
        mcall   SF_DRAW_RECT,<111,393>,,[bar_bacground_color]
2582 mario79 254
@@:
3408 hidnplayr 255
        ret
2582 mario79 256
;------------------------------------------------------------------------------
3587 fedesco 257
align 4
31 halyavin 258
draw_next_process:
259
;input:
260
;  edi - current slot
261
;  [curposy] - y position
262
;output:
263
;  edi - next slot (or -1 if no next slot)
264
;registers corrupted!
265
;create terminate process button
3408 hidnplayr 266
        mov     ecx,[curposy]
267
        shl     ecx,16
268
        mov     cx,13   ; button height
269
        mov     edx,[index]
270
        add     edx,11
6444 pathoswith 271
        mov     esi,0xccddee
3408 hidnplayr 272
        test    dword [index],1
6444 pathoswith 273
        jz      @f
274
        mov     esi,0xaabbcc
275
@@:
7354 leency 276
		add     edx,0x80000000 ; delete a button
8533 IgorA 277
		mcall   SF_DEFINE_BUTTON ; before create
7354 leency 278
		sub     edx,0x80000000 ; a new one below
8533 IgorA 279
        mcall   SF_DEFINE_BUTTON,<10,99>
3408 hidnplayr 280
        mov     [btn_bacground_color],esi
31 halyavin 281
;draw background for proccess information
6444 pathoswith 282
        mov     edx,0xddffdd
3408 hidnplayr 283
        test    dword [index],1
6444 pathoswith 284
        jz      @f
285
        mov     edx,0xffffff
286
@@:
3408 hidnplayr 287
        inc     cx
288
        cmp     [draw_window_flag],0
289
        je      @f
8533 IgorA 290
        mcall   SF_DRAW_RECT,<110,395>
2582 mario79 291
@@:
3408 hidnplayr 292
        mov     [bar_bacground_color],edx
6444 pathoswith 293
;nothing else should be done if there is no process for this button
3408 hidnplayr 294
        cmp     edi,-1
295
        jne     .return_1
2582 mario79 296
 
3408 hidnplayr 297
        call    draw_empty_slot
298
        or      edi,-1
299
        jmp     .ret
2559 mario79 300
;--------------------------------------
301
align 4
302
.return_1:
31 halyavin 303
;find process
3408 hidnplayr 304
        inc     edi
3587 fedesco 305
;more comfortable register for next loop
3408 hidnplayr 306
        mov     ecx,edi
3587 fedesco 307
;precacluate pointer to process buffer
3408 hidnplayr 308
        mov     ebx,process_info_buffer
2559 mario79 309
;--------------------------------------
310
align 4
31 halyavin 311
.find_loop:
3408 hidnplayr 312
        cmp     ecx,256
313
        jge     .no_processes
31 halyavin 314
;load process information in buffer
8533 IgorA 315
        mcall   SF_THREAD_INFO
31 halyavin 316
;if current slot greater than maximal slot,
3587 fedesco 317
;there is no more proccesses.
3408 hidnplayr 318
        cmp     ecx,eax
319
        jg      .no_processes
3587 fedesco 320
;if slot state is equal to 9, it is empty.
3408 hidnplayr 321
        cmp     [process_info_buffer+process_information.slot_state],9
322
        jnz     .process_found
3587 fedesco 323
 
3408 hidnplayr 324
        inc     ecx
325
        jmp     .find_loop
2559 mario79 326
;--------------------------------------
327
align 4
31 halyavin 328
.no_processes:
3408 hidnplayr 329
        call    draw_empty_slot
330
        or      edi,-1
331
        ret
2559 mario79 332
;--------------------------------------
333
align 4
31 halyavin 334
.process_found:
1266 Lrz 335
;check on/off check box
3408 hidnplayr 336
        push    edi
337
        lea     edi,[check1]
338
        test    dword ch_flags,ch_flag_en
339
        pop     edi
3779 mario79 340
        jnz     .no_filter
1266 Lrz 341
 
3408 hidnplayr 342
        cmp     dword [process_info_buffer+10],'ICON'
3779 mario79 343
	jnz	@f
344
        cmp     dword [process_info_buffer+10+4],0
3587 fedesco 345
        jz      .return_1
3779 mario79 346
@@:
347
        cmp     dword [process_info_buffer+10],'IDLE'
348
	jnz	@f
349
        cmp     dword [process_info_buffer+10+4],0
3408 hidnplayr 350
        jz      .return_1
3779 mario79 351
@@:
352
        cmp     word [process_info_buffer+10],'OS'
353
	jnz	@f
354
        cmp     dword [process_info_buffer+10+2],0
355
        jz      .return_1
356
@@:
3408 hidnplayr 357
        cmp     byte [process_info_buffer+10],'@'
358
        jz      .return_1
2559 mario79 359
;--------------------------------------
360
align 4
3779 mario79 361
.no_filter:
3408 hidnplayr 362
        mov     edi,ecx
363
        mov     [list_add],ecx
3587 fedesco 364
;get processor cpeed
31 halyavin 365
;for percent calculating
8533 IgorA 366
        mcall   SF_SYSTEM,SSF_GET_CPU_FREQUENCY
3408 hidnplayr 367
        xor     edx,edx
368
        mov     ebx,100
369
        div     ebx
31 halyavin 370
;eax = number of operation for 1% now
371
;calculate process cpu usage percent
3408 hidnplayr 372
        mov     ebx,eax
373
        mov     eax,[process_info_buffer+process_information.cpu_usage]
374
;       cdq
3587 fedesco 375
        xor     edx,edx ; for CPU more 2 GHz - mike.dld
3408 hidnplayr 376
        div     ebx
377
        mov     [cpu_percent],eax
31 halyavin 378
;set text color to display process information
3587 fedesco 379
;0%      : black
31 halyavin 380
;1-80%   : green
381
;81-100% : red
3408 hidnplayr 382
        test    eax,eax
383
        jnz     .no_black
1212 Lrz 384
 
6444 pathoswith 385
        mov     esi,eax
3408 hidnplayr 386
        jmp     .color_set
2559 mario79 387
;--------------------------------------
388
align 4
3587 fedesco 389
.no_black:
3408 hidnplayr 390
        cmp     eax,80
391
        ja      .no_green
1212 Lrz 392
 
6444 pathoswith 393
        mov     esi,0x107a30
3408 hidnplayr 394
        jmp     .color_set
2559 mario79 395
;--------------------------------------
396
align 4
31 halyavin 397
.no_green:
6444 pathoswith 398
        mov     esi,0xac0000
2559 mario79 399
;--------------------------------------
400
align 4
31 halyavin 401
.color_set:
402
;show slot number
3587 fedesco 403
;ecx haven't changed since .process_found
3408 hidnplayr 404
        push    edi
405
        mov     edx,[curposy]
406
        add     edx,15*65536+3
8533 IgorA 407
        mcall   SF_DRAW_NUMBER,<2,256>
31 halyavin 408
;show process name
3408 hidnplayr 409
        mov     ebx,[curposy]
410
        add     ebx,40*65536+3
6444 pathoswith 411
        mov     ecx,esi
8533 IgorA 412
        mcall   SF_DRAW_TEXT,,,process_info_buffer.process_name,11
31 halyavin 413
;show pid
3408 hidnplayr 414
        mov     edx,[curposy]
415
        add     edx,125*65536+3
6444 pathoswith 416
        mov     esi,ecx
3408 hidnplayr 417
        or      esi,0x40000000
8533 IgorA 418
        mcall   SF_DRAW_NUMBER,<8,256>,[process_info_buffer.PID],,,[bar_bacground_color]
31 halyavin 419
;show cpu usage
3408 hidnplayr 420
        add     edx,60*65536
421
        mcall   ,,[process_info_buffer.cpu_usage]
31 halyavin 422
;show cpu percent
3408 hidnplayr 423
        add     edx,60*65536
424
        mcall   ,<3,0>,[cpu_percent]
31 halyavin 425
;show memory start - obsolete
3408 hidnplayr 426
        add     edx,30*65536
427
        mcall   ,<8,256>,[process_info_buffer.memory_start]
31 halyavin 428
;show memory usage
3408 hidnplayr 429
        mov     ecx,[process_info_buffer.used_memory]
430
        inc     ecx
431
        add     edx,60*65536
432
        mcall
31 halyavin 433
;show window stack and value
3408 hidnplayr 434
        add     edx,60*65536
435
        mcall   ,,dword [process_info_buffer.window_stack_position]
31 halyavin 436
;show window xy size
3408 hidnplayr 437
        mov     ecx,[process_info_buffer.box.left]
438
        shl     ecx,16
439
        add     ecx,[process_info_buffer.box.top]
440
        add     edx,60*65536
3587 fedesco 441
        mcall
3408 hidnplayr 442
        pop     edi
2559 mario79 443
;--------------------------------------
444
align 4
31 halyavin 445
.ret:
446
;build index->slot map for terminating processes.
3408 hidnplayr 447
        mov     eax,[index]
3587 fedesco 448
        mov     [tasklist+4*eax],edi
3408 hidnplayr 449
        ret
2559 mario79 450
;------------------------------------------------------------------------------
3587 fedesco 451
align 4
2559 mario79 452
f11:
3587 fedesco 453
;full update
3408 hidnplayr 454
        push    edi
455
        call    draw_window
456
        pop     edi
2559 mario79 457
;------------------------------------------------------------------------------
31 halyavin 458
;   *********************************************
459
;   *******  WINDOW DEFINITIONS AND DRAW ********
460
;   *********************************************
3587 fedesco 461
align 4
31 halyavin 462
draw_window:
8533 IgorA 463
        mcall   SF_REDRAW, SSF_BEGIN_DRAW
2559 mario79 464
; DRAW WINDOW
3408 hidnplayr 465
        xor     eax,eax                         ; function 0 : define and draw window
466
        xor     esi,esi
467
        mcall   ,[winxpos],[winypos],0x74ffffff,,title  ;0x34ddffdd
2582 mario79 468
 
8533 IgorA 469
        mcall   SF_THREAD_INFO,process_info_buffer,-1
3587 fedesco 470
 
3408 hidnplayr 471
        mov     eax,[ebx+70]
472
        mov     [window_status],eax
473
        test    [window_status],100b            ; window is rolled up
474
        jnz     .exit
2583 mario79 475
 
3408 hidnplayr 476
        test    [window_status],10b             ; window is minimized to panel
477
        jnz     .exit
2583 mario79 478
 
3408 hidnplayr 479
        mov     eax,[ebx+62]
480
        inc     eax
481
        mov     [client_area_x_size],eax
482
        mov     eax,[ebx+66]
483
        inc     eax
484
        mov     [client_area_y_size],eax
2582 mario79 485
 
3408 hidnplayr 486
        mov     ebx,[client_area_x_size]
8533 IgorA 487
        mcall   SF_DRAW_RECT,,<0,20>,0xffffff
2559 mario79 488
; function 4 : write text to window
3408 hidnplayr 489
        xor     ecx,ecx
8533 IgorA 490
        mcall   SF_DRAW_TEXT,<17,8>,,text,text_len
31 halyavin 491
 
8533 IgorA 492
        mcall   SF_DRAW_RECT,<0,10>,<20,336>,0xffffff
3587 fedesco 493
 
3408 hidnplayr 494
        mov     ebx,[client_area_x_size]
495
        sub     ebx,10+100+395
496
        add     ebx,(10+100+395) shl 16
497
        mcall
3587 fedesco 498
 
8533 IgorA 499
        mcall   SF_SYSTEM_GET,SSF_TIME_COUNT
3408 hidnplayr 500
        add     eax,100
501
        mov     [time_counter],eax
2582 mario79 502
 
3408 hidnplayr 503
        mov     [draw_window_flag],1
504
        call    show_process_info
505
        mov     [draw_window_flag],0
3587 fedesco 506
 
3408 hidnplayr 507
        mov     ebx,[client_area_x_size]
508
        mov     ecx,[client_area_y_size]
509
        sub     ecx,20+336
510
        add     ecx,(20+336) shl 16
8533 IgorA 511
        mcall   SF_DRAW_RECT,,,0xffffff
2582 mario79 512
 
3408 hidnplayr 513
        push    dword edit1
514
        call    [edit_box_draw]
2559 mario79 515
 
3408 hidnplayr 516
        push    dword check1
517
        call    [check_box_draw]
3587 fedesco 518
 
31 halyavin 519
; previous page button
8533 IgorA 520
        mcall   SF_DEFINE_BUTTON,<25,96>,<361,14>,51,0xccddee  ;0xaabbcc
1207 Lrz 521
; next page button  52
3408 hidnplayr 522
        inc     edx
523
        mcall   ,<125,96>
31 halyavin 524
; ">" (text enter) button
3408 hidnplayr 525
        add     ecx,20 shl 16
1207 Lrz 526
; run button 53
3408 hidnplayr 527
        inc     edx
528
        mcall   ,<456,50>
3587 fedesco 529
; reboot button
530
        sub     ebx,120*65536
3408 hidnplayr 531
        add     ebx,60
532
        sub     ecx,20 shl 16
533
        inc     edx
534
        mcall
31 halyavin 535
;"PREV PAGE", "NEXT PAGE" and "REBOOT" labels
3408 hidnplayr 536
        xor     ecx,ecx
8533 IgorA 537
        mcall   SF_DRAW_TEXT,<45,365>,,tbts,tbte-tbts
31 halyavin 538
;"RUN" labels
3408 hidnplayr 539
        mcall   ,<464,385>,,tbts_3,tbte_2-tbts_3
31 halyavin 540
;print application name in text box
2583 mario79 541
;--------------------------------------
542
align 4
543
.exit:
8533 IgorA 544
        mcall   SF_REDRAW, SSF_END_DRAW
3408 hidnplayr 545
        ret
2559 mario79 546
;------------------------------------------------------------------------------
547
align 4
548
show_process_info:
3408 hidnplayr 549
        test    [window_status],100b            ; window is rolled up
550
        jnz     .exit
2583 mario79 551
 
3408 hidnplayr 552
        test    [window_status],10b             ; window is minimized to panel
553
        jnz     .exit
2583 mario79 554
 
3938 mario79 555
        mov     ecx,display_processes
556
        mov     edi,tasklist
557
        xor     eax,eax
558
        cld
559
        rep     stosd
560
 
3408 hidnplayr 561
        mov     edi,[list_start]
562
        mov     [list_add],edi
563
        mov     dword [index],0
564
        mov     dword [curposy],20
2559 mario79 565
;--------------------------------------
566
align 4
567
.loop_draw:
3408 hidnplayr 568
        call    draw_next_process
569
        inc     dword [index]
570
        add     dword [curposy],14
571
        cmp     [index],display_processes
572
        jl      .loop_draw
2583 mario79 573
;--------------------------------------
574
align 4
575
.exit:
3408 hidnplayr 576
        ret
2559 mario79 577
;------------------------------------------------------------------------------
31 halyavin 578
; DATA AREA
2559 mario79 579
;------------------------------------------------------------------------------
3408 hidnplayr 580
system_path      db '/sys/lib/'
581
library_name     db 'box_lib.obj',0
1205 Lrz 582
 
2559 mario79 583
;------------------------------------------------------------------------------
3587 fedesco 584
align 4
585
myimport:
3408 hidnplayr 586
edit_box_draw           dd aEdit_box_draw
587
edit_box_key            dd aEdit_box_key
588
edit_box_mouse          dd aEdit_box_mouse
589
;version_ed             dd aVersion_ed
1205 Lrz 590
 
3408 hidnplayr 591
init_checkbox           dd aInit_checkbox
592
check_box_draw          dd aCheck_box_draw
593
check_box_mouse         dd aCheck_box_mouse
594
;version_ch             dd aVersion_ch
1205 Lrz 595
 
3408 hidnplayr 596
;option_box_draw        dd aOption_box_draw
597
;option_box_mouse       dd aOption_box_mouse
598
;version_op             dd aVersion_op
1205 Lrz 599
 
3408 hidnplayr 600
                dd 0
601
                dd 0
1205 Lrz 602
 
3408 hidnplayr 603
aEdit_box_draw          db 'edit_box',0
604
aEdit_box_key           db 'edit_box_key',0
605
aEdit_box_mouse         db 'edit_box_mouse',0
606
;aVersion_ed            db 'version_ed',0
1205 Lrz 607
 
3408 hidnplayr 608
aInit_checkbox          db 'init_checkbox2',0
609
aCheck_box_draw         db 'check_box_draw2',0
610
aCheck_box_mouse        db 'check_box_mouse2',0
611
;aVersion_ch            db 'version_ch',0
1205 Lrz 612
 
3408 hidnplayr 613
;aOption_box_draw       db 'option_box_draw',0
614
;aOption_box_mouse      db 'option_box_mouse',0
615
;aVersion_op            db 'version_op',0
2559 mario79 616
;------------------------------------------------------------------------------
3587 fedesco 617
align 4
7519 leency 618
check1 check_box2 (10 shl 16)+12,(383 shl 16)+12,6, 0x80D6DEE7,0x4C5258,0,check_text, ch_flag_middle ;ch_flag_en
1266 Lrz 619
check1_end:
2582 mario79 620
edit1 edit_box 350,95,381,0xffffff,0x6f9480,0,0xAABBCC,0,start_application_c,\
2559 mario79 621
   start_application,mouse_dd,ed_focus,start_application_e,start_application_e
1228 Lrz 622
edit1_end:
31 halyavin 623
list_start  dd 0
2559 mario79 624
;------------------------------------------------------------------------------
3587 fedesco 625
align 4
748 heavyiron 626
sys_reboot:
8533 IgorA 627
            dd SSF_START_APP
3408 hidnplayr 628
            dd 0
629
            dd 0
630
            dd 0
631
            dd 0
632
            db '/sys/end',0
2559 mario79 633
;------------------------------------------------------------------------------
340 heavyiron 634
if lang eq de
31 halyavin 635
text:
3408 hidnplayr 636
        db 'NAME/BEENDEN        PID     CPU-LAST   % '
637
        db 'SPEICHER START/NUTZUNG  W-STACK  W-POS'
205 heavyiron 638
text_len = $-text
31 halyavin 639
 
3408 hidnplayr 640
tbts:   db 'SEITE ZURUECK     SEITE VOR                        REBOOT SYSTEM'
135 diamond 641
tbte:
3408 hidnplayr 642
tbts_3  db 'START'
135 diamond 643
tbte_2:
5420 leency 644
check_text      db 'System',0
3408 hidnplayr 645
title   db 'Prozesse  - Ctrl/Alt/Del',0
2559 mario79 646
;--------------------------------------
268 kaitz 647
else if lang eq et
648
text:
3408 hidnplayr 649
        db 'NIMI/LÕPETA         PID    CPU-KASUTUS %   '
650
        db 'MÄLU ALGUS/KASUTUS  W-PUHVER  W-SUURUS'
268 kaitz 651
text_len = $-text
652
 
3408 hidnplayr 653
tbts:   db 'EELMINE LEHT   JÄRGMINE LEHT                     REBOODI SÜSTEEM'
268 kaitz 654
tbte:
3408 hidnplayr 655
tbts_3  db 'START'
268 kaitz 656
tbte_2:
5420 leency 657
check_text      db 'System',0
3408 hidnplayr 658
title   db 'Protsessid - Ctrl/Alt/Del'
2559 mario79 659
;--------------------------------------
660
else if lang eq ru
661
text:
3408 hidnplayr 662
        db 'ˆŒŸ/‡€‚…˜ˆ’œ      PID     CPU-‡€ƒ“‡Š€ %  '
663
        db '€ŒŸ’œ €—€‹Ž/‚‘…ƒŽ  W-STACK  W-POS'
2559 mario79 664
text_len = $-text
268 kaitz 665
 
3408 hidnplayr 666
tbts:   db '…„.‘’        ‘‹…„.‘’                          ……‡€ƒ“‡Š€'
2559 mario79 667
tbte:
3408 hidnplayr 668
tbts_3  db '‡€“‘Š'
2559 mario79 669
tbte_2:
5420 leency 670
check_text      db '‘¨á⥬­ë¥',0
3408 hidnplayr 671
title   db '„¨á¯¥âç¥à ¯à®æ¥áᮢ - Ctrl/Alt/Del',0
2559 mario79 672
;--------------------------------------
3587 fedesco 673
else if lang eq it
674
text:
675
        db 'NOME-PROGRAMMA    PID       USO CPU    % '
676
        db 'MEMORY START/USAGE  W-STACK  W-POS'
677
text_len = $-text
678
 
679
tbts:   db 'INDIETRO         AVANTI                           RIAVVIA SISTEMA'
680
tbte:
681
tbts_3  db 'START'
682
tbte_2:
5420 leency 683
check_text      db 'System',0
3587 fedesco 684
title   db 'Gestore processi  - Ctrl/Alt/Del',0
685
;--------------------------------------
340 heavyiron 686
else
687
text:
3408 hidnplayr 688
        db 'NAME/TERMINATE    PID       CPU-USAGE  %   '
689
        db 'MEMORY START/USAGE  W-STACK   W-POS'
340 heavyiron 690
text_len = $-text
691
 
3408 hidnplayr 692
tbts:   db 'PREV PAGE       NEXT PAGE                         REBOOT SYSTEM'
340 heavyiron 693
tbte:
3408 hidnplayr 694
tbts_3  db ' RUN'
340 heavyiron 695
tbte_2:
5420 leency 696
check_text      db 'System',0
3408 hidnplayr 697
title   db 'Process manager - Ctrl/Alt/Del',0
340 heavyiron 698
 
135 diamond 699
end if
4968 0CodErr 700
; ---------------------------------------------------------------------------- ;
3587 fedesco 701
align 4
4968 0CodErr 702
tinfo:
8533 IgorA 703
                    dd SSF_START_APP
4968 0CodErr 704
                    dd 0
705
.params             dd .params_buf
706
                    dd 0
707
                    dd 0
708
                    db 0
709
.file_path          dd sz_tinfo_file_path
710
align 4
711
.params_buf:
712
times 11 db 0 ; at now 4 bytes will be enough, but may be in the future not
713
align 4
714
sz_tinfo_file_path  db "/sys/tinfo",0
715
; ---------------------------------------------------------------------------- ;
716
align 4
2559 mario79 717
file_start:
8533 IgorA 718
        dd SSF_START_APP
3408 hidnplayr 719
        dd 0
720
        dd 0
721
        dd 0
722
        dd 0
5427 yogev_ezra 723
start_application: db '/sys/LAUNCHER',0
1205 Lrz 724
start_application_e=$-start_application-1
725
;                   times 60 db 0
3408 hidnplayr 726
        rb 60
1205 Lrz 727
start_application_c=$-start_application-1
2559 mario79 728
;------------------------------------------------------------------------------
729
IM_END:
730
;------------------------------------------------------------------------------
3587 fedesco 731
align 4
1228 Lrz 732
sc system_colors
3408 hidnplayr 733
winxpos         rd 1
734
winypos         rd 1
735
mouse_dd        rd 1
736
cpu_percent     rd 1
737
list_add        rd 1
738
curposy         rd 1
739
index           rd 1
740
tasklist        rd display_processes
741
time_counter    rd 1
2582 mario79 742
 
3408 hidnplayr 743
window_status           rd 1
744
client_area_x_size      rd 1
745
client_area_y_size      rd 1
746
bar_bacground_color     rd 1
747
btn_bacground_color     rd 1
748
draw_window_flag        rd 1
2559 mario79 749
;------------------------------------------------------------------------------
3587 fedesco 750
align 4
2559 mario79 751
library_path:
31 halyavin 752
process_info_buffer process_information
2559 mario79 753
;------------------------------------------------------------------------------
3587 fedesco 754
align 4
2559 mario79 755
cur_dir_path:
3408 hidnplayr 756
        rb 1024
757
        rb 1024
2559 mario79 758
stack_area:
31 halyavin 759
U_END: