comparison src/console.h @ 424:11054d720c21 r21-2-20

Import from CVS: tag r21-2-20
author cvs
date Mon, 13 Aug 2007 11:26:11 +0200
parents 95016f13131a
children
comparison
equal deleted inserted replaced
423:28d9c139be4c 424:11054d720c21
58 DM_size_workspace, DM_size_device_mm, DM_device_dpi, DM_num_bit_planes, 58 DM_size_workspace, DM_size_device_mm, DM_device_dpi, DM_num_bit_planes,
59 DM_num_color_cells, DM_mouse_buttons, DM_swap_buttons, DM_show_sounds, 59 DM_num_color_cells, DM_mouse_buttons, DM_swap_buttons, DM_show_sounds,
60 DM_slow_device, DM_security 60 DM_slow_device, DM_security
61 }; 61 };
62 62
63 extern const struct struct_description cted_description;
64 extern const struct struct_description console_methods_description;
65
63 struct console_methods 66 struct console_methods
64 { 67 {
65 CONST char *name; /* Used by print_console, print_device, print_frame */ 68 CONST char *name; /* Used by print_console, print_device, print_frame */
66 Lisp_Object symbol; 69 Lisp_Object symbol;
67 Lisp_Object predicate_symbol; 70 Lisp_Object predicate_symbol;
68 71
69 /* console methods */ 72 /* console methods */
70 void (*init_console_method) (struct console *, Lisp_Object props); 73 void (*init_console_method) (struct console *, Lisp_Object props);
71 void (*mark_console_method) (struct console *, void (*)(Lisp_Object)); 74 void (*mark_console_method) (struct console *);
72 int (*initially_selected_for_input_method) (struct console *); 75 int (*initially_selected_for_input_method) (struct console *);
73 void (*delete_console_method) (struct console *); 76 void (*delete_console_method) (struct console *);
74 Lisp_Object (*semi_canonicalize_console_connection_method) 77 Lisp_Object (*semi_canonicalize_console_connection_method)
75 (Lisp_Object connection, Error_behavior errb); 78 (Lisp_Object connection, Error_behavior errb);
76 Lisp_Object (*semi_canonicalize_device_connection_method) 79 Lisp_Object (*semi_canonicalize_device_connection_method)
84 87
85 /* device methods */ 88 /* device methods */
86 void (*init_device_method) (struct device *, Lisp_Object props); 89 void (*init_device_method) (struct device *, Lisp_Object props);
87 void (*finish_init_device_method) (struct device *, Lisp_Object props); 90 void (*finish_init_device_method) (struct device *, Lisp_Object props);
88 void (*delete_device_method) (struct device *); 91 void (*delete_device_method) (struct device *);
89 void (*mark_device_method) (struct device *, void (*)(Lisp_Object)); 92 void (*mark_device_method) (struct device *);
90 void (*asynch_device_change_method) (void); 93 void (*asynch_device_change_method) (void);
91 Lisp_Object (*device_system_metrics_method) (struct device *, enum device_metrics); 94 Lisp_Object (*device_system_metrics_method) (struct device *, enum device_metrics);
92 unsigned int (*device_implementation_flags_method) (void); 95 unsigned int (*device_implementation_flags_method) (void);
93 Lisp_Object (*own_selection_method)(Lisp_Object selection_name, Lisp_Object selection_value); 96 Lisp_Object (*own_selection_method)(Lisp_Object selection_name, Lisp_Object selection_value);
94 void (*disown_selection_method)(Lisp_Object selection_name, Lisp_Object timeval); 97 void (*disown_selection_method)(Lisp_Object selection_name, Lisp_Object timeval);
101 void (*init_frame_1_method) (struct frame *, Lisp_Object properties); 104 void (*init_frame_1_method) (struct frame *, Lisp_Object properties);
102 void (*init_frame_2_method) (struct frame *, Lisp_Object properties); 105 void (*init_frame_2_method) (struct frame *, Lisp_Object properties);
103 void (*init_frame_3_method) (struct frame *); 106 void (*init_frame_3_method) (struct frame *);
104 void (*after_init_frame_method) (struct frame *, int first_on_device, 107 void (*after_init_frame_method) (struct frame *, int first_on_device,
105 int first_on_console); 108 int first_on_console);
106 void (*mark_frame_method) (struct frame *, void (*)(Lisp_Object)); 109 void (*mark_frame_method) (struct frame *);
107 void (*delete_frame_method) (struct frame *); 110 void (*delete_frame_method) (struct frame *);
108 void (*focus_on_frame_method) (struct frame *); 111 void (*focus_on_frame_method) (struct frame *);
109 void (*raise_frame_method) (struct frame *); 112 void (*raise_frame_method) (struct frame *);
110 void (*lower_frame_method) (struct frame *); 113 void (*lower_frame_method) (struct frame *);
111 int (*get_mouse_position_method) (struct device *d, Lisp_Object *frame, 114 int (*get_mouse_position_method) (struct device *d, Lisp_Object *frame,
153 int (*flash_method) (struct device *); 156 int (*flash_method) (struct device *);
154 void (*ring_bell_method) (struct device *, int volume, int pitch, 157 void (*ring_bell_method) (struct device *, int volume, int pitch,
155 int duration); 158 int duration);
156 void (*frame_redraw_cursor_method) (struct frame *f); 159 void (*frame_redraw_cursor_method) (struct frame *f);
157 void (*set_final_cursor_coords_method) (struct frame *, int, int); 160 void (*set_final_cursor_coords_method) (struct frame *, int, int);
158 void (*bevel_area_method) (struct window *, face_index, int, int, int, int, int); 161 void (*bevel_area_method) (struct window *, face_index, int, int, int, int, int,
159 162 int, enum edge_style);
163 void (*output_pixmap_method) (struct window *w, Lisp_Object image_instance,
164 struct display_box *db, struct display_glyph_area *dga,
165 face_index findex, int cursor_start, int cursor_width,
166 int cursor_height, int offset_bitmap);
167 void (*output_string_method) (struct window *w, struct display_line *dl,
168 Emchar_dynarr *buf, int xpos, int xoffset,
169 int start_pixpos, int width, face_index findex,
170 int cursor, int cursor_start, int cursor_width,
171 int cursor_height);
160 /* color methods */ 172 /* color methods */
161 int (*initialize_color_instance_method) (struct Lisp_Color_Instance *, 173 int (*initialize_color_instance_method) (struct Lisp_Color_Instance *,
162 Lisp_Object name, 174 Lisp_Object name,
163 Lisp_Object device, 175 Lisp_Object device,
164 Error_behavior errb); 176 Error_behavior errb);
165 void (*mark_color_instance_method) (struct Lisp_Color_Instance *, 177 void (*mark_color_instance_method) (struct Lisp_Color_Instance *);
166 void (*)(Lisp_Object));
167 void (*print_color_instance_method) (struct Lisp_Color_Instance *, 178 void (*print_color_instance_method) (struct Lisp_Color_Instance *,
168 Lisp_Object printcharfun, 179 Lisp_Object printcharfun,
169 int escapeflag); 180 int escapeflag);
170 void (*finalize_color_instance_method) (struct Lisp_Color_Instance *); 181 void (*finalize_color_instance_method) (struct Lisp_Color_Instance *);
171 int (*color_instance_equal_method) (struct Lisp_Color_Instance *, 182 int (*color_instance_equal_method) (struct Lisp_Color_Instance *,
180 /* font methods */ 191 /* font methods */
181 int (*initialize_font_instance_method) (struct Lisp_Font_Instance *, 192 int (*initialize_font_instance_method) (struct Lisp_Font_Instance *,
182 Lisp_Object name, 193 Lisp_Object name,
183 Lisp_Object device, 194 Lisp_Object device,
184 Error_behavior errb); 195 Error_behavior errb);
185 void (*mark_font_instance_method) (struct Lisp_Font_Instance *, 196 void (*mark_font_instance_method) (struct Lisp_Font_Instance *);
186 void (*)(Lisp_Object));
187 void (*print_font_instance_method) (struct Lisp_Font_Instance *, 197 void (*print_font_instance_method) (struct Lisp_Font_Instance *,
188 Lisp_Object printcharfun, 198 Lisp_Object printcharfun,
189 int escapeflag); 199 int escapeflag);
190 void (*finalize_font_instance_method) (struct Lisp_Font_Instance *); 200 void (*finalize_font_instance_method) (struct Lisp_Font_Instance *);
191 Lisp_Object (*font_instance_truename_method) (struct Lisp_Font_Instance *, 201 Lisp_Object (*font_instance_truename_method) (struct Lisp_Font_Instance *,
202 Lisp_Object reloc, 212 Lisp_Object reloc,
203 Bytecount offset, 213 Bytecount offset,
204 Bytecount length); 214 Bytecount length);
205 215
206 /* image methods */ 216 /* image methods */
207 void (*mark_image_instance_method) (struct Lisp_Image_Instance *, 217 void (*mark_image_instance_method) (struct Lisp_Image_Instance *);
208 void (*)(Lisp_Object));
209 void (*print_image_instance_method) (struct Lisp_Image_Instance *, 218 void (*print_image_instance_method) (struct Lisp_Image_Instance *,
210 Lisp_Object printcharfun, 219 Lisp_Object printcharfun,
211 int escapeflag); 220 int escapeflag);
212 void (*finalize_image_instance_method) (struct Lisp_Image_Instance *); 221 void (*finalize_image_instance_method) (struct Lisp_Image_Instance *);
213 void (*unmap_subwindow_method) (struct Lisp_Image_Instance *); 222 void (*unmap_subwindow_method) (struct Lisp_Image_Instance *);
214 void (*map_subwindow_method) (struct Lisp_Image_Instance *, int x, int y); 223 void (*map_subwindow_method) (struct Lisp_Image_Instance *, int x, int y,
224 struct display_glyph_area* dga);
215 void (*resize_subwindow_method) (struct Lisp_Image_Instance *, int w, int h); 225 void (*resize_subwindow_method) (struct Lisp_Image_Instance *, int w, int h);
216 void (*update_subwindow_method) (struct Lisp_Image_Instance *); 226 void (*update_subwindow_method) (struct Lisp_Image_Instance *);
217 int (*image_instance_equal_method) (struct Lisp_Image_Instance *, 227 int (*image_instance_equal_method) (struct Lisp_Image_Instance *,
218 struct Lisp_Image_Instance *, 228 struct Lisp_Image_Instance *,
219 int depth); 229 int depth);
220 unsigned long (*image_instance_hash_method) (struct Lisp_Image_Instance *, 230 unsigned long (*image_instance_hash_method) (struct Lisp_Image_Instance *,
221 int depth); 231 int depth);
222 void (*init_image_instance_from_eimage_method) (struct Lisp_Image_Instance *ii, 232 void (*init_image_instance_from_eimage_method) (struct Lisp_Image_Instance *ii,
223 int width, int height, 233 int width, int height,
234 int slices,
224 unsigned char *eimage, 235 unsigned char *eimage,
225 int dest_mask, 236 int dest_mask,
226 Lisp_Object instantiator, 237 Lisp_Object instantiator,
227 Lisp_Object domain); 238 Lisp_Object domain);
228 Lisp_Object (*locate_pixmap_file_method) (Lisp_Object file_method); 239 Lisp_Object (*locate_pixmap_file_method) (Lisp_Object file_method);
344 355
345 #define INITIALIZE_CONSOLE_TYPE(type, obj_name, pred_sym) do { \ 356 #define INITIALIZE_CONSOLE_TYPE(type, obj_name, pred_sym) do { \
346 type##_console_methods = xnew_and_zero (struct console_methods); \ 357 type##_console_methods = xnew_and_zero (struct console_methods); \
347 type##_console_methods->name = obj_name; \ 358 type##_console_methods->name = obj_name; \
348 type##_console_methods->symbol = Q##type; \ 359 type##_console_methods->symbol = Q##type; \
349 defsymbol (&type##_console_methods->predicate_symbol, pred_sym); \ 360 defsymbol_nodump (&type##_console_methods->predicate_symbol, pred_sym); \
350 add_entry_to_console_type_list (Q##type, type##_console_methods); \ 361 add_entry_to_console_type_list (Q##type, type##_console_methods); \
351 type##_console_methods->image_conversion_list = Qnil; \ 362 type##_console_methods->image_conversion_list = Qnil; \
352 staticpro (&type##_console_methods->image_conversion_list); \ 363 staticpro_nodump (&type##_console_methods->image_conversion_list); \
353 } while (0) 364 dumpstruct (&type##_console_methods, &console_methods_description); \
365 } while (0)
366
367 #define REINITIALIZE_CONSOLE_TYPE(type) do { \
368 staticpro_nodump (&type##_console_methods->predicate_symbol); \
369 staticpro_nodump (&type##_console_methods->image_conversion_list); \
370 } while (0)
371
354 372
355 /* Declare that console-type TYPE has method M; used in 373 /* Declare that console-type TYPE has method M; used in
356 initialization routines */ 374 initialization routines */
357 #define CONSOLE_HAS_METHOD(type, m) \ 375 #define CONSOLE_HAS_METHOD(type, m) \
358 (type##_console_methods->m##_method = type##_##m) 376 (type##_console_methods->m##_method = type##_##m)
400 418
401 DECLARE_LRECORD (console, struct console); 419 DECLARE_LRECORD (console, struct console);
402 #define XCONSOLE(x) XRECORD (x, console, struct console) 420 #define XCONSOLE(x) XRECORD (x, console, struct console)
403 #define XSETCONSOLE(x, p) XSETRECORD (x, p, console) 421 #define XSETCONSOLE(x, p) XSETRECORD (x, p, console)
404 #define CONSOLEP(x) RECORDP (x, console) 422 #define CONSOLEP(x) RECORDP (x, console)
405 #define GC_CONSOLEP(x) GC_RECORDP (x, console)
406 #define CHECK_CONSOLE(x) CHECK_RECORD (x, console) 423 #define CHECK_CONSOLE(x) CHECK_RECORD (x, console)
407 #define CONCHECK_CONSOLE(x) CONCHECK_RECORD (x, console) 424 #define CONCHECK_CONSOLE(x) CONCHECK_RECORD (x, console)
408 425
409 #define CHECK_LIVE_CONSOLE(x) do { \ 426 #define CHECK_LIVE_CONSOLE(x) do { \
410 CHECK_CONSOLE (x); \ 427 CHECK_CONSOLE (x); \