1 //**************************************************************************************** 2 // 3 // File: PulseView.h 4 // 5 // Written by: David Ramsey and Daniel Switkin 6 // 7 // Copyright 1999, Be Incorporated 8 // 9 //**************************************************************************************** 10 11 #ifndef PULSEVIEW_H 12 #define PULSEVIEW_H 13 14 #include <interface/View.h> 15 #include <interface/PopUpMenu.h> 16 #include <interface/MenuItem.h> 17 18 extern "C" int _kget_cpu_state_(int cpu); 19 extern "C" int _kset_cpu_state_(int cpu, int enabled); 20 21 class PulseView : public BView { 22 public: 23 PulseView(BRect rect, const char *name); 24 PulseView(BMessage *message); 25 ~PulseView(); 26 virtual void MouseDown(BPoint point); 27 void ChangeCPUState(BMessage *message); 28 29 protected: 30 void Init(); 31 void Update(); 32 33 BPopUpMenu *popupmenu; 34 BMenuItem *mode1, *mode2, *preferences, *about; 35 BMenuItem **cpu_menu_items; 36 37 double cpu_times[B_MAX_CPU_COUNT]; 38 bigtime_t prev_active[B_MAX_CPU_COUNT]; 39 bigtime_t prev_time; 40 }; 41 42 #endif 43