/
w_util.h
59 lines (51 loc) · 1.71 KB
/
w_util.h
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
/*
* FIG : Facility for Interactive Generation of figures
* Copyright (c) 1985 by Supoj Sutanthavibul
*
* "Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both the copyright
* notice and this permission notice appear in supporting documentation.
* No representations are made about the suitability of this software for
* any purpose. It is provided "as is" without express or implied warranty."
*/
/* constant values used for popup_query */
#define QUERY_YES 0
#define QUERY_YESNO 1
#define RESULT_NO -1
#define RESULT_YES 1
#define RESULT_CANCEL 0
/*
* Author: Doyle C. Davidson
* Intergraph Corporation
* One Madison Industrial Park
* Huntsville, Al. 35894-0001
*
* Modification history:
* 11 May 91 - added SetValues and GetValues - Paul King
*
* My macros for using XtSetArg easily:
* Usage:
*
* blah()
* {
* DeclareArgs(2);
* ...
* FirstArg(XmNx, 100);
* NextArg(XmNy, 80);
* button = XmCreatePushButton(parent, name, Args, ArgCount);
* }
*/
#include "assert.h"
#define ArgCount _fooArgCount
#define Args _fooArgList
#define ArgCountMax _fooArgCountMax
#define DeclareArgs(n) Arg Args[n]; int ArgCountMax = n; int ArgCount
#define DeclareStaticArgs(n) static Arg Args[n]; static int ArgCountMax = n; static int ArgCount
#define FirstArg(name, val) \
{ XtSetArg(Args[0], (name), (val)); ArgCount=1;}
#define NextArg(name, val) \
{ assert(ArgCount < ArgCountMax); \
XtSetArg(Args[ArgCount], (name), (val)); ArgCount++;}
#define GetValues(n) XtGetValues(n, Args, ArgCount)
#define SetValues(n) XtSetValues(n, Args, ArgCount)