* 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>
+
+ 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.
#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. */
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
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,
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);
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,
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
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.
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);
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));
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)
{
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);
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. */
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)
{
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);
}
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 *);
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));
/* 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));