17a84e134Smrg/*
27a84e134Smrg
37a84e134SmrgCopyright 1987, 1998  The Open Group
47a84e134Smrg
57a84e134SmrgPermission to use, copy, modify, distribute, and sell this software and its
67a84e134Smrgdocumentation for any purpose is hereby granted without fee, provided that
77a84e134Smrgthe above copyright notice appear in all copies and that both that
87a84e134Smrgcopyright notice and this permission notice appear in supporting
97a84e134Smrgdocumentation.
107a84e134Smrg
117a84e134SmrgThe above copyright notice and this permission notice shall be included in
127a84e134Smrgall copies or substantial portions of the Software.
137a84e134Smrg
147a84e134SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
157a84e134SmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
167a84e134SmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
177a84e134SmrgOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
187a84e134SmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
197a84e134SmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
207a84e134Smrg
217a84e134SmrgExcept as contained in this notice, the name of The Open Group shall not be
227a84e134Smrgused in advertising or otherwise to promote the sale, use or other dealings
237a84e134Smrgin this Software without prior written authorization from The Open Group.
247a84e134Smrg
257a84e134Smrg*/
267a84e134Smrg
277a84e134Smrg#ifdef HAVE_CONFIG_H
287a84e134Smrg#include <config.h>
297a84e134Smrg#endif
307a84e134Smrg#include <X11/IntrinsicP.h>
317a84e134Smrg#include <X11/StringDefs.h>
327a84e134Smrg#include <X11/Xaw/TemplateP.h>
337a84e134Smrg
347a84e134Smrg/*
357a84e134Smrg * Class Methods
367a84e134Smrg */
377a84e134Smrgstatic void TemplateInitialize(Widget, Widget, ArgList, Cardinal*);
387a84e134Smrg
397a84e134Smrg/*
407a84e134Smrg * Prototypes
417a84e134Smrg */
427a84e134Smrgstatic Bool TemplateFunction(TemplateWidget, int, int, Bool);
437a84e134Smrg
447a84e134Smrg/*
457a84e134Smrg * Actions
467a84e134Smrg */
477a84e134Smrgstatic void TemplateAction(Widget, XEvent*, String*, Cardinal*);
487a84e134Smrg
497a84e134Smrg/*
507a84e134Smrg * Initialization
517a84e134Smrg */
527a84e134Smrg#define offset(field) XtOffsetOf(TemplateRec, template.field)
537a84e134Smrgstatic XtResource resources[] = {
547a84e134Smrg/*{
557a84e134Smrg    name,
567a84e134Smrg    class,
577a84e134Smrg    type,
587a84e134Smrg    size,
597a84e134Smrg    offset,
607a84e134Smrg    default_type,
617a84e134Smrg    default_addr
627a84e134Smrg  },*/
637a84e134Smrg  {
647a84e134Smrg    XtNtemplateResource,
657a84e134Smrg    XtCTemplateResource,
667a84e134Smrg    XtRTemplateResource,
677a84e134Smrg    sizeof(char*),
687a84e134Smrg    offset(resource),
697a84e134Smrg    XtRString,
707a84e134Smrg    (XtPointer)"default"
717a84e134Smrg  },
727a84e134Smrg};
737a84e134Smrg#undef offset
747a84e134Smrg
757a84e134Smrgstatic XtActionsRec actions[] =
767a84e134Smrg{
777a84e134Smrg    /*{name,		procedure},*/
787a84e134Smrg    {"template",	TemplateAction},
797a84e134Smrg};
807a84e134Smrg
817a84e134Smrgstatic char translations[] =
827a84e134Smrg"<Key>:"	"template()\n"
837a84e134Smrg;
847a84e134Smrg
857a84e134Smrg#define Superclass	(&widgetClassRec)
867a84e134SmrgTemplateClassRec templateClassRec = {
877a84e134Smrg  /* core */
887a84e134Smrg  {
897a84e134Smrg    (WidgetClass)Superclass,		/* superclass */
907a84e134Smrg    "Template",				/* class_name */
917a84e134Smrg    sizeof(TemplateRec),		/* widget_size */
927a84e134Smrg    NULL,				/* class_initialize */
937a84e134Smrg    NULL,				/* class_part_initialize */
947a84e134Smrg    False,				/* class_inited */
957a84e134Smrg    TemplateInitialize,			/* initialize */
967a84e134Smrg    NULL,				/* initialize_hook */
977a84e134Smrg    XtInheritRealize,			/* realize */
987a84e134Smrg    actions,				/* actions */
997a84e134Smrg    XtNumber(actions),			/* num_actions */
1007a84e134Smrg    resources,				/* resources */
1017a84e134Smrg    XtNumber(resources),		/* num_resources */
1027a84e134Smrg    NULLQUARK,				/* xrm_class */
1037a84e134Smrg    True,				/* compress_motion */
1047a84e134Smrg    True,				/* compress_exposure */
1057a84e134Smrg    True,				/* compress_enterleave */
1067a84e134Smrg    False,				/* visible_interest */
1077a84e134Smrg    NULL,				/* destroy */
1087a84e134Smrg    NULL,				/* resize */
1097a84e134Smrg    NULL,				/* expose */
1107a84e134Smrg    NULL,				/* set_values */
1117a84e134Smrg    NULL,				/* set_values_hook */
1127a84e134Smrg    XtInheritSetValuesAlmost,		/* set_values_almost */
1137a84e134Smrg    NULL,				/* get_values_hook */
1147a84e134Smrg    NULL,				/* accept_focus */
1157a84e134Smrg    XtVersion,				/* version */
1167a84e134Smrg    NULL,				/* callback_private */
1177a84e134Smrg    translations,			/* tm_table */
1187a84e134Smrg    XtInheritQueryGeometry,		/* query_geometry */
1197a84e134Smrg    XtInheritDisplayAccelerator,	/* display_accelerator */
1207a84e134Smrg    NULL,				/* extension */
1217a84e134Smrg  },
1227a84e134Smrg  /* template */
1237a84e134Smrg  {
1247a84e134Smrg    NULL,				/* extension */
1257a84e134Smrg  }
1267a84e134Smrg};
1277a84e134Smrg
1287a84e134SmrgWidgetClass templateWidgetClass = (WidgetClass)&templateClassRec;
1297a84e134Smrg
1307a84e134Smrg/*
1317a84e134Smrg * Implementation
1327a84e134Smrg */
1337a84e134Smrg/*
1347a84e134Smrg * Function:
1357a84e134Smrg *	TemplateInitialize
1367a84e134Smrg *
1377a84e134Smrg * Parameters:
1387a84e134Smrg *	request - requested widget
1397a84e134Smrg *	w	- the widget
1407a84e134Smrg *	args	- arguments
1417a84e134Smrg *	num_args - number of arguments
1427a84e134Smrg *
1437a84e134Smrg * Description:
1447a84e134Smrg *	Initializes widget instance.
1457a84e134Smrg */
1467a84e134Smrg/*ARGSUSED*/
1477a84e134Smrgstatic void
1487a84e134SmrgTemplateInitialize(Widget request, Widget w, ArgList args, Cardinal *num_args)
1497a84e134Smrg{
1507a84e134Smrg    TemplateWidget tw = (TemplateWidget)w;
1517a84e134Smrg
1527a84e134Smrg    tw->template.private = NULL;
1537a84e134Smrg}
1547a84e134Smrg
1557a84e134Smrg/*
1567a84e134Smrg * Function:
1577a84e134Smrg *	TemplateFunction
1587a84e134Smrg *
1597a84e134Smrg * Parameters:
1607a84e134Smrg *	tw    - template widget
1617a84e134Smrg *	x     - x coordinate
1627a84e134Smrg *	y     - y coordinate
1637a84e134Smrg *	force - force action
1647a84e134Smrg *
1657a84e134Smrg * Description:
1667a84e134Smrg *	This function does nothing.
1677a84e134Smrg *
1687a84e134Smrg * Return:
1697a84e134Smrg *	Parameter force
1707a84e134Smrg */
1717a84e134Smrg/*ARGSUSED*/
1727a84e134Smrgstatic Bool
1737a84e134SmrgTemplateFunction(TemplateWidget tw, int x, int y, Bool force)
1747a84e134Smrg{
1757a84e134Smrg    return (force);
1767a84e134Smrg}
1777a84e134Smrg
1787a84e134Smrg/*
1797a84e134Smrg * Function:
1807a84e134Smrg *	TemplateAction
1817a84e134Smrg *
1827a84e134Smrg * Parameters:
1837a84e134Smrg *	w	   - template widget
1847a84e134Smrg *	event	   - event that caused this action
1857a84e134Smrg *	params	   - parameters
1867a84e134Smrg *	num_params - number of parameters
1877a84e134Smrg *
1887a84e134Smrg * Description:
1897a84e134Smrg *	This function does nothing.
1907a84e134Smrg */
1917a84e134Smrg/*ARGSUSED*/
1927a84e134Smrgstatic void
1937a84e134SmrgTemplateAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
1947a84e134Smrg{
1957a84e134Smrg}
196