File: xosview.h

package info (click to toggle)
xosview 1.7.3-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,000 kB
  • ctags: 1,200
  • sloc: cpp: 7,317; sh: 1,760; ansic: 368; makefile: 46; awk: 20
file content (88 lines) | stat: -rw-r--r-- 2,233 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//  
//  Copyright (c) 1994, 1995 by Mike Romberg ( romberg@fsl.noaa.gov )
//
//  This file may be distributed under terms of the GPL
//
//
// $Id: xosview.h,v 1.11 1999/02/26 23:36:20 bgrayson Exp $
//
#ifndef _XOSVIEW_H_
#define _XOSVIEW_H_

#define XOSVIEW_H_CVSID	"$Id: xosview.h,v 1.11 1999/02/26 23:36:20 bgrayson Exp $"

#include "xwin.h"
#include "Xrm.h"  //  For Xrm resource manager class.


/*  Take at most n samples per second (default of 10)  */
extern double MAX_SAMPLES_PER_SECOND;

class Meter;

class XOSView : public XWin {
public:
  XOSView( char* instName, int argc, char *argv[] );
  ~XOSView( void );

  void figureSize ( void );
  void resize( void );
  void reallydraw( void );
  void draw ( void );
  void run( void );
  void keyrelease( char *ch );
  const char *winname( void );

  // used by meter makers
  int xoff(void) const { return xoff_; }
  int newypos( void );

  int hasBeenExposedAtLeastOnce() const {return exposed_once_flag_; }
  int isExposed() const { return expose_flag_; }
  int isFullyVisible() const { return _isvisible && !_ispartiallyvisible; }
  int isAtLeastPartiallyVisible() const { return _isvisible; }

protected:

  Xrm xrm;
  void checkArgs (int argc, char** argv) const;
  class MeterNode {
  public:
    MeterNode( Meter *fm ) { meter_ = fm;  next_ = NULL; }

    Meter *meter_;
    MeterNode *next_;
  };

  MeterNode *meters_;
  
  int caption_, legend_, xoff_, yoff_, nummeters_, usedlabels_;
  unsigned long sleeptime_, usleeptime_;

  int expose_flag_, exposed_once_flag_;

  void usleep_via_select( unsigned long usec );
  void addmeter( Meter *fm );
  void checkMeterResources( void );

  int findx( void );
  int findy( void );
  void dolegends( void );

  void checkOverallResources();
  void resizeEvent( XEvent & );
  void exposeEvent( XExposeEvent &event );
  void keyPressEvent( XKeyEvent &event );
  void visibilityEvent( XVisibilityEvent &event );
  void unmapEvent( XUnmapEvent &event);
private:

  bool _isvisible;
  bool _ispartiallyvisible;
};

/*  Make XOSDEBUG("This is a format string.  %d %d\n", a, b); look
 *  like if (0) printf("This ..."...);.  Change the 0 to a 1, to
 *  enable these debugging outputs.  */
#define XOSDEBUG	if (0) printf
#endif