1 /* $XConsortium: SimpleP.h /main/5 1995/07/15 20:41:32 drk $ */
2 /*
3  * Motif
4  *
5  * Copyright (c) 1987-2012, The Open Group. All rights reserved.
6  *
7  * These libraries and programs are free software; you can
8  * redistribute them and/or modify them under the terms of the GNU
9  * Lesser General Public License as published by the Free Software
10  * Foundation; either version 2 of the License, or (at your option)
11  * any later version.
12  *
13  * These libraries and programs are distributed in the hope that
14  * they will be useful, but WITHOUT ANY WARRANTY; without even the
15  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16  * PURPOSE. See the GNU Lesser General Public License for more
17  * details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with these librararies and programs; if not, write
21  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
22  * Floor, Boston, MA 02110-1301 USA
23  */
24 /*
25  * HISTORY
26  */
27 
28 /*******************************************************************************
29  *
30  * SimpleP.h: The widget private header file for the ExmSimple demonstration
31  *            widget.
32  *
33  ******************************************************************************/
34 
35 
36 /* Ensure that the file be included only once. */
37 #ifndef _ExmSimpleP_h
38 #define _ExmSimpleP_h
39 
40 /* Include appropriate files. */
41 #include <Exm/Simple.h> /* public header file for the ExmSimple widget */
42 #include <Xm/PrimitiveP.h> /* private header file for the XmPrimitive widget */
43 
44 /* Allow for C++ compilation. */
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 /* Make the following seven methods inheritable by subclasses of ExmSimple. */
50 #define ExmInheritDrawVisual	 ((XtWidgetProc) _XtInherit)
51 #define ExmInheritDrawShadow	 ((XtWidgetProc) _XtInherit)
52 #define ExmInheritCreateGC	 ((XtWidgetProc) _XtInherit)
53 #define ExmInheritDestroyGC	 ((XtWidgetProc) _XtInherit)
54 #define ExmInheritSelectGC	 ((ExmSelectGCProc) _XtInherit)
55 #define ExmInheritCalcVisualSize ((XtWidgetProc) _XtInherit)
56 #define ExmInheritCalcWidgetSize ((XtWidgetProc) _XtInherit)
57 #define ExmInheritReconfigure    ((ExmReconfigureProc) _XtInherit)
58 
59 /* Provide typedefs for inheritable methods that do not already
60    have an appropriate data type. */
61 typedef GC   (*ExmSelectGCProc)(
62                         Widget);
63 typedef void (*ExmReconfigureProc)(
64 			WidgetClass,
65 			Widget,
66 			Widget) ;
67 
68 /* Define the widget class part. */
69 typedef struct _ExmSimpleClassPart
70 {
71 	XtWidgetProc		draw_visual;
72 	XtWidgetProc		draw_shadow;
73 	XtWidgetProc		create_gc;
74 	XtWidgetProc		destroy_gc;
75 	ExmSelectGCProc		select_gc;
76 	XtWidgetProc		calc_visual_size;
77 	XtWidgetProc		calc_widget_size;
78         ExmReconfigureProc      reconfigure;
79 	XtPointer		extension;
80 } ExmSimpleClassPart;
81 
82 /* Define the full class record. */
83 typedef struct _ExmSimpleClassRec
84 {
85 	CoreClassPart		core_class;
86 	XmPrimitiveClassPart	primitive_class;
87 	ExmSimpleClassPart	simple_class;
88 } ExmSimpleClassRec;
89 
90 /* Define the subclassing level index to be used with ResolvePartOffset */
91 #define ExmSimpleIndex (XmPrimitiveIndex + 1)
92 
93 /* Make the full class record externally accessible. */
94 externalref ExmSimpleClassRec exmSimpleClassRec;
95 
96 /* Define the widget instance part. */
97 typedef struct _ExmSimplePart
98 {
99  /* Provide space for the three resources of ExmSimple. */
100 	unsigned char		simple_shape;
101 	Dimension		margin_height;
102         Dimension		margin_width;
103 
104  /* Provide space for the other protected fields of ExmSimple. */
105  /* normal_gc holds a Graphics Context for rendering the visual
106     when the value of XmNsensitive is True. */
107 	GC			normal_gc;
108 
109  /* insensitive_gc holds a Graphics Context for rendering the visual
110     when the value of XmNsensitive is False. */
111 	GC			insensitive_gc;
112 
113  /* pref_width holds an integral value representing the widget's
114     current preferred width. */
115 	Dimension		pref_width;
116 
117  /* pref_width holds an integral value representing the widget's
118     current preferred height. */
119 	Dimension		pref_height;
120 
121  /* need_to_compute_width is a flag.  If its value is True, then the widget
122     needs to renegotiate its width. */
123 	Boolean			need_to_compute_width;
124 
125  /* need_to_compute_height is a flag.  If its value is True, then the widget
126     needs to renegotiate its height. */
127 	Boolean			need_to_compute_height;
128 
129  /* visual is an XRectangle value representing the bounding box of the
130     widget's visual. */
131 	XRectangle              visual;
132 
133  /* need_to_reconfigure is a flag.  If its value is True, then the widget
134     needs to call the reconfigure method. */
135 	Boolean			need_to_reconfigure;
136 
137  /* saved_foreground is used for the management of the selected state */
138 	Pixel			saved_foreground;
139 } ExmSimplePart;
140 
141 
142 /* Define the full instance record. */
143 typedef struct _ExmSimpleRec
144 {
145 	CorePart		core;
146 	XmPrimitivePart		primitive;
147 	ExmSimplePart		simple;
148 } ExmSimpleRec;
149 
150 /* Allow for C++ compilation. */
151 #ifdef __cplusplus
152 } /* Close scope of 'extern "C"' declaration which encloses file. */
153 #endif
154 
155 /* Ensure that the file be included only once. */
156 #endif /* _ExmSimpleP_h */
157 /* Don't add anything after this #endif */
158