1994689c1Smrg<sect1 id="Private_Header_File"> 2994689c1Smrg<title>Private Header File</title> 3994689c1Smrg<para> 4994689c1Smrg<!-- .LP --> 5994689c1SmrgThe private header file contains the complete declaration of the class 6994689c1Smrgand instance structures for the widget and any additional private data 7994689c1Smrgthat will be required by anticipated subclasses of the widget. 8994689c1SmrgInformation in the private header file is normally hidden from the 9994689c1Smrgapplication and is designed to be accessed only through other public 10994689c1Smrgprocedures; e.g. 115ec34c4cSmrg<function>XtSetValues</function>. 12994689c1Smrg</para> 13994689c1Smrg<para> 14994689c1Smrg<!-- .LP --> 15994689c1SmrgThe contents of the Template private header file, 165ec34c4cSmrg<filename class="headerfile"><X11/Xaw/TemplateP.h></filename>, 17994689c1Smrgare: 18994689c1Smrg</para> 19994689c1Smrg<!-- .CB --> 20994689c1Smrg<!-- .\".so ../../lib/Xaw/TemplateP.h --> 21994689c1Smrg<literallayout class="monospaced"> 22994689c1Smrg/* Copyright (c) X Consortium 1987, 1988 23994689c1Smrg */ 24994689c1Smrg 25994689c1Smrg#ifndef _TemplateP_h 26994689c1Smrg#define _TemplateP_h 27994689c1Smrg 28994689c1Smrg#include <X11/Xaw/Template.h> 29994689c1Smrg/* include superclass private header file */ 30994689c1Smrg#include <X11/CoreP.h> 31994689c1Smrg 32994689c1Smrg/* define unique representation types not found in <X11/StringDefs.h> */ 33994689c1Smrg 34994689c1Smrg#define XtRTemplateResource "TemplateResource" 35994689c1Smrg 36994689c1Smrgtypedef struct { 37994689c1Smrg int empty; 38994689c1Smrg} TemplateClassPart; 39994689c1Smrg 40994689c1Smrgtypedef struct _TemplateClassRec { 41994689c1Smrg CoreClassPart core_class; 42994689c1Smrg TemplateClassPart template_class; 43994689c1Smrg} TemplateClassRec; 44994689c1Smrg 45994689c1Smrgextern TemplateClassRec templateClassRec; 46994689c1Smrg 47994689c1Smrgtypedef struct { 48994689c1Smrg /* resources */ 49994689c1Smrg char* resource; 50994689c1Smrg /* private state */ 51994689c1Smrg} TemplatePart; 52994689c1Smrg 53994689c1Smrgtypedef struct _TemplateRec { 54994689c1Smrg CorePart core; 55994689c1Smrg TemplatePart template; 56994689c1Smrg} TemplateRec; 57994689c1Smrg 58994689c1Smrg#endif /* _TemplateP_h */ 59994689c1Smrg<!-- .CE --> 60994689c1Smrg</literallayout> 61994689c1Smrg<para> 62994689c1SmrgThe private header file includes the private header file of its 63994689c1Smrgsuperclass, thereby exposing the entire internal structure of the widget. 64994689c1SmrgIt may not always be advantageous to do this; your own project 65994689c1Smrgdevelopment style will dictate the appropriate level of detail to expose 66994689c1Smrgin each module. 67994689c1Smrg</para> 68994689c1Smrg<para> 69994689c1SmrgThe "WindowWidget" needs to declare two fields in its instance structure to 70994689c1Smrghold the drawing colors, a resource field for the font and a field for the 71994689c1Smrgexpose and user input callback lists: 72994689c1Smrg</para> 73994689c1Smrg 74994689c1Smrg<literallayout class="monospaced"> 75994689c1Smrgtypedef struct { 76994689c1Smrg /* resources */ 77994689c1Smrg Pixel color_1; 78994689c1Smrg Pixel color_2; 79994689c1Smrg XFontStruct* font; 80994689c1Smrg XtCallbackList expose_callback; 81994689c1Smrg XtCallbackList input_callback; 82994689c1Smrg /* private state */ 83994689c1Smrg /* (none) */ 84994689c1Smrg} WindowPart; 85994689c1Smrg</literallayout> 86994689c1Smrg 87994689c1Smrg</sect1> 88