Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:25

0001 /*
0002 
0003 Copyright 1987, 1998  The Open Group
0004 
0005 Permission to use, copy, modify, distribute, and sell this software and its
0006 documentation for any purpose is hereby granted without fee, provided that
0007 the above copyright notice appear in all copies and that both that
0008 copyright notice and this permission notice appear in supporting
0009 documentation.
0010 
0011 The above copyright notice and this permission notice shall be included in
0012 all copies or substantial portions of the Software.
0013 
0014 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
0017 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
0018 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0019 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0020 
0021 Except as contained in this notice, the name of The Open Group shall not be
0022 used in advertising or otherwise to promote the sale, use or other dealings
0023 in this Software without prior written authorization from The Open Group.
0024 
0025 */
0026 
0027 #ifdef HAVE_CONFIG_H
0028 #include <config.h>
0029 #endif
0030 #include <X11/IntrinsicP.h>
0031 #include <X11/StringDefs.h>
0032 #include <X11/Xaw/TemplateP.h>
0033 
0034 /*
0035  * Class Methods
0036  */
0037 static void TemplateInitialize(Widget, Widget, ArgList, Cardinal*);
0038 
0039 /*
0040  * Prototypes
0041  */
0042 static Bool TemplateFunction(TemplateWidget, int, int, Bool);
0043 
0044 /*
0045  * Actions
0046  */
0047 static void TemplateAction(Widget, XEvent*, String*, Cardinal*);
0048 
0049 /*
0050  * Initialization
0051  */
0052 #define offset(field) XtOffsetOf(TemplateRec, template.field)
0053 static XtResource resources[] = {
0054 /*{
0055     name,
0056     class,
0057     type,
0058     size,
0059     offset,
0060     default_type,
0061     default_addr
0062   },*/
0063   {
0064     XtNtemplateResource,
0065     XtCTemplateResource,
0066     XtRTemplateResource,
0067     sizeof(char*),
0068     offset(resource),
0069     XtRString,
0070     (XtPointer)"default"
0071   },
0072 };
0073 #undef offset
0074 
0075 static XtActionsRec actions[] =
0076 {
0077     /*{name,        procedure},*/
0078     {"template",    TemplateAction},
0079 };
0080 
0081 static char translations[] =
0082 "<Key>:"    "template()\n"
0083 ;
0084 
0085 #define Superclass  (&widgetClassRec)
0086 TemplateClassRec templateClassRec = {
0087   /* core */
0088   {
0089     (WidgetClass)Superclass,        /* superclass */
0090     "Template",             /* class_name */
0091     sizeof(TemplateRec),        /* widget_size */
0092     NULL,               /* class_initialize */
0093     NULL,               /* class_part_initialize */
0094     False,              /* class_inited */
0095     TemplateInitialize,         /* initialize */
0096     NULL,               /* initialize_hook */
0097     XtInheritRealize,           /* realize */
0098     actions,                /* actions */
0099     XtNumber(actions),          /* num_actions */
0100     resources,              /* resources */
0101     XtNumber(resources),        /* num_resources */
0102     NULLQUARK,              /* xrm_class */
0103     True,               /* compress_motion */
0104     True,               /* compress_exposure */
0105     True,               /* compress_enterleave */
0106     False,              /* visible_interest */
0107     NULL,               /* destroy */
0108     NULL,               /* resize */
0109     NULL,               /* expose */
0110     NULL,               /* set_values */
0111     NULL,               /* set_values_hook */
0112     XtInheritSetValuesAlmost,       /* set_values_almost */
0113     NULL,               /* get_values_hook */
0114     NULL,               /* accept_focus */
0115     XtVersion,              /* version */
0116     NULL,               /* callback_private */
0117     translations,           /* tm_table */
0118     XtInheritQueryGeometry,     /* query_geometry */
0119     XtInheritDisplayAccelerator,    /* display_accelerator */
0120     NULL,               /* extension */
0121   },
0122   /* template */
0123   {
0124     NULL,               /* extension */
0125   }
0126 };
0127 
0128 WidgetClass templateWidgetClass = (WidgetClass)&templateClassRec;
0129 
0130 /*
0131  * Implementation
0132  */
0133 /*
0134  * Function:
0135  *  TemplateInitialize
0136  *
0137  * Parameters:
0138  *  request - requested widget
0139  *  w   - the widget
0140  *  args    - arguments
0141  *  num_args - number of arguments
0142  *
0143  * Description:
0144  *  Initializes widget instance.
0145  */
0146 /*ARGSUSED*/
0147 static void
0148 TemplateInitialize(Widget request, Widget w, ArgList args, Cardinal *num_args)
0149 {
0150     TemplateWidget tw = (TemplateWidget)w;
0151 
0152     tw->template.private = NULL;
0153 }
0154 
0155 /*
0156  * Function:
0157  *  TemplateFunction
0158  *
0159  * Parameters:
0160  *  tw    - template widget
0161  *  x     - x coordinate
0162  *  y     - y coordinate
0163  *  force - force action
0164  *
0165  * Description:
0166  *  This function does nothing.
0167  *
0168  * Return:
0169  *  Parameter force
0170  */
0171 /*ARGSUSED*/
0172 static Bool
0173 TemplateFunction(TemplateWidget tw, int x, int y, Bool force)
0174 {
0175     return (force);
0176 }
0177 
0178 /*
0179  * Function:
0180  *  TemplateAction
0181  *
0182  * Parameters:
0183  *  w      - template widget
0184  *  event      - event that caused this action
0185  *  params     - parameters
0186  *  num_params - number of parameters
0187  *
0188  * Description:
0189  *  This function does nothing.
0190  */
0191 /*ARGSUSED*/
0192 static void
0193 TemplateAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
0194 {
0195 }