comparison src/redisplay.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
143 } chr; 143 } chr;
144 144
145 /* HLINE */ 145 /* HLINE */
146 struct 146 struct
147 { 147 {
148 int thickness; /* how thick to make hline */ 148 short thickness; /* how thick to make hline */
149 int yoffset; /* how far down from top of line to put top */ 149 short yoffset; /* how far down from top of line to put top */
150 } hline; 150 } hline;
151 } object; /* actual rune object */ 151 } object; /* actual rune object */
152 }; 152 };
153 153
154 typedef struct 154 typedef struct
271 pixels below the baseline. 271 pixels below the baseline.
272 The descent includes the baseline 272 The descent includes the baseline
273 pixel-row itself, I think. */ 273 pixel-row itself, I think. */
274 unsigned short clip; /* amount of bottom of line to clip 274 unsigned short clip; /* amount of bottom of line to clip
275 in pixels.*/ 275 in pixels.*/
276 unsigned short top_clip; /* amount of top of line to clip
277 in pixels.*/
276 Bufpos bufpos; /* first buffer position on line */ 278 Bufpos bufpos; /* first buffer position on line */
277 Bufpos end_bufpos; /* last buffer position on line */ 279 Bufpos end_bufpos; /* last buffer position on line */
278 Charcount offset; /* adjustment to bufpos vals */ 280 Charcount offset; /* adjustment to bufpos vals */
279 Charcount num_chars; /* # of chars on line 281 Charcount num_chars; /* # of chars on line
280 including expansion of tabs 282 including expansion of tabs
299 face_index right_margin_findex; 301 face_index right_margin_findex;
300 face_index default_findex; 302 face_index default_findex;
301 }; 303 };
302 304
303 #define DISPLAY_LINE_HEIGHT(dl) \ 305 #define DISPLAY_LINE_HEIGHT(dl) \
304 (dl->ascent + dl->descent - dl->clip) 306 (dl->ascent + dl->descent - (dl->clip + dl->top_clip))
305 #define DISPLAY_LINE_YPOS(dl) \ 307 #define DISPLAY_LINE_YPOS(dl) \
306 (dl->ypos - dl->ascent) 308 (dl->ypos - (dl->ascent - dl->top_clip))
309 #define DISPLAY_LINE_YEND(dl) \
310 ((dl->ypos + dl->descent) - dl->clip)
307 311
308 typedef struct 312 typedef struct
309 { 313 {
310 Dynarr_declare (display_line); 314 Dynarr_declare (display_line);
311 } display_line_dynarr; 315 } display_line_dynarr;
316
317 /* The following two structures are used to represent an area to
318 displayed and where to display it. Using these two structures all
319 combinations of clipping and position can be accommodated. */
320
321 /* This represents an area to be displayed into. */
322 typedef struct display_box display_box;
323 struct display_box
324 {
325 int xpos; /* absolute horizontal position of area */
326 int ypos; /* absolute vertical position of area */
327 int width, height;
328 };
329
330 /* This represents the area from a glyph to be displayed. */
331 typedef struct display_glyph_area display_glyph_area;
332 struct display_glyph_area
333 {
334 int xoffset; /* horizontal offset of the glyph, +ve means
335 display the glyph with x offset by xoffset,
336 -ve means display starting xoffset into the
337 glyph. */
338 int yoffset; /* vertical offset of the glyph, +ve means
339 display the glyph with y offset by yoffset,
340 -ve means display starting xoffset into the
341 glyph. */
342 int width, height; /* width and height of glyph to display. */
343 };
312 344
313 /* It could be argued that the following two structs belong in 345 /* It could be argued that the following two structs belong in
314 extents.h, but they're only used by redisplay and it simplifies 346 extents.h, but they're only used by redisplay and it simplifies
315 the header files to put them here. */ 347 the header files to put them here. */
316 348
343 unsigned int invisible_ellipses:1; 375 unsigned int invisible_ellipses:1;
344 unsigned int previously_invisible:1; 376 unsigned int previously_invisible:1;
345 unsigned int invisible_ellipses_already_displayed:1; 377 unsigned int invisible_ellipses_already_displayed:1;
346 }; 378 };
347 379
380 #define EDGE_TOP 1
381 #define EDGE_LEFT 2
382 #define EDGE_BOTTOM 4
383 #define EDGE_RIGHT 8
384 #define EDGE_ALL (EDGE_TOP | EDGE_LEFT | EDGE_BOTTOM | EDGE_RIGHT)
385
348 386
349 /*************************************************************************/ 387 /*************************************************************************/
350 /* change flags */ 388 /* change flags */
351 /*************************************************************************/ 389 /*************************************************************************/
352 390
387 425
388 /* True if any displayed subwindow is in need of updating 426 /* True if any displayed subwindow is in need of updating
389 somewhere. */ 427 somewhere. */
390 extern int subwindows_changed; 428 extern int subwindows_changed;
391 extern int subwindows_changed_set; 429 extern int subwindows_changed_set;
430
431 /* True if any displayed subwindow is in need of updating
432 somewhere. */
433 extern int subwindows_state_changed;
434 extern int subwindows_state_changed_set;
392 435
393 /* True if an icon is in need of updating somewhere. */ 436 /* True if an icon is in need of updating somewhere. */
394 extern int icon_changed; 437 extern int icon_changed;
395 extern int icon_changed_set; 438 extern int icon_changed_set;
396 439
461 #define MARK_POINT_CHANGED MARK_TYPE_CHANGED (point) 504 #define MARK_POINT_CHANGED MARK_TYPE_CHANGED (point)
462 #define MARK_TOOLBAR_CHANGED MARK_TYPE_CHANGED (toolbar) 505 #define MARK_TOOLBAR_CHANGED MARK_TYPE_CHANGED (toolbar)
463 #define MARK_GUTTER_CHANGED MARK_TYPE_CHANGED (gutter) 506 #define MARK_GUTTER_CHANGED MARK_TYPE_CHANGED (gutter)
464 #define MARK_GLYPHS_CHANGED MARK_TYPE_CHANGED (glyphs) 507 #define MARK_GLYPHS_CHANGED MARK_TYPE_CHANGED (glyphs)
465 #define MARK_SUBWINDOWS_CHANGED MARK_TYPE_CHANGED (subwindows) 508 #define MARK_SUBWINDOWS_CHANGED MARK_TYPE_CHANGED (subwindows)
509 #define MARK_SUBWINDOWS_STATE_CHANGED MARK_TYPE_CHANGED (subwindows_state)
510
511
512 #define CLASS_RESET_CHANGED_FLAGS(p) do { \
513 (p)->buffers_changed = 0; \
514 (p)->clip_changed = 0; \
515 (p)->extents_changed = 0; \
516 (p)->faces_changed = 0; \
517 (p)->frame_changed = 0; \
518 (p)->icon_changed = 0; \
519 (p)->menubar_changed = 0; \
520 (p)->modeline_changed = 0; \
521 (p)->point_changed = 0; \
522 (p)->toolbar_changed = 0; \
523 (p)->gutter_changed = 0; \
524 (p)->glyphs_changed = 0; \
525 (p)->subwindows_changed = 0; \
526 (p)->subwindows_state_changed = 0; \
527 (p)->windows_changed = 0; \
528 (p)->windows_structure_changed = 0; \
529 } while (0)
530
531 #define GLOBAL_RESET_CHANGED_FLAGS do { \
532 buffers_changed = 0; \
533 clip_changed = 0; \
534 extents_changed = 0; \
535 faces_changed = 0; \
536 frame_changed = 0; \
537 icon_changed = 0; \
538 menubar_changed = 0; \
539 modeline_changed = 0; \
540 point_changed = 0; \
541 toolbar_changed = 0; \
542 gutter_changed = 0; \
543 glyphs_changed = 0; \
544 subwindows_changed = 0; \
545 subwindows_state_changed = 0; \
546 windows_changed = 0; \
547 windows_structure_changed = 0; \
548 } while (0)
549
550 #define CLASS_REDISPLAY_FLAGS_CHANGEDP(p) \
551 ( (p)->buffers_changed || \
552 (p)->clip_changed || \
553 (p)->extents_changed || \
554 (p)->faces_changed || \
555 (p)->frame_changed || \
556 (p)->icon_changed || \
557 (p)->menubar_changed || \
558 (p)->modeline_changed || \
559 (p)->point_changed || \
560 (p)->toolbar_changed || \
561 (p)->gutter_changed || \
562 (p)->glyphs_changed || \
563 (p)->subwindows_changed || \
564 (p)->subwindows_state_changed || \
565 (p)->windows_changed || \
566 (p)->windows_structure_changed )
567
568 #define GLOBAL_REDISPLAY_FLAGS_CHANGEDP \
569 ( buffers_changed || \
570 clip_changed || \
571 extents_changed || \
572 faces_changed || \
573 frame_changed || \
574 icon_changed || \
575 menubar_changed || \
576 modeline_changed || \
577 point_changed || \
578 toolbar_changed || \
579 gutter_changed || \
580 glyphs_changed || \
581 subwindows_changed || \
582 subwindows_state_changed || \
583 windows_changed || \
584 windows_structure_changed )
585
466 586
467 /* Anytime a console, device or frame is added or deleted we need to reset 587 /* Anytime a console, device or frame is added or deleted we need to reset
468 these flags. */ 588 these flags. */
469 #define RESET_CHANGED_SET_FLAGS \ 589 #define RESET_CHANGED_SET_FLAGS do { \
470 do { \ 590 buffers_changed_set = 0; \
471 buffers_changed_set = 0; \ 591 clip_changed_set = 0; \
472 clip_changed_set = 0; \ 592 extents_changed_set = 0; \
473 extents_changed_set = 0; \ 593 icon_changed_set = 0; \
474 icon_changed_set = 0; \ 594 menubar_changed_set = 0; \
475 menubar_changed_set = 0; \ 595 modeline_changed_set = 0; \
476 modeline_changed_set = 0; \ 596 point_changed_set = 0; \
477 point_changed_set = 0; \ 597 toolbar_changed_set = 0; \
478 toolbar_changed_set = 0; \ 598 gutter_changed_set = 0; \
479 gutter_changed_set = 0; \ 599 glyphs_changed_set = 0; \
480 glyphs_changed_set = 0; \ 600 subwindows_changed_set = 0; \
481 subwindows_changed_set = 0; \ 601 subwindows_state_changed_set = 0; \
482 } while (0) 602 } while (0)
483 603
484 604
485 /*************************************************************************/ 605 /*************************************************************************/
486 /* redisplay global variables */ 606 /* redisplay global variables */
487 /*************************************************************************/ 607 /*************************************************************************/
553 Bufpos point); 673 Bufpos point);
554 int line_at_center (struct window *w, int type, Bufpos start, Bufpos point); 674 int line_at_center (struct window *w, int type, Bufpos start, Bufpos point);
555 int window_half_pixpos (struct window *w); 675 int window_half_pixpos (struct window *w);
556 void redisplay_echo_area (void); 676 void redisplay_echo_area (void);
557 void free_display_structs (struct window_mirror *mir); 677 void free_display_structs (struct window_mirror *mir);
678 void free_display_lines (display_line_dynarr *dla);
558 Bufbyte *generate_formatted_string (struct window *w, Lisp_Object format_str, 679 Bufbyte *generate_formatted_string (struct window *w, Lisp_Object format_str,
559 Lisp_Object result_str, face_index findex, 680 Lisp_Object result_str, face_index findex,
560 int type); 681 int type);
561 void generate_displayable_area (struct window *w, Lisp_Object disp_string, 682 void generate_displayable_area (struct window *w, Lisp_Object disp_string,
562 int xpos, int ypos, int width, int height, 683 int xpos, int ypos, int width, int height,
569 struct window **w, Bufpos *bufpos, 690 struct window **w, Bufpos *bufpos,
570 Bufpos *closest, Charcount *modeline_closest, 691 Bufpos *closest, Charcount *modeline_closest,
571 Lisp_Object *obj1, Lisp_Object *obj2); 692 Lisp_Object *obj1, Lisp_Object *obj2);
572 void glyph_to_pixel_translation (struct window *w, int char_x, 693 void glyph_to_pixel_translation (struct window *w, int char_x,
573 int char_y, int *pix_x, int *pix_y); 694 int char_y, int *pix_x, int *pix_y);
574 void mark_redisplay (void (*) (Lisp_Object)); 695 void mark_redisplay (void);
575 int point_in_line_start_cache (struct window *w, Bufpos point, 696 int point_in_line_start_cache (struct window *w, Bufpos point,
576 int min_past); 697 int min_past);
577 int point_would_be_visible (struct window *w, Bufpos startp, 698 int point_would_be_visible (struct window *w, Bufpos startp,
578 Bufpos point); 699 Bufpos point);
579 Bufpos start_of_last_line (struct window *w, Bufpos startp); 700 Bufpos start_of_last_line (struct window *w, Bufpos startp);
597 718
598 /* defined in redisplay-output.c */ 719 /* defined in redisplay-output.c */
599 int get_next_display_block (layout_bounds bounds, 720 int get_next_display_block (layout_bounds bounds,
600 display_block_dynarr *dba, int start_pos, 721 display_block_dynarr *dba, int start_pos,
601 int *next_start); 722 int *next_start);
602 void redisplay_output_subwindow (struct window *w, struct display_line *dl, 723 void redisplay_output_layout (struct window *w,
603 Lisp_Object image_instance, int xpos, 724 Lisp_Object image_instance,
604 int xoffset, int start_pixpos, int width, 725 struct display_box* db, struct display_glyph_area* dga,
605 face_index findex, int cursor_start, 726 face_index findex, int cursor_start, int cursor_width,
606 int cursor_width, int cursor_height); 727 int cursor_height);
728 void redisplay_output_subwindow (struct window *w,
729 Lisp_Object image_instance,
730 struct display_box* db, struct display_glyph_area* dga,
731 face_index findex, int cursor_start, int cursor_width,
732 int cursor_height);
607 void redisplay_unmap_subwindows_maybe (struct frame* f, int x, int y, int width, int height); 733 void redisplay_unmap_subwindows_maybe (struct frame* f, int x, int y, int width, int height);
734 void redisplay_output_pixmap (struct window *w,
735 Lisp_Object image_instance,
736 struct display_box* db, struct display_glyph_area* dga,
737 face_index findex, int cursor_start, int cursor_width,
738 int cursor_height, int offset_bitmap);
739 int redisplay_calculate_display_boxes (struct display_line *dl, int xpos,
740 int xoffset, int start_pixpos, int width,
741 struct display_box* dest,
742 struct display_glyph_area* src);
743 int redisplay_normalize_glyph_area (struct display_box* dest,
744 struct display_glyph_area* glyphsrc);
608 void redisplay_clear_to_window_end (struct window *w, int ypos1, int ypos2); 745 void redisplay_clear_to_window_end (struct window *w, int ypos1, int ypos2);
609 void redisplay_clear_region (Lisp_Object window, face_index findex, int x, 746 void redisplay_clear_region (Lisp_Object window, face_index findex, int x,
610 int y, int width, int height); 747 int y, int width, int height);
611 void redisplay_clear_bottom_of_window (struct window *w, 748 void redisplay_clear_bottom_of_window (struct window *w,
612 display_line_dynarr *ddla, 749 display_line_dynarr *ddla,
613 int min_start, int max_end); 750 int min_start, int max_end);
614 void redisplay_update_line (struct window *w, int first_line, 751 void redisplay_update_line (struct window *w, int first_line,
615 int last_line, int update_values); 752 int last_line, int update_values);
616 void redisplay_output_window (struct window *w); 753 void redisplay_output_window (struct window *w);
754 void bevel_modeline (struct window *w, struct display_line *dl);
617 int redisplay_move_cursor (struct window *w, Bufpos new_point, 755 int redisplay_move_cursor (struct window *w, Bufpos new_point,
618 int no_output_end); 756 int no_output_end);
619 void redisplay_redraw_cursor (struct frame *f, int run_begin_end_meths); 757 void redisplay_redraw_cursor (struct frame *f, int run_begin_end_meths);
620 void output_display_line (struct window *w, display_line_dynarr *cdla, 758 void output_display_line (struct window *w, display_line_dynarr *cdla,
621 display_line_dynarr *ddla, int line, 759 display_line_dynarr *ddla, int line,