diff options
| author | Kim F. Storm | 2003-03-21 13:49:19 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2003-03-21 13:49:19 +0000 |
| commit | d74b2553d9423c3e1fc3d070a5e88299cb39fef5 (patch) | |
| tree | e3221836f7fa515558b9eb8fd480f71c19ab1be1 /src | |
| parent | 2091fe046919d751ada0ff7a2061d78e2f4e29e5 (diff) | |
| download | emacs-d74b2553d9423c3e1fc3d070a5e88299cb39fef5.tar.gz emacs-d74b2553d9423c3e1fc3d070a5e88299cb39fef5.zip | |
* dispextern.h (Display_Info): Generic typedef for *_display_info.
(NativeRectangle): Generic typedef for rectangle type.
(enum window_part): Move here from window.c.
(struct redisplay_interface): New members flush_display_optional,
define_frame_cursor, clear_frame_area, draw_window_cursor,
draw_vertical_window_border, shift_glyphs_for_insert.
Rename member clear_mouse_face to clear_window_mouse_face.
(estimate_mode_line_height_hook): Remove hook.
(auto_raise_tool_bar_buttons_p): Don't declare extern.
(tool_bar_item_info): Remove prototype.
(help_echo_string, help_echo_window, help_echo_object)
(previous_help_echo_string, help_echo_pos)
(last_mouse_frame, last_tool_bar_item, mouse_autoselect_window):
(x_stretch_cursor_p, output_cursor): Declare extern.
(x_draw_glyphs, notice_overwritten_cursor): Remove prototypes.
(x_write_glyphs), x_insert_glyphs, x_clear_end_of_line)
(x_fix_overlapping_area, draw_phys_cursor_glyph, erase_phys_cursor)
(display_and_set_cursor, set_output_cursor, x_cursor_to)
(x_update_cursor, x_clear_cursor, x_draw_vertical_border)
(frame_to_window_pixel_xy, get_glyph_string_clip_rect)
(note_mouse_highlight, x_clear_window_mouse_face, cancel_mouse_face)
(handle_tool_bar_click, clear_mouse_face, show_mouse_face)
(cursor_in_mouse_face_p, expose_frame, x_intersect_rectangles):
Add prototypes.
(mode_line_string, marginal_area_string): Fix prototypes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispextern.h | 201 |
1 files changed, 146 insertions, 55 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index 00bb2ca0950..ad42527fdc0 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -48,14 +48,22 @@ typedef struct { | |||
| 48 | #include "msdos.h" | 48 | #include "msdos.h" |
| 49 | #endif | 49 | #endif |
| 50 | 50 | ||
| 51 | #ifdef HAVE_X_WINDOWS | ||
| 52 | typedef struct x_display_info Display_Info; | ||
| 53 | #define NativeRectangle XRectangle | ||
| 54 | #endif | ||
| 55 | |||
| 51 | #ifdef HAVE_NTGUI | 56 | #ifdef HAVE_NTGUI |
| 52 | #include "w32gui.h" | 57 | #include "w32gui.h" |
| 58 | typedef struct w32_display_info Display_Info; | ||
| 53 | #endif | 59 | #endif |
| 54 | 60 | ||
| 55 | #ifdef MAC_OS | 61 | #ifdef MAC_OS |
| 56 | #include "macgui.h" | 62 | #include "macgui.h" |
| 63 | typedef struct mac_display_info Display_Info; | ||
| 57 | #endif | 64 | #endif |
| 58 | 65 | ||
| 66 | |||
| 59 | /* Structure forward declarations. Some are here because function | 67 | /* Structure forward declarations. Some are here because function |
| 60 | prototypes below reference structure types before their definition | 68 | prototypes below reference structure types before their definition |
| 61 | in this file. Some are here because not every file including | 69 | in this file. Some are here because not every file including |
| @@ -69,6 +77,22 @@ struct frame; | |||
| 69 | struct window; | 77 | struct window; |
| 70 | 78 | ||
| 71 | 79 | ||
| 80 | /* Values returned from coordinates_in_window. */ | ||
| 81 | |||
| 82 | enum window_part | ||
| 83 | { | ||
| 84 | ON_NOTHING, | ||
| 85 | ON_TEXT, | ||
| 86 | ON_MODE_LINE, | ||
| 87 | ON_VERTICAL_BORDER, | ||
| 88 | ON_HEADER_LINE, | ||
| 89 | ON_LEFT_FRINGE, | ||
| 90 | ON_RIGHT_FRINGE, | ||
| 91 | ON_LEFT_MARGIN, | ||
| 92 | ON_RIGHT_MARGIN | ||
| 93 | }; | ||
| 94 | |||
| 95 | |||
| 72 | 96 | ||
| 73 | /*********************************************************************** | 97 | /*********************************************************************** |
| 74 | Debugging | 98 | Debugging |
| @@ -921,7 +945,7 @@ extern struct glyph_row scratch_glyph_row; | |||
| 921 | ************************************************************************/ | 945 | ************************************************************************/ |
| 922 | 946 | ||
| 923 | /* Enumeration for overriding/changing the face to use for drawing | 947 | /* Enumeration for overriding/changing the face to use for drawing |
| 924 | glyphs in x_draw_glyphs. */ | 948 | glyphs in draw_glyphs. */ |
| 925 | 949 | ||
| 926 | enum draw_glyphs_face | 950 | enum draw_glyphs_face |
| 927 | { | 951 | { |
| @@ -1309,6 +1333,41 @@ struct glyph_string | |||
| 1309 | && !NILP (XBUFFER ((W)->buffer)->header_line_format) \ | 1333 | && !NILP (XBUFFER ((W)->buffer)->header_line_format) \ |
| 1310 | && XFASTINT ((W)->height) > 1 + !NILP (XBUFFER ((W)->buffer)->mode_line_format)) | 1334 | && XFASTINT ((W)->height) > 1 + !NILP (XBUFFER ((W)->buffer)->mode_line_format)) |
| 1311 | 1335 | ||
| 1336 | |||
| 1337 | /* Return proper value to be used as baseline offset of font that has | ||
| 1338 | ASCENT and DESCENT to draw characters by the font at the vertical | ||
| 1339 | center of the line of frame F. | ||
| 1340 | |||
| 1341 | Here, our task is to find the value of BOFF in the following figure; | ||
| 1342 | |||
| 1343 | -------------------------+-----------+- | ||
| 1344 | -+-+---------+-+ | | | ||
| 1345 | | | | | | | | ||
| 1346 | | | | | F_ASCENT F_HEIGHT | ||
| 1347 | | | | ASCENT | | | ||
| 1348 | HEIGHT | | | | | | ||
| 1349 | | | |-|-+------+-----------|------- baseline | ||
| 1350 | | | | | BOFF | | | ||
| 1351 | | |---------|-+-+ | | | ||
| 1352 | | | | DESCENT | | | ||
| 1353 | -+-+---------+-+ F_DESCENT | | ||
| 1354 | -------------------------+-----------+- | ||
| 1355 | |||
| 1356 | -BOFF + DESCENT + (F_HEIGHT - HEIGHT) / 2 = F_DESCENT | ||
| 1357 | BOFF = DESCENT + (F_HEIGHT - HEIGHT) / 2 - F_DESCENT | ||
| 1358 | DESCENT = FONT->descent | ||
| 1359 | HEIGHT = FONT_HEIGHT (FONT) | ||
| 1360 | F_DESCENT = (F->output_data.x->font->descent | ||
| 1361 | - F->output_data.x->baseline_offset) | ||
| 1362 | F_HEIGHT = FRAME_LINE_HEIGHT (F) | ||
| 1363 | */ | ||
| 1364 | |||
| 1365 | #define VCENTER_BASELINE_OFFSET(FONT, F) \ | ||
| 1366 | (FONT_DESCENT (FONT) \ | ||
| 1367 | + (FRAME_LINE_HEIGHT ((F)) - FONT_HEIGHT ((FONT)) \ | ||
| 1368 | + (FRAME_LINE_HEIGHT ((F)) > FONT_HEIGHT ((FONT)))) / 2 \ | ||
| 1369 | - (FONT_DESCENT (FRAME_FONT (F)) - FRAME_BASELINE_OFFSET (F))) | ||
| 1370 | |||
| 1312 | 1371 | ||
| 1313 | /*********************************************************************** | 1372 | /*********************************************************************** |
| 1314 | Faces | 1373 | Faces |
| @@ -2149,8 +2208,13 @@ struct redisplay_interface | |||
| 2149 | /* Flush the display of frame F. For X, this is XFlush. */ | 2208 | /* Flush the display of frame F. For X, this is XFlush. */ |
| 2150 | void (*flush_display) P_ ((struct frame *f)); | 2209 | void (*flush_display) P_ ((struct frame *f)); |
| 2151 | 2210 | ||
| 2211 | /* Flush the display of frame F if non-NULL. This is called | ||
| 2212 | during redisplay, and should be NULL on systems which flushes | ||
| 2213 | automatically before reading input. */ | ||
| 2214 | void (*flush_display_optional) P_ ((struct frame *f)); | ||
| 2215 | |||
| 2152 | /* Clear the mouse hightlight in window W, if there is any. */ | 2216 | /* Clear the mouse hightlight in window W, if there is any. */ |
| 2153 | void (*clear_mouse_face) P_ ((struct window *w)); | 2217 | void (*clear_window_mouse_face) P_ ((struct window *w)); |
| 2154 | 2218 | ||
| 2155 | /* Set *LEFT and *RIGHT to the left and right overhang of GLYPH on | 2219 | /* Set *LEFT and *RIGHT to the left and right overhang of GLYPH on |
| 2156 | frame F. */ | 2220 | frame F. */ |
| @@ -2187,52 +2251,38 @@ struct redisplay_interface | |||
| 2187 | /* Draw a glyph string S. */ | 2251 | /* Draw a glyph string S. */ |
| 2188 | void (*draw_glyph_string) P_ ((struct glyph_string *s)); | 2252 | void (*draw_glyph_string) P_ ((struct glyph_string *s)); |
| 2189 | 2253 | ||
| 2190 | #endif /* HAVE_WINDOW_SYSTEM */ | 2254 | /* Define cursor CURSOR on frame F. */ |
| 2191 | }; | 2255 | void (*define_frame_cursor) P_ ((struct frame *f, Cursor cursor)); |
| 2192 | 2256 | ||
| 2193 | /* The current interface for window-based redisplay. */ | 2257 | /* Clear the area at (X,Y,WIDTH,HEIGHT) of frame F. */ |
| 2194 | 2258 | void (*clear_frame_area) P_ ((struct frame *f, int x, int y, | |
| 2195 | extern struct redisplay_interface *rif; | 2259 | int width, int height)); |
| 2196 | 2260 | ||
| 2197 | /* Hook to call in estimate_mode_line_height. */ | 2261 | /* Draw specified cursor NEW_CURSOR_TYPE of width NEW_CURSOR_WIDTH |
| 2262 | at row GLYPH_ROW on window W. */ | ||
| 2263 | void (*draw_window_cursor) P_ ((struct window *w, | ||
| 2264 | struct glyph_row *glyph_row, | ||
| 2265 | int on, int x, int y, | ||
| 2266 | int new_cursor_type, | ||
| 2267 | int new_cursor_width)); | ||
| 2198 | 2268 | ||
| 2199 | extern int (* estimate_mode_line_height_hook) P_ ((struct frame *, | 2269 | /* Draw vertical border for window W from (X,Y0) to (X,Y1). */ |
| 2200 | enum face_id)); | 2270 | void (*draw_vertical_window_border) P_ ((struct window *w, |
| 2201 | 2271 | int x, int y0, int y1)); | |
| 2202 | |||
| 2203 | /* Return proper value to be used as baseline offset of font that has | ||
| 2204 | ASCENT and DESCENT to draw characters by the font at the vertical | ||
| 2205 | center of the line of frame F. | ||
| 2206 | 2272 | ||
| 2207 | Here, out task is to find the value of BOFF in the following figure; | 2273 | /* Shift display of frame F to make room for inserted glyphs. |
| 2274 | The area at pixel (X,Y) of width WIDTH and height HEIGHT is | ||
| 2275 | shifted right by SHIFT_BY pixels. */ | ||
| 2276 | void (*shift_glyphs_for_insert) P_ ((struct frame *f, | ||
| 2277 | int x, int y, int width, | ||
| 2278 | int height, int shift_by)); | ||
| 2208 | 2279 | ||
| 2209 | -------------------------+-----------+- | 2280 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 2210 | -+-+---------+-+ | | | 2281 | }; |
| 2211 | | | | | | | | ||
| 2212 | | | | | F_ASCENT F_HEIGHT | ||
| 2213 | | | | ASCENT | | | ||
| 2214 | HEIGHT | | | | | | ||
| 2215 | | | |-|-+------+-----------|------- baseline | ||
| 2216 | | | | | BOFF | | | ||
| 2217 | | |---------|-+-+ | | | ||
| 2218 | | | | DESCENT | | | ||
| 2219 | -+-+---------+-+ F_DESCENT | | ||
| 2220 | -------------------------+-----------+- | ||
| 2221 | 2282 | ||
| 2222 | -BOFF + DESCENT + (F_HEIGHT - HEIGHT) / 2 = F_DESCENT | 2283 | /* The current interface for window-based redisplay. */ |
| 2223 | BOFF = DESCENT + (F_HEIGHT - HEIGHT) / 2 - F_DESCENT | ||
| 2224 | DESCENT = FONT->descent | ||
| 2225 | HEIGHT = FONT_HEIGHT (FONT) | ||
| 2226 | F_DESCENT = (F->output_data.x->font->descent | ||
| 2227 | - F->output_data.x->baseline_offset) | ||
| 2228 | F_HEIGHT = FRAME_LINE_HEIGHT (F) | ||
| 2229 | */ | ||
| 2230 | 2284 | ||
| 2231 | #define VCENTER_BASELINE_OFFSET(FONT, F) \ | 2285 | extern struct redisplay_interface *rif; |
| 2232 | (FONT_DESCENT (FONT) \ | ||
| 2233 | + (FRAME_LINE_HEIGHT ((F)) - FONT_HEIGHT ((FONT)) \ | ||
| 2234 | + (FRAME_LINE_HEIGHT ((F)) > FONT_HEIGHT ((FONT)))) / 2 \ | ||
| 2235 | - (FONT_DESCENT (FRAME_FONT (F)) - FRAME_BASELINE_OFFSET (F))) | ||
| 2236 | 2286 | ||
| 2237 | 2287 | ||
| 2238 | /*********************************************************************** | 2288 | /*********************************************************************** |
| @@ -2446,10 +2496,6 @@ enum tool_bar_item_image | |||
| 2446 | TOOL_BAR_IMAGE_DISABLED_DESELECTED | 2496 | TOOL_BAR_IMAGE_DISABLED_DESELECTED |
| 2447 | }; | 2497 | }; |
| 2448 | 2498 | ||
| 2449 | /* Non-zero means raise tool-bar buttons when the mouse moves over them. */ | ||
| 2450 | |||
| 2451 | extern int auto_raise_tool_bar_buttons_p; | ||
| 2452 | |||
| 2453 | /* Margin around tool-bar buttons in pixels. */ | 2499 | /* Margin around tool-bar buttons in pixels. */ |
| 2454 | 2500 | ||
| 2455 | extern Lisp_Object Vtool_bar_button_margin; | 2501 | extern Lisp_Object Vtool_bar_button_margin; |
| @@ -2507,6 +2553,7 @@ int window_box_width P_ ((struct window *, int)); | |||
| 2507 | int window_box_left P_ ((struct window *, int)); | 2553 | int window_box_left P_ ((struct window *, int)); |
| 2508 | int window_box_right P_ ((struct window *, int)); | 2554 | int window_box_right P_ ((struct window *, int)); |
| 2509 | void window_box_edges P_ ((struct window *, int, int *, int *, int *, int *)); | 2555 | void window_box_edges P_ ((struct window *, int, int *, int *, int *, int *)); |
| 2556 | int estimate_mode_line_height P_ ((struct frame *, enum face_id)); | ||
| 2510 | void mark_window_display_accurate P_ ((Lisp_Object, int)); | 2557 | void mark_window_display_accurate P_ ((Lisp_Object, int)); |
| 2511 | void redisplay_preserve_echo_area P_ ((int)); | 2558 | void redisplay_preserve_echo_area P_ ((int)); |
| 2512 | void set_cursor_from_row P_ ((struct window *, struct glyph_row *, | 2559 | void set_cursor_from_row P_ ((struct window *, struct glyph_row *, |
| @@ -2528,7 +2575,6 @@ void move_it_past_eol P_ ((struct it *)); | |||
| 2528 | int in_display_vector_p P_ ((struct it *)); | 2575 | int in_display_vector_p P_ ((struct it *)); |
| 2529 | int frame_mode_line_height P_ ((struct frame *)); | 2576 | int frame_mode_line_height P_ ((struct frame *)); |
| 2530 | void highlight_trailing_whitespace P_ ((struct frame *, struct glyph_row *)); | 2577 | void highlight_trailing_whitespace P_ ((struct frame *, struct glyph_row *)); |
| 2531 | int tool_bar_item_info P_ ((struct frame *, struct glyph *, int *)); | ||
| 2532 | void draw_row_fringe_bitmaps P_ ((struct window *, struct glyph_row *)); | 2578 | void draw_row_fringe_bitmaps P_ ((struct window *, struct glyph_row *)); |
| 2533 | void compute_fringe_widths P_ ((struct frame *, int)); | 2579 | void compute_fringe_widths P_ ((struct frame *, int)); |
| 2534 | extern Lisp_Object Qtool_bar; | 2580 | extern Lisp_Object Qtool_bar; |
| @@ -2539,6 +2585,14 @@ extern Lisp_Object Vimage_types; | |||
| 2539 | extern void add_to_log P_ ((char *, Lisp_Object, Lisp_Object)); | 2585 | extern void add_to_log P_ ((char *, Lisp_Object, Lisp_Object)); |
| 2540 | extern int help_echo_showing_p; | 2586 | extern int help_echo_showing_p; |
| 2541 | extern int current_mode_line_height, current_header_line_height; | 2587 | extern int current_mode_line_height, current_header_line_height; |
| 2588 | extern Lisp_Object help_echo_string, help_echo_window; | ||
| 2589 | extern Lisp_Object help_echo_object, previous_help_echo_string; | ||
| 2590 | extern int help_echo_pos; | ||
| 2591 | extern struct frame *last_mouse_frame; | ||
| 2592 | extern int last_tool_bar_item; | ||
| 2593 | extern int mouse_autoselect_window; | ||
| 2594 | |||
| 2595 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 2542 | 2596 | ||
| 2543 | #if GLYPH_DEBUG | 2597 | #if GLYPH_DEBUG |
| 2544 | extern void dump_glyph_string P_ ((struct glyph_string *)); | 2598 | extern void dump_glyph_string P_ ((struct glyph_string *)); |
| @@ -2547,13 +2601,49 @@ extern void dump_glyph_string P_ ((struct glyph_string *)); | |||
| 2547 | extern void x_get_glyph_overhangs P_ ((struct glyph *, struct frame *, | 2601 | extern void x_get_glyph_overhangs P_ ((struct glyph *, struct frame *, |
| 2548 | int *, int *)); | 2602 | int *, int *)); |
| 2549 | extern void x_produce_glyphs P_ ((struct it *)); | 2603 | extern void x_produce_glyphs P_ ((struct it *)); |
| 2550 | extern int x_draw_glyphs P_ ((struct window *, int , struct glyph_row *, | ||
| 2551 | enum glyph_row_area, int, int, | ||
| 2552 | enum draw_glyphs_face, int)); | ||
| 2553 | 2604 | ||
| 2554 | extern void notice_overwritten_cursor P_ ((struct window *, | 2605 | extern void x_write_glyphs P_ ((struct glyph *, int)); |
| 2555 | enum glyph_row_area, | 2606 | extern void x_insert_glyphs P_ ((struct glyph *, int len)); |
| 2556 | int, int, int, int)); | 2607 | extern void x_clear_end_of_line P_ ((int)); |
| 2608 | |||
| 2609 | extern int x_stretch_cursor_p; | ||
| 2610 | extern struct cursor_pos output_cursor; | ||
| 2611 | |||
| 2612 | extern void x_fix_overlapping_area P_ ((struct window *, struct glyph_row *, | ||
| 2613 | enum glyph_row_area)); | ||
| 2614 | extern void draw_phys_cursor_glyph P_ ((struct window *, | ||
| 2615 | struct glyph_row *, | ||
| 2616 | enum draw_glyphs_face)); | ||
| 2617 | extern void erase_phys_cursor P_ ((struct window *)); | ||
| 2618 | extern void display_and_set_cursor P_ ((struct window *, | ||
| 2619 | int, int, int, int, int)); | ||
| 2620 | |||
| 2621 | extern void set_output_cursor P_ ((struct cursor_pos *)); | ||
| 2622 | extern void x_cursor_to P_ ((int, int, int, int)); | ||
| 2623 | |||
| 2624 | extern void x_update_cursor P_ ((struct frame *, int)); | ||
| 2625 | extern void x_clear_cursor P_ ((struct window *)); | ||
| 2626 | extern void x_draw_vertical_border P_ ((struct window *w)); | ||
| 2627 | |||
| 2628 | extern void frame_to_window_pixel_xy P_ ((struct window *, int *, int *)); | ||
| 2629 | extern void get_glyph_string_clip_rect P_ ((struct glyph_string *, | ||
| 2630 | NativeRectangle *nr)); | ||
| 2631 | extern void note_mouse_highlight P_ ((struct frame *, int, int)); | ||
| 2632 | extern void x_clear_window_mouse_face P_ ((struct window *)); | ||
| 2633 | extern void cancel_mouse_face P_ ((struct frame *)); | ||
| 2634 | |||
| 2635 | extern void handle_tool_bar_click P_ ((struct frame *, | ||
| 2636 | int, int, int, unsigned int)); | ||
| 2637 | |||
| 2638 | /* msdos.c defines its own versions of these functions. */ | ||
| 2639 | extern int clear_mouse_face P_ ((Display_Info *)); | ||
| 2640 | extern void show_mouse_face P_ ((Display_Info *, enum draw_glyphs_face)); | ||
| 2641 | extern int cursor_in_mouse_face_p P_ ((struct window *w)); | ||
| 2642 | |||
| 2643 | extern void expose_frame P_ ((struct frame *, int, int, int, int)); | ||
| 2644 | extern int x_intersect_rectangles P_ ((XRectangle *, XRectangle *, | ||
| 2645 | XRectangle *)); | ||
| 2646 | #endif | ||
| 2557 | 2647 | ||
| 2558 | /* Defined in sysdep.c */ | 2648 | /* Defined in sysdep.c */ |
| 2559 | 2649 | ||
| @@ -2667,9 +2757,10 @@ int popup_activated P_ ((void)); | |||
| 2667 | extern int inverse_video; | 2757 | extern int inverse_video; |
| 2668 | extern int required_matrix_width P_ ((struct window *)); | 2758 | extern int required_matrix_width P_ ((struct window *)); |
| 2669 | extern int required_matrix_height P_ ((struct window *)); | 2759 | extern int required_matrix_height P_ ((struct window *)); |
| 2670 | extern int estimate_mode_line_height P_ ((struct frame *, enum face_id)); | 2760 | extern Lisp_Object mode_line_string P_ ((struct window *, int, int, |
| 2671 | extern Lisp_Object mode_line_string P_ ((struct window *, int, int, int, int *)); | 2761 | enum window_part, int *)); |
| 2672 | extern Lisp_Object marginal_area_string P_ ((struct window *, int, int, int, int *)); | 2762 | extern Lisp_Object marginal_area_string P_ ((struct window *, int, int, |
| 2763 | enum window_part, int *)); | ||
| 2673 | extern void redraw_frame P_ ((struct frame *)); | 2764 | extern void redraw_frame P_ ((struct frame *)); |
| 2674 | extern void redraw_garbaged_frames P_ ((void)); | 2765 | extern void redraw_garbaged_frames P_ ((void)); |
| 2675 | extern void cancel_line P_ ((int, struct frame *)); | 2766 | extern void cancel_line P_ ((int, struct frame *)); |