UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
param.H
1 /* param.H */
2 /* $Id: param.H,v 1.4 2009/04/14 12:11:23 vlad Exp $ */
3 #ifndef __param_H
4 #define __param_H
5 
6 #include <stdio.h>
7 #include <string.h>
8 #include <stdarg.h>
9 #include <X11/Intrinsic.h>
10 #include <csi/memctl.H>
11 
12 
17 class ParType
18 {
19 public:
20 
22  virtual size_t size (MemBlock* mb) const = 0;
23 
25  virtual const char* base_type () const = 0;
26 
28  virtual Logic eq (MemBlock* mb1, MemBlock* mb2) = 0;
29 
31  virtual void text_input (MemBlock* mb, FILE* stream) = 0;
32 
34  virtual void text_output (MemBlock* mb, FILE* stream) = 0;
35 
37  virtual void init (MemBlock* mb) = 0;
38 
40  virtual void set_value (MemBlock* mb, va_list val) = 0;
41 
43  virtual void get_value (MemBlock* mb, va_list val) = 0;
44 
47  void set_text_value (MemBlock* mb, const char* text);
48 
51  void get_text_value (MemBlock* mb, char*& text);
52 
53 };
54 
55 
57 struct ParDesc
58 {
59  char *name;
60  char *type;
61  char *targ;
62  char *label;
63  char *anno;
65 };
66 
67 
68 /*************************************************************
69  * Table of parameters description.
70  */
71 #define AnyType ParDesc
72 #define AnyAr ParDescAr
73 #define AnyFormatSpec "\n%d: name='%s' type='%s' targ='%s' label='%s' anno='%s'"
74 #define AnyPrintList i, item.name, item.type, item.targ, item.label, item.anno
75 #define AnyCmp(x,y) strcmp(x.name, y.name)
76 #include <mix/AnyAr.H>
77 
78 
79 class Protocol;
80 
85 class ParView
86 {
87 protected:
88 
90  char name[PEP_MAX_NAME_LEN+1];
91 
93  char help_section[2*PEP_MAX_NAME_LEN+2];
94 
97 
99  Widget form;
100 
101 public:
102 
103  ParView (Protocol* protocol, const char* pname, Widget wParent);
104  virtual ~ParView ();
105 
107  operator Widget ()
108  { return form; }
109 
111  virtual void view_publish () = 0;
112 
114  virtual void view_absorb () = 0;
115 
117  const char* help_ref () const
118  { return help_section; }
119 
121  virtual void start_client () { /* empty */ };
122 
124  virtual void finish_client () { /* empty */ };
125 
126 };
127 
128 
129 #endif /* param.H */
Widget form
Definition: param.H:99
Protocol & pep
Definition: param.H:96
char * name
Definition: param.H:59
virtual void view_absorb()=0
virtual void init(MemBlock *mb)=0
virtual Logic eq(MemBlock *mb1, MemBlock *mb2)=0
char * label
Definition: param.H:62
char * targ
Definition: param.H:61
Definition: param.H:57
char help_section[2 *PEP_MAX_NAME_LEN+2]
Definition: param.H:93
void set_text_value(MemBlock *mb, const char *text)
virtual void finish_client()
Definition: param.H:124
virtual void start_client()
Definition: param.H:121
void get_text_value(MemBlock *mb, char *&text)
char name[PEP_MAX_NAME_LEN+1]
Definition: param.H:90
char * anno
Definition: param.H:63
Definition: memctl.H:27
Definition: param.H:17
virtual void text_input(MemBlock *mb, FILE *stream)=0
Definition: pep.H:23
Definition: param.H:85
virtual const char * base_type() const =0
virtual size_t size(MemBlock *mb) const =0
const char * help_ref() const
Definition: param.H:117
virtual void text_output(MemBlock *mb, FILE *stream)=0
ParType * ptype
Definition: param.H:64
virtual void get_value(MemBlock *mb, va_list val)=0
virtual void set_value(MemBlock *mb, va_list val)=0
char * type
Definition: param.H:60
virtual void view_publish()=0