annotate src/console-impl.h @ 5127:a9c41067dd88 ben-lisp-object

more cleanups, terminology clarification, lots of doc work -------------------- ChangeLog entries follow: -------------------- man/ChangeLog addition: 2010-03-05 Ben Wing <ben@xemacs.org> * internals/internals.texi (Introduction to Allocation): * internals/internals.texi (Integers and Characters): * internals/internals.texi (Allocation from Frob Blocks): * internals/internals.texi (lrecords): * internals/internals.texi (Low-level allocation): Rewrite section on allocation of Lisp objects to reflect the new reality. Remove references to nonexistent XSETINT and XSETCHAR. modules/ChangeLog addition: 2010-03-05 Ben Wing <ben@xemacs.org> * postgresql/postgresql.c (allocate_pgconn): * postgresql/postgresql.c (allocate_pgresult): * postgresql/postgresql.h (struct Lisp_PGconn): * postgresql/postgresql.h (struct Lisp_PGresult): * ldap/eldap.c (allocate_ldap): * ldap/eldap.h (struct Lisp_LDAP): Same changes as in src/ dir. See large log there in ChangeLog, but basically: ALLOC_LISP_OBJECT -> ALLOC_NORMAL_LISP_OBJECT LISP_OBJECT_HEADER -> NORMAL_LISP_OBJECT_HEADER ../hlo/src/ChangeLog addition: 2010-03-05 Ben Wing <ben@xemacs.org> * alloc.c: * alloc.c (old_alloc_sized_lcrecord): * alloc.c (very_old_free_lcrecord): * alloc.c (copy_lisp_object): * alloc.c (zero_sized_lisp_object): * alloc.c (zero_nonsized_lisp_object): * alloc.c (lisp_object_storage_size): * alloc.c (free_normal_lisp_object): * alloc.c (FREE_FIXED_TYPE_WHEN_NOT_IN_GC): * alloc.c (ALLOC_FROB_BLOCK_LISP_OBJECT): * alloc.c (Fcons): * alloc.c (noseeum_cons): * alloc.c (make_float): * alloc.c (make_bignum): * alloc.c (make_bignum_bg): * alloc.c (make_ratio): * alloc.c (make_ratio_bg): * alloc.c (make_ratio_rt): * alloc.c (make_bigfloat): * alloc.c (make_bigfloat_bf): * alloc.c (size_vector): * alloc.c (make_compiled_function): * alloc.c (Fmake_symbol): * alloc.c (allocate_extent): * alloc.c (allocate_event): * alloc.c (make_key_data): * alloc.c (make_button_data): * alloc.c (make_motion_data): * alloc.c (make_process_data): * alloc.c (make_timeout_data): * alloc.c (make_magic_data): * alloc.c (make_magic_eval_data): * alloc.c (make_eval_data): * alloc.c (make_misc_user_data): * alloc.c (Fmake_marker): * alloc.c (noseeum_make_marker): * alloc.c (size_string_direct_data): * alloc.c (make_uninit_string): * alloc.c (make_string_nocopy): * alloc.c (mark_lcrecord_list): * alloc.c (alloc_managed_lcrecord): * alloc.c (free_managed_lcrecord): * alloc.c (sweep_lcrecords_1): * alloc.c (malloced_storage_size): * buffer.c (allocate_buffer): * buffer.c (compute_buffer_usage): * buffer.c (DEFVAR_BUFFER_LOCAL_1): * buffer.c (nuke_all_buffer_slots): * buffer.c (common_init_complex_vars_of_buffer): * buffer.h (struct buffer_text): * buffer.h (struct buffer): * bytecode.c: * bytecode.c (make_compiled_function_args): * bytecode.c (size_compiled_function_args): * bytecode.h (struct compiled_function_args): * casetab.c (allocate_case_table): * casetab.h (struct Lisp_Case_Table): * charset.h (struct Lisp_Charset): * chartab.c (fill_char_table): * chartab.c (Fmake_char_table): * chartab.c (make_char_table_entry): * chartab.c (copy_char_table_entry): * chartab.c (Fcopy_char_table): * chartab.c (put_char_table): * chartab.h (struct Lisp_Char_Table_Entry): * chartab.h (struct Lisp_Char_Table): * console-gtk-impl.h (struct gtk_device): * console-gtk-impl.h (struct gtk_frame): * console-impl.h (struct console): * console-msw-impl.h (struct Lisp_Devmode): * console-msw-impl.h (struct mswindows_device): * console-msw-impl.h (struct msprinter_device): * console-msw-impl.h (struct mswindows_frame): * console-msw-impl.h (struct mswindows_dialog_id): * console-stream-impl.h (struct stream_console): * console-stream.c (stream_init_console): * console-tty-impl.h (struct tty_console): * console-tty-impl.h (struct tty_device): * console-tty.c (allocate_tty_console_struct): * console-x-impl.h (struct x_device): * console-x-impl.h (struct x_frame): * console.c (allocate_console): * console.c (nuke_all_console_slots): * console.c (DEFVAR_CONSOLE_LOCAL_1): * console.c (common_init_complex_vars_of_console): * data.c (make_weak_list): * data.c (make_weak_box): * data.c (make_ephemeron): * database.c: * database.c (struct Lisp_Database): * database.c (allocate_database): * database.c (finalize_database): * device-gtk.c (allocate_gtk_device_struct): * device-impl.h (struct device): * device-msw.c: * device-msw.c (mswindows_init_device): * device-msw.c (msprinter_init_device): * device-msw.c (finalize_devmode): * device-msw.c (allocate_devmode): * device-tty.c (allocate_tty_device_struct): * device-x.c (allocate_x_device_struct): * device.c: * device.c (nuke_all_device_slots): * device.c (allocate_device): * dialog-msw.c (handle_question_dialog_box): * elhash.c: * elhash.c (struct Lisp_Hash_Table): * elhash.c (finalize_hash_table): * elhash.c (make_general_lisp_hash_table): * elhash.c (Fcopy_hash_table): * elhash.h (htentry): * emacs.c (main_1): * eval.c: * eval.c (size_multiple_value): * event-stream.c (finalize_command_builder): * event-stream.c (allocate_command_builder): * event-stream.c (free_command_builder): * event-stream.c (event_stream_generate_wakeup): * event-stream.c (event_stream_resignal_wakeup): * event-stream.c (event_stream_disable_wakeup): * event-stream.c (event_stream_wakeup_pending_p): * events.h (struct Lisp_Timeout): * events.h (struct command_builder): * extents-impl.h: * extents-impl.h (struct extent_auxiliary): * extents-impl.h (struct extent_info): * extents-impl.h (set_extent_no_chase_aux_field): * extents-impl.h (set_extent_no_chase_normal_field): * extents.c: * extents.c (gap_array_marker): * extents.c (gap_array): * extents.c (extent_list_marker): * extents.c (extent_list): * extents.c (stack_of_extents): * extents.c (gap_array_make_marker): * extents.c (extent_list_make_marker): * extents.c (allocate_extent_list): * extents.c (SLOT): * extents.c (mark_extent_auxiliary): * extents.c (allocate_extent_auxiliary): * extents.c (attach_extent_auxiliary): * extents.c (size_gap_array): * extents.c (finalize_extent_info): * extents.c (allocate_extent_info): * extents.c (uninit_buffer_extents): * extents.c (allocate_soe): * extents.c (copy_extent): * extents.c (vars_of_extents): * extents.h: * faces.c (allocate_face): * faces.h (struct Lisp_Face): * faces.h (struct face_cachel): * file-coding.c: * file-coding.c (finalize_coding_system): * file-coding.c (sizeof_coding_system): * file-coding.c (Fcopy_coding_system): * file-coding.h (struct Lisp_Coding_System): * file-coding.h (MARKED_SLOT): * fns.c (size_bit_vector): * font-mgr.c: * font-mgr.c (finalize_fc_pattern): * font-mgr.c (print_fc_pattern): * font-mgr.c (Ffc_pattern_p): * font-mgr.c (Ffc_pattern_create): * font-mgr.c (Ffc_name_parse): * font-mgr.c (Ffc_name_unparse): * font-mgr.c (Ffc_pattern_duplicate): * font-mgr.c (Ffc_pattern_add): * font-mgr.c (Ffc_pattern_del): * font-mgr.c (Ffc_pattern_get): * font-mgr.c (fc_config_create_using): * font-mgr.c (fc_strlist_to_lisp_using): * font-mgr.c (fontset_to_list): * font-mgr.c (Ffc_config_p): * font-mgr.c (Ffc_config_up_to_date): * font-mgr.c (Ffc_config_build_fonts): * font-mgr.c (Ffc_config_get_cache): * font-mgr.c (Ffc_config_get_fonts): * font-mgr.c (Ffc_config_set_current): * font-mgr.c (Ffc_config_get_blanks): * font-mgr.c (Ffc_config_get_rescan_interval): * font-mgr.c (Ffc_config_set_rescan_interval): * font-mgr.c (Ffc_config_app_font_add_file): * font-mgr.c (Ffc_config_app_font_add_dir): * font-mgr.c (Ffc_config_app_font_clear): * font-mgr.c (size): * font-mgr.c (Ffc_config_substitute): * font-mgr.c (Ffc_font_render_prepare): * font-mgr.c (Ffc_font_match): * font-mgr.c (Ffc_font_sort): * font-mgr.c (finalize_fc_config): * font-mgr.c (print_fc_config): * font-mgr.h: * font-mgr.h (struct fc_pattern): * font-mgr.h (XFC_PATTERN): * font-mgr.h (struct fc_config): * font-mgr.h (XFC_CONFIG): * frame-gtk.c (allocate_gtk_frame_struct): * frame-impl.h (struct frame): * frame-msw.c (mswindows_init_frame_1): * frame-x.c (allocate_x_frame_struct): * frame.c (nuke_all_frame_slots): * frame.c (allocate_frame_core): * gc.c: * gc.c (GC_CHECK_NOT_FREE): * glyphs.c (finalize_image_instance): * glyphs.c (allocate_image_instance): * glyphs.c (Fcolorize_image_instance): * glyphs.c (allocate_glyph): * glyphs.c (unmap_subwindow_instance_cache_mapper): * glyphs.c (register_ignored_expose): * glyphs.h (struct Lisp_Image_Instance): * glyphs.h (struct Lisp_Glyph): * glyphs.h (struct glyph_cachel): * glyphs.h (struct expose_ignore): * gui.c (allocate_gui_item): * gui.h (struct Lisp_Gui_Item): * keymap.c (struct Lisp_Keymap): * keymap.c (make_keymap): * lisp.h: * lisp.h (struct Lisp_String_Direct_Data): * lisp.h (struct Lisp_String_Indirect_Data): * lisp.h (struct Lisp_Vector): * lisp.h (struct Lisp_Bit_Vector): * lisp.h (DECLARE_INLINE_LISP_BIT_VECTOR): * lisp.h (struct weak_box): * lisp.h (struct ephemeron): * lisp.h (struct weak_list): * lrecord.h: * lrecord.h (struct lrecord_implementation): * lrecord.h (MC_ALLOC_CALL_FINALIZER): * lrecord.h (struct lcrecord_list): * lstream.c (finalize_lstream): * lstream.c (sizeof_lstream): * lstream.c (Lstream_new): * lstream.c (Lstream_delete): * lstream.h (struct lstream): * marker.c: * marker.c (finalize_marker): * marker.c (compute_buffer_marker_usage): * mule-charset.c: * mule-charset.c (make_charset): * mule-charset.c (compute_charset_usage): * objects-impl.h (struct Lisp_Color_Instance): * objects-impl.h (struct Lisp_Font_Instance): * objects-tty-impl.h (struct tty_color_instance_data): * objects-tty-impl.h (struct tty_font_instance_data): * objects-tty.c (tty_initialize_color_instance): * objects-tty.c (tty_initialize_font_instance): * objects.c (finalize_color_instance): * objects.c (Fmake_color_instance): * objects.c (finalize_font_instance): * objects.c (Fmake_font_instance): * objects.c (reinit_vars_of_objects): * opaque.c: * opaque.c (sizeof_opaque): * opaque.c (make_opaque_ptr): * opaque.c (free_opaque_ptr): * opaque.h: * opaque.h (Lisp_Opaque): * opaque.h (Lisp_Opaque_Ptr): * print.c (printing_unreadable_lcrecord): * print.c (external_object_printer): * print.c (debug_p4): * process.c (finalize_process): * process.c (make_process_internal): * procimpl.h (struct Lisp_Process): * rangetab.c (Fmake_range_table): * rangetab.c (Fcopy_range_table): * rangetab.h (struct Lisp_Range_Table): * scrollbar.c: * scrollbar.c (create_scrollbar_instance): * scrollbar.c (compute_scrollbar_instance_usage): * scrollbar.h (struct scrollbar_instance): * specifier.c (finalize_specifier): * specifier.c (sizeof_specifier): * specifier.c (set_specifier_caching): * specifier.h (struct Lisp_Specifier): * specifier.h (struct specifier_caching): * symeval.h: * symeval.h (SYMBOL_VALUE_MAGIC_P): * symeval.h (DEFVAR_SYMVAL_FWD): * symsinit.h: * syntax.c (init_buffer_syntax_cache): * syntax.h (struct syntax_cache): * toolbar.c: * toolbar.c (allocate_toolbar_button): * toolbar.c (update_toolbar_button): * toolbar.h (struct toolbar_button): * tooltalk.c (struct Lisp_Tooltalk_Message): * tooltalk.c (make_tooltalk_message): * tooltalk.c (struct Lisp_Tooltalk_Pattern): * tooltalk.c (make_tooltalk_pattern): * ui-gtk.c: * ui-gtk.c (allocate_ffi_data): * ui-gtk.c (emacs_gtk_object_finalizer): * ui-gtk.c (allocate_emacs_gtk_object_data): * ui-gtk.c (allocate_emacs_gtk_boxed_data): * ui-gtk.h: * window-impl.h (struct window): * window-impl.h (struct window_mirror): * window.c (finalize_window): * window.c (allocate_window): * window.c (new_window_mirror): * window.c (mark_window_as_deleted): * window.c (make_dummy_parent): * window.c (compute_window_mirror_usage): * window.c (compute_window_usage): Overall point of this change and previous ones in this repository: (1) Introduce new, clearer terminology: everything other than int or char is a "record" object, which comes in two types: "normal objects" and "frob-block objects". Fix up all places that referred to frob-block objects as "simple", "basic", etc. (2) Provide an advertised interface for doing operations on Lisp objects, including creating new types, that is clean and consistent in its naming, uses the above-referenced terms and avoids referencing "lrecords", "old lcrecords", etc., which should hide under the surface. (3) Make the size_in_bytes and finalizer methods take a Lisp_Object rather than a void * for consistency with other methods. (4) Separate finalizer method into finalizer and disksaver, so that normal finalize methods don't have to worry about disksaving. Other specifics: (1) Renaming: LISP_OBJECT_HEADER -> NORMAL_LISP_OBJECT_HEADER ALLOC_LISP_OBJECT -> ALLOC_NORMAL_LISP_OBJECT implementation->basic_p -> implementation->frob_block_p ALLOCATE_FIXED_TYPE_AND_SET_IMPL -> ALLOC_FROB_BLOCK_LISP_OBJECT *FCCONFIG*, wrap_fcconfig -> *FC_CONFIG*, wrap_fc_config *FCPATTERN*, wrap_fcpattern -> *FC_PATTERN*, wrap_fc_pattern (the last two changes make the naming of these macros consistent with the naming of all other macros, since the objects are named fc-config and fc-pattern with a hyphen) (2) Lots of documentation fixes in lrecord.h. (3) Eliminate macros for copying, freeing, zeroing objects, getting their storage size. Instead, new functions: zero_sized_lisp_object() zero_nonsized_lisp_object() lisp_object_storage_size() free_normal_lisp_object() (copy_lisp_object() already exists) LISP_OBJECT_FROB_BLOCK_P() (actually a macro) Eliminated: free_lrecord() zero_lrecord() copy_lrecord() copy_sized_lrecord() old_copy_lcrecord() old_copy_sized_lcrecord() old_zero_lcrecord() old_zero_sized_lcrecord() LISP_OBJECT_STORAGE_SIZE() COPY_SIZED_LISP_OBJECT() COPY_SIZED_LCRECORD() COPY_LISP_OBJECT() ZERO_LISP_OBJECT() FREE_LISP_OBJECT() (4) Catch the remaining places where lrecord stuff was used directly and use the advertised interface, e.g. alloc_sized_lrecord() -> ALLOC_SIZED_LISP_OBJECT(). (5) Make certain statically-declared pseudo-objects (buffer_local_flags, console_local_flags) have their lheader initialized correctly, so things like copy_lisp_object() can work on them. Make extent_auxiliary_defaults a proper heap object Vextent_auxiliary_defaults, and make extent auxiliaries dumpable so that this object can be dumped. allocate_extent_auxiliary() now just creates the object, and attach_extent_auxiliary() creates an extent auxiliary and attaches to an extent, like the old allocate_extent_auxiliary(). (6) Create EXTENT_AUXILIARY_SLOTS macro, similar to the foo-slots.h files but in a macro instead of a file. The purpose is to avoid duplication when iterating over all the slots in an extent auxiliary. Use it. (7) In lstream.c, don't zero out object after allocation because allocation routines take care of this. (8) In marker.c, fix a mistake in computing marker overhead. (9) In print.c, clean up printing_unreadable_lcrecord(), external_object_printer() to avoid lots of ifdef NEW_GC's. (10) Separate toolbar-button allocation into a separate allocate_toolbar_button() function for use in the example code in lrecord.h.
author Ben Wing <ben@xemacs.org>
date Fri, 05 Mar 2010 04:08:17 -0600
parents b5df3737028a
children 7be849cb8828
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
1 /* Define console object for XEmacs.
2959
4eb2a8c07cb3 [xemacs-hg @ 2005-09-27 05:48:22 by ben]
ben
parents: 2828
diff changeset
2 Copyright (C) 1996, 2002, 2003, 2005 Ben Wing
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
3
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
4 This file is part of XEmacs.
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
5
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
9 later version.
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
10
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
14 for more details.
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
15
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
20
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
21 /* Synched up with: Not in FSF. */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
22
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
23 /* Written by Ben Wing. */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
24
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
25 #ifndef INCLUDED_console_impl_h_
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
26 #define INCLUDED_console_impl_h_
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
27
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
28 #include "console.h"
3659
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3017
diff changeset
29 #include "specifier.h"
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
30
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 934
diff changeset
31 extern const struct sized_memory_description cted_description;
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 934
diff changeset
32 extern const struct sized_memory_description console_methods_description;
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
33
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
34
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
35 /*
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
36 * Constants returned by device_implementation_flags_method
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
37 */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
38
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
39 /* Set when device uses pixel-based geometry */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
40 #define XDEVIMPF_PIXEL_GEOMETRY 0x00000001L
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
41
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
42 /* Indicates that the device is a printer */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
43 #define XDEVIMPF_IS_A_PRINTER 0x00000002L
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
44
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
45 /* Do not automatically redisplay this device */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
46 #define XDEVIMPF_NO_AUTO_REDISPLAY 0x00000004L
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
47
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
48 /* Do not delete the device when last frame's gone */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
49 #define XDEVIMPF_FRAMELESS_OK 0x00000008L
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
50
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
51 /* Do not preempt resiaply of frame or device once it starts */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
52 #define XDEVIMPF_DONT_PREEMPT_REDISPLAY 0x00000010L
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
53
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
54 struct console_methods
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
55 {
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
56 const char *name; /* Used by print_console, print_device, print_frame */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
57 Lisp_Object symbol;
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
58 Lisp_Object predicate_symbol;
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
59 unsigned int flags; /* Read-only implementation flags, set once upon
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
60 console type creation. INITIALIZE_CONSOLE_TYPE sets
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
61 this member to 0. */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
62
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
63 /* console methods */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
64 void (*init_console_method) (struct console *, Lisp_Object props);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
65 void (*mark_console_method) (struct console *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
66 int (*initially_selected_for_input_method) (struct console *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
67 void (*delete_console_method) (struct console *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
68 Lisp_Object (*semi_canonicalize_console_connection_method)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
69 (Lisp_Object connection, Error_Behavior errb);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
70 Lisp_Object (*semi_canonicalize_device_connection_method)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
71 (Lisp_Object connection, Error_Behavior errb);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
72 Lisp_Object (*canonicalize_console_connection_method)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
73 (Lisp_Object connection, Error_Behavior errb);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
74 Lisp_Object (*canonicalize_device_connection_method)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
75 (Lisp_Object connection, Error_Behavior errb);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
76 Lisp_Object (*device_to_console_connection_method)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
77 (Lisp_Object connection, Error_Behavior errb);
2828
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2720
diff changeset
78 Lisp_Object (*perhaps_init_unseen_key_defaults_method)
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2720
diff changeset
79 (struct console *, Lisp_Object keysym);
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
80
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
81 /* device methods */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
82 void (*init_device_method) (struct device *, Lisp_Object props);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
83 void (*finish_init_device_method) (struct device *, Lisp_Object props);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
84 void (*delete_device_method) (struct device *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
85 void (*mark_device_method) (struct device *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
86 void (*asynch_device_change_method) (void);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
87 Lisp_Object (*device_system_metrics_method) (struct device *,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
88 enum device_metrics);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
89 Lisp_Object (*own_selection_method)(Lisp_Object selection_name,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
90 Lisp_Object selection_value,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
91 Lisp_Object how_to_add,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
92 Lisp_Object selection_type,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
93 int owned_p);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
94 void (*disown_selection_method)(Lisp_Object selection_name,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
95 Lisp_Object timeval);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
96 Lisp_Object (*get_foreign_selection_method) (Lisp_Object selection_symbol,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
97 Lisp_Object target_type);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
98 Lisp_Object (*selection_exists_p_method)(Lisp_Object selection_name,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
99 Lisp_Object selection_type);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
100 Lisp_Object (*available_selection_types_method)(Lisp_Object selection_name);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
101 Lisp_Object (*register_selection_data_type_method)(Lisp_Object type_name);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
102 Lisp_Object (*selection_data_type_name_method)(Lisp_Object type);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
103
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
104 /* frame methods */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
105 Lisp_Object *device_specific_frame_props;
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
106 void (*init_frame_1_method) (struct frame *, Lisp_Object properties,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
107 int frame_name_is_defaulted);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
108 void (*init_frame_2_method) (struct frame *, Lisp_Object properties);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
109 void (*init_frame_3_method) (struct frame *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
110 void (*after_init_frame_method) (struct frame *, int first_on_device,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
111 int first_on_console);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
112 void (*mark_frame_method) (struct frame *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
113 void (*delete_frame_method) (struct frame *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
114 void (*focus_on_frame_method) (struct frame *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
115 void (*raise_frame_method) (struct frame *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
116 void (*lower_frame_method) (struct frame *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
117 void (*enable_frame_method) (struct frame *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
118 void (*disable_frame_method) (struct frame *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
119 int (*get_mouse_position_method) (struct device *d, Lisp_Object *frame,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
120 int *x, int *y);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
121 void (*set_mouse_position_method) (struct window *w, int x, int y);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
122 void (*make_frame_visible_method) (struct frame *f);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
123 void (*make_frame_invisible_method) (struct frame *f);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
124 void (*iconify_frame_method) (struct frame *f);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
125 Lisp_Object (*frame_property_method) (struct frame *f, Lisp_Object prop);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
126 int (*internal_frame_property_p_method) (struct frame *f,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
127 Lisp_Object prop);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
128 Lisp_Object (*frame_properties_method) (struct frame *f);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
129 void (*set_frame_properties_method) (struct frame *f, Lisp_Object plist);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
130 void (*set_frame_size_method) (struct frame *f, int width, int height);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
131 void (*set_frame_position_method) (struct frame *f, int xoff, int yoff);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
132 int (*frame_visible_p_method) (struct frame *f);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
133 int (*frame_totally_visible_p_method) (struct frame *f);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
134 int (*frame_iconified_p_method) (struct frame *f);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
135 void (*set_title_from_ibyte_method) (struct frame *f, Ibyte *title);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
136 void (*set_icon_name_from_ibyte_method) (struct frame *f, Ibyte *title);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
137 void (*set_frame_pointer_method) (struct frame *f);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
138 void (*set_frame_icon_method) (struct frame *f);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
139 void (*popup_menu_method) (Lisp_Object menu, Lisp_Object event);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
140 Lisp_Object (*get_frame_parent_method) (struct frame *f);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
141 void (*update_frame_external_traits_method) (struct frame *f, Lisp_Object name);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
142 int (*frame_size_fixed_p_method) (struct frame *f);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
143 void (*eject_page_method) (struct frame *f);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
144
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
145 /* redisplay methods */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
146 int (*left_margin_width_method) (struct window *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
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
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
149 const Ichar *str, Charcount len);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
150 void (*output_display_block_method) (struct window *, struct display_line *,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
151 int, int, int, int, int, int, int);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
152 int (*divider_height_method) (void);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
153 int (*eol_cursor_width_method) (void);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
154 void (*output_vertical_divider_method) (struct window *, int);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
155 void (*clear_to_window_end_method) (struct window *, int, int);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
156 void (*clear_region_method) (Lisp_Object, struct device*, struct frame*, face_index,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
157 int, int, int, int,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
158 Lisp_Object, Lisp_Object, Lisp_Object);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
159 void (*clear_frame_method) (struct frame *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
160 void (*window_output_begin_method) (struct window *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
161 void (*frame_output_begin_method) (struct frame *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
162 void (*window_output_end_method) (struct window *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
163 void (*frame_output_end_method) (struct frame *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
164 int (*flash_method) (struct device *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
165 void (*ring_bell_method) (struct device *, int volume, int pitch,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
166 int duration);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
167 void (*frame_redraw_cursor_method) (struct frame *f);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
168 void (*set_final_cursor_coords_method) (struct frame *, int, int);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
169 void (*bevel_area_method) (struct window *, face_index, int, int, int, int, int,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
170 int, enum edge_style);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
171 void (*output_pixmap_method) (struct window *w, Lisp_Object image_instance,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
172 struct display_box *db, struct display_glyph_area *dga,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
173 face_index findex, int cursor_start, int cursor_width,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
174 int cursor_height, int offset_bitmap);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
175 void (*output_string_method) (struct window *w, struct display_line *dl,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
176 Ichar_dynarr *buf, int xpos, int xoffset,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
177 int start_pixpos, int width, face_index findex,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
178 int cursor, int cursor_start, int cursor_width,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
179 int cursor_height);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
180
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
181 /* color methods */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
182 int (*initialize_color_instance_method) (Lisp_Color_Instance *,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
183 Lisp_Object name,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
184 Lisp_Object device,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
185 Error_Behavior errb);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
186 void (*mark_color_instance_method) (Lisp_Color_Instance *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
187 void (*print_color_instance_method) (Lisp_Color_Instance *,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
188 Lisp_Object printcharfun,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
189 int escapeflag);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
190 void (*finalize_color_instance_method) (Lisp_Color_Instance *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
191 int (*color_instance_equal_method) (Lisp_Color_Instance *,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
192 Lisp_Color_Instance *,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
193 int depth);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
194 Hashcode (*color_instance_hash_method) (Lisp_Color_Instance *,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
195 int depth);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
196 Lisp_Object (*color_instance_rgb_components_method) (Lisp_Color_Instance *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
197 int (*valid_color_name_p_method) (struct device *, Lisp_Object color);
2527
491f8cf78a9c [xemacs-hg @ 2005-01-28 02:58:38 by ben]
ben
parents: 2367
diff changeset
198 Lisp_Object (*color_list_method) (void);
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
199
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
200 /* font methods */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
201 int (*initialize_font_instance_method) (Lisp_Font_Instance *,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
202 Lisp_Object name,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
203 Lisp_Object device,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
204 Error_Behavior errb);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
205 void (*mark_font_instance_method) (Lisp_Font_Instance *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
206 void (*print_font_instance_method) (Lisp_Font_Instance *,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
207 Lisp_Object printcharfun,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
208 int escapeflag);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
209 void (*finalize_font_instance_method) (Lisp_Font_Instance *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
210 Lisp_Object (*font_instance_truename_method) (Lisp_Font_Instance *,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
211 Error_Behavior errb);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
212 Lisp_Object (*font_instance_properties_method) (Lisp_Font_Instance *);
2527
491f8cf78a9c [xemacs-hg @ 2005-01-28 02:58:38 by ben]
ben
parents: 2367
diff changeset
213 Lisp_Object (*font_list_method) (Lisp_Object pattern,
1701
a1e328407366 [xemacs-hg @ 2003-09-20 01:14:24 by youngs]
youngs
parents: 1318
diff changeset
214 Lisp_Object device,
a1e328407366 [xemacs-hg @ 2003-09-20 01:14:24 by youngs]
youngs
parents: 1318
diff changeset
215 Lisp_Object maxnumber);
3659
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3017
diff changeset
216 Lisp_Object (*find_charset_font_method)
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3017
diff changeset
217 (Lisp_Object device, Lisp_Object font, Lisp_Object charset,
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3017
diff changeset
218 enum font_specifier_matchspec_stages stage);
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3017
diff changeset
219 int (*font_spec_matches_charset_method)
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3017
diff changeset
220 (struct device *d, Lisp_Object charset, const Ibyte *nonreloc,
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3017
diff changeset
221 Lisp_Object reloc, Bytecount offset, Bytecount length,
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 3017
diff changeset
222 enum font_specifier_matchspec_stages stage);
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
223
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
224 /* image methods */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
225 void (*mark_image_instance_method) (Lisp_Image_Instance *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
226 void (*print_image_instance_method) (Lisp_Image_Instance *,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
227 Lisp_Object printcharfun,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
228 int escapeflag);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
229 void (*finalize_image_instance_method) (Lisp_Image_Instance *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
230 void (*unmap_subwindow_method) (Lisp_Image_Instance *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
231 void (*map_subwindow_method) (Lisp_Image_Instance *, int x, int y,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
232 struct display_glyph_area* dga);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
233 void (*resize_subwindow_method) (Lisp_Image_Instance *, int w, int h);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
234 void (*redisplay_subwindow_method) (Lisp_Image_Instance *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
235 void (*redisplay_widget_method) (Lisp_Image_Instance *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
236 /* Maybe this should be a specifier. Unfortunately specifiers don't
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
237 allow us to represent things at the toolkit level, which is what
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
238 is required here. */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
239 int (*widget_border_width_method) (void);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
240 int (*widget_spacing_method) (Lisp_Image_Instance *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
241 int (*image_instance_equal_method) (Lisp_Image_Instance *,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
242 Lisp_Image_Instance *,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
243 int depth);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
244 Hashcode (*image_instance_hash_method) (Lisp_Image_Instance *,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
245 int depth);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
246 void (*init_image_instance_from_eimage_method) (Lisp_Image_Instance *ii,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
247 int width, int height,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
248 int slices,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
249 unsigned char *eimage,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
250 int dest_mask,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
251 Lisp_Object instantiator,
2959
4eb2a8c07cb3 [xemacs-hg @ 2005-09-27 05:48:22 by ben]
ben
parents: 2828
diff changeset
252 Lisp_Object pointer_fg,
4eb2a8c07cb3 [xemacs-hg @ 2005-09-27 05:48:22 by ben]
ben
parents: 2828
diff changeset
253 Lisp_Object pointer_bg,
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
254 Lisp_Object domain);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
255 Lisp_Object (*locate_pixmap_file_method) (Lisp_Object file_method);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
256 int (*colorize_image_instance_method) (Lisp_Object image_instance,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
257 Lisp_Object fg, Lisp_Object bg);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
258 void (*widget_query_string_geometry_method) (Lisp_Object string,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
259 Lisp_Object face,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
260 int* width, int* height,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
261 Lisp_Object domain);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
262 Lisp_Object image_conversion_list;
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
263
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
264 #ifdef HAVE_TOOLBARS
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
265 /* toolbar methods */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
266 void (*output_frame_toolbars_method) (struct frame *);
905
c15f25529e61 [xemacs-hg @ 2002-07-06 21:05:42 by andyp]
andyp
parents: 872
diff changeset
267 void (*clear_frame_toolbars_method) (struct frame *);
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
268 void (*initialize_frame_toolbars_method) (struct frame *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
269 void (*free_frame_toolbars_method) (struct frame *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
270 void (*output_toolbar_button_method) (struct frame *, Lisp_Object);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
271 void (*redraw_frame_toolbars_method) (struct frame *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
272 void (*redraw_exposed_toolbars_method) (struct frame *f, int x, int y,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
273 int width, int height);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
274 #endif
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
275
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
276 #ifdef HAVE_SCROLLBARS
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
277 /* scrollbar methods */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
278 int (*inhibit_scrollbar_slider_size_change_method) (void);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
279 void (*free_scrollbar_instance_method) (struct scrollbar_instance *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
280 void (*release_scrollbar_instance_method) (struct scrollbar_instance *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
281 void (*create_scrollbar_instance_method) (struct frame *, int,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
282 struct scrollbar_instance *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
283 void (*update_scrollbar_instance_values_method) (struct window *,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
284 struct scrollbar_instance *,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
285 int, int, int, int, int,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
286 int, int, int, int, int);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
287 void (*update_scrollbar_instance_status_method) (struct window *, int, int,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
288 struct
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
289 scrollbar_instance *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
290 void (*scrollbar_pointer_changed_in_window_method) (struct window *w);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
291 #ifdef MEMORY_USAGE_STATS
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
292 int (*compute_scrollbar_instance_usage_method) (struct device *,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
293 struct scrollbar_instance *,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
294 struct overhead_stats *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
295 #endif
1318
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 1204
diff changeset
296 /* Paint the window's deadbox, a rectangle between window
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 1204
diff changeset
297 borders and two short edges of both scrollbars. */
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 1204
diff changeset
298 void (*redisplay_deadbox_method) (struct window *w, int x, int y, int width,
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 1204
diff changeset
299 int height);
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
300 #endif /* HAVE_SCROLLBARS */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
301
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
302 #ifdef HAVE_MENUBARS
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
303 /* menubar methods */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
304 void (*update_frame_menubars_method) (struct frame *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
305 void (*free_frame_menubars_method) (struct frame *);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
306 #endif
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
307
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
308 #ifdef HAVE_DIALOGS
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
309 /* dialog methods */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
310 Lisp_Object (*make_dialog_box_internal_method) (struct frame *,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
311 Lisp_Object type,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
312 Lisp_Object keys);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
313 #endif
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
314 };
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
315
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
316 #define CONMETH_TYPE(meths) ((meths)->symbol)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
317 #define CONMETH_IMPL_FLAG(meths, f) ((meths)->flags & (f))
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
318
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
319 #define CONSOLE_TYPE_NAME(c) ((c)->conmeths->name)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
320 #define CONSOLE_TYPE(c) ((c)->conmeths->symbol)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
321 #define CONSOLE_IMPL_FLAG(c, f) CONMETH_IMPL_FLAG ((c)->conmeths, (f))
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
322
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
323 /******** Accessing / calling a console method *********/
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
324
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
325 #define HAS_CONTYPE_METH_P(meth, m) ((meth)->m##_method)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
326 #define CONTYPE_METH(meth, m, args) (((meth)->m##_method) args)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
327
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
328 /* Call a void-returning console method, if it exists */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
329 #define MAYBE_CONTYPE_METH(meth, m, args) do { \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
330 struct console_methods *maybe_contype_meth_meth = (meth); \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
331 if (HAS_CONTYPE_METH_P (maybe_contype_meth_meth, m)) \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
332 CONTYPE_METH (maybe_contype_meth_meth, m, args); \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
333 } while (0)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
334
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
335 /* Call a console method, if it exists; otherwise return
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
336 the specified value - meth is multiply evaluated. */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
337 #define CONTYPE_METH_OR_GIVEN(meth, m, args, given) \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
338 (HAS_CONTYPE_METH_P (meth, m) ? \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
339 CONTYPE_METH (meth, m, args) : (given))
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
340
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
341 /* Call an int-returning console method, if it exists; otherwise
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
342 return 0 */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
343 #define MAYBE_INT_CONTYPE_METH(meth, m, args) \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
344 CONTYPE_METH_OR_GIVEN (meth, m, args, 0)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
345
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
346 /* Call an Lisp-Object-returning console method, if it exists;
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
347 otherwise return Qnil */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
348 #define MAYBE_LISP_CONTYPE_METH(meth, m, args) \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
349 CONTYPE_METH_OR_GIVEN (meth, m, args, Qnil)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
350
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
351 /******** Same functions, operating on a console instead of a
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
352 struct console_methods ********/
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
353
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
354 #define HAS_CONMETH_P(c, m) HAS_CONTYPE_METH_P ((c)->conmeths, m)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
355 #define CONMETH(c, m, args) CONTYPE_METH ((c)->conmeths, m, args)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
356 #define MAYBE_CONMETH(c, m, args) MAYBE_CONTYPE_METH ((c)->conmeths, m, args)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
357 #define CONMETH_OR_GIVEN(c, m, args, given) \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
358 CONTYPE_METH_OR_GIVEN((c)->conmeths, m, args, given)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
359 #define MAYBE_INT_CONMETH(c, m, args) \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
360 MAYBE_INT_CONTYPE_METH ((c)->conmeths, m, args)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
361 #define MAYBE_LISP_CONMETH(c, m, args) \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
362 MAYBE_LISP_CONTYPE_METH ((c)->conmeths, m, args)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
363
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
364 /******** Defining new console types ********/
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
365
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
366 typedef struct console_type_entry console_type_entry;
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
367 struct console_type_entry
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
368 {
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
369 Lisp_Object symbol;
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
370 struct console_methods *meths;
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
371 };
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
372
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
373 #define DECLARE_CONSOLE_TYPE(type) \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
374 extern struct console_methods * type##_console_methods
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
375
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
376 #define DEFINE_CONSOLE_TYPE(type) \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
377 struct console_methods * type##_console_methods
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
378
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
379 #define INITIALIZE_CONSOLE_TYPE(type, obj_name, pred_sym) do { \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
380 type##_console_methods = xnew_and_zero (struct console_methods); \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
381 type##_console_methods->name = obj_name; \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
382 type##_console_methods->symbol = Q##type; \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
383 defsymbol_nodump (&type##_console_methods->predicate_symbol, pred_sym); \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
384 add_entry_to_console_type_list (Q##type, type##_console_methods); \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
385 type##_console_methods->image_conversion_list = Qnil; \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
386 staticpro_nodump (&type##_console_methods->image_conversion_list); \
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 1701
diff changeset
387 dump_add_root_block_ptr (&type##_console_methods, &console_methods_description); \
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
388 } while (0)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
389
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
390 #define REINITIALIZE_CONSOLE_TYPE(type) do { \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
391 staticpro_nodump (&type##_console_methods->predicate_symbol); \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
392 staticpro_nodump (&type##_console_methods->image_conversion_list); \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
393 } while (0)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
394
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
395
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
396 /* Declare that console-type TYPE has method M; used in
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
397 initialization routines */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
398 #define CONSOLE_HAS_METHOD(type, m) \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
399 (type##_console_methods->m##_method = type##_##m)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
400
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
401 /* Declare that console-type TYPE inherits method M
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
402 implementation from console-type FROMTYPE */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
403 #define CONSOLE_INHERITS_METHOD(type, fromtype, m) \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
404 (type##_console_methods->m##_method = fromtype##_##m)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
405
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
406 /* Define console type implementation flags */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
407 #define CONSOLE_IMPLEMENTATION_FLAGS(type, flg) \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
408 (type##_console_methods->flags = flg)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
409
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
410 struct console
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
411 {
5127
a9c41067dd88 more cleanups, terminology clarification, lots of doc work
Ben Wing <ben@xemacs.org>
parents: 5125
diff changeset
412 NORMAL_LISP_OBJECT_HEADER header;
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
413
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
414 /* Description of this console's methods. */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
415 struct console_methods *conmeths;
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
416
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 934
diff changeset
417 /* Enumerated constant listing which type of console this is (TTY, X,
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 934
diff changeset
418 MS-Windows, etc.). This duplicates the symbol in conmeths->symbol,
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 934
diff changeset
419 which formerly was the only way to determine the console type.
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 934
diff changeset
420 We need this constant now for KKCC, so that it can be used in
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 934
diff changeset
421 an XD_UNION clause to determine the Lisp objects in console_data. */
934
c925bacdda60 [xemacs-hg @ 2002-07-29 09:21:12 by michaels]
michaels
parents: 905
diff changeset
422 enum console_variant contype;
c925bacdda60 [xemacs-hg @ 2002-07-29 09:21:12 by michaels]
michaels
parents: 905
diff changeset
423
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
424 /* A structure of auxiliary data specific to the console type.
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
425 struct x_console is used for X window frames; defined in console-x.h
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
426 struct tty_console is used to TTY's; defined in console-tty.h */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
427 void *console_data;
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
428
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
429 /* ----- begin partially-completed console localization of
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
430 event loop ---- */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
431
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
432 int local_var_flags;
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
433
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 934
diff changeset
434 #define MARKED_SLOT(x) Lisp_Object x;
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
435 #include "conslots.h"
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
436
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
437 /* Where to store the next keystroke of the macro.
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
438 Index into con->kbd_macro_builder. */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
439 int kbd_macro_ptr;
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
440
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
441 /* The finalized section of the macro starts at kbd_macro_buffer and
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
442 ends before this. This is not the same as kbd_macro_pointer, because
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
443 we advance this to kbd_macro_pointer when a key's command is complete.
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
444 This way, the keystrokes for "end-kbd-macro" are not included in the
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
445 macro. */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
446 int kbd_macro_end;
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
447
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
448 /* ----- end partially-completed console localization of event loop ---- */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
449
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
450 unsigned int input_enabled :1;
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
451 };
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
452
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
453 /* Redefine basic properties more efficiently */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
454
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
455 #undef CONSOLE_LIVE_P
5124
623d57b7fbe8 separate regular and disksave finalization, print method fixes.
Ben Wing <ben@xemacs.org>
parents: 5120
diff changeset
456 /* 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
457 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
458 debug_print() */
623d57b7fbe8 separate regular and disksave finalization, print method fixes.
Ben Wing <ben@xemacs.org>
parents: 5120
diff changeset
459 /* #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
460 #define CONSOLE_LIVE_P(con) ((con)->contype != dead_console)
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
461 #undef CONSOLE_DEVICE_LIST
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
462 #define CONSOLE_DEVICE_LIST(con) ((con)->device_list)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
463
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
464 #define CONSOLE_TYPE_P(con, type) EQ (CONSOLE_TYPE (con), Q##type)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
465
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
466 #ifdef ERROR_CHECK_TYPES
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
467 DECLARE_INLINE_HEADER (
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
468 struct console *
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
469 error_check_console_type (struct console *con, Lisp_Object sym)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
470 )
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
471 {
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
472 assert (EQ (CONSOLE_TYPE (con), sym));
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
473 return con;
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
474 }
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
475 # define CONSOLE_TYPE_DATA(con, type) \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
476 (*(struct type##_console **) \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
477 &(error_check_console_type (con, Q##type))->console_data)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
478 #else
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
479 # define CONSOLE_TYPE_DATA(con, type) \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
480 (*(struct type##_console **) &((con)->console_data))
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
481 #endif
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
482
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
483 #define CHECK_CONSOLE_TYPE(x, type) do { \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
484 CHECK_CONSOLE (x); \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
485 if (! CONSOLE_TYPE_P (XCONSOLE (x), type)) \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
486 dead_wrong_type_argument \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
487 (type##_console_methods->predicate_symbol, x); \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
488 } while (0)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
489 #define CONCHECK_CONSOLE_TYPE(x, type) do { \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
490 CONCHECK_CONSOLE (x); \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
491 if (!(CONSOLEP (x) && \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
492 CONSOLE_TYPE_P (XCONSOLE (x), type))) \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
493 x = wrong_type_argument \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
494 (type##_console_methods->predicate_symbol, x); \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
495 } while (0)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
496
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
497 /* #### These should be in the console-*.h files but there are
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
498 too many places where the abstraction is broken. Need to
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
499 fix. */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
500
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
501 #ifdef HAVE_GTK
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
502 #define CONSOLE_TYPESYM_GTK_P(typesym) EQ (typesym, Qgtk)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
503 #else
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
504 #define CONSOLE_TYPESYM_GTK_P(typesym) 0
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
505 #endif
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
506
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
507 #ifdef HAVE_X_WINDOWS
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
508 #define CONSOLE_TYPESYM_X_P(typesym) EQ (typesym, Qx)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
509 #else
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
510 #define CONSOLE_TYPESYM_X_P(typesym) 0
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
511 #endif
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
512 #ifdef HAVE_TTY
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
513 #define CONSOLE_TYPESYM_TTY_P(typesym) EQ (typesym, Qtty)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
514 #else
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
515 #define CONSOLE_TYPESYM_TTY_P(typesym) 0
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
516 #endif
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
517 #ifdef HAVE_MS_WINDOWS
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
518 #define CONSOLE_TYPESYM_MSWINDOWS_P(typesym) EQ (typesym, Qmswindows)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
519 #else
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
520 #define CONSOLE_TYPESYM_MSWINDOWS_P(typesym) 0
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
521 #endif
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
522 #define CONSOLE_TYPESYM_STREAM_P(typesym) EQ (typesym, Qstream)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
523
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
524 #define CONSOLE_TYPESYM_WIN_P(typesym) \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
525 (CONSOLE_TYPESYM_GTK_P (typesym) || CONSOLE_TYPESYM_X_P (typesym) || CONSOLE_TYPESYM_MSWINDOWS_P (typesym))
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
526
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
527 #define CONSOLE_X_P(con) CONSOLE_TYPESYM_X_P (CONSOLE_TYPE (con))
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
528 #define CHECK_X_CONSOLE(z) CHECK_CONSOLE_TYPE (z, x)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
529 #define CONCHECK_X_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, x)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
530
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
531 #define CONSOLE_GTK_P(con) CONSOLE_TYPESYM_GTK_P (CONSOLE_TYPE (con))
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
532 #define CHECK_GTK_CONSOLE(z) CHECK_CONSOLE_TYPE (z, gtk)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
533 #define CONCHECK_GTK_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, gtk)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
534
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
535 #define CONSOLE_TTY_P(con) CONSOLE_TYPESYM_TTY_P (CONSOLE_TYPE (con))
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
536 #define CHECK_TTY_CONSOLE(z) CHECK_CONSOLE_TYPE (z, tty)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
537 #define CONCHECK_TTY_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, tty)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
538
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
539 #define CONSOLE_MSWINDOWS_P(con) CONSOLE_TYPESYM_MSWINDOWS_P (CONSOLE_TYPE (con))
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
540 #define CHECK_MSWINDOWS_CONSOLE(z) CHECK_CONSOLE_TYPE (z, mswindows)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
541 #define CONCHECK_MSWINDOWS_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, mswindows)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
542
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
543 #define CONSOLE_STREAM_P(con) CONSOLE_TYPESYM_STREAM_P (CONSOLE_TYPE (con))
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
544 #define CHECK_STREAM_CONSOLE(z) CHECK_CONSOLE_TYPE (z, stream)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
545 #define CONCHECK_STREAM_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, stream)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
546
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
547 #define CONSOLE_WIN_P(con) CONSOLE_TYPESYM_WIN_P (CONSOLE_TYPE (con))
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
548
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
549 /* This structure marks which slots in a console have corresponding
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
550 default values in console_defaults.
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
551 Each such slot has a nonzero value in this structure.
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
552 The value has only one nonzero bit.
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
553
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
554 When a console has its own local value for a slot,
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
555 the bit for that slot (found in the same slot in this structure)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
556 is turned on in the console's local_var_flags slot.
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
557
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
558 If a slot in this structure is zero, then even though there may
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
559 be a DEFVAR_CONSOLE_LOCAL for the slot, there is no default value for it;
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
560 and the corresponding slot in console_defaults is not used. */
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
561
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
562 extern struct console console_local_flags;
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
563
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
564 #define CONSOLE_NAME(con) ((con)->name)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
565 #define CONSOLE_CONNECTION(con) ((con)->connection)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
566 #define CONSOLE_CANON_CONNECTION(con) ((con)->canon_connection)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
567 #define CONSOLE_FUNCTION_KEY_MAP(con) ((con)->function_key_map)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
568 #define CONSOLE_SELECTED_DEVICE(con) ((con)->selected_device)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
569 #define CONSOLE_SELECTED_FRAME(con) \
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
570 DEVICE_SELECTED_FRAME (XDEVICE ((con)->selected_device))
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
571 #define CONSOLE_LAST_NONMINIBUF_FRAME(con) NON_LVALUE ((con)->last_nonminibuf_frame)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
572 #define CONSOLE_QUIT_CHAR(con) ((con)->quit_char)
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 934
diff changeset
573 #define CONSOLE_QUIT_EVENT(con) ((con)->quit_event)
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 934
diff changeset
574 #define CONSOLE_CRITICAL_QUIT_EVENT(con) ((con)->critical_quit_event)
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
575
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
576 DECLARE_CONSOLE_TYPE (dead);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
577
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
578 extern console_type_entry_dynarr *the_console_type_entry_dynarr;
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
579
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents:
diff changeset
580 #endif /* INCLUDED_console_impl_h_ */