Mercurial > hg > xemacs-beta
annotate src/console-impl.h @ 5353:38e24b8be4ea
Improve the lexical scoping in #'block, #'return-from.
lisp/ChangeLog addition:
2011-02-07 Aidan Kehoe <kehoea@parhasard.net>
* bytecomp.el:
* bytecomp.el (byte-compile-initial-macro-environment):
Shadow `block', `return-from' here, we implement them differently
when byte-compiling.
* bytecomp.el (byte-compile-active-blocks): New.
* bytecomp.el (byte-compile-block-1): New.
* bytecomp.el (byte-compile-return-from-1): New.
* bytecomp.el (return-from-1): New.
* bytecomp.el (block-1): New.
These are two aliases that exist to have their own associated
byte-compile functions, which functions implement `block' and
`return-from'.
* cl-extra.el (cl-macroexpand-all):
Fix a bug here when macros in the environment have been compiled.
* cl-macs.el (block):
* cl-macs.el (return):
* cl-macs.el (return-from):
Be more careful about lexical scope in these macros.
* cl.el:
* cl.el ('cl-block-wrapper): Removed.
* cl.el ('cl-block-throw): Removed.
These aren't needed in code generated by this XEmacs. They
shouldn't be needed in code generated by XEmacs 21.4, but if it
turns out the packages do need them, we can put them back.
2011-01-30 Mike Sperber <mike@xemacs.org>
* font-lock.el (font-lock-fontify-pending-extents): Don't fail if
`font-lock-mode' is unset, which can happen in the middle of
`revert-buffer'.
2011-01-23 Aidan Kehoe <kehoea@parhasard.net>
* cl-macs.el (delete):
* cl-macs.el (delq):
* cl-macs.el (remove):
* cl-macs.el (remq):
Don't use the compiler macro if these functions were given the
wrong number of arguments, as happens in lisp-tests.el.
* cl-seq.el (remove, remq): Removed.
I added these to subr.el, and forgot to remove them from here.
2011-01-22 Aidan Kehoe <kehoea@parhasard.net>
* bytecomp.el (byte-compile-setq, byte-compile-set):
Remove kludge allowing keywords' values to be set, all the code
that does that is gone.
* cl-compat.el (elt-satisfies-test-p):
* faces.el (set-face-parent):
* faces.el (face-doc-string):
* gtk-font-menu.el:
* gtk-font-menu.el (gtk-reset-device-font-menus):
* msw-font-menu.el:
* msw-font-menu.el (mswindows-reset-device-font-menus):
* package-get.el (package-get-installedp):
* select.el (select-convert-from-image-data):
* sound.el:
* sound.el (load-sound-file):
* x-font-menu.el (x-reset-device-font-menus-core):
Don't quote keywords, they're self-quoting, and the
win from backward-compatibility is sufficiently small now that the
style problem overrides it.
2011-01-22 Aidan Kehoe <kehoea@parhasard.net>
* cl-macs.el (block, return-from): Require that NAME be a symbol
in these macros, as always documented in the #'block docstring and
as required by Common Lisp.
* descr-text.el (unidata-initialize-unihan-database):
Correct the use of non-symbols in #'block and #'return-from in
this function.
2011-01-15 Aidan Kehoe <kehoea@parhasard.net>
* cl-extra.el (concatenate): Accept more complicated TYPEs in this
function, handing the sequences over to #'coerce if we don't
understand them here.
* cl-macs.el (inline): Don't proclaim #'concatenate as inline, its
compiler macro is more useful than doing that.
2011-01-11 Aidan Kehoe <kehoea@parhasard.net>
* subr.el (delete, delq, remove, remq): Move #'remove, #'remq
here, they don't belong in cl-seq.el; move #'delete, #'delq here
from fns.c, implement them in terms of #'delete*, allowing support
for sequences generally.
* update-elc.el (do-autoload-commands): Use #'delete*, not #'delq
here, now the latter's no longer dumped.
* cl-macs.el (delete, delq): Add compiler macros transforming
#'delete and #'delq to #'delete* calls.
2011-01-10 Aidan Kehoe <kehoea@parhasard.net>
* dialog.el (make-dialog-box): Correct a misplaced parenthesis
here, thank you Mats Lidell in 87zkr9gqrh.fsf@mail.contactor.se !
2011-01-02 Aidan Kehoe <kehoea@parhasard.net>
* dialog.el (make-dialog-box):
* list-mode.el (display-completion-list):
These functions used to use cl-parsing-keywords; change them to
use defun* instead, fixing the build. (Not sure what led to me
not including this change in d1b17a33450b!)
2011-01-02 Aidan Kehoe <kehoea@parhasard.net>
* cl-macs.el (define-star-compiler-macros):
Make sure the form has ITEM and LIST specified before attempting
to change to calls with explicit tests; necessary for some tests
in lisp-tests.el to compile correctly.
(stable-union, stable-intersection): Add compiler macros for these
functions, in the same way we do for most of the other functions
in cl-seq.el.
2011-01-01 Aidan Kehoe <kehoea@parhasard.net>
* cl-macs.el (dolist, dotimes, do-symbols, macrolet)
(symbol-macrolet):
Define these macros with defmacro* instead of parsing the argument
list by hand, for the sake of style and readability; use backquote
where appropriate, instead of calling #'list and and friends, for
the same reason.
2010-12-30 Aidan Kehoe <kehoea@parhasard.net>
* x-misc.el (device-x-display):
Provide this function, documented in the Lispref for years, but
not existing previously. Thank you Julian Bradfield, thank you
Jeff Mincy.
2010-12-30 Aidan Kehoe <kehoea@parhasard.net>
* cl-seq.el:
Move the heavy lifting from this file to C. Dump the
cl-parsing-keywords macro, but don't use defun* for the functions
we define that do take keywords, dynamic scope lossage makes that
not practical.
* subr.el (sort, fillarray): Move these aliases here.
(map-plist): #'nsublis is now built-in, but at this point #'eql
isn't necessarily available as a test; use #'eq.
* obsolete.el (cl-delete-duplicates): Make this available for old
compiler macros and old code.
(memql): Document that this is equivalent to #'member*, and worse.
* cl.el (adjoin, subst): Removed. These are in C.
2010-12-30 Aidan Kehoe <kehoea@parhasard.net>
* simple.el (assoc-ignore-case): Remove a duplicate definition of
this function (it's already in subr.el).
* iso8859-1.el (char-width):
On non-Mule, make this function equivalent to that produced by
(constantly 1), but preserve its docstring.
* subr.el (subst-char-in-string): Define this in terms of
#'substitute, #'nsubstitute.
(string-width): Define this using #'reduce and #'char-width.
(char-width): Give this a simpler definition, it makes far more
sense to check for mule at load time and redefine, as we do in
iso8859-1.el.
(store-substring): Implement this in terms of #'replace, now
#'replace is cheap.
2010-12-30 Aidan Kehoe <kehoea@parhasard.net>
* update-elc.el (lisp-files-needed-for-byte-compilation)
(lisp-files-needing-early-byte-compilation):
cl-macs belongs in the former, not the latter, it is as
fundamental as bytecomp.el.
2010-12-30 Aidan Kehoe <kehoea@parhasard.net>
* cl.el:
Provde the Common Lisp program-error, type-error as error
symbols. This doesn't nearly go far enough for anyone using the
Common Lisp errors.
2010-12-29 Aidan Kehoe <kehoea@parhasard.net>
* cl-macs.el (delete-duplicates):
If the form has an incorrect number of arguments, don't attempt a
compiler macroexpansion.
2010-12-29 Aidan Kehoe <kehoea@parhasard.net>
* cl-macs.el (cl-safe-expr-p):
Forms that start with the symbol lambda are also safe.
2010-12-29 Aidan Kehoe <kehoea@parhasard.net>
* cl-macs.el (= < > <= >=):
For these functions' compiler macros, the optimisation is safe
even if the first and the last arguments have side effects, since
they're only used the once.
2010-12-29 Aidan Kehoe <kehoea@parhasard.net>
* cl-macs.el (inline-side-effect-free-compiler-macros):
Unroll a loop here at macro-expansion time, so these compiler
macros are compiled. Use #'eql instead of #'eq in a couple of
places for better style.
2010-12-29 Aidan Kehoe <kehoea@parhasard.net>
* cl-extra.el (notany, notevery): Avoid some dynamic scope
stupidity with local variable names in these functions, when they
weren't prefixed with cl-; go into some more detail in the doc
strings.
2010-12-29 Aidan Kehoe <kehoea@parhasard.net>
* byte-optimize.el (side-effect-free-fns): #'remove, #'remq are
free of side-effects.
(side-effect-and-error-free-fns):
Drop dot, dot-marker from the list.
2010-11-17 Aidan Kehoe <kehoea@parhasard.net>
* cl-extra.el (coerce):
In the argument list, name the first argument OBJECT, not X; the
former name was always used in the doc string and is clearer.
Handle vector type specifications which include the length of the
target sequence, error if there's a mismatch.
* cl-macs.el (cl-make-type-test): Handle type specifications
starting with the symbol 'eql.
2010-11-14 Aidan Kehoe <kehoea@parhasard.net>
* cl-macs.el (eql): Don't remove the byte-compile property of this
symbol. That was necessary to override a bug in bytecomp.el where
#'eql was confused with #'eq, which bug we no longer have.
If neither expression is constant, don't attempt to handle the
expression in this compiler macro, leave it to byte-compile-eql,
which produces better code anyway.
* bytecomp.el (eq): #'eql is not the function associated with the
byte-eq byte code.
(byte-compile-eql): Add an explicit compile method for this
function, for cases where the cl-macs compiler macro hasn't
reduced it to #'eq or #'equal.
2010-10-25 Aidan Kehoe <kehoea@parhasard.net>
Add compiler macros and compilation sanity-checking for various
functions that take keywords.
* byte-optimize.el (side-effect-free-fns): #'symbol-value is
side-effect free and not error free.
* bytecomp.el (byte-compile-normal-call): Check keyword argument
lists for sanity; store information about the positions where
keyword arguments start using the new byte-compile-keyword-start
property.
* cl-macs.el (cl-const-expr-val): Take a new optional argument,
cl-not-constant, defaulting to nil, in this function; return it if
the expression is not constant.
(cl-non-fixnum-number-p): Make this into a separate function, we
want to pass it to #'every.
(eql): Use it.
(define-star-compiler-macros): Use the same code to generate the
member*, assoc* and rassoc* compiler macros; special-case some
code in #'add-to-list in subr.el.
(remove, remq): Add compiler macros for these two functions, in
preparation for #'remove being in C.
(define-foo-if-compiler-macros): Transform (remove-if-not ...) calls to
(remove ... :if-not) at compile time, which will be a real win
once the latter is in C.
(define-substitute-if-compiler-macros)
(define-subst-if-compiler-macros): Similarly for these functions.
(delete-duplicates): Change this compiler macro to use
#'plists-equal; if we don't have information about the type of
SEQUENCE at compile time, don't bother attempting to inline the
call, the function will be in C soon enough.
(equalp): Remove an old commented-out compiler macro for this, if
we want to see it it's in version control.
(subst-char-in-string): Transform this to a call to nsubstitute or
nsubstitute, if that is appropriate.
* cl.el (ldiff): Don't call setf here, this makes for a load-time
dependency problem in cl-macs.el
2010-06-14 Stephen J. Turnbull <stephen@xemacs.org>
* term/vt100.el:
Refer to XEmacs, not GNU Emacs, in permissions.
* term/bg-mouse.el:
* term/sup-mouse.el:
Put copyright notice in canonical "Copyright DATE AUTHOR" form.
Refer to XEmacs, not GNU Emacs, in permissions.
* site-load.el:
Add permission boilerplate.
* mule/canna-leim.el:
* alist.el:
Refer to XEmacs, not APEL/this program, in permissions.
* mule/canna-leim.el:
Remove my copyright, I've assigned it to the FSF.
2010-06-14 Stephen J. Turnbull <stephen@xemacs.org>
* gtk.el:
* gtk-widget-accessors.el:
* gtk-package.el:
* gtk-marshal.el:
* gtk-compose.el:
* gnome.el:
Add copyright notice based on internal evidence.
2010-06-14 Stephen J. Turnbull <stephen@xemacs.org>
* easymenu.el: Add reference to COPYING to permission notice.
* gutter.el:
* gutter-items.el:
* menubar-items.el:
Fix typo "Xmacs" in permissions notice.
2010-06-14 Stephen J. Turnbull <stephen@xemacs.org>
* auto-save.el:
* font.el:
* fontconfig.el:
* mule/kinsoku.el:
Add "part of XEmacs" text to permission notice.
2010-10-14 Aidan Kehoe <kehoea@parhasard.net>
* byte-optimize.el (side-effect-free-fns):
* cl-macs.el (remf, getf):
* cl-extra.el (tailp, cl-set-getf, cl-do-remf):
* cl.el (ldiff, endp):
Tighten up Common Lisp compatibility for #'ldiff, #'endp, #'tailp;
add circularity checking for the first two.
#'cl-set-getf and #'cl-do-remf were Lisp implementations of
#'plist-put and #'plist-remprop; change the names to aliases,
changes the macros that use them to using #'plist-put and
#'plist-remprop directly.
2010-10-12 Aidan Kehoe <kehoea@parhasard.net>
* abbrev.el (fundamental-mode-abbrev-table, global-abbrev-table):
Create both these abbrev tables using the usual
#'define-abbrev-table calls, rather than attempting to
special-case them.
* cl-extra.el: Force cl-macs to be loaded here, if cl-extra.el is
being loaded interpreted. Previously other, later files would
redundantly call (load "cl-macs") when interpreted, it's more
reasonable to do it here, once.
* cmdloop.el (read-quoted-char-radix): Use defcustom here, we
don't have any dump-order dependencies that would prevent that.
* custom.el (eval-when-compile): Don't load cl-macs when
interpreted or when byte-compiling, rely on cl-extra.el in the
former case and the appropriate entry in bytecomp-load-hook in the
latter. Get rid of custom-declare-variable-list, we have no
dump-time dependencies that would require it.
* faces.el (eval-when-compile): Don't load cl-macs when
interpreted or when byte-compiling.
* packages.el: Remove some inaccurate comments.
* post-gc.el (cleanup-simple-finalizers): Use #'delete-if-not
here, now the order of preloaded-file-list has been changed to
make it available.
* subr.el (custom-declare-variable-list): Remove. No need for it.
Also remove a stub define-abbrev-table from this file, given the
current order of preloaded-file-list there's no need for it.
2010-10-10 Aidan Kehoe <kehoea@parhasard.net>
* bytecomp.el (byte-compile-constp) Forms quoted with FUNCTION are
also constant.
(byte-compile-initial-macro-environment): In #'the, if FORM is
constant and does not match TYPE, warn at byte-compile time.
2010-10-10 Aidan Kehoe <kehoea@parhasard.net>
* backquote.el (bq-vector-contents, bq-list*): Remove; the former
is equivalent to (append VECTOR nil), the latter to (list* ...).
(bq-process-2): Use (append VECTOR nil) instead of using
#'bq-vector-contents to convert to a list.
(bq-process-1): Now we use list* instead of bq-list
* subr.el (list*): Moved from cl.el, since it is now required to
be available the first time a backquoted form is encountered.
* cl.el (list*): Move to subr.el.
2010-09-16 Aidan Kehoe <kehoea@parhasard.net>
* test-harness.el (Check-Message):
Add an omitted comma here, thank you the buildbot.
2010-09-16 Aidan Kehoe <kehoea@parhasard.net>
* hash-table.el (hash-table-key-list, hash-table-value-list)
(hash-table-key-value-alist, hash-table-key-value-plist):
Remove some useless #'nreverse calls in these files; our hash
tables have no order, it's not helpful to pretend they do.
* behavior.el (read-behavior):
Do the same in this file, in some code evidently copied from
hash-table.el.
2010-09-16 Aidan Kehoe <kehoea@parhasard.net>
* info.el (Info-insert-dir):
* format.el (format-deannotate-region):
* files.el (cd, save-buffers-kill-emacs):
Use #'some, #'every and related functions for applying boolean
operations to lists, instead of rolling our own ones that cons and
don't short-circuit.
2010-09-16 Aidan Kehoe <kehoea@parhasard.net>
* bytecomp.el (byte-compile-initial-macro-environment):
* cl-macs.el (the):
Rephrase the docstring, make its implementation when compiling
files a little nicer.
2010-09-16 Aidan Kehoe <kehoea@parhasard.net>
* descr-text.el (unidata-initialize-unicodedata-database)
(unidata-initialize-unihan-database, describe-char-unicode-data)
(describe-char-unicode-data):
Wrap calls to the database functions with (with-fboundp ...),
avoiding byte compile warnings on builds without support for the
database functions.
(describe-char): (reduce #'max ...), not (apply #'max ...), no
need to cons needlessly.
(describe-char): Remove a redundant lambda wrapping
#'extent-properties.
(describe-char-unicode-data): Call #'nsubst when replacing "" with
nil in the result of #'split-string, instead of consing inside
mapcar.
2010-09-16 Aidan Kehoe <kehoea@parhasard.net>
* x-faces.el (x-available-font-sizes):
* specifier.el (let-specifier):
* package-ui.el (pui-add-required-packages):
* msw-faces.el (mswindows-available-font-sizes):
* modeline.el (modeline-minor-mode-menu):
* minibuf.el (minibuf-directory-files):
Replace the O2N (delq nil (mapcar (lambda (W) (and X Y)) Z)) with
the ON (mapcan (lambda (W) (and X (list Y))) Z) in these files.
2010-09-16 Aidan Kehoe <kehoea@parhasard.net>
* cl-macs.el (= < > <= >=):
When these functions are handed more than two arguments, and those
arguments have no side effects, transform to a series of two
argument calls, avoiding funcall in the byte-compiled code.
* mule/mule-cmds.el (finish-set-language-environment):
Take advantage of this change in a function called 256 times at
startup.
2010-09-16 Aidan Kehoe <kehoea@parhasard.net>
* bytecomp.el (byte-compile-function-form, byte-compile-quote)
(byte-compile-quote-form):
Warn at compile time, and error at runtime, if a (quote ...) or a
(function ...) form attempts to quote more than one object.
2010-09-16 Aidan Kehoe <kehoea@parhasard.net>
* byte-optimize.el (byte-optimize-apply): Transform (apply 'nconc
(mapcar ...)) to (mapcan ...); warn about use of the first idiom.
* update-elc.el (do-autoload-commands):
* packages.el (packages-find-package-library-path):
* frame.el (frame-list):
* extents.el (extent-descendants):
* etags.el (buffer-tag-table-files):
* dumped-lisp.el (preloaded-file-list):
* device.el (device-list):
* bytecomp-runtime.el (proclaim-inline, proclaim-notinline)
Use #'mapcan, not (apply #'nconc (mapcar ...) in all these files.
* bytecomp-runtime.el (eval-when-compile, eval-and-compile):
In passing, mention that these macros also evaluate the body when
interpreted.
tests/ChangeLog addition:
2011-02-07 Aidan Kehoe <kehoea@parhasard.net>
* automated/lisp-tests.el:
Test lexical scope for `block', `return-from'; add a
Known-Bug-Expect-Failure for a contorted example that fails when
byte-compiled.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Mon, 07 Feb 2011 12:01:24 +0000 |
parents | 71ee43b8a74d |
children | 308d34e9f07d |
rev | line source |
---|---|
872 | 1 /* Define console object for XEmacs. |
5170
5ddbab03b0e6
various fixes to memory-usage stats
Ben Wing <ben@xemacs.org>
parents:
5157
diff
changeset
|
2 Copyright (C) 1996, 2002, 2003, 2005, 2010 Ben Wing |
872 | 3 |
4 This file is part of XEmacs. | |
5 | |
6 XEmacs is free software; you can redistribute it and/or modify it | |
7 under the terms of the GNU General Public License as published by the | |
8 Free Software Foundation; either version 2, or (at your option) any | |
9 later version. | |
10 | |
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 for more details. | |
15 | |
16 You should have received a copy of the GNU General Public License | |
17 along with XEmacs; see the file COPYING. If not, write to | |
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
19 Boston, MA 02111-1307, USA. */ | |
20 | |
21 /* Synched up with: Not in FSF. */ | |
22 | |
23 /* Written by Ben Wing. */ | |
24 | |
25 #ifndef INCLUDED_console_impl_h_ | |
26 #define INCLUDED_console_impl_h_ | |
27 | |
28 #include "console.h" | |
3659 | 29 #include "specifier.h" |
872 | 30 |
1204 | 31 extern const struct sized_memory_description cted_description; |
32 extern const struct sized_memory_description console_methods_description; | |
872 | 33 |
34 | |
35 /* | |
36 * Constants returned by device_implementation_flags_method | |
37 */ | |
38 | |
39 /* Set when device uses pixel-based geometry */ | |
40 #define XDEVIMPF_PIXEL_GEOMETRY 0x00000001L | |
41 | |
42 /* Indicates that the device is a printer */ | |
43 #define XDEVIMPF_IS_A_PRINTER 0x00000002L | |
44 | |
45 /* Do not automatically redisplay this device */ | |
46 #define XDEVIMPF_NO_AUTO_REDISPLAY 0x00000004L | |
47 | |
48 /* Do not delete the device when last frame's gone */ | |
49 #define XDEVIMPF_FRAMELESS_OK 0x00000008L | |
50 | |
51 /* Do not preempt resiaply of frame or device once it starts */ | |
52 #define XDEVIMPF_DONT_PREEMPT_REDISPLAY 0x00000010L | |
53 | |
54 struct console_methods | |
55 { | |
56 const char *name; /* Used by print_console, print_device, print_frame */ | |
57 Lisp_Object symbol; | |
58 Lisp_Object predicate_symbol; | |
59 unsigned int flags; /* Read-only implementation flags, set once upon | |
60 console type creation. INITIALIZE_CONSOLE_TYPE sets | |
61 this member to 0. */ | |
62 | |
63 /* console methods */ | |
64 void (*init_console_method) (struct console *, Lisp_Object props); | |
65 void (*mark_console_method) (struct console *); | |
66 int (*initially_selected_for_input_method) (struct console *); | |
67 void (*delete_console_method) (struct console *); | |
68 Lisp_Object (*semi_canonicalize_console_connection_method) | |
69 (Lisp_Object connection, Error_Behavior errb); | |
70 Lisp_Object (*semi_canonicalize_device_connection_method) | |
71 (Lisp_Object connection, Error_Behavior errb); | |
72 Lisp_Object (*canonicalize_console_connection_method) | |
73 (Lisp_Object connection, Error_Behavior errb); | |
74 Lisp_Object (*canonicalize_device_connection_method) | |
75 (Lisp_Object connection, Error_Behavior errb); | |
76 Lisp_Object (*device_to_console_connection_method) | |
77 (Lisp_Object connection, Error_Behavior errb); | |
2828 | 78 Lisp_Object (*perhaps_init_unseen_key_defaults_method) |
79 (struct console *, Lisp_Object keysym); | |
872 | 80 |
81 /* device methods */ | |
82 void (*init_device_method) (struct device *, Lisp_Object props); | |
83 void (*finish_init_device_method) (struct device *, Lisp_Object props); | |
84 void (*delete_device_method) (struct device *); | |
85 void (*mark_device_method) (struct device *); | |
86 void (*asynch_device_change_method) (void); | |
87 Lisp_Object (*device_system_metrics_method) (struct device *, | |
88 enum device_metrics); | |
89 Lisp_Object (*own_selection_method)(Lisp_Object selection_name, | |
90 Lisp_Object selection_value, | |
91 Lisp_Object how_to_add, | |
92 Lisp_Object selection_type, | |
93 int owned_p); | |
94 void (*disown_selection_method)(Lisp_Object selection_name, | |
95 Lisp_Object timeval); | |
96 Lisp_Object (*get_foreign_selection_method) (Lisp_Object selection_symbol, | |
97 Lisp_Object target_type); | |
98 Lisp_Object (*selection_exists_p_method)(Lisp_Object selection_name, | |
99 Lisp_Object selection_type); | |
100 Lisp_Object (*available_selection_types_method)(Lisp_Object selection_name); | |
101 Lisp_Object (*register_selection_data_type_method)(Lisp_Object type_name); | |
102 Lisp_Object (*selection_data_type_name_method)(Lisp_Object type); | |
103 | |
104 /* frame methods */ | |
105 Lisp_Object *device_specific_frame_props; | |
106 void (*init_frame_1_method) (struct frame *, Lisp_Object properties, | |
107 int frame_name_is_defaulted); | |
108 void (*init_frame_2_method) (struct frame *, Lisp_Object properties); | |
109 void (*init_frame_3_method) (struct frame *); | |
110 void (*after_init_frame_method) (struct frame *, int first_on_device, | |
111 int first_on_console); | |
112 void (*mark_frame_method) (struct frame *); | |
113 void (*delete_frame_method) (struct frame *); | |
114 void (*focus_on_frame_method) (struct frame *); | |
115 void (*raise_frame_method) (struct frame *); | |
116 void (*lower_frame_method) (struct frame *); | |
117 void (*enable_frame_method) (struct frame *); | |
118 void (*disable_frame_method) (struct frame *); | |
119 int (*get_mouse_position_method) (struct device *d, Lisp_Object *frame, | |
120 int *x, int *y); | |
121 void (*set_mouse_position_method) (struct window *w, int x, int y); | |
122 void (*make_frame_visible_method) (struct frame *f); | |
123 void (*make_frame_invisible_method) (struct frame *f); | |
124 void (*iconify_frame_method) (struct frame *f); | |
125 Lisp_Object (*frame_property_method) (struct frame *f, Lisp_Object prop); | |
126 int (*internal_frame_property_p_method) (struct frame *f, | |
127 Lisp_Object prop); | |
128 Lisp_Object (*frame_properties_method) (struct frame *f); | |
129 void (*set_frame_properties_method) (struct frame *f, Lisp_Object plist); | |
130 void (*set_frame_size_method) (struct frame *f, int width, int height); | |
131 void (*set_frame_position_method) (struct frame *f, int xoff, int yoff); | |
132 int (*frame_visible_p_method) (struct frame *f); | |
133 int (*frame_totally_visible_p_method) (struct frame *f); | |
134 int (*frame_iconified_p_method) (struct frame *f); | |
135 void (*set_title_from_ibyte_method) (struct frame *f, Ibyte *title); | |
136 void (*set_icon_name_from_ibyte_method) (struct frame *f, Ibyte *title); | |
137 void (*set_frame_pointer_method) (struct frame *f); | |
138 void (*set_frame_icon_method) (struct frame *f); | |
139 void (*popup_menu_method) (Lisp_Object menu, Lisp_Object event); | |
140 Lisp_Object (*get_frame_parent_method) (struct frame *f); | |
141 void (*update_frame_external_traits_method) (struct frame *f, Lisp_Object name); | |
142 int (*frame_size_fixed_p_method) (struct frame *f); | |
143 void (*eject_page_method) (struct frame *f); | |
144 | |
145 /* redisplay methods */ | |
146 int (*left_margin_width_method) (struct window *); | |
147 int (*right_margin_width_method) (struct window *); | |
4928
ea701c23ed84
change text_width method to take a window, in preparation for unicode-internal changes
Ben Wing <ben@xemacs.org>
parents:
3659
diff
changeset
|
148 int (*text_width_method) (struct window *w, struct face_cachel *cachel, |
872 | 149 const Ichar *str, Charcount len); |
150 void (*output_display_block_method) (struct window *, struct display_line *, | |
151 int, int, int, int, int, int, int); | |
152 int (*divider_height_method) (void); | |
153 int (*eol_cursor_width_method) (void); | |
154 void (*output_vertical_divider_method) (struct window *, int); | |
155 void (*clear_to_window_end_method) (struct window *, int, int); | |
5080
5502045ec510
The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents:
4928
diff
changeset
|
156 void (*clear_region_method) (Lisp_Object, struct device*, struct frame*, |
5502045ec510
The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents:
4928
diff
changeset
|
157 face_index, int, int, int, int, |
5502045ec510
The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents:
4928
diff
changeset
|
158 Lisp_Object, Lisp_Object, |
5502045ec510
The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents:
4928
diff
changeset
|
159 Lisp_Object, Lisp_Object); |
872 | 160 void (*clear_frame_method) (struct frame *); |
161 void (*window_output_begin_method) (struct window *); | |
162 void (*frame_output_begin_method) (struct frame *); | |
163 void (*window_output_end_method) (struct window *); | |
164 void (*frame_output_end_method) (struct frame *); | |
165 int (*flash_method) (struct device *); | |
166 void (*ring_bell_method) (struct device *, int volume, int pitch, | |
167 int duration); | |
168 void (*frame_redraw_cursor_method) (struct frame *f); | |
169 void (*set_final_cursor_coords_method) (struct frame *, int, int); | |
170 void (*bevel_area_method) (struct window *, face_index, int, int, int, int, int, | |
171 int, enum edge_style); | |
172 void (*output_pixmap_method) (struct window *w, Lisp_Object image_instance, | |
173 struct display_box *db, struct display_glyph_area *dga, | |
174 face_index findex, int cursor_start, int cursor_width, | |
175 int cursor_height, int offset_bitmap); | |
176 void (*output_string_method) (struct window *w, struct display_line *dl, | |
177 Ichar_dynarr *buf, int xpos, int xoffset, | |
178 int start_pixpos, int width, face_index findex, | |
179 int cursor, int cursor_start, int cursor_width, | |
180 int cursor_height); | |
181 | |
182 /* color methods */ | |
183 int (*initialize_color_instance_method) (Lisp_Color_Instance *, | |
184 Lisp_Object name, | |
185 Lisp_Object device, | |
186 Error_Behavior errb); | |
187 void (*mark_color_instance_method) (Lisp_Color_Instance *); | |
188 void (*print_color_instance_method) (Lisp_Color_Instance *, | |
189 Lisp_Object printcharfun, | |
190 int escapeflag); | |
191 void (*finalize_color_instance_method) (Lisp_Color_Instance *); | |
192 int (*color_instance_equal_method) (Lisp_Color_Instance *, | |
193 Lisp_Color_Instance *, | |
194 int depth); | |
195 Hashcode (*color_instance_hash_method) (Lisp_Color_Instance *, | |
5191
71ee43b8a74d
Add #'equalp as a hash test by default; add #'define-hash-table-test, GNU API
Aidan Kehoe <kehoea@parhasard.net>
parents:
5170
diff
changeset
|
196 int depth); |
872 | 197 Lisp_Object (*color_instance_rgb_components_method) (Lisp_Color_Instance *); |
198 int (*valid_color_name_p_method) (struct device *, Lisp_Object color); | |
2527 | 199 Lisp_Object (*color_list_method) (void); |
872 | 200 |
201 /* font methods */ | |
202 int (*initialize_font_instance_method) (Lisp_Font_Instance *, | |
203 Lisp_Object name, | |
204 Lisp_Object device, | |
205 Error_Behavior errb); | |
206 void (*mark_font_instance_method) (Lisp_Font_Instance *); | |
207 void (*print_font_instance_method) (Lisp_Font_Instance *, | |
208 Lisp_Object printcharfun, | |
209 int escapeflag); | |
210 void (*finalize_font_instance_method) (Lisp_Font_Instance *); | |
211 Lisp_Object (*font_instance_truename_method) (Lisp_Font_Instance *, | |
212 Error_Behavior errb); | |
213 Lisp_Object (*font_instance_properties_method) (Lisp_Font_Instance *); | |
2527 | 214 Lisp_Object (*font_list_method) (Lisp_Object pattern, |
1701 | 215 Lisp_Object device, |
216 Lisp_Object maxnumber); | |
3659 | 217 Lisp_Object (*find_charset_font_method) |
218 (Lisp_Object device, Lisp_Object font, Lisp_Object charset, | |
219 enum font_specifier_matchspec_stages stage); | |
220 int (*font_spec_matches_charset_method) | |
221 (struct device *d, Lisp_Object charset, const Ibyte *nonreloc, | |
222 Lisp_Object reloc, Bytecount offset, Bytecount length, | |
223 enum font_specifier_matchspec_stages stage); | |
872 | 224 |
225 /* image methods */ | |
226 void (*mark_image_instance_method) (Lisp_Image_Instance *); | |
227 void (*print_image_instance_method) (Lisp_Image_Instance *, | |
228 Lisp_Object printcharfun, | |
229 int escapeflag); | |
230 void (*finalize_image_instance_method) (Lisp_Image_Instance *); | |
231 void (*unmap_subwindow_method) (Lisp_Image_Instance *); | |
232 void (*map_subwindow_method) (Lisp_Image_Instance *, int x, int y, | |
233 struct display_glyph_area* dga); | |
234 void (*resize_subwindow_method) (Lisp_Image_Instance *, int w, int h); | |
235 void (*redisplay_subwindow_method) (Lisp_Image_Instance *); | |
236 void (*redisplay_widget_method) (Lisp_Image_Instance *); | |
237 /* Maybe this should be a specifier. Unfortunately specifiers don't | |
238 allow us to represent things at the toolkit level, which is what | |
239 is required here. */ | |
240 int (*widget_border_width_method) (void); | |
241 int (*widget_spacing_method) (Lisp_Image_Instance *); | |
242 int (*image_instance_equal_method) (Lisp_Image_Instance *, | |
243 Lisp_Image_Instance *, | |
244 int depth); | |
245 Hashcode (*image_instance_hash_method) (Lisp_Image_Instance *, | |
246 int depth); | |
247 void (*init_image_instance_from_eimage_method) (Lisp_Image_Instance *ii, | |
248 int width, int height, | |
249 int slices, | |
250 unsigned char *eimage, | |
251 int dest_mask, | |
252 Lisp_Object instantiator, | |
2959 | 253 Lisp_Object pointer_fg, |
254 Lisp_Object pointer_bg, | |
872 | 255 Lisp_Object domain); |
256 Lisp_Object (*locate_pixmap_file_method) (Lisp_Object file_method); | |
257 int (*colorize_image_instance_method) (Lisp_Object image_instance, | |
258 Lisp_Object fg, Lisp_Object bg); | |
259 void (*widget_query_string_geometry_method) (Lisp_Object string, | |
260 Lisp_Object face, | |
261 int* width, int* height, | |
262 Lisp_Object domain); | |
263 Lisp_Object image_conversion_list; | |
264 | |
265 #ifdef HAVE_TOOLBARS | |
266 /* toolbar methods */ | |
267 void (*output_frame_toolbars_method) (struct frame *); | |
905 | 268 void (*clear_frame_toolbars_method) (struct frame *); |
872 | 269 void (*initialize_frame_toolbars_method) (struct frame *); |
270 void (*free_frame_toolbars_method) (struct frame *); | |
271 void (*output_toolbar_button_method) (struct frame *, Lisp_Object); | |
272 void (*redraw_frame_toolbars_method) (struct frame *); | |
273 void (*redraw_exposed_toolbars_method) (struct frame *f, int x, int y, | |
274 int width, int height); | |
275 #endif | |
276 | |
277 #ifdef HAVE_SCROLLBARS | |
278 /* scrollbar methods */ | |
279 int (*inhibit_scrollbar_slider_size_change_method) (void); | |
280 void (*free_scrollbar_instance_method) (struct scrollbar_instance *); | |
281 void (*release_scrollbar_instance_method) (struct scrollbar_instance *); | |
282 void (*create_scrollbar_instance_method) (struct frame *, int, | |
283 struct scrollbar_instance *); | |
284 void (*update_scrollbar_instance_values_method) (struct window *, | |
285 struct scrollbar_instance *, | |
286 int, int, int, int, int, | |
287 int, int, int, int, int); | |
288 void (*update_scrollbar_instance_status_method) (struct window *, int, int, | |
289 struct | |
290 scrollbar_instance *); | |
291 void (*scrollbar_pointer_changed_in_window_method) (struct window *w); | |
292 #ifdef MEMORY_USAGE_STATS | |
5170
5ddbab03b0e6
various fixes to memory-usage stats
Ben Wing <ben@xemacs.org>
parents:
5157
diff
changeset
|
293 Bytecount (*compute_scrollbar_instance_usage_method) |
5ddbab03b0e6
various fixes to memory-usage stats
Ben Wing <ben@xemacs.org>
parents:
5157
diff
changeset
|
294 (struct device *, |
5ddbab03b0e6
various fixes to memory-usage stats
Ben Wing <ben@xemacs.org>
parents:
5157
diff
changeset
|
295 struct scrollbar_instance *, |
5ddbab03b0e6
various fixes to memory-usage stats
Ben Wing <ben@xemacs.org>
parents:
5157
diff
changeset
|
296 struct usage_stats *); |
872 | 297 #endif |
1318 | 298 /* Paint the window's deadbox, a rectangle between window |
299 borders and two short edges of both scrollbars. */ | |
300 void (*redisplay_deadbox_method) (struct window *w, int x, int y, int width, | |
301 int height); | |
872 | 302 #endif /* HAVE_SCROLLBARS */ |
303 | |
304 #ifdef HAVE_MENUBARS | |
305 /* menubar methods */ | |
306 void (*update_frame_menubars_method) (struct frame *); | |
307 void (*free_frame_menubars_method) (struct frame *); | |
308 #endif | |
309 | |
310 #ifdef HAVE_DIALOGS | |
311 /* dialog methods */ | |
312 Lisp_Object (*make_dialog_box_internal_method) (struct frame *, | |
313 Lisp_Object type, | |
314 Lisp_Object keys); | |
315 #endif | |
316 }; | |
317 | |
318 #define CONMETH_TYPE(meths) ((meths)->symbol) | |
319 #define CONMETH_IMPL_FLAG(meths, f) ((meths)->flags & (f)) | |
320 | |
321 #define CONSOLE_TYPE_NAME(c) ((c)->conmeths->name) | |
322 #define CONSOLE_TYPE(c) ((c)->conmeths->symbol) | |
323 #define CONSOLE_IMPL_FLAG(c, f) CONMETH_IMPL_FLAG ((c)->conmeths, (f)) | |
324 | |
325 /******** Accessing / calling a console method *********/ | |
326 | |
327 #define HAS_CONTYPE_METH_P(meth, m) ((meth)->m##_method) | |
328 #define CONTYPE_METH(meth, m, args) (((meth)->m##_method) args) | |
329 | |
330 /* Call a void-returning console method, if it exists */ | |
331 #define MAYBE_CONTYPE_METH(meth, m, args) do { \ | |
332 struct console_methods *maybe_contype_meth_meth = (meth); \ | |
333 if (HAS_CONTYPE_METH_P (maybe_contype_meth_meth, m)) \ | |
334 CONTYPE_METH (maybe_contype_meth_meth, m, args); \ | |
335 } while (0) | |
336 | |
337 /* Call a console method, if it exists; otherwise return | |
338 the specified value - meth is multiply evaluated. */ | |
339 #define CONTYPE_METH_OR_GIVEN(meth, m, args, given) \ | |
340 (HAS_CONTYPE_METH_P (meth, m) ? \ | |
341 CONTYPE_METH (meth, m, args) : (given)) | |
342 | |
343 /* Call an int-returning console method, if it exists; otherwise | |
344 return 0 */ | |
345 #define MAYBE_INT_CONTYPE_METH(meth, m, args) \ | |
346 CONTYPE_METH_OR_GIVEN (meth, m, args, 0) | |
347 | |
348 /* Call an Lisp-Object-returning console method, if it exists; | |
349 otherwise return Qnil */ | |
350 #define MAYBE_LISP_CONTYPE_METH(meth, m, args) \ | |
351 CONTYPE_METH_OR_GIVEN (meth, m, args, Qnil) | |
352 | |
353 /******** Same functions, operating on a console instead of a | |
354 struct console_methods ********/ | |
355 | |
356 #define HAS_CONMETH_P(c, m) HAS_CONTYPE_METH_P ((c)->conmeths, m) | |
357 #define CONMETH(c, m, args) CONTYPE_METH ((c)->conmeths, m, args) | |
358 #define MAYBE_CONMETH(c, m, args) MAYBE_CONTYPE_METH ((c)->conmeths, m, args) | |
359 #define CONMETH_OR_GIVEN(c, m, args, given) \ | |
360 CONTYPE_METH_OR_GIVEN((c)->conmeths, m, args, given) | |
361 #define MAYBE_INT_CONMETH(c, m, args) \ | |
362 MAYBE_INT_CONTYPE_METH ((c)->conmeths, m, args) | |
363 #define MAYBE_LISP_CONMETH(c, m, args) \ | |
364 MAYBE_LISP_CONTYPE_METH ((c)->conmeths, m, args) | |
365 | |
366 /******** Defining new console types ********/ | |
367 | |
368 typedef struct console_type_entry console_type_entry; | |
369 struct console_type_entry | |
370 { | |
371 Lisp_Object symbol; | |
372 struct console_methods *meths; | |
373 }; | |
374 | |
375 #define DECLARE_CONSOLE_TYPE(type) \ | |
376 extern struct console_methods * type##_console_methods | |
377 | |
378 #define DEFINE_CONSOLE_TYPE(type) \ | |
379 struct console_methods * type##_console_methods | |
380 | |
381 #define INITIALIZE_CONSOLE_TYPE(type, obj_name, pred_sym) do { \ | |
382 type##_console_methods = xnew_and_zero (struct console_methods); \ | |
383 type##_console_methods->name = obj_name; \ | |
384 type##_console_methods->symbol = Q##type; \ | |
385 defsymbol_nodump (&type##_console_methods->predicate_symbol, pred_sym); \ | |
386 add_entry_to_console_type_list (Q##type, type##_console_methods); \ | |
387 type##_console_methods->image_conversion_list = Qnil; \ | |
388 staticpro_nodump (&type##_console_methods->image_conversion_list); \ | |
2367 | 389 dump_add_root_block_ptr (&type##_console_methods, &console_methods_description); \ |
872 | 390 } while (0) |
391 | |
392 #define REINITIALIZE_CONSOLE_TYPE(type) do { \ | |
393 staticpro_nodump (&type##_console_methods->predicate_symbol); \ | |
394 staticpro_nodump (&type##_console_methods->image_conversion_list); \ | |
395 } while (0) | |
396 | |
397 | |
398 /* Declare that console-type TYPE has method M; used in | |
399 initialization routines */ | |
400 #define CONSOLE_HAS_METHOD(type, m) \ | |
401 (type##_console_methods->m##_method = type##_##m) | |
402 | |
403 /* Declare that console-type TYPE inherits method M | |
404 implementation from console-type FROMTYPE */ | |
405 #define CONSOLE_INHERITS_METHOD(type, fromtype, m) \ | |
406 (type##_console_methods->m##_method = fromtype##_##m) | |
407 | |
408 /* Define console type implementation flags */ | |
409 #define CONSOLE_IMPLEMENTATION_FLAGS(type, flg) \ | |
410 (type##_console_methods->flags = flg) | |
411 | |
412 struct console | |
413 { | |
5127
a9c41067dd88
more cleanups, terminology clarification, lots of doc work
Ben Wing <ben@xemacs.org>
parents:
5125
diff
changeset
|
414 NORMAL_LISP_OBJECT_HEADER header; |
872 | 415 |
416 /* Description of this console's methods. */ | |
417 struct console_methods *conmeths; | |
418 | |
1204 | 419 /* Enumerated constant listing which type of console this is (TTY, X, |
420 MS-Windows, etc.). This duplicates the symbol in conmeths->symbol, | |
421 which formerly was the only way to determine the console type. | |
422 We need this constant now for KKCC, so that it can be used in | |
423 an XD_UNION clause to determine the Lisp objects in console_data. */ | |
934 | 424 enum console_variant contype; |
425 | |
872 | 426 /* A structure of auxiliary data specific to the console type. |
427 struct x_console is used for X window frames; defined in console-x.h | |
428 struct tty_console is used to TTY's; defined in console-tty.h */ | |
429 void *console_data; | |
430 | |
431 /* ----- begin partially-completed console localization of | |
432 event loop ---- */ | |
433 | |
434 int local_var_flags; | |
435 | |
1204 | 436 #define MARKED_SLOT(x) Lisp_Object x; |
872 | 437 #include "conslots.h" |
438 | |
439 /* Where to store the next keystroke of the macro. | |
440 Index into con->kbd_macro_builder. */ | |
441 int kbd_macro_ptr; | |
442 | |
443 /* The finalized section of the macro starts at kbd_macro_buffer and | |
444 ends before this. This is not the same as kbd_macro_pointer, because | |
445 we advance this to kbd_macro_pointer when a key's command is complete. | |
446 This way, the keystrokes for "end-kbd-macro" are not included in the | |
447 macro. */ | |
448 int kbd_macro_end; | |
449 | |
450 /* ----- end partially-completed console localization of event loop ---- */ | |
451 | |
452 unsigned int input_enabled :1; | |
453 }; | |
454 | |
455 /* Redefine basic properties more efficiently */ | |
456 | |
457 #undef CONSOLE_LIVE_P | |
5124
623d57b7fbe8
separate regular and disksave finalization, print method fixes.
Ben Wing <ben@xemacs.org>
parents:
5120
diff
changeset
|
458 /* The following is the old way, but it can lead to crashes in certain |
623d57b7fbe8
separate regular and disksave finalization, print method fixes.
Ben Wing <ben@xemacs.org>
parents:
5120
diff
changeset
|
459 weird circumstances, where you might want to be printing a console via |
623d57b7fbe8
separate regular and disksave finalization, print method fixes.
Ben Wing <ben@xemacs.org>
parents:
5120
diff
changeset
|
460 debug_print() */ |
623d57b7fbe8
separate regular and disksave finalization, print method fixes.
Ben Wing <ben@xemacs.org>
parents:
5120
diff
changeset
|
461 /* #define CONSOLE_LIVE_P(con) (!EQ (CONSOLE_TYPE (con), Qdead)) */ |
623d57b7fbe8
separate regular and disksave finalization, print method fixes.
Ben Wing <ben@xemacs.org>
parents:
5120
diff
changeset
|
462 #define CONSOLE_LIVE_P(con) ((con)->contype != dead_console) |
872 | 463 #undef CONSOLE_DEVICE_LIST |
464 #define CONSOLE_DEVICE_LIST(con) ((con)->device_list) | |
465 | |
466 #define CONSOLE_TYPE_P(con, type) EQ (CONSOLE_TYPE (con), Q##type) | |
467 | |
468 #ifdef ERROR_CHECK_TYPES | |
469 DECLARE_INLINE_HEADER ( | |
470 struct console * | |
471 error_check_console_type (struct console *con, Lisp_Object sym) | |
472 ) | |
473 { | |
474 assert (EQ (CONSOLE_TYPE (con), sym)); | |
475 return con; | |
476 } | |
477 # define CONSOLE_TYPE_DATA(con, type) \ | |
478 (*(struct type##_console **) \ | |
479 &(error_check_console_type (con, Q##type))->console_data) | |
480 #else | |
481 # define CONSOLE_TYPE_DATA(con, type) \ | |
482 (*(struct type##_console **) &((con)->console_data)) | |
483 #endif | |
484 | |
485 #define CHECK_CONSOLE_TYPE(x, type) do { \ | |
486 CHECK_CONSOLE (x); \ | |
487 if (! CONSOLE_TYPE_P (XCONSOLE (x), type)) \ | |
488 dead_wrong_type_argument \ | |
489 (type##_console_methods->predicate_symbol, x); \ | |
490 } while (0) | |
491 #define CONCHECK_CONSOLE_TYPE(x, type) do { \ | |
492 CONCHECK_CONSOLE (x); \ | |
493 if (!(CONSOLEP (x) && \ | |
494 CONSOLE_TYPE_P (XCONSOLE (x), type))) \ | |
495 x = wrong_type_argument \ | |
496 (type##_console_methods->predicate_symbol, x); \ | |
497 } while (0) | |
498 | |
499 /* #### These should be in the console-*.h files but there are | |
500 too many places where the abstraction is broken. Need to | |
501 fix. */ | |
502 | |
503 #ifdef HAVE_GTK | |
504 #define CONSOLE_TYPESYM_GTK_P(typesym) EQ (typesym, Qgtk) | |
505 #else | |
506 #define CONSOLE_TYPESYM_GTK_P(typesym) 0 | |
507 #endif | |
508 | |
509 #ifdef HAVE_X_WINDOWS | |
510 #define CONSOLE_TYPESYM_X_P(typesym) EQ (typesym, Qx) | |
511 #else | |
512 #define CONSOLE_TYPESYM_X_P(typesym) 0 | |
513 #endif | |
514 #ifdef HAVE_TTY | |
515 #define CONSOLE_TYPESYM_TTY_P(typesym) EQ (typesym, Qtty) | |
516 #else | |
517 #define CONSOLE_TYPESYM_TTY_P(typesym) 0 | |
518 #endif | |
519 #ifdef HAVE_MS_WINDOWS | |
520 #define CONSOLE_TYPESYM_MSWINDOWS_P(typesym) EQ (typesym, Qmswindows) | |
521 #else | |
522 #define CONSOLE_TYPESYM_MSWINDOWS_P(typesym) 0 | |
523 #endif | |
524 #define CONSOLE_TYPESYM_STREAM_P(typesym) EQ (typesym, Qstream) | |
525 | |
526 #define CONSOLE_TYPESYM_WIN_P(typesym) \ | |
527 (CONSOLE_TYPESYM_GTK_P (typesym) || CONSOLE_TYPESYM_X_P (typesym) || CONSOLE_TYPESYM_MSWINDOWS_P (typesym)) | |
528 | |
529 #define CONSOLE_X_P(con) CONSOLE_TYPESYM_X_P (CONSOLE_TYPE (con)) | |
530 #define CHECK_X_CONSOLE(z) CHECK_CONSOLE_TYPE (z, x) | |
531 #define CONCHECK_X_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, x) | |
532 | |
533 #define CONSOLE_GTK_P(con) CONSOLE_TYPESYM_GTK_P (CONSOLE_TYPE (con)) | |
534 #define CHECK_GTK_CONSOLE(z) CHECK_CONSOLE_TYPE (z, gtk) | |
535 #define CONCHECK_GTK_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, gtk) | |
536 | |
537 #define CONSOLE_TTY_P(con) CONSOLE_TYPESYM_TTY_P (CONSOLE_TYPE (con)) | |
538 #define CHECK_TTY_CONSOLE(z) CHECK_CONSOLE_TYPE (z, tty) | |
539 #define CONCHECK_TTY_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, tty) | |
540 | |
541 #define CONSOLE_MSWINDOWS_P(con) CONSOLE_TYPESYM_MSWINDOWS_P (CONSOLE_TYPE (con)) | |
542 #define CHECK_MSWINDOWS_CONSOLE(z) CHECK_CONSOLE_TYPE (z, mswindows) | |
543 #define CONCHECK_MSWINDOWS_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, mswindows) | |
544 | |
545 #define CONSOLE_STREAM_P(con) CONSOLE_TYPESYM_STREAM_P (CONSOLE_TYPE (con)) | |
546 #define CHECK_STREAM_CONSOLE(z) CHECK_CONSOLE_TYPE (z, stream) | |
547 #define CONCHECK_STREAM_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, stream) | |
548 | |
549 #define CONSOLE_WIN_P(con) CONSOLE_TYPESYM_WIN_P (CONSOLE_TYPE (con)) | |
550 | |
551 /* This structure marks which slots in a console have corresponding | |
552 default values in console_defaults. | |
553 Each such slot has a nonzero value in this structure. | |
554 The value has only one nonzero bit. | |
555 | |
556 When a console has its own local value for a slot, | |
557 the bit for that slot (found in the same slot in this structure) | |
558 is turned on in the console's local_var_flags slot. | |
559 | |
560 If a slot in this structure is zero, then even though there may | |
561 be a DEFVAR_CONSOLE_LOCAL for the slot, there is no default value for it; | |
562 and the corresponding slot in console_defaults is not used. */ | |
563 | |
564 extern struct console console_local_flags; | |
565 | |
566 #define CONSOLE_NAME(con) ((con)->name) | |
567 #define CONSOLE_CONNECTION(con) ((con)->connection) | |
568 #define CONSOLE_CANON_CONNECTION(con) ((con)->canon_connection) | |
569 #define CONSOLE_FUNCTION_KEY_MAP(con) ((con)->function_key_map) | |
570 #define CONSOLE_SELECTED_DEVICE(con) ((con)->selected_device) | |
571 #define CONSOLE_SELECTED_FRAME(con) \ | |
572 DEVICE_SELECTED_FRAME (XDEVICE ((con)->selected_device)) | |
573 #define CONSOLE_LAST_NONMINIBUF_FRAME(con) NON_LVALUE ((con)->last_nonminibuf_frame) | |
574 #define CONSOLE_QUIT_CHAR(con) ((con)->quit_char) | |
1204 | 575 #define CONSOLE_QUIT_EVENT(con) ((con)->quit_event) |
576 #define CONSOLE_CRITICAL_QUIT_EVENT(con) ((con)->critical_quit_event) | |
872 | 577 |
578 DECLARE_CONSOLE_TYPE (dead); | |
579 | |
580 extern console_type_entry_dynarr *the_console_type_entry_dynarr; | |
581 | |
582 #endif /* INCLUDED_console_impl_h_ */ |