home *** CD-ROM | disk | FTP | other *** search
/ Netscape Plug-Ins Developer's Kit / Netscape_Plug-Ins_Developers_Kit.iso / source / Chap09 / NPTREE / NPWINDOW.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-21  |  1.2 KB  |  102 lines

  1.  
  2. #ifndef _NPWINDOW_H_
  3. #define _NPWINDOW_H_
  4.  
  5. #include "..\inc\npapi.h"
  6. #include <afxcmn.h>
  7.  
  8. #define ID_TREE    200
  9. #define NUM        5
  10.  
  11. //#define ID_UPDATE_CHART        1000
  12.  
  13. // vmstat structure
  14.  
  15. typedef struct
  16. {
  17.     // Threads
  18.  
  19.     int    r;
  20.     int b;
  21.     int    w;
  22.  
  23.     // Memory
  24.  
  25.     int avm;
  26.     int fre;
  27.  
  28.     // Pages
  29.  
  30.     int re;
  31.     int at;
  32.     int pi;
  33.     int po;
  34.     int fr;
  35.     int de;
  36.     int sr;
  37.     int d0;
  38.     int s1;
  39.     int s2;
  40.     int s3;
  41.     
  42.     // Faults
  43.  
  44.     int interrupts;
  45.     int syscalls;
  46.     int contextswitch;
  47.  
  48.     // CPU
  49.  
  50.     int user;
  51.     int system;
  52.     int idle;
  53.  
  54. } VMSTAT;
  55.  
  56.  
  57.  
  58. class CPluginWindow;
  59. class CCpuMon;
  60.  
  61. //
  62. // CPluginWindow:
  63. //
  64. class CPluginWindow : public CFrameWnd
  65. {
  66.  
  67. #define NUM 5
  68.     
  69. protected:
  70.     CCpuMon*  pCpuMon;
  71.     HTREEITEM hTreeCtrl[NUM];
  72.     HTREEITEM hTreeCurrent;
  73.  
  74. private:
  75.     VMSTAT    vmstat;
  76.     char    FileLine[1024];
  77.  
  78. public:
  79.  
  80. //    CButton*    cbUpdate;
  81.     CTreeCtrl m_Tree;
  82.     void InitTree();
  83.  
  84.     CPluginWindow (CCpuMon *pCpuMon);
  85.     ~CPluginWindow();
  86.  
  87.     void    InitWindow (void);
  88.     void    CleanupWindow (void);
  89. //    BOOL    UpdateChart (FILE* fp);
  90. //    void    DrawRects (CDC* dc);
  91.  
  92.     //{{AFX_MSG( CMainWindow )
  93.     afx_msg void OnPaint();
  94.     //}}AFX_MSG
  95.  
  96.     DECLARE_MESSAGE_MAP()
  97. };
  98.  
  99.  
  100. #endif /* _NPWINDOW_H_ */
  101.  
  102.