1 /*
2  * Motif Tools Library, Version 3.1
3  * $Id: MotifWidgets.c,v 1.2 2001/09/19 02:57:18 grmcdorman Exp $
4  *
5  * Written by David Flanagan.
6  * Copyright (c) 1992-2001 by David Flanagan.
7  * All Rights Reserved.  See the file COPYRIGHT for details.
8  * This is open source software.  See the file LICENSE for details.
9  * There is no warranty for this software.  See NO_WARRANTY for details.
10  *
11  * $Log: MotifWidgets.c,v $
12  * Revision 1.2  2001/09/19 02:57:18  grmcdorman
13  * This change makes the following modifications:
14  *   A new program, printConfig, is provided. This is built by a
15  *   simple rule in the Makefile and not installed. It prints
16  *   significant defines from Xmt.tmpl.
17  *
18  *   XmtP.h is now generated from XmtP.h.in using printConfig. As
19  *   a result, code compiled outside of the Xmt Imakefiles will
20  *   have all of the Xmt.tmpl defines.
21  *
22  *   Source files are modified to use XmtP.h instead of Xmt.h.
23  *
24  *   WorkingBox.c is modified to use the new Progress widget.
25  *   It can be compiled in the old style if WORKINGBOX_USE_SCALE is
26  *   defined at compile time.
27  *
28  *   Because XmtP.h is generated dynamically, it is removed from CVS
29  *   with this check-in.
30  *
31  * Revision 1.1.1.1  2001/02/10 13:49:12  motiftools
32  * Initial import of Xmt310 to CVS
33  *
34  *
35  */
36 
37 #include <Xmt/XmtP.h>
38 #include <Xmt/WidgetType.h>
39 
40 #include <Xm/ArrowB.h>
41 #include <Xm/BulletinB.h>
42 #include <Xm/CascadeB.h>
43 #include <Xm/Command.h>
44 #include <Xm/DialogS.h>
45 #include <Xm/DrawingA.h>
46 #include <Xm/DrawnB.h>
47 #include <Xm/FileSB.h>
48 #include <Xm/Form.h>
49 #include <Xm/Frame.h>
50 #include <Xm/Label.h>
51 #include <Xm/List.h>
52 #include <Xm/MainW.h>
53 #include <Xm/MenuShell.h>
54 #include <Xm/MessageB.h>
55 #include <Xm/PanedW.h>
56 #include <Xm/PushB.h>
57 #include <Xm/RowColumn.h>
58 #include <Xm/ScrollBar.h>
59 #include <Xm/ScrolledW.h>
60 #include <Xm/SelectioB.h>
61 #include <Xm/Separator.h>
62 
63 /*
64  * ARH	These include files cover widgets that were added in Motif-2.0.
65  */
66 #if XmVersion >= 2000
67 #include <Xm/Container.h>
68 #include <Xm/IconG.h>
69 #include <Xm/Notebook.h>
70 #include <Xm/SpinB.h>
71 #endif
72 
73 static XmtWidgetType motif_widgets[] = {
74 {"XmArrowButton", NULL, XmCreateArrowButton},
75 {"XmBulletinBoard", NULL, XmCreateBulletinBoard},
76 {"XmBulletinBoardDialog", NULL, XmCreateBulletinBoardDialog, NULL, NULL, True},
77 {"XmCascadeButton", NULL, XmCreateCascadeButton},
78 {"XmCommand", NULL, XmCreateCommand},
79 
80 #if XmVersion >= 2000
81 {"XmContainer", NULL, XmCreateContainer, NULL, NULL, True},
82 #endif
83 
84 {"XmDialogShell", NULL, XmCreateDialogShell, NULL, NULL, True},
85 {"XmDrawingArea", NULL, XmCreateDrawingArea},
86 {"XmDrawnButton", NULL, XmCreateDrawnButton},
87 {"XmErrorDialog", NULL, XmCreateErrorDialog, NULL, NULL, True},
88 {"XmFileSelectionBox", NULL, XmCreateFileSelectionBox},
89 {"XmFileSelectionDialog", NULL, XmCreateFileSelectionDialog, NULL, NULL, True},
90 {"XmForm", NULL, XmCreateForm},
91 {"XmFormDialog", NULL, XmCreateFormDialog, NULL, NULL, True},
92 {"XmFrame", NULL, XmCreateFrame},
93 
94 #if XmVersion >= 2000
95 {"XmIconGadget", NULL, XmCreateIconGadget, NULL, NULL, True},
96 #endif
97 
98 {"XmInformationDialog", NULL, XmCreateInformationDialog, NULL, NULL, True},
99 {"XmLabel", NULL, XmCreateLabel},
100 /* Motif 1.2.0 has the prototypes wrong for these next two and ScrolledList */
101 {"XmList", NULL, (XmtWidgetConstructor) XmCreateList},
102 {"XmMainWindow", NULL, (XmtWidgetConstructor) XmCreateMainWindow},
103 {"XmMenuBar", NULL, XmCreateMenuBar},
104 {"XmMenuShell", NULL, XmCreateMenuShell, NULL, NULL, True},
105 {"XmMessageBox", NULL, XmCreateMessageBox},
106 {"XmMessageDialog", NULL, XmCreateMessageDialog, NULL, NULL, True},
107 
108 #if XmVersion >= 2000
109 {"XmNotebook", NULL, XmCreateNotebook, NULL, NULL, True},
110 #endif
111 
112 {"XmOptionMenu", NULL, XmCreateOptionMenu},
113 {"XmPanedWindow", NULL, XmCreatePanedWindow},
114 {"XmPopupMenu", NULL, XmCreatePopupMenu, NULL, NULL, True},
115 {"XmPromptDialog", NULL, XmCreatePromptDialog, NULL, NULL, True},
116 {"XmPulldownMenu", NULL, XmCreatePulldownMenu, NULL, NULL, True},
117 {"XmPushButton", NULL, XmCreatePushButton},
118 {"XmQuestionDialog", NULL, XmCreateQuestionDialog, NULL, NULL, True},
119 {"XmRadioBox", NULL, XmCreateRadioBox},
120 {"XmRowColumn", NULL, XmCreateRowColumn},
121 {"XmScrollBar", NULL, XmCreateScrollBar},
122 {"XmScrolledList", NULL, (XmtWidgetConstructor) XmCreateScrolledList},
123 {"XmScrolledWindow", NULL, XmCreateScrolledWindow},
124 {"XmSelectionBox", NULL, XmCreateSelectionBox},
125 {"XmSelectionDialog", NULL, XmCreateSelectionDialog, NULL, NULL, True},
126 {"XmSeparator", NULL, XmCreateSeparator},
127 {"XmSimpleCheckBox", NULL, XmCreateSimpleCheckBox},
128 {"XmSimpleMenuBar", NULL, XmCreateSimpleMenuBar},
129 {"XmSimpleOptionMenu", NULL, XmCreateSimpleOptionMenu},
130 {"XmSimplePopupMenu", NULL, XmCreateSimplePopupMenu, NULL, NULL, True},
131 {"XmSimplePulldownMenu", NULL, XmCreateSimplePulldownMenu, NULL, NULL, True},
132 {"XmSimpleRadioBox", NULL, XmCreateSimpleRadioBox},
133 
134 #if XmVersion >= 2000
135 {"XmSpinBox", NULL, XmCreateSpinBox, NULL, NULL, True},
136 #endif
137 
138 {"XmWarningDialog", NULL, XmCreateWarningDialog, NULL, NULL, True},
139 {"XmWorkArea", NULL, XmCreateWorkArea},
140 {"XmWorkingDialog", NULL, XmCreateWorkingDialog, NULL, NULL, True},
141 };
142 
143 
144 #if NeedFunctionPrototypes
XmtRegisterMotifWidgets(void)145 void XmtRegisterMotifWidgets(void)
146 #else
147 void XmtRegisterMotifWidgets()
148 #endif
149 {
150     XmtRegisterWidgetTypes(motif_widgets, XtNumber(motif_widgets));
151     XmtRegisterXmText();
152     XmtRegisterXmScrolledText();
153     XmtRegisterXmTextField();
154     XmtRegisterXmToggleButton();
155     XmtRegisterXmScale();
156 #if XmVersion >= 2000
157     XmtRegisterXmComboBox();
158 #endif
159 #if XmVersion == 2000
160     XmtRegisterXmCSText();
161     XmtRegisterXmScrolledCSText();
162 #endif
163 }
164