/* $XConsortium: Template.c,v 1.4 91/02/17 16:18:42 converse Exp $ */ /* Copyright Massachusetts Institute of Technology 1987, 1988 * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. M.I.T. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ #include <X11/IntrinsicP.h> #include <X11/StringDefs.h> #include "TemplateP.h" static XtResource resources[] = { #define offset(field) XtOffsetOf(TemplateRec, template.field) /* {name, class, type, size, offset, default_type, default_addr}, */ { XtNtemplateResource, XtCTemplateResource, XtRTemplateResource, sizeof(char*), offset(resource), XtRString, (XtPointer) "default" }, #undef offset }; static void TemplateAction(/* Widget, XEvent*, String*, Cardinal* */); static XtActionsRec actions[] = { /* {name, procedure}, */ {"template", TemplateAction}, }; static char translations[] = "<Key>: template() \n\ "; TemplateClassRec templateClassRec = { { /* core fields */ /* superclass */ (WidgetClass) &widgetClassRec, /* class_name */ "Template", /* widget_size */ sizeof(TemplateRec), /* class_initialize */ NULL, /* class_part_initialize */ NULL, /* class_inited */ FALSE, /* initialize */ NULL, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ actions, /* num_actions */ XtNumber(actions), /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ TRUE, /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ NULL, /* resize */ NULL, /* expose */ NULL, /* set_values */ NULL, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ translations, /* query_geometry */ XtInheritQueryGeometry, /* display_accelerator */ XtInheritDisplayAccelerator, /* extension */ NULL }, { /* template fields */ /* empty */ 0 } }; WidgetClass templateWidgetClass = (WidgetClass)&templateClassRec;