Specifications
Athena Widget Set libXaw 1.0.7
here. Section 1.4 of the Intrinsics should be read in conjunction with this section.
All Athena widgets have three separate files associated with them:
•A‘‘public’’header file containing declarations needed by applications programmers
•A‘‘private’’header file containing additional declarations needed by the widget and anysub-
classes
•Asource code file containing the implementation of the widget
This separation of functions into three files is suggested for all widgets, but nothing in the Toolkit
actually requires this format. In particular,aprivate widget created for a single application may
easily combine the ‘‘public’’and ‘‘private’’header files into a single file, or merge the contents
into another application header file. Similarly,the widget implementation can be merged into
other application code.
In the following example, the public header file <X11/Xaw/Template.h>, the private header file
<X11/Xaw/TemplateP.h>and the source code file <X11/Xaw/Template.c>will be modified to
produce the ‘‘WindowWidget’’described above.Ineach case, the files have been designed so
that a global string replacement of ‘‘Template’’and ‘‘template’’with the name of your newwid-
get, using the appropriate case, can be done.
7.1. Public Header File
The public header file contains declarations that will be required by anyapplication module that
needs to refer to the widget; whether to create an instance of the class, to perform an XtSetVal-
ues operation, or to call a public routine implemented by the widget class.
The contents of the Template public header file, <X11/Xaw/Template.h>, are:
/* XConsortium: Template.h,v 1.2 88/10/25 17:22:09 swick Exp $ */
/* Copyright (c) X Consortium 1987, 1988 */
#ifndef _Template_h
#define _Template_h
/****************************************************************
*
*Template widget
*
****************************************************************/
/* Resources:
Name Class RepType Default Value
---- ----- ------- -------------
background Background Pixel XtDefaultBackground
border BorderColor Pixel XtDefaultForeground
borderWidth BorderWidth Dimension 1
destroyCallback Callback Pointer NULL
height Height Dimension 0
mappedWhenManaged MappedWhenManaged Boolean True
sensitive Sensitive Boolean True
width Width Dimension 0
xPosition Position 0
yPosition Position 0
*/
/* define anyspecial resource names here that are not in <X11/StringDefs.h> */
#define XtNtemplateResource "templateResource"
133