annotate src/EmacsManager.c @ 315:5e87bc5b1ee4

Added tag r21-0b55 for changeset 341dac730539
author cvs
date Mon, 13 Aug 2007 10:44:26 +0200
parents e121b013d1f0
children 74fd4e045ea6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* Emacs manager widget.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1993-1995 Sun Microsystems, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 Copyright (C) 1995 Ben Wing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 /* Synched up with: Not in FSF. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 /* Written by Ben Wing, May, 1994. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 #include <config.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 #include <X11/StringDefs.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 #include "EmacsManagerP.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 #ifdef LWLIB_MENUBARS_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 #include <Xm/RowColumn.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 #endif /* LWLIB_MENUBARS_MOTIF */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 /* For I, Emacs, am a kind god. Unlike the goddess Athena and the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 Titan Motif, I require no ritual sacrifices to placate the lesser
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 daemons of geometry management. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 static XtResource resources[] = {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 #define offset(field) XtOffset(EmacsManagerWidget, emacs_manager.field)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 { XtNresizeCallback, XtCCallback, XtRCallback, sizeof(XtCallbackList),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 offset(resize_callback), XtRImmediate, (XtPointer) 0 },
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 { XtNqueryGeometryCallback, XtCCallback, XtRCallback, sizeof(XtCallbackList),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 offset(query_geometry_callback), XtRImmediate, (XtPointer) 0 },
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 { XtNuserData, XtCUserData, XtRPointer, sizeof(XtPointer),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 offset(user_data), XtRImmediate, (XtPointer) 0 },
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 /****************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 * Full class record constant
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 ****************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 static XtGeometryResult QueryGeometry (Widget wid,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 XtWidgetGeometry *request,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 XtWidgetGeometry *reply);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 static void Resize (Widget w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 static XtGeometryResult GeometryManager (Widget w, XtWidgetGeometry *request,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 XtWidgetGeometry *reply);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 static void ChangeManaged (Widget w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 static void Realize (Widget w, Mask *valueMask,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 XSetWindowAttributes *attributes);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 static void ClassInitialize (void);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 EmacsManagerClassRec emacsManagerClassRec = {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 /* core_class fields */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 #ifdef LWLIB_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 /* superclass */ (WidgetClass) &xmManagerClassRec,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 /* superclass */ (WidgetClass) &compositeClassRec,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 #endif
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 16
diff changeset
73 /* class_name */ "EmacsManager",
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 /* widget_size */ sizeof(EmacsManagerRec),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 /* class_initialize */ ClassInitialize,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 /* class_part_init */ NULL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 /* class_inited */ FALSE,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 /* initialize */ NULL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 /* initialize_hook */ NULL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 /* realize */ Realize,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 /* actions */ NULL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 /* num_actions */ 0,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 /* resources */ resources,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 /* num_resources */ XtNumber(resources),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 /* xrm_class */ NULLQUARK,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 /* compress_motion */ TRUE,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 /* compress_exposure */ TRUE,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 /* compress_enterleave*/ TRUE,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 /* visible_interest */ FALSE,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 /* destroy */ NULL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 /* resize */ Resize,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 /* expose */ NULL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 /* set_values */ NULL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 /* set_values_hook */ NULL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 /* set_values_almost */ XtInheritSetValuesAlmost,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 /* get_values_hook */ NULL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 /* accept_focus */ NULL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 /* version */ XtVersion,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 /* callback_private */ NULL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 /* tm_table */ XtInheritTranslations,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 /* query_geometry */ QueryGeometry,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 /* display_accelerator*/ XtInheritDisplayAccelerator,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 /* extension */ NULL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 },
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 /* composite_class fields */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 /* geometry_manager */ GeometryManager,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 /* change_managed */ ChangeManaged,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 /* insert_child */ XtInheritInsertChild,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 /* delete_child */ XtInheritDeleteChild,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 /* extension */ NULL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 },
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 #ifdef LWLIB_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 /* constraint_class fields */
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 16
diff changeset
116 NULL, /* resource list */
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 16
diff changeset
117 0, /* num resources */
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 16
diff changeset
118 0, /* constraint size */
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 16
diff changeset
119 (XtInitProc)NULL, /* init proc */
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 16
diff changeset
120 (XtWidgetProc)NULL, /* destroy proc */
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 16
diff changeset
121 (XtSetValuesFunc)NULL, /* set values proc */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 NULL, /* extension */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 },
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 /* manager_class fields */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 XtInheritTranslations, /* translations */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 NULL, /* syn_resources */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 0, /* num_syn_resources */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 NULL, /* syn_cont_resources */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 0, /* num_syn_cont_resources */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 XmInheritParentProcess, /* parent_process */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 NULL, /* extension */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 },
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 /* emacs_manager_class fields */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 /* empty */ 0,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 WidgetClass emacsManagerWidgetClass = (WidgetClass)&emacsManagerClassRec;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 /* What is my preferred size? A suggested size may be given. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 static XtGeometryResult
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 QueryGeometry (Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 EmacsManagerWidget emw = (EmacsManagerWidget) w;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 EmacsManagerQueryGeometryStruct struc;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 int mask = request->request_mode & (CWWidth | CWHeight);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 struc.request_mode = mask;
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
153 if (mask & CWWidth) struc.proposed_width = request->width;
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
154 if (mask & CWHeight) struc.proposed_height = request->height;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 XtCallCallbackList (w, emw->emacs_manager.query_geometry_callback, &struc);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 reply->request_mode = CWWidth | CWHeight;
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
157 reply->width = struc.proposed_width;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 reply->height = struc.proposed_height;
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
159 if (((mask & CWWidth) && (request->width != reply->width)) ||
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
160 ((mask & CWHeight) && (request->height != reply->height)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 return XtGeometryAlmost;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 return XtGeometryYes;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 Resize (Widget w)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 EmacsManagerWidget emw = (EmacsManagerWidget) w;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 EmacsManagerResizeStruct struc;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
171 struc.width = w->core.width;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 struc.height = w->core.height;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 XtCallCallbackList (w, emw->emacs_manager.resize_callback, &struc);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 static XtGeometryResult
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 GeometryManager (Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 /* Sure, any changes are fine. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 #define COPY(field, mask) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 if (request->request_mode & mask) w->core.field = request->field
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 /* The Motif menubar will merrily request a new size every time a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 child is added or deleted. Blow it off because it doesn't know
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 what it's talking about. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 #ifdef LWLIB_MENUBARS_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 if (!(XtClass (w) == xmRowColumnWidgetClass))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 #endif /* LWLIB_MENUBARS_MOTIF */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 COPY (width, CWWidth);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 COPY (height, CWHeight);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 COPY (border_width, CWBorderWidth);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 COPY (x, CWX);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 COPY (y, CWY);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 #undef COPY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 return XtGeometryYes;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 ChangeManaged (Widget w)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 if (!XtIsRealized (w))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 XtWidgetGeometry req, repl;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 /* find out how big we'd like to be ... */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 req.request_mode = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 XtQueryGeometry (w, &req, &repl);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 EmacsManagerChangeSize (w, repl.width, repl.height);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 Realize (Widget w, Mask *valueMask, XSetWindowAttributes *attributes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 attributes->bit_gravity = NorthWestGravity;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 *valueMask |= CWBitGravity;
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 16
diff changeset
221
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 XtCreateWindow (w, (unsigned) InputOutput, (Visual *) CopyFromParent,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 *valueMask, attributes);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 ClassInitialize (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 EmacsManagerChangeSize (Widget w, Dimension width, Dimension height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 if (width == 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 width = w->core.width;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 if (height == 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 height = w->core.height;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 /* do nothing if we're already that size */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 if (w->core.width != width || w->core.height != height)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
242 if (XtMakeResizeRequest (w, width, height, &w->core.width, &w->core.height)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
243 == XtGeometryAlmost)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
244 XtMakeResizeRequest (w, w->core.width, w->core.height, NULL, NULL);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 Resize (w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249