Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
7361 leency 1
/*
2
 * System Monitor
7422 leency 3
 * version 0.87
7361 leency 4
 * Author: Leency
5
*/
6
 
7614 leency 7
#define MEMSIZE 4096*30
7361 leency 8
 
7614 leency 9
//===================================================//
10
//                                                   //
11
//                       LIB                         //
12
//                                                   //
13
//===================================================//
14
 
7361 leency 15
#include "../lib/io.h"
16
#include "../lib/gui.h"
7369 leency 17
#include "../lib/fs.h"
7614 leency 18
#include "../lib/list_box.h"
7361 leency 19
 
20
#include "../lib/obj/libio.h"
21
#include "../lib/obj/libimg.h"
22
#include "../lib/obj/libini.h"
7614 leency 23
#include "../lib/obj/box_lib.h"
7361 leency 24
 
7614 leency 25
#include "../lib/patterns/select_list.h"
26
#include "../lib/patterns/restart_process.h"
27
 
7361 leency 28
//===================================================//
29
//                                                   //
30
//                       DATA                        //
31
//                                                   //
32
//===================================================//
33
 
7614 leency 34
#define WIN_PAD 20   //Window padding
35
#define WIN_CONTENT_X WIN_PAD
36
#define WIN_CONTENT_Y TAB_HEIGHT+WIN_PAD
37
#define WIN_CONTENT_W 400
38
#define WIN_CONTENT_H 465
39
proc_info Form;
7361 leency 40
 
7614 leency 41
#include "general.h"
42
#include "process.h"
7361 leency 43
 
7614 leency 44
#define T_GENERAL "General"
45
#define T_PROCESSES "Processes"
7369 leency 46
 
7614 leency 47
enum {
48
	TAB_GENERAL=20,
49
	TAB_PROCESSES
50
};
51
_tabs tabs = { TAB_GENERAL, 4, 0, WIN_CONTENT_W+WIN_PAD+WIN_PAD-4-4, TAB_HEIGHT };
7361 leency 52
 
53
void main()
54
{
55
	load_dll(libio, #libio_init,1);
56
	load_dll(libimg, #libimg_init,1);
57
	load_dll(libini, #lib_init,1);
7614 leency 58
	load_dll(boxlib, #box_lib_init,0);
59
	General__Main();
7361 leency 60
}
61
 
7614 leency 62
int Sysmon__DefineAndDrawWindow()
7369 leency 63
{
7614 leency 64
	system.color.get();
65
	DefineAndDrawWindow(screen.width - WIN_CONTENT_H - 200, 100, WIN_CONTENT_W + WIN_PAD + WIN_PAD +9,
66
		WIN_CONTENT_H + TAB_HEIGHT + skin_height + 4, 0x34, system.color.work, "System Monitor",0);
67
	GetProcessInfo(#Form, SelfInfo);
68
	if (Form.status_window>2) return false;
69
	//if (Form.width  < 300) { MoveSize(OLD,OLD,300,OLD); break; }
70
	//if (Form.height < 200) { MoveSize(OLD,OLD,OLD,200); break; }
71
	tabs.draw_wrapper();
72
	tabs.draw_button(tabs.x+TAB_PADDING, TAB_GENERAL, T_GENERAL);
73
	tabs.draw_button(strlen(T_GENERAL)*8+tabs.x+TAB_PADDING+TAB_PADDING, TAB_PROCESSES, T_PROCESSES);
74
	return true;
7369 leency 75
}
76
 
7361 leency 77
//===================================================//
78
//                                                   //
7614 leency 79
//                      EVENTS                       //
7361 leency 80
//                                                   //
81
//===================================================//
82
 
7614 leency 83
void Sysmon__ButtonEvent(dword id)
7361 leency 84
{
7614 leency 85
	if (1==id) ExitProcess();
86
	if (TAB_GENERAL==id) {
87
		tabs.active_tab = TAB_GENERAL;
88
		General__Main();
7361 leency 89
	}
7614 leency 90
	if (TAB_PROCESSES==id) {
91
		tabs.active_tab = TAB_PROCESSES;
92
		Processes__Main();
7361 leency 93
	}
94
}
7614 leency 95
 
96
 
97
stop: