diff options
| author | Dmitry Antipov | 2013-08-23 08:03:25 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-08-23 08:03:25 +0400 |
| commit | 9997ec56be8bf3fb32ac246e5b654ed735ee2c52 (patch) | |
| tree | 9005d22fa77dfbf0799c83e094bf510fc877af58 /src | |
| parent | 7f780da621d462afa3c6e0374590a86de513f863 (diff) | |
| download | emacs-9997ec56be8bf3fb32ac246e5b654ed735ee2c52.tar.gz emacs-9997ec56be8bf3fb32ac246e5b654ed735ee2c52.zip | |
Minor cleanup for redisplay interface and few related functions.
* frame.h (enum text_cursor_kinds): Move from here...
* dispextern.h (enum text_cursor_kinds): ...to here.
(toplevel): Drop unnecessary declarations.
(struct redisplay_interface): Use bool and enum text_cursor_kinds
in update_window_end_hook and draw_window_cursor functions.
(display_and_set_cursor, x_update_cursor): Adjust prototypes.
* nsterm.m (ns_update_window_end, ns_draw_window_cursor):
* w32term.c (x_update_window_end,w32_draw_window_cursor):
* xterm.c (x_update_window_end, x_draw_window_cursor):
* xdisp.c (display_and_set_cursor, update_window_cursor)
(update_cursor_in_window_tree, x_update_cursor): Use bool and
enum text_cursor_kinds where appropriate.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 16 | ||||
| -rw-r--r-- | src/dispextern.h | 38 | ||||
| -rw-r--r-- | src/frame.h | 10 | ||||
| -rw-r--r-- | src/nsterm.m | 8 | ||||
| -rw-r--r-- | src/w32term.c | 9 | ||||
| -rw-r--r-- | src/xdisp.c | 8 | ||||
| -rw-r--r-- | src/xterm.c | 9 |
7 files changed, 51 insertions, 47 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index aadaae24e98..e252e4a2f4f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,21 @@ | |||
| 1 | 2013-08-23 Dmitry Antipov <dmantipov@yandex.ru> | 1 | 2013-08-23 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 2 | ||
| 3 | Minor cleanup for redisplay interface and few related functions. | ||
| 4 | * frame.h (enum text_cursor_kinds): Move from here... | ||
| 5 | * dispextern.h (enum text_cursor_kinds): ...to here. | ||
| 6 | (toplevel): Drop unnecessary declarations. | ||
| 7 | (struct redisplay_interface): Use bool and enum text_cursor_kinds | ||
| 8 | in update_window_end_hook and draw_window_cursor functions. | ||
| 9 | (display_and_set_cursor, x_update_cursor): Adjust prototypes. | ||
| 10 | * nsterm.m (ns_update_window_end, ns_draw_window_cursor): | ||
| 11 | * w32term.c (x_update_window_end,w32_draw_window_cursor): | ||
| 12 | * xterm.c (x_update_window_end, x_draw_window_cursor): | ||
| 13 | * xdisp.c (display_and_set_cursor, update_window_cursor) | ||
| 14 | (update_cursor_in_window_tree, x_update_cursor): Use bool and | ||
| 15 | enum text_cursor_kinds where appropriate. | ||
| 16 | |||
| 17 | 2013-08-23 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 18 | |||
| 3 | Redesign redisplay interface to drop updated_row and updated_area. | 19 | Redesign redisplay interface to drop updated_row and updated_area. |
| 4 | * dispextern.h (updated_row, updated_area): Remove declaration. | 20 | * dispextern.h (updated_row, updated_area): Remove declaration. |
| 5 | (struct redisplay_interface): Pass glyph row and row area parameters | 21 | (struct redisplay_interface): Pass glyph row and row area parameters |
diff --git a/src/dispextern.h b/src/dispextern.h index eb5b4bd195c..6e1d85de924 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -95,18 +95,17 @@ typedef int Cursor; | |||
| 95 | #define NativeRectangle int | 95 | #define NativeRectangle int |
| 96 | #endif | 96 | #endif |
| 97 | 97 | ||
| 98 | /* Structure forward declarations. Some are here because function | 98 | /* Text cursor types. */ |
| 99 | prototypes below reference structure types before their definition | ||
| 100 | in this file. Some are here because not every file including | ||
| 101 | dispextern.h also includes frame.h and windows.h. */ | ||
| 102 | |||
| 103 | struct glyph; | ||
| 104 | struct glyph_row; | ||
| 105 | struct glyph_matrix; | ||
| 106 | struct glyph_pool; | ||
| 107 | struct frame; | ||
| 108 | struct window; | ||
| 109 | 99 | ||
| 100 | enum text_cursor_kinds | ||
| 101 | { | ||
| 102 | DEFAULT_CURSOR = -2, | ||
| 103 | NO_CURSOR = -1, | ||
| 104 | FILLED_BOX_CURSOR, | ||
| 105 | HOLLOW_BOX_CURSOR, | ||
| 106 | BAR_CURSOR, | ||
| 107 | HBAR_CURSOR | ||
| 108 | }; | ||
| 110 | 109 | ||
| 111 | /* Values returned from coordinates_in_window. */ | 110 | /* Values returned from coordinates_in_window. */ |
| 112 | 111 | ||
| @@ -2739,8 +2738,8 @@ struct redisplay_interface | |||
| 2739 | MOUSE_FACE_OVERWRITTEN_P non-zero means that some lines in W | 2738 | MOUSE_FACE_OVERWRITTEN_P non-zero means that some lines in W |
| 2740 | that contained glyphs in mouse-face were overwritten, so we | 2739 | that contained glyphs in mouse-face were overwritten, so we |
| 2741 | have to update the mouse highlight. */ | 2740 | have to update the mouse highlight. */ |
| 2742 | void (*update_window_end_hook) (struct window *w, int cursor_on_p, | 2741 | void (*update_window_end_hook) (struct window *w, bool cursor_on_p, |
| 2743 | int mouse_face_overwritten_p); | 2742 | bool mouse_face_overwritten_p); |
| 2744 | 2743 | ||
| 2745 | /* Move cursor to row/column position VPOS/HPOS, pixel coordinates | 2744 | /* Move cursor to row/column position VPOS/HPOS, pixel coordinates |
| 2746 | Y/X. HPOS/VPOS are window-relative row and column numbers and X/Y | 2745 | Y/X. HPOS/VPOS are window-relative row and column numbers and X/Y |
| @@ -2799,10 +2798,10 @@ struct redisplay_interface | |||
| 2799 | 0, don't draw cursor. If ACTIVE_P is 1, system caret | 2798 | 0, don't draw cursor. If ACTIVE_P is 1, system caret |
| 2800 | should track this cursor (when applicable). */ | 2799 | should track this cursor (when applicable). */ |
| 2801 | void (*draw_window_cursor) (struct window *w, | 2800 | void (*draw_window_cursor) (struct window *w, |
| 2802 | struct glyph_row *glyph_row, | 2801 | struct glyph_row *glyph_row, |
| 2803 | int x, int y, | 2802 | int x, int y, |
| 2804 | int cursor_type, int cursor_width, | 2803 | enum text_cursor_kinds cursor_type, |
| 2805 | int on_p, int active_p); | 2804 | int cursor_width, bool on_p, bool active_p); |
| 2806 | 2805 | ||
| 2807 | /* Draw vertical border for window W from (X,Y_0) to (X,Y_1). */ | 2806 | /* Draw vertical border for window W from (X,Y_0) to (X,Y_1). */ |
| 2808 | void (*draw_vertical_window_border) (struct window *w, | 2807 | void (*draw_vertical_window_border) (struct window *w, |
| @@ -3195,13 +3194,12 @@ extern void draw_phys_cursor_glyph (struct window *, | |||
| 3195 | extern void get_phys_cursor_geometry (struct window *, struct glyph_row *, | 3194 | extern void get_phys_cursor_geometry (struct window *, struct glyph_row *, |
| 3196 | struct glyph *, int *, int *, int *); | 3195 | struct glyph *, int *, int *, int *); |
| 3197 | extern void erase_phys_cursor (struct window *); | 3196 | extern void erase_phys_cursor (struct window *); |
| 3198 | extern void display_and_set_cursor (struct window *, | 3197 | extern void display_and_set_cursor (struct window *, bool, int, int, int, int); |
| 3199 | int, int, int, int, int); | ||
| 3200 | 3198 | ||
| 3201 | extern void set_output_cursor (struct cursor_pos *); | 3199 | extern void set_output_cursor (struct cursor_pos *); |
| 3202 | extern void x_cursor_to (struct window *, int, int, int, int); | 3200 | extern void x_cursor_to (struct window *, int, int, int, int); |
| 3203 | 3201 | ||
| 3204 | extern void x_update_cursor (struct frame *, int); | 3202 | extern void x_update_cursor (struct frame *, bool); |
| 3205 | extern void x_clear_cursor (struct window *); | 3203 | extern void x_clear_cursor (struct window *); |
| 3206 | extern void x_draw_vertical_border (struct window *w); | 3204 | extern void x_draw_vertical_border (struct window *w); |
| 3207 | 3205 | ||
diff --git a/src/frame.h b/src/frame.h index e44003b15ca..2dcb7562524 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -56,16 +56,6 @@ enum vertical_scroll_bar_type | |||
| 56 | vertical_scroll_bar_right | 56 | vertical_scroll_bar_right |
| 57 | }; | 57 | }; |
| 58 | 58 | ||
| 59 | enum text_cursor_kinds | ||
| 60 | { | ||
| 61 | DEFAULT_CURSOR = -2, | ||
| 62 | NO_CURSOR = -1, | ||
| 63 | FILLED_BOX_CURSOR, | ||
| 64 | HOLLOW_BOX_CURSOR, | ||
| 65 | BAR_CURSOR, | ||
| 66 | HBAR_CURSOR | ||
| 67 | }; | ||
| 68 | |||
| 69 | enum fullscreen_type | 59 | enum fullscreen_type |
| 70 | { | 60 | { |
| 71 | FULLSCREEN_NONE, | 61 | FULLSCREEN_NONE, |
diff --git a/src/nsterm.m b/src/nsterm.m index f374bfd90c6..287c119ba73 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -742,8 +742,8 @@ ns_update_window_begin (struct window *w) | |||
| 742 | 742 | ||
| 743 | 743 | ||
| 744 | static void | 744 | static void |
| 745 | ns_update_window_end (struct window *w, int cursor_on_p, | 745 | ns_update_window_end (struct window *w, bool cursor_on_p, |
| 746 | int mouse_face_overwritten_p) | 746 | bool mouse_face_overwritten_p) |
| 747 | /* -------------------------------------------------------------------------- | 747 | /* -------------------------------------------------------------------------- |
| 748 | Finished a grouped sequence of drawing calls | 748 | Finished a grouped sequence of drawing calls |
| 749 | external (RIF) call; for one window called before update_end | 749 | external (RIF) call; for one window called before update_end |
| @@ -2341,8 +2341,8 @@ ns_draw_fringe_bitmap (struct window *w, struct glyph_row *row, | |||
| 2341 | 2341 | ||
| 2342 | static void | 2342 | static void |
| 2343 | ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, | 2343 | ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, |
| 2344 | int x, int y, int cursor_type, int cursor_width, | 2344 | int x, int y, enum text_cursor_kinds cursor_type, |
| 2345 | int on_p, int active_p) | 2345 | int cursor_width, bool on_p, bool active_p) |
| 2346 | /* -------------------------------------------------------------------------- | 2346 | /* -------------------------------------------------------------------------- |
| 2347 | External call (RIF): draw cursor. | 2347 | External call (RIF): draw cursor. |
| 2348 | Note that CURSOR_WIDTH is meaningful only for (h)bar cursors. | 2348 | Note that CURSOR_WIDTH is meaningful only for (h)bar cursors. |
diff --git a/src/w32term.c b/src/w32term.c index 7d51850559b..7a15323551b 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -210,7 +210,6 @@ static int volatile input_signal_count; | |||
| 210 | int w32_message_fd = -1; | 210 | int w32_message_fd = -1; |
| 211 | #endif /* CYGWIN */ | 211 | #endif /* CYGWIN */ |
| 212 | 212 | ||
| 213 | static void x_update_window_end (struct window *, int, int); | ||
| 214 | static void w32_handle_tool_bar_click (struct frame *, | 213 | static void w32_handle_tool_bar_click (struct frame *, |
| 215 | struct input_event *); | 214 | struct input_event *); |
| 216 | static void w32_define_cursor (Window, Cursor); | 215 | static void w32_define_cursor (Window, Cursor); |
| @@ -676,8 +675,8 @@ w32_draw_vertical_window_border (struct window *w, int x, int y0, int y1) | |||
| 676 | here. */ | 675 | here. */ |
| 677 | 676 | ||
| 678 | static void | 677 | static void |
| 679 | x_update_window_end (struct window *w, int cursor_on_p, | 678 | x_update_window_end (struct window *w, bool cursor_on_p, |
| 680 | int mouse_face_overwritten_p) | 679 | bool mouse_face_overwritten_p) |
| 681 | { | 680 | { |
| 682 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); | 681 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); |
| 683 | 682 | ||
| @@ -5300,8 +5299,8 @@ w32_clear_frame_area (struct frame *f, int x, int y, int width, int height) | |||
| 5300 | 5299 | ||
| 5301 | static void | 5300 | static void |
| 5302 | w32_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, | 5301 | w32_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, |
| 5303 | int x, int y, int cursor_type, int cursor_width, | 5302 | int x, int y, enum text_cursor_kinds cursor_type, |
| 5304 | int on_p, int active_p) | 5303 | int cursor_width, bool on_p, bool active_p) |
| 5305 | { | 5304 | { |
| 5306 | if (on_p) | 5305 | if (on_p) |
| 5307 | { | 5306 | { |
diff --git a/src/xdisp.c b/src/xdisp.c index a029f53305c..53fc6d85647 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -26465,7 +26465,7 @@ erase_phys_cursor (struct window *w) | |||
| 26465 | where to put the cursor is specified by HPOS, VPOS, X and Y. */ | 26465 | where to put the cursor is specified by HPOS, VPOS, X and Y. */ |
| 26466 | 26466 | ||
| 26467 | void | 26467 | void |
| 26468 | display_and_set_cursor (struct window *w, int on, | 26468 | display_and_set_cursor (struct window *w, bool on, |
| 26469 | int hpos, int vpos, int x, int y) | 26469 | int hpos, int vpos, int x, int y) |
| 26470 | { | 26470 | { |
| 26471 | struct frame *f = XFRAME (w->frame); | 26471 | struct frame *f = XFRAME (w->frame); |
| @@ -26549,7 +26549,7 @@ display_and_set_cursor (struct window *w, int on, | |||
| 26549 | of ON. */ | 26549 | of ON. */ |
| 26550 | 26550 | ||
| 26551 | static void | 26551 | static void |
| 26552 | update_window_cursor (struct window *w, int on) | 26552 | update_window_cursor (struct window *w, bool on) |
| 26553 | { | 26553 | { |
| 26554 | /* Don't update cursor in windows whose frame is in the process | 26554 | /* Don't update cursor in windows whose frame is in the process |
| 26555 | of being deleted. */ | 26555 | of being deleted. */ |
| @@ -26585,7 +26585,7 @@ update_window_cursor (struct window *w, int on) | |||
| 26585 | in the window tree rooted at W. */ | 26585 | in the window tree rooted at W. */ |
| 26586 | 26586 | ||
| 26587 | static void | 26587 | static void |
| 26588 | update_cursor_in_window_tree (struct window *w, int on_p) | 26588 | update_cursor_in_window_tree (struct window *w, bool on_p) |
| 26589 | { | 26589 | { |
| 26590 | while (w) | 26590 | while (w) |
| 26591 | { | 26591 | { |
| @@ -26604,7 +26604,7 @@ update_cursor_in_window_tree (struct window *w, int on_p) | |||
| 26604 | Don't change the cursor's position. */ | 26604 | Don't change the cursor's position. */ |
| 26605 | 26605 | ||
| 26606 | void | 26606 | void |
| 26607 | x_update_cursor (struct frame *f, int on_p) | 26607 | x_update_cursor (struct frame *f, bool on_p) |
| 26608 | { | 26608 | { |
| 26609 | update_cursor_in_window_tree (XWINDOW (f->root_window), on_p); | 26609 | update_cursor_in_window_tree (XWINDOW (f->root_window), on_p); |
| 26610 | } | 26610 | } |
diff --git a/src/xterm.c b/src/xterm.c index b5c5a5cb584..cea952f44d2 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -292,8 +292,6 @@ static void x_set_window_size_1 (struct frame *, int, int, int); | |||
| 292 | static void x_raise_frame (struct frame *); | 292 | static void x_raise_frame (struct frame *); |
| 293 | static void x_lower_frame (struct frame *); | 293 | static void x_lower_frame (struct frame *); |
| 294 | static const XColor *x_color_cells (Display *, int *); | 294 | static const XColor *x_color_cells (Display *, int *); |
| 295 | static void x_update_window_end (struct window *, int, int); | ||
| 296 | |||
| 297 | static int x_io_error_quitter (Display *); | 295 | static int x_io_error_quitter (Display *); |
| 298 | static struct terminal *x_create_terminal (struct x_display_info *); | 296 | static struct terminal *x_create_terminal (struct x_display_info *); |
| 299 | void x_delete_terminal (struct terminal *); | 297 | void x_delete_terminal (struct terminal *); |
| @@ -612,7 +610,8 @@ x_draw_vertical_window_border (struct window *w, int x, int y0, int y1) | |||
| 612 | here. */ | 610 | here. */ |
| 613 | 611 | ||
| 614 | static void | 612 | static void |
| 615 | x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p) | 613 | x_update_window_end (struct window *w, bool cursor_on_p, |
| 614 | bool mouse_face_overwritten_p) | ||
| 616 | { | 615 | { |
| 617 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); | 616 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); |
| 618 | 617 | ||
| @@ -7372,7 +7371,9 @@ x_clear_frame_area (struct frame *f, int x, int y, int width, int height) | |||
| 7372 | /* RIF: Draw cursor on window W. */ | 7371 | /* RIF: Draw cursor on window W. */ |
| 7373 | 7372 | ||
| 7374 | static void | 7373 | static void |
| 7375 | x_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x, int y, int cursor_type, int cursor_width, int on_p, int active_p) | 7374 | x_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x, |
| 7375 | int y, enum text_cursor_kinds cursor_type, | ||
| 7376 | int cursor_width, bool on_p, bool active_p) | ||
| 7376 | { | 7377 | { |
| 7377 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 7378 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 7378 | 7379 | ||