1 /*
2 
3 Copyright (c) 1989  X Consortium
4 
5 Permission is hereby granted, free of charge, to any person obtaining a copy
6 of this software and associated documentation files (the "Software"), to deal
7 in the Software without restriction, including without limitation the rights
8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 copies of the Software, and to permit persons to whom the Software is
10 furnished to do so, subject to the following conditions:
11 
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
14 
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
18 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 Except as contained in this notice, the name of the X Consortium shall not be
23 used in advertising or otherwise to promote the sale, use or other dealings
24 in this Software without prior written authorization from the X Consortium.
25 
26 */
27 
28 /*
29  * ToggleP.h - Private definitions for Toggle widget
30  *
31  * Author: Chris D. Peterson
32  *         MIT X Consortium
33  *         kit@expo.lcs.mit.edu
34  *
35  * Date:   January 12, 1989
36  *
37  */
38 
39 #ifndef _XawToggleP_h
40 #define _XawToggleP_h
41 
42 #include <X11/Xaw3dxft/Toggle.h>
43 #include <X11/Xaw3dxft/CommandP.h>
44 
45 /***********************************************************************
46  *
47  * Toggle Widget Private Data
48  *
49  ***********************************************************************/
50 
51 #define streq(a, b) ( strcmp((a), (b)) == 0 )
52 
53 typedef struct _RadioGroup {
54   struct _RadioGroup *prev, *next; /* Pointers to other elements in group. */
55   Widget widget;		  /* Widget corrosponding to this element. */
56 } RadioGroup;
57 
58 /************************************
59  *
60  *  Class structure
61  *
62  ***********************************/
63 
64    /* New fields for the Toggle widget class record */
65 typedef struct _ToggleClass  {
66     XtActionProc Set;
67     XtActionProc Unset;
68     XtPointer extension;
69 } ToggleClassPart;
70 
71    /* Full class record declaration */
72 typedef struct _ToggleClassRec {
73     CoreClassPart	core_class;
74     SimpleClassPart	simple_class;
75     ThreeDClassPart	threeD_class;
76     LabelClassPart	label_class;
77     CommandClassPart	command_class;
78     ToggleClassPart     toggle_class;
79 } ToggleClassRec;
80 
81 extern ToggleClassRec toggleClassRec;
82 
83 /***************************************
84  *
85  *  Instance (widget) structure
86  *
87  **************************************/
88 
89     /* New fields for the Toggle widget record */
90 typedef struct {
91     /* resources */
92     Widget      widget;
93     XtPointer   radio_data;
94 
95     /* private data */
96     RadioGroup * radio_group;
97 } TogglePart;
98 
99    /* Full widget declaration */
100 typedef struct _ToggleRec {
101     CorePart         core;
102     SimplePart	     simple;
103     ThreeDPart       threeD;
104     LabelPart	     label;
105     CommandPart	     command;
106     TogglePart       toggle;
107 } ToggleRec;
108 
109 #endif /* _XawToggleP_h */
110 
111 
112