Mercurial > hg > xemacs-beta
annotate src/EmacsFrame.c @ 5724:ede80ef92a74
Make soft links in src for module source files, if built in to the executable.
This ensures that those files are built with the same compiler flags as all
other source files.
See these xemacs-beta messages:
<CAHCOHQn+q=Xuwq+y68dvqi7afAP9f-TdB7=8YiZ8VYO816sjHg@mail.gmail.com>
<f5by5ejqiyk.fsf@calexico.inf.ed.ac.uk>
author | Jerry James <james@xemacs.org> |
---|---|
date | Sat, 02 Mar 2013 14:32:37 -0700 |
parents | 56144c8593a8 |
children |
rev | line source |
---|---|
428 | 1 /* The emacs frame widget. |
2 Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. | |
3 Copyright (C) 1993-1995 Sun Microsystems, Inc. | |
5043 | 4 Copyright (C) 1995, 2010 Ben Wing. |
428 | 5 |
6 This file is part of XEmacs. | |
7 | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5178
diff
changeset
|
8 XEmacs is free software: you can redistribute it and/or modify it |
428 | 9 under the terms of the GNU General Public License as published by the |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5178
diff
changeset
|
10 Free Software Foundation, either version 3 of the License, or (at your |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5178
diff
changeset
|
11 option) any later version. |
428 | 12 |
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5178
diff
changeset
|
19 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */ |
428 | 20 |
21 /* Synched up with: Not in FSF. */ | |
22 | |
23 /* #### Note to potential hackers: Don't mess with this unless you're | |
24 sure you know what you're doing! Xt is a lot more subtle than | |
25 you may think. */ | |
26 | |
27 #include <config.h> | |
28 #include "lisp.h" | |
29 | |
872 | 30 #include "device-impl.h" |
800 | 31 #include "faces.h" |
872 | 32 #include "frame-impl.h" |
800 | 33 #include "toolbar.h" |
34 #include "window.h" | |
35 | |
872 | 36 #include "console-x-impl.h" |
428 | 37 #include "glyphs-x.h" |
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
5052
diff
changeset
|
38 #include "fontcolor-x.h" |
800 | 39 |
428 | 40 #include <X11/Shell.h> |
4769
5460287a3327
Remove support for pre-X11R5 systems, including systems without Xmu. See
Jerry James <james@xemacs.org>
parents:
4528
diff
changeset
|
41 #include <X11/Xmu/CharSet.h> |
428 | 42 #include "EmacsFrameP.h" |
43 #include "EmacsManager.h" /* for EmacsManagerChangeSize */ | |
4528
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
44 #include "../lwlib/xt-wrappers.h" |
428 | 45 |
46 static void EmacsFrameClassInitialize (void); | |
47 static void EmacsFrameInitialize (Widget, Widget, ArgList, Cardinal *); | |
48 static void EmacsFrameRealize (Widget, XtValueMask*, XSetWindowAttributes*); | |
49 static void EmacsFrameResize (Widget widget); | |
50 static Boolean EmacsFrameSetValues (Widget, Widget, Widget, | |
51 ArgList, Cardinal *); | |
52 static XtGeometryResult EmacsFrameQueryGeometry (Widget, XtWidgetGeometry*, | |
53 XtWidgetGeometry*); | |
54 | |
55 extern void | |
56 emacs_Xt_mapping_action (Widget w, XEvent* event); | |
57 | |
58 #undef XtOffset | |
59 #define XtOffset(p_type,field) \ | |
60 ((Cardinal) (((char *) (&(((p_type)0)->field))) - ((char *)0))) | |
440 | 61 #define offset(field) XtOffset (EmacsFrame, emacs_frame.field) |
4528
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
62 #define res(name,_class,intrepr,type,member,extrepr,value) \ |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
63 Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value) |
428 | 64 static XtResource resources[] = { |
4528
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
65 res (XtNgeometry, XtCGeometry, XtRString, String, geometry, XtRString, 0), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
66 res (XtNiconic, XtCIconic, XtRBoolean, Boolean, iconic, XtRImmediate, False), |
428 | 67 |
4528
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
68 res (XtNemacsFrame, XtCEmacsFrame, XtRPointer, XtPointer, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
69 frame, XtRImmediate, 0), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
70 res (XtNmenubar, XtCMenubar, XtRBoolean, Boolean, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
71 menubar_p, XtRImmediate, True), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
72 res (XtNinitiallyUnmapped, XtCInitiallyUnmapped, XtRBoolean, Boolean, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
73 initially_unmapped, XtRImmediate, False), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
74 res (XtNminibuffer, XtCMinibuffer, XtRBoolean, Boolean, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
75 minibuffer, XtRImmediate, True), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
76 res (XtNunsplittable, XtCUnsplittable, XtRBoolean, Boolean, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
77 unsplittable, XtRImmediate, False), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
78 res (XtNinternalBorderWidth, XtCInternalBorderWidth, XtRInt, int, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
79 internal_border_width, XtRImmediate, 4), |
428 | 80 #ifdef HAVE_SCROLLBARS |
4528
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
81 res (XtNscrollBarWidth, XtCScrollBarWidth, XtRInt, int, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
82 scrollbar_width, XtRImmediate, -1), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
83 res (XtNscrollBarHeight, XtCScrollBarHeight, XtRInt, int, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
84 scrollbar_height, XtRImmediate, -1), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
85 res (XtNscrollBarPlacement, XtCScrollBarPlacement, XtRScrollBarPlacement, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
86 unsigned char, scrollbar_placement, XtRImmediate, |
428 | 87 #if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \ |
88 defined (LWLIB_SCROLLBARS_ATHENA3D) | |
4528
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
89 XtBOTTOM_RIGHT |
428 | 90 #else |
4528
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
91 XtBOTTOM_LEFT |
428 | 92 #endif |
4528
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
93 ), |
428 | 94 #endif /* HAVE_SCROLLBARS */ |
440 | 95 |
428 | 96 #ifdef HAVE_TOOLBARS |
4528
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
97 res (XtNtopToolBarHeight, XtCTopToolBarHeight, XtRInt, int, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
98 top_toolbar_height, XtRImmediate, -1), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
99 res (XtNbottomToolBarHeight, XtCBottomToolBarHeight, XtRInt, int, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
100 bottom_toolbar_height, XtRImmediate, -1), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
101 res (XtNleftToolBarWidth, XtCLeftToolBarWidth, XtRInt, int, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
102 left_toolbar_width, XtRImmediate, -1), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
103 res (XtNrightToolBarWidth, XtCRightToolBarWidth, XtRInt, int, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
104 right_toolbar_width, XtRImmediate, -1), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
105 res (XtNtopToolBarBorderWidth, XtCTopToolBarBorderWidth, XtRInt, int, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
106 top_toolbar_border_width, XtRImmediate, -1), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
107 res (XtNbottomToolBarBorderWidth, XtCBottomToolBarBorderWidth, XtRInt, int, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
108 bottom_toolbar_border_width, XtRImmediate, -1), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
109 res (XtNleftToolBarBorderWidth, XtCLeftToolBarBorderWidth, XtRInt, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
110 int, left_toolbar_border_width, XtRImmediate, -1), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
111 res (XtNrightToolBarBorderWidth, XtCRightToolBarBorderWidth, XtRInt, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
112 int, right_toolbar_border_width, XtRImmediate, -1), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
113 res (XtNtoolBarShadowThickness, XtCToolBarShadowThickness, XtRDimension, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
114 Dimension, toolbar_shadow_thickness, XtRImmediate, 2), |
428 | 115 #endif /* HAVE_TOOLBARS */ |
440 | 116 |
4528
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
117 res (XtNinterline, XtCInterline, XtRInt, int, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
118 interline, XtRImmediate, 0), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
119 res (XtNfont, XtCFont, XtRFontStruct, XFontStruct *, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
120 font, XtRImmediate, 0), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
121 res (XtNforeground, XtCForeground, XtRPixel, Pixel, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
122 foreground_pixel, XtRString, "Black"), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
123 res (XtNbackground, XtCBackground, XtRPixel, Pixel, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
124 background_pixel, XtRString, "Gray80"), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
125 res (XtNcursorColor, XtCForeground, XtRPixel, Pixel, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
126 cursor_color, XtRString, "XtDefaultForeground"), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
127 res (XtNbarCursor, XtCBarCursor, XtRBoolean, Boolean, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
128 bar_cursor, XtRImmediate, 0), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
129 res (XtNvisualBell, XtCVisualBell, XtRBoolean, Boolean, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
130 visual_bell, XtRImmediate, 0), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
131 res (XtNbellVolume, XtCBellVolume, XtRInt, int, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
132 bell_volume, XtRImmediate, 0), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
133 res (XtNuseBackingStore, XtCUseBackingStore, XtRBoolean, Boolean, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
134 use_backing_store, XtRImmediate, 0), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
135 res (XtNpreferredWidth, XtCPreferredWidth, XtRDimension, Dimension, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
136 preferred_width, XtRImmediate, 0), |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
137 res (XtNpreferredHeight, XtCPreferredHeight, XtRDimension, Dimension, |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
138 preferred_height, XtRImmediate, 0), |
428 | 139 }; |
140 | |
141 #undef offset | |
142 | |
143 /* Xt is stupid and dumb. | |
144 Xt is stupid and dumb. | |
145 Xt is stupid and dumb. */ | |
146 | |
147 static XtActionsRec | |
148 emacsFrameActionsTable [] = { | |
4528
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
149 { (String) "mapping", (XtActionProc) emacs_Xt_mapping_action}, |
428 | 150 }; |
151 | |
152 static char | |
153 emacsFrameTranslations [] = "\ | |
154 <Mapping>: mapping()\n\ | |
155 "; | |
156 | |
157 /* If we're running under Motif, make this widget a subclass | |
158 of XmPrimitive. It's not clear this is necessary, but it | |
159 may make focus behavior work better. */ | |
160 | |
161 EmacsFrameClassRec emacsFrameClassRec = { | |
162 { /* core fields */ | |
163 #ifdef LWLIB_USES_MOTIF | |
164 /* superclass */ (WidgetClass) &xmPrimitiveClassRec, | |
165 #else | |
166 /* superclass */ &widgetClassRec, | |
167 #endif | |
4528
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
168 /* class_name */ (String) "EmacsFrame", |
440 | 169 /* widget_size */ sizeof (EmacsFrameRec), |
428 | 170 /* class_initialize */ EmacsFrameClassInitialize, |
171 /* class_part_initialize */ 0, | |
172 /* class_inited */ FALSE, | |
173 /* initialize */ EmacsFrameInitialize, | |
174 /* initialize_hook */ 0, | |
175 /* realize */ EmacsFrameRealize, | |
176 /* actions */ emacsFrameActionsTable, | |
177 /* num_actions */ XtNumber (emacsFrameActionsTable), | |
178 /* resources */ resources, | |
440 | 179 /* resource_count */ XtNumber (resources), |
428 | 180 /* xrm_class */ NULLQUARK, |
181 /* compress_motion */ TRUE, | |
182 /* compress_exposure */ TRUE, | |
183 /* compress_enterleave */ TRUE, | |
184 /* visible_interest */ FALSE, | |
185 /* destroy */ NULL, | |
186 /* resize */ EmacsFrameResize, | |
187 /* expose */ XtInheritExpose, | |
188 /* set_values */ EmacsFrameSetValues, | |
189 /* set_values_hook */ 0, | |
190 /* set_values_almost */ XtInheritSetValuesAlmost, | |
191 /* get_values_hook */ 0, | |
192 /* accept_focus */ XtInheritAcceptFocus, | |
193 /* version */ XtVersion, | |
194 /* callback_private */ 0, | |
195 /* tm_table */ emacsFrameTranslations, | |
196 /* query_geometry */ EmacsFrameQueryGeometry, | |
197 /* display_accelerator */ XtInheritDisplayAccelerator, | |
198 /* extension */ 0 | |
199 }, | |
200 #ifdef LWLIB_USES_MOTIF | |
201 { /* XmPrimitiveClassPart | |
202 */ | |
203 (XtWidgetProc) _XtInherit, /* border_highlight */ | |
204 (XtWidgetProc) _XtInherit, /* border_unhighlight */ | |
205 /* Setting the following to NULL causes PrimitiveInitialize() | |
206 not to add traversal (TAB etc. to switch focus) and | |
207 focus-in/out (border highlight/unhighlight) translations. | |
208 If you want those translations, use the value XtInheritTranslations | |
209 instead. Doing this, however, will interfere with Emacs | |
210 focus handling (which highlights/unhighlights the text cursor), | |
211 and will lead to strange display results around the border of the | |
212 widget. */ | |
213 NULL, /* translations */ | |
214 NULL, /* arm_and_activate */ | |
215 NULL, /* get resources */ | |
216 0, /* num get_resources */ | |
217 NULL, /* extension */ | |
218 }, | |
219 #endif /* LWLIB_USES_MOTIF */ | |
220 { | |
221 0 | |
222 } | |
223 }; | |
224 WidgetClass emacsFrameClass = (WidgetClass) &emacsFrameClassRec; | |
225 | |
226 static void | |
227 update_various_frame_slots (EmacsFrame ew) | |
228 { | |
229 ew->emacs_frame.frame->pixheight = ew->core.height; | |
230 ew->emacs_frame.frame->pixwidth = ew->core.width; | |
231 } | |
232 | |
233 static void | |
3025 | 234 EmacsFrameInitialize (Widget UNUSED (request), Widget new_, |
2286 | 235 ArgList UNUSED (unused1), Cardinal *UNUSED (unused2)) |
428 | 236 { |
3025 | 237 EmacsFrame ew = (EmacsFrame)new_; |
428 | 238 struct frame *f = ew->emacs_frame.frame; |
239 | |
240 if (!f) | |
241 fatal ("can't create an emacs frame widget without a frame."); | |
242 | |
243 ew->emacs_frame.frame->internal_border_width = | |
244 ew->emacs_frame.internal_border_width; | |
245 } | |
246 | |
247 void emacs_Xt_event_handler (Widget wid /* unused */, | |
248 XtPointer closure /* unused */, | |
249 XEvent *event, | |
250 Boolean *continue_to_dispatch /* unused */); | |
251 | |
252 static void | |
253 EmacsFrameRealize (Widget widget, XtValueMask *mask, | |
254 XSetWindowAttributes *attrs) | |
255 { | |
256 EmacsFrame ew = (EmacsFrame) widget; | |
257 struct frame *f = ew->emacs_frame.frame; | |
258 Widget shell_widget = FRAME_X_SHELL_WIDGET (f); | |
259 | |
260 attrs->event_mask = | |
261 ExposureMask | | |
262 VisibilityChangeMask | | |
263 PropertyChangeMask | | |
264 StructureNotifyMask | | |
265 SubstructureNotifyMask | | |
266 /*SubstructureRedirectMask |*/ /* Only for WMs! */ | |
267 KeyPressMask | | |
268 KeyReleaseMask | | |
269 ButtonPressMask | | |
270 ButtonReleaseMask | | |
271 FocusChangeMask | | |
272 PointerMotionHintMask | | |
273 PointerMotionMask | | |
274 LeaveWindowMask | | |
275 EnterWindowMask; | |
276 | |
277 | |
278 *mask |= CWEventMask; | |
279 | |
280 if (ew->emacs_frame.use_backing_store) | |
281 { | |
282 attrs->backing_store = Always; | |
283 *mask |= CWBackingStore; | |
284 } | |
285 XtCreateWindow (widget, InputOutput, (Visual *)CopyFromParent, *mask, | |
286 attrs); | |
287 | |
288 /* snarf the events we want. */ | |
289 XtInsertEventHandler (widget, attrs->event_mask, TRUE, | |
290 emacs_Xt_event_handler, NULL, XtListHead); | |
291 /* some events (e.g. map-notify and WM_DELETE_WINDOW) get sent | |
292 directly to the shell, and the above event handler won't see | |
293 them. So add a handler to get them. These events don't | |
294 propagate, so there's no danger of them being seen twice. */ | |
295 XtInsertEventHandler (shell_widget, | |
296 EnterWindowMask | LeaveWindowMask | | |
297 VisibilityChangeMask | StructureNotifyMask | | |
298 KeyPressMask, | |
299 TRUE, emacs_Xt_event_handler, NULL, XtListHead); | |
300 | |
301 #ifdef EXTERNAL_WIDGET | |
302 /* #### Not sure if this special case is necessary */ | |
303 if (!FRAME_X_EXTERNAL_WINDOW_P (f)) | |
304 #endif | |
305 /* This is necessary under Motif in order to make it possible to click in | |
306 a buffer and move focus out of a dialog box or control panel and back | |
307 into emacs-land; also necessary so that you can still type chars | |
308 if the cursor is over the menubar or scrollbar. */ | |
309 lw_set_keyboard_focus (shell_widget, FRAME_X_TEXT_WIDGET (f)); | |
310 } | |
311 | |
312 /* DO NOT CALL THIS FUNCTION! Only Xt is supposed to do this. */ | |
313 | |
314 static void | |
315 EmacsFrameResize (Widget widget) | |
316 { | |
317 EmacsFrame ew = (EmacsFrame)widget; | |
318 struct frame *f = ew->emacs_frame.frame; | |
319 int columns; | |
320 int rows; | |
321 XtWidgetGeometry req, repl; | |
322 | |
323 update_various_frame_slots (ew); | |
324 | |
5043 | 325 pixel_to_frame_unit_size (f, ew->core.width, ew->core.height, &columns, &rows); |
326 change_frame_size (f, columns, rows, 0); | |
428 | 327 |
3381 | 328 /* The code below is just plain wrong. If the EmacsShell or EmacsManager |
329 needs to know, they should just ask. If needed information is being | |
330 updated here, then we should set a dirty flag and have it updated on an | |
331 as-needed basis. | |
332 For now, conditionalize so people can get work done if this breaks | |
333 something. */ | |
334 if (wedge_metacity) /* cf. x_set_frame_size */ | |
335 { | |
336 /* Now we tell the EmacsShell that we've changed the size of the | |
337 non-fixed portion of the frame. Note that, if the resize occurred | |
338 as a result of EmacsFrameSetCharSize(), this information will be | |
339 stored twice. This is not a big deal, as storing this information | |
340 doesn't actually do anything until the next resize. */ | |
341 if (FRAME_X_TOP_LEVEL_FRAME_P (f)) | |
342 x_wm_set_variable_size (FRAME_X_SHELL_WIDGET (f), columns, rows); | |
428 | 343 |
3381 | 344 /* Kick the manager so that it knows we've changed size. |
345 #### No, no, no! If this does anything at all, it will involve | |
346 changing the manager's size. That's not something that a child | |
347 widget should initialize as part of a purely informational | |
348 method!! */ | |
349 req.request_mode = 0; | |
350 XtQueryGeometry (FRAME_X_CONTAINER_WIDGET (f), &req, &repl); | |
351 EmacsManagerChangeSize (FRAME_X_CONTAINER_WIDGET (f), | |
352 repl.width, repl.height); | |
353 } | |
428 | 354 } |
355 | |
356 static Boolean | |
2286 | 357 EmacsFrameSetValues (Widget cur_widget, Widget UNUSED (req_widget), |
358 Widget new_widget, ArgList argv, Cardinal *argc) | |
428 | 359 { |
360 EmacsFrame cur = (EmacsFrame) cur_widget; | |
3025 | 361 EmacsFrame new_ = (EmacsFrame) new_widget; |
362 struct frame *f = new_->emacs_frame.frame; | |
428 | 363 in_resource_setting++; |
364 /* This function does not need to do much. Pretty much everything | |
365 interesting will get done in the resize method, which will | |
366 (if necessary) get called by Xt when this function returns | |
367 (see below). | |
368 */ | |
369 | |
370 /* #### This function will not work if it is not called from | |
371 update_EmacsFrame(), called from SET_FACE_PROPERTY(). | |
372 The code located there should be moved inside of here instead, | |
373 so that things work if either SET_FACE_PROPERTY() is | |
374 called or XtSetValues() is called. | |
375 */ | |
376 | |
3025 | 377 if (cur->emacs_frame.iconic != new_->emacs_frame.iconic && |
378 FRAME_X_TOP_LEVEL_FRAME_P (new_->emacs_frame.frame)) | |
379 x_wm_set_shell_iconic_p (FRAME_X_SHELL_WIDGET (new_->emacs_frame.frame), | |
380 new_->emacs_frame.iconic); | |
428 | 381 |
382 /* If we got here, then we were likely called as a result of | |
383 the EditRes protocol, so go ahead and change scrollbar-width | |
384 and scrollbar-height. Otherwise, we're merely mirroring | |
385 a change made to scrollbar-width etc. so don't do anything | |
386 special. */ | |
387 if (cur->emacs_frame.internal_border_width != | |
3025 | 388 new_->emacs_frame.internal_border_width) |
428 | 389 { |
3025 | 390 f->internal_border_width = new_->emacs_frame.internal_border_width; |
428 | 391 MARK_FRAME_SIZE_SLIPPED (f); |
392 } | |
393 | |
394 #ifdef HAVE_SCROLLBARS | |
395 if (cur->emacs_frame.scrollbar_width != | |
3025 | 396 new_->emacs_frame.scrollbar_width) |
428 | 397 Fadd_spec_to_specifier |
398 (Vscrollbar_width, | |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
399 make_fixnum (new_->emacs_frame.scrollbar_width), |
872 | 400 wrap_frame (f), Qnil, Qnil); |
428 | 401 if (cur->emacs_frame.scrollbar_height != |
3025 | 402 new_->emacs_frame.scrollbar_height) |
428 | 403 Fadd_spec_to_specifier |
404 (Vscrollbar_height, | |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
405 make_fixnum (new_->emacs_frame.scrollbar_height), |
872 | 406 wrap_frame (f), Qnil, Qnil); |
428 | 407 #endif /* HAVE_SCROLLBARS */ |
408 #ifdef HAVE_TOOLBARS | |
409 if (cur->emacs_frame.top_toolbar_height != | |
3025 | 410 new_->emacs_frame.top_toolbar_height) |
428 | 411 Fadd_spec_to_specifier |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5052
diff
changeset
|
412 (Vtoolbar_size[TOP_EDGE], |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
413 make_fixnum (new_->emacs_frame.top_toolbar_height), |
872 | 414 wrap_frame (f), Qnil, Qnil); |
428 | 415 if (cur->emacs_frame.bottom_toolbar_height != |
3025 | 416 new_->emacs_frame.bottom_toolbar_height) |
428 | 417 Fadd_spec_to_specifier |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5052
diff
changeset
|
418 (Vtoolbar_size[BOTTOM_EDGE], |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
419 make_fixnum (new_->emacs_frame.bottom_toolbar_height), |
872 | 420 wrap_frame (f), Qnil, Qnil); |
428 | 421 if (cur->emacs_frame.left_toolbar_width != |
3025 | 422 new_->emacs_frame.left_toolbar_width) |
428 | 423 Fadd_spec_to_specifier |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5052
diff
changeset
|
424 (Vtoolbar_size[LEFT_EDGE], |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
425 make_fixnum (new_->emacs_frame.left_toolbar_width), |
872 | 426 wrap_frame (f), Qnil, Qnil); |
428 | 427 if (cur->emacs_frame.right_toolbar_width != |
3025 | 428 new_->emacs_frame.right_toolbar_width) |
428 | 429 Fadd_spec_to_specifier |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5052
diff
changeset
|
430 (Vtoolbar_size[RIGHT_EDGE], |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
431 make_fixnum (new_->emacs_frame.right_toolbar_width), |
872 | 432 wrap_frame (f), Qnil, Qnil); |
428 | 433 if (cur->emacs_frame.top_toolbar_border_width != |
3025 | 434 new_->emacs_frame.top_toolbar_border_width) |
428 | 435 Fadd_spec_to_specifier |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5052
diff
changeset
|
436 (Vtoolbar_border_width[TOP_EDGE], |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
437 make_fixnum (new_->emacs_frame.top_toolbar_border_width), |
872 | 438 wrap_frame (f), Qnil, Qnil); |
428 | 439 if (cur->emacs_frame.bottom_toolbar_border_width != |
3025 | 440 new_->emacs_frame.bottom_toolbar_border_width) |
428 | 441 Fadd_spec_to_specifier |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5052
diff
changeset
|
442 (Vtoolbar_border_width[BOTTOM_EDGE], |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
443 make_fixnum (new_->emacs_frame.bottom_toolbar_border_width), |
872 | 444 wrap_frame (f), Qnil, Qnil); |
428 | 445 if (cur->emacs_frame.left_toolbar_border_width != |
3025 | 446 new_->emacs_frame.left_toolbar_border_width) |
428 | 447 Fadd_spec_to_specifier |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5052
diff
changeset
|
448 (Vtoolbar_border_width[LEFT_EDGE], |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
449 make_fixnum (new_->emacs_frame.left_toolbar_border_width), |
872 | 450 wrap_frame (f), Qnil, Qnil); |
428 | 451 if (cur->emacs_frame.right_toolbar_border_width != |
3025 | 452 new_->emacs_frame.right_toolbar_border_width) |
428 | 453 Fadd_spec_to_specifier |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5052
diff
changeset
|
454 (Vtoolbar_border_width[RIGHT_EDGE], |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
455 make_fixnum (new_->emacs_frame.right_toolbar_border_width), |
872 | 456 wrap_frame (f), Qnil, Qnil); |
428 | 457 #endif /* HAVE_TOOLBARS */ |
458 | |
459 in_resource_setting--; | |
460 | |
461 /* If the request was to resize us, but the size has not changed, Xt | |
462 will do nothing, and won't call our resize callback. Since such a | |
463 request might be issued as a result of hiding/showing menubar or | |
464 changing toolbar placement, where we rely on relayout made by the | |
465 callback, we go ahead and simulate such a call */ | |
3025 | 466 if (cur->core.width == new_->core.width |
467 && cur->core.height == new_->core.height) | |
428 | 468 { |
469 int i; | |
647 | 470 for (i = 0; i < (int) *argc; i++) |
428 | 471 if (strcmp (argv[i].name, XtNwidth) == 0 |
472 || strcmp (argv[i].name, XtNheight) == 0) | |
473 { | |
474 EmacsFrameResize (new_widget); | |
475 break; | |
476 } | |
477 } | |
478 | |
479 return False; | |
480 | |
481 /* Note that if either (a) we return True, or (b) the width or | |
482 height has changed, an Expose event will be generated. The Xt | |
483 manual says you should not return True if the width or height has | |
484 changed, because then two Expose events will be generated. | |
485 | |
486 In any case, there is no need to return True because | |
487 SET_FACE_PROPERTY(), which does the resource | |
488 setting, automatically forces a redisplay as necessary. */ | |
489 } | |
490 | |
491 static XtGeometryResult | |
492 EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, | |
493 XtWidgetGeometry *result) | |
494 { | |
495 EmacsFrame ew = (EmacsFrame) widget; | |
496 int mask = request->request_mode; | |
497 Dimension width, height; | |
498 int ok_width_int, ok_height_int; | |
499 Dimension ok_width, ok_height; | |
500 | |
501 /* We have a definite preference for what size we would like | |
502 to be. | |
503 | |
504 1) If a preferred size was specified for us, use it. | |
505 (This is not currently used) | |
506 2) If a proposed size was given, round it to the nearest | |
507 multiple of the default char size and return it. | |
508 3) Otherwise, take our current size and round it to the | |
509 nearest multiple of the default char size. */ | |
510 | |
511 width = mask & CWWidth ? request->width : ew->core.width; | |
512 height = mask & CWHeight ? request->height : ew->core.height; | |
513 round_size_to_char (ew->emacs_frame.frame, width, height, | |
514 &ok_width_int, &ok_height_int); | |
515 ok_width = (Dimension) ok_width_int; | |
516 ok_height = (Dimension) ok_height_int; | |
517 if (ew->emacs_frame.preferred_width) | |
518 ok_width = ew->emacs_frame.preferred_width; | |
519 if (ew->emacs_frame.preferred_height) | |
520 ok_height = ew->emacs_frame.preferred_height; | |
521 result->request_mode |= CWWidth | CWHeight; | |
522 result->width = ok_width; | |
523 result->height = ok_height; | |
524 if (((mask & CWWidth) && ok_width != request->width) | |
525 || ((mask & CWHeight) && ok_height != request->height)) | |
526 return XtGeometryAlmost; | |
527 else | |
528 return XtGeometryYes; | |
529 } | |
530 | |
531 /* Xt string-to-scrollbar-placement converter */ | |
440 | 532 /* #### Convert this to a `new-style' converter (See XtAddTypeConverter) */ |
428 | 533 |
534 /* This variable cannot be a stack variable. */ | |
535 static unsigned char cvt_string_scrollbar_placement; | |
536 | |
537 /* ARGSUSED */ | |
538 static void | |
2286 | 539 Xt_StringToScrollBarPlacement (XrmValuePtr UNUSED (args), |
540 Cardinal *UNUSED (num_args), | |
541 XrmValuePtr fromVal, | |
542 XrmValuePtr toVal) | |
428 | 543 { |
2367 | 544 /* !!#### needs work */ |
428 | 545 XrmQuark q; |
851 | 546 char *lowerName = (char *) ALLOCA (strlen ((char *) fromVal->addr) + 1); |
428 | 547 |
548 XmuCopyISOLatin1Lowered (lowerName, (char *) fromVal->addr); | |
549 q = XrmStringToQuark (lowerName); | |
550 | |
551 toVal->size = sizeof (cvt_string_scrollbar_placement); | |
552 toVal->addr = (XPointer) &cvt_string_scrollbar_placement; | |
553 | |
554 if (q == XrmStringToQuark ("top-left") | |
555 || q == XrmStringToQuark ("top_left")) | |
556 cvt_string_scrollbar_placement = XtTOP_LEFT; | |
557 else if (q == XrmStringToQuark ("bottom-left") | |
558 || q == XrmStringToQuark ("bottom_left")) | |
559 cvt_string_scrollbar_placement = XtBOTTOM_LEFT; | |
560 else if (q == XrmStringToQuark ("top-right") | |
561 || q == XrmStringToQuark ("top_right")) | |
562 cvt_string_scrollbar_placement = XtTOP_RIGHT; | |
563 else if (q == XrmStringToQuark ("bottom-right") | |
564 || q == XrmStringToQuark ("bottom_right")) | |
565 cvt_string_scrollbar_placement = XtBOTTOM_RIGHT; | |
566 else | |
567 { | |
568 XtStringConversionWarning (fromVal->addr, "scrollBarPlacement"); | |
569 toVal->addr = NULL; | |
570 toVal->size = 0; | |
571 } | |
572 } | |
573 | |
574 static void | |
575 EmacsFrameClassInitialize (void) | |
576 { | |
577 XtAddConverter (XtRString, XtRScrollBarPlacement, | |
578 Xt_StringToScrollBarPlacement, NULL, 0); | |
579 } | |
580 | |
581 /********************* Special entrypoints *******************/ | |
582 | |
583 void | |
584 EmacsFrameRecomputeCellSize (Widget w) | |
585 { | |
586 EmacsFrame ew = (EmacsFrame) w; | |
587 int cw, ch; | |
588 struct frame *f = ew->emacs_frame.frame; | |
589 | |
5050
6f2158fa75ed
Fix quick-build, use asserts() in place of ABORT()
Ben Wing <ben@xemacs.org>
parents:
4769
diff
changeset
|
590 assert (XtIsSubclass (w, emacsFrameClass)); |
428 | 591 |
5047
07dcc7000bbf
put width before height consistently, fix a real bug found in the process
Ben Wing <ben@xemacs.org>
parents:
5043
diff
changeset
|
592 default_face_width_and_height (wrap_frame (f), &cw, &ch); |
428 | 593 if (FRAME_X_TOP_LEVEL_FRAME_P (f)) |
594 x_wm_set_cell_size (FRAME_X_SHELL_WIDGET (f), cw, ch); | |
595 } | |
596 | |
597 /* Set the size of the widget to have the number of rows and columns | |
598 specified. This both causes the X window to change and the | |
599 internal frame structures to get modified to match. */ | |
600 | |
601 void | |
602 EmacsFrameSetCharSize (Widget widget, int columns, int rows) | |
603 { | |
604 EmacsFrame ew = (EmacsFrame) widget; | |
605 int pixel_width, pixel_height; | |
606 struct frame *f = ew->emacs_frame.frame; | |
607 | |
608 if (columns < 3) | |
609 columns = 3; /* no way buddy */ | |
610 if (rows < 1) | |
611 rows = 1; | |
612 | |
613 char_to_pixel_size (f, columns, rows, &pixel_width, &pixel_height); | |
614 | |
615 if (FRAME_X_TOP_LEVEL_FRAME_P (f)) | |
616 x_wm_set_variable_size (FRAME_X_SHELL_WIDGET (f), columns, rows); | |
617 | |
618 { | |
619 Arg al [2]; | |
4528
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
620 Xt_SET_ARG (al [0], XtNwidth, pixel_width); |
726060ee587c
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4522
diff
changeset
|
621 Xt_SET_ARG (al [1], XtNheight, pixel_height); |
428 | 622 XtSetValues ((Widget) ew, al, countof (al)); |
623 } | |
624 } |