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