1
/* $XConsortium: Template.c,v 1.4 91/02/17 16:18:42 converse Exp $ */
3
/* Copyright Massachusetts Institute of Technology 1987, 1988
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
9
* documentation, and that the name of M.I.T. not be used in advertising or
10
* publicity pertaining to distribution of the software without specific,
11
* written prior permission. M.I.T. makes no representations about the
12
* suitability of this software for any purpose. It is provided "as is"
13
* without express or implied warranty.
15
* M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
16
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
17
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
19
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24
#include <X11/IntrinsicP.h>
25
#include <X11/StringDefs.h>
26
#include "TemplateP.h"
28
static XtResource resources[] = {
29
#define offset(field) XtOffsetOf(TemplateRec, template.field)
30
/* {name, class, type, size, offset, default_type, default_addr}, */
31
{ XtNtemplateResource, XtCTemplateResource, XtRTemplateResource,
32
sizeof(char*), offset(resource), XtRString, (XtPointer) "default" },
36
static void TemplateAction(/* Widget, XEvent*, String*, Cardinal* */);
38
static XtActionsRec actions[] =
40
/* {name, procedure}, */
41
{"template", TemplateAction},
44
static char translations[] =
45
"<Key>: template() \n\
48
TemplateClassRec templateClassRec = {
50
/* superclass */ (WidgetClass) &widgetClassRec,
51
/* class_name */ "Template",
52
/* widget_size */ sizeof(TemplateRec),
53
/* class_initialize */ NULL,
54
/* class_part_initialize */ NULL,
55
/* class_inited */ FALSE,
56
/* initialize */ NULL,
57
/* initialize_hook */ NULL,
58
/* realize */ XtInheritRealize,
59
/* actions */ actions,
60
/* num_actions */ XtNumber(actions),
61
/* resources */ resources,
62
/* num_resources */ XtNumber(resources),
63
/* xrm_class */ NULLQUARK,
64
/* compress_motion */ TRUE,
65
/* compress_exposure */ TRUE,
66
/* compress_enterleave */ TRUE,
67
/* visible_interest */ FALSE,
71
/* set_values */ NULL,
72
/* set_values_hook */ NULL,
73
/* set_values_almost */ XtInheritSetValuesAlmost,
74
/* get_values_hook */ NULL,
75
/* accept_focus */ NULL,
76
/* version */ XtVersion,
77
/* callback_private */ NULL,
78
/* tm_table */ translations,
79
/* query_geometry */ XtInheritQueryGeometry,
80
/* display_accelerator */ XtInheritDisplayAccelerator,
83
{ /* template fields */
88
WidgetClass templateWidgetClass = (WidgetClass)&templateClassRec;