mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
39ffa8406b
Removing usage of EDE_PANEL_APPLET_CLASS since there is no much usage of it. Also, marked all applet widgets as EDE_PANEL_WIDGET_TYPE so panel knows it is widget. Added license info in some code, but whole ede2 tree needs to be revised for that.
49 lines
696 B
C++
49 lines
696 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
|
|
};
|
|
|
|
class CPUMonitor : public 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
|