Mercurial > hg > xemacs-beta
comparison src/EmacsManager.c @ 16:0293115a14e9 r19-15b91
Import from CVS: tag r19-15b91
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:49:20 +0200 |
parents | ac2d302a0011 |
children | e121b013d1f0 |
comparison
equal
deleted
inserted
replaced
15:ad457d5f7d04 | 16:0293115a14e9 |
---|---|
148 EmacsManagerWidget emw = (EmacsManagerWidget) w; | 148 EmacsManagerWidget emw = (EmacsManagerWidget) w; |
149 EmacsManagerQueryGeometryStruct struc; | 149 EmacsManagerQueryGeometryStruct struc; |
150 int mask = request->request_mode & (CWWidth | CWHeight); | 150 int mask = request->request_mode & (CWWidth | CWHeight); |
151 | 151 |
152 struc.request_mode = mask; | 152 struc.request_mode = mask; |
153 struc.proposed_width = request->width; | 153 if (mask & CWWidth) struc.proposed_width = request->width; |
154 struc.proposed_height = request->height; | 154 if (mask & CWHeight) struc.proposed_height = request->height; |
155 XtCallCallbackList (w, emw->emacs_manager.query_geometry_callback, &struc); | 155 XtCallCallbackList (w, emw->emacs_manager.query_geometry_callback, &struc); |
156 reply->request_mode = CWWidth | CWHeight; | 156 reply->request_mode = CWWidth | CWHeight; |
157 reply->width = struc.proposed_width; | 157 reply->width = struc.proposed_width; |
158 reply->height = struc.proposed_height; | 158 reply->height = struc.proposed_height; |
159 if (((mask & CWWidth) && (request->width != reply->width)) | 159 if (((mask & CWWidth) && (request->width != reply->width)) || |
160 || ((mask & CWHeight) && (request->height != reply->height))) | 160 ((mask & CWHeight) && (request->height != reply->height))) |
161 return XtGeometryAlmost; | 161 return XtGeometryAlmost; |
162 return XtGeometryYes; | 162 return XtGeometryYes; |
163 } | 163 } |
164 | 164 |
165 static void | 165 static void |
166 Resize (Widget w) | 166 Resize (Widget w) |
167 { | 167 { |
168 EmacsManagerWidget emw = (EmacsManagerWidget) w; | 168 EmacsManagerWidget emw = (EmacsManagerWidget) w; |
169 EmacsManagerResizeStruct struc; | 169 EmacsManagerResizeStruct struc; |
170 | 170 |
171 struc.width = w->core.width; | 171 struc.width = w->core.width; |
172 struc.height = w->core.height; | 172 struc.height = w->core.height; |
173 XtCallCallbackList (w, emw->emacs_manager.resize_callback, &struc); | 173 XtCallCallbackList (w, emw->emacs_manager.resize_callback, &struc); |
174 } | 174 } |
175 | 175 |
176 static XtGeometryResult | 176 static XtGeometryResult |
230 } | 230 } |
231 | 231 |
232 void | 232 void |
233 EmacsManagerChangeSize (Widget w, Dimension width, Dimension height) | 233 EmacsManagerChangeSize (Widget w, Dimension width, Dimension height) |
234 { | 234 { |
235 Dimension realwidth, realheight; | |
236 XtGeometryResult res; | |
237 | |
238 if (width == 0) | 235 if (width == 0) |
239 width = w->core.width; | 236 width = w->core.width; |
240 if (height == 0) | 237 if (height == 0) |
241 height = w->core.height; | 238 height = w->core.height; |
242 | 239 |
243 /* do nothing if we're already that size */ | 240 /* do nothing if we're already that size */ |
244 if (w->core.width != width || w->core.height != height) | 241 if (w->core.width != width || w->core.height != height) |
245 { | 242 if (XtMakeResizeRequest (w, width, height, &w->core.width, &w->core.height) |
246 res = XtMakeResizeRequest (w, width, height, &realwidth, &realheight); | 243 == XtGeometryAlmost) |
247 if (res == XtGeometryAlmost) | 244 XtMakeResizeRequest (w, w->core.width, w->core.height, NULL, NULL); |
248 XtMakeResizeRequest (w, realwidth, realheight, NULL, NULL); | |
249 w->core.width = realwidth; | |
250 w->core.height = realheight; | |
251 } | |
252 | 245 |
253 Resize (w); | 246 Resize (w); |
254 } | 247 } |
255 | 248 |
256 | 249 |