Mercurial > hg > xemacs-beta
changeset 872:79c6ff3eef26
[xemacs-hg @ 2002-06-20 21:18:01 by ben]
font changes etc.; some 21.4 changes
mule/mule-msw-init-late.el: Specify charset->windows-registry conversion.
mule/mule-x-init.el: Delete extra mule font additions here. Put them in faces.c.
cl-macs.el: Document better.
font-lock.el: Move Lisp function regexp to lisp-mode.el.
lisp-mode.el: Various indentation fixes:
Handle flet functions better.
Handle argument lists in defuns and flets.
Handle quoted lists, e.g. property lists -- don't indent like
function calls. Distinguish between lambdas and other lists.
lisp-mode.el: Handle this form.
faces.el, font-menu.el, font.el, gtk-faces.el, msw-faces.el, msw-font-menu.el, x-faces.el, x-init.el: Major overhaul of face-handling code:
-- Fix lots of bogus code in msw-faces.el, msw-font-menu.el,
font-menu.el that was "truenaming" font specs -- i.e. in the
process of frobbing a particular field in a general user-specified
font spec with wildcarded fields, sticking in particular values
for all the remaining wildcarded fields. This bug was rampant
everywhere except in x-faces.el (the oldest and only correctly
written code). This also means that we need to work with font
names at all times and not font instances, because a font instance
is essentially a truenamed font.
-- Total rewrite of extremely junky code in msw-faces.el. Work
with names as well as font instances, and return names; stop
truenaming when canonicalizing and frobbing; fix handling of the
combined style field, i.e. weight/slant (also fixed in font.el).
-- Totally rewrite the frobbing functions in faces.el. This time,
we frob all the instantiators rather than just computing a single
instance value and working backwards. That way, e.g., `bold' will
work for all charsets that have bold available, rather than only
for whatever charset was part of the computed font instance
(another example of the truename virus). Also fix up code to look
at the fallbacks (all of them) when no global value present, so we
don't need to put something in the global value. Intelligently
handle a request to frob a buffer locale, rather than signalling
an error. When frobbing instantiators, try hard to figure out
what device type is associated with them, and frob each according
to its own proper device type. Correctly handle inheritance
vectors given as instantiators. Preserve existing tags when
putting back frobbed instantiators. Extract out general
specifier-frobbing code into specifier.el. Document everything
cleanly. Do lots of other things better, etc.
-- Don't duplicatively set a global specification for the default
font -- it's already in the fallback and we no longer need a
default global specification present. Delete various code in
x-faces.el and msw-faces.el that duplicated the lists of fonts in
faces.c.
-- init-global-faces was not being called at all under MS Windows!
Major bogosity. That caused device-specific values to get stuck
into all the fonts, making it very hard to change them -- setting
global specs caused nothing to happen.
-- Correct weight names in font.el.
-- Lots more font fixups in objects*.c.
Printer.el: Warning fix.
specifier.el: Add more args to map-specifier.
Add various "heuristic" specifier functions to aid in creation of
specifier-munging code such as in faces.el.
subr.el: New functions.
lwlib.c: Fix warning.
config.inc.samp: Clean up, add args to control fastcall (not yet supported! the
changes needed are in another ws of mine), profile support, vc6
support, union-type.
xemacs.dsp, xemacs.mak: Semi-major overhaul.
Fix bug where dump-id was always getting recomputed, forcing a
redump even when nothing changed.
Add support for fastcall. Support edit-and-continue (on by
default) with vc6. Use incremental linking when doing a debug
compilation. Add support for profiling.
Consolidate the various debug flags.
Partial support for "batch-compiling" -- compiling many files on a
single invocation of the compiler. Doesn't seem to help that much
for me, so it's not finished or enabled by default.
Remove HAVE_MSW_C_DIRED, we always do.
Correct some sloppy use of directories.
s/cygwin32.h: Allow pdump to work under Cygwin (mmap is broken, so need to undefine
HAVE_MMAP).
s/win32-common.h, s/windowsnt.h: Support for fastcall. Add WIN32_ANY for identifying all Win32
variants (Cygwin, native, MinGW). Both of these are properly used
in another ws.
alloc.c, balloon-x.c, buffer.c, bytecode.c, callint.c, cm.c, cmdloop.c, cmds.c, console-gtk.c, console-gtk.h, console-msw.c, console-msw.h, console-stream.c, console-stream.h, console-tty.c, console-tty.h, console-x.c, console-x.h, console.c, console.h, device-gtk.c, device-msw.c, device-tty.c, device-x.c, device.c, device.h, devslots.h, dialog-gtk.c, dialog-msw.c, dialog-x.c, dialog.c, dired-msw.c, editfns.c, emacs.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, event-tty.c, event-unixoid.c, events.c, extents.c, extents.h, faces.c, fileio.c, fns.c, frame-gtk.c, frame-msw.c, frame-tty.c, frame-x.c, frame.c, frame.h, glyphs-eimage.c, glyphs-gtk.c, glyphs-msw.c, glyphs-widget.c, glyphs-x.c, glyphs.c, glyphs.h, gui-gtk.c, gui-msw.c, gui-x.c, gui.c, gutter.c, input-method-xlib.c, intl-encap-win32.c, intl-win32.c, keymap.c, lisp.h, macros.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, menubar.c, menubar.h, minibuf.c, mule-charset.c, nt.c, objects-gtk.c, objects-gtk.h, objects-msw.c, objects-msw.h, objects-tty.c, objects-tty.h, objects-x.c, objects-x.h, objects.c, objects.h, postgresql.c, print.c, process.h, redisplay-gtk.c, redisplay-msw.c, redisplay-output.c, redisplay-tty.c, redisplay-x.c, redisplay.c, redisplay.h, scrollbar-gtk.c, scrollbar-msw.c, scrollbar-x.c, scrollbar.c, select-gtk.c, select-msw.c, select-x.c, select.c, signal.c, sound.c, specifier.c, symbols.c, syntax.c, sysdep.c, syssignal.h, syswindows.h, toolbar-common.c, toolbar-gtk.c, toolbar-msw.c, toolbar-x.c, toolbar.c, unicode.c, window.c, window.h: The following are the major changes made:
(1) Separation of various header files into an external and an
internal version, similar to the existing separation of process.h
and procimpl.h. Eventually this should be done for all Lisp
objects. The external version has the same name as currently; the
internal adds -impl. The external file has XFOO() macros for
objects, but the structure is opaque and defined only in the
internal file. It's now reasonable to move all prototypes in
lisp.h into the appropriate external file, and this should be
done. Currently, separation has been done on extents.h,
objects*.h, console.h, device.h, frame.h, and window.h.
For c/d/f/w, the most basic properties are available in the
external header file, with the macros resolving to functions. In
the internal header file, the macros are redefined to directly
access the structure. Also, the global MARK_FOO_CHANGED macros
have been made into functions so that they can be accessed without
needing to include lots of -impl headers -- they are used in
almost exclusively in non-time-critical functions, and take up
enough time that the function overhead will be negligible.
Similarly, the function overhead from making the basic properties
mentioned above into functions is negligible, and code that does
heavy accessing of c/d/f/w structures inevitably ends up needing
the internal header files, anyway.
(2) More face changes.
-- Major rewrite of objects-msw.c. Now handles wildcard specs
properly, rather than "truenaming" (or even worse, signalling an
error, which previously happened with some of the fallbacks if you
tried to use them in make-font-instance!).
-- Split charset matching of fonts into two stages -- one to find
a font specifically designed for a particular charset (by
examining its registry), the second to find a Unicode font that
can support the charset. This needs to proceed as two complete,
separate instantiations in order to work properly (otherwise many
of the fonts in the HELLO page look wrong). This should also make
it easy to support iso10646 (Unicode) fonts under X.
-- All default values for fonts are now completely specified in
the fallbacks. Stuff from mule-x-init.el has all been moved here,
merged with the existing specs, and totally rethought so you get
sensible results. (HELLO now looks much better!).
-- Generalize the "default X/GTK device" stuff into a
per-device-type "default device".
-- Add mswindows-{set-}charset-registry. In time,
charset<->code-page conversion functions will be removed.
-- Wrap protective code around calls to compute device specifier tags,
and do this computation before calling the face initialization code
because the latter may need these tags to be correctly updated.
(3) Other changes.
EmacsFrame.c, glyphs-msw.c, eval.c, gui-x.c, intl-encap-win32.c, search.c, signal.c, toolbar-msw.c, unicode.c: Warning fixes.
config.h.in: #undefs meant to be frobbed by configure *MUST* go inside of
#ifndef WIN32_NO_CONFIGURE, and everything else *MUST* go outside!
eval.c: Let detailed backtraces be detailed.
specifier.c: Don't override user's print-string-length/print-length settings.
glyphs.c: New function image-instance-instantiator.
config.h.in, sysdep.c: Changes for fastcall.
sysdep.c, nt.c: Fix up a previous botched patch that tried to add support for both
EEXIST and EACCES. IF THE BOTCHED PATCH WENT INTO 21.4, THIS FIXUP
NEEDS TO GO IN, TOO.
search.c: Fix *evil* crash due to incorrect synching of syntax-cache code
with 21.1. THIS SHOULD GO INTO 21.4.
line wrap: on
line diff
--- a/lisp/ChangeLog Tue Jun 11 19:28:22 2002 +0000 +++ b/lisp/ChangeLog Thu Jun 20 21:19:10 2002 +0000 @@ -1,3 +1,188 @@ +2002-06-20 Ben Wing <ben@xemacs.org> + + * mule/mule-msw-init-late.el: + Specify charset->windows-registry conversion. + + * mule/mule-x-init.el: + * mule/mule-x-init.el (x-use-halfwidth-roman-font): + * mule/mule-x-init.el (init-mule-x-win): + Delete extra mule font additions here. Put them in faces.c. + +2002-06-20 Ben Wing <ben@xemacs.org> + + * cl-macs.el (defun*): + * cl-macs.el (defmacro*): + * cl-macs.el (destructuring-bind): + Document better. + + * font-lock.el (lisp-font-lock-keywords-1): + Move Lisp function regexp to lisp-mode.el. + + * lisp-mode.el: + * lisp-mode.el (lisp-function-and-type-regexp): New. + * lisp-mode.el (lisp-flet-regexp): New. + * lisp-mode.el (lisp-indent-function): + * lisp-mode.el (lisp-indent-quoteform): New. + Various indentation fixes: + + Handle flet functions better. + Handle argument lists in defuns and flets. + Handle quoted lists, e.g. property lists -- don't indent like + function calls. Distinguish between lambdas and other lists. + + * lisp-mode.el (save-selected-device): Handle this form. + + * faces.el: + * faces.el (face-property-instance): + * faces.el (face-property-matching-instance): + * faces.el (set-face-property): + * faces.el (set-face-display-table): + * faces.el (set-face-underline-p): + * faces.el (set-face-strikethru-p): + * faces.el (set-face-highlight-p): + * faces.el (set-face-blinking-p): + * faces.el (face-equal): + * faces.el (try-font-name): + * faces.el (face-frob-from-locale-first): New. + * faces.el (frob-face-property): Removed. + * faces.el (included): Removed. + * faces.el (frob-face-property-1): Removed. + * faces.el (frob-face-font-2): Removed. + * faces.el (Face-frob-property-device-considered-current): New. + * faces.el (Face-frob-property): New. + * faces.el (make-face-family): + * faces.el (make-face-bold): + * faces.el (make-face-italic): + * faces.el (NOTE): New. + * faces.el (functions): New. + * faces.el (make-face-bold-italic): + * faces.el (make-face-unbold): + * faces.el (make-face-unitalic): + * faces.el (make-face-size): + * faces.el (make-face-smaller): + * faces.el (make-face-larger): + * faces.el (get-frame-background-mode): + * faces.el (init-global-faces): + * font-menu.el: + * font-menu.el (font-menu-set-font): + * font-menu.el (font-menu-change-face): + * font.el: + * font.el (mswindows-font-weight-mappings): + * font.el (font-mswindows-font-regexp): Removed. + * font.el (mswindows-font-create-object): + * font.el (mswindows-font-create-name): + * gtk-faces.el (gtk-init-global-faces): + * msw-faces.el: + * msw-faces.el (mswindows-init-device-faces): + * msw-faces.el (mswindows-font-regexp): Removed. + * msw-faces.el (mswindows-font-canonicalize-name): Removed. + * msw-faces.el (mswindows-canonicalize-font-name): New. + * msw-faces.el (mswindows-parse-font-style): New. + * msw-faces.el (mswindows-construct-font-style): New. + * msw-faces.el (mswindows-frob-font-style): New. + * msw-faces.el (mswindows-frob-font-style-and-sizify): New. + * msw-faces.el (mswindows-nonbold-weight-regexp): New. + * msw-faces.el (mswindows-make-font-unbold): + * msw-faces.el (mswindows-bold-weight-regexp): New. + * msw-faces.el (mswindows-make-font-italic): + * msw-faces.el (mswindows-make-font-bold-mapper): New. + * msw-faces.el (mswindows-make-font-unitalic): + * msw-faces.el (mswindows-make-font-nonbold-mapper): New. + * msw-faces.el (mswindows-make-font-italic-mapper): New. + * msw-faces.el (mswindows-make-font-bold-italic): + * msw-faces.el (mswindows-make-font-unitalic-mapper): New. + * msw-faces.el (mswindows-make-font-bold-italic-mapper): New. + * msw-faces.el (mswindows-find-smaller-font): + * msw-faces.el (mswindows-find-larger-font): + * msw-faces.el (mswindows-available-font-sizes): New. + * msw-faces.el (mswindows-frob-font-size): New. + * msw-font-menu.el: + * msw-font-menu.el (mswindows-font-menu-junk-families): + * msw-font-menu.el (mswindows-font-menu-registry-encoding): Removed. + * msw-font-menu.el (mswindows-reset-device-font-menus): + * msw-font-menu.el (mswindows-font-menu-font-data): + * msw-font-menu.el (mswindows-font-menu-load-font): + * x-faces.el: + * x-faces.el (x-init-global-faces): + * x-faces.el (x-init-device-faces): + * x-init.el (init-x-win): + * x-init.el (init-post-x-win): + + Major overhaul of face-handling code: + + -- Fix lots of bogus code in msw-faces.el, msw-font-menu.el, + font-menu.el that was "truenaming" font specs -- i.e. in the + process of frobbing a particular field in a general user-specified + font spec with wildcarded fields, sticking in particular values + for all the remaining wildcarded fields. This bug was rampant + everywhere except in x-faces.el (the oldest and only correctly + written code). This also means that we need to work with font + names at all times and not font instances, because a font instance + is essentially a truenamed font. + + -- Total rewrite of extremely junky code in msw-faces.el. Work + with names as well as font instances, and return names; stop + truenaming when canonicalizing and frobbing; fix handling of the + combined style field, i.e. weight/slant (also fixed in font.el). + + -- Totally rewrite the frobbing functions in faces.el. This time, + we frob all the instantiators rather than just computing a single + instance value and working backwards. That way, e.g., `bold' will + work for all charsets that have bold available, rather than only + for whatever charset was part of the computed font instance + (another example of the truename virus). Also fix up code to look + at the fallbacks (all of them) when no global value present, so we + don't need to put something in the global value. Intelligently + handle a request to frob a buffer locale, rather than signalling + an error. When frobbing instantiators, try hard to figure out + what device type is associated with them, and frob each according + to its own proper device type. Correctly handle inheritance + vectors given as instantiators. Preserve existing tags when + putting back frobbed instantiators. Extract out general + specifier-frobbing code into specifier.el. Document everything + cleanly. Do lots of other things better, etc. + + -- Don't duplicatively set a global specification for the default + font -- it's already in the fallback and we no longer need a + default global specification present. Delete various code in + x-faces.el and msw-faces.el that duplicated the lists of fonts in + faces.c. + + -- init-global-faces was not being called at all under MS Windows! + Major bogosity. That caused device-specific values to get stuck + into all the fonts, making it very hard to change them -- setting + global specs caused nothing to happen. + + -- Correct weight names in font.el. + + -- Lots more font fixups in objects*.c. + + * Printer.el (generic-print-region): + Warning fix. + + * specifier.el: + * specifier.el (map-specifier): + * specifier.el (modify-specifier-instances): + * specifier.el (instance-to-instantiator): New. + * specifier.el (device-type-matches-spec): New. + * specifier.el (add-tag-to-inst-list): New. + * specifier.el (derive-domain-from-locale): New. + * specifier.el (derive-device-type-from-tag-set): New. + * specifier.el (Specifically): New. + * specifier.el (derive-device-type-from-locale-and-tag-set): New. + * specifier.el (derive-specifier-specs-from-locale): New. + Add more args to map-specifier. + + Add various "heuristic" specifier functions to aid in creation of + specifier-munging code such as in faces.el. + + * subr.el: + * subr.el (args-out-of-range): New. + * subr.el (argument-in-range-p): New. + * subr.el (check-argument-range): New. + New functions. + + 2002-06-04 Andy Piper <andy@xemacs.org> * startup.el (normal-top-level): Fix bad merge.
--- a/lisp/cl-macs.el Tue Jun 11 19:28:22 2002 +0000 +++ b/lisp/cl-macs.el Thu Jun 20 21:19:10 2002 +0000 @@ -113,7 +113,31 @@ (defmacro defun* (name args &rest body) "(defun* NAME ARGLIST [DOCSTRING] BODY...): define NAME as a function. Like normal `defun', except ARGLIST allows full Common Lisp conventions, -and BODY is implicitly surrounded by (block NAME ...)." +and BODY is implicitly surrounded by (block NAME ...). + +\"Full Common Lisp conventions\" means that: + +-- In addition to &optional and &rest, the lambda-list keywords &key, + &allow-other-keys, and &aux are allowed. + +-- The format of the arguments to &optional is expanded: As well as simple + variables, they can be lists of the form (VAR [INITFORM [SVAR]]); when + no argument is available for VAR, INITFORM is evaluated (or nil, if + INITFORM is omitted) and stored as VAR's value, and SVAR is bound to t. + If an arguent is available for VAR, and INITFORM is unused, SVAR is + bound to nil. + +-- &key specifies keyword arguments. The format of each argument is + VAR || ( { VAR || (KEYWORD VAR) } [INITFORM [SVAR]]) -- #### document me. + +-- &allow-other-keys means that if other keyword arguments are given that are + not specifically list in the arg list, they are allowed, rather than an + error being signalled. They can be retrieved with an &rest form. + +-- &aux specifies extra bindings, exactly like a `let*' enclosing the body. + The format of each binding is VAR || (VAR [INITFORM]) -- exactly like the + format of `let'/`let*' bindings. +" (let* ((res (cl-transform-lambda (cons args body) name)) (form (list* 'defun name (cdr res)))) (if (car res) (list 'progn (car res) form) form))) @@ -122,7 +146,43 @@ (defmacro defmacro* (name args &rest body) "(defmacro* NAME ARGLIST [DOCSTRING] BODY...): define NAME as a macro. Like normal `defmacro', except ARGLIST allows full Common Lisp conventions, -and BODY is implicitly surrounded by (block NAME ...)." +and BODY is implicitly surrounded by (block NAME ...). + +\"Full Common Lisp conventions\" means that: + +-- The lambda-list keywords &optional, &rest, &key, &allow-other-keys, and + &aux are allowed, as in `defun*'. + +-- Three additional lambda-list keywords are allowed: &body, &whole, and + &environment. #### Document me. + +-- The macro arg list syntax allows for \"destructuring\" -- see also + `destructuring-bind', which destructures exactly like `defmacro*', and + `loop', which does a rather different way of destructuring. Anywhere + that a simple argument may appear, and (if following a lambda-list + keyword) a list may not normally appear, an embedded lambda list can be + substituted. (The format of the embedded lambda list is exactly the + same as for a top-level list except that &environment is not allowed.) + When matching this lambda list against a caller-specified argument, that + argument is treated as a list and normal lambda-list processing occurs, + just as if the entire operation were happening at top level. + Furthermore, any lambda list, embedded or top-level, can be dotted at its + end, and this will cause matching with an appropriate dotted list given + as an argument. + + See `loop' for practical examples of destructuring, but + keep in mind that `loop' destructuring is somewhat different from macro + destructuring in that + + (a) Macro destructuring has extra features in the various lambda-list + keywords, allowing for special processing of a list other than just + simple matching. + (b) Macro destructuring is strict, in that an error is signalled if the + actual structure does not match the expected structure. On the + other hand, loop destructuring is lax -- extra arguments in a list + are ignored, not enough arguments cause the remaining parameters to + receive a value of nil, etc. +" (let* ((res (cl-transform-lambda (cons args body) name)) (form (list* 'defmacro name (cdr res)))) (if (car res) (list 'progn (car res) form) form))) @@ -370,6 +430,26 @@ ;;;###autoload (defmacro destructuring-bind (args expr &rest body) + "Bind the arguments in ARGS to EXPR then eval BODY. +This is similar to `let' but it does \"destructuring\", in that it matches +the structure of ARGS to the structure of EXPR and binds corresponding +arguments in ARGS to their values in EXPR. The format of ARGS, and the +way the destructuring works, is exactly like the destructuring that occurs +in `defmacro*'; see that for more information. + +An alternative means of destructuring is using the `loop' macro. `loop' +gives practical examples of destructuring. `defmacro*' describes the +differences between loop and macro-style destructuring. + +You can rewrite a call to (destructuring-bind ARGS EXPR &rest BODY) using +`loop', approximately like this: + + (loop for ARGS = EXPR + return (progn BODY)) + +I say \"approximately\" because the destructuring works in a somewhat +different fashion, although for most reasonably simple constructs the +results will be the same." (let* ((bind-lets nil) (bind-forms nil) (bind-inits nil) (bind-defs nil) (bind-block 'cl-none)) (cl-do-arglist (or args '(&aux)) expr)
--- a/lisp/faces.el Tue Jun 11 19:28:22 2002 +0000 +++ b/lisp/faces.el Thu Jun 20 21:19:10 2002 +0000 @@ -2,7 +2,7 @@ ;; Copyright (C) 1992-4, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995 Board of Trustees, University of Illinois -;; Copyright (C) 1995, 1996 Ben Wing +;; Copyright (C) 1995, 1996, 2002 Ben Wing ;; Author: Ben Wing <ben@xemacs.org> ;; Keywords: faces, internal, dumped @@ -166,7 +166,7 @@ (put face property specifier))))) (defun face-property-instance (face property - &optional domain default no-fallback) + &optional domain default no-fallback) "Return the instance of FACE's PROPERTY in the specified DOMAIN. Under most circumstances, DOMAIN will be a particular window, @@ -216,8 +216,8 @@ value)) (defun face-property-matching-instance (face property matchspec - &optional domain default - no-fallback) + &optional domain default + no-fallback) "Return the instance of FACE's PROPERTY matching MATCHSPEC in DOMAIN. Currently the only useful value for MATCHSPEC is a charset, when used in conjunction with the face's font; this allows you to retrieve a @@ -231,12 +231,22 @@ (setq face (get-face face)) (let ((value (get face property))) (if (specifierp value) - (setq value (specifier-matching-instance value matchspec domain - default no-fallback))) + (setq value (if (or (charsetp matchspec) + (and (symbolp matchspec) + (find-charset matchspec))) + (or + (specifier-matching-instance + value (cons matchspec nil) domain default + no-fallback) + (specifier-matching-instance + value (cons matchspec t) domain default + no-fallback)) + (specifier-matching-instance value matchspec domain + default no-fallback)))) value)) (defun set-face-property (face property value &optional locale tag-set - how-to-add) + how-to-add) "Change a property of FACE. NOTE: If you want to remove a property from a face, use `remove-face-property' @@ -636,7 +646,7 @@ (face-property-instance face 'display-table domain default no-fallback)) (defun set-face-display-table (face display-table &optional locale tag-set - how-to-add) + how-to-add) "Change the display table of FACE to DISPLAY-TABLE in LOCALE. DISPLAY-TABLE should be a vector as returned by `make-display-table'. @@ -655,7 +665,7 @@ (face-property-instance face 'underline domain default no-fallback)) (defun set-face-underline-p (face underline-p &optional locale tag-set - how-to-add) + how-to-add) "Change the underline property of FACE to UNDERLINE-P. UNDERLINE-P is normally a face-boolean instantiator; see `make-face-boolean-specifier'. @@ -670,7 +680,7 @@ (face-property-instance face 'strikethru domain default no-fallback)) (defun set-face-strikethru-p (face strikethru-p &optional locale tag-set - how-to-add) + how-to-add) "Change whether FACE is strikethru-d (i.e. struck through) in LOCALE. STRIKETHRU-P is normally a face-boolean instantiator; see `make-face-boolean-specifier'. @@ -685,7 +695,7 @@ (face-property-instance face 'highlight domain default no-fallback)) (defun set-face-highlight-p (face highlight-p &optional locale tag-set - how-to-add) + how-to-add) "Change whether FACE is highlighted in LOCALE (TTY locales only). HIGHLIGHT-P is normally a face-boolean instantiator; see `make-face-boolean-specifier'. @@ -714,7 +724,7 @@ (face-property-instance face 'blinking domain default no-fallback)) (defun set-face-blinking-p (face blinking-p &optional locale tag-set - how-to-add) + how-to-add) "Change whether FACE is blinking in LOCALE (TTY locales only). BLINKING-P is normally a face-boolean instantiator; see `make-face-boolean-specifier'. @@ -766,11 +776,7 @@ (and (face-equal-loop common-props face1 face2 domain) (cond ((eq 'tty (device-type device)) (face-equal-loop tty-props face1 face2 domain)) - ;; #### Why isn't this (console-on-window-system-p (device-console device))? - ;; #### FIXME! - ((or (eq 'x (device-type device)) - (eq 'gtk (device-type device)) - (eq 'mswindows (device-type device))) + ((console-on-window-system-p (device-console device)) (face-equal-loop win-props face1 face2 domain)) (t t))))) @@ -779,12 +785,19 @@ See `face-property-instance' for the semantics of the DOMAIN argument." (not (face-equal face 'default domain))) -; moved from x-faces.el (defun try-font-name (name &optional device) + "Return NAME if it's a valid font name on DEVICE, else nil." ;; yes, name really should be here twice. (and name (make-font-instance name device t) name)) + +(defcustom face-frob-from-locale-first nil + "*If non nil, use kludgy way of frobbing fonts suitable for non-mule +multi-charset environments." + :group 'faces + :type 'boolean) + ;; This function is a terrible, disgusting hack!!!! Need to ;; separate out the font elements as separate face properties! @@ -803,204 +816,263 @@ ;; WE DEMAND LEXICAL SCOPING!!! ;; WE DEMAND LEXICAL SCOPING!!! ;; WE DEMAND LEXICAL SCOPING!!! -(defun frob-face-property (face property func device-tags &optional -locale tags) - "Change the specifier for FACE's PROPERTY according to FUNC, in LOCALE. -This function is ugly and messy and is primarily used as an internal -helper function for `make-face-bold' et al., so you probably don't -want to use it or read the rest of the documentation. But if you do ... + +;; When we are initializing a device, it won't be selected; we communicate +;; the device to consider as selected using this variable. +(defvar Face-frob-property-device-considered-current nil) -FUNC should be a function of two arguments (an instance and a device) -that returns a modified name that is valid for the given device. -If LOCALE specifies a valid domain (i.e. a window, frame, or device), -this function instantiates the specifier over that domain, applies FUNC -to the resulting instance, and adds the result back as an instantiator -for that locale. Otherwise, LOCALE should be a locale, locale type, or -'all (defaults to 'all if omitted). For each specification thusly -included: if the locale given is a valid domain, FUNC will be -iterated over all valid instantiators for the device of the domain -until a non-nil result is found (if there is no such result, the -first valid instantiator is used), and that result substituted for -the specification; otherwise, the process just outlined is -iterated over each existing device and the concatenated results -substituted for the specification. +(defun Face-frob-property (face locale tag-set exact-p + unfrobbed-face frobbed-face + win-prop tty-props + frob-mapping standard-face-mapping) + ;; implement the semantics of `make-face-bold' et al. FACE, LOCALE, TAG-SET + ;; and EXACT-P are as in that call. UNFROBBED-FACE and FROBBED-FACE are + ;; what we expect the original face and the result to look like, + ;; respectively. TTY-PROPS is a list of face properties to frob in place + ;; of `font' for TTY's. FROB-MAPPING is either a plist mapping device + ;; types to functions of two args (NAME DEVICE) that will frob the + ;; instantiator as appropriate for the device type (this includes TTY's), + ;; or a function to handle the mapping for all device types. + ;; STANDARD-FACE-MAPPING is an alist of mappings of inheritance + ;; instantiators to be replaced with other inheritance instantiators, meant + ;; for e.g. converting [bold] into [bold-italic]. + + ;; #### it would be nice if this function could be generalized to be + ;; a general specifier frobber. but so much of what it does is specific + ;; to faces -- e.g. handling of inheritance, standard faces, + ;; special-casing in various ways for tty's, etc. i've already extracted + ;; as much of the functionality as i can into subfunctions in the + ;; heuristic section of specifier.el. -DEVICE-TAGS is a list of tags that each device must match in order for -the function to be called on it." - (let ((sp (face-property face property)) - temp-sp) - (if (valid-specifier-domain-p locale) - ;; this is easy. - (let* ((inst (face-property-instance face property locale)) - (name (and inst - (device-matches-specifier-tag-set-p - (dfw-device locale) device-tags) - (funcall func inst (dfw-device locale))))) - (when name - (add-spec-to-specifier sp name locale tags))) - ;; otherwise, map over all specifications ... - ;; but first, some further kludging: - ;; (1) if we're frobbing the global property, make sure - ;; that something is there (copy from the default face, - ;; if necessary). Otherwise, something like - ;; (make-face-larger 'modeline) - ;; won't do anything at all if the modeline simply - ;; inherits its font from 'default. - ;; (2) if we're frobbing a particular locale, nothing would - ;; happen if that locale has no instantiators. So signal - ;; an error to indicate this. + ;; #### Note: The old code was totally different (and there was much less + ;; of it). It didn't bother with trying to frob all the instantiators, + ;; or handle inheritance vectors as instantiators, or do something + ;; sensible with buffer locales, or many other things. (It always, or + ;; usually, did a specifier-instance and frobbed the result.) But it did + ;; do three things we don't: + ;; + ;; (1) Map over all devices when processing global or buffer locales. + ;; Should we be doing this in stages 2 and/or 3? The fact that we + ;; now process all fallback instantiators seems to make this less + ;; necessary, at least for global locales. + ;; + ;; (2) Remove all instantiators tagged with `default' when putting the + ;; instantiators back. I don't see why this is necessary, but maybe + ;; it is. + ;; + ;; (3) Pay attention to the face-frob-from-locale-first variable. #### + ;; I don't understand its purpose. Undocumented hacks like this, + ;; clearly added after-the-fact, don't deserve to live. DOCUMENT + ;; THIS SHIT! + (flet + ( + + ;; non-nil if either instantiator non-nil, or nil instantiators allowed. + (nil-instantiator-ok (inst devtype-spec) + (or inst (eq devtype-spec 'tty))) + + ;; if LOCALE is a global locale (all, nil, global), return 'global, + ;; else nil. + (global-locale (locale) + (and (memq locale '(all nil global)) 'global)) - (setq temp-sp (copy-specifier sp)) - (if (or (eq locale 'global) (eq locale 'all) (not locale)) - (when (not (specifier-specs temp-sp 'global)) - ;; Try fallback via the official ways and then do it "by hand" - (let* ((fallback (specifier-fallback sp)) - (fallback-sp - (cond ((specifierp fallback) fallback) - ;; just an inst list - (fallback - (make-specifier-and-init (specifier-type sp) - fallback)) - ((eq (get-face face) (get-face 'default)) - (error "Unable to find global specification")) - ;; If no fallback we snoop from default - (t (face-property 'default property))))) - (copy-specifier fallback-sp temp-sp 'global)))) - (if (and (valid-specifier-locale-p locale) - (not (specifier-specs temp-sp locale))) - (error "Property must have a specification in locale %S" locale)) - (map-specifier - temp-sp - (lambda (sp-arg locale inst-list func) - (let* ((device (dfw-device locale)) - ;; if a device can be derived from the locale, - ;; call frob-face-property-1 for that device. - ;; Otherwise map frob-face-property-1 over each device. - (result - (if device - (list (and (device-matches-specifier-tag-set-p - device device-tags) - (frob-face-property-1 sp-arg device inst-list - func))) - (mapcar (lambda (device) - (and (device-matches-specifier-tag-set-p - device device-tags) - (frob-face-property-1 sp-arg device - inst-list func))) - (device-list)))) - new-result) - ;; remove duplicates and nils from the obtained list of - ;; instantiators. Also add tags amd remove 'defaults'. - (mapcar (lambda (arg) - (when arg - (if (not (consp arg)) - (setq arg (cons tags arg)) - (setcar arg (append tags (delete 'default - (car arg)))))) - (when (and arg (not (member arg new-result))) - (setq new-result (cons arg new-result)))) - result) - ;; add back in. - (add-spec-list-to-specifier sp (list (cons locale new-result))) - ;; tell map-specifier to keep going. - nil)) - locale - func)))) + ;; Given a locale and the inst-list from that locale, frob the + ;; instantiators according to FROB-MAPPING, a plist mapping device + ;; types to functions that frob instantiators of that device type. + ;; NOTE: TAG-SET and FROB-MAPPING from environment. + (frob-face-inst-list (locale inst-list prop devtype-spec) + (let* ((ffpdev Face-frob-property-device-considered-current) + (results + ;; for each inst-pair, frob it (the result will be 0 or + ;; more inst-pairs; we may get more than one if, e.g. the + ;; instantiator specifies inheritance and we expand the + ;; inheritance); then nconc the results together + (loop for (tag-set . x) in inst-list + for devtype = (derive-device-type-from-locale-and-tag-set + locale tag-set devtype-spec ffpdev) + ;; devtype may be nil if it fails to match DEVTYPE-SPEC + if devtype + if (let* ((mapper (if (functionp frob-mapping) frob-mapping + (plist-get frob-mapping devtype))) + (result + (cond + ;; if a vector ... + ((vectorp x) + (let ((change-to + (cdr (assoc x standard-face-mapping)))) + (cond + ;; (1) handle standard mappings/null vectors + ((or change-to (null (length x))) + (list (cons tag-set + (cond ((eq change-to t) x) + (change-to) + (t x))))) + ;; (2) inheritance vectors. retrieve the + ;; inherited value and recursively frob. + ;; stick the tag-set into the result. + (t (let* + ((subprop + (if (> (length x) 1) (elt x 1) + prop)) + (subinsts + (frob-face-inst-list + locale + (cdar + (specifier-spec-list + (face-property (elt x 0) + subprop))) + subprop devtype-spec))) + ;; #### we don't currently handle + ;; the "reverse the sense" flag on + ;; tty inheritance vectors. + (add-tag-to-inst-list subinsts + tag-set)))))) + ;; (3) not a vector. just process it. + (t + (let ((value + (if (eq devtype-spec 'tty) + (funcall mapper x) + (funcall mapper x + (derive-domain-from-locale + locale devtype-spec + ffpdev))))) + (and (nil-instantiator-ok value devtype-spec) + (list (cons tag-set value)))))))) + ;; if we're adding to a tty, we need to tag our + ;; additions with `tty'; see [note 1] below. we leave + ;; the old spec in place, however -- if e.g. we're + ;; italicizing a font that was always set to be + ;; underlined, even on window systems, then we still + ;; want the underline there. unless we put the old + ;; spec back, the underline will disappear, since + ;; the new specs are all tagged with `tty'. this + ;; doesn't apply to the [note 1] situations below + ;; because there we're just adding, not substituting. + (if (and (eq 'tty devtype-spec) + (not (or (eq 'tty tag-set) + (memq 'tty tag-set)))) + (nconc (add-tag-to-inst-list result 'tty) + (list (cons tag-set x))) + result)) + nconc it))) + (delete-duplicates results :test #'equal))) -(defun frob-face-property-1 (sp device inst-list func) - (let - (first-valid result) - (while (and inst-list (not result)) - (let* ((inst-pair (car inst-list)) - (tag-set (car inst-pair)) - (sp-inst (specifier-instance-from-inst-list - sp device (list inst-pair)))) - (if sp-inst - (progn - (if (not first-valid) - (setq first-valid inst-pair)) - (setq result (funcall func sp-inst device)) - (if result - (setq result (cons tag-set result)))))) - (setq inst-list (cdr inst-list))) - (or result first-valid))) + ;; Frob INST-LIST, which came from LOCALE, and put the new value back + ;; into SP at LOCALE. THUNK is a cons of (PROP . DEVTYPE-SPEC), the + ;; property being processed and whether this is a TTY property or a + ;; win property. + (frob-locale (sp locale inst-list thunk) + (let ((newinst (frob-face-inst-list locale inst-list + (car thunk) (cdr thunk)))) + (remove-specifier sp locale tag-set exact-p) + (add-spec-list-to-specifier sp (list (cons locale newinst)))) + ;; map-specifier should keep going + nil) -(defcustom face-frob-from-locale-first nil - "*If non nil, use kludgy way of frobbing fonts suitable for non-mule -multi-charset environments." - :group 'faces - :type 'boolean) + ;; map over all specified locales in LOCALE; for each locale, + ;; frob the instantiators in that locale in the specifier in both + ;; WIN-PROP and TTY-PROPS in FACE. Takes values from environment. + (map-over-locales (locale) + (map-specifier (get face win-prop) #'frob-locale locale + (cons win-prop 'window-system) + tag-set exact-p) + (loop for prop in tty-props do + (map-specifier (get face prop) #'frob-locale locale + (cons prop 'tty) + tag-set exact-p))) + + ;; end of flets + ) + + ;; the function itself -(defun frob-face-font-2 (face locale tags unfrobbed-face frobbed-face - tty-thunk ws-thunk standard-face-mapping) - ;; another kludge to make things more intuitive. If we're - ;; inheriting from a standard face in this locale, frob the - ;; inheritance as appropriate. Else, if, after the first - ;; window-system frobbing pass, the face hasn't changed and still - ;; looks like the standard unfrobbed face (e.g. 'default), make it - ;; inherit from the standard frobbed face (e.g. 'bold). Regardless - ;; of things, do the TTY frobbing. + (let* ((ffpdev Face-frob-property-device-considered-current) + (do-later-stages + (or (global-locale locale) + (valid-specifier-domain-p locale) + (bufferp locale))) + (domain (and do-later-stages + (derive-domain-from-locale locale 'window-system + ffpdev))) + (check-differences + (and unfrobbed-face frobbed-face domain + (not (memq (face-name face) + '(default bold italic bold-italic))))) + (orig-instance + (and check-differences + (face-property-instance face win-prop domain)))) + + ;; first do the frobbing + (setq face (get-face face)) + (map-over-locales locale) + + (when do-later-stages + + (if (global-locale locale) (setq locale 'global)) - ;; yuck -- The LOCALE argument to make-face-bold is not actually a locale, - ;; but is a "locale, locale-type, or nil for all". So ... do our extra - ;; frobbing only if it's actually a locale; or for nil, do the frobbing - ;; on 'global. This specifier stuff needs some rethinking. - (let* ((the-locale (cond ((null locale) 'global) - ((valid-specifier-locale-p locale) locale) - (t nil))) - (spec-list - (and - the-locale - (specifier-spec-list (get (get-face face) 'font) the-locale tags t))) - (change-it - (and - spec-list - (cdr (assoc (cdadar spec-list) standard-face-mapping))))) - (if (and change-it - (not (memq (face-name (find-face face)) - '(default bold italic bold-italic)))) - (progn - (or (equal change-it t) - (set-face-property face 'font change-it the-locale tags)) - (funcall tty-thunk)) - (let* ((domain (cond ((null the-locale) nil) - ((valid-specifier-domain-p the-locale) the-locale) - ;; OK, this next one is truly a kludge, but - ;; it results in more intuitive behavior most - ;; of the time. (really!) - ((or (eq the-locale 'global) (eq the-locale 'all)) - (selected-device)) - (t nil))) - (inst (and domain (face-property-instance face 'font domain)))) - ;; If it's reasonable to do the inherit-from-standard-face trick, - ;; and it's called for, then do it now. - (if (and - face-frob-from-locale-first - (eq the-locale 'global) - domain - (equal inst (face-property-instance face 'font domain)) - ;; don't do it for standard faces, or you'll get inheritance loops. - ;; #### This makes XEmacs seg fault! fix this bug. - (not (memq (face-name (find-face face)) - '(default bold italic bold-italic))) - (equal (face-property-instance face 'font domain) - (face-property-instance unfrobbed-face 'font domain))) - (set-face-property face 'font (vector frobbed-face) - the-locale tags) - ;; and only otherwise try to build new property value artificially - (funcall tty-thunk) - (funcall ws-thunk) - (and - domain - (equal inst (face-property-instance face 'font domain)) - ;; don't do it for standard faces, or you'll get inheritance loops. - ;; #### This makes XEmacs seg fault! fix this bug. - (not (memq (face-name (find-face face)) - '(default bold italic bold-italic))) - (equal (face-property-instance face 'font domain) - (face-property-instance unfrobbed-face 'font domain)) - (set-face-property face 'font (vector frobbed-face) the-locale tags))))))) + ;; now do the second stage -- if there's nothing there, try + ;; harder to find an instantiator, and frob it. + (let (do-something) + (loop for prop in (cons win-prop tty-props) + for propspec = (get face prop) + for devtype-spec = (if (eq prop win-prop) 'window-system 'tty) + if propspec + do + (or (specifier-spec-list propspec locale) + (let ((doit (derive-specifier-specs-from-locale + propspec locale devtype-spec ffpdev + ;; #### does this make sense? When no tags + ;; given, frob the whole list of fallbacks when + ;; global, else just retrieve a current-device + ;; value. this tries to mirror normal practices, + ;; where with no tags you want everything frobbed, + ;; but with a tag you want only the tag frobbed + ;; and hence you probably don't want lots and lots + ;; of items there. (#### Perhaps the best way -- + ;; or at least a way with some theoretical + ;; justifiability -- is to fetch the fallbacks + ;; that match the TAG-SET/EXACT-P, and if none, + ;; fall back onto doing the selected-device + ;; trick.) + (and (not tag-set) (not exact-p))))) + (if (and (not doit) (eq locale 'global)) + (error + "No fallback for specifier property %s in face %s???" + prop face)) + ;; [note 1] whenever we add to a tty property, + ;; make sure we tag our additions with `tty' to + ;; avoid accidentally messing things up on window + ;; systems (e.g. when making things italic we + ;; don't want to set the underline property on + ;; window systems) + (when doit + (add-spec-list-to-specifier + propspec + (list (cons locale + (add-tag-to-inst-list + doit + (append (if (listp tag-set) tag-set + (list tag-set)) + (if (eq devtype-spec 'tty) '(tty))) + )))) + (setq do-something t))))) + (when do-something + (map-over-locales (or (global-locale locale) locale)))) + + ;; then do the third stage -- check for whether we have to do + ;; the inheritance trick. + + (when (and check-differences + (let ((new-instance + (face-property-instance face win-prop domain))) + (and + (equal orig-instance new-instance) + (equal orig-instance + (face-property-instance unfrobbed-face win-prop + domain))))) + (set-face-property face win-prop (vector frobbed-face) + (or (global-locale locale) locale) tag-set)))))) ;; WE DEMAND FOUNDRY FROBBING! @@ -1008,253 +1080,263 @@ ;; Thx Jan Vroonhof, Ref xemacs-beta <87oflypbum.fsf@petteflet.ntlworld.com> ;; Brainlessly derived from make-face-size by Stephen; don't blame Jan. ;; I'm long since flown to Rio, it does you little good to blame me, either. -(defun make-face-family (face family &optional locale tags) - "Set FACE's family to FAMILY in LOCALE, if possible. +(defun make-face-family (face family &optional locale tags exact-p) + "Set FACE's family to FAMILY in LOCALE, if possible." + (interactive (list (read-face-name "Set family of which face: ") + (read-string "Family to set: "))) -Add/replace settings specified by TAGS only." - (frob-face-property face 'font - ;; uses dynamic scope of family - #'(lambda (f d) + (Face-frob-property face locale tags exact-p + nil nil 'font nil + `(lambda (f d) ;; keep the dependency on font.el for now - (let ((fo (font-create-object (font-instance-name f) - d))) - (set-font-family fo family) + (let ((fo (font-create-object f d))) + (set-font-family fo ,family) (font-create-name fo d))) - nil locale tags)) + nil)) ;; Style (ie, typographical face) frobbing -(defun make-face-bold (face &optional locale tags) +(defun make-face-bold (face &optional locale tags exact-p) "Make FACE bold in LOCALE, if possible. -This will attempt to make the font bold for X/MSW locales and will set the -highlight flag for TTY locales. +This will attempt to make the font bold for window-system locales and will +set the highlight flag for TTY locales. + +The actual behavior of this function is somewhat messy, in an attempt to +get more intuitive behavior in quite a lot of different circumstances. (You +might view this as indicative of design failures with specifiers, but in +fact almost all code that attempts to interface to humans and produce +\"intuitive\" results gets messy, particularly with a system as complicated +as specifiers, whose complexity results from an attempt to work well in +many different circumstances.) + +The meaning of LOCALE is the same as for `specifier-spec-list', i.e.: + +-- If LOCALE is nil, omitted, or `all', this will attempt to \"frob\" all + font specifications for FACE to make them appear bold (i.e. the + specifications are replaced with equivalent specifications, where the + font names have been changed to the closest bold font). + +-- If LOCALE is a locale type \(`buffer', `window', etc.), this frobs all + font specifications for locales of that type. + +-- If LOCALE is a particular locale, this frobs all font specifications for + that locale. -If LOCALE is nil, omitted, or `all', this will attempt to frob all -font specifications for FACE to make them appear bold. Similarly, if -LOCALE is a locale type, this frobs all font specifications for locales -of that type. If LOCALE is a particular locale, what happens depends on -what sort of locale is given. If you gave a device, frame, or window, -then it's always possible to determine what the font actually will be, -so this is determined and the resulting font is frobbed and added back as a -specification for this locale. If LOCALE is a buffer, however, you can't -determine what the font will actually be unless there's actually a -specification given for that particular buffer (otherwise, it depends -on what window and frame the buffer appears in, and might not even be -well-defined if the buffer appears multiple times in different places); -therefore you will get an error unless there's a specification for the -buffer. +If TAGS is given, this only processes instantiators whose tag set includes +all tags mentioned in TAGS. In addition, if EXACT-P is non-nil, only +instantiators whose tag set exactly matches TAGS are processed; otherwise, +additional tags may be present in the instantiator's tag set. + +This function proceeeds in three stages. + +STAGE 1: Frob the settings that are already present. +STAGE 2: (if called for) Ensure that *some* setting exists in the locale + that was given, finding it in various ways and frobbing it as in + stage 1. This ensures that there is an actual setting for + the locale, so you will get the expected buffer-local/frame-local + behavior -- changes to the global value, to other locales, won't + affect this locale, (b) the face will actually look bold in + the locale. +STAGE 3: (if called for) + +The way the frobbing works depends on the device type -- first on whether +or not it's TTY, and second, if it's a window-system device type, on which +particular window-system device type. For locales with a specific device +type, we do the frobbing in the context of that device type -- this means +that for TTY device types we set the highlight flag, and for window-system +device types we modify the font spec according to the rules for font specs +of that device type. For global locales, we may process both the highlight +flag and the font specs (depending on the device types compiled into this +XEmacs). When processing font specs, we check the tag set associated with +each font spec to see if it's specific to a particular device type; if so, +we frob it in the context of that type, else we use the type of the current +device. (A hack, but works well in practice -- and if a new device is +created, we will automatically frob all the standard fonts to make sure +they display OK on that device.) + +If LOCALE is not a locale type, and both TAGS and EXACT-P are omitted, we +do further frobbing in an attempt to give more intuitive behavior. -Finally, in some cases (specifically, when LOCALE is not a locale type), -if the frobbing didn't actually make the font look any different -\(this happens, for example, if your font specification is already bold -or has no bold equivalent), and currently looks like the font of the -'default face, it is set to inherit from the 'bold face. This is kludgy -but it makes `make-face-bold' have more intuitive behavior in many -circumstances." +First, if there are no specifications in LOCALE (if LOCALE is `all', we act +as if it were `global' for this step), we do our utmost to put a +specification there; otherwise, this function will have no effect. For +device, frame, or window locales, the face's font is instantiated using the +locale as a domain, and the resulting font is frobbed and added back as a +specification for this locale. If LOCALE is `global', we retrieve the +fallback specs and frob them. If LOCALE is a buffer, things get tricky +since you can't instantiate a specifier in a buffer domain \(the buffer can +appear in multiple places, or in different places over time, so this +operation is not well-defined). We used to signal an error in this case, +but now we instead try to do something logical so that we work somewhat +similarly to buffer-local variables. Specifically, we use +`get-buffer-window' to find a window viewing the buffer, and if there is +one, use this as a domain to instantiate the font, and frob the resulting +value. Otherwise, we use the selected window for the same purpose. + +Finally, if the frobbing didn't actually make the font look any different +in whatever domain we instantiated the font in (this happens, for example, +if your font specification is already bold or has no bold equivalent; note +that in this step, we use the selected device in place of `global' or `all' +-- another hack, but works well in practice since there's usually only one +device), and the font currently looks like the font of the `default' face, +it is set to inherit from the `bold' face. + +NOTE: For the other functions defined below, the identity of these two +standard faces mentioned in the previous paragraph, and the TTY properties +that are modified, may be different, and whether the TTY property or +properties are set or unset may be different. For example, for +`make-face-unitalic', the last sentence in the previous paragraph would +read \"... and the font currently looks like the font of the `italic' face, +it is set to inherit from the `default' face.\", and the second sentence in +the first paragraph would read \"This will attempt to make the font +non-italic for window-system locales and will unset the underline flag for +TTY locales.\" + +Here's a table indicating the behavior differences with the different +functions: + +function face1 face2 tty-props tty-val +---------------------------------------------------------------------------- +make-face-bold default bold highlight t +make-face-italic default italic underline t +make-face-bold-italic default bold-italic highlight,underline t +make-face-unbold bold default highlight nil +make-face-unitalic italic default underline nil +" (interactive (list (read-face-name "Make which face bold: "))) - (frob-face-font-2 - face locale tags 'default 'bold - (lambda () - ;; handle TTY specific entries - (when (featurep 'tty) - (set-face-highlight-p face t locale (cons 'tty tags)))) - (lambda () - ;; handle window-system specific entries - (when (featurep 'gtk) - (frob-face-property face 'font 'gtk-make-font-bold - '(gtk) locale tags)) - (when (featurep 'x) - (frob-face-property face 'font 'x-make-font-bold - '(x) locale tags)) - (when (featurep 'mswindows) - (frob-face-property face 'font 'mswindows-make-font-bold - '(mswindows) locale tags) - (frob-face-property face 'font 'mswindows-make-font-bold - '(msprinter) locale tags)) - ) - '(([default] . [bold]) - ([bold] . t) - ([italic] . [bold-italic]) - ([bold-italic] . t)))) + (Face-frob-property face locale tags exact-p + 'default 'bold 'font '(highlight) + '(tty (lambda (x) t) + x x-make-font-bold + gtk gtk-make-font-bold + mswindows mswindows-make-font-bold + msprinter mswindows-make-font-bold) + '(([default] . [bold]) + ([bold] . t) + ([italic] . [bold-italic]) + ([bold-italic] . t)))) -(defun make-face-italic (face &optional locale tags) +(defun make-face-italic (face &optional locale tags exact-p) "Make FACE italic in LOCALE, if possible. This will attempt to make the font italic for X/MS Windows locales and will set the underline flag for TTY locales. See `make-face-bold' for the semantics of the LOCALE argument and for more specifics on exactly how this function works." (interactive (list (read-face-name "Make which face italic: "))) - (frob-face-font-2 - face locale tags 'default 'italic - (lambda () - ;; handle TTY specific entries - (when (featurep 'tty) - (set-face-underline-p face t locale (cons 'tty tags)))) - (lambda () - ;; handle window-system specific entries - (when (featurep 'gtk) - (frob-face-property face 'font 'gtk-make-font-italic - '(gtk) locale tags)) - (when (featurep 'x) - (frob-face-property face 'font 'x-make-font-italic - '(x) locale tags)) - (when (featurep 'mswindows) - (frob-face-property face 'font 'mswindows-make-font-italic - '(mswindows) locale tags) - (frob-face-property face 'font 'mswindows-make-font-italic - '(msprinter) locale tags)) - ) - '(([default] . [italic]) - ([bold] . [bold-italic]) - ([italic] . t) - ([bold-italic] . t)))) + (Face-frob-property face locale tags exact-p + 'default 'italic 'font '(underline) + '(tty (lambda (x) t) + x x-make-font-italic + gtk gtk-make-font-italic + mswindows mswindows-make-font-italic + msprinter mswindows-make-font-italic) + '(([default] . [italic]) + ([bold] . [bold-italic]) + ([italic] . t) + ([bold-italic] . t)))) -(defun make-face-bold-italic (face &optional locale tags) +(defun make-face-bold-italic (face &optional locale tags exact-p) "Make FACE bold and italic in LOCALE, if possible. This will attempt to make the font bold-italic for X/MS Windows locales and will set the highlight and underline flags for TTY locales. See `make-face-bold' for the semantics of the LOCALE argument and for more specifics on exactly how this function works." (interactive (list (read-face-name "Make which face bold-italic: "))) - (frob-face-font-2 - face locale tags 'default 'bold-italic - (lambda () - ;; handle TTY specific entries - (when (featurep 'tty) - (set-face-highlight-p face t locale (cons 'tty tags)) - (set-face-underline-p face t locale (cons 'tty tags)))) - (lambda () - ;; handle window-system specific entries - (when (featurep 'gtk) - (frob-face-property face 'font 'gtk-make-font-bold-italic - '(gtk) locale tags)) - (when (featurep 'x) - (frob-face-property face 'font 'x-make-font-bold-italic - '(x) locale tags)) - (when (featurep 'mswindows) - (frob-face-property face 'font 'mswindows-make-font-bold-italic - '(mswindows) locale tags) - (frob-face-property face 'font 'mswindows-make-font-bold-italic - '(msprinter) locale tags)) - ) - '(([default] . [italic]) - ([bold] . [bold-italic]) - ([italic] . [bold-italic]) - ([bold-italic] . t)))) + (Face-frob-property face locale tags exact-p + 'default 'bold-italic 'font '(underline highlight) + '(tty (lambda (x) t) + x x-make-font-bold-italic + gtk gtk-make-font-bold-italic + mswindows mswindows-make-font-bold-italic + msprinter mswindows-make-font-bold-italic) + '(([default] . [italic]) + ([bold] . [bold-italic]) + ([italic] . [bold-italic]) + ([bold-italic] . t)))) -(defun make-face-unbold (face &optional locale tags) + +(defun make-face-unbold (face &optional locale tags exact-p) "Make FACE non-bold in LOCALE, if possible. This will attempt to make the font non-bold for X/MS Windows locales and will unset the highlight flag for TTY locales. See `make-face-bold' for the semantics of the LOCALE argument and for more specifics on exactly how this function works." (interactive (list (read-face-name "Make which face non-bold: "))) - (frob-face-font-2 - face locale tags 'bold 'default - (lambda () - ;; handle TTY specific entries - (when (featurep 'tty) - (set-face-highlight-p face nil locale (cons 'tty tags)))) - (lambda () - ;; handle window-system specific entries - (when (featurep 'gtk) - (frob-face-property face 'font 'gtk-make-font-unbold - '(gtk) locale tags)) - (when (featurep 'x) - (frob-face-property face 'font 'x-make-font-unbold - '(x) locale tags)) - (when (featurep 'mswindows) - (frob-face-property face 'font 'mswindows-make-font-unbold - '(mswindows) locale tags) - (frob-face-property face 'font 'mswindows-make-font-unbold - '(msprinter) locale tags)) - ) - '(([default] . t) - ([bold] . [default]) - ([italic] . t) - ([bold-italic] . [italic])))) + (Face-frob-property face locale tags exact-p + 'bold 'default 'font '(highlight) + '(tty (lambda (x) nil) + x x-make-font-unbold + gtk gtk-make-font-unbold + mswindows mswindows-make-font-unbold + msprinter mswindows-make-font-unbold) + '(([default] . t) + ([bold] . [default]) + ([italic] . t) + ([bold-italic] . [italic])))) -(defun make-face-unitalic (face &optional locale tags) +(defun make-face-unitalic (face &optional locale tags exact-p) "Make FACE non-italic in LOCALE, if possible. This will attempt to make the font non-italic for X/MS Windows locales and will unset the underline flag for TTY locales. See `make-face-bold' for the semantics of the LOCALE argument and for more specifics on exactly how this function works." (interactive (list (read-face-name "Make which face non-italic: "))) - (frob-face-font-2 - face locale tags 'italic 'default - (lambda () - ;; handle TTY specific entries - (when (featurep 'tty) - (set-face-underline-p face nil locale (cons 'tty tags)))) - (lambda () - ;; handle window-system specific entries - (when (featurep 'gtk) - (frob-face-property face 'font 'gtk-make-font-unitalic - '(gtk) locale tags)) - (when (featurep 'x) - (frob-face-property face 'font 'x-make-font-unitalic - '(x) locale tags)) - (when (featurep 'mswindows) - (frob-face-property face 'font 'mswindows-make-font-unitalic - '(mswindows) locale tags) - (frob-face-property face 'font 'mswindows-make-font-unitalic - '(msprinter) locale tags)) - ) - '(([default] . t) - ([bold] . t) - ([italic] . [default]) - ([bold-italic] . [bold])))) + (Face-frob-property face locale tags exact-p + 'italic 'default 'font '(underline) + '(tty (lambda (x) nil) + x x-make-font-unitalic + gtk gtk-make-font-unitalic + mswindows mswindows-make-font-unitalic + msprinter mswindows-make-font-unitalic) + '(([default] . t) + ([bold] . t) + ([italic] . [default]) + ([bold-italic] . [bold])))) ;; Size frobbing ;; Thx Jan Vroonhof, Ref xemacs-beta <87oflypbum.fsf@petteflet.ntlworld.com> ;; Jan had a separate helper function -(defun make-face-size (face size &optional locale tags) - "Adjust FACE to SIZE in LOCALE, if possible. - -Add/replace settings specified by TAGS only." - (frob-face-property face 'font - ;; uses dynamic scope of size - #'(lambda (f d) - ;; keep the dependency on font.el for now - (let ((fo (font-create-object (font-instance-name f) - d))) - (set-font-size fo size) - (font-create-name fo d))) - nil locale tags)) +(defun make-face-size (face size &optional locale tags exact-p) + "Adjust FACE to SIZE in LOCALE, if possible." + (interactive (list (read-face-name "Set size of which face: ") + (read-number "Size to set: " t 10))) + (Face-frob-property face locale tags exact-p + nil nil 'font nil + `(lambda (f d) + ;; keep the dependency on font.el for now + (let ((fo (font-create-object f d))) + (set-font-size fo ,size) + (font-create-name fo d))) + nil)) ;; Why do the following two functions lose so badly in so many ;; circumstances? -(defun make-face-smaller (face &optional locale) +(defun make-face-smaller (face &optional locale tags exact-p) "Make the font of FACE be smaller, if possible. LOCALE works as in `make-face-bold' et al., but the ``inheriting- from-the-bold-face'' operations described there are not done because they don't make sense in this context." (interactive (list (read-face-name "Shrink which face: "))) - ;; handle X specific entries - (when (featurep 'x) - (frob-face-property face 'font 'x-find-smaller-font - '(x) locale)) - (when (featurep 'mswindows) - (frob-face-property face 'font 'mswindows-find-smaller-font - '(mswindows) locale) - (frob-face-property face 'font 'mswindows-find-smaller-font - '(msprinter) locale))) + (Face-frob-property face locale tags exact-p + nil nil 'font nil + '(x x-find-smaller-font + gtk gtk-find-smaller-font + mswindows mswindows-find-smaller-font + msprinter mswindows-find-smaller-font) + nil)) -(defun make-face-larger (face &optional locale) +(defun make-face-larger (face &optional locale tags exact-p) "Make the font of FACE be larger, if possible. See `make-face-smaller' for the semantics of the LOCALE argument." (interactive (list (read-face-name "Enlarge which face: "))) - ;; handle X specific entries - (when (featurep 'x) - (frob-face-property face 'font 'x-find-larger-font - '(x) locale)) - (when (featurep 'mswindows) - (frob-face-property face 'font 'mswindows-find-larger-font - '(mswindows) locale) - (frob-face-property face 'font 'mswindows-find-larger-font - '(msprinter) locale))) + (Face-frob-property face locale tags exact-p + nil nil 'font nil + '(x x-find-larger-font + gtk gtk-find-larger-font + mswindows mswindows-find-larger-font + msprinter mswindows-find-larger-font) + nil)) (defun invert-face (face &optional locale) "Swap the foreground and background colors of the face." @@ -1320,9 +1402,12 @@ (if (< (apply '+ (color-instance-rgb-components color-instance)) 65536) 'dark 'light) - ;; Here, we get an error on a TTY. As we don't have - ;; a good way of detecting whether a TTY is light or - ;; dark, we'll guess it's dark. + ;; Here, we get an error on a TTY (Return value from + ;; color-instance-rgb-components is nil), and on the + ;; initial stream device (Return value from + ;; face-background-instance is nil). As we don't have a + ;; good way of detecting whether a TTY is light or dark, + ;; we'll guess it's dark. (error 'dark)))) (set-frame-property frame 'background-mode mode) mode)) @@ -1587,42 +1672,36 @@ ;; Is there anything which should be done for TTY's? ))) -;; #### This is somewhat X-specific, and is called when the first -;; X device is created (even if there were TTY devices created -;; beforehand). The concept of resources has not been generalized -;; outside of X-specificness, so we have to live with this -;; breach of device-independence. +;; Called when the first device created. -(defun init-global-faces () - ;; Look for global face resources. - (loop for face in (face-list) do - (init-face-from-resources face 'global)) - ;; Further X frobbing. - (and (featurep 'x) (declare-fboundp (x-init-global-faces))) - (and (featurep 'gtk) (declare-fboundp (gtk-init-global-faces))) - (and (featurep 'mswindows) (declare-fboundp (mswindows-init-global-faces))) +(defun init-global-faces (device) + (let ((Face-frob-property-device-considered-current device)) + ;; Look for global face resources. + (loop for face in (face-list) do + (init-face-from-resources face 'global)) + ;; Further frobbing. + (and (featurep 'x) (declare-fboundp (x-init-global-faces))) + (and (featurep 'gtk) (declare-fboundp (gtk-init-global-faces))) + (and (featurep 'mswindows) (declare-fboundp (mswindows-init-global-faces))) - ;; for bold and the like, make the global specification be bold etc. - ;; if the user didn't already specify a value. These will also be - ;; frobbed further in init-other-random-faces. - (unless (face-font 'bold 'global) - (make-face-bold 'bold 'global)) - ;; - (unless (face-font 'italic 'global) - (make-face-italic 'italic 'global)) - ;; - (unless (face-font 'bold-italic 'global) - (make-face-bold-italic 'bold-italic 'global) + ;; for bold and the like, make the global specification be bold etc. + ;; if the user didn't already specify a value. These will also be + ;; frobbed further in init-other-random-faces. + (unless (face-font 'bold 'global) + (make-face-bold 'bold 'global)) + ;; + (unless (face-font 'italic 'global) + (make-face-italic 'italic 'global)) + ;; (unless (face-font 'bold-italic 'global) - (copy-face 'bold 'bold-italic) - (make-face-italic 'bold-italic))) + (make-face-bold-italic 'bold-italic 'global) + (unless (face-font 'bold-italic 'global) + (copy-face 'bold 'bold-italic) + (make-face-italic 'bold-italic))) - (when (face-equal 'bold 'bold-italic) - (copy-face 'italic 'bold-italic) - (make-face-bold 'bold-italic)) - ;; - ;; Nothing more to be done for X or TTY's? - ) + (when (face-equal 'bold 'bold-italic device) + (copy-face 'italic 'bold-italic) + (make-face-bold 'bold-italic)))) ;; These warnings are there for a reason. Just specify your fonts
--- a/lisp/font-lock.el Tue Jun 11 19:28:22 2002 +0000 +++ b/lisp/font-lock.el Thu Jun 20 21:19:10 2002 +0000 @@ -1944,30 +1944,28 @@ ;; generally more like variables (no parameters), and the function and ;; keyword colors are currently the same, while the variable color is ;; different, which looks better. - (list (concat "^(\\(def\\(" - ;; Function declarations. - "\\(un\\|advice\\|alias\\|macro\\|macro\\*\\|setf\\|subst\\|" - "subst\\*\\|-edebug-spec\\|" - "ine-\\(ccl-program\\|compatible-function-alias\\|" - "compiler-macro\\|device-method\\|device-method\\*\\|" - "function\\|function-when-void\\|modify-macro\\|" - "obsolete-function-alias\\|prefix-command\\|setf-method\\|" - "skeleton\\)\\)\\|" - ;; Structure declarations. - "\\(class\\|struct\\|type\\)\\|" - ;; Former variable declarations, but woefully inadequate. - ;"\\(const\\(\\|ant\\)\\|ine-key\\(\\|-after\\)\\|var\\|custom\\)\\|" - ;; Everything else is a function declaration. - "\\([^ \t\n\(\)]+\\)" - "\\)\\)\\>" - ;; Any whitespace and declared object. - "[ \t'\(]*" - "\\([^ \t\n\)]+\\)?") - '(1 font-lock-keyword-face) - '(7 (cond ((match-beginning 3) 'font-lock-function-name-face) - ((match-beginning 5) 'font-lock-type-face) - (t 'font-lock-variable-name-face)) - nil t)) + (list (concat + "^(\\(" lisp-function-and-type-regexp + ;; Former variable declarations, but woefully inadequate. + ;; "\\|def\\(const\\(\\|ant\\)\\|ine-key\\(\\|-after\\)\\|" + ;; "var\\|custom\\)" + ;; Everything else is a variable declaration. + ;; anything else is a variable + "\\|def\\([^ \t\n\(\)]+\\)" + ;; make sure we are at end of word. + "\\)\\>" + ;; Any whitespace following and declared object. + "[ \t'\(]*" + "\\([^ \t\n\)]+\\)?") + ;; Note about numbering: #1 is the grouping around the whole + ;; keyword. #2 - #4 are in lisp-function-and-type-regexp. + ;; #5 is for variables. (Must be set if neither #3 nor #4 are.) + ;; #6 for the following object. + '(1 font-lock-keyword-face) + '(6 (cond ((match-beginning 3) 'font-lock-function-name-face) + ((match-beginning 4) 'font-lock-type-face) + (t 'font-lock-variable-name-face)) + nil t)) ) "Subdued level highlighting Lisp modes.")
--- a/lisp/font-menu.el Tue Jun 11 19:28:22 2002 +0000 +++ b/lisp/font-menu.el Thu Jun 20 21:19:10 2002 +0000 @@ -64,10 +64,6 @@ ;;; `reset-device-font-menus' to rebuild the menus from all currently ;;; available fonts. ;;; -;;; There is knowledge here about the regexp match numbers in -;;; `mswindows-font-regexp' and `mswindows-font-regexp-foundry-and-family' defined in -;;; mswindows-faces.el. -;;; ;;; There are at least three kinds of fonts under X11r5: ;;; ;;; - bitmap fonts, which can be assumed to look as good as possible; @@ -297,14 +293,15 @@ (when weight (signal 'error '("Setting weight currently not supported"))) (setq new-default-face-font - (font-menu-load-font - (or family from-family) - (or weight from-weight) - (or size from-size) - from-slant - (specifier-instance - font-menu-preferred-resolution (selected-device)))) - ;; This is such a gross hack. The border-glyph face under + (font-instance-name + (font-menu-load-font + (or family from-family) + (or weight from-weight) + (or size from-size) + from-slant + (specifier-instance + font-menu-preferred-resolution (selected-device))))) + ;; #### This is such a gross hack. The border-glyph face under ;; mswindows is in a symbol font. Thus it will not appear in the ;; cache - being a junk family. What we should do is change the ;; size but not the family, but this is more work than I care to @@ -368,13 +365,14 @@ (to-weight (string-equal face-weight from-weight)) (to-size (= face-size from-size)))) (set-face-font face - (font-menu-load-font (or to-family face-family) - (or to-weight face-weight) - (or to-size face-size) - face-slant - (specifier-instance - font-menu-preferred-resolution - (selected-device))) + (font-instance-name + (font-menu-load-font (or to-family face-family) + (or to-weight face-weight) + (or to-size face-size) + face-slant + (specifier-instance + font-menu-preferred-resolution + (selected-device)))) (and font-menu-this-frame-only-p (selected-frame))))))
--- a/lisp/font.el Tue Jun 11 19:28:22 2002 +0000 +++ b/lisp/font.el Thu Jun 20 21:19:10 2002 +0000 @@ -2,6 +2,7 @@ ;; Copyright (c) 1995, 1996 by William M. Perry (wmperry@cs.indiana.edu) ;; Copyright (c) 1996, 1997 Free Software Foundation, Inc. +;; Copyright (C) 2002 Ben Wing. ;; Author: wmperry ;; Maintainer: XEmacs Development Team @@ -11,7 +12,7 @@ ;; XEmacs is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 1, or (at your option) +;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; XEmacs is distributed in the hope that it will be useful, but @@ -34,6 +35,8 @@ '(x-list-fonts mswindows-list-fonts ns-list-fonts internal-facep fontsetp get-font-info get-fontset-info mswindows-define-rgb-color cancel-function-timers + mswindows-font-regexp mswindows-canonicalize-font-name + mswindows-parse-font-style mswindows-construct-font-style ;; #### perhaps we should rewrite font-warn to avoid the warning font-warn)) @@ -780,40 +783,20 @@ ;;; The window-system dependent code (mswindows-style) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; mswindows fonts look like: -;;; fontname[:[weight][ style][:pointsize[:effects]]][:charset] -;;; A minimal mswindows font spec looks like: -;;; Courier New -;;; A maximal mswindows font spec looks like: -;;; Courier New:Bold Italic:10:underline strikeout:western -;;; Missing parts of the font spec should be filled in with these values: -;;; Courier New:Regular:10::western -;; "^[a-zA-Z ]+:[a-zA-Z ]*:[0-9]+:[a-zA-Z ]*:[a-zA-Z 0-9]*$" -(defvar font-mswindows-font-regexp - (let - ((- ":") - (fontname "\\([a-zA-Z ]+\\)") - (weight "\\([a-zA-Z]*\\)") - (style "\\( [a-zA-Z]*\\)?") - (pointsize "\\([0-9]+\\)") - (effects "\\([a-zA-Z ]*\\)") - (charset "\\([a-zA-Z 0-9]*\\)") - ) - (concat "^" - fontname - weight style - pointsize - effects - charset "$"))) - (defconst mswindows-font-weight-mappings - '((:extra-light . "Extralight") + '((:thin . "Thin") + (:extra-light . "Extra Light") (:light . "Light") - (:demi-light . "Demilight") - (:demi . "Demi") - (:book . "Book") + (:demi-light . "Light") + (:demi . "Light") + (:book . "Medium") (:medium . "Medium") (:normal . "Normal") - (:demi-bold . "Demibold") + (:demi-bold . "Demi Bold") (:bold . "Bold") (:regular . "Regular") - (:extra-bold . "Extrabold")) + (:extra-bold . "Extra Bold") + (:heavy . "Heavy")) "An assoc list mapping keywords to actual mswindows specific strings for use in the 'weight' field of an mswindows font string.") @@ -838,41 +821,46 @@ (defun mswindows-font-create-object (fontname &optional device) "Return a font descriptor object for FONTNAME, appropriate for MS Windows devices." (let ((case-fold-search t) - (font (declare-fboundp (mswindows-font-canonicalize-name fontname)))) + (font (declare-fboundp (mswindows-canonicalize-font-name fontname)))) (if (or (not (stringp font)) - (not (string-match font-mswindows-font-regexp font))) + (not (string-match mswindows-font-regexp font))) (make-font) (let ((family (match-string 1 font)) - (weight (match-string 2 font)) - (style (match-string 3 font)) - (pointsize (match-string 4 font)) - (effects (match-string 5 font)) - (charset (match-string 6 font)) + (style (match-string 2 font)) + (pointsize (match-string 3 font)) + (effects (match-string 4 font)) + (charset (match-string 5 font)) (retval nil) (size nil) (case-fold-search t) ) - (if pointsize (setq size (concat pointsize "pt"))) - (if weight (setq weight (intern-soft (concat ":" (downcase weight))))) - (setq retval (make-font :family family - :weight weight - :size size - :encoding charset)) - (set-font-bold-p retval (eq :bold weight)) - (cond - ((null style) nil) - ((string-match "^ *[iI]talic" style) - (set-font-italic-p retval t))) - (cond - ((null effects) nil) - ((string-match "^[uU]nderline [sS]trikeout" effects) - (set-font-underline-p retval t) - (set-font-strikethru-p retval t)) - ((string-match "[uU]nderline" effects) - (set-font-underline-p retval t)) - ((string-match "[sS]trikeout" effects) - (set-font-strikethru-p retval t))) - retval)))) + (destructuring-bind (weight . slant) + (mswindows-parse-font-style style) + (if (equal pointsize "") (setq pointsize nil)) + (if pointsize (setq size (concat pointsize "pt"))) + (if weight (setq weight + (intern-soft + (concat ":" (downcase (replace-in-string + weight " " "-")))))) + (setq retval (make-font :family family + :weight weight + :size size + :encoding charset)) + (set-font-bold-p retval (eq :bold weight)) + (cond + ((null slant) nil) + ((string-match "[iI]talic" slant) + (set-font-italic-p retval t))) + (cond + ((null effects) nil) + ((string-match "^[uU]nderline [sS]trikeout" effects) + (set-font-underline-p retval t) + (set-font-strikethru-p retval t)) + ((string-match "[uU]nderline" effects) + (set-font-underline-p retval t)) + ((string-match "[sS]trikeout" effects) + (set-font-strikethru-p retval t))) + retval))))) (defun mswindows-font-create-name (fontobj &optional device) "Return a font name constructed from FONTOBJ, appropriate for MS Windows devices." @@ -893,8 +881,7 @@ (font-size default))) (underline-p (font-underline-p fontobj)) (strikeout-p (font-strikethru-p fontobj)) - (encoding (or (font-encoding fontobj) - (font-encoding default)))) + (encoding (font-encoding fontobj))) (if (stringp family) (setq family (list family))) (setq weight (font-higher-weight weight @@ -920,10 +907,12 @@ family)) ;; We treat oblique and italic as equivalent. Don't ask. ;; Courier New:Bold Italic:10:underline strikeout:western - (setq font-name (format "%s:%s%s:%s:%s:%s" - cur-family weight - (if (font-italic-p fontobj) - " Italic" "") + (setq font-name (format "%s:%s:%s:%s:%s" + cur-family + (mswindows-construct-font-style + weight + (if (font-italic-p fontobj) + "Italic" "")) (if size (int-to-string size) "10") (if underline-p
--- a/lisp/gtk-faces.el Tue Jun 11 19:28:22 2002 +0000 +++ b/lisp/gtk-faces.el Thu Jun 20 21:19:10 2002 +0000 @@ -86,30 +86,8 @@ (defun gtk-init-frame-faces (frame) ) -;;; gtk-init-global-faces is responsible for ensuring that the -;;; default face has some reasonable fallbacks if nothing else is -;;; specified. -;;; (defun gtk-init-global-faces () - (let* ((dev nil) - (default-font (or (face-font 'default 'global) - ;;(plist-get (gtk-style-info dev) 'font) - "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*")) - (italic-font (or (gtk-make-font-italic default-font dev) default-font)) - (bold-font (or (gtk-make-font-bold default-font dev) default-font)) - (bi-font (or (gtk-make-font-bold-italic default-font dev) default-font))) - - (or (face-font 'default 'global) - (set-face-font 'default default-font 'global '(gtk default))) - - (or (face-font 'bold 'global) - (set-face-font 'bold bold-font 'global '(gtk default))) - - (or (face-font 'bold-italic 'global) - (set-face-font 'bold-italic bi-font 'global '(gtk default))) - - (or (face-font 'italic 'global) - (set-face-font 'italic italic-font 'global '(gtk default))))) + ) ;;; Lots of this stolen from x-faces.el - I'm not sure if this will
--- a/lisp/lisp-mode.el Tue Jun 11 19:28:22 2002 +0000 +++ b/lisp/lisp-mode.el Thu Jun 20 21:19:10 2002 +0000 @@ -675,6 +675,40 @@ (t normal-indent)))))) +(defvar lisp-function-and-type-regexp + (concat "def\\(" + ;; def but not define-. + "\\(un\\|advice\\|alias\\|macro\\*?\\|setf\\|subst\\*?\\|" + "-edebug-spec\\|" + ;; CLOS + "method\\|generic\\|" + ;; define-* + "ine-\\(?:" + ;; basic Lisp stuff + "compiler-macro\\|function\\|function-when-void\\|modify-macro\\|" + "setf-method\\|" + ;; obsolete/compatible support, XEmacs-specific + "compatible-function-alias\\|obsolete-function-alias\\|" + ;; XEmacs-specific, supporting stuff inside of XEmacs + "ccl-program\\|device-method\\*?\\|prefix-command\\|skeleton" + "\\)\\)\\|" + ;; Structure declarations. + "\\(class\\|struct\\|type\\)\\)\\>") + "Regular expression to match the function and type keywords used in Lisp. +This matches, for example, the string \"defun\", as well as defsetf, +defsubst*, define-prefix-command, etc. Match string 1 matches everything +but the three-letter \"def\" string at the beginning. Match string 2 +matches everything after that, when it's *NOT* a \"type\" declaration -- +which includes defclass, defstruct, and deftype. Match string 3 is similar +to match string 2 in that it matches everything after the \"def\", when +\(and only when) the keyword matched *IS* a type declaration. You can use +match strings 2 and 3 to easily determine whether a function or type was +matched. The regex is terminated with a \\\> so that there must be a +word-end; i.e. defunbbb won't match.") + +(defvar lisp-flet-regexp + "(\\(flet\\|macrolet\\|labels\\)\\(\\s-\\|\n\\)") + (defun lisp-indent-function (indent-point state) ;; free reference to `calculate-lisp-indent-last-sexp' ;; in #'calculate-lisp-indent @@ -697,19 +731,91 @@ ;; inside the innermost containing sexp. (backward-prefix-chars) (current-column)) - (let ((function (buffer-substring (point) + + ;; Now come a bunch of ad-hoc checks to see if we're in particular + ;; places (defining an flet function, in the argument list of a + ;; regular or flet function, in a quoted list, etc.) where the + ;; regular indenting doesn't work well. + + ;; #### All this stuff here should be generalized so that + ;; you can specify, for various functions, how you want + ;; particular arguments handled -- in some way that works + ;; recursively, so it can handle flet and such. + + (let* ((function (buffer-substring (point) (progn (forward-sexp 1) (point)))) - method) - (if (condition-case nil + (quote (condition-case nil + (save-excursion + (backward-up-list 1) + (memq (char-before (point)) '(?' ?`))))) + method) + (cond + ;; if we're indenting a quoted list, and the first word is not + ;; lambda, line up second line below first with no indentation, + ;; so that property lists indent correctly. + ((and quote (not (equal function "lambda"))) + (setq method 'lisp-indent-quoteform)) + ;; do the same if we're indenting the arg list of a def* form. + ((let ((p (point))) + (condition-case nil (save-excursion - (backward-up-list 1) - (backward-up-list 1) - (backward-up-list 1) - (looking-at "(\\(flet\\|macrolet\\|labels\\)\\s-")) - (error nil)) - (setq method 'defun) - (setq method (or (get (intern-soft function) 'lisp-indent-function) - (get (intern-soft function) 'lisp-indent-hook)))) + (backward-up-list 2) + ;; make sure we're indeed the second argument of the + ;; def* form. + (and (eq (point) (save-excursion + (goto-char p) + (backward-up-list 1) + (backward-sexp 2) + (1- (point)))) + ;; check to see that the function is a def* type + (eq (char-after) ?\() + (progn (forward-char 1) t) + (looking-at lisp-function-and-type-regexp) + ;; defstruct may have slot option specs, which + ;; should probably be reverse-indented like + ;; normal, because the slot name is the first + ;; in the list. #### Review this. + (not (equal (match-string 0) "defstruct")))) + (error nil))) + (setq method 'lisp-indent-quoteform)) + + ;; handle functions in flet forms + ((let ((p (point))) + (condition-case nil + (save-excursion + (backward-up-list 3) + ;; make sure we're indeed a function, i.e. inside the + ;; first form after the flet. + (and (eq (point) (save-excursion + (goto-char p) + (backward-up-list 2) + (backward-sexp 1) + (1- (point)))) + (looking-at lisp-flet-regexp))) + (error nil))) + (setq method 'defun)) + + ;; handle the arg lists in functions in flet forms + ((let ((p (point))) + (condition-case nil + (save-excursion + (backward-up-list 2) + ;; make sure we're indeed the arg list -- i.e. the first + ;; element after the function name. + (and (eq (point) (save-excursion + (goto-char p) + (backward-up-list 1) + (backward-sexp 1) + (1- (point)))) + (progn + (backward-up-list 2) + (looking-at lisp-flet-regexp)))) + (error nil))) + (setq method 'lisp-indent-quoteform)) + (t + (setq method + (or (get (intern-soft function) 'lisp-indent-function) + (get (intern-soft function) 'lisp-indent-hook))))) (cond ((or (eq method 'defun) (and (null method) (> (length function) 3) @@ -721,6 +827,14 @@ (method (funcall method state indent-point))))))) +(defun lisp-indent-quoteform (state indent-point) + (goto-char (car (cdr state))) + (forward-line 1) + (if (> (point) (car (cdr (cdr state)))) + (progn + (goto-char (car (cdr state))) + (+ 1 (current-column))))) + (defvar lisp-body-indent 2 "Number of columns to indent the second line of a `(def...)' form.") @@ -796,6 +910,8 @@ (put 'with-selected-window 'lisp-indent-function 1) (put 'save-selected-frame 'lisp-indent-function 0) (put 'with-selected-frame 'lisp-indent-function 1) +(put 'save-selected-device 'lisp-indent-function 0) +(put 'with-selected-device 'lisp-indent-function 1) (put 'save-restriction 'lisp-indent-function 0) (put 'save-match-data 'lisp-indent-function 0) (put 'let 'lisp-indent-function 1)
--- a/lisp/msw-faces.el Tue Jun 11 19:28:22 2002 +0000 +++ b/lisp/msw-faces.el Thu Jun 20 21:19:10 2002 +0000 @@ -39,167 +39,275 @@ ; an error now instead of a crash at frame creation. (unless (face-font-instance 'default device) (error "Can't find a suitable default font")) - + + ;; Don't set them on the device because then the global setting won't + ;; override them. + ;; #### Use device tags if we have multiple msprinter devices. (can we?) (if (car color-default) - (set-face-foreground 'default (car color-default)) device) + (set-face-foreground 'default (car color-default) nil + (device-type device))) (if (cdr color-default) - (set-face-background 'default (cdr color-default)) device) + (set-face-background 'default (cdr color-default) nil + (device-type device))) (if (car color-3d-face) - (set-face-foreground 'gui-element (car color-3d-face)) device) + (set-face-foreground 'gui-element (car color-3d-face) nil + (device-type device))) (if (cdr color-3d-face) - (set-face-background 'gui-element (cdr color-3d-face)) device) + (set-face-background 'gui-element (cdr color-3d-face) nil + (device-type device))) )) (defun mswindows-init-frame-faces (frame) ) ;; Other functions expect these regexps -(defconst mswindows-font-regexp - (let - ((- ":") - (fontname "\\([a-zA-Z ]+\\)") - (weight "\\([a-zA-Z]*\\)?") - (style "\\( [a-zA-Z]*\\)?") - (pointsize "\\([0-9]+\\)?") - (effects "\\([a-zA-Z ]*\\)?") - (charset "\\([a-zA-Z 0-9]*\\)") - ) - (concat "^" - fontname - weight style - pointsize - effects - charset "$"))) +(let + ((- ":") + (fontname "\\([a-zA-Z ]*\\)") ; 1 + (style "\\(\\(?:[a-zA-Z]+\\(?: +[a-zA-Z]+\\)*\\)?\\)") ; 2 + (pointsize "\\([0-9]*\\)") ; 3 + (effects "\\(\\(?:[a-zA-Z]+\\(?: +[a-zA-Z]+\\)*\\)?\\)") ; 4 + ;; must match "OEM/DOS" + (charset "\\([a-zA-Z/ ]*\\)") ; 5 + ) + (defconst mswindows-font-regexp + (concat "^" fontname - style - pointsize - effects - charset "$")) + (defconst mswindows-font-regexp-missing-1 + (concat "^" fontname - style - pointsize - effects "$")) + (defconst mswindows-font-regexp-missing-2 + (concat "^" fontname - style - pointsize "$")) + (defconst mswindows-font-regexp-missing-3 + (concat "^" fontname - style "$")) + (defconst mswindows-font-regexp-missing-4 + (concat "^" fontname "$")) +) ;;; Fill in missing parts of a font spec. This is primarily intended as a ;;; helper function for the functions below. ;;; mswindows fonts look like: -;;; fontname[:[weight][ style][:pointsize[:effects]]][:charset] +;;; fontname[:[weight][ slant][:pointsize[:effects]]][:charset] ;;; A minimal mswindows font spec looks like: ;;; Courier New ;;; A maximal mswindows font spec looks like: ;;; Courier New:Bold Italic:10:underline strikeout:Western -;;; Missing parts of the font spec should be filled in with these values: -;;; Courier New:Regular:10::Western -(defun mswindows-font-canonicalize-name (font) - "Given a mswindows font or font name, this returns its name in -canonical form." - (if (or (font-instance-p font) - (stringp font)) - (let ((name (if (font-instance-p font) - (font-instance-name font) - font))) - (cond ((string-match - "^[a-zA-Z ]+:[a-zA-Z ]*:[0-9]+:[a-zA-Z ]*:[a-zA-Z 0-9]*$" - name) name) - ((string-match "^[a-zA-Z ]+:[a-zA-Z ]*:[0-9]+:[a-zA-Z ]*$" - name) (concat name ":Western")) - ((string-match "^[a-zA-Z ]+:[a-zA-Z ]*:[0-9]+$" name) - (concat name "::Western")) - ((string-match "^[a-zA-Z ]+:[a-zA-Z ]*$" name) - (concat name ":10::Western")) - ((string-match "^[a-zA-Z ]+$" name) - (concat name ":Regular:10::Western")) - (t "Courier New:Regular:10::Western"))))) +(defun mswindows-canonicalize-font-name (font) + "Given a mswindows font or font name, return its name in canonical form. +This adds missing colons and fills in the style field with \"Regular\". +This does *NOT* fill in the point size or charset fields, because in those +cases an empty field is not equivalent to any particular field value, but a +wildcard allowing for any possible value (charset Western and point size 10 +are chosen first, if they exist)." + (if (font-instance-p font) (setq font (font-instance-name font))) + ;; fill in missing colons + (setq font + (cond ((string-match mswindows-font-regexp font) font) + ((string-match mswindows-font-regexp-missing-1 font) + (concat font ":")) + ((string-match mswindows-font-regexp-missing-2 font) + (concat font "::")) + ((string-match mswindows-font-regexp-missing-3 font) + (concat font ":::")) + ((string-match mswindows-font-regexp-missing-4 font) + (concat font "::::")) + (t "::::"))) + (or (string-match mswindows-font-regexp font) (error "can't parse %S" font)) + (if (equal "" (match-string 2 font)) + (concat (substring font 0 (match-beginning 2)) "Regular" + (substring font (match-beginning 2))) + font)) + +(defun mswindows-parse-font-style (style) + ;; Parse a style into a cons (WEIGHT . SLANT). WEIGHT will never be the + ;; empty string (it may be "Regular"), but SLANT will be empty for + ;; non-italic. + (save-match-data + (let ((case-fold-search t)) + (cond ((equalp style "Italic") '("Regular" . "Italic")) + ((string-match "^\\([a-zA-Z ]+?\\) +Italic$" style) + (cons (match-string 1 style) "Italic")) + (t (cons style "")))))) + +(defun mswindows-construct-font-style (weight slant) + ;; Construct the style from WEIGHT and SLANT. Opposite of + ;; mswindows-parse-font-style. + (cond ((and (equal slant "") (equal weight "")) "Regular") + ((equal slant "") weight) + ((or (equalp weight "Regular") (equal weight "")) slant) + (t (concat weight " " slant)))) + +(defun mswindows-frob-font-style (font which) + ;; Given a font name or font instance, return a name with the style field + ;; (which includes weight and/or slant) changed according to WHICH, a plist. + ;; If no entry found, don't change. + (if (null font) nil + (setq font (mswindows-canonicalize-font-name font)) + (or (string-match mswindows-font-regexp font) + (error "can't parse %S" font)) + (let* ((style (match-string 2 font)) + (style-rep + (save-match-data + (or (loop for (x y) on which by #'cddr + if (string-match (concat "^" x "$") style) + return (replace-match y nil nil style)) + style)))) + (concat (substring font 0 (match-beginning 2)) + style-rep + (substring font (match-end 2)))))) + +(defun mswindows-frob-font-style-and-sizify (font which &optional device) + (if (null font) nil + (let* ((oldwidth (if (font-instance-p font) (font-instance-width font) + (let ((fi (make-font-instance font device t))) + (and fi (font-instance-width fi))))) + (newname (mswindows-frob-font-style font which)) + (newfont (make-font-instance newname device t))) + ;; Hack! On MS Windows, bold fonts (even monospaced) are often wider + ;; than the equivalent non-bold font. Making the bold font one point + ;; smaller usually makes it the same width (maybe at the expense of + ;; making it one pixel shorter). Do the same trick in both directions. + (when (font-instance-p newfont) + (let ((newerfont newfont)) + (block nil + (while (and newerfont oldwidth) + (setq newfont newerfont) + (cond ((< (font-instance-width newfont) oldwidth) + (setq newerfont + (make-font-instance + (mswindows-find-larger-font newfont device) + device t)) + (if (and newerfont + (> (font-instance-width newerfont) oldwidth)) + (return nil))) + ((> (font-instance-width newfont) oldwidth) + (setq newerfont + (make-font-instance + (mswindows-find-smaller-font newfont device) + device t)) + (if (and newerfont + (< (font-instance-width newerfont) oldwidth)) + (return nil))) + (t (return nil)))))) + (if (font-instance-p newfont) (font-instance-name newfont) newfont))))) + +(defconst mswindows-nonbold-weight-regexp + ;; He looked so, so cool with the ultra light dangling from his mouth as + ;; his fingers spun out demisemiquavers from the keyboard ... + "\\(Regular\\|Thin\\|Extra Light\\|Ultra Light\\|Light\\|Normal\\|Medium\\|Semi Bold\\|Demi Bold\\)" + ) +(defconst mswindows-bold-weight-regexp + "\\(Semi Bold\\|Demi Bold\\|Bold\\|Extra Bold\\|Ultra Bold\\|Heavy\\|Black\\)" + ) + +(defconst mswindows-make-font-bold-mapper + `(,mswindows-nonbold-weight-regexp "Bold" + "Italic" "Bold Italic" + ,(concat mswindows-nonbold-weight-regexp " Italic") "Bold Italic")) + +(defconst mswindows-make-font-nonbold-mapper + `(,mswindows-bold-weight-regexp "Regular" + ,(concat mswindows-bold-weight-regexp " Italic") "Italic")) + +(defconst mswindows-make-font-italic-mapper + '("\\(.*\\)Italic" "\\1Italic" + "\\(.*\\)" "\\1 Italic")) + +(defconst mswindows-make-font-unitalic-mapper + '("Italic" "Regular" + "\\(.*\\) Italic" "\\1")) + +(defconst mswindows-make-font-bold-italic-mapper + `(,mswindows-nonbold-weight-regexp "Bold Italic" + ,(concat mswindows-nonbold-weight-regexp " Italic") "Bold Italic" + "Italic" "Bold Italic" + ,mswindows-bold-weight-regexp "\\1 Italic")) (defun mswindows-make-font-bold (font &optional device) "Given a mswindows font specification, this attempts to make a bold font. If it fails, it returns nil." - (if (font-instance-p font) - (let ((name (mswindows-font-canonicalize-name font)) - (oldwidth (font-instance-width font))) - (string-match "^[a-zA-Z ]+:\\([a-zA-Z ]*\\):" name) - (let ((newfont (make-font-instance - (concat (substring name 0 (match-beginning 1)) - "Bold" (substring name (match-end 1))) - device t))) -; Hack! on mswindows, bold fonts (even monospaced) are often wider than the -; equivalent non-bold font. Making the bold font one point smaller usually -; makes it the same width (maybe at the expense of making it one pixel shorter) - (if (font-instance-p newfont) - (if (> (font-instance-width newfont) oldwidth) - (mswindows-find-smaller-font newfont device) - newfont)))))) + (mswindows-frob-font-style-and-sizify font mswindows-make-font-bold-mapper + device)) (defun mswindows-make-font-unbold (font &optional device) "Given a mswindows font specification, this attempts to make a non-bold font. If it fails, it returns nil." - (if (font-instance-p font) - (let ((name (mswindows-font-canonicalize-name font))) - (string-match "^[a-zA-Z ]+:\\([a-zA-Z ]*\\):" name) - (make-font-instance (concat - (substring name 0 (match-beginning 1)) - "Regular" (substring name (match-end 1))) - device t)))) + (mswindows-frob-font-style-and-sizify font mswindows-make-font-nonbold-mapper + device)) (defun mswindows-make-font-italic (font &optional device) "Given a mswindows font specification, this attempts to make an `italic' font. If it fails, it returns nil." - (if (font-instance-p font) - (let ((name (mswindows-font-canonicalize-name font))) - (string-match "^[a-zA-Z ]+:\\([a-zA-Z ]*\\):" name) - (make-font-instance (concat - (substring name 0 (match-beginning 1)) - "Italic" (substring name (match-end 1))) - device t)))) + (try-font-name (mswindows-frob-font-style + font mswindows-make-font-italic-mapper) device)) (defun mswindows-make-font-unitalic (font &optional device) "Given a mswindows font specification, this attempts to make a non-italic font. If it fails, it returns nil." - (if (font-instance-p font) - (let ((name (mswindows-font-canonicalize-name font))) - (string-match "^[a-zA-Z ]+:\\([a-zA-Z ]*\\):" name) - (make-font-instance (concat - (substring name 0 (match-beginning 1)) - "Regular" (substring name (match-end 1))) - device t)))) + (try-font-name (mswindows-frob-font-style + font mswindows-make-font-unitalic-mapper) device)) (defun mswindows-make-font-bold-italic (font &optional device) "Given a mswindows font specification, this attempts to make a `bold-italic' font. If it fails, it returns nil." - (if (font-instance-p font) - (let ((name (mswindows-font-canonicalize-name font)) - (oldwidth (font-instance-width font))) - (string-match "^[a-zA-Z ]+:\\([a-zA-Z ]*\\):" name) - (let ((newfont (make-font-instance - (concat (substring name 0 (match-beginning 1)) - "Bold Italic" (substring name (match-end 1))) - device t))) -; Hack! on mswindows, bold fonts (even monospaced) are often wider than the -; equivalent non-bold font. Making the bold font one point smaller usually -; makes it the same width (maybe at the expense of making it one pixel shorter) - (if (font-instance-p newfont) - (if (> (font-instance-width newfont) oldwidth) - (mswindows-find-smaller-font newfont device) - newfont)))))) + (mswindows-frob-font-style-and-sizify font + mswindows-make-font-bold-italic-mapper + device)) + +(defun mswindows-available-font-sizes (font device) + (if (font-instance-p font) (setq font (font-instance-name font))) + (setq font (mswindows-canonicalize-font-name font)) + (or (string-match mswindows-font-regexp font) (error "Can't parse %S" font)) + ;; turn pointsize into wildcard + (setq font + (concat (substring font 0 (match-beginning 3)) + (substring font (match-end 3) (match-end 0)))) + (sort + (delq nil + (mapcar #'(lambda (name) + (and (string-match mswindows-font-regexp name) + (string-to-int (substring name (match-beginning 3) + (match-end 3))))) + (list-fonts font device))) + #'<)) + +(defun mswindows-frob-font-size (font up-p device) + (if (stringp font) (setq font (make-font-instance font device))) + (let* ((name (font-instance-name font)) + (truename (font-instance-truename font)) + (available (and truename + (mswindows-available-font-sizes truename device)))) + (if (null available) nil + (or (string-match mswindows-font-regexp truename) + (error "can't parse %S" truename)) + (let ((old-size (string-to-int + (substring truename + (match-beginning 3) (match-end 3))))) + (or (> old-size 0) (error "font truename has 0 pointsize?")) + (or (string-match mswindows-font-regexp name) + (error "can't parse %S" name)) + (let ((newsize + ;; scalable fonts: change size by 1 point. + (if (= 0 (car available)) + (if (and (not up-p) (= 1 old-size)) nil + (if up-p (1+ old-size) (1- old-size))) + ;; non-scalable fonts: take the next available size. + (if up-p + (loop for tail on available + if (eql (car tail) old-size) + return (cadr tail)) + (loop for tail on available + if (eql (cadr tail) old-size) + return (car tail)))))) + (and newsize + (concat (substring name 0 (match-beginning 3)) + (int-to-string newsize) + (substring name (match-end 3) (match-end 0))))))))) (defun mswindows-find-smaller-font (font &optional device) "Loads a new version of the given font (or font name) 1 point smaller. Returns the font if it succeeds, nil otherwise." - (if (stringp font) (setq font (make-font-instance font device))) - (if (font-instance-p font) (setq font (font-instance-truename font))) - (if (stringp font) (setq font (make-font-instance font device))) - (if (font-instance-p font) - (let (old-size (name (mswindows-font-canonicalize-name font))) - (string-match "^[a-zA-Z ]+:[a-zA-Z ]*:\\([0-9]+\\):" name) - (setq old-size (string-to-int - (substring name (match-beginning 1) (match-end 1)))) - (if (> old-size 0) - (make-font-instance (concat - (substring name 0 (match-beginning 1)) - (int-to-string (- old-size 1)) - (substring name (match-end 1))) - device t))))) + (mswindows-frob-font-size font nil device)) (defun mswindows-find-larger-font (font &optional device) "Loads a new version of the given font (or font name) 1 point larger. Returns the font if it succeeds, nil otherwise." - (if (stringp font) (setq font (make-font-instance font device))) - (if (font-instance-p font) (setq font (font-instance-truename font))) - (if (stringp font) (setq font (make-font-instance font device))) - (if (font-instance-p font) - (let (old-size (name (mswindows-font-canonicalize-name font))) - (string-match "^[a-zA-Z ]+:[a-zA-Z ]*:\\([0-9]+\\):" name) - (setq old-size (string-to-int - (substring name (match-beginning 1) (match-end 1)))) - (make-font-instance (concat - (substring name 0 (match-beginning 1)) - (int-to-string (+ old-size 1)) - (substring name (match-end 1))) - device t)))) + (mswindows-frob-font-size font t device))
--- a/lisp/msw-font-menu.el Tue Jun 11 19:28:22 2002 +0000 +++ b/lisp/msw-font-menu.el Thu Jun 20 21:19:10 2002 +0000 @@ -1,6 +1,7 @@ ;; msw-font-menu.el --- Managing menus of mswindows fonts. ;; Copyright (C) 1999 Free Software Foundation, Inc. +;; Copyright (C) 2002 Ben Wing. ;; Adapted from x-font-menu.el by Andy Piper <andy@xemacs.org> @@ -21,6 +22,13 @@ ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. +;;; Known Problems: +;;; =============== +;;; There is knowledge here about the regexp match numbers in +;;; `mswindows-font-regexp' and `mswindows-font-regexp-foundry-and-family' defined in +;;; mswindows-faces.el. +;;; + ;;; mswindows fonts look like: ;;; fontname[:[weight][ style][:pointsize[:effects]]][:charset] ;;; ie: @@ -40,9 +48,6 @@ (require 'font-menu) (globally-declare-boundp 'mswindows-font-regexp) -(defvar mswindows-font-menu-registry-encoding nil - "Registry and encoding to use with font menu fonts.") - (defvar mswindows-font-menu-junk-families (mapconcat #'identity @@ -65,7 +70,6 @@ or if you change your font path, you can call this to re-initialize the menus." (unless mswindows-font-regexp-ascii (setq mswindows-font-regexp-ascii "Western")) - (setq mswindows-font-menu-registry-encoding "Western") (let ((case-fold-search t) family size weight entry dev-cache cache families sizes weights) @@ -75,8 +79,9 @@ (t debug))) (when (and (string-match mswindows-font-regexp-ascii name) (string-match mswindows-font-regexp name)) - (setq weight (capitalize (match-string 2 name)) - size (string-to-int (or (match-string 4 name) "0")) + (setq weight (capitalize (car (mswindows-parse-font-style + (match-string 2 name)))) + size (string-to-int (match-string 3 name)) family (match-string 1 name)) (unless (string-match mswindows-font-menu-junk-families family) (setq entry (or (vassoc name cache) @@ -174,15 +179,16 @@ (return-from mswindows-font-menu-font-data (make-vector 5 nil))) (when (string-match mswindows-font-regexp name) - (setq weight (match-string 2 name)) - (setq size (string-to-int (or (match-string 4 name) "0")))) + (setq weight (car (mswindows-parse-font-style (match-string 2 name)))) + (setq size (string-to-int (match-string 3 name)))) (when (string-match mswindows-font-regexp truename) - (when (not (member weight (aref entry 1))) - (setq weight (match-string 2 truename))) - (when (not (member size (aref entry 2))) - (setq size (string-to-int (or (match-string 4 truename) "0")))) - (setq slant (match-string 5 truename))) + (destructuring-bind (newweight . slant) + (mswindows-parse-font-style (match-string 2 truename)) + (when (not (member weight (aref entry 1))) + (setq weight newweight)) + (when (not (member size (aref entry 2))) + (setq size (string-to-int (match-string 3 truename)))))) (vector entry family size weight slant))) @@ -195,14 +201,15 @@ (dolist (weight (list weight "")) (dolist (slant ;; oblique is not currently implemented - (cond ((string-equal slant "Oblique") '(" Italic" "")) - ((string-equal slant "Italic") '(" Italic" "")) + (cond ((string-equal slant "Oblique") '("Italic" "")) + ((string-equal slant "Italic") '("Italic" "")) (t (list slant "")))) (when (setq font (make-font-instance - (concat family ":" weight slant ":" - size "::" - mswindows-font-menu-registry-encoding) + (concat + family ":" + (mswindows-construct-font-style weight slant) ":" + size "::") nil t)) (throw 'got-font font)))))))
--- a/lisp/mule/mule-msw-init-late.el Tue Jun 11 19:28:22 2002 +0000 +++ b/lisp/mule/mule-msw-init-late.el Thu Jun 20 21:19:10 2002 +0000 @@ -30,6 +30,33 @@ ;; guess we're supposed to query the font for what ranges it supports, and ;; what its preferred range is.) +(let ((l '((ascii . "Western") + (latin-iso8859-2 . "Central European") + (cyrillic-iso8859-5 . "Cyrillic") + (latin-iso8859-1 . "Western") + (greek-iso8859-7 . "Greek") + (latin-iso8859-9 . "Turkish") + (hebrew-iso8859-8 . "Hebrew") + (arabic-iso8859-6 . "Arabic") + (latin-iso8859-4 . "Baltic") + (vietnamese-viscii-lower . "Viet Nam") + (vietnamese-viscii-upper . "Viet Nam") + (thai-tis620 . "Thai") + (latin-jisx0201 . "Japanese") + (katakana-jisx0201 . "Japanese") + ;; (japanese-jisx0208-1978 . "Japanese") + (japanese-jisx0208 . "Japanese") + (japanese-jisx0212 . "Japanese") + (chinese-gb2312 . "Simplified Chinese") + (korean-ksc5601 . "Korean") + (chinese-big5-1 . "Traditional Chinese") + (chinese-big5-2 . "Traditional Chinese")))) + (while l + (let ((charset (car (car l))) + (registry (cdr (car l)))) + (mswindows-set-charset-registry charset registry) + (setq l (cdr l))))) + (let ((l '((ascii . 1252) (latin-iso8859-2 . 1250) (cyrillic-iso8859-5 . 1251)
--- a/lisp/mule/mule-x-init.el Tue Jun 11 19:28:22 2002 +0000 +++ b/lisp/mule/mule-x-init.el Thu Jun 20 21:19:10 2002 +0000 @@ -1,6 +1,6 @@ ;;; mule-x-init.el --- initialization code for X Windows under MULE -*- coding: iso-2022-7bit; -*- ;; Copyright (C) 1994 Free Software Foundation, Inc. -;; Copyright (C) 1996 Ben Wing <ben@xemacs.org> +;; Copyright (C) 1996, 2002 Ben Wing <ben@xemacs.org> ;; Author: various ;; Keywords: mule X11 @@ -40,22 +40,20 @@ occupy exactly twice the screen space of ASCII (`halfwidth') characters. On many systems, e.g. Sun CDE systems, this can only be achieved by using a national variant roman font to display ASCII." - (let* ((charset-font-width - (lambda (charset) - (font-instance-width - (face-font-instance 'default (selected-device) charset)))) - - (twice-as-wide - (lambda (cs1 cs2) - (let ((width1 (funcall charset-font-width cs1)) - (width2 (funcall charset-font-width cs2))) - (and width1 width2 (eq (+ width1 width1) width2)))))) + (flet ((charset-font-width (charset) + (font-instance-width + (face-font-instance 'default (selected-device) charset))) + + (twice-as-wide (cs1 cs2) + (let ((width1 (charset-font-width cs1)) + (width2 (charset-font-width cs2))) + (and width1 width2 (eq (+ width1 width1) width2))))) (when (eq 'x (device-type)) (condition-case nil - (unless (funcall twice-as-wide 'ascii fullwidth-charset) + (unless (twice-as-wide 'ascii fullwidth-charset) (set-charset-registry 'ascii roman-registry) - (unless (funcall twice-as-wide 'ascii fullwidth-charset) + (unless (twice-as-wide 'ascii fullwidth-charset) ;; Restore if roman-registry didn't help (set-charset-registry 'ascii "iso8859-1"))) (error (set-charset-registry 'ascii "iso8859-1")))))) @@ -66,61 +64,4 @@ (defun init-mule-x-win () "Initialize X Windows for MULE at startup. Don't call this." - (when (not mule-x-win-initted) - (define-specifier-tag 'mule-fonts - (lambda (device) (eq 'x (device-type device)))) - - (set-face-font - 'default - '("-*-fixed-medium-r-*--16-*-iso8859-1" - "-*-fixed-medium-r-*--*-iso8859-1" - "-*-fixed-medium-r-*--*-iso8859-2" - "-*-fixed-medium-r-*--*-iso8859-3" - "-*-fixed-medium-r-*--*-iso8859-4" - "-*-fixed-medium-r-*--*-iso8859-7" - "-*-fixed-medium-r-*--*-iso8859-8" - "-*-fixed-medium-r-*--*-iso8859-5" - "-*-fixed-medium-r-*--*-iso8859-9" - - ;; Following 3 fonts proposed by Teruhiko.Kurosaka@Japan.eng.sun - "-sun-gothic-medium-r-normal--14-120-75-75-c-60-jisx0201.1976-0" - "-sun-gothic-medium-r-normal--14-120-75-75-c-120-jisx0208.1983-0" - "-wadalab-gothic-medium-r-normal--14-120-75-75-c-120-jisx0212.1990-0" - ;; Other Japanese fonts - "-*-fixed-medium-r-*--*-jisx0201.1976-*" - "-*-fixed-medium-r-*--*-jisx0208.1983-*" - "-*-fixed-medium-r-*--*-jisx0212*-*" - - ;; Chinese fonts - "-*-*-medium-r-*--*-gb2312.1980-*" - - ;; Use One font specification for CNS chinese - ;; Too many variations in font naming - "-*-fixed-medium-r-*--*-cns11643*-*" - ;; "-*-fixed-medium-r-*--*-cns11643*2" - ;; "-*-fixed-medium-r-*--*-cns11643*3" - ;; "-*-fixed-medium-r-*--*-cns11643*4" - ;; "-*-fixed-medium-r-*--*-cns11643.5-0" - ;; "-*-fixed-medium-r-*--*-cns11643.6-0" - ;; "-*-fixed-medium-r-*--*-cns11643.7-0" - - "-*-fixed-medium-r-*--*-big5*-*" - "-*-fixed-medium-r-*--*-sisheng_cwnn-0" - - ;; Other fonts - - ;; "-*-fixed-medium-r-*--*-viscii1.1-1" - - ;; "-*-fixed-medium-r-*--*-mulearabic-0" - ;; "-*-fixed-medium-r-*--*-mulearabic-1" - ;; "-*-fixed-medium-r-*--*-mulearabic-2" - - ;; "-*-fixed-medium-r-*--*-muleipa-1" - ;; "-*-fixed-medium-r-*--*-ethio-*" - - "-*-mincho-medium-r-*--*-ksc5601.1987-*" ; Korean - "-*-fixed-medium-r-*--*-tis620.2529-1" ; Thai - ) - 'global '(mule-fonts) 'append) - - (setq mule-x-win-initted t))) + )
--- a/lisp/printer.el Tue Jun 11 19:28:22 2002 +0000 +++ b/lisp/printer.el Thu Jun 20 21:19:10 2002 +0000 @@ -451,5 +451,5 @@ (setq copies (1- copies))))) ((and (not (eq system-type 'windows-nt)) (fboundp 'lpr-region)) - (lpr-region start end)) + (declare-fboundp (lpr-region start end))) (t (error "No print support available"))))
--- a/lisp/specifier.el Tue Jun 11 19:28:22 2002 +0000 +++ b/lisp/specifier.el Thu Jun 20 21:19:10 2002 +0000 @@ -1,7 +1,7 @@ ;;; specifier.el --- Lisp interface to specifiers ;; Copyright (C) 1997 Free Software Foundation, Inc. -;; Copyright (C) 1995, 1996, 2000 Ben Wing. +;; Copyright (C) 1995, 1996, 2000, 2002 Ben Wing. ;; Author: Ben Wing <ben@xemacs.org> ;; Keywords: internal, dumped @@ -50,7 +50,8 @@ ;; God damn, do I hate dynamic scoping. -(defun map-specifier (ms-specifier ms-func &optional ms-locale ms-maparg) +(defun map-specifier (ms-specifier ms-func &optional ms-locale ms-maparg + ms-tag-set ms-exact-p) "Apply MS-FUNC to the specification(s) for MS-LOCALE in MS-SPECIFIER. If MS-LOCALE is a locale, MS-FUNC will be called for that locale. @@ -58,13 +59,16 @@ of that type. If MS-LOCALE is 'all or nil, MS-FUNC will be mapped over all locales in MS-SPECIFIER. +MS-TAG-SET and MS-EXACT-P are as in `specifier-spec-list'. + MS-FUNC is called with four arguments: the MS-SPECIFIER, the locale being mapped over, the inst-list for that locale, and the optional MS-MAPARG. If any invocation of MS-FUNC returns non-nil, the mapping will stop and the returned value becomes the value returned from `map-specifier'. Otherwise, `map-specifier' returns nil." - (let ((ms-specs (specifier-spec-list ms-specifier ms-locale)) + (let ((ms-specs (specifier-spec-list ms-specifier ms-locale ms-tag-set + ms-exact-p)) ms-result) (while (and ms-specs (not ms-result)) (let ((ms-this-spec (car ms-specs))) @@ -408,7 +412,7 @@ value) (defun modify-specifier-instances (specifier func &optional args force default - locale tag-set) + locale tag-set) "Modify all specifications that match LOCALE and TAG-SET by FUNC. For each specification that exists for SPECIFIER, in locale LOCALE @@ -613,4 +617,358 @@ (define-specifier-tag 'default) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; "Heuristic" specifier functions ;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;; "Heuristic" is a euphemism for kludge. This stuff works well in +;;; practice, though. + +;;; You might view all the contortions we do here and in Face-frob-property +;;; as indicative of design failures with specifiers, and perhaps you're +;;; right. But in fact almost all code that attempts to interface to +;;; humans and produce "intuitive" results gets messy, particularly with a +;;; system as complicated as specifiers, whose complexity results from an +;;; attempt to work well in many different circumstances. We could create +;;; a much simpler system, but the tradeoff would be that you'd have to +;;; programmatically control all the stuff that gets handled automatically +;;; by setting the right specifiers -- and then things wouldn't "just work" +;;; if the user simultaneously creates a TTY and X device, or X devices on +;;; different types of machines, or wants some buffers to display +;;; differently from others, etc. without a lot of hook functions and other +;;; glue machinery to set everything up. The result would be just as much +;;; complexity, but worse, and much harder to control, since there wouldn't +;;; be any standard framework for managing all these hook functions and the +;;; user would have to be able to write lots of Lisp code to get things +;;; working. + +;;; The problem is that we have no high-level code, e.g. custom, to make it +;;; easy for the user to control specifiers nicely. The following +;;; lower-level code, though, should make it easier to implement the +;;; high-level code. + +;;; #### Something like Face-frob-property, but more general, should be +;;; created for general specifier frobbing. + +;;; #### Other possible extensions to specifiers would be +;;; +;;; (a) the ability to create specifications for particular types of +;;; buffers, e.g. all C-mode buffers one way, all text-mode buffers +;;; another way, etc. Perhaps this should be implemented through hook +;;; functions; but that wouldn't easily allow you to `make-face-bold' +;;; and have it work on these other kinds of specifications. Probably +;;; a better way is to extend the tag mechanism so that it can specify +;;; things other than device types. One way would be to simply allow +;;; tags to have arbitrary elisp attached to them -- a function that +;;; takes a domain and returns whether the attached instantiator +;;; applies. This should be doable given (a) that we now have code to +;;; allow elisp to be run inside a "sandbox", sufficiently protected +;;; that it can even be called from redisplay, and (b) the large amount +;;; of caching we already have, which would minimize the speed hit. +;;; However, this still runs into problems -- (a) it requires +;;; programming to get anything at all done, and (b) you'll get +;;; horrible namespace clashes very quickly. Another possibility to be +;;; used in conjunction with this would be vector tags, with an +;;; extendable mechanism to control their syntax. For example, +;;; +;;; [tag :mode 'c] (buffer in c-mode) +;;; [tag :buffer-name "\\*Help: function"] (help-on-function buffers) +;;; [tag :buffer-coding-system 'japanese-euc] (buffer's coding system is +;;; EUC-JP) +;;; [tag :buffer-file-name "^#.*#$"] (autosave files) +;;; [tag :language-environment "French"] (whenever the global language +;;; environment is French) +;;; [tag :font-height-minimum '(default 12)] (if the height of the default +;;; font is at least 12 pixels +;;; in this domain) +;;; +;;; The general idea is that the properties allowable in a tag vector +;;; are extendable, just by specifying the property name and a function +;;; of two arguments, the property value and the domain, which should +;;; return whether the tag applies. You could imagine very complex +;;; behavior (e.g. combining two tags in a single tag set makes an +;;; `and', and putting the two tags separately with separate (perhaps +;;; identical) instantiators makes an `or'. You could effectively do a +;;; lot of what you might want to do with hooks, but in a much more +;;; controllable fashion. Obviously, much of this complexity wouldn't +;;; necessarily be directly set by the user -- they wouldn't probably +;;; do more than simple tags based on mode, buffer or file name, etc. +;;; But a higher-level interface could easily have various possible +;;; "behaviors" to choose from, implemented using this mechanism. +;;; +;;; #### WE NEED CUSTOM SUPPORT! +;;; +;;; (b) Another possibility is "partial" inheritance. For example -- +;;; toolbars and menubars are complex specifications. Currently the +;;; only way to make a change is to copy the entire value and make the +;;; necessary modifications. What we would like instead is to be able +;;; to construct a mini-menubar that says something like "add this menu +;;; here" and combine with everything else. That would require a +;;; slightly different approach to instantiation. Currently it just +;;; searches up the tree from specific to general, looking for a match; +;;; from this match, it generates the instance. Instead, it would +;;; potentially have to record all the matches it found and pass a list +;;; of them to the instantiation function. To implement this, we would +;;; create another specifier method "instantiator_inherits_up", which +;;; looks at the instantiator to determine if it calls for combining +;;; itself with the value higher up. this tells the specifier code +;;; whether to stop now or keep going. It would then pass a Dynarr of +;;; the instantiators to the instantiate method, which might be a +;;; special version, e.g. "instantiate_multi". + +(defun instance-to-instantiator (inst) + "Convert an instance to an instantiator. +If we have an instance object, we fetch the instantiator that generated the object. Otherwise, we just return the instance." + (cond ((font-instance-p inst) + (setq inst (font-instance-name inst))) + ((color-instance-p inst) + (setq inst (color-instance-name inst))) + ((image-instance-p inst) + (setq inst (image-instance-instantiator inst))) + (t inst))) + +(defun device-type-matches-spec (devtype devtype-spec) + ;; Return DEVTYPE (a devtype) if it matches DEVTYPE-SPEC, else nil. + ;; DEVTYPE-SPEC can be nil (all types OK), a device type (only that type + ;; OK), or `window-system' -- window system device types OK. + (cond ((not devtype-spec) devtype) + ((eq devtype-spec 'window-system) + (and (not (memq devtype '(tty stream))) devtype)) + (t (and (eq devtype devtype-spec) devtype)))) + +(defun add-tag-to-inst-list (inst-list tag-set) + "Add TAG-SET (tag or tag-set) to all tags in INST-LIST." + ;; Ah, all is sweetness and light with `loop' + (if (null tag-set) inst-list + (loop for (t2 . x2) in inst-list + for newt2 = (delete-duplicates + (append (if (listp tag-set) tag-set (list tag-set)) + (if (listp t2) t2 (list t2)))) + collect (cons newt2 x2)))) + +(defun derive-domain-from-locale (locale &optional devtype-spec current-device) + "Given a locale, try to derive the \"most reasonable\" domain. + +This is a heuristic \(\"works most of the time\") algorithm. + +\[Remember that, in specifiers, locales are what you attach specifications or +\"instantiators\" to, and domains are the contexts in which you can +retrieve the value or \"instance\" of the specifier. Not all locales are +domains. In particular, buffers are locales but not domains because +buffers may be displayed in different windows on different frames, and thus +end up with different values if the frames each have a frame-local +instantiator and the instantiators are different. However, we may well +find ourselves in a situation where we want to figure out the most likely +value of a specifier in a buffer -- for example we might conceptually want +to make a buffer's modeline face be bold, so we need to figure out what the +current face is. If the buffer already has an instantiator, it's easy; but +if it doesn't, we want to do something reasonable rather than just issue an +error, even though technically the value is not well-defined. We want +something that gives the right answer most of the time.] + +LOCALE is a specifier locale -- i.e. a buffer, window, frame, device, the +symbol `global', or nil, meaning the same as `global'. + +DEVTYPE-SPEC, if given, can restrict the possible return values to domains +on devices of that device type; or if it's `window-system', to domains on +window-system devices. + +CURRENT-DEVICE is what should be considered as the \"selected device\" when +this value is needed. It defaults to the currently selected device. + +-- If LOCALE is a domain, it's simply returned. +-- If LOCALE is `all', `global', or nil, we return CURRENT-DEVICE. +-- If LOCALE is a buffer, we use `get-buffer-window' to find a window viewing + the buffer, and return it if there is one; otherwise we return the selected + window on CURRENT-DEVICE. + +The return value may be nil if the only possible values don't agree with +DEVTYPE-SPEC." + ;; DEVICE aims to be the selected device, but picks some other + ;; device if that won't work. may be nil. + (let* ((device (or current-device (selected-device))) + (device (if (device-type-matches-spec (device-type device) + devtype-spec) + device + (first + (delete-if-not + #'(lambda (x) + (device-type-matches-spec (device-type x) + devtype-spec)) + (device-list)))))) + (cond ((memq locale '(all nil global)) device) + ((valid-specifier-domain-p locale) + (and (device-type-matches-spec (device-type (dfw-device locale)) + devtype-spec) + locale)) + ((bufferp locale) + (let ((win (get-buffer-window locale t devtype-spec))) + (or win (and device (selected-window device)))))))) + +(defun derive-device-type-from-tag-set (tag-set &optional try-stages + devtype-spec current-device) + "Given a tag set, try (heuristically) to get a device type from it. + +There are three stages that this function proceeds through, each one trying +harder than the previous to get a value. TRY-STAGES controls how many +stages to try. If nil or 1, only stage 1 is done; if 2; stages 1 and 2 are +done; if 3, stages 1-3 are done; if t, all stages are done (currently 1-3). + +Stage 1 looks at the tags themselves to see if any of them are device-type +tags. If so, it returns the device type. If there is more than one device +type, this tag can never match anything, but we go ahead and return one of +them. If no device types in the tags, we fail. + +Stage 2 runs all devices through the tag set to see if any match, and +accumulate a list of device types of all matching devices. If there is +exactly one device type in the list, we return it, else fail. + +Stage 3 picks up from where stage 2 left off, and tries hard to return +*SOME* device type in all possible situations, modulo the DEVTYPE-SPEC +flag. \(DEVTYPE-SPEC and CURRENT-DEVICE are the same as in +`derive-domain-from-locale'.) + +Specifically: + +\(a) if no matching devices, return the selected device's type. +\(b) if more than device type and the selected device's type is + listed, use it. +\(c) else, pick one of the device types (currently the first). + +This will never return a device type that's incompatible with the +DEVTYPE-SPEC flag; thus, it may return nil." + (or try-stages (setq try-stages 1)) + (if (eq try-stages t) (setq try-stages 3)) + (check-argument-range try-stages 1 3) + (flet ((delete-wrong-type (x) + (delete-if-not + #'(lambda (y) + (device-type-matches-spec y devtype-spec)) + x))) + (let ((both (intersection (device-type-list) + (canonicalize-tag-set tag-set)))) + ;; shouldn't be more than one (will fail), but whatever + (if both (first (delete-wrong-type both)) + (and (>= try-stages 2) + ;; no device types mentioned. try the hard way, + ;; i.e. check each existing device to see if it will + ;; pass muster. + (let ((okdevs + (delete-wrong-type + (delete-duplicates + (mapcan + #'(lambda (dev) + (and (device-matches-specifier-tag-set-p + dev tag-set) + (list (device-type dev)))) + (device-list))))) + (devtype (cond ((or (null devtype-spec) + (eq devtype-spec 'window-system)) + (let ((dev (derive-domain-from-locale + 'global devtype-spec + current-device))) + (and dev (device-type dev)))) + (t devtype-spec)))) + (cond ((= 1 (length okdevs)) (car okdevs)) + ((< try-stages 3) nil) + ((null okdevs) devtype) + ((memq devtype okdevs) devtype) + (t (car okdevs))))))))) + +;; Sheesh, the things you do to get "intuitive" behavior. +(defun derive-device-type-from-locale-and-tag-set (locale tag-set + &optional devtype-spec + current-device) + "Try to derive a device type from a locale and tag set. + +If the locale is a domain, use the domain's device type. Else, if the tag +set uniquely specifies a device type, use it. Else, if a buffer is given, +find a window visiting the buffer, and if any, use its device type. +Finally, go back to the tag set and \"try harder\" -- if the selected +device matches the tag set, use its device type, else use some valid device +type from the tag set. + +DEVTYPE-SPEC and CURRENT-DEVICE as in `derive-domain-from-locale'." + + (cond ((valid-specifier-domain-p locale) + ;; if locale is a domain, then it must match DEVTYPE-SPEC, + ;; or we exit immediately with nil. + (device-type-matches-spec (device-type (dfw-device locale)) + devtype-spec)) + ((derive-device-type-from-tag-set tag-set 2 devtype-spec + current-device)) + ((and (bufferp locale) + (let ((win (get-buffer-window locale t devtype-spec))) + (and win (device-type (dfw-device win)))))) + ((derive-device-type-from-tag-set tag-set t devtype-spec + current-device)))) + +(defun derive-specifier-specs-from-locale (specifier locale + &optional devtype-spec + current-device + global-use-fallback) + "Heuristically find the specs of a specifier in a locale. + +This tries to find some reasonable instantiators that are most likely to +correspond to the specifier's \"value\" (i.e. instance) in a particular +locale, even when the user has not specifically set any such instantiators. +This is useful for functions that want to modify the instance of a +specifier in a particular locale, and only in that locale. + +Keep in mind that this is a heuristic (i.e. kludge) function, and that it +may not always give the right results, since the operation is not +technically well-defined in many cases! (See `derive-domain-from-locale'.) + +DEVTYPE-SPEC and CURRENT-DEVICE are as in `derive-domain-from-locale'. + +The return value is an inst-list, i.e. + + ((TAG-SET . INSTANTIATOR) ...) + +More specifically, if there is already a spec in the locale, it's just +returned. Otherwise, if LOCALE is `global', `all', or nil: If +GLOBAL-USE-FALLBACK is non-nil, the fallback is fetched, and returned, with +`default' added to the tag set; else, we use CURRENT-DEVICE (defaulting to +the selected device) as a domain and proceed as in the following. If +LOCALE is a domain (window, frame, device), the specifier's instance in +that domain is computed, and converted back to an instantiator +\(`instance-to-instantiator'). Else, if LOCALE is a buffer, we use +`derive-domain-from-locale' to heuristically get a likely domain, and +proceed as if LOCALE were a domain." + (if (memq locale '(all nil)) (setq locale 'global)) + (let ((current (specifier-spec-list specifier locale))) + (if current (cdar current) + ;; case 1: a global locale, fallbacks + (cond ((and (eq locale 'global) global-use-fallback) + ;; if nothing there globally, retrieve the fallback. + ;; this is either an inst-list or a specifier. in the + ;; latter case, we need to recursively retrieve its + ;; fallback. + (let (sofar + (fallback (specifier-fallback specifier))) + (while (specifierp fallback) + (setq sofar (nconc sofar + (cdar (specifier-spec-list fallback + 'global)))) + (setq fallback (specifier-fallback fallback))) + (add-tag-to-inst-list (nconc sofar fallback) 'default))) + (t + (let (domain) + ;; case 2: window, frame, device locale + (cond ((eq locale 'global) + (setq domain (or current-device (selected-device)))) + ((valid-specifier-domain-p locale) + (setq domain locale)) + ;; case 3: buffer locale + ((bufferp locale) + (setq domain (derive-domain-from-locale + locale devtype-spec current-device))) + (t nil)) + ;; retrieve an instance, convert back to instantiator + (when domain + (let ((inst + (instance-to-instantiator + (specifier-instance specifier domain)))) + (list (cons nil inst)))))))))) + ;;; specifier.el ends here
--- a/lisp/subr.el Tue Jun 11 19:28:22 2002 +0000 +++ b/lisp/subr.el Thu Jun 20 21:19:10 2002 +0000 @@ -914,6 +914,41 @@ `(if (not (,(eval predicate) ,argument)) (signal-error 'wrong-type-argument (list ,predicate ,argument))))) +(defun args-out-of-range (value min max) + "Signal an error until the correct in-range value is given by the user. +This function loops, signalling a continuable `args-out-of-range' error +with VALUE, MIN and MAX as the data associated with the error and then +checking the returned value to make sure it's not outside the given +boundaries \(nil for either means no boundary on that side). At that +point, the gotten value is returned." + (loop + for newval = (signal 'args-out-of-range (list value min max)) + do (setq value newval) + finally return value + while (not (argument-in-range-p value min max)))) + +(defun argument-in-range-p (argument min max) + "Return true if ARGUMENT is within the range of [MIN, MAX]. +This includes boundaries. nil for either value means no limit on that side." + (and (or (not min) (<= min argument)) + (or (not max) (<= argument max)))) + +(defmacro check-argument-range (argument min max) + "Check that ARGUMENT is within the range [MIN, MAX]. +This is a macro, and ARGUMENT is not evaluated. If ARGUMENT is an lvalue, +this function signals a continuable `args-out-of-range' error until the +returned value is within range, and assigns the returned value +to ARGUMENT. Otherwise, this function signals a non-continuable +`args-out-of-range' error if the returned value is out of range." + (if (symbolp argument) + `(if (not (argument-in-range-p ,argument ,min ,max)) + (setq ,argument + (args-out-of-range ,argument ,min ,max))) + (let ((newsym (gensym))) + `(let ((,newsym ,argument)) + (if (not (argument-in-range-p ,newsym ,min ,max)) + (signal-error 'args-out-of-range ,newsym ,min ,max)))))) + (defun signal-error (error-symbol data) "Signal a non-continuable error. Args are ERROR-SYMBOL, and associated DATA. An error symbol is a symbol defined using `define-error'.
--- a/lisp/x-faces.el Tue Jun 11 19:28:22 2002 +0000 +++ b/lisp/x-faces.el Thu Jun 20 21:19:10 2002 +0000 @@ -1,7 +1,7 @@ ;;; x-faces.el --- X-specific face frobnication, aka black magic. ;; Copyright (C) 1992-4, 1997 Free Software Foundation, Inc. -;; Copyright (C) 1995, 1996 Ben Wing. +;; Copyright (C) 1995, 1996, 2002 Ben Wing. ;; Author: Jamie Zawinski <jwz@jwz.org> ;; Maintainer: XEmacs Development Team @@ -617,10 +617,6 @@ ;;; specified. ;;; (defun x-init-global-faces () - (or (face-font 'default 'global) - (set-face-font 'default - "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*" - 'global '(x default))) (or (face-foreground 'default 'global) (set-face-foreground 'default "black" 'global '(x default))) (or (face-background 'default 'global) @@ -633,67 +629,43 @@ ;; ;; If the "default" face didn't have a font specified, try to pick one. ;; - (or - (face-font-instance 'default device) - ;; - ;; No font specified in the resource database; try to cope. - ;; - ;; At first I wanted to do this by just putting a font-spec in the - ;; fallback resources passed to XtAppInitialize(), but that fails - ;; if there is an Emacs app-defaults file which doesn't specify a - ;; font: apparently the fallback resources are not consulted when - ;; there is an app-defaults file, which seems pretty bogus to me. - ;; - ;; We should also probably try "*xtDefaultFont", but I think that it - ;; might be legal to specify that as "xtDefaultFont:", that is, at - ;; top level, instead of "*xtDefaultFont:", that is, applicable to - ;; every application. `x-get-resource' can't handle that right now. - ;; Anyway, xtDefaultFont is probably variable-width. - ;; - ;; Some who have LucidaTypewriter think it's a better font than Courier, - ;; but it has the bug that there are no italic and bold italic versions. - ;; We could hair this code up to try and mix-and-match fonts to get a - ;; full complement, but really, why bother. It's just a default. - ;; - (let (new-x-font) - (setq new-x-font (or - ;; - ;; We default to looking for iso8859 fonts. Using a wildcard for the - ;; encoding would be bad, because that can cause English speakers to get - ;; Kanji fonts by default. It is safe to assume that people using a - ;; language other than English have both set $LANG, and have specified - ;; their `font' and `fontList' resources. In any event, it's better to - ;; err on the side of the English speaker in this case because they are - ;; much less likely to have encountered this problem, and are thus less - ;; likely to know what to do about it. + ;; (or + ;; (face-font-instance 'default device) + ;; + ;; [[ No font specified in the resource database; try to cope. ]] + ;; + ;; NOTE: In reality, this will never happen. The fallbacks will always + ;; be tried, and the last fallback is "*", which should get any font. No + ;; need to put the same checks here as in the fallbacks. These comments + ;; appear to be pre-19.12. --ben - ;; Try for Courier. Almost everyone has that. (Does anyone not?) - (make-font-instance - "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*" device t) - (make-font-instance - "-*-courier-*-r-*-*-*-120-*-*-*-*-iso8859-*" device t) - ;; Next try for any "medium" charcell or monospaced iso8859 font. - (make-font-instance "-*-*-medium-r-*-*-*-120-*-*-m-*-iso8859-*" device t) - (make-font-instance "-*-*-medium-r-*-*-*-120-*-*-c-*-iso8859-*" device t) - ;; Next try for any charcell or monospaced iso8859 font. - (make-font-instance "-*-*-*-r-*-*-*-120-*-*-m-*-iso8859-*" device t) - (make-font-instance "-*-*-*-r-*-*-*-120-*-*-c-*-iso8859-*" device t) - ;; Ok, let's at least try to stay in 8859... - (make-font-instance "-*-*-*-r-*-*-*-120-*-*-*-*-iso8859-*" device t) - ;; Boy, we sure are losing now. Try the above, but in any encoding. - (make-font-instance "-*-*-medium-r-*-*-*-120-*-*-m-*-*-*" device t) - (make-font-instance "-*-*-medium-r-*-*-*-120-*-*-c-*-*-*" device t) - (make-font-instance "-*-*-*-r-*-*-*-120-*-*-m-*-*-*" device t) - (make-font-instance "-*-*-*-r-*-*-*-120-*-*-c-*-*-*" device t) - (make-font-instance "-*-*-*-r-*-*-*-120-*-*-*-*-*-*" device t) - ;; Hello? Please? - (make-font-instance "-*-*-*-*-*-*-*-120-*-*-*-*-*-*" device t) - (make-font-instance "*" device t) - ;; if we get to here we're screwed, and faces.c will fatal()... - )) - (if (not (face-font 'default 'global)) - (set-face-font 'default new-x-font) - (set-face-font 'default new-x-font device)))) + ;; [[ At first I wanted to do this by just putting a font-spec in the + ;; fallback resources passed to XtAppInitialize(), but that fails + ;; if there is an Emacs app-defaults file which doesn't specify a + ;; font: apparently the fallback resources are not consulted when + ;; there is an app-defaults file, which seems pretty bogus to me. + ;; + ;; We should also probably try "*xtDefaultFont", but I think that it + ;; might be legal to specify that as "xtDefaultFont:", that is, at + ;; top level, instead of "*xtDefaultFont:", that is, applicable to + ;; every application. `x-get-resource' can't handle that right now. + ;; Anyway, xtDefaultFont is probably variable-width. + ;; + ;; Some who have LucidaTypewriter think it's a better font than Courier, + ;; but it has the bug that there are no italic and bold italic versions. + ;; We could hair this code up to try and mix-and-match fonts to get a + ;; full complement, but really, why bother. It's just a default. ]] + ;; + ;; [[ We default to looking for iso8859 fonts. Using a wildcard for the + ;; encoding would be bad, because that can cause English speakers to get + ;; Kanji fonts by default. It is safe to assume that people using a + ;; language other than English have both set $LANG, and have specified + ;; their `font' and `fontList' resources. In any event, it's better to + ;; err on the side of the English speaker in this case because they are + ;; much less likely to have encountered this problem, and are thus less + ;; likely to know what to do about it. ]] + + ;; ;; If the "default" face didn't have both colors specified, then pick ;; some, taking into account whether one of the colors was specified.
--- a/lisp/x-init.el Tue Jun 11 19:28:22 2002 +0000 +++ b/lisp/x-init.el Thu Jun 20 21:19:10 2002 +0000 @@ -269,6 +269,7 @@ (when (not x-win-initted) (defvar x-app-defaults-directory) (init-pre-x-win) + (if (featurep 'mule) (init-mule-x-win)) ;; Open the X display when this file is loaded ;; (Note that the first frame is created later.) @@ -288,7 +289,7 @@ (defun init-post-x-win () "Initialize X Windows at startup (post). Don't call this." (when (not post-x-win-initted) - (if (featurep 'mule) (init-mule-x-win)) + ;(if (featurep 'mule) (init-mule-x-win)) ;; Motif-ish bindings ;; The following two were generally unliked. ;;(define-key global-map '(shift delete) 'kill-primary-selection)
--- a/lwlib/ChangeLog Tue Jun 11 19:28:22 2002 +0000 +++ b/lwlib/ChangeLog Thu Jun 20 21:19:10 2002 +0000 @@ -1,3 +1,8 @@ +2002-06-20 Ben Wing <ben@xemacs.org> + + * lwlib.c: + * lwlib.c (dialog_spec_p): Fix warning. + 2002-02-13 Stephen J. Turnbull <stephen@xemacs.org> * lwlib-Xm.c (make_dialog): Fix XmProcessTraversal crash.
--- a/lwlib/lwlib.c Tue Jun 11 19:28:22 2002 +0000 +++ b/lwlib/lwlib.c Thu Jun 20 21:19:10 2002 +0000 @@ -852,6 +852,8 @@ } } +#if defined (NEED_LUCID) || defined (NEED_ATHENA) || defined (NEED_MOTIF) + static widget_creation_function find_in_table (const char *type, const widget_creation_entry table[]) { @@ -862,6 +864,8 @@ return NULL; } +#endif + static Boolean dialog_spec_p (const char *name) {
--- a/nt/ChangeLog Tue Jun 11 19:28:22 2002 +0000 +++ b/nt/ChangeLog Thu Jun 20 21:19:10 2002 +0000 @@ -1,3 +1,86 @@ +2002-06-20 Ben Wing <ben@xemacs.org> + + * config.inc.samp (OPTIMIZED_BUILD): + * config.inc.samp (USE_FASTCALL): New. + * config.inc.samp (PROFILE_SUPPORT): New. + * config.inc.samp (DEBUG_XEMACS): + * config.inc.samp (HAVE_VC6): New. + * config.inc.samp (USE_PORTABLE_DUMPER): + Clean up, add args to control fastcall (not yet supported! the + changes needed are in another ws of mine), profile support, vc6 + support, union-type. + + * xemacs.dsp (CFG): + * xemacs.mak (HAVE_DIALOGS): + * xemacs.mak (HAVE_MSW_C_DIRED): Removed. + * xemacs.mak (USE_FASTCALL): New. + * xemacs.mak (PROFILE_SUPPORT): New. + * xemacs.mak (HAVE_VC6): New. + * xemacs.mak (QUICK_BUILD): + * xemacs.mak (VERBOSECC): New. + * xemacs.mak (DEPEND): New. + * xemacs.mak (CONFIG_ERROR): + * xemacs.mak (CCV): + * xemacs.mak (DEBUGFLAGS): Removed. + * xemacs.mak (OPTFLAGS): Removed. + * xemacs.mak (DEBUG_FLAGS_COMPILE): New. + * xemacs.mak (DEBUG_FLAGS_LINK): New. + * xemacs.mak (DEBUG_DEFINES): New. + * xemacs.mak (BROWSERFLAGS): New. + * xemacs.mak (LIBC_LIB): + * xemacs.mak (OPTFLAGS_FASTCALL): New. + * xemacs.mak (OPTFLAGS_CDECL): New. + * xemacs.mak (PROFILE_FLAGS): New. + * xemacs.mak (CFLAGS_NO_OPT): New. + * xemacs.mak (CFLAGS_CDECL_NO_LIB): New. + * xemacs.mak (CFLAGS_CDECL): New. + * xemacs.mak (MSW_LIBS): + * xemacs.mak (MSW_DEFINES): Removed. + * xemacs.mak (MSW_C_DIRED_OBJ): Removed. + * xemacs.mak (MULE_DEFINES): + * xemacs.mak (DEBUG_FLAGS): Removed. + * xemacs.mak (LINK_DEPENDENCY_ARGS): + * xemacs.mak (ETAGS_DEPS): + * xemacs.mak (LIB_SRC_TOOLS): + * xemacs.mak (TEMACS_LFLAGS): + * xemacs.mak (TEMACS_CPP_FLAGS): Removed. + * xemacs.mak (TEMACS_CPP_FLAGS_NO_CFLAGS): New. + * xemacs.mak (TEMACS_CPP_CDECL_FLAGS): New. + * xemacs.mak (TEMACS_MSW_OBJS): + * xemacs.mak (TEMACS_OBJS): + * xemacs.mak (.SUFFIXES): + * xemacs.mak (create-list-file): New. + * xemacs.mak (compile-list-file): New. + * xemacs.mak (TEMACS_DUMP_ID_OBJ): New. + * xemacs.mak (PROGNAME): + * xemacs.mak (temacs_loadup): + * xemacs.mak (check): + * xemacs.mak (check-temacs): + * xemacs.mak (make-docargs): + * xemacs.mak (update-elc): + * xemacs.mak (install): + * xemacs.mak (mostlyclean): + * xemacs.mak (versionclean): + * xemacs.mak (OS): + Semi-major overhaul. + + Fix bug where dump-id was always getting recomputed, forcing a + redump even when nothing changed. + + Add support for fastcall. Support edit-and-continue (on by + default) with vc6. Use incremental linking when doing a debug + compilation. Add support for profiling. + + Consolidate the various debug flags. + + Partial support for "batch-compiling" -- compiling many files on a + single invocation of the compiler. Doesn't seem to help that much + for me, so it's not finished or enabled by default. + + Remove HAVE_MSW_C_DIRED, we always do. + + Correct some sloppy use of directories. + 2002-03-29 Jonathan Harris <jonathan@xemacs.org> * xemacs.mak: Define STACK_TRACE_EYE_CATCHER.
--- a/nt/config.inc.samp Tue Jun 11 19:28:22 2002 +0000 +++ b/nt/config.inc.samp Thu Jun 20 21:19:10 2002 +0000 @@ -66,6 +66,15 @@ # Set this to turn on optimization when compiling. OPTIMIZED_BUILD=0 +# Set this to build with the fastcall calling convention, which uses registers +# instead of the stack and should speed things up a bit +# #### Change to 1 when I check in the ws with support for fastcall +USE_FASTCALL=0 + +# Set this to compile in support for profiling. If you want line-by-line +# profiling under VC++, you also need debugging turned on. +PROFILE_SUPPORT=0 + ############################################################################ # Development options # ############################################################################ @@ -78,6 +87,9 @@ # variable, below.) DEBUG_XEMACS=1 +# True if running VC++ 6 or later. +HAVE_VC6=1 + # Uncomment this to turn off or on the error-checking code, which adds # abundant internal error checking (and slows things down a lot). Normally, # leave this alone -- it will be on for beta builds and off for release @@ -98,3 +110,18 @@ # Set this to use the portable dumper for dumping the preloaded Lisp # routines, instead of the older "unexec" routines in unexnt.c. USE_PORTABLE_DUMPER=1 + +# Set this to get improved type checking of Lisp_Objects -- with this +# setting, they're declared as unions instead of ints, and so places where +# a Lisp_Object is mistakenly passed to a routine expecting an int (or +# vice-versa), or a check is written `if (foo)' instead of `if (!NILP +# (foo))', will be flagged as errors. (All of these do NOT lead to the +# expected results! Qnil is not represented as 0 (so if (foo) will +# *ALWAYS* be true for a Lisp_Object), the representation of an integer as +# a Lisp_Object is not just the integer's numeric value (but usually 2x the +# integer +/- 1). + +# Some also claim it simplifies debugging, but I don't really believe them. +# Definitely don't do your normal builds this way, because you may well get +# less efficiency, and could conceivably trigger compiler bugs (has definitely happened, many times, with gcc). +# USE_UNION_TYPE=1
--- a/nt/xemacs.dsp Tue Jun 11 19:28:22 2002 +0000 +++ b/nt/xemacs.dsp Thu Jun 20 21:19:10 2002 +0000 @@ -58,7 +58,7 @@ # PROP Use_Debug_Libraries 1 # PROP Output_Dir "..\src" # PROP Intermediate_Dir "obj" -# PROP Cmd_Line "NMAKE /f xemacs.mak" +# PROP Cmd_Line "NMAKE /k /f xemacs.mak" # PROP Rebuild_Opt "/a" # PROP Target_File "..\src\xemacs.exe" # PROP Bsc_Name "..\src\temacs.bsc"
--- a/nt/xemacs.mak Tue Jun 11 19:28:22 2002 +0000 +++ b/nt/xemacs.mak Thu Jun 20 21:19:10 2002 +0000 @@ -164,20 +164,27 @@ !if !defined(HAVE_DIALOGS) HAVE_DIALOGS=1 !endif -!if !defined(HAVE_MSW_C_DIRED) -HAVE_MSW_C_DIRED=1 -!endif !if !defined(HAVE_NATIVE_SOUND) HAVE_NATIVE_SOUND=1 !endif !if !defined(HAVE_WIDGETS) HAVE_WIDGETS=1 !endif +!if !defined(OPTIMIZED_BUILD) +OPTIMIZED_BUILD=1 +!endif +!if !defined(USE_FASTCALL) +# #### Change to 1 when I check in the ws with support for fastcall +USE_FASTCALL=0 +!endif +!if !defined(PROFILE_SUPPORT) +PROFILE_SUPPORT=0 +!endif !if !defined(DEBUG_XEMACS) DEBUG_XEMACS=0 !endif -!if !defined(OPTIMIZED_BUILD) -OPTIMIZED_BUILD=0 +!if !defined(HAVE_VC6) +HAVE_VC6=1 !endif !if !defined(ERROR_CHECK_ALL) # Turn off when not a beta XEmacs. @@ -186,15 +193,21 @@ !if !defined(QUICK_BUILD) QUICK_BUILD=0 !endif +!if !defined(VERBOSECC) +VERBOSECC=0 +!endif +!if !defined(DEPEND) +DEPEND=0 +!endif +!if !defined(USE_PORTABLE_DUMPER) +USE_PORTABLE_DUMPER=1 +!endif !if !defined(USE_UNION_TYPE) USE_UNION_TYPE=0 !endif !if !defined(USE_MINITAR) USE_MINITAR=$(HAVE_ZLIB) !endif -!if !defined(USE_PORTABLE_DUMPER) -USE_PORTABLE_DUMPER=1 -!endif # A little bit of adhockery. Default to use system malloc and # DLL version of the C runtime library when using portable @@ -323,9 +336,6 @@ # # Whether to use dependency information generated by make-src-depend # -!if !defined(DEPEND) -DEPEND=0 -!endif !if $(DEPEND) && exist("$(SRC)\depend") ! if [if not exist $(OUTDIR)\nul mkdir "$(OUTDIR)"] ! endif @@ -341,9 +351,6 @@ # # Compiler command echo control. Define VERBOSECC=1 to get verbose compilation. # -!if !defined(VERBOSECC) -VERBOSECC=0 -!endif !if $(VERBOSECC) CCV=$(CC) !else @@ -351,33 +358,81 @@ !endif !if $(DEBUG_XEMACS) -DEBUGFLAGS=-Zi -!else -DEBUGFLAGS= -!endif -!if $(OPTIMIZED_BUILD) -OPTFLAGS=-O2 -G5 +# ---- Debugging support ---- +! if $(HAVE_VC6) +# support edit-and-continue +DEBUG_FLAGS_COMPILE=-ZI +! else +DEBUG_FLAGS_COMPILE=-Zi +! endif +DEBUG_FLAGS_LINK=-debug:full +DEBUG_DEFINES=-DDEBUG_XEMACS -D_DEBUG +#BROWSERFLAGS=-Fr -Fd$(OUTDIR)\temacs.pdb +BROWSERFLAGS=-Fr$*.sbr -Fd$(OUTDIR)\temacs.pdb + !else -OPTFLAGS=-Od + +# ---- No debugging support ---- +DEBUG_FLAGS_COMPILE= +DEBUG_FLAGS_LINK=-incremental:no +DEBUG_DEFINES=-DDEBUG_XEMACS -D_DEBUG +BROWSERFLAGS= + !endif !if $(USE_CRTDLL) -!if $(DEBUG_XEMACS) +! if $(DEBUG_XEMACS) C_LIBFLAG=-MDd LIBC_LIB=msvcrtd.lib -!else +! else C_LIBFLAG=-MD LIBC_LIB=msvcrt.lib -!endif +! endif !else C_LIBFLAG=-ML LIBC_LIB=libc.lib !endif -CFLAGS_NO_LIB=-nologo -W3 -DSTRICT $(DEBUGFLAGS) $(OPTFLAGS) +!if $(OPTIMIZED_BUILD) +# -G5 means optimize for Pentium. (According to the code-optimization +# article, -GB is the same as -G5, and -G6, i.e. optimze for Pentium Pro, +# gains you little over -G5 for PPro's but causes big slowdowns for +# Pentiums.) -GF means put strings in read-only memory; -Gr means use +# fastcall convention. Another possible addition: -Ob2 -- allows inlining +# of any function, not just those declared inline. Potential code size +# increase, though. +# +# #### Note: fastcall doesn't actually seem to make any difference, at least +# not using the (admittedly unscientific) test of (hanoi 6). The +# optimization article claims 1-2% improvement in both speed and size. +OPTFLAGS_FASTCALL =-O2 -G5 -Gr -Ob2 +OPTFLAGS_CDECL =-O2 -G5 -Ob2 +!else +OPTFLAGS_FASTCALL =-Od +OPTFLAGS_CDECL =-Od +!endif + +!if $(USE_FASTCALL) +OPTFLAGS = $(OPTFLAGS_FASTCALL) +!else +OPTFLAGS = $(OPTFLAGS_CDECL) +!endif + +!if $(PROFILE_SUPPORT) +PROFILE_FLAGS=-profile +!else +PROFILE_FLAGS= +!endif + +CFLAGS_NO_OPT=-nologo -W3 -DSTRICT $(DEBUG_FLAGS_COMPILE) + +CFLAGS_NO_LIB=$(CFLAGS_NO_OPT) $(OPTFLAGS) CFLAGS=$(CFLAGS_NO_LIB) $(C_LIBFLAG) +CFLAGS_CDECL_NO_LIB=$(CFLAGS_NO_OPT) $(OPTFLAGS_CDECL) +CFLAGS_CDECL=$(CFLAGS_CDECL_NO_LIB) $(C_LIBFLAG) + !if $(HAVE_X_WINDOWS) X_DEFINES=-DHAVE_X_WINDOWS X_INCLUDES=-I$(X11_DIR)\include @@ -389,10 +444,6 @@ MSW_INCLUDES= MSW_LIBS=comctl32.lib -!if $(HAVE_MSW_C_DIRED) -MSW_DEFINES=$(MSW_DEFINES) -DHAVE_MSW_C_DIRED -MSW_C_DIRED_OBJ=$(OUTDIR)\dired-msw.obj -!endif !if $(HAVE_XPM) MSW_DEFINES=$(MSW_DEFINES) -DHAVE_XPM -DFOR_MSW MSW_INCLUDES=$(MSW_INCLUDES) -I"$(XPM_DIR)" -I"$(XPM_DIR)\lib" @@ -455,11 +506,6 @@ MULE_DEFINES=-DMULE !endif -!if $(DEBUG_XEMACS) -DEBUG_DEFINES=-DDEBUG_XEMACS -D_DEBUG -DEBUG_FLAGS=-debug:full -!endif - !if $(QUICK_BUILD) QUICK_DEFINES=-DQUICK_BUILD !endif @@ -557,7 +603,7 @@ !endif -LINK_DEPENDENCY_ARGS = -Fe$@ -Fd$* $** -link -incremental:no +LINK_DEPENDENCY_ARGS = -Fe$@ -Fd$* $** -link $(DEBUG_FLAGS_LINK) LINK_STANDARD_LIBRARY_ARGS = setargv.obj user32.lib wsock32.lib # Inferred rule @@ -575,9 +621,10 @@ $(LIB_SRC)/movemail.exe : $(LIB_SRC)/movemail.c $(LIB_SRC)/pop.c $(ETAGS_DEPS) +# Minitar uses zlib so just use cdecl to simplify things $(LIB_SRC)/minitar.exe : $(NT)/minitar.c cd $(LIB_SRC) - $(CCV) -I"$(ZLIB_DIR)" $(LIB_SRC_DEFINES) $(CFLAGS_NO_LIB) $(LINK_DEPENDENCY_ARGS) "$(ZLIB_DIR)\zlib.lib" + $(CCV) -I"$(ZLIB_DIR)" $(LIB_SRC_DEFINES) $(CFLAGS_CDECL_NO_LIB) $(LINK_DEPENDENCY_ARGS) "$(ZLIB_DIR)\zlib.lib" cd $(NT) LIB_SRC_TOOLS = \ @@ -604,15 +651,6 @@ #------------------------------------------------------------------------------ -# dump-id.c file that contains the dump id - -$(SRC)\dump-id.c : $(LIB_SRC)/make-dump-id.exe - cd $(SRC) - $(LIB_SRC)\make-dump-id.exe - cd $(NT) - -#------------------------------------------------------------------------------ - # LASTFILE Library !if !$(USE_SYSTEM_MALLOC) || !$(USE_PORTABLE_DUMPER) @@ -700,12 +738,11 @@ oldnames.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib \ shell32.lib wsock32.lib netapi32.lib winmm.lib winspool.lib ole32.lib \ mpr.lib uuid.lib imm32.lib $(LIBC_LIB) -TEMACS_LFLAGS=-nologo $(LIBRARIES) $(DEBUG_FLAGS) -base:0x1000000\ +TEMACS_LFLAGS=-nologo $(LIBRARIES) $(DEBUG_FLAGS_LINK) -base:0x1000000\ -stack:0x800000 $(TEMACS_ENTRYPOINT) -subsystem:windows\ -pdb:$(TEMACS_DIR)\temacs.pdb -map:$(TEMACS_DIR)\temacs.map \ - -heap:0x00100000 -nodefaultlib -incremental:no setargv.obj -TEMACS_CPP_FLAGS=-c \ - $(CFLAGS) $(INCLUDES) $(DEFINES) $(DEBUG_DEFINES) \ + -heap:0x00100000 -nodefaultlib $(PROFILE_FLAGS) setargv.obj +TEMACS_CPP_FLAGS_NO_CFLAGS=-c $(INCLUDES) $(DEFINES) $(DEBUG_DEFINES) \ -DEMACS_MAJOR_VERSION=$(emacs_major_version) \ -DEMACS_MINOR_VERSION=$(emacs_minor_version) \ $(EMACS_BETA_VERSION) \ @@ -713,6 +750,8 @@ -DXEMACS_CODENAME=\"$(xemacs_codename:&=and)\" \ -DEMACS_CONFIGURATION=\"$(EMACS_CONFIGURATION)\" \ -DPATH_PACKAGEPATH=\"$(PATH_PACKAGEPATH)\" +TEMACS_CPP_FLAGS=$(CFLAGS) $(TEMACS_CPP_FLAGS_NO_CFLAGS) +TEMACS_CPP_CDECL_FLAGS=$(CFLAGS_CDECL) $(TEMACS_CPP_FLAGS_NO_CFLAGS) !if $(HAVE_X_WINDOWS) TEMACS_X_OBJS=\ @@ -750,7 +789,7 @@ $(OUTDIR)\objects-msw.obj \ $(OUTDIR)\redisplay-msw.obj \ $(OUTDIR)\select-msw.obj \ - $(MSW_C_DIRED_OBJ) \ + $(OUTDIR)\dired-msw.obj \ $(MSW_MENUBAR_OBJ) \ $(MSW_SCROLLBAR_OBJ) \ $(MSW_TOOLBAR_OBJ) \ @@ -853,6 +892,7 @@ $(OUTDIR)\intl-encap-win32.obj \ $(OUTDIR)\intl-auto-encap-win32.obj \ $(OUTDIR)\keymap.obj \ + $(OUTDIR)\libinterface.obj \ $(OUTDIR)\line-number.obj \ $(OUTDIR)\lread.obj \ $(OUTDIR)\lstream.obj \ @@ -860,6 +900,7 @@ $(OUTDIR)\marker.obj \ $(OUTDIR)\md5.obj \ $(OUTDIR)\minibuf.obj \ +# #### Leave the next one out when integrating my working ws $(OUTDIR)\nt.obj \ $(OUTDIR)\ntplay.obj \ $(OUTDIR)\objects.obj \ @@ -895,22 +936,27 @@ .SUFFIXES: .SUFFIXES: .c .obj .texi .info -# nmake rule -!if $(DEBUG_XEMACS) -{$(TEMACS_SRC)}.c{$(OUTDIR)}.obj: - $(CCV) $(TEMACS_CPP_FLAGS) $< -Fo$@ -Fr$*.sbr -Fd$(OUTDIR)\temacs.pdb -!else +# nmake rule with batching: +#{$(TEMACS_SRC)}.c{$(OUTDIR)}.obj: +# echo $< >> $(OUTDIR)\listfile.tmp + {$(TEMACS_SRC)}.c{$(OUTDIR)}.obj: - $(CCV) $(TEMACS_CPP_FLAGS) $< -Fo$@ -!endif + $(CCV) $(TEMACS_CPP_FLAGS) $< -Fo$@ $(BROWSERFLAGS) -$(OUTDIR)\emacs.obj: $(XEMACS)\version.sh +# An explicit rule looks like this ($< works only in implicit rules): +# $(OUTDIR)\foo.obj: $(TEMACS_SRC)\foo.c +# $(CCV) $(TEMACS_CPP_FLAGS) $(TEMACS_SRC)\$(@B).c -Fo$@ $(BROWSERFLAGS) -$(OUTDIR)\TopLevelEmacsShell.obj: $(TEMACS_SRC)\EmacsShell-sub.c - $(CCV) $(TEMACS_CPP_FLAGS) -DDEFINE_TOP_LEVEL_EMACS_SHELL $(TEMACS_SRC)\$(@B).c -Fo$@ +$(OUTDIR)\emacs.obj: $(XEMACS)\version.sh + +$(OUTDIR)\TopLevelEmacsShell.obj: $(TEMACS_SRC)\EmacsShell-sub.c + $(CCV) $(TEMACS_CPP_FLAGS) -DDEFINE_TOP_LEVEL_EMACS_SHELL $(TEMACS_SRC)\$(@B).c -Fo$@ $(BROWSERFLAGS) $(OUTDIR)\TransientEmacsShell.obj: $(TEMACS_SRC)\EmacsShell-sub.c - $(CCV) $(TEMACS_CPP_FLAGS) -DDEFINE_TRANSIENT_EMACS_SHELL $(TEMACS_SRC)\$(@B).c -Fo$@ + $(CCV) $(TEMACS_CPP_FLAGS) -DDEFINE_TRANSIENT_EMACS_SHELL $(TEMACS_SRC)\$(@B).c -Fo$@ $(BROWSERFLAGS) + +$(OUTDIR)\libinterface.obj: $(TEMACS_SRC)\libinterface.c + $(CCV) $(TEMACS_CPP_CDECL_FLAGS) $(TEMACS_SRC)\$(@B).c -Fo$@ $(BROWSERFLAGS) #$(TEMACS_SRC)\Emacs.ad.h: $(XEMACS)\etc\Emacs.ad # !"sed -f ad2c.sed < $(XEMACS)\etc\Emacs.ad > $(TEMACS_SRC)\Emacs.ad.h" @@ -918,31 +964,57 @@ #$(TEMACS_SRC)\paths.h: $(TEMACS_SRC)\paths.h.in # !"cd $(TEMACS_SRC); cp paths.h.in paths.h" -$(TEMACS): $(TEMACS_INCLUDES) $(TEMACS_OBJS) $(OUTDIR)\xemacs.res -!if $(DEBUG_XEMACS) +create-list-file: + @if exist $(OUTDIR)\listfile.tmp del $(OUTDIR)\listfile.tmp + +compile-list-file: + cd $(OUTDIR) + @if exist listfile.tmp $(CC) $(TEMACS_CPP_FLAGS) @listfile.tmp $(BROWSERFLAGS) + +$(TEMACS_BROWSE): $(TEMACS_OBJS) @dir /b/s $(OUTDIR)\*.sbr > $(OUTDIR)\bscmake.tmp bscmake -nologo -o$(TEMACS_BROWSE) @$(OUTDIR)\bscmake.tmp -$(DEL) $(OUTDIR)\bscmake.tmp + +# dump-id.c file that contains the dump id + +$(OUTDIR)\dump-id.obj : $(SRC)\dump-id.c + cd $(OUTDIR) + $(CCV) $(TEMACS_CPP_FLAGS) $(TEMACS_SRC)\$(@B).c $(BROWSERFLAGS) + +$(SRC)\dump-id.c : $(LIB_SRC)/make-dump-id.exe $(TEMACS_OBJS) + cd $(SRC) + $(LIB_SRC)\make-dump-id.exe + cd $(NT) + +!if $(USE_PORTABLE_DUMPER) +TEMACS_DUMP_ID_OBJ = $(OUTDIR)\dump-id.obj +!else +TEMACS_DUMP_ID_OBJ = +!endif + +!if $(DEBUG_XEMACS) +$(TEMACS): $(TEMACS_OBJS) $(OUTDIR)\temacs.res $(TEMACS_BROWSE) $(TEMACS_DUMP_ID_OBJ) +!else +$(TEMACS): $(TEMACS_OBJS) $(OUTDIR)\temacs.res $(TEMACS_DUMP_ID_OBJ) !endif !if $(USE_PORTABLE_DUMPER) - @if exist $(SRC)\dump-id.c $(DEL) $(SRC)\dump-id.c -# make a new dump id file. There is probably a better way to do this, but this works - @if exist $(OUTDIR)\dump-id.obj $(DEL) $(OUTDIR)\dump-id.obj - nmake -nologo -f xemacs.mak OUTDIR=$(OUTDIR) $(OUTDIR)\dump-id.obj + cd $(NT) link.exe @<< - $(TEMACS_LFLAGS) -out:$@ $(TEMACS_OBJS) $(TEMACS_LIBS) $(OUTDIR)\dump-id.obj + $(TEMACS_LFLAGS) -out:$@ $(TEMACS_OBJS) $(TEMACS_LIBS) $(TEMACS_DUMP_ID_OBJ) << !else link.exe @<< - $(TEMACS_LFLAGS) -out:$@ $(TEMACS_OBJS) $(OUTDIR)\xemacs.res $(TEMACS_LIBS) + $(TEMACS_LFLAGS) -out:$@ $(TEMACS_OBJS) $(OUTDIR)\temacs.res $(TEMACS_LIBS) << !endif -$(OUTDIR)\xemacs.res: xemacs.rc +$(OUTDIR)\temacs.res: $(NT)\xemacs.rc + cd $(NT) rc -Fo$@ xemacs.rc -PROGNAME=$(SRC)\xemacs.exe +PROGNAME=$(TEMACS_DIR)\xemacs.exe BATCH = -no-packages -batch BATCH_PACKAGES = -vanilla -batch TEMACS_BATCH = "$(LIB_SRC)\i" "$(TEMACS)" $(BATCH) @@ -953,7 +1025,7 @@ # Section handling automated tests starts here blddir=$(MAKEDIR:\=\\)\\.. -temacs_loadup=$(TEMACS_BATCH) -l $(LISP)/loadup.el +temacs_loadup= dump_temacs = $(temacs_loadup) dump run_temacs = $(temacs_loadup) run-temacs ## We have automated tests!! @@ -963,12 +1035,12 @@ # .PHONY: check check-temacs check: - cd $(SRC) + cd $(TEMACS_DIR) $(PROGNAME) $(batch_test_emacs) check-temacs: - cd $(SRC) - $(run_temacs) $(batch_test_emacs) + cd $(TEMACS_DIR) + $(TEMACS_BATCH) -l $(LISP)/loadup.el run-temacs $(batch_test_emacs) # Section handling automated tests ends here @@ -1215,11 +1287,13 @@ $(DOC): $(LIB_SRC)\make-docfile.exe make-docargs if exist $(DOC) $(DEL) $(DOC) - $(TEMACS_BATCH) -l $(TEMACS_DIR)\..\lisp\make-docfile.el -- -o $(DOC) -i $(XEMACS)\site-packages + cd $(TEMACS_DIR) + $(TEMACS_BATCH) -l $(LISP)\make-docfile.el -- -o $(DOC) -i $(XEMACS)\site-packages $(LIB_SRC)\make-docfile.exe -a $(DOC) @$(OUTDIR)\make-docfile.tmp update-elc: - $(TEMACS_BATCH) -l $(TEMACS_DIR)\..\lisp\update-elc.el + cd $(TEMACS_DIR) + $(TEMACS_BATCH) -l $(LISP)\update-elc.el # This file is touched by update-elc.el when redumping is necessary. $(TEMACS_DIR)\NEEDTODUMP : @@ -1228,10 +1302,12 @@ # This rule dumps xemacs and then possibly spawns sub-make if PURESPACE # requirements have changed. +$(TEMACS_DIR)\SATISFIED: $(PROGNAME) + $(PROGNAME) : $(TEMACS) $(TEMACS_DIR)\NEEDTODUMP @echo >$(TEMACS_DIR)\SATISFIED cd $(TEMACS_DIR) - $(TEMACS_BATCH) -l $(TEMACS_DIR)\..\lisp\loadup.el dump + $(TEMACS_BATCH) -l $(LISP)\loadup.el dump !if $(USE_PORTABLE_DUMPER) rc -d INCLUDE_DUMP -Fo $(OUTDIR)\xemacs.res $(NT)\xemacs.rc # Make the resource section read/write since almost all of it is the dump @@ -1242,7 +1318,7 @@ -$(DEL) $(TEMACS_DIR)\xemacs.dmp !endif cd $(NT) - @if not exist $(TEMACS_DIR)\SATISFIED nmake -nologo -f xemacs.mak $@ + @if not exist $(TEMACS_DIR)\SATISFIED $(MAKE) /$(MAKEFLAGS) -nologo -f xemacs.mak $@ #------------------------------------------------------------------------------ # use this rule to build the complete system @@ -1263,7 +1339,7 @@ @$(COPY) $(LIB_SRC)\*.exe "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)\" @$(COPY) $(LIB_SRC)\DOC "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" @$(COPY) $(CONFIG_VALUES) "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" - @$(COPY) $(SRC)\xemacs.exe "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" + @$(COPY) $(TEMACS_DIR)\xemacs.exe "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" @$(COPYDIR) $(XEMACS)\etc "$(INSTALL_DIR)\etc\" @$(COPYDIR) $(XEMACS)\info "$(INSTALL_DIR)\info\" @$(COPYDIR) $(XEMACS)\lisp "$(INSTALL_DIR)\lisp\" @@ -1283,10 +1359,10 @@ -$(DEL) $(OUTDIR)\*.pdb -$(DEL) $(OUTDIR)\*.res -$(DEL) $(OUTDIR)\*.sbr - -$(DEL) $(SRC)\*.exe - -$(DEL) $(SRC)\*.map + -$(DEL) $(TEMACS_DIR)\*.exe + -$(DEL) $(TEMACS_DIR)\*.map -$(DEL) $(SRC)\*.bsc - -$(DEL) $(SRC)\*.pdb + -$(DEL) $(TEMACS_DIR)\*.pdb -$(DEL) $(LIB_SRC)\*.exe -$(DEL) $(LIB_SRC)\*.obj -$(DEL) $(LIB_SRC)\*.pdb @@ -1334,7 +1410,7 @@ realclean: distclean versionclean: - -$(DEL) $(SRC)\xemacs.exe + -$(DEL) $(TEMACS_DIR)\xemacs.exe -$(DEL) $(LIB_SRC)\DOC #not sure about those wildcards. DOS wildcards are stupid compared to Unix, @@ -1370,6 +1446,8 @@ XEmacs $(XEMACS_VERSION_STRING) $(xemacs_codename:"=\") configured for `$(EMACS_CONFIGURATION)'. + Building XEmacs using \"$(MAKE:\=\\)\". + Building XEmacs using make flags \"$(MAKEFLAGS)\". Building XEmacs in \"$(MAKEDIR:\=\\)\". !if defined(CCV) Using compiler \"$(CC) $(CFLAGS)\". @@ -1443,15 +1521,6 @@ !if $(HAVE_NATIVE_SOUND) Compiling in support for native sounds. !endif -!if $(HAVE_MSW_C_DIRED) - Compiling in fast dired implementation. -!else - -------------------------------------------------------------------- - WARNING: Define HAVE_MSW_C_DIRED to be non-zero if you want XEmacs - WARNING: to use C primitives to significantly speed up dired, at the - WARNING: expense of an additional ~4KB of code. - -------------------------------------------------------------------- -!endif !if $(USE_UNION_TYPE) Using union type for Lisp object storage. !endif
--- a/src/ChangeLog Tue Jun 11 19:28:22 2002 +0000 +++ b/src/ChangeLog Thu Jun 20 21:19:10 2002 +0000 @@ -1,3 +1,345 @@ +2002-06-20 Ben Wing <ben@xemacs.org> + + * s/cygwin32.h: + Allow pdump to work under Cygwin (mmap is broken, so need to undefine + HAVE_MMAP). + + * s/win32-common.h: + * s/win32-common.h (NO_MATHERR): + * s/windowsnt.h: + + Support for fastcall. Add WIN32_ANY for identifying all Win32 + variants (Cygwin, native, MinGW). Both of these are properly used + in another ws. + +2002-06-20 Ben Wing <ben@xemacs.org> + + * alloc.c: + * alloc.c (disksave_object_finalization): + * alloc.c (garbage_collect_1): + * balloon-x.c: + * balloon-x.c (alloc_color): + * balloon-x.c (init): + * buffer.c: + * buffer.c (Fkill_buffer): + * bytecode.c: + * callint.c: + * cm.c: + * cmdloop.c: + * cmdloop.c (Frecursive_edit): + * cmdloop.c (Fcommand_loop_1): + * cmds.c: + * console-gtk.c: + * console-gtk.h: + * console-msw.c: + * console-msw.h: + * console-msw.h (struct): + * console-msw.h (wrap_mswindows_dialog_id): + * console-stream.c: + * console-stream.h: + * console-stream.h (stream_canonicalize_device_connection): + * console-tty.c: + * console-tty.h: + * console-x.c: + * console-x.h: + * console-x.h (Xt_SET_VALUE): + * console.c: + * console.c (Fcdfw_console): + * console.h: + * console.h (CDFW_CONSOLE): + * device-gtk.c: + * device-gtk.c (gtk_delete_device): + * device-gtk.c (Fgtk_display_visual_class): + * device-gtk.c (syms_of_device_gtk): + * device-gtk.c (vars_of_device_gtk): + * device-msw.c: + * device-tty.c: + * device-x.c: + * device-x.c (x_init_device): + * device-x.c (x_delete_device): + * device-x.c (x_get_resource_prefix): + * device-x.c (Fdefault_x_device): + * device-x.c (vars_of_device_x): + * device.c: + * device.c (allocate_device): + * device.c (device_console): + * device.c (init_global_resources): + * device.c (init_device_resources): + * device.c (Fdefault_device): + * device.c (Fmake_device): + * device.c (delete_device_internal): + * device.c (call_critical_lisp_code): + * device.c (syms_of_device): + * device.c (vars_of_device): + * device.h: + * devslots.h: + * dialog-gtk.c: + * dialog-msw.c: + * dialog-x.c: + * dialog.c: + * dialog.c (Fmake_dialog_box_internal): + * dired-msw.c: + * editfns.c: + * emacs.c: + * event-Xt.c: + * event-Xt.c (change_frame_visibility): + * event-gtk.c: + * event-gtk.c (change_frame_visibility): + * event-gtk.c (gtk_event_to_emacs_event): + * event-msw.c: + * event-stream.c: + * event-tty.c: + * event-unixoid.c: + * events.c: + * extents.c: + * extents.h: + * extents.h (glyph_layout): + * faces.c: + * faces.c (face_property_matching_instance): + * faces.c (init_global_faces): + * faces.c (init_device_faces): + * faces.c (complex_vars_of_faces): + * fileio.c: + * fns.c: + * frame-gtk.c: + * frame-gtk.c (INTERNAL_BORDER_WIDTH): + * frame-msw.c: + * frame-tty.c: + * frame-x.c: + * frame.c: + * frame.c (decode_frame_or_selected): + * frame.h: + * frame.h (FW_FRAME): + * frame.h (Value): Removed. + * frame.h (0): Removed. + * glyphs-eimage.c: + * glyphs-gtk.c: + * glyphs-gtk.c (gtk_locate_pixmap_file): + * glyphs-msw.c: + * glyphs-widget.c: + * glyphs-x.c: + * glyphs-x.c (x_locate_pixmap_file): + * glyphs.c: + * glyphs.c (decode_device_ii_format): + * glyphs.c (Fimage_instance_instantiator): + * glyphs.c (syms_of_glyphs): + * glyphs.h: + * gui-gtk.c: + * gui-msw.c: + * gui-x.c: + * gui-x.c (popup_selection_callback): + * gui.c: + * gutter.c: + * input-method-xlib.c: + * intl-encap-win32.c: + * intl-win32.c: + * intl-win32.c (getacp): + * intl-win32.c (mswindows_get_registry_charset): + * intl-win32.c (syms_of_intl_win32): + * intl-win32.c (vars_of_intl_win32): + * keymap.c: + * lisp.h: + * macros.c: + * menubar-gtk.c: + * menubar-msw.c: + * menubar-x.c: + * menubar.c: + * menubar.h: + * minibuf.c: + * mule-charset.c: + * mule-charset.c (Fset_charset_ccl_program): + * nt.c: + * objects-gtk.c: + * objects-gtk.c (gtk_initialize_font_instance): + * objects-gtk.c (gtk_print_font_instance): + * objects-gtk.c (gtk_font_instance_truename): + * objects-gtk.c (gtk_font_spec_matches_charset): + * objects-gtk.c (console_type_create_objects_gtk): + * objects-gtk.c (gtk_find_charset_font): + * objects-gtk.h: + * objects-msw.c: + * objects-msw.c (charset_map): + * objects-msw.c (font_enum_callback_2): + * objects-msw.c (sort_font_list_function): + * objects-msw.c (mswindows_enumerate_fonts): + * objects-msw.c (parse_font_spec): + * objects-msw.c (create_hfont_from_font_spec): + * objects-msw.c (initialize_font_instance): + * objects-msw.c (mswindows_list_fonts): + * objects-msw.c (mswindows_font_instance_truename): + * objects-msw.c (mswindows_font_spec_matches_charset_stage_1): + * objects-msw.c (mswindows_font_spec_matches_charset_stage_2): + * objects-msw.c (mswindows_font_spec_matches_charset): + * objects-msw.c (mswindows_find_charset_font): + * objects-msw.h: + * objects-msw.h (mswindows_color_to_string): + * objects-tty.c: + * objects-tty.c (tty_font_spec_matches_charset): + * objects-tty.c (tty_find_charset_font): + * objects-tty.h: + * objects-x.c: + * objects-x.c (x_initialize_font_instance): + * objects-x.c (x_print_font_instance): + * objects-x.c (x_font_instance_truename): + * objects-x.c (x_font_spec_matches_charset): + * objects-x.c (x_find_charset_font): + * objects-x.c (console_type_create_objects_x): + * objects-x.h: + * objects.c: + * objects.c (mark_font_instance): + * objects.c (Fmake_font_instance): + * objects.c (font_validate_matchspec): + * objects.c (initialize_charset_font_caches): + * objects.c (font_instantiate): + * objects.c (reinit_vars_of_objects): + * objects.h: + * postgresql.c: + * print.c: + * process.h: + * redisplay-gtk.c: + * redisplay-msw.c: + * redisplay-output.c: + * redisplay-tty.c: + * redisplay-x.c: + * redisplay.c: + * redisplay.c (text_cursor_visible_p_changed): + * redisplay.h: + * scrollbar-gtk.c: + * scrollbar-msw.c: + * scrollbar-x.c: + * scrollbar.c: + * select-gtk.c: + * select-msw.c: + * select-x.c: + * select.c: + * signal.c: + * sound.c: + * specifier.c: + * specifier.c (print_specifier): + * specifier.c (setup_device_initial_specifier_tags): + * specifier.c (Fspecifier_matching_instance): + * symbols.c: + * syntax.c (signal_syntax_table_extent_changed): + * sysdep.c: + * syssignal.h: + * syswindows.h: + * toolbar-common.c: + * toolbar-gtk.c: + * toolbar-msw.c: + * toolbar-msw.c (mswindows_clear_toolbar): + * toolbar-msw.c (mswindows_free_frame_toolbars): + * toolbar-x.c: + * toolbar.c: + * unicode.c: + * window.c: + * window.c (decode_window): + * window.h: + * window.h (WINDOW_XFRAME): + * window.h (XWINDOW_FRAME): + * window.h (CHECK_LIVE_WINDOW): + * window.h (window_divider_width): + + The following are the major changes made: + + (1) Separation of various header files into an external and an + internal version, similar to the existing separation of process.h + and procimpl.h. Eventually this should be done for all Lisp + objects. The external version has the same name as currently; the + internal adds -impl. The external file has XFOO() macros for + objects, but the structure is opaque and defined only in the + internal file. It's now reasonable to move all prototypes in + lisp.h into the appropriate external file, and this should be + done. Currently, separation has been done on extents.h, + objects*.h, console.h, device.h, frame.h, and window.h. + + For c/d/f/w, the most basic properties are available in the + external header file, with the macros resolving to functions. In + the internal header file, the macros are redefined to directly + access the structure. Also, the global MARK_FOO_CHANGED macros + have been made into functions so that they can be accessed without + needing to include lots of -impl headers -- they are used in + almost exclusively in non-time-critical functions, and take up + enough time that the function overhead will be negligible. + Similarly, the function overhead from making the basic properties + mentioned above into functions is negligible, and code that does + heavy accessing of c/d/f/w structures inevitably ends up needing + the internal header files, anyway. + + (2) More face changes. + + -- Major rewrite of objects-msw.c. Now handles wildcard specs + properly, rather than "truenaming" (or even worse, signalling an + error, which previously happened with some of the fallbacks if you + tried to use them in make-font-instance!). + + -- Split charset matching of fonts into two stages -- one to find + a font specifically designed for a particular charset (by + examining its registry), the second to find a Unicode font that + can support the charset. This needs to proceed as two complete, + separate instantiations in order to work properly (otherwise many + of the fonts in the HELLO page look wrong). This should also make + it easy to support iso10646 (Unicode) fonts under X. + + -- All default values for fonts are now completely specified in + the fallbacks. Stuff from mule-x-init.el has all been moved here, + merged with the existing specs, and totally rethought so you get + sensible results. (HELLO now looks much better!). + + -- Generalize the "default X/GTK device" stuff into a + per-device-type "default device". + + -- Add mswindows-{set-}charset-registry. In time, + charset<->code-page conversion functions will be removed. + + -- Wrap protective code around calls to compute device specifier tags, + and do this computation before calling the face initialization code + because the latter may need these tags to be correctly updated. + + (3) Other changes. + + * EmacsFrame.c: + * EmacsFrame.c (EmacsFrameSetValues): + * glyphs-msw.c: + * eval.c: + * gui-x.c: + * intl-encap-win32.c: + * search.c (Fstore_match_data): + * search.c: + * signal.c: + * toolbar-msw.c: + * unicode.c: + Warning fixes. + + * config.h.in: + #undefs meant to be frobbed by configure *MUST* go inside of + #ifndef WIN32_NO_CONFIGURE, and everything else *MUST* go outside! + + * eval.c (Fbacktrace): + Let detailed backtraces be detailed. + * specifier.c: + Don't override user's print-string-length/print-length settings. + + * glyphs.c: New function image-instance-instantiator. + + * config.h.in: + * sysdep.c (set_descriptor_non_blocking): + * sysdep.c (SIG_PARAM_TYPE): + * sysdep.c (struct save_signal): + * sysdep.c (save_signal_handlers): + * sysdep.c (retry_open): + * sysdep.c (qxe_open): + Changes for fastcall. + + * sysdep.c (qxe_rename): + * nt.c (mswindows_rename): + Fix up a previous botched patch that tried to add support for both + EEXIST and EACCES. IF THE BOTCHED PATCH WENT INTO 21.4, THIS FIXUP + NEEDS TO GO IN, TOO. + + * search.c (skip_chars): + Fix *evil* crash due to incorrect synching of syntax-cache code + with 21.1. THIS SHOULD GO INTO 21.4. + 2002-06-07 William M. Perry <wmperry@gnu.org> * frame-x.c (init_x_prop_symbols): Don't attempt to expose the
--- a/src/EmacsFrame.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/EmacsFrame.c Thu Jun 20 21:19:10 2002 +0000 @@ -29,13 +29,13 @@ #include <config.h> #include "lisp.h" -#include "device.h" +#include "device-impl.h" #include "faces.h" -#include "frame.h" +#include "frame-impl.h" #include "toolbar.h" #include "window.h" -#include "console-x.h" +#include "console-x-impl.h" #include "glyphs-x.h" #include "objects-x.h" @@ -382,7 +382,6 @@ EmacsFrame cur = (EmacsFrame) cur_widget; EmacsFrame new = (EmacsFrame) new_widget; struct frame *f = new->emacs_frame.frame; - Lisp_Object frame = wrap_frame (f); in_resource_setting++; /* This function does not need to do much. Pretty much everything interesting will get done in the resize method, which will @@ -420,13 +419,13 @@ Fadd_spec_to_specifier (Vscrollbar_width, make_int (new->emacs_frame.scrollbar_width), - frame, Qnil, Qnil); + wrap_frame (f), Qnil, Qnil); if (cur->emacs_frame.scrollbar_height != new->emacs_frame.scrollbar_height) Fadd_spec_to_specifier (Vscrollbar_height, make_int (new->emacs_frame.scrollbar_height), - frame, Qnil, Qnil); + wrap_frame (f), Qnil, Qnil); #endif /* HAVE_SCROLLBARS */ #ifdef HAVE_TOOLBARS if (cur->emacs_frame.top_toolbar_height != @@ -434,49 +433,49 @@ Fadd_spec_to_specifier (Vtoolbar_size[TOP_TOOLBAR], make_int (new->emacs_frame.top_toolbar_height), - frame, Qnil, Qnil); + wrap_frame (f), Qnil, Qnil); if (cur->emacs_frame.bottom_toolbar_height != new->emacs_frame.bottom_toolbar_height) Fadd_spec_to_specifier (Vtoolbar_size[BOTTOM_TOOLBAR], make_int (new->emacs_frame.bottom_toolbar_height), - frame, Qnil, Qnil); + wrap_frame (f), Qnil, Qnil); if (cur->emacs_frame.left_toolbar_width != new->emacs_frame.left_toolbar_width) Fadd_spec_to_specifier (Vtoolbar_size[LEFT_TOOLBAR], make_int (new->emacs_frame.left_toolbar_width), - frame, Qnil, Qnil); + wrap_frame (f), Qnil, Qnil); if (cur->emacs_frame.right_toolbar_width != new->emacs_frame.right_toolbar_width) Fadd_spec_to_specifier (Vtoolbar_size[RIGHT_TOOLBAR], make_int (new->emacs_frame.right_toolbar_width), - frame, Qnil, Qnil); + wrap_frame (f), Qnil, Qnil); if (cur->emacs_frame.top_toolbar_border_width != new->emacs_frame.top_toolbar_border_width) Fadd_spec_to_specifier (Vtoolbar_border_width[TOP_TOOLBAR], make_int (new->emacs_frame.top_toolbar_border_width), - frame, Qnil, Qnil); + wrap_frame (f), Qnil, Qnil); if (cur->emacs_frame.bottom_toolbar_border_width != new->emacs_frame.bottom_toolbar_border_width) Fadd_spec_to_specifier (Vtoolbar_border_width[BOTTOM_TOOLBAR], make_int (new->emacs_frame.bottom_toolbar_border_width), - frame, Qnil, Qnil); + wrap_frame (f), Qnil, Qnil); if (cur->emacs_frame.left_toolbar_border_width != new->emacs_frame.left_toolbar_border_width) Fadd_spec_to_specifier (Vtoolbar_border_width[LEFT_TOOLBAR], make_int (new->emacs_frame.left_toolbar_border_width), - frame, Qnil, Qnil); + wrap_frame (f), Qnil, Qnil); if (cur->emacs_frame.right_toolbar_border_width != new->emacs_frame.right_toolbar_border_width) Fadd_spec_to_specifier (Vtoolbar_border_width[RIGHT_TOOLBAR], make_int (new->emacs_frame.right_toolbar_border_width), - frame, Qnil, Qnil); + wrap_frame (f), Qnil, Qnil); #endif /* HAVE_TOOLBARS */ in_resource_setting--;
--- a/src/alloc.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/alloc.c Thu Jun 20 21:19:10 2002 +0000 @@ -49,10 +49,11 @@ #include "device.h" #include "elhash.h" #include "events.h" -#include "extents.h" -#include "frame.h" +#include "extents-impl.h" +#include "frame-impl.h" #include "glyphs.h" #include "opaque.h" +#include "process.h" #include "redisplay.h" #include "specifier.h" #include "sysfile.h" @@ -3475,6 +3476,7 @@ Flocate_file_clear_hashing (Qt); uncache_home_directory (); zero_out_command_line_status_vars (); + clear_default_devices (); #if defined(LOADHIST) && !(defined(LOADHIST_DUMPED) || \ defined(LOADHIST_BUILTIN)) @@ -3608,7 +3610,7 @@ Lisp_Object device = Fselected_device (Qnil); if (NILP (device)) /* Could happen during startup, eg. if always_gc */ return; - frame = DEVICE_SELECTED_FRAME (XDEVICE (device)); + frame = Fselected_frame (device); if (NILP (frame)) invalid_state ("No frames exist on device", device); f = XFRAME (frame);
--- a/src/balloon-x.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/balloon-x.c Thu Jun 20 21:19:10 2002 +0000 @@ -24,8 +24,8 @@ #include <config.h> #include "lisp.h" -#include "device.h" -#include "console-x.h" +#include "device-impl.h" +#include "console-x-impl.h" #include "balloon_help.h" @@ -34,7 +34,7 @@ static unsigned long alloc_color (Display* dpy, const char* colorname, int light) { - Colormap cmap = DEVICE_X_COLORMAP (XDEVICE(Vdefault_x_device)); + Colormap cmap = DEVICE_X_COLORMAP (XDEVICE (get_default_device (Qx))); unsigned long pixel = 0; XColor color; @@ -84,7 +84,7 @@ { Pixel fg, bg, shine, shadow; XFontStruct* font; - Display *dpy = DEVICE_X_DISPLAY (XDEVICE (Vdefault_x_device)); + Display *dpy = DEVICE_X_DISPLAY (XDEVICE (get_default_device (Qx))); fg = alloc_color (dpy, "grey60", 1); bg = alloc_color (dpy, "black", 0);
--- a/src/buffer.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/buffer.c Thu Jun 20 21:19:10 2002 +0000 @@ -80,12 +80,12 @@ #include "chartab.h" #include "casetab.h" #include "commands.h" -#include "device.h" +#include "device-impl.h" #include "elhash.h" #include "extents.h" #include "faces.h" #include "file-coding.h" -#include "frame.h" +#include "frame-impl.h" #include "insdel.h" #include "lstream.h" #include "process.h" /* for kill_buffer_processes */ @@ -1187,7 +1187,7 @@ return Qnil; /* Don't kill the minibuffer now current. */ - if (EQ (buf, XWINDOW (minibuf_window)->buffer)) + if (EQ (buf, XWINDOW_BUFFER (minibuf_window))) return Qnil; /* When we kill a base buffer, kill all its indirect buffers.
--- a/src/bytecode.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/bytecode.c Thu Jun 20 21:19:10 2002 +0000 @@ -56,6 +56,7 @@ #include "bytecode.h" #include "opaque.h" #include "syntax.h" +#include "window.h" EXFUN (Ffetch_bytecode, 1);
--- a/src/callint.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/callint.c Thu Jun 20 21:19:10 2002 +0000 @@ -35,7 +35,7 @@ #include "commands.h" #include "events.h" #include "insdel.h" -#include "window.h" +#include "window-impl.h" /* WINDOW_MINI_P */ extern int num_input_chars;
--- a/src/cm.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/cm.c Thu Jun 20 21:19:10 2002 +0000 @@ -31,7 +31,7 @@ #include "lstream.h" #include "redisplay.h" -#include "console-tty.h" +#include "console-tty-impl.h" #define EXPENSIVE 2000
--- a/src/cmdloop.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/cmdloop.c Thu Jun 20 21:19:10 2002 +0000 @@ -32,12 +32,17 @@ #include "lisp.h" #include "buffer.h" +#include "console-impl.h" #include "device.h" #include "commands.h" #include "frame.h" #include "events.h" #include "window.h" +#ifdef HAVE_MS_WINDOWS +#include "console-msw.h" +#endif + /* Current depth in recursive edits. */ Fixnum command_loop_level; @@ -359,11 +364,10 @@ MARK_MODELINE_CHANGED; record_unwind_protect (recursive_edit_unwind, - ((current_buffer - != XBUFFER (XWINDOW (Fselected_window - (Qnil))->buffer)) + current_buffer + != XWINDOW_XBUFFER (Fselected_window (Qnil)) ? Fcurrent_buffer () - : Qnil)); + : Qnil); specbind (Qstandard_output, Qt); specbind (Qstandard_input, Qt); @@ -546,9 +550,9 @@ Lisp_Object selected_window = Fselected_window (Qnil); if (!NILP (selected_window) && - (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)) + XWINDOW_XBUFFER (selected_window) != current_buffer) { - set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer)); + set_buffer_internal (XWINDOW_XBUFFER (selected_window)); } }
--- a/src/cmds.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/cmds.c Thu Jun 20 21:19:10 2002 +0000 @@ -25,6 +25,7 @@ #include "lisp.h" #include "commands.h" #include "buffer.h" +#include "extents.h" #include "syntax.h" #include "insdel.h"
--- a/src/config.h.in Tue Jun 11 19:28:22 2002 +0000 +++ b/src/config.h.in Thu Jun 20 21:19:10 2002 +0000 @@ -41,7 +41,7 @@ config.h.in with #undef, it is easy to make this file serve as config.h under Windows NT. Options that are set by the user are specified in the file config.inc.samp, which is included by xemacs.mak -(the makefile) and used to set command-line options to the +\(the makefile) and used to set command-line options to the compiler. The sorts of options that relate to the system and not to the user and which are normally auto-determined by configure are set in windowsnt.h. @@ -255,7 +255,34 @@ #undef HAVE_SYS_WAIT_H #undef HAVE_LIBINTL_H #undef HAVE_X11_XLOCALE_H + +/* About __STDC__: Different compilers differ wrt __STDC__. Sunpro C + defines it, but its value is 0 unless we disable non-ANSI extensions. + VC++ doesn't define it at all unless we disable non-ANSI extensions. + But these compilers are all ANSI-compliant. So don't go testing + __STDC__ anywhere except in code that runs only on known + compilers. --ben + + Jamie wrote the following: + + [[ The ANSI standard says that defining __STDC__ to a non-zero value + means that the compiler conforms to that standard. The standard + requires certain header files and library functions to be present. + Therefore, if your compiler defines __STDC__ to non-0 but does not have + ANSI headers and the ANSI library routines, then your compiler is + buggy. Conversely, an ANSI-conforming environment (which has both the + ANSI headers and library routines, i.e., stdlib.h and `memmove') does + not necessarily define the STDC_HEADERS flag. Lucid Emacs requires an + ANSI compiler. Therefore, there is no need to consult the abominable + STDC_HEADERS flag. -- jwz ]] + + In reality, we should not be testing STDC_HEADERS at all except + possibly in code we're purposely keeping in close sync with FSF code. + STDC_HEADERS should be defined on *ALL* compilers. +*/ + #undef STDC_HEADERS + #undef TIME_WITH_SYS_TIME #undef WORDS_BIGENDIAN @@ -586,6 +613,14 @@ */ #undef QUICK_BUILD +/* If true, run the compiler with many files at once rather than one at a + time. May speed up compilation time with some compilers, particularly + if the entire compilation happens in a single process -- the process can + cache the results of processing include files. This definitely helps + with VC++ (although it doesn't use Makefile.in.in) but not with GCC, + which runs many processes per file to compile. */ +#undef BATCH_COMPILER_RUNS + /* If defined, use unions instead of ints. A few systems (DEC Alpha) seem to require this, probably because something with the int definitions isn't right with 64-bit systems. */ @@ -700,21 +735,25 @@ #define SYSTEM_MALLOC #endif -/* Use the relocating allocator for buffer space? */ -#undef REL_ALLOC - /* Define the return type of signal handlers if the s/xxx.h file did not already do so. */ #define RETSIGTYPE void +#ifndef XCDECL +#define XCDECL +#endif + /* SIGTYPE is the macro we actually use. */ #ifndef SIGTYPE -#define SIGTYPE RETSIGTYPE +#define SIGTYPE RETSIGTYPE XCDECL #define SIGRETURN return #endif #ifndef WIN32_NO_CONFIGURE /* Defined in xemacs.mak or s/windowsnt.h: */ +/* Use the relocating allocator for buffer space? */ +#undef REL_ALLOC + /* Define DYNODUMP if it is necessary to properly dump on this system. Currently this is only Solaris 2.x, for x < 6. */ #undef DYNODUMP
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/console-gtk-impl.h Thu Jun 20 21:19:10 2002 +0000 @@ -0,0 +1,199 @@ +/* Define X specific console, device, and frame object for XEmacs. + Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. + Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. + Copyright (C) 2002 Ben Wing. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + + +/* Authorship: + + Ultimately based on FSF, then later on JWZ work for Lemacs. + Rewritten over time by Ben Wing and Chuck Thompson (original + multi-device work by Chuck Thompson). + */ + +#ifndef INCLUDED_console_gtk_impl_h_ +#define INCLUDED_console_gtk_impl_h_ + +#ifdef HAVE_GTK + +#include "console-impl.h" +#include "console-gtk.h" + +#define GDK_DRAWABLE(x) (GdkDrawable *) (x) +#define GET_GTK_WIDGET_WINDOW(x) (GTK_WIDGET (x)->window) +#define GET_GTK_WIDGET_PARENT(x) (GTK_WIDGET (x)->parent) + +DECLARE_CONSOLE_TYPE (gtk); + +struct gtk_device +{ + /* Gtk application info. */ + GtkWidget *gtk_app_shell; + + /* Cache of GC's for frame's on this device. */ + struct gc_cache *gc_cache; + + /* Selected visual, depth and colormap for this device */ + GdkVisual *visual; + int depth; + GdkColormap *device_cmap; + + /* Used by x_bevel_modeline in redisplay-x.c */ + GdkBitmap *gray_pixmap; + + /* frame that holds the WM_COMMAND property; there should be exactly + one of these per device. */ + Lisp_Object WM_COMMAND_frame; + + /* The following items are all used exclusively in event-gtk.c. */ + int MetaMask, HyperMask, SuperMask, AltMask, ModeMask; + guint lock_interpretation; + + void *x_modifier_keymap; /* Really an (XModifierKeymap *)*/ + + guint *x_keysym_map; + int x_keysym_map_min_code; + int x_keysym_map_max_code; + int x_keysym_map_keysyms_per_code; + Lisp_Object x_keysym_map_hashtable; + + /* #### It's not clear that there is much distinction anymore + between mouse_timestamp and global_mouse_timestamp, now that + Emacs doesn't see most (all?) events not destined for it. */ + + /* The timestamp of the last button or key event used by emacs itself. + This is used for asserting selections and input focus. */ + guint32 mouse_timestamp; + + /* This is the timestamp the last button or key event whether it was + dispatched to emacs or widgets. */ + guint32 global_mouse_timestamp; + + /* This is the last known timestamp received from the server. It is + maintained by x_event_to_emacs_event and used to patch bogus + WM_TAKE_FOCUS messages sent by Mwm. */ + guint32 last_server_timestamp; + + GdkAtom atom_WM_PROTOCOLS; + GdkAtom atom_WM_TAKE_FOCUS; + GdkAtom atom_WM_STATE; + +#if 0 + /* #### BILL!!! */ + /* stuff for sticky modifiers: */ + unsigned int need_to_add_mask, down_mask; + KeyCode last_downkey; + guint32 release_time; +#endif +}; + +#define DEVICE_GTK_DATA(d) DEVICE_TYPE_DATA (d, gtk) + +#define DEVICE_GTK_VISUAL(d) (DEVICE_GTK_DATA (d)->visual) +#define DEVICE_GTK_DEPTH(d) (DEVICE_GTK_DATA (d)->depth) +#define DEVICE_GTK_COLORMAP(d) (DEVICE_GTK_DATA (d)->device_cmap) +#define DEVICE_GTK_APP_SHELL(d) (DEVICE_GTK_DATA (d)->gtk_app_shell) +#define DEVICE_GTK_GC_CACHE(d) (DEVICE_GTK_DATA (d)->gc_cache) +#define DEVICE_GTK_GRAY_PIXMAP(d) (DEVICE_GTK_DATA (d)->gray_pixmap) +#define DEVICE_GTK_WM_COMMAND_FRAME(d) (DEVICE_GTK_DATA (d)->WM_COMMAND_frame) +#define DEVICE_GTK_MOUSE_TIMESTAMP(d) (DEVICE_GTK_DATA (d)->mouse_timestamp) +#define DEVICE_GTK_GLOBAL_MOUSE_TIMESTAMP(d) (DEVICE_GTK_DATA (d)->global_mouse_timestamp) +#define DEVICE_GTK_LAST_SERVER_TIMESTAMP(d) (DEVICE_GTK_DATA (d)->last_server_timestamp) + +/* The maximum number of widgets that can be displayed above the text + area at one time. Currently no more than 3 will ever actually be + displayed (menubar, psheet, debugger panel). */ +#define MAX_CONCURRENT_TOP_WIDGETS 8 + +struct gtk_frame +{ + /* The widget of this frame. */ + GtkWidget *widget; /* This is really a GtkWindow */ + + /* The layout manager */ + GtkWidget *container; /* actually a GtkVBox. */ + + /* The widget of the menubar */ + GtkWidget *menubar_widget; + + /* The widget of the edit portion of this frame; this is a GtkDrawingArea, + and the window of this widget is what the redisplay code draws on. */ + GtkWidget *edit_widget; + + /* Lists the widgets above the text area, in the proper order. */ + GtkWidget *top_widgets[MAX_CONCURRENT_TOP_WIDGETS]; + int num_top_widgets; + + /* Our container widget as a Lisp_Object */ + Lisp_Object lisp_visible_widgets[10]; + + /*************************** Miscellaneous **************************/ + + /* The icon pixmaps; these are Lisp_Image_Instance objects, or Qnil. */ + Lisp_Object icon_pixmap; + Lisp_Object icon_pixmap_mask; + + /* geometry string that ought to be freed. */ + char *geom_free_me_please; + + /* 1 if the frame is completely visible on the display, 0 otherwise. + if 0 the frame may have been iconified or may be totally + or partially hidden by another X window */ + unsigned int totally_visible_p :1; + + /* Is it visible at all? */ + unsigned int visible_p :1; + + /* Are we a top-level frame? This means that our shell is a + TopLevelShell, and we should do certain things to interact with + the window manager. */ + unsigned int top_level_frame_p :1; + + /* Are we iconfied right now? */ + unsigned int iconified_p :1; + +}; + +#define FRAME_GTK_DATA(f) FRAME_TYPE_DATA (f, gtk) + +#define FRAME_GTK_SHELL_WIDGET(f) (FRAME_GTK_DATA (f)->widget) +#define FRAME_GTK_CONTAINER_WIDGET(f) (FRAME_GTK_DATA (f)->container) +#define FRAME_GTK_MENUBAR_WIDGET(f) (FRAME_GTK_DATA (f)->menubar_widget) +#define FRAME_GTK_TEXT_WIDGET(f) (FRAME_GTK_DATA (f)->edit_widget) +#define FRAME_GTK_TOP_WIDGETS(f) (FRAME_GTK_DATA (f)->top_widgets) +#define FRAME_GTK_NUM_TOP_WIDGETS(f) (FRAME_GTK_DATA (f)->num_top_widgets) +#define FRAME_GTK_ICONIFIED_P(f) (FRAME_GTK_DATA (f)->iconfigied_p) + +#define FRAME_GTK_LISP_WIDGETS(f) (FRAME_GTK_DATA (f)->lisp_visible_widgets) +#define FRAME_GTK_ICON_PIXMAP(f) (FRAME_GTK_DATA (f)->icon_pixmap) +#define FRAME_GTK_ICON_PIXMAP_MASK(f) (FRAME_GTK_DATA (f)->icon_pixmap_mask) + +#define FRAME_GTK_GEOM_FREE_ME_PLEASE(f) (FRAME_GTK_DATA (f)->geom_free_me_please) + +#define FRAME_GTK_TOTALLY_VISIBLE_P(f) (FRAME_GTK_DATA (f)->totally_visible_p) +#define FRAME_GTK_VISIBLE_P(f) (FRAME_GTK_DATA (f)->visible_p) +#define FRAME_GTK_TOP_LEVEL_FRAME_P(f) (FRAME_GTK_DATA (f)->top_level_frame_p) + +extern struct console_type *gtk_console_type; + +#endif /* HAVE_GTK */ +#endif /* INCLUDED_console_gtk_impl_h_ */
--- a/src/console-gtk.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/console-gtk.c Thu Jun 20 21:19:10 2002 +0000 @@ -29,10 +29,11 @@ #include <config.h> #include "lisp.h" -#include "console-gtk.h" #include "process.h" /* canonicalize_host_name */ #include "redisplay.h" /* for display_arg */ +#include "console-gtk-impl.h" + DEFINE_CONSOLE_TYPE (gtk); static int
--- a/src/console-gtk.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/console-gtk.h Thu Jun 20 21:19:10 2002 +0000 @@ -1,6 +1,7 @@ /* Define X specific console, device, and frame object for XEmacs. Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. + Copyright (C) 2002 Ben Wing. This file is part of XEmacs. @@ -37,169 +38,11 @@ #include "console.h" #include <gtk/gtk.h> -#define GDK_DRAWABLE(x) (GdkDrawable *) (x) -#define GET_GTK_WIDGET_WINDOW(x) (GTK_WIDGET (x)->window) -#define GET_GTK_WIDGET_PARENT(x) (GTK_WIDGET (x)->parent) - -DECLARE_CONSOLE_TYPE (gtk); - -struct gtk_device -{ - /* Gtk application info. */ - GtkWidget *gtk_app_shell; - - /* Cache of GC's for frame's on this device. */ - struct gc_cache *gc_cache; - - /* Selected visual, depth and colormap for this device */ - GdkVisual *visual; - int depth; - GdkColormap *device_cmap; - - /* Used by x_bevel_modeline in redisplay-x.c */ - GdkBitmap *gray_pixmap; - - /* frame that holds the WM_COMMAND property; there should be exactly - one of these per device. */ - Lisp_Object WM_COMMAND_frame; - - /* The following items are all used exclusively in event-gtk.c. */ - int MetaMask, HyperMask, SuperMask, AltMask, ModeMask; - guint lock_interpretation; - - void *x_modifier_keymap; /* Really an (XModifierKeymap *)*/ - - guint *x_keysym_map; - int x_keysym_map_min_code; - int x_keysym_map_max_code; - int x_keysym_map_keysyms_per_code; - Lisp_Object x_keysym_map_hashtable; - - /* #### It's not clear that there is much distinction anymore - between mouse_timestamp and global_mouse_timestamp, now that - Emacs doesn't see most (all?) events not destined for it. */ - - /* The timestamp of the last button or key event used by emacs itself. - This is used for asserting selections and input focus. */ - guint32 mouse_timestamp; - - /* This is the timestamp the last button or key event whether it was - dispatched to emacs or widgets. */ - guint32 global_mouse_timestamp; - - /* This is the last known timestamp received from the server. It is - maintained by x_event_to_emacs_event and used to patch bogus - WM_TAKE_FOCUS messages sent by Mwm. */ - guint32 last_server_timestamp; - - GdkAtom atom_WM_PROTOCOLS; - GdkAtom atom_WM_TAKE_FOCUS; - GdkAtom atom_WM_STATE; - -#if 0 - /* #### BILL!!! */ - /* stuff for sticky modifiers: */ - unsigned int need_to_add_mask, down_mask; - KeyCode last_downkey; - guint32 release_time; -#endif -}; - -#define DEVICE_GTK_DATA(d) DEVICE_TYPE_DATA (d, gtk) - -#define DEVICE_GTK_VISUAL(d) (DEVICE_GTK_DATA (d)->visual) -#define DEVICE_GTK_DEPTH(d) (DEVICE_GTK_DATA (d)->depth) -#define DEVICE_GTK_COLORMAP(d) (DEVICE_GTK_DATA (d)->device_cmap) -#define DEVICE_GTK_APP_SHELL(d) (DEVICE_GTK_DATA (d)->gtk_app_shell) -#define DEVICE_GTK_GC_CACHE(d) (DEVICE_GTK_DATA (d)->gc_cache) -#define DEVICE_GTK_GRAY_PIXMAP(d) (DEVICE_GTK_DATA (d)->gray_pixmap) -#define DEVICE_GTK_WM_COMMAND_FRAME(d) (DEVICE_GTK_DATA (d)->WM_COMMAND_frame) -#define DEVICE_GTK_MOUSE_TIMESTAMP(d) (DEVICE_GTK_DATA (d)->mouse_timestamp) -#define DEVICE_GTK_GLOBAL_MOUSE_TIMESTAMP(d) (DEVICE_GTK_DATA (d)->global_mouse_timestamp) -#define DEVICE_GTK_LAST_SERVER_TIMESTAMP(d) (DEVICE_GTK_DATA (d)->last_server_timestamp) - -/* The maximum number of widgets that can be displayed above the text - area at one time. Currently no more than 3 will ever actually be - displayed (menubar, psheet, debugger panel). */ -#define MAX_CONCURRENT_TOP_WIDGETS 8 - -struct gtk_frame -{ - /* The widget of this frame. */ - GtkWidget *widget; /* This is really a GtkWindow */ - - /* The layout manager */ - GtkWidget *container; /* actually a GtkVBox. */ - - /* The widget of the menubar */ - GtkWidget *menubar_widget; - - /* The widget of the edit portion of this frame; this is a GtkDrawingArea, - and the window of this widget is what the redisplay code draws on. */ - GtkWidget *edit_widget; - - /* Lists the widgets above the text area, in the proper order. */ - GtkWidget *top_widgets[MAX_CONCURRENT_TOP_WIDGETS]; - int num_top_widgets; - - /* Our container widget as a Lisp_Object */ - Lisp_Object lisp_visible_widgets[10]; - - /*************************** Miscellaneous **************************/ - - /* The icon pixmaps; these are Lisp_Image_Instance objects, or Qnil. */ - Lisp_Object icon_pixmap; - Lisp_Object icon_pixmap_mask; - - /* geometry string that ought to be freed. */ - char *geom_free_me_please; - - /* 1 if the frame is completely visible on the display, 0 otherwise. - if 0 the frame may have been iconified or may be totally - or partially hidden by another X window */ - unsigned int totally_visible_p :1; - - /* Is it visible at all? */ - unsigned int visible_p :1; - - /* Are we a top-level frame? This means that our shell is a - TopLevelShell, and we should do certain things to interact with - the window manager. */ - unsigned int top_level_frame_p :1; - - /* Are we iconfied right now? */ - unsigned int iconified_p :1; - -}; - -#define FRAME_GTK_DATA(f) FRAME_TYPE_DATA (f, gtk) - -#define FRAME_GTK_SHELL_WIDGET(f) (FRAME_GTK_DATA (f)->widget) -#define FRAME_GTK_CONTAINER_WIDGET(f) (FRAME_GTK_DATA (f)->container) -#define FRAME_GTK_MENUBAR_WIDGET(f) (FRAME_GTK_DATA (f)->menubar_widget) -#define FRAME_GTK_TEXT_WIDGET(f) (FRAME_GTK_DATA (f)->edit_widget) -#define FRAME_GTK_TOP_WIDGETS(f) (FRAME_GTK_DATA (f)->top_widgets) -#define FRAME_GTK_NUM_TOP_WIDGETS(f) (FRAME_GTK_DATA (f)->num_top_widgets) -#define FRAME_GTK_ICONIFIED_P(f) (FRAME_GTK_DATA (f)->iconfigied_p) - -#define FRAME_GTK_LISP_WIDGETS(f) (FRAME_GTK_DATA (f)->lisp_visible_widgets) -#define FRAME_GTK_ICON_PIXMAP(f) (FRAME_GTK_DATA (f)->icon_pixmap) -#define FRAME_GTK_ICON_PIXMAP_MASK(f) (FRAME_GTK_DATA (f)->icon_pixmap_mask) - -#define FRAME_GTK_GEOM_FREE_ME_PLEASE(f) (FRAME_GTK_DATA (f)->geom_free_me_please) - -#define FRAME_GTK_TOTALLY_VISIBLE_P(f) (FRAME_GTK_DATA (f)->totally_visible_p) -#define FRAME_GTK_VISIBLE_P(f) (FRAME_GTK_DATA (f)->visible_p) -#define FRAME_GTK_TOP_LEVEL_FRAME_P(f) (FRAME_GTK_DATA (f)->top_level_frame_p) - /* Variables associated with the X display frame this emacs is using. */ extern Lisp_Object Vx_gc_pointer_shape; extern Lisp_Object Vx_scrollbar_pointer_shape; -extern struct console_type *gtk_console_type; -extern Lisp_Object Vdefault_gtk_device; - /* Number of pixels below each line. */ extern int gtk_interline_space;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/console-impl.h Thu Jun 20 21:19:10 2002 +0000 @@ -0,0 +1,564 @@ +/* Define console object for XEmacs. + Copyright (C) 1996, 2002 Ben Wing + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +/* Written by Ben Wing. */ + +#ifndef INCLUDED_console_impl_h_ +#define INCLUDED_console_impl_h_ + +#include "console.h" + +extern const struct struct_description cted_description; +extern const struct struct_description console_methods_description; + + +/* + * Constants returned by device_implementation_flags_method + */ + +/* Set when device uses pixel-based geometry */ +#define XDEVIMPF_PIXEL_GEOMETRY 0x00000001L + +/* Indicates that the device is a printer */ +#define XDEVIMPF_IS_A_PRINTER 0x00000002L + +/* Do not automatically redisplay this device */ +#define XDEVIMPF_NO_AUTO_REDISPLAY 0x00000004L + +/* Do not delete the device when last frame's gone */ +#define XDEVIMPF_FRAMELESS_OK 0x00000008L + +/* Do not preempt resiaply of frame or device once it starts */ +#define XDEVIMPF_DONT_PREEMPT_REDISPLAY 0x00000010L + +struct console_methods +{ + const char *name; /* Used by print_console, print_device, print_frame */ + Lisp_Object symbol; + Lisp_Object predicate_symbol; + unsigned int flags; /* Read-only implementation flags, set once upon + console type creation. INITIALIZE_CONSOLE_TYPE sets + this member to 0. */ + + /* console methods */ + void (*init_console_method) (struct console *, Lisp_Object props); + void (*mark_console_method) (struct console *); + int (*initially_selected_for_input_method) (struct console *); + void (*delete_console_method) (struct console *); + Lisp_Object (*semi_canonicalize_console_connection_method) + (Lisp_Object connection, Error_Behavior errb); + Lisp_Object (*semi_canonicalize_device_connection_method) + (Lisp_Object connection, Error_Behavior errb); + Lisp_Object (*canonicalize_console_connection_method) + (Lisp_Object connection, Error_Behavior errb); + Lisp_Object (*canonicalize_device_connection_method) + (Lisp_Object connection, Error_Behavior errb); + Lisp_Object (*device_to_console_connection_method) + (Lisp_Object connection, Error_Behavior errb); + + /* device methods */ + void (*init_device_method) (struct device *, Lisp_Object props); + void (*finish_init_device_method) (struct device *, Lisp_Object props); + void (*delete_device_method) (struct device *); + void (*mark_device_method) (struct device *); + void (*asynch_device_change_method) (void); + Lisp_Object (*device_system_metrics_method) (struct device *, + enum device_metrics); + Lisp_Object (*own_selection_method)(Lisp_Object selection_name, + Lisp_Object selection_value, + Lisp_Object how_to_add, + Lisp_Object selection_type, + int owned_p); + void (*disown_selection_method)(Lisp_Object selection_name, + Lisp_Object timeval); + Lisp_Object (*get_foreign_selection_method) (Lisp_Object selection_symbol, + Lisp_Object target_type); + Lisp_Object (*selection_exists_p_method)(Lisp_Object selection_name, + Lisp_Object selection_type); + Lisp_Object (*available_selection_types_method)(Lisp_Object selection_name); + Lisp_Object (*register_selection_data_type_method)(Lisp_Object type_name); + Lisp_Object (*selection_data_type_name_method)(Lisp_Object type); + + /* frame methods */ + Lisp_Object *device_specific_frame_props; + void (*init_frame_1_method) (struct frame *, Lisp_Object properties, + int frame_name_is_defaulted); + void (*init_frame_2_method) (struct frame *, Lisp_Object properties); + void (*init_frame_3_method) (struct frame *); + void (*after_init_frame_method) (struct frame *, int first_on_device, + int first_on_console); + void (*mark_frame_method) (struct frame *); + void (*delete_frame_method) (struct frame *); + void (*focus_on_frame_method) (struct frame *); + void (*raise_frame_method) (struct frame *); + void (*lower_frame_method) (struct frame *); + void (*enable_frame_method) (struct frame *); + void (*disable_frame_method) (struct frame *); + int (*get_mouse_position_method) (struct device *d, Lisp_Object *frame, + int *x, int *y); + void (*set_mouse_position_method) (struct window *w, int x, int y); + void (*make_frame_visible_method) (struct frame *f); + void (*make_frame_invisible_method) (struct frame *f); + void (*iconify_frame_method) (struct frame *f); + Lisp_Object (*frame_property_method) (struct frame *f, Lisp_Object prop); + int (*internal_frame_property_p_method) (struct frame *f, + Lisp_Object prop); + Lisp_Object (*frame_properties_method) (struct frame *f); + void (*set_frame_properties_method) (struct frame *f, Lisp_Object plist); + void (*set_frame_size_method) (struct frame *f, int width, int height); + void (*set_frame_position_method) (struct frame *f, int xoff, int yoff); + int (*frame_visible_p_method) (struct frame *f); + int (*frame_totally_visible_p_method) (struct frame *f); + int (*frame_iconified_p_method) (struct frame *f); + void (*set_title_from_ibyte_method) (struct frame *f, Ibyte *title); + void (*set_icon_name_from_ibyte_method) (struct frame *f, Ibyte *title); + void (*set_frame_pointer_method) (struct frame *f); + void (*set_frame_icon_method) (struct frame *f); + void (*popup_menu_method) (Lisp_Object menu, Lisp_Object event); + Lisp_Object (*get_frame_parent_method) (struct frame *f); + void (*update_frame_external_traits_method) (struct frame *f, Lisp_Object name); + int (*frame_size_fixed_p_method) (struct frame *f); + void (*eject_page_method) (struct frame *f); + + /* redisplay methods */ + int (*left_margin_width_method) (struct window *); + int (*right_margin_width_method) (struct window *); + int (*text_width_method) (struct frame *f, struct face_cachel *cachel, + const Ichar *str, Charcount len); + void (*output_display_block_method) (struct window *, struct display_line *, + int, int, int, int, int, int, int); + int (*divider_height_method) (void); + int (*eol_cursor_width_method) (void); + void (*output_vertical_divider_method) (struct window *, int); + void (*clear_to_window_end_method) (struct window *, int, int); + void (*clear_region_method) (Lisp_Object, struct device*, struct frame*, face_index, + int, int, int, int, + Lisp_Object, Lisp_Object, Lisp_Object); + void (*clear_frame_method) (struct frame *); + void (*window_output_begin_method) (struct window *); + void (*frame_output_begin_method) (struct frame *); + void (*window_output_end_method) (struct window *); + void (*frame_output_end_method) (struct frame *); + int (*flash_method) (struct device *); + void (*ring_bell_method) (struct device *, int volume, int pitch, + int duration); + void (*frame_redraw_cursor_method) (struct frame *f); + void (*set_final_cursor_coords_method) (struct frame *, int, int); + void (*bevel_area_method) (struct window *, face_index, int, int, int, int, int, + int, enum edge_style); + void (*output_pixmap_method) (struct window *w, Lisp_Object image_instance, + struct display_box *db, struct display_glyph_area *dga, + face_index findex, int cursor_start, int cursor_width, + int cursor_height, int offset_bitmap); + void (*output_string_method) (struct window *w, struct display_line *dl, + Ichar_dynarr *buf, int xpos, int xoffset, + int start_pixpos, int width, face_index findex, + int cursor, int cursor_start, int cursor_width, + int cursor_height); + + /* color methods */ + int (*initialize_color_instance_method) (Lisp_Color_Instance *, + Lisp_Object name, + Lisp_Object device, + Error_Behavior errb); + void (*mark_color_instance_method) (Lisp_Color_Instance *); + void (*print_color_instance_method) (Lisp_Color_Instance *, + Lisp_Object printcharfun, + int escapeflag); + void (*finalize_color_instance_method) (Lisp_Color_Instance *); + int (*color_instance_equal_method) (Lisp_Color_Instance *, + Lisp_Color_Instance *, + int depth); + Hashcode (*color_instance_hash_method) (Lisp_Color_Instance *, + int depth); + Lisp_Object (*color_instance_rgb_components_method) (Lisp_Color_Instance *); + int (*valid_color_name_p_method) (struct device *, Lisp_Object color); + + /* font methods */ + int (*initialize_font_instance_method) (Lisp_Font_Instance *, + Lisp_Object name, + Lisp_Object device, + Error_Behavior errb); + void (*mark_font_instance_method) (Lisp_Font_Instance *); + void (*print_font_instance_method) (Lisp_Font_Instance *, + Lisp_Object printcharfun, + int escapeflag); + void (*finalize_font_instance_method) (Lisp_Font_Instance *); + Lisp_Object (*font_instance_truename_method) (Lisp_Font_Instance *, + Error_Behavior errb); + Lisp_Object (*font_instance_properties_method) (Lisp_Font_Instance *); + Lisp_Object (*list_fonts_method) (Lisp_Object pattern, + Lisp_Object device); + Lisp_Object (*find_charset_font_method) (Lisp_Object device, + Lisp_Object font, + Lisp_Object charset, + int stage); + int (*font_spec_matches_charset_method) (struct device *d, + Lisp_Object charset, + const Ibyte *nonreloc, + Lisp_Object reloc, + Bytecount offset, + Bytecount length, + int stage); + + /* image methods */ + void (*mark_image_instance_method) (Lisp_Image_Instance *); + void (*print_image_instance_method) (Lisp_Image_Instance *, + Lisp_Object printcharfun, + int escapeflag); + void (*finalize_image_instance_method) (Lisp_Image_Instance *); + void (*unmap_subwindow_method) (Lisp_Image_Instance *); + void (*map_subwindow_method) (Lisp_Image_Instance *, int x, int y, + struct display_glyph_area* dga); + void (*resize_subwindow_method) (Lisp_Image_Instance *, int w, int h); + void (*redisplay_subwindow_method) (Lisp_Image_Instance *); + void (*redisplay_widget_method) (Lisp_Image_Instance *); + /* Maybe this should be a specifier. Unfortunately specifiers don't + allow us to represent things at the toolkit level, which is what + is required here. */ + int (*widget_border_width_method) (void); + int (*widget_spacing_method) (Lisp_Image_Instance *); + int (*image_instance_equal_method) (Lisp_Image_Instance *, + Lisp_Image_Instance *, + int depth); + Hashcode (*image_instance_hash_method) (Lisp_Image_Instance *, + int depth); + void (*init_image_instance_from_eimage_method) (Lisp_Image_Instance *ii, + int width, int height, + int slices, + unsigned char *eimage, + int dest_mask, + Lisp_Object instantiator, + Lisp_Object domain); + Lisp_Object (*locate_pixmap_file_method) (Lisp_Object file_method); + int (*colorize_image_instance_method) (Lisp_Object image_instance, + Lisp_Object fg, Lisp_Object bg); + void (*widget_query_string_geometry_method) (Lisp_Object string, + Lisp_Object face, + int* width, int* height, + Lisp_Object domain); + Lisp_Object image_conversion_list; + +#ifdef HAVE_TOOLBARS + /* toolbar methods */ + void (*output_frame_toolbars_method) (struct frame *); + void (*initialize_frame_toolbars_method) (struct frame *); + void (*free_frame_toolbars_method) (struct frame *); + void (*output_toolbar_button_method) (struct frame *, Lisp_Object); + void (*redraw_frame_toolbars_method) (struct frame *); + void (*redraw_exposed_toolbars_method) (struct frame *f, int x, int y, + int width, int height); +#endif + +#ifdef HAVE_SCROLLBARS + /* scrollbar methods */ + int (*inhibit_scrollbar_slider_size_change_method) (void); + void (*free_scrollbar_instance_method) (struct scrollbar_instance *); + void (*release_scrollbar_instance_method) (struct scrollbar_instance *); + void (*create_scrollbar_instance_method) (struct frame *, int, + struct scrollbar_instance *); + void (*update_scrollbar_instance_values_method) (struct window *, + struct scrollbar_instance *, + int, int, int, int, int, + int, int, int, int, int); + void (*update_scrollbar_instance_status_method) (struct window *, int, int, + struct + scrollbar_instance *); + void (*scrollbar_pointer_changed_in_window_method) (struct window *w); +#ifdef MEMORY_USAGE_STATS + int (*compute_scrollbar_instance_usage_method) (struct device *, + struct scrollbar_instance *, + struct overhead_stats *); +#endif +#endif /* HAVE_SCROLLBARS */ + +#ifdef HAVE_MENUBARS + /* menubar methods */ + void (*update_frame_menubars_method) (struct frame *); + void (*free_frame_menubars_method) (struct frame *); +#endif + +#ifdef HAVE_DIALOGS + /* dialog methods */ + Lisp_Object (*make_dialog_box_internal_method) (struct frame *, + Lisp_Object type, + Lisp_Object keys); +#endif +}; + +#define CONMETH_TYPE(meths) ((meths)->symbol) +#define CONMETH_IMPL_FLAG(meths, f) ((meths)->flags & (f)) + +#define CONSOLE_TYPE_NAME(c) ((c)->conmeths->name) +#define CONSOLE_TYPE(c) ((c)->conmeths->symbol) +#define CONSOLE_IMPL_FLAG(c, f) CONMETH_IMPL_FLAG ((c)->conmeths, (f)) + +/******** Accessing / calling a console method *********/ + +#define HAS_CONTYPE_METH_P(meth, m) ((meth)->m##_method) +#define CONTYPE_METH(meth, m, args) (((meth)->m##_method) args) + +/* Call a void-returning console method, if it exists */ +#define MAYBE_CONTYPE_METH(meth, m, args) do { \ + struct console_methods *maybe_contype_meth_meth = (meth); \ + if (HAS_CONTYPE_METH_P (maybe_contype_meth_meth, m)) \ + CONTYPE_METH (maybe_contype_meth_meth, m, args); \ +} while (0) + +/* Call a console method, if it exists; otherwise return + the specified value - meth is multiply evaluated. */ +#define CONTYPE_METH_OR_GIVEN(meth, m, args, given) \ + (HAS_CONTYPE_METH_P (meth, m) ? \ + CONTYPE_METH (meth, m, args) : (given)) + +/* Call an int-returning console method, if it exists; otherwise + return 0 */ +#define MAYBE_INT_CONTYPE_METH(meth, m, args) \ + CONTYPE_METH_OR_GIVEN (meth, m, args, 0) + +/* Call an Lisp-Object-returning console method, if it exists; + otherwise return Qnil */ +#define MAYBE_LISP_CONTYPE_METH(meth, m, args) \ + CONTYPE_METH_OR_GIVEN (meth, m, args, Qnil) + +/******** Same functions, operating on a console instead of a + struct console_methods ********/ + +#define HAS_CONMETH_P(c, m) HAS_CONTYPE_METH_P ((c)->conmeths, m) +#define CONMETH(c, m, args) CONTYPE_METH ((c)->conmeths, m, args) +#define MAYBE_CONMETH(c, m, args) MAYBE_CONTYPE_METH ((c)->conmeths, m, args) +#define CONMETH_OR_GIVEN(c, m, args, given) \ + CONTYPE_METH_OR_GIVEN((c)->conmeths, m, args, given) +#define MAYBE_INT_CONMETH(c, m, args) \ + MAYBE_INT_CONTYPE_METH ((c)->conmeths, m, args) +#define MAYBE_LISP_CONMETH(c, m, args) \ + MAYBE_LISP_CONTYPE_METH ((c)->conmeths, m, args) + +/******** Defining new console types ********/ + +typedef struct console_type_entry console_type_entry; +struct console_type_entry +{ + Lisp_Object symbol; + struct console_methods *meths; +}; + +#define DECLARE_CONSOLE_TYPE(type) \ +extern struct console_methods * type##_console_methods + +#define DEFINE_CONSOLE_TYPE(type) \ +struct console_methods * type##_console_methods + +#define INITIALIZE_CONSOLE_TYPE(type, obj_name, pred_sym) do { \ + type##_console_methods = xnew_and_zero (struct console_methods); \ + type##_console_methods->name = obj_name; \ + type##_console_methods->symbol = Q##type; \ + defsymbol_nodump (&type##_console_methods->predicate_symbol, pred_sym); \ + add_entry_to_console_type_list (Q##type, type##_console_methods); \ + type##_console_methods->image_conversion_list = Qnil; \ + staticpro_nodump (&type##_console_methods->image_conversion_list); \ + dump_add_root_struct_ptr (&type##_console_methods, &console_methods_description); \ +} while (0) + +#define REINITIALIZE_CONSOLE_TYPE(type) do { \ + staticpro_nodump (&type##_console_methods->predicate_symbol); \ + staticpro_nodump (&type##_console_methods->image_conversion_list); \ +} while (0) + + +/* Declare that console-type TYPE has method M; used in + initialization routines */ +#define CONSOLE_HAS_METHOD(type, m) \ + (type##_console_methods->m##_method = type##_##m) + +/* Declare that console-type TYPE inherits method M + implementation from console-type FROMTYPE */ +#define CONSOLE_INHERITS_METHOD(type, fromtype, m) \ + (type##_console_methods->m##_method = fromtype##_##m) + +/* Define console type implementation flags */ +#define CONSOLE_IMPLEMENTATION_FLAGS(type, flg) \ + (type##_console_methods->flags = flg) + +struct console +{ + struct lcrecord_header header; + + /* Description of this console's methods. */ + struct console_methods *conmeths; + + /* A structure of auxiliary data specific to the console type. + struct x_console is used for X window frames; defined in console-x.h + struct tty_console is used to TTY's; defined in console-tty.h */ + void *console_data; + + /* Character that causes a quit. Normally C-g. + #### Should be possible for this not to be ASCII. (Currently works + under Windows.) */ + Ichar quit_char; + + /* ----- begin partially-completed console localization of + event loop ---- */ + + int local_var_flags; + +#define MARKED_SLOT(x) Lisp_Object x +#include "conslots.h" + + /* Where to store the next keystroke of the macro. + Index into con->kbd_macro_builder. */ + int kbd_macro_ptr; + + /* The finalized section of the macro starts at kbd_macro_buffer and + ends before this. This is not the same as kbd_macro_pointer, because + we advance this to kbd_macro_pointer when a key's command is complete. + This way, the keystrokes for "end-kbd-macro" are not included in the + macro. */ + int kbd_macro_end; + + /* ----- end partially-completed console localization of event loop ---- */ + + unsigned int input_enabled :1; +}; + +/* Redefine basic properties more efficiently */ + +#undef CONSOLE_LIVE_P +#define CONSOLE_LIVE_P(con) (!EQ (CONSOLE_TYPE (con), Qdead)) +#undef CONSOLE_DEVICE_LIST +#define CONSOLE_DEVICE_LIST(con) ((con)->device_list) + +#define CONSOLE_TYPE_P(con, type) EQ (CONSOLE_TYPE (con), Q##type) + +#ifdef ERROR_CHECK_TYPES +DECLARE_INLINE_HEADER ( +struct console * +error_check_console_type (struct console *con, Lisp_Object sym) +) +{ + assert (EQ (CONSOLE_TYPE (con), sym)); + return con; +} +# define CONSOLE_TYPE_DATA(con, type) \ + (*(struct type##_console **) \ + &(error_check_console_type (con, Q##type))->console_data) +#else +# define CONSOLE_TYPE_DATA(con, type) \ + (*(struct type##_console **) &((con)->console_data)) +#endif + +#define CHECK_CONSOLE_TYPE(x, type) do { \ + CHECK_CONSOLE (x); \ + if (! CONSOLE_TYPE_P (XCONSOLE (x), type)) \ + dead_wrong_type_argument \ + (type##_console_methods->predicate_symbol, x); \ +} while (0) +#define CONCHECK_CONSOLE_TYPE(x, type) do { \ + CONCHECK_CONSOLE (x); \ + if (!(CONSOLEP (x) && \ + CONSOLE_TYPE_P (XCONSOLE (x), type))) \ + x = wrong_type_argument \ + (type##_console_methods->predicate_symbol, x); \ +} while (0) + +/* #### These should be in the console-*.h files but there are + too many places where the abstraction is broken. Need to + fix. */ + +#ifdef HAVE_GTK +#define CONSOLE_TYPESYM_GTK_P(typesym) EQ (typesym, Qgtk) +#else +#define CONSOLE_TYPESYM_GTK_P(typesym) 0 +#endif + +#ifdef HAVE_X_WINDOWS +#define CONSOLE_TYPESYM_X_P(typesym) EQ (typesym, Qx) +#else +#define CONSOLE_TYPESYM_X_P(typesym) 0 +#endif +#ifdef HAVE_TTY +#define CONSOLE_TYPESYM_TTY_P(typesym) EQ (typesym, Qtty) +#else +#define CONSOLE_TYPESYM_TTY_P(typesym) 0 +#endif +#ifdef HAVE_MS_WINDOWS +#define CONSOLE_TYPESYM_MSWINDOWS_P(typesym) EQ (typesym, Qmswindows) +#else +#define CONSOLE_TYPESYM_MSWINDOWS_P(typesym) 0 +#endif +#define CONSOLE_TYPESYM_STREAM_P(typesym) EQ (typesym, Qstream) + +#define CONSOLE_TYPESYM_WIN_P(typesym) \ + (CONSOLE_TYPESYM_GTK_P (typesym) || CONSOLE_TYPESYM_X_P (typesym) || CONSOLE_TYPESYM_MSWINDOWS_P (typesym)) + +#define CONSOLE_X_P(con) CONSOLE_TYPESYM_X_P (CONSOLE_TYPE (con)) +#define CHECK_X_CONSOLE(z) CHECK_CONSOLE_TYPE (z, x) +#define CONCHECK_X_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, x) + +#define CONSOLE_GTK_P(con) CONSOLE_TYPESYM_GTK_P (CONSOLE_TYPE (con)) +#define CHECK_GTK_CONSOLE(z) CHECK_CONSOLE_TYPE (z, gtk) +#define CONCHECK_GTK_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, gtk) + +#define CONSOLE_TTY_P(con) CONSOLE_TYPESYM_TTY_P (CONSOLE_TYPE (con)) +#define CHECK_TTY_CONSOLE(z) CHECK_CONSOLE_TYPE (z, tty) +#define CONCHECK_TTY_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, tty) + +#define CONSOLE_MSWINDOWS_P(con) CONSOLE_TYPESYM_MSWINDOWS_P (CONSOLE_TYPE (con)) +#define CHECK_MSWINDOWS_CONSOLE(z) CHECK_CONSOLE_TYPE (z, mswindows) +#define CONCHECK_MSWINDOWS_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, mswindows) + +#define CONSOLE_STREAM_P(con) CONSOLE_TYPESYM_STREAM_P (CONSOLE_TYPE (con)) +#define CHECK_STREAM_CONSOLE(z) CHECK_CONSOLE_TYPE (z, stream) +#define CONCHECK_STREAM_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, stream) + +#define CONSOLE_WIN_P(con) CONSOLE_TYPESYM_WIN_P (CONSOLE_TYPE (con)) + +/* This structure marks which slots in a console have corresponding + default values in console_defaults. + Each such slot has a nonzero value in this structure. + The value has only one nonzero bit. + + When a console has its own local value for a slot, + the bit for that slot (found in the same slot in this structure) + is turned on in the console's local_var_flags slot. + + If a slot in this structure is zero, then even though there may + be a DEFVAR_CONSOLE_LOCAL for the slot, there is no default value for it; + and the corresponding slot in console_defaults is not used. */ + +extern struct console console_local_flags; + +#define CONSOLE_NAME(con) ((con)->name) +#define CONSOLE_CONNECTION(con) ((con)->connection) +#define CONSOLE_CANON_CONNECTION(con) ((con)->canon_connection) +#define CONSOLE_FUNCTION_KEY_MAP(con) ((con)->function_key_map) +#define CONSOLE_SELECTED_DEVICE(con) ((con)->selected_device) +#define CONSOLE_SELECTED_FRAME(con) \ + DEVICE_SELECTED_FRAME (XDEVICE ((con)->selected_device)) +#define CONSOLE_LAST_NONMINIBUF_FRAME(con) NON_LVALUE ((con)->last_nonminibuf_frame) +#define CONSOLE_QUIT_CHAR(con) ((con)->quit_char) + +DECLARE_CONSOLE_TYPE (dead); + +extern console_type_entry_dynarr *the_console_type_entry_dynarr; + +#endif /* INCLUDED_console_impl_h_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/console-msw-impl.h Thu Jun 20 21:19:10 2002 +0000 @@ -0,0 +1,287 @@ +/* Define mswindows-specific console, device, and frame object for XEmacs. + Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. + Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. + Copyright (C) 2001, 2002 Ben Wing. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +/* This file essentially Mule-ized (except perhaps some Unicode splitting). + 5-2000. */ + +/* Authorship: + + Ultimately based on FSF, then later on JWZ work for Lemacs. + Rewritten over time by Ben Wing and Chuck Thompson. + Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0. + */ + +#ifndef INCLUDED_console_msw_impl_h_ +#define INCLUDED_console_msw_impl_h_ + +#include "console-impl.h" +#include "console-msw.h" + +/* + * Consoles + */ + +DECLARE_CONSOLE_TYPE (mswindows); + +struct mswindows_console +{ + int infd, outfd; +}; + +DECLARE_CONSOLE_TYPE (msprinter); + +/* + * Printer settings, aka devmode + */ + +typedef struct Lisp_Devmode +{ + struct lcrecord_header header; + + /* Pointer to the DEVMODE structure */ + DEVMODEW *devmode; + + /* Full printer name. It can be longer than devmode->dmDeviceName + can accommodate, so need to keep it separately */ + Lisp_Object printer_name; + + /* Printer device this object is currently selected in, or Qnil + if not selected */ + Lisp_Object device; + +} Lisp_Devmode; + +#define DEVMODE_SIZE(dm) ((dm)->dmSize + (dm)->dmDriverExtra) +#define XDEVMODE_SIZE(x) ((x)->devmode ? DEVMODE_SIZE((x)->devmode) : 0) + +/* + * Devices + */ + +struct mswindows_device +{ + Lisp_Object fontlist; /* List of (STRING . FIXED-P), device fonts */ + HDC hcdc; /* Compatible DC */ + DWORD update_tick; /* Used when device is modified through + Windows messages, see WM_DISPLAYCHANGE + in event-msw.c */ +}; + +#define DEVICE_MSWINDOWS_DATA(d) DEVICE_TYPE_DATA (d, mswindows) +#define DEVICE_MSWINDOWS_FONTLIST(d) (DEVICE_MSWINDOWS_DATA (d)->fontlist) +#define DEVICE_MSWINDOWS_HCDC(d) (DEVICE_MSWINDOWS_DATA (d)->hcdc) +#define DEVICE_MSWINDOWS_UPDATE_TICK(d) (DEVICE_MSWINDOWS_DATA (d)->update_tick) + +struct msprinter_device +{ + HDC hdc, hcdc; /* Printer and the comp. DCs */ + HANDLE hprinter; + Lisp_Object name; + Lisp_Object devmode; + Lisp_Object fontlist; +}; + +#define DEVICE_MSPRINTER_DATA(d) DEVICE_TYPE_DATA (d, msprinter) +#define DEVICE_MSPRINTER_HDC(d) (DEVICE_MSPRINTER_DATA (d)->hdc) +#define DEVICE_MSPRINTER_HCDC(d) (DEVICE_MSPRINTER_DATA (d)->hcdc) +#define DEVICE_MSPRINTER_HPRINTER(d) (DEVICE_MSPRINTER_DATA (d)->hprinter) +#define DEVICE_MSPRINTER_FONTLIST(d) (DEVICE_MSPRINTER_DATA (d)->fontlist) +#define DEVICE_MSPRINTER_NAME(d) (DEVICE_MSPRINTER_DATA (d)->name) +#define DEVICE_MSPRINTER_DEVMODE(d) (DEVICE_MSPRINTER_DATA (d)->devmode) + +#define CONSOLE_TYPESYM_MSPRINTER_P(typesym) EQ (typesym, Qmsprinter) +#define DEVICE_MSPRINTER_P(dev) CONSOLE_TYPESYM_MSPRINTER_P (DEVICE_TYPE (dev)) +#define CHECK_MSPRINTER_DEVICE(z) CHECK_DEVICE_TYPE (z, msprinter) +#define CONCHECK_MSPRINTER_DEVICE(z) CONCHECK_DEVICE_TYPE (z, msprinter) + +/* Common checks */ + +#define DEVICE_MSGDI_P(dev) (DEVICE_MSWINDOWS_P(dev) || DEVICE_MSPRINTER_P(dev)) +#define CHECK_MSGDI_DEVICE(d) \ + do { \ + CHECK_DEVICE (d); \ + if (!(DEVICEP (d) && DEVICE_MSGDI_P(XDEVICE(d)))) \ + dead_wrong_type_argument \ + (list3 (Qor, Qmswindows, Qmsprinter), d); \ + } while (0) +#define CONCHECK_MSGDI_DEVICE(d) \ + do { \ + CHECK_DEVICE (d); \ + if (!(DEVICEP (d) && DEVICE_MSGDI_P(XDEVICE(d)))) \ + wrong_type_argument \ + (list3 (Qor, Qmswindows, Qmsprinter), d); \ + } while (0) + +/* + * Frames + */ + +struct mswindows_frame +{ + /* win32 window handle */ + HWND hwnd; + + /* DC for this win32 window */ + HDC hdc; + + /* Used with DeferWindowPos */ + HDWP hdwp; + + /* Time of last click event, for button 2 emul */ + DWORD last_click_time; + + /* Mods of last click event */ + DWORD last_click_mods; + + /* Coordinates of last click event, screen-relative */ + POINTS last_click_point; +#ifdef HAVE_TOOLBARS + /* Toolbar hash table. See toolbar-msw.c */ + Lisp_Object toolbar_hash_table; + unsigned int toolbar_checksum[4]; +#endif + + /* Menu hash table. See menubar-msw.c */ + Lisp_Object menu_hash_table; + + /* Menu checksum. See menubar-msw.c */ + unsigned int menu_checksum; + + /* Widget glyphs attached to this frame. See glyphs-msw.c */ + Lisp_Object widget_hash_table1, widget_hash_table2, widget_hash_table3; + + /* Frame title hash value. See frame-msw.c */ + unsigned int title_checksum; + + /* Real character width and height of the frame. + FRAME_{HEIGHT,WIDTH} do not work for pixel geometry! */ + int charheight, charwidth; + +#ifdef MULE + int cursor_x; + int cursor_y; + face_index cursor_findex; +#endif + + /* Misc flags */ + int button2_need_lbutton : 1; + int button2_need_rbutton : 1; + int button2_is_down : 1; + int ignore_next_lbutton_up : 1; + int ignore_next_rbutton_up : 1; + int sizing : 1; + int paint_pending : 1; /* Whether a WM_PAINT magic event has been queued */ + int popup : 1; /* frame is a popup frame */ + + /* Geometry, in characters, as specified by proplist during frame + creation. Members are set to -1 for unspecified */ + XEMACS_RECT_WH *target_rect; +}; + +#define FRAME_MSWINDOWS_DATA(f) FRAME_TYPE_DATA (f, mswindows) + +#define FRAME_MSWINDOWS_HANDLE(f) (FRAME_MSWINDOWS_DATA (f)->hwnd) +#define FRAME_MSWINDOWS_DC(f) (FRAME_MSWINDOWS_DATA (f)->hdc) +#define FRAME_MSWINDOWS_MENU_HASH_TABLE(f) (FRAME_MSWINDOWS_DATA (f)->menu_hash_table) +#define FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE(f) \ + (FRAME_MSWINDOWS_DATA (f)->toolbar_hash_table) +#define FRAME_MSWINDOWS_WIDGET_HASH_TABLE1(f) \ + (FRAME_MSWINDOWS_DATA (f)->widget_hash_table1) +#define FRAME_MSWINDOWS_WIDGET_HASH_TABLE2(f) \ + (FRAME_MSWINDOWS_DATA (f)->widget_hash_table2) +#define FRAME_MSWINDOWS_WIDGET_HASH_TABLE3(f) \ + (FRAME_MSWINDOWS_DATA (f)->widget_hash_table3) +#define FRAME_MSWINDOWS_TOOLBAR_CHECKSUM(f,pos) \ + (FRAME_MSWINDOWS_DATA (f)->toolbar_checksum[pos]) +#define FRAME_MSWINDOWS_MENU_CHECKSUM(f) (FRAME_MSWINDOWS_DATA (f)->menu_checksum) +#define FRAME_MSWINDOWS_TITLE_CHECKSUM(f) (FRAME_MSWINDOWS_DATA (f)->title_checksum) +#define FRAME_MSWINDOWS_CHARWIDTH(f) (FRAME_MSWINDOWS_DATA (f)->charwidth) +#define FRAME_MSWINDOWS_CHARHEIGHT(f) (FRAME_MSWINDOWS_DATA (f)->charheight) +#define FRAME_MSWINDOWS_TARGET_RECT(f) (FRAME_MSWINDOWS_DATA (f)->target_rect) + +#define FRAME_MSWINDOWS_POPUP(f) (FRAME_MSWINDOWS_DATA (f)->popup) + +#ifdef MULE +# define FRAME_MSWINDOWS_CURSOR_X(f) (FRAME_MSWINDOWS_DATA (f)->cursor_x) +# define FRAME_MSWINDOWS_CURSOR_Y(f) (FRAME_MSWINDOWS_DATA (f)->cursor_y) +# define FRAME_MSWINDOWS_CURSOR_FINDEX(f) (FRAME_MSWINDOWS_DATA (f)->cursor_findex) +#endif + +/* Frame check and validation macros */ +#define FRAME_MSWINDOWS_P(frm) CONSOLE_TYPESYM_MSWINDOWS_P (FRAME_TYPE (frm)) +#define CHECK_MSWINDOWS_FRAME(z) CHECK_FRAME_TYPE (z, mswindows) +#define CONCHECK_MSWINDOWS_FRAME(z) CONCHECK_FRAME_TYPE (z, mswindows) + +/* win32 window LONG indices */ +#define XWL_FRAMEOBJ 0 +#define XWL_COUNT 1 /* Number of LONGs that we use */ +#define MSWINDOWS_WINDOW_EXTRA_BYTES (XWL_COUNT * 4) + +/* + * Printer frame, aka printer job + */ + +struct msprinter_frame +{ + int left_margin, top_margin, /* All in twips */ + right_margin, bottom_margin; + int charheight, charwidth; /* As per proplist or -1 if not given */ + int pix_left, pix_top; /* Calculated in init_frame_*, VP offset */ + int job_started : 1; + int page_started : 1; +}; + +#define FRAME_MSPRINTER_DATA(f) FRAME_TYPE_DATA (f, msprinter) +#define FRAME_MSPRINTER_LEFT_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->left_margin) +#define FRAME_MSPRINTER_RIGHT_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->top_margin) +#define FRAME_MSPRINTER_TOP_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->right_margin) +#define FRAME_MSPRINTER_BOTTOM_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->bottom_margin) +#define FRAME_MSPRINTER_JOB_STARTED(f) (FRAME_MSPRINTER_DATA (f)->job_started) +#define FRAME_MSPRINTER_PAGE_STARTED(f) (FRAME_MSPRINTER_DATA (f)->page_started) +#define FRAME_MSPRINTER_CHARWIDTH(f) (FRAME_MSPRINTER_DATA (f)->charwidth) +#define FRAME_MSPRINTER_CHARHEIGHT(f) (FRAME_MSPRINTER_DATA (f)->charheight) +#define FRAME_MSPRINTER_PIXLEFT(f) (FRAME_MSPRINTER_DATA (f)->pix_left) +#define FRAME_MSPRINTER_PIXTOP(f) (FRAME_MSPRINTER_DATA (f)->pix_top) + +/* + * Events + */ + +/* win32 messages / magic event types */ +#define EVENT_MSWINDOWS_MAGIC_TYPE(e) \ + ((e)->event.magic.underlying_mswindows_event) +#define XM_BUMPQUEUE (WM_USER + 101) +#define XM_MAPFRAME (WM_USER + 102) +#define XM_UNMAPFRAME (WM_USER + 103) + +struct mswindows_dialog_id +{ + struct lcrecord_header header; + + Lisp_Object frame; + Lisp_Object callbacks; + HWND hwnd; +}; + +#endif /* INCLUDED_console_msw_impl_h_ */
--- a/src/console-msw.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/console-msw.c Thu Jun 20 21:19:10 2002 +0000 @@ -32,7 +32,7 @@ #include <config.h> #include "lisp.h" -#include "console-msw.h" +#include "console-msw-impl.h" #include "events.h" #include "opaque.h"
--- a/src/console-msw.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/console-msw.h Thu Jun 20 21:19:10 2002 +0000 @@ -49,38 +49,10 @@ #define XEMACS_CONTROL_CLASS "XEmacsControl" /* - * Consoles - */ - -DECLARE_CONSOLE_TYPE (mswindows); - -struct mswindows_console -{ - int infd, outfd; -}; - -DECLARE_CONSOLE_TYPE (msprinter); - -/* * Printer settings, aka devmode */ -typedef struct Lisp_Devmode -{ - struct lcrecord_header header; - - /* Pointer to the DEVMODE structure */ - DEVMODEW *devmode; - - /* Full printer name. It can be longer than devmode->dmDeviceName - can accommodate, so need to keep it separately */ - Lisp_Object printer_name; - - /* Printer device this object is currently selected in, or Qnil - if not selected */ - Lisp_Object device; - -} Lisp_Devmode; +typedef struct Lisp_Devmode Lisp_Devmode; DECLARE_LRECORD (devmode, Lisp_Devmode); @@ -90,72 +62,15 @@ #define CHECK_DEVMODE(x) CHECK_RECORD (x, devmode) #define CONCHECK_DEVMODE(x) CONCHECK_RECORD (x, devmode) -#define DEVMODE_SIZE(dm) ((dm)->dmSize + (dm)->dmDriverExtra) -#define XDEVMODE_SIZE(x) ((x)->devmode ? DEVMODE_SIZE((x)->devmode) : 0) - /* * Devices */ #define MSW_FONTSIZE (LF_FACESIZE * 4 + 12) -struct mswindows_device -{ - Lisp_Object fontlist; /* List of strings, device fonts */ - HDC hcdc; /* Compatible DC */ - DWORD update_tick; /* Used when device is modified through - Windows messages, see WM_DISPLAYCHANGE - in event-msw.c */ -}; - -#define DEVICE_MSWINDOWS_DATA(d) DEVICE_TYPE_DATA (d, mswindows) -#define DEVICE_MSWINDOWS_FONTLIST(d) (DEVICE_MSWINDOWS_DATA (d)->fontlist) -#define DEVICE_MSWINDOWS_HCDC(d) (DEVICE_MSWINDOWS_DATA (d)->hcdc) -#define DEVICE_MSWINDOWS_UPDATE_TICK(d) (DEVICE_MSWINDOWS_DATA (d)->update_tick) - -struct msprinter_device -{ - HDC hdc, hcdc; /* Printer and the comp. DCs */ - HANDLE hprinter; - Lisp_Object name; - Lisp_Object devmode; - Lisp_Object fontlist; -}; - -#define DEVICE_MSPRINTER_DATA(d) DEVICE_TYPE_DATA (d, msprinter) -#define DEVICE_MSPRINTER_HDC(d) (DEVICE_MSPRINTER_DATA (d)->hdc) -#define DEVICE_MSPRINTER_HCDC(d) (DEVICE_MSPRINTER_DATA (d)->hcdc) -#define DEVICE_MSPRINTER_HPRINTER(d) (DEVICE_MSPRINTER_DATA (d)->hprinter) -#define DEVICE_MSPRINTER_FONTLIST(d) (DEVICE_MSPRINTER_DATA (d)->fontlist) -#define DEVICE_MSPRINTER_NAME(d) (DEVICE_MSPRINTER_DATA (d)->name) -#define DEVICE_MSPRINTER_DEVMODE(d) (DEVICE_MSPRINTER_DATA (d)->devmode) - -#define CONSOLE_TYPESYM_MSPRINTER_P(typesym) EQ (typesym, Qmsprinter) -#define DEVICE_MSPRINTER_P(dev) CONSOLE_TYPESYM_MSPRINTER_P (DEVICE_TYPE (dev)) -#define CHECK_MSPRINTER_DEVICE(z) CHECK_DEVICE_TYPE (z, msprinter) -#define CONCHECK_MSPRINTER_DEVICE(z) CONCHECK_DEVICE_TYPE (z, msprinter) - /* Printer functions in frame-msw.c */ void msprinter_start_page (struct frame *f); -/* Common checks */ - -#define DEVICE_MSGDI_P(dev) (DEVICE_MSWINDOWS_P(dev) || DEVICE_MSPRINTER_P(dev)) -#define CHECK_MSGDI_DEVICE(d) \ - do { \ - CHECK_DEVICE (d); \ - if (!(DEVICEP (d) && DEVICE_MSGDI_P(XDEVICE(d)))) \ - dead_wrong_type_argument \ - (list3 (Qor, Qmswindows, Qmsprinter), d); \ - } while (0) -#define CONCHECK_MSGDI_DEVICE(d) \ - do { \ - CHECK_DEVICE (d); \ - if (!(DEVICEP (d) && DEVICE_MSGDI_P(XDEVICE(d)))) \ - wrong_type_argument \ - (list3 (Qor, Qmswindows, Qmsprinter), d); \ - } while (0) - /* * Frames */ @@ -167,145 +82,6 @@ int height; } XEMACS_RECT_WH; -struct mswindows_frame -{ - /* win32 window handle */ - HWND hwnd; - - /* DC for this win32 window */ - HDC hdc; - - /* Used with DeferWindowPos */ - HDWP hdwp; - - /* Time of last click event, for button 2 emul */ - DWORD last_click_time; - - /* Mods of last click event */ - DWORD last_click_mods; - - /* Coordinates of last click event, screen-relative */ - POINTS last_click_point; -#ifdef HAVE_TOOLBARS - /* Toolbar hash table. See toolbar-msw.c */ - Lisp_Object toolbar_hash_table; - unsigned int toolbar_checksum[4]; -#endif - - /* Menu hash table. See menubar-msw.c */ - Lisp_Object menu_hash_table; - - /* Menu checksum. See menubar-msw.c */ - unsigned int menu_checksum; - - /* Widget glyphs attached to this frame. See glyphs-msw.c */ - Lisp_Object widget_hash_table1, widget_hash_table2, widget_hash_table3; - - /* Frame title hash value. See frame-msw.c */ - unsigned int title_checksum; - - /* Real character width and height of the frame. - FRAME_{HEIGHT,WIDTH} do not work for pixel geometry! */ - int charheight, charwidth; - -#ifdef MULE - int cursor_x; - int cursor_y; - face_index cursor_findex; -#endif - - /* Misc flags */ - int button2_need_lbutton : 1; - int button2_need_rbutton : 1; - int button2_is_down : 1; - int ignore_next_lbutton_up : 1; - int ignore_next_rbutton_up : 1; - int sizing : 1; - int paint_pending : 1; /* Whether a WM_PAINT magic event has been queued */ - int popup : 1; /* frame is a popup frame */ - - /* Geometry, in characters, as specified by proplist during frame - creation. Members are set to -1 for unspecified */ - XEMACS_RECT_WH *target_rect; -}; - -#define FRAME_MSWINDOWS_DATA(f) FRAME_TYPE_DATA (f, mswindows) - -#define FRAME_MSWINDOWS_HANDLE(f) (FRAME_MSWINDOWS_DATA (f)->hwnd) -#define FRAME_MSWINDOWS_DC(f) (FRAME_MSWINDOWS_DATA (f)->hdc) -#define FRAME_MSWINDOWS_MENU_HASH_TABLE(f) (FRAME_MSWINDOWS_DATA (f)->menu_hash_table) -#define FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE(f) \ - (FRAME_MSWINDOWS_DATA (f)->toolbar_hash_table) -#define FRAME_MSWINDOWS_WIDGET_HASH_TABLE1(f) \ - (FRAME_MSWINDOWS_DATA (f)->widget_hash_table1) -#define FRAME_MSWINDOWS_WIDGET_HASH_TABLE2(f) \ - (FRAME_MSWINDOWS_DATA (f)->widget_hash_table2) -#define FRAME_MSWINDOWS_WIDGET_HASH_TABLE3(f) \ - (FRAME_MSWINDOWS_DATA (f)->widget_hash_table3) -#define FRAME_MSWINDOWS_TOOLBAR_CHECKSUM(f,pos) \ - (FRAME_MSWINDOWS_DATA (f)->toolbar_checksum[pos]) -#define FRAME_MSWINDOWS_MENU_CHECKSUM(f) (FRAME_MSWINDOWS_DATA (f)->menu_checksum) -#define FRAME_MSWINDOWS_TITLE_CHECKSUM(f) (FRAME_MSWINDOWS_DATA (f)->title_checksum) -#define FRAME_MSWINDOWS_CHARWIDTH(f) (FRAME_MSWINDOWS_DATA (f)->charwidth) -#define FRAME_MSWINDOWS_CHARHEIGHT(f) (FRAME_MSWINDOWS_DATA (f)->charheight) -#define FRAME_MSWINDOWS_TARGET_RECT(f) (FRAME_MSWINDOWS_DATA (f)->target_rect) - -#define FRAME_MSWINDOWS_POPUP(f) (FRAME_MSWINDOWS_DATA (f)->popup) - -#ifdef MULE -# define FRAME_MSWINDOWS_CURSOR_X(f) (FRAME_MSWINDOWS_DATA (f)->cursor_x) -# define FRAME_MSWINDOWS_CURSOR_Y(f) (FRAME_MSWINDOWS_DATA (f)->cursor_y) -# define FRAME_MSWINDOWS_CURSOR_FINDEX(f) (FRAME_MSWINDOWS_DATA (f)->cursor_findex) -#endif - -/* Frame check and validation macros */ -#define FRAME_MSWINDOWS_P(frm) CONSOLE_TYPESYM_MSWINDOWS_P (FRAME_TYPE (frm)) -#define CHECK_MSWINDOWS_FRAME(z) CHECK_FRAME_TYPE (z, mswindows) -#define CONCHECK_MSWINDOWS_FRAME(z) CONCHECK_FRAME_TYPE (z, mswindows) - -/* win32 window LONG indices */ -#define XWL_FRAMEOBJ 0 -#define XWL_COUNT 1 /* Number of LONGs that we use */ -#define MSWINDOWS_WINDOW_EXTRA_BYTES (XWL_COUNT * 4) - -/* - * Printer frame, aka printer job - */ - -struct msprinter_frame -{ - int left_margin, top_margin, /* All in twips */ - right_margin, bottom_margin; - int charheight, charwidth; /* As per proplist or -1 if not given */ - int pix_left, pix_top; /* Calculated in init_frame_*, VP offset */ - int job_started : 1; - int page_started : 1; -}; - -#define FRAME_MSPRINTER_DATA(f) FRAME_TYPE_DATA (f, msprinter) -#define FRAME_MSPRINTER_LEFT_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->left_margin) -#define FRAME_MSPRINTER_RIGHT_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->top_margin) -#define FRAME_MSPRINTER_TOP_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->right_margin) -#define FRAME_MSPRINTER_BOTTOM_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->bottom_margin) -#define FRAME_MSPRINTER_JOB_STARTED(f) (FRAME_MSPRINTER_DATA (f)->job_started) -#define FRAME_MSPRINTER_PAGE_STARTED(f) (FRAME_MSPRINTER_DATA (f)->page_started) -#define FRAME_MSPRINTER_CHARWIDTH(f) (FRAME_MSPRINTER_DATA (f)->charwidth) -#define FRAME_MSPRINTER_CHARHEIGHT(f) (FRAME_MSPRINTER_DATA (f)->charheight) -#define FRAME_MSPRINTER_PIXLEFT(f) (FRAME_MSPRINTER_DATA (f)->pix_left) -#define FRAME_MSPRINTER_PIXTOP(f) (FRAME_MSPRINTER_DATA (f)->pix_top) - -/* - * Events - */ - -/* win32 messages / magic event types */ -#define EVENT_MSWINDOWS_MAGIC_TYPE(e) \ - ((e)->event.magic.underlying_mswindows_event) -#define XM_BUMPQUEUE (WM_USER + 101) -#define XM_MAPFRAME (WM_USER + 102) -#define XM_UNMAPFRAME (WM_USER + 103) - - /* * Random globals */ @@ -397,19 +173,31 @@ Lisp_Object mswindows_find_frame (HWND hwnd); +/* Defined in console-msw.c */ +EXFUN (Fmswindows_message_box, 3); +extern int mswindows_message_outputted; +void mswindows_hide_console (void); +int mswindows_output_console_string (const Ibyte *ptr, Bytecount len); +void write_string_to_mswindows_debugging_output (Ibyte *str, Bytecount len); + + #ifdef MULE Lisp_Object mswindows_get_code_page_charset (int code_page); void mswindows_start_ime_composition (struct frame *f); #endif /* MULE */ -struct mswindows_dialog_id -{ - struct lcrecord_header header; +/* Defined in intl-win32.c */ +EXFUN (Fmswindows_set_current_locale, 1); +EXFUN (Fmswindows_current_locale, 0); +EXFUN (Fmswindows_user_default_locale, 0); +EXFUN (Fmswindows_system_default_locale, 0); +EXFUN (Fmswindows_locale_code_page, 1); +EXFUN (Fmswindows_supported_locales, 0); +EXFUN (Fmswindows_charset_code_page, 1); +EXFUN (Fmswindows_charset_registry, 1); +EXFUN (Fmswindows_set_charset_code_page, 2); - Lisp_Object frame; - Lisp_Object callbacks; - HWND hwnd; -}; +struct mswindows_dialog_id; DECLARE_LRECORD (mswindows_dialog_id, struct mswindows_dialog_id); #define XMSWINDOWS_DIALOG_ID(x) XRECORD (x, mswindows_dialog_id, struct mswindows_dialog_id)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/console-stream-impl.h Thu Jun 20 21:19:10 2002 +0000 @@ -0,0 +1,44 @@ +/* Define stream specific console, device, and frame object for XEmacs. + Copyright (C) 1995 Board of Trustees, University of Illinois. + Copyright (C) 1995 Free Software Foundation, Inc. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +/* Written by Ben Wing. */ + +#ifndef INCLUDED_console_stream_impl_h_ +#define INCLUDED_console_stream_impl_h_ + +#include "console-impl.h" +#include "console-stream.h" + +DECLARE_CONSOLE_TYPE (stream); + +struct stream_console +{ + FILE *in; + FILE *out; + FILE *err; + int needs_newline; +}; + +#define CONSOLE_STREAM_DATA(con) CONSOLE_TYPE_DATA (con, stream) + +#endif /* INCLUDED_console_stream_impl_h_ */
--- a/src/console-stream.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/console-stream.c Thu Jun 20 21:19:10 2002 +0000 @@ -28,14 +28,14 @@ #include <config.h> #include "lisp.h" -#include "device.h" +#include "device-impl.h" #include "events.h" -#include "frame.h" +#include "frame-impl.h" #include "redisplay.h" #include "sysdep.h" #include "window.h" -#include "console-stream.h" +#include "console-stream-impl.h" #include "console-tty.h" #include "sysfile.h"
--- a/src/console-stream.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/console-stream.h Thu Jun 20 21:19:10 2002 +0000 @@ -28,26 +28,14 @@ #include "console.h" -DECLARE_CONSOLE_TYPE (stream); - -struct stream_console -{ - FILE *in; - FILE *out; - FILE *err; - int needs_newline; -}; - -#define CONSOLE_STREAM_DATA(con) CONSOLE_TYPE_DATA (con, stream) - extern Lisp_Object Vterminal_console, Vterminal_frame, Vterminal_device; -Lisp_Object stream_semi_canonicalize_console_connection(Lisp_Object, +Lisp_Object stream_semi_canonicalize_console_connection (Lisp_Object, + Error_Behavior); +Lisp_Object stream_canonicalize_console_connection (Lisp_Object, + Error_Behavior); +Lisp_Object stream_semi_canonicalize_device_connection (Lisp_Object, Error_Behavior); -Lisp_Object stream_canonicalize_console_connection(Lisp_Object, +Lisp_Object stream_canonicalize_device_connection (Lisp_Object, Error_Behavior); -Lisp_Object stream_semi_canonicalize_device_connection(Lisp_Object, - Error_Behavior); -Lisp_Object stream_canonicalize_device_connection(Lisp_Object, - Error_Behavior); #endif /* INCLUDED_console_stream_h_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/console-tty-impl.h Thu Jun 20 21:19:10 2002 +0000 @@ -0,0 +1,245 @@ +/* Define TTY specific console, device, and frame object for XEmacs. + Copyright (C) 1995 Board of Trustees, University of Illinois. + Copyright (C) 1996 Ben Wing. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +/* Written by Chuck Thompson and Ben Wing. */ + +/* NOTE: Currently each TTY console can have only one device. + Therefore, all stuff for both input and output is lumped into + the console structure. If it ever becomes meaningful to + have more than one device on a TTY console, the output stuff + will have to get separated out. */ + +#ifndef INCLUDED_console_tty_impl_h_ +#define INCLUDED_console_tty_impl_h_ + +#include "console-impl.h" +#include "console-tty.h" + +DECLARE_CONSOLE_TYPE (tty); + +struct tty_console +{ + int infd, outfd; + Lisp_Object instream, outstream; + Lisp_Object terminal_type; + Lisp_Object controlling_process; + char *term_entry_buffer; + + /* Physical location of cursor on this console. */ + int cursor_x; + int cursor_y; + + /* The real location of the cursor. The above physical location may + be ahead of where we really are. */ + int real_cursor_x; + int real_cursor_y; + + int final_cursor_x; + int final_cursor_y; + + int height; + int width; + + /* The count of frame number. */ + int frame_count; + + /* flags indicating presence, absence or value of various features */ + struct + { + unsigned int must_write_spaces :1; /* terminal inserts nulls, not + spaces to fill whitespace on + screen */ + unsigned int insert_mode_motion :1; /* cursor movement commands + work while in insert mode */ + unsigned int standout_motion :1; /* cursor movement is graceful + in standout or underline mode */ + unsigned int memory_above_frame :1; /* display retained above screen */ + unsigned int memory_below_frame :1; /* display retained below screen */ + unsigned int meta_key :2; /* 0 == mask off top bit; + 1 == top bit is meta; + 2 == top bit is useful as + character info */ + unsigned int flow_control :1; /* Nonzero means use ^S/^Q as + cretinous flow control. */ + int standout_width; /* # of spaces printed when + change to standout mode */ + int underline_width; /* # of spaces printed when + change to underline mode */ + } flags; + + /* cursor motion entries - each entry is commented with the terminfo + and the termcap entry */ + struct + { + /* local cursor movement */ + const char *up; /* cuu1, up */ + const char *down; /* cud1, do */ + const char *left; /* cub1, le */ + const char *right; /* cuf1, nd */ + const char *home; /* home, ho */ + const char *low_left; /* ll, ll */ + const char *car_return; /* cr, cr */ + + /* parameterized local cursor movement */ + const char *multi_up; /* cuu, UP */ + const char *multi_down; /* cud, DO */ + const char *multi_left; /* cub, LE */ + const char *multi_right; /* cuf, RI */ + + /* absolute cursor motion */ + const char *abs; /* cup, cm */ + const char *hor_abs; /* hpa, ch */ + const char *ver_abs; /* vpa, cv */ + + /* scrolling */ + const char *scroll_forw; /* ind, sf */ + const char *scroll_back; /* ri, sr */ + const char *multi_scroll_forw; /* indn, SF */ + const char *multi_scroll_back; /* rin, SR */ + const char *set_scroll_region; /* csr, cs */ + } cm; + + /* screen editing entries - each entry is commented with the + terminfo and the termcap entry */ + struct + { + /* adding to the screen */ + const char *ins_line; /* il1, al */ + const char *multi_ins_line; /* il, AL */ + const char *repeat; /* rep, rp */ + const char *begin_ins_mode; /* smir, im */ + const char *end_ins_mode; /* rmir, ei */ + const char *ins_char; /* ich1, ic */ + const char *multi_ins_char; /* ich, IC */ + const char *insert_pad; /* ip, ip */ + + /* deleting from the screen */ + const char *clr_frame; /* clear, cl */ + const char *clr_from_cursor; /* ed, cd */ + const char *clr_to_eol; /* el, ce */ + const char *del_line; /* dl1, dl */ + const char *multi_del_line; /* dl, DL */ + const char *del_char; /* dch1, dc */ + const char *multi_del_char; /* dch, DC */ + const char *begin_del_mode; /* smdc, dm */ + const char *end_del_mode; /* rmdc, ed */ + const char *erase_at_cursor; /* ech, ec */ + } se; + + /* screen display entries - each entry is commented with the + terminfo and termcap entry */ + struct + { + const char *begin_standout; /* smso, so */ + const char *end_standout; /* rmso, se */ + const char *begin_underline; /* smul, us */ + const char *end_underline; /* rmul, ue */ + const char *begin_alternate; /* smacs, as */ + const char *end_alternate; /* rmacs, ae */ + + const char *turn_on_reverse; /* rev, mr */ + const char *turn_on_blinking; /* blink, mb */ + const char *turn_on_bold; /* bold, md */ + const char *turn_on_dim; /* dim, mh */ + const char *turn_off_attributes; /* sgr0, me */ + + const char *visual_bell; /* flash, vb */ + const char *audio_bell; /* bel, bl */ + + const char *cursor_visible; /* cvvis, vs */ + const char *cursor_normal; /* cnorm, ve */ + const char *init_motion; /* smcup, ti */ + const char *end_motion; /* rmcup, te */ + const char *keypad_on; /* smkx, ks */ + const char *keypad_off; /* rmkx, ke */ + + const char *orig_pair; /* op, op */ + } sd; + + /* costs of various operations */ + struct + { + int cm_up; + int cm_down; + int cm_left; + int cm_right; + int cm_home; + int cm_low_left; + int cm_car_return; + int cm_abs; + int cm_hor_abs; + int cm_ver_abs; + } cost; + + /* The initial tty mode bits */ + struct emacs_tty old_tty; + + /* Is this TTY our controlling terminal? */ + unsigned int controlling_terminal :1; + unsigned int is_stdio :1; +}; + +#define CONSOLE_TTY_DATA(c) CONSOLE_TYPE_DATA (c, tty) +#define CONSOLE_TTY_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->cursor_x) +#define CONSOLE_TTY_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->cursor_y) +#define CONSOLE_TTY_REAL_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->real_cursor_x) +#define CONSOLE_TTY_REAL_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->real_cursor_y) +#define CONSOLE_TTY_FINAL_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->final_cursor_x) +#define CONSOLE_TTY_FINAL_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->final_cursor_y) + +#define TTY_CM(c) (CONSOLE_TTY_DATA (c)->cm) +#define TTY_SE(c) (CONSOLE_TTY_DATA (c)->se) +#define TTY_SD(c) (CONSOLE_TTY_DATA (c)->sd) +#define TTY_FLAGS(c) (CONSOLE_TTY_DATA (c)->flags) +#define TTY_COST(c) (CONSOLE_TTY_DATA (c)->cost) + +#define TTY_INC_CURSOR_X(c, n) do { \ + int TICX_n = (n); \ + assert (CONSOLE_TTY_CURSOR_X (c) == CONSOLE_TTY_REAL_CURSOR_X (c)); \ + CONSOLE_TTY_CURSOR_X (c) += TICX_n; \ + CONSOLE_TTY_REAL_CURSOR_X (c) += TICX_n; \ +} while (0) + +#define TTY_INC_CURSOR_Y(c, n) do { \ + int TICY_n = (n); \ + CONSOLE_TTY_CURSOR_Y (c) += TICY_n; \ + CONSOLE_TTY_REAL_CURSOR_Y (c) += TICY_n; \ +} while (0) + +struct tty_device +{ +#ifdef HAVE_TERMIOS + speed_t ospeed; /* Output speed (from sg_ospeed) */ +#else + short ospeed; /* Output speed (from sg_ospeed) */ +#endif +}; + +#define DEVICE_TTY_DATA(d) DEVICE_TYPE_DATA (d, tty) + +/* termcap requires this to be global */ +#ifndef HAVE_TERMIOS +extern short ospeed; /* Output speed (from sg_ospeed) */ +#endif + +#endif /* INCLUDED_console_tty_impl_h_ */
--- a/src/console-tty.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/console-tty.c Thu Jun 20 21:19:10 2002 +0000 @@ -27,15 +27,18 @@ #include <config.h> #include "lisp.h" -#include "console-tty.h" +#include "console-tty-impl.h" #include "console-stream.h" + #include "faces.h" +#include "file-coding.h" #include "frame.h" +#include "glyphs.h" #include "lstream.h" -#include "glyphs.h" +#include "process.h" + #include "sysdep.h" #include "sysfile.h" -#include "file-coding.h" DEFINE_CONSOLE_TYPE (tty); DECLARE_IMAGE_INSTANTIATOR_FORMAT (nothing);
--- a/src/console-tty.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/console-tty.h Thu Jun 20 21:19:10 2002 +0000 @@ -35,213 +35,6 @@ #include "console.h" #include "systty.h" -DECLARE_CONSOLE_TYPE (tty); - -struct tty_console -{ - int infd, outfd; - Lisp_Object instream, outstream; - Lisp_Object terminal_type; - Lisp_Object controlling_process; - char *term_entry_buffer; - - /* Physical location of cursor on this console. */ - int cursor_x; - int cursor_y; - - /* The real location of the cursor. The above physical location may - be ahead of where we really are. */ - int real_cursor_x; - int real_cursor_y; - - int final_cursor_x; - int final_cursor_y; - - int height; - int width; - - /* The count of frame number. */ - int frame_count; - - /* flags indicating presence, absence or value of various features */ - struct - { - unsigned int must_write_spaces :1; /* terminal inserts nulls, not - spaces to fill whitespace on - screen */ - unsigned int insert_mode_motion :1; /* cursor movement commands - work while in insert mode */ - unsigned int standout_motion :1; /* cursor movement is graceful - in standout or underline mode */ - unsigned int memory_above_frame :1; /* display retained above screen */ - unsigned int memory_below_frame :1; /* display retained below screen */ - unsigned int meta_key :2; /* 0 == mask off top bit; - 1 == top bit is meta; - 2 == top bit is useful as - character info */ - unsigned int flow_control :1; /* Nonzero means use ^S/^Q as - cretinous flow control. */ - int standout_width; /* # of spaces printed when - change to standout mode */ - int underline_width; /* # of spaces printed when - change to underline mode */ - } flags; - - /* cursor motion entries - each entry is commented with the terminfo - and the termcap entry */ - struct - { - /* local cursor movement */ - const char *up; /* cuu1, up */ - const char *down; /* cud1, do */ - const char *left; /* cub1, le */ - const char *right; /* cuf1, nd */ - const char *home; /* home, ho */ - const char *low_left; /* ll, ll */ - const char *car_return; /* cr, cr */ - - /* parameterized local cursor movement */ - const char *multi_up; /* cuu, UP */ - const char *multi_down; /* cud, DO */ - const char *multi_left; /* cub, LE */ - const char *multi_right; /* cuf, RI */ - - /* absolute cursor motion */ - const char *abs; /* cup, cm */ - const char *hor_abs; /* hpa, ch */ - const char *ver_abs; /* vpa, cv */ - - /* scrolling */ - const char *scroll_forw; /* ind, sf */ - const char *scroll_back; /* ri, sr */ - const char *multi_scroll_forw; /* indn, SF */ - const char *multi_scroll_back; /* rin, SR */ - const char *set_scroll_region; /* csr, cs */ - } cm; - - /* screen editing entries - each entry is commented with the - terminfo and the termcap entry */ - struct - { - /* adding to the screen */ - const char *ins_line; /* il1, al */ - const char *multi_ins_line; /* il, AL */ - const char *repeat; /* rep, rp */ - const char *begin_ins_mode; /* smir, im */ - const char *end_ins_mode; /* rmir, ei */ - const char *ins_char; /* ich1, ic */ - const char *multi_ins_char; /* ich, IC */ - const char *insert_pad; /* ip, ip */ - - /* deleting from the screen */ - const char *clr_frame; /* clear, cl */ - const char *clr_from_cursor; /* ed, cd */ - const char *clr_to_eol; /* el, ce */ - const char *del_line; /* dl1, dl */ - const char *multi_del_line; /* dl, DL */ - const char *del_char; /* dch1, dc */ - const char *multi_del_char; /* dch, DC */ - const char *begin_del_mode; /* smdc, dm */ - const char *end_del_mode; /* rmdc, ed */ - const char *erase_at_cursor; /* ech, ec */ - } se; - - /* screen display entries - each entry is commented with the - terminfo and termcap entry */ - struct - { - const char *begin_standout; /* smso, so */ - const char *end_standout; /* rmso, se */ - const char *begin_underline; /* smul, us */ - const char *end_underline; /* rmul, ue */ - const char *begin_alternate; /* smacs, as */ - const char *end_alternate; /* rmacs, ae */ - - const char *turn_on_reverse; /* rev, mr */ - const char *turn_on_blinking; /* blink, mb */ - const char *turn_on_bold; /* bold, md */ - const char *turn_on_dim; /* dim, mh */ - const char *turn_off_attributes; /* sgr0, me */ - - const char *visual_bell; /* flash, vb */ - const char *audio_bell; /* bel, bl */ - - const char *cursor_visible; /* cvvis, vs */ - const char *cursor_normal; /* cnorm, ve */ - const char *init_motion; /* smcup, ti */ - const char *end_motion; /* rmcup, te */ - const char *keypad_on; /* smkx, ks */ - const char *keypad_off; /* rmkx, ke */ - - const char *orig_pair; /* op, op */ - } sd; - - /* costs of various operations */ - struct - { - int cm_up; - int cm_down; - int cm_left; - int cm_right; - int cm_home; - int cm_low_left; - int cm_car_return; - int cm_abs; - int cm_hor_abs; - int cm_ver_abs; - } cost; - - /* The initial tty mode bits */ - struct emacs_tty old_tty; - - /* Is this TTY our controlling terminal? */ - unsigned int controlling_terminal :1; - unsigned int is_stdio :1; -}; - -#define CONSOLE_TTY_DATA(c) CONSOLE_TYPE_DATA (c, tty) -#define CONSOLE_TTY_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->cursor_x) -#define CONSOLE_TTY_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->cursor_y) -#define CONSOLE_TTY_REAL_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->real_cursor_x) -#define CONSOLE_TTY_REAL_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->real_cursor_y) -#define CONSOLE_TTY_FINAL_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->final_cursor_x) -#define CONSOLE_TTY_FINAL_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->final_cursor_y) - -#define TTY_CM(c) (CONSOLE_TTY_DATA (c)->cm) -#define TTY_SE(c) (CONSOLE_TTY_DATA (c)->se) -#define TTY_SD(c) (CONSOLE_TTY_DATA (c)->sd) -#define TTY_FLAGS(c) (CONSOLE_TTY_DATA (c)->flags) -#define TTY_COST(c) (CONSOLE_TTY_DATA (c)->cost) - -#define TTY_INC_CURSOR_X(c, n) do { \ - int TICX_n = (n); \ - assert (CONSOLE_TTY_CURSOR_X (c) == CONSOLE_TTY_REAL_CURSOR_X (c)); \ - CONSOLE_TTY_CURSOR_X (c) += TICX_n; \ - CONSOLE_TTY_REAL_CURSOR_X (c) += TICX_n; \ -} while (0) - -#define TTY_INC_CURSOR_Y(c, n) do { \ - int TICY_n = (n); \ - CONSOLE_TTY_CURSOR_Y (c) += TICY_n; \ - CONSOLE_TTY_REAL_CURSOR_Y (c) += TICY_n; \ -} while (0) - -struct tty_device -{ -#ifdef HAVE_TERMIOS - speed_t ospeed; /* Output speed (from sg_ospeed) */ -#else - short ospeed; /* Output speed (from sg_ospeed) */ -#endif -}; - -#define DEVICE_TTY_DATA(d) DEVICE_TYPE_DATA (d, tty) - -/* termcap requires this to be global */ -#ifndef HAVE_TERMIOS -extern short ospeed; /* Output speed (from sg_ospeed) */ -#endif - extern FILE *termscript; EXFUN (Fconsole_tty_controlling_process, 1);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/console-x-impl.h Thu Jun 20 21:19:10 2002 +0000 @@ -0,0 +1,341 @@ +/* Define X specific console, device, and frame object for XEmacs. + Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. + Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. + Copyright (C) 1996, 2002 Ben Wing. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + + +/* Authorship: + + Ultimately based on FSF, then later on JWZ work for Lemacs. + Rewritten over time by Ben Wing and Chuck Thompson (original + multi-device work by Chuck Thompson). + */ + +#ifndef INCLUDED_console_x_impl_h_ +#define INCLUDED_console_x_impl_h_ + +#ifdef HAVE_X_WINDOWS + +#include "console-impl.h" +#include "console-x.h" + +DECLARE_CONSOLE_TYPE (x); + +struct x_device +{ + /* The X connection of this device. */ + Display *display; + + /* Set by x_IO_error_handler(). */ + int being_deleted; + + /* Xt application info. */ + Widget Xt_app_shell; + + /* Cache of GC's for frames on this device. */ + struct gc_cache *gc_cache; + + /* Selected visual, depth and colormap for this device */ + Visual *visual; + int depth; + Colormap device_cmap; + + /* Used by x_bevel_modeline in redisplay-x.c */ + Pixmap gray_pixmap; + + /* Atoms associated with this device. */ + /* allocated in Xatoms_of_device_x */ + Atom Xatom_WM_PROTOCOLS; + Atom Xatom_WM_DELETE_WINDOW; + Atom Xatom_WM_SAVE_YOURSELF; + Atom Xatom_WM_TAKE_FOCUS; + Atom Xatom_WM_STATE; + + /* allocated in Xatoms_of_select_x */ + Atom Xatom_CLIPBOARD; + Atom Xatom_TIMESTAMP; + Atom Xatom_TEXT; + Atom Xatom_DELETE; + Atom Xatom_MULTIPLE; + Atom Xatom_INCR; + Atom Xatom_EMACS_TMP; + Atom Xatom_TARGETS; + Atom Xatom_NULL; + Atom Xatom_ATOM_PAIR; + Atom Xatom_COMPOUND_TEXT; + + /* allocated in Xatoms_of_objects_x */ + Atom Xatom_FOUNDRY; + Atom Xatom_FAMILY_NAME; + Atom Xatom_WEIGHT_NAME; + Atom Xatom_SLANT; + Atom Xatom_SETWIDTH_NAME; + Atom Xatom_ADD_STYLE_NAME; + Atom Xatom_PIXEL_SIZE; + Atom Xatom_POINT_SIZE; + Atom Xatom_RESOLUTION_X; + Atom Xatom_RESOLUTION_Y; + Atom Xatom_SPACING; + Atom Xatom_AVERAGE_WIDTH; + Atom Xatom_CHARSET_REGISTRY; + Atom Xatom_CHARSET_ENCODING; + + /* The following items are all used exclusively in event-Xt.c. */ + int MetaMask, HyperMask, SuperMask, AltMask, ModeMask; + KeySym lock_interpretation; + + XModifierKeymap *x_modifier_keymap; + + KeySym *x_keysym_map; + int x_keysym_map_min_code; + int x_keysym_map_max_code; + int x_keysym_map_keysyms_per_code; + Lisp_Object x_keysym_map_hash_table; + + /* frame that holds the WM_COMMAND property; there should be exactly + one of these per device. */ + Lisp_Object WM_COMMAND_frame; + + /* #### It's not clear that there is much distinction anymore + between mouse_timestamp and global_mouse_timestamp, now that + Emacs doesn't see most (all?) events not destined for it. */ + + /* The timestamp of the last button or key event used by emacs itself. + This is used for asserting selections and input focus. */ + Time mouse_timestamp; + + /* This is the timestamp the last button or key event whether it was + dispatched to emacs or widgets. */ + Time global_mouse_timestamp; + + /* This is the last known timestamp received from the server. It is + maintained by x_event_to_emacs_event and used to patch bogus + WM_TAKE_FOCUS messages sent by Mwm. */ + Time last_server_timestamp; + + /* Used by Xlib to preserve information across calls to + XLookupString(), to implement compose processing. + + According to The X Window System, p. 467, "The creation of + XComposeStatus structures is implementation dependent; + a portable program must pass NULL for this argument." + But this means that a portable program cannot implement + compose processing! WTF? + + So we just set it to all zeros. */ + + /* No X Server ever used this, AFAIK -- mrb */ + /* XComposeStatus x_compose_status; */ + +#ifdef HAVE_XIM + XIM xim; + XIMStyles *xim_styles; +#endif /* HAVE_XIM */ + + /* stuff for sticky modifiers: */ + + unsigned int need_to_add_mask, down_mask; + KeyCode last_downkey; + Time release_time; + Time modifier_release_time; +}; + +#define DEVICE_X_DATA(d) DEVICE_TYPE_DATA (d, x) + +#define FRAME_X_DISPLAY(f) (DEVICE_X_DISPLAY (XDEVICE (f->device))) +#define DEVICE_X_DISPLAY(d) (DEVICE_X_DATA (d)->display) +#define DEVICE_X_BEING_DELETED(d) (DEVICE_X_DATA (d)->being_deleted) +#define DEVICE_X_VISUAL(d) (DEVICE_X_DATA (d)->visual) +#define DEVICE_X_DEPTH(d) (DEVICE_X_DATA (d)->depth) +#define DEVICE_X_COLORMAP(d) (DEVICE_X_DATA (d)->device_cmap) +#define DEVICE_XT_APP_SHELL(d) (DEVICE_X_DATA (d)->Xt_app_shell) +#define DEVICE_X_GC_CACHE(d) (DEVICE_X_DATA (d)->gc_cache) +#define DEVICE_X_GRAY_PIXMAP(d) (DEVICE_X_DATA (d)->gray_pixmap) +#define DEVICE_X_WM_COMMAND_FRAME(d) (DEVICE_X_DATA (d)->WM_COMMAND_frame) +#define DEVICE_X_MOUSE_TIMESTAMP(d) (DEVICE_X_DATA (d)->mouse_timestamp) +#define DEVICE_X_GLOBAL_MOUSE_TIMESTAMP(d) (DEVICE_X_DATA (d)->global_mouse_timestamp) +#define DEVICE_X_LAST_SERVER_TIMESTAMP(d) (DEVICE_X_DATA (d)->last_server_timestamp) +#define DEVICE_X_KEYSYM_MAP_HASH_TABLE(d) (DEVICE_X_DATA (d)->x_keysym_map_hash_table) +/* #define DEVICE_X_X_COMPOSE_STATUS(d) (DEVICE_X_DATA (d)->x_compose_status) */ +#ifdef HAVE_XIM +#define DEVICE_X_XIM(d) (DEVICE_X_DATA (d)->xim) +#define DEVICE_X_XIM_STYLES(d) (DEVICE_X_DATA (d)->xim_styles) +#define DEVICE_X_FONTSET(d) (DEVICE_X_DATA (d)->fontset) +#endif /* HAVE_XIM */ + +/* allocated in Xatoms_of_device_x */ +#define DEVICE_XATOM_WM_PROTOCOLS(d) (DEVICE_X_DATA (d)->Xatom_WM_PROTOCOLS) +#define DEVICE_XATOM_WM_DELETE_WINDOW(d) (DEVICE_X_DATA (d)->Xatom_WM_DELETE_WINDOW) +#define DEVICE_XATOM_WM_SAVE_YOURSELF(d) (DEVICE_X_DATA (d)->Xatom_WM_SAVE_YOURSELF) +#define DEVICE_XATOM_WM_TAKE_FOCUS(d) (DEVICE_X_DATA (d)->Xatom_WM_TAKE_FOCUS) +#define DEVICE_XATOM_WM_STATE(d) (DEVICE_X_DATA (d)->Xatom_WM_STATE) + +/* allocated in Xatoms_of_select_x */ +#define DEVICE_XATOM_CLIPBOARD(d) (DEVICE_X_DATA (d)->Xatom_CLIPBOARD) +#define DEVICE_XATOM_TIMESTAMP(d) (DEVICE_X_DATA (d)->Xatom_TIMESTAMP) +#define DEVICE_XATOM_TEXT(d) (DEVICE_X_DATA (d)->Xatom_TEXT) +#define DEVICE_XATOM_DELETE(d) (DEVICE_X_DATA (d)->Xatom_DELETE) +#define DEVICE_XATOM_MULTIPLE(d) (DEVICE_X_DATA (d)->Xatom_MULTIPLE) +#define DEVICE_XATOM_INCR(d) (DEVICE_X_DATA (d)->Xatom_INCR) +#define DEVICE_XATOM_EMACS_TMP(d) (DEVICE_X_DATA (d)->Xatom_EMACS_TMP) +#define DEVICE_XATOM_TARGETS(d) (DEVICE_X_DATA (d)->Xatom_TARGETS) +#define DEVICE_XATOM_NULL(d) (DEVICE_X_DATA (d)->Xatom_NULL) +#define DEVICE_XATOM_ATOM_PAIR(d) (DEVICE_X_DATA (d)->Xatom_ATOM_PAIR) +#define DEVICE_XATOM_COMPOUND_TEXT(d) (DEVICE_X_DATA (d)->Xatom_COMPOUND_TEXT) + +/* allocated in Xatoms_of_objects_x */ +#define DEVICE_XATOM_FOUNDRY(d) (DEVICE_X_DATA (d)->Xatom_FOUNDRY) +#define DEVICE_XATOM_FAMILY_NAME(d) (DEVICE_X_DATA (d)->Xatom_FAMILY_NAME) +#define DEVICE_XATOM_WEIGHT_NAME(d) (DEVICE_X_DATA (d)->Xatom_WEIGHT_NAME) +#define DEVICE_XATOM_SLANT(d) (DEVICE_X_DATA (d)->Xatom_SLANT) +#define DEVICE_XATOM_SETWIDTH_NAME(d) (DEVICE_X_DATA (d)->Xatom_SETWIDTH_NAME) +#define DEVICE_XATOM_ADD_STYLE_NAME(d) (DEVICE_X_DATA (d)->Xatom_ADD_STYLE_NAME) +#define DEVICE_XATOM_PIXEL_SIZE(d) (DEVICE_X_DATA (d)->Xatom_PIXEL_SIZE) +#define DEVICE_XATOM_POINT_SIZE(d) (DEVICE_X_DATA (d)->Xatom_POINT_SIZE) +#define DEVICE_XATOM_RESOLUTION_X(d) (DEVICE_X_DATA (d)->Xatom_RESOLUTION_X) +#define DEVICE_XATOM_RESOLUTION_Y(d) (DEVICE_X_DATA (d)->Xatom_RESOLUTION_Y) +#define DEVICE_XATOM_SPACING(d) (DEVICE_X_DATA (d)->Xatom_SPACING) +#define DEVICE_XATOM_AVERAGE_WIDTH(d) (DEVICE_X_DATA (d)->Xatom_AVERAGE_WIDTH) +#define DEVICE_XATOM_CHARSET_REGISTRY(d) (DEVICE_X_DATA (d)->Xatom_CHARSET_REGISTRY) +#define DEVICE_XATOM_CHARSET_ENCODING(d) (DEVICE_X_DATA (d)->Xatom_CHARSET_ENCODING) + +/* The maximum number of widgets that can be displayed above the text + area at one time. Currently no more than 3 will ever actually be + displayed (menubar, psheet, debugger panel). */ +#define MAX_CONCURRENT_TOP_WIDGETS 8 + +struct x_frame +{ + /* The widget of this frame. This is an EmacsShell or an + ExternalShell. */ + Widget widget; + + /* The parent of the EmacsFrame, the menubar, and the scrollbars. + This is an EmacsManager. */ + Widget container; + + /* The widget of the menubar, of whatever widget class it happens to be. */ + Widget menubar_widget; + + /* The widget of the edit portion of this frame; this is an EmacsFrame, + and the window of this widget is what the redisplay code draws on. */ + Widget edit_widget; + + /* Lists the widgets above the text area, in the proper order. + Used by the EmacsManager. */ + Widget top_widgets[MAX_CONCURRENT_TOP_WIDGETS]; + int num_top_widgets; + + /*************************** Miscellaneous **************************/ + + /* The icon pixmaps; these are Lisp_Image_Instance objects, or Qnil. */ + Lisp_Object icon_pixmap; + Lisp_Object icon_pixmap_mask; + +#ifdef HAVE_TOOLBARS + int old_toolbar_size[4]; + + /* We don't provide a mechanism for changing these after they are + initialized so we might as well keep pointers to them and avoid + lots of expensive calls to gc_cache_lookup. */ + GC toolbar_top_shadow_gc; + GC toolbar_bottom_shadow_gc; + GC toolbar_blank_background_gc; + GC toolbar_pixmap_background_gc; +#endif /* HAVE_TOOLBARS */ + + /* geometry string that ought to be freed. */ + char *geom_free_me_please; + +#ifdef HAVE_XIM + XPoint xic_spot; /* Spot Location cache */ +#ifdef XIM_XLIB + XIC xic; + /* Could get these at any time by asking xic, but... */ + XIMStyle xic_style; /* XIM Style cache */ +#endif /* XIM_XLIB */ +#endif /* HAVE_XIM */ + + /* 1 if the frame is completely visible on the display, 0 otherwise. + if 0 the frame may have been iconified or may be totally + or partially hidden by another X window */ + unsigned int totally_visible_p :1; + + /* NB: Both of the following flags are derivable from the 'shell' + field above, but it's easier if we also have them separately here. */ + + /* Are we a top-level frame? This means that our shell is a + TopLevelShell, and we should do certain things to interact with + the window manager. */ + unsigned int top_level_frame_p :1; + +#ifdef EXTERNAL_WIDGET + /* Are we using somebody else's window for our shell window? This + means that our shell is an ExternalShell. If this flag is set, then + `top_level_frame_p' will never be set. */ + unsigned int external_window_p :1; +#endif /* EXTERNAL_WIDGET */ +}; + +#define FRAME_X_DATA(f) FRAME_TYPE_DATA (f, x) + +#define FRAME_X_SHELL_WIDGET(f) (FRAME_X_DATA (f)->widget) +#define FRAME_X_CONTAINER_WIDGET(f) (FRAME_X_DATA (f)->container) +#define FRAME_X_MENUBAR_WIDGET(f) (FRAME_X_DATA (f)->menubar_widget) +#define FRAME_X_TEXT_WIDGET(f) (FRAME_X_DATA (f)->edit_widget) +#define FRAME_X_TOP_WIDGETS(f) (FRAME_X_DATA (f)->top_widgets) +#define FRAME_X_NUM_TOP_WIDGETS(f) (FRAME_X_DATA (f)->num_top_widgets) + +#define FRAME_X_ICON_PIXMAP(f) (FRAME_X_DATA (f)->icon_pixmap) +#define FRAME_X_ICON_PIXMAP_MASK(f) (FRAME_X_DATA (f)->icon_pixmap_mask) + +#ifdef HAVE_TOOLBARS +#define FRAME_X_OLD_TOOLBAR_SIZE(f, pos) (FRAME_X_DATA (f)->old_toolbar_size[pos]) + +#define FRAME_X_TOOLBAR_TOP_SHADOW_GC(f) (FRAME_X_DATA (f)->toolbar_top_shadow_gc) +#define FRAME_X_TOOLBAR_BOTTOM_SHADOW_GC(f) (FRAME_X_DATA (f)->toolbar_bottom_shadow_gc) +#define FRAME_X_TOOLBAR_BLANK_BACKGROUND_GC(f) (FRAME_X_DATA (f)->toolbar_blank_background_gc) +#define FRAME_X_TOOLBAR_PIXMAP_BACKGROUND_GC(f) (FRAME_X_DATA (f)->toolbar_pixmap_background_gc) +#endif /* HAVE_TOOLBARS */ + +#define FRAME_X_GEOM_FREE_ME_PLEASE(f) (FRAME_X_DATA (f)->geom_free_me_please) + +#define FRAME_X_TOTALLY_VISIBLE_P(f) (FRAME_X_DATA (f)->totally_visible_p) +#define FRAME_X_TOP_LEVEL_FRAME_P(f) (FRAME_X_DATA (f)->top_level_frame_p) + +#ifdef EXTERNAL_WIDGET +#define FRAME_X_EXTERNAL_WINDOW_P(f) (FRAME_X_DATA (f)->external_window_p) +#endif + +#ifdef HAVE_XIM +#define FRAME_X_XIC_SPOT(f) (FRAME_X_DATA (f)->xic_spot) +#ifdef XIM_XLIB +#define FRAME_X_XIC(f) (FRAME_X_DATA (f)->xic) +#define FRAME_X_XIC_STYLE(f) (FRAME_X_DATA (f)->xic_style) +#endif /* XIM_XLIB */ +#endif /* HAVE_XIM */ + +extern struct console_type *x_console_type; + +#endif /* HAVE_X_WINDOWS */ + +#endif /* INCLUDED_console_x_impl_h_ */
--- a/src/console-x.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/console-x.c Thu Jun 20 21:19:10 2002 +0000 @@ -30,11 +30,12 @@ #include <config.h> #include "lisp.h" -#include "console-x.h" #include "buffer.h" #include "process.h" /* canonicalize_host_name */ #include "redisplay.h" /* for display_arg */ +#include "console-x-impl.h" + DEFINE_CONSOLE_TYPE (x); static int
--- a/src/console-x.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/console-x.h Thu Jun 20 21:19:10 2002 +0000 @@ -53,186 +53,6 @@ # define XPointer char * #endif -DECLARE_CONSOLE_TYPE (x); - -struct x_device -{ - /* The X connection of this device. */ - Display *display; - - /* Set by x_IO_error_handler(). */ - int being_deleted; - - /* Xt application info. */ - Widget Xt_app_shell; - - /* Cache of GC's for frames on this device. */ - struct gc_cache *gc_cache; - - /* Selected visual, depth and colormap for this device */ - Visual *visual; - int depth; - Colormap device_cmap; - - /* Used by x_bevel_modeline in redisplay-x.c */ - Pixmap gray_pixmap; - - /* Atoms associated with this device. */ - /* allocated in Xatoms_of_device_x */ - Atom Xatom_WM_PROTOCOLS; - Atom Xatom_WM_DELETE_WINDOW; - Atom Xatom_WM_SAVE_YOURSELF; - Atom Xatom_WM_TAKE_FOCUS; - Atom Xatom_WM_STATE; - - /* allocated in Xatoms_of_select_x */ - Atom Xatom_CLIPBOARD; - Atom Xatom_TIMESTAMP; - Atom Xatom_TEXT; - Atom Xatom_DELETE; - Atom Xatom_MULTIPLE; - Atom Xatom_INCR; - Atom Xatom_EMACS_TMP; - Atom Xatom_TARGETS; - Atom Xatom_NULL; - Atom Xatom_ATOM_PAIR; - Atom Xatom_COMPOUND_TEXT; - - /* allocated in Xatoms_of_objects_x */ - Atom Xatom_FOUNDRY; - Atom Xatom_FAMILY_NAME; - Atom Xatom_WEIGHT_NAME; - Atom Xatom_SLANT; - Atom Xatom_SETWIDTH_NAME; - Atom Xatom_ADD_STYLE_NAME; - Atom Xatom_PIXEL_SIZE; - Atom Xatom_POINT_SIZE; - Atom Xatom_RESOLUTION_X; - Atom Xatom_RESOLUTION_Y; - Atom Xatom_SPACING; - Atom Xatom_AVERAGE_WIDTH; - Atom Xatom_CHARSET_REGISTRY; - Atom Xatom_CHARSET_ENCODING; - - /* The following items are all used exclusively in event-Xt.c. */ - int MetaMask, HyperMask, SuperMask, AltMask, ModeMask; - KeySym lock_interpretation; - - XModifierKeymap *x_modifier_keymap; - - KeySym *x_keysym_map; - int x_keysym_map_min_code; - int x_keysym_map_max_code; - int x_keysym_map_keysyms_per_code; - Lisp_Object x_keysym_map_hash_table; - - /* frame that holds the WM_COMMAND property; there should be exactly - one of these per device. */ - Lisp_Object WM_COMMAND_frame; - - /* #### It's not clear that there is much distinction anymore - between mouse_timestamp and global_mouse_timestamp, now that - Emacs doesn't see most (all?) events not destined for it. */ - - /* The timestamp of the last button or key event used by emacs itself. - This is used for asserting selections and input focus. */ - Time mouse_timestamp; - - /* This is the timestamp the last button or key event whether it was - dispatched to emacs or widgets. */ - Time global_mouse_timestamp; - - /* This is the last known timestamp received from the server. It is - maintained by x_event_to_emacs_event and used to patch bogus - WM_TAKE_FOCUS messages sent by Mwm. */ - Time last_server_timestamp; - - /* Used by Xlib to preserve information across calls to - XLookupString(), to implement compose processing. - - According to The X Window System, p. 467, "The creation of - XComposeStatus structures is implementation dependent; - a portable program must pass NULL for this argument." - But this means that a portable program cannot implement - compose processing! WTF? - - So we just set it to all zeros. */ - - /* No X Server ever used this, AFAIK -- mrb */ - /* XComposeStatus x_compose_status; */ - -#ifdef HAVE_XIM - XIM xim; - XIMStyles *xim_styles; -#endif /* HAVE_XIM */ - - /* stuff for sticky modifiers: */ - - unsigned int need_to_add_mask, down_mask; - KeyCode last_downkey; - Time release_time; - Time modifier_release_time; -}; - -#define DEVICE_X_DATA(d) DEVICE_TYPE_DATA (d, x) - -#define FRAME_X_DISPLAY(f) (DEVICE_X_DISPLAY (XDEVICE (f->device))) -#define DEVICE_X_DISPLAY(d) (DEVICE_X_DATA (d)->display) -#define DEVICE_X_BEING_DELETED(d) (DEVICE_X_DATA (d)->being_deleted) -#define DEVICE_X_VISUAL(d) (DEVICE_X_DATA (d)->visual) -#define DEVICE_X_DEPTH(d) (DEVICE_X_DATA (d)->depth) -#define DEVICE_X_COLORMAP(d) (DEVICE_X_DATA (d)->device_cmap) -#define DEVICE_XT_APP_SHELL(d) (DEVICE_X_DATA (d)->Xt_app_shell) -#define DEVICE_X_GC_CACHE(d) (DEVICE_X_DATA (d)->gc_cache) -#define DEVICE_X_GRAY_PIXMAP(d) (DEVICE_X_DATA (d)->gray_pixmap) -#define DEVICE_X_WM_COMMAND_FRAME(d) (DEVICE_X_DATA (d)->WM_COMMAND_frame) -#define DEVICE_X_MOUSE_TIMESTAMP(d) (DEVICE_X_DATA (d)->mouse_timestamp) -#define DEVICE_X_GLOBAL_MOUSE_TIMESTAMP(d) (DEVICE_X_DATA (d)->global_mouse_timestamp) -#define DEVICE_X_LAST_SERVER_TIMESTAMP(d) (DEVICE_X_DATA (d)->last_server_timestamp) -#define DEVICE_X_KEYSYM_MAP_HASH_TABLE(d) (DEVICE_X_DATA (d)->x_keysym_map_hash_table) -/* #define DEVICE_X_X_COMPOSE_STATUS(d) (DEVICE_X_DATA (d)->x_compose_status) */ -#ifdef HAVE_XIM -#define DEVICE_X_XIM(d) (DEVICE_X_DATA (d)->xim) -#define DEVICE_X_XIM_STYLES(d) (DEVICE_X_DATA (d)->xim_styles) -#define DEVICE_X_FONTSET(d) (DEVICE_X_DATA (d)->fontset) -#endif /* HAVE_XIM */ - -/* allocated in Xatoms_of_device_x */ -#define DEVICE_XATOM_WM_PROTOCOLS(d) (DEVICE_X_DATA (d)->Xatom_WM_PROTOCOLS) -#define DEVICE_XATOM_WM_DELETE_WINDOW(d) (DEVICE_X_DATA (d)->Xatom_WM_DELETE_WINDOW) -#define DEVICE_XATOM_WM_SAVE_YOURSELF(d) (DEVICE_X_DATA (d)->Xatom_WM_SAVE_YOURSELF) -#define DEVICE_XATOM_WM_TAKE_FOCUS(d) (DEVICE_X_DATA (d)->Xatom_WM_TAKE_FOCUS) -#define DEVICE_XATOM_WM_STATE(d) (DEVICE_X_DATA (d)->Xatom_WM_STATE) - -/* allocated in Xatoms_of_select_x */ -#define DEVICE_XATOM_CLIPBOARD(d) (DEVICE_X_DATA (d)->Xatom_CLIPBOARD) -#define DEVICE_XATOM_TIMESTAMP(d) (DEVICE_X_DATA (d)->Xatom_TIMESTAMP) -#define DEVICE_XATOM_TEXT(d) (DEVICE_X_DATA (d)->Xatom_TEXT) -#define DEVICE_XATOM_DELETE(d) (DEVICE_X_DATA (d)->Xatom_DELETE) -#define DEVICE_XATOM_MULTIPLE(d) (DEVICE_X_DATA (d)->Xatom_MULTIPLE) -#define DEVICE_XATOM_INCR(d) (DEVICE_X_DATA (d)->Xatom_INCR) -#define DEVICE_XATOM_EMACS_TMP(d) (DEVICE_X_DATA (d)->Xatom_EMACS_TMP) -#define DEVICE_XATOM_TARGETS(d) (DEVICE_X_DATA (d)->Xatom_TARGETS) -#define DEVICE_XATOM_NULL(d) (DEVICE_X_DATA (d)->Xatom_NULL) -#define DEVICE_XATOM_ATOM_PAIR(d) (DEVICE_X_DATA (d)->Xatom_ATOM_PAIR) -#define DEVICE_XATOM_COMPOUND_TEXT(d) (DEVICE_X_DATA (d)->Xatom_COMPOUND_TEXT) - -/* allocated in Xatoms_of_objects_x */ -#define DEVICE_XATOM_FOUNDRY(d) (DEVICE_X_DATA (d)->Xatom_FOUNDRY) -#define DEVICE_XATOM_FAMILY_NAME(d) (DEVICE_X_DATA (d)->Xatom_FAMILY_NAME) -#define DEVICE_XATOM_WEIGHT_NAME(d) (DEVICE_X_DATA (d)->Xatom_WEIGHT_NAME) -#define DEVICE_XATOM_SLANT(d) (DEVICE_X_DATA (d)->Xatom_SLANT) -#define DEVICE_XATOM_SETWIDTH_NAME(d) (DEVICE_X_DATA (d)->Xatom_SETWIDTH_NAME) -#define DEVICE_XATOM_ADD_STYLE_NAME(d) (DEVICE_X_DATA (d)->Xatom_ADD_STYLE_NAME) -#define DEVICE_XATOM_PIXEL_SIZE(d) (DEVICE_X_DATA (d)->Xatom_PIXEL_SIZE) -#define DEVICE_XATOM_POINT_SIZE(d) (DEVICE_X_DATA (d)->Xatom_POINT_SIZE) -#define DEVICE_XATOM_RESOLUTION_X(d) (DEVICE_X_DATA (d)->Xatom_RESOLUTION_X) -#define DEVICE_XATOM_RESOLUTION_Y(d) (DEVICE_X_DATA (d)->Xatom_RESOLUTION_Y) -#define DEVICE_XATOM_SPACING(d) (DEVICE_X_DATA (d)->Xatom_SPACING) -#define DEVICE_XATOM_AVERAGE_WIDTH(d) (DEVICE_X_DATA (d)->Xatom_AVERAGE_WIDTH) -#define DEVICE_XATOM_CHARSET_REGISTRY(d) (DEVICE_X_DATA (d)->Xatom_CHARSET_REGISTRY) -#define DEVICE_XATOM_CHARSET_ENCODING(d) (DEVICE_X_DATA (d)->Xatom_CHARSET_ENCODING) - #define Xt_SET_VALUE(widget, resource, value) do { \ Arg al; \ XtSetArg (al, resource, value); \ @@ -245,122 +65,6 @@ XtGetValues (widget, &al, 1); \ } while (0) -/* The maximum number of widgets that can be displayed above the text - area at one time. Currently no more than 3 will ever actually be - displayed (menubar, psheet, debugger panel). */ -#define MAX_CONCURRENT_TOP_WIDGETS 8 - -struct x_frame -{ - /* The widget of this frame. This is an EmacsShell or an - ExternalShell. */ - Widget widget; - - /* The parent of the EmacsFrame, the menubar, and the scrollbars. - This is an EmacsManager. */ - Widget container; - - /* The widget of the menubar, of whatever widget class it happens to be. */ - Widget menubar_widget; - - /* The widget of the edit portion of this frame; this is an EmacsFrame, - and the window of this widget is what the redisplay code draws on. */ - Widget edit_widget; - - /* Lists the widgets above the text area, in the proper order. - Used by the EmacsManager. */ - Widget top_widgets[MAX_CONCURRENT_TOP_WIDGETS]; - int num_top_widgets; - - /*************************** Miscellaneous **************************/ - - /* The icon pixmaps; these are Lisp_Image_Instance objects, or Qnil. */ - Lisp_Object icon_pixmap; - Lisp_Object icon_pixmap_mask; - -#ifdef HAVE_TOOLBARS - int old_toolbar_size[4]; - - /* We don't provide a mechanism for changing these after they are - initialized so we might as well keep pointers to them and avoid - lots of expensive calls to gc_cache_lookup. */ - GC toolbar_top_shadow_gc; - GC toolbar_bottom_shadow_gc; - GC toolbar_blank_background_gc; - GC toolbar_pixmap_background_gc; -#endif /* HAVE_TOOLBARS */ - - /* geometry string that ought to be freed. */ - char *geom_free_me_please; - -#ifdef HAVE_XIM - XPoint xic_spot; /* Spot Location cache */ -#ifdef XIM_XLIB - XIC xic; - /* Could get these at any time by asking xic, but... */ - XIMStyle xic_style; /* XIM Style cache */ -#endif /* XIM_XLIB */ -#endif /* HAVE_XIM */ - - /* 1 if the frame is completely visible on the display, 0 otherwise. - if 0 the frame may have been iconified or may be totally - or partially hidden by another X window */ - unsigned int totally_visible_p :1; - - /* NB: Both of the following flags are derivable from the 'shell' - field above, but it's easier if we also have them separately here. */ - - /* Are we a top-level frame? This means that our shell is a - TopLevelShell, and we should do certain things to interact with - the window manager. */ - unsigned int top_level_frame_p :1; - -#ifdef EXTERNAL_WIDGET - /* Are we using somebody else's window for our shell window? This - means that our shell is an ExternalShell. If this flag is set, then - `top_level_frame_p' will never be set. */ - unsigned int external_window_p :1; -#endif /* EXTERNAL_WIDGET */ -}; - -#define FRAME_X_DATA(f) FRAME_TYPE_DATA (f, x) - -#define FRAME_X_SHELL_WIDGET(f) (FRAME_X_DATA (f)->widget) -#define FRAME_X_CONTAINER_WIDGET(f) (FRAME_X_DATA (f)->container) -#define FRAME_X_MENUBAR_WIDGET(f) (FRAME_X_DATA (f)->menubar_widget) -#define FRAME_X_TEXT_WIDGET(f) (FRAME_X_DATA (f)->edit_widget) -#define FRAME_X_TOP_WIDGETS(f) (FRAME_X_DATA (f)->top_widgets) -#define FRAME_X_NUM_TOP_WIDGETS(f) (FRAME_X_DATA (f)->num_top_widgets) - -#define FRAME_X_ICON_PIXMAP(f) (FRAME_X_DATA (f)->icon_pixmap) -#define FRAME_X_ICON_PIXMAP_MASK(f) (FRAME_X_DATA (f)->icon_pixmap_mask) - -#ifdef HAVE_TOOLBARS -#define FRAME_X_OLD_TOOLBAR_SIZE(f, pos) (FRAME_X_DATA (f)->old_toolbar_size[pos]) - -#define FRAME_X_TOOLBAR_TOP_SHADOW_GC(f) (FRAME_X_DATA (f)->toolbar_top_shadow_gc) -#define FRAME_X_TOOLBAR_BOTTOM_SHADOW_GC(f) (FRAME_X_DATA (f)->toolbar_bottom_shadow_gc) -#define FRAME_X_TOOLBAR_BLANK_BACKGROUND_GC(f) (FRAME_X_DATA (f)->toolbar_blank_background_gc) -#define FRAME_X_TOOLBAR_PIXMAP_BACKGROUND_GC(f) (FRAME_X_DATA (f)->toolbar_pixmap_background_gc) -#endif /* HAVE_TOOLBARS */ - -#define FRAME_X_GEOM_FREE_ME_PLEASE(f) (FRAME_X_DATA (f)->geom_free_me_please) - -#define FRAME_X_TOTALLY_VISIBLE_P(f) (FRAME_X_DATA (f)->totally_visible_p) -#define FRAME_X_TOP_LEVEL_FRAME_P(f) (FRAME_X_DATA (f)->top_level_frame_p) - -#ifdef EXTERNAL_WIDGET -#define FRAME_X_EXTERNAL_WINDOW_P(f) (FRAME_X_DATA (f)->external_window_p) -#endif - -#ifdef HAVE_XIM -#define FRAME_X_XIC_SPOT(f) (FRAME_X_DATA (f)->xic_spot) -#ifdef XIM_XLIB -#define FRAME_X_XIC(f) (FRAME_X_DATA (f)->xic) -#define FRAME_X_XIC_STYLE(f) (FRAME_X_DATA (f)->xic_style) -#endif /* XIM_XLIB */ -#endif /* HAVE_XIM */ - /* Variables associated with the X display frame this emacs is using. */ extern XtAppContext Xt_app_con; @@ -368,9 +72,6 @@ extern Lisp_Object Vx_scrollbar_pointer_shape; extern Lisp_Object Qx_error; -extern struct console_type *x_console_type; -extern Lisp_Object Vdefault_x_device; - /* Number of pixels below each line. */ extern int x_interline_space; /* #### implement me */
--- a/src/console.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/console.c Thu Jun 20 21:19:10 2002 +0000 @@ -30,14 +30,17 @@ #include "lisp.h" #include "buffer.h" -#include "device.h" +#include "console-impl.h" +#include "device-impl.h" #include "events.h" -#include "frame.h" +#include "frame-impl.h" #include "redisplay.h" #include "sysdep.h" #include "window.h" -#include "console-tty.h" +#ifdef HAVE_TTY +#include "console-tty-impl.h" +#endif Lisp_Object Vconsole_list, Vselected_console; @@ -220,6 +223,18 @@ return CDFW_CONSOLE (object); } +int +console_live_p (struct console *c) +{ + return CONSOLE_LIVE_P (c); +} + +Lisp_Object +console_device_list (struct console *c) +{ + return CONSOLE_DEVICE_LIST (c); +} + DEFUN ("selected-console", Fselected_console, 0, 0, 0, /* Return the console which is currently active.
--- a/src/console.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/console.h Thu Jun 20 21:19:10 2002 +0000 @@ -1,5 +1,5 @@ /* Define console object for XEmacs. - Copyright (C) 1996 Ben Wing + Copyright (C) 1996, 2002 Ben Wing This file is part of XEmacs. @@ -60,416 +60,7 @@ DM_show_sounds, DM_slow_device, DM_security }; -extern const struct struct_description cted_description; -extern const struct struct_description console_methods_description; - - -/* - * Constants returned by device_implementation_flags_method - */ - -/* Set when device uses pixel-based geometry */ -#define XDEVIMPF_PIXEL_GEOMETRY 0x00000001L - -/* Indicates that the device is a printer */ -#define XDEVIMPF_IS_A_PRINTER 0x00000002L - -/* Do not automatically redisplay this device */ -#define XDEVIMPF_NO_AUTO_REDISPLAY 0x00000004L - -/* Do not delete the device when last frame's gone */ -#define XDEVIMPF_FRAMELESS_OK 0x00000008L - -/* Do not preempt resiaply of frame or device once it starts */ -#define XDEVIMPF_DONT_PREEMPT_REDISPLAY 0x00000010L - -struct console_methods -{ - const char *name; /* Used by print_console, print_device, print_frame */ - Lisp_Object symbol; - Lisp_Object predicate_symbol; - unsigned int flags; /* Read-only implementation flags, set once upon - console type creation. INITIALIZE_CONSOLE_TYPE sets - this member to 0. */ - - /* console methods */ - void (*init_console_method) (struct console *, Lisp_Object props); - void (*mark_console_method) (struct console *); - int (*initially_selected_for_input_method) (struct console *); - void (*delete_console_method) (struct console *); - Lisp_Object (*semi_canonicalize_console_connection_method) - (Lisp_Object connection, Error_Behavior errb); - Lisp_Object (*semi_canonicalize_device_connection_method) - (Lisp_Object connection, Error_Behavior errb); - Lisp_Object (*canonicalize_console_connection_method) - (Lisp_Object connection, Error_Behavior errb); - Lisp_Object (*canonicalize_device_connection_method) - (Lisp_Object connection, Error_Behavior errb); - Lisp_Object (*device_to_console_connection_method) - (Lisp_Object connection, Error_Behavior errb); - - /* device methods */ - void (*init_device_method) (struct device *, Lisp_Object props); - void (*finish_init_device_method) (struct device *, Lisp_Object props); - void (*delete_device_method) (struct device *); - void (*mark_device_method) (struct device *); - void (*asynch_device_change_method) (void); - Lisp_Object (*device_system_metrics_method) (struct device *, - enum device_metrics); - Lisp_Object (*own_selection_method)(Lisp_Object selection_name, - Lisp_Object selection_value, - Lisp_Object how_to_add, - Lisp_Object selection_type, - int owned_p); - void (*disown_selection_method)(Lisp_Object selection_name, - Lisp_Object timeval); - Lisp_Object (*get_foreign_selection_method) (Lisp_Object selection_symbol, - Lisp_Object target_type); - Lisp_Object (*selection_exists_p_method)(Lisp_Object selection_name, - Lisp_Object selection_type); - Lisp_Object (*available_selection_types_method)(Lisp_Object selection_name); - Lisp_Object (*register_selection_data_type_method)(Lisp_Object type_name); - Lisp_Object (*selection_data_type_name_method)(Lisp_Object type); - - /* frame methods */ - Lisp_Object *device_specific_frame_props; - void (*init_frame_1_method) (struct frame *, Lisp_Object properties, - int frame_name_is_defaulted); - void (*init_frame_2_method) (struct frame *, Lisp_Object properties); - void (*init_frame_3_method) (struct frame *); - void (*after_init_frame_method) (struct frame *, int first_on_device, - int first_on_console); - void (*mark_frame_method) (struct frame *); - void (*delete_frame_method) (struct frame *); - void (*focus_on_frame_method) (struct frame *); - void (*raise_frame_method) (struct frame *); - void (*lower_frame_method) (struct frame *); - void (*enable_frame_method) (struct frame *); - void (*disable_frame_method) (struct frame *); - int (*get_mouse_position_method) (struct device *d, Lisp_Object *frame, - int *x, int *y); - void (*set_mouse_position_method) (struct window *w, int x, int y); - void (*make_frame_visible_method) (struct frame *f); - void (*make_frame_invisible_method) (struct frame *f); - void (*iconify_frame_method) (struct frame *f); - Lisp_Object (*frame_property_method) (struct frame *f, Lisp_Object prop); - int (*internal_frame_property_p_method) (struct frame *f, - Lisp_Object prop); - Lisp_Object (*frame_properties_method) (struct frame *f); - void (*set_frame_properties_method) (struct frame *f, Lisp_Object plist); - void (*set_frame_size_method) (struct frame *f, int width, int height); - void (*set_frame_position_method) (struct frame *f, int xoff, int yoff); - int (*frame_visible_p_method) (struct frame *f); - int (*frame_totally_visible_p_method) (struct frame *f); - int (*frame_iconified_p_method) (struct frame *f); - void (*set_title_from_ibyte_method) (struct frame *f, Ibyte *title); - void (*set_icon_name_from_ibyte_method) (struct frame *f, Ibyte *title); - void (*set_frame_pointer_method) (struct frame *f); - void (*set_frame_icon_method) (struct frame *f); - void (*popup_menu_method) (Lisp_Object menu, Lisp_Object event); - Lisp_Object (*get_frame_parent_method) (struct frame *f); - void (*update_frame_external_traits_method) (struct frame *f, Lisp_Object name); - int (*frame_size_fixed_p_method) (struct frame *f); - void (*eject_page_method) (struct frame *f); - - /* redisplay methods */ - int (*left_margin_width_method) (struct window *); - int (*right_margin_width_method) (struct window *); - int (*text_width_method) (struct frame *f, struct face_cachel *cachel, - const Ichar *str, Charcount len); - void (*output_display_block_method) (struct window *, struct display_line *, - int, int, int, int, int, int, int); - int (*divider_height_method) (void); - int (*eol_cursor_width_method) (void); - void (*output_vertical_divider_method) (struct window *, int); - void (*clear_to_window_end_method) (struct window *, int, int); - void (*clear_region_method) (Lisp_Object, struct device*, struct frame*, face_index, - int, int, int, int, - Lisp_Object, Lisp_Object, Lisp_Object); - void (*clear_frame_method) (struct frame *); - void (*window_output_begin_method) (struct window *); - void (*frame_output_begin_method) (struct frame *); - void (*window_output_end_method) (struct window *); - void (*frame_output_end_method) (struct frame *); - int (*flash_method) (struct device *); - void (*ring_bell_method) (struct device *, int volume, int pitch, - int duration); - void (*frame_redraw_cursor_method) (struct frame *f); - void (*set_final_cursor_coords_method) (struct frame *, int, int); - void (*bevel_area_method) (struct window *, face_index, int, int, int, int, int, - int, enum edge_style); - void (*output_pixmap_method) (struct window *w, Lisp_Object image_instance, - struct display_box *db, struct display_glyph_area *dga, - face_index findex, int cursor_start, int cursor_width, - int cursor_height, int offset_bitmap); - void (*output_string_method) (struct window *w, struct display_line *dl, - Ichar_dynarr *buf, int xpos, int xoffset, - int start_pixpos, int width, face_index findex, - int cursor, int cursor_start, int cursor_width, - int cursor_height); - - /* color methods */ - int (*initialize_color_instance_method) (Lisp_Color_Instance *, - Lisp_Object name, - Lisp_Object device, - Error_Behavior errb); - void (*mark_color_instance_method) (Lisp_Color_Instance *); - void (*print_color_instance_method) (Lisp_Color_Instance *, - Lisp_Object printcharfun, - int escapeflag); - void (*finalize_color_instance_method) (Lisp_Color_Instance *); - int (*color_instance_equal_method) (Lisp_Color_Instance *, - Lisp_Color_Instance *, - int depth); - Hashcode (*color_instance_hash_method) (Lisp_Color_Instance *, - int depth); - Lisp_Object (*color_instance_rgb_components_method) (Lisp_Color_Instance *); - int (*valid_color_name_p_method) (struct device *, Lisp_Object color); - - /* font methods */ - int (*initialize_font_instance_method) (Lisp_Font_Instance *, - Lisp_Object name, - Lisp_Object device, - Error_Behavior errb); - void (*mark_font_instance_method) (Lisp_Font_Instance *); - void (*print_font_instance_method) (Lisp_Font_Instance *, - Lisp_Object printcharfun, - int escapeflag); - void (*finalize_font_instance_method) (Lisp_Font_Instance *); - Lisp_Object (*font_instance_truename_method) (Lisp_Font_Instance *, - Error_Behavior errb); - Lisp_Object (*font_instance_properties_method) (Lisp_Font_Instance *); - Lisp_Object (*list_fonts_method) (Lisp_Object pattern, - Lisp_Object device); - Lisp_Object (*find_charset_font_method) (Lisp_Object device, - Lisp_Object font, - Lisp_Object charset); - int (*font_spec_matches_charset_method) (struct device *d, - Lisp_Object charset, - const Ibyte *nonreloc, - Lisp_Object reloc, - Bytecount offset, - Bytecount length); - - /* image methods */ - void (*mark_image_instance_method) (Lisp_Image_Instance *); - void (*print_image_instance_method) (Lisp_Image_Instance *, - Lisp_Object printcharfun, - int escapeflag); - void (*finalize_image_instance_method) (Lisp_Image_Instance *); - void (*unmap_subwindow_method) (Lisp_Image_Instance *); - void (*map_subwindow_method) (Lisp_Image_Instance *, int x, int y, - struct display_glyph_area* dga); - void (*resize_subwindow_method) (Lisp_Image_Instance *, int w, int h); - void (*redisplay_subwindow_method) (Lisp_Image_Instance *); - void (*redisplay_widget_method) (Lisp_Image_Instance *); - /* Maybe this should be a specifier. Unfortunately specifiers don't - allow us to represent things at the toolkit level, which is what - is required here. */ - int (*widget_border_width_method) (void); - int (*widget_spacing_method) (Lisp_Image_Instance *); - int (*image_instance_equal_method) (Lisp_Image_Instance *, - Lisp_Image_Instance *, - int depth); - Hashcode (*image_instance_hash_method) (Lisp_Image_Instance *, - int depth); - void (*init_image_instance_from_eimage_method) (Lisp_Image_Instance *ii, - int width, int height, - int slices, - unsigned char *eimage, - int dest_mask, - Lisp_Object instantiator, - Lisp_Object domain); - Lisp_Object (*locate_pixmap_file_method) (Lisp_Object file_method); - int (*colorize_image_instance_method) (Lisp_Object image_instance, - Lisp_Object fg, Lisp_Object bg); - void (*widget_query_string_geometry_method) (Lisp_Object string, - Lisp_Object face, - int* width, int* height, - Lisp_Object domain); - Lisp_Object image_conversion_list; - -#ifdef HAVE_TOOLBARS - /* toolbar methods */ - void (*output_frame_toolbars_method) (struct frame *); - void (*initialize_frame_toolbars_method) (struct frame *); - void (*free_frame_toolbars_method) (struct frame *); - void (*output_toolbar_button_method) (struct frame *, Lisp_Object); - void (*redraw_frame_toolbars_method) (struct frame *); - void (*redraw_exposed_toolbars_method) (struct frame *f, int x, int y, - int width, int height); -#endif - -#ifdef HAVE_SCROLLBARS - /* scrollbar methods */ - int (*inhibit_scrollbar_slider_size_change_method) (void); - void (*free_scrollbar_instance_method) (struct scrollbar_instance *); - void (*release_scrollbar_instance_method) (struct scrollbar_instance *); - void (*create_scrollbar_instance_method) (struct frame *, int, - struct scrollbar_instance *); - void (*update_scrollbar_instance_values_method) (struct window *, - struct scrollbar_instance *, - int, int, int, int, int, - int, int, int, int, int); - void (*update_scrollbar_instance_status_method) (struct window *, int, int, - struct - scrollbar_instance *); - void (*scrollbar_pointer_changed_in_window_method) (struct window *w); -#ifdef MEMORY_USAGE_STATS - int (*compute_scrollbar_instance_usage_method) (struct device *, - struct scrollbar_instance *, - struct overhead_stats *); -#endif -#endif /* HAVE_SCROLLBARS */ - -#ifdef HAVE_MENUBARS - /* menubar methods */ - void (*update_frame_menubars_method) (struct frame *); - void (*free_frame_menubars_method) (struct frame *); -#endif - -#ifdef HAVE_DIALOGS - /* dialog methods */ - Lisp_Object (*make_dialog_box_internal_method) (struct frame *, - Lisp_Object type, - Lisp_Object keys); -#endif -}; - -#define CONMETH_TYPE(meths) ((meths)->symbol) -#define CONMETH_IMPL_FLAG(meths, f) ((meths)->flags & (f)) - -#define CONSOLE_TYPE_NAME(c) ((c)->conmeths->name) -#define CONSOLE_TYPE(c) ((c)->conmeths->symbol) -#define CONSOLE_IMPL_FLAG(c, f) CONMETH_IMPL_FLAG ((c)->conmeths, (f)) - -/******** Accessing / calling a console method *********/ - -#define HAS_CONTYPE_METH_P(meth, m) ((meth)->m##_method) -#define CONTYPE_METH(meth, m, args) (((meth)->m##_method) args) - -/* Call a void-returning console method, if it exists */ -#define MAYBE_CONTYPE_METH(meth, m, args) do { \ - struct console_methods *maybe_contype_meth_meth = (meth); \ - if (HAS_CONTYPE_METH_P (maybe_contype_meth_meth, m)) \ - CONTYPE_METH (maybe_contype_meth_meth, m, args); \ -} while (0) - -/* Call a console method, if it exists; otherwise return - the specified value - meth is multiply evaluated. */ -#define CONTYPE_METH_OR_GIVEN(meth, m, args, given) \ - (HAS_CONTYPE_METH_P (meth, m) ? \ - CONTYPE_METH (meth, m, args) : (given)) - -/* Call an int-returning console method, if it exists; otherwise - return 0 */ -#define MAYBE_INT_CONTYPE_METH(meth, m, args) \ - CONTYPE_METH_OR_GIVEN (meth, m, args, 0) - -/* Call an Lisp-Object-returning console method, if it exists; - otherwise return Qnil */ -#define MAYBE_LISP_CONTYPE_METH(meth, m, args) \ - CONTYPE_METH_OR_GIVEN (meth, m, args, Qnil) - -/******** Same functions, operating on a console instead of a - struct console_methods ********/ - -#define HAS_CONMETH_P(c, m) HAS_CONTYPE_METH_P ((c)->conmeths, m) -#define CONMETH(c, m, args) CONTYPE_METH ((c)->conmeths, m, args) -#define MAYBE_CONMETH(c, m, args) MAYBE_CONTYPE_METH ((c)->conmeths, m, args) -#define CONMETH_OR_GIVEN(c, m, args, given) \ - CONTYPE_METH_OR_GIVEN((c)->conmeths, m, args, given) -#define MAYBE_INT_CONMETH(c, m, args) \ - MAYBE_INT_CONTYPE_METH ((c)->conmeths, m, args) -#define MAYBE_LISP_CONMETH(c, m, args) \ - MAYBE_LISP_CONTYPE_METH ((c)->conmeths, m, args) - -/******** Defining new console types ********/ - -typedef struct console_type_entry console_type_entry; -struct console_type_entry -{ - Lisp_Object symbol; - struct console_methods *meths; -}; - -#define DECLARE_CONSOLE_TYPE(type) \ -extern struct console_methods * type##_console_methods - -#define DEFINE_CONSOLE_TYPE(type) \ -struct console_methods * type##_console_methods - -#define INITIALIZE_CONSOLE_TYPE(type, obj_name, pred_sym) do { \ - type##_console_methods = xnew_and_zero (struct console_methods); \ - type##_console_methods->name = obj_name; \ - type##_console_methods->symbol = Q##type; \ - defsymbol_nodump (&type##_console_methods->predicate_symbol, pred_sym); \ - add_entry_to_console_type_list (Q##type, type##_console_methods); \ - type##_console_methods->image_conversion_list = Qnil; \ - staticpro_nodump (&type##_console_methods->image_conversion_list); \ - dump_add_root_struct_ptr (&type##_console_methods, &console_methods_description); \ -} while (0) - -#define REINITIALIZE_CONSOLE_TYPE(type) do { \ - staticpro_nodump (&type##_console_methods->predicate_symbol); \ - staticpro_nodump (&type##_console_methods->image_conversion_list); \ -} while (0) - - -/* Declare that console-type TYPE has method M; used in - initialization routines */ -#define CONSOLE_HAS_METHOD(type, m) \ - (type##_console_methods->m##_method = type##_##m) - -/* Declare that console-type TYPE inherits method M - implementation from console-type FROMTYPE */ -#define CONSOLE_INHERITS_METHOD(type, fromtype, m) \ - (type##_console_methods->m##_method = fromtype##_##m) - -/* Define console type implementation flags */ -#define CONSOLE_IMPLEMENTATION_FLAGS(type, flg) \ - (type##_console_methods->flags = flg) - -struct console -{ - struct lcrecord_header header; - - /* Description of this console's methods. */ - struct console_methods *conmeths; - - /* A structure of auxiliary data specific to the console type. - struct x_console is used for X window frames; defined in console-x.h - struct tty_console is used to TTY's; defined in console-tty.h */ - void *console_data; - - /* Character that causes a quit. Normally C-g. - #### Should be possible for this not to be ASCII. (Currently works - under Windows.) */ - Ichar quit_char; - - /* ----- begin partially-completed console localization of - event loop ---- */ - - int local_var_flags; - -#define MARKED_SLOT(x) Lisp_Object x -#include "conslots.h" - - /* Where to store the next keystroke of the macro. - Index into con->kbd_macro_builder. */ - int kbd_macro_ptr; - - /* The finalized section of the macro starts at kbd_macro_buffer and - ends before this. This is not the same as kbd_macro_pointer, because - we advance this to kbd_macro_pointer when a key's command is complete. - This way, the keystrokes for "end-kbd-macro" are not included in the - macro. */ - int kbd_macro_end; - - /* ----- end partially-completed console localization of event loop ---- */ - - unsigned int input_enabled :1; -}; +struct console; DECLARE_LRECORD (console, struct console); #define XCONSOLE(x) XRECORD (x, console, struct console) @@ -478,6 +69,15 @@ #define CHECK_CONSOLE(x) CHECK_RECORD (x, console) #define CONCHECK_CONSOLE(x) CONCHECK_RECORD (x, console) +/* Basic properties available to non-privileged users; redefined in + console-impl.h */ + +int console_live_p (struct console *c); +Lisp_Object console_device_list (struct console *c); + +#define CONSOLE_LIVE_P(c) console_live_p (c) +#define CONSOLE_DEVICE_LIST(c) console_device_list (c) + #define CHECK_LIVE_CONSOLE(x) do { \ CHECK_CONSOLE (x); \ if (! CONSOLE_LIVE_P (XCONSOLE (x))) \ @@ -489,129 +89,6 @@ x = wrong_type_argument (Qconsole_live_p, (x)); \ } while (0) -#define CONSOLE_TYPE_P(con, type) EQ (CONSOLE_TYPE (con), Q##type) - -#ifdef ERROR_CHECK_TYPES -DECLARE_INLINE_HEADER ( -struct console * -error_check_console_type (struct console *con, Lisp_Object sym) -) -{ - assert (EQ (CONSOLE_TYPE (con), sym)); - return con; -} -# define CONSOLE_TYPE_DATA(con, type) \ - (*(struct type##_console **) \ - &(error_check_console_type (con, Q##type))->console_data) -#else -# define CONSOLE_TYPE_DATA(con, type) \ - (*(struct type##_console **) &((con)->console_data)) -#endif - -#define CHECK_CONSOLE_TYPE(x, type) do { \ - CHECK_CONSOLE (x); \ - if (! CONSOLE_TYPE_P (XCONSOLE (x), type)) \ - dead_wrong_type_argument \ - (type##_console_methods->predicate_symbol, x); \ -} while (0) -#define CONCHECK_CONSOLE_TYPE(x, type) do { \ - CONCHECK_CONSOLE (x); \ - if (!(CONSOLEP (x) && \ - CONSOLE_TYPE_P (XCONSOLE (x), type))) \ - x = wrong_type_argument \ - (type##_console_methods->predicate_symbol, x); \ -} while (0) - -/* #### These should be in the console-*.h files but there are - too many places where the abstraction is broken. Need to - fix. */ - -#ifdef HAVE_GTK -#define CONSOLE_TYPESYM_GTK_P(typesym) EQ (typesym, Qgtk) -#else -#define CONSOLE_TYPESYM_GTK_P(typesym) 0 -#endif - -#ifdef HAVE_X_WINDOWS -#define CONSOLE_TYPESYM_X_P(typesym) EQ (typesym, Qx) -#else -#define CONSOLE_TYPESYM_X_P(typesym) 0 -#endif -#ifdef HAVE_TTY -#define CONSOLE_TYPESYM_TTY_P(typesym) EQ (typesym, Qtty) -#else -#define CONSOLE_TYPESYM_TTY_P(typesym) 0 -#endif -#ifdef HAVE_MS_WINDOWS -#define CONSOLE_TYPESYM_MSWINDOWS_P(typesym) EQ (typesym, Qmswindows) -#else -#define CONSOLE_TYPESYM_MSWINDOWS_P(typesym) 0 -#endif -#define CONSOLE_TYPESYM_STREAM_P(typesym) EQ (typesym, Qstream) - -#define CONSOLE_TYPESYM_WIN_P(typesym) \ - (CONSOLE_TYPESYM_GTK_P (typesym) || CONSOLE_TYPESYM_X_P (typesym) || CONSOLE_TYPESYM_MSWINDOWS_P (typesym)) - -#define CONSOLE_X_P(con) CONSOLE_TYPESYM_X_P (CONSOLE_TYPE (con)) -#define CHECK_X_CONSOLE(z) CHECK_CONSOLE_TYPE (z, x) -#define CONCHECK_X_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, x) - -#define CONSOLE_GTK_P(con) CONSOLE_TYPESYM_GTK_P (CONSOLE_TYPE (con)) -#define CHECK_GTK_CONSOLE(z) CHECK_CONSOLE_TYPE (z, gtk) -#define CONCHECK_GTK_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, gtk) - -#define CONSOLE_TTY_P(con) CONSOLE_TYPESYM_TTY_P (CONSOLE_TYPE (con)) -#define CHECK_TTY_CONSOLE(z) CHECK_CONSOLE_TYPE (z, tty) -#define CONCHECK_TTY_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, tty) - -#define CONSOLE_MSWINDOWS_P(con) CONSOLE_TYPESYM_MSWINDOWS_P (CONSOLE_TYPE (con)) -#define CHECK_MSWINDOWS_CONSOLE(z) CHECK_CONSOLE_TYPE (z, mswindows) -#define CONCHECK_MSWINDOWS_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, mswindows) - -#define CONSOLE_STREAM_P(con) CONSOLE_TYPESYM_STREAM_P (CONSOLE_TYPE (con)) -#define CHECK_STREAM_CONSOLE(z) CHECK_CONSOLE_TYPE (z, stream) -#define CONCHECK_STREAM_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, stream) - -#define CONSOLE_WIN_P(con) CONSOLE_TYPESYM_WIN_P (CONSOLE_TYPE (con)) - -EXFUN (Fconsole_disable_input, 1); -EXFUN (Fdelete_console, 2); -EXFUN (Fselect_console, 1); -EXFUN (Fselected_console, 0); - -extern Lisp_Object Qcreate_console_hook, Qdelete_console_hook; -extern Lisp_Object Vconsole_defaults, Vconsole_type_list, Vselected_console; - -/* This structure marks which slots in a console have corresponding - default values in console_defaults. - Each such slot has a nonzero value in this structure. - The value has only one nonzero bit. - - When a console has its own local value for a slot, - the bit for that slot (found in the same slot in this structure) - is turned on in the console's local_var_flags slot. - - If a slot in this structure is zero, then even though there may - be a DEFVAR_CONSOLE_LOCAL for the slot, there is no default value for it; - and the corresponding slot in console_defaults is not used. */ - -extern struct console console_local_flags; - -int valid_console_type_p (Lisp_Object type); - -#define CONSOLE_LIVE_P(con) (!EQ (CONSOLE_TYPE (con), Qdead)) - -#define CONSOLE_NAME(con) ((con)->name) -#define CONSOLE_CONNECTION(con) ((con)->connection) -#define CONSOLE_CANON_CONNECTION(con) ((con)->canon_connection) -#define CONSOLE_FUNCTION_KEY_MAP(con) ((con)->function_key_map) -#define CONSOLE_DEVICE_LIST(con) ((con)->device_list) -#define CONSOLE_SELECTED_DEVICE(con) ((con)->selected_device) -#define CONSOLE_SELECTED_FRAME(con) \ - DEVICE_SELECTED_FRAME (XDEVICE ((con)->selected_device)) -#define CONSOLE_LAST_NONMINIBUF_FRAME(con) NON_LVALUE ((con)->last_nonminibuf_frame) -#define CONSOLE_QUIT_CHAR(con) ((con)->quit_char) - #define CDFW_CONSOLE(obj) \ (WINDOWP (obj) ? WINDOW_CONSOLE (XWINDOW (obj)) \ : (FRAMEP (obj) ? FRAME_CONSOLE (XFRAME (obj)) \ @@ -623,8 +100,15 @@ #define CONSOLE_DEVICE_LOOP(devcons, con) \ LIST_LOOP (devcons, CONSOLE_DEVICE_LIST (con)) -DECLARE_CONSOLE_TYPE (dead); -extern console_type_entry_dynarr *the_console_type_entry_dynarr; +EXFUN (Fconsole_disable_input, 1); +EXFUN (Fdelete_console, 2); +EXFUN (Fselect_console, 1); +EXFUN (Fselected_console, 0); + +extern Lisp_Object Qcreate_console_hook, Qdelete_console_hook; +extern Lisp_Object Vconsole_defaults, Vconsole_type_list, Vselected_console; + +int valid_console_type_p (Lisp_Object type); Lisp_Object create_console (Lisp_Object name, Lisp_Object type, Lisp_Object connection, Lisp_Object props); @@ -639,5 +123,6 @@ void io_error_delete_console (Lisp_Object console); void set_console_last_nonminibuf_frame (struct console *con, Lisp_Object frame); +void stuff_buffered_input (Lisp_Object); #endif /* INCLUDED_console_h_ */
--- a/src/depend Tue Jun 11 19:28:22 2002 +0000 +++ b/src/depend Thu Jun 20 21:19:10 2002 +0000 @@ -7,61 +7,61 @@ #endif LISP_H=lisp.h config.h general-slots.h lrecord.h symeval.h symsinit.h text.h $(LISP_UNION_H) #if defined(HAVE_MS_WINDOWS) -console-msw.o: $(LISP_H) conslots.h console-msw.h console.h events.h intl-auto-encap-win32.h opaque.h systime.h syswindows.h -device-msw.o: $(LISP_H) charset.h conslots.h console-msw.h console-stream.h console.h device.h devslots.h events.h faces.h frame.h frameslots.h intl-auto-encap-win32.h objects-msw.h objects.h redisplay.h specifier.h sysdep.h systime.h syswindows.h -dialog-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-msw.h console.h frame.h frameslots.h gui.h intl-auto-encap-win32.h opaque.h redisplay.h sysfile.h syswindows.h -dired-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h intl-auto-encap-win32.h ndir.h regex.h syntax.h sysdir.h sysfile.h sysfloat.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h -event-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-msw.h console-tty.h console.h device.h devslots.h dragdrop.h events.h faces.h frame.h frameslots.h glyphs.h gui.h intl-auto-encap-win32.h lstream.h menubar-msw.h menubar.h objects-msw.h objects.h process.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h window.h winslots.h -frame-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-msw.h console.h device.h devslots.h elhash.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h intl-auto-encap-win32.h redisplay.h scrollbar.h specifier.h systime.h syswindows.h window.h winslots.h -glyphs-msw.o: $(LISP_H) charset.h conslots.h console-msw.h console.h device.h devslots.h elhash.h faces.h file-coding.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h imgproc.h insdel.h intl-auto-encap-win32.h lstream.h objects-msw.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syswindows.h window.h winslots.h -gui-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-msw.h console.h elhash.h events.h frame.h frameslots.h glyphs.h gui.h intl-auto-encap-win32.h redisplay.h scrollbar.h specifier.h systime.h syswindows.h window.h winslots.h -menubar-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-msw.h console.h elhash.h events.h frame.h frameslots.h gui.h intl-auto-encap-win32.h menubar-msw.h menubar.h opaque.h redisplay.h scrollbar.h systime.h syswindows.h window.h winslots.h -objects-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-msw.h console.h device.h devslots.h elhash.h insdel.h intl-auto-encap-win32.h objects-msw.h objects.h opaque.h specifier.h syswindows.h -redisplay-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-msw.h console.h debug.h device.h devslots.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gutter.h intl-auto-encap-win32.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h systime.h syswindows.h window.h winslots.h -scrollbar-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h devslots.h elhash.h events.h frame.h frameslots.h intl-auto-encap-win32.h opaque.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h systime.h syswindows.h window.h winslots.h -select-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-msw.h console.h file-coding.h frame.h frameslots.h intl-auto-encap-win32.h opaque.h redisplay.h select.h syswindows.h -toolbar-msw.o: $(LISP_H) charset.h conslots.h console-msw.h console.h device.h devslots.h elhash.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h intl-auto-encap-win32.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syswindows.h toolbar.h window.h winslots.h +console-msw.o: $(LISP_H) conslots.h console-impl.h console-msw-impl.h console-msw.h console.h events.h intl-auto-encap-win32.h opaque.h systime.h syswindows.h +device-msw.o: $(LISP_H) charset.h conslots.h console-impl.h console-msw-impl.h console-msw.h console-stream.h console.h device-impl.h device.h devslots.h events.h faces.h frame.h intl-auto-encap-win32.h objects-msw.h objects.h redisplay.h sysdep.h systime.h syswindows.h +dialog-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h frame-impl.h frame.h frameslots.h gui.h intl-auto-encap-win32.h opaque.h redisplay.h sysfile.h syswindows.h +dired-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console-msw.h console.h intl-auto-encap-win32.h ndir.h regex.h syntax.h sysdir.h sysfile.h sysfloat.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h +event-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console-tty.h console.h device-impl.h device.h devslots.h dragdrop.h events.h faces.h frame-impl.h frame.h frameslots.h glyphs.h gui.h intl-auto-encap-win32.h lstream.h menubar-msw.h menubar.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h process.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h window-impl.h window.h winslots.h +frame-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device-impl.h device.h devslots.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h glyphs-msw.h glyphs.h intl-auto-encap-win32.h redisplay.h scrollbar.h specifier.h systime.h syswindows.h window-impl.h window.h winslots.h +glyphs-msw.o: $(LISP_H) charset.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device-impl.h device.h devslots.h elhash.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h imgproc.h insdel.h intl-auto-encap-win32.h lstream.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syswindows.h window-impl.h window.h winslots.h +gui-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h elhash.h events.h frame-impl.h frame.h frameslots.h glyphs.h gui.h intl-auto-encap-win32.h redisplay.h scrollbar.h specifier.h systime.h syswindows.h window-impl.h window.h winslots.h +menubar-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h elhash.h events.h frame-impl.h frame.h frameslots.h gui.h intl-auto-encap-win32.h menubar-msw.h menubar.h opaque.h redisplay.h scrollbar.h systime.h syswindows.h window-impl.h window.h winslots.h +objects-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device-impl.h device.h devslots.h elhash.h insdel.h intl-auto-encap-win32.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h opaque.h specifier.h syswindows.h +redisplay-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h debug.h device-impl.h device.h devslots.h events.h faces.h frame-impl.h frame.h frameslots.h glyphs-msw.h glyphs.h gutter.h intl-auto-encap-win32.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h systime.h syswindows.h window-impl.h window.h winslots.h +scrollbar-msw.o: $(LISP_H) conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device.h elhash.h events.h frame-impl.h frame.h frameslots.h intl-auto-encap-win32.h opaque.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h systime.h syswindows.h window-impl.h window.h winslots.h +select-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h file-coding.h frame-impl.h frame.h frameslots.h intl-auto-encap-win32.h opaque.h redisplay.h select.h syswindows.h +toolbar-msw.o: $(LISP_H) charset.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device.h elhash.h faces.h frame-impl.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h intl-auto-encap-win32.h redisplay.h scrollbar.h specifier.h syswindows.h toolbar.h window-impl.h window.h winslots.h #endif #if defined(HAVE_X_WINDOWS) -balloon-x.o: $(LISP_H) balloon_help.h conslots.h console-x.h console.h device.h devslots.h xintrinsic.h -console-x.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-x.h console.h process.h redisplay.h xintrinsic.h -device-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-x.h console.h device.h devslots.h elhash.h events.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h sysfile.h systime.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmu.h -dialog-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-x.h console.h events.h frame.h frameslots.h gui-x.h gui.h opaque.h redisplay.h scrollbar.h systime.h window.h winslots.h xintrinsic.h -frame-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-x.h console.h device.h devslots.h dragdrop.h events.h extents.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gutter.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar-x.h scrollbar.h specifier.h systime.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h -glyphs-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-x.h console.h device.h devslots.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h imgproc.h insdel.h lstream.h objects-x.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysfile.h sysproc.h syssignal.h systime.h window.h winslots.h xintrinsic.h xmu.h -gui-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-x.h console.h device.h devslots.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h opaque.h redisplay.h scrollbar.h specifier.h systime.h window.h winslots.h xintrinsic.h -intl-x.o: $(LISP_H) conslots.h console-x.h console.h xintrinsic.h -menubar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-x.h console.h device.h devslots.h events.h frame.h frameslots.h gui-x.h gui.h keymap.h menubar.h opaque.h redisplay.h scrollbar.h systime.h window.h winslots.h xintrinsic.h -objects-x.o: $(LISP_H) charset.h conslots.h console-x.h console.h device.h devslots.h insdel.h objects-x.h objects.h specifier.h xintrinsic.h -redisplay-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-x.h console.h debug.h device.h devslots.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gutter.h mule-ccl.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysproc.h syssignal.h systime.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmprimitivep.h -scrollbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h conslots.h console-x.h console.h device.h devslots.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h redisplay.h scrollbar-x.h scrollbar.h specifier.h window.h winslots.h xintrinsic.h -select-x.o: $(LISP_H) charset.h conslots.h console-x.h console.h device.h devslots.h frame.h frameslots.h objects-x.h objects.h opaque.h redisplay.h select-common.h select.h specifier.h systime.h xintrinsic.h -toolbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h charset.h conslots.h console-x.h console.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar-common.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h +balloon-x.o: $(LISP_H) balloon_help.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h xintrinsic.h +console-x.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h process.h redisplay.h xintrinsic.h +device-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h sysfile.h systime.h window-impl.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmu.h +dialog-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-x-impl.h console-x.h console.h events.h frame-impl.h frame.h frameslots.h gui-x.h gui.h opaque.h redisplay.h scrollbar.h systime.h window.h xintrinsic.h +frame-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dragdrop.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gutter.h objects-impl.h objects-x-impl.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar-x.h scrollbar.h specifier.h systime.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h +glyphs-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h imgproc.h insdel.h lstream.h objects-impl.h objects-x-impl.h objects-x.h objects.h opaque.h process.h redisplay.h scrollbar.h specifier.h sysfile.h sysproc.h syssignal.h systime.h window-impl.h window.h winslots.h xintrinsic.h xmu.h +gui-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h events.h frame.h glyphs.h gui-x.h gui.h menubar.h opaque.h redisplay.h scrollbar.h specifier.h systime.h window-impl.h window.h winslots.h xintrinsic.h +intl-x.o: $(LISP_H) console-x.h console.h xintrinsic.h +menubar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h gui-x.h gui.h keymap.h menubar.h opaque.h redisplay.h scrollbar.h systime.h window-impl.h window.h winslots.h xintrinsic.h +objects-x.o: $(LISP_H) charset.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h insdel.h objects-impl.h objects-x-impl.h objects-x.h objects.h specifier.h xintrinsic.h +redisplay-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h debug.h device-impl.h device.h devslots.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gutter.h mule-ccl.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysproc.h syssignal.h systime.h window-impl.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmprimitivep.h +scrollbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h redisplay.h scrollbar-x.h scrollbar.h specifier.h window-impl.h window.h winslots.h xintrinsic.h +select-x.o: $(LISP_H) charset.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h frame-impl.h frame.h frameslots.h objects-x.h objects.h opaque.h redisplay.h select-common.h select.h systime.h xintrinsic.h +toolbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h charset.h conslots.h console-impl.h console-x-impl.h console-x.h console.h faces.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar-common.h toolbar.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h #endif #if defined(HAVE_TTY) -console-tty.o: $(LISP_H) charset.h conslots.h console-stream.h console-tty.h console.h faces.h file-coding.h frame.h frameslots.h glyphs.h lstream.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systty.h window.h winslots.h -device-tty.o: $(LISP_H) charset.h conslots.h console-stream.h console-tty.h console.h device.h devslots.h events.h faces.h frame.h frameslots.h lstream.h redisplay.h sysdep.h sysfile.h syssignal.h systime.h systty.h -event-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h devslots.h events.h frame.h frameslots.h process.h redisplay.h sysproc.h syssignal.h systime.h systty.h syswait.h -frame-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h devslots.h events.h frame.h frameslots.h redisplay.h systime.h systty.h -objects-tty.o: $(LISP_H) charset.h conslots.h console-tty.h console.h device.h devslots.h insdel.h objects-tty.h objects.h specifier.h systty.h -redisplay-tty.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-tty.h console.h device.h devslots.h events.h faces.h frame.h frameslots.h glyphs.h lstream.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h systime.h systty.h window.h winslots.h +console-tty.o: $(LISP_H) charset.h conslots.h console-impl.h console-stream.h console-tty-impl.h console-tty.h console.h faces.h file-coding.h frame.h glyphs.h lstream.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systty.h window-impl.h window.h winslots.h +device-tty.o: $(LISP_H) charset.h conslots.h console-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h events.h faces.h frame.h lstream.h redisplay.h sysdep.h sysfile.h syssignal.h systime.h systty.h +event-tty.o: $(LISP_H) conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h events.h frame.h process.h redisplay.h sysproc.h syssignal.h systime.h systty.h syswait.h +frame-tty.o: $(LISP_H) conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h redisplay.h systime.h systty.h +objects-tty.o: $(LISP_H) charset.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h insdel.h objects-impl.h objects-tty-impl.h objects-tty.h objects.h specifier.h systty.h +redisplay-tty.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h events.h faces.h frame-impl.h frame.h frameslots.h glyphs.h lstream.h objects-impl.h objects-tty-impl.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h window-impl.h window.h winslots.h #endif #if defined(HAVE_GTK) -console-gtk.o: $(LISP_H) conslots.h console-gtk.h console.h process.h redisplay.h -device-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk.h console.h device.h devslots.h elhash.h events.h faces.h frame.h frameslots.h gccache-gtk.h glyphs-gtk.h glyphs.h gtk-xemacs.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systime.h window.h winslots.h -dialog-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-gtk.h console.h events.h frame.h frameslots.h gui-gtk.h gui.h opaque.h redisplay.h scrollbar.h systime.h window.h winslots.h -event-gtk.o: $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-gtk.h console-tty.h console.h device.h devslots.h dragdrop.h elhash.h event-gtk.h events.h file-coding.h frame.h frameslots.h gtk-xemacs.h lstream.h objects-gtk.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h window.h winslots.h xintrinsic.h -frame-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk.h console.h device.h devslots.h dragdrop.h events.h extents.h faces.h frame.h frameslots.h glyphs-gtk.h glyphs.h gtk-xemacs.h objects-gtk.h objects.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h sysdll.h systime.h ui-gtk.h window.h winslots.h +console-gtk.o: $(LISP_H) conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h process.h redisplay.h +device-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h gccache-gtk.h glyphs-gtk.h glyphs.h gtk-xemacs.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systime.h window-impl.h window.h winslots.h +dialog-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h console-gtk.h console.h events.h frame.h gui-gtk.h gui.h opaque.h redisplay.h scrollbar.h systime.h window.h +event-gtk.o: $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-tty.h console.h device-impl.h device.h devslots.h dragdrop.h elhash.h event-gtk.h events.h file-coding.h frame-impl.h frame.h frameslots.h gtk-xemacs.h lstream.h objects-gtk.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h sysproc.h syssignal.h systime.h systty.h window.h xintrinsic.h +frame-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dragdrop.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h glyphs-gtk.h glyphs.h gtk-xemacs.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h sysdll.h systime.h ui-gtk.h window-impl.h window.h winslots.h gccache-gtk.o: $(LISP_H) gccache-gtk.h hash.h -glyphs-gtk.o: $(LISP_H) bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk.h console.h device.h devslots.h faces.h file-coding.h frame.h frameslots.h glyphs-gtk.h glyphs.h gui-gtk.h gui.h imgproc.h insdel.h lstream.h objects-gtk.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysdll.h sysfile.h ui-gtk.h window.h winslots.h -gui-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk.h console.h device.h devslots.h frame.h frameslots.h gui-gtk.h gui.h opaque.h redisplay.h -menubar-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-gtk.h console.h device.h devslots.h events.h frame.h frameslots.h gui-gtk.h gui.h opaque.h redisplay.h scrollbar.h sysdll.h systime.h ui-gtk.h window.h winslots.h -objects-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk.h console.h device.h devslots.h insdel.h objects-gtk.h objects.h specifier.h -redisplay-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk.h console.h debug.h device.h devslots.h faces.h file-coding.h frame.h frameslots.h gccache-gtk.h glyphs-gtk.h glyphs.h gutter.h mule-ccl.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysproc.h syssignal.h systime.h window.h winslots.h -scrollbar-gtk.o: $(LISP_H) conslots.h console-gtk.h console.h frame.h frameslots.h glyphs-gtk.h glyphs.h gui-gtk.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h window.h winslots.h -select-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk.h console.h device.h devslots.h events.h frame.h frameslots.h opaque.h redisplay.h select-common.h select.h systime.h -toolbar-gtk.o: $(LISP_H) conslots.h console-gtk.h console.h frame.h frameslots.h redisplay.h toolbar-common.h -ui-gtk.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h conslots.h console-gtk.h console.h device.h devslots.h elhash.h emacs-marshals.c emacs-widget-accessors.c event-gtk.h events.h faces.h glade.c glyphs-gtk.h glyphs.h gtk-glue.c gui-gtk.h gui.h hash.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h sysdll.h systime.h ui-byhand.c ui-gtk.h window.h winslots.h +glyphs-gtk.o: $(LISP_H) bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-gtk.h glyphs.h gui-gtk.h gui.h imgproc.h insdel.h lstream.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysdll.h sysfile.h ui-gtk.h window-impl.h window.h winslots.h +gui-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h frame.h gui-gtk.h gui.h opaque.h redisplay.h +menubar-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device.h events.h frame-impl.h frame.h frameslots.h gui-gtk.h gui.h opaque.h redisplay.h scrollbar.h sysdll.h systime.h ui-gtk.h window.h +objects-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h insdel.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h specifier.h +redisplay-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h debug.h device-impl.h device.h devslots.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gccache-gtk.h glyphs-gtk.h glyphs.h gutter.h mule-ccl.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysproc.h syssignal.h systime.h window-impl.h window.h winslots.h +scrollbar-gtk.o: $(LISP_H) conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h frame-impl.h frame.h frameslots.h glyphs-gtk.h glyphs.h gui-gtk.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h window-impl.h window.h winslots.h +select-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h events.h frame.h opaque.h redisplay.h select-common.h select.h systime.h +toolbar-gtk.o: $(LISP_H) conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h frame.h redisplay.h toolbar-common.h +ui-gtk.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h console-gtk.h console.h device.h elhash.h emacs-marshals.c emacs-widget-accessors.c event-gtk.h events.h faces.h glade.c glyphs-gtk.h glyphs.h gtk-glue.c gui-gtk.h gui.h hash.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h sysdll.h systime.h ui-byhand.c ui-gtk.h window-impl.h window.h winslots.h #endif #if defined(HAVE_DATABASE) database.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h database.h sysfile.h @@ -69,9 +69,9 @@ #if defined(MULE) mule-canna.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h file-coding.h mule-ccl.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h file-coding.h mule-ccl.h -mule-charset.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h device.h devslots.h elhash.h faces.h lstream.h mule-ccl.h +mule-charset.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console.h device.h elhash.h faces.h lstream.h mule-ccl.h objects.h mule-coding.o: $(LISP_H) charset.h file-coding.h mule-ccl.h -mule-wnnfns.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h redisplay.h scrollbar.h sysdep.h window.h winslots.h +mule-wnnfns.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h redisplay.h scrollbar.h sysdep.h window.h mule.o: $(LISP_H) regex.h #endif #if defined(EXTERNAL_WIDGET) @@ -81,147 +81,148 @@ extw-Xlib.o: config.h extw-Xlib.h extw-Xt.o: config.h extw-Xlib.h extw-Xt.h #endif -EmacsFrame.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h charset.h conslots.h console-x.h console.h device.h devslots.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h +EmacsFrame.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h charset.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h faces.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h EmacsManager.o: EmacsManager.h EmacsManagerP.h config.h xintrinsicp.h xmmanagerp.h EmacsShell-sub.o: EmacsShell.h EmacsShellP.h config.h xintrinsic.h xintrinsicp.h EmacsShell.o: EmacsShell.h ExternalShell.h config.h xintrinsicp.h -abbrev.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h insdel.h redisplay.h scrollbar.h syntax.h window.h winslots.h -alloc.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h conslots.h console-stream.h console.h device.h devslots.h dumper.h elhash.h events.h extents.h frame.h frameslots.h glyphs.h opaque.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systime.h window.h winslots.h +abbrev.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h insdel.h redisplay.h scrollbar.h syntax.h window.h +alloc.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h conslots.h console-impl.h console-stream.h console.h device.h dumper.h elhash.h events.h extents-impl.h extents.h frame-impl.h frame.h frameslots.h glyphs.h opaque.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systime.h window-impl.h window.h winslots.h alloca.o: $(LISP_H) balloon_help.o: balloon_help.h config.h xintrinsic.h blocktype.o: $(LISP_H) blocktype.h -buffer.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console.h device.h devslots.h elhash.h extents.h faces.h file-coding.h frame.h frameslots.h insdel.h intl-auto-encap-win32.h lstream.h ndir.h process.h redisplay.h scrollbar.h select.h specifier.h syntax.h sysdir.h sysfile.h syswindows.h window.h winslots.h -bytecode.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h opaque.h syntax.h -callint.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h commands.h events.h insdel.h redisplay.h scrollbar.h systime.h window.h winslots.h +buffer.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h elhash.h extents.h faces.h file-coding.h frame-impl.h frame.h frameslots.h insdel.h intl-auto-encap-win32.h lstream.h ndir.h process.h redisplay.h scrollbar.h select.h specifier.h syntax.h sysdir.h sysfile.h syswindows.h window.h +bytecode.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h opaque.h redisplay.h scrollbar.h syntax.h window.h +callint.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h commands.h events.h insdel.h redisplay.h scrollbar.h systime.h window-impl.h window.h winslots.h casefiddle.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h insdel.h syntax.h casetab.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h opaque.h chartab.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h syntax.h -cm.o: $(LISP_H) conslots.h console-tty.h console.h device.h devslots.h frame.h frameslots.h lstream.h redisplay.h systty.h -cmdloop.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console.h device.h devslots.h events.h frame.h frameslots.h redisplay.h scrollbar.h systime.h window.h winslots.h -cmds.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h insdel.h syntax.h -console-stream.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h devslots.h events.h frame.h frameslots.h redisplay.h scrollbar.h sysdep.h sysfile.h systime.h systty.h window.h winslots.h -console.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-tty.h console.h device.h devslots.h events.h frame.h frameslots.h redisplay.h scrollbar.h sysdep.h systime.h systty.h window.h winslots.h +cm.o: $(LISP_H) conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h frame.h lstream.h redisplay.h systty.h +cmdloop.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-msw.h console.h device.h events.h frame.h intl-auto-encap-win32.h redisplay.h scrollbar.h systime.h syswindows.h window.h +cmds.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h extents.h insdel.h syntax.h +console-stream.o: $(LISP_H) conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h redisplay.h scrollbar.h sysdep.h sysfile.h systime.h systty.h window.h +console.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h redisplay.h scrollbar.h sysdep.h systime.h systty.h window.h data.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h sysfloat.h syssignal.h debug.o: $(LISP_H) bytecode.h debug.h -device.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h device.h devslots.h elhash.h events.h faces.h frame.h frameslots.h keymap.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h toolbar.h window.h winslots.h +device.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h keymap.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h toolbar.h window.h dgif_lib.o: $(LISP_H) gifrlib.h sysfile.h -dialog.o: $(LISP_H) conslots.h console.h device.h devslots.h frame.h frameslots.h redisplay.h +dialog.o: $(LISP_H) conslots.h console-impl.h console.h frame-impl.h frame.h frameslots.h redisplay.h dired.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h elhash.h intl-auto-encap-win32.h ndir.h opaque.h regex.h syntax.h sysdep.h sysdir.h sysfile.h syspwd.h systime.h syswindows.h doc.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h file-coding.h insdel.h keymap.h lstream.h sysfile.h doprnt.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h lstream.h dragdrop.o: $(LISP_H) dragdrop.h -dumper.o: $(LISP_H) conslots.h console-stream.h console.h dumper.h elhash.h file-coding.h intl-auto-encap-win32.h specifier.h sysfile.h syswindows.h +dumper.o: $(LISP_H) console-stream.h console.h dumper.h elhash.h file-coding.h intl-auto-encap-win32.h specifier.h sysfile.h syswindows.h dynarr.o: $(LISP_H) ecrt0.o: config.h -editfns.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console.h device.h devslots.h events.h extents.h frame.h frameslots.h insdel.h line-number.h ndir.h redisplay.h scrollbar.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h window.h winslots.h +editfns.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console.h device.h events.h frame.h insdel.h line-number.h ndir.h process.h redisplay.h scrollbar.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h window.h eldap.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h eldap.h opaque.h sysdep.h elhash.o: $(LISP_H) bytecode.h elhash.h opaque.h emacs-marshals.o: hash.h emacs-widget-accessors.o: -emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console.h dumper.h frame.h frameslots.h intl-auto-encap-win32.h paths.h process.h redisplay.h sysdep.h sysdll.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswindows.h -emodules.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h emodules.h file-coding.h frame.h frameslots.h insdel.h lstream.h redisplay.h scrollbar.h sysdep.h sysdll.h window.h winslots.h +emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h console-msw.h console.h dumper.h frame.h intl-auto-encap-win32.h paths.h process.h redisplay.h sysdep.h sysdll.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswindows.h +emodules.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console.h emodules.h file-coding.h frame.h insdel.h lstream.h redisplay.h scrollbar.h sysdep.h sysdll.h window.h esd.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h miscplay.h sound.h sysfile.h -eval.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h commands.h conslots.h console.h device.h devslots.h frame.h frameslots.h lstream.h opaque.h redisplay.h scrollbar.h window.h winslots.h -event-Xt.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h Emacs.ad.h EmacsFrame.h blocktype.h charset.h conslots.h console-tty.h console-x.h console.h device.h devslots.h dragdrop.h elhash.h events.h file-coding.h frame.h frameslots.h glyphs.h lstream.h objects-x.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h window.h winslots.h xintrinsic.h xintrinsicp.h -event-stream.o: $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console.h device.h devslots.h elhash.h events.h file-coding.h frame.h frameslots.h gui.h insdel.h keymap.h lstream.h macros.h menubar.h process.h redisplay.h scrollbar.h sysdep.h sysfile.h syssignal.h systime.h window.h winslots.h -event-unixoid.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h devslots.h events.h lstream.h process.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h -events.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-tty.h console.h device.h devslots.h events.h extents.h frame.h frameslots.h glyphs.h keymap.h lstream.h redisplay.h scrollbar.h specifier.h systime.h systty.h toolbar.h window.h winslots.h -extents.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h debug.h device.h devslots.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h gutter.h insdel.h keymap.h opaque.h process.h redisplay.h scrollbar.h specifier.h window.h winslots.h -faces.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h device.h devslots.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h objects.h redisplay.h scrollbar.h specifier.h window.h winslots.h +eval.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console.h device.h frame.h lstream.h opaque.h redisplay.h scrollbar.h window.h +event-Xt.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h Emacs.ad.h EmacsFrame.h blocktype.h charset.h conslots.h console-impl.h console-tty.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dragdrop.h elhash.h events.h file-coding.h frame-impl.h frame.h frameslots.h glyphs.h lstream.h objects-x.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h +event-stream.o: $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h elhash.h events.h file-coding.h frame-impl.h frame.h frameslots.h gui.h insdel.h keymap.h lstream.h macros.h menubar.h process.h redisplay.h scrollbar.h sysdep.h sysfile.h syssignal.h systime.h window-impl.h window.h winslots.h +event-unixoid.o: $(LISP_H) conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device.h events.h lstream.h process.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h +events.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h events.h extents.h frame-impl.h frame.h frameslots.h glyphs.h keymap.h lstream.h redisplay.h scrollbar.h specifier.h systime.h systty.h toolbar.h window-impl.h window.h winslots.h +extents.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console.h debug.h device.h elhash.h extents-impl.h extents.h faces.h frame.h glyphs.h gutter.h insdel.h keymap.h opaque.h process.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h +faces.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h elhash.h extents-impl.h extents.h faces.h frame-impl.h frame.h frameslots.h glyphs.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h file-coding.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h elhash.h file-coding.h insdel.h lstream.h opaque.h -fileio.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h device.h devslots.h events.h file-coding.h frame.h frameslots.h insdel.h intl-auto-encap-win32.h lstream.h ndir.h redisplay.h scrollbar.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h window.h winslots.h +fileio.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console.h device.h events.h file-coding.h frame.h insdel.h intl-auto-encap-win32.h lstream.h ndir.h process.h redisplay.h scrollbar.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h window-impl.h window.h winslots.h filelock.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h ndir.h paths.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h filemode.o: $(LISP_H) sysfile.h floatfns.o: $(LISP_H) sysfloat.h syssignal.h -fns.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h conslots.h console.h device.h devslots.h events.h extents.h frame.h frameslots.h insdel.h lstream.h opaque.h redisplay.h sysfile.h sysproc.h syssignal.h systime.h +fns.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h console.h device.h events.h extents.h frame.h insdel.h lstream.h opaque.h process.h redisplay.h sysfile.h sysproc.h syssignal.h systime.h font-lock.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h insdel.h syntax.h -frame.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h device.h devslots.h events.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h menubar.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h +frame.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h glyphs.h gui.h gutter.h menubar.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window-impl.h window.h winslots.h free-hook.o: $(LISP_H) hash.h general.o: $(LISP_H) getloadavg.o: $(LISP_H) sysfile.h gif_io.o: $(LISP_H) gifrlib.h sysfile.h glade.o: bytecode.h -glyphs-eimage.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h device.h devslots.h faces.h file-coding.h frame.h frameslots.h gifrlib.h glyphs.h lstream.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysfile.h window.h winslots.h -glyphs-shared.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h elhash.h faces.h frame.h frameslots.h glyphs.h imgproc.h insdel.h lstream.h opaque.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h window.h winslots.h -glyphs-widget.o: $(LISP_H) bytecode.h charset.h conslots.h console.h device.h devslots.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h objects.h opaque.h redisplay.h scrollbar.h specifier.h window.h winslots.h -glyphs.o: $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h device.h devslots.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h objects.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h sysfile.h window.h winslots.h +glyphs-eimage.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h faces.h file-coding.h frame.h gifrlib.h glyphs.h lstream.h objects-impl.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysfile.h window-impl.h window.h winslots.h +glyphs-shared.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console.h elhash.h faces.h frame.h glyphs.h imgproc.h insdel.h lstream.h opaque.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h window-impl.h window.h winslots.h +glyphs-widget.o: $(LISP_H) bytecode.h charset.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h faces.h frame.h glyphs.h gui.h insdel.h lstream.h objects.h opaque.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h +glyphs.o: $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h elhash.h faces.h frame-impl.h frame.h frameslots.h glyphs.h gui.h insdel.h objects-impl.h objects.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h sysfile.h window-impl.h window.h winslots.h gmalloc.o: $(LISP_H) getpagesize.h sysdep.h -gpmevent.o: $(LISP_H) commands.h conslots.h console-tty.h console.h device.h devslots.h events.h gpmevent.h lstream.h process.h sysdep.h sysproc.h syssignal.h systime.h systty.h +gpmevent.o: $(LISP_H) commands.h console-tty.h console.h device.h events.h gpmevent.h lstream.h process.h sysdep.h sysproc.h syssignal.h systime.h systty.h gtk-glue.o: -gtk-xemacs.o: $(LISP_H) charset.h conslots.h console-gtk.h console.h device.h devslots.h event-gtk.h faces.h frame.h frameslots.h glyphs.h gtk-xemacs.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h window.h winslots.h -gui.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h elhash.h gui.h -gutter.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h device.h devslots.h faces.h frame.h frameslots.h glyphs.h gutter.h redisplay.h scrollbar.h specifier.h window.h winslots.h +gtk-xemacs.o: $(LISP_H) charset.h console-gtk.h console.h device.h event-gtk.h faces.h frame.h glyphs.h gtk-xemacs.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h +gui.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h elhash.h gui.h menubar.h +gutter.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h faces.h frame-impl.h frame.h frameslots.h glyphs.h gutter.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h hash.o: $(LISP_H) hash.h hftctl.o: $(LISP_H) sysfile.h hpplay.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h sound.h imgproc.o: $(LISP_H) imgproc.h -indent.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h device.h devslots.h extents.h faces.h frame.h frameslots.h glyphs.h insdel.h redisplay.h scrollbar.h specifier.h window.h winslots.h -inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h conslots.h console-gtk.h console-msw.h console.h database.h device.h devslots.h eldap.h elhash.h events.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h intl-auto-encap-win32.h keymap.h lstream.h objects.h opaque.h postgresql.h process.h rangetab.h redisplay.h scrollbar.h specifier.h syntax.h sysdll.h sysfile.h systime.h syswindows.h toolbar.h tooltalk.h ui-gtk.h window.h winslots.h xintrinsic.h -input-method-motif.o: $(LISP_H) EmacsFrame.h conslots.h console-x.h console.h device.h devslots.h frame.h frameslots.h redisplay.h xintrinsic.h -input-method-xlib.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-x.h console.h device.h devslots.h events.h frame.h frameslots.h redisplay.h scrollbar.h systime.h window.h winslots.h xintrinsic.h -insdel.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h device.h devslots.h extents.h frame.h frameslots.h insdel.h line-number.h lstream.h redisplay.h +indent.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console.h device.h extents.h faces.h frame.h glyphs.h insdel.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h +inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h console-gtk.h console-msw.h console.h database.h device.h eldap.h elhash.h events.h extents.h faces.h file-coding.h frame.h glyphs-x.h glyphs.h gui-x.h gui.h intl-auto-encap-win32.h keymap.h lstream.h objects.h opaque.h postgresql.h process.h rangetab.h redisplay.h scrollbar.h specifier.h syntax.h sysdll.h sysfile.h systime.h syswindows.h toolbar.h tooltalk.h ui-gtk.h window-impl.h window.h winslots.h xintrinsic.h +input-method-motif.o: $(LISP_H) EmacsFrame.h console-x.h console.h device.h frame.h redisplay.h xintrinsic.h +input-method-xlib.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h redisplay.h scrollbar.h systime.h window-impl.h window.h winslots.h xintrinsic.h +insdel.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console.h device.h extents.h frame.h insdel.h line-number.h lstream.h redisplay.h intl-auto-encap-win32.o: $(LISP_H) intl-auto-encap-win32.h syswindows.h -intl-encap-win32.o: $(LISP_H) conslots.h console-msw.h console.h intl-auto-encap-win32.h syswindows.h -intl-win32.o: $(LISP_H) charset.h conslots.h console-msw.h console.h elhash.h faces.h file-coding.h frame.h frameslots.h intl-auto-encap-win32.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syswindows.h window.h winslots.h +intl-encap-win32.o: $(LISP_H) console-msw.h console.h intl-auto-encap-win32.h syswindows.h +intl-win32.o: $(LISP_H) charset.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h elhash.h faces.h file-coding.h frame-impl.h frame.h frameslots.h intl-auto-encap-win32.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syswindows.h window-impl.h window.h winslots.h intl.o: $(LISP_H) -keymap.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h conslots.h console.h elhash.h events.h frame.h frameslots.h insdel.h keymap.h redisplay.h scrollbar.h systime.h window.h winslots.h +keymap.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h elhash.h events.h extents.h frame.h insdel.h keymap.h redisplay.h scrollbar.h systime.h window.h lastfile.o: config.h +libinterface.o: $(LISP_H) gifrlib.h libinterface.h libsst.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h libsst.h sound.h sysfile.h line-number.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h line-number.h linuxplay.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h miscplay.h sound.h sysfile.h syssignal.h systty.h lread.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h elhash.h file-coding.h intl-auto-encap-win32.h lstream.h opaque.h sysfile.h sysfloat.h syswindows.h lstream.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h insdel.h lstream.h sysfile.h -macros.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console.h device.h devslots.h events.h frame.h frameslots.h keymap.h macros.h redisplay.h scrollbar.h systime.h window.h winslots.h +macros.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console.h device.h events.h frame.h keymap.h macros.h redisplay.h scrollbar.h systime.h window.h malloc.o: config.h getpagesize.h marker.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h md5.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h file-coding.h lstream.h -menubar.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h device.h devslots.h frame.h frameslots.h gui.h keymap.h menubar.h redisplay.h scrollbar.h specifier.h window.h winslots.h -minibuf.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-stream.h console.h events.h frame.h frameslots.h insdel.h redisplay.h scrollbar.h systime.h window.h winslots.h +menubar.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h frame-impl.h frame.h frameslots.h gui.h keymap.h menubar.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h +minibuf.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-stream.h console.h events.h frame-impl.h frame.h frameslots.h insdel.h redisplay.h scrollbar.h systime.h window-impl.h window.h winslots.h miscplay.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h miscplay.h sound.h sysfile.h syssignal.h nas.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h sound.h sysdep.h syssignal.h -native-gtk-toolbar.o: $(LISP_H) charset.h conslots.h console-gtk.h console.h faces.h frame.h frameslots.h glyphs-gtk.h glyphs.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -nt.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h intl-auto-encap-win32.h ndir.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h +native-gtk-toolbar.o: $(LISP_H) charset.h console-gtk.h console.h faces.h frame.h glyphs-gtk.h glyphs.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window-impl.h window.h winslots.h +nt.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h intl-auto-encap-win32.h ndir.h process.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h ntheap.o: $(LISP_H) intl-auto-encap-win32.h sysdep.h syswindows.h ntplay.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h intl-auto-encap-win32.h sound.h sysfile.h syswindows.h -objects.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h device.h devslots.h elhash.h faces.h frame.h frameslots.h glyphs.h objects.h redisplay.h scrollbar.h specifier.h window.h winslots.h +objects.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h elhash.h faces.h frame.h glyphs.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h offix.o: offix-cursors.h offix-types.h offix.h xintrinsic.h opaque.o: $(LISP_H) opaque.h -postgresql.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h postgresql.h sysdep.h -print.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h conslots.h console-msw.h console-stream.h console-tty.h console.h device.h devslots.h extents.h frame.h frameslots.h insdel.h intl-auto-encap-win32.h lstream.h opaque.h redisplay.h sysfile.h systty.h syswindows.h -process-nt.o: $(LISP_H) conslots.h console-msw.h console.h hash.h intl-auto-encap-win32.h lstream.h process.h procimpl.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h -process-unix.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h events.h file-coding.h frame.h frameslots.h hash.h lstream.h ndir.h opaque.h process.h procimpl.h redisplay.h scrollbar.h sysdep.h sysdir.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h window.h winslots.h -process.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console.h device.h devslots.h events.h file-coding.h frame.h frameslots.h hash.h insdel.h lstream.h opaque.h process.h procimpl.h redisplay.h scrollbar.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h window.h winslots.h +postgresql.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h postgresql.h process.h sysdep.h +print.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h extents.h frame.h insdel.h intl-auto-encap-win32.h lstream.h opaque.h redisplay.h sysfile.h systty.h syswindows.h +process-nt.o: $(LISP_H) console-msw.h console.h hash.h intl-auto-encap-win32.h lstream.h process.h procimpl.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h +process-unix.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console.h events.h file-coding.h frame.h hash.h lstream.h ndir.h opaque.h process.h procimpl.h redisplay.h scrollbar.h sysdep.h sysdir.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h window.h +process.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h console.h device.h events.h file-coding.h frame.h hash.h insdel.h lstream.h opaque.h process.h procimpl.h redisplay.h scrollbar.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h window.h profile.o: $(LISP_H) backtrace.h bytecode.h elhash.h hash.h syssignal.h systime.h ralloc.o: $(LISP_H) getpagesize.h rangetab.o: $(LISP_H) rangetab.h realpath.o: $(LISP_H) intl-auto-encap-win32.h sysfile.h syswindows.h -redisplay-output.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h device.h devslots.h faces.h frame.h frameslots.h glyphs.h gutter.h redisplay.h scrollbar.h specifier.h window.h winslots.h -redisplay.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-tty.h console.h debug.h device.h devslots.h elhash.h events.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h gutter.h insdel.h line-number.h menubar.h objects.h process.h redisplay.h scrollbar.h specifier.h sysfile.h systime.h systty.h toolbar.h window.h winslots.h +redisplay-output.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h faces.h frame-impl.h frame.h frameslots.h glyphs.h gutter.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h +redisplay.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-tty.h console.h debug.h device-impl.h device.h devslots.h elhash.h events.h extents-impl.h extents.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs.h gui.h gutter.h insdel.h line-number.h menubar.h objects-impl.h objects.h process.h redisplay.h scrollbar.h specifier.h sysfile.h systime.h systty.h toolbar.h window-impl.h window.h winslots.h regex.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h regex.h syntax.h -scrollbar.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console.h device.h devslots.h frame.h frameslots.h glyphs.h gutter.h redisplay.h scrollbar.h specifier.h window.h winslots.h +scrollbar.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h frame-impl.h frame.h frameslots.h glyphs.h gutter.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h search.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h insdel.h opaque.h regex.h syntax.h -select.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h device.h devslots.h extents.h frame.h frameslots.h objects.h opaque.h redisplay.h select.h specifier.h +select.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h extents.h frame.h objects.h opaque.h redisplay.h select.h sgiplay.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h libst.h sound.h sysfile.h sysproc.h syssignal.h systime.h sheap.o: $(LISP_H) sheap-adjust.h sysfile.h -signal.o: $(LISP_H) conslots.h console.h device.h devslots.h events.h frame.h frameslots.h process.h redisplay.h sysdep.h sysfile.h syssignal.h systime.h -sound.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-x.h console.h device.h devslots.h redisplay.h sound.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h xintrinsic.h -specifier.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h device.h devslots.h frame.h frameslots.h glyphs.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h window.h winslots.h +signal.o: $(LISP_H) conslots.h console-impl.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h process.h redisplay.h sysdep.h sysfile.h syssignal.h systime.h +sound.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h intl-auto-encap-win32.h redisplay.h sound.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h xintrinsic.h +specifier.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h frame.h glyphs.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h strcat.o: config.h strcmp.o: config.h strcpy.o: config.h strftime.o: $(LISP_H) sunplay.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h sound.h sysdep.h sysfile.h syssignal.h sunpro.o: $(LISP_H) -symbols.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h elhash.h +symbols.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h elhash.h syntax.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h extents.h syntax.h -sysdep.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-stream.h console-tty.h console.h device.h devslots.h events.h frame.h frameslots.h intl-auto-encap-win32.h ndir.h process.h redisplay.h scrollbar.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h systty.h syswait.h syswindows.h window.h winslots.h +sysdep.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h events.h frame.h intl-auto-encap-win32.h ndir.h process.h redisplay.h scrollbar.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h systty.h syswait.h syswindows.h window.h sysdll.o: config.h sysdll.h -termcap.o: $(LISP_H) conslots.h console.h device.h devslots.h +termcap.o: $(LISP_H) console.h device.h terminfo.o: config.h tests.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h elhash.h lstream.h opaque.h text.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h file-coding.h lstream.h -toolbar-common.o: $(LISP_H) charset.h conslots.h console-gtk.h console-x.h console.h device.h devslots.h faces.h frame.h frameslots.h glyphs.h redisplay.h scrollbar.h specifier.h toolbar-common.h toolbar.h window.h winslots.h xintrinsic.h -toolbar.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console.h device.h devslots.h frame.h frameslots.h glyphs.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +toolbar-common.o: $(LISP_H) charset.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h faces.h frame-impl.h frame.h frameslots.h glyphs.h redisplay.h scrollbar.h specifier.h toolbar-common.h toolbar.h window-impl.h window.h winslots.h xintrinsic.h +toolbar.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h frame-impl.h frame.h frameslots.h glyphs.h redisplay.h scrollbar.h specifier.h toolbar.h window-impl.h window.h winslots.h tooltalk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h elhash.h process.h syssignal.h tooltalk.h tparam.o: $(LISP_H) ui-byhand.o: gui.h @@ -244,7 +245,7 @@ unicode.o: $(LISP_H) charset.h file-coding.h opaque.h sysfile.h vm-limit.o: $(LISP_H) mem-limits.h widget.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h -win32.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-msw.h console.h intl-auto-encap-win32.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h -window.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console.h device.h devslots.h elhash.h faces.h frame.h frameslots.h glyphs.h gutter.h objects.h redisplay.h scrollbar.h specifier.h window.h winslots.h +win32.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console-msw.h console.h intl-auto-encap-win32.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h +window.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h elhash.h faces.h frame-impl.h frame.h frameslots.h glyphs.h gutter.h objects.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h xgccache.o: $(LISP_H) hash.h xgccache.h xmu.o: config.h
--- a/src/device-gtk.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/device-gtk.c Thu Jun 20 21:19:10 2002 +0000 @@ -1,6 +1,7 @@ /* Device functions for X windows. Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. Copyright (C) 1994, 1995 Free Software Foundation, Inc. + Copyright (C) 2002 Ben Wing. This file is part of XEmacs. @@ -28,22 +29,22 @@ #include <config.h> #include "lisp.h" -#include "console-gtk.h" +#include "buffer.h" +#include "device-impl.h" +#include "elhash.h" +#include "events.h" +#include "faces.h" +#include "frame-impl.h" +#include "redisplay.h" +#include "sysdep.h" +#include "window.h" + +#include "console-gtk-impl.h" #include "gccache-gtk.h" #include "glyphs-gtk.h" #include "objects-gtk.h" #include "gtk-xemacs.h" -#include "buffer.h" -#include "events.h" -#include "faces.h" -#include "frame.h" -#include "device.h" -#include "redisplay.h" -#include "sysdep.h" -#include "window.h" -#include "elhash.h" - #include "sysfile.h" #include "systime.h" @@ -55,8 +56,6 @@ #include <bonobo.h> #endif -Lisp_Object Vdefault_gtk_device; - /* Qdisplay in general.c */ Lisp_Object Qinit_pre_gtk_win, Qinit_post_gtk_win; @@ -371,22 +370,6 @@ #endif } - if (EQ (device, Vdefault_gtk_device)) - { - Lisp_Object devcons, concons; - /* #### handle deleting last X device */ - Vdefault_gtk_device = Qnil; - DEVICE_LOOP_NO_BREAK (devcons, concons) - { - if (DEVICE_GTK_P (XDEVICE (XCAR (devcons))) && - !EQ (device, XCAR (devcons))) - { - Vdefault_gtk_device = XCAR (devcons); - goto double_break; - } - } - } - double_break: free_gtk_device_struct (d); } @@ -413,15 +396,6 @@ /* display information functions */ /************************************************************************/ -DEFUN ("default-gtk-device", Fdefault_gtk_device, 0, 0, 0, /* -Return the default GTK device for resourcing. -This is the first-created GTK device that still exists. -*/ - ()) -{ - return Vdefault_gtk_device; -} - DEFUN ("gtk-display-visual-class", Fgtk_display_visual_class, 0, 1, 0, /* Return the visual class of the GTK display DEVICE is using. The returned value will be one of the symbols `static-gray', `gray-scale', @@ -698,7 +672,6 @@ void syms_of_device_gtk (void) { - DEFSUBR (Fdefault_gtk_device); DEFSUBR (Fgtk_keysym_on_keyboard_p); DEFSUBR (Fgtk_display_visual_class); DEFSUBR (Fgtk_display_visual_depth); @@ -732,8 +705,6 @@ { Fprovide (Qgtk); - staticpro (&Vdefault_gtk_device); - DEFVAR_LISP ("gtk-initial-argv-list", &Vgtk_initial_argv_list /* You don't want to know. This is used during startup to communicate the remaining arguments in @@ -749,7 +720,6 @@ This is used during startup to communicate the default geometry to GTK. */ ); - Vdefault_gtk_device = Qnil; Vgtk_initial_geometry = Qnil; Vgtk_initial_argv_list = Qnil; }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/device-impl.h Thu Jun 20 21:19:10 2002 +0000 @@ -0,0 +1,331 @@ +/* Define device-object for XEmacs. + Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. + Copyright (C) 1995, 2002 Ben Wing + Copyright (C) 1995 Sun Microsystems + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +/* Written by Chuck Thompson and Ben Wing. */ + +#ifndef INCLUDED_device_impl_h_ +#define INCLUDED_device_impl_h_ + +#include "console-impl.h" +#include "device.h" + +/* This should really be in redisplay.h but by putting it here we + won't have to ensure that redisplay.h is always included before + this file. */ +struct pixel_to_glyph_translation_cache +{ + unsigned int valid :1; + struct frame *frame; + int low_x_coord, high_x_coord, col, obj_x; + int low_y_coord, high_y_coord, row, obj_y; + struct window *w; + Charbpos charpos; + Charbpos closest; + Charcount modeline_closest; + Lisp_Object obj1, obj2; + int retval; +}; + +/* Less public: */ +#define DEVICE_TYPE_NAME(d) ((d)->devmeths->name) +#define DEVICE_IMPL_FLAG(d, f) CONMETH_IMPL_FLAG ((d)->devmeths, (f)) +#define DEVICE_SPECIFIC_FRAME_PROPS(d) \ + ((d)->devmeths->device_specific_frame_props) + +/* More public: */ +#define DEVICE_TYPE(d) ((d)->devmeths->symbol) +#define XDEVICE_TYPE(d) DEVICE_TYPE (XDEVICE (d)) + +/******** Accessing / calling a device method *********/ + +#define HAS_DEVMETH_P(d, m) HAS_CONTYPE_METH_P ((d)->devmeths, m) +#define DEVMETH(d, m, args) CONTYPE_METH ((d)->devmeths, m, args) +#define MAYBE_DEVMETH(d, m, args) MAYBE_CONTYPE_METH ((d)->devmeths, m, args) +#define DEVMETH_OR_GIVEN(d, m, args, given) \ + CONTYPE_METH_OR_GIVEN((d)->devmeths, m, args, given) +#define MAYBE_INT_DEVMETH(d, m, args) \ + MAYBE_INT_CONTYPE_METH ((d)->devmeths, m, args) +#define MAYBE_LISP_DEVMETH(d, m, args) \ + MAYBE_LISP_CONTYPE_METH ((d)->devmeths, m, args) + +struct device +{ + struct lcrecord_header header; + + /* Methods for this device's console. This can also be retrieved + through device->console, but it's faster this way. */ + struct console_methods *devmeths; + + /* A structure of auxiliary data specific to the device type. + struct x_device is used for X window frames; defined in console-x.h + struct tty_device is used to TTY's; defined in console-tty.h */ + void *device_data; + + /* redisplay flags */ + unsigned int buffers_changed :1; + unsigned int clip_changed :1; + unsigned int extents_changed :1; + unsigned int faces_changed :1; + unsigned int frame_changed :1; + unsigned int glyphs_changed :1; + unsigned int subwindows_changed :1; + unsigned int subwindows_state_changed :1; + unsigned int icon_changed :1; + unsigned int menubar_changed :1; + unsigned int modeline_changed :1; + unsigned int point_changed :1; + unsigned int size_changed :1; + unsigned int gutter_changed :1; + unsigned int toolbar_changed :1; + unsigned int windows_changed :1; + unsigned int windows_structure_changed :1; + + unsigned int locked :1; + + /* Cache information about last pixel position translated to a + glyph. The law of locality applies very heavily here so caching + the value leads to a significant win. At the moment this is + really X specific but once we have generic mouse support it won't + be. */ + struct pixel_to_glyph_translation_cache pixel_to_glyph_cache; + + /* Output baud rate of device; used for redisplay decisions. */ + int baud_rate; + + /* sound flags */ + unsigned int on_console_p :1; + unsigned int connected_to_nas_p :1; + +#define MARKED_SLOT(x) Lisp_Object x +#include "devslots.h" + + /* File descriptors for input and output. Much of the time + (but not always) these will be the same. For an X device, + these both hold the file descriptor of the socket used + to communicate with the X server. For a TTY device, these + may or may not be the same and point to the terminal that + is used for I/O. */ + int infd, outfd; + + /* infd and outfd are moved outside HAVE_UNIXOID_EVENT_LOOP conditionals, + because Win32, presumably the first port which does not use select() + polling, DOES have handles for a console device. -- kkm */ + +#ifdef HAVE_UNIXOID_EVENT_LOOP + /* holds some data necessary for SIGIO control. Perhaps this should + be inside of device_data; but it is used for both TTY's and X + device. Perhaps it should be conditionalized on SIGIO; but + this requires including syssignal.h. */ + int old_fcntl_owner; +#endif +}; + +/* Redefine basic properties more efficiently */ + +#undef DEVICE_LIVE_P +#define DEVICE_LIVE_P(d) (!EQ (DEVICE_TYPE (d), Qdead)) +#undef DEVICE_CONSOLE +#define DEVICE_CONSOLE(d) ((d)->console) +#undef DEVICE_FRAME_LIST +#define DEVICE_FRAME_LIST(d) ((d)->frame_list) + +#define DEVICE_TYPE_P(d, type) EQ (DEVICE_TYPE (d), Q##type) + +#ifdef ERROR_CHECK_TYPES +DECLARE_INLINE_HEADER ( +struct device * +error_check_device_type (struct device *d, Lisp_Object sym) +) +{ + assert (EQ (DEVICE_TYPE (d), sym)); + return d; +} +# define DEVICE_TYPE_DATA(d, type) \ + ((struct type##_device *) error_check_device_type (d, Q##type)->device_data) +#else +# define DEVICE_TYPE_DATA(d, type) \ + ((struct type##_device *) (d)->device_data) +#endif + +#define CHECK_DEVICE_TYPE(x, type) \ + do { \ + CHECK_DEVICE (x); \ + if (!(DEVICEP (x) && DEVICE_TYPE_P (XDEVICE (x), \ + type))) \ + dead_wrong_type_argument \ + (type##_console_methods->predicate_symbol, x); \ + } while (0) +#define CONCHECK_DEVICE_TYPE(x, type) \ + do { \ + CONCHECK_DEVICE (x); \ + if (!(DEVICEP (x) && DEVICE_TYPE_P (XDEVICE (x), \ + type))) \ + x = wrong_type_argument \ + (type##_console_methods->predicate_symbol, x); \ + } while (0) + +#define DEVICE_DISPLAY_P(dev) \ + (DEVICE_LIVE_P (dev) && \ + !DEVICE_IMPL_FLAG (dev, XDEVIMPF_IS_A_PRINTER)) + +#define CHECK_DISPLAY_DEVICE(dev) \ + do { \ + CHECK_DEVICE (dev); \ + if (!(DEVICEP (dev) \ + && DEVICE_DISPLAY_P (XDEVICE (dev)))) \ + dead_wrong_type_argument (Qdisplay, dev); \ + } while (0) + +#define CONCHECK_DISPLAY_DEVICE(dev) \ + do { \ + CONCHECK_DEVICE (dev); \ + if (!(DEVICEP (dev) \ + && DEVICE_DISPLAY_P (XDEVICE (dev)))) \ + wrong_type_argument (Qdisplay, dev); \ + } while (0) + +#define DEVICE_PRINTER_P(dev) \ + (DEVICE_LIVE_P (dev) && !DEVICE_DISPLAY_P (dev)) + +#define CHECK_PRINTER_DEVICE(dev) \ + do { \ + CHECK_DEVICE (dev); \ + if (!(DEVICEP (dev) \ + && DEVICE_PRINTER_P (XDEVICE (dev)))) \ + dead_wrong_type_argument (Qprinter, dev); \ + } while (0) + +#define CONCHECK_PRINTER_DEVICE(dev) \ + do { \ + CONCHECK_DEVICE (dev); \ + if (!(DEVICEP (dev) \ + && DEVICE_PRINTER_P (XDEVICE (dev)))) \ + wrong_type_argument (Qprinter, dev); \ + } while (0) + +/* #### These should be in the device-*.h files but there are + too many places where the abstraction is broken. Need to + fix. */ + +#define DEVICE_X_P(dev) CONSOLE_TYPESYM_X_P (DEVICE_TYPE (dev)) +#define CHECK_X_DEVICE(z) CHECK_DEVICE_TYPE (z, x) +#define CONCHECK_X_DEVICE(z) CONCHECK_DEVICE_TYPE (z, x) + +#define DEVICE_GTK_P(dev) CONSOLE_TYPESYM_GTK_P (DEVICE_TYPE (dev)) +#define CHECK_GTK_DEVICE(z) CHECK_DEVICE_TYPE (z, gtk) +#define CONCHECK_GTK_DEVICE(z) CONCHECK_DEVICE_TYPE (z, gtk) + +#define DEVICE_MSWINDOWS_P(dev) CONSOLE_TYPESYM_MSWINDOWS_P (DEVICE_TYPE (dev)) +#define CHECK_MSWINDOWS_DEVICE(z) CHECK_DEVICE_TYPE (z, mswindows) +#define CONCHECK_MSWINDOWS_DEVICE(z) CONCHECK_DEVICE_TYPE (z, mswindows) + +#define DEVICE_TTY_P(dev) CONSOLE_TYPESYM_TTY_P (DEVICE_TYPE (dev)) +#define CHECK_TTY_DEVICE(z) CHECK_DEVICE_TYPE (z, tty) +#define CONCHECK_TTY_DEVICE(z) CONCHECK_DEVICE_TYPE (z, tty) + +#define DEVICE_STREAM_P(dev) CONSOLE_TYPESYM_STREAM_P (DEVICE_TYPE (dev)) +#define CHECK_STREAM_DEVICE(z) CHECK_DEVICE_TYPE (z, stream) +#define CONCHECK_STREAM_DEVICE(z) CONCHECK_DEVICE_TYPE (z, stream) + +#define DEVICE_WIN_P(dev) CONSOLE_TYPESYM_WIN_P (DEVICE_TYPE (dev)) + +#define DEVICE_REDISPLAY_INFO(d) ((d)->redisplay_info) + +#define DEVICE_NAME(d) ((d)->name) +#define DEVICE_CLASS(d) ((d)->device_class) +/* Catch people attempting to set this. */ +#define DEVICE_SELECTED_FRAME(d) NON_LVALUE ((d)->selected_frame) +#define DEVICE_FRAME_WITH_FOCUS_REAL(d) ((d)->frame_with_focus_real) +#define DEVICE_FRAME_WITH_FOCUS_FOR_HOOKS(d) ((d)->frame_with_focus_for_hooks) +#define DEVICE_FRAME_THAT_OUGHT_TO_HAVE_FOCUS(d) \ + ((d)->frame_that_ought_to_have_focus) +#define DEVICE_USER_DEFINED_TAGS(d) ((d)->user_defined_tags) +#define DEVICE_CONNECTION(d) ((d)->connection) +#define DEVICE_CANON_CONNECTION(d) ((d)->canon_connection) +#define DEVICE_BAUD_RATE(d) ((d)->baud_rate) +#define DEVICE_INFD(d) ((d)->infd) +#define DEVICE_OUTFD(d) ((d)->outfd) +#define DEVICE_OLD_FCNTL_OWNER(d) ((d)->old_fcntl_owner) +#define DEVICE_ON_CONSOLE_P(d) ((d)->on_console_p) +#define DEVICE_CONNECTED_TO_NAS_P(d) ((d)->connected_to_nas_p) + +#define LOCK_DEVICE(d) ((void) ((d)->locked = 1)) +#define UNLOCK_DEVICE(d) ((void) ((d)->locked = 0)) + +#define INVALIDATE_DEVICE_PIXEL_TO_GLYPH_CACHE(d) \ + ((void) ((d)->pixel_to_glyph_cache.valid = 0)) + +#define INVALIDATE_PIXEL_TO_GLYPH_CACHE do { \ + Lisp_Object IPTGC_devcons, IPTGC_concons; \ + DEVICE_LOOP_NO_BREAK (IPTGC_devcons, IPTGC_concons) \ + INVALIDATE_DEVICE_PIXEL_TO_GLYPH_CACHE (XDEVICE (XCAR (IPTGC_devcons))); \ +} while (0) + +#define MARK_DEVICE_FACES_CHANGED(d) \ + ((void) (faces_changed = (d)->faces_changed = 1)) + +#define MARK_DEVICE_GLYPHS_CHANGED(d) \ + ((void) (glyphs_changed = (d)->glyphs_changed = 1)) + +#define MARK_DEVICE_SUBWINDOWS_CHANGED(d) \ + ((void) (subwindows_changed = (d)->subwindows_changed = 1)) + +#define MARK_DEVICE_SUBWINDOWS_STATE_CHANGED(d) \ + ((void) (subwindows_state_changed = (d)->subwindows_state_changed = 1)) + +#define MARK_DEVICE_TOOLBARS_CHANGED(d) \ + ((void) (toolbar_changed = (d)->toolbar_changed = 1)) + +#define MARK_DEVICE_GUTTERS_CHANGED(d) \ + ((void) (gutter_changed = (d)->gutter_changed = 1)) + +#define MARK_DEVICE_SIZE_CHANGED(d) \ + ((void) (size_changed = (d)->size_changed = 1)) + +#define MARK_DEVICE_FRAMES_FACES_CHANGED(d) do { \ + struct device *mdffc_d = (d); \ + Lisp_Object frmcons; \ + DEVICE_FRAME_LOOP (frmcons, mdffc_d) \ + XFRAME (XCAR (frmcons))->faces_changed = 1; \ + MARK_DEVICE_FACES_CHANGED (mdffc_d); \ +} while (0) + +#define MARK_DEVICE_FRAMES_GLYPHS_CHANGED(d) do { \ + struct device *mdffc_d = (d); \ + Lisp_Object frmcons; \ + DEVICE_FRAME_LOOP (frmcons, mdffc_d) \ + XFRAME (XCAR (frmcons))->glyphs_changed = 1; \ + MARK_DEVICE_GLYPHS_CHANGED (mdffc_d); \ +} while (0) + +#define MARK_DEVICE_FRAME_CHANGED(d) \ + ((void) (frame_changed = (d)->frame_changed = 1)) + +#define MARK_DEVICE_WINDOWS_CHANGED(d) \ + ((void) (windows_changed = (d)->windows_changed = 1)) + +#define MARK_DEVICE_WINDOWS_STRUCTURE_CHANGED(d) \ + ((void) (windows_structure_changed = (d)->windows_structure_changed = 1)) + +#endif /* INCLUDED_device_impl_h_ */
--- a/src/device-msw.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/device-msw.c Thu Jun 20 21:19:10 2002 +0000 @@ -38,12 +38,12 @@ #include <config.h> #include "lisp.h" -#include "device.h" +#include "device-impl.h" #include "events.h" #include "faces.h" #include "frame.h" -#include "console-msw.h" +#include "console-msw-impl.h" #include "console-stream.h" #include "objects-msw.h"
--- a/src/device-tty.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/device-tty.c Thu Jun 20 21:19:10 2002 +0000 @@ -27,7 +27,7 @@ #include <config.h> #include "lisp.h" -#include "device.h" +#include "device-impl.h" #include "events.h" #include "faces.h" #include "frame.h" @@ -35,7 +35,7 @@ #include "redisplay.h" #include "sysdep.h" -#include "console-tty.h" +#include "console-tty-impl.h" #include "console-stream.h" #include "sysfile.h"
--- a/src/device-x.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/device-x.c Thu Jun 20 21:19:10 2002 +0000 @@ -31,16 +31,16 @@ #include "lisp.h" #include "buffer.h" -#include "device.h" +#include "device-impl.h" #include "elhash.h" #include "events.h" #include "faces.h" -#include "frame.h" +#include "frame-impl.h" #include "redisplay.h" #include "sysdep.h" #include "window.h" -#include "console-x.h" +#include "console-x-impl.h" #include "glyphs-x.h" #include "objects-x.h" @@ -63,7 +63,6 @@ #include "offix.h" #endif -Lisp_Object Vdefault_x_device; #ifdef MULE Lisp_Object Vx_app_defaults_directory; Lisp_Object Qget_coding_system_from_locale; @@ -626,8 +625,6 @@ speed_up_interrupts (); screen = DefaultScreen (dpy); - if (NILP (Vdefault_x_device)) - Vdefault_x_device = device; #ifdef MULE { @@ -915,22 +912,6 @@ #endif } - if (EQ (device, Vdefault_x_device)) - { - Lisp_Object devcons, concons; - /* #### handle deleting last X device */ - Vdefault_x_device = Qnil; - DEVICE_LOOP_NO_BREAK (devcons, concons) - { - if (DEVICE_X_P (XDEVICE (XCAR (devcons))) && - !EQ (device, XCAR (devcons))) - { - Vdefault_x_device = XCAR (devcons); - goto double_break; - } - } - } - double_break: free_x_device_struct (d); } @@ -1335,7 +1316,7 @@ if (DEVICEP (device) && !DEVICE_X_P (XDEVICE (device))) device = Qnil; if (NILP (device)) - device = Vdefault_x_device; + device = get_default_device (Qx); if (NILP (device)) { *display_out = 0; @@ -1644,10 +1625,11 @@ DEFUN ("default-x-device", Fdefault_x_device, 0, 0, 0, /* Return the default X device for resourcing. This is the first-created X device that still exists. +See also `default-device'. */ ()) { - return Vdefault_x_device; + return get_default_device (Qx); } DEFUN ("x-display-visual-class", Fx_display_visual_class, 0, 1, 0, /* @@ -2114,7 +2096,4 @@ #endif Fprovide (Qx); - - staticpro (&Vdefault_x_device); - Vdefault_x_device = Qnil; }
--- a/src/device.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/device.c Thu Jun 20 21:19:10 2002 +0000 @@ -32,12 +32,13 @@ #include "buffer.h" #include "console.h" -#include "device.h" +#include "device-impl.h" #include "elhash.h" #include "events.h" #include "faces.h" -#include "frame.h" +#include "frame-impl.h" #include "keymap.h" +#include "objects.h" #include "redisplay.h" #include "specifier.h" #include "sysdep.h" @@ -53,11 +54,13 @@ /* Vdefault_device is the firstly-created non-stream device that's still around. We don't really use it anywhere currently, but it might be used for resourcing at some point. (Currently we use - Vdefault_x_device.) */ + the default X device -- see Vdefault_device_plist.) */ Lisp_Object Vdefault_device; Lisp_Object Vcreate_device_hook, Vdelete_device_hook; +static Lisp_Object Vdefault_device_plist; + /* Device classes */ /* Qcolor defined in general.c */ Lisp_Object Qgrayscale, Qmono; @@ -173,9 +176,7 @@ d->font_instance_cache = make_lisp_hash_table (20, HASH_TABLE_KEY_WEAK, HASH_TABLE_EQUAL); #ifdef MULE - /* Note that the following table is bi-level. */ - d->charset_font_cache = - make_lisp_hash_table (20, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); + initialize_charset_font_caches (d); #endif /* Note that the image instance cache is actually bi-level. @@ -210,6 +211,24 @@ return DFW_DEVICE (object); } +Lisp_Object +device_console (struct device *d) +{ + return DEVICE_CONSOLE (d); +} + +int +device_live_p (struct device *d) +{ + return DEVICE_LIVE_P (d); +} + +Lisp_Object +device_frame_list (struct device *d) +{ + return DEVICE_FRAME_LIST (d); +} + DEFUN ("selected-device", Fselected_device, 0, 1, 0, /* Return the device which is currently active. @@ -333,8 +352,6 @@ return DEVICE_CONSOLE (decode_device (device)); } -#ifdef HAVE_WINDOW_SYSTEM - static void init_global_resources (struct device *d) { @@ -347,8 +364,6 @@ #endif } -#endif - static void init_device_resources (struct device *d) { @@ -361,6 +376,45 @@ #endif } +DEFUN ("default-device", Fdefault_device, 0, 1, 0, /* +Return the default device of type TYPE. +This is generally the first-created device of that TYPE that still exists. +It is used for resourcing and certain other things. On MS Windows, it +is not very useful because there is generally only one device. +If TYPE is omitted, it is derived from the selected device. +If there is no default device of TYPE, nil is returned. +*/ + (type)) +{ + if (NILP (type)) + type = XDEVICE_TYPE (Fselected_device (Qnil)); + else + /* For errors */ + decode_console_type (type, ERROR_ME); + + return Fplist_get (Vdefault_device_plist, type, Qnil); +} + +/* Return the default device for a device type. */ +Lisp_Object +get_default_device (Lisp_Object type) +{ + return Fplist_get (Vdefault_device_plist, type, Qnil); +} + +/* Set the default device for a device type. */ +void +set_default_device (Lisp_Object type, Lisp_Object device) +{ + Vdefault_device_plist = Fplist_put (Vdefault_device_plist, type, device); +} + +void +clear_default_devices (void) +{ + Vdefault_device_plist = Qnil; +} + static Lisp_Object semi_canonicalize_device_connection (struct console_methods *meths, Lisp_Object name, Error_Behavior errb) @@ -510,27 +564,16 @@ int speccount = specpdl_depth(); struct gcpro gcpro1, gcpro2, gcpro3; -#ifdef HAVE_X_WINDOWS - /* #### icky-poo. If this is the first X device we are creating, - then retrieve the global face resources. We have to do it - here, at the same time as (or just before) the device face - resources are retrieved; specifically, it needs to be done - after the device has been created but before any frames have - been popped up or much anything else has been done. It's - possible for other devices to specify different global - resources (there's a property on each X server's root window - that holds some resources); tough luck for the moment. - - This is a nasty violation of device independence, but - there's not a whole lot I can figure out to do about it. - The real problem is that the concept of resources is not - generalized away from X. Similar resource-related - device-independence violations occur in faces.el. */ - int first_x_device = NILP (Vdefault_x_device) && EQ (type, Qx); -#endif -#ifdef HAVE_GTK - int first_gtk_device = NILP (Vdefault_gtk_device) && EQ (type, Qgtk); -#endif + /* If this is the first device we are creating of a particular type + (e.g. X), then retrieve the global face resources. We have to do it + here, at the same time as (or just before) the device face resources + are retrieved; specifically, it needs to be done after the device has + been created but before any frames have been popped up or much + anything else has been done. It's possible for other devices to + specify different global resources (there's a property on each X + server's root window that holds some resources); tough luck for the + moment. */ + int first = NILP (get_default_device (type)); GCPRO3 (device, console, name); @@ -553,7 +596,7 @@ console = create_console (name, type, conconnect, props); } - record_unwind_protect(delete_deviceless_console, console); + record_unwind_protect (delete_deviceless_console, console); con = XCONSOLE (console); d = allocate_device (console); @@ -571,6 +614,10 @@ /* Do it this way so that the device list is in order of creation */ con->device_list = nconc2 (con->device_list, Fcons (device, Qnil)); + + if (NILP (get_default_device (type))) + set_default_device (type, device); + note_object_created (device); RESET_CHANGED_SET_FLAGS; @@ -578,25 +625,28 @@ Vdefault_device = device; init_device_sound (d); -#ifdef HAVE_X_WINDOWS - if (first_x_device) - init_global_resources (d); -#endif -#ifdef HAVE_GTK - if (first_gtk_device) - init_global_resources (d); -#endif - init_device_resources (d); - - MAYBE_DEVMETH (d, finish_init_device, (d, props)); /* If this is the first device on the console, make it the selected one. */ if (NILP (CONSOLE_SELECTED_DEVICE (con))) CONSOLE_SELECTED_DEVICE (con) = device; - /* #### the following should trap errors. */ + /* Needed before initialization of resources because they may do things + with the tags, esp. the face code. For example, + init-other-random-faces calls face-property-instance, and the + specifier code checks inst-pairs by seeing if the device matches the + tag; this fails for tags such as `default', if we haven't set up the + tags yet. */ setup_device_initial_specifier_tags (d); + if (!EQ (type, Qstream)) + { + if (first) + init_global_resources (d); + init_device_resources (d); + } + + MAYBE_DEVMETH (d, finish_init_device, (d, props)); + UNGCPRO; unbind_to (speccount); return device; @@ -807,6 +857,29 @@ MAYBE_DEVMETH (d, delete_device, (d)); + /* Now see if we're the default device, and thus need to be changed. */ + { + /* Device type still OK, not set to null till down below. */ + Lisp_Object dt = DEVICE_TYPE (d); + + if (EQ (device, get_default_device (dt))) + { + Lisp_Object devcons, concons; + /* #### handle deleting last device */ + set_default_device (dt, Qnil); + DEVICE_LOOP_NO_BREAK (devcons, concons) + { + if (EQ (dt, XDEVICE_TYPE (XCAR (devcons))) && + !EQ (device, XCAR (devcons))) + { + set_default_device (dt, XCAR (devcons)); + goto double_break; + } + } + } + } + double_break: + CONSOLE_DEVICE_LIST (c) = delq_no_quit (device, CONSOLE_DEVICE_LIST (c)); RESET_CHANGED_SET_FLAGS; @@ -1219,7 +1292,7 @@ return Qnil; } -void +Lisp_Object call_critical_lisp_code (struct device *d, Lisp_Object function, Lisp_Object object) { @@ -1227,6 +1300,7 @@ int count = begin_gc_forbidden (); struct gcpro gcpro1; Lisp_Object args[3]; + Lisp_Object retval; specbind (Qinhibit_quit, Qt); record_unwind_protect (unlock_device, wrap_device (d)); @@ -1248,11 +1322,11 @@ /* It's useful to have an error handler; otherwise an infinite loop may result. */ - Fcall_with_condition_handler (!NILP (object) ? 3 : 2, args); + retval = Fcall_with_condition_handler (!NILP (object) ? 3 : 2, args); UNGCPRO; - unbind_to (count); + return unbind_to_1 (count, retval); } @@ -1280,6 +1354,7 @@ DEFSUBR (Ffind_device); DEFSUBR (Fget_device); DEFSUBR (Fmake_device); + DEFSUBR (Fdefault_device); DEFSUBR (Fdelete_device); DEFSUBR (Fdevice_frame_list); DEFSUBR (Fdevice_class); @@ -1369,6 +1444,10 @@ */ ); Vdelete_device_hook = Qnil; + /* Plist of device types and their default devices. */ + Vdefault_device_plist = Qnil; + staticpro (&Vdefault_device_plist); + Vdevice_class_list = list3 (Qcolor, Qgrayscale, Qmono); staticpro (&Vdevice_class_list);
--- a/src/device.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/device.h Thu Jun 20 21:19:10 2002 +0000 @@ -1,6 +1,6 @@ /* Define device-object for XEmacs. Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. - Copyright (C) 1995 Ben Wing + Copyright (C) 1995, 2002 Ben Wing Copyright (C) 1995 Sun Microsystems This file is part of XEmacs. @@ -29,112 +29,7 @@ #include "console.h" -/* This should really be in redisplay.h but by putting it here we - won't have to ensure that redisplay.h is always included before - this file. */ -struct pixel_to_glyph_translation_cache -{ - unsigned int valid :1; - struct frame *frame; - int low_x_coord, high_x_coord, col, obj_x; - int low_y_coord, high_y_coord, row, obj_y; - struct window *w; - Charbpos charpos; - Charbpos closest; - Charcount modeline_closest; - Lisp_Object obj1, obj2; - int retval; -}; - -#define DEVICE_TYPE_NAME(d) ((d)->devmeths->name) -#define DEVICE_TYPE(d) ((d)->devmeths->symbol) -#define DEVICE_IMPL_FLAG(d, f) CONMETH_IMPL_FLAG ((d)->devmeths, (f)) -#define DEVICE_SPECIFIC_FRAME_PROPS(d) \ - ((d)->devmeths->device_specific_frame_props) - -/******** Accessing / calling a device method *********/ - -#define HAS_DEVMETH_P(d, m) HAS_CONTYPE_METH_P ((d)->devmeths, m) -#define DEVMETH(d, m, args) CONTYPE_METH ((d)->devmeths, m, args) -#define MAYBE_DEVMETH(d, m, args) MAYBE_CONTYPE_METH ((d)->devmeths, m, args) -#define DEVMETH_OR_GIVEN(d, m, args, given) \ - CONTYPE_METH_OR_GIVEN((d)->devmeths, m, args, given) -#define MAYBE_INT_DEVMETH(d, m, args) \ - MAYBE_INT_CONTYPE_METH ((d)->devmeths, m, args) -#define MAYBE_LISP_DEVMETH(d, m, args) \ - MAYBE_LISP_CONTYPE_METH ((d)->devmeths, m, args) - -struct device -{ - struct lcrecord_header header; - - /* Methods for this device's console. This can also be retrieved - through device->console, but it's faster this way. */ - struct console_methods *devmeths; - - /* A structure of auxiliary data specific to the device type. - struct x_device is used for X window frames; defined in console-x.h - struct tty_device is used to TTY's; defined in console-tty.h */ - void *device_data; - - /* redisplay flags */ - unsigned int buffers_changed :1; - unsigned int clip_changed :1; - unsigned int extents_changed :1; - unsigned int faces_changed :1; - unsigned int frame_changed :1; - unsigned int glyphs_changed :1; - unsigned int subwindows_changed :1; - unsigned int subwindows_state_changed :1; - unsigned int icon_changed :1; - unsigned int menubar_changed :1; - unsigned int modeline_changed :1; - unsigned int point_changed :1; - unsigned int size_changed :1; - unsigned int gutter_changed :1; - unsigned int toolbar_changed :1; - unsigned int windows_changed :1; - unsigned int windows_structure_changed :1; - - unsigned int locked :1; - - /* Cache information about last pixel position translated to a - glyph. The law of locality applies very heavily here so caching - the value leads to a significant win. At the moment this is - really X specific but once we have generic mouse support it won't - be. */ - struct pixel_to_glyph_translation_cache pixel_to_glyph_cache; - - /* Output baud rate of device; used for redisplay decisions. */ - int baud_rate; - - /* sound flags */ - unsigned int on_console_p :1; - unsigned int connected_to_nas_p :1; - -#define MARKED_SLOT(x) Lisp_Object x -#include "devslots.h" - - /* File descriptors for input and output. Much of the time - (but not always) these will be the same. For an X device, - these both hold the file descriptor of the socket used - to communicate with the X server. For a TTY device, these - may or may not be the same and point to the terminal that - is used for I/O. */ - int infd, outfd; - - /* infd and outfd are moved outside HAVE_UNIXOID_EVENT_LOOP conditionals, - because Win32, presumably the first port which does not use select() - polling, DOES have handles for a console device. -- kkm */ - -#ifdef HAVE_UNIXOID_EVENT_LOOP - /* holds some data necessary for SIGIO control. Perhaps this should - be inside of device_data; but it is used for both TTY's and X - device. Perhaps it should be conditionalized on SIGIO; but - this requires including syssignal.h. */ - int old_fcntl_owner; -#endif -}; +struct device; DECLARE_LRECORD (device, struct device); #define XDEVICE(x) XRECORD (x, device, struct device) @@ -143,6 +38,22 @@ #define CHECK_DEVICE(x) CHECK_RECORD (x, device) #define CONCHECK_DEVICE(x) CONCHECK_RECORD (x, device) +/* Basic properties available to non-privileged users; redefined in + device-impl.h */ + +int device_live_p (struct device *d); +Lisp_Object device_console (struct device *d); +Lisp_Object device_frame_list (struct device *d); + +#define DEVICE_LIVE_P(d) device_live_p (d) +#define DEVICE_CONSOLE(d) device_console (d) +#define DEVICE_FRAME_LIST(d) device_frame_list (d) + +#define DEVICE_XCONSOLE(d) XCONSOLE (DEVICE_CONSOLE (d)) + +#define XDEVICE_CONSOLE(d) DEVICE_CONSOLE (XDEVICE (d)) +#define XDEVICE_XCONSOLE(d) XCONSOLE (XDEVICE_XCONSOLE (d)) + #define CHECK_LIVE_DEVICE(x) do { \ CHECK_DEVICE (x); \ if (! DEVICE_LIVE_P (XDEVICE (x))) \ @@ -154,200 +65,6 @@ x = wrong_type_argument (Qdevice_live_p, (x)); \ } while (0) -#define DEVICE_TYPE_P(d, type) EQ (DEVICE_TYPE (d), Q##type) - -#ifdef ERROR_CHECK_TYPES -DECLARE_INLINE_HEADER ( -struct device * -error_check_device_type (struct device *d, Lisp_Object sym) -) -{ - assert (EQ (DEVICE_TYPE (d), sym)); - return d; -} -# define DEVICE_TYPE_DATA(d, type) \ - ((struct type##_device *) error_check_device_type (d, Q##type)->device_data) -#else -# define DEVICE_TYPE_DATA(d, type) \ - ((struct type##_device *) (d)->device_data) -#endif - -#define CHECK_DEVICE_TYPE(x, type) \ - do { \ - CHECK_DEVICE (x); \ - if (!(DEVICEP (x) && DEVICE_TYPE_P (XDEVICE (x), \ - type))) \ - dead_wrong_type_argument \ - (type##_console_methods->predicate_symbol, x); \ - } while (0) -#define CONCHECK_DEVICE_TYPE(x, type) \ - do { \ - CONCHECK_DEVICE (x); \ - if (!(DEVICEP (x) && DEVICE_TYPE_P (XDEVICE (x), \ - type))) \ - x = wrong_type_argument \ - (type##_console_methods->predicate_symbol, x); \ - } while (0) - -#define DEVICE_DISPLAY_P(dev) \ - (DEVICE_LIVE_P (dev) && \ - !DEVICE_IMPL_FLAG (dev, XDEVIMPF_IS_A_PRINTER)) - -#define CHECK_DISPLAY_DEVICE(dev) \ - do { \ - CHECK_DEVICE (dev); \ - if (!(DEVICEP (dev) \ - && DEVICE_DISPLAY_P (XDEVICE (dev)))) \ - dead_wrong_type_argument (Qdisplay, dev); \ - } while (0) - -#define CONCHECK_DISPLAY_DEVICE(dev) \ - do { \ - CONCHECK_DEVICE (dev); \ - if (!(DEVICEP (dev) \ - && DEVICE_DISPLAY_P (XDEVICE (dev)))) \ - wrong_type_argument (Qdisplay, dev); \ - } while (0) - -#define DEVICE_PRINTER_P(dev) \ - (DEVICE_LIVE_P (dev) && !DEVICE_DISPLAY_P (dev)) - -#define CHECK_PRINTER_DEVICE(dev) \ - do { \ - CHECK_DEVICE (dev); \ - if (!(DEVICEP (dev) \ - && DEVICE_PRINTER_P (XDEVICE (dev)))) \ - dead_wrong_type_argument (Qprinter, dev); \ - } while (0) - -#define CONCHECK_PRINTER_DEVICE(dev) \ - do { \ - CONCHECK_DEVICE (dev); \ - if (!(DEVICEP (dev) \ - && DEVICE_PRINTER_P (XDEVICE (dev)))) \ - wrong_type_argument (Qprinter, dev); \ - } while (0) - -/* #### These should be in the device-*.h files but there are - too many places where the abstraction is broken. Need to - fix. */ - -#define DEVICE_X_P(dev) CONSOLE_TYPESYM_X_P (DEVICE_TYPE (dev)) -#define CHECK_X_DEVICE(z) CHECK_DEVICE_TYPE (z, x) -#define CONCHECK_X_DEVICE(z) CONCHECK_DEVICE_TYPE (z, x) - -#define DEVICE_GTK_P(dev) CONSOLE_TYPESYM_GTK_P (DEVICE_TYPE (dev)) -#define CHECK_GTK_DEVICE(z) CHECK_DEVICE_TYPE (z, gtk) -#define CONCHECK_GTK_DEVICE(z) CONCHECK_DEVICE_TYPE (z, gtk) - -#define DEVICE_MSWINDOWS_P(dev) CONSOLE_TYPESYM_MSWINDOWS_P (DEVICE_TYPE (dev)) -#define CHECK_MSWINDOWS_DEVICE(z) CHECK_DEVICE_TYPE (z, mswindows) -#define CONCHECK_MSWINDOWS_DEVICE(z) CONCHECK_DEVICE_TYPE (z, mswindows) - -#define DEVICE_TTY_P(dev) CONSOLE_TYPESYM_TTY_P (DEVICE_TYPE (dev)) -#define CHECK_TTY_DEVICE(z) CHECK_DEVICE_TYPE (z, tty) -#define CONCHECK_TTY_DEVICE(z) CONCHECK_DEVICE_TYPE (z, tty) - -#define DEVICE_STREAM_P(dev) CONSOLE_TYPESYM_STREAM_P (DEVICE_TYPE (dev)) -#define CHECK_STREAM_DEVICE(z) CHECK_DEVICE_TYPE (z, stream) -#define CONCHECK_STREAM_DEVICE(z) CONCHECK_DEVICE_TYPE (z, stream) - -#define DEVICE_WIN_P(dev) CONSOLE_TYPESYM_WIN_P (DEVICE_TYPE (dev)) - -EXFUN (Fdevice_console, 1); -EXFUN (Fdevice_name, 1); -EXFUN (Ffind_device, 2); -EXFUN (Fmake_device, 3); -EXFUN (Fselected_device, 1); - -extern Lisp_Object Qcreate_device_hook, Qdelete_device_hook, Qgrayscale; -extern Lisp_Object Qinit_post_tty_win, Qmono, Vdefault_x_device, Vdefault_gtk_device; -extern Lisp_Object Vdevice_class_list; - -int valid_device_class_p (Lisp_Object class); - -#define DEVICE_LIVE_P(d) (!EQ (DEVICE_TYPE (d), Qdead)) - -#define DEVICE_REDISPLAY_INFO(d) ((d)->redisplay_info) - -#define DEVICE_NAME(d) ((d)->name) -#define DEVICE_CLASS(d) ((d)->device_class) -/* Catch people attempting to set this. */ -#define DEVICE_SELECTED_FRAME(d) NON_LVALUE ((d)->selected_frame) -#define DEVICE_FRAME_WITH_FOCUS_REAL(d) ((d)->frame_with_focus_real) -#define DEVICE_FRAME_WITH_FOCUS_FOR_HOOKS(d) ((d)->frame_with_focus_for_hooks) -#define DEVICE_FRAME_THAT_OUGHT_TO_HAVE_FOCUS(d) \ - ((d)->frame_that_ought_to_have_focus) -#define DEVICE_USER_DEFINED_TAGS(d) ((d)->user_defined_tags) -#define DEVICE_FRAME_LIST(d) ((d)->frame_list) -#define DEVICE_CONNECTION(d) ((d)->connection) -#define DEVICE_CANON_CONNECTION(d) ((d)->canon_connection) -#define DEVICE_CONSOLE(d) ((d)->console) -#define DEVICE_BAUD_RATE(d) ((d)->baud_rate) -#define DEVICE_INFD(d) ((d)->infd) -#define DEVICE_OUTFD(d) ((d)->outfd) -#define DEVICE_OLD_FCNTL_OWNER(d) ((d)->old_fcntl_owner) -#define DEVICE_ON_CONSOLE_P(d) ((d)->on_console_p) -#define DEVICE_CONNECTED_TO_NAS_P(d) ((d)->connected_to_nas_p) - -#define LOCK_DEVICE(d) ((void) ((d)->locked = 1)) -#define UNLOCK_DEVICE(d) ((void) ((d)->locked = 0)) - -#define INVALIDATE_DEVICE_PIXEL_TO_GLYPH_CACHE(d) \ - ((void) ((d)->pixel_to_glyph_cache.valid = 0)) - -#define INVALIDATE_PIXEL_TO_GLYPH_CACHE do { \ - Lisp_Object IPTGC_devcons, IPTGC_concons; \ - DEVICE_LOOP_NO_BREAK (IPTGC_devcons, IPTGC_concons) \ - INVALIDATE_DEVICE_PIXEL_TO_GLYPH_CACHE (XDEVICE (XCAR (IPTGC_devcons))); \ -} while (0) - -#define MARK_DEVICE_FACES_CHANGED(d) \ - ((void) (faces_changed = (d)->faces_changed = 1)) - -#define MARK_DEVICE_GLYPHS_CHANGED(d) \ - ((void) (glyphs_changed = (d)->glyphs_changed = 1)) - -#define MARK_DEVICE_SUBWINDOWS_CHANGED(d) \ - ((void) (subwindows_changed = (d)->subwindows_changed = 1)) - -#define MARK_DEVICE_SUBWINDOWS_STATE_CHANGED(d) \ - ((void) (subwindows_state_changed = (d)->subwindows_state_changed = 1)) - -#define MARK_DEVICE_TOOLBARS_CHANGED(d) \ - ((void) (toolbar_changed = (d)->toolbar_changed = 1)) - -#define MARK_DEVICE_GUTTERS_CHANGED(d) \ - ((void) (gutter_changed = (d)->gutter_changed = 1)) - -#define MARK_DEVICE_SIZE_CHANGED(d) \ - ((void) (size_changed = (d)->size_changed = 1)) - -#define MARK_DEVICE_FRAMES_FACES_CHANGED(d) do { \ - struct device *mdffc_d = (d); \ - Lisp_Object frmcons; \ - DEVICE_FRAME_LOOP (frmcons, mdffc_d) \ - XFRAME (XCAR (frmcons))->faces_changed = 1; \ - MARK_DEVICE_FACES_CHANGED (mdffc_d); \ -} while (0) - -#define MARK_DEVICE_FRAMES_GLYPHS_CHANGED(d) do { \ - struct device *mdffc_d = (d); \ - Lisp_Object frmcons; \ - DEVICE_FRAME_LOOP (frmcons, mdffc_d) \ - XFRAME (XCAR (frmcons))->glyphs_changed = 1; \ - MARK_DEVICE_GLYPHS_CHANGED (mdffc_d); \ -} while (0) - -#define MARK_DEVICE_FRAME_CHANGED(d) \ - ((void) (frame_changed = (d)->frame_changed = 1)) - -#define MARK_DEVICE_WINDOWS_CHANGED(d) \ - ((void) (windows_changed = (d)->windows_changed = 1)) - -#define MARK_DEVICE_WINDOWS_STRUCTURE_CHANGED(d) \ - ((void) (windows_structure_changed = (d)->windows_structure_changed = 1)) - /* #### unify this with DOMAIN_DEVICE once the latter has image instances expunged from it. */ /* This turns out to be used heavily so we make it a macro to make it @@ -371,11 +88,23 @@ CONSOLE_DEVICE_LOOP (devcons, con) \ DEVICE_FRAME_LOOP (frmcons, XDEVICE (XCAR (devcons))) +EXFUN (Fdevice_console, 1); +EXFUN (Fdevice_name, 1); +EXFUN (Ffind_device, 2); +EXFUN (Fmake_device, 3); +EXFUN (Fselected_device, 1); + +extern Lisp_Object Qcreate_device_hook, Qdelete_device_hook, Qgrayscale; +extern Lisp_Object Qinit_post_tty_win, Qmono; +extern Lisp_Object Vdevice_class_list; + +int valid_device_class_p (Lisp_Object class); + void select_device_1 (Lisp_Object); struct device *decode_device (Lisp_Object); void handle_asynch_device_change (void); -void call_critical_lisp_code (struct device *d, Lisp_Object function, - Lisp_Object object); +Lisp_Object call_critical_lisp_code (struct device *d, Lisp_Object function, + Lisp_Object object); void delete_device_internal (struct device *d, int force, int called_from_delete_console, int from_io_error); @@ -385,4 +114,8 @@ Lisp_Object domain_device_type (Lisp_Object domain); int window_system_pixelated_geometry (Lisp_Object domain); +Lisp_Object get_default_device (Lisp_Object type); +void set_default_device (Lisp_Object type, Lisp_Object device); +void clear_default_devices (void); + #endif /* INCLUDED_device_h_ */
--- a/src/devslots.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/devslots.h Thu Jun 20 21:19:10 2002 +0000 @@ -1,5 +1,6 @@ /* Definitions of marked slots in consoles Copyright (C) 1990, 1992, 1993 Free Software Foundation, Inc. + Copyright (C) 2002 Ben Wing. This file is part of XEmacs. @@ -104,7 +105,10 @@ given charset's registry. This speeds up the horrendously slow XListFonts() operation that needs to be done in order to determine an appropriate font. */ - MARKED_SLOT (charset_font_cache); + MARKED_SLOT (charset_font_cache_stage_1); + + /* Similar cache for stage 2, if it exists. See objects.c. */ + MARKED_SLOT (charset_font_cache_stage_2); #endif /* This is a bi-level cache, where the hash table in this slot here
--- a/src/dialog-gtk.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/dialog-gtk.c Thu Jun 20 21:19:10 2002 +0000 @@ -24,9 +24,6 @@ #include <config.h> #include "lisp.h" -#include "console-gtk.h" -#include "gui-gtk.h" - #include "buffer.h" #include "commands.h" /* zmacs_regions */ #include "events.h" @@ -35,6 +32,9 @@ #include "opaque.h" #include "window.h" +#include "console-gtk.h" +#include "gui-gtk.h" + Lisp_Object Qgtk_make_dialog_box_internal; /* We just bounce up into lisp here... see $(srcdir)/lisp/dialog-gtk.el */
--- a/src/dialog-msw.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/dialog-msw.c Thu Jun 20 21:19:10 2002 +0000 @@ -32,11 +32,12 @@ #include "lisp.h" #include "buffer.h" -#include "console-msw.h" -#include "frame.h" +#include "frame-impl.h" #include "gui.h" #include "opaque.h" +#include "console-msw-impl.h" + #include "sysfile.h" Lisp_Object Qdialog_box_error;
--- a/src/dialog-x.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/dialog-x.c Thu Jun 20 21:19:10 2002 +0000 @@ -27,18 +27,18 @@ #include <config.h> #include "lisp.h" -#include "console-x.h" -#include "EmacsFrame.h" -#include "gui-x.h" - #include "buffer.h" #include "commands.h" /* zmacs_regions */ #include "events.h" -#include "frame.h" +#include "frame-impl.h" #include "gui.h" #include "opaque.h" #include "window.h" +#include "console-x-impl.h" +#include "gui-x.h" + +#include "EmacsFrame.h" static void maybe_run_dbox_text_callback (LWLIB_ID id)
--- a/src/dialog.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/dialog.c Thu Jun 20 21:19:10 2002 +0000 @@ -25,8 +25,7 @@ #include <config.h> #include "lisp.h" -#include "frame.h" -#include "device.h" +#include "frame-impl.h" Lisp_Object Vdelete_dialog_box_hook; Lisp_Object Qdelete_dialog_box_hook; @@ -40,15 +39,14 @@ (type, keys)) { struct frame *f = selected_frame (); - struct device *d = XDEVICE (f->device); CHECK_SYMBOL (type); - if (!HAS_DEVMETH_P (d, make_dialog_box_internal)) + if (!HAS_FRAMEMETH_P (f, make_dialog_box_internal)) signal_error (Qunimplemented, - "Device does not support dialogs", f->device); + "Device does not support dialogs", FRAME_DEVICE (f)); - return DEVMETH (d, make_dialog_box_internal, (f, type, keys)); + return FRAMEMETH (f, make_dialog_box_internal, (f, type, keys)); } void
--- a/src/dired-msw.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/dired-msw.c Thu Jun 20 21:19:10 2002 +0000 @@ -78,13 +78,15 @@ #include "regex.h" #include "syntax.h" +#include "console-msw.h" + #include "sysdir.h" #include "sysfile.h" #include "sysfloat.h" #include "sysproc.h" #include "syspwd.h" #include "systime.h" -#include "syswindows.h" + static int mswindows_ls_sort_case_insensitive; static Fixnum mswindows_ls_round_file_size;
--- a/src/editfns.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/editfns.c Thu Jun 20 21:19:10 2002 +0000 @@ -32,13 +32,12 @@ #include "buffer.h" #include "casetab.h" #include "chartab.h" -#include "commands.h" #include "device.h" #include "events.h" /* for EVENTP */ -#include "extents.h" #include "frame.h" #include "insdel.h" #include "line-number.h" +#include "process.h" #include "window.h" #include "sysdep.h"
--- a/src/emacs.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/emacs.c Thu Jun 20 21:19:10 2002 +0000 @@ -273,7 +273,7 @@ #endif #if defined (WIN32_NATIVE) || defined (CYGWIN) -#include "syswindows.h" +#include "console-msw.h" #endif /* For PATH_EXEC */
--- a/src/eval.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/eval.c Thu Jun 20 21:19:10 2002 +0000 @@ -142,7 +142,7 @@ #include "backtrace.h" #include "bytecode.h" #include "buffer.h" -#include "console.h" +#include "console-impl.h" #include "device.h" #include "frame.h" #include "lstream.h" @@ -457,17 +457,6 @@ return Qwarning; } -/* unwind-protect used by call_debugger() to restore the value of - entering_debugger. (We cannot use specbind() because the - variable is not Lisp-accessible.) */ - -static Lisp_Object -restore_entering_debugger (Lisp_Object arg) -{ - entering_debugger = ! NILP (arg); - return arg; -} - /* Actually call the debugger. ARG is a list of args that will be passed to the debugger function, as follows; @@ -2124,7 +2113,10 @@ that won't get signalled for errors occurring when call_with_suspended_errors() was invoked. */ -static void +/* Don't make static or it might be compiled away */ +void signal_1 (void); + +void signal_1 (void) { } @@ -6006,7 +5998,10 @@ entering_debugger = 0; - Vprint_level = make_int (3); + if (!NILP (detailed)) + Vprint_level = make_int (50); + else + Vprint_level = make_int (3); print_readably = 0; print_escape_newlines = 1;
--- a/src/event-Xt.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/event-Xt.c Thu Jun 20 21:19:10 2002 +0000 @@ -28,11 +28,11 @@ #include "blocktype.h" #include "charset.h" #include "console.h" -#include "device.h" +#include "device-impl.h" #include "elhash.h" #include "events.h" #include "file-coding.h" -#include "frame.h" +#include "frame-impl.h" #include "glyphs.h" #include "lstream.h" #include "process.h" @@ -41,7 +41,7 @@ #include "console-tty.h" -#include "console-x.h" +#include "console-x-impl.h" #include "objects-x.h" #include "../lwlib/lwlib.h" #include "EmacsFrame.h" @@ -1680,10 +1680,12 @@ if (!FRAME_VISIBLE_P (f) && is_visible) { FRAME_VISIBLE_P (f) = is_visible; - /* This improves the double flicker when uniconifying a frame + /* [[ This improves the double flicker when uniconifying a frame some. A lot of it is not showing a buffer which has changed while the frame was iconified. To fix it further requires - the good 'ol double redisplay structure. */ + the good 'ol double redisplay structure. ]] -- comment is + invalid, obviously predates 19.12, when the double redisplay + structure (i.e. current + desired) was put back in. --ben */ MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (f); va_run_hook_with_args (Qmap_frame_hook, 1, frame); }
--- a/src/event-gtk.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/event-gtk.c Thu Jun 20 21:19:10 2002 +0000 @@ -28,30 +28,30 @@ #include <config.h> #include "lisp.h" -#include "console-gtk.h" - #include "blocktype.h" #include "buffer.h" #include "commands.h" #include "console.h" -#include "console-tty.h" +#include "device-impl.h" +#include "elhash.h" #include "events.h" -#include "frame.h" -#include "objects-gtk.h" +#include "file-coding.h" +#include "frame-impl.h" +#include "lstream.h" #include "process.h" #include "redisplay.h" -#include "elhash.h" #include "window.h" -#include "device.h" + +#include "console-tty.h" + +#include "console-gtk-impl.h" +#include "objects-gtk.h" #include "gtk-xemacs.h" #include "systime.h" #include "sysproc.h" /* for MAXDESC */ -#include "lstream.h" -#include "file-coding.h" - #include <gdk/gdkkeysyms.h> #ifdef HAVE_DRAGNDROP @@ -150,10 +150,12 @@ if (!FRAME_VISIBLE_P (f) && is_visible) { FRAME_VISIBLE_P (f) = is_visible; - /* This improves the double flicker when uniconifying a frame + /* [[ This improves the double flicker when uniconifying a frame some. A lot of it is not showing a buffer which has changed while the frame was iconified. To fix it further requires - the good 'ol double redisplay structure. */ + the good 'ol double redisplay structure. ]] -- comment is + invalid, obviously predates 19.12, when the double redisplay + structure (i.e. current + desired) was put back in. --ben */ MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (f); va_run_hook_with_args (Qmap_frame_hook, 1, frame); } @@ -1206,9 +1208,11 @@ struct gtk_device *gd = NULL; gboolean accept_any_window = FALSE; + /* #### Under what circumstances can this happen???? Hunt out the code that + sets frame to 0 and fix it instead. */ if (!frame) { - frame = XFRAME (Fselected_frame (Vdefault_gtk_device)); + frame = XFRAME (Fselected_frame (get_default_device (Qgtk))); accept_any_window = TRUE; }
--- a/src/event-msw.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/event-msw.c Thu Jun 20 21:19:10 2002 +0000 @@ -62,10 +62,10 @@ #endif #include "buffer.h" -#include "device.h" +#include "device-impl.h" #include "events.h" #include "faces.h" -#include "frame.h" +#include "frame-impl.h" #include "glyphs.h" #include "lstream.h" #include "process.h" @@ -73,8 +73,8 @@ #include "sysdep.h" #include "window.h" -#include "console-msw.h" -#include "objects-msw.h" +#include "console-msw-impl.h" +#include "objects-msw-impl.h" #ifdef HAVE_SCROLLBARS # include "scrollbar-msw.h"
--- a/src/event-stream.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/event-stream.c Thu Jun 20 21:19:10 2002 +0000 @@ -75,17 +75,17 @@ #include "blocktype.h" #include "buffer.h" #include "commands.h" -#include "device.h" +#include "device-impl.h" #include "elhash.h" #include "events.h" -#include "frame.h" +#include "frame-impl.h" #include "insdel.h" /* for buffer_reset_changes */ #include "keymap.h" #include "lstream.h" #include "macros.h" /* for defining_keyboard_macro */ #include "menubar.h" /* #### for evil kludges. */ #include "process.h" -#include "window.h" +#include "window-impl.h" #include "sysdep.h" /* init_poll_for_quit() */ #include "syssignal.h" /* SIGCHLD, etc. */
--- a/src/event-tty.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/event-tty.c Thu Jun 20 21:19:10 2002 +0000 @@ -26,7 +26,7 @@ #include "lisp.h" #include "device.h" -#include "console-tty.h" +#include "console-tty-impl.h" #include "events.h" #include "frame.h" #include "process.h"
--- a/src/event-unixoid.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/event-unixoid.c Thu Jun 20 21:19:10 2002 +0000 @@ -29,8 +29,8 @@ #include <config.h> #include "lisp.h" -#include "console-stream.h" -#include "console-tty.h" +#include "console-stream-impl.h" +#include "console-tty-impl.h" #include "device.h" #include "events.h" #include "lstream.h"
--- a/src/events.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/events.c Thu Jun 20 21:19:10 2002 +0000 @@ -31,7 +31,7 @@ #include "device.h" #include "extents.h" #include "events.h" -#include "frame.h" +#include "frame-impl.h" #include "glyphs.h" #include "keymap.h" /* for key_desc_list_to_event() */ #include "lstream.h" @@ -39,7 +39,7 @@ #include "toolbar.h" #include "window.h" -#include "console-tty.h" /* for stuff in character_to_event */ +#include "console-tty-impl.h" /* for stuff in character_to_event */ /* Where old events go when they are explicitly deallocated. The event chain here is cut loose before GC, so these will be freed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/extents-impl.h Thu Jun 20 21:19:10 2002 +0000 @@ -0,0 +1,293 @@ +/* Copyright (c) 1994, 1995 Free Software Foundation. + Copyright (c) 1995, 1996, 2002 Ben Wing. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +#ifndef INCLUDED_extents_impl_h_ +#define INCLUDED_extents_impl_h_ + +#include "extents.h" + +struct extent +{ + struct lrecord_header lheader; + + Memxpos start; + Memxpos end; + Lisp_Object object; /* A buffer, string, Qnil (extent detached from no + buffer), Qt (destroyed extent) */ + + /* Extent properties are conceptually a plist, but the most common + props are implemented as bits instead of conses. */ + struct + { + Lisp_Object face; + + /* These flags are simply an optimization for common boolean properties + which go onto the extent's property list. Any of them would work if + done in the normal way, but the space savings of doing these in this + way is significant. Note that if you add a flag, there are numerous + places in extents.c that need to know about it. + + Another consideration is that some of these properties are accessed + during redisplay, so it's good for access to them to be fast (a bit + reference instead of a search down a plist). + + `begin_glyph_layout' and `end_glyph_layout' are unusual in that + they have 4 states instead of 2. + + Other special extent properties are stored in an auxiliary + structure that sits at the beginning of the plist. The has_aux + flag indicates whether this structure exists. The has_parent + flag is an optimization indicating whether the extent has a parent + (this could also be determined by looking in the aux structure). */ + + enum_field (glyph_layout) begin_glyph_layout :2; + /* 2 text, margins, or whitespace */ + enum_field (glyph_layout) end_glyph_layout :2; + /* 4 text, margins, or whitespace */ + unsigned int has_parent :1; /* 5 extent has a parent */ + unsigned int has_aux :1; /* 6 extent has an aux. structure */ + unsigned int start_open :1; /* 7 insertion behavior at start */ + unsigned int end_open :1; /* 8 insertion behavior at end */ + unsigned int unique :1; /* 9 there may be only one attached */ + unsigned int duplicable :1; /* 10 copied to strings by kill/undo */ + unsigned int detachable :1; /* 11 extent detaches if text deleted */ + unsigned int internal :1; /* 12 used by map-extents etc. */ + unsigned int in_red_event :1; /* 13 An event has been spawned for + initial redisplay. + (not exported to lisp) */ + unsigned int unused16 :1; /* 16 unused bits */ + /* --- Adding more flags will cause the extent struct to grow by another + word. It's not clear that this would make a difference, however, + because on 32-bit machines things tend to get allocated in chunks + of 4 bytes. */ + } flags; + /* The plist may have an auxiliary structure as its first element */ + Lisp_Object plist; +}; + +/* Basic properties of an extent (not affected by the extent's parent) */ +#define extent_object(e) ((e)->object) +#define extent_start(e) ((e)->start + 0) +#define extent_end(e) ((e)->end + 0) +#define set_extent_start(e, val) ((void) ((e)->start = (val))) +#define set_extent_end(e, val) ((void) ((e)->end = (val))) +#define extent_endpoint(e, endp) ((endp) ? extent_end (e) : extent_start (e)) +#define set_extent_endpoint(e, val, endp) \ + ((endp) ? set_extent_end (e, val) : set_extent_start (e, val)) +#define extent_detached_p(e) (extent_start (e) < 0) + +/* Additional information that may be present in an extent. The idea is + that fast access is provided to this information, but since (hopefully) + most extents won't have this set on them, we usually don't need to + have this structure around and thus the size of an extent is smaller. */ + +typedef struct extent_auxiliary extent_auxiliary; +struct extent_auxiliary +{ + struct lcrecord_header header; + + Lisp_Object begin_glyph; + Lisp_Object end_glyph; + Lisp_Object parent; + /* We use a weak list here. Originally I didn't do this and + depended on having the extent's finalization method remove + itself from its parent's children list. This runs into + lots and lots of problems though because everything is in + a really really bizarre state when an extent's finalization + method is called (it happens in sweep_extents() by way of + ADDITIONAL_FREE_extent()) and it's extremely difficult to + avoid getting hosed by just-freed objects. */ + Lisp_Object children; + Lisp_Object invisible; + Lisp_Object read_only; + Lisp_Object mouse_face; + Lisp_Object initial_redisplay_function; + Lisp_Object before_change_functions, after_change_functions; + int priority; +}; + +extern struct extent_auxiliary extent_auxiliary_defaults; + +struct extent_info +{ + struct lcrecord_header header; + + struct extent_list *extents; + struct stack_of_extents *soe; +}; + +/* A "normal" field is one that is stored in the `struct flags' structure + in an extent. an "aux" field is one that is stored in the extent's + auxiliary structure. + + The functions below that have `extent_no_chase' in their name operate + on an extent directly (ignoring its parent), and should normally + only be used on extents known not to have a parent. The other + versions chase down any parent links. */ + +#define extent_no_chase_normal_field(e, field) ((e)->flags.field) + +DECLARE_INLINE_HEADER ( +struct extent_auxiliary * +extent_aux_or_default (EXTENT e) +) +{ + return e->flags.has_aux ? + XEXTENT_AUXILIARY (XCAR (e->plist)) : + & extent_auxiliary_defaults; +} + +#define extent_no_chase_aux_field(e, field) (extent_aux_or_default(e)->field) + +#define extent_normal_field(e, field) \ + extent_no_chase_normal_field (extent_ancestor (e), field) + +#define extent_aux_field(e, field) \ + extent_no_chase_aux_field (extent_ancestor (e), field) + +#define set_extent_no_chase_aux_field(e, field, value) do { \ + EXTENT sencaf_e = (e); \ + if (! sencaf_e->flags.has_aux) \ + allocate_extent_auxiliary (sencaf_e); \ + XEXTENT_AUXILIARY (XCAR (sencaf_e->plist))->field = (value);\ +} while (0) + +#define set_extent_no_chase_normal_field(e, field, value) \ + extent_no_chase_normal_field (e, field) = (value) + +#define set_extent_aux_field(e, field, value) \ + set_extent_no_chase_aux_field (extent_ancestor (e), field, value) + +#define set_extent_normal_field(e, field, value) \ + set_extent_no_chase_normal_field (extent_ancestor (e), field, value) + +/* The `parent' and `children' fields are not affected by any + parent links. We don't provide any settors for these fields + because they need special handling and it's cleaner just to + do this in the particular functions that need to do this. */ + +#define extent_parent(e) extent_no_chase_aux_field (e, parent) +#define extent_children(e) extent_no_chase_aux_field (e, children) + +EXTENT extent_ancestor_1 (EXTENT e); + +/* extent_ancestor() chases all the parent links until there aren't any + more. extent_ancestor_1() does the same thing but it a function; + the following optimizes the most common case. */ +DECLARE_INLINE_HEADER ( +EXTENT +extent_ancestor (EXTENT e) +) +{ + return e->flags.has_parent ? extent_ancestor_1 (e) : e; +} + +#define extent_begin_glyph(e) extent_aux_field (e, begin_glyph) +#define extent_end_glyph(e) extent_aux_field (e, end_glyph) +#define extent_priority(e) extent_aux_field (e, priority) +#define extent_invisible(e) extent_aux_field (e, invisible) +#define extent_read_only(e) extent_aux_field (e, read_only) +#define extent_mouse_face(e) extent_aux_field (e, mouse_face) +#define extent_initial_redisplay_function(e) extent_aux_field (e, initial_redisplay_function) +#define extent_before_change_functions(e) extent_aux_field (e, before_change_functions) +#define extent_after_change_functions(e) extent_aux_field (e, after_change_functions) + +#define set_extent_begin_glyph(e, value) \ + set_extent_aux_field (e, begin_glyph, value) +#define set_extent_end_glyph(e, value) \ + set_extent_aux_field (e, end_glyph, value) +#define set_extent_priority(e, value) \ + set_extent_aux_field (e, priority, value) +#define set_extent_invisible_1(e, value) \ + set_extent_aux_field (e, invisible, value) +#define set_extent_read_only(e, value) \ + set_extent_aux_field (e, read_only, value) +#define set_extent_mouse_face(e, value) \ + set_extent_aux_field (e, mouse_face, value) +/* Use Fset_extent_initial_redisplay_function unless you know what you're doing */ +#define set_extent_initial_redisplay_function(e, value) \ + set_extent_aux_field (e, initial_redisplay_function, value) +#define set_extent_before_change_functions(e, value) \ + set_extent_aux_field (e, before_change_functions, value) +#define set_extent_after_change_functions(e, value) \ + set_extent_aux_field (e, after_change_functions, value) + +#define extent_face(e) extent_normal_field (e, face) +#define extent_begin_glyph_layout(e) ((enum glyph_layout) extent_normal_field (e, begin_glyph_layout)) +#define extent_end_glyph_layout(e) ((enum glyph_layout) extent_normal_field (e, end_glyph_layout)) +#define extent_start_open_p(e) extent_normal_field (e, start_open) +#define extent_end_open_p(e) extent_normal_field (e, end_open) +#define extent_unique_p(e) extent_normal_field (e, unique) +#define extent_duplicable_p(e) extent_normal_field (e, duplicable) +#define extent_detachable_p(e) extent_normal_field (e, detachable) +#define extent_internal_p(e) extent_normal_field (e, internal) +#define extent_in_red_event_p(e) extent_normal_field (e, in_red_event) + +#define set_extent_face(e, val) \ + set_extent_normal_field (e, face, val) +#define set_extent_begin_glyph_layout(e, val) \ + set_extent_normal_field (e, begin_glyph_layout, val) +#define set_extent_end_glyph_layout(e, val) \ + set_extent_normal_field (e, end_glyph_layout, val) +#define set_extent_start_open_p(e, val) \ + set_extent_normal_field (e, start_open, val) +#define set_extent_end_open_p(e, val) \ + set_extent_normal_field (e, end_open, val) +#define set_extent_unique_p(e, val) \ + set_extent_normal_field (e, unique, val) +#define set_extent_duplicable_p(e, val) \ + set_extent_normal_field (e, duplicable, val) +#define set_extent_detachable_p(e, val) \ + set_extent_normal_field (e, detachable, val) +#define set_extent_internal_p(e, val) \ + set_extent_normal_field (e, internal, val) +#define set_extent_in_red_event_p(e, val) \ + set_extent_normal_field (e, in_red_event, val) + +DECLARE_INLINE_HEADER ( +Lisp_Object * +extent_no_chase_plist_addr (EXTENT e) +) +{ + return e->flags.has_aux ? &XCDR (e->plist) : &e->plist; +} + +#define extent_no_chase_plist(e) (*extent_no_chase_plist_addr (e)) + +#define extent_plist_addr(e) extent_no_chase_plist_addr (extent_ancestor (e)) +#define extent_plist_slot(e) extent_no_chase_plist (extent_ancestor (e)) + + +#define EXTENT_LIVE_P(e) (!EQ (extent_object (e), Qt)) + +#define CHECK_LIVE_EXTENT(x) do { \ + CHECK_EXTENT (x); \ + if (!EXTENT_LIVE_P (XEXTENT (x))) \ + dead_wrong_type_argument (Qextent_live_p, (x)); \ +} while (0) +#define CONCHECK_LIVE_EXTENT(x) do { \ + CONCHECK_EXTENT (x); \ + if (!EXTENT_LIVE_P (XEXTENT (x))) \ + x = wrong_type_argument (Qextent_live_p, (x)); \ +} while (0) + +#endif /* INCLUDED_extents_impl_h_ */
--- a/src/extents.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/extents.c Thu Jun 20 21:19:10 2002 +0000 @@ -218,7 +218,7 @@ #include "debug.h" #include "device.h" #include "elhash.h" -#include "extents.h" +#include "extents-impl.h" #include "faces.h" #include "frame.h" #include "glyphs.h"
--- a/src/extents.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/extents.h Thu Jun 20 21:19:10 2002 +0000 @@ -1,5 +1,5 @@ /* Copyright (c) 1994, 1995 Free Software Foundation. - Copyright (c) 1995, 1996 Ben Wing. + Copyright (c) 1995, 1996, 2002 Ben Wing. This file is part of XEmacs. @@ -30,119 +30,7 @@ #define CHECK_EXTENT(x) CHECK_RECORD (x, extent) #define CONCHECK_EXTENT(x) CONCHECK_RECORD (x, extent) -/* the layouts for glyphs (extent->flags.glyph_layout). Must fit in 2 bits. */ -typedef enum glyph_layout -{ - GL_TEXT, - GL_OUTSIDE_MARGIN, - GL_INSIDE_MARGIN, - GL_WHITESPACE -} glyph_layout; - -struct extent -{ - struct lrecord_header lheader; - - Memxpos start; - Memxpos end; - Lisp_Object object; /* A buffer, string, Qnil (extent detached from no - buffer), Qt (destroyed extent) */ - - /* Extent properties are conceptually a plist, but the most common - props are implemented as bits instead of conses. */ - struct - { - Lisp_Object face; - - /* These flags are simply an optimization for common boolean properties - which go onto the extent's property list. Any of them would work if - done in the normal way, but the space savings of doing these in this - way is significant. Note that if you add a flag, there are numerous - places in extents.c that need to know about it. - - Another consideration is that some of these properties are accessed - during redisplay, so it's good for access to them to be fast (a bit - reference instead of a search down a plist). - - `begin_glyph_layout' and `end_glyph_layout' are unusual in that - they have 4 states instead of 2. - - Other special extent properties are stored in an auxiliary - structure that sits at the beginning of the plist. The has_aux - flag indicates whether this structure exists. The has_parent - flag is an optimization indicating whether the extent has a parent - (this could also be determined by looking in the aux structure). */ - - enum_field (glyph_layout) begin_glyph_layout :2; - /* 2 text, margins, or whitespace */ - enum_field (glyph_layout) end_glyph_layout :2; - /* 4 text, margins, or whitespace */ - unsigned int has_parent :1; /* 5 extent has a parent */ - unsigned int has_aux :1; /* 6 extent has an aux. structure */ - unsigned int start_open :1; /* 7 insertion behavior at start */ - unsigned int end_open :1; /* 8 insertion behavior at end */ - unsigned int unique :1; /* 9 there may be only one attached */ - unsigned int duplicable :1; /* 10 copied to strings by kill/undo */ - unsigned int detachable :1; /* 11 extent detaches if text deleted */ - unsigned int internal :1; /* 12 used by map-extents etc. */ - unsigned int in_red_event :1; /* 13 An event has been spawned for - initial redisplay. - (not exported to lisp) */ - unsigned int unused16 :1; /* 16 unused bits */ - /* --- Adding more flags will cause the extent struct to grow by another - word. It's not clear that this would make a difference, however, - because on 32-bit machines things tend to get allocated in chunks - of 4 bytes. */ - } flags; - /* The plist may have an auxiliary structure as its first element */ - Lisp_Object plist; -}; - -/* Basic properties of an extent (not affected by the extent's parent) */ -#define extent_object(e) ((e)->object) -#define extent_start(e) ((e)->start + 0) -#define extent_end(e) ((e)->end + 0) -#define set_extent_start(e, val) ((void) ((e)->start = (val))) -#define set_extent_end(e, val) ((void) ((e)->end = (val))) -#define extent_endpoint(e, endp) ((endp) ? extent_end (e) : extent_start (e)) -#define set_extent_endpoint(e, val, endp) \ - ((endp) ? set_extent_end (e, val) : set_extent_start (e, val)) -#define extent_detached_p(e) (extent_start (e) < 0) - -void set_extent_endpoints (EXTENT extent, Bytexpos s, Bytexpos e, - Lisp_Object object); - -/* Additional information that may be present in an extent. The idea is - that fast access is provided to this information, but since (hopefully) - most extents won't have this set on them, we usually don't need to - have this structure around and thus the size of an extent is smaller. */ - -typedef struct extent_auxiliary extent_auxiliary; -struct extent_auxiliary -{ - struct lcrecord_header header; - - Lisp_Object begin_glyph; - Lisp_Object end_glyph; - Lisp_Object parent; - /* We use a weak list here. Originally I didn't do this and - depended on having the extent's finalization method remove - itself from its parent's children list. This runs into - lots and lots of problems though because everything is in - a really really bizarre state when an extent's finalization - method is called (it happens in sweep_extents() by way of - ADDITIONAL_FREE_extent()) and it's extremely difficult to - avoid getting hosed by just-freed objects. */ - Lisp_Object children; - Lisp_Object invisible; - Lisp_Object read_only; - Lisp_Object mouse_face; - Lisp_Object initial_redisplay_function; - Lisp_Object before_change_functions, after_change_functions; - int priority; -}; - -extern struct extent_auxiliary extent_auxiliary_defaults; +struct extent_auxiliary; DECLARE_LRECORD (extent_auxiliary, struct extent_auxiliary); #define XEXTENT_AUXILIARY(x) \ @@ -152,13 +40,7 @@ #define CHECK_EXTENT_AUXILIARY(x) CHECK_RECORD (x, extent_auxiliary) #define CONCHECK_EXTENT_AUXILIARY(x) CONCHECK_RECORD (x, extent_auxiliary) -struct extent_info -{ - struct lcrecord_header header; - - struct extent_list *extents; - struct stack_of_extents *soe; -}; +struct extent_info; DECLARE_LRECORD (extent_info, struct extent_info); #define XEXTENT_INFO(x) XRECORD (x, extent_info, struct extent_info) @@ -167,151 +49,26 @@ #define CHECK_EXTENT_INFO(x) CHECK_RECORD (x, extent_info) #define CONCHECK_EXTENT_INFO(x) CONCHECK_RECORD (x, extent_info) -void flush_cached_extent_info (Lisp_Object extent_info); - -/* A "normal" field is one that is stored in the `struct flags' structure - in an extent. an "aux" field is one that is stored in the extent's - auxiliary structure. - - The functions below that have `extent_no_chase' in their name operate - on an extent directly (ignoring its parent), and should normally - only be used on extents known not to have a parent. The other - versions chase down any parent links. */ - -#define extent_no_chase_normal_field(e, field) ((e)->flags.field) - -DECLARE_INLINE_HEADER ( -struct extent_auxiliary * -extent_aux_or_default (EXTENT e) -) -{ - return e->flags.has_aux ? - XEXTENT_AUXILIARY (XCAR (e->plist)) : - & extent_auxiliary_defaults; -} - -#define extent_no_chase_aux_field(e, field) (extent_aux_or_default(e)->field) - -#define extent_normal_field(e, field) \ - extent_no_chase_normal_field (extent_ancestor (e), field) - -#define extent_aux_field(e, field) \ - extent_no_chase_aux_field (extent_ancestor (e), field) - -#define set_extent_no_chase_aux_field(e, field, value) do { \ - EXTENT sencaf_e = (e); \ - if (! sencaf_e->flags.has_aux) \ - allocate_extent_auxiliary (sencaf_e); \ - XEXTENT_AUXILIARY (XCAR (sencaf_e->plist))->field = (value);\ -} while (0) - -#define set_extent_no_chase_normal_field(e, field, value) \ - extent_no_chase_normal_field (e, field) = (value) - -#define set_extent_aux_field(e, field, value) \ - set_extent_no_chase_aux_field (extent_ancestor (e), field, value) - -#define set_extent_normal_field(e, field, value) \ - set_extent_no_chase_normal_field (extent_ancestor (e), field, value) - -/* The `parent' and `children' fields are not affected by any - parent links. We don't provide any settors for these fields - because they need special handling and it's cleaner just to - do this in the particular functions that need to do this. */ - -#define extent_parent(e) extent_no_chase_aux_field (e, parent) -#define extent_children(e) extent_no_chase_aux_field (e, children) - -EXTENT extent_ancestor_1 (EXTENT e); - -/* extent_ancestor() chases all the parent links until there aren't any - more. extent_ancestor_1() does the same thing but it a function; - the following optimizes the most common case. */ -DECLARE_INLINE_HEADER ( -EXTENT -extent_ancestor (EXTENT e) -) +/* the layouts for glyphs (extent->flags.glyph_layout). Must fit in 2 bits. */ +typedef enum glyph_layout { - return e->flags.has_parent ? extent_ancestor_1 (e) : e; -} - -#define extent_begin_glyph(e) extent_aux_field (e, begin_glyph) -#define extent_end_glyph(e) extent_aux_field (e, end_glyph) -#define extent_priority(e) extent_aux_field (e, priority) -#define extent_invisible(e) extent_aux_field (e, invisible) -#define extent_read_only(e) extent_aux_field (e, read_only) -#define extent_mouse_face(e) extent_aux_field (e, mouse_face) -#define extent_initial_redisplay_function(e) extent_aux_field (e, initial_redisplay_function) -#define extent_before_change_functions(e) extent_aux_field (e, before_change_functions) -#define extent_after_change_functions(e) extent_aux_field (e, after_change_functions) + GL_TEXT, + GL_OUTSIDE_MARGIN, + GL_INSIDE_MARGIN, + GL_WHITESPACE +} glyph_layout; -#define set_extent_begin_glyph(e, value) \ - set_extent_aux_field (e, begin_glyph, value) -#define set_extent_end_glyph(e, value) \ - set_extent_aux_field (e, end_glyph, value) -#define set_extent_priority(e, value) \ - set_extent_aux_field (e, priority, value) -#define set_extent_invisible_1(e, value) \ - set_extent_aux_field (e, invisible, value) -#define set_extent_read_only(e, value) \ - set_extent_aux_field (e, read_only, value) -#define set_extent_mouse_face(e, value) \ - set_extent_aux_field (e, mouse_face, value) -/* Use Fset_extent_initial_redisplay_function unless you know what you're doing */ -#define set_extent_initial_redisplay_function(e, value) \ - set_extent_aux_field (e, initial_redisplay_function, value) -#define set_extent_before_change_functions(e, value) \ - set_extent_aux_field (e, before_change_functions, value) -#define set_extent_after_change_functions(e, value) \ - set_extent_aux_field (e, after_change_functions, value) +struct extent; -#define extent_face(e) extent_normal_field (e, face) -#define extent_begin_glyph_layout(e) ((enum glyph_layout) extent_normal_field (e, begin_glyph_layout)) -#define extent_end_glyph_layout(e) ((enum glyph_layout) extent_normal_field (e, end_glyph_layout)) -#define extent_start_open_p(e) extent_normal_field (e, start_open) -#define extent_end_open_p(e) extent_normal_field (e, end_open) -#define extent_unique_p(e) extent_normal_field (e, unique) -#define extent_duplicable_p(e) extent_normal_field (e, duplicable) -#define extent_detachable_p(e) extent_normal_field (e, detachable) -#define extent_internal_p(e) extent_normal_field (e, internal) -#define extent_in_red_event_p(e) extent_normal_field (e, in_red_event) +void set_extent_endpoints (EXTENT extent, Bytexpos s, Bytexpos e, + Lisp_Object object); -#define set_extent_face(e, val) \ - set_extent_normal_field (e, face, val) -#define set_extent_begin_glyph_layout(e, val) \ - set_extent_normal_field (e, begin_glyph_layout, val) -#define set_extent_end_glyph_layout(e, val) \ - set_extent_normal_field (e, end_glyph_layout, val) -#define set_extent_start_open_p(e, val) \ - set_extent_normal_field (e, start_open, val) -#define set_extent_end_open_p(e, val) \ - set_extent_normal_field (e, end_open, val) -#define set_extent_unique_p(e, val) \ - set_extent_normal_field (e, unique, val) -#define set_extent_duplicable_p(e, val) \ - set_extent_normal_field (e, duplicable, val) -#define set_extent_detachable_p(e, val) \ - set_extent_normal_field (e, detachable, val) -#define set_extent_internal_p(e, val) \ - set_extent_normal_field (e, internal, val) -#define set_extent_in_red_event_p(e, val) \ - set_extent_normal_field (e, in_red_event, val) + +void flush_cached_extent_info (Lisp_Object extent_info); void set_extent_glyph (EXTENT extent, Lisp_Object glyph, int endp, glyph_layout layout); -DECLARE_INLINE_HEADER ( -Lisp_Object * -extent_no_chase_plist_addr (EXTENT e) -) -{ - return e->flags.has_aux ? &XCDR (e->plist) : &e->plist; -} - -#define extent_no_chase_plist(e) (*extent_no_chase_plist_addr (e)) - -#define extent_plist_addr(e) extent_no_chase_plist_addr (extent_ancestor (e)) -#define extent_plist_slot(e) extent_no_chase_plist (extent_ancestor (e)) /* flags for map_extents() and friends */ #define ME_END_CLOSED (1 << 0) @@ -337,23 +94,74 @@ ME_MIGHT_MODIFY_EXTENTS | ME_MIGHT_MOVE_SOE) -#define EXTENT_LIVE_P(e) (!EQ (extent_object (e), Qt)) - -#define CHECK_LIVE_EXTENT(x) do { \ - CHECK_EXTENT (x); \ - if (!EXTENT_LIVE_P (XEXTENT (x))) \ - dead_wrong_type_argument (Qextent_live_p, (x)); \ -} while (0) -#define CONCHECK_LIVE_EXTENT(x) do { \ - CONCHECK_EXTENT (x); \ - if (!EXTENT_LIVE_P (XEXTENT (x))) \ - x = wrong_type_argument (Qextent_live_p, (x)); \ -} while (0) - - extern int inside_undo; extern int in_modeline_generation; +EXFUN (Fextent_at, 5); +EXFUN (Fextent_property, 3); +EXFUN (Fput_text_property, 5); + +EXFUN (Fdetach_extent, 1); +EXFUN (Fextent_end_position, 1); +EXFUN (Fextent_object, 1); +EXFUN (Fextent_properties, 1); +EXFUN (Fextent_start_position, 1); +EXFUN (Fget_char_property, 4); +EXFUN (Fmake_extent, 3); +EXFUN (Fnext_extent_change, 2); +EXFUN (Fprevious_extent_change, 2); +EXFUN (Fprevious_single_property_change, 4); +EXFUN (Fset_extent_endpoints, 4); +EXFUN (Fset_extent_parent, 2); +EXFUN (Fset_extent_property, 3); + +enum extent_at_flag +{ + EXTENT_AT_DEFAULT = 0, + EXTENT_AT_AFTER = 0, + EXTENT_AT_BEFORE, + EXTENT_AT_AT +}; + +Bytexpos extent_endpoint_byte (EXTENT extent, int endp); +Charxpos extent_endpoint_char (EXTENT extent, int endp); +Bytexpos next_single_property_change (Bytexpos pos, Lisp_Object prop, + Lisp_Object object, Bytexpos limit); +Bytexpos previous_single_property_change (Bytexpos pos, Lisp_Object prop, + Lisp_Object object, Bytexpos limit); +Lisp_Object get_char_property (Bytexpos position, Lisp_Object prop, + Lisp_Object object, enum extent_at_flag fl, + int text_props_only); +void adjust_extents (Lisp_Object object, Memxpos from, + Memxpos to, int amount); +void adjust_extents_for_deletion (Lisp_Object object, Bytexpos from, + Bytexpos to, int gapsize, + int numdel, int movegapsize); +void verify_extent_modification (Lisp_Object object, Bytexpos from, + Bytexpos to, + Lisp_Object inhibit_read_only_value); +void process_extents_for_insertion (Lisp_Object object, + Bytexpos opoint, Bytecount length); +void process_extents_for_deletion (Lisp_Object object, Bytexpos from, + Bytexpos to, int destroy_them); +/* Note the following function is in Charbpos's */ +void report_extent_modification (Lisp_Object buffer, Charbpos start, + Charbpos end, int afterp); +void add_string_extents (Lisp_Object string, struct buffer *buf, + Bytexpos opoint, Bytecount length); +void splice_in_string_extents (Lisp_Object string, struct buffer *buf, + Bytexpos opoint, Bytecount length, + Bytecount pos); +void copy_string_extents (Lisp_Object new_string, + Lisp_Object old_string, + Bytecount new_pos, Bytecount old_pos, + Bytecount length); +void detach_all_extents (Lisp_Object object); +Lisp_Object extent_at (Bytexpos position, Lisp_Object object, + Lisp_Object property, EXTENT before, + enum extent_at_flag at_flag, int all_extents); + + struct extent_fragment *extent_fragment_new (Lisp_Object buffer_or_string, struct frame *frm); face_index extent_fragment_update (struct window *w,
--- a/src/faces.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/faces.c Thu Jun 20 21:19:10 2002 +0000 @@ -30,13 +30,13 @@ #include "lisp.h" #include "buffer.h" -#include "device.h" +#include "device-impl.h" #include "elhash.h" -#include "extents.h" +#include "extents-impl.h" /* for extent_face */ #include "faces.h" -#include "frame.h" +#include "frame-impl.h" #include "glyphs.h" -#include "objects.h" +#include "objects-impl.h" #include "specifier.h" #include "window.h" @@ -553,9 +553,24 @@ Lisp_Object depth) { Lisp_Object retval; + Lisp_Object matchspec = Qunbound; + struct gcpro gcpro1; - retval = specifier_instance_no_quit (Fget (face, property, Qnil), charset, + if (!NILP (charset)) + matchspec = noseeum_cons (charset, Qnil); + GCPRO1 (matchspec); + retval = specifier_instance_no_quit (Fget (face, property, Qnil), matchspec, domain, errb, no_fallback, depth); + if (UNBOUNDP (retval)) + { + Fsetcdr (matchspec, Qt); + retval = specifier_instance_no_quit (Fget (face, property, Qnil), + matchspec, domain, errb, + no_fallback, depth); + } + UNGCPRO; + if (CONSP (matchspec)) + free_cons (matchspec); if (UNBOUNDP (retval) && !no_fallback) { @@ -866,9 +881,7 @@ /* When making the initial terminal device, there is no Lisp code loaded, so we can't do this. */ if (initialized && !noninteractive) - { - call_critical_lisp_code (d, Qinit_global_faces, Qnil); - } + call_critical_lisp_code (d, Qinit_global_faces, wrap_device (d)); } void @@ -879,11 +892,7 @@ /* When making the initial terminal device, there is no Lisp code loaded, so we can't do this. */ if (initialized) - { - Lisp_Object tdevice = wrap_device (d); - - call_critical_lisp_code (d, Qinit_device_faces, tdevice); - } + call_critical_lisp_code (d, Qinit_device_faces, wrap_device (d)); } void @@ -988,6 +997,7 @@ keep them in a chain, and use them to allocate new elements when possible instead of increasing the Dynarr. +--ben (?? At least I think I wrote this!) */ /* mark for GC a dynarr of face cachels. */ @@ -1959,34 +1969,136 @@ { Lisp_Object inst_list = Qnil; -#if defined(HAVE_X_WINDOWS) || defined(HAVE_GTK) - /* This is kind of ugly because stephen wanted this to be CPP - ** identical to the old version, at least for the initial - ** checkin - ** - ** WMP March 9, 2001 - */ +#if defined (HAVE_X_WINDOWS) || defined (HAVE_GTK) - /* The same gory list from x-faces.el. - (#### Perhaps we should remove the stuff from x-faces.el - and only depend on this stuff here? That should work.) - */ const Char_ASCII *fonts[] = { - "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*", + /************** ISO-8859 fonts *************/ + "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*", + "-*-fixed-medium-r-*-*-*-120-*-*-*-*-iso8859-*" "-*-courier-*-r-*-*-*-120-*-*-*-*-iso8859-*", + "-*-fixed-*-r-*-*-*-120-*-*-*-*-iso8859-*" + /* Next try for any "medium" charcell or monospaced iso8859 font. */ "-*-*-medium-r-*-*-*-120-*-*-m-*-iso8859-*", "-*-*-medium-r-*-*-*-120-*-*-c-*-iso8859-*", + /* Next try for any charcell or monospaced iso8859 font. */ "-*-*-*-r-*-*-*-120-*-*-m-*-iso8859-*", "-*-*-*-r-*-*-*-120-*-*-c-*-iso8859-*", + + /* Repeat, any size */ + "-*-courier-medium-r-*-*-*-*-*-*-*-*-iso8859-*", + "-*-fixed-medium-r-*-*-*-*-*-*-*-*-iso8859-*" + "-*-courier-*-r-*-*-*-*-*-*-*-*-iso8859-*", + "-*-fixed-*-r-*-*-*-*-*-*-*-*-iso8859-*" + /* Next try for any "medium" charcell or monospaced iso8859 font. */ + "-*-*-medium-r-*-*-*-*-*-*-m-*-iso8859-*", + "-*-*-medium-r-*-*-*-*-*-*-c-*-iso8859-*", + /* Next try for any charcell or monospaced iso8859 font. */ + "-*-*-*-r-*-*-*-*-*-*-m-*-iso8859-*", + "-*-*-*-r-*-*-*-*-*-*-c-*-iso8859-*", + + /* Non-proportional fonts -- last resort. */ "-*-*-*-r-*-*-*-120-*-*-*-*-iso8859-*", + "-*-*-*-r-*-*-*-*-*-*-*-*-iso8859-*", + "-*-*-*-*-*-*-*-*-*-*-*-*-iso8859-*", + + /************* Japanese fonts ************/ + + /* Following 3 fonts proposed by Teruhiko.Kurosaka@Japan.eng.sun */ + "-sun-gothic-medium-r-normal--14-120-75-75-c-60-jisx0201.1976-0", + "-sun-gothic-medium-r-normal--14-120-75-75-c-120-jisx0208.1983-0", + "-wadalab-gothic-medium-r-normal--14-120-75-75-c-120-jisx0212.1990-0", + + /* Other Japanese fonts */ + "-*-fixed-medium-r-*--*-jisx0201.1976-*", + "-*-fixed-medium-r-*--*-jisx0208.1983-*", + "-*-fixed-medium-r-*--*-jisx0212*-*", + "-*-*-*-r-*--*-jisx0201.1976-*", + "-*-*-*-r-*--*-jisx0208.1983-*", + "-*-*-*-r-*--*-jisx0212*-*", + + /************* Chinese fonts ************/ + + "-*-*-medium-r-*--*-gb2312.1980-*", + "-*-fixed-medium-r-*--*-cns11643*-*", + + "-*-fixed-medium-r-*--*-big5*-*," + "-*-fixed-medium-r-*--*-sisheng_cwnn-0", + + /************* Korean fonts *************/ + + "-*-mincho-medium-r-*--*-ksc5601.1987-*", + + /************* Thai fonts **************/ + + "-*-fixed-medium-r-*--*-tis620.2529-1", + + /************* Other fonts (nonstandard) *************/ + + "-*-fixed-medium-r-*--*-viscii1.1-1", + "-*-fixed-medium-r-*--*-mulearabic-*", + "-*-fixed-medium-r-*--*-muleipa-*", + "-*-fixed-medium-r-*--*-ethio-*", + + /************* Unicode fonts **************/ + + /* #### We don't yet support Unicode fonts, but doing so would not be + hard because all the machinery has already been added for Windows + support. We need to do this: + + (1) Add "stage 2" support in find_charset_font()/etc.; this finds + an appropriate Unicode font after all the charset-specific fonts + have been checked. This should look at the per-char font info and + check whether we have support for some of the chars in the + charset. (#### Bogus, but that's the way it currently works) + + (2) Record in the font instance a flag indicating when we're + dealing with a Unicode font. + + (3) Notice this flag in separate_textual_runs() and translate the + text into Unicode if so. + */ + + "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso10646-1", + "-*-fixed-medium-r-*-*-*-120-*-*-*-*-iso10646-1" + "-*-courier-*-r-*-*-*-120-*-*-*-*-iso10646-1", + "-*-fixed-*-r-*-*-*-120-*-*-*-*-iso10646-1" + /* Next try for any "medium" charcell or monospaced iso8859 font. */ + "-*-*-medium-r-*-*-*-120-*-*-m-*-iso10646-1", + "-*-*-medium-r-*-*-*-120-*-*-c-*-iso10646-1", + /* Next try for any charcell or monospaced iso8859 font. */ + "-*-*-*-r-*-*-*-120-*-*-m-*-iso10646-1", + "-*-*-*-r-*-*-*-120-*-*-c-*-iso10646-1", + + /* Repeat, any size */ + "-*-courier-medium-r-*-*-*-*-*-*-*-*-iso10646-1", + "-*-fixed-medium-r-*-*-*-*-*-*-*-*-iso10646-1" + "-*-courier-*-r-*-*-*-*-*-*-*-*-iso10646-1", + "-*-fixed-*-r-*-*-*-*-*-*-*-*-iso10646-1" + /* Next try for any "medium" charcell or monospaced iso8859 font. */ + "-*-*-medium-r-*-*-*-*-*-*-m-*-iso10646-1", + "-*-*-medium-r-*-*-*-*-*-*-c-*-iso10646-1", + /* Next try for any charcell or monospaced iso8859 font. */ + "-*-*-*-r-*-*-*-*-*-*-m-*-iso10646-1", + "-*-*-*-r-*-*-*-*-*-*-c-*-iso10646-1", + + /* Non-proportional fonts -- last resort. */ + "-*-*-*-r-*-*-*-120-*-*-*-*-iso10646-1", + "-*-*-*-r-*-*-*-*-*-*-*-*-iso10646-1", + "-*-*-*-*-*-*-*-*-*-*-*-*-iso10646-1", + + /*********** Last resort ***********/ + + /* Boy, we sure are losing now. Try the above, but in any encoding. */ "-*-*-medium-r-*-*-*-120-*-*-m-*-*-*", "-*-*-medium-r-*-*-*-120-*-*-c-*-*-*", "-*-*-*-r-*-*-*-120-*-*-m-*-*-*", "-*-*-*-r-*-*-*-120-*-*-c-*-*-*", + /* Hello? Please? */ "-*-*-*-r-*-*-*-120-*-*-*-*-*-*", "-*-*-*-*-*-*-*-120-*-*-*-*-*-*", + "-*-*-*-*-*-*-*-*-*-*-*-*-*-*", "*" }; const Char_ASCII **fontptr; @@ -2013,8 +2125,6 @@ { const Char_ASCII *mswfonts[] = { - "Courier New:Regular:10::Western", - "Courier:Regular:10::Western", "Courier New:Regular:10::", "Courier:Regular:10::", ":Regular:10::"
--- a/src/fileio.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/fileio.c Thu Jun 20 21:19:10 2002 +0000 @@ -37,9 +37,10 @@ #include "frame.h" #include "insdel.h" #include "lstream.h" +#include "process.h" #include "redisplay.h" #include "sysdep.h" -#include "window.h" /* minibuf_level */ +#include "window-impl.h" #include "sysfile.h" #include "sysproc.h"
--- a/src/fns.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/fns.c Thu Jun 20 21:19:10 2002 +0000 @@ -45,6 +45,7 @@ #include "events.h" #include "extents.h" #include "frame.h" +#include "process.h" #include "systime.h" #include "insdel.h" #include "lstream.h" @@ -1813,10 +1814,13 @@ int (*pred_fn) (Lisp_Object, Lisp_Object, Lisp_Object lisp_arg)); +/* The sort function should return > 0 if OBJ1 < OBJ2, < 0 otherwise. + NOTE: This is backwards from the way qsort() works. */ + Lisp_Object list_sort (Lisp_Object list, Lisp_Object lisp_arg, - int (*pred_fn) (Lisp_Object, Lisp_Object, + int (*pred_fn) (Lisp_Object obj1, Lisp_Object obj2, Lisp_Object lisp_arg)) { struct gcpro gcpro1, gcpro2, gcpro3;
--- a/src/frame-gtk.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/frame-gtk.c Thu Jun 20 21:19:10 2002 +0000 @@ -27,30 +27,30 @@ #include <config.h> #include "lisp.h" -#include "console-gtk.h" -#include "ui-gtk.h" +#include "buffer.h" +#include "device-impl.h" +#include "events.h" +#include "extents.h" +#include "faces.h" +#include "frame-impl.h" +#include "window.h" + +#ifdef HAVE_DRAGNDROP +#include "dragdrop.h" +#endif + +#include "console-gtk-impl.h" #include "glyphs-gtk.h" -#include "objects-gtk.h" +#include "objects-gtk-impl.h" #include "scrollbar-gtk.h" +#include "ui-gtk.h" #include "gtk-xemacs.h" -#include "buffer.h" -#include "events.h" -#include "extents.h" -#include "faces.h" -#include "frame.h" -#include "device.h" -#include "window.h" - #ifdef HAVE_GNOME #include <libgnomeui/libgnomeui.h> #endif -#ifdef HAVE_DRAGNDROP -#include "dragdrop.h" -#endif - #define BORDER_WIDTH 0 #define INTERNAL_BORDER_WIDTH 0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/frame-impl.h Thu Jun 20 21:19:10 2002 +0000 @@ -0,0 +1,696 @@ +/* Define frame-object for XEmacs. + Copyright (C) 1988, 1992, 1993, 1994 Free Software Foundation, Inc. + Copyright (C) 1995 Ben Wing. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: FSF 19.30. */ + +#ifndef INCLUDED_frame_impl_h_ +#define INCLUDED_frame_impl_h_ + +#include "console-impl.h" /* for error_check_frame_type */ +#include "frame.h" + +#define FRAME_TYPE_NAME(f) ((f)->framemeths->name) +#define FRAME_TYPE(f) ((f)->framemeths->symbol) + +/******** Accessing / calling a frame method *********/ + +#define HAS_FRAMEMETH_P(f, m) HAS_CONTYPE_METH_P ((f)->framemeths, m) +#define FRAMEMETH(f, m, args) CONTYPE_METH ((f)->framemeths, m, args) +#define MAYBE_FRAMEMETH(f, m, args) \ + MAYBE_CONTYPE_METH ((f)->framemeths, m, args) +#define FRAMEMETH_OR_GIVEN(f, m, args, given) \ + CONTYPE_METH_OR_GIVEN((f)->framemeths, m, args, given) + +struct frame +{ + struct lcrecord_header header; + + /* Methods for this frame's console. This can also be retrieved + through frame->device->console, but it's faster this way. */ + struct console_methods *framemeths; + + /* Size of text only area of this frame, excluding scrollbars, + toolbars and end of line glyphs. The size can be in characters + or pixels, depending on units in which window system resizes + its windows */ + int height, width; + + /* New height and width for pending size change, in the same units + as above. 0 if no change pending. */ + int new_height, new_width; + + /* Size of text-only are of the frame, in default font characters. + This may be inaccurate due to rounding error */ + int char_height, char_width; + + /* Size of the whole frame, including scrollbars, toolbars and end + of line glyphs, in pixels */ + int pixheight, pixwidth; + +#ifdef HAVE_TTY + /* The count of frame number. This applies to TTY frames only. */ + int order_count; +#endif + + /* Current page number for a printer frame. */ + int page_number; + + /* Width of the internal border. This is a line of background color + just inside the window's border. It is normally only non-zero on + X frames, but we put it here to avoid introducing window system + dependencies. */ + int internal_border_width; + + int modiff; + + struct expose_ignore *subwindow_exposures; + struct expose_ignore *subwindow_exposures_tail; + +#ifdef HAVE_SCROLLBARS + /* frame-local scrollbar information. See scrollbar.c. */ + int scrollbar_y_offset; + + /* cache of created scrollbars */ + struct scrollbar_instance *sb_vcache; + struct scrollbar_instance *sb_hcache; +#endif + +#ifdef HAVE_TOOLBARS + /* Size of toolbars as seen by redisplay. This is used to determine + whether to re-layout windows by a call to change_frame_size early + in redisplay_frame. */ + int current_toolbar_size[4]; +#endif + + /* Size of gutters as seen by redisplay. This is used to determine + whether to re-layout windows by a call to change_frame_size early + in redisplay_frame. */ + int current_gutter_bounds[4]; + + /* Dynamic arrays of display lines for gutters */ + display_line_dynarr *current_display_lines[4]; + display_line_dynarr *desired_display_lines[4]; + + /* A structure of auxiliary data specific to the device type. + struct x_frame is used for X window frames; defined in console-x.h */ + void *frame_data; + +#define FRAME_SLOT_DECLARATION +#define MARKED_SLOT(x) Lisp_Object x +#include "frameslots.h" + + /* Nonzero if frame is currently displayed. + Mutually exclusive with iconified + JV: This now a tristate flag: +Value : Emacs meaning :f-v-p : X meaning +0 : not displayed : nil : unmapped +>0 : user can access it,needs repainting : t : mapped and visible +<0 : user can access it,needs no repainting : hidden :mapped and invisible + where f-v-p is the return value of frame-visible-p */ + int visible; + + /* one-bit flags: */ + + /* Is focusing onto this frame disabled? (Modal dialog boxes) */ + unsigned int disabled :1; + + /* Are we finished initializing? */ + unsigned int init_finished :1; + + /* Is frame marked for deletion? This is used in XSetErrorHandler(). */ + unsigned int being_deleted :1; + + /* Nonzero if last attempt at redisplay on this frame was preempted. */ + unsigned int display_preempted :1; + + /* Nonzero if window is currently iconified. + This and visible are mutually exclusive. */ + unsigned int iconified :1; + + /* Nonzero if this frame should be cleared and then redrawn. + Setting this will also effectively set frame_changed. */ + unsigned int clear :1; + + /* True if frame actually has a minibuffer window on it. + 0 if using a minibuffer window that isn't on this frame. */ + unsigned int has_minibuffer :1; + + /* True if frame's root window can't be split. */ + unsigned int no_split :1; + + unsigned int top_toolbar_was_visible :1; + unsigned int bottom_toolbar_was_visible :1; + unsigned int left_toolbar_was_visible :1; + unsigned int right_toolbar_was_visible :1; + /* gutter visibility */ + unsigned int top_gutter_was_visible :1; + unsigned int bottom_gutter_was_visible :1; + unsigned int left_gutter_was_visible :1; + unsigned int right_gutter_was_visible :1; + + /* redisplay flags */ + unsigned int buffers_changed :1; + unsigned int clip_changed :1; + unsigned int extents_changed :1; + unsigned int faces_changed :1; + unsigned int frame_changed :1; + unsigned int subwindows_changed :1; + unsigned int subwindows_state_changed :1; + unsigned int glyphs_changed :1; + unsigned int icon_changed :1; + unsigned int menubar_changed :1; + unsigned int modeline_changed :1; + unsigned int point_changed :1; + unsigned int size_changed :1; + unsigned int toolbar_changed :1; + unsigned int gutter_changed :1; + unsigned int windows_changed :1; + unsigned int windows_structure_changed :1; + unsigned int window_face_cache_reset :1; /* used by expose handler */ + unsigned int echo_area_garbaged :1; /* used by Fredisplay_echo_area */ + unsigned int size_slipped :1; + + unsigned int size_change_pending :1; + unsigned int mirror_dirty :1; + + /* flag indicating if any window on this frame is displaying a subwindow */ + unsigned int subwindows_being_displayed :1; +}; + +/* Redefine basic properties more efficiently */ + +#undef FRAME_LIVE_P +#define FRAME_LIVE_P(f) (!EQ (FRAME_TYPE (f), Qdead)) +#undef FRAME_DEVICE +#define FRAME_DEVICE(f) ((f)->device) + +#define FRAME_TYPE_P(f, type) EQ (FRAME_TYPE (f), Q##type) + +#ifdef ERROR_CHECK_TYPES +DECLARE_INLINE_HEADER ( +struct frame * +error_check_frame_type (struct frame * f, Lisp_Object sym) +) +{ + assert (EQ (FRAME_TYPE (f), sym)); + return f; +} +# define FRAME_TYPE_DATA(f, type) \ + ((struct type##_frame *) error_check_frame_type (f, Q##type)->frame_data) +#else +# define FRAME_TYPE_DATA(f, type) \ + ((struct type##_frame *) (f)->frame_data) +#endif + +#define CHECK_FRAME_TYPE(x, type) \ + do { \ + CHECK_FRAME (x); \ + if (!FRAME_TYPE_P (XFRAME (x), type)) \ + dead_wrong_type_argument \ + (type##_console_methods->predicate_symbol, x); \ + } while (0) +#define CONCHECK_FRAME_TYPE(x, type) \ + do { \ + CONCHECK_FRAME (x); \ + if (!FRAME_TYPE_P (XFRAME (x), type)) \ + x = wrong_type_argument \ + (type##_console_methods->predicate_symbol, x); \ + } while (0) + +#define FRAME_DISPLAY_P(frm) \ + (DEVICE_DISPLAY_P (XDEVICE (FRAME_DEVICE (frm)))) + +#define CHECK_DISPLAY_FRAME(frm) \ + do { \ + CHECK_FRAME (frm); \ + CHECK_LIVE_FRAME (frm); \ + CHECK_DISPLAY_DEVICE (FRAME_DEVICE (XFRAME (frm))); \ + } while (0) + +#define CONCHECK_DISPLAY_FRAME(frm) \ + do { \ + CONCHECK_FRAME (frm); \ + CONCHECK_LIVE_FRAME (frm); \ + CONCHECK_DISPLAY_DEVICE (FRAME_DEVICE (XFRAME (frm))); \ + } while (0) + +#define FRAME_PRINTER_P(frm) \ + (DEVICE_PRINTER_P (XDEVICE (FRAME_DEVICE (frm)))) + +#define CHECK_PRINTER_FRAME(frm) \ + do { \ + CHECK_FRAME (frm); \ + CHECK_LIVE_FRAME (frm); \ + CHECK_PRINTER_DEVICE (FRAME_DEVICE (XFRAME (frm))); \ + } while (0) + +#define CONCHECK_PRINTER_FRAME(frm) \ + do { \ + CONCHECK_FRAME (frm); \ + CONCHECK_LIVE_FRAME (frm); \ + CONCHECK_PRINTER_DEVICE (FRAME_DEVICE (XFRAME (frm))); \ + } while (0) + +/* #### These should be in the frame-*.h files but there are + too many places where the abstraction is broken. Need to + fix. */ + +#define FRAME_X_P(frm) CONSOLE_TYPESYM_X_P (FRAME_TYPE (frm)) +#define CHECK_X_FRAME(z) CHECK_FRAME_TYPE (z, x) +#define CONCHECK_X_FRAME(z) CONCHECK_FRAME_TYPE (z, x) + +#define FRAME_GTK_P(frm) CONSOLE_TYPESYM_GTK_P (FRAME_TYPE (frm)) +#define CHECK_GTK_FRAME(z) CHECK_FRAME_TYPE (z, gtk) +#define CONCHECK_GTK_FRAME(z) CONCHECK_FRAME_TYPE (z, gtk) + +#define FRAME_TTY_P(frm) CONSOLE_TYPESYM_TTY_P (FRAME_TYPE (frm)) +#define CHECK_TTY_FRAME(z) CHECK_FRAME_TYPE (z, tty) +#define CONCHECK_TTY_FRAME(z) CONCHECK_FRAME_TYPE (z, tty) + +#define FRAME_STREAM_P(frm) CONSOLE_TYPESYM_STREAM_P (FRAME_TYPE (frm)) +#define CHECK_STREAM_FRAME(z) CHECK_FRAME_TYPE (z, stream) +#define CONCHECK_STREAM_FRAME(z) CONCHECK_FRAME_TYPE (z, stream) + +#define FRAME_WIN_P(frm) CONSOLE_TYPESYM_WIN_P (FRAME_TYPE (frm)) + +extern int frame_changed; + +#define MARK_FRAME_FACES_CHANGED(f) do { \ + struct frame *mffc_f = (f); \ + mffc_f->faces_changed = 1; \ + mffc_f->modiff++; \ + if (!NILP (mffc_f->device)) \ + { \ + struct device *mffc_d = XDEVICE (mffc_f->device); \ + MARK_DEVICE_FACES_CHANGED (mffc_d); \ + } \ + else \ + faces_changed = 1; \ +} while (0) + +#define MARK_FRAME_GLYPHS_CHANGED(f) do { \ + struct frame *mfgc_f = (f); \ + mfgc_f->glyphs_changed = 1; \ + mfgc_f->modiff++; \ + if (!NILP (mfgc_f->device)) \ + { \ + struct device *mfgc_d = XDEVICE (mfgc_f->device); \ + MARK_DEVICE_GLYPHS_CHANGED (mfgc_d); \ + } \ + else \ + glyphs_changed = 1; \ +} while (0) + +#define MARK_FRAME_SUBWINDOWS_CHANGED(f) do { \ + struct frame *mfgc_f = (f); \ + mfgc_f->subwindows_changed = 1; \ + mfgc_f->modiff++; \ + if (!NILP (mfgc_f->device)) \ + { \ + struct device *mfgc_d = XDEVICE (mfgc_f->device); \ + MARK_DEVICE_SUBWINDOWS_CHANGED (mfgc_d); \ + } \ + else \ + subwindows_changed = 1; \ +} while (0) + +#define MARK_FRAME_SUBWINDOWS_STATE_CHANGED(f) do { \ + struct frame *mfgc_f = (f); \ + mfgc_f->subwindows_state_changed = 1; \ + mfgc_f->modiff++; \ + if (!NILP (mfgc_f->device)) \ + { \ + struct device *mfgc_d = XDEVICE (mfgc_f->device); \ + MARK_DEVICE_SUBWINDOWS_STATE_CHANGED (mfgc_d); \ + } \ + else \ + subwindows_state_changed = 1; \ +} while (0) + +#define MARK_FRAME_TOOLBARS_CHANGED(f) do { \ + struct frame *mftc_f = (f); \ + mftc_f->toolbar_changed = 1; \ + mftc_f->modiff++; \ + if (!NILP (mftc_f->device)) \ + { \ + struct device *mftc_d = XDEVICE (mftc_f->device); \ + MARK_DEVICE_TOOLBARS_CHANGED (mftc_d); \ + } \ + else \ + toolbar_changed = 1; \ +} while (0) + +#define MARK_FRAME_GUTTERS_CHANGED(f) do { \ + struct frame *mftc_f = (f); \ + mftc_f->gutter_changed = 1; \ + mftc_f->modiff++; \ + if (!NILP (mftc_f->device)) \ + { \ + struct device *mftc_d = XDEVICE (mftc_f->device); \ + MARK_DEVICE_GUTTERS_CHANGED (mftc_d); \ + } \ + else \ + gutter_changed = 1; \ +} while (0) + +#define MARK_FRAME_SIZE_CHANGED(f) do { \ + struct frame *mfsc_f = (f); \ + mfsc_f->size_changed = 1; \ + mfsc_f->size_change_pending = 1; \ + mfsc_f->modiff++; \ + if (!NILP (mfsc_f->device)) \ + { \ + struct device *mfsc_d = XDEVICE (mfsc_f->device); \ + MARK_DEVICE_SIZE_CHANGED (mfsc_d); \ + } \ + else \ + size_changed = 1; \ +} while (0) + +#define MARK_FRAME_CHANGED(f) do { \ + struct frame *mfc_f = (f); \ + mfc_f->frame_changed = 1; \ + mfc_f->modiff++; \ + if (!NILP (mfc_f->device)) \ + { \ + struct device *mfc_d = XDEVICE (mfc_f->device); \ + MARK_DEVICE_FRAME_CHANGED (mfc_d); \ + } \ + else \ + frame_changed = 1; \ +} while (0) + +#define MARK_FRAME_WINDOWS_CHANGED(f) do { \ + struct frame *mfwc_f = (f); \ + mfwc_f->windows_changed = 1; \ + mfwc_f->modiff++; \ + if (!NILP (mfwc_f->device)) \ + { \ + struct device *mfwc_d = XDEVICE (mfwc_f->device); \ + MARK_DEVICE_WINDOWS_CHANGED (mfwc_d); \ + } \ + else \ + windows_changed = 1; \ +} while (0) + +#define MARK_FRAME_WINDOWS_STRUCTURE_CHANGED(f) do { \ + struct frame *fwsc_f = (f); \ + fwsc_f->windows_structure_changed = 1; \ + fwsc_f->modiff++; \ + if (!NILP (fwsc_f->device)) \ + { \ + struct device *fwsc_d = XDEVICE (fwsc_f->device); \ + MARK_DEVICE_WINDOWS_STRUCTURE_CHANGED (fwsc_d); \ + } \ + else \ + windows_structure_changed = 1; \ + invalidate_vertical_divider_cache_in_frame (fwsc_f); \ +} while (0) + +#define MARK_FRAME_SIZE_SLIPPED(f) do { \ + struct frame *fwsc_f = (f); \ + fwsc_f->size_slipped = 1; \ + fwsc_f->modiff++; \ + if (!NILP (fwsc_f->device)) \ + { \ + struct device *fwsc_d = XDEVICE (fwsc_f->device); \ + MARK_DEVICE_FRAME_CHANGED (fwsc_d); \ + } \ + else \ + frame_changed = 1; \ +} while (0) + +#define CLEAR_FRAME_SIZE_SLIPPED(f) do { \ + struct frame *fwsc_f = (f); \ + fwsc_f->size_slipped = 0; \ +} while (0) + +#define SET_FRAME_CLEAR(f) MARK_FRAME_CHANGED (f); (f)->clear = 1 + +#define FRAME_MINIBUF_ONLY_P(f) \ + EQ (FRAME_ROOT_WINDOW (f), FRAME_MINIBUF_WINDOW (f)) +#define FRAME_HAS_MINIBUF_P(f) ((f)->has_minibuffer) +#define FRAME_HEIGHT(f) ((f)->height) +#define FRAME_WIDTH(f) ((f)->width) +#define FRAME_CHARHEIGHT(f) ((f)->char_height) +#define FRAME_CHARWIDTH(f) ((f)->char_width) +#define FRAME_PIXHEIGHT(f) ((f)->pixheight) +#define FRAME_PIXWIDTH(f) ((f)->pixwidth) +#define FRAME_PAGENUMBER(f) ((f)->page_number + 0) +#define FRAME_SET_PAGENUMBER(f,x) (f)->page_number = (x); +#ifdef HAVE_SCROLLBARS +#define FRAME_SCROLLBAR_WIDTH(f) \ + (NILP ((f)->vertical_scrollbar_visible_p) ? \ + 0 : XINT ((f)->scrollbar_width)) +#define FRAME_SCROLLBAR_HEIGHT(f) \ + (NILP ((f)->horizontal_scrollbar_visible_p) ? \ + 0 : XINT ((f)->scrollbar_height)) +#else +#define FRAME_SCROLLBAR_WIDTH(f) 0 +#define FRAME_SCROLLBAR_HEIGHT(f) 0 +#endif + +#define FRAME_NEW_HEIGHT(f) ((f)->new_height) +#define FRAME_NEW_WIDTH(f) ((f)->new_width) +#define FRAME_CURSOR_X(f) ((f)->cursor_x) +#define FRAME_CURSOR_Y(f) ((f)->cursor_y) +#define FRAME_VISIBLE_P(f) ((f)->visible) +#define FRAME_REPAINT_P(f) ((f)->visible>0) +#define FRAME_NO_SPLIT_P(f) ((f)->no_split) +#define FRAME_ICONIFIED_P(f) ((f)->iconified) +#define FRAME_FOCUS_FRAME(f) ((f)->focus_frame) +#define FRAME_MINIBUF_WINDOW(f) ((f)->minibuffer_window) +#define FRAME_ROOT_WINDOW(f) ((f)->root_window) +/* Catch people attempting to set this. */ +#define FRAME_SELECTED_WINDOW(f) NON_LVALUE ((f)->selected_window) +#define FRAME_SELECTED_XWINDOW(f) XWINDOW (FRAME_SELECTED_WINDOW (f)) +#define FRAME_LAST_NONMINIBUF_WINDOW(f) \ + NON_LVALUE ((f)->last_nonminibuf_window) +#define FRAME_SB_VCACHE(f) ((f)->sb_vcache) +#define FRAME_SB_HCACHE(f) ((f)->sb_hcache) +#define FRAME_SUBWINDOW_CACHE(f) ((f)->subwindow_instance_cache) + +#if 0 /* FSFmacs */ + +#define FRAME_VISIBLE_P(f) ((f)->visible != 0) +#define FRAME_SET_VISIBLE(f,p) \ + ((f)->async_visible = (p), FRAME_SAMPLE_VISIBILITY (f)) + +/* Emacs's redisplay code could become confused if a frame's + visibility changes at arbitrary times. For example, if a frame is + visible while the desired glyphs are being built, but becomes + invisible before they are updated, then some rows of the + desired_glyphs will be left marked as enabled after redisplay is + complete, which should never happen. The next time the frame + becomes visible, redisplay will probably barf. + + Currently, there are no similar situations involving iconified, but + the principle is the same. + + So instead of having asynchronous input handlers directly set and + clear the frame's visibility and iconification flags, they just set + the async_visible and async_iconified flags; the redisplay code + calls the FRAME_SAMPLE_VISIBILITY macro before doing any redisplay, + which sets visible and iconified from their asynchronous + counterparts. + + Synchronous code must use the FRAME_SET_VISIBLE macro. + + Also, if a frame used to be invisible, but has just become visible, + it must be marked as garbaged, since redisplay hasn't been keeping + up its contents. */ +#define FRAME_SAMPLE_VISIBILITY(f) \ + (((f)->async_visible && ! (f)->visible) ? SET_FRAME_GARBAGED (f) : 0, \ + (f)->visible = (f)->async_visible, \ + (f)->iconified = (f)->async_iconified) + +#endif /* FSFmacs */ + +#define FRAME_BORDER_WIDTH(f) ((f)->internal_border_width) +#define FRAME_BORDER_HEIGHT(f) ((f)->internal_border_width) + +/* This returns the frame-local value; that tells you what you should + use when computing the frame size. It is *not* the actual toolbar + size because that depends on the selected window. Use the macros + below for that. +*/ + +#ifdef HAVE_TOOLBARS +#define FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE(f, pos) \ + (!NILP((f)->toolbar_buttons[pos]) && !NILP ((f)->toolbar_visible_p[pos])) +#define FRAME_RAW_THEORETICAL_TOOLBAR_SIZE(f, pos) \ + (!NILP ((f)->toolbar_buttons[pos]) && INTP((f)->toolbar_size[pos]) ? \ + (XINT ((f)->toolbar_size[pos])) : 0) +#define FRAME_RAW_THEORETICAL_TOOLBAR_BORDER_WIDTH(f, pos) \ + (!NILP ((f)->toolbar_buttons[pos]) && INTP((f)->toolbar_border_width[pos]) ? \ + (XINT ((f)->toolbar_border_width[pos])) : 0) +#else +#define FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE(f, pos) 0 +#define FRAME_RAW_THEORETICAL_TOOLBAR_SIZE(f, pos) 0 +#define FRAME_RAW_THEORETICAL_TOOLBAR_BORDER_WIDTH(f, pos) 0 +#endif + +#define FRAME_THEORETICAL_TOOLBAR_SIZE(f, pos) \ + (FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE (f, pos) \ + ? FRAME_RAW_THEORETICAL_TOOLBAR_SIZE (f, pos) \ + : 0) + +#define FRAME_THEORETICAL_TOP_TOOLBAR_HEIGHT(f) \ + FRAME_THEORETICAL_TOOLBAR_SIZE (f, TOP_TOOLBAR) +#define FRAME_THEORETICAL_BOTTOM_TOOLBAR_HEIGHT(f) \ + FRAME_THEORETICAL_TOOLBAR_SIZE (f, BOTTOM_TOOLBAR) +#define FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH(f) \ + FRAME_THEORETICAL_TOOLBAR_SIZE (f, LEFT_TOOLBAR) +#define FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH(f) \ + FRAME_THEORETICAL_TOOLBAR_SIZE (f, RIGHT_TOOLBAR) + +#define FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH(f, pos) \ + (FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE (f, pos) \ + ? FRAME_RAW_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, pos) \ + : 0) + +#define FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH(f) \ + FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, TOP_TOOLBAR) +#define FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH(f) \ + FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, BOTTOM_TOOLBAR) +#define FRAME_THEORETICAL_LEFT_TOOLBAR_BORDER_WIDTH(f) \ + FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, LEFT_TOOLBAR) +#define FRAME_THEORETICAL_RIGHT_TOOLBAR_BORDER_WIDTH(f) \ + FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, RIGHT_TOOLBAR) + +/* This returns the window-local value rather than the frame-local value; + that tells you about what's actually visible rather than what should + be used when computing the frame size. */ + +#ifdef HAVE_TOOLBARS +#define FRAME_RAW_REAL_TOOLBAR_VISIBLE(f, pos) \ + (HAS_FRAMEMETH_P (f, initialize_frame_toolbars) \ + && !NILP (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_visible_p[pos])) +#define FRAME_RAW_REAL_TOOLBAR_BORDER_WIDTH(f, pos) \ + ((INTP (XWINDOW \ + (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_border_width[pos])) ? \ + (XINT (XWINDOW \ + (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_border_width[pos])) \ + : 0) +#define FRAME_RAW_REAL_TOOLBAR_SIZE(f, pos) \ + ((INTP (XWINDOW \ + (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_size[pos])) ? \ + (XINT (XWINDOW \ + (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_size[pos])) : 0) +#define FRAME_REAL_TOOLBAR(f, pos) \ + (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar[pos]) +#else +#define FRAME_RAW_REAL_TOOLBAR_VISIBLE(f, pos) 0 +#define FRAME_RAW_REAL_TOOLBAR_BORDER_WIDTH(f, pos) 0 +#define FRAME_RAW_REAL_TOOLBAR_SIZE(f, pos) 0 +#define FRAME_REAL_TOOLBAR(f, pos) Qnil +#endif + +/* Note to Chuck + Note to Chuck + Note to Chuck: + + The former definitions of FRAME_REAL_FOO_TOOLBAR_VISIBLE + looked at the toolbar data to see what was there. The + current ones look at the current values of the specifiers. + This is a semantic change; the former definition returned + what was *actually* there right at the moment, while the + current one returns what *ought* to be there once redisplay + has run to completion. I think this new definition is more + correct in almost all circumstances and is much less likely + to lead to strange race conditions. I'm not completely + sure that there aren't some places in the redisplay code + that use these macros and expect the former semantics, so + if you encounter some odd toolbar behavior, you might want + to look into this. --ben */ + +#define FRAME_REAL_TOOLBAR_VISIBLE(f, pos) \ + ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \ + && FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos) > 0) \ + ? FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos) \ + : 0) +#define FRAME_REAL_TOOLBAR_SIZE(f, pos) \ + ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \ + && FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos)) \ + ? FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos) \ + : 0) +#define FRAME_REAL_TOOLBAR_BORDER_WIDTH(f, pos) \ + ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \ + && FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos)) \ + ? FRAME_RAW_REAL_TOOLBAR_BORDER_WIDTH (f, pos) \ + : 0) + +#define FRAME_REAL_TOP_TOOLBAR_HEIGHT(f) \ + FRAME_REAL_TOOLBAR_SIZE (f, TOP_TOOLBAR) +#define FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT(f) \ + FRAME_REAL_TOOLBAR_SIZE (f, BOTTOM_TOOLBAR) +#define FRAME_REAL_LEFT_TOOLBAR_WIDTH(f) \ + FRAME_REAL_TOOLBAR_SIZE (f, LEFT_TOOLBAR) +#define FRAME_REAL_RIGHT_TOOLBAR_WIDTH(f) \ + FRAME_REAL_TOOLBAR_SIZE (f, RIGHT_TOOLBAR) + +#define FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH(f) \ + FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, TOP_TOOLBAR) +#define FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH(f) \ + FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, BOTTOM_TOOLBAR) +#define FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH(f) \ + FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, LEFT_TOOLBAR) +#define FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH(f) \ + FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, RIGHT_TOOLBAR) + +#define FRAME_REAL_TOP_TOOLBAR_VISIBLE(f) \ + FRAME_REAL_TOOLBAR_VISIBLE (f, TOP_TOOLBAR) +#define FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE(f) \ + FRAME_REAL_TOOLBAR_VISIBLE (f, BOTTOM_TOOLBAR) +#define FRAME_REAL_LEFT_TOOLBAR_VISIBLE(f) \ + FRAME_REAL_TOOLBAR_VISIBLE (f, LEFT_TOOLBAR) +#define FRAME_REAL_RIGHT_TOOLBAR_VISIBLE(f) \ + FRAME_REAL_TOOLBAR_VISIBLE (f, RIGHT_TOOLBAR) + +#define FRAME_TOP_BORDER_START(f) \ + (FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) + \ + 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f)) +#define FRAME_TOP_BORDER_END(f) \ + (FRAME_TOP_BORDER_START (f) + FRAME_BORDER_HEIGHT (f)) + +#define FRAME_BOTTOM_BORDER_START(f) \ + (FRAME_PIXHEIGHT (f) - FRAME_BORDER_HEIGHT (f) - \ + FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - \ + 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f)) +#define FRAME_BOTTOM_BORDER_END(f) \ + (FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - \ + 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f)) + +#define FRAME_LEFT_BORDER_START(f) \ + (FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) + \ + 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f)) +#define FRAME_LEFT_BORDER_END(f) \ + (FRAME_LEFT_BORDER_START (f) + FRAME_BORDER_WIDTH (f)) + +#define FRAME_RIGHT_BORDER_START(f) \ + (FRAME_PIXWIDTH (f) - FRAME_BORDER_WIDTH (f) - \ + FRAME_REAL_RIGHT_TOOLBAR_WIDTH(f) - \ + 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f)) +#define FRAME_RIGHT_BORDER_END(f) \ + (FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) - \ + 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH(f)) + +#endif /* INCLUDED_frame_impl_h_ */
--- a/src/frame-msw.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/frame-msw.c Thu Jun 20 21:19:10 2002 +0000 @@ -35,15 +35,15 @@ #include "lisp.h" #include "buffer.h" -#include "device.h" +#include "device-impl.h" #include "elhash.h" #include "events.h" #include "faces.h" -#include "frame.h" +#include "frame-impl.h" #include "redisplay.h" #include "window.h" -#include "console-msw.h" +#include "console-msw-impl.h" #include "glyphs-msw.h" #define MSWINDOWS_FRAME_STYLE (WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW)
--- a/src/frame-tty.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/frame-tty.c Thu Jun 20 21:19:10 2002 +0000 @@ -27,11 +27,11 @@ #include <config.h> #include "lisp.h" -#include "device.h" +#include "device-impl.h" #include "events.h" -#include "frame.h" +#include "frame-impl.h" -#include "console-tty.h" +#include "console-tty-impl.h" /* Default properties to use when creating frames. */
--- a/src/frame-x.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/frame-x.c Thu Jun 20 21:19:10 2002 +0000 @@ -29,17 +29,17 @@ #include "lisp.h" #include "buffer.h" -#include "device.h" +#include "device-impl.h" #include "events.h" #include "extents.h" #include "faces.h" -#include "frame.h" -#include "window.h" +#include "frame-impl.h" #include "gutter.h" - -#include "console-x.h" +#include "window.h" + +#include "console-x-impl.h" #include "glyphs-x.h" -#include "objects-x.h" +#include "objects-x-impl.h" #include "scrollbar-x.h" #include "xintrinsicp.h" /* CoreP.h needs this */
--- a/src/frame.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/frame.c Thu Jun 20 21:19:10 2002 +0000 @@ -29,11 +29,11 @@ #include "buffer.h" /* for Vbuffer_alist */ #include "console.h" -#include "device.h" +#include "device-impl.h" #include "events.h" #include "extents.h" #include "faces.h" -#include "frame.h" +#include "frame-impl.h" #include "glyphs.h" #include "gutter.h" #include "menubar.h" @@ -607,6 +607,18 @@ return decode_frame (cdf); } +Lisp_Object +frame_device (struct frame *f) +{ + return FRAME_DEVICE (f); +} + +int +frame_live_p (struct frame *f) +{ + return FRAME_LIVE_P (f); +} + #ifdef ERROR_CHECK_TRAPPING_PROBLEMS
--- a/src/frame.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/frame.h Thu Jun 20 21:19:10 2002 +0000 @@ -1,6 +1,6 @@ /* Define frame-object for XEmacs. Copyright (C) 1988, 1992, 1993, 1994 Free Software Foundation, Inc. - Copyright (C) 1995 Ben Wing. + Copyright (C) 1995, 2002 Ben Wing. This file is part of XEmacs. @@ -27,174 +27,9 @@ #include "redisplay.h" #include "console.h" /* for error_check_frame_type */ -#define FRAME_TYPE_NAME(f) ((f)->framemeths->name) -#define FRAME_TYPE(f) ((f)->framemeths->symbol) - -/******** Accessing / calling a frame method *********/ - -#define HAS_FRAMEMETH_P(f, m) HAS_CONTYPE_METH_P ((f)->framemeths, m) -#define FRAMEMETH(f, m, args) CONTYPE_METH ((f)->framemeths, m, args) -#define MAYBE_FRAMEMETH(f, m, args) \ - MAYBE_CONTYPE_METH ((f)->framemeths, m, args) -#define FRAMEMETH_OR_GIVEN(f, m, args, given) \ - CONTYPE_METH_OR_GIVEN((f)->framemeths, m, args, given) - -struct frame -{ - struct lcrecord_header header; - - /* Methods for this frame's console. This can also be retrieved - through frame->device->console, but it's faster this way. */ - struct console_methods *framemeths; - - /* Size of text only area of this frame, excluding scrollbars, - toolbars and end of line glyphs. The size can be in characters - or pixels, depending on units in which window system resizes - its windows */ - int height, width; - - /* New height and width for pending size change, in the same units - as above. 0 if no change pending. */ - int new_height, new_width; - - /* Size of text-only are of the frame, in default font characters. - This may be inaccurate due to rounding error */ - int char_height, char_width; - - /* Size of the whole frame, including scrollbars, toolbars and end - of line glyphs, in pixels */ - int pixheight, pixwidth; - -#ifdef HAVE_TTY - /* The count of frame number. This applies to TTY frames only. */ - int order_count; -#endif - - /* Current page number for a printer frame. */ - int page_number; - - /* Width of the internal border. This is a line of background color - just inside the window's border. It is normally only non-zero on - X frames, but we put it here to avoid introducing window system - dependencies. */ - int internal_border_width; - - int modiff; - - struct expose_ignore *subwindow_exposures; - struct expose_ignore *subwindow_exposures_tail; - -#ifdef HAVE_SCROLLBARS - /* frame-local scrollbar information. See scrollbar.c. */ - int scrollbar_y_offset; - - /* cache of created scrollbars */ - struct scrollbar_instance *sb_vcache; - struct scrollbar_instance *sb_hcache; -#endif - -#ifdef HAVE_TOOLBARS - /* Size of toolbars as seen by redisplay. This is used to determine - whether to re-layout windows by a call to change_frame_size early - in redisplay_frame. */ - int current_toolbar_size[4]; -#endif - - /* Size of gutters as seen by redisplay. This is used to determine - whether to re-layout windows by a call to change_frame_size early - in redisplay_frame. */ - int current_gutter_bounds[4]; - - /* Dynamic arrays of display lines for gutters */ - display_line_dynarr *current_display_lines[4]; - display_line_dynarr *desired_display_lines[4]; +struct frame; - /* A structure of auxiliary data specific to the device type. - struct x_frame is used for X window frames; defined in console-x.h */ - void *frame_data; - -#define FRAME_SLOT_DECLARATION -#define MARKED_SLOT(x) Lisp_Object x -#include "frameslots.h" - - /* Nonzero if frame is currently displayed. - Mutually exclusive with iconified - JV: This now a tristate flag: -Value : Emacs meaning :f-v-p : X meaning -0 : not displayed : nil : unmapped ->0 : user can access it,needs repainting : t : mapped and visible -<0 : user can access it,needs no repainting : hidden :mapped and invisible - where f-v-p is the return value of frame-visible-p */ - int visible; - - /* one-bit flags: */ - - /* Is focusing onto this frame disabled? (Modal dialog boxes) */ - unsigned int disabled :1; - - /* Are we finished initializing? */ - unsigned int init_finished :1; - - /* Is frame marked for deletion? This is used in XSetErrorHandler(). */ - unsigned int being_deleted :1; - - /* Nonzero if last attempt at redisplay on this frame was preempted. */ - unsigned int display_preempted :1; - - /* Nonzero if window is currently iconified. - This and visible are mutually exclusive. */ - unsigned int iconified :1; - - /* Nonzero if this frame should be cleared and then redrawn. - Setting this will also effectively set frame_changed. */ - unsigned int clear :1; - - /* True if frame actually has a minibuffer window on it. - 0 if using a minibuffer window that isn't on this frame. */ - unsigned int has_minibuffer :1; - - /* True if frame's root window can't be split. */ - unsigned int no_split :1; - - unsigned int top_toolbar_was_visible :1; - unsigned int bottom_toolbar_was_visible :1; - unsigned int left_toolbar_was_visible :1; - unsigned int right_toolbar_was_visible :1; - /* gutter visibility */ - unsigned int top_gutter_was_visible :1; - unsigned int bottom_gutter_was_visible :1; - unsigned int left_gutter_was_visible :1; - unsigned int right_gutter_was_visible :1; - - /* redisplay flags */ - unsigned int buffers_changed :1; - unsigned int clip_changed :1; - unsigned int extents_changed :1; - unsigned int faces_changed :1; - unsigned int frame_changed :1; - unsigned int subwindows_changed :1; - unsigned int subwindows_state_changed :1; - unsigned int glyphs_changed :1; - unsigned int icon_changed :1; - unsigned int menubar_changed :1; - unsigned int modeline_changed :1; - unsigned int point_changed :1; - unsigned int size_changed :1; - unsigned int toolbar_changed :1; - unsigned int gutter_changed :1; - unsigned int windows_changed :1; - unsigned int windows_structure_changed :1; - unsigned int window_face_cache_reset :1; /* used by expose handler */ - unsigned int echo_area_garbaged :1; /* used by Fredisplay_echo_area */ - unsigned int size_slipped :1; - - unsigned int size_change_pending :1; - unsigned int mirror_dirty :1; - - /* flag indicating if any window on this frame is displaying a subwindow */ - unsigned int subwindows_being_displayed :1; -}; - +EXFUN (Fselected_frame, 1); EXFUN (Fdelete_frame, 2); EXFUN (Fframe_iconified_p, 1); EXFUN (Fframe_name, 1); @@ -225,7 +60,6 @@ extern Lisp_Object Vframe_icon_title_format, Vframe_title_format; extern Lisp_Object Vmouse_motion_handler; - DECLARE_LRECORD (frame, struct frame); #define XFRAME(x) XRECORD (x, frame, struct frame) #define wrap_frame(p) wrap_record (p, frame) @@ -233,6 +67,24 @@ #define CHECK_FRAME(x) CHECK_RECORD (x, frame) #define CONCHECK_FRAME(x) CONCHECK_RECORD (x, frame) +/* Basic properties available to non-privileged users; redefined in + frame-impl.h */ + +int frame_live_p (struct frame *f); +Lisp_Object frame_device (struct frame *f); + +#define FRAME_LIVE_P(f) frame_live_p (f) +#define FRAME_DEVICE(f) frame_device (f) + +#define FRAME_XDEVICE(f) XDEVICE (FRAME_DEVICE (f)) +#define FRAME_CONSOLE(f) XDEVICE_CONSOLE (FRAME_DEVICE (f)) +#define FRAME_XCONSOLE(f) XCONSOLE (FRAME_CONSOLE (f)) + +#define XFRAME_DEVICE(f) FRAME_DEVICE (XFRAME (f)) +#define XFRAME_XDEVICE(f) XDEVICE (XFRAME_DEVICE (f)) +#define XFRAME_CONSOLE(f) XDEVICE_CONSOLE (XFRAME_DEVICE (f)) +#define XFRAME_XCONSOLE(f) XCONSOLE (XFRAME_CONSOLE (f)) + #define CHECK_LIVE_FRAME(x) do { \ CHECK_FRAME (x); \ if (! FRAME_LIVE_P (XFRAME (x))) \ @@ -244,505 +96,11 @@ x = wrong_type_argument (Qframe_live_p, (x)); \ } while (0) -#define FRAME_TYPE_P(f, type) EQ (FRAME_TYPE (f), Q##type) - -#ifdef ERROR_CHECK_TYPES -DECLARE_INLINE_HEADER ( -struct frame * -error_check_frame_type (struct frame * f, Lisp_Object sym) -) -{ - assert (EQ (FRAME_TYPE (f), sym)); - return f; -} -# define FRAME_TYPE_DATA(f, type) \ - ((struct type##_frame *) error_check_frame_type (f, Q##type)->frame_data) -#else -# define FRAME_TYPE_DATA(f, type) \ - ((struct type##_frame *) (f)->frame_data) -#endif - -#define CHECK_FRAME_TYPE(x, type) \ - do { \ - CHECK_FRAME (x); \ - if (!FRAME_TYPE_P (XFRAME (x), type)) \ - dead_wrong_type_argument \ - (type##_console_methods->predicate_symbol, x); \ - } while (0) -#define CONCHECK_FRAME_TYPE(x, type) \ - do { \ - CONCHECK_FRAME (x); \ - if (!FRAME_TYPE_P (XFRAME (x), type)) \ - x = wrong_type_argument \ - (type##_console_methods->predicate_symbol, x); \ - } while (0) - -#define FRAME_DISPLAY_P(frm) \ - (DEVICE_DISPLAY_P (XDEVICE (FRAME_DEVICE (frm)))) - -#define CHECK_DISPLAY_FRAME(frm) \ - do { \ - CHECK_FRAME (frm); \ - CHECK_LIVE_FRAME (frm); \ - CHECK_DISPLAY_DEVICE (FRAME_DEVICE (XFRAME (frm))); \ - } while (0) - -#define CONCHECK_DISPLAY_FRAME(frm) \ - do { \ - CONCHECK_FRAME (frm); \ - CONCHECK_LIVE_FRAME (frm); \ - CONCHECK_DISPLAY_DEVICE (FRAME_DEVICE (XFRAME (frm))); \ - } while (0) - -#define FRAME_PRINTER_P(frm) \ - (DEVICE_PRINTER_P (XDEVICE (FRAME_DEVICE (frm)))) - -#define CHECK_PRINTER_FRAME(frm) \ - do { \ - CHECK_FRAME (frm); \ - CHECK_LIVE_FRAME (frm); \ - CHECK_PRINTER_DEVICE (FRAME_DEVICE (XFRAME (frm))); \ - } while (0) - -#define CONCHECK_PRINTER_FRAME(frm) \ - do { \ - CONCHECK_FRAME (frm); \ - CONCHECK_LIVE_FRAME (frm); \ - CONCHECK_PRINTER_DEVICE (FRAME_DEVICE (XFRAME (frm))); \ - } while (0) - -/* #### These should be in the frame-*.h files but there are - too many places where the abstraction is broken. Need to - fix. */ - -#define FRAME_X_P(frm) CONSOLE_TYPESYM_X_P (FRAME_TYPE (frm)) -#define CHECK_X_FRAME(z) CHECK_FRAME_TYPE (z, x) -#define CONCHECK_X_FRAME(z) CONCHECK_FRAME_TYPE (z, x) - -#define FRAME_GTK_P(frm) CONSOLE_TYPESYM_GTK_P (FRAME_TYPE (frm)) -#define CHECK_GTK_FRAME(z) CHECK_FRAME_TYPE (z, gtk) -#define CONCHECK_GTK_FRAME(z) CONCHECK_FRAME_TYPE (z, gtk) - -#define FRAME_TTY_P(frm) CONSOLE_TYPESYM_TTY_P (FRAME_TYPE (frm)) -#define CHECK_TTY_FRAME(z) CHECK_FRAME_TYPE (z, tty) -#define CONCHECK_TTY_FRAME(z) CONCHECK_FRAME_TYPE (z, tty) - -#define FRAME_STREAM_P(frm) CONSOLE_TYPESYM_STREAM_P (FRAME_TYPE (frm)) -#define CHECK_STREAM_FRAME(z) CHECK_FRAME_TYPE (z, stream) -#define CONCHECK_STREAM_FRAME(z) CONCHECK_FRAME_TYPE (z, stream) - -#define FRAME_WIN_P(frm) CONSOLE_TYPESYM_WIN_P (FRAME_TYPE (frm)) - -extern int frame_changed; - -#define MARK_FRAME_FACES_CHANGED(f) do { \ - struct frame *mffc_f = (f); \ - mffc_f->faces_changed = 1; \ - mffc_f->modiff++; \ - if (!NILP (mffc_f->device)) \ - { \ - struct device *mffc_d = XDEVICE (mffc_f->device); \ - MARK_DEVICE_FACES_CHANGED (mffc_d); \ - } \ - else \ - faces_changed = 1; \ -} while (0) - -#define MARK_FRAME_GLYPHS_CHANGED(f) do { \ - struct frame *mfgc_f = (f); \ - mfgc_f->glyphs_changed = 1; \ - mfgc_f->modiff++; \ - if (!NILP (mfgc_f->device)) \ - { \ - struct device *mfgc_d = XDEVICE (mfgc_f->device); \ - MARK_DEVICE_GLYPHS_CHANGED (mfgc_d); \ - } \ - else \ - glyphs_changed = 1; \ -} while (0) - -#define MARK_FRAME_SUBWINDOWS_CHANGED(f) do { \ - struct frame *mfgc_f = (f); \ - mfgc_f->subwindows_changed = 1; \ - mfgc_f->modiff++; \ - if (!NILP (mfgc_f->device)) \ - { \ - struct device *mfgc_d = XDEVICE (mfgc_f->device); \ - MARK_DEVICE_SUBWINDOWS_CHANGED (mfgc_d); \ - } \ - else \ - subwindows_changed = 1; \ -} while (0) - -#define MARK_FRAME_SUBWINDOWS_STATE_CHANGED(f) do { \ - struct frame *mfgc_f = (f); \ - mfgc_f->subwindows_state_changed = 1; \ - mfgc_f->modiff++; \ - if (!NILP (mfgc_f->device)) \ - { \ - struct device *mfgc_d = XDEVICE (mfgc_f->device); \ - MARK_DEVICE_SUBWINDOWS_STATE_CHANGED (mfgc_d); \ - } \ - else \ - subwindows_state_changed = 1; \ -} while (0) - -#define MARK_FRAME_TOOLBARS_CHANGED(f) do { \ - struct frame *mftc_f = (f); \ - mftc_f->toolbar_changed = 1; \ - mftc_f->modiff++; \ - if (!NILP (mftc_f->device)) \ - { \ - struct device *mftc_d = XDEVICE (mftc_f->device); \ - MARK_DEVICE_TOOLBARS_CHANGED (mftc_d); \ - } \ - else \ - toolbar_changed = 1; \ -} while (0) - -#define MARK_FRAME_GUTTERS_CHANGED(f) do { \ - struct frame *mftc_f = (f); \ - mftc_f->gutter_changed = 1; \ - mftc_f->modiff++; \ - if (!NILP (mftc_f->device)) \ - { \ - struct device *mftc_d = XDEVICE (mftc_f->device); \ - MARK_DEVICE_GUTTERS_CHANGED (mftc_d); \ - } \ - else \ - gutter_changed = 1; \ -} while (0) - -#define MARK_FRAME_SIZE_CHANGED(f) do { \ - struct frame *mfsc_f = (f); \ - mfsc_f->size_changed = 1; \ - mfsc_f->size_change_pending = 1; \ - mfsc_f->modiff++; \ - if (!NILP (mfsc_f->device)) \ - { \ - struct device *mfsc_d = XDEVICE (mfsc_f->device); \ - MARK_DEVICE_SIZE_CHANGED (mfsc_d); \ - } \ - else \ - size_changed = 1; \ -} while (0) - -#define MARK_FRAME_CHANGED(f) do { \ - struct frame *mfc_f = (f); \ - mfc_f->frame_changed = 1; \ - mfc_f->modiff++; \ - if (!NILP (mfc_f->device)) \ - { \ - struct device *mfc_d = XDEVICE (mfc_f->device); \ - MARK_DEVICE_FRAME_CHANGED (mfc_d); \ - } \ - else \ - frame_changed = 1; \ -} while (0) - -#define MARK_FRAME_WINDOWS_CHANGED(f) do { \ - struct frame *mfwc_f = (f); \ - mfwc_f->windows_changed = 1; \ - mfwc_f->modiff++; \ - if (!NILP (mfwc_f->device)) \ - { \ - struct device *mfwc_d = XDEVICE (mfwc_f->device); \ - MARK_DEVICE_WINDOWS_CHANGED (mfwc_d); \ - } \ - else \ - windows_changed = 1; \ -} while (0) - -#define MARK_FRAME_WINDOWS_STRUCTURE_CHANGED(f) do { \ - struct frame *fwsc_f = (f); \ - fwsc_f->windows_structure_changed = 1; \ - fwsc_f->modiff++; \ - if (!NILP (fwsc_f->device)) \ - { \ - struct device *fwsc_d = XDEVICE (fwsc_f->device); \ - MARK_DEVICE_WINDOWS_STRUCTURE_CHANGED (fwsc_d); \ - } \ - else \ - windows_structure_changed = 1; \ - invalidate_vertical_divider_cache_in_frame (fwsc_f); \ -} while (0) - -#define MARK_FRAME_SIZE_SLIPPED(f) do { \ - struct frame *fwsc_f = (f); \ - fwsc_f->size_slipped = 1; \ - fwsc_f->modiff++; \ - if (!NILP (fwsc_f->device)) \ - { \ - struct device *fwsc_d = XDEVICE (fwsc_f->device); \ - MARK_DEVICE_FRAME_CHANGED (fwsc_d); \ - } \ - else \ - frame_changed = 1; \ -} while (0) - -#define CLEAR_FRAME_SIZE_SLIPPED(f) do { \ - struct frame *fwsc_f = (f); \ - fwsc_f->size_slipped = 0; \ -} while (0) - -#define SET_FRAME_CLEAR(f) MARK_FRAME_CHANGED (f); (f)->clear = 1 -#define FRAME_DEVICE(f) ((f)->device) -#define FRAME_CONSOLE(f) DEVICE_CONSOLE (XDEVICE (FRAME_DEVICE (f))) -#define FRAME_LIVE_P(f) (!EQ (FRAME_TYPE (f), Qdead)) - -#define FRAME_MINIBUF_ONLY_P(f) \ - EQ (FRAME_ROOT_WINDOW (f), FRAME_MINIBUF_WINDOW (f)) -#define FRAME_HAS_MINIBUF_P(f) ((f)->has_minibuffer) -#define FRAME_HEIGHT(f) ((f)->height) -#define FRAME_WIDTH(f) ((f)->width) -#define FRAME_CHARHEIGHT(f) ((f)->char_height) -#define FRAME_CHARWIDTH(f) ((f)->char_width) -#define FRAME_PIXHEIGHT(f) ((f)->pixheight) -#define FRAME_PIXWIDTH(f) ((f)->pixwidth) -#define FRAME_PAGENUMBER(f) ((f)->page_number + 0) -#define FRAME_SET_PAGENUMBER(f,x) (f)->page_number = (x); -#ifdef HAVE_SCROLLBARS -#define FRAME_SCROLLBAR_WIDTH(f) \ - (NILP ((f)->vertical_scrollbar_visible_p) ? \ - 0 : XINT ((f)->scrollbar_width)) -#define FRAME_SCROLLBAR_HEIGHT(f) \ - (NILP ((f)->horizontal_scrollbar_visible_p) ? \ - 0 : XINT ((f)->scrollbar_height)) -#else -#define FRAME_SCROLLBAR_WIDTH(f) 0 -#define FRAME_SCROLLBAR_HEIGHT(f) 0 -#endif - #define FW_FRAME(obj) \ (WINDOWP (obj) ? WINDOW_FRAME (XWINDOW (obj)) \ : (FRAMEP (obj) ? obj \ : Qnil)) -#define FRAME_NEW_HEIGHT(f) ((f)->new_height) -#define FRAME_NEW_WIDTH(f) ((f)->new_width) -#define FRAME_CURSOR_X(f) ((f)->cursor_x) -#define FRAME_CURSOR_Y(f) ((f)->cursor_y) -#define FRAME_VISIBLE_P(f) ((f)->visible) -#define FRAME_REPAINT_P(f) ((f)->visible>0) -#define FRAME_NO_SPLIT_P(f) ((f)->no_split) -#define FRAME_ICONIFIED_P(f) ((f)->iconified) -#define FRAME_FOCUS_FRAME(f) ((f)->focus_frame) -#define FRAME_MINIBUF_WINDOW(f) ((f)->minibuffer_window) -#define FRAME_ROOT_WINDOW(f) ((f)->root_window) -/* Catch people attempting to set this. */ -#define FRAME_SELECTED_WINDOW(f) NON_LVALUE ((f)->selected_window) -#define FRAME_SELECTED_XWINDOW(f) XWINDOW (FRAME_SELECTED_WINDOW (f)) -#define FRAME_LAST_NONMINIBUF_WINDOW(f) \ - NON_LVALUE ((f)->last_nonminibuf_window) -#define FRAME_SB_VCACHE(f) ((f)->sb_vcache) -#define FRAME_SB_HCACHE(f) ((f)->sb_hcache) -#define FRAME_SUBWINDOW_CACHE(f) ((f)->subwindow_instance_cache) - -#if 0 /* FSFmacs */ - -#define FRAME_VISIBLE_P(f) ((f)->visible != 0) -#define FRAME_SET_VISIBLE(f,p) \ - ((f)->async_visible = (p), FRAME_SAMPLE_VISIBILITY (f)) - -/* Emacs's redisplay code could become confused if a frame's - visibility changes at arbitrary times. For example, if a frame is - visible while the desired glyphs are being built, but becomes - invisible before they are updated, then some rows of the - desired_glyphs will be left marked as enabled after redisplay is - complete, which should never happen. The next time the frame - becomes visible, redisplay will probably barf. - - Currently, there are no similar situations involving iconified, but - the principle is the same. - - So instead of having asynchronous input handlers directly set and - clear the frame's visibility and iconification flags, they just set - the async_visible and async_iconified flags; the redisplay code - calls the FRAME_SAMPLE_VISIBILITY macro before doing any redisplay, - which sets visible and iconified from their asynchronous - counterparts. - - Synchronous code must use the FRAME_SET_VISIBLE macro. - - Also, if a frame used to be invisible, but has just become visible, - it must be marked as garbaged, since redisplay hasn't been keeping - up its contents. */ -#define FRAME_SAMPLE_VISIBILITY(f) \ - (((f)->async_visible && ! (f)->visible) ? SET_FRAME_GARBAGED (f) : 0, \ - (f)->visible = (f)->async_visible, \ - (f)->iconified = (f)->async_iconified) - -#endif /* FSFmacs */ - -#define FRAME_BORDER_WIDTH(f) ((f)->internal_border_width) -#define FRAME_BORDER_HEIGHT(f) ((f)->internal_border_width) - -/* This returns the frame-local value; that tells you what you should - use when computing the frame size. It is *not* the actual toolbar - size because that depends on the selected window. Use the macros - below for that. -*/ - -#ifdef HAVE_TOOLBARS -#define FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE(f, pos) \ - (!NILP((f)->toolbar_buttons[pos]) && !NILP ((f)->toolbar_visible_p[pos])) -#define FRAME_RAW_THEORETICAL_TOOLBAR_SIZE(f, pos) \ - (!NILP ((f)->toolbar_buttons[pos]) && INTP((f)->toolbar_size[pos]) ? \ - (XINT ((f)->toolbar_size[pos])) : 0) -#define FRAME_RAW_THEORETICAL_TOOLBAR_BORDER_WIDTH(f, pos) \ - (!NILP ((f)->toolbar_buttons[pos]) && INTP((f)->toolbar_border_width[pos]) ? \ - (XINT ((f)->toolbar_border_width[pos])) : 0) -#else -#define FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE(f, pos) 0 -#define FRAME_RAW_THEORETICAL_TOOLBAR_SIZE(f, pos) 0 -#define FRAME_RAW_THEORETICAL_TOOLBAR_BORDER_WIDTH(f, pos) 0 -#endif - -#define FRAME_THEORETICAL_TOOLBAR_SIZE(f, pos) \ - (FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE (f, pos) \ - ? FRAME_RAW_THEORETICAL_TOOLBAR_SIZE (f, pos) \ - : 0) - -#define FRAME_THEORETICAL_TOP_TOOLBAR_HEIGHT(f) \ - FRAME_THEORETICAL_TOOLBAR_SIZE (f, TOP_TOOLBAR) -#define FRAME_THEORETICAL_BOTTOM_TOOLBAR_HEIGHT(f) \ - FRAME_THEORETICAL_TOOLBAR_SIZE (f, BOTTOM_TOOLBAR) -#define FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH(f) \ - FRAME_THEORETICAL_TOOLBAR_SIZE (f, LEFT_TOOLBAR) -#define FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH(f) \ - FRAME_THEORETICAL_TOOLBAR_SIZE (f, RIGHT_TOOLBAR) - -#define FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH(f, pos) \ - (FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE (f, pos) \ - ? FRAME_RAW_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, pos) \ - : 0) - -#define FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH(f) \ - FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, TOP_TOOLBAR) -#define FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH(f) \ - FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, BOTTOM_TOOLBAR) -#define FRAME_THEORETICAL_LEFT_TOOLBAR_BORDER_WIDTH(f) \ - FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, LEFT_TOOLBAR) -#define FRAME_THEORETICAL_RIGHT_TOOLBAR_BORDER_WIDTH(f) \ - FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, RIGHT_TOOLBAR) - -/* This returns the window-local value rather than the frame-local value; - that tells you about what's actually visible rather than what should - be used when computing the frame size. */ - -#ifdef HAVE_TOOLBARS -#define FRAME_RAW_REAL_TOOLBAR_VISIBLE(f, pos) \ - (HAS_DEVMETH_P (XDEVICE (FRAME_DEVICE (f)), initialize_frame_toolbars) \ - && !NILP (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_visible_p[pos])) -#define FRAME_RAW_REAL_TOOLBAR_BORDER_WIDTH(f, pos) \ - ((INTP (XWINDOW \ - (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_border_width[pos])) ? \ - (XINT (XWINDOW \ - (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_border_width[pos])) \ - : 0) -#define FRAME_RAW_REAL_TOOLBAR_SIZE(f, pos) \ - ((INTP (XWINDOW \ - (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_size[pos])) ? \ - (XINT (XWINDOW \ - (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_size[pos])) : 0) -#define FRAME_REAL_TOOLBAR(f, pos) \ - (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar[pos]) -#else -#define FRAME_RAW_REAL_TOOLBAR_VISIBLE(f, pos) 0 -#define FRAME_RAW_REAL_TOOLBAR_BORDER_WIDTH(f, pos) 0 -#define FRAME_RAW_REAL_TOOLBAR_SIZE(f, pos) 0 -#define FRAME_REAL_TOOLBAR(f, pos) Qnil -#endif - -/* Note to Chuck - Note to Chuck - Note to Chuck: - - The former definitions of FRAME_REAL_FOO_TOOLBAR_VISIBLE - looked at the toolbar data to see what was there. The - current ones look at the current values of the specifiers. - This is a semantic change; the former definition returned - what was *actually* there right at the moment, while the - current one returns what *ought* to be there once redisplay - has run to completion. I think this new definition is more - correct in almost all circumstances and is much less likely - to lead to strange race conditions. I'm not completely - sure that there aren't some places in the redisplay code - that use these macros and expect the former semantics, so - if you encounter some odd toolbar behavior, you might want - to look into this. --ben */ - -#define FRAME_REAL_TOOLBAR_VISIBLE(f, pos) \ - ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \ - && FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos) > 0) \ - ? FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos) \ - : 0) -#define FRAME_REAL_TOOLBAR_SIZE(f, pos) \ - ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \ - && FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos)) \ - ? FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos) \ - : 0) -#define FRAME_REAL_TOOLBAR_BORDER_WIDTH(f, pos) \ - ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \ - && FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos)) \ - ? FRAME_RAW_REAL_TOOLBAR_BORDER_WIDTH (f, pos) \ - : 0) - -#define FRAME_REAL_TOP_TOOLBAR_HEIGHT(f) \ - FRAME_REAL_TOOLBAR_SIZE (f, TOP_TOOLBAR) -#define FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT(f) \ - FRAME_REAL_TOOLBAR_SIZE (f, BOTTOM_TOOLBAR) -#define FRAME_REAL_LEFT_TOOLBAR_WIDTH(f) \ - FRAME_REAL_TOOLBAR_SIZE (f, LEFT_TOOLBAR) -#define FRAME_REAL_RIGHT_TOOLBAR_WIDTH(f) \ - FRAME_REAL_TOOLBAR_SIZE (f, RIGHT_TOOLBAR) - -#define FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH(f) \ - FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, TOP_TOOLBAR) -#define FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH(f) \ - FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, BOTTOM_TOOLBAR) -#define FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH(f) \ - FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, LEFT_TOOLBAR) -#define FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH(f) \ - FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, RIGHT_TOOLBAR) - -#define FRAME_REAL_TOP_TOOLBAR_VISIBLE(f) \ - FRAME_REAL_TOOLBAR_VISIBLE (f, TOP_TOOLBAR) -#define FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE(f) \ - FRAME_REAL_TOOLBAR_VISIBLE (f, BOTTOM_TOOLBAR) -#define FRAME_REAL_LEFT_TOOLBAR_VISIBLE(f) \ - FRAME_REAL_TOOLBAR_VISIBLE (f, LEFT_TOOLBAR) -#define FRAME_REAL_RIGHT_TOOLBAR_VISIBLE(f) \ - FRAME_REAL_TOOLBAR_VISIBLE (f, RIGHT_TOOLBAR) - -#define FRAME_TOP_BORDER_START(f) \ - (FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) + \ - 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f)) -#define FRAME_TOP_BORDER_END(f) \ - (FRAME_TOP_BORDER_START (f) + FRAME_BORDER_HEIGHT (f)) - -#define FRAME_BOTTOM_BORDER_START(f) \ - (FRAME_PIXHEIGHT (f) - FRAME_BORDER_HEIGHT (f) - \ - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - \ - 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f)) -#define FRAME_BOTTOM_BORDER_END(f) \ - (FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - \ - 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f)) - -#define FRAME_LEFT_BORDER_START(f) \ - (FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) + \ - 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f)) -#define FRAME_LEFT_BORDER_END(f) \ - (FRAME_LEFT_BORDER_START (f) + FRAME_BORDER_WIDTH (f)) - -#define FRAME_RIGHT_BORDER_START(f) \ - (FRAME_PIXWIDTH (f) - FRAME_BORDER_WIDTH (f) - \ - FRAME_REAL_RIGHT_TOOLBAR_WIDTH(f) - \ - 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f)) -#define FRAME_RIGHT_BORDER_END(f) \ - (FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) - \ - 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH(f)) - /* Equivalent in FSF Emacs: FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a
--- a/src/glyphs-eimage.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/glyphs-eimage.c Thu Jun 20 21:19:10 2002 +0000 @@ -48,10 +48,10 @@ #include "lisp.h" #include "lstream.h" #include "console.h" -#include "device.h" +#include "device-impl.h" #include "faces.h" #include "glyphs.h" -#include "objects.h" +#include "objects-impl.h" #include "buffer.h" #include "frame.h"
--- a/src/glyphs-gtk.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/glyphs-gtk.c Thu Jun 20 21:19:10 2002 +0000 @@ -49,31 +49,30 @@ #include <config.h> #include "lisp.h" -#include "lstream.h" -#include "console-gtk.h" -#include "glyphs.h" -#include "glyphs-gtk.h" -#include "objects-gtk.h" -#include "gui-gtk.h" -#include "ui-gtk.h" #include "buffer.h" -#include "window.h" -#include "device.h" +#include "device-impl.h" +#include "faces.h" +#include "file-coding.h" +#include "frame-impl.h" +#include "glyphs.h" #include "gui.h" -#include "frame.h" +#include "imgproc.h" #include "insdel.h" +#include "lstream.h" #include "opaque.h" -#include "faces.h" - -#include "imgproc.h" +#include "window.h" + +#include "console-gtk-impl.h" +#include "glyphs-gtk.h" +#include "gui-gtk.h" +#include "objects-gtk-impl.h" +#include "ui-gtk.h" #include "sysfile.h" #include <setjmp.h> -#include "file-coding.h" - DECLARE_IMAGE_INSTANTIATOR_FORMAT (nothing); DECLARE_IMAGE_INSTANTIATOR_FORMAT (string); DECLARE_IMAGE_INSTANTIATOR_FORMAT (formatted_string); @@ -555,10 +554,6 @@ return Qnil; } - if (NILP (Vdefault_gtk_device)) - /* This may occur during intialization. */ - return Qnil; - if (NILP (Vgtk_bitmap_file_path)) { Vgtk_bitmap_file_path = nconc2 (Vgtk_bitmap_file_path,
--- a/src/glyphs-msw.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/glyphs-msw.c Thu Jun 20 21:19:10 2002 +0000 @@ -31,11 +31,11 @@ #include <config.h> #include "lisp.h" -#include "device.h" +#include "device-impl.h" #include "elhash.h" #include "faces.h" #include "file-coding.h" -#include "frame.h" +#include "frame-impl.h" #include "gui.h" #include "imgproc.h" #include "insdel.h" @@ -45,9 +45,9 @@ #include "sysfile.h" #include "window.h" -#include "console-msw.h" +#include "console-msw-impl.h" #include "glyphs-msw.h" -#include "objects-msw.h" +#include "objects-msw-impl.h" #define WIDGET_GLYPH_SLOT 0 @@ -1852,16 +1852,18 @@ return mswindows_get_hfont (XFONT_INSTANCE (font), under, strike); } +#ifdef DEFER_WINDOW_POS + static HDWP begin_defer_window_pos (struct frame *f) { -#ifdef DEFER_WINDOW_POS if (FRAME_MSWINDOWS_DATA (f)->hdwp == 0) FRAME_MSWINDOWS_DATA (f)->hdwp = BeginDeferWindowPos (10); -#endif return FRAME_MSWINDOWS_DATA (f)->hdwp; } +#endif + /* unmap the image if it is a widget. This is used by redisplay via redisplay_unmap_subwindows */ static void
--- a/src/glyphs-widget.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/glyphs-widget.c Thu Jun 20 21:19:10 2002 +0000 @@ -27,7 +27,7 @@ #include "bytecode.h" #include "console.h" -#include "device.h" +#include "device-impl.h" #include "faces.h" #include "frame.h" #include "glyphs.h"
--- a/src/glyphs-x.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/glyphs-x.c Thu Jun 20 21:19:10 2002 +0000 @@ -55,23 +55,24 @@ #include "lisp.h" #include "buffer.h" -#include "device.h" +#include "device-impl.h" #include "faces.h" #include "file-coding.h" -#include "frame.h" +#include "frame-impl.h" #include "gui.h" #include "imgproc.h" #include "insdel.h" #include "lstream.h" #include "opaque.h" +#include "process.h" /* egetenv() */ #include "window.h" -#include "console-x.h" +#include "console-x-impl.h" #include "glyphs-x.h" -#include "objects-x.h" #ifdef HAVE_X_WIDGETS #include "gui-x.h" #endif +#include "objects-x-impl.h" #include "xmu.h" #include "sysfile.h" @@ -574,12 +575,15 @@ return Qnil; } - if (NILP (Vdefault_x_device)) - /* This may occur during initialization. */ - return Qnil; - else - /* We only check the bitmapFilePath resource on the original X device. */ - display = DEVICE_X_DISPLAY (XDEVICE (Vdefault_x_device)); + { + Lisp_Object defx = get_default_device (Qx); + if (NILP (defx)) + /* This may occur during initialization. */ + return Qnil; + else + /* We only check the bitmapFilePath resource on the original X device. */ + display = DEVICE_X_DISPLAY (XDEVICE (defx)); + } #ifdef USE_XBMLANGPATH {
--- a/src/glyphs.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/glyphs.c Thu Jun 20 21:19:10 2002 +0000 @@ -33,14 +33,14 @@ #include "blocktype.h" #include "buffer.h" #include "chartab.h" -#include "device.h" +#include "device-impl.h" #include "elhash.h" #include "faces.h" -#include "frame.h" +#include "frame-impl.h" #include "glyphs.h" #include "gui.h" #include "insdel.h" -#include "objects.h" +#include "objects-impl.h" #include "opaque.h" #include "rangetab.h" #include "redisplay.h" @@ -187,7 +187,7 @@ } maybe_invalid_argument ("Invalid image-instantiator format", format, - Qimage, errb); + Qimage, errb); return 0; } @@ -1597,6 +1597,15 @@ return XIMAGE_INSTANCE_NAME (image_instance); } +DEFUN ("image-instance-instantiator", Fimage_instance_instantiator, 1, 1, 0, /* +Return the instantiator that was used to create the image instance. +*/ + (image_instance)) +{ + CHECK_IMAGE_INSTANCE (image_instance); + return XIMAGE_INSTANCE_INSTANTIATOR (image_instance); +} + DEFUN ("image-instance-domain", Fimage_instance_domain, 1, 1, 0, /* Return the governing domain of the given image instance. The governing domain of an image instance is the domain that the image @@ -5037,6 +5046,7 @@ DEFSUBR (Fimage_instance_type_list); DEFSUBR (Fimage_instance_name); DEFSUBR (Fimage_instance_domain); + DEFSUBR (Fimage_instance_instantiator); DEFSUBR (Fimage_instance_string); DEFSUBR (Fimage_instance_file_name); DEFSUBR (Fimage_instance_mask_file_name);
--- a/src/glyphs.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/glyphs.h Thu Jun 20 21:19:10 2002 +0000 @@ -25,7 +25,7 @@ #define INCLUDED_glyphs_h_ #include "specifier.h" -#include "window.h" /* need for GLYPH_CACHEL_WIDTH */ +#include "window-impl.h" /* need for GLYPH_CACHEL_WIDTH */ /************************************************************************/ /* Image Instantiators */
--- a/src/gui-gtk.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/gui-gtk.c Thu Jun 20 21:19:10 2002 +0000 @@ -1,6 +1,6 @@ /* General GUI code -- X-specific. (menubars, scrollbars, toolbars, dialogs) Copyright (C) 1995 Board of Trustees, University of Illinois. - Copyright (C) 1995, 1996 Ben Wing. + Copyright (C) 1995, 1996, 2002 Ben Wing. Copyright (C) 1995 Sun Microsystems, Inc. Copyright (C) 1998 Free Software Foundation, Inc. @@ -26,14 +26,15 @@ #include <config.h> #include "lisp.h" -#include "console-gtk.h" -#include "gui-gtk.h" #include "buffer.h" -#include "device.h" +#include "device-impl.h" #include "frame.h" #include "gui.h" #include "opaque.h" +#include "console-gtk-impl.h" +#include "gui-gtk.h" + #ifdef HAVE_POPUPS Lisp_Object Qmenu_no_selection_hook; #endif
--- a/src/gui-msw.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/gui-msw.c Thu Jun 20 21:19:10 2002 +0000 @@ -25,11 +25,11 @@ #include <config.h> #include "lisp.h" -#include "console-msw.h" +#include "console-msw-impl.h" #include "redisplay.h" #include "gui.h" #include "glyphs.h" -#include "frame.h" +#include "frame-impl.h" #include "elhash.h" #include "events.h" #include "buffer.h"
--- a/src/gui-x.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/gui-x.c Thu Jun 20 21:19:10 2002 +0000 @@ -28,19 +28,22 @@ #include <config.h> #include "lisp.h" -#include "console-x.h" +#include "buffer.h" +#include "device-impl.h" +#include "events.h" +#include "frame.h" +#include "glyphs.h" +#include "gui.h" +#include "menubar.h" +#include "opaque.h" +#include "redisplay.h" + +#include "console-x-impl.h" +#include "gui-x.h" + #ifdef LWLIB_USES_MOTIF #include <Xm/Xm.h> /* for XmVersion */ #endif -#include "gui-x.h" -#include "buffer.h" -#include "device.h" -#include "events.h" -#include "frame.h" -#include "gui.h" -#include "glyphs.h" -#include "redisplay.h" -#include "opaque.h" /* we need a unique id for each popup menu, dialog box, and scrollbar */ static LWLIB_ID lwlib_id_tick; @@ -219,9 +222,11 @@ struct device *d = get_device_from_display (XtDisplay (widget)); struct frame *f = x_any_widget_or_parent_to_frame (d, widget); +#ifdef HAVE_MENUBARS /* set in lwlib to the time stamp associated with the most recent menu operation */ extern Time x_focus_timestamp_really_sucks_fix_me_better; +#endif if (!f) return; @@ -291,7 +296,7 @@ /* This is the timestamp used for asserting focus so we need to get an up-to-date value event if no events have been dispatched to emacs */ -#if defined(HAVE_MENUBARS) +#ifdef HAVE_MENUBARS DEVICE_X_MOUSE_TIMESTAMP (d) = x_focus_timestamp_really_sucks_fix_me_better; #else DEVICE_X_MOUSE_TIMESTAMP (d) = DEVICE_X_GLOBAL_MOUSE_TIMESTAMP (d);
--- a/src/gui.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/gui.c Thu Jun 20 21:19:10 2002 +0000 @@ -27,10 +27,12 @@ #include <config.h> #include "lisp.h" -#include "gui.h" -#include "elhash.h" + #include "buffer.h" #include "bytecode.h" +#include "elhash.h" +#include "gui.h" +#include "menubar.h" Lisp_Object Qmenu_no_selection_hook; Lisp_Object Vmenu_no_selection_hook;
--- a/src/gutter.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/gutter.c Thu Jun 20 21:19:10 2002 +0000 @@ -27,8 +27,8 @@ #include "lisp.h" #include "buffer.h" -#include "frame.h" -#include "device.h" +#include "frame-impl.h" +#include "device-impl.h" #include "faces.h" #include "glyphs.h" #include "redisplay.h"
--- a/src/input-method-xlib.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/input-method-xlib.c Thu Jun 20 21:19:10 2002 +0000 @@ -71,15 +71,18 @@ #include <config.h> #include "lisp.h" + +#include "buffer.h" +#include "device-impl.h" +#include "events.h" +#include "frame-impl.h" +#include "window-impl.h" + +#include "console-x-impl.h" +#include "EmacsFrame.h" + #include <X11/Xlocale.h> /* More portable than <locale.h> ? */ #include <X11/Xlib.h> -#include "frame.h" -#include "device.h" -#include "window.h" -#include "buffer.h" -#include "console-x.h" -#include "EmacsFrame.h" -#include "events.h" #if !defined (XIM_XLIB) && !defined (USE_XFONTSET) #error neither XIM_XLIB nor USE_XFONTSET is defined??
--- a/src/intl-encap-win32.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/intl-encap-win32.c Thu Jun 20 21:19:10 2002 +0000 @@ -1925,6 +1925,8 @@ memcpy (dst, src, sizeof (LOGFONTA)); } +#if 0 /* unused */ + static void copy_enumlogfonta_to_enumlogfontw (const ENUMLOGFONTA *src, ENUMLOGFONTW *dst) { @@ -1940,6 +1942,8 @@ memcpy (dst->elfStyle, src->elfStyle, sizeof (src->elfStyle)); } +#endif /* 0 */ + static void copy_enumlogfontexa_to_enumlogfontexw (const ENUMLOGFONTEXA *src, ENUMLOGFONTEXW *dst) @@ -1997,6 +2001,8 @@ dst->ntmFontSig = src->ntmFontSig; } +#if 0 /* unused */ + static void copy_textmetricw_to_textmetrica (const TEXTMETRICW *src, TEXTMETRICA *dst) @@ -2014,6 +2020,8 @@ dst->tmBreakChar = (BYTE) src->tmBreakChar; } +#endif /* 0 */ + static void copy_textmetrica_to_textmetricw (const TEXTMETRICA *src, TEXTMETRICW *dst)
--- a/src/intl-win32.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/intl-win32.c Thu Jun 20 21:19:10 2002 +0000 @@ -38,11 +38,11 @@ #include "elhash.h" #include "faces.h" #include "file-coding.h" -#include "frame.h" -#include "window.h" +#include "frame-impl.h" +#include "window-impl.h" -#include "console-msw.h" -#include "objects-msw.h" +#include "console-msw-impl.h" +#include "objects-msw-impl.h" #ifndef CYGWIN_HEADERS # include <mbctype.h> @@ -64,6 +64,7 @@ #ifdef MULE static Lisp_Object Vmswindows_charset_code_page_table; +static Lisp_Object Vmswindows_charset_registry_table; LCID current_locale; @@ -1023,7 +1024,7 @@ #ifdef DEBUG_XEMACS -static int getacp (void); +int getacp (void); int getacp (void) { @@ -1270,6 +1271,56 @@ return charset; } +DEFUN ("mswindows-charset-registry", + Fmswindows_charset_registry, 1, 1, 0, /* +Return the registry for the CHARSET. +This is the last item in an MS Windows font spec. + +#### This function may be changed in the near future. +*/ + (charset)) +{ + charset = Fget_charset (charset); + return Fgethash (charset, Vmswindows_charset_registry_table, Qnil); +} + +DEFUN ("mswindows-set-charset-registry", + Fmswindows_set_charset_registry, 2, 2, 0, /* +Set the REGISTRY for the CHARSET. + +#### This function may be changed once full Unicode support is present. +*/ + (charset, registry)) +{ + charset = Fget_charset (charset); + CHECK_STRING (registry); + Fputhash (charset, registry, Vmswindows_charset_registry_table); + invalidate_charset_font_caches (charset); + face_property_was_changed (Vdefault_face, Qfont, Qglobal); + return Qnil; +} + +Lisp_Object +mswindows_get_registry_charset (Ibyte *registry) +{ + Lisp_Object charset_tail; + Lisp_Object charset = Qunbound; + + LIST_LOOP (charset_tail, Fcharset_list ()) + { + Lisp_Object charset_registry; + + charset_registry = Fmswindows_charset_registry (XCAR (charset_tail)); + if (STRINGP (charset_registry) && + !qxestrcasecmp (XSTRING_DATA (charset_registry), registry)) + { + charset = Fget_charset (XCAR (charset_tail)); + break; + } + } + return charset; +} + #if 0 /* #### from Emacs 20.6; consider porting */ @@ -2126,6 +2177,8 @@ DEFSUBR (Fmswindows_supported_locales); DEFSUBR (Fmswindows_charset_code_page); DEFSUBR (Fmswindows_set_charset_code_page); + DEFSUBR (Fmswindows_charset_registry); + DEFSUBR (Fmswindows_set_charset_registry); #if 0 DEFSUBR (Fmswindows_get_locale_info); @@ -2198,6 +2251,9 @@ Vmswindows_charset_code_page_table = make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); staticpro (&Vmswindows_charset_code_page_table); + Vmswindows_charset_registry_table = + make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); + staticpro (&Vmswindows_charset_registry_table); #endif /* MULE */ }
--- a/src/keymap.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/keymap.c Thu Jun 20 21:19:10 2002 +0000 @@ -31,9 +31,10 @@ #include "buffer.h" #include "bytecode.h" -#include "console.h" +#include "console-impl.h" #include "elhash.h" #include "events.h" +#include "extents.h" #include "frame.h" #include "insdel.h" #include "keymap.h"
--- a/src/lisp.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/lisp.h Thu Jun 20 21:19:10 2002 +0000 @@ -1284,14 +1284,14 @@ typedef unsigned int USID; typedef int face_index; typedef int glyph_index; -typedef struct lstream Lstream; -typedef struct extent *EXTENT; +typedef struct lstream Lstream; /* lstream-impl.h */ +typedef struct extent *EXTENT; /* extents-impl.h */ typedef struct Lisp_Event Lisp_Event; /* "events.h" */ -typedef struct Lisp_Face Lisp_Face; /* "faces.h" */ +typedef struct Lisp_Face Lisp_Face; /* "faces-impl.h" */ typedef struct Lisp_Process Lisp_Process; /* "procimpl.h" */ -typedef struct Lisp_Color_Instance Lisp_Color_Instance; -typedef struct Lisp_Font_Instance Lisp_Font_Instance; -typedef struct Lisp_Image_Instance Lisp_Image_Instance; +typedef struct Lisp_Color_Instance Lisp_Color_Instance; /* objects-impl.h */ +typedef struct Lisp_Font_Instance Lisp_Font_Instance; /* objects-impl.h */ +typedef struct Lisp_Image_Instance Lisp_Image_Instance; /* glyphs-impl.h */ typedef struct Lisp_Gui_Item Lisp_Gui_Item; /* ------------------------------- */ @@ -3457,16 +3457,6 @@ EXFUN (Fforward_char, 2); EXFUN (Fforward_line, 2); -/* Defined in console.c */ -void stuff_buffered_input (Lisp_Object); - -/* Defined in console-msw.c */ -EXFUN (Fmswindows_message_box, 3); -extern int mswindows_message_outputted; -void mswindows_hide_console (void); -int mswindows_output_console_string (const Ibyte *ptr, Bytecount len); -void write_string_to_mswindows_debugging_output (Ibyte *str, Bytecount len); - /* Defined in data.c */ EXFUN (Fadd1, 1); EXFUN (Faref, 2); @@ -3977,71 +3967,6 @@ EXFUN (Fevent_y_pixel, 1); -/* Defined in extents.c */ -EXFUN (Fextent_at, 5); -EXFUN (Fextent_property, 3); -EXFUN (Fput_text_property, 5); - -EXFUN (Fdetach_extent, 1); -EXFUN (Fextent_end_position, 1); -EXFUN (Fextent_object, 1); -EXFUN (Fextent_properties, 1); -EXFUN (Fextent_start_position, 1); -EXFUN (Fget_char_property, 4); -EXFUN (Fmake_extent, 3); -EXFUN (Fnext_extent_change, 2); -EXFUN (Fprevious_extent_change, 2); -EXFUN (Fprevious_single_property_change, 4); -EXFUN (Fset_extent_endpoints, 4); -EXFUN (Fset_extent_parent, 2); -EXFUN (Fset_extent_property, 3); - -enum extent_at_flag -{ - EXTENT_AT_DEFAULT = 0, - EXTENT_AT_AFTER = 0, - EXTENT_AT_BEFORE, - EXTENT_AT_AT -}; - -Bytexpos extent_endpoint_byte (EXTENT extent, int endp); -Charxpos extent_endpoint_char (EXTENT extent, int endp); -Bytexpos next_single_property_change (Bytexpos pos, Lisp_Object prop, - Lisp_Object object, Bytexpos limit); -Bytexpos previous_single_property_change (Bytexpos pos, Lisp_Object prop, - Lisp_Object object, Bytexpos limit); -Lisp_Object get_char_property (Bytexpos position, Lisp_Object prop, - Lisp_Object object, enum extent_at_flag fl, - int text_props_only); -void adjust_extents (Lisp_Object object, Memxpos from, - Memxpos to, int amount); -void adjust_extents_for_deletion (Lisp_Object object, Bytexpos from, - Bytexpos to, int gapsize, - int numdel, int movegapsize); -void verify_extent_modification (Lisp_Object object, Bytexpos from, - Bytexpos to, - Lisp_Object inhibit_read_only_value); -void process_extents_for_insertion (Lisp_Object object, - Bytexpos opoint, Bytecount length); -void process_extents_for_deletion (Lisp_Object object, Bytexpos from, - Bytexpos to, int destroy_them); -/* Note the following function is in Charbpos's */ -void report_extent_modification (Lisp_Object buffer, Charbpos start, - Charbpos end, int afterp); -void add_string_extents (Lisp_Object string, struct buffer *buf, - Bytexpos opoint, Bytecount length); -void splice_in_string_extents (Lisp_Object string, struct buffer *buf, - Bytexpos opoint, Bytecount length, - Bytecount pos); -void copy_string_extents (Lisp_Object new_string, - Lisp_Object old_string, - Bytecount new_pos, Bytecount old_pos, - Bytecount length); -void detach_all_extents (Lisp_Object object); -Lisp_Object extent_at (Bytexpos position, Lisp_Object object, - Lisp_Object property, EXTENT before, - enum extent_at_flag at_flag, int all_extents); - /* Defined in file-coding.c */ EXFUN (Fcoding_category_list, 0); EXFUN (Fcoding_category_system, 1); @@ -4240,9 +4165,6 @@ Lisp_Object add_prefix_to_symbol (const Char_ASCII *ascii_string, Lisp_Object symbol); -/* Defined in frame.c */ -EXFUN (Fselected_frame, 1); - /* Defined in free-hook.c */ EXFUN (Freally_free, 1); @@ -4283,20 +4205,6 @@ /* Defined in intl.c */ EXFUN (Fgettext, 1); - -/* Defined in intl-win32.c */ -EXFUN (Fmswindows_set_current_locale, 1); -EXFUN (Fmswindows_current_locale, 0); -EXFUN (Fmswindows_user_default_locale, 0); -EXFUN (Fmswindows_system_default_locale, 0); -EXFUN (Fmswindows_locale_code_page, 1); -EXFUN (Fmswindows_supported_locales, 0); -EXFUN (Fmswindows_charset_code_page, 1); -EXFUN (Fmswindows_set_charset_code_page, 2); - -extern Lisp_Object Qmswindows_tstr, Qmswindows_unicode; -extern Lisp_Object Qmswindows_multibyte, Qmswindows_multibyte_to_unicode; - /* Defined in keymap.c */ EXFUN (Fdefine_key, 3); EXFUN (Fkey_description, 1); @@ -4354,11 +4262,6 @@ void init_buffer_markers (struct buffer *b); void uninit_buffer_markers (struct buffer *b); -/* Defined in menubar.c */ -extern int popup_menu_up_p; -extern int menubar_show_keybindings; -extern int popup_menu_titles; - /* Defined in minibuf.c */ extern int minibuf_level; Charcount scmp_1 (const Ibyte *, const Ibyte *, Charcount, int); @@ -4450,20 +4353,6 @@ void debug_short_backtrace (int); void debug_backtrace (void); -/* Defined in process.c */ -EXFUN (Fdelete_process, 1); -EXFUN (Fget_buffer_process, 1); -EXFUN (Fget_process, 1); -EXFUN (Fprocess_status, 1); - -DECLARE_DOESNT_RETURN (report_process_error (const char *, Lisp_Object)); -DECLARE_DOESNT_RETURN (report_network_error (const char *, Lisp_Object)); -extern Lisp_Object Vlisp_EXEC_SUFFIXES; - -Ibyte *egetenv (const CIbyte *var); -void eputenv (const CIbyte *var, const CIbyte *value); -extern int env_initted; - /* Defined in profile.c */ void mark_profiling_info (void); void profile_increase_call_count (Lisp_Object); @@ -4512,7 +4401,6 @@ Lisp_Object, Bytecount, Bytecount, int, Error_Behavior, int); Bytecount fast_lisp_string_match (Lisp_Object, Lisp_Object); -void restore_match_data (void); extern Fixnum warn_about_possibly_incompatible_back_references; @@ -4965,12 +4853,6 @@ /* Defined in vm-limit.c */ void memory_warnings (void *, void (*) (const char *)); -/* Defined in window.c */ -EXFUN (Fcurrent_window_configuration, 1); - -Lisp_Object save_window_excursion_unwind (Lisp_Object); -Lisp_Object display_buffer (Lisp_Object, Lisp_Object, Lisp_Object); - /*--------------- prototypes for constant symbols ------------*/ /* #### We should get rid of this and put the prototypes back up there in
--- a/src/macros.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/macros.c Thu Jun 20 21:19:10 2002 +0000 @@ -33,7 +33,7 @@ #include "buffer.h" #include "commands.h" -#include "console.h" +#include "console-impl.h" #include "device.h" #include "events.h" #include "frame.h"
--- a/src/menubar-gtk.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/menubar-gtk.c Thu Jun 20 21:19:10 2002 +0000 @@ -26,19 +26,19 @@ #include <config.h> #include "lisp.h" -#include "console-gtk.h" -#include "gui-gtk.h" - #include "buffer.h" #include "commands.h" /* zmacs_regions */ -#include "ui-gtk.h" -#include "gui.h" +#include "device.h" #include "events.h" -#include "frame.h" -#include "device.h" +#include "frame-impl.h" +#include "gui.h" #include "opaque.h" #include "window.h" +#include "console-gtk-impl.h" +#include "gui-gtk.h" +#include "ui-gtk.h" + #ifdef HAVE_GNOME #include <libgnomeui/libgnomeui.h> #endif
--- a/src/menubar-msw.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/menubar-msw.c Thu Jun 20 21:19:10 2002 +0000 @@ -84,16 +84,16 @@ #include "buffer.h" #include "commands.h" -#include "console-msw.h" +#include "console-msw-impl.h" #include "elhash.h" #include "events.h" -#include "frame.h" +#include "frame-impl.h" #include "gui.h" #include "lisp.h" #include "menubar.h" #include "menubar-msw.h" #include "opaque.h" -#include "window.h" +#include "window-impl.h" /* #### */ #define REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIGHT_FLUSH 0
--- a/src/menubar-x.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/menubar-x.c Thu Jun 20 21:19:10 2002 +0000 @@ -38,16 +38,16 @@ #include "buffer.h" #include "commands.h" /* zmacs_regions */ -#include "device.h" +#include "device-impl.h" #include "events.h" -#include "frame.h" +#include "frame-impl.h" #include "gui.h" #include "keymap.h" #include "menubar.h" #include "opaque.h" -#include "window.h" +#include "window-impl.h" -#include "console-x.h" +#include "console-x-impl.h" #include "gui-x.h" #include "EmacsFrame.h"
--- a/src/menubar.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/menubar.c Thu Jun 20 21:19:10 2002 +0000 @@ -34,14 +34,14 @@ #include "lisp.h" #include "buffer.h" -#include "device.h" -#include "frame.h" +#include "device-impl.h" +#include "frame-impl.h" #include "gui.h" #include "keymap.h" #include "menubar.h" #include "redisplay.h" #include "specifier.h" -#include "window.h" +#include "window-impl.h" int menubar_show_keybindings; Lisp_Object Vmenubar_configuration;
--- a/src/menubar.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/menubar.h Thu Jun 20 21:19:10 2002 +0000 @@ -31,7 +31,7 @@ void free_frame_menubars (struct frame *f); Lisp_Object menu_parse_submenu_keywords (Lisp_Object desc, Lisp_Object gui_item); -Lisp_Object current_frame_menubar (const struct frame* f); +Lisp_Object current_frame_menubar (const struct frame *f); EXFUN (Fmenu_find_real_submenu, 2); @@ -55,7 +55,7 @@ /* #### kluuuuuuuuuuuuuuuuuuuuuuuuuuuudge! The author of the accelerator code didn't know what the hell he was doing. Someone needs to abstract this properly. */ -#if defined(HAVE_X_WINDOWS) && defined(LWLIB_MENUBARS_LUCID) +#if defined (HAVE_X_WINDOWS) && defined (LWLIB_MENUBARS_LUCID) extern int x_kludge_lw_menu_active (void); struct command_builder; Lisp_Object command_builder_find_menu_accelerator (struct command_builder @@ -66,6 +66,10 @@ extern int in_menu_callback; #endif +extern int popup_menu_up_p; +extern int menubar_show_keybindings; +extern int popup_menu_titles; + #endif /* HAVE_MENUBARS */ #endif /* INCLUDED_menubar_h_ */
--- a/src/minibuf.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/minibuf.c Thu Jun 20 21:19:10 2002 +0000 @@ -33,10 +33,10 @@ #include "commands.h" #include "console-stream.h" #include "events.h" -#include "frame.h" +#include "frame-impl.h" #include "insdel.h" #include "redisplay.h" -#include "window.h" +#include "window-impl.h" /* Depth in minibuffer invocations. */ int minibuf_level;
--- a/src/mule-charset.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/mule-charset.c Thu Jun 20 21:19:10 2002 +0000 @@ -34,6 +34,7 @@ #include "faces.h" #include "lstream.h" #include "mule-ccl.h" +#include "objects.h" /* The various pre-defined charsets. */ @@ -858,20 +859,6 @@ return Qnil; } -static void -invalidate_charset_font_caches (Lisp_Object charset) -{ - /* Invalidate font cache entries for charset on all devices. */ - Lisp_Object devcons, concons, hash_table; - DEVICE_LOOP_NO_BREAK (devcons, concons) - { - struct device *d = XDEVICE (XCAR (devcons)); - hash_table = Fgethash (charset, d->charset_font_cache, Qunbound); - if (!UNBOUNDP (hash_table)) - Fclrhash (hash_table); - } -} - /* Japanese folks may want to (set-charset-registry 'ascii "jisx0201") */ DEFUN ("set-charset-registry", Fset_charset_registry, 2, 2, 0, /* Set the 'registry property of CHARSET to REGISTRY.
--- a/src/nt.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/nt.c Thu Jun 20 21:19:10 2002 +0000 @@ -39,6 +39,7 @@ #include "lisp.h" #include "buffer.h" +#include "process.h" #include "sysdir.h" #include "sysfile.h" @@ -1199,7 +1200,7 @@ result = rename (tempext, newext); if (result < 0 - && errno == EEXIST + && (errno == EEXIST || errno == EACCES) && _chmod (newext, 0666) == 0 && _unlink (newext) == 0) result = rename (tempext, newext);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/objects-gtk-impl.h Thu Jun 20 21:19:10 2002 +0000 @@ -0,0 +1,62 @@ +/* Gtk-specific Lisp objects. + Copyright (C) 1993, 1994 Free Software Foundation, Inc. + Copyright (C) 1995 Board of Trustees, University of Illinois. + Copyright (C) 1995, 1996 Ben Wing. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ +/* Gtk version by William Perry */ + +#ifndef _XEMACS_OBJECTS_GTK_IMPL_H_ +#define _XEMACS_OBJECTS_GTK_IMPL_H_ + +#include "objects-impl.h" +#include "objects-gtk.h" + +#ifdef HAVE_GTK + +/***************************************************************************** + Color-Instance + ****************************************************************************/ + +struct gtk_color_instance_data +{ + GdkColor *color; + char dealloc_on_gc; +}; + +#define GTK_COLOR_INSTANCE_DATA(c) ((struct gtk_color_instance_data *) (c)->data) +#define COLOR_INSTANCE_GTK_COLOR(c) (GTK_COLOR_INSTANCE_DATA (c)->color) +#define COLOR_INSTANCE_GTK_DEALLOC(c) (GTK_COLOR_INSTANCE_DATA (c)->dealloc_on_gc) + +/***************************************************************************** + Font-Instance + ****************************************************************************/ + +struct gtk_font_instance_data +{ + /* Gtk-specific information */ + GdkFont *font; +}; + +#define GTK_FONT_INSTANCE_DATA(f) ((struct gtk_font_instance_data *) (f)->data) +#define FONT_INSTANCE_GTK_FONT(f) (GTK_FONT_INSTANCE_DATA (f)->font) + +#endif /* HAVE_GTK */ +#endif /* _XEMACS_OBJECTS_GTK_IMPL_H_ */
--- a/src/objects-gtk.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/objects-gtk.c Thu Jun 20 21:19:10 2002 +0000 @@ -2,7 +2,7 @@ Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Board of Trustees, University of Illinois. Copyright (C) 1995 Tinker Systems. - Copyright (C) 1995, 1996 Ben Wing. + Copyright (C) 1995, 1996, 2002 Ben Wing. Copyright (C) 1995 Sun Microsystems, Inc. This file is part of XEmacs. @@ -30,12 +30,12 @@ #include <config.h> #include "lisp.h" -#include "console-gtk.h" -#include "objects-gtk.h" +#include "buffer.h" +#include "device-impl.h" +#include "insdel.h" -#include "buffer.h" -#include "device.h" -#include "insdel.h" +#include "console-gtk-impl.h" +#include "objects-gtk-impl.h" /* sigh */ #include <gdk/gdkx.h> @@ -235,7 +235,6 @@ /* Don't allocate the data until we're sure that we will succeed, or the finalize method may get fucked. */ f->data = xnew (struct gtk_font_instance_data); - FONT_INSTANCE_GTK_TRUENAME (f) = Qnil; FONT_INSTANCE_GTK_FONT (f) = gf; f->ascent = gf->ascent; f->descent = gf->descent; @@ -306,12 +305,6 @@ } static void -gtk_mark_font_instance (struct Lisp_Font_Instance *f) -{ - mark_object (FONT_INSTANCE_GTK_TRUENAME (f)); -} - -static void gtk_print_font_instance (struct Lisp_Font_Instance *f, Lisp_Object printcharfun, int escapeflag) @@ -341,18 +334,18 @@ static Lisp_Object gtk_font_instance_truename (struct Lisp_Font_Instance *f, Error_Behavior errb) { - if (NILP (FONT_INSTANCE_GTK_TRUENAME (f))) + if (NILP (FONT_INSTANCE_TRUENAME (f))) { - FONT_INSTANCE_GTK_TRUENAME (f) = __get_gtk_font_truename (FONT_INSTANCE_GTK_FONT (f), 1); + FONT_INSTANCE_TRUENAME (f) = __get_gtk_font_truename (FONT_INSTANCE_GTK_FONT (f), 1); - if (NILP (FONT_INSTANCE_GTK_TRUENAME (f))) + if (NILP (FONT_INSTANCE_TRUENAME (f))) { /* Ok, just this once, return the font name as the truename. (This is only used by Fequal() right now.) */ return f->name; } } - return (FONT_INSTANCE_GTK_TRUENAME (f)); + return (FONT_INSTANCE_TRUENAME (f)); } static Lisp_Object @@ -380,8 +373,12 @@ static int gtk_font_spec_matches_charset (struct device *d, Lisp_Object charset, const Ibyte *nonreloc, Lisp_Object reloc, - Bytecount offset, Bytecount length) + Bytecount offset, Bytecount length, + int stage) { + if (stage) + return 0; + if (UNBOUNDP (charset)) return 1; /* Hack! Short font names don't have the registry in them, @@ -456,7 +453,6 @@ CONSOLE_HAS_METHOD (gtk, valid_color_name_p); CONSOLE_HAS_METHOD (gtk, initialize_font_instance); - CONSOLE_HAS_METHOD (gtk, mark_font_instance); CONSOLE_HAS_METHOD (gtk, print_font_instance); CONSOLE_HAS_METHOD (gtk, finalize_font_instance); CONSOLE_HAS_METHOD (gtk, font_instance_truename); @@ -484,7 +480,8 @@ /* find a font spec that matches font spec FONT and also matches (the registry of) CHARSET. */ static Lisp_Object -gtk_find_charset_font (Lisp_Object device, Lisp_Object font, Lisp_Object charset) +gtk_find_charset_font (Lisp_Object device, Lisp_Object font, + Lisp_Object charset, int stage) { char **names; int count = 0; @@ -492,6 +489,9 @@ const char *patternext; int i; + if (stage) + return Qnil; + TO_EXTERNAL_FORMAT (LISP_STRING, font, C_STRING_ALLOCA, patternext, Qbinary); names = XListFonts (GDK_DISPLAY (), @@ -505,7 +505,7 @@ TO_INTERNAL_FORMAT (C_STRING, names[i], ALLOCA, (intname, intlen), Qctext); if (gtk_font_spec_matches_charset (XDEVICE (device), charset, - intname, Qnil, 0, -1)) + intname, Qnil, 0, -1, 0)) { result = make_string ((char *) intname, intlen); break; @@ -518,7 +518,7 @@ /* Check for a short font name. */ if (NILP (result) && gtk_font_spec_matches_charset (XDEVICE (device), charset, 0, - font, 0, -1)) + font, 0, -1, 0)) return font; return result;
--- a/src/objects-gtk.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/objects-gtk.h Thu Jun 20 21:19:10 2002 +0000 @@ -34,16 +34,6 @@ Color-Instance ****************************************************************************/ -struct gtk_color_instance_data -{ - GdkColor *color; - char dealloc_on_gc; -}; - -#define GTK_COLOR_INSTANCE_DATA(c) ((struct gtk_color_instance_data *) (c)->data) -#define COLOR_INSTANCE_GTK_COLOR(c) (GTK_COLOR_INSTANCE_DATA (c)->color) -#define COLOR_INSTANCE_GTK_DEALLOC(c) (GTK_COLOR_INSTANCE_DATA (c)->dealloc_on_gc) - int allocate_nearest_color (GdkColormap *screen_colormap, GdkVisual *visual, GdkColor *color_def); int gtk_parse_nearest_color (struct device *d, GdkColor *color, Ibyte *name, @@ -53,16 +43,5 @@ Font-Instance ****************************************************************************/ -struct gtk_font_instance_data -{ - /* Gtk-specific information */ - Lisp_Object truename; - GdkFont *font; -}; - -#define GTK_FONT_INSTANCE_DATA(f) ((struct gtk_font_instance_data *) (f)->data) -#define FONT_INSTANCE_GTK_FONT(f) (GTK_FONT_INSTANCE_DATA (f)->font) -#define FONT_INSTANCE_GTK_TRUENAME(f) (GTK_FONT_INSTANCE_DATA (f)->truename) - #endif /* HAVE_GTK */ #endif /* _XEMACS_OBJECTS_GTK_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/objects-impl.h Thu Jun 20 21:19:10 2002 +0000 @@ -0,0 +1,154 @@ +/* Generic object functions -- header implementation. + Copyright (C) 1995 Board of Trustees, University of Illinois. + Copyright (C) 1995, 1996, 2002 Ben Wing. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +#ifndef INCLUDED_objects_impl_h_ +#define INCLUDED_objects_impl_h_ + +#include "specifier.h" +#include "objects.h" + +/***************************************************************************** + * Color Specifier Object * + *****************************************************************************/ + +struct color_specifier +{ + Lisp_Object face; /* face this is attached to, or nil */ + Lisp_Object face_property; /* property of that face */ +}; + +#define COLOR_SPECIFIER_DATA(g) SPECIFIER_TYPE_DATA (g, color) +#define COLOR_SPECIFIER_FACE(g) (COLOR_SPECIFIER_DATA (g)->face) +#define COLOR_SPECIFIER_FACE_PROPERTY(g) \ + (COLOR_SPECIFIER_DATA (g)->face_property) + +DECLARE_SPECIFIER_TYPE (color); +#define XCOLOR_SPECIFIER(x) XSPECIFIER_TYPE (x, color) +#define COLOR_SPECIFIERP(x) SPECIFIER_TYPEP (x, color) +#define CHECK_COLOR_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, color) +#define CONCHECK_COLOR_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, color) + +/***************************************************************************** + * Font Specifier Object * + *****************************************************************************/ + +struct font_specifier +{ + Lisp_Object face; /* face this is attached to, or nil */ + Lisp_Object face_property; /* property of that face */ +}; + +#define FONT_SPECIFIER_DATA(g) SPECIFIER_TYPE_DATA (g, font) +#define FONT_SPECIFIER_FACE(g) (FONT_SPECIFIER_DATA (g)->face) +#define FONT_SPECIFIER_FACE_PROPERTY(g) \ + (FONT_SPECIFIER_DATA (g)->face_property) + +DECLARE_SPECIFIER_TYPE (font); +#define XFONT_SPECIFIER(x) XSPECIFIER_TYPE (x, font) +#define FONT_SPECIFIERP(x) SPECIFIER_TYPEP (x, font) +#define CHECK_FONT_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, font) +#define CONCHECK_FONT_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, font) + +/***************************************************************************** + * Face Boolean Specifier Object * + *****************************************************************************/ + +struct face_boolean_specifier +{ + Lisp_Object face; /* face this is attached to, or nil */ + Lisp_Object face_property; /* property of that face */ +}; + +#define FACE_BOOLEAN_SPECIFIER_DATA(g) SPECIFIER_TYPE_DATA (g, face_boolean) +#define FACE_BOOLEAN_SPECIFIER_FACE(g) (FACE_BOOLEAN_SPECIFIER_DATA (g)->face) +#define FACE_BOOLEAN_SPECIFIER_FACE_PROPERTY(g) \ + (FACE_BOOLEAN_SPECIFIER_DATA (g)->face_property) + +DECLARE_SPECIFIER_TYPE (face_boolean); +extern Lisp_Object Qface_boolean; +#define XFACE_BOOLEAN_SPECIFIER(x) XSPECIFIER_TYPE (x, face_boolean) +#define FACE_BOOLEAN_SPECIFIERP(x) SPECIFIER_TYPEP (x, face_boolean) +#define CHECK_FACE_BOOLEAN_SPECIFIER(x) \ + CHECK_SPECIFIER_TYPE (x, face_boolean) +#define CONCHECK_FACE_BOOLEAN_SPECIFIER(x) \ + CONCHECK_SPECIFIER_TYPE (x, face_boolean) + +/**************************************************************************** + * Color Instance Object * + ****************************************************************************/ + +struct Lisp_Color_Instance +{ + struct lcrecord_header header; + Lisp_Object name; + Lisp_Object device; + + /* console-type-specific data */ + void *data; +}; + +#define COLOR_INSTANCE_NAME(c) ((c)->name) +#define COLOR_INSTANCE_DEVICE(c) ((c)->device) + +/**************************************************************************** + * Font Instance Object * + ****************************************************************************/ + +struct Lisp_Font_Instance +{ + struct lcrecord_header header; + Lisp_Object name; /* the instantiator used to create the font instance */ + Lisp_Object truename; /* used by the device-specific methods; we need to + call them to get the truename (#### in reality, + they all probably just store the truename here + if they know it, and nil otherwise; we should + check this and enforce it as a general policy) */ + Lisp_Object device; + + unsigned short ascent; /* extracted from `font', or made up */ + unsigned short descent; + unsigned short width; + unsigned short height; + int proportional_p; + + /* console-type-specific data */ + void *data; +}; + +#define FONT_INSTANCE_NAME(f) ((f)->name) +#define FONT_INSTANCE_TRUENAME(f) ((f)->name) +#define FONT_INSTANCE_DEVICE(f) ((f)->device) +#define FONT_INSTANCE_ASCENT(f) ((f)->ascent) +#define FONT_INSTANCE_DESCENT(f) ((f)->descent) +#define FONT_INSTANCE_WIDTH(f) ((f)->width) +#define FONT_INSTANCE_HEIGHT(f) ((f)->height) + +#define XFONT_INSTANCE_NAME(f) FONT_INSTANCE_NAME (XFONT_INSTANCE (f)) +#define XFONT_INSTANCE_TRUENAME(f) FONT_INSTANCE_TRUENAME (XFONT_INSTANCE (f)) +#define XFONT_INSTANCE_DEVICE(f) FONT_INSTANCE_DEVICE (XFONT_INSTANCE (f)) +#define XFONT_INSTANCE_ASCENT(f) FONT_INSTANCE_ASCENT (XFONT_INSTANCE (f)) +#define XFONT_INSTANCE_DESCENT(f) FONT_INSTANCE_DESCENT (XFONT_INSTANCE (f)) +#define XFONT_INSTANCE_WIDTH(f) FONT_INSTANCE_WIDTH (XFONT_INSTANCE (f)) +#define XFONT_INSTANCE_HEIGHT(f) FONT_INSTANCE_HEIGHT (XFONT_INSTANCE (f)) + +#endif /* INCLUDED_objects_impl_h_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/objects-msw-impl.h Thu Jun 20 21:19:10 2002 +0000 @@ -0,0 +1,75 @@ +/* mswindows-specific Lisp objects -- header implementation. + Copyright (C) 1993, 1994 Free Software Foundation, Inc. + Copyright (C) 1995 Board of Trustees, University of Illinois. + Copyright (C) 1995, 1996, 2002 Ben Wing. + Copyright (C) 1997, Jonathan Harris. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +/* Authorship: + + Ultimately based on FSF. + Rewritten by Ben Wing. + Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0. + */ + + +#ifndef INCLUDED_objects_msw_impl_h_ +#define INCLUDED_objects_msw_impl_h_ + +#include "objects-impl.h" +#include "objects-msw.h" + +struct mswindows_color_instance_data +{ + COLORREF color; +}; + +#define MSWINDOWS_COLOR_INSTANCE_DATA(c) \ + ((struct mswindows_color_instance_data *) (c)->data) +#define COLOR_INSTANCE_MSWINDOWS_COLOR(c) \ + (MSWINDOWS_COLOR_INSTANCE_DATA (c)->color) + +/* The four HFONTS are for the 4 (underlined, strikethrough) + combinations. Only the one at index 0, neither underlined nor + struk through is created with the font instance. Other fonts are + created as necessary during redisplay, using the one at index 0 + as prototype */ +#define MSWINDOWS_NUM_FONT_VARIANTS 4 +struct mswindows_font_instance_data +{ + HFONT hfont [MSWINDOWS_NUM_FONT_VARIANTS]; +}; + +#define MSWINDOWS_FONT_INSTANCE_DATA(c) \ + ((struct mswindows_font_instance_data *) (c)->data) + +#define FONT_INSTANCE_MSWINDOWS_HFONT_I(c,i) \ + (MSWINDOWS_FONT_INSTANCE_DATA(c)->hfont[(i)]) + +#define FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT(c,under,strike) \ + FONT_INSTANCE_MSWINDOWS_HFONT_I (c, (!!(strike)<<1)|!!(under)) + +/* If font creation during redisplay fails, then the following + value is used to prevent future attempts to create this font. + Redisplay uses the "main" font when encounters this value */ +#define MSWINDOWS_BAD_HFONT ((HFONT)INVALID_HANDLE_VALUE) + +#endif /* INCLUDED_objects_msw_impl_h_ */
--- a/src/objects-msw.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/objects-msw.c Thu Jun 20 21:19:10 2002 +0000 @@ -38,12 +38,12 @@ #include <config.h> #include "lisp.h" -#include "console-msw.h" -#include "objects-msw.h" +#include "console-msw-impl.h" +#include "objects-msw-impl.h" #include "buffer.h" #include "charset.h" -#include "device.h" +#include "device-impl.h" #include "elhash.h" #include "insdel.h" #include "opaque.h" @@ -751,8 +751,8 @@ {"Black" , FW_BLACK} }; -/* Default charset first, no synonyms allowed because these names are - * matched against the names reported by win32 by match_font() */ +/* Default charset must be listed first, no synonyms allowed because these + * names are matched against the names reported by win32 by match_font() */ static const fontmap_t charset_map[] = { {"Western" , ANSI_CHARSET}, /* Latin 1 */ @@ -1142,8 +1142,14 @@ /* Add the font name to the list if not already there */ fontname_lispstr = build_intstring (fontname); - if (NILP (Fmember (fontname_lispstr, font_enum->list))) - font_enum->list = Fcons (fontname_lispstr, font_enum->list); + if (NILP (Fassoc (fontname_lispstr, font_enum->list))) + font_enum->list = + Fcons (Fcons (fontname_lispstr, + /* TMPF_FIXED_PITCH is backwards from what you expect! + If set, it means NOT fixed pitch. */ + (lpntme->ntmTm.tmPitchAndFamily & TMPF_FIXED_PITCH) ? + Qnil : Qt), + font_enum->list); return 1; } @@ -1159,6 +1165,94 @@ (LPARAM) font_enum, 0); } +/* Function for sorting lists of fonts as obtained from + mswindows_enumerate_fonts(). These come in a known format: + "family::::charset" for TrueType fonts, "family::size::charset" + otherwise. */ + +static int +sort_font_list_function (Lisp_Object obj1, Lisp_Object obj2, + Lisp_Object pred) +{ + Ibyte *font1, *font2; + Ibyte *c1, *c2; + int t1, t2; + + /* + 1. fixed over proportional. + 2. Western over other charsets. + 3. TrueType over non-TrueType. + 4. Within non-TrueType, sizes closer to 10pt over sizes farther from 10pt. + 5. Courier New over other families. + */ + + /* The sort function should return > 0 if OBJ1 < OBJ2, < 0 otherwise. + NOTE: This is backwards from the way qsort() works. */ + + t1 = !NILP (XCDR (obj1)); + t2 = !NILP (XCDR (obj2)); + + if (t1 && !t2) + return 1; + if (t2 && !t1) + return -1; + + font1 = XSTRING_DATA (XCAR (obj1)); + font2 = XSTRING_DATA (XCAR (obj2)); + + c1 = qxestrrchr (font1, ':'); + c2 = qxestrrchr (font2, ':'); + + t1 = !qxestrcasecmp_c (c1 + 1, "western"); + t2 = !qxestrcasecmp_c (c2 + 1, "western"); + + if (t1 && !t2) + return 1; + if (t2 && !t1) + return -1; + + c1 -= 2; + c2 -= 2; + t1 = *c1 == ':'; + t2 = *c2 == ':'; + + if (t1 && !t2) + return 1; + if (t2 && !t1) + return -1; + + if (!t1 && !t2) + { + while (isdigit (*c1)) + c1--; + while (isdigit (*c2)) + c2--; + + t1 = qxeatoi (c1 + 1) - 10; + t2 = qxeatoi (c2 + 1) - 10; + + if (abs (t1) < abs (t2)) + return 1; + else if (abs (t2) < abs (t1)) + return -1; + else if (t1 < t2) + /* Prefer a smaller font over a larger one just as far away + because the smaller one won't upset the total line height if it's + just a few chars. */ + return 1; + } + + t1 = !qxestrncasecmp_c (font1, "courier new:", 12); + t2 = !qxestrncasecmp_c (font2, "courier new:", 12); + + if (t1 && !t2) + return 1; + if (t2 && !t1) + return -1; + + return -1; +} + /* * Enumerate the available on the HDC fonts and return a list of string * font names. @@ -1182,7 +1276,7 @@ qxeEnumFontFamiliesEx (hdc, &logfont, (FONTENUMPROCW) font_enum_callback_1, (LPARAM) (&font_enum), 0); - return font_enum.list; + return list_sort (font_enum.list, Qnil, sort_font_list_function); } static HFONT @@ -1320,20 +1414,36 @@ static void mswindows_finalize_font_instance (Lisp_Font_Instance *f); -static HFONT -create_hfont_from_font_spec (const Ibyte *namestr, - HDC hdc, - Lisp_Object name_for_errors, - Lisp_Object device_font_list, - Error_Behavior errb) +/* Parse the font spec in NAMESTR. Maybe issue errors, according to ERRB; + NAME_FOR_ERRORS is the Lisp string to use when issuing errors. Store + the five parts of the font spec into the given strings, which should be + declared as + + Ibyte fontname[LF_FACESIZE], weight[LF_FACESIZE], points[8]; + Ibyte effects[LF_FACESIZE], charset[LF_FACESIZE]; + + If LOGFONT is given, store the necessary information in LOGFONT to + create a font object. If LOGFONT is given, HDC must also be given; + else, NULL can be given for both. + + Return 1 if ok, 0 if error. + */ +static int +parse_font_spec (const Ibyte *namestr, + HDC hdc, + Lisp_Object name_for_errors, + Error_Behavior errb, + LOGFONTW *logfont, + Ibyte *fontname, + Ibyte *weight, + Ibyte *points, + Ibyte *effects, + Ibyte *charset) { - LOGFONTW logfont; int fields, i; int pt; - Ibyte fontname[LF_FACESIZE], weight[LF_FACESIZE], *style, points[8]; - Ibyte effects[LF_FACESIZE], charset[LF_FACESIZE]; + Ibyte *style; Ibyte *c; - HFONT hfont; /* * mswindows fonts look like: @@ -1348,6 +1458,15 @@ * Courier New:Bold Italic:10:underline strikeout:western */ + fontname[0] = 0; + weight[0] = 0; + points[0] = 0; + effects[0] = 0; + charset[0] = 0; + + if (logfont) + xzero (*logfont); + fields = sscanf ((CIbyte *) namestr, "%31[^:]:%31[^:]:%7[^:]:%31[^:]:%31s", fontname, weight, points, effects, charset); @@ -1361,7 +1480,7 @@ { maybe_signal_error (Qinvalid_argument, "Invalid font", name_for_errors, Qfont, errb); - return NULL; + return 0; } if (fields > 0 && qxestrlen (fontname)) @@ -1369,14 +1488,12 @@ Extbyte *extfontname; C_STRING_TO_TSTR (fontname, extfontname); - xetcsncpy ((Extbyte *) logfont.lfFaceName, extfontname, LF_FACESIZE - 1); - logfont.lfFaceName[LF_FACESIZE - 1] = 0; - } - else - { - maybe_signal_error (Qinvalid_argument, "Must specify a font name", - name_for_errors, Qfont, errb); - return NULL; + if (logfont) + { + xetcsncpy ((Extbyte *) logfont->lfFaceName, extfontname, + LF_FACESIZE - 1); + logfont->lfFaceName[LF_FACESIZE - 1] = 0; + } } /* weight */ @@ -1385,31 +1502,33 @@ /* Maybe split weight into weight and style */ if ((c = qxestrchr (weight, ' '))) - { - *c = '\0'; - style = c + 1; - } + { + *c = '\0'; + style = c + 1; + } else style = NULL; for (i = 0; i < countof (fontweight_map); i++) if (!qxestrcasecmp_c (weight, fontweight_map[i].name)) { - logfont.lfWeight = fontweight_map[i].value; + if (logfont) + logfont->lfWeight = fontweight_map[i].value; break; } if (i == countof (fontweight_map)) /* No matching weight */ { if (!style) { - logfont.lfWeight = FW_REGULAR; + if (logfont) + logfont->lfWeight = FW_REGULAR; style = weight; /* May have specified style without weight */ } else { maybe_signal_error (Qinvalid_constant, "Invalid font weight", name_for_errors, Qfont, errb); - return NULL; + return 0; } } @@ -1417,41 +1536,59 @@ { /* #### what about oblique? */ if (qxestrcasecmp_c (style, "italic") == 0) - logfont.lfItalic = TRUE; + { + if (logfont) + logfont->lfItalic = TRUE; + } else { maybe_signal_error (Qinvalid_constant, "Invalid font weight or style", name_for_errors, Qfont, errb); - return NULL; + return 0; } /* Glue weight and style together again */ if (weight != style) *c = ' '; } - else - logfont.lfItalic = FALSE; + else if (logfont) + logfont->lfItalic = FALSE; - if (fields < 3) - pt = 10; /* #### Should we reject strings that don't specify a size? */ - else if ((pt = qxeatoi (points)) == 0) + if (fields < 3 || !qxestrcmp_c (points, "")) + ; + else if (points[0] == '0' || + qxestrspn (points, "0123456789") < qxestrlen (points)) { maybe_signal_error (Qinvalid_argument, "Invalid font pointsize", name_for_errors, Qfont, errb); - return NULL; + return 0; + } + else + { + pt = qxeatoi (points); + + if (logfont) + { + /* Formula for pointsize->height from LOGFONT docs in MSVC5 Platform + SDK */ + logfont->lfHeight = -MulDiv (pt, GetDeviceCaps (hdc, LOGPIXELSY), + 72); + logfont->lfWidth = 0; + } } - /* Formula for pointsize->height from LOGFONT docs in MSVC5 Platform SDK */ - logfont.lfHeight = -MulDiv (pt, GetDeviceCaps (hdc, LOGPIXELSY), 72); - logfont.lfWidth = 0; + /* Effects */ + if (logfont) + { + logfont->lfUnderline = FALSE; + logfont->lfStrikeOut = FALSE; + } - /* Effects */ - logfont.lfUnderline = FALSE; - logfont.lfStrikeOut = FALSE; if (fields >= 4 && effects[0] != '\0') { Ibyte *effects2; + int underline = FALSE, strikeout = FALSE; /* Maybe split effects into effects and effects2 */ if ((c = qxestrchr (effects, ' '))) @@ -1463,43 +1600,47 @@ effects2 = NULL; if (qxestrcasecmp_c (effects, "underline") == 0) - logfont.lfUnderline = TRUE; + underline = TRUE; else if (qxestrcasecmp_c (effects, "strikeout") == 0) - logfont.lfStrikeOut = TRUE; + strikeout = TRUE; else { maybe_signal_error (Qinvalid_constant, "Invalid font effect", name_for_errors, Qfont, errb); - return NULL; + return 0; } if (effects2 && effects2[0] != '\0') { if (qxestrcasecmp_c (effects2, "underline") == 0) - logfont.lfUnderline = TRUE; + underline = TRUE; else if (qxestrcasecmp_c (effects2, "strikeout") == 0) - logfont.lfStrikeOut = TRUE; + strikeout = TRUE; else { maybe_signal_error (Qinvalid_constant, "Invalid font effect", name_for_errors, Qfont, errb); - return NULL; + return 0; } } - /* Regenerate sanitised effects string */ - if (logfont.lfUnderline) + /* Regenerate sanitized effects string */ + if (underline) { - if (logfont.lfStrikeOut) + if (strikeout) qxestrcpy_c (effects, "underline strikeout"); else qxestrcpy_c (effects, "underline"); } - else if (logfont.lfStrikeOut) + else if (strikeout) qxestrcpy_c (effects, "strikeout"); + + if (logfont) + { + logfont->lfUnderline = underline; + logfont->lfStrikeOut = strikeout; + } } - else - effects[0] = '\0'; /* Charset */ /* charset can be specified even if earlier fields haven't been */ @@ -1511,76 +1652,173 @@ qxestrncpy (charset, c + 1, LF_FACESIZE); charset[LF_FACESIZE - 1] = '\0'; } - else - qxestrcpy_c (charset, charset_map[0].name); } - for (i = 0; i < countof (charset_map); i++) - if (!qxestrcasecmp_c (charset, charset_map[i].name)) - { - logfont.lfCharSet = charset_map[i].value; - break; - } + /* NOTE: If you give a blank charset spec, we will normally not get here + under Mule unless we explicitly call `make-font-instance'! This is + because the C code instantiates fonts using particular charsets, by + way of specifier_matching_instance(). Before instantiating the font, + font_instantiate() calls the devmeth find_matching_font(), which gets + a truename font spec with the registry (i.e. the charset spec) filled + in appropriately to the charset. */ + if (!qxestrcmp_c (charset, "")) + ; + else + { + for (i = 0; i < countof (charset_map); i++) + if (!qxestrcasecmp_c (charset, charset_map[i].name)) + { + if (logfont) + logfont->lfCharSet = charset_map[i].value; + break; + } - if (i == countof (charset_map)) /* No matching charset */ + if (i == countof (charset_map)) /* No matching charset */ + { + maybe_signal_error (Qinvalid_argument, "Invalid charset", + name_for_errors, Qfont, errb); + return 0; + } + } + + if (logfont) { - maybe_signal_error (Qinvalid_argument, "Invalid charset", - name_for_errors, Qfont, errb); - return NULL; + /* Misc crud */ +#if 1 + logfont->lfOutPrecision = OUT_DEFAULT_PRECIS; + logfont->lfClipPrecision = CLIP_DEFAULT_PRECIS; + logfont->lfQuality = DEFAULT_QUALITY; +#else + logfont->lfOutPrecision = OUT_STROKE_PRECIS; + logfont->lfClipPrecision = CLIP_STROKE_PRECIS; + logfont->lfQuality = PROOF_QUALITY; +#endif + /* Default to monospaced if the specified fontname doesn't exist. */ + logfont->lfPitchAndFamily = FF_MODERN; } - /* Misc crud */ - logfont.lfEscapement = logfont.lfOrientation = 0; -#if 1 - logfont.lfOutPrecision = OUT_DEFAULT_PRECIS; - logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS; - logfont.lfQuality = DEFAULT_QUALITY; -#else - logfont.lfOutPrecision = OUT_STROKE_PRECIS; - logfont.lfClipPrecision = CLIP_STROKE_PRECIS; - logfont.lfQuality = PROOF_QUALITY; -#endif - /* Default to monospaced if the specified fontname doesn't exist. */ - logfont.lfPitchAndFamily = FF_MODERN; + return 1; +} + +/* + mswindows fonts look like: + [fontname[:style[:pointsize[:effects]]]][:charset] + A maximal mswindows font spec looks like: + Courier New:Bold Italic:10:underline strikeout:Western + + A missing weight/style field is the same as Regular, and a missing + effects field is left alone, and means no effects; but a missing + fontname, pointsize or charset field means any will do. We prefer + Courier New, 10, Western. See sort function above. */ - /* Windows will silently substitute a default font if the fontname specifies - a non-existent font. This is bad for screen fonts because it doesn't - allow higher-level code to see the error and to act appropriately. - For instance complex_vars_of_faces() sets up a fallback list of fonts - for the default face. */ +static HFONT +create_hfont_from_font_spec (const Ibyte *namestr, + HDC hdc, + Lisp_Object name_for_errors, + Lisp_Object device_font_list, + Error_Behavior errb, + Lisp_Object *truename_ret) +{ + LOGFONTW logfont; + HFONT hfont; + Ibyte fontname[LF_FACESIZE], weight[LF_FACESIZE], points[8]; + Ibyte effects[LF_FACESIZE], charset[LF_FACESIZE]; + Ibyte truename[MSW_FONTSIZE]; + Ibyte truername[MSW_FONTSIZE]; + + /* Windows will silently substitute a default font if the fontname + specifies a non-existent font. This is bad for screen fonts because + it doesn't allow higher-level code to see the error and to act + appropriately. For instance complex_vars_of_faces() sets up a + fallback list of fonts for the default face. Instead, we look at all + the possibilities and pick one that works, handling missing pointsize + and charset fields appropriately. + + For printer fonts, we used to go ahead and let Windows choose the + font, and for those devices, then, DEVICE_FONT_LIST would be nil. + However, this causes problems with the font-matching code below, which + needs a list of fonts so it can pick the right one for Mule. + + Thus, the code below to handle a nil DEVICE_FONT_LIST is not currently + used. */ if (!NILP (device_font_list)) { - Lisp_Object fonttail; - Ibyte truename[MSW_FONTSIZE]; + Lisp_Object fonttail = Qnil; + + if (!parse_font_spec (namestr, 0, name_for_errors, + errb, 0, fontname, weight, points, + effects, charset)) + return 0; + + /* The fonts in the device font list always specify fontname and + charset, but often times not the size; so if we don't have the + size specified either, do a round with size 10 so we'll always end + up with a size in the truename (if we fail this one but succeed + the next one, we'll have chosen a non-TrueType font, and in those + cases the size is specified in the font list item. */ + + if (!points[0]) + { + qxesprintf (truename, "%s:%s:10:%s:%s", + fontname, weight, effects, charset); - qxesprintf (truename, "%s:%s:%d:%s:%s", fontname, weight, pt, effects, - charset); - LIST_LOOP (fonttail, device_font_list) + LIST_LOOP (fonttail, device_font_list) + { + if (match_font (XSTRING_DATA (XCAR (XCAR (fonttail))), + truename, truername)) + break; + } + } + + if (NILP (fonttail)) { - if (match_font (XSTRING_DATA (XCAR (fonttail)), truename, - NULL)) - break; + qxesprintf (truename, "%s:%s:%s:%s:%s", + fontname, weight, points, effects, charset); + + LIST_LOOP (fonttail, device_font_list) + { + if (match_font (XSTRING_DATA (XCAR (XCAR (fonttail))), + truename, truername)) + break; + } } + if (NILP (fonttail)) { maybe_signal_error (Qinvalid_argument, "No matching font", name_for_errors, Qfont, errb); - return NULL; + return 0; } + + if (!parse_font_spec (truername, hdc, name_for_errors, + ERROR_ME_DEBUG_WARN, &logfont, fontname, weight, + points, effects, charset)) + signal_error (Qinternal_error, "Bad value in device font list?", + build_intstring (truername)); } + else if (!parse_font_spec (namestr, hdc, name_for_errors, + errb, &logfont, fontname, weight, points, + effects, charset)) + return 0; if ((hfont = qxeCreateFontIndirect (&logfont)) == NULL) { maybe_signal_error (Qgui_error, "Couldn't create font", name_for_errors, Qfont, errb); - return NULL; + return 0; } + /* #### Truename will not have all its fields filled in when we have no + list of fonts. Doesn't really matter now, since we always have one. + See above. */ + qxesprintf (truename, "%s:%s:%s:%s:%s", fontname, weight, + points, effects, charset); + + *truename_ret = build_intstring (truename); return hfont; } - /* * This is a work horse for both mswindows_initialize_font_instance and * msprinter_initialize_font_instance. @@ -1593,11 +1831,13 @@ HFONT hfont, hfont2; TEXTMETRICW metrics; Ibyte *namestr = XSTRING_DATA (name); + Lisp_Object truename; hfont = create_hfont_from_font_spec (namestr, hdc, name, device_font_list, - errb); + errb, &truename); + f->truename = truename; f->data = xnew_and_zero (struct mswindows_font_instance_data); - FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f,0,0) = hfont; + FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, 0, 0) = hfont; /* Some underlined fonts have the descent of one pixel more than their non-underlined counterparts. Font variants though are assumed to have @@ -1700,7 +1940,8 @@ { Ibyte fontname[MSW_FONTSIZE]; - if (match_font (XSTRING_DATA (XCAR (fonttail)), XSTRING_DATA (pattern), + if (match_font (XSTRING_DATA (XCAR (XCAR (fonttail))), + XSTRING_DATA (pattern), fontname)) result = Fcons (build_intstring (fontname), result); } @@ -1708,118 +1949,29 @@ return Fnreverse (result); } -/* Fill in missing parts of a font spec. This is primarily intended as a - * helper function for the functions below. - * mswindows fonts look like: - * fontname[:[weight][ style][:pointsize[:effects]]][:charset] - * A minimal mswindows font spec looks like: - * Courier New - * A maximal mswindows font spec looks like: - * Courier New:Bold Italic:10:underline strikeout:Western - * Missing parts of the font spec should be filled in with these values: - * Courier New:Regular:10::Western */ static Lisp_Object mswindows_font_instance_truename (Lisp_Font_Instance *f, Error_Behavior errb) { - /* #### does not handle charset at end!!! charset can be given even - when previous fields are not. - - #### does not canonicalize given fields! needs to be merged - with initialize_font_instance(). */ - - int nsep = 0; - Ibyte *ptr = (Ibyte *) XSTRING_DATA (f->name); - Ibyte *name = (Ibyte *) ALLOCA (XSTRING_LENGTH (f->name) + 19); - - qxestrcpy (name, ptr); - - while ((ptr = qxestrchr (ptr, ':')) != 0) - { - ptr++; - nsep++; - } - - switch (nsep) - { - case 0: - qxestrcat_c (name, ":Regular:10::Western"); - break; - case 1: - qxestrcat_c (name, ":10::Western"); - break; - case 2: - qxestrcat_c (name, "::Western"); - break; - case 3: - qxestrcat_c (name, ":Western"); - break; - default:; - } - - return build_intstring (name); + return f->truename; } #ifdef MULE static int -mswindows_font_spec_matches_charset_stage_1 (const Ibyte *font_charset, - Lisp_Object charset) +mswindows_font_spec_matches_charset_stage_1 (struct device *d, + Lisp_Object charset, + const Ibyte *nonreloc, + Lisp_Object reloc, + Bytecount offset, + Bytecount length) { - int i, ms_charset = 0; - CHARSETINFO info; - int font_code_page; - Lisp_Object charset_code_page; - - /* Get code page from the font spec */ - - for (i = 0; i < countof (charset_map); i++) - if (qxestrcasecmp_c (font_charset, charset_map[i].name) == 0) - { - ms_charset = charset_map[i].value; - break; - } - if (i == countof (charset_map)) - return 0; - - /* For border-glyph use */ - if (ms_charset == SYMBOL_CHARSET) - ms_charset = ANSI_CHARSET; - - if (!TranslateCharsetInfo ((DWORD *) ms_charset, &info, TCI_SRCCHARSET)) - return 0; - - font_code_page = info.ciACP; - - /* Get code page for the charset */ - charset_code_page = Fmswindows_charset_code_page (charset); - if (!INTP (charset_code_page)) - return 0; - - return font_code_page == XINT (charset_code_page); -} - -static int -mswindows_font_spec_matches_charset (struct device *d, Lisp_Object charset, - const Ibyte *nonreloc, - Lisp_Object reloc, - Bytecount offset, Bytecount length) -{ + int i; + Lisp_Object charset_registry; + const Ibyte *font_charset; const Ibyte *the_nonreloc = nonreloc; - int i; const Ibyte *c; Bytecount the_length = length; -/* The idea is that, when trying to find a suitable font for a character, - we first see if the character comes from one of the known charsets - listed above; if so, we try to find a font which is declared as being of - that charset (that's the last element of the font spec). If so, this - means that the font is specifically designed for the charset, and we - prefer it. However, there are only a limited number of defined - charsets, and new ones aren't being defined; so if we fail the first - stage, we search through each font looking at the Unicode subranges it - supports, to see if the character comes from that subrange. -*/ - if (UNBOUNDP (charset)) return 1; @@ -1839,126 +1991,220 @@ c = newc; } - if (i >= 4 && mswindows_font_spec_matches_charset_stage_1 (c, charset)) + if (i < 4) + return 0; + + font_charset = c; + + /* For border-glyph use */ + if (!qxestrcasecmp_c (font_charset, "symbol")) + font_charset = (const Ibyte *) "western"; + + /* Get code page for the charset */ + charset_registry = Fmswindows_charset_registry (charset); + if (!STRINGP (charset_registry)) + return 0; + + return !qxestrcasecmp (XSTRING_DATA (charset_registry), font_charset); +} + +/* + +1. handle standard mapping and inheritance vectors properly in Face-frob-property. +2. finish impl of mswindows-charset-registry. +3. see if everything works under fixup, now that i copied the stuff over. +4. consider generalizing Face-frob-property to frob-specifier. +5. maybe extract some of the flets out of Face-frob-property as useful specifier frobbing. +6. eventually this stuff's got to be checked in!!!! +*/ + +static int +mswindows_font_spec_matches_charset_stage_2 (struct device *d, + Lisp_Object charset, + const Ibyte *nonreloc, + Lisp_Object reloc, + Bytecount offset, + Bytecount length) +{ + const Ibyte *the_nonreloc = nonreloc; + FONTSIGNATURE fs; + FONTSIGNATURE *fsp = &fs; + struct gcpro gcpro1; + Lisp_Object fontsig; + Bytecount the_length = length; + int i; + + if (UNBOUNDP (charset)) return 1; - /* Stage 2. */ - { - FONTSIGNATURE fs; - FONTSIGNATURE *fsp = &fs; - struct gcpro gcpro1; - Lisp_Object fontsig; + if (!the_nonreloc) + the_nonreloc = XSTRING_DATA (reloc); + fixup_internal_substring (nonreloc, reloc, offset, &the_length); + the_nonreloc += offset; + + /* Get the list of Unicode subranges corresponding to the font. This + is contained inside of FONTSIGNATURE data, obtained by calling + GetTextCharsetInfo on a font object, which we need to create from the + spec. See if the FONTSIGNATURE data is already cached. If not, get + it and cache it. */ + if (!STRINGP (reloc) || the_nonreloc != XSTRING_DATA (reloc)) + reloc = build_intstring (the_nonreloc); + GCPRO1 (reloc); + fontsig = Fgethash (reloc, Vfont_signature_data, Qunbound); + + if (!UNBOUNDP (fontsig)) + { + fsp = (FONTSIGNATURE *) XOPAQUE_DATA (fontsig); + UNGCPRO; + } + else + { + HDC hdc = CreateCompatibleDC (NULL); + Lisp_Object font_list = DEVICE_MSWINDOWS_FONTLIST (d); + Lisp_Object truename; + HFONT hfont = create_hfont_from_font_spec (the_nonreloc, hdc, Qnil, + font_list, + ERROR_ME_DEBUG_WARN, + &truename); - /* Get the list of Unicode subranges corresponding to the font. This - is contained inside of FONTSIGNATURE data, obtained by calling - GetTextCharsetInfo on a font object, which we need to create from the - spec. See if the FONTSIGNATURE data is already cached. If not, get - it and cache it. */ - if (!STRINGP (reloc) || the_nonreloc != XSTRING_DATA (reloc)) - reloc = build_intstring (the_nonreloc); - GCPRO1 (reloc); - fontsig = Fgethash (reloc, Vfont_signature_data, Qunbound); + if (!hfont || !(hfont = (HFONT) SelectObject (hdc, hfont))) + { + nope: + DeleteDC (hdc); + UNGCPRO; + return 0; + } + + if (GetTextCharsetInfo (hdc, &fs, 0) == DEFAULT_CHARSET) + { + SelectObject (hdc, hfont); + goto nope; + } + SelectObject (hdc, hfont); + DeleteDC (hdc); + Fputhash (reloc, make_opaque (&fs, sizeof (fs)), Vfont_signature_data); + UNGCPRO; + } - if (!UNBOUNDP (fontsig)) + { + int lowlim, highlim; + int dim, j, cp = -1; + + /* Try to find a Unicode char in the charset. #### This is somewhat + bogus. See below. + + #### Cache me baby!!!!!!!!!!!!! + */ + get_charset_limits (charset, &lowlim, &highlim); + dim = XCHARSET_DIMENSION (charset); + + if (dim == 1) { - fsp = (FONTSIGNATURE *) XOPAQUE_DATA (fontsig); - UNGCPRO; + for (i = lowlim; i <= highlim; i++) + if ((cp = ichar_to_unicode (make_ichar (charset, i, 0))) >= 0) + break; } else { - HDC hdc = CreateCompatibleDC (NULL); - Lisp_Object font_list = DEVICE_MSWINDOWS_FONTLIST (d); - HFONT hfont = create_hfont_from_font_spec (the_nonreloc, hdc, Qnil, - font_list, - ERROR_ME_DEBUG_WARN); + for (i = lowlim; i <= highlim; i++) + for (j = lowlim; j <= highlim; j++) + if ((cp = ichar_to_unicode (make_ichar (charset, i, j))) >= 0) + break; + } + + if (cp < 0) + return 0; - if (!hfont || !(hfont = (HFONT) SelectObject (hdc, hfont))) + /* Check to see, for each subrange supported by the font, + whether the Unicode char is within that subrange. If any match, + the font supports the char (whereby, the charset, bogusly). */ + + for (i = 0; i < 128; i++) + { + if (fsp->fsUsb[i >> 5] & (1 << (i & 32))) { - nope: - DeleteDC (hdc); - UNGCPRO; - return 0; + for (j = 0; j < unicode_subrange_table[i].no_subranges; j++) + if (cp >= unicode_subrange_table[i].subranges[j].start && + cp <= unicode_subrange_table[i].subranges[j].end) + return 1; } - - if (GetTextCharsetInfo (hdc, &fs, 0) == DEFAULT_CHARSET) - { - SelectObject (hdc, hfont); - goto nope; - } - SelectObject (hdc, hfont); - DeleteDC (hdc); - Fputhash (reloc, make_opaque (&fs, sizeof (fs)), Vfont_signature_data); - UNGCPRO; } - { - int lowlim, highlim; - int dim, j, cp = -1; - - /* Try to find a Unicode char in the charset. #### This is somewhat - bogus. We should really be doing these checks on the char level, - not the charset level. There's no guarantee that a charset covers - a single Unicode range. Furthermore, this is extremely wasteful. - We should be doing this when we're about to redisplay and already - have the Unicode codepoints in hand. - - #### Cache me baby!!!!!!!!!!!!! - */ - get_charset_limits (charset, &lowlim, &highlim); - dim = XCHARSET_DIMENSION (charset); - - if (dim == 1) - { - for (i = lowlim; i <= highlim; i++) - if ((cp = ichar_to_unicode (make_ichar (charset, i, 0))) >= 0) - break; - } - else - { - for (i = lowlim; i <= highlim; i++) - for (j = lowlim; j <= highlim; j++) - if ((cp = ichar_to_unicode (make_ichar (charset, i, j))) >= 0) - break; - } - - if (cp < 0) - return 0; - - /* Check to see, for each subrange supported by the font, - whether the Unicode char is within that subrange. If any match, - the font supports the char (whereby, the charset, bogusly). */ - - for (i = 0; i < 128; i++) - { - if (fsp->fsUsb[i >> 5] & (1 << (i & 32))) - { - for (j = 0; j < unicode_subrange_table[i].no_subranges; j++) - if (cp >= unicode_subrange_table[i].subranges[j].start && - cp <= unicode_subrange_table[i].subranges[j].end) - return 1; - } - } - - return 0; - } + return 0; } } -/* find a font spec that matches font spec FONT and also matches +/* + Given a truename font spec, does it match CHARSET? + + We try two stages: + + -- First see if the charset corresponds to one of the predefined Windows + charsets; if so, we see if the registry (that's the last element of the + font spec) is that same charset. If so, this means that the font is + specifically designed for the charset, and we prefer it. + + -- However, there are only a limited number of defined Windows charsets, + and new ones aren't being defined; so if we fail the first stage, we find + a character from the charset with a Unicode equivalent, and see if the + font can display this character. we do that by retrieving the Unicode + ranges that the font supports, to see if the character comes from that + subrange. + + #### Note: We really want to be doing all these checks at the character + level, not the charset level. There's no guarantee that a charset covers + a single Unicode range. Furthermore, this is extremely wasteful. We + should be doing this when we're about to redisplay and already have the + Unicode codepoints in hand. +*/ + +static int +mswindows_font_spec_matches_charset (struct device *d, Lisp_Object charset, + const Ibyte *nonreloc, + Lisp_Object reloc, + Bytecount offset, Bytecount length, + int stage) +{ + return stage ? + mswindows_font_spec_matches_charset_stage_2 (d, charset, nonreloc, + reloc, offset, length) + : mswindows_font_spec_matches_charset_stage_1 (d, charset, nonreloc, + reloc, offset, length); +} + + +/* Find a font spec that matches font spec FONT and also matches (the registry of) CHARSET. */ + static Lisp_Object mswindows_find_charset_font (Lisp_Object device, Lisp_Object font, - Lisp_Object charset) + Lisp_Object charset, int stage) { Lisp_Object fontlist, fonttail; + /* If FONT specifies a particular charset, this will only list fonts with + that charset; otherwise, it will list fonts with all charsets. */ fontlist = mswindows_list_fonts (font, device); - LIST_LOOP (fonttail, fontlist) + + if (!stage) { - if (mswindows_font_spec_matches_charset - (XDEVICE (device), charset, 0, XCAR (fonttail), 0, -1)) - return XCAR (fonttail); + LIST_LOOP (fonttail, fontlist) + { + if (mswindows_font_spec_matches_charset_stage_1 + (XDEVICE (device), charset, 0, XCAR (fonttail), 0, -1)) + return XCAR (fonttail); + } } + else + { + LIST_LOOP (fonttail, fontlist) + { + if (mswindows_font_spec_matches_charset_stage_2 + (XDEVICE (device), charset, 0, XCAR (fonttail), 0, -1)) + return XCAR (fonttail); + } + } + return Qnil; }
--- a/src/objects-msw.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/objects-msw.h Thu Jun 20 21:19:10 2002 +0000 @@ -1,7 +1,7 @@ /* mswindows-specific Lisp objects. Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Board of Trustees, University of Illinois. - Copyright (C) 1995, 1996 Ben Wing. + Copyright (C) 1995, 1996, 2002 Ben Wing. Copyright (C) 1997, Jonathan Harris. This file is part of XEmacs. @@ -36,43 +36,7 @@ #include "objects.h" -struct mswindows_color_instance_data -{ - COLORREF color; -}; - -#define MSWINDOWS_COLOR_INSTANCE_DATA(c) \ - ((struct mswindows_color_instance_data *) (c)->data) -#define COLOR_INSTANCE_MSWINDOWS_COLOR(c) \ - (MSWINDOWS_COLOR_INSTANCE_DATA (c)->color) - -/* The four HFONTS are for the 4 (underlined, strikethrough) - combinations. Only the one at index 0, neither underlined nor - struk through is created with the font instance. Other fonts are - created as necessary during redisplay, using the one at index 0 - as prototype */ -#define MSWINDOWS_NUM_FONT_VARIANTS 4 -struct mswindows_font_instance_data -{ - HFONT hfont [MSWINDOWS_NUM_FONT_VARIANTS]; -}; - -#define MSWINDOWS_FONT_INSTANCE_DATA(c) \ - ((struct mswindows_font_instance_data *) (c)->data) - -#define FONT_INSTANCE_MSWINDOWS_HFONT_I(c,i) \ - (MSWINDOWS_FONT_INSTANCE_DATA(c)->hfont[(i)]) - -#define FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT(c,under,strike) \ - FONT_INSTANCE_MSWINDOWS_HFONT_I (c, (!!(strike)<<1)|!!(under)) - -/* If font creation during redisplay fails, then the following - value is used to prevent future attempts to create this font. - Redisplay uses the "main" font when encounters this value */ -#define MSWINDOWS_BAD_HFONT ((HFONT)INVALID_HANDLE_VALUE) - HFONT mswindows_get_hfont (Lisp_Font_Instance *f, int under, int strike); - Lisp_Object mswindows_color_to_string (COLORREF color); #endif /* INCLUDED_objects_msw_h_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/objects-tty-impl.h Thu Jun 20 21:19:10 2002 +0000 @@ -0,0 +1,50 @@ +/* TTY-specific Lisp objects. + Copyright (C) 1995 Board of Trustees, University of Illinois. + Copyright (C) 1995 Ben Wing + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +#ifndef INCLUDED_objects_tty_impl_h_ +#define INCLUDED_objects_tty_impl_h_ + +#include "objects-impl.h" +#include "objects-tty.h" + +struct tty_color_instance_data +{ + Lisp_Object symbol; /* so we don't have to constantly call Fintern() */ +}; + +#define TTY_COLOR_INSTANCE_DATA(c) \ + ((struct tty_color_instance_data *) (c)->data) + +#define COLOR_INSTANCE_TTY_SYMBOL(c) (TTY_COLOR_INSTANCE_DATA (c)->symbol) + +struct tty_font_instance_data +{ + Lisp_Object charset; +}; + +#define TTY_FONT_INSTANCE_DATA(c) \ + ((struct tty_font_instance_data *) (c)->data) + +#define FONT_INSTANCE_TTY_CHARSET(c) (TTY_FONT_INSTANCE_DATA (c)->charset) + +#endif /* INCLUDED_objects_tty_impl_h_ */
--- a/src/objects-tty.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/objects-tty.c Thu Jun 20 21:19:10 2002 +0000 @@ -24,9 +24,9 @@ #include <config.h> #include "lisp.h" -#include "console-tty.h" +#include "console-tty-impl.h" #include "insdel.h" -#include "objects-tty.h" +#include "objects-tty-impl.h" #include "device.h" #include "charset.h" @@ -283,10 +283,14 @@ static int tty_font_spec_matches_charset (struct device *d, Lisp_Object charset, const Ibyte *nonreloc, Lisp_Object reloc, - Bytecount offset, Bytecount length) + Bytecount offset, Bytecount length, + int stage) { const Ibyte *the_nonreloc = nonreloc; + if (stage) + return 0; + if (!the_nonreloc) the_nonreloc = XSTRING_DATA (reloc); fixup_internal_substring (nonreloc, reloc, offset, &length); @@ -308,14 +312,17 @@ (the registry of) CHARSET. */ static Lisp_Object tty_find_charset_font (Lisp_Object device, Lisp_Object font, - Lisp_Object charset) + Lisp_Object charset, int stage) { Ibyte *fontname = XSTRING_DATA (font); + if (stage) + return Qnil; + if (strchr ((const char *) fontname, '/')) { if (tty_font_spec_matches_charset (XDEVICE (device), charset, 0, - font, 0, -1)) + font, 0, -1, 0)) return font; return Qnil; }
--- a/src/objects-tty.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/objects-tty.h Thu Jun 20 21:19:10 2002 +0000 @@ -26,26 +26,6 @@ #include "objects.h" -struct tty_color_instance_data -{ - Lisp_Object symbol; /* so we don't have to constantly call Fintern() */ -}; - -#define TTY_COLOR_INSTANCE_DATA(c) \ - ((struct tty_color_instance_data *) (c)->data) - -#define COLOR_INSTANCE_TTY_SYMBOL(c) (TTY_COLOR_INSTANCE_DATA (c)->symbol) - -struct tty_font_instance_data -{ - Lisp_Object charset; -}; - -#define TTY_FONT_INSTANCE_DATA(c) \ - ((struct tty_font_instance_data *) (c)->data) - -#define FONT_INSTANCE_TTY_CHARSET(c) (TTY_FONT_INSTANCE_DATA (c)->charset) - extern Lisp_Object Vtty_color_alist, Vtty_dynamic_color_bg; extern Lisp_Object Vtty_dynamic_color_fg;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/objects-x-impl.h Thu Jun 20 21:19:10 2002 +0000 @@ -0,0 +1,64 @@ +/* X-specific Lisp objects. + Copyright (C) 1993, 1994 Free Software Foundation, Inc. + Copyright (C) 1995 Board of Trustees, University of Illinois. + Copyright (C) 1995, 1996, 2002 Ben Wing. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +/* This file Mule-ized (more like Mule-verified) by Ben Wing, 7-10-00. */ + +#ifndef INCLUDED_objects_x_impl_h_ +#define INCLUDED_objects_x_impl_h_ + +#include "objects-impl.h" +#include "objects-x.h" + +#ifdef HAVE_X_WINDOWS + +/***************************************************************************** + Color-Instance + ****************************************************************************/ + +struct x_color_instance_data +{ + XColor color; + char dealloc_on_gc; +}; + +#define X_COLOR_INSTANCE_DATA(c) ((struct x_color_instance_data *) (c)->data) +#define COLOR_INSTANCE_X_COLOR(c) (X_COLOR_INSTANCE_DATA (c)->color) +#define COLOR_INSTANCE_X_DEALLOC(c) (X_COLOR_INSTANCE_DATA (c)->dealloc_on_gc) + +/***************************************************************************** + Font-Instance + ****************************************************************************/ + +struct x_font_instance_data +{ + /* X-specific information */ + XFontStruct *font; +}; + +#define X_FONT_INSTANCE_DATA(f) ((struct x_font_instance_data *) (f)->data) +#define FONT_INSTANCE_X_FONT(f) (X_FONT_INSTANCE_DATA (f)->font) + +#endif /* HAVE_X_WINDOWS */ + +#endif /* INCLUDED_objects_x_impl_h_ */
--- a/src/objects-x.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/objects-x.c Thu Jun 20 21:19:10 2002 +0000 @@ -31,12 +31,12 @@ #include <config.h> #include "lisp.h" -#include "console-x.h" -#include "objects-x.h" +#include "charset.h" +#include "device-impl.h" +#include "insdel.h" -#include "charset.h" -#include "device.h" -#include "insdel.h" +#include "console-x-impl.h" +#include "objects-x-impl.h" int x_handle_non_fully_specified_fonts; @@ -390,7 +390,6 @@ /* Don't allocate the data until we're sure that we will succeed, or the finalize method may get fucked. */ f->data = xnew (struct x_font_instance_data); - FONT_INSTANCE_X_TRUENAME (f) = Qnil; FONT_INSTANCE_X_FONT (f) = xf; f->ascent = xf->ascent; f->descent = xf->descent; @@ -455,12 +454,6 @@ } static void -x_mark_font_instance (Lisp_Font_Instance *f) -{ - mark_object (FONT_INSTANCE_X_TRUENAME (f)); -} - -static void x_print_font_instance (Lisp_Font_Instance *f, Lisp_Object printcharfun, int escapeflag) @@ -775,17 +768,17 @@ { struct device *d = XDEVICE (f->device); - if (NILP (FONT_INSTANCE_X_TRUENAME (f))) + if (NILP (FONT_INSTANCE_TRUENAME (f))) { Display *dpy = DEVICE_X_DISPLAY (d); { Extbyte *nameext; LISP_STRING_TO_EXTERNAL (f->name, nameext, Qx_font_name_encoding); - FONT_INSTANCE_X_TRUENAME (f) = + FONT_INSTANCE_TRUENAME (f) = x_font_truename (dpy, nameext, FONT_INSTANCE_X_FONT (f)); } - if (NILP (FONT_INSTANCE_X_TRUENAME (f))) + if (NILP (FONT_INSTANCE_TRUENAME (f))) { Lisp_Object font_instance = wrap_font_instance (f); @@ -797,7 +790,7 @@ return f->name; } } - return FONT_INSTANCE_X_TRUENAME (f); + return FONT_INSTANCE_TRUENAME (f); } static Lisp_Object @@ -884,8 +877,12 @@ static int x_font_spec_matches_charset (struct device *d, Lisp_Object charset, const Ibyte *nonreloc, Lisp_Object reloc, - Bytecount offset, Bytecount length) + Bytecount offset, Bytecount length, + int stage) { + if (stage) + return 0; + if (UNBOUNDP (charset)) return 1; /* Hack! Short font names don't have the registry in them, @@ -933,7 +930,8 @@ /* find a font spec that matches font spec FONT and also matches (the registry of) CHARSET. */ static Lisp_Object -x_find_charset_font (Lisp_Object device, Lisp_Object font, Lisp_Object charset) +x_find_charset_font (Lisp_Object device, Lisp_Object font, Lisp_Object charset, + int stage) { Extbyte **names; int count = 0; @@ -941,6 +939,9 @@ const Extbyte *patternext; int i; + if (stage) + return Qnil; + LISP_STRING_TO_EXTERNAL (font, patternext, Qx_font_name_encoding); names = XListFonts (DEVICE_X_DISPLAY (XDEVICE (device)), @@ -955,7 +956,7 @@ ALLOCA, (intname, intlen), Qx_font_name_encoding); if (x_font_spec_matches_charset (XDEVICE (device), charset, - intname, Qnil, 0, -1)) + intname, Qnil, 0, -1, 0)) { result = make_string (intname, intlen); break; @@ -968,7 +969,7 @@ /* Check for a short font name. */ if (NILP (result) && x_font_spec_matches_charset (XDEVICE (device), charset, 0, - font, 0, -1)) + font, 0, -1, 0)) return font; return result; @@ -1000,7 +1001,6 @@ CONSOLE_HAS_METHOD (x, valid_color_name_p); CONSOLE_HAS_METHOD (x, initialize_font_instance); - CONSOLE_HAS_METHOD (x, mark_font_instance); CONSOLE_HAS_METHOD (x, print_font_instance); CONSOLE_HAS_METHOD (x, finalize_font_instance); CONSOLE_HAS_METHOD (x, font_instance_truename);
--- a/src/objects-x.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/objects-x.h Thu Jun 20 21:19:10 2002 +0000 @@ -1,7 +1,7 @@ /* X-specific Lisp objects. Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Board of Trustees, University of Illinois. - Copyright (C) 1995, 1996 Ben Wing. + Copyright (C) 1995, 1996, 2002 Ben Wing. This file is part of XEmacs. @@ -31,38 +31,8 @@ #ifdef HAVE_X_WINDOWS -/***************************************************************************** - Color-Instance - ****************************************************************************/ - -struct x_color_instance_data -{ - XColor color; - char dealloc_on_gc; -}; - -#define X_COLOR_INSTANCE_DATA(c) ((struct x_color_instance_data *) (c)->data) -#define COLOR_INSTANCE_X_COLOR(c) (X_COLOR_INSTANCE_DATA (c)->color) -#define COLOR_INSTANCE_X_DEALLOC(c) (X_COLOR_INSTANCE_DATA (c)->dealloc_on_gc) - int allocate_nearest_color (Display *display, Colormap screen_colormap, Visual *visual, XColor *color_def); - -/***************************************************************************** - Font-Instance - ****************************************************************************/ - -struct x_font_instance_data -{ - /* X-specific information */ - Lisp_Object truename; - XFontStruct *font; -}; - -#define X_FONT_INSTANCE_DATA(f) ((struct x_font_instance_data *) (f)->data) -#define FONT_INSTANCE_X_FONT(f) (X_FONT_INSTANCE_DATA (f)->font) -#define FONT_INSTANCE_X_TRUENAME(f) (X_FONT_INSTANCE_DATA (f)->truename) - #endif /* HAVE_X_WINDOWS */ #endif /* INCLUDED_objects_x_h_ */
--- a/src/objects.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/objects.c Thu Jun 20 21:19:10 2002 +0000 @@ -26,12 +26,12 @@ #include "lisp.h" #include "buffer.h" -#include "device.h" +#include "device-impl.h" #include "elhash.h" #include "faces.h" #include "frame.h" #include "glyphs.h" -#include "objects.h" +#include "objects-impl.h" #include "specifier.h" #include "window.h" @@ -238,6 +238,7 @@ Lisp_Font_Instance *f = XFONT_INSTANCE (obj); mark_object (f->name); + mark_object (f->truename); if (!NILP (f->device)) /* Vthe_null_font_instance */ MAYBE_DEVMETH (XDEVICE (f->device), mark_font_instance, (f)); @@ -325,6 +326,7 @@ f = alloc_lcrecord_type (Lisp_Font_Instance, &lrecord_font_instance); f->name = name; + f->truename = Qnil; f->device = device; f->data = 0; @@ -665,24 +667,58 @@ #ifdef MULE -int +/* Given a truename font spec (i.e. the font spec should have its registry + field filled in), does it support displaying characters from CHARSET? */ + +static int font_spec_matches_charset (struct device *d, Lisp_Object charset, const Ibyte *nonreloc, Lisp_Object reloc, - Bytecount offset, Bytecount length) + Bytecount offset, Bytecount length, + int stage) { return DEVMETH_OR_GIVEN (d, font_spec_matches_charset, - (d, charset, nonreloc, reloc, offset, length), + (d, charset, nonreloc, reloc, offset, length, + stage), 1); } static void font_validate_matchspec (Lisp_Object matchspec) { - Fget_charset (matchspec); + CHECK_CONS (matchspec); + Fget_charset (XCAR (matchspec)); } #endif /* MULE */ +void +initialize_charset_font_caches (struct device *d) +{ + /* Note that the following tables are bi-level. */ + d->charset_font_cache_stage_1 = + make_lisp_hash_table (20, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); + d->charset_font_cache_stage_2 = + make_lisp_hash_table (20, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); +} + +void +invalidate_charset_font_caches (Lisp_Object charset) +{ + /* Invalidate font cache entries for charset on all devices. */ + Lisp_Object devcons, concons, hash_table; + DEVICE_LOOP_NO_BREAK (devcons, concons) + { + struct device *d = XDEVICE (XCAR (devcons)); + hash_table = Fgethash (charset, d->charset_font_cache_stage_1, + Qunbound); + if (!UNBOUNDP (hash_table)) + Fclrhash (hash_table); + hash_table = Fgethash (charset, d->charset_font_cache_stage_2, + Qunbound); + if (!UNBOUNDP (hash_table)) + Fclrhash (hash_table); + } +} static Lisp_Object font_instantiate (Lisp_Object specifier, Lisp_Object matchspec, @@ -694,10 +730,15 @@ Lisp_Object device = DOMAIN_DEVICE (domain); struct device *d = XDEVICE (device); Lisp_Object instance; + Lisp_Object charset = Qnil; + int stage = 0; #ifdef MULE if (!UNBOUNDP (matchspec)) - matchspec = Fget_charset (matchspec); + { + charset = Fget_charset (XCAR (matchspec)); + stage = NILP (XCDR (matchspec)) ? 0 : 1; + } #endif if (FONT_INSTANCEP (instantiator)) @@ -706,10 +747,10 @@ || EQ (device, XFONT_INSTANCE (instantiator)->device)) { #ifdef MULE - if (font_spec_matches_charset (d, matchspec, 0, + if (font_spec_matches_charset (d, charset, 0, Ffont_instance_truename (instantiator), - 0, -1)) + 0, -1, stage)) return instantiator; #else return instantiator; @@ -720,8 +761,11 @@ if (STRINGP (instantiator)) { + Lisp_Object cache = stage ? d->charset_font_cache_stage_2 : + d->charset_font_cache_stage_1; + #ifdef MULE - if (!UNBOUNDP (matchspec)) + if (!NILP (charset)) { /* The instantiator is a font spec that could match many different fonts. We need to find one of those fonts @@ -731,14 +775,13 @@ iterate over all possible fonts, and a regexp match on each one. So we cache the results. */ Lisp_Object matching_font = Qunbound; - Lisp_Object hash_table = Fgethash (matchspec, d->charset_font_cache, - Qunbound); + Lisp_Object hash_table = Fgethash (charset, cache, Qunbound); if (UNBOUNDP (hash_table)) { /* need to make a sub hash table. */ hash_table = make_lisp_hash_table (20, HASH_TABLE_KEY_WEAK, HASH_TABLE_EQUAL); - Fputhash (matchspec, hash_table, d->charset_font_cache); + Fputhash (charset, hash_table, cache); } else matching_font = Fgethash (instantiator, hash_table, Qunbound); @@ -748,7 +791,7 @@ /* make sure we cache the failures, too. */ matching_font = DEVMETH_OR_GIVEN (d, find_charset_font, - (device, instantiator, matchspec), + (device, instantiator, charset, stage), instantiator); Fputhash (instantiator, matching_font, hash_table); } @@ -759,13 +802,13 @@ #endif /* MULE */ /* First, look to see if we can retrieve a cached value. */ - instance = Fgethash (instantiator, d->font_instance_cache, Qunbound); + instance = Fgethash (instantiator, cache, Qunbound); /* Otherwise, make a new one. */ if (UNBOUNDP (instance)) { /* make sure we cache the failures, too. */ instance = Fmake_font_instance (instantiator, device, Qt); - Fputhash (instantiator, instance, d->font_instance_cache); + Fputhash (instantiator, instance, cache); } return NILP (instance) ? Qunbound : instance; @@ -775,7 +818,7 @@ assert (XVECTOR_LENGTH (instantiator) == 1); return (face_property_matching_instance (Fget_face (XVECTOR_DATA (instantiator)[0]), Qfont, - matchspec, domain, ERROR_ME, 0, depth)); + charset, domain, ERROR_ME, 0, depth)); } else if (NILP (instantiator)) return Qunbound; @@ -1094,6 +1137,7 @@ Lisp_Font_Instance *f = alloc_lcrecord_type (Lisp_Font_Instance, &lrecord_font_instance); f->name = Qnil; + f->truename = Qnil; f->device = Qnil; f->data = 0;
--- a/src/objects.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/objects.h Thu Jun 20 21:19:10 2002 +0000 @@ -1,6 +1,6 @@ -/* Generic object functions. +/* Generic object functions -- interface. Copyright (C) 1995 Board of Trustees, University of Illinois. - Copyright (C) 1995, 1996 Ben Wing. + Copyright (C) 1995, 1996, 2002 Ben Wing. This file is part of XEmacs. @@ -24,54 +24,46 @@ #ifndef INCLUDED_objects_h_ #define INCLUDED_objects_h_ -#include "specifier.h" - void finalose (void *ptr); -/***************************************************************************** - * Color Specifier Object * - *****************************************************************************/ - -struct color_specifier -{ - Lisp_Object face; /* face this is attached to, or nil */ - Lisp_Object face_property; /* property of that face */ -}; +/**************************************************************************** + * Color Instance Object * + ****************************************************************************/ -#define COLOR_SPECIFIER_DATA(g) SPECIFIER_TYPE_DATA (g, color) -#define COLOR_SPECIFIER_FACE(g) (COLOR_SPECIFIER_DATA (g)->face) -#define COLOR_SPECIFIER_FACE_PROPERTY(g) \ - (COLOR_SPECIFIER_DATA (g)->face_property) +DECLARE_LRECORD (color_instance, Lisp_Color_Instance); +#define XCOLOR_INSTANCE(x) XRECORD (x, color_instance, Lisp_Color_Instance) +#define wrap_color_instance(p) wrap_record (p, color_instance) +#define COLOR_INSTANCEP(x) RECORDP (x, color_instance) +#define CHECK_COLOR_INSTANCE(x) CHECK_RECORD (x, color_instance) +#define CONCHECK_COLOR_INSTANCE(x) CONCHECK_RECORD (x, color_instance) -DECLARE_SPECIFIER_TYPE (color); -#define XCOLOR_SPECIFIER(x) XSPECIFIER_TYPE (x, color) -#define COLOR_SPECIFIERP(x) SPECIFIER_TYPEP (x, color) -#define CHECK_COLOR_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, color) -#define CONCHECK_COLOR_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, color) +EXFUN (Fmake_color_instance, 3); + +extern Lisp_Object Vthe_null_color_instance; void set_color_attached_to (Lisp_Object obj, Lisp_Object face, Lisp_Object property); -/***************************************************************************** - * Font Specifier Object * - *****************************************************************************/ +/**************************************************************************** + * Font Instance Object * + ****************************************************************************/ -struct font_specifier -{ - Lisp_Object face; /* face this is attached to, or nil */ - Lisp_Object face_property; /* property of that face */ -}; +void initialize_charset_font_caches (struct device *d); +void invalidate_charset_font_caches (Lisp_Object charset); -#define FONT_SPECIFIER_DATA(g) SPECIFIER_TYPE_DATA (g, font) -#define FONT_SPECIFIER_FACE(g) (FONT_SPECIFIER_DATA (g)->face) -#define FONT_SPECIFIER_FACE_PROPERTY(g) \ - (FONT_SPECIFIER_DATA (g)->face_property) +DECLARE_LRECORD (font_instance, Lisp_Font_Instance); +#define XFONT_INSTANCE(x) XRECORD (x, font_instance, Lisp_Font_Instance) +#define wrap_font_instance(p) wrap_record (p, font_instance) +#define FONT_INSTANCEP(x) RECORDP (x, font_instance) +#define CHECK_FONT_INSTANCE(x) CHECK_RECORD (x, font_instance) +#define CONCHECK_FONT_INSTANCE(x) CONCHECK_RECORD (x, font_instance) -DECLARE_SPECIFIER_TYPE (font); -#define XFONT_SPECIFIER(x) XSPECIFIER_TYPE (x, font) -#define FONT_SPECIFIERP(x) SPECIFIER_TYPEP (x, font) -#define CHECK_FONT_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, font) -#define CONCHECK_FONT_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, font) +EXFUN (Fmake_font_instance, 3); +EXFUN (Ffont_instance_name, 1); +EXFUN (Ffont_instance_p, 1); +EXFUN (Ffont_instance_truename, 1); + +extern Lisp_Object Vthe_null_font_instance; void set_font_attached_to (Lisp_Object obj, Lisp_Object face, Lisp_Object property); @@ -80,103 +72,7 @@ * Face Boolean Specifier Object * *****************************************************************************/ -struct face_boolean_specifier -{ - Lisp_Object face; /* face this is attached to, or nil */ - Lisp_Object face_property; /* property of that face */ -}; - -#define FACE_BOOLEAN_SPECIFIER_DATA(g) SPECIFIER_TYPE_DATA (g, face_boolean) -#define FACE_BOOLEAN_SPECIFIER_FACE(g) (FACE_BOOLEAN_SPECIFIER_DATA (g)->face) -#define FACE_BOOLEAN_SPECIFIER_FACE_PROPERTY(g) \ - (FACE_BOOLEAN_SPECIFIER_DATA (g)->face_property) - -DECLARE_SPECIFIER_TYPE (face_boolean); -extern Lisp_Object Qface_boolean; -#define XFACE_BOOLEAN_SPECIFIER(x) XSPECIFIER_TYPE (x, face_boolean) -#define FACE_BOOLEAN_SPECIFIERP(x) SPECIFIER_TYPEP (x, face_boolean) -#define CHECK_FACE_BOOLEAN_SPECIFIER(x) \ - CHECK_SPECIFIER_TYPE (x, face_boolean) -#define CONCHECK_FACE_BOOLEAN_SPECIFIER(x) \ - CONCHECK_SPECIFIER_TYPE (x, face_boolean) - void set_face_boolean_attached_to (Lisp_Object obj, Lisp_Object face, Lisp_Object property); -/**************************************************************************** - * Color Instance Object * - ****************************************************************************/ - -EXFUN (Fmake_color_instance, 3); - -extern Lisp_Object Vthe_null_color_instance; - -struct Lisp_Color_Instance -{ - struct lcrecord_header header; - Lisp_Object name; - Lisp_Object device; - - /* console-type-specific data */ - void *data; -}; - -DECLARE_LRECORD (color_instance, Lisp_Color_Instance); -#define XCOLOR_INSTANCE(x) XRECORD (x, color_instance, Lisp_Color_Instance) -#define wrap_color_instance(p) wrap_record (p, color_instance) -#define COLOR_INSTANCEP(x) RECORDP (x, color_instance) -#define CHECK_COLOR_INSTANCE(x) CHECK_RECORD (x, color_instance) -#define CONCHECK_COLOR_INSTANCE(x) CONCHECK_RECORD (x, color_instance) - -#define COLOR_INSTANCE_NAME(c) ((c)->name) -#define COLOR_INSTANCE_DEVICE(c) ((c)->device) - -/**************************************************************************** - * Font Instance Object * - ****************************************************************************/ - -DECLARE_LRECORD (font_instance, Lisp_Font_Instance); -#define XFONT_INSTANCE(x) XRECORD (x, font_instance, Lisp_Font_Instance) -#define wrap_font_instance(p) wrap_record (p, font_instance) -#define FONT_INSTANCEP(x) RECORDP (x, font_instance) -#define CHECK_FONT_INSTANCE(x) CHECK_RECORD (x, font_instance) -#define CONCHECK_FONT_INSTANCE(x) CONCHECK_RECORD (x, font_instance) - -#ifdef MULE -int font_spec_matches_charset (struct device *d, Lisp_Object charset, - const Ibyte *nonreloc, - Lisp_Object reloc, Bytecount offset, - Bytecount length); -#endif - -EXFUN (Fmake_font_instance, 3); -EXFUN (Ffont_instance_name, 1); -EXFUN (Ffont_instance_p, 1); -EXFUN (Ffont_instance_truename, 1); - -extern Lisp_Object Vthe_null_font_instance; - -struct Lisp_Font_Instance -{ - struct lcrecord_header header; - Lisp_Object name; - Lisp_Object device; - - unsigned short ascent; /* extracted from `font', or made up */ - unsigned short descent; - unsigned short width; - unsigned short height; - int proportional_p; - - /* console-type-specific data */ - void *data; -}; - -#define FONT_INSTANCE_NAME(f) ((f)->name) -#define FONT_INSTANCE_DEVICE(f) ((f)->device) -#define FONT_INSTANCE_ASCENT(f) ((f)->ascent) -#define FONT_INSTANCE_DESCENT(f) ((f)->descent) -#define FONT_INSTANCE_WIDTH(f) ((f)->width) -#define FONT_INSTANCE_HEIGHT(f) ((f)->height) - #endif /* INCLUDED_objects_h_ */
--- a/src/postgresql.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/postgresql.c Thu Jun 20 21:19:10 2002 +0000 @@ -98,8 +98,10 @@ #include "lisp.h" #include "sysdep.h" + #include "buffer.h" #include "postgresql.h" +#include "process.h" #ifdef RUNNING_XEMACS_21_1 /* handle interface changes */ #define PG_OS_CODING FORMAT_FILENAME
--- a/src/print.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/print.c Thu Jun 20 21:19:10 2002 +0000 @@ -38,15 +38,15 @@ #include "backtrace.h" #include "buffer.h" #include "bytecode.h" -#include "device.h" +#include "device-impl.h" #include "extents.h" #include "frame.h" #include "insdel.h" #include "lstream.h" #include "opaque.h" -#include "console-tty.h" -#include "console-stream.h" +#include "console-tty-impl.h" +#include "console-stream-impl.h" #ifdef WIN32_NATIVE #include "console-msw.h" #endif
--- a/src/process.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/process.h Thu Jun 20 21:19:10 2002 +0000 @@ -59,9 +59,21 @@ dead_wrong_type_argument (Qprocess_readable_p, (x)); \ } while (0) +EXFUN (Fdelete_process, 1); +EXFUN (Fget_buffer_process, 1); +EXFUN (Fget_process, 1); +EXFUN (Fprocess_status, 1); EXFUN (Fprocess_kill_without_query, 2); EXFUN (Fprocess_id, 1); +DECLARE_DOESNT_RETURN (report_process_error (const char *, Lisp_Object)); +DECLARE_DOESNT_RETURN (report_network_error (const char *, Lisp_Object)); +extern Lisp_Object Vlisp_EXEC_SUFFIXES; + +Ibyte *egetenv (const CIbyte *var); +void eputenv (const CIbyte *var, const CIbyte *value); +extern int env_initted; + extern Lisp_Object Qprocess_live_p; Lisp_Object connect_to_file_descriptor (Lisp_Object name,
--- a/src/redisplay-gtk.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/redisplay-gtk.c Thu Jun 20 21:19:10 2002 +0000 @@ -31,26 +31,26 @@ #include <config.h> #include "lisp.h" -#include "console-gtk.h" -#include "gccache-gtk.h" -#include "glyphs-gtk.h" -#include "objects-gtk.h" - #include "buffer.h" #include "debug.h" +#include "device-impl.h" #include "faces.h" -#include "frame.h" +#include "file-coding.h" +#include "frame-impl.h" #include "gutter.h" #include "redisplay.h" #include "sysdep.h" #include "window.h" -#include "device.h" + +#include "console-gtk-impl.h" +#include "gccache-gtk.h" +#include "glyphs-gtk.h" +#include "objects-gtk-impl.h" #include "sysproc.h" /* for select() */ #ifdef MULE #include "mule-ccl.h" -#include "file-coding.h" /* for CCL conversion */ #endif #define CONST const
--- a/src/redisplay-msw.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/redisplay-msw.c Thu Jun 20 21:19:10 2002 +0000 @@ -40,18 +40,18 @@ #include "buffer.h" #include "charset.h" #include "debug.h" -#include "device.h" +#include "device-impl.h" #include "events.h" #include "faces.h" -#include "frame.h" +#include "frame-impl.h" #include "gutter.h" #include "redisplay.h" #include "sysdep.h" -#include "window.h" +#include "window-impl.h" -#include "console-msw.h" +#include "console-msw-impl.h" #include "glyphs-msw.h" -#include "objects-msw.h" +#include "objects-msw-impl.h" #define MSWINDOWS_EOL_CURSOR_WIDTH 5
--- a/src/redisplay-output.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/redisplay-output.c Thu Jun 20 21:19:10 2002 +0000 @@ -35,8 +35,8 @@ #include "buffer.h" #include "window.h" -#include "frame.h" -#include "device.h" +#include "frame-impl.h" +#include "device-impl.h" #include "glyphs.h" #include "redisplay.h" #include "faces.h"
--- a/src/redisplay-tty.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/redisplay-tty.c Thu Jun 20 21:19:10 2002 +0000 @@ -33,18 +33,18 @@ #include "lisp.h" #include "buffer.h" -#include "device.h" +#include "device-impl.h" #include "events.h" #include "faces.h" -#include "frame.h" +#include "frame-impl.h" #include "glyphs.h" #include "lstream.h" #include "redisplay.h" #include "sysdep.h" #include "window.h" -#include "console-tty.h" -#include "objects-tty.h" +#include "console-tty-impl.h" +#include "objects-tty-impl.h" #include "syssignal.h"
--- a/src/redisplay-x.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/redisplay-x.c Thu Jun 20 21:19:10 2002 +0000 @@ -32,10 +32,10 @@ #include "buffer.h" #include "debug.h" -#include "device.h" +#include "device-impl.h" #include "faces.h" #include "file-coding.h" -#include "frame.h" +#include "frame-impl.h" #include "gutter.h" #include "redisplay.h" #include "sysdep.h" @@ -45,9 +45,9 @@ #include "mule-ccl.h" #endif -#include "console-x.h" +#include "console-x-impl.h" #include "glyphs-x.h" -#include "objects-x.h" +#include "objects-x-impl.h" #include "xgccache.h" #include "EmacsFrame.h"
--- a/src/redisplay.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/redisplay.c Thu Jun 20 21:19:10 2002 +0000 @@ -57,21 +57,21 @@ #include "buffer.h" #include "commands.h" #include "debug.h" -#include "device.h" +#include "device-impl.h" #include "elhash.h" #include "events.h" -#include "extents.h" +#include "extents-impl.h" #include "faces.h" -#include "frame.h" +#include "frame-impl.h" #include "glyphs.h" #include "gutter.h" #include "insdel.h" #include "menubar.h" -#include "objects.h" +#include "objects-impl.h" #include "process.h" #include "redisplay.h" #include "toolbar.h" -#include "window.h" +#include "window-impl.h" #include "line-number.h" #include "file-coding.h" @@ -9226,7 +9226,7 @@ /***************************************************************************/ /* */ -/* Lisp-variable change triggers */ +/* Change flags */ /* */ /***************************************************************************/ @@ -9289,6 +9289,78 @@ Fforce_cursor_redisplay (w->frame); } +void +mark_buffers_changed (void) +{ + MARK_TYPE_CHANGED (buffers); +} + +void +mark_clip_changed (void) +{ + MARK_TYPE_CHANGED (clip); +} + +void +mark_extents_changed (void) +{ + MARK_TYPE_CHANGED (extents); +} + +void +mark_icon_changed (void) +{ + MARK_TYPE_CHANGED (icon); +} + +void +mark_menubar_changed (void) +{ + MARK_TYPE_CHANGED (menubar); +} + +void +mark_modeline_changed (void) +{ + MARK_TYPE_CHANGED (modeline); +} + +void +mark_point_changed (void) +{ + MARK_TYPE_CHANGED (point); +} + +void +mark_toolbar_changed (void) +{ + MARK_TYPE_CHANGED (toolbar); +} + +void +mark_gutter_changed (void) +{ + MARK_TYPE_CHANGED (gutter); +} + +void +mark_glyphs_changed (void) +{ + MARK_TYPE_CHANGED (glyphs); +} + +void +mark_subwindows_changed (void) +{ + MARK_TYPE_CHANGED (subwindows); +} + +void +mark_subwindows_state_changed (void) +{ + MARK_TYPE_CHANGED (subwindows_state); +} + #ifdef MEMORY_USAGE_STATS
--- a/src/redisplay.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/redisplay.h Thu Jun 20 21:19:10 2002 +0000 @@ -518,19 +518,30 @@ object##_changed_set = 1; } \ } while (0) -#define MARK_BUFFERS_CHANGED MARK_TYPE_CHANGED (buffers) -#define MARK_CLIP_CHANGED MARK_TYPE_CHANGED (clip) -#define MARK_EXTENTS_CHANGED MARK_TYPE_CHANGED (extents) -#define MARK_ICON_CHANGED MARK_TYPE_CHANGED (icon) -#define MARK_MENUBAR_CHANGED MARK_TYPE_CHANGED (menubar) -#define MARK_MODELINE_CHANGED MARK_TYPE_CHANGED (modeline) -#define MARK_POINT_CHANGED MARK_TYPE_CHANGED (point) -#define MARK_TOOLBAR_CHANGED MARK_TYPE_CHANGED (toolbar) -#define MARK_GUTTER_CHANGED MARK_TYPE_CHANGED (gutter) -#define MARK_GLYPHS_CHANGED MARK_TYPE_CHANGED (glyphs) -#define MARK_SUBWINDOWS_CHANGED MARK_TYPE_CHANGED (subwindows) -#define MARK_SUBWINDOWS_STATE_CHANGED MARK_TYPE_CHANGED (subwindows_state) - +void mark_buffers_changed (void); +#define MARK_BUFFERS_CHANGED mark_buffers_changed () +void mark_clip_changed (void); +#define MARK_CLIP_CHANGED mark_clip_changed () +void mark_extents_changed (void); +#define MARK_EXTENTS_CHANGED mark_extents_changed () +void mark_icon_changed (void); +#define MARK_ICON_CHANGED mark_icon_changed () +void mark_menubar_changed (void); +#define MARK_MENUBAR_CHANGED mark_menubar_changed () +void mark_modeline_changed (void); +#define MARK_MODELINE_CHANGED mark_modeline_changed () +void mark_point_changed (void); +#define MARK_POINT_CHANGED mark_point_changed () +void mark_toolbar_changed (void); +#define MARK_TOOLBAR_CHANGED mark_toolbar_changed () +void mark_gutter_changed (void); +#define MARK_GUTTER_CHANGED mark_gutter_changed () +void mark_glyphs_changed (void); +#define MARK_GLYPHS_CHANGED mark_glyphs_changed () +void mark_subwindows_changed (void); +#define MARK_SUBWINDOWS_CHANGED mark_subwindows_changed () +void mark_subwindows_state_changed (void); +#define MARK_SUBWINDOWS_STATE_CHANGED mark_subwindows_state_changed () #define CLASS_RESET_CHANGED_FLAGS(p) do { \ (p)->buffers_changed = 0; \
--- a/src/s/cygwin32.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/s/cygwin32.h Thu Jun 20 21:19:10 2002 +0000 @@ -83,3 +83,9 @@ It sets the Lisp variable system-type. */ #define SYSTEM_TYPE "cygwin32" + +/* Cygwin bogusly forgets to copy mmap()ed regions into the child when + a fork is done; thus, any reference to anything in mmap()ed space + (under PDUMP, in particular, this bites, since all data loaded from + PDUMP is normally done using mmap()) will cause an immediate segfault. */ +#undef HAVE_MMAP
--- a/src/s/win32-common.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/s/win32-common.h Thu Jun 20 21:19:10 2002 +0000 @@ -1,6 +1,6 @@ /* Common system description file for cygwin32/windowsnt/mingw32. Copyright (C) 1993, 1994, 1995, 1999 Free Software Foundation, Inc. - Copyright (C) 2001 Ben Wing. + Copyright (C) 2001, 2002 Ben Wing. This file is part of XEmacs. @@ -22,15 +22,9 @@ /* Do not define LOAD_AVE_TYPE or LOAD_AVE_CVT since there is no load average available. */ -/* If you are compiling with a non-C calling convention but need to - declare vararg routines differently, put it here */ -#define _VARARGS_ __cdecl - -/* If you are providing a function to something that will call the - function back (like a signal handler and signal, or main) its calling - convention must be whatever standard the libraries expect */ -#define _CALLBACK_ __cdecl - #define NO_MATHERR #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:" + +/* Define an identifier for all MS Windows systems -- Cygwin, native, MinGW */ +#define WIN32_ANY
--- a/src/s/windowsnt.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/s/windowsnt.h Thu Jun 20 21:19:10 2002 +0000 @@ -233,12 +233,25 @@ # define WINVER 0x0400 #endif +/* Vararg routines, main(), and callback routines for library functions + (qsort(), signal(), etc.) need to be __cdecl if we use the fastcall + convention by default (a good idea, since it speeds things up). #### Why + do they have to complain about this? Why not just do the right thing + automatically? + + Prefix with X because plain CDECL is already defined by the VC++ header + files. */ +#define XCDECL __cdecl + /* MSVC 6.0 has a mechanism to declare functions which never return */ #if (_MSC_VER >= 1200) #define DOESNT_RETURN __declspec(noreturn) void #define DECLARE_DOESNT_RETURN(decl) __declspec(noreturn) extern void decl #define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \ - __declspec(noreturn) extern void decl PRINTF_ARGS(str,idx) + __declspec(noreturn) extern void __cdecl decl PRINTF_ARGS(str,idx) +#else +#define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \ + extern void __cdecl decl PRINTF_ARGS(str,idx) #endif /* MSVC 6.0 */ /* MSVC warnings no-no crap. When adding one to this section,
--- a/src/scrollbar-gtk.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/scrollbar-gtk.c Thu Jun 20 21:19:10 2002 +0000 @@ -27,14 +27,14 @@ #include <config.h> #include "lisp.h" -#include "console-gtk.h" +#include "frame-impl.h" +#include "window.h" + +#include "console-gtk-impl.h" #include "glyphs-gtk.h" #include "gui-gtk.h" #include "scrollbar-gtk.h" -#include "frame.h" -#include "window.h" - static gboolean scrollbar_cb (GtkAdjustment *adj, gpointer user_data); /* Used to prevent changing the size of the slider while drag
--- a/src/scrollbar-msw.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/scrollbar-msw.c Thu Jun 20 21:19:10 2002 +0000 @@ -33,13 +33,13 @@ #include "device.h" #include "elhash.h" #include "events.h" -#include "frame.h" +#include "frame-impl.h" #include "opaque.h" #include "scrollbar.h" #include "specifier.h" -#include "window.h" +#include "window-impl.h" -#include "console-msw.h" +#include "console-msw-impl.h" #include "scrollbar-msw.h" /* We use a similar sort of vertical scrollbar drag hack for mswindows
--- a/src/scrollbar-x.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/scrollbar-x.c Thu Jun 20 21:19:10 2002 +0000 @@ -28,11 +28,11 @@ #include <config.h> #include "lisp.h" -#include "device.h" -#include "frame.h" +#include "device-impl.h" +#include "frame-impl.h" #include "window.h" -#include "console-x.h" +#include "console-x-impl.h" #include "glyphs-x.h" #include "gui-x.h" #include "scrollbar-x.h"
--- a/src/scrollbar.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/scrollbar.c Thu Jun 20 21:19:10 2002 +0000 @@ -31,8 +31,8 @@ #include "buffer.h" #include "commands.h" #include "scrollbar.h" -#include "device.h" -#include "frame.h" +#include "device-impl.h" +#include "frame-impl.h" #include "glyphs.h" #include "gutter.h" #include "window.h"
--- a/src/search.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/search.c Thu Jun 20 21:19:10 2002 +0000 @@ -111,7 +111,6 @@ Lisp_Object Vskip_chars_range_table; static void set_search_regs (struct buffer *buf, Charbpos beg, Charcount len); -static void save_search_regs (void); static Charbpos simple_search (struct buffer *buf, Ibyte *base_pat, Bytecount len, Bytebpos pos, Bytebpos lim, EMACS_INT n, Lisp_Object trt); @@ -599,7 +598,7 @@ static Bytebpos byte_scan_buffer (struct buffer *buf, Ichar target, Bytebpos st, Bytebpos en, - EMACS_INT count, EMACS_INT *shortage, int allow_quit) + EMACS_INT count, EMACS_INT *shortage, int allow_quit) { Bytebpos lim = en > 0 ? en : ((count > 0) ? BYTE_BUF_ZV (buf) : BYTE_BUF_BEGV (buf)); @@ -830,6 +829,7 @@ return pos; } +/* This function synched with FSF 21.1 */ static Lisp_Object skip_chars (struct buffer *buf, int forwardp, int syntaxp, Lisp_Object string, Lisp_Object lim) @@ -896,6 +896,7 @@ { Ichar cend; + /* Skip over the dash. */ p++; if (p == pend) break; cend = itext_ichar (p); @@ -920,6 +921,7 @@ } } + /* #### Not in FSF 21.1 */ if (syntaxp && fastmap['-'] != 0) fastmap[' '] = 1; @@ -933,36 +935,46 @@ { Charbpos start_point = BUF_PT (buf); + Charbpos pos = start_point; + Charbpos pos_byte = BYTE_BUF_PT (buf); if (syntaxp) { - scache = setup_buffer_syntax_cache (buf, BUF_PT (buf), - forwardp ? 1 : -1); + scache = setup_buffer_syntax_cache (buf, pos, forwardp ? 1 : -1); /* All syntax designators are normal chars so nothing strange to worry about */ if (forwardp) { - while (BUF_PT (buf) < limit - && fastmap[(unsigned char) - syntax_code_spec - [(int) SYNTAX_FROM_CACHE - (scache, BUF_FETCH_CHAR (buf, BUF_PT (buf)))]]) - { - BUF_SET_PT (buf, BUF_PT (buf) + 1); - UPDATE_SYNTAX_CACHE_FORWARD (scache, BUF_PT (buf)); - } + if (pos < limit) + while (fastmap[(unsigned char) + syntax_code_spec + [(int) SYNTAX_FROM_CACHE + (scache, BYTE_BUF_FETCH_CHAR (buf, pos_byte))]]) + { + pos++; + INC_BYTEBPOS (buf, pos_byte); + if (pos >= XINT (lim)) + break; + UPDATE_SYNTAX_CACHE_FORWARD (scache, pos); + } } else { - while (BUF_PT (buf) > limit - && fastmap[(unsigned char) - syntax_code_spec - [(int) SYNTAX_FROM_CACHE - (scache, - BUF_FETCH_CHAR (buf, BUF_PT (buf) - 1))]]) + while (pos > limit) { - BUF_SET_PT (buf, BUF_PT (buf) - 1); - UPDATE_SYNTAX_CACHE_BACKWARD (scache, BUF_PT (buf) - 1); + Charbpos savepos = pos_byte; + pos--; + DEC_BYTEBPOS (buf, pos_byte); + UPDATE_SYNTAX_CACHE_BACKWARD (scache, pos); + if (!fastmap[(unsigned char) + syntax_code_spec + [(int) SYNTAX_FROM_CACHE + (scache, BYTE_BUF_FETCH_CHAR (buf, pos_byte))]]) + { + pos++; + pos_byte = savepos; + break; + } } } } @@ -970,36 +982,47 @@ { if (forwardp) { - while (BUF_PT (buf) < limit) + while (pos < limit) { - Ichar ch = BUF_FETCH_CHAR (buf, BUF_PT (buf)); + Ichar ch = BYTE_BUF_FETCH_CHAR (buf, pos_byte); if ((ch < 0400) ? fastmap[ch] : (NILP (Fget_range_table (make_int (ch), Vskip_chars_range_table, Qnil)) == negate)) - BUF_SET_PT (buf, BUF_PT (buf) + 1); + { + pos++; + INC_BYTEBPOS (buf, pos_byte); + } else break; } } else { - while (BUF_PT (buf) > limit) + while (pos > limit) { - Ichar ch = BUF_FETCH_CHAR (buf, BUF_PT (buf) - 1); + Charbpos prev_pos_byte = pos_byte; + Ichar ch; + + DEC_BYTEBPOS (buf, prev_pos_byte); + ch = BYTE_BUF_FETCH_CHAR (buf, prev_pos_byte); if ((ch < 0400) ? fastmap[ch] : (NILP (Fget_range_table (make_int (ch), Vskip_chars_range_table, Qnil)) == negate)) - BUF_SET_PT (buf, BUF_PT (buf) - 1); + { + pos--; + pos_byte = prev_pos_byte; + } else break; } } } QUIT; + BOTH_BUF_SET_PT (buf, pos, pos_byte); return make_int (BUF_PT (buf) - start_point); } } @@ -2914,48 +2937,6 @@ return Qnil; } -/* If non-zero the match data have been saved in saved_search_regs - during the execution of a sentinel or filter. */ -static int search_regs_saved; -static struct re_registers saved_search_regs; - -/* Called from Flooking_at, Fstring_match, search_buffer, Fstore_match_data - if asynchronous code (filter or sentinel) is running. */ -static void -save_search_regs (void) -{ - if (!search_regs_saved) - { - saved_search_regs.num_regs = search_regs.num_regs; - saved_search_regs.start = search_regs.start; - saved_search_regs.end = search_regs.end; - search_regs.num_regs = 0; - search_regs.start = 0; - search_regs.end = 0; - - search_regs_saved = 1; - } -} - -/* Called upon exit from filters and sentinels. */ -void -restore_match_data (void) -{ - if (search_regs_saved) - { - if (search_regs.num_regs > 0) - { - xfree (search_regs.start); - xfree (search_regs.end); - } - search_regs.num_regs = saved_search_regs.num_regs; - search_regs.start = saved_search_regs.start; - search_regs.end = saved_search_regs.end; - - search_regs_saved = 0; - } -} - /* Quote a string to inactivate reg-expr chars */ DEFUN ("regexp-quote", Fregexp_quote, 1, 1, 0, /*
--- a/src/select-gtk.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/select-gtk.c Thu Jun 20 21:19:10 2002 +0000 @@ -31,13 +31,15 @@ #include <config.h> #include "lisp.h" -#include "events.h" + #include "buffer.h" -#include "device.h" -#include "console-gtk.h" +#include "device-impl.h" +#include "events.h" +#include "frame.h" +#include "opaque.h" #include "select.h" -#include "opaque.h" -#include "frame.h" + +#include "console-gtk-impl.h" static Lisp_Object Vretrieved_selection; static gboolean waiting_for_selection;
--- a/src/select-msw.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/select-msw.c Thu Jun 20 21:19:10 2002 +0000 @@ -34,12 +34,12 @@ #include <config.h> #include "lisp.h" #include "buffer.h" -#include "frame.h" +#include "frame-impl.h" #include "select.h" #include "opaque.h" #include "file-coding.h" -#include "console-msw.h" +#include "console-msw-impl.h" static int in_own_selection;
--- a/src/select-x.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/select-x.c Thu Jun 20 21:19:10 2002 +0000 @@ -27,12 +27,12 @@ #include "lisp.h" #include "charset.h" -#include "device.h" -#include "frame.h" +#include "device-impl.h" +#include "frame-impl.h" #include "opaque.h" #include "select.h" -#include "console-x.h" +#include "console-x-impl.h" #include "objects-x.h" #include "systime.h"
--- a/src/select.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/select.c Thu Jun 20 21:19:10 2002 +0000 @@ -25,7 +25,7 @@ #include "lisp.h" #include "buffer.h" -#include "device.h" +#include "device-impl.h" #include "extents.h" #include "console.h" #include "objects.h"
--- a/src/signal.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/signal.c Thu Jun 20 21:19:10 2002 +0000 @@ -25,9 +25,9 @@ #include "lisp.h" #include "console.h" -#include "device.h" +#include "device-impl.h" #include "events.h" /* for signal_fake_event() */ -#include "frame.h" +#include "frame-impl.h" #include "process.h" #include "sysdep.h" @@ -769,13 +769,6 @@ */ -static Lisp_Object -restore_dont_check_for_quit (Lisp_Object val) -{ - dont_check_for_quit = XINT (val); - return Qnil; -} - /* Defer all checking or processing of C-g. You can do this, for example, if you want to read C-g's as events. (In that case, you should set Vquit_flag to Qnil just before you unbind, because it typically gets set
--- a/src/sound.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/sound.c Thu Jun 20 21:19:10 2002 +0000 @@ -33,9 +33,9 @@ #include "buffer.h" #ifdef HAVE_X_WINDOWS -#include "console-x.h" +#include "console-x-impl.h" #endif -#include "device.h" +#include "device-impl.h" #include "redisplay.h" #include "sound.h" @@ -47,6 +47,10 @@ # include "sysproc.h" #endif +#ifdef WIN32_NATIVE +#include "syswindows.h" +#endif + #ifdef HAVE_ESD_SOUND extern int esd_play_sound_file (Extbyte *file, int vol); extern int esd_play_sound_data (UChar_Binary *data, size_t length, int vol);
--- a/src/specifier.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/specifier.c Thu Jun 20 21:19:10 2002 +0000 @@ -33,7 +33,7 @@ #include "buffer.h" #include "chartab.h" -#include "device.h" +#include "device-impl.h" #include "frame.h" #include "glyphs.h" #include "opaque.h" @@ -274,8 +274,13 @@ sp->methods->name, sp->header.uid); write_fmt_string (printcharfun, "#<%s-specifier global=", sp->methods->name); +#if 0 + /* #### Not obvious this is useful, and overrides user settings; if we + resurrect this, create variables like `print-specifier-length' so it + can be controlled. */ specbind (Qprint_string_length, make_int (100)); specbind (Qprint_length, make_int (5)); +#endif the_specs = Fspecifier_specs (obj, Qglobal, Qnil, Qnil); if (NILP (the_specs)) /* there are no global specs */ @@ -1017,7 +1022,6 @@ Lisp_Object rest, rest2; Lisp_Object device = wrap_device (d); - DEVICE_USER_DEFINED_TAGS (d) = Fcopy_alist (Vuser_defined_tags); /* Now set up the initial values */ @@ -1031,7 +1035,8 @@ if (NILP (predicate)) XCDR (XCAR (rest2)) = Qt; else - XCDR (XCAR (rest2)) = !NILP (call1 (predicate, device)) ? Qt : Qnil; + XCDR (XCAR (rest2)) = + !NILP (call_critical_lisp_code (d, predicate, device)) ? Qt : Qnil; } } @@ -2716,11 +2721,14 @@ display table is not there. (Chartable specifiers are not yet implemented.) --- For font specifiers, MATCHSPEC should be a charset, and the specification - (a font string) must have a registry that matches the charset's registry. - (This only makes sense with Mule support.) This makes it easy to choose a - font that can display a particular character. (This is what redisplay - does, in fact.) +-- For font specifiers, MATCHSPEC should be a list (CHARSET . SECOND-STAGE-P), + and the specification (a font string) must have a registry that matches + the charset's registry. (This only makes sense with Mule support.) This + makes it easy to choose a font that can display a particular + character. (This is what redisplay does, in fact.) SECOND-STAGE-P means + to ignore the font's registry and instead look at the characters in the + font to see if the font can support the charset. This currently only makes + sense under MS Windows. */ (specifier, matchspec, domain, default_, no_fallback)) {
--- a/src/symbols.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/symbols.c Thu Jun 20 21:19:10 2002 +0000 @@ -55,7 +55,7 @@ #include "lisp.h" #include "buffer.h" /* for Vbuffer_defaults */ -#include "console.h" +#include "console-impl.h" #include "elhash.h" Lisp_Object Qad_advice_info, Qad_activate;
--- a/src/syntax.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/syntax.c Thu Jun 20 21:19:10 2002 +0000 @@ -382,7 +382,7 @@ void signal_syntax_table_extent_changed (EXTENT extent) { - Lisp_Object buffer = extent_object (extent); + Lisp_Object buffer = Fextent_object (wrap_extent (extent)); if (BUFFERP (buffer)) { struct syntax_cache *cache = XBUFFER (buffer)->syntax_cache;
--- a/src/sysdep.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/sysdep.c Thu Jun 20 21:19:10 2002 +0000 @@ -47,7 +47,7 @@ #include "buffer.h" -#include "device.h" +#include "device-impl.h" #include "events.h" #include "frame.h" #include "process.h" @@ -56,11 +56,11 @@ #include "window.h" #ifdef HAVE_TTY -#include "console-tty.h" +#include "console-tty-impl.h" #else #endif /* HAVE_TTY */ -#include "console-stream.h" +#include "console-stream-impl.h" #ifdef WIN32_NATIVE #include "syswindows.h" #endif @@ -186,7 +186,7 @@ It seems that O_NONBLOCK applies only to FIFOs? From lowry@watson.ibm.com (Andy Lowry). */ /* #### Should this be conditionalized on FIONBIO? */ -#if defined (STRIDE) || defined (pfa) || defined (AIX) +#if defined (STRIDE) || (defined (pfa) && defined (HAVE_PTYS)) || defined (AIX) { int one = 1; ioctl (fd, FIONBIO, &one); @@ -529,17 +529,13 @@ #if !defined (SIGTSTP) && !defined (USG_JOBCTRL) -#if defined(__STDC__) || defined(_MSC_VER) #define SIG_PARAM_TYPE int -#else -#define SIG_PARAM_TYPE -#endif /* Record a signal code and the handler for it. */ struct save_signal { int code; - SIGTYPE (*handler) (SIG_PARAM_TYPE); + RETSIGTYPE (XCDECL * handler) (SIG_PARAM_TYPE); }; static void @@ -548,7 +544,7 @@ while (saved_handlers->code) { saved_handlers->handler - = (SIGTYPE (*) (SIG_PARAM_TYPE)) EMACS_SIGNAL (saved_handlers->code, SIG_IGN); + = (RETSIGTYPE (XCDECL *) (SIG_PARAM_TYPE)) EMACS_SIGNAL (saved_handlers->code, SIG_IGN); saved_handlers++; } } @@ -2536,7 +2532,7 @@ /* Like qxe_open() below but operates on externally-encoded filenames. */ -int +int XCDECL retry_open (const Extbyte *path, int oflag, ...) { int mode; @@ -2562,7 +2558,7 @@ /* The basic external entry point to open(). Handles conversion to external encoding, interruptions, etc. */ -int +int XCDECL qxe_open (const Ibyte *path, int oflag, ...) { Extbyte *pathout; @@ -3166,14 +3162,7 @@ qxe_rename (const Ibyte *old, const Ibyte *new) { #ifdef WIN32_NATIVE - /* Windows rename fails if NEW exists */ - if (mswindows_rename (old, new) == 0) - return 0; - /* In some cases errno is EACCES if NEW exists */ - if (errno != EEXIST && errno != EACCES) - return -1; - if (mswindows_unlink (new) != 0) - return -1; + return mswindows_rename (old, new); #else /* not WIN32_NATIVE */ Extbyte *oldout, *newout; PATHNAME_CONVERT_OUT (old, oldout);
--- a/src/syssignal.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/syssignal.h Thu Jun 20 21:19:10 2002 +0000 @@ -108,7 +108,7 @@ */ #ifndef NeXT -typedef SIGTYPE (*signal_handler_t) (int); +typedef RETSIGTYPE (XCDECL * signal_handler_t) (int); #endif #if defined (HAVE_SIGPROCMASK)
--- a/src/syswindows.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/syswindows.h Thu Jun 20 21:19:10 2002 +0000 @@ -1053,7 +1053,7 @@ int * is_cygnus_app); Ibyte *mswindows_getdcwd (int drivelet); -/* In process-nt.c */ +/* in process-nt.c */ extern int mswindows_compare_env (const void *strp1, const void *strp2); /* in win32.c */ @@ -1064,4 +1064,8 @@ int errnum)); Lisp_Object mswindows_lisp_error (int errnum); +/* in intl-win32.c */ +extern Lisp_Object Qmswindows_tstr, Qmswindows_unicode; +extern Lisp_Object Qmswindows_multibyte, Qmswindows_multibyte_to_unicode; + #endif /* INCLUDED_syswindows_h_ */
--- a/src/toolbar-common.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/toolbar-common.c Thu Jun 20 21:19:10 2002 +0000 @@ -26,9 +26,9 @@ #include <config.h> #include "lisp.h" -#include "device.h" +#include "device-impl.h" #include "faces.h" -#include "frame.h" +#include "frame-impl.h" #include "glyphs.h" #include "toolbar.h" #include "window.h" @@ -53,12 +53,12 @@ ** Use __INTERNAL_FLUSH to do this. It is passed a device. */ #if defined(HAVE_GTK) -#include "console-gtk.h" +#include "console-gtk-impl.h" #define __INTERNAL_MAPPED_P(f) GTK_WIDGET_REALIZED (FRAME_GTK_TEXT_WIDGET (f)) #define __INTERNAL_FLUSH(d) gdk_flush() #define __INTERNAL_APPROPRIATENESS_CHECK(f) assert(FRAME_GTK_P (f)) #elif defined(HAVE_X_WINDOWS) -#include "console-x.h" +#include "console-x-impl.h" #define __INTERNAL_MAPPED_P(f) XtIsRealized (FRAME_X_SHELL_WIDGET (f)) #define __INTERNAL_APPROPRIATENESS_CHECK(f) assert(FRAME_X_P (f)) #define __INTERNAL_FLUSH(d) XFlush (DEVICE_X_DISPLAY (d))
--- a/src/toolbar-gtk.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/toolbar-gtk.c Thu Jun 20 21:19:10 2002 +0000 @@ -25,9 +25,12 @@ #include <config.h> #include "lisp.h" + #include "frame.h" + #include "toolbar-common.h" -#include "console-gtk.h" + +#include "console-gtk-impl.h" /* We should really create a 'common' console type and fill it with ** all the shared code. We would then just use
--- a/src/toolbar-msw.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/toolbar-msw.c Thu Jun 20 21:19:10 2002 +0000 @@ -38,14 +38,14 @@ #include "device.h" #include "elhash.h" #include "faces.h" -#include "frame.h" +#include "frame-impl.h" #include "gui.h" #include "toolbar.h" #include "window.h" -#include "console-msw.h" +#include "console-msw-impl.h" #include "glyphs-msw.h" -#include "objects-msw.h" +// #include "objects-msw.h" #define TOOLBAR_ITEM_ID_MIN 0x4000 #define TOOLBAR_ITEM_ID_MAX 0x7FFF @@ -100,9 +100,9 @@ mswindows_clear_toolbar (struct frame *f, enum toolbar_pos pos, int thickness_change) { - HIMAGELIST ilist=NULL; + HIMAGELIST ilist = NULL; int i; - HWND toolbarwnd = TOOLBAR_HANDLE(f, pos); + HWND toolbarwnd = TOOLBAR_HANDLE (f, pos); if (toolbarwnd) { TBBUTTON info; @@ -586,14 +586,6 @@ #undef DELETE_TOOLBAR } -/* map toolbar hwnd to pos */ -static int -mswindows_find_toolbar_pos (struct frame *f, HWND ctrl) -{ - int id = GetDlgCtrlID (ctrl); - return id ? id - TOOLBAR_ID_BIAS : -1; -} - Lisp_Object mswindows_get_toolbar_button_text (struct frame *f, int command_id) {
--- a/src/toolbar-x.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/toolbar-x.c Thu Jun 20 21:19:10 2002 +0000 @@ -28,19 +28,20 @@ #include <config.h> #include "lisp.h" -#include "console-x.h" -#include "glyphs-x.h" -#include "objects-x.h" -#include "EmacsFrame.h" -#include "EmacsFrameP.h" - #include "faces.h" -#include "frame.h" +#include "frame-impl.h" #include "toolbar.h" #include "window.h" #include "toolbar-common.h" +#include "console-x-impl.h" +#include "glyphs-x.h" +#include "objects-x.h" + +#include "EmacsFrame.h" +#include "EmacsFrameP.h" + /* We should really create a 'common' console type and fill it with ** all the shared code. We would then just use ** CONSOLE_INHERITS_METHOD(x,common,blah)
--- a/src/toolbar.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/toolbar.c Thu Jun 20 21:19:10 2002 +0000 @@ -30,8 +30,8 @@ #include "lisp.h" #include "buffer.h" -#include "frame.h" -#include "device.h" +#include "frame-impl.h" +#include "device-impl.h" #include "glyphs.h" #include "redisplay.h" #include "toolbar.h"
--- a/src/unicode.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/unicode.c Thu Jun 20 21:19:10 2002 +0000 @@ -1178,6 +1178,8 @@ #endif /* MULE */ } +#ifdef MULE + static Lisp_Object cerrar_el_fulano (Lisp_Object fulano) { @@ -1186,8 +1188,6 @@ return Qnil; } -#ifdef MULE - DEFUN ("parse-unicode-translation-table", Fparse_unicode_translation_table, 2, 6, 0, /* Parse Unicode translation data in FILENAME for CHARSET.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/window-impl.h Thu Jun 20 21:19:10 2002 +0000 @@ -0,0 +1,287 @@ +/* Window definitions for XEmacs. + Copyright (C) 1985, 1986, 1992, 1993, 1994, 1995 + Free Software Foundation, Inc. + Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. + Copyright (C) 1995, 1996, 2002 Ben Wing. + Copyright (C) 1996 Chuck Thompson. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: FSF 19.30. */ + +#ifndef INCLUDED_window_impl_h_ +#define INCLUDED_window_impl_h_ + +#include "window.h" + +/* All windows in use are arranged into a tree, with pointers up and down. + +Windows that are leaves of the tree are actually displayed +and show the contents of buffers. Windows that are not leaves +are used for representing the way groups of leaf windows are +arranged on the frame. Leaf windows never become non-leaves. +They are deleted only by calling delete-window on them (but +this can be done implicitly). Combination windows can be created +and deleted at any time. + +A leaf window has a non-nil buffer field, and also + has markers in its start and pointm fields. Non-leaf windows + have nil in these fields. + +Non-leaf windows are either vertical or horizontal combinations. + +A vertical combination window has children that are arranged on the frame +one above the next. Its vchild field points to the uppermost child. +The parent field of each of the children points to the vertical +combination window. The next field of each child points to the +child below it, or is nil for the lowest child. The prev field +of each child points to the child above it, or is nil for the +highest child. + +A horizontal combination window has children that are side by side. +Its hchild field points to the leftmost child. In each child +the next field points to the child to the right and the prev field +points to the child to the left. + +The children of a vertical combination window may be leaf windows +or horizontal combination windows. The children of a horizontal +combination window may be leaf windows or vertical combination windows. + +At the top of the tree are two windows which have nil as parent. +The second of these is minibuf_window. The first one manages all +the frame area that is not minibuffer, and is called the root window. +Different windows can be the root at different times; +initially the root window is a leaf window, but if more windows +are created then that leaf window ceases to be root and a newly +made combination window becomes root instead. + +In any case, on screens which have an ordinary window and a +minibuffer, prev of the minibuf window is the root window and next of +the root window is the minibuf window. On minibufferless screens or +minibuffer-only screens, the root window and the minibuffer window are +one and the same, so its prev and next members are nil. + +A dead window has the `dead' flag set on it. Note that unlike other +dead objects, dead windows can be made live again through restoring a +window configuration. This means that the values in a dead window +need to be preserved, except for those that are reconstructed by from +the window configuration. */ + +struct window +{ + struct lcrecord_header header; + + /* The upper left corner coordinates of this window, + as integers (pixels) relative to upper left corner of frame = 0, 0 */ + int pixel_left; + int pixel_top; + /* The size of the window (in pixels) */ + int pixel_height; + int pixel_width; + + /* Number of columns display within the window is scrolled to the left. */ + int hscroll; + /* Idem for the window's modeline */ + Charcount modeline_hscroll; + /* Amount to clip off the top line for pixel-based scrolling. Point + will remain constant but this will be incremented to + incrementally shift lines up. */ + int top_yoffset; + /* Amount to clip off the left of the lines for pixel-based + scrolling. Hscroll will remain constant but this will be + incremented to incrementally shift lines left.*/ + int left_xoffset; + + /* face cache elements correct for this window and its current buffer */ + face_cachel_dynarr *face_cachels; + /* glyph cache elements correct for this window and its current buffer */ + glyph_cachel_dynarr *glyph_cachels; + /* List of starting positions for display lines. Only valid if + buffer has not changed. */ + line_start_cache_dynarr *line_start_cache; + int line_cache_validation_override; + + /* Length of longest line currently displayed. Used to control the + width of the horizontal scrollbars. */ + int max_line_len; + + /* Frame coords of point at that time */ + int last_point_x[3]; + int last_point_y[3]; + + /* Number of characters in buffer past bottom of window, + as of last redisplay that finished. */ + /* need one for each set of display structures */ + int window_end_pos[3]; + + /* Set by the extent code when extents in the gutter are changed. */ + int gutter_extent_modiff[4]; + + /* Set by redisplay to the last position seen. This is used + to implement the redisplay-end-trigger-functions. */ + Charbpos last_redisplay_pos; + +#define WINDOW_SLOT_DECLARATION +#define WINDOW_SLOT(slot) Lisp_Object slot; +#include "winslots.h" + + /* one-bit flags: */ + + /* marker used when restoring a window configuration */ + unsigned int config_mark :1; + /* Non-zero means window was dead. */ + unsigned int dead :1; + /* Non-zero means next redisplay must use the value of start + set up for it in advance. Set by scrolling commands. */ + unsigned int force_start :1; + /* Non-zero means must regenerate modeline of this window */ + unsigned int redo_modeline :1; + /* Non-zero means current value of `start' + was the beginning of a line when it was chosen. */ + unsigned int start_at_line_beg :1; + /* new redisplay flag */ + unsigned int windows_changed :1; + unsigned int shadow_thickness_changed :1; + /* Vertical divider flag and validity of it */ + unsigned int need_vertical_divider_p :1; + unsigned int need_vertical_divider_valid_p :1; +}; + +#define CURRENT_DISP 0 +#define DESIRED_DISP 1 +#define CMOTION_DISP 2 + +struct window_mirror +{ + struct lcrecord_header header; + + /* Frame this mirror is on. */ + struct frame *frame; + + /* Following child (to right or down) at same level of tree */ + struct window_mirror *next; + + /* There is no prev field because we never traverse this structure + backwards. Same goes for the parent field. */ + + /* First child of this window. */ + /* vchild is used if this is a vertical combination, + hchild if this is a horizontal combination. */ + struct window_mirror *hchild, *vchild; + + /* Dynamic array of display lines */ + display_line_dynarr *current_display_lines; + display_line_dynarr *desired_display_lines; + + /* Buffer current_display_lines represent. */ + struct buffer *buffer; + +#ifdef HAVE_SCROLLBARS + /* Scrollbars associated with window, if any. */ + struct scrollbar_instance *scrollbar_vertical_instance; + struct scrollbar_instance *scrollbar_horizontal_instance; +#endif /* HAVE_SCROLLBARS */ + + /* Flag indicating whether a subwindow is currently being displayed. */ + unsigned int subwindows_being_displayed :1; + + /* Keep track of the truncation status in this window so we can + detect when it has changed. #### Magic variables would be a huge + win here. */ + unsigned int truncate_win :1; +}; + +/* Redefine basic properties more efficiently */ + +#undef WINDOW_LIVE_P +#define WINDOW_LIVE_P(x) (!(x)->dead) +#undef WINDOW_FRAME +#define WINDOW_FRAME(w) ((w)->frame) +#undef WINDOW_BUFFER +#define WINDOW_BUFFER(w) ((w)->buffer) + +/* 1 if W is a minibuffer window. */ +#define MINI_WINDOW_P(W) (!NILP ((W)->mini_p)) + +/* 1 if we are dealing with a parentless window (this includes the + root window on a frame and the minibuffer window; both of these + are siblings). */ +#define TOP_LEVEL_WINDOW_P(w) NILP ((w)->parent) + +/* Set all redisplay flags indicating a window has changed */ +#define MARK_WINDOWS_CHANGED(w) do { \ + (w)->windows_changed = 1; \ + if (!NILP (w->frame)) \ + { \ + struct frame *mwc_frame = XFRAME (w->frame); \ + MARK_FRAME_WINDOWS_CHANGED (mwc_frame); \ + } \ + else \ + windows_changed = 1; \ +} while (0) + +/* #### This should be fixed not to call MARK_FRAME_CHANGED because + faces are cached per window. Also, other code which changes window's + face should use this macro. +*/ +#define MARK_WINDOW_FACES_CHANGED(w) \ + MARK_FRAME_FACES_CHANGED (XFRAME ((w)->frame)) + +#define WINDOW_TTY_P(w) FRAME_TTY_P (XFRAME ((w)->frame)) +#define WINDOW_X_P(w) FRAME_X_P (XFRAME ((w)->frame)) +#define WINDOW_NS_P(w) FRAME_NS_P (XFRAME ((w)->frame)) +#define WINDOW_WIN_P(w) FRAME_WIN_P (XFRAME ((w)->frame)) + +/* XEmacs window size and positioning macros. */ +#define WINDOW_TOP(w) ((w)->pixel_top) +#define WINDOW_TEXT_TOP(w) (WINDOW_TOP (w) + window_top_gutter_height (w)) +#define WINDOW_TEXT_TOP_CLIP(w) ((w)->top_yoffset) +#define WINDOW_BOTTOM(w) ((w)->pixel_top + (w)->pixel_height) +#define WINDOW_TEXT_BOTTOM(w) (WINDOW_BOTTOM (w) - window_bottom_gutter_height (w)) +#define WINDOW_LEFT(w) ((w)->pixel_left) +#define WINDOW_TEXT_LEFT(w) (WINDOW_LEFT (w) + window_left_gutter_width (w, 0)) +#define WINDOW_MODELINE_LEFT(w) \ + (WINDOW_LEFT (w) + window_left_gutter_width (w, 1)) +#define WINDOW_RIGHT(w) ((w)->pixel_left + (w)->pixel_width) +#define WINDOW_TEXT_RIGHT(w) \ + (WINDOW_RIGHT (w) - window_right_gutter_width (w, 0)) +#define WINDOW_MODELINE_RIGHT(w) \ + (WINDOW_RIGHT (w) - window_right_gutter_width (w, 1)) + +#define WINDOW_HEIGHT(w) ((w)->pixel_height) +#define WINDOW_TEXT_HEIGHT(w) (WINDOW_TEXT_BOTTOM (w) - WINDOW_TEXT_TOP (w)) +#define WINDOW_WIDTH(w) ((w)->pixel_width) +#define WINDOW_TEXT_WIDTH(w) (WINDOW_TEXT_RIGHT (w) - WINDOW_TEXT_LEFT (w)) + +#define WINDOW_HAS_MODELINE_P(w) (!NILP (w->has_modeline_p)) + +#define MODELINE_OFF_SHADOW_THICKNESS_ADJUSTED(win) \ + abs ((!WINDOW_HAS_MODELINE_P (win) \ + ? ((XINT (win->modeline_shadow_thickness) > 1) \ + ? XINT (win->modeline_shadow_thickness) - 1 \ + : ((XINT (win->modeline_shadow_thickness) < -1) \ + ? XINT (win->modeline_shadow_thickness) + 1 \ + : XINT (win->modeline_shadow_thickness))) \ + : XINT (win->modeline_shadow_thickness))) + +#define MODELINE_SHADOW_THICKNESS(win) \ + (MODELINE_OFF_SHADOW_THICKNESS_ADJUSTED (win) > 10 \ + ? 10 \ + : MODELINE_OFF_SHADOW_THICKNESS_ADJUSTED (win)) + +#endif /* INCLUDED_window_impl_h_ */
--- a/src/window.c Tue Jun 11 19:28:22 2002 +0000 +++ b/src/window.c Thu Jun 20 21:19:10 2002 +0000 @@ -41,15 +41,15 @@ #include "buffer.h" #include "commands.h" -#include "device.h" +#include "device-impl.h" #include "elhash.h" #include "faces.h" -#include "frame.h" +#include "frame-impl.h" #include "glyphs.h" #include "gutter.h" #include "objects.h" #include "redisplay.h" -#include "window.h" +#include "window-impl.h" Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configurationp; Lisp_Object Qdisplay_buffer; @@ -1353,6 +1353,24 @@ return XWINDOW (window); } +int +window_live_p (struct window *w) +{ + return WINDOW_LIVE_P (w); +} + +Lisp_Object +window_frame (struct window *w) +{ + return WINDOW_FRAME (w); +} + +Lisp_Object +window_buffer (struct window *w) +{ + return WINDOW_BUFFER (w); +} + DEFUN ("window-buffer", Fwindow_buffer, 0, 1, 0, /* Return the buffer that WINDOW is displaying. */
--- a/src/window.h Tue Jun 11 19:28:22 2002 +0000 +++ b/src/window.h Thu Jun 20 21:19:10 2002 +0000 @@ -2,7 +2,7 @@ Copyright (C) 1985, 1986, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. - Copyright (C) 1995, 1996 Ben Wing. + Copyright (C) 1995, 1996, 2002 Ben Wing. Copyright (C) 1996 Chuck Thompson. This file is part of XEmacs. @@ -32,138 +32,7 @@ #include "scrollbar.h" #endif -/* All windows in use are arranged into a tree, with pointers up and down. - -Windows that are leaves of the tree are actually displayed -and show the contents of buffers. Windows that are not leaves -are used for representing the way groups of leaf windows are -arranged on the frame. Leaf windows never become non-leaves. -They are deleted only by calling delete-window on them (but -this can be done implicitly). Combination windows can be created -and deleted at any time. - -A leaf window has a non-nil buffer field, and also - has markers in its start and pointm fields. Non-leaf windows - have nil in these fields. - -Non-leaf windows are either vertical or horizontal combinations. - -A vertical combination window has children that are arranged on the frame -one above the next. Its vchild field points to the uppermost child. -The parent field of each of the children points to the vertical -combination window. The next field of each child points to the -child below it, or is nil for the lowest child. The prev field -of each child points to the child above it, or is nil for the -highest child. - -A horizontal combination window has children that are side by side. -Its hchild field points to the leftmost child. In each child -the next field points to the child to the right and the prev field -points to the child to the left. - -The children of a vertical combination window may be leaf windows -or horizontal combination windows. The children of a horizontal -combination window may be leaf windows or vertical combination windows. - -At the top of the tree are two windows which have nil as parent. -The second of these is minibuf_window. The first one manages all -the frame area that is not minibuffer, and is called the root window. -Different windows can be the root at different times; -initially the root window is a leaf window, but if more windows -are created then that leaf window ceases to be root and a newly -made combination window becomes root instead. - -In any case, on screens which have an ordinary window and a -minibuffer, prev of the minibuf window is the root window and next of -the root window is the minibuf window. On minibufferless screens or -minibuffer-only screens, the root window and the minibuffer window are -one and the same, so its prev and next members are nil. - -A dead window has the `dead' flag set on it. Note that unlike other -dead objects, dead windows can be made live again through restoring a -window configuration. This means that the values in a dead window -need to be preserved, except for those that are reconstructed by from -the window configuration. */ - -struct window -{ - struct lcrecord_header header; - - /* The upper left corner coordinates of this window, - as integers (pixels) relative to upper left corner of frame = 0, 0 */ - int pixel_left; - int pixel_top; - /* The size of the window (in pixels) */ - int pixel_height; - int pixel_width; - - /* Number of columns display within the window is scrolled to the left. */ - int hscroll; - /* Idem for the window's modeline */ - Charcount modeline_hscroll; - /* Amount to clip off the top line for pixel-based scrolling. Point - will remain constant but this will be incremented to - incrementally shift lines up. */ - int top_yoffset; - /* Amount to clip off the left of the lines for pixel-based - scrolling. Hscroll will remain constant but this will be - incremented to incrementally shift lines left.*/ - int left_xoffset; - - /* face cache elements correct for this window and its current buffer */ - face_cachel_dynarr *face_cachels; - /* glyph cache elements correct for this window and its current buffer */ - glyph_cachel_dynarr *glyph_cachels; - /* List of starting positions for display lines. Only valid if - buffer has not changed. */ - line_start_cache_dynarr *line_start_cache; - int line_cache_validation_override; - - /* Length of longest line currently displayed. Used to control the - width of the horizontal scrollbars. */ - int max_line_len; - - /* Frame coords of point at that time */ - int last_point_x[3]; - int last_point_y[3]; - - /* Number of characters in buffer past bottom of window, - as of last redisplay that finished. */ - /* need one for each set of display structures */ - int window_end_pos[3]; - - /* Set by the extent code when extents in the gutter are changed. */ - int gutter_extent_modiff[4]; - - /* Set by redisplay to the last position seen. This is used - to implement the redisplay-end-trigger-functions. */ - Charbpos last_redisplay_pos; - -#define WINDOW_SLOT_DECLARATION -#define WINDOW_SLOT(slot) Lisp_Object slot; -#include "winslots.h" - - /* one-bit flags: */ - - /* marker used when restoring a window configuration */ - unsigned int config_mark :1; - /* Non-zero means window was dead. */ - unsigned int dead :1; - /* Non-zero means next redisplay must use the value of start - set up for it in advance. Set by scrolling commands. */ - unsigned int force_start :1; - /* Non-zero means must regenerate modeline of this window */ - unsigned int redo_modeline :1; - /* Non-zero means current value of `start' - was the beginning of a line when it was chosen. */ - unsigned int start_at_line_beg :1; - /* new redisplay flag */ - unsigned int windows_changed :1; - unsigned int shadow_thickness_changed :1; - /* Vertical divider flag and validity of it */ - unsigned int need_vertical_divider_p :1; - unsigned int need_vertical_divider_valid_p :1; -}; +struct window; DECLARE_LRECORD (window, struct window); #define XWINDOW(x) XRECORD (x, window, struct window) @@ -172,58 +41,33 @@ #define CHECK_WINDOW(x) CHECK_RECORD (x, window) #define CONCHECK_WINDOW(x) CONCHECK_RECORD (x, window) -#define CURRENT_DISP 0 -#define DESIRED_DISP 1 -#define CMOTION_DISP 2 - -struct window_mirror -{ - struct lcrecord_header header; - - /* Frame this mirror is on. */ - struct frame *frame; +/* Basic properties available to non-privileged users; redefined in + window-impl.h */ - /* Following child (to right or down) at same level of tree */ - struct window_mirror *next; - - /* There is no prev field because we never traverse this structure - backwards. Same goes for the parent field. */ +int window_live_p (struct window *w); +Lisp_Object window_frame (struct window *w); +Lisp_Object window_buffer (struct window *w); - /* First child of this window. */ - /* vchild is used if this is a vertical combination, - hchild if this is a horizontal combination. */ - struct window_mirror *hchild, *vchild; - - /* Dynamic array of display lines */ - display_line_dynarr *current_display_lines; - display_line_dynarr *desired_display_lines; +#define WINDOW_LIVE_P(w) window_live_p (w) +#define WINDOW_FRAME(w) window_frame (w) +#define WINDOW_BUFFER(w) window_buffer (w) - /* Buffer current_display_lines represent. */ - struct buffer *buffer; - -#ifdef HAVE_SCROLLBARS - /* Scrollbars associated with window, if any. */ - struct scrollbar_instance *scrollbar_vertical_instance; - struct scrollbar_instance *scrollbar_horizontal_instance; -#endif /* HAVE_SCROLLBARS */ - - /* Flag indicating whether a subwindow is currently being displayed. */ - unsigned int subwindows_being_displayed :1; +#define WINDOW_XFRAME(w) XFRAME (WINDOW_FRAME (w)) +#define WINDOW_DEVICE(w) XFRAME_DEVICE (WINDOW_FRAME (w)) +#define WINDOW_XDEVICE(w) XDEVICE (WINDOW_DEVICE (w)) +#define WINDOW_CONSOLE(w) XDEVICE_CONSOLE (WINDOW_DEVICE (w)) +#define WINDOW_XCONSOLE(w) XCONSOLE (WINDOW_CONSOLE (w)) +#define WINDOW_XBUFFER(w) XBUFFER (WINDOW_BUFFER (w)) - /* Keep track of the truncation status in this window so we can - detect when it has changed. #### Magic variables would be a huge - win here. */ - unsigned int truncate_win :1; -}; +#define XWINDOW_FRAME(w) WINDOW_FRAME (XWINDOW (w)) +#define XWINDOW_XFRAME(w) XFRAME (XWINDOW_FRAME (w)) +#define XWINDOW_DEVICE(w) XFRAME_DEVICE (XWINDOW_FRAME (w)) +#define XWINDOW_XDEVICE(w) XDEVICE (XWINDOW_DEVICE (w)) +#define XWINDOW_CONSOLE(w) XDEVICE_CONSOLE (XWINDOW_DEVICE (w)) +#define XWINDOW_XCONSOLE(w) XCONSOLE (XWINDOW_CONSOLE (w)) +#define XWINDOW_BUFFER(w) WINDOW_BUFFER (XWINDOW (w)) +#define XWINDOW_XBUFFER(w) XBUFFER (XWINDOW_BUFFER (w)) -DECLARE_LRECORD (window_mirror, struct window_mirror); -#define XWINDOW_MIRROR(x) XRECORD (x, window_mirror, struct window_mirror) -#define wrap_window_mirror(p) wrap_record (p, window_mirror) -#define WINDOW_MIRRORP(x) RECORDP (x, window_mirror) -#define CHECK_WINDOW_MIRROR(x) CHECK_RECORD (x, window_mirror) -#define CONCHECK_WINDOW_MIRROR(x) CONCHECK_RECORD (x, window_mirror) - -#define WINDOW_LIVE_P(x) (!(x)->dead) #define CHECK_LIVE_WINDOW(x) do { \ CHECK_WINDOW (x); \ if (!WINDOW_LIVE_P (XWINDOW (x))) \ @@ -235,37 +79,14 @@ x = wrong_type_argument (Qwindow_live_p, (x)); \ } while (0) -/* 1 if W is a minibuffer window. */ -#define MINI_WINDOW_P(W) (!NILP ((W)->mini_p)) - -/* 1 if we are dealing with a parentless window (this includes the - root window on a frame and the minibuffer window; both of these - are siblings). */ -#define TOP_LEVEL_WINDOW_P(w) NILP ((w)->parent) +struct window_mirror; -/* Set all redisplay flags indicating a window has changed */ -#define MARK_WINDOWS_CHANGED(w) do { \ - (w)->windows_changed = 1; \ - if (!NILP (w->frame)) \ - { \ - struct frame *mwc_frame = XFRAME (w->frame); \ - MARK_FRAME_WINDOWS_CHANGED (mwc_frame); \ - } \ - else \ - windows_changed = 1; \ -} while (0) - -/* #### This should be fixed not to call MARK_FRAME_CHANGED because - faces are cached per window. Also, other code which changes window's - face should use this macro. -*/ -#define MARK_WINDOW_FACES_CHANGED(w) \ - MARK_FRAME_FACES_CHANGED (XFRAME ((w)->frame)) - -#define WINDOW_TTY_P(w) FRAME_TTY_P (XFRAME ((w)->frame)) -#define WINDOW_X_P(w) FRAME_X_P (XFRAME ((w)->frame)) -#define WINDOW_NS_P(w) FRAME_NS_P (XFRAME ((w)->frame)) -#define WINDOW_WIN_P(w) FRAME_WIN_P (XFRAME ((w)->frame)) +DECLARE_LRECORD (window_mirror, struct window_mirror); +#define XWINDOW_MIRROR(x) XRECORD (x, window_mirror, struct window_mirror) +#define wrap_window_mirror(p) wrap_record (p, window_mirror) +#define WINDOW_MIRRORP(x) RECORDP (x, window_mirror) +#define CHECK_WINDOW_MIRROR(x) CHECK_RECORD (x, window_mirror) +#define CONCHECK_WINDOW_MIRROR(x) CONCHECK_RECORD (x, window_mirror) DECLARE_LRECORD (window_configuration, struct window_config); @@ -283,6 +104,10 @@ EXFUN (Fwindow_highest_p, 1); EXFUN (Fwindow_point, 1); EXFUN (Fwindow_start, 1); +EXFUN (Fcurrent_window_configuration, 1); + +Lisp_Object save_window_excursion_unwind (Lisp_Object); +Lisp_Object display_buffer (Lisp_Object, Lisp_Object, Lisp_Object); /* The minibuffer window of the selected frame. Note that you cannot test for minibufferness of an arbitrary window @@ -347,50 +172,4 @@ void *u_n_u_s_e_d); int window_divider_width (struct window *w); -#define WINDOW_FRAME(w) ((w)->frame) -#define WINDOW_XFRAME(w) XFRAME (WINDOW_FRAME (w)) -#define WINDOW_BUFFER(w) ((w)->buffer) -#define WINDOW_XBUFFER(w) XBUFFER (WINDOW_BUFFER (w)) -#define WINDOW_DEVICE(w) FRAME_DEVICE (XFRAME (WINDOW_FRAME (w))) -#define WINDOW_XDEVICE(w) XDEVICE (WINDOW_DEVICE (w)) -#define WINDOW_CONSOLE(w) DEVICE_CONSOLE (XDEVICE (WINDOW_DEVICE (w))) -#define WINDOW_XCONSOLE(w) XCONSOLE (WINDOW_CONSOLE (w)) - -/* XEmacs window size and positioning macros. */ -#define WINDOW_TOP(w) ((w)->pixel_top) -#define WINDOW_TEXT_TOP(w) (WINDOW_TOP (w) + window_top_gutter_height (w)) -#define WINDOW_TEXT_TOP_CLIP(w) ((w)->top_yoffset) -#define WINDOW_BOTTOM(w) ((w)->pixel_top + (w)->pixel_height) -#define WINDOW_TEXT_BOTTOM(w) (WINDOW_BOTTOM (w) - window_bottom_gutter_height (w)) -#define WINDOW_LEFT(w) ((w)->pixel_left) -#define WINDOW_TEXT_LEFT(w) (WINDOW_LEFT (w) + window_left_gutter_width (w, 0)) -#define WINDOW_MODELINE_LEFT(w) \ - (WINDOW_LEFT (w) + window_left_gutter_width (w, 1)) -#define WINDOW_RIGHT(w) ((w)->pixel_left + (w)->pixel_width) -#define WINDOW_TEXT_RIGHT(w) \ - (WINDOW_RIGHT (w) - window_right_gutter_width (w, 0)) -#define WINDOW_MODELINE_RIGHT(w) \ - (WINDOW_RIGHT (w) - window_right_gutter_width (w, 1)) - -#define WINDOW_HEIGHT(w) ((w)->pixel_height) -#define WINDOW_TEXT_HEIGHT(w) (WINDOW_TEXT_BOTTOM (w) - WINDOW_TEXT_TOP (w)) -#define WINDOW_WIDTH(w) ((w)->pixel_width) -#define WINDOW_TEXT_WIDTH(w) (WINDOW_TEXT_RIGHT (w) - WINDOW_TEXT_LEFT (w)) - -#define WINDOW_HAS_MODELINE_P(w) (!NILP (w->has_modeline_p)) - -#define MODELINE_OFF_SHADOW_THICKNESS_ADJUSTED(win) \ - abs ((!WINDOW_HAS_MODELINE_P (win) \ - ? ((XINT (win->modeline_shadow_thickness) > 1) \ - ? XINT (win->modeline_shadow_thickness) - 1 \ - : ((XINT (win->modeline_shadow_thickness) < -1) \ - ? XINT (win->modeline_shadow_thickness) + 1 \ - : XINT (win->modeline_shadow_thickness))) \ - : XINT (win->modeline_shadow_thickness))) - -#define MODELINE_SHADOW_THICKNESS(win) \ - (MODELINE_OFF_SHADOW_THICKNESS_ADJUSTED (win) > 10 \ - ? 10 \ - : MODELINE_OFF_SHADOW_THICKNESS_ADJUSTED (win)) - #endif /* INCLUDED_window_h_ */