3 Copyright 1987, 1998 The Open Group
5 Permission to use, copy, modify, distribute, and sell this software and its
6 documentation for any purpose is hereby granted without fee, provided that
7 the above copyright notice appear in all copies and that both that
8 copyright notice and this permission notice appear in supporting
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 Except as contained in this notice, the name of The Open Group shall not be
22 used in advertising or otherwise to promote the sale, use or other dealings
23 in this Software without prior written authorization from The Open Group.
30 #include <X11/IntrinsicP.h>
31 #include <X11/StringDefs.h>
32 #include <X11/Xaw/TemplateP.h>
37 static void TemplateInitialize(Widget, Widget, ArgList, Cardinal*);
42 static Bool TemplateFunction(TemplateWidget, int, int, Bool);
47 static void TemplateAction(Widget, XEvent*, String*, Cardinal*);
52 #define offset(field) XtOffsetOf(TemplateRec, template.field)
53 static XtResource resources[] = {
75 static XtActionsRec actions[] =
77 /*{name, procedure},*/
78 {"template", TemplateAction},
81 static char translations[] =
82 "<Key>:" "template()\n"
85 #define Superclass (&widgetClassRec)
86 TemplateClassRec templateClassRec = {
89 (WidgetClass)Superclass, /* superclass */
90 "Template", /* class_name */
91 sizeof(TemplateRec), /* widget_size */
92 NULL, /* class_initialize */
93 NULL, /* class_part_initialize */
94 False, /* class_inited */
95 TemplateInitialize, /* initialize */
96 NULL, /* initialize_hook */
97 XtInheritRealize, /* realize */
98 actions, /* actions */
99 XtNumber(actions), /* num_actions */
100 resources, /* resources */
101 XtNumber(resources), /* num_resources */
102 NULLQUARK, /* xrm_class */
103 True, /* compress_motion */
104 True, /* compress_exposure */
105 True, /* compress_enterleave */
106 False, /* visible_interest */
110 NULL, /* set_values */
111 NULL, /* set_values_hook */
112 XtInheritSetValuesAlmost, /* set_values_almost */
113 NULL, /* get_values_hook */
114 NULL, /* accept_focus */
115 XtVersion, /* version */
116 NULL, /* callback_private */
117 translations, /* tm_table */
118 XtInheritQueryGeometry, /* query_geometry */
119 XtInheritDisplayAccelerator, /* display_accelerator */
120 NULL, /* extension */
124 NULL, /* extension */
128 WidgetClass templateWidgetClass = (WidgetClass)&templateClassRec;
138 * request - requested widget
141 * num_args - number of arguments
144 * Initializes widget instance.
148 TemplateInitialize(Widget request, Widget w, ArgList args, Cardinal *num_args)
150 TemplateWidget tw = (TemplateWidget)w;
152 tw->template.private = NULL;
160 * tw - template widget
163 * force - force action
166 * This function does nothing.
173 TemplateFunction(TemplateWidget tw, int x, int y, Bool force)
183 * w - template widget
184 * event - event that caused this action
185 * params - parameters
186 * num_params - number of parameters
189 * This function does nothing.
193 TemplateAction(Widget w, XEvent *event, String *params, Cardinal *num_params)