ede/ede-panel/applets/cpu-monitor/CpuMonitor.h
Sanel Zukan eb175fa89f Moving all class declarations to EDE_PANEL_APPLET_CLASS macro.
This change should make base applet code easier to modify without modifying applets itself. This is also
a starting point for implementation of better routing netwm messages to applets without adding specific listener
to each applet.
2012-05-28 10:57:50 +00:00

49 lines
706 B
C++

#ifndef __CPUMONITOR_H__
#define __CPUMONITOR_H__
#include <FL/Fl_Box.H>
#include "Applet.h"
/*
#ifdef HAVE_KSTAT_H
# include <kstat.h>
# include <sys/sysinfo.h>
#endif
*/
enum {
IWM_USER = 0,
IWM_NICE,
IWM_SYS,
IWM_IDLE,
IWM_STATES
};
EDE_PANEL_APPLET_CLASS(CPUMonitor, Fl_Box) {
private:
bool m_draw_label;
int m_old_samples;
int m_samples;
int **cpu;
long last_cpu[IWM_STATES];
Fl_Color colors[IWM_STATES];
public:
CPUMonitor();
~CPUMonitor() { clear(); }
void clear();
void update_status();
void get_cpu_info();
void draw();
void layout();
int handle(int e);
int samples() const { return m_samples; }
};
#endif