comparison src/EmacsShell-sub.c @ 185:3d6bfa290dbd r20-3b19

Import from CVS: tag r20-3b19
author cvs
date Mon, 13 Aug 2007 09:55:28 +0200
parents 5a88923fcbfe
children c5d627a313b1
comparison
equal deleted inserted replaced
184:bcd2674570bf 185:3d6bfa290dbd
31 /* 31 /*
32 This widget is not actually Emacs-specific; perhaps there could 32 This widget is not actually Emacs-specific; perhaps there could
33 be a better name than "EmacsShell". What it does is work around 33 be a better name than "EmacsShell". What it does is work around
34 a limitation in Xt in correctly dealing with the window-manager 34 a limitation in Xt in correctly dealing with the window-manager
35 size hints with applications that 35 size hints with applications that
36 36
37 (a) dynamically change their window size 37 (a) dynamically change their window size
38 (b) have a cell size (width-inc and height-inc) other than 1 38 (b) have a cell size (width-inc and height-inc) other than 1
39 39
40 and 40 and
41 41
53 "baseWidth", "baseHeight", "minWidth", or "minHeight". 53 "baseWidth", "baseHeight", "minWidth", or "minHeight".
54 Instead, use "widthCells" and "heightCells" to specify the 54 Instead, use "widthCells" and "heightCells" to specify the
55 current size in cells (you must keep this up-to-date), 55 current size in cells (you must keep this up-to-date),
56 and "minWidthCells" and "minHeightCells" to specify the 56 and "minWidthCells" and "minHeightCells" to specify the
57 minimum size in cells. 57 minimum size in cells.
58 58
59 Every time that the program issues a size command, the 59 Every time that the program issues a size command, the
60 "baseWidth", "baseHeight", "minWidth", and "minHeight" fields 60 "baseWidth", "baseHeight", "minWidth", and "minHeight" fields
61 of the WM_NORMAL_HINTS property will be updated to stay in 61 of the WM_NORMAL_HINTS property will be updated to stay in
62 line with the resource values specified above. The calculations 62 line with the resource values specified above. The calculations
63 are done once the desired shell size is known but before the 63 are done once the desired shell size is known but before the
114 Error. Must define either DEFINE_TOP_LEVEL_EMACS_SHELL or 114 Error. Must define either DEFINE_TOP_LEVEL_EMACS_SHELL or
115 DEFINE_TRANSIENT_EMACS_SHELL. 115 DEFINE_TRANSIENT_EMACS_SHELL.
116 #endif 116 #endif
117 117
118 typedef struct { 118 typedef struct {
119 XtPointer next_extension; 119 XtPointer next_extension;
120 XrmQuark record_type; 120 XrmQuark record_type;
121 long version; 121 long version;
122 Cardinal record_size; 122 Cardinal record_size;
123 } GenericClassExtRec; 123 } GenericClassExtRec;
124 124
125 static XtGeometryResult RootGeometryManager (Widget gw, 125 static XtGeometryResult RootGeometryManager (Widget gw,
126 XtWidgetGeometry *request, XtWidgetGeometry *reply); 126 XtWidgetGeometry *request, XtWidgetGeometry *reply);
127 static void ChangeManaged (Widget w); 127 static void ChangeManaged (Widget w);
128 128
129 /* snarfed from Shell.c */ 129 /* snarfed from Shell.c */
130 #define BIGSIZE ((Dimension)32767) 130 #define BIGSIZE ((Dimension)32767)
131 131
132 static XtResource resources[] = { 132 static XtResource resources[] = {
133 #define offset(field) XtOffset(EMACS_SHELL_WIDGET, emacs_shell.field) 133 #define offset(field) XtOffset(EMACS_SHELL_WIDGET, emacs_shell.field)
134 #define coreoffset(field) XtOffset(EMACS_SHELL_WIDGET, core.field) 134 #define coreoffset(field) XtOffset(EMACS_SHELL_WIDGET, core.field)
135 #ifdef LWLIB_USES_MOTIF 135 #ifdef LWLIB_USES_MOTIF
136 /* *** BOGOSITY^10! *** The Motif VendorShell fucks around with 136 /* *** BOGOSITY^10! *** The Motif VendorShell fucks around with
192 /* visible_interest */ TRUE, 192 /* visible_interest */ TRUE,
193 /* destroy */ NULL, 193 /* destroy */ NULL,
194 /* resize */ XtInheritResize, 194 /* resize */ XtInheritResize,
195 /* expose */ NULL, 195 /* expose */ NULL,
196 /* set_values */ NULL, /* XtInheritSetValues, */ 196 /* set_values */ NULL, /* XtInheritSetValues, */
197 /* set_values_hook */ NULL, 197 /* set_values_hook */ NULL,
198 /* set_values_almost */ XtInheritSetValuesAlmost, 198 /* set_values_almost */ XtInheritSetValuesAlmost,
199 /* get_values_hook */ NULL, 199 /* get_values_hook */ NULL,
200 /* accept_focus */ NULL, 200 /* accept_focus */ NULL,
201 /* intrinsics version */ XtVersion, 201 /* intrinsics version */ XtVersion,
202 /* callback offsets */ NULL, 202 /* callback offsets */ NULL,
203 /* tm_table */ NULL, 203 /* tm_table */ NULL,
204 /* query_geometry */ NULL, 204 /* query_geometry */ NULL,
351 offsets. */ 351 offsets. */
352 if (!XtIsRealized (wid)) 352 if (!XtIsRealized (wid))
353 { 353 {
354 Widget child = NULL; 354 Widget child = NULL;
355 int i; 355 int i;
356 356
357 /* the managed child indicates what our size is */ 357 /* the managed child indicates what our size is */
358 for (i = 0; i < w->composite.num_children; i++) { 358 for (i = 0; i < w->composite.num_children; i++) {
359 if (XtIsManaged(w->composite.children[i])) { 359 if (XtIsManaged(w->composite.children[i])) {
360 child = w->composite.children[i]; 360 child = w->composite.children[i];
361 break; 361 break;
362 } 362 }
363 } 363 }
364 364
365 update_size_hints_internal (w, child->core.width, child->core.height); 365 update_size_hints_internal (w, child->core.width, child->core.height);
366 } 366 }
367 367
368 /* call the real ChangeManaged */ 368 /* call the real ChangeManaged */
369 (((ShellWidgetClass) SUPERCLASS_WIDGET_CLASS)-> 369 (((ShellWidgetClass) SUPERCLASS_WIDGET_CLASS)->
370 composite_class.change_managed)(wid); 370 composite_class.change_managed)(wid);
371 } 371 }
372 372
373 373
374 /******************* external entry points *********************/ 374 /******************* external entry points *********************/
375 375
376 void 376 void
377 EMACS_SHELL_UPDATE_SIZE_HINTS (Widget gw) 377 EMACS_SHELL_UPDATE_SIZE_HINTS (Widget gw)