Subversion Repositories Kolibri OS

Rev

Rev 9301 | Rev 9436 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9301 Rev 9428
Line 1... Line 1...
1
/*
1
/*
2
 * System Monitor
2
 * System Monitor
3
 * version 1.36
3
 * version 1.37
4
 * Author: Leency
4
 * Author: Leency
5
*/
5
*/
Line 6... Line 6...
6
 
6
 
-
 
7
#define MEMSIZE 4096*30
Line 7... Line 8...
7
#define MEMSIZE 4096*30
8
#define NO_DLL_INIT
8
 
9
 
9
//===================================================//
10
//===================================================//
10
//                                                   //
11
//                                                   //
Line 14... Line 15...
14
 
15
 
15
#include "../lib/gui.h"
16
#include "../lib/gui.h"
16
#include "../lib/fs.h"
17
#include "../lib/fs.h"
Line 17... Line -...
17
#include "../lib/list_box.h"
-
 
18
 
18
#include "../lib/list_box.h"
Line 19... Line 19...
19
#include "../lib/obj/libimg.h"
19
 
20
#include "../lib/obj/box_lib.h"
20
#include "../lib/obj/box_lib.h"
Line 76... Line 76...
76
int current_process_id = 0;
76
int current_process_id = 0;
77
int proc_list[256];
77
int proc_list[256];
Line 78... Line 78...
78
 
78
 
Line -... Line 79...
-
 
79
checkbox show_system = { T_SHOW_SYSTEM, false };
-
 
80
 
79
checkbox show_system = { T_SHOW_SYSTEM, false };
81
char* shared_icons_16;
80
 
82
 
81
sensor cpu;
83
sensor cpu;
82
sensor ram;
84
sensor ram;
Line 93... Line 95...
93
//                                                   //
95
//                                                   //
94
//===================================================//
96
//===================================================//
Line 95... Line 97...
95
 
97
 
96
void load_lib()
98
void load_lib()
97
{
-
 
98
	load_dll(libimg, #libimg_init,1);
99
{
99
	load_dll(boxlib, #box_lib_init,0);
100
	load_dll(boxlib, #box_lib_init,0);
Line 100... Line 101...
100
}
101
}
101
 
102
 
102
void main()
103
void main()
103
{
104
{
-
 
105
	int btn;
104
	int btn;
106
	load_lib();
105
	load_lib();
107
	shared_icons_16 = memopen("ICONS18W", NULL, SHM_READ);
106
	@SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
108
	@SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
107
	loop() switch(@WaitEventTimeout(50))
109
	loop() switch(@WaitEventTimeout(50))
108
	{
110
	{
Line 293... Line 295...
293
	}
295
	}
294
}
296
}
Line 295... Line 297...
295
 
297
 
296
void DrawIconWithText(dword _x, _y, _icon, _title)
298
void DrawIconWithText(dword _x, _y, _icon, _title)
-
 
299
{
297
{
300
	if (shared_icons_16) {
-
 
301
		PutPaletteImage(18*18*4*_icon + shared_icons_16, 18, 18,_x, _y, 32, 0);
-
 
302
	} else {
-
 
303
		_x -= ICONGAP;
298
	int size = DrawIcon16(_x, _y, sc.work, _icon);
304
	}
299
	WriteTextWithBg(_x+ICONGAP, _y + size - 16, 0xD0, sc.work_text, _title, sc.work);
305
	WriteTextWithBg(_x+ICONGAP, _y + 2, 0xD0, sc.work_text, _title, sc.work);
Line 300... Line 306...
300
}
306
}
301
 
307
 
302
dword GetCpuLoad(dword max_h)
308
dword GetCpuLoad(dword max_h)