ARB
aw_xargs.hxx
Go to the documentation of this file.
1 // ============================================================= //
2 // //
3 // File : aw_xargs.hxx //
4 // Purpose : //
5 // //
6 // Coded by Ralf Westram (coder@reallysoft.de) in March 2012 //
7 // Institute of Microbiology (Technical University Munich) //
8 // http://www.arb-home.de/ //
9 // //
10 // ============================================================= //
11 
12 #ifndef AW_XARGS_HXX
13 #define AW_XARGS_HXX
14 
15 #ifndef ARBTOOLS_H
16 #include <arbtools.h>
17 #endif
18 #ifndef _XtIntrinsic_h
19 #include <X11/Intrinsic.h>
20 #endif
21 
22 class aw_xargs : virtual Noncopyable {
23  Arg *arg;
24  size_t max;
25  size_t count;
26 public:
27  aw_xargs(size_t maxcount)
28  : arg(new Arg[maxcount]),
29  max(maxcount),
30  count(0)
31  {}
33  delete [] arg;
34  }
35 
36  Arg *list() { return arg; }
37  int size() { return count; }
38 
39  void add(String name, XtArgVal value) {
40  aw_assert(count<max);
41  XtSetArg(arg[count], name, value);
42  count++;
43  }
44 
46  XtSetValues(w, list(), size());
47  }
48 };
49 
50 
51 #else
52 #error aw_xargs.hxx included twice
53 #endif // AW_XARGS_HXX
Arg * list()
Definition: aw_xargs.hxx:36
const char * String
Definition: gb_aci_impl.h:59
aw_xargs(size_t maxcount)
Definition: aw_xargs.hxx:27
#define aw_assert(bed)
Definition: aw_position.hxx:29
void assign_to_widget(Widget w)
Definition: aw_xargs.hxx:45
~aw_xargs()
Definition: aw_xargs.hxx:32
int size()
Definition: aw_xargs.hxx:37
void add(String name, XtArgVal value)
Definition: aw_xargs.hxx:39
struct _WidgetRec * Widget
Definition: aw_base.hxx:48