Specifications
Athena Widget Set libXaw 1.0.7
#include <X11/Xaw/Template.h>
/* include superclass private header file */
#include <X11/CoreP.h>
/* define unique representation types not found in <X11/StringDefs.h> */
#define XtRTemplateResource "TemplateResource"
typedef struct {
int empty;
}TemplateClassPart;
typedef struct _TemplateClassRec {
CoreClassPart core_class;
TemplateClassPart template_class;
}TemplateClassRec;
extern TemplateClassRec templateClassRec;
typedef struct {
/* resources */
char* resource;
/* private state */
}TemplatePart;
typedef struct _TemplateRec {
CorePart core;
TemplatePart template;
}TemplateRec;
#endif /* _TemplateP_h */
The private header file includes the private header file of its superclass, thereby exposing the
entire internal structure of the widget. It may not always be advantageous to do this; your own
project development style will dictate the appropriate levelofdetail to expose in each module.
The ‘‘WindowWidget’’needs to declare twofields in its instance structure to hold the drawing
colors, a resource field for the font and a field for the expose and user input callback lists:
typedef struct {
/* resources */
Pixel color_1;
Pixel color_2;
XFontStruct* font;
XtCallbackList expose_callback;
XtCallbackList input_callback;
/* private state */
/* (none) */
}WindowPart;
7.3. Widget Source File
The source code file implements the widget class itself. The unique part of this file is the declara-
tion and initialization of the widget class record structure and the declaration of all resources and
action routines added by the widget class.
The contents of the Template implementation file, <X11/Xaw/Template.c>, are:
/* XConsortium: Template.c,v 1.2 88/10/25 17:40:25 swick Exp $ */
/* Copyright (c) X Consortium 1987, 1988
*/
135