0
|
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);
|
2
|
108 void (*set_title_from_bufbyte_method) (struct frame *f, Bufbyte *title);
|
|
109 void (*set_icon_name_from_bufbyte_method) (struct frame *f, Bufbyte *title);
|
0
|
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 */
|
102
|
217 int (*inhibit_scrollbar_slider_size_change_method) (void);
|
0
|
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
|
185
|
307 typedef struct console_type_entry console_type_entry;
|
0
|
308 struct console_type_entry
|
|
309 {
|
|
310 Lisp_Object symbol;
|
|
311 struct console_methods *meths;
|
|
312 };
|
|
313
|
185
|
314 #define DECLARE_CONSOLE_TYPE(type) \
|
0
|
315 extern struct console_methods * type##_console_methods
|
|
316
|
185
|
317 #define DEFINE_CONSOLE_TYPE(type) \
|
0
|
318 struct console_methods * type##_console_methods
|
|
319
|
185
|
320 #define INITIALIZE_CONSOLE_TYPE(type, obj_name, pred_sym) do { \
|
|
321 type##_console_methods = xnew_and_zero (struct console_methods); \
|
|
322 type##_console_methods->name = obj_name; \
|
|
323 type##_console_methods->symbol = Q##type; \
|
|
324 defsymbol (&type##_console_methods->predicate_symbol, pred_sym); \
|
|
325 add_entry_to_console_type_list (Q##type, type##_console_methods); \
|
|
326 type##_console_methods->image_conversion_list = Qnil; \
|
|
327 staticpro (&type##_console_methods->image_conversion_list); \
|
|
328 } while (0)
|
0
|
329
|
|
330 /* Declare that console-type TYPE has method M; used in
|
|
331 initialization routines */
|
|
332 #define CONSOLE_HAS_METHOD(type, m) \
|
|
333 (type##_console_methods->m##_method = type##_##m)
|
|
334
|
|
335 struct console
|
|
336 {
|
|
337 struct lcrecord_header header;
|
|
338
|
|
339 /* Description of this console's methods. */
|
|
340 struct console_methods *conmeths;
|
|
341
|
|
342 /* A structure of auxiliary data specific to the console type.
|
|
343 struct x_console is used for X window frames; defined in console-x.h
|
|
344 struct tty_console is used to TTY's; defined in console-tty.h */
|
|
345 void *console_data;
|
|
346
|
|
347 /* Character that causes a quit. Normally C-g.
|
|
348 #### Should be possible for this not to be ASCII. */
|
|
349 int quit_char;
|
|
350
|
|
351 /* ----- begin partially-completed console localization of
|
|
352 event loop ---- */
|
|
353
|
|
354 int local_var_flags;
|
|
355
|
|
356 #define MARKED_SLOT(x) Lisp_Object x
|
|
357 #include "conslots.h"
|
|
358 #undef MARKED_SLOT
|
|
359
|
|
360 /* Where to store the next keystroke of the macro.
|
|
361 Index into con->kbd_macro_builder. */
|
|
362 int kbd_macro_ptr;
|
|
363
|
|
364 /* The finalized section of the macro starts at kbd_macro_buffer and
|
|
365 ends before this. This is not the same as kbd_macro_pointer, because
|
|
366 we advance this to kbd_macro_pointer when a key's command is complete.
|
|
367 This way, the keystrokes for "end-kbd-macro" are not included in the
|
|
368 macro. */
|
|
369 int kbd_macro_end;
|
|
370
|
|
371 /* ----- end partially-completed console localization of event loop ---- */
|
|
372
|
|
373 unsigned int input_enabled :1;
|
|
374 };
|
|
375
|
|
376 DECLARE_LRECORD (console, struct console);
|
|
377 #define XCONSOLE(x) XRECORD (x, console, struct console)
|
|
378 #define XSETCONSOLE(x, p) XSETRECORD (x, p, console)
|
|
379 #define CONSOLEP(x) RECORDP (x, console)
|
|
380 #define GC_CONSOLEP(x) GC_RECORDP (x, console)
|
|
381 #define CHECK_CONSOLE(x) CHECK_RECORD (x, console)
|
|
382 #define CONCHECK_CONSOLE(x) CONCHECK_RECORD (x, console)
|
|
383
|
|
384 #define CHECK_LIVE_CONSOLE(x) \
|
|
385 do { CHECK_CONSOLE (x); \
|
|
386 if (! CONSOLEP (x) \
|
|
387 || ! CONSOLE_LIVE_P (XCONSOLE (x))) \
|
|
388 dead_wrong_type_argument (Qconsole_live_p, (x)); } while (0)
|
|
389 #define CONCHECK_LIVE_CONSOLE(x) \
|
|
390 do { CONCHECK_CONSOLE (x); \
|
|
391 if (! CONSOLEP (x) \
|
|
392 || ! CONSOLE_LIVE_P (XCONSOLE (x))) \
|
|
393 x = wrong_type_argument (Qconsole_live_p, (x)); } while (0)
|
|
394
|
|
395 #define CONSOLE_TYPE_P(con, type) EQ (CONSOLE_TYPE (con), Q##type)
|
|
396
|
|
397 #ifdef ERROR_CHECK_TYPECHECK
|
|
398 MAC_DECLARE_EXTERN (struct console *, MTconsole_data)
|
|
399 # define CONSOLE_TYPE_DATA(con, type) \
|
|
400 MAC_BEGIN \
|
|
401 MAC_DECLARE (struct console *, MTconsole_data, con) \
|
|
402 assert (CONSOLE_TYPE_P (MTconsole_data, type)) \
|
|
403 MAC_SEP \
|
|
404 (struct type##_console *) MTconsole_data->console_data \
|
|
405 MAC_END
|
|
406 #else
|
|
407 # define CONSOLE_TYPE_DATA(con, type) \
|
|
408 ((struct type##_console *) (con)->console_data)
|
|
409 #endif
|
|
410
|
|
411 #define CHECK_CONSOLE_TYPE(x, type) \
|
|
412 do { \
|
|
413 CHECK_CONSOLE (x); \
|
|
414 if (!(CONSOLEP (x) && CONSOLE_TYPE_P (XCONSOLE (x), \
|
|
415 type))) \
|
|
416 dead_wrong_type_argument \
|
|
417 (type##_console_methods->predicate_symbol, x); \
|
|
418 } while (0)
|
|
419 #define CONCHECK_CONSOLE_TYPE(x, type) \
|
|
420 do { \
|
|
421 CONCHECK_CONSOLE (x); \
|
|
422 if (!(CONSOLEP (x) && CONSOLE_TYPE_P (XCONSOLE (x), \
|
|
423 type))) \
|
|
424 x = wrong_type_argument \
|
|
425 (type##_console_methods->predicate_symbol, x); \
|
|
426 } while (0)
|
|
427
|
|
428 /* #### These should be in the console-*.h files but there are
|
|
429 too many places where the abstraction is broken. Need to
|
|
430 fix. */
|
|
431
|
|
432 #ifdef HAVE_X_WINDOWS
|
|
433 #define CONSOLE_TYPESYM_X_P(typesym) EQ (typesym, Qx)
|
|
434 #else
|
|
435 #define CONSOLE_TYPESYM_X_P(typesym) 0
|
|
436 #endif
|
|
437 #ifdef HAVE_TTY
|
|
438 #define CONSOLE_TYPESYM_TTY_P(typesym) EQ (typesym, Qtty)
|
|
439 #else
|
|
440 #define CONSOLE_TYPESYM_TTY_P(typesym) 0
|
|
441 #endif
|
209
|
442 #ifdef HAVE_W32GUI
|
|
443 #define CONSOLE_TYPESYM_W32_P(typesym) EQ (typesym, Qw32)
|
|
444 #else
|
|
445 #define CONSOLE_TYPESYM_W32_P(typesym) 0
|
|
446 #endif
|
0
|
447 #define CONSOLE_TYPESYM_STREAM_P(typesym) EQ (typesym, Qstream)
|
|
448
|
|
449 #define CONSOLE_TYPESYM_WIN_P(typesym) \
|
120
|
450 (CONSOLE_TYPESYM_X_P (typesym))
|
0
|
451
|
|
452 #define CONSOLE_X_P(con) CONSOLE_TYPESYM_X_P (CONSOLE_TYPE (con))
|
|
453 #define CHECK_X_CONSOLE(z) CHECK_CONSOLE_TYPE (z, x)
|
|
454 #define CONCHECK_X_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, x)
|
|
455
|
|
456 #define CONSOLE_TTY_P(con) CONSOLE_TYPESYM_TTY_P (CONSOLE_TYPE (con))
|
|
457 #define CHECK_TTY_CONSOLE(z) CHECK_CONSOLE_TYPE (z, tty)
|
|
458 #define CONCHECK_TTY_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, tty)
|
|
459
|
209
|
460 #define CONSOLE_W32_P(con) CONSOLE_TYPESYM_W32_P (CONSOLE_TYPE (con))
|
|
461 #define CHECK_W32_CONSOLE(z) CHECK_CONSOLE_TYPE (z, w32)
|
|
462 #define CONCHECK_W32_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, w32)
|
|
463
|
0
|
464 #define CONSOLE_STREAM_P(con) CONSOLE_TYPESYM_STREAM_P (CONSOLE_TYPE (con))
|
|
465 #define CHECK_STREAM_CONSOLE(z) CHECK_CONSOLE_TYPE (z, stream)
|
|
466 #define CONCHECK_STREAM_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, stream)
|
|
467
|
|
468 #define CONSOLE_WIN_P(con) CONSOLE_TYPESYM_WIN_P (CONSOLE_TYPE (con))
|
|
469
|
|
470 extern Lisp_Object Vconsole_list, Vselected_console, Vdefault_console;
|
|
471 extern Lisp_Object Qconsole_live_p;
|
|
472
|
|
473 /* This structure holds the default values of the console-local
|
|
474 variables defined with DEFVAR_CONSOLE_LOCAL, that have special
|
|
475 slots in each console. The default value occupies the same slot
|
|
476 in this structure as an individual console's value occupies in
|
|
477 that console. Setting the default value also goes through the
|
|
478 list of consoles and stores into each console that does not say
|
|
479 it has a local value. */
|
|
480
|
|
481 extern Lisp_Object Vconsole_defaults;
|
|
482
|
|
483 /* This structure marks which slots in a console have corresponding
|
|
484 default values in console_defaults.
|
|
485 Each such slot has a nonzero value in this structure.
|
|
486 The value has only one nonzero bit.
|
|
487
|
|
488 When a console has its own local value for a slot,
|
|
489 the bit for that slot (found in the same slot in this structure)
|
|
490 is turned on in the console's local_var_flags slot.
|
|
491
|
|
492 If a slot in this structure is zero, then even though there may
|
|
493 be a DEFVAR_CONSOLE_LOCAL for the slot, there is no default value for it;
|
|
494 and the corresponding slot in console_defaults is not used. */
|
|
495
|
|
496 extern struct console console_local_flags;
|
|
497
|
|
498 extern Lisp_Object Vconsole_type_list;
|
|
499
|
|
500 extern Lisp_Object Qtty, Qstream, Qdead;
|
|
501 #ifdef HAVE_X_WINDOWS
|
|
502 extern Lisp_Object Qx;
|
|
503 #endif /* HAVE_X_WINDOWS */
|
209
|
504 #ifdef HAVE_W32GUI
|
|
505 extern Lisp_Object Qw32;
|
|
506 #endif /* HAVE_W32GUI */
|
0
|
507
|
|
508 int valid_console_type_p (Lisp_Object type);
|
|
509
|
|
510 #define CONSOLE_LIVE_P(con) (!EQ (CONSOLE_TYPE (con), Qdead))
|
|
511
|
|
512 #define CONSOLE_NAME(con) ((con)->name)
|
|
513 #define CONSOLE_CONNECTION(con) ((con)->connection)
|
|
514 #define CONSOLE_CANON_CONNECTION(con) ((con)->canon_connection)
|
|
515 #define CONSOLE_FUNCTION_KEY_MAP(con) ((con)->function_key_map)
|
|
516 #define CONSOLE_DEVICE_LIST(con) ((con)->device_list)
|
|
517 #define CONSOLE_SELECTED_DEVICE(con) ((con)->selected_device)
|
|
518 #define CONSOLE_SELECTED_FRAME(con) \
|
|
519 DEVICE_SELECTED_FRAME (XDEVICE ((con)->selected_device))
|
|
520 #define CONSOLE_LAST_NONMINIBUF_FRAME(con) NON_LVALUE ((con)->_last_nonminibuf_frame)
|
|
521 #define CONSOLE_QUIT_CHAR(con) ((con)->quit_char)
|
|
522
|
2
|
523 #define CDFW_CONSOLE(obj) \
|
|
524 (WINDOWP (obj) ? WINDOW_CONSOLE (XWINDOW (obj)) \
|
|
525 : (FRAMEP (obj) ? FRAME_CONSOLE (XFRAME (obj)) \
|
|
526 : (DEVICEP (obj) ? DEVICE_CONSOLE (XDEVICE (obj)) \
|
|
527 : (CONSOLEP (obj) ? obj \
|
|
528 : Qnil))))
|
0
|
529
|
|
530 #define CONSOLE_LOOP(concons) LIST_LOOP (concons, Vconsole_list)
|
|
531 #define CONSOLE_DEVICE_LOOP(devcons, con) \
|
|
532 LIST_LOOP (devcons, CONSOLE_DEVICE_LIST (con))
|
|
533
|
|
534 DECLARE_CONSOLE_TYPE (dead);
|
|
535 extern console_type_entry_dynarr *the_console_type_entry_dynarr;
|
|
536
|
|
537 Lisp_Object create_console (Lisp_Object name, Lisp_Object type,
|
|
538 Lisp_Object connection, Lisp_Object props);
|
|
539 void select_console_1 (Lisp_Object);
|
|
540 struct console *decode_console (Lisp_Object);
|
|
541 Lisp_Object make_console (struct console *c);
|
|
542 void add_entry_to_console_type_list (Lisp_Object symbol,
|
|
543 struct console_methods *type);
|
|
544 struct console_methods *decode_console_type (Lisp_Object type,
|
|
545 Error_behavior errb);
|
|
546 void delete_console_internal (struct console *con, int force,
|
|
547 int from_kill_emacs, int from_io_error);
|
|
548 void io_error_delete_console (Lisp_Object console);
|
|
549 void set_console_last_nonminibuf_frame (struct console *con,
|
|
550 Lisp_Object frame);
|
|
551
|
|
552 #endif /* _XEMACS_CONSOLE_H_ */
|