Merge branch 'master' of https://git.code.sf.net/p/cdesktopenv/code
[oweals/cde.git] / cde / programs / dtcalc / ds_widget.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: ds_widget.h /main/3 1995/11/01 12:40:37 rswiston $ */
24 /*                                                                      *
25  *  ds_widget.h                                                         *
26  *   Contains the NO_PROTO defines for functions is ds_widget.h.        *
27  *                                                                      *
28  * (c) Copyright 1993, 1994 Hewlett-Packard Company                     *
29  * (c) Copyright 1993, 1994 International Business Machines Corp.       *
30  * (c) Copyright 1993, 1994 Sun Microsystems, Inc.                      *
31  * (c) Copyright 1993, 1994 Novell, Inc.                                *
32  */
33
34 #ifndef _ds_widget_h
35 #define _ds_widget_h
36
37 #include <X11/Xlib.h>
38 #include <X11/Xresource.h>
39 #include <X11/Intrinsic.h>
40 #include <Xm/Xm.h>
41 #include <Xm/Label.h>
42 #include <Xm/Separator.h>
43 #include <Xm/RowColumn.h>
44 #include <Xm/ToggleB.h>
45 #include <Xm/PushB.h>
46 #include <Xm/TextF.h>
47
48 /* For all function declarations, if ANSI then use a prototype. */
49
50 #if  defined(__STDC__)
51 #define P(args)  args
52 #else  /* ! __STDC__ */
53 #define P(args)  ()
54 #endif  /* STDC */
55
56 enum choice_type { CH_ACTIVE, CH_VALUE } ;    /* Choice operations. */
57
58 /* Text widget operations. */
59 enum text_type   { T_ACTIVE, T_CARET, T_LABEL, T_VALUE } ;
60
61 struct cW_struct {                 /* Choice widget structure. */
62   Widget lmanager ;                /* xmRowColumnWidget Class. */
63   Widget label ;                   /* xmLabelWidgetClass. */
64   Widget cmanager ;                /* xmRowColumnWidgetClass. */
65   Widget *choices ;                /* xmToggleButtonWidgetClass. */
66   int maxno ;                      /* Number of choice elements. */
67   int isexclusive ;                /* Exclusive choice. */
68   void (*func)() ;                 /* Callback (if any) for this choice. */
69 } ;
70
71 struct tW_struct {                 /* Text widget structure. */
72   Widget manager ;                 /* xmRowColumnWidgetClass. */
73   Widget label ;                   /* xmLabelWidgetClass. */
74   Widget textfield ;               /* xmTextWidgetClass. */
75 } ;
76
77 int get_choice                  P((struct cW_struct *, enum choice_type)) ;
78
79 struct cW_struct *make_choiceW  P((Widget, char *, char **, int, int,
80                                    int, void (*)())) ;
81 struct tW_struct *make_textW    P((Widget,  char *)) ;
82  
83 Widget make_butW         P((Widget, char *)) ;
84 Widget make_labelW       P((Widget,  char *)) ;
85 Widget make_manW         P((char *, Widget, int, int)) ;
86 Widget make_toggleW      P((Widget, char *)) ;
87
88 void set_choice          P((struct cW_struct *, enum choice_type, int)) ;
89 void set_choice_help     P((struct cW_struct *, char *)) ;
90 void set_text_help       P((struct tW_struct *, char *)) ;
91 void set_text_str        P((struct tW_struct *, enum text_type, char *)) ;
92
93 #endif /*_ds_widget_h*/