annotate src/EmacsFrame.c @ 793:e38acbeb1cae

[xemacs-hg @ 2002-03-29 04:46:17 by ben] lots o' fixes etc/ChangeLog: New file. Separated out all entries for etc/ into their own ChangeLog. Includes entries for the following files: etc/BABYL, etc/BETA, etc/CHARSETS, etc/DISTRIB, etc/Emacs.ad, etc/FTP, etc/GNUS-NEWS, etc/GOATS, etc/HELLO, etc/INSTALL, etc/MACHINES, etc/MAILINGLISTS, etc/MSDOS, etc/MYTHOLOGY, etc/NEWS, etc/OXYMORONS, etc/PACKAGES, etc/README, etc/TUTORIAL, etc/TUTORIAL.de, etc/TUTORIAL.ja, etc/TUTORIAL.ko, etc/TUTORIAL.se, etc/aliases.ksh, etc/altrasoft-logo.xpm, etc/check_cygwin_setup.sh, etc/custom/example-themes/europe-theme.el, etc/custom/example-themes/ex-custom-file, etc/custom/example-themes/example-theme.el, etc/e/eterm.ti, etc/edt-user.doc, etc/enriched.doc, etc/etags.1, etc/gnuserv.1, etc/gnuserv.README, etc/package-index.LATEST.gpg, etc/package-index.LATEST.pgp, etc/photos/jan.png, etc/recycle.xpm, etc/refcard.tex, etc/sample.Xdefaults, etc/sample.emacs, etc/sgml/CATALOG, etc/sgml/HTML32.dtd, etc/skk/SKK.tut.E, etc/smilies/Face_ase.xbm, etc/smilies/Face_ase2.xbm, etc/smilies/Face_ase3.xbm, etc/smilies/Face_smile.xbm, etc/smilies/Face_weep.xbm, etc/sounds, etc/toolbar, etc/toolbar/workshop-cap-up.xpm, etc/xemacs-ja.1, etc/xemacs.1, etc/yow.lines, etc\BETA, etc\NEWS, etc\README, etc\TUTORIAL, etc\TUTORIAL.de, etc\check_cygwin_setup.sh, etc\sample.init.el, etc\unicode\README, etc\unicode\mule-ucs\*, etc\unicode\other\* unicode/unicode-consortium/8859-16.TXT: New file. mule/english.el: Define this charset now, since a bug was fixed that formerly prevented it. mule/ethio-util.el: Fix compile errors involving Unicode `characters', which should be integers. Makefile.in.in: Always include gui.c, to fix compile error when TTY-only. EmacsFrame.c, abbrev.c, alloc.c, buffer.c, buffer.h, bytecode.c, bytecode.h, callint.c, callproc.c, casetab.c, casetab.h, charset.h, chartab.c, chartab.h, cmds.c, console-msw.c, console-msw.h, console-tty.c, console-x.c, console-x.h, console.c, console.h, data.c, database.c, device-gtk.c, device-msw.c, device-x.c, device.c, device.h, dialog-msw.c, doc.c, doprnt.c, dumper.c, dynarr.c, editfns.c, eldap.c, eldap.h, elhash.c, elhash.h, emacs.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, event-tty.c, event-unixoid.c, events.c, events.h, extents.c, extents.h, faces.c, faces.h, file-coding.c, file-coding.h, fileio.c, filelock.c, fns.c, frame-gtk.c, frame-msw.c, frame-tty.c, frame-x.c, frame.c, frame.h, free-hook.c, general-slots.h, glyphs-eimage.c, glyphs-gtk.c, glyphs-msw.c, glyphs-widget.c, glyphs-x.c, glyphs.c, glyphs.h, gpmevent.c, gtk-xemacs.c, gui-msw.c, gui-x.c, gui-x.h, gui.c, gui.h, gutter.c, gutter.h, indent.c, input-method-xlib.c, insdel.c, keymap.c, keymap.h, lisp-disunion.h, lisp-union.h, lisp.h, lread.c, lrecord.h, lstream.c, lstream.h, marker.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, mule-canna.c, mule-ccl.c, mule-charset.c, mule-wnnfns.c, native-gtk-toolbar.c, objects-msw.c, objects-tty.c, objects-x.c, objects.c, objects.h, opaque.c, opaque.h, postgresql.c, postgresql.h, print.c, process-unix.c, process.c, process.h, rangetab.c, rangetab.h, redisplay-gtk.c, redisplay-msw.c, redisplay-output.c, redisplay-tty.c, redisplay-x.c, redisplay.c, scrollbar-gtk.c, scrollbar-msw.c, scrollbar-x.c, scrollbar.c, scrollbar.h, search.c, select-gtk.c, select-x.c, sound.c, specifier.c, specifier.h, strftime.c, symbols.c, symeval.h, syntax.h, text.c, text.h, toolbar-common.c, toolbar-msw.c, toolbar.c, toolbar.h, tooltalk.c, tooltalk.h, ui-gtk.c, ui-gtk.h, undo.c, vm-limit.c, window.c, window.h: Eliminate XSETFOO. Replace all usages with wrap_foo(). Make symbol->name a Lisp_Object, not Lisp_String *. Eliminate nearly all uses of Lisp_String * in favor of Lisp_Object, and correct macros so most of them favor Lisp_Object. Create new error-behavior ERROR_ME_DEBUG_WARN -- output warnings, but at level `debug' (usually ignored). Use it when instantiating specifiers, so problems can be debugged. Move log-warning-minimum-level into C so that we can optimize ERROR_ME_DEBUG_WARN. Fix warning levels consistent with new definitions. Add default_ and parent fields to char table; not yet implemented. New fun Dynarr_verify(); use for further error checking on Dynarrs. Rearrange code at top of lisp.h in conjunction with dynarr changes. Fix eifree(). Use Eistrings in various places (format_event_object(), where_is_to_char(), and callers thereof) to avoid fixed-size strings buffers. New fun write_eistring(). Reindent and fix GPM code to follow standards. Set default MS Windows font to Lucida Console (same size as Courier New but less interline spacing, so more lines fit). Increase default frame size on Windows to 50 lines. (If that's too big for the workspace, the frame will be shrunk as necessary.) Fix problem with text files with no newlines (). (Change `convert-eol' coding system to use `nil' for autodetect, consistent with make-coding-system.) Correct compile warnings in vm-limit.c. Fix handling of reverse-direction charsets to avoid errors when opening (e.g.) mule-ucs/lisp/reldata/uiso8859-6.el. Recode some object printing methods to use write_fmt_string() instead of a fixed buffer and sprintf. Turn on display of png comments as warnings (level `info'), now that they're unobtrusive. Revamped the sound documentation. Fixed bug in redisplay w.r.t. hscroll/truncation/continuation glyphs causing jumping up and down of the lines, since they're bigger than the line size. (It was seen most obviously when there's a horizontal scroll bar, e.g. do C-h a glyph or something like that.) The problem was that the glyph-contrib-p setting on glyphs was ignored even if it was set properly, which it wasn't until now.
author ben
date Fri, 29 Mar 2002 04:49:13 +0000
parents 943eaba38521
children a5954632b187
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /* The emacs frame widget.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 Copyright (C) 1993-1995 Sun Microsystems, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 Copyright (C) 1995 Ben Wing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 Free Software Foundation; either version 2, or (at your option) any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 /* Synched up with: Not in FSF. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 /* #### Note to potential hackers: Don't mess with this unless you're
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 sure you know what you're doing! Xt is a lot more subtle than
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 you may think. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 #include <config.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 #include "lisp.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 #include "console-x.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 #include "glyphs-x.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 #include "objects-x.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 #include <X11/Shell.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 #include "EmacsFrameP.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 #include "EmacsManager.h" /* for EmacsManagerChangeSize */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 #include "xmu.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 #include "faces.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 #include "frame.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 #include "toolbar.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 #include "window.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 static void EmacsFrameClassInitialize (void);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 static void EmacsFrameInitialize (Widget, Widget, ArgList, Cardinal *);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 static void EmacsFrameRealize (Widget, XtValueMask*, XSetWindowAttributes*);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 static void EmacsFrameResize (Widget widget);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 static Boolean EmacsFrameSetValues (Widget, Widget, Widget,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 ArgList, Cardinal *);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 static XtGeometryResult EmacsFrameQueryGeometry (Widget, XtWidgetGeometry*,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 XtWidgetGeometry*);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 extern void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 emacs_Xt_mapping_action (Widget w, XEvent* event);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 #undef XtOffset
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 #define XtOffset(p_type,field) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 ((Cardinal) (((char *) (&(((p_type)0)->field))) - ((char *)0)))
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
60 #define offset(field) XtOffset (EmacsFrame, emacs_frame.field)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 static XtResource resources[] = {
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
63 { XtNgeometry, XtCGeometry,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
64 XtRString, sizeof (String),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
65 offset (geometry), XtRString, (XtPointer) 0 },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
66 { XtNiconic, XtCIconic,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
67 XtRBoolean, sizeof (Boolean),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
68 offset (iconic), XtRImmediate, (XtPointer) False },
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
70 { XtNemacsFrame, XtCEmacsFrame,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
71 XtRPointer, sizeof (XtPointer),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
72 offset (frame), XtRImmediate, 0 },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
73 { XtNmenubar, XtCMenubar,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
74 XtRBoolean, sizeof (Boolean),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
75 offset (menubar_p), XtRImmediate, (XtPointer) True },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
76 { XtNinitiallyUnmapped, XtCInitiallyUnmapped,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
77 XtRBoolean, sizeof (Boolean),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
78 offset (initially_unmapped), XtRImmediate, (XtPointer) False },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
79 { XtNminibuffer, XtCMinibuffer,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
80 XtRBoolean, sizeof (Boolean),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
81 offset (minibuffer), XtRImmediate, (XtPointer) True },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
82 { XtNunsplittable, XtCUnsplittable,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
83 XtRBoolean, sizeof (Boolean),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
84 offset (unsplittable), XtRImmediate, (XtPointer) False },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
85 { XtNinternalBorderWidth, XtCInternalBorderWidth,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
86 XtRInt, sizeof (int),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
87 offset (internal_border_width), XtRImmediate, (XtPointer)4 },
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 #ifdef HAVE_SCROLLBARS
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
89 { XtNscrollBarWidth, XtCScrollBarWidth,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
90 XtRInt, sizeof (int),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
91 offset (scrollbar_width), XtRImmediate, (XtPointer)-1 },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
92 { XtNscrollBarHeight, XtCScrollBarHeight,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
93 XtRInt, sizeof (int),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
94 offset (scrollbar_height), XtRImmediate, (XtPointer)-1 },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
95 { XtNscrollBarPlacement, XtCScrollBarPlacement,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
96 XtRScrollBarPlacement, sizeof (unsigned char),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
97 offset (scrollbar_placement), XtRImmediate,
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 #if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 defined (LWLIB_SCROLLBARS_ATHENA3D)
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
100 (XtPointer) XtBOTTOM_RIGHT
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 #else
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
102 (XtPointer) XtBOTTOM_LEFT
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 },
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 #endif /* HAVE_SCROLLBARS */
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
106
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 #ifdef HAVE_TOOLBARS
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
108 { XtNtopToolBarHeight, XtCTopToolBarHeight,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
109 XtRInt, sizeof (int),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
110 offset (top_toolbar_height), XtRImmediate, (XtPointer)-1 },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
111 { XtNbottomToolBarHeight, XtCBottomToolBarHeight,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
112 XtRInt, sizeof (int),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
113 offset (bottom_toolbar_height), XtRImmediate, (XtPointer)-1 },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
114 { XtNleftToolBarWidth, XtCLeftToolBarWidth,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
115 XtRInt, sizeof (int),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
116 offset (left_toolbar_width), XtRImmediate, (XtPointer)-1 },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
117 { XtNrightToolBarWidth, XtCRightToolBarWidth,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
118 XtRInt, sizeof (int),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
119 offset (right_toolbar_width), XtRImmediate, (XtPointer)-1 },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
120 { XtNtopToolBarBorderWidth, XtCTopToolBarBorderWidth,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
121 XtRInt, sizeof (int),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
122 offset (top_toolbar_border_width), XtRImmediate, (XtPointer)-1 },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
123 { XtNbottomToolBarBorderWidth, XtCBottomToolBarBorderWidth,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
124 XtRInt, sizeof (int),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
125 offset (bottom_toolbar_border_width), XtRImmediate, (XtPointer)-1 },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
126 { XtNleftToolBarBorderWidth, XtCLeftToolBarBorderWidth,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
127 XtRInt, sizeof (int),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
128 offset (left_toolbar_border_width), XtRImmediate, (XtPointer)-1 },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
129 { XtNrightToolBarBorderWidth, XtCRightToolBarBorderWidth,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
130 XtRInt, sizeof (int),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
131 offset (right_toolbar_border_width), XtRImmediate, (XtPointer)-1 },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
132 { XtNtopToolBarShadowColor, XtCTopToolBarShadowColor,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
133 XtRPixel, sizeof (Pixel),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
134 offset(top_toolbar_shadow_pixel), XtRString, (XtPointer) "#000000" },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
135 { XtNbottomToolBarShadowColor, XtCBottomToolBarShadowColor,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
136 XtRPixel, sizeof (Pixel),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
137 offset (bottom_toolbar_shadow_pixel), XtRString, (XtPointer) "#000000" },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
138 { XtNbackgroundToolBarColor, XtCBackgroundToolBarColor,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
139 XtRPixel, sizeof (Pixel),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
140 offset (background_toolbar_pixel), XtRImmediate, (XtPointer)-1 },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
141 { XtNforegroundToolBarColor, XtCForegroundToolBarColor,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
142 XtRPixel, sizeof (Pixel),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
143 offset (foreground_toolbar_pixel), XtRImmediate, (XtPointer)-1 },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
144 { XtNtopToolBarShadowPixmap, XtCTopToolBarShadowPixmap,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
145 XtRPixmap, sizeof (Pixmap),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
146 offset (top_toolbar_shadow_pixmap), XtRImmediate, (XtPointer)None },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
147 { XtNbottomToolBarShadowPixmap, XtCBottomToolBarShadowPixmap,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
148 XtRPixmap, sizeof (Pixmap),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
149 offset (bottom_toolbar_shadow_pixmap), XtRImmediate, (XtPointer)None },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
150 { XtNtoolBarShadowThickness, XtCToolBarShadowThickness,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
151 XtRDimension, sizeof (Dimension),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
152 offset (toolbar_shadow_thickness), XtRImmediate, (XtPointer)2 },
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153 #endif /* HAVE_TOOLBARS */
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
154
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
155 { XtNinterline, XtCInterline,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
156 XtRInt, sizeof (int),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
157 offset (interline), XtRImmediate, (XtPointer)0 },
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 {
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
159 XtNfont, XtCFont,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
160 XtRFontStruct, sizeof (XFontStruct *),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 offset(font), XtRImmediate, (XtPointer)0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 },
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
163 { XtNforeground, XtCForeground,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
164 XtRPixel, sizeof (Pixel),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
165 offset(foreground_pixel), XtRString, (XtPointer) "Black" },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
166 { XtNbackground, XtCBackground,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
167 XtRPixel, sizeof (Pixel),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
168 offset(background_pixel), XtRString, (XtPointer) "Gray80" },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
169 { XtNcursorColor, XtCForeground,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
170 XtRPixel, sizeof (Pixel),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
171 offset(cursor_color), XtRString, (XtPointer) "XtDefaultForeground" },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
172 { XtNbarCursor, XtCBarCursor,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
173 XtRBoolean, sizeof (Boolean),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
174 offset (bar_cursor), XtRImmediate, (XtPointer)0 },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
175 { XtNvisualBell, XtCVisualBell,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
176 XtRBoolean, sizeof (Boolean),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
177 offset (visual_bell), XtRImmediate, (XtPointer)0 },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
178 { XtNbellVolume, XtCBellVolume,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
179 XtRInt, sizeof (int),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
180 offset (bell_volume), XtRImmediate, (XtPointer)0 },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
181 { XtNuseBackingStore, XtCUseBackingStore,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
182 XtRBoolean, sizeof (Boolean),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
183 offset (use_backing_store), XtRImmediate, (XtPointer)0 },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
184 { XtNpreferredWidth, XtCPreferredWidth,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
185 XtRDimension, sizeof (Dimension),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
186 offset (preferred_width), XtRImmediate, (XtPointer)0 },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
187 { XtNpreferredHeight, XtCPreferredHeight,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
188 XtRDimension, sizeof (Dimension),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
189 offset (preferred_height), XtRImmediate, (XtPointer)0 },
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 #undef offset
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 /* Xt is stupid and dumb.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 Xt is stupid and dumb.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 Xt is stupid and dumb. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 static XtActionsRec
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 emacsFrameActionsTable [] = {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 {"mapping", (XtActionProc) emacs_Xt_mapping_action},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203 static char
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204 emacsFrameTranslations [] = "\
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 <Mapping>: mapping()\n\
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 ";
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 /* If we're running under Motif, make this widget a subclass
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 of XmPrimitive. It's not clear this is necessary, but it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 may make focus behavior work better. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 EmacsFrameClassRec emacsFrameClassRec = {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 { /* core fields */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 #ifdef LWLIB_USES_MOTIF
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215 /* superclass */ (WidgetClass) &xmPrimitiveClassRec,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216 #else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 /* superclass */ &widgetClassRec,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219 /* class_name */ "EmacsFrame",
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
220 /* widget_size */ sizeof (EmacsFrameRec),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 /* class_initialize */ EmacsFrameClassInitialize,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 /* class_part_initialize */ 0,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223 /* class_inited */ FALSE,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 /* initialize */ EmacsFrameInitialize,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 /* initialize_hook */ 0,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226 /* realize */ EmacsFrameRealize,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 /* actions */ emacsFrameActionsTable,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228 /* num_actions */ XtNumber (emacsFrameActionsTable),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229 /* resources */ resources,
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
230 /* resource_count */ XtNumber (resources),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231 /* xrm_class */ NULLQUARK,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232 /* compress_motion */ TRUE,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 /* compress_exposure */ TRUE,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 /* compress_enterleave */ TRUE,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 /* visible_interest */ FALSE,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 /* destroy */ NULL,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 /* resize */ EmacsFrameResize,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 /* expose */ XtInheritExpose,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 /* set_values */ EmacsFrameSetValues,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 /* set_values_hook */ 0,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 /* set_values_almost */ XtInheritSetValuesAlmost,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 /* get_values_hook */ 0,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 /* accept_focus */ XtInheritAcceptFocus,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 /* version */ XtVersion,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 /* callback_private */ 0,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 /* tm_table */ emacsFrameTranslations,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 /* query_geometry */ EmacsFrameQueryGeometry,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 /* display_accelerator */ XtInheritDisplayAccelerator,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 /* extension */ 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 },
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 #ifdef LWLIB_USES_MOTIF
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 { /* XmPrimitiveClassPart
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 (XtWidgetProc) _XtInherit, /* border_highlight */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 (XtWidgetProc) _XtInherit, /* border_unhighlight */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 /* Setting the following to NULL causes PrimitiveInitialize()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 not to add traversal (TAB etc. to switch focus) and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 focus-in/out (border highlight/unhighlight) translations.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 If you want those translations, use the value XtInheritTranslations
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260 instead. Doing this, however, will interfere with Emacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 focus handling (which highlights/unhighlights the text cursor),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 and will lead to strange display results around the border of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263 widget. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 NULL, /* translations */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 NULL, /* arm_and_activate */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 NULL, /* get resources */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 0, /* num get_resources */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268 NULL, /* extension */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 },
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270 #endif /* LWLIB_USES_MOTIF */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 WidgetClass emacsFrameClass = (WidgetClass) &emacsFrameClassRec;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278 update_various_frame_slots (EmacsFrame ew)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 ew->emacs_frame.frame->pixheight = ew->core.height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 ew->emacs_frame.frame->pixwidth = ew->core.width;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285 EmacsFrameInitialize (Widget request, Widget new,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 ArgList dum1, Cardinal *dum2)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 EmacsFrame ew = (EmacsFrame)new;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 struct frame *f = ew->emacs_frame.frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 if (!f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 fatal ("can't create an emacs frame widget without a frame.");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 ew->emacs_frame.frame->internal_border_width =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 ew->emacs_frame.internal_border_width;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 void emacs_Xt_event_handler (Widget wid /* unused */,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299 XtPointer closure /* unused */,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300 XEvent *event,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301 Boolean *continue_to_dispatch /* unused */);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 EmacsFrameRealize (Widget widget, XtValueMask *mask,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 XSetWindowAttributes *attrs)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307 EmacsFrame ew = (EmacsFrame) widget;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308 struct frame *f = ew->emacs_frame.frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309 Widget shell_widget = FRAME_X_SHELL_WIDGET (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 attrs->event_mask =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 ExposureMask |
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 VisibilityChangeMask |
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 PropertyChangeMask |
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315 StructureNotifyMask |
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316 SubstructureNotifyMask |
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 /*SubstructureRedirectMask |*/ /* Only for WMs! */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 KeyPressMask |
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 KeyReleaseMask |
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320 ButtonPressMask |
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321 ButtonReleaseMask |
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 FocusChangeMask |
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323 PointerMotionHintMask |
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 PointerMotionMask |
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 LeaveWindowMask |
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 EnterWindowMask;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329 *mask |= CWEventMask;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331 if (ew->emacs_frame.use_backing_store)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
332 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333 attrs->backing_store = Always;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
334 *mask |= CWBackingStore;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
335 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
336 XtCreateWindow (widget, InputOutput, (Visual *)CopyFromParent, *mask,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
337 attrs);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
338
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339 /* snarf the events we want. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340 XtInsertEventHandler (widget, attrs->event_mask, TRUE,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
341 emacs_Xt_event_handler, NULL, XtListHead);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
342 /* some events (e.g. map-notify and WM_DELETE_WINDOW) get sent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343 directly to the shell, and the above event handler won't see
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
344 them. So add a handler to get them. These events don't
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
345 propagate, so there's no danger of them being seen twice. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346 XtInsertEventHandler (shell_widget,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347 EnterWindowMask | LeaveWindowMask |
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348 VisibilityChangeMask | StructureNotifyMask |
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349 KeyPressMask,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
350 TRUE, emacs_Xt_event_handler, NULL, XtListHead);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
351
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352 #ifdef EXTERNAL_WIDGET
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353 /* #### Not sure if this special case is necessary */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354 if (!FRAME_X_EXTERNAL_WINDOW_P (f))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356 /* This is necessary under Motif in order to make it possible to click in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357 a buffer and move focus out of a dialog box or control panel and back
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
358 into emacs-land; also necessary so that you can still type chars
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 if the cursor is over the menubar or scrollbar. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360 lw_set_keyboard_focus (shell_widget, FRAME_X_TEXT_WIDGET (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363 /* DO NOT CALL THIS FUNCTION! Only Xt is supposed to do this. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366 EmacsFrameResize (Widget widget)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368 EmacsFrame ew = (EmacsFrame)widget;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
369 struct frame *f = ew->emacs_frame.frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370 int columns;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371 int rows;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372 XtWidgetGeometry req, repl;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374 update_various_frame_slots (ew);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376 pixel_to_char_size (f, ew->core.width, ew->core.height, &columns, &rows);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377 change_frame_size (f, rows, columns, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379 /* Now we tell the EmacsShell that we've changed the size of the non-fixed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 portion of the frame. Note that, if we the resize occurred as a result
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381 of EmacsFrameSetCharSize(), this information will be stored twice.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
382 This is not a big deal, as storing this information doesn't actually
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
383 do anything until the next resize. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
384 if (FRAME_X_TOP_LEVEL_FRAME_P (f))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
385 x_wm_set_variable_size (FRAME_X_SHELL_WIDGET (f), columns, rows);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
386
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
387 /* Kick the manager so that it knows we've changed size. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
388 req.request_mode = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
389 XtQueryGeometry (FRAME_X_CONTAINER_WIDGET (f), &req, &repl);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
390 EmacsManagerChangeSize (FRAME_X_CONTAINER_WIDGET (f), repl.width,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
391 repl.height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
392 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
393
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
394 static Boolean
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
395 EmacsFrameSetValues (Widget cur_widget, Widget req_widget, Widget new_widget,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
396 ArgList argv, Cardinal *argc)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
397 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
398 EmacsFrame cur = (EmacsFrame) cur_widget;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
399 EmacsFrame new = (EmacsFrame) new_widget;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
400 struct frame *f = new->emacs_frame.frame;
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
401 Lisp_Object frame = wrap_frame (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
402 in_resource_setting++;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
403 /* This function does not need to do much. Pretty much everything
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
404 interesting will get done in the resize method, which will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
405 (if necessary) get called by Xt when this function returns
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
406 (see below).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
407 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
408
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
409 /* #### This function will not work if it is not called from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
410 update_EmacsFrame(), called from SET_FACE_PROPERTY().
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
411 The code located there should be moved inside of here instead,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
412 so that things work if either SET_FACE_PROPERTY() is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
413 called or XtSetValues() is called.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
414 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
415
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
416 if (cur->emacs_frame.iconic != new->emacs_frame.iconic &&
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
417 FRAME_X_TOP_LEVEL_FRAME_P (new->emacs_frame.frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
418 x_wm_set_shell_iconic_p (FRAME_X_SHELL_WIDGET (new->emacs_frame.frame),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
419 new->emacs_frame.iconic);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
420
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
421 /* If we got here, then we were likely called as a result of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
422 the EditRes protocol, so go ahead and change scrollbar-width
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
423 and scrollbar-height. Otherwise, we're merely mirroring
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
424 a change made to scrollbar-width etc. so don't do anything
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
425 special. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
426 if (cur->emacs_frame.internal_border_width !=
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
427 new->emacs_frame.internal_border_width)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
428 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
429 f->internal_border_width = new->emacs_frame.internal_border_width;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
430 MARK_FRAME_SIZE_SLIPPED (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
431 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
432
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
433 #ifdef HAVE_SCROLLBARS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
434 if (cur->emacs_frame.scrollbar_width !=
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
435 new->emacs_frame.scrollbar_width)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
436 Fadd_spec_to_specifier
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
437 (Vscrollbar_width,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
438 make_int (new->emacs_frame.scrollbar_width),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
439 frame, Qnil, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
440 if (cur->emacs_frame.scrollbar_height !=
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
441 new->emacs_frame.scrollbar_height)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
442 Fadd_spec_to_specifier
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
443 (Vscrollbar_height,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
444 make_int (new->emacs_frame.scrollbar_height),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
445 frame, Qnil, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
446 #endif /* HAVE_SCROLLBARS */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
447 #ifdef HAVE_TOOLBARS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
448 if (cur->emacs_frame.top_toolbar_height !=
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
449 new->emacs_frame.top_toolbar_height)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
450 Fadd_spec_to_specifier
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
451 (Vtoolbar_size[TOP_TOOLBAR],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
452 make_int (new->emacs_frame.top_toolbar_height),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
453 frame, Qnil, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
454 if (cur->emacs_frame.bottom_toolbar_height !=
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
455 new->emacs_frame.bottom_toolbar_height)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
456 Fadd_spec_to_specifier
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
457 (Vtoolbar_size[BOTTOM_TOOLBAR],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
458 make_int (new->emacs_frame.bottom_toolbar_height),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
459 frame, Qnil, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
460 if (cur->emacs_frame.left_toolbar_width !=
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
461 new->emacs_frame.left_toolbar_width)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
462 Fadd_spec_to_specifier
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
463 (Vtoolbar_size[LEFT_TOOLBAR],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
464 make_int (new->emacs_frame.left_toolbar_width),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
465 frame, Qnil, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
466 if (cur->emacs_frame.right_toolbar_width !=
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
467 new->emacs_frame.right_toolbar_width)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
468 Fadd_spec_to_specifier
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
469 (Vtoolbar_size[RIGHT_TOOLBAR],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
470 make_int (new->emacs_frame.right_toolbar_width),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
471 frame, Qnil, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
472 if (cur->emacs_frame.top_toolbar_border_width !=
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
473 new->emacs_frame.top_toolbar_border_width)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
474 Fadd_spec_to_specifier
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
475 (Vtoolbar_border_width[TOP_TOOLBAR],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
476 make_int (new->emacs_frame.top_toolbar_border_width),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
477 frame, Qnil, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
478 if (cur->emacs_frame.bottom_toolbar_border_width !=
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
479 new->emacs_frame.bottom_toolbar_border_width)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
480 Fadd_spec_to_specifier
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
481 (Vtoolbar_border_width[BOTTOM_TOOLBAR],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
482 make_int (new->emacs_frame.bottom_toolbar_border_width),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
483 frame, Qnil, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
484 if (cur->emacs_frame.left_toolbar_border_width !=
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
485 new->emacs_frame.left_toolbar_border_width)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
486 Fadd_spec_to_specifier
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
487 (Vtoolbar_border_width[LEFT_TOOLBAR],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
488 make_int (new->emacs_frame.left_toolbar_border_width),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
489 frame, Qnil, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
490 if (cur->emacs_frame.right_toolbar_border_width !=
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
491 new->emacs_frame.right_toolbar_border_width)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
492 Fadd_spec_to_specifier
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
493 (Vtoolbar_border_width[RIGHT_TOOLBAR],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
494 make_int (new->emacs_frame.right_toolbar_border_width),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
495 frame, Qnil, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
496 #endif /* HAVE_TOOLBARS */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
497
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
498 in_resource_setting--;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
499
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
500 /* If the request was to resize us, but the size has not changed, Xt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
501 will do nothing, and won't call our resize callback. Since such a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
502 request might be issued as a result of hiding/showing menubar or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
503 changing toolbar placement, where we rely on relayout made by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
504 callback, we go ahead and simulate such a call */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
505 if (cur->core.width == new->core.width
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
506 && cur->core.height == new->core.height)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
507 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
508 int i;
647
b39c14581166 [xemacs-hg @ 2001-08-13 04:45:47 by ben]
ben
parents: 440
diff changeset
509 for (i = 0; i < (int) *argc; i++)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
510 if (strcmp (argv[i].name, XtNwidth) == 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
511 || strcmp (argv[i].name, XtNheight) == 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
512 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
513 EmacsFrameResize (new_widget);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
514 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
515 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
516 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
517
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
518 return False;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
519
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
520 /* Note that if either (a) we return True, or (b) the width or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
521 height has changed, an Expose event will be generated. The Xt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
522 manual says you should not return True if the width or height has
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
523 changed, because then two Expose events will be generated.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
524
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
525 In any case, there is no need to return True because
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
526 SET_FACE_PROPERTY(), which does the resource
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
527 setting, automatically forces a redisplay as necessary. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
528 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
529
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
530 static XtGeometryResult
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
531 EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
532 XtWidgetGeometry *result)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
533 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
534 EmacsFrame ew = (EmacsFrame) widget;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
535 int mask = request->request_mode;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
536 Dimension width, height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
537 int ok_width_int, ok_height_int;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
538 Dimension ok_width, ok_height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
539
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
540 /* We have a definite preference for what size we would like
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
541 to be.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
542
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
543 1) If a preferred size was specified for us, use it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
544 (This is not currently used)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
545 2) If a proposed size was given, round it to the nearest
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
546 multiple of the default char size and return it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
547 3) Otherwise, take our current size and round it to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
548 nearest multiple of the default char size. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
549
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
550 width = mask & CWWidth ? request->width : ew->core.width;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
551 height = mask & CWHeight ? request->height : ew->core.height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
552 round_size_to_char (ew->emacs_frame.frame, width, height,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
553 &ok_width_int, &ok_height_int);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
554 ok_width = (Dimension) ok_width_int;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
555 ok_height = (Dimension) ok_height_int;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
556 if (ew->emacs_frame.preferred_width)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
557 ok_width = ew->emacs_frame.preferred_width;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
558 if (ew->emacs_frame.preferred_height)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
559 ok_height = ew->emacs_frame.preferred_height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
560 result->request_mode |= CWWidth | CWHeight;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
561 result->width = ok_width;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
562 result->height = ok_height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
563 if (((mask & CWWidth) && ok_width != request->width)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
564 || ((mask & CWHeight) && ok_height != request->height))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
565 return XtGeometryAlmost;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
566 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
567 return XtGeometryYes;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
568 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
569
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
570 /* Xt string-to-scrollbar-placement converter */
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
571 /* #### Convert this to a `new-style' converter (See XtAddTypeConverter) */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
572
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
573 /* This variable cannot be a stack variable. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
574 static unsigned char cvt_string_scrollbar_placement;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
575
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
576 /* ARGSUSED */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
577 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
578 Xt_StringToScrollBarPlacement (XrmValuePtr args, /* unused */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
579 Cardinal *num_args, /* unused */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
580 XrmValuePtr fromVal,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
581 XrmValuePtr toVal)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
582 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
583 XrmQuark q;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
584 char *lowerName = (char *) alloca (strlen ((char *) fromVal->addr) + 1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
585
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
586 XmuCopyISOLatin1Lowered (lowerName, (char *) fromVal->addr);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
587 q = XrmStringToQuark (lowerName);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
588
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
589 toVal->size = sizeof (cvt_string_scrollbar_placement);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
590 toVal->addr = (XPointer) &cvt_string_scrollbar_placement;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
591
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
592 if (q == XrmStringToQuark ("top-left")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
593 || q == XrmStringToQuark ("top_left"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
594 cvt_string_scrollbar_placement = XtTOP_LEFT;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
595 else if (q == XrmStringToQuark ("bottom-left")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
596 || q == XrmStringToQuark ("bottom_left"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
597 cvt_string_scrollbar_placement = XtBOTTOM_LEFT;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
598 else if (q == XrmStringToQuark ("top-right")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
599 || q == XrmStringToQuark ("top_right"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
600 cvt_string_scrollbar_placement = XtTOP_RIGHT;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
601 else if (q == XrmStringToQuark ("bottom-right")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
602 || q == XrmStringToQuark ("bottom_right"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
603 cvt_string_scrollbar_placement = XtBOTTOM_RIGHT;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
604 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
605 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
606 XtStringConversionWarning (fromVal->addr, "scrollBarPlacement");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
607 toVal->addr = NULL;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
608 toVal->size = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
609 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
610 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
611
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
612 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
613 EmacsFrameClassInitialize (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
614 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
615 XtAddConverter (XtRString, XtRScrollBarPlacement,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
616 Xt_StringToScrollBarPlacement, NULL, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
617 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
618
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
619 /********************* Special entrypoints *******************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
620
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
621 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
622 EmacsFrameRecomputeCellSize (Widget w)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
623 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
624 EmacsFrame ew = (EmacsFrame) w;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
625 int cw, ch;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
626 struct frame *f = ew->emacs_frame.frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
627
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
628 if (! XtIsSubclass (w, emacsFrameClass))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
629 abort ();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
630
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 647
diff changeset
631 default_face_height_and_width (wrap_frame (f), &ch, &cw);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
632 if (FRAME_X_TOP_LEVEL_FRAME_P (f))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
633 x_wm_set_cell_size (FRAME_X_SHELL_WIDGET (f), cw, ch);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
634 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
635
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
636 /* Set the size of the widget to have the number of rows and columns
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
637 specified. This both causes the X window to change and the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
638 internal frame structures to get modified to match. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
639
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
640 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
641 EmacsFrameSetCharSize (Widget widget, int columns, int rows)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
642 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
643 EmacsFrame ew = (EmacsFrame) widget;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
644 int pixel_width, pixel_height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
645 struct frame *f = ew->emacs_frame.frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
646
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
647 if (columns < 3)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
648 columns = 3; /* no way buddy */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
649 if (rows < 1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
650 rows = 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
651
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
652 char_to_pixel_size (f, columns, rows, &pixel_width, &pixel_height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
653
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
654 if (FRAME_X_TOP_LEVEL_FRAME_P (f))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
655 x_wm_set_variable_size (FRAME_X_SHELL_WIDGET (f), columns, rows);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
656
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
657 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
658 Arg al [2];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
659 XtSetArg (al [0], XtNwidth, pixel_width);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
660 XtSetArg (al [1], XtNheight, pixel_height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
661 XtSetValues ((Widget) ew, al, countof (al));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
662 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
663 }