00001 /* $XConsortium: Template.c,v 1.5 94/04/17 20:12:58 converse Exp $ */ 00002 00003 /* 00004 00005 Copyright (c) 1987 X Consortium 00006 00007 Permission is hereby granted, free of charge, to any person obtaining a copy 00008 of this software and associated documentation files (the "Software"), to deal 00009 in the Software without restriction, including without limitation the rights 00010 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00011 copies of the Software, and to permit persons to whom the Software is 00012 furnished to do so, subject to the following conditions: 00013 00014 The above copyright notice and this permission notice shall be included in 00015 all copies or substantial portions of the Software. 00016 00017 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00018 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00019 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00020 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 00021 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00022 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00023 00024 Except as contained in this notice, the name of the X Consortium shall not be 00025 used in advertising or otherwise to promote the sale, use or other dealings 00026 in this Software without prior written authorization from the X Consortium. 00027 00028 */ 00029 00030 #include <X11/IntrinsicP.h> 00031 #include <X11/StringDefs.h> 00032 #include "TemplateP.h" 00033 00034 static XtResource resources[] = { 00035 #define offset(field) XtOffsetOf(TemplateRec, template.field) 00036 /* {name, class, type, size, offset, default_type, default_addr}, */ 00037 { XtNtemplateResource, XtCTemplateResource, XtRTemplateResource, 00038 sizeof(char*), offset(resource), XtRString, (XtPointer) "default" }, 00039 #undef offset 00040 }; 00041 00042 static void TemplateAction(/* Widget, XEvent*, String*, Cardinal* */); 00043 00044 static XtActionsRec actions[] = 00045 { 00046 /* {name, procedure}, */ 00047 {"template", TemplateAction}, 00048 }; 00049 00050 static char translations[] = 00051 "<Key>: template() \n\ 00052 "; 00053 00054 TemplateClassRec templateClassRec = { 00055 { /* core fields */ 00056 /* superclass */ (WidgetClass) &widgetClassRec, 00057 /* class_name */ "Template", 00058 /* widget_size */ sizeof(TemplateRec), 00059 /* class_initialize */ NULL, 00060 /* class_part_initialize */ NULL, 00061 /* class_inited */ FALSE, 00062 /* initialize */ NULL, 00063 /* initialize_hook */ NULL, 00064 /* realize */ XtInheritRealize, 00065 /* actions */ actions, 00066 /* num_actions */ XtNumber(actions), 00067 /* resources */ resources, 00068 /* num_resources */ XtNumber(resources), 00069 /* xrm_class */ NULLQUARK, 00070 /* compress_motion */ TRUE, 00071 /* compress_exposure */ TRUE, 00072 /* compress_enterleave */ TRUE, 00073 /* visible_interest */ FALSE, 00074 /* destroy */ NULL, 00075 /* resize */ NULL, 00076 /* expose */ NULL, 00077 /* set_values */ NULL, 00078 /* set_values_hook */ NULL, 00079 /* set_values_almost */ XtInheritSetValuesAlmost, 00080 /* get_values_hook */ NULL, 00081 /* accept_focus */ NULL, 00082 /* version */ XtVersion, 00083 /* callback_private */ NULL, 00084 /* tm_table */ translations, 00085 /* query_geometry */ XtInheritQueryGeometry, 00086 /* display_accelerator */ XtInheritDisplayAccelerator, 00087 /* extension */ NULL 00088 }, 00089 { /* template fields */ 00090 /* empty */ 0 00091 } 00092 }; 00093 00094 WidgetClass templateWidgetClass = (WidgetClass)&templateClassRec;
1.5.1