Add Semaphores and Ports data sources.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25011 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol
2008-04-17 20:30:13 +00:00
parent 8cda9a8ead
commit 03aaa278a5
4 changed files with 156 additions and 0 deletions
+96
View File
@@ -17,6 +17,8 @@
const DataSource* kSources[] = {
new UsedMemoryDataSource(),
new CachedMemoryDataSource(),
new SemaphoresDataSource(),
new PortsDataSource(),
new ThreadsDataSource(),
new TeamsDataSource(),
new CPUUsageDataSource(),
@@ -340,6 +342,100 @@ CachedMemoryDataSource::Label() const
// #pragma mark -
SemaphoresDataSource::SemaphoresDataSource()
{
SystemInfo info;
fMinimum = 0;
fMaximum = info.MaxSemaphores();
fColor = (rgb_color){100, 200, 100};
}
SemaphoresDataSource::~SemaphoresDataSource()
{
}
DataSource*
SemaphoresDataSource::Copy() const
{
return new SemaphoresDataSource(*this);
}
int64
SemaphoresDataSource::NextValue(SystemInfo& info)
{
return info.UsedSemaphores();
}
const char*
SemaphoresDataSource::Label() const
{
return "Semaphores";
}
bool
SemaphoresDataSource::AdaptiveScale() const
{
return true;
}
// #pragma mark -
PortsDataSource::PortsDataSource()
{
SystemInfo info;
fMinimum = 0;
fMaximum = info.MaxPorts();
fColor = (rgb_color){180, 200, 180};
}
PortsDataSource::~PortsDataSource()
{
}
DataSource*
PortsDataSource::Copy() const
{
return new PortsDataSource(*this);
}
int64
PortsDataSource::NextValue(SystemInfo& info)
{
return info.UsedPorts();
}
const char*
PortsDataSource::Label() const
{
return "Ports";
}
bool
PortsDataSource::AdaptiveScale() const
{
return true;
}
// #pragma mark -
ThreadsDataSource::ThreadsDataSource()
{
SystemInfo info;