]> git.eshelyaron.com Git - emacs.git/commitdiff
Minor cleanup for redisplay interface and few related functions.
authorDmitry Antipov <dmantipov@yandex.ru>
Fri, 23 Aug 2013 04:03:25 +0000 (08:03 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Fri, 23 Aug 2013 04:03:25 +0000 (08:03 +0400)
* 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.

src/ChangeLog
src/dispextern.h
src/frame.h
src/nsterm.m
src/w32term.c
src/xdisp.c
src/xterm.c

index aadaae24e981bc51c7537524bf8223fb00297e5e..e252e4a2f4f4f4e371d90766404a477908c97d30 100644 (file)
@@ -1,3 +1,19 @@
+2013-08-23  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       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.
+
 2013-08-23  Dmitry Antipov  <dmantipov@yandex.ru>
 
        Redesign redisplay interface to drop updated_row and updated_area.
index eb5b4bd195c3d049667bcd34d8e894e74dfb4880..6e1d85de9247ca05c65727b1c1fda74c3bb03ae8 100644 (file)
@@ -95,18 +95,17 @@ typedef int Cursor;
 #define NativeRectangle int
 #endif
 
-/* Structure forward declarations.  Some are here because function
-   prototypes below reference structure types before their definition
-   in this file.  Some are here because not every file including
-   dispextern.h also includes frame.h and windows.h.  */
-
-struct glyph;
-struct glyph_row;
-struct glyph_matrix;
-struct glyph_pool;
-struct frame;
-struct window;
+/* Text cursor types.  */
 
+enum text_cursor_kinds
+{
+  DEFAULT_CURSOR = -2,
+  NO_CURSOR = -1,
+  FILLED_BOX_CURSOR,
+  HOLLOW_BOX_CURSOR,
+  BAR_CURSOR,
+  HBAR_CURSOR
+};
 
 /* Values returned from coordinates_in_window.  */
 
@@ -2739,8 +2738,8 @@ struct redisplay_interface
      MOUSE_FACE_OVERWRITTEN_P non-zero means that some lines in W
      that contained glyphs in mouse-face were overwritten, so we
      have to update the mouse highlight.  */
-  void (*update_window_end_hook) (struct window *w, int cursor_on_p,
-                                  int mouse_face_overwritten_p);
+  void (*update_window_end_hook) (struct window *w, bool cursor_on_p,
+                                  bool mouse_face_overwritten_p);
 
   /* Move cursor to row/column position VPOS/HPOS, pixel coordinates
      Y/X. HPOS/VPOS are window-relative row and column numbers and X/Y
@@ -2799,10 +2798,10 @@ struct redisplay_interface
    0, don't draw cursor.  If ACTIVE_P is 1, system caret
    should track this cursor (when applicable).  */
   void (*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);
+                             struct glyph_row *glyph_row,
+                             int x, int y,
+                             enum text_cursor_kinds cursor_type,
+                             int cursor_width, bool on_p, bool active_p);
 
 /* Draw vertical border for window W from (X,Y_0) to (X,Y_1).  */
   void (*draw_vertical_window_border) (struct window *w,
@@ -3195,13 +3194,12 @@ extern void draw_phys_cursor_glyph (struct window *,
 extern void get_phys_cursor_geometry (struct window *, struct glyph_row *,
                                       struct glyph *, int *, int *, int *);
 extern void erase_phys_cursor (struct window *);
-extern void display_and_set_cursor (struct window *,
-                                    int, int, int, int, int);
+extern void display_and_set_cursor (struct window *, bool, int, int, int, int);
 
 extern void set_output_cursor (struct cursor_pos *);
 extern void x_cursor_to (struct window *, int, int, int, int);
 
-extern void x_update_cursor (struct frame *, int);
+extern void x_update_cursor (struct frame *, bool);
 extern void x_clear_cursor (struct window *);
 extern void x_draw_vertical_border (struct window *w);
 
index e44003b15ca33e2bf717b35aee00ed79f163403e..2dcb7562524390ac2946b2a3802b62ee10d67047 100644 (file)
@@ -56,16 +56,6 @@ enum vertical_scroll_bar_type
   vertical_scroll_bar_right
 };
 
-enum text_cursor_kinds
-{
-  DEFAULT_CURSOR = -2,
-  NO_CURSOR = -1,
-  FILLED_BOX_CURSOR,
-  HOLLOW_BOX_CURSOR,
-  BAR_CURSOR,
-  HBAR_CURSOR
-};
-
 enum fullscreen_type
 {
   FULLSCREEN_NONE,
index f374bfd90c630f9a521dba44bacd5d024cc0b0be..287c119ba73b9d3a3abeb05e52dfc6fb94ad041a 100644 (file)
@@ -742,8 +742,8 @@ ns_update_window_begin (struct window *w)
 
 
 static void
-ns_update_window_end (struct window *w, int cursor_on_p,
-                      int mouse_face_overwritten_p)
+ns_update_window_end (struct window *w, bool cursor_on_p,
+                      bool mouse_face_overwritten_p)
 /* --------------------------------------------------------------------------
    Finished a grouped sequence of drawing calls
    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,
 
 static void
 ns_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)
+                      int x, int y, enum text_cursor_kinds cursor_type,
+                      int cursor_width, bool on_p, bool active_p)
 /* --------------------------------------------------------------------------
      External call (RIF): draw cursor.
      Note that CURSOR_WIDTH is meaningful only for (h)bar cursors.
index 7d51850559bae1ad1da94b330675a8679316e3cd..7a15323551b6116e13daddc15dda1d30e93ba3f4 100644 (file)
@@ -210,7 +210,6 @@ static int volatile input_signal_count;
 int w32_message_fd = -1;
 #endif /* CYGWIN */
 
-static void x_update_window_end (struct window *, int, int);
 static void w32_handle_tool_bar_click (struct frame *,
                                        struct input_event *);
 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)
    here. */
 
 static void
-x_update_window_end (struct window *w, int cursor_on_p,
-                    int mouse_face_overwritten_p)
+x_update_window_end (struct window *w, bool cursor_on_p,
+                    bool mouse_face_overwritten_p)
 {
   Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
 
@@ -5300,8 +5299,8 @@ w32_clear_frame_area (struct frame *f, int x, int y, int width, int height)
 
 static void
 w32_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)
+                       int x, int y, enum text_cursor_kinds cursor_type,
+                       int cursor_width, bool on_p, bool active_p)
 {
   if (on_p)
     {
index a029f53305cc9c5a58664e76f5c29a1b5a13e1e8..53fc6d8564771d5fceb9ce5c951de47313d63b63 100644 (file)
@@ -26465,7 +26465,7 @@ erase_phys_cursor (struct window *w)
    where to put the cursor is specified by HPOS, VPOS, X and Y.  */
 
 void
-display_and_set_cursor (struct window *w, int on,
+display_and_set_cursor (struct window *w, bool on,
                        int hpos, int vpos, int x, int y)
 {
   struct frame *f = XFRAME (w->frame);
@@ -26549,7 +26549,7 @@ display_and_set_cursor (struct window *w, int on,
    of ON.  */
 
 static void
-update_window_cursor (struct window *w, int on)
+update_window_cursor (struct window *w, bool on)
 {
   /* Don't update cursor in windows whose frame is in the process
      of being deleted.  */
@@ -26585,7 +26585,7 @@ update_window_cursor (struct window *w, int on)
    in the window tree rooted at W.  */
 
 static void
-update_cursor_in_window_tree (struct window *w, int on_p)
+update_cursor_in_window_tree (struct window *w, bool on_p)
 {
   while (w)
     {
@@ -26604,7 +26604,7 @@ update_cursor_in_window_tree (struct window *w, int on_p)
    Don't change the cursor's position.  */
 
 void
-x_update_cursor (struct frame *f, int on_p)
+x_update_cursor (struct frame *f, bool on_p)
 {
   update_cursor_in_window_tree (XWINDOW (f->root_window), on_p);
 }
index b5c5a5cb5840129ac7327d9098778241ced6b099..cea952f44d22cc336eee27fed1fe4d2b43f05f38 100644 (file)
@@ -292,8 +292,6 @@ static void x_set_window_size_1 (struct frame *, int, int, int);
 static void x_raise_frame (struct frame *);
 static void x_lower_frame (struct frame *);
 static const XColor *x_color_cells (Display *, int *);
-static void x_update_window_end (struct window *, int, int);
-
 static int x_io_error_quitter (Display *);
 static struct terminal *x_create_terminal (struct x_display_info *);
 void x_delete_terminal (struct terminal *);
@@ -612,7 +610,8 @@ x_draw_vertical_window_border (struct window *w, int x, int y0, int y1)
    here.  */
 
 static void
-x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p)
+x_update_window_end (struct window *w, bool cursor_on_p,
+                    bool mouse_face_overwritten_p)
 {
   Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
 
@@ -7372,7 +7371,9 @@ x_clear_frame_area (struct frame *f, int x, int y, int width, int height)
 /* RIF: Draw cursor on window W.  */
 
 static void
-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)
+x_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x,
+                     int y, enum text_cursor_kinds cursor_type,
+                     int cursor_width, bool on_p, bool active_p)
 {
   struct frame *f = XFRAME (WINDOW_FRAME (w));