annotate src/console.h @ 102:a145efe76779 r20-1b3

Import from CVS: tag r20-1b3
author cvs
date Mon, 13 Aug 2007 09:15:49 +0200
parents 131b0175ea99
children cca96a509cfe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* Define console object for XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1996 Ben Wing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 /* Synched up with: Not in FSF. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 /* Written by Ben Wing. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 #ifndef _XEMACS_CONSOLE_H_
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 #define _XEMACS_CONSOLE_H_
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 /* Devices and consoles are similar entities. The idea is that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 a console represents a physical keyboard/mouse/other-input-source
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 while a device represents a display where frames appear on.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 In the X world, a console is a "Display" while a device is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 "Screen". Implementationally, it can sometimes get confusing:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 under X, multiple devices on a single console are different
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 "Display" connections to what is in reality the same Display on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 the same server. Because of this, input comes from the device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 and not from the console. This is OK because events are basically
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 always tagged to a particular X window (i.e. frame),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 which exists on only one screen; therefore the event won't be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 reported multiple times even if there are multiple devices on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 the same physical display. This is an implementational detail
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 specific to X consoles (e.g. under NeXTstep or Windows, this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 could be different, and input would come directly from the console).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 struct console_methods
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 CONST char *name; /* Used by print_console, print_device, print_frame */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 Lisp_Object symbol;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 Lisp_Object predicate_symbol;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 /* console methods */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 void (*init_console_method) (struct console *, Lisp_Object props);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 void (*mark_console_method) (struct console *, void (*)(Lisp_Object));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 int (*initially_selected_for_input_method) (struct console *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 void (*delete_console_method) (struct console *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 Lisp_Object (*semi_canonicalize_console_connection_method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (Lisp_Object connection, Error_behavior errb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 Lisp_Object (*semi_canonicalize_device_connection_method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (Lisp_Object connection, Error_behavior errb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 Lisp_Object (*canonicalize_console_connection_method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (Lisp_Object connection, Error_behavior errb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 Lisp_Object (*canonicalize_device_connection_method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (Lisp_Object connection, Error_behavior errb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 Lisp_Object (*device_to_console_connection_method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (Lisp_Object connection, Error_behavior errb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 /* device methods */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 void (*init_device_method) (struct device *, Lisp_Object props);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 void (*finish_init_device_method) (struct device *, Lisp_Object props);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 void (*delete_device_method) (struct device *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 void (*mark_device_method) (struct device *, void (*)(Lisp_Object));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 void (*asynch_device_change_method) (void);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 int (*device_pixel_width_method) (struct device *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 int (*device_pixel_height_method) (struct device *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 int (*device_mm_width_method) (struct device *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 int (*device_mm_height_method) (struct device *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 int (*device_bitplanes_method) (struct device *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 int (*device_color_cells_method) (struct device *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 /* frame methods */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 Lisp_Object *device_specific_frame_props;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 void (*init_frame_1_method) (struct frame *, Lisp_Object properties);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 void (*init_frame_2_method) (struct frame *, Lisp_Object properties);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 void (*init_frame_3_method) (struct frame *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 void (*after_init_frame_method) (struct frame *, int first_on_device,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 int first_on_console);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 void (*mark_frame_method) (struct frame *, void (*)(Lisp_Object));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 void (*delete_frame_method) (struct frame *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 void (*focus_on_frame_method) (struct frame *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 void (*raise_frame_method) (struct frame *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 void (*lower_frame_method) (struct frame *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 int (*get_mouse_position_method) (struct device *d, Lisp_Object *frame,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 int *x, int *y);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 void (*set_mouse_position_method) (struct window *w, int x, int y);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 void (*make_frame_visible_method) (struct frame *f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 void (*make_frame_invisible_method) (struct frame *f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 void (*iconify_frame_method) (struct frame *f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 Lisp_Object (*frame_property_method) (struct frame *f, Lisp_Object prop);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 int (*internal_frame_property_p_method) (struct frame *f,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 Lisp_Object prop);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 Lisp_Object (*frame_properties_method) (struct frame *f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 void (*set_frame_properties_method) (struct frame *f, Lisp_Object plist);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 void (*set_frame_size_method) (struct frame *f, int width, int height);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 void (*set_frame_position_method) (struct frame *f, int xoff, int yoff);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 int (*frame_visible_p_method) (struct frame *f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 int (*frame_totally_visible_p_method) (struct frame *f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 int (*frame_iconified_p_method) (struct frame *f);
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
108 void (*set_title_from_bufbyte_method) (struct frame *f, Bufbyte *title);
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
109 void (*set_icon_name_from_bufbyte_method) (struct frame *f, Bufbyte *title);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 void (*set_frame_pointer_method) (struct frame *f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 void (*set_frame_icon_method) (struct frame *f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 void (*popup_menu_method) (Lisp_Object menu, Lisp_Object event);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 Lisp_Object (*get_frame_parent_method) (struct frame *f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 /* redisplay methods */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 int (*left_margin_width_method) (struct window *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 int (*right_margin_width_method) (struct window *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 int (*text_width_method) (struct face_cachel *cachel,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 CONST Emchar *str, Charcount len);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 void (*output_display_block_method) (struct window *, struct display_line *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 int, int, int, int, int, int, int);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 int (*divider_width_method) (void);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 int (*divider_height_method) (void);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 int (*eol_cursor_width_method) (void);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 void (*output_vertical_divider_method) (struct window *, int);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 void (*clear_to_window_end_method) (struct window *, int, int);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 void (*clear_region_method) (Lisp_Object, face_index, int, int, int, int);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 void (*clear_frame_method) (struct frame *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 void (*output_begin_method) (struct device *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 void (*output_end_method) (struct device *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 int (*flash_method) (struct device *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 void (*ring_bell_method) (struct device *, int volume, int pitch,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 int duration);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 void (*frame_redraw_cursor_method) (struct frame *f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 /* color methods */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 int (*initialize_color_instance_method) (struct Lisp_Color_Instance *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 Lisp_Object name,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 Lisp_Object device,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 Error_behavior errb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 void (*mark_color_instance_method) (struct Lisp_Color_Instance *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 void (*)(Lisp_Object));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 void (*print_color_instance_method) (struct Lisp_Color_Instance *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 Lisp_Object printcharfun,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 int escapeflag);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 void (*finalize_color_instance_method) (struct Lisp_Color_Instance *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 int (*color_instance_equal_method) (struct Lisp_Color_Instance *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 struct Lisp_Color_Instance *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 int depth);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 unsigned long (*color_instance_hash_method) (struct Lisp_Color_Instance *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 int depth);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 Lisp_Object (*color_instance_rgb_components_method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (struct Lisp_Color_Instance *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 int (*valid_color_name_p_method) (struct device *, Lisp_Object color);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 /* font methods */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 int (*initialize_font_instance_method) (struct Lisp_Font_Instance *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 Lisp_Object name,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 Lisp_Object device,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 Error_behavior errb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 void (*mark_font_instance_method) (struct Lisp_Font_Instance *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 void (*)(Lisp_Object));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 void (*print_font_instance_method) (struct Lisp_Font_Instance *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 Lisp_Object printcharfun,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 int escapeflag);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 void (*finalize_font_instance_method) (struct Lisp_Font_Instance *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 Lisp_Object (*font_instance_truename_method) (struct Lisp_Font_Instance *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 Error_behavior errb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 Lisp_Object (*font_instance_properties_method) (struct Lisp_Font_Instance *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 Lisp_Object (*list_fonts_method) (Lisp_Object pattern,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 Lisp_Object device);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 Lisp_Object (*find_charset_font_method) (Lisp_Object device,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 Lisp_Object font,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 Lisp_Object charset);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 int (*font_spec_matches_charset_method) (struct device *d,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 Lisp_Object charset,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 CONST Bufbyte *nonreloc,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 Lisp_Object reloc,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 Bytecount offset,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 Bytecount length);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 /* image methods */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 void (*mark_image_instance_method) (struct Lisp_Image_Instance *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 void (*)(Lisp_Object));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 void (*print_image_instance_method) (struct Lisp_Image_Instance *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 Lisp_Object printcharfun,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 int escapeflag);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 void (*finalize_image_instance_method) (struct Lisp_Image_Instance *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 int (*image_instance_equal_method) (struct Lisp_Image_Instance *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 struct Lisp_Image_Instance *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 int depth);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 unsigned long (*image_instance_hash_method) (struct Lisp_Image_Instance *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 int depth);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 int (*colorize_image_instance_method) (Lisp_Object image_instance,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 Lisp_Object fg, Lisp_Object bg);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 Lisp_Object image_conversion_list;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 #ifdef HAVE_TOOLBARS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 /* toolbar methods */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 void (*toolbar_size_changed_in_frame_method) (struct frame *f,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 enum toolbar_pos pos,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 Lisp_Object oldval);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 void (*toolbar_visible_p_changed_in_frame_method) (struct frame *f,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 enum toolbar_pos pos,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 Lisp_Object oldval);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 void (*output_frame_toolbars_method) (struct frame *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 void (*initialize_frame_toolbars_method) (struct frame *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 void (*free_frame_toolbars_method) (struct frame *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 void (*output_toolbar_button_method) (struct frame *, Lisp_Object);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 void (*redraw_frame_toolbars_method) (struct frame *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 void (*redraw_exposed_toolbars_method) (struct frame *f, int x, int y,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 int width, int height);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 #ifdef HAVE_SCROLLBARS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 /* scrollbar methods */
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
217 int (*inhibit_scrollbar_slider_size_change_method) (void);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 void (*free_scrollbar_instance_method) (struct scrollbar_instance *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 void (*release_scrollbar_instance_method) (struct scrollbar_instance *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 void (*create_scrollbar_instance_method) (struct frame *, int,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 struct scrollbar_instance *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 void (*scrollbar_width_changed_in_frame_method) (Lisp_Object, struct frame *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 Lisp_Object);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 void (*scrollbar_height_changed_in_frame_method) (Lisp_Object,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 struct frame *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 Lisp_Object);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 void (*update_scrollbar_instance_values_method) (struct window *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 struct scrollbar_instance *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 int, int, int, int, int,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 int, int, int, int, int);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 void (*update_scrollbar_instance_status_method) (struct window *, int, int,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 scrollbar_instance *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 void (*scrollbar_pointer_changed_in_window_method) (struct window *w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 #ifdef MEMORY_USAGE_STATS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 int (*compute_scrollbar_instance_usage_method) (struct device *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 struct scrollbar_instance *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 struct overhead_stats *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 #endif /* HAVE_SCROLLBARS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 #ifdef HAVE_MENUBARS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 /* menubar methods */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 void (*update_frame_menubars_method) (struct frame *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 void (*free_frame_menubars_method) (struct frame *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 #ifdef HAVE_DIALOGS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 /* dialog methods */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 #define CONSOLE_TYPE_NAME(c) ((c)->conmeths->name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 #define CONSOLE_TYPE(c) ((c)->conmeths->symbol)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 #define CONMETH_TYPE(meths) ((meths)->symbol)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 /******** Accessing / calling a console method *********/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 #define HAS_CONTYPE_METH_P(meth, m) ((meth)->m##_method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 #define CONTYPE_METH(meth, m, args) (((meth)->m##_method) args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 /* Call a void-returning console method, if it exists */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 #define MAYBE_CONTYPE_METH(meth, m, args) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 do { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 struct console_methods *_maybe_contype_meth_meth = (meth); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 if (HAS_CONTYPE_METH_P (_maybe_contype_meth_meth, m)) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 CONTYPE_METH (_maybe_contype_meth_meth, m, args); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 } while (0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 MAC_DECLARE_EXTERN (struct console_methods *, MTcontype_meth_or_given)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 /* Call a console method, if it exists; otherwise return
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 the specified value */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 #define CONTYPE_METH_OR_GIVEN(meth, m, args, given) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 MAC_BEGIN \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 MAC_DECLARE (struct console_methods *, \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 MTcontype_meth_or_given, meth) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 HAS_CONTYPE_METH_P (MTcontype_meth_or_given, m) ? \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 CONTYPE_METH (MTcontype_meth_or_given, m, args) : (given) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 MAC_END
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 /* Call an int-returning console method, if it exists; otherwise
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 return 0 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 #define MAYBE_INT_CONTYPE_METH(meth, m, args) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 CONTYPE_METH_OR_GIVEN (meth, m, args, 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 /* Call an Lisp-Object-returning console method, if it exists;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 otherwise return Qnil */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 #define MAYBE_LISP_CONTYPE_METH(meth, m, args) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 CONTYPE_METH_OR_GIVEN (meth, m, args, Qnil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 /******** Same functions, operating on a console instead of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 struct console_methods ********/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 #define HAS_CONMETH_P(c, m) HAS_CONTYPE_METH_P ((c)->conmeths, m)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 #define CONMETH(c, m, args) CONTYPE_METH ((c)->conmeths, m, args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 #define MAYBE_CONMETH(c, m, args) MAYBE_CONTYPE_METH ((c)->conmeths, m, args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 #define CONMETH_OR_GIVEN(c, m, args, given) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 CONTYPE_METH_OR_GIVEN((c)->conmeths, m, args, given)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 #define MAYBE_INT_CONMETH(c, m, args) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 MAYBE_INT_CONTYPE_METH ((c)->conmeths, m, args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 #define MAYBE_LISP_CONMETH(c, m, args) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 MAYBE_LISP_CONTYPE_METH ((c)->conmeths, m, args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 /******** Defining new console types ********/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 struct console_type_entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 Lisp_Object symbol;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 struct console_methods *meths;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 #define DECLARE_CONSOLE_TYPE(type) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 extern struct console_methods * type##_console_methods
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 #define DEFINE_CONSOLE_TYPE(type) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 struct console_methods * type##_console_methods
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 #define INITIALIZE_CONSOLE_TYPE(type, obj_name, pred_sym) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 do { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 type##_console_methods = \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 malloc_type_and_zero (struct console_methods); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 type##_console_methods->name = obj_name; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 type##_console_methods->symbol = Q##type; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 defsymbol (&type##_console_methods->predicate_symbol, \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 pred_sym); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 add_entry_to_console_type_list (Q##type, \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 type##_console_methods); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 type##_console_methods->image_conversion_list = Qnil; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 staticpro (&type##_console_methods->image_conversion_list); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 } while (0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 /* Declare that console-type TYPE has method M; used in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 initialization routines */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 #define CONSOLE_HAS_METHOD(type, m) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (type##_console_methods->m##_method = type##_##m)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 struct console
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 struct lcrecord_header header;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 /* Description of this console's methods. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 struct console_methods *conmeths;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 /* A structure of auxiliary data specific to the console type.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 struct x_console is used for X window frames; defined in console-x.h
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 struct tty_console is used to TTY's; defined in console-tty.h */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 void *console_data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 /* Character that causes a quit. Normally C-g.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 #### Should be possible for this not to be ASCII. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 int quit_char;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 /* ----- begin partially-completed console localization of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 event loop ---- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 int local_var_flags;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 #define MARKED_SLOT(x) Lisp_Object x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 #include "conslots.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 #undef MARKED_SLOT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 /* Where to store the next keystroke of the macro.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 Index into con->kbd_macro_builder. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 int kbd_macro_ptr;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 /* The finalized section of the macro starts at kbd_macro_buffer and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 ends before this. This is not the same as kbd_macro_pointer, because
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 we advance this to kbd_macro_pointer when a key's command is complete.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 This way, the keystrokes for "end-kbd-macro" are not included in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 macro. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 int kbd_macro_end;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 /* ----- end partially-completed console localization of event loop ---- */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 unsigned int input_enabled :1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 DECLARE_LRECORD (console, struct console);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 #define XCONSOLE(x) XRECORD (x, console, struct console)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 #define XSETCONSOLE(x, p) XSETRECORD (x, p, console)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 #define CONSOLEP(x) RECORDP (x, console)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 #define GC_CONSOLEP(x) GC_RECORDP (x, console)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 #define CHECK_CONSOLE(x) CHECK_RECORD (x, console)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 #define CONCHECK_CONSOLE(x) CONCHECK_RECORD (x, console)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 #define CHECK_LIVE_CONSOLE(x) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 do { CHECK_CONSOLE (x); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 if (! CONSOLEP (x) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 || ! CONSOLE_LIVE_P (XCONSOLE (x))) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 dead_wrong_type_argument (Qconsole_live_p, (x)); } while (0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 #define CONCHECK_LIVE_CONSOLE(x) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 do { CONCHECK_CONSOLE (x); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 if (! CONSOLEP (x) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 || ! CONSOLE_LIVE_P (XCONSOLE (x))) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 x = wrong_type_argument (Qconsole_live_p, (x)); } while (0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 #define CONSOLE_TYPE_P(con, type) EQ (CONSOLE_TYPE (con), Q##type)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 #ifdef ERROR_CHECK_TYPECHECK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 MAC_DECLARE_EXTERN (struct console *, MTconsole_data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 # define CONSOLE_TYPE_DATA(con, type) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 MAC_BEGIN \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 MAC_DECLARE (struct console *, MTconsole_data, con) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 assert (CONSOLE_TYPE_P (MTconsole_data, type)) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 MAC_SEP \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 (struct type##_console *) MTconsole_data->console_data \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 MAC_END
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 # define CONSOLE_TYPE_DATA(con, type) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 ((struct type##_console *) (con)->console_data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 #define CHECK_CONSOLE_TYPE(x, type) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 do { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 CHECK_CONSOLE (x); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 if (!(CONSOLEP (x) && CONSOLE_TYPE_P (XCONSOLE (x), \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 type))) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 dead_wrong_type_argument \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 (type##_console_methods->predicate_symbol, x); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 } while (0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 #define CONCHECK_CONSOLE_TYPE(x, type) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 do { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 CONCHECK_CONSOLE (x); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 if (!(CONSOLEP (x) && CONSOLE_TYPE_P (XCONSOLE (x), \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 type))) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 x = wrong_type_argument \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 (type##_console_methods->predicate_symbol, x); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 } while (0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 /* #### These should be in the console-*.h files but there are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 too many places where the abstraction is broken. Need to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 fix. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 #ifdef HAVE_X_WINDOWS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 #define CONSOLE_TYPESYM_X_P(typesym) EQ (typesym, Qx)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 #define CONSOLE_TYPESYM_X_P(typesym) 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 #ifdef HAVE_NEXTSTEP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 #define CONSOLE_TYPESYM_NS_P(typesym) EQ (typesym, Qns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 #define CONSOLE_TYPESYM_NS_P(typesym) 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 #ifdef HAVE_TTY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 #define CONSOLE_TYPESYM_TTY_P(typesym) EQ (typesym, Qtty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 #define CONSOLE_TYPESYM_TTY_P(typesym) 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 #define CONSOLE_TYPESYM_STREAM_P(typesym) EQ (typesym, Qstream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 #define CONSOLE_TYPESYM_WIN_P(typesym) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (CONSOLE_TYPESYM_X_P (typesym) || CONSOLE_TYPESYM_NS_P (typesym))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 #define CONSOLE_X_P(con) CONSOLE_TYPESYM_X_P (CONSOLE_TYPE (con))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 #define CHECK_X_CONSOLE(z) CHECK_CONSOLE_TYPE (z, x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 #define CONCHECK_X_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 #define CONSOLE_NS_P(con) CONSOLE_TYPESYM_NS_P (CONSOLE_TYPE (con))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 #define CHECK_NS_CONSOLE(z) CHECK_CONSOLE_TYPE (z, ns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 #define CONCHECK_NS_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, ns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 #define CONSOLE_TTY_P(con) CONSOLE_TYPESYM_TTY_P (CONSOLE_TYPE (con))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 #define CHECK_TTY_CONSOLE(z) CHECK_CONSOLE_TYPE (z, tty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 #define CONCHECK_TTY_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, tty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 #define CONSOLE_STREAM_P(con) CONSOLE_TYPESYM_STREAM_P (CONSOLE_TYPE (con))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 #define CHECK_STREAM_CONSOLE(z) CHECK_CONSOLE_TYPE (z, stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 #define CONCHECK_STREAM_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 #define CONSOLE_WIN_P(con) CONSOLE_TYPESYM_WIN_P (CONSOLE_TYPE (con))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 extern Lisp_Object Vconsole_list, Vselected_console, Vdefault_console;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 extern Lisp_Object Qconsole_live_p;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 /* This structure holds the default values of the console-local
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 variables defined with DEFVAR_CONSOLE_LOCAL, that have special
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 slots in each console. The default value occupies the same slot
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 in this structure as an individual console's value occupies in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 that console. Setting the default value also goes through the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 list of consoles and stores into each console that does not say
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 it has a local value. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 extern Lisp_Object Vconsole_defaults;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 /* This structure marks which slots in a console have corresponding
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 default values in console_defaults.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 Each such slot has a nonzero value in this structure.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 The value has only one nonzero bit.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 When a console has its own local value for a slot,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 the bit for that slot (found in the same slot in this structure)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 is turned on in the console's local_var_flags slot.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 If a slot in this structure is zero, then even though there may
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 be a DEFVAR_CONSOLE_LOCAL for the slot, there is no default value for it;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 and the corresponding slot in console_defaults is not used. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 extern struct console console_local_flags;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 extern Lisp_Object Vconsole_type_list;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 extern Lisp_Object Qtty, Qstream, Qdead;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 #ifdef HAVE_X_WINDOWS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 extern Lisp_Object Qx;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 #endif /* HAVE_X_WINDOWS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 #ifdef HAVE_NEXTSTEP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 extern Lisp_Object Qns;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 #endif /* HAVE_NEXTSTEP */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 int valid_console_type_p (Lisp_Object type);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 #define CONSOLE_LIVE_P(con) (!EQ (CONSOLE_TYPE (con), Qdead))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 #define CONSOLE_NAME(con) ((con)->name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 #define CONSOLE_CONNECTION(con) ((con)->connection)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 #define CONSOLE_CANON_CONNECTION(con) ((con)->canon_connection)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 #define CONSOLE_FUNCTION_KEY_MAP(con) ((con)->function_key_map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 #define CONSOLE_DEVICE_LIST(con) ((con)->device_list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 #define CONSOLE_SELECTED_DEVICE(con) ((con)->selected_device)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 #define CONSOLE_SELECTED_FRAME(con) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 DEVICE_SELECTED_FRAME (XDEVICE ((con)->selected_device))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 #define CONSOLE_LAST_NONMINIBUF_FRAME(con) NON_LVALUE ((con)->_last_nonminibuf_frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 #define CONSOLE_QUIT_CHAR(con) ((con)->quit_char)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
526 #define CDFW_CONSOLE(obj) \
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
527 (WINDOWP (obj) ? WINDOW_CONSOLE (XWINDOW (obj)) \
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
528 : (FRAMEP (obj) ? FRAME_CONSOLE (XFRAME (obj)) \
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
529 : (DEVICEP (obj) ? DEVICE_CONSOLE (XDEVICE (obj)) \
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
530 : (CONSOLEP (obj) ? obj \
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
531 : Qnil))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 #define CONSOLE_LOOP(concons) LIST_LOOP (concons, Vconsole_list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 #define CONSOLE_DEVICE_LOOP(devcons, con) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 LIST_LOOP (devcons, CONSOLE_DEVICE_LIST (con))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 DECLARE_CONSOLE_TYPE (dead);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 extern console_type_entry_dynarr *the_console_type_entry_dynarr;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 Lisp_Object create_console (Lisp_Object name, Lisp_Object type,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 Lisp_Object connection, Lisp_Object props);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 void select_console_1 (Lisp_Object);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 struct console *decode_console (Lisp_Object);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 Lisp_Object make_console (struct console *c);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 void add_entry_to_console_type_list (Lisp_Object symbol,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 struct console_methods *type);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 struct console_methods *decode_console_type (Lisp_Object type,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 Error_behavior errb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 void delete_console_internal (struct console *con, int force,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 int from_kill_emacs, int from_io_error);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 void io_error_delete_console (Lisp_Object console);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 void set_console_last_nonminibuf_frame (struct console *con,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 Lisp_Object frame);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 #endif /* _XEMACS_CONSOLE_H_ */