| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | #ifndef _XOSVIEW_H_ |
|---|
| 10 | #define _XOSVIEW_H_ |
|---|
| 11 | |
|---|
| 12 | #define XOSVIEW_H_CVSID "$Id: xosview.h,v 1.1.1.1 2008/05/04 15:53:48 emasson Exp $" |
|---|
| 13 | |
|---|
| 14 | #include "xwin.h" |
|---|
| 15 | #include "Xrm.h" // For Xrm resource manager class. |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | extern double MAX_SAMPLES_PER_SECOND; |
|---|
| 20 | |
|---|
| 21 | class Meter; |
|---|
| 22 | |
|---|
| 23 | class XOSView : public XWin { |
|---|
| 24 | public: |
|---|
| 25 | XOSView( char* instName, int argc, char *argv[] ); |
|---|
| 26 | ~XOSView( void ); |
|---|
| 27 | |
|---|
| 28 | void figureSize ( void ); |
|---|
| 29 | void resize( void ); |
|---|
| 30 | void reallydraw( void ); |
|---|
| 31 | void draw ( void ); |
|---|
| 32 | void run( void ); |
|---|
| 33 | void keyrelease( char *ch ); |
|---|
| 34 | const char *winname( void ); |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | int xoff(void) const { return xoff_; } |
|---|
| 38 | int newypos( void ); |
|---|
| 39 | |
|---|
| 40 | int hasBeenExposedAtLeastOnce() const {return exposed_once_flag_; } |
|---|
| 41 | int isExposed() const { return expose_flag_; } |
|---|
| 42 | int isFullyVisible() const { return _isvisible && !_ispartiallyvisible; } |
|---|
| 43 | int isAtLeastPartiallyVisible() const { return _isvisible; } |
|---|
| 44 | |
|---|
| 45 | protected: |
|---|
| 46 | |
|---|
| 47 | Xrm xrm; |
|---|
| 48 | void checkArgs (int argc, char** argv) const; |
|---|
| 49 | class MeterNode { |
|---|
| 50 | public: |
|---|
| 51 | MeterNode( Meter *fm ) { meter_ = fm; next_ = NULL; } |
|---|
| 52 | |
|---|
| 53 | Meter *meter_; |
|---|
| 54 | MeterNode *next_; |
|---|
| 55 | }; |
|---|
| 56 | |
|---|
| 57 | MeterNode *meters_; |
|---|
| 58 | |
|---|
| 59 | int caption_, legend_, xoff_, yoff_, nummeters_, usedlabels_; |
|---|
| 60 | int hmargin_, vmargin_, vspacing_; |
|---|
| 61 | unsigned long sleeptime_, usleeptime_; |
|---|
| 62 | |
|---|
| 63 | int expose_flag_, exposed_once_flag_; |
|---|
| 64 | |
|---|
| 65 | void usleep_via_select( unsigned long usec ); |
|---|
| 66 | void addmeter( Meter *fm ); |
|---|
| 67 | void checkMeterResources( void ); |
|---|
| 68 | |
|---|
| 69 | int findx( void ); |
|---|
| 70 | int findy( void ); |
|---|
| 71 | void dolegends( void ); |
|---|
| 72 | |
|---|
| 73 | void checkOverallResources(); |
|---|
| 74 | void resizeEvent( XEvent & ); |
|---|
| 75 | void exposeEvent( XExposeEvent &event ); |
|---|
| 76 | void keyPressEvent( XKeyEvent &event ); |
|---|
| 77 | void visibilityEvent( XVisibilityEvent &event ); |
|---|
| 78 | void unmapEvent( XUnmapEvent &event); |
|---|
| 79 | void checkVersion(int argc, char *argv[]) const; |
|---|
| 80 | |
|---|
| 81 | private: |
|---|
| 82 | |
|---|
| 83 | bool _isvisible; |
|---|
| 84 | bool _ispartiallyvisible; |
|---|
| 85 | }; |
|---|
| 86 | |
|---|
| 87 | |
|---|
| 88 | |
|---|
| 89 | |
|---|
| 90 | #define XOSDEBUG if (0) printf |
|---|
| 91 | #endif |
|---|