aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoakim Verona2013-08-23 06:16:37 +0200
committerJoakim Verona2013-08-23 06:16:37 +0200
commit87174f325be32b8967bb50a81ad8f43a9482f10f (patch)
treed2ab0b78ff0b7f0cc88bda43c8b4a464e877e536 /src
parent9d72cbde8b1a6b9b391a1966fe54def9b56c9746 (diff)
parent9997ec56be8bf3fb32ac246e5b654ed735ee2c52 (diff)
downloademacs-87174f325be32b8967bb50a81ad8f43a9482f10f.tar.gz
emacs-87174f325be32b8967bb50a81ad8f43a9482f10f.zip
merge from trunk
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog16
-rw-r--r--src/dispextern.h38
-rw-r--r--src/frame.h10
-rw-r--r--src/nsterm.m8
-rw-r--r--src/w32term.c9
-rw-r--r--src/xdisp.c8
-rw-r--r--src/xterm.c9
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 @@
12013-08-23 Dmitry Antipov <dmantipov@yandex.ru> 12013-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
172013-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 7123587c596..42b1c01d34e 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
103struct glyph;
104struct glyph_row;
105struct glyph_matrix;
106struct glyph_pool;
107struct frame;
108struct window;
109 99
100enum 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
@@ -2767,8 +2766,8 @@ struct redisplay_interface
2767 MOUSE_FACE_OVERWRITTEN_P non-zero means that some lines in W 2766 MOUSE_FACE_OVERWRITTEN_P non-zero means that some lines in W
2768 that contained glyphs in mouse-face were overwritten, so we 2767 that contained glyphs in mouse-face were overwritten, so we
2769 have to update the mouse highlight. */ 2768 have to update the mouse highlight. */
2770 void (*update_window_end_hook) (struct window *w, int cursor_on_p, 2769 void (*update_window_end_hook) (struct window *w, bool cursor_on_p,
2771 int mouse_face_overwritten_p); 2770 bool mouse_face_overwritten_p);
2772 2771
2773 /* Move cursor to row/column position VPOS/HPOS, pixel coordinates 2772 /* Move cursor to row/column position VPOS/HPOS, pixel coordinates
2774 Y/X. HPOS/VPOS are window-relative row and column numbers and X/Y 2773 Y/X. HPOS/VPOS are window-relative row and column numbers and X/Y
@@ -2827,10 +2826,10 @@ struct redisplay_interface
2827 0, don't draw cursor. If ACTIVE_P is 1, system caret 2826 0, don't draw cursor. If ACTIVE_P is 1, system caret
2828 should track this cursor (when applicable). */ 2827 should track this cursor (when applicable). */
2829 void (*draw_window_cursor) (struct window *w, 2828 void (*draw_window_cursor) (struct window *w,
2830 struct glyph_row *glyph_row, 2829 struct glyph_row *glyph_row,
2831 int x, int y, 2830 int x, int y,
2832 int cursor_type, int cursor_width, 2831 enum text_cursor_kinds cursor_type,
2833 int on_p, int active_p); 2832 int cursor_width, bool on_p, bool active_p);
2834 2833
2835/* Draw vertical border for window W from (X,Y_0) to (X,Y_1). */ 2834/* Draw vertical border for window W from (X,Y_0) to (X,Y_1). */
2836 void (*draw_vertical_window_border) (struct window *w, 2835 void (*draw_vertical_window_border) (struct window *w,
@@ -3223,13 +3222,12 @@ extern void draw_phys_cursor_glyph (struct window *,
3223extern void get_phys_cursor_geometry (struct window *, struct glyph_row *, 3222extern void get_phys_cursor_geometry (struct window *, struct glyph_row *,
3224 struct glyph *, int *, int *, int *); 3223 struct glyph *, int *, int *, int *);
3225extern void erase_phys_cursor (struct window *); 3224extern void erase_phys_cursor (struct window *);
3226extern void display_and_set_cursor (struct window *, 3225extern void display_and_set_cursor (struct window *, bool, int, int, int, int);
3227 int, int, int, int, int);
3228 3226
3229extern void set_output_cursor (struct cursor_pos *); 3227extern void set_output_cursor (struct cursor_pos *);
3230extern void x_cursor_to (struct window *, int, int, int, int); 3228extern void x_cursor_to (struct window *, int, int, int, int);
3231 3229
3232extern void x_update_cursor (struct frame *, int); 3230extern void x_update_cursor (struct frame *, bool);
3233extern void x_clear_cursor (struct window *); 3231extern void x_clear_cursor (struct window *);
3234extern void x_draw_vertical_border (struct window *w); 3232extern void x_draw_vertical_border (struct window *w);
3235 3233
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
59enum 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
69enum fullscreen_type 59enum 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
744static void 744static void
745ns_update_window_end (struct window *w, int cursor_on_p, 745ns_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
2342static void 2342static void
2343ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, 2343ns_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;
210int w32_message_fd = -1; 210int w32_message_fd = -1;
211#endif /* CYGWIN */ 211#endif /* CYGWIN */
212 212
213static void x_update_window_end (struct window *, int, int);
214static void w32_handle_tool_bar_click (struct frame *, 213static void w32_handle_tool_bar_click (struct frame *,
215 struct input_event *); 214 struct input_event *);
216static void w32_define_cursor (Window, Cursor); 215static 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
678static void 677static void
679x_update_window_end (struct window *w, int cursor_on_p, 678x_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
5301static void 5300static void
5302w32_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, 5301w32_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 3439ce617c4..9e40cd26259 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -26719,7 +26719,7 @@ erase_phys_cursor (struct window *w)
26719 where to put the cursor is specified by HPOS, VPOS, X and Y. */ 26719 where to put the cursor is specified by HPOS, VPOS, X and Y. */
26720 26720
26721void 26721void
26722display_and_set_cursor (struct window *w, int on, 26722display_and_set_cursor (struct window *w, bool on,
26723 int hpos, int vpos, int x, int y) 26723 int hpos, int vpos, int x, int y)
26724{ 26724{
26725 struct frame *f = XFRAME (w->frame); 26725 struct frame *f = XFRAME (w->frame);
@@ -26803,7 +26803,7 @@ display_and_set_cursor (struct window *w, int on,
26803 of ON. */ 26803 of ON. */
26804 26804
26805static void 26805static void
26806update_window_cursor (struct window *w, int on) 26806update_window_cursor (struct window *w, bool on)
26807{ 26807{
26808 /* Don't update cursor in windows whose frame is in the process 26808 /* Don't update cursor in windows whose frame is in the process
26809 of being deleted. */ 26809 of being deleted. */
@@ -26839,7 +26839,7 @@ update_window_cursor (struct window *w, int on)
26839 in the window tree rooted at W. */ 26839 in the window tree rooted at W. */
26840 26840
26841static void 26841static void
26842update_cursor_in_window_tree (struct window *w, int on_p) 26842update_cursor_in_window_tree (struct window *w, bool on_p)
26843{ 26843{
26844 while (w) 26844 while (w)
26845 { 26845 {
@@ -26858,7 +26858,7 @@ update_cursor_in_window_tree (struct window *w, int on_p)
26858 Don't change the cursor's position. */ 26858 Don't change the cursor's position. */
26859 26859
26860void 26860void
26861x_update_cursor (struct frame *f, int on_p) 26861x_update_cursor (struct frame *f, bool on_p)
26862{ 26862{
26863 update_cursor_in_window_tree (XWINDOW (f->root_window), on_p); 26863 update_cursor_in_window_tree (XWINDOW (f->root_window), on_p);
26864} 26864}
diff --git a/src/xterm.c b/src/xterm.c
index f75d92109d6..6730dd3e42e 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -295,8 +295,6 @@ static void x_set_window_size_1 (struct frame *, int, int, int);
295static void x_raise_frame (struct frame *); 295static void x_raise_frame (struct frame *);
296static void x_lower_frame (struct frame *); 296static void x_lower_frame (struct frame *);
297static const XColor *x_color_cells (Display *, int *); 297static const XColor *x_color_cells (Display *, int *);
298static void x_update_window_end (struct window *, int, int);
299
300static int x_io_error_quitter (Display *); 298static int x_io_error_quitter (Display *);
301static struct terminal *x_create_terminal (struct x_display_info *); 299static struct terminal *x_create_terminal (struct x_display_info *);
302void x_delete_terminal (struct terminal *); 300void x_delete_terminal (struct terminal *);
@@ -615,7 +613,8 @@ x_draw_vertical_window_border (struct window *w, int x, int y0, int y1)
615 here. */ 613 here. */
616 614
617static void 615static void
618x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p) 616x_update_window_end (struct window *w, bool cursor_on_p,
617 bool mouse_face_overwritten_p)
619{ 618{
620 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); 619 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
621 620
@@ -7386,7 +7385,9 @@ x_clear_frame_area (struct frame *f, int x, int y, int width, int height)
7386/* RIF: Draw cursor on window W. */ 7385/* RIF: Draw cursor on window W. */
7387 7386
7388static void 7387static void
7389x_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) 7388x_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x,
7389 int y, enum text_cursor_kinds cursor_type,
7390 int cursor_width, bool on_p, bool active_p)
7390{ 7391{
7391 struct frame *f = XFRAME (WINDOW_FRAME (w)); 7392 struct frame *f = XFRAME (WINDOW_FRAME (w));
7392 7393