root/foundation-apps/grosview-maxx/xosview.h

Revision 2, 2.3 KB (checked in by emasson, 3 years ago)

initial import for the community edition

Line 
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// $Id: xosview.h,v 1.1.1.1 2008/05/04 15:53:48 emasson Exp $
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/*  Take at most n samples per second (default of 10)  */
19extern double MAX_SAMPLES_PER_SECOND;
20
21class Meter;
22
23class XOSView : public XWin {
24public:
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  // used by meter makers
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
45protected:
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
81private:
82
83  bool _isvisible;
84  bool _ispartiallyvisible;
85};
86
87/*  Make XOSDEBUG("This is a format string.  %d %d\n", a, b); look
88 *  like if (0) printf("This ..."...);.  Change the 0 to a 1, to
89 *  enable these debugging outputs.  */
90#define XOSDEBUG        if (0) printf
91#endif
Note: See TracBrowser for help on using the browser.