~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to gui/GraphLib/libsrc/uimxR5/src/enum_type.c

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*---------------------------------------------------------------------
 
2
 * $Date: 2009-08-18 15:23:20 $             $Revision: 1.2 $
 
3
 *---------------------------------------------------------------------
 
4
 *
 
5
 *             Copyright (c) 1990, Visual Edge Software Ltd.
 
6
 *
 
7
 * ALL  RIGHTS  RESERVED.  Permission  to  use,  copy,  modify,  and
 
8
 * distribute  this  software  and its documentation for any purpose
 
9
 * and  without  fee  is  hereby  granted,  provided  that the above
 
10
 * copyright  notice  appear  in  all  copies  and  that  both  that
 
11
 * copyright  notice and this permission notice appear in supporting
 
12
 * documentation,  and that  the name of Visual Edge Software not be
 
13
 * used  in advertising  or publicity  pertaining to distribution of
 
14
 * the software without specific, written prior permission. The year
 
15
 * included in the notice is the year of the creation of the work.
 
16
 *-------------------------------------------------------------------*/
 
17
/*
 
18
.VERSION
 
19
 090812         last modif KB
 
20
*/
 
21
 
 
22
 
 
23
#include <stdio.h>
 
24
#include <string.h>
 
25
#include "ctype.h"
 
26
 
 
27
#include <X11/StringDefs.h>
 
28
#include <X11/Intrinsic.h>
 
29
#include <X11/Shell.h>
 
30
 
 
31
#include <X11/X.h> /* included for the win gravity resource */
 
32
 
 
33
#include <Xm/Xm.h>
 
34
#include <Xm/MwmUtil.h>
 
35
 
 
36
#ifndef RUNTIME
 
37
 
 
38
#include "veos.h"
 
39
#include "valuesOf.h"   /* included just so the compiler will cross-check */
 
40
#include "swidget.h"
 
41
 
 
42
#ifdef MOTIF_WIDGETS
 
43
#include "scrBar.cl.h"
 
44
#endif /* MOTIF_WIDGETS */
 
45
 
 
46
#else
 
47
#include "UxLib.h"
 
48
#endif /* RUNTIME */
 
49
 
 
50
#include "utype.h"
 
51
#include "types.h"
 
52
#include "vtypes.h"
 
53
#include "valloc.h"
 
54
#include "global.h"
 
55
#include "tkdefaults.h"
 
56
#include "uimx_cat.h"
 
57
#include "misc1_ds.h"
 
58
 
 
59
#include "UxDialSh.h"
 
60
 
 
61
/* X/OPEN message catalog macros. These will make the code more compact. */
 
62
#define CGETS(ms,ds_ms)                 UxCatGets(MC_MISC1,ms,ds_ms)
 
63
 
 
64
 
 
65
extern int UxStrEqual();
 
66
extern void UxAddXValues(), UxAddUserDefEnumTypes();
 
67
 
 
68
 
 
69
 
 
70
/* string conversions in alphabetical order */
 
71
/* ------------------------------------------------------------------------*/
 
72
 
 
73
/*---------------------------------------------------------------
 
74
 * Boolean and Bool have same Uimx strings, different X type
 
75
 *---------------------------------------------------------------*/
 
76
 
 
77
static char *uBoolean[] = {
 
78
        "true", "false"
 
79
};
 
80
static unsigned char xBoolean[] = {
 
81
        1, 0
 
82
};
 
83
static int xBool[] = {
 
84
        1, 0
 
85
};
 
86
 
 
87
#ifndef RUNTIME
 
88
int UxValuesOfBoolean(ulist, n)
 
89
char ***ulist;
 
90
int *n;
 
91
{
 
92
        *ulist = uBoolean;
 
93
        *n = XtNumber(uBoolean);
 
94
        return *n;
 
95
}
 
96
 
 
97
int UxValuesOfBool(ulist, n)
 
98
char ***ulist;
 
99
int *n;
 
100
{
 
101
        return UxValuesOfBoolean (ulist, n);
 
102
}
 
103
 
 
104
int UxValidateBoolean(rs, s)
 
105
swidget rs;
 
106
char *s;
 
107
{
 
108
        int i, n=XtNumber(uBoolean);
 
109
 
 
110
        if (s == NULL)
 
111
                return ERROR;
 
112
        for (i=0; i<n; i++)
 
113
                if (UxStrEqual(s, uBoolean[i]))
 
114
                        return NO_ERROR;
 
115
        return ERROR;
 
116
}
 
117
 
 
118
int UxValidateBool(rs, s)
 
119
swidget rs;
 
120
char *s;
 
121
{
 
122
        return UxValidateBoolean(rs, s);
 
123
}
 
124
#endif /* ! RUNTIME */
 
125
 
 
126
/* ------------------------------------------------------------------------*/
 
127
 
 
128
static char *uInitialWindowState[] = {
 
129
        "DontCareState", "NormalState", "ZoomState", 
 
130
        "IconicState", "InactiveState"
 
131
};
 
132
static int  xInitialWindowState[] = {
 
133
        DontCareState, NormalState, ZoomState,
 
134
        IconicState, InactiveState
 
135
};
 
136
 
 
137
#ifndef RUNTIME
 
138
int UxValuesOfInitialWindowState(ulist, n)
 
139
char ***ulist;
 
140
int *n;
 
141
{
 
142
        *ulist = uInitialWindowState;
 
143
        *n = XtNumber(uInitialWindowState);
 
144
        return *n;
 
145
}
 
146
 
 
147
int UxValidateInitialWindowState(rs, s)
 
148
swidget rs;
 
149
char *s;
 
150
{
 
151
        int i, n=XtNumber(uInitialWindowState);
 
152
 
 
153
        if (s == NULL)
 
154
                return ERROR;
 
155
        for (i=0; i<n; i++)
 
156
                if (UxStrEqual(s, uInitialWindowState[i]))
 
157
                        return NO_ERROR;
 
158
        return ERROR;
 
159
}
 
160
#endif /* ! RUNTIME */
 
161
 
 
162
/* ------------------------------------------------------------------------*/
 
163
 
 
164
#ifdef VE_INTERNAL
 
165
static char *uWhichButton[] = {
 
166
        "button1", "button2", "button3", 
 
167
        "button4", "button5"
 
168
};
 
169
static unsigned char xWhichButton[] = {
 
170
        Button1, Button2, Button3,
 
171
        Button4, Button5
 
172
};
 
173
 
 
174
#ifndef RUNTIME
 
175
int UxValuesOfWhichButton(ulist, n)
 
176
char ***ulist;
 
177
int *n;
 
178
{
 
179
        *ulist = uWhichButton;
 
180
        *n = XtNumber(uWhichButton);
 
181
        return *n;
 
182
}
 
183
 
 
184
int UxValidateWhichButton(rs, s)
 
185
swidget rs;
 
186
char *s;
 
187
{
 
188
        int i, n=XtNumber(uWhichButton);
 
189
 
 
190
        if (s == NULL)
 
191
                return ERROR;
 
192
        for (i=0; i<n; i++)
 
193
                if (UxStrEqual(s, uWhichButton[i]))
 
194
                        return NO_ERROR;
 
195
        return ERROR;
 
196
}
 
197
#endif /* ! RUNTIME */
 
198
#endif /* VE_INTERNAL */
 
199
 
 
200
/* ------------------------------------------------------------------------*/
 
201
 
 
202
#ifndef RUNTIME
 
203
 
 
204
/** Resize recursion is a Compound resource;
 
205
 ** the X Values never actually put to use.
 
206
 **/
 
207
 
 
208
static  char *uResizeRecursion[] = {
 
209
        "none",
 
210
        "up",
 
211
        "down"
 
212
};
 
213
 
 
214
static  int  xResizeRecursion[] = {
 
215
        -1, 0, 1
 
216
};
 
217
 
 
218
int     UxValuesOfResizeRecursion(ulist, n)
 
219
char    ***ulist;
 
220
int     *n;
 
221
{
 
222
        *ulist = uResizeRecursion;
 
223
        *n = XtNumber(uResizeRecursion);
 
224
        return( *n );
 
225
}
 
226
 
 
227
int     UxValidateResizeRecursion(rs, s)
 
228
swidget rs;
 
229
char *s;
 
230
{
 
231
        int i, n=XtNumber(uResizeRecursion);
 
232
 
 
233
        for (i=0; i<n; i++)
 
234
                if (UxStrEqual(s, uResizeRecursion[i]))
 
235
                        return NO_ERROR;
 
236
        return ERROR;
 
237
}
 
238
 
 
239
static  char *uDragRecursion[] = {
 
240
        "none",
 
241
        "up",
 
242
};
 
243
 
 
244
static  int  xDragRecursion[] = {
 
245
        0, 1
 
246
};
 
247
 
 
248
int     UxValuesOfDragRecursion(ulist, n)
 
249
char    ***ulist;
 
250
int     *n;
 
251
{
 
252
        *ulist = uDragRecursion;
 
253
        *n = XtNumber(uDragRecursion);
 
254
        return( *n );
 
255
}
 
256
 
 
257
int     UxValidateDragRecursion(rs, s)
 
258
swidget rs;
 
259
char *s;
 
260
{
 
261
        int i, n=XtNumber(uDragRecursion);
 
262
 
 
263
        for (i=0; i<n; i++)
 
264
                if (UxStrEqual(s, uDragRecursion[i]))
 
265
                        return NO_ERROR;
 
266
        return ERROR;
 
267
}
 
268
#endif /* ! RUNTIME */
 
269
 
 
270
/* ------------------------------------------------------------------------*/
 
271
 
 
272
static  char *uAlignment[] = {
 
273
        "alignment_center", "alignment_end", 
 
274
        "alignment_beginning"
 
275
        
 
276
};
 
277
static  unsigned char xAlignment[] = {
 
278
        XmALIGNMENT_CENTER, XmALIGNMENT_END,
 
279
        XmALIGNMENT_BEGINNING
 
280
};
 
281
 
 
282
#ifndef RUNTIME
 
283
int UxValuesOfAlignment(ulist, n)
 
284
char ***ulist;
 
285
int *n;
 
286
{
 
287
        *ulist = uAlignment;
 
288
        *n = XtNumber(uAlignment);
 
289
        return *n;
 
290
}
 
291
 
 
292
int UxValidateAlignment(rs, s)
 
293
swidget rs;
 
294
char *s;
 
295
{
 
296
        int i, n=XtNumber(uAlignment);
 
297
 
 
298
        if (s == NULL)
 
299
                return ERROR;
 
300
        for (i=0; i<n; i++)
 
301
                if (UxStrEqual(s, uAlignment[i]))
 
302
                        return NO_ERROR;
 
303
        return ERROR;
 
304
}
 
305
#endif /* ! RUNTIME */
 
306
 
 
307
/* ------------------------------------------------------------------------*/
 
308
 
 
309
static  char *uEntryVerticalAlignment[] = {
 
310
        "alignment_baseline_bottom", "alignment_baseline_top",
 
311
        "alignment_contents_bottom", "alignment_center",
 
312
        "alignment_contents_top"
 
313
 
 
314
};
 
315
static  unsigned char xEntryVerticalAlignment[] = {
 
316
        XmALIGNMENT_BASELINE_BOTTOM, XmALIGNMENT_BASELINE_TOP,
 
317
        XmALIGNMENT_CONTENTS_BOTTOM, XmALIGNMENT_CENTER,
 
318
        XmALIGNMENT_CONTENTS_TOP
 
319
};
 
320
 
 
321
#ifndef RUNTIME
 
322
 
 
323
int UxValuesOfEntryVerticalAlignment(ulist, n)
 
324
char ***ulist;
 
325
int *n;
 
326
{
 
327
        *ulist = uEntryVerticalAlignment;
 
328
        *n = XtNumber(uEntryVerticalAlignment);
 
329
        return *n;
 
330
}
 
331
 
 
332
int UxValidateEntryVerticalAlignment(rs, s)
 
333
swidget rs;
 
334
char *s;
 
335
{
 
336
        int i, n=XtNumber(uEntryVerticalAlignment);
 
337
 
 
338
        if (s == NULL)
 
339
                return ERROR;
 
340
        for (i=0; i<n; i++)
 
341
                if (UxStrEqual(s, uEntryVerticalAlignment[i]))
 
342
                        return NO_ERROR;
 
343
        return ERROR;
 
344
}
 
345
#endif /* ! RUNTIME */
 
346
 
 
347
/* ------------------------------------------------------------------------*/
 
348
 
 
349
static  char *uChildVerticalAlignment[] = {
 
350
        "alignment_baseline_bottom", "alignment_baseline_top", 
 
351
        "alignment_widget_top", "alignment_center", 
 
352
        "alignment_widget_bottom"
 
353
        
 
354
};
 
355
static  unsigned char xChildVerticalAlignment[] = {
 
356
        XmALIGNMENT_BASELINE_BOTTOM, XmALIGNMENT_BASELINE_TOP,
 
357
        XmALIGNMENT_WIDGET_TOP, XmALIGNMENT_CENTER,
 
358
        XmALIGNMENT_WIDGET_BOTTOM
 
359
};
 
360
 
 
361
#ifndef RUNTIME
 
362
 
 
363
int UxValuesOfChildVerticalAlignment(ulist, n)
 
364
char ***ulist;
 
365
int *n;
 
366
{
 
367
        *ulist = uChildVerticalAlignment;
 
368
        *n = XtNumber(uChildVerticalAlignment);
 
369
        return *n;
 
370
}
 
371
 
 
372
int UxValidateChildVerticalAlignment(rs, s)
 
373
swidget rs;
 
374
char *s;
 
375
{
 
376
        int i, n=XtNumber(uChildVerticalAlignment);
 
377
 
 
378
        if (s == NULL)
 
379
                return ERROR;
 
380
        for (i=0; i<n; i++)
 
381
                if (UxStrEqual(s, uChildVerticalAlignment[i]))
 
382
                        return NO_ERROR;
 
383
        return ERROR;
 
384
}
 
385
#endif /* ! RUNTIME */
 
386
 
 
387
/* ------------------------------------------------------------------------*/
 
388
 
 
389
static  char *uArrowDirection[] = {
 
390
        "arrow_up", "arrow_down", "arrow_left", 
 
391
        "arrow_right"
 
392
};
 
393
 
 
394
static  unsigned char xArrowDirection[] = {
 
395
        XmARROW_UP, XmARROW_DOWN, XmARROW_LEFT,
 
396
        XmARROW_RIGHT
 
397
};
 
398
 
 
399
#ifndef RUNTIME
 
400
int UxValuesOfArrowDirection(ulist, n)
 
401
char ***ulist;
 
402
int *n;
 
403
{
 
404
        *ulist = uArrowDirection;
 
405
        *n = XtNumber(uArrowDirection);
 
406
        return *n;
 
407
}
 
408
 
 
409
int UxValidateArrowDirection(rs, s)
 
410
swidget rs;
 
411
char *s;
 
412
{
 
413
        int i, n=XtNumber(uArrowDirection);
 
414
 
 
415
        if (s == NULL)
 
416
                return ERROR;
 
417
        for (i=0; i<n; i++)
 
418
                if (UxStrEqual(s, uArrowDirection[i]))
 
419
                        return NO_ERROR;
 
420
        return ERROR;
 
421
}
 
422
#endif /* ! RUNTIME */
 
423
 
 
424
/* ------------------------------------------------------------------------*/
 
425
 
 
426
static  char *uAttachmentType[] = {
 
427
        "attach_none", "attach_form", 
 
428
        "attach_opposite_form", "attach_widget", 
 
429
        "attach_opposite_widget", "attach_position", 
 
430
        "attach_self"
 
431
};
 
432
static  unsigned char xAttachmentType[] = {
 
433
        XmATTACH_NONE, XmATTACH_FORM, 
 
434
        XmATTACH_OPPOSITE_FORM, XmATTACH_WIDGET, 
 
435
        XmATTACH_OPPOSITE_WIDGET, XmATTACH_POSITION,
 
436
        XmATTACH_SELF
 
437
};
 
438
 
 
439
#ifndef RUNTIME
 
440
int UxValuesOfAttachmentType(ulist, n)
 
441
char ***ulist;
 
442
int *n;
 
443
{
 
444
        static char *values[1];
 
445
        static char **val;
 
446
        static Boolean first_time = TRUE;
 
447
        int nu = XtNumber(uAttachmentType);
 
448
        int nv = XtNumber(values);
 
449
 
 
450
        
 
451
        if (first_time)
 
452
        {
 
453
                int             i;
 
454
                extern char     *UxCopyString();
 
455
 
 
456
                values[0] = UxCopyString(CGETS(MS_MISC_ATTACHMENT_MSG1, 
 
457
                                DS_MS_MISC_ATTACHMENT_MSG1));
 
458
                val = (char **) UxCalloc(nu+nv, sizeof(char *));
 
459
                for (i=0; i< nu; i++)
 
460
                        val[i] = uAttachmentType[i];
 
461
                for (i=nu; i< (nu+nv); i++)
 
462
                        val[i] = values[i-nu];
 
463
                first_time = FALSE;
 
464
        }
 
465
 
 
466
        *ulist = val;
 
467
        *n = nu+nv;
 
468
        return nu;
 
469
}
 
470
 
 
471
static int ValidateAttachmentType(rs, s, side)
 
472
swidget rs;
 
473
char *s;
 
474
char *side;
 
475
{
 
476
        int i, n=XtNumber(uAttachmentType);
 
477
 
 
478
        if (s == NULL)
 
479
                return ERROR;
 
480
        for (i=0; i<n; i++)
 
481
                if (UxStrEqual(s, uAttachmentType[i]))
 
482
                {
 
483
                        if (UxCheckForAttachmentReferences (rs, side) != ERROR)
 
484
                                return NO_ERROR;
 
485
                }
 
486
        return ERROR;
 
487
}
 
488
 
 
489
int UxValidateBottomAttachment(rs, s)
 
490
swidget rs;
 
491
char *s;
 
492
{
 
493
        return ValidateAttachmentType(rs, s, XmNbottomAttachment);
 
494
}
 
495
 
 
496
int UxValidateTopAttachment(rs, s)
 
497
swidget rs;
 
498
char *s;
 
499
{
 
500
        return ValidateAttachmentType(rs, s, XmNtopAttachment);
 
501
}
 
502
 
 
503
int UxValidateRightAttachment(rs, s)
 
504
swidget rs;
 
505
char *s;
 
506
{
 
507
        return ValidateAttachmentType(rs, s, XmNrightAttachment);
 
508
}
 
509
 
 
510
int UxValidateLeftAttachment(rs, s)
 
511
swidget rs;
 
512
char *s;
 
513
{
 
514
        return ValidateAttachmentType(rs, s, XmNleftAttachment);
 
515
}
 
516
#endif /* ! RUNTIME */
 
517
 
 
518
/* ------------------------------------------------------------------------*/
 
519
 
 
520
static  char *uAudibleWarning[] = {
 
521
        "bell", "none"
 
522
};
 
523
static  unsigned char xAudibleWarning[] = {
 
524
        XmBELL, XmNONE
 
525
};
 
526
 
 
527
#ifndef RUNTIME
 
528
int UxValuesOfAudibleWarning(ulist, n)
 
529
char ***ulist;
 
530
int *n;
 
531
{
 
532
        *ulist = uAudibleWarning;
 
533
        *n = XtNumber(uAudibleWarning);
 
534
        return *n;
 
535
}
 
536
 
 
537
int UxValidateAudibleWarning(rs, s)
 
538
swidget rs;
 
539
char *s;
 
540
{
 
541
        int i, n=XtNumber(uAudibleWarning);
 
542
 
 
543
        if (s == NULL)
 
544
                return ERROR;
 
545
        for (i=0; i<n; i++)
 
546
                if (UxStrEqual(s, uAudibleWarning[i]))
 
547
                        return NO_ERROR;
 
548
        return ERROR;
 
549
}
 
550
#endif /* ! RUNTIME */
 
551
 
 
552
/* ------------------------------------------------------------------------*/
 
553
 
 
554
static  char *uChildType[] = {
 
555
        "frame_title_child", "frame_workarea_child", "frame_generic_child"
 
556
};
 
557
static  unsigned char xChildType[] = {
 
558
        XmFRAME_TITLE_CHILD, XmFRAME_WORKAREA_CHILD, XmFRAME_GENERIC_CHILD
 
559
};
 
560
 
 
561
#ifndef RUNTIME
 
562
int UxValuesOfChildType(ulist, n)
 
563
char ***ulist;
 
564
int *n;
 
565
{
 
566
        *ulist = uChildType;
 
567
        *n = XtNumber(uChildType);
 
568
        return *n;
 
569
}
 
570
 
 
571
int UxValidateChildType(rs, s)
 
572
swidget rs;
 
573
char *s;
 
574
{
 
575
        int i, n=XtNumber(uChildType);
 
576
 
 
577
        if (s == NULL)
 
578
                return ERROR;
 
579
        for (i=0; i<n; i++)
 
580
                if (UxStrEqual(s, uChildType[i]))
 
581
                        return NO_ERROR;
 
582
        return ERROR;
 
583
}
 
584
#endif /* ! RUNTIME */
 
585
 
 
586
/* ------------------------------------------------------------------------*/
 
587
 
 
588
static  char *uCommandWindowLocation[] = {
 
589
        "command_above_workspace", "command_below_workspace" 
 
590
};
 
591
static  unsigned char xCommandWindowLocation[] = {
 
592
        XmCOMMAND_ABOVE_WORKSPACE, XmCOMMAND_BELOW_WORKSPACE
 
593
};
 
594
 
 
595
#ifndef RUNTIME
 
596
/******************************************************************************
 
597
NAME:           int     UxValuesOfCommandWindowLocation(lst, n)
 
598
                char ***lst;
 
599
                int *n;
 
600
RETURN:         0
 
601
DESCRIPTION:    Displays the allowable values of CommandWindowLocation
 
602
CREATION:       February 5 1991         (bug2045)
 
603
REVISIONS:      
 
604
-----------------------------------------------------------------------------*/
 
605
int UxValuesOfCommandWindowLocation(ulist, n)
 
606
char ***ulist;
 
607
int *n;
 
608
{
 
609
        *ulist = uCommandWindowLocation;
 
610
        *n = XtNumber(uCommandWindowLocation);
 
611
        return *n;
 
612
}
 
613
 
 
614
/******************************************************************************
 
615
NAME:           int     UxValidateCommandWindowLocation(rs, s)
 
616
                swidget rs;
 
617
                char     *s;
 
618
RETURN:         0
 
619
DESCRIPTION:    Validates a CommandWindowLocation
 
620
CREATION:       February 5 1991         (bug2045)
 
621
REVISIONS:      
 
622
-----------------------------------------------------------------------------*/
 
623
int UxValidateCommandWindowLocation(rs, s)
 
624
swidget rs;
 
625
char *s;
 
626
{
 
627
        int i, n=XtNumber(uCommandWindowLocation);
 
628
 
 
629
        if (s == NULL)
 
630
                return ERROR;
 
631
        for (i=0; i<n; i++)
 
632
                if (UxStrEqual(s, uCommandWindowLocation[i]))
 
633
                        return NO_ERROR;
 
634
        return ERROR;
 
635
}
 
636
#endif /* ! RUNTIME */
 
637
 
 
638
/*----------------------------------------------------------*/
 
639
 
 
640
static  char *uChildPlacement[] = {
 
641
         "place_above_selection", "place_below_selection",
 
642
         "place_top"
 
643
};
 
644
 
 
645
static  unsigned char xChildPlacement[] = {
 
646
        XmPLACE_ABOVE_SELECTION, XmPLACE_BELOW_SELECTION,
 
647
        XmPLACE_TOP
 
648
};
 
649
 
 
650
 
 
651
#ifndef RUNTIME
 
652
 
 
653
/* -----------------------------------------------------------------------
 
654
 
 
655
NAME:           int     UxValuesOfChildPlacement(lst, n)
 
656
                char ***lst;
 
657
                int *n;
 
658
RETURN:
 
659
DESCRIPTION:    Specifies the placement of the work area child
 
660
CREATION:       October 26 1992
 
661
REVISIONS:      added for Motif1_2.2 support
 
662
-----------------------------------------------------------------------*/
 
663
 
 
664
int     UxValuesOfChildPlacement(ulist, n)
 
665
char    ***ulist;
 
666
int     *n;
 
667
{
 
668
        *ulist = uChildPlacement;
 
669
        *n = XtNumber(uChildPlacement);
 
670
        return  *n;
 
671
}
 
672
 
 
673
 
 
674
int UxValidateChildPlacement(rs, s)
 
675
swidget rs;
 
676
char *s;
 
677
{
 
678
        int i, n=XtNumber(uChildPlacement);
 
679
 
 
680
        if (s == NULL)
 
681
                return ERROR;
 
682
        for (i=0; i<n; i++)
 
683
                if (UxStrEqual(s, uChildPlacement[i]))
 
684
                        return NO_ERROR;
 
685
        return ERROR;
 
686
}
 
687
#endif /* ! RUNTIME */
 
688
 
 
689
 
 
690
/* ------------------------------------------------------------------------*/
 
691
 
 
692
static  char *uDefaultButtonType[] = {
 
693
        "dialog_cancel_button", "dialog_ok_button", 
 
694
        "dialog_help_button", "dialog_none"
 
695
};
 
696
static  unsigned char xDefaultButtonType[] = {
 
697
        XmDIALOG_CANCEL_BUTTON, XmDIALOG_OK_BUTTON,
 
698
        XmDIALOG_HELP_BUTTON, XmDIALOG_NONE
 
699
};
 
700
 
 
701
#ifndef RUNTIME
 
702
int UxValuesOfDefaultButtonType(ulist, n)
 
703
char ***ulist;
 
704
int *n;
 
705
{
 
706
        *ulist = uDefaultButtonType;
 
707
        *n = XtNumber(uDefaultButtonType);
 
708
        return *n;
 
709
}
 
710
 
 
711
int UxValidateDefaultButtonType(rs, s)
 
712
swidget rs;
 
713
char *s;
 
714
{
 
715
        int i, n=XtNumber(uDefaultButtonType);
 
716
 
 
717
        if (s == NULL)
 
718
                return ERROR;
 
719
        for (i=0; i<n; i++)
 
720
                if (UxStrEqual(s, uDefaultButtonType[i]))
 
721
                        return NO_ERROR;
 
722
        return ERROR;
 
723
}
 
724
#endif /* ! RUNTIME */
 
725
 
 
726
/* ------------------------------------------------------------------------*/
 
727
 
 
728
static  char *uDeleteResponse[] = {
 
729
        "destroy", "unmap", "do_nothing"
 
730
};
 
731
static  unsigned char xDeleteResponse[] = {
 
732
        XmDESTROY, XmUNMAP, XmDO_NOTHING
 
733
};
 
734
 
 
735
#ifndef RUNTIME
 
736
int UxValuesOfDeleteResponse(ulist, n)
 
737
char ***ulist;
 
738
int *n;
 
739
{
 
740
        *ulist = uDeleteResponse;
 
741
        *n = XtNumber(uDeleteResponse);
 
742
        return *n;
 
743
}
 
744
 
 
745
int UxValidateDeleteResponse(rs, s)
 
746
swidget rs;
 
747
char *s;
 
748
{
 
749
        int i, n=XtNumber(uDeleteResponse);
 
750
 
 
751
        if (s == NULL)
 
752
                return ERROR;
 
753
        for (i=0; i<n; i++)
 
754
                if (UxStrEqual(s, uDeleteResponse[i]))
 
755
                        return NO_ERROR;
 
756
        return ERROR;
 
757
}
 
758
#endif /* ! RUNTIME */
 
759
 
 
760
/* ------------------------------------------------------------------------*/
 
761
 
 
762
 
 
763
static  char *uDialogStyle[] = {
 
764
        "dialog_modeless", 
 
765
        "dialog_primary_application_modal", "dialog_full_application_modal",
 
766
        "dialog_system_modal", "dialog_work_area"
 
767
};
 
768
 
 
769
#ifdef RUNTIME
 
770
static  unsigned char xDialogStyle[] = {
 
771
        XmDIALOG_MODELESS, 
 
772
        XmDIALOG_PRIMARY_APPLICATION_MODAL, XmDIALOG_FULL_APPLICATION_MODAL,
 
773
        XmDIALOG_SYSTEM_MODAL, XmDIALOG_WORK_AREA
 
774
};
 
775
#else
 
776
     /*
 
777
      * For user widgets, dialog_system_modal, dialog_full_application_modal
 
778
      * mapped to XmDIALOG_PRIMARY_APPLICATION_MODAL .
 
779
      * UIM/X widgets use the true values.
 
780
      */
 
781
static  unsigned char xDialogStyle[] = {
 
782
        XmDIALOG_MODELESS, 
 
783
        XmDIALOG_PRIMARY_APPLICATION_MODAL, XmDIALOG_PRIMARY_APPLICATION_MODAL,
 
784
        XmDIALOG_PRIMARY_APPLICATION_MODAL, XmDIALOG_WORK_AREA
 
785
};
 
786
static  unsigned char xTrueDialogStyle[] = {
 
787
        XmDIALOG_MODELESS, 
 
788
        XmDIALOG_PRIMARY_APPLICATION_MODAL, XmDIALOG_FULL_APPLICATION_MODAL,
 
789
        XmDIALOG_SYSTEM_MODAL, XmDIALOG_WORK_AREA
 
790
};
 
791
#endif /*  RUNTIME */
 
792
 
 
793
 
 
794
#ifndef RUNTIME
 
795
int UxValuesOfDialogStyle(ulist, n)
 
796
char ***ulist;
 
797
int *n;
 
798
{
 
799
        static char *values[1];
 
800
        static char **val;
 
801
        static Boolean first_time = TRUE;
 
802
        int nu = XtNumber(uDialogStyle);
 
803
        int nv = XtNumber(values);
 
804
 
 
805
        if (first_time)
 
806
        {
 
807
                int             i;
 
808
                extern char     *UxCopyString();
 
809
 
 
810
                values[0] = UxCopyString(CGETS(MS_MISC1_DIAG_STYLE_MSG,
 
811
                                DS_MS_MISC1_DIAG_STYLE_MSG));
 
812
                val = (char **) UxCalloc(nu+nv, sizeof(char *));
 
813
                for (i=0; i< nu; i++)
 
814
                        val[i] = uDialogStyle[i];
 
815
                for (i=nu; i< (nu+nv); i++)
 
816
                        val[i] = values[i-nu];
 
817
                first_time = FALSE;
 
818
        }
 
819
 
 
820
        *ulist = val;
 
821
        *n = nu+nv;
 
822
        return nu;
 
823
}
 
824
 
 
825
int UxValidateDialogStyle(rs, s)
 
826
swidget rs;
 
827
char *s;
 
828
{
 
829
        int i, dialog_shell, n=XtNumber(uDialogStyle);
 
830
 
 
831
        if (s == NULL)
 
832
                return ERROR;
 
833
 
 
834
        /*
 
835
         * If dialog shell then the only valid choice is "dialog_work_area"
 
836
         * otherwise "dialog_work_area" is not a valid choice.
 
837
         */
 
838
        dialog_shell = False;
 
839
 
 
840
        if (UxIsDialogWidget( rs)) {
 
841
                        dialog_shell = True;
 
842
        } else
 
843
        if (is_shell(rs)) {
 
844
                if (UxGetDefaultShellClass(rs) == xmDialogShellWidgetClass)
 
845
                        dialog_shell = True;
 
846
        } else {
 
847
                if (UxIsSubclass(UxGetParent(rs), UxC_dialogShell))
 
848
                        dialog_shell = True;
 
849
        }
 
850
 
 
851
        if (dialog_shell) {
 
852
                if (UxStrEqual(s, "dialog_work_area"))
 
853
                        return ERROR;
 
854
        } else {
 
855
                if (! UxStrEqual(s, "dialog_work_area"))
 
856
                        return ERROR;
 
857
        }
 
858
 
 
859
        for (i=0; i<n; i++)
 
860
                if (UxStrEqual(s, uDialogStyle[i]))
 
861
                        return NO_ERROR;
 
862
 
 
863
        return ERROR;
 
864
}
 
865
#endif /* ! RUNTIME */
 
866
 
 
867
/* ------------------------------------------------------------------------*/
 
868
 
 
869
static  char *uDialogType[] = {
 
870
 
 
871
        "dialog_prompt",
 
872
        "dialog_selection", "dialog_file_selection",
 
873
        "dialog_work_area", "dialog_command"
 
874
};
 
875
 
 
876
static  unsigned char xDialogType[] = {
 
877
 
 
878
        XmDIALOG_PROMPT,
 
879
        XmDIALOG_SELECTION, XmDIALOG_FILE_SELECTION,
 
880
        XmDIALOG_WORK_AREA, XmDIALOG_COMMAND
 
881
};
 
882
 
 
883
#ifndef RUNTIME
 
884
int UxValuesOfDialogType(ulist, n)
 
885
char ***ulist;
 
886
int *n;
 
887
{
 
888
        *ulist = uDialogType;
 
889
        *n = XtNumber(uDialogType);
 
890
        return *n;
 
891
}
 
892
 
 
893
int UxValidateDialogType(rs, s)
 
894
swidget rs;
 
895
char *s;
 
896
{
 
897
        int i, n=XtNumber(uDialogType);
 
898
 
 
899
        if (s == NULL)
 
900
                return ERROR;
 
901
        for (i=0; i<n; i++)
 
902
                if (UxStrEqual(s, uDialogType[i]))
 
903
                        return NO_ERROR;
 
904
        return ERROR;
 
905
}
 
906
#endif /* ! RUNTIME */
 
907
 
 
908
/* ------------------------------------------------------------------------*/
 
909
 
 
910
static  char *uEditMode[] = {
 
911
        "single_line_edit", "multi_line_edit" 
 
912
};
 
913
static  int xEditMode[] = {
 
914
        (int) XmSINGLE_LINE_EDIT, (int) XmMULTI_LINE_EDIT 
 
915
};
 
916
 
 
917
#ifndef RUNTIME
 
918
int UxValuesOfEditMode(ulist, n)
 
919
char ***ulist;
 
920
int *n;
 
921
{
 
922
        *ulist = uEditMode;
 
923
        *n = XtNumber(uEditMode);
 
924
        return *n;
 
925
}
 
926
 
 
927
int UxValidateEditMode(rs, s)
 
928
swidget rs;
 
929
char *s;
 
930
{
 
931
        int i, n=XtNumber(uEditMode);
 
932
 
 
933
        if (s == NULL)
 
934
                return ERROR;
 
935
        for (i=0; i<n; i++)
 
936
                if (UxStrEqual(s, uEditMode[i]))
 
937
                        return NO_ERROR;
 
938
        return ERROR;
 
939
}
 
940
#endif /* ! RUNTIME */
 
941
 
 
942
/*  ------------------------------------------------------- */
 
943
#ifdef MOTIF_WIDGETS
 
944
static char * uFileTypeMask[] = {
 
945
        "file_regular", "file_directory", "file_any_type"
 
946
};
 
947
static unsigned char xFileTypeMask[] = {
 
948
        XmFILE_REGULAR, XmFILE_DIRECTORY, XmFILE_ANY_TYPE
 
949
};
 
950
 
 
951
#ifndef RUNTIME
 
952
/******************************************************************************
 
953
NAME:           int     UxValuesOfFileTypeMask(lst, n)
 
954
                char ***lst;
 
955
                int *n;
 
956
RETURN:         0
 
957
DESCRIPTION:    Displays the allowable values of FileTypeMask
 
958
CREATION:       January 29 1991         (bug2032)
 
959
REVISIONS:      
 
960
-----------------------------------------------------------------------------*/
 
961
int UxValuesOfFileTypeMask(ulist, n)
 
962
char ***ulist;
 
963
int *n;
 
964
{
 
965
        *ulist = uFileTypeMask;
 
966
        *n = XtNumber(uFileTypeMask);
 
967
        return *n;
 
968
}
 
969
 
 
970
/******************************************************************************
 
971
NAME:           int     UxValidateFileTypeMask(rs, s)
 
972
                rswidget        *rs;    - rswidget
 
973
                char    *s;             - name.
 
974
RETURN:         ERROR or NO_ERROR
 
975
DESCRIPTION:    Validates FileTypeMask
 
976
CREATION:       January 29 1991         (bug2032)
 
977
REVISIONS:      
 
978
-----------------------------------------------------------------------------*/
 
979
int UxValidateFileTypeMask(rs, s)
 
980
swidget rs;
 
981
char *s;
 
982
{
 
983
        int i, n=XtNumber(uFileTypeMask);
 
984
 
 
985
        if (s == NULL)
 
986
                return ERROR;
 
987
        for (i=0; i<n; i++)
 
988
                if (UxStrEqual(s, uFileTypeMask[i]))
 
989
                        return NO_ERROR;
 
990
        return ERROR;
 
991
}
 
992
#endif
 
993
#endif
 
994
/* ------------------------------------------------------------------------*/
 
995
 
 
996
static  char *uIndicatorType[] = {
 
997
        "one_of_many", "n_of_many"
 
998
};
 
999
static  unsigned char xIndicatorType[] = {
 
1000
        XmONE_OF_MANY, XmN_OF_MANY
 
1001
};
 
1002
 
 
1003
#ifndef RUNTIME
 
1004
int UxValuesOfIndicatorType(ulist, n)
 
1005
char ***ulist;
 
1006
int *n;
 
1007
{
 
1008
        *ulist = uIndicatorType;
 
1009
        *n = XtNumber(uIndicatorType);
 
1010
        return *n;
 
1011
}
 
1012
 
 
1013
int UxValidateIndicatorType(rs, s)
 
1014
swidget rs;
 
1015
char *s;
 
1016
{
 
1017
        int i, n=XtNumber(uIndicatorType);
 
1018
 
 
1019
        if (s == NULL)
 
1020
                return ERROR;
 
1021
        for (i=0; i<n; i++)
 
1022
                if (UxStrEqual(s, uIndicatorType[i]))
 
1023
                        return NO_ERROR;
 
1024
        return ERROR;
 
1025
}
 
1026
#endif /* ! RUNTIME */
 
1027
 
 
1028
/* ------------------------------------------------------------------------*/
 
1029
 
 
1030
static  char *uKeyboardFocusPolicy[] = {
 
1031
        "explicit", "pointer"
 
1032
};
 
1033
static  unsigned char xKeyboardFocusPolicy[] = {
 
1034
        XmEXPLICIT, XmPOINTER
 
1035
};
 
1036
 
 
1037
#ifndef RUNTIME
 
1038
int UxValuesOfKeyboardFocusPolicy(ulist, n)
 
1039
char ***ulist;
 
1040
int *n;
 
1041
{
 
1042
        *ulist = uKeyboardFocusPolicy;
 
1043
        *n = XtNumber(uKeyboardFocusPolicy);
 
1044
        return *n;
 
1045
}
 
1046
 
 
1047
int UxValidateKeyboardFocusPolicy(rs, s)
 
1048
swidget rs;
 
1049
char *s;
 
1050
{
 
1051
        int i, n=XtNumber(uKeyboardFocusPolicy);
 
1052
 
 
1053
        if (s == NULL)
 
1054
                return ERROR;
 
1055
        for (i=0; i<n; i++)
 
1056
                if (UxStrEqual(s, uKeyboardFocusPolicy[i]))
 
1057
                        return NO_ERROR;
 
1058
        return ERROR;
 
1059
}
 
1060
#endif /* ! RUNTIME */
 
1061
 
 
1062
/* ------------------------------------------------------------------------*/
 
1063
 
 
1064
static  char *uLabelType[] = {
 
1065
        "string", "pixmap"
 
1066
};
 
1067
static  unsigned char xLabelType[] = {
 
1068
        XmSTRING, XmPIXMAP
 
1069
};
 
1070
 
 
1071
#ifndef RUNTIME
 
1072
int UxValuesOfLabelType(ulist, n)
 
1073
char ***ulist;
 
1074
int *n;
 
1075
{
 
1076
        *ulist = uLabelType;
 
1077
        *n = XtNumber(uLabelType);
 
1078
        return *n;
 
1079
}
 
1080
 
 
1081
int UxValidateLabelType(rs, s)
 
1082
swidget rs;
 
1083
char *s;
 
1084
{
 
1085
        int i, n=XtNumber(uLabelType);
 
1086
 
 
1087
        if (s == NULL)
 
1088
                return ERROR;
 
1089
        for (i=0; i<n; i++)
 
1090
                if (UxStrEqual(s, uLabelType[i]))
 
1091
                        return NO_ERROR;
 
1092
        return ERROR;
 
1093
}
 
1094
#endif /* ! RUNTIME */
 
1095
 
 
1096
/* ------------------------------------------------------------------------*/
 
1097
 
 
1098
static  char *uListSizePolicy[] = {
 
1099
        "constant", "variable", "resize_if_possible"
 
1100
};
 
1101
static  unsigned char xListSizePolicy[] = {
 
1102
        XmCONSTANT, XmVARIABLE, XmRESIZE_IF_POSSIBLE
 
1103
};
 
1104
 
 
1105
#ifndef RUNTIME
 
1106
int UxValuesOfListSizePolicy(ulist, n)
 
1107
char ***ulist;
 
1108
int *n;
 
1109
{
 
1110
        *ulist = uListSizePolicy;
 
1111
        *n = XtNumber(uListSizePolicy);
 
1112
        return *n;
 
1113
}
 
1114
 
 
1115
int UxValidateListSizePolicy(rs, s)
 
1116
swidget rs;
 
1117
char *s;
 
1118
{
 
1119
        int i, n=XtNumber(uListSizePolicy);
 
1120
 
 
1121
        if (s == NULL)
 
1122
                return ERROR;
 
1123
        for (i=0; i<n; i++)
 
1124
                if (UxStrEqual(s, uListSizePolicy[i]))
 
1125
                        return NO_ERROR;
 
1126
        return ERROR;
 
1127
}
 
1128
#endif /* ! RUNTIME */
 
1129
 
 
1130
/* ------------------------------------------------------------------------*/
 
1131
 
 
1132
static  char *uMsgDialogType[] = {
 
1133
 
 
1134
        "dialog_error", "dialog_information",
 
1135
        "dialog_message", "dialog_question",
 
1136
        "dialog_template", "dialog_warning",
 
1137
        "dialog_working"
 
1138
};
 
1139
 
 
1140
static  unsigned char xMsgDialogType[] = {
 
1141
 
 
1142
        XmDIALOG_ERROR, XmDIALOG_INFORMATION,
 
1143
        XmDIALOG_MESSAGE, XmDIALOG_QUESTION,
 
1144
        XmDIALOG_TEMPLATE, XmDIALOG_WARNING,
 
1145
        XmDIALOG_WORKING
 
1146
};
 
1147
 
 
1148
#ifndef RUNTIME
 
1149
int UxValuesOfMsgDialogType(ulist, n)
 
1150
char ***ulist;
 
1151
int *n;
 
1152
{
 
1153
        *ulist = uMsgDialogType;
 
1154
        *n = XtNumber(uMsgDialogType);
 
1155
        return *n;
 
1156
}
 
1157
 
 
1158
int UxValidateMsgDialogType(rs, s)
 
1159
swidget rs;
 
1160
char *s;
 
1161
{
 
1162
        int i, n=XtNumber(uMsgDialogType);
 
1163
 
 
1164
        if (s == NULL)
 
1165
                return ERROR;
 
1166
        for (i=0; i<n; i++)
 
1167
                if (UxStrEqual(s, uMsgDialogType[i]))
 
1168
                        return NO_ERROR;
 
1169
        return ERROR;
 
1170
}
 
1171
#endif /* ! RUNTIME */
 
1172
 
 
1173
/* ------------------------------------------------------------------------*/
 
1174
 
 
1175
#ifdef MOTIF_WIDGETS
 
1176
static  char * uMwmInputMode[] = {
 
1177
        "-1", "mwm_input_modeless",
 
1178
        "mwm_input_primary_application_modal",
 
1179
        "mwm_input_system_modal", "mwm_input_full_application_modal"
 
1180
};
 
1181
 
 
1182
#ifdef RUNTIME
 
1183
static  int xMwmInputMode[] = {
 
1184
        -1, MWM_INPUT_MODELESS, MWM_INPUT_PRIMARY_APPLICATION_MODAL,
 
1185
        MWM_INPUT_SYSTEM_MODAL, MWM_INPUT_FULL_APPLICATION_MODAL
 
1186
};
 
1187
#else
 
1188
static  int xMwmInputMode[] = {
 
1189
        -1, MWM_INPUT_MODELESS, MWM_INPUT_PRIMARY_APPLICATION_MODAL,
 
1190
        MWM_INPUT_PRIMARY_APPLICATION_MODAL, MWM_INPUT_PRIMARY_APPLICATION_MODAL
 
1191
};
 
1192
static  int xTrueMwmInputMode[] = {
 
1193
        -1, MWM_INPUT_MODELESS, MWM_INPUT_PRIMARY_APPLICATION_MODAL,
 
1194
        MWM_INPUT_SYSTEM_MODAL, MWM_INPUT_FULL_APPLICATION_MODAL
 
1195
};
 
1196
#endif /* RUNTIME */
 
1197
 
 
1198
/******************************************************************************
 
1199
NAME:           int     UxValuesOfMwmInputMode(lst, n)
 
1200
                char ***lst;
 
1201
                int *n;
 
1202
RETURN:         0
 
1203
DESCRIPTION:    Displays the allowable values of MwmInputMode
 
1204
CREATION:       February 4 1993         (bug1950)
 
1205
REVISIONS:      
 
1206
-----------------------------------------------------------------------------*/
 
1207
#ifndef RUNTIME
 
1208
int UxValuesOfMwmInputMode(ulist, n)
 
1209
char ***ulist;
 
1210
int *n;
 
1211
{
 
1212
        *ulist = uMwmInputMode;
 
1213
        *n = XtNumber(uMwmInputMode);
 
1214
        return *n;
 
1215
}
 
1216
 
 
1217
/******************************************************************************
 
1218
NAME:           int     UxValidateMwmInputMode(rs, s)
 
1219
                rswidget        *rs;    - rswidget
 
1220
                char    *s;             - name.
 
1221
RETURN:         ERROR or NO_ERROR
 
1222
DESCRIPTION:    Validates MwmInputMode
 
1223
CREATION:       February 4 1993         (bug1950)
 
1224
REVISIONS:      
 
1225
-----------------------------------------------------------------------------*/
 
1226
int UxValidateMwmInputMode(rs, s)
 
1227
swidget rs;
 
1228
char *s;
 
1229
{
 
1230
        int i, n=XtNumber(uMwmInputMode);
 
1231
 
 
1232
        if (s == NULL)
 
1233
                return ERROR;
 
1234
        for (i=0; i<n; i++)
 
1235
                if (UxStrEqual(s, uMwmInputMode[i]))
 
1236
                        return NO_ERROR;
 
1237
        return ERROR;
 
1238
}
 
1239
#endif
 
1240
#endif
 
1241
 
 
1242
/* ------------------------------------------------------------------------*/
 
1243
 
 
1244
#ifdef MOTIF_WIDGETS
 
1245
static  char * uMultiClick[] = {
 
1246
        "multiclick_keep", "multiclick_discard"
 
1247
};
 
1248
static  unsigned char xMultiClick[] = {
 
1249
        XmMULTICLICK_KEEP, XmMULTICLICK_DISCARD
 
1250
};
 
1251
 
 
1252
/******************************************************************************
 
1253
NAME:           int     UxValuesOfMultiClick(lst, n)
 
1254
                char ***lst;
 
1255
                int *n;
 
1256
RETURN:         0
 
1257
DESCRIPTION:    Displays the allowable values of MultiClick
 
1258
CREATION:       January 29 1991         (bug2035)
 
1259
REVISIONS:      
 
1260
-----------------------------------------------------------------------------*/
 
1261
#ifndef RUNTIME
 
1262
int UxValuesOfMultiClick(ulist, n)
 
1263
char ***ulist;
 
1264
int *n;
 
1265
{
 
1266
        *ulist = uMultiClick;
 
1267
        *n = XtNumber(uMultiClick);
 
1268
        return *n;
 
1269
}
 
1270
 
 
1271
/******************************************************************************
 
1272
NAME:           int     UxValidateMultiClick(rs, s)
 
1273
                rswidget        *rs;    - rswidget
 
1274
                char    *s;             - name.
 
1275
RETURN:         ERROR or NO_ERROR
 
1276
DESCRIPTION:    Validates MultiClick's
 
1277
CREATION:       January 29 1991         (bug2035)
 
1278
REVISIONS:      
 
1279
-----------------------------------------------------------------------------*/
 
1280
int UxValidateMultiClick(rs, s)
 
1281
swidget rs;
 
1282
char *s;
 
1283
{
 
1284
        int i, n=XtNumber(uMultiClick);
 
1285
 
 
1286
        if (s == NULL)
 
1287
                return ERROR;
 
1288
        for (i=0; i<n; i++)
 
1289
                if (UxStrEqual(s, uMultiClick[i]))
 
1290
                        return NO_ERROR;
 
1291
        return ERROR;
 
1292
}
 
1293
#endif
 
1294
#endif
 
1295
 
 
1296
/* ------------------------------------------------------------------------*/
 
1297
 
 
1298
#ifdef MOTIF_WIDGETS
 
1299
static  char * uNavigationType[] = {
 
1300
        "none", "tab_group", "sticky_tab_group", "exclusive_tab_group"
 
1301
};
 
1302
static  unsigned char xNavigationType[] = {
 
1303
        XmNONE, XmTAB_GROUP, XmSTICKY_TAB_GROUP, XmEXCLUSIVE_TAB_GROUP
 
1304
};
 
1305
 
 
1306
/******************************************************************************
 
1307
NAME:           int     UxValuesOfNavigationType(lst, n)
 
1308
                char ***lst;
 
1309
                int *n;
 
1310
RETURN:         0
 
1311
DESCRIPTION:    Displays the allowable values of NavigationType
 
1312
CREATION:       January 29 1991         (bug2035)
 
1313
REVISIONS:      
 
1314
-----------------------------------------------------------------------------*/
 
1315
#ifndef RUNTIME
 
1316
int UxValuesOfNavigationType(ulist, n)
 
1317
char ***ulist;
 
1318
int *n;
 
1319
{
 
1320
        *ulist = uNavigationType;
 
1321
        *n = XtNumber(uNavigationType);
 
1322
        return *n;
 
1323
}
 
1324
 
 
1325
/******************************************************************************
 
1326
NAME:           int     UxValidateNavigationType(rs, s)
 
1327
                rswidget        *rs;    - rswidget
 
1328
                char    *s;             - name.
 
1329
RETURN:         ERROR or NO_ERROR
 
1330
DESCRIPTION:    Validates NavigationType's
 
1331
CREATION:       January 29 1991         (bug2035)
 
1332
REVISIONS:      
 
1333
-----------------------------------------------------------------------------*/
 
1334
int UxValidateNavigationType(rs, s)
 
1335
swidget rs;
 
1336
char *s;
 
1337
{
 
1338
        int i, n=XtNumber(uNavigationType);
 
1339
 
 
1340
        if (s == NULL)
 
1341
                return ERROR;
 
1342
        for (i=0; i<n; i++)
 
1343
                if (UxStrEqual(s, uNavigationType[i]))
 
1344
                        return NO_ERROR;
 
1345
        return ERROR;
 
1346
}
 
1347
#endif
 
1348
#endif
 
1349
 
 
1350
/* ------------------------------------------------------------------------*/
 
1351
 
 
1352
static  char *uOrientation[] = {
 
1353
        "vertical", "horizontal"
 
1354
};
 
1355
static  unsigned char xOrientation[] = {
 
1356
        XmVERTICAL, XmHORIZONTAL
 
1357
};
 
1358
 
 
1359
#ifndef RUNTIME
 
1360
int UxValuesOfOrientation(ulist, n)
 
1361
char ***ulist;
 
1362
int *n;
 
1363
{
 
1364
        *ulist = uOrientation;
 
1365
        *n = XtNumber(uOrientation);
 
1366
        return *n;
 
1367
}
 
1368
 
 
1369
int UxValidateOrientation(rs, s)
 
1370
swidget rs;
 
1371
char *s;
 
1372
{
 
1373
        int i, n=XtNumber(uOrientation);
 
1374
 
 
1375
        if (s == NULL)
 
1376
                return ERROR;
 
1377
        for (i=0; i<n; i++)
 
1378
                if (UxStrEqual(s, uOrientation[i]))
 
1379
                        return NO_ERROR;
 
1380
        return ERROR;
 
1381
}
 
1382
#endif /* ! RUNTIME */
 
1383
 
 
1384
/* ------------------------------------------------------------------------*/
 
1385
 
 
1386
static  char *uPacking[] = {
 
1387
        "pack_tight", "pack_column", "pack_none"
 
1388
};
 
1389
static  unsigned char xPacking[] = {
 
1390
        XmPACK_TIGHT, XmPACK_COLUMN, XmPACK_NONE
 
1391
};
 
1392
 
 
1393
#ifndef RUNTIME
 
1394
int UxValuesOfPacking(ulist, n)
 
1395
char ***ulist;
 
1396
int *n;
 
1397
{
 
1398
        *ulist = uPacking;
 
1399
        *n = XtNumber(uPacking);
 
1400
        return *n;
 
1401
}
 
1402
 
 
1403
int UxValidatePacking(rs, s)
 
1404
swidget rs;
 
1405
char *s;
 
1406
{
 
1407
        int i, n=XtNumber(uPacking);
 
1408
 
 
1409
        if (s == NULL)
 
1410
                return ERROR;
 
1411
        for (i=0; i<n; i++)
 
1412
                if (UxStrEqual(s, uPacking[i]))
 
1413
                        return NO_ERROR;
 
1414
        return ERROR;
 
1415
}
 
1416
#endif /* ! RUNTIME */
 
1417
 
 
1418
/* ------------------------------------------------------------------------*/
 
1419
 
 
1420
static  char *uProcessingDirection[] = {
 
1421
        "max_on_top", "max_on_bottom", 
 
1422
        "max_on_left", "max_on_right"
 
1423
};
 
1424
static  unsigned char xProcessingDirection[] = {
 
1425
        XmMAX_ON_TOP, XmMAX_ON_BOTTOM,
 
1426
        XmMAX_ON_LEFT, XmMAX_ON_RIGHT
 
1427
};
 
1428
 
 
1429
#ifndef RUNTIME
 
1430
int UxValuesOfProcessingDirection(ulist, n)
 
1431
char ***ulist;
 
1432
int *n;
 
1433
{
 
1434
        *ulist = uProcessingDirection;
 
1435
        *n = XtNumber(uProcessingDirection);
 
1436
        return *n;
 
1437
}
 
1438
 
 
1439
int UxValidateProcessingDirection(rs, s)
 
1440
swidget rs;
 
1441
char *s;
 
1442
{
 
1443
        int i;
 
1444
        char *hv = UX_DEFAULT_SB_ORIENTATION;
 
1445
 
 
1446
        (void) UxFindValue(rs, UxGetRD_orientation(rs), &hv);
 
1447
        if (s == NULL)
 
1448
                return ERROR;
 
1449
        if (UxStrEqual(hv, "vertical") &&
 
1450
           (UxStrEqual(s, "max_on_top") || UxStrEqual(s, "max_on_bottom")))
 
1451
                return NO_ERROR;
 
1452
        if (UxStrEqual(hv, "horizontal") &&
 
1453
           (UxStrEqual(s, "max_on_left") || UxStrEqual(s, "max_on_right")))
 
1454
                return NO_ERROR;
 
1455
        return ERROR;
 
1456
}
 
1457
#endif /* ! RUNTIME */
 
1458
 
 
1459
/* ------------------------------------------------------------------------*/
 
1460
 
 
1461
static  char *uResizePolicy[] = {
 
1462
        "resize_none", "resize_any", 
 
1463
        "resize_grow"
 
1464
};
 
1465
static  unsigned char xResizePolicy[] = {
 
1466
        XmRESIZE_NONE, XmRESIZE_ANY,
 
1467
        XmRESIZE_GROW
 
1468
};
 
1469
 
 
1470
#ifndef RUNTIME
 
1471
int UxValuesOfResizePolicy(ulist, n)
 
1472
char ***ulist;
 
1473
int *n;
 
1474
{
 
1475
        *ulist = uResizePolicy;
 
1476
        *n = XtNumber(uResizePolicy);
 
1477
        return *n;
 
1478
}
 
1479
 
 
1480
int UxValidateResizePolicy(rs, s)
 
1481
swidget rs;
 
1482
char *s;
 
1483
{
 
1484
        int i, n=XtNumber(uResizePolicy);
 
1485
 
 
1486
        if (s == NULL)
 
1487
                return ERROR;
 
1488
        for (i=0; i<n; i++)
 
1489
                if (UxStrEqual(s, uResizePolicy[i]))
 
1490
                        return NO_ERROR;
 
1491
        return ERROR;
 
1492
}
 
1493
#endif /* ! RUNTIME */
 
1494
 
 
1495
/* ------------------------------------------------------------------------*/
 
1496
 
 
1497
static  char *uRowColumnType[] = {
 
1498
        "work_area", "menu_bar", "menu_pulldown", 
 
1499
        "menu_popup", "menu_option"
 
1500
};
 
1501
static  unsigned char xRowColumnType[] = {
 
1502
        XmWORK_AREA, XmMENU_BAR, XmMENU_PULLDOWN,
 
1503
        XmMENU_POPUP, XmMENU_OPTION
 
1504
};
 
1505
 
 
1506
#ifndef RUNTIME
 
1507
int UxValuesOfRowColumnType(ulist, n)
 
1508
char ***ulist;
 
1509
int *n;
 
1510
{
 
1511
        *ulist = uRowColumnType;
 
1512
        *n = XtNumber(uRowColumnType);
 
1513
        return *n;
 
1514
}
 
1515
 
 
1516
int UxValidateRowColumnType(rs, s)
 
1517
swidget rs;
 
1518
char *s;
 
1519
{
 
1520
        int i, n=XtNumber(uRowColumnType);
 
1521
 
 
1522
        if (s == NULL)
 
1523
                return ERROR;
 
1524
        for (i=0; i<n; i++)
 
1525
                if (UxStrEqual(s, uRowColumnType[i]))
 
1526
                        return NO_ERROR;
 
1527
        return ERROR;
 
1528
}
 
1529
#endif /* ! RUNTIME */
 
1530
 
 
1531
/* ------------------------------------------------------------------------*/
 
1532
 
 
1533
static  char *uScrollBarDisplayPolicy[] = {
 
1534
        "as_needed", "static"
 
1535
};
 
1536
static  unsigned char xScrollBarDisplayPolicy[] = {
 
1537
        XmAS_NEEDED, XmSTATIC
 
1538
};
 
1539
 
 
1540
#ifndef RUNTIME
 
1541
int UxValuesOfScrollBarDisplayPolicy(ulist, n)
 
1542
char ***ulist;
 
1543
int *n;
 
1544
{
 
1545
        *ulist = uScrollBarDisplayPolicy;
 
1546
        *n = XtNumber(uScrollBarDisplayPolicy);
 
1547
        return *n;
 
1548
}
 
1549
 
 
1550
int UxValidateScrollBarDisplayPolicy(rs, s)
 
1551
swidget rs;
 
1552
char *s;
 
1553
{
 
1554
        int i, n=XtNumber(uScrollBarDisplayPolicy);
 
1555
 
 
1556
        if (s == NULL)
 
1557
                return ERROR;
 
1558
        for (i=0; i<n; i++)
 
1559
                if (UxStrEqual(s, uScrollBarDisplayPolicy[i]))
 
1560
                        return NO_ERROR;
 
1561
        return ERROR;
 
1562
}
 
1563
#endif /* ! RUNTIME */
 
1564
 
 
1565
/* ------------------------------------------------------------------------*/
 
1566
 
 
1567
static  char *uScrollBarPlacement[] = {
 
1568
        "top_left", "bottom_left", "top_right", 
 
1569
        "bottom_right"
 
1570
};
 
1571
static  unsigned char xScrollBarPlacement[] = {
 
1572
        XmTOP_LEFT, XmBOTTOM_LEFT, XmTOP_RIGHT,
 
1573
        XmBOTTOM_RIGHT
 
1574
};
 
1575
 
 
1576
#ifndef RUNTIME
 
1577
int UxValuesOfScrollBarPlacement(ulist, n)
 
1578
char ***ulist;
 
1579
int *n;
 
1580
{
 
1581
        *ulist = uScrollBarPlacement;
 
1582
        *n = XtNumber(uScrollBarPlacement);
 
1583
        return *n;
 
1584
}
 
1585
 
 
1586
int UxValidateScrollBarPlacement(rs, s)
 
1587
swidget rs;
 
1588
char *s;
 
1589
{
 
1590
        int i, n=XtNumber(uScrollBarPlacement);
 
1591
 
 
1592
        if (s == NULL)
 
1593
                return ERROR;
 
1594
        for (i=0; i<n; i++)
 
1595
                if (UxStrEqual(s, uScrollBarPlacement[i]))
 
1596
                        return NO_ERROR;
 
1597
        return ERROR;
 
1598
}
 
1599
#endif /* ! RUNTIME */
 
1600
 
 
1601
/* ------------------------------------------------------------------------*/
 
1602
 
 
1603
static  char *uScrollingPolicy[] = {
 
1604
        "automatic", "application_defined"
 
1605
};
 
1606
static  unsigned char xScrollingPolicy[] = {
 
1607
        XmAUTOMATIC, XmAPPLICATION_DEFINED
 
1608
};
 
1609
 
 
1610
#ifndef RUNTIME
 
1611
int UxValuesOfScrollingPolicy(ulist, n)
 
1612
char ***ulist;
 
1613
int *n;
 
1614
{
 
1615
        *ulist = uScrollingPolicy;
 
1616
        *n = XtNumber(uScrollingPolicy);
 
1617
        return *n;
 
1618
}
 
1619
 
 
1620
int UxValidateScrollingPolicy(rs, s)
 
1621
swidget rs;
 
1622
char *s;
 
1623
{
 
1624
        int i, n=XtNumber(uScrollingPolicy);
 
1625
 
 
1626
        if (s == NULL)
 
1627
                return ERROR;
 
1628
        for (i=0; i<n; i++)
 
1629
                if (UxStrEqual(s, uScrollingPolicy[i]))
 
1630
                        return NO_ERROR;
 
1631
        return ERROR;
 
1632
}
 
1633
#endif /* ! RUNTIME */
 
1634
 
 
1635
/* ------------------------------------------------------------------------*/
 
1636
 
 
1637
static  char *uSelectionPolicy[] = {
 
1638
        "single_select", "multiple_select", 
 
1639
        "extended_select", "browse_select"
 
1640
};
 
1641
static  unsigned char xSelectionPolicy[] = {
 
1642
        XmSINGLE_SELECT, XmMULTIPLE_SELECT,
 
1643
        XmEXTENDED_SELECT, XmBROWSE_SELECT
 
1644
};
 
1645
 
 
1646
#ifndef RUNTIME
 
1647
int UxValuesOfSelectionPolicy(ulist, n)
 
1648
char ***ulist;
 
1649
int *n;
 
1650
{
 
1651
        *ulist = uSelectionPolicy;
 
1652
        *n = XtNumber(uSelectionPolicy);
 
1653
        return *n;
 
1654
}
 
1655
 
 
1656
int UxValidateSelectionPolicy(rs, s)
 
1657
swidget rs;
 
1658
char *s;
 
1659
{
 
1660
        int i, n=XtNumber(uSelectionPolicy);
 
1661
 
 
1662
        if (s == NULL)
 
1663
                return ERROR;
 
1664
        for (i=0; i<n; i++)
 
1665
                if (UxStrEqual(s, uSelectionPolicy[i]))
 
1666
                        return NO_ERROR;
 
1667
        return ERROR;
 
1668
}
 
1669
#endif /* ! RUNTIME */
 
1670
 
 
1671
/* ------------------------------------------------------------------------*/
 
1672
 
 
1673
static  char *uSeparatorType[] = {
 
1674
        "single_line", "double_line", 
 
1675
        "single_dashed_line", "double_dashed_line", 
 
1676
        "no_line", "shadow_etched_in", 
 
1677
        "shadow_etched_out"
 
1678
};
 
1679
static  unsigned char xSeparatorType[] = {
 
1680
        XmSINGLE_LINE, XmDOUBLE_LINE,
 
1681
        XmSINGLE_DASHED_LINE, XmDOUBLE_DASHED_LINE,
 
1682
        XmNO_LINE, XmSHADOW_ETCHED_IN,
 
1683
        XmSHADOW_ETCHED_OUT
 
1684
};
 
1685
 
 
1686
#ifndef RUNTIME
 
1687
int UxValuesOfSeparatorType(ulist, n)
 
1688
char ***ulist;
 
1689
int *n;
 
1690
{
 
1691
        *ulist = uSeparatorType;
 
1692
        *n = XtNumber(uSeparatorType);
 
1693
        return *n;
 
1694
}
 
1695
 
 
1696
int UxValidateSeparatorType(rs, s)
 
1697
swidget rs;
 
1698
char *s;
 
1699
{
 
1700
        int i, n=XtNumber(uSeparatorType);
 
1701
 
 
1702
        if (s == NULL)
 
1703
                return ERROR;
 
1704
        for (i=0; i<n; i++)
 
1705
                if (UxStrEqual(s, uSeparatorType[i]))
 
1706
                        return NO_ERROR;
 
1707
        return ERROR;
 
1708
}
 
1709
#endif /* ! RUNTIME */
 
1710
 
 
1711
/* ------------------------------------------------------------------------*/
 
1712
 
 
1713
static  char *uShadowType[] = {
 
1714
        "shadow_in", "shadow_out", 
 
1715
        "shadow_etched_in", "shadow_etched_out"
 
1716
};
 
1717
static  unsigned char xShadowType[] = {
 
1718
        XmSHADOW_IN, XmSHADOW_OUT,
 
1719
        XmSHADOW_ETCHED_IN, XmSHADOW_ETCHED_OUT
 
1720
};
 
1721
 
 
1722
#ifndef RUNTIME
 
1723
int UxValuesOfShadowType(ulist, n)
 
1724
char ***ulist;
 
1725
int *n;
 
1726
{
 
1727
        *ulist = uShadowType;
 
1728
        *n = XtNumber(uShadowType);
 
1729
        return *n;
 
1730
}
 
1731
 
 
1732
int UxValidateShadowType(rs, s)
 
1733
swidget rs;
 
1734
char *s;
 
1735
{
 
1736
        int i, n=XtNumber(uShadowType);
 
1737
 
 
1738
        if (s == NULL)
 
1739
                return ERROR;
 
1740
        for (i=0; i<n; i++)
 
1741
                if (UxStrEqual(s, uShadowType[i]))
 
1742
                        return NO_ERROR;
 
1743
        return ERROR;
 
1744
}
 
1745
#endif /* ! RUNTIME */
 
1746
 
 
1747
/* ------------------------------------------------------------------------*/
 
1748
 
 
1749
static  char *uStringDirection[] = {
 
1750
        "string_direction_l_to_r", "string_direction_r_to_l"
 
1751
};
 
1752
static  unsigned char xStringDirection[] = {
 
1753
        XmSTRING_DIRECTION_L_TO_R, XmSTRING_DIRECTION_R_TO_L
 
1754
};
 
1755
 
 
1756
#ifndef RUNTIME
 
1757
int UxValuesOfStringDirection(ulist, n)
 
1758
char ***ulist;
 
1759
int *n;
 
1760
{
 
1761
        *ulist = uStringDirection;
 
1762
        *n = XtNumber(uStringDirection);
 
1763
        return *n;
 
1764
}
 
1765
 
 
1766
int UxValidateStringDirection(rs, s)
 
1767
swidget rs;
 
1768
char *s;
 
1769
{
 
1770
        int i, n=XtNumber(uStringDirection);
 
1771
 
 
1772
        if (s == NULL)
 
1773
                return ERROR;
 
1774
        for (i=0; i<n; i++)
 
1775
                if (UxStrEqual(s, uStringDirection[i]))
 
1776
                        return NO_ERROR;
 
1777
        return ERROR;
 
1778
}
 
1779
#endif /* ! RUNTIME */
 
1780
 
 
1781
/* ------------------------------------------------------------------------*/
 
1782
 
 
1783
 
 
1784
static  char *uTearOffModel[] = {
 
1785
        "tear_off_enabled", "tear_off_disabled"
 
1786
};
 
1787
static  unsigned char xTearOffModel[] = {
 
1788
        XmTEAR_OFF_ENABLED, XmTEAR_OFF_DISABLED
 
1789
};
 
1790
 
 
1791
#ifndef RUNTIME
 
1792
int UxValuesOfTearOffModel(ulist, n)
 
1793
char ***ulist;
 
1794
int *n;
 
1795
{
 
1796
        *ulist = uTearOffModel;
 
1797
        *n = XtNumber(uTearOffModel);
 
1798
        return *n;
 
1799
}
 
1800
 
 
1801
int UxValidateTearOffModel(rs, s)
 
1802
swidget rs;
 
1803
char *s;
 
1804
{
 
1805
        int i, n=XtNumber(uTearOffModel);
 
1806
 
 
1807
        if (s == NULL)
 
1808
                return ERROR;
 
1809
        for (i=0; i<n; i++)
 
1810
                if (UxStrEqual(s, uTearOffModel[i]))
 
1811
                        return NO_ERROR;
 
1812
        return ERROR;
 
1813
}
 
1814
#endif /* ! RUNTIME */
 
1815
 
 
1816
 
 
1817
/* ------------------------------------------------------------------------*/
 
1818
 
 
1819
static  char *uUnitType[] = {
 
1820
        "pixels", "100th_millimeters", 
 
1821
        "1000th_inches", "100th_points", 
 
1822
        "100th_font_units"
 
1823
};
 
1824
static  unsigned char xUnitType[] = {
 
1825
        XmPIXELS, Xm100TH_MILLIMETERS,
 
1826
        Xm1000TH_INCHES, Xm100TH_POINTS,
 
1827
        Xm100TH_FONT_UNITS
 
1828
};
 
1829
 
 
1830
#ifndef RUNTIME
 
1831
int UxValuesOfUnitType(ulist, n)
 
1832
char ***ulist;
 
1833
int *n;
 
1834
{
 
1835
        *ulist = uUnitType;
 
1836
        *n = XtNumber(uUnitType);
 
1837
        return *n;
 
1838
}
 
1839
 
 
1840
int UxValidateUnitType(rs, s)
 
1841
swidget rs;
 
1842
char *s;
 
1843
{
 
1844
        int i, n=XtNumber(uUnitType);
 
1845
 
 
1846
        if (s == NULL)
 
1847
                return ERROR;
 
1848
        for (i=0; i<n; i++)
 
1849
                if (UxStrEqual(s, uUnitType[i]))
 
1850
                        return NO_ERROR;
 
1851
        return ERROR;
 
1852
}
 
1853
#endif /* ! RUNTIME */
 
1854
 
 
1855
/* ------------------------------------------------------------------------*/
 
1856
 
 
1857
static  char *uVisualPolicy[] = {
 
1858
        "constant", "variable"
 
1859
};
 
1860
static  unsigned char xVisualPolicy[] = {
 
1861
        XmCONSTANT, XmVARIABLE
 
1862
};
 
1863
 
 
1864
#ifndef RUNTIME
 
1865
int UxValuesOfVisualPolicy(ulist, n)
 
1866
char ***ulist;
 
1867
int *n;
 
1868
{
 
1869
        *ulist = uVisualPolicy;
 
1870
        *n = XtNumber(uVisualPolicy);
 
1871
        return *n;
 
1872
}
 
1873
 
 
1874
int UxValidateVisualPolicy(rs, s)
 
1875
swidget rs;
 
1876
char *s;
 
1877
{
 
1878
        int i, n=XtNumber(uVisualPolicy);
 
1879
 
 
1880
        if (s == NULL)
 
1881
                return ERROR;
 
1882
        for (i=0; i<n; i++)
 
1883
                if (UxStrEqual(s, uVisualPolicy[i]))
 
1884
                        return NO_ERROR;
 
1885
        return ERROR;
 
1886
}
 
1887
#endif /* ! RUNTIME */
 
1888
 
 
1889
/* ------------------------------------------------------------------------*/
 
1890
 
 
1891
static  char *uWinGravity[] = {
 
1892
        "forget_gravity",       "north_west_gravity",   "north_gravity",
 
1893
        "north_east_gravity",   "west_gravity",         "center_gravity",
 
1894
        "east_gravity",         "south_west_gravity",   "south_gravity",
 
1895
        "south_east_gravity",   "static_gravity"
 
1896
 
 
1897
};
 
1898
static  int xWinGravity[] = {
 
1899
        ForgetGravity,          NorthWestGravity,       NorthGravity,
 
1900
        NorthEastGravity,       WestGravity,            CenterGravity,
 
1901
        EastGravity,            SouthWestGravity,       SouthGravity,
 
1902
        SouthEastGravity,       StaticGravity           
 
1903
 
 
1904
};
 
1905
 
 
1906
#ifndef RUNTIME
 
1907
int UxValuesOfWinGravity(ulist, n)
 
1908
char ***ulist;
 
1909
int *n;
 
1910
{
 
1911
        *ulist = uWinGravity;
 
1912
        *n = XtNumber(uWinGravity);
 
1913
        return *n;
 
1914
}
 
1915
 
 
1916
int UxValidateWinGravity(rs, s)
 
1917
swidget rs;
 
1918
char *s;
 
1919
{
 
1920
        int i, n=XtNumber(uWinGravity);
 
1921
 
 
1922
        if (s == NULL)
 
1923
                return ERROR;
 
1924
        for (i=0; i<n; i++)
 
1925
                if (UxStrEqual(s, uWinGravity[i]))
 
1926
                        return NO_ERROR;
 
1927
        return ERROR;
 
1928
}
 
1929
#endif /* ! RUNTIME */
 
1930
 
 
1931
 
 
1932
/******************************************************************************
 
1933
NAME:           UxStringToCharEnum (sw, udata, xdata, flag, XT_type)
 
1934
INPUT:          swidget         sw              - swidget
 
1935
                char            **udata         - UIMX string representation
 
1936
                char            *xdata          - Motif enumerated value
 
1937
                int             flag            - TO_UIMX or TO_X
 
1938
                int             XT_type         - the type identifier
 
1939
RETURN:         int                             - ERROR/NO_ERROR
 
1940
DESCRIPTION:    Performs the conversion DIRECTLY using the 'conversion' records
 
1941
                defined above. This function is for Widget properties that do
 
1942
                not have resource converters.
 
1943
CREATION:       Jul 4/1989
 
1944
REVISIONS:      --
 
1945
-----------------------------------------------------------------------------*/
 
1946
 
 
1947
int     UxStringToCharEnum (sw, udata, xdata, flag, XT_type)
 
1948
        swidget         sw;
 
1949
        char            **udata;
 
1950
        unsigned char   *xdata;
 
1951
        int             flag;
 
1952
        int             XT_type;
 
1953
{
 
1954
        int             i, match, err = 0;
 
1955
        char            **uconv = UxStr_conv[XT_type].strings;
 
1956
        unsigned char   *xconv = UxStr_conv[XT_type].values;
 
1957
        int             n = UxStr_conv[XT_type].size;
 
1958
 
 
1959
        if (flag == TO_UIMX)
 
1960
        {
 
1961
            for (i=0, match=0; i<n; i++)
 
1962
                if (*xdata == xconv[i])
 
1963
                {
 
1964
                    match = 1;
 
1965
                    break;
 
1966
                }
 
1967
            if (match)
 
1968
                *udata = uconv[i];
 
1969
            else
 
1970
                err = 1;
 
1971
        }
 
1972
        else if (flag == TO_X)
 
1973
        {
 
1974
            for (i=0, match=0; i<n; i++)
 
1975
            {
 
1976
                if (UxStrEqual(*udata, uconv[i]))
 
1977
                {
 
1978
                    match = 1;
 
1979
                    break;
 
1980
                }
 
1981
            }
 
1982
            if (match)
 
1983
                *xdata = xconv[i];
 
1984
            else
 
1985
                err = 1;
 
1986
        }
 
1987
        else
 
1988
        {
 
1989
            UxStandardError(CGETS( MS_MISC_WRONG_FLAG, DS_MS_MISC_WRONG_FLAG));
 
1990
            return ERROR;
 
1991
        }
 
1992
        if (!err)
 
1993
            return NO_ERROR;
 
1994
        else
 
1995
        {
 
1996
            UxStandardError(CGETS( MS_MISC_NO_MATCH, DS_MS_MISC_NO_MATCH));
 
1997
            return ERROR;
 
1998
        }
 
1999
}
 
2000
 
 
2001
/******************************************************************************
 
2002
NAME:           int             string_dialogStyle
 
2003
INPUT:          swidget         sw              - swidget
 
2004
                char            **udata         - UIMX string representation
 
2005
                char            *xdata          - Motif enumerated value
 
2006
                int             flag            - TO_UIMX or TO_X
 
2007
                int             XT_type         - the type identifier
 
2008
RETURN:         ERROR/NO_ERROR
 
2009
DESCRIPTION:    This routine converts between strings and dialogStyle values.
 
2010
                If UIMX is in design mode the conversion to X always uses
 
2011
                "dialog_modeless", Otherwise the normal conversion occurs.
 
2012
LAST REV:       Apr 93  fix 4119 pass true values to UIM/X widgets.
 
2013
-----------------------------------------------------------------------------*/
 
2014
 
 
2015
static int string_dialogStyle(sw, udata, xdata, flag, XT_type)
 
2016
        swidget         sw;
 
2017
        char            **udata;
 
2018
        unsigned char   *xdata;
 
2019
        int             flag;
 
2020
        int             XT_type;
 
2021
{
 
2022
#ifndef RUNTIME
 
2023
 
 
2024
        /*-------------------------------------------------------------
 
2025
         * USER widgets are NEVER modal in Design Mode, only Test Mode.
 
2026
         *-------------------------------------------------------------*/
 
2027
        if ((flag == TO_X) 
 
2028
            && UxDesignModeP() 
 
2029
            && (sw == NULL || UxGetClassification(sw) != UIMX_WIDGET))
 
2030
        {       
 
2031
                char            *newdata= "dialog_modeless";
 
2032
 
 
2033
                if(UxStrEqual(*udata, "dialog_work_area"))
 
2034
                        return(UxStringToCharEnum(sw, udata, xdata,
 
2035
                                flag, XT_type));
 
2036
 
 
2037
                return(UxStringToCharEnum(sw, &newdata, xdata,
 
2038
                        flag, XT_type));
 
2039
        }
 
2040
 
 
2041
        /*-----------------------------------------------------
 
2042
         * UIM/X widgets get real values, not the safe subset.
 
2043
         *-----------------------------------------------------*/
 
2044
        if (flag == TO_X &&
 
2045
            sw &&
 
2046
            UxGetClassification(sw) == UIMX_WIDGET)
 
2047
        {
 
2048
            int i; 
 
2049
            int n = XtNumber(uDialogStyle);
 
2050
 
 
2051
            for (i=0; i<n; i++) {
 
2052
                if (UxStrEqual(*udata, uDialogStyle[i])) {
 
2053
                        *xdata = xTrueDialogStyle[i];
 
2054
                        return NO_ERROR;
 
2055
                }
 
2056
            }
 
2057
            *xdata =  XmDIALOG_MODELESS;
 
2058
            return ERROR;
 
2059
        }
 
2060
 
 
2061
#endif /* RUNTIME */
 
2062
        /*----------------------------------------------------------
 
2063
         * Correct name for dialog_modeless depends on the widget.
 
2064
         *----------------------------------------------------------*/
 
2065
        if (flag == TO_UIMX) 
 
2066
        {
 
2067
                int st = UxStringToCharEnum(sw, udata, xdata, flag, XT_type);
 
2068
 
 
2069
                if (st == NO_ERROR && UxStrEqual(*udata, "dialog_modeless")) 
 
2070
                {
 
2071
                        Widget  w, wp;
 
2072
 
 
2073
                        w = UxGetWidget(sw);
 
2074
                        if (   w == NULL 
 
2075
                            || (wp = XtParent(w)) == NULL
 
2076
                            || ! XmIsDialogShell(wp))
 
2077
                        {
 
2078
                                *udata = "dialog_work_area";
 
2079
                        }
 
2080
                        return NO_ERROR;
 
2081
                }
 
2082
                return st;
 
2083
        }
 
2084
 
 
2085
        return(UxStringToCharEnum(sw, udata, xdata, flag, XT_type));
 
2086
}
 
2087
 
 
2088
/******************************************************************************
 
2089
NAME:           int             string_inputMode(sw, udata, xdata, flag,
 
2090
                                                                XT_type)
 
2091
INPUT:          swidget         sw              - swidget
 
2092
                char            **udata         - UIMX string representation
 
2093
                int             *xdata          - Motif enumerated value
 
2094
                int             flag            - TO_UIMX or TO_X
 
2095
                int             XT_type         - the type identifier
 
2096
RETURN:         ERROR/NO_ERROR
 
2097
DESCRIPTION:    Converts between strings and inputMode values.
 
2098
 
 
2099
In design time, the values for user widgets are mapped to the
 
2100
harmless subset of values, so that USER widgets don't interfere with
 
2101
interactions.    For UIM/X widgets, we override that.
 
2102
 
 
2103
LAST REV:       fix4119         Created.
 
2104
-----------------------------------------------------------------------------*/
 
2105
 
 
2106
static int string_mwmInputMode(sw, udata, xdata, flag, XT_type)
 
2107
        swidget         sw;
 
2108
        char            **udata;
 
2109
        int             *xdata;
 
2110
        int             flag;
 
2111
        int             XT_type;
 
2112
{
 
2113
#ifndef RUNTIME
 
2114
        /*--------------------------------------------------------
 
2115
         * UIM/X widgets get the true values, not the safe subset.
 
2116
         *--------------------------------------------------------*/
 
2117
        if (flag == TO_X &&
 
2118
            sw &&
 
2119
            UxGetClassification(sw) == UIMX_WIDGET)
 
2120
        {
 
2121
            int i; 
 
2122
            int n = XtNumber(uMwmInputMode);
 
2123
 
 
2124
            for (i=0; i < n; i++) 
 
2125
            {
 
2126
                if (UxStrEqual(*udata, uMwmInputMode[i])) {
 
2127
                        *xdata = xTrueMwmInputMode[i];
 
2128
                        return NO_ERROR;
 
2129
                }
 
2130
            }
 
2131
            *xdata =  MWM_INPUT_MODELESS;
 
2132
            return ERROR;
 
2133
        }
 
2134
 
 
2135
#endif /* RUNTIME */
 
2136
 
 
2137
        return UxStringToIntEnum(sw, udata, xdata, flag, XT_type);
 
2138
}
 
2139
 
 
2140
#ifdef RUNTIME
 
2141
/******************************************************************************
 
2142
NAME:           int     string_UIMXconversion (sw, udata, xdata, flag, XT_type)
 
2143
INPUT:          swidget         sw              - swidget
 
2144
                char            **udata         - UIMX string representation
 
2145
                int             *xdata          - Motif enumerated value
 
2146
                int             flag            - TO_UIMX or TO_X
 
2147
                int             XT_type         - the type identifier
 
2148
RETURN:         ERROR/NO_ERROR
 
2149
DESCRIPTION:    Performs the conversion DIRECTLY using the 'conversion' records
 
2150
                defined above. This function is for Widget properties that do
 
2151
                not have resource converters.
 
2152
CREATION:       Jul 4/1989
 
2153
REVISIONS:      --
 
2154
-----------------------------------------------------------------------------*/
 
2155
 
 
2156
static  int     string_UIMXconversion (sw, udata, xdata, flag, XT_type)
 
2157
        swidget sw;
 
2158
        char    **udata;
 
2159
        int     *xdata;
 
2160
        int     flag;
 
2161
        int     XT_type;
 
2162
{
 
2163
        int             i, match, err = 0;
 
2164
        char            **uconv = UxStr_conv[XT_type].strings;
 
2165
        int             *xconv = (int *) UxStr_conv[XT_type].values;
 
2166
        int             n = UxStr_conv[XT_type].size;
 
2167
        int             real_xdata;
 
2168
 
 
2169
        if (flag == TO_UIMX)
 
2170
        {
 
2171
 
 
2172
            real_xdata = * xdata;
 
2173
 
 
2174
            for (i = 0, match = 0; i<n; i++)
 
2175
                if (real_xdata == (int) xconv[i])
 
2176
                {
 
2177
                    match = 1;
 
2178
                    break;
 
2179
                }
 
2180
            if (match)
 
2181
                *udata = uconv[i];
 
2182
            else
 
2183
                err = 1;
 
2184
        }
 
2185
        else if (flag == TO_X)
 
2186
        {
 
2187
            for (i=0, match=0; i<n; i++)
 
2188
                if (UxStrEqual (*udata, uconv[i]))
 
2189
                {
 
2190
                    match = 1;
 
2191
                    break;
 
2192
                }
 
2193
            if (match)
 
2194
                *xdata = (int)xconv[i];
 
2195
            else
 
2196
                err = 1;
 
2197
        }
 
2198
        else
 
2199
        {
 
2200
            UxStandardError (CGETS( MS_MISC_WRONG_FLAG, DS_MS_MISC_WRONG_FLAG));
 
2201
            return ERROR;
 
2202
        }
 
2203
        if (! err)
 
2204
            return NO_ERROR;
 
2205
        else
 
2206
        {
 
2207
            UxStandardError (CGETS( MS_MISC_NO_MATCH, DS_MS_MISC_NO_MATCH));
 
2208
            return ERROR;
 
2209
        }
 
2210
}
 
2211
#endif /* RUNTIME */
 
2212
 
 
2213
/******************************************************************************
 
2214
NAME:           UxStringToIntEnum (sw, udata, xdata, flag, XT_type)
 
2215
INPUT:          swidget         sw              - swidget
 
2216
                char            **udata         - UIMX string representation
 
2217
                char            *xdata          - Motif enumerated value
 
2218
                int             flag            - TO_UIMX or TO_X
 
2219
                int             XT_type         - the type identifier
 
2220
RETURN:         int                             - ERROR/NO_ERROR
 
2221
DESCRIPTION:    Performs the conversion DIRECTLY using the 'conversion' records
 
2222
                defined above.
 
2223
CREATION:       Jul 4/1989
 
2224
REVISIONS:      --
 
2225
-----------------------------------------------------------------------------*/
 
2226
 
 
2227
int     UxStringToIntEnum (sw, udata, xdata, flag, XT_type)
 
2228
        swidget         sw;
 
2229
        char            **udata;
 
2230
        int             *xdata;
 
2231
        int             flag;
 
2232
        int             XT_type;
 
2233
{
 
2234
 
 
2235
#ifdef RUNTIME
 
2236
        return string_UIMXconversion(sw, udata, xdata, flag, XT_type);
 
2237
#else
 
2238
        if (flag == TO_UIMX)
 
2239
        {
 
2240
            for (i=0, match=0; i<n; i++)
 
2241
                if (*xdata == (int) xconv[i])
 
2242
                {
 
2243
                    match = 1;
 
2244
                    break;
 
2245
                }
 
2246
            if (match)
 
2247
                *udata = uconv[i];
 
2248
            else
 
2249
                err = 1;
 
2250
        }
 
2251
        else if (flag == TO_X)
 
2252
        {
 
2253
            for (i=0, match=0; i<n; i++)
 
2254
            {
 
2255
                if (UxStrEqual(*udata, uconv[i]))
 
2256
                {
 
2257
                    match = 1;
 
2258
                    break;
 
2259
                }
 
2260
            }
 
2261
            if (match)
 
2262
                *xdata = (int) xconv[i];
 
2263
            else
 
2264
                err = 1;
 
2265
        }
 
2266
        else
 
2267
        {
 
2268
            UxStandardError(CGETS( MS_MISC_WRONG_FLAG, DS_MS_MISC_WRONG_FLAG));
 
2269
            return ERROR;
 
2270
        }
 
2271
        if (!err)
 
2272
            return NO_ERROR;
 
2273
        else
 
2274
        {
 
2275
            UxStandardError(CGETS( MS_MISC_NO_MATCH, DS_MS_MISC_NO_MATCH));
 
2276
            return ERROR;
 
2277
        }
 
2278
#endif /* RUNTIME */
 
2279
}
 
2280
 
 
2281
/***************************************************************************
 
2282
NAME:           add_enum_type( name, xt_size, xt_vals, uimx_vals, num_vals,
 
2283
                                convertor, xt_variable )
 
2284
INPUT:          char            *name           : name of resource type
 
2285
                int             xt_size         : sizeof(Xt value)
 
2286
                unsigned char   *xt_vals        : array of Xt values
 
2287
                char            **uimx_vals     : array of uimx values
 
2288
                int             num_vals        : number of array elements
 
2289
                UIMX_conv       convertor       : convertor function to be used
 
2290
OUTPUT:         int             *xt_variable    : the UxXT_ variable to be set
 
2291
RETURN:         void
 
2292
DESCRIPTION:    Installs the arrays of possible values and the convertor for an
 
2293
                Xt resource type that takes on one of a small set of values.
 
2294
                Note that most resources are of Xt type 'unsigned char'
 
2295
                and use the convertor 'UxStringToCharEnum()',
 
2296
                but there are a few exceptions.
 
2297
EXT REFERENCES: Relies on the UxUT_string variable already being initialized.
 
2298
EXT EFFECTS:    ---
 
2299
CREATION:       Jan 16/90
 
2300
REVISIONS:      21 Mars 1991    bug 2118
 
2301
                -- Changed name of function to be compliant to VE style
 
2302
                   for user delivery. UxAddXtype and UxAddConv
 
2303
 
 
2304
---------------------------------------------------------------------------*/
 
2305
static  void    add_enum_type( name, xt_size, xt_vals, uimx_vals, num_vals,
 
2306
                                convertor, xt_variable )
 
2307
        char            *name;
 
2308
        int             xt_size;
 
2309
        unsigned char   *xt_vals;
 
2310
        char            **uimx_vals;
 
2311
        int             num_vals;
 
2312
        UIMX_conv       convertor;
 
2313
        int             *xt_variable;
 
2314
{
 
2315
        *xt_variable = UxAddXtype( name, xt_size );
 
2316
        UxAddXValues( *xt_variable, uimx_vals, xt_vals, num_vals );
 
2317
        UxAddConv( UxUT_string, *xt_variable, convertor );
 
2318
}
 
2319
 
 
2320
/***************************************************************************
 
2321
NAME:           UxAddEnumType( name, xt_size, xt_vals, uimx_vals, xdef_vals,
 
2322
                                                        num_vals, convertor )
 
2323
INPUT:          char            *name           : name of resource type
 
2324
                int             xt_size         : sizeof(Xt value)
 
2325
                unsigned char   *xt_vals        : array of Xt values
 
2326
                char            **uimx_vals     : array of uimx values
 
2327
                char            **xdef_vals     : array of Xt defined constants
 
2328
                int             num_vals        : number of array elements
 
2329
                UIMX_conv       convertor       : convertor function to be used
 
2330
OUTPUT:         ---
 
2331
RETURN:         int                             : the id of the new xtype
 
2332
DESCRIPTION:    Installs the arrays of possible values and the convertor for an
 
2333
                Xt resource type that takes on one of a small set of values.
 
2334
                The return value is the id of the new xtype and should be stored
 
2335
                in a UxXT_ global variable.
 
2336
                Note that most resources are of Xt type 'unsigned char'
 
2337
                and use the convertor 'UxStringToCharEnum()',
 
2338
                but there are a few exceptions.
 
2339
 
 
2340
                This function is presently not used in the standard UIM/X
 
2341
                - it is provided for use by the users who are extending UIM/X.
 
2342
                Note that the parameter 'xdef_vals' is not used in this
 
2343
                version of the function but there is another version of this
 
2344
                function in cgen/enum.c where 'xdef_vals' is used and so we
 
2345
                retain it here so that both versions have the same parameters.
 
2346
 
 
2347
EXT REFERENCES: Relies on the UxUT_string variable already being initialized.
 
2348
EXT EFFECTS:    ---
 
2349
CREATION:       Jan 16/90       Visual Edge Software
 
2350
 
 
2351
---------------------------------------------------------------------------*/
 
2352
int     UxAddEnumType( name, xt_size, xt_vals, uimx_vals, xdef_vals,
 
2353
                                                        num_vals, convertor )
 
2354
        char            *name;
 
2355
        int             xt_size;
 
2356
        unsigned char   *xt_vals;
 
2357
        char            **uimx_vals;
 
2358
        char            **xdef_vals;
 
2359
        int             num_vals;
 
2360
        UIMX_conv       convertor;
 
2361
{
 
2362
        int             xtype;
 
2363
 
 
2364
        add_enum_type( name, xt_size, xt_vals, uimx_vals, num_vals, convertor,
 
2365
                        &xtype );
 
2366
 
 
2367
        return ( xtype );
 
2368
}
 
2369
 
 
2370
/***************************************************************************
 
2371
NAME:           UxInitEnumTypes()
 
2372
INPUT:          ---
 
2373
OUTPUT:         ---
 
2374
RETURN:         void
 
2375
DESCRIPTION:    Adds the Xt types and registers the convertors and arrays of
 
2376
                values for the enumerated-type resources.
 
2377
EXT REFERENCES: Relies on the UxUT_string variable already being initialized.
 
2378
EXT EFFECTS:    Initializes the UxXT_ variables for the enumerated types.
 
2379
CREATION:       Jan 11/91
 
2380
 
 
2381
---------------------------------------------------------------------------*/
 
2382
void    UxInitEnumTypes()
 
2383
{
 
2384
        /* in alphabetical order */
 
2385
 
 
2386
        add_enum_type( "Alignment",  sizeof(unsigned char),
 
2387
                xAlignment, uAlignment, XtNumber(uAlignment),
 
2388
                UxStringToCharEnum, &UxXT_Alignment );
 
2389
 
 
2390
        add_enum_type( "ChildPlacement",  sizeof(unsigned char),
 
2391
                xChildPlacement, uChildPlacement,
 
2392
                XtNumber(uChildPlacement),
 
2393
                UxStringToCharEnum, &UxXT_ChildPlacement );
 
2394
 
 
2395
        add_enum_type( "ChildVerticalAlignment",  sizeof(unsigned char), 
 
2396
                xChildVerticalAlignment, uChildVerticalAlignment,
 
2397
                XtNumber(uChildVerticalAlignment),
 
2398
                UxStringToCharEnum, &UxXT_ChildVerticalAlignment);
 
2399
        add_enum_type( "EntryVerticalAlignment",  sizeof(unsigned
 
2400
 char),
 
2401
                xEntryVerticalAlignment, uEntryVerticalAlignment,
 
2402
                XtNumber(uEntryVerticalAlignment),
 
2403
                UxStringToCharEnum, &UxXT_EntryVerticalAlignment);
 
2404
 
 
2405
 
 
2406
        add_enum_type( "ArrowDirection",  sizeof(unsigned char),
 
2407
                xArrowDirection, uArrowDirection, XtNumber(uArrowDirection),
 
2408
                UxStringToCharEnum, &UxXT_ArrowDirection );
 
2409
 
 
2410
        add_enum_type( "AttachmentType",  sizeof(unsigned char),
 
2411
                xAttachmentType, uAttachmentType, XtNumber(uAttachmentType),
 
2412
                UxStringToCharEnum, &UxXT_AttachmentType );
 
2413
 
 
2414
        add_enum_type( "AudibleWarning",  sizeof(unsigned char),
 
2415
                xAudibleWarning, uAudibleWarning, XtNumber(uAudibleWarning),
 
2416
                UxStringToCharEnum, &UxXT_AudibleWarning );
 
2417
 
 
2418
        add_enum_type( "Bool",  sizeof(Bool),
 
2419
                xBool, uBoolean, XtNumber(uBoolean),
 
2420
                UxStringToIntEnum, &UxXT_Bool );
 
2421
 
 
2422
        add_enum_type( "Boolean",  sizeof(Boolean),
 
2423
                xBoolean, uBoolean, XtNumber(uBoolean),
 
2424
                UxStringToCharEnum, &UxXT_Boolean );
 
2425
 
 
2426
        add_enum_type( "ChildType",  sizeof(unsigned char),
 
2427
                xChildType, uChildType,
 
2428
                XtNumber(uChildType),
 
2429
                UxStringToCharEnum, &UxXT_ChildType );
 
2430
 
 
2431
        add_enum_type( "CommandWindowLocation",  sizeof(unsigned char),
 
2432
                xCommandWindowLocation, uCommandWindowLocation, 
 
2433
                XtNumber(uCommandWindowLocation),
 
2434
                UxStringToCharEnum, &UxXT_CommandWindowLocation );
 
2435
 
 
2436
        add_enum_type( "DefaultButtonType",  sizeof(unsigned char),
 
2437
                xDefaultButtonType, uDefaultButtonType,
 
2438
                XtNumber(uDefaultButtonType),
 
2439
                UxStringToCharEnum, &UxXT_DefaultButtonType );
 
2440
 
 
2441
        add_enum_type( "DeleteResponse",  sizeof(unsigned char),
 
2442
                xDeleteResponse, uDeleteResponse, XtNumber(uDeleteResponse),
 
2443
                UxStringToCharEnum, &UxXT_DeleteResponse );
 
2444
 
 
2445
        add_enum_type( "DialogStyle",  sizeof(unsigned char),
 
2446
                xDialogStyle, uDialogStyle, XtNumber(uDialogStyle),
 
2447
                string_dialogStyle, &UxXT_DialogStyle );
 
2448
 
 
2449
        add_enum_type( "DialogType",  sizeof(unsigned char),
 
2450
                xDialogType, uDialogType, XtNumber(uDialogType),
 
2451
                UxStringToCharEnum, &UxXT_DialogType );
 
2452
 
 
2453
        add_enum_type( "EditMode",  sizeof(int),
 
2454
                (unsigned char *)xEditMode, uEditMode, XtNumber(uEditMode),
 
2455
                UxStringToIntEnum, &UxXT_EditMode );
 
2456
 
 
2457
        add_enum_type( "FileTypeMask",  sizeof(unsigned char),
 
2458
                xFileTypeMask, uFileTypeMask, XtNumber(uFileTypeMask),
 
2459
                UxStringToCharEnum, &UxXT_FileTypeMask );
 
2460
 
 
2461
        add_enum_type( "IndicatorType",  sizeof(unsigned char),
 
2462
                xIndicatorType, uIndicatorType, XtNumber(uIndicatorType),
 
2463
                UxStringToCharEnum, &UxXT_IndicatorType );
 
2464
 
 
2465
        add_enum_type( "InitialWindowState",  sizeof(int),
 
2466
                (unsigned char *)xInitialWindowState, uInitialWindowState,
 
2467
                XtNumber(uInitialWindowState),
 
2468
                UxStringToIntEnum, &UxXT_InitialWindowState );
 
2469
 
 
2470
        add_enum_type( "KeyboardFocusPolicy",  sizeof(unsigned char),
 
2471
                xKeyboardFocusPolicy, uKeyboardFocusPolicy,
 
2472
                XtNumber(uKeyboardFocusPolicy),
 
2473
                UxStringToCharEnum, &UxXT_KeyboardFocusPolicy );
 
2474
 
 
2475
        add_enum_type( "LabelType",  sizeof(unsigned char),
 
2476
                xLabelType, uLabelType, XtNumber(uLabelType),
 
2477
                UxStringToCharEnum, &UxXT_LabelType );
 
2478
 
 
2479
        add_enum_type( "ListSizePolicy",  sizeof(unsigned char),
 
2480
                xListSizePolicy, uListSizePolicy, XtNumber(uListSizePolicy),
 
2481
                UxStringToCharEnum, &UxXT_ListSizePolicy );
 
2482
 
 
2483
        add_enum_type( "MsgDialogType",  sizeof(unsigned char),
 
2484
                xMsgDialogType, uMsgDialogType, XtNumber(uMsgDialogType),
 
2485
                UxStringToCharEnum, &UxXT_MsgDialogType );
 
2486
 
 
2487
        add_enum_type( "MwmInputMode",  sizeof(int),
 
2488
                xMwmInputMode, uMwmInputMode, XtNumber(uMwmInputMode),
 
2489
                string_mwmInputMode, &UxXT_MwmInputMode );
 
2490
 
 
2491
        add_enum_type( "MultiClick",  sizeof(unsigned char),
 
2492
                xMultiClick, uMultiClick, XtNumber(uMultiClick),
 
2493
                UxStringToCharEnum, &UxXT_MultiClick );
 
2494
 
 
2495
        add_enum_type( "NavigationType",  sizeof(unsigned char),
 
2496
                xNavigationType, uNavigationType, XtNumber(uNavigationType),
 
2497
                UxStringToCharEnum, &UxXT_NavigationType );
 
2498
 
 
2499
        add_enum_type( "Orientation",  sizeof(unsigned char),
 
2500
                xOrientation, uOrientation, XtNumber(uOrientation),
 
2501
                UxStringToCharEnum, &UxXT_Orientation );
 
2502
 
 
2503
        add_enum_type( "Packing",  sizeof(unsigned char),
 
2504
                xPacking, uPacking, XtNumber(uPacking),
 
2505
                UxStringToCharEnum, &UxXT_Packing );
 
2506
 
 
2507
        add_enum_type( "ProcessingDirection",  sizeof(unsigned char),
 
2508
                xProcessingDirection, uProcessingDirection,
 
2509
                XtNumber(uProcessingDirection),
 
2510
                UxStringToCharEnum, &UxXT_ProcessingDirection );
 
2511
 
 
2512
        add_enum_type( "ResizePolicy",  sizeof(unsigned char),
 
2513
                xResizePolicy, uResizePolicy, XtNumber(uResizePolicy),
 
2514
                UxStringToCharEnum, &UxXT_ResizePolicy );
 
2515
 
 
2516
        add_enum_type( "RowColumnType",  sizeof(unsigned char),
 
2517
                xRowColumnType, uRowColumnType, XtNumber(uRowColumnType),
 
2518
                UxStringToCharEnum, &UxXT_RowColumnType );
 
2519
 
 
2520
        add_enum_type( "ScrollBarDisplayPolicy",  sizeof(unsigned char),
 
2521
                xScrollBarDisplayPolicy, uScrollBarDisplayPolicy,
 
2522
                XtNumber(uScrollBarDisplayPolicy),
 
2523
                UxStringToCharEnum, &UxXT_ScrollBarDisplayPolicy );
 
2524
 
 
2525
        add_enum_type( "ScrollBarPlacement",  sizeof(unsigned char),
 
2526
                xScrollBarPlacement, uScrollBarPlacement,
 
2527
                XtNumber(uScrollBarPlacement),
 
2528
                UxStringToCharEnum, &UxXT_ScrollBarPlacement );
 
2529
 
 
2530
        add_enum_type( "ScrollingPolicy",  sizeof(unsigned char),
 
2531
                xScrollingPolicy, uScrollingPolicy, XtNumber(uScrollingPolicy),
 
2532
                UxStringToCharEnum, &UxXT_ScrollingPolicy );
 
2533
 
 
2534
        add_enum_type( "SelectionPolicy",  sizeof(unsigned char),
 
2535
                xSelectionPolicy, uSelectionPolicy, XtNumber(uSelectionPolicy),
 
2536
                UxStringToCharEnum, &UxXT_SelectionPolicy );
 
2537
 
 
2538
        add_enum_type( "SeparatorType",  sizeof(unsigned char),
 
2539
                xSeparatorType, uSeparatorType, XtNumber(uSeparatorType),
 
2540
                UxStringToCharEnum, &UxXT_SeparatorType );
 
2541
 
 
2542
        add_enum_type( "ShadowType",  sizeof(unsigned char),
 
2543
                xShadowType, uShadowType, XtNumber(uShadowType),
 
2544
                UxStringToCharEnum, &UxXT_ShadowType );
 
2545
 
 
2546
        add_enum_type( "StringDirection",  sizeof(unsigned char),
 
2547
                xStringDirection, uStringDirection, XtNumber(uStringDirection),
 
2548
                UxStringToCharEnum, &UxXT_StringDirection );
 
2549
 
 
2550
        add_enum_type( "TearOffModel",  sizeof(unsigned char),
 
2551
                xTearOffModel, uTearOffModel, XtNumber(uTearOffModel),
 
2552
                UxStringToCharEnum, &UxXT_TearOffModel );
 
2553
 
 
2554
        add_enum_type( "UnitType",  sizeof(unsigned char),
 
2555
                xUnitType, uUnitType, XtNumber(uUnitType),
 
2556
                UxStringToCharEnum, &UxXT_UnitType );
 
2557
 
 
2558
        add_enum_type( "VisualPolicy",  sizeof(unsigned char),
 
2559
                xVisualPolicy, uVisualPolicy, XtNumber(uVisualPolicy),
 
2560
                UxStringToCharEnum, &UxXT_VisualPolicy );
 
2561
 
 
2562
        add_enum_type( "WinGravity",  sizeof(int),
 
2563
                xWinGravity, uWinGravity, XtNumber(uWinGravity),
 
2564
                UxStringToIntEnum, &UxXT_WinGravity );
 
2565
 
 
2566
        /* Now add any enumerated-resource types that the user has defined */
 
2567
        UxAddUserDefEnumTypes();
 
2568
}
 
2569