xosview  1.23
About: xosview is an X Windows based system monitor (cpu, memory, swap and network usage; interrupt and serial activities; load average).
  Fossies Dox: xosview-1.23.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

xosview.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 1994, 1995, 2006 by Mike Romberg ( mike.romberg@noaa.gov )
3 //
4 // This file may be distributed under terms of the GPL
5 //
6 
7 #ifndef _XOSVIEW_H_
8 #define _XOSVIEW_H_
9 
10 #include "xwin.h"
11 #include "Xrm.h" // For Xrm resource manager class.
12 #include <stdio.h>
13 
14 /* Take at most n samples per second (default of 10) */
15 extern double MAX_SAMPLES_PER_SECOND;
16 
17 class Meter;
18 
19 class XOSView : public XWin {
20 public:
21  XOSView( const char* instName, int argc, char *argv[] );
22  ~XOSView( void );
23 
24  void figureSize ( void );
25  void resize( void );
26  void draw ( void );
27  void run( void );
28  const char *winname( void );
29 
30  // used by meter makers
31  int xoff(void) const { return xoff_; }
32  int newypos( void );
33 
36 
37 protected:
38 
40  void checkArgs (int argc, char** argv) const;
41  class MeterNode {
42  public:
43  MeterNode( Meter *fm ) { meter_ = fm; next_ = NULL; }
44 
47  };
48 
50 
53  unsigned long sleeptime_, usleeptime_;
54 
55  void usleep_via_select( unsigned long usec );
56  void addmeter( Meter *fm );
57  void checkMeterResources( void );
58 
59  int findx( void );
60  int findy( void );
61  void dolegends( void );
62 
63  void checkOverallResources();
64  void resizeEvent( XConfigureEvent &event );
65  void exposeEvent( XExposeEvent &event );
66  void keyPressEvent( XKeyEvent &event );
67  void visibilityEvent( XVisibilityEvent &event );
68  void unmapEvent( XUnmapEvent &event);
69  void checkVersion(int argc, char *argv[]) const;
70 
71 private:
72 
76 };
77 
78 #ifdef DEBUG
79 #define XOSDEBUG(...) { \
80  fprintf(stderr, "%s:%d: ", __func__, __LINE__); \
81  fprintf(stderr, __VA_ARGS__); \
82 }
83 #else
84 #define XOSDEBUG(...)
85 #endif
86 
87 #endif
Definition: meter.h:14
MeterNode * next_
Definition: xosview.h:46
MeterNode(Meter *fm)
Definition: xosview.h:43
Meter * meter_
Definition: xosview.h:45
void visibilityEvent(XVisibilityEvent &event)
Definition: xosview.cc:433
void checkArgs(int argc, char **argv) const
Definition: xosview.cc:364
void keyPressEvent(XKeyEvent &event)
Definition: xosview.cc:354
void addmeter(Meter *fm)
Definition: xosview.cc:203
const char * winname(void)
Definition: xosview.cc:255
int legend_
Definition: xosview.h:51
void checkOverallResources()
Definition: xosview.cc:233
void checkVersion(int argc, char *argv[]) const
Definition: xosview.cc:149
int caption_
Definition: xosview.h:51
void draw(void)
Definition: xosview.cc:302
int nummeters_
Definition: xosview.h:51
void usleep_via_select(unsigned long usec)
MeterNode * meters_
Definition: xosview.h:49
unsigned long usleeptime_
Definition: xosview.h:53
int xoff(void) const
Definition: xosview.h:31
int findy(void)
Definition: xosview.cc:226
int usedlabels_
Definition: xosview.h:51
int hmargin_
Definition: xosview.h:52
void unmapEvent(XUnmapEvent &event)
Definition: xosview.cc:458
enum windowVisibilityState windowVisibility
Definition: xosview.h:75
bool _deferred_resize
Definition: xosview.h:73
enum windowVisibilityState getWindowVisibilityState(void)
Definition: xosview.h:35
int yoff_
Definition: xosview.h:51
void resize(void)
Definition: xosview.cc:266
unsigned long sleeptime_
Definition: xosview.h:53
void resizeEvent(XConfigureEvent &event)
Definition: xosview.cc:419
XOSView(const char *instName, int argc, char *argv[])
Definition: xosview.cc:62
void checkMeterResources(void)
Definition: xosview.cc:180
void figureSize(void)
Definition: xosview.cc:160
int newypos(void)
Definition: xosview.cc:189
int vspacing_
Definition: xosview.h:52
int vmargin_
Definition: xosview.h:52
void dolegends(void)
Definition: xosview.cc:193
Xrm xrm
Definition: xosview.h:39
int findx(void)
Definition: xosview.cc:216
void exposeEvent(XExposeEvent &event)
Definition: xosview.cc:409
void run(void)
Definition: xosview.cc:319
int xoff_
Definition: xosview.h:51
windowVisibilityState
Definition: xosview.h:34
@ PARTIALLY_VISIBILE
Definition: xosview.h:34
@ FULLY_VISIBLE
Definition: xosview.h:34
@ OBSCURED
Definition: xosview.h:34
~XOSView(void)
Definition: xosview.cc:292
bool _deferred_redraw
Definition: xosview.h:74
Definition: xwin.h:15
Definition: Xrm.h:15
double MAX_SAMPLES_PER_SECOND
Definition: xosview.cc:60