comparison src/redisplay.h @ 422:95016f13131a r21-2-19

Import from CVS: tag r21-2-19
author cvs
date Mon, 13 Aug 2007 11:25:01 +0200
parents 697ef44129c6
children 11054d720c21
comparison
equal deleted inserted replaced
421:fff06e11db74 422:95016f13131a
230 230
231 typedef struct 231 typedef struct
232 { 232 {
233 Dynarr_declare (glyph_block); 233 Dynarr_declare (glyph_block);
234 } glyph_block_dynarr; 234 } glyph_block_dynarr;
235
236 /*************************************************************************/
237 /* display lines */
238 /*************************************************************************/
239
240 /* Modeline commentary: IMO the modeline is handled very badly, we
241 special case virtually *everything* in the redisplay routines for
242 the modeline. The fact that dl->bufpos can be either a buffer
243 position or a char count highlights this. There is no abstraction at
244 all that I can find and it means that the code is made very ugly as
245 a result. Either we should treat the modeline *entirely* separately,
246 or we should abstract to something that applies equally well to the
247 modeline and to buffer text, the things are not enormously different
248 after all and handling them identically at some level would
249 eliminate some bugs that still exist (mainly to do with modeline
250 handling). This problem doesn't help trying to implement gutters
251 which are somewhere in between buffer text and modeline text.
252
253 Redisplay commentary: Everything in redisplay is tied very tightly
254 to the things that are being displayed, and the context,
255 e.g. buffers and windows. According to Chuck this is so that we can
256 get speed, which seems fine to me, however this usage is extended
257 too far down the redispay routines IMO. At some level there should
258 be functions that know how to display strings with extents and
259 faces, regardless of buffer etc. After all the window system does
260 not care. <andy@xemacs.org> */
235 261
236 typedef struct display_line display_line; 262 typedef struct display_line display_line;
237 struct display_line 263 struct display_line
238 { 264 {
239 short ypos; /* vertical position in pixels 265 short ypos; /* vertical position in pixels
266 display_block_dynarr *display_blocks; 292 display_block_dynarr *display_blocks;
267 293
268 /* Dynamic arrays of left and right glyph blocks */ 294 /* Dynamic arrays of left and right glyph blocks */
269 glyph_block_dynarr *left_glyphs; 295 glyph_block_dynarr *left_glyphs;
270 glyph_block_dynarr *right_glyphs; 296 glyph_block_dynarr *right_glyphs;
297
298 face_index left_margin_findex;
299 face_index right_margin_findex;
300 face_index default_findex;
271 }; 301 };
272 302
273 #define DISPLAY_LINE_HEIGHT(dl) \ 303 #define DISPLAY_LINE_HEIGHT(dl) \
274 (dl->ascent + dl->descent - dl->clip) 304 (dl->ascent + dl->descent - dl->clip)
275 #define DISPLAY_LINE_YPOS(dl) \ 305 #define DISPLAY_LINE_YPOS(dl) \
384 extern int asynch_device_change_pending; 414 extern int asynch_device_change_pending;
385 415
386 /* non-nil if any toolbar has changed */ 416 /* non-nil if any toolbar has changed */
387 extern int toolbar_changed; 417 extern int toolbar_changed;
388 extern int toolbar_changed_set; 418 extern int toolbar_changed_set;
419
420 /* non-nil if any gutter has changed */
421 extern int gutter_changed;
422 extern int gutter_changed_set;
389 423
390 /* non-nil if any window has changed since the last time redisplay completed */ 424 /* non-nil if any window has changed since the last time redisplay completed */
391 extern int windows_changed; 425 extern int windows_changed;
392 426
393 /* non-nil if any frame's window structure has changed since the last 427 /* non-nil if any frame's window structure has changed since the last
424 #define MARK_ICON_CHANGED MARK_TYPE_CHANGED (icon) 458 #define MARK_ICON_CHANGED MARK_TYPE_CHANGED (icon)
425 #define MARK_MENUBAR_CHANGED MARK_TYPE_CHANGED (menubar) 459 #define MARK_MENUBAR_CHANGED MARK_TYPE_CHANGED (menubar)
426 #define MARK_MODELINE_CHANGED MARK_TYPE_CHANGED (modeline) 460 #define MARK_MODELINE_CHANGED MARK_TYPE_CHANGED (modeline)
427 #define MARK_POINT_CHANGED MARK_TYPE_CHANGED (point) 461 #define MARK_POINT_CHANGED MARK_TYPE_CHANGED (point)
428 #define MARK_TOOLBAR_CHANGED MARK_TYPE_CHANGED (toolbar) 462 #define MARK_TOOLBAR_CHANGED MARK_TYPE_CHANGED (toolbar)
463 #define MARK_GUTTER_CHANGED MARK_TYPE_CHANGED (gutter)
429 #define MARK_GLYPHS_CHANGED MARK_TYPE_CHANGED (glyphs) 464 #define MARK_GLYPHS_CHANGED MARK_TYPE_CHANGED (glyphs)
430 #define MARK_SUBWINDOWS_CHANGED MARK_TYPE_CHANGED (subwindows) 465 #define MARK_SUBWINDOWS_CHANGED MARK_TYPE_CHANGED (subwindows)
431 466
432 /* Anytime a console, device or frame is added or deleted we need to reset 467 /* Anytime a console, device or frame is added or deleted we need to reset
433 these flags. */ 468 these flags. */
439 icon_changed_set = 0; \ 474 icon_changed_set = 0; \
440 menubar_changed_set = 0; \ 475 menubar_changed_set = 0; \
441 modeline_changed_set = 0; \ 476 modeline_changed_set = 0; \
442 point_changed_set = 0; \ 477 point_changed_set = 0; \
443 toolbar_changed_set = 0; \ 478 toolbar_changed_set = 0; \
479 gutter_changed_set = 0; \
444 glyphs_changed_set = 0; \ 480 glyphs_changed_set = 0; \
445 subwindows_changed_set = 0; \ 481 subwindows_changed_set = 0; \
446 } while (0) 482 } while (0)
447 483
448 484
520 void redisplay_echo_area (void); 556 void redisplay_echo_area (void);
521 void free_display_structs (struct window_mirror *mir); 557 void free_display_structs (struct window_mirror *mir);
522 Bufbyte *generate_formatted_string (struct window *w, Lisp_Object format_str, 558 Bufbyte *generate_formatted_string (struct window *w, Lisp_Object format_str,
523 Lisp_Object result_str, face_index findex, 559 Lisp_Object result_str, face_index findex,
524 int type); 560 int type);
561 void generate_displayable_area (struct window *w, Lisp_Object disp_string,
562 int xpos, int ypos, int width, int height,
563 display_line_dynarr* dl,
564 Bufpos start_pos, face_index default_face);
525 int real_current_modeline_height (struct window *w); 565 int real_current_modeline_height (struct window *w);
526 int pixel_to_glyph_translation (struct frame *f, int x_coord, 566 int pixel_to_glyph_translation (struct frame *f, int x_coord,
527 int y_coord, int *col, int *row, 567 int y_coord, int *col, int *row,
528 int *obj_x, int *obj_y, 568 int *obj_x, int *obj_y,
529 struct window **w, Bufpos *bufpos, 569 struct window **w, Bufpos *bufpos,
563 Lisp_Object image_instance, int xpos, 603 Lisp_Object image_instance, int xpos,
564 int xoffset, int start_pixpos, int width, 604 int xoffset, int start_pixpos, int width,
565 face_index findex, int cursor_start, 605 face_index findex, int cursor_start,
566 int cursor_width, int cursor_height); 606 int cursor_width, int cursor_height);
567 void redisplay_unmap_subwindows_maybe (struct frame* f, int x, int y, int width, int height); 607 void redisplay_unmap_subwindows_maybe (struct frame* f, int x, int y, int width, int height);
608 void redisplay_clear_to_window_end (struct window *w, int ypos1, int ypos2);
568 void redisplay_clear_region (Lisp_Object window, face_index findex, int x, 609 void redisplay_clear_region (Lisp_Object window, face_index findex, int x,
569 int y, int width, int height); 610 int y, int width, int height);
570 void redisplay_clear_bottom_of_window (struct window *w, 611 void redisplay_clear_bottom_of_window (struct window *w,
571 display_line_dynarr *ddla, 612 display_line_dynarr *ddla,
572 int min_start, int max_end); 613 int min_start, int max_end);