summaryrefslogtreecommitdiff
path: root/src/libnml/nml/nml_oi.hh
blob: 2f3ec4be519c981df212ba42108e9a06df1ac6b3 (plain)
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
/********************************************************************
* Description: nml_oi.cc
*   Defines Generic NML Message structures used to log errors and
*   interact with an Operator Interface from within an NML_MODULE.
*
*   Derived from a work by Fred Proctor & Will Shackleford
*
* Author:
* License: LGPL Version 2
* System: Linux
*    
* Copyright (c) 2004 All rights reserved.
*
* Last change: 
********************************************************************/

#ifndef NML_OI_HH
#define NML_OI_HH

#include "cms.hh"		// class CMS
#include "nml.hh"		// class NML
#include "nmlmsg.hh"		// class NMLmsg

// NML operator interface stuff for errors, text, and graphics display

#define NML_ERROR_TYPE    ((NMLTYPE) 1)
#define NML_TEXT_TYPE     ((NMLTYPE) 2)
#define NML_DISPLAY_TYPE  ((NMLTYPE) 3)

// Sizes for strings for the above messages

#define NML_ERROR_LEN 256
#define NML_TEXT_LEN 256
#define NML_DISPLAY_LEN 256

class NML_ERROR:public NMLmsg {
  public:
    NML_ERROR():NMLmsg(NML_ERROR_TYPE, sizeof(NML_ERROR)) {
    };
    ~NML_ERROR() {
    };

    void update(CMS * cms);
    char error[NML_ERROR_LEN];
};

class NML_TEXT:public NMLmsg {
  public:
    NML_TEXT():NMLmsg(NML_TEXT_TYPE, sizeof(NML_TEXT)) {
    };
    ~NML_TEXT() {
    };

    void update(CMS * cms);
    char text[NML_TEXT_LEN];
};

class NML_DISPLAY:public NMLmsg {
  public:
    NML_DISPLAY():NMLmsg(NML_DISPLAY_TYPE, sizeof(NML_DISPLAY)) {
    };
    ~NML_DISPLAY() {
    };

    void update(CMS * cms);
    char display[NML_DISPLAY_LEN];
};

// NML format function
extern int nmlErrorFormat(NMLTYPE type, void *buffer, CMS * cms);

#endif