1 /* $XConsortium: GridP.h /main/5 1995/07/15 20:40:53 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  * GridP.h: The widget private header file for the ExmGrid widget.
31  *
32  ******************************************************************************/
33 
34 /* Ensure that the file be included only once. */
35 #ifndef _ExmGridP_h
36 #define _ExmGridP_h
37 
38 
39 /* Include appropriate files. */
40 #include <Exm/Grid.h>  /* public header file for ExmGrid */
41 #include <Xm/ManagerP.h> /* private header file for XmManager */
42 
43 
44 /* Allow for C++ compilation. */
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 
50 /* Make the following two methods inheritable by subclasses of ExmGrid. */
51 #define ExmInheritLayout   ((ExmLayoutProc) _XtInherit)
52 #define ExmInheritCalcSize ((ExmCalcSizeProc) _XtInherit)
53 #define ExmInheritNeedRelayout ((ExmNeedRelayoutProc) _XtInherit)
54 
55 
56 /* Define new data types for these two inheritable methods. */
57 typedef void (*ExmLayoutProc)(
58 			Widget,
59 			Widget);
60 typedef void (*ExmCalcSizeProc)(
61                         Widget,
62                         Widget,
63                         Dimension *,
64                         Dimension *);
65 typedef Boolean (*ExmNeedRelayoutProc)(
66                         Widget,
67                         Widget);
68 
69 /* Define the widget class part. */
70 typedef struct
71 {
72 	ExmLayoutProc           layout;
73         ExmCalcSizeProc         calc_size;
74         ExmNeedRelayoutProc     need_relayout;
75 	XtPointer		extension;
76 } ExmGridClassPart;
77 
78 
79 /* Define the full class record. */
80 typedef struct _ExmGridClassRec
81 {
82 	CoreClassPart		core_class;
83 	CompositeClassPart	composite_class;
84 	ConstraintClassPart	constraint_class;
85 	XmManagerClassPart	manager_class;
86 	ExmGridClassPart	grid_class;
87 } ExmGridClassRec;
88 
89 externalref ExmGridClassRec exmGridClassRec;
90 
91 
92 /* Define the widget instance part. */
93 typedef struct
94 {
95  /* Provide space for the values of the four resources of ExmGrid. */
96 	short			rows;
97 	short			columns;
98 	Dimension		margin_width;
99 	Dimension		margin_height;
100 	XtCallbackList	        map_callback;
101 	XtCallbackList	        unmap_callback;
102 	Boolean		        default_position;
103 	XmRenderTable           button_render_table ;
104 	XmRenderTable           label_render_table ;
105 	XmRenderTable           text_render_table ;
106         XmString	        dialog_title;
107 
108  /* processing_constraints is a flag.  If its value is True, then
109     it means that the ConstraintSetValues method is requesting a
110     geometry change. */
111 	Boolean			processing_constraints;
112 
113 } ExmGridPart;
114 
115 /* Establish an arbitrary limit */
116 #define EXM_GRID_MAX_NUMBER_OF_ROWS 100
117 #define EXM_GRID_MAX_NUMBER_OF_COLUMNS 100
118 
119 /* Define the full instance record. */
120 typedef struct _ExmGridRec
121 {
122 	CorePart		core;
123 	CompositePart		composite;
124 	ConstraintPart		constraint;
125 	XmManagerPart		manager;
126 	ExmGridPart		grid;
127 } ExmGridRec;
128 
129 /* Define the subclassing level index to be used with ResolvePartOffset */
130 #define ExmGridIndex (XmManagerIndex + 1)
131 
132 /* Define the constraint part structure. */
133 typedef struct _ExmGridConstraintPart
134 {
135 	Dimension		grid_margin_width_within_cell;
136 	Dimension		grid_margin_height_within_cell;
137 } ExmGridConstraintPart, * ExmGridConstraint;
138 
139 
140 /* Define the full constraint structure. */
141 typedef struct _ExmGridConstraintRec
142 {
143 	XmManagerConstraintPart	manager;
144 	ExmGridConstraintPart	grid;
145 } ExmGridConstraintRec, * ExmGridConstraintPtr;
146 
147 
148 /* Define macros for this class. */
149 #define ExmGridCPart(w) \
150         (&((ExmGridConstraintPtr) (w)->core.constraints)->grid)
151 
152 
153 /* Allow for C++ compilation. */
154 #ifdef __cplusplus
155 } /* Close scope of 'extern "C"' declaration which encloses file. */
156 #endif
157 
158 
159 /* Ensure that the file be included only once. */
160 #endif /* _ExmGridP_h */
161