aboutsummaryrefslogtreecommitdiffstats
path: root/src/dispextern.h
diff options
context:
space:
mode:
authorEli Zaretskii2010-10-30 15:09:52 +0200
committerEli Zaretskii2010-10-30 15:09:52 +0200
commitd009ae66b405e38113c1ed29ff50832e5eec2b29 (patch)
treef6fb055534f6b2b9c3b65ba785d167efc5e40f16 /src/dispextern.h
parentaeeb3dcb656d2df4421f3c0a8b6416a5c1ea94a7 (diff)
downloademacs-d009ae66b405e38113c1ed29ff50832e5eec2b29.tar.gz
emacs-d009ae66b405e38113c1ed29ff50832e5eec2b29.zip
Unify mouse highlight code of MSDOS and GUI sessions.
xdisp.c (coords_in_mouse_face_p): Move prototype out of the HAVE_WINDOW_SYSTEM conditional. (x_y_to_hpos_vpos, frame_to_window_pixel_xy): Move out of the HAVE_WINDOW_SYSTEM block. (try_window_id) [HAVE_GPM || MSDOS]: Call x_clear_window_mouse_face. (draw_row_with_mouse_face): Implementation for HAVE_WINDOW_SYSTEM systems. (show_mouse_face): Call it, instead of calling draw_glyphs directly. (show_mouse_face, clear_mouse_face, coords_in_mouse_face_p) (cursor_in_mouse_face_p, rows_from_pos_range) (mouse_face_from_buffer_pos, mouse_face_from_string_pos) (note_mode_line_or_margin_highlight, note_mouse_highlight) (x_clear_window_mouse_face, cancel_mouse_face): Move out of the HAVE_WINDOW_SYSTEM block. Ifdef away window-system specific fragments. (note_mouse_highlight): Call popup_activated for MSDOS as well. Clear mouse highlight if pointer is over glyphs whose OBJECT is an integer. (mouse_face_from_buffer_pos): Add parentheses around && within ||. xmenu.c (popup_activated): Don't define on MSDOS. dispnew.c (mirror_make_current): Set Y coordinate of the mode-line and header-line rows. termchar.h (struct tty_display_info): Define mouse_face_* members not only for MSDOS. Delete stray whitespace. <mouse_face_beg_x, mouse_face_beg_y, mouse_face_overlay>: New struct members. dispextern.h (DPYINFO_DEFINED) [HAVE_X_WINDOWS]: Define. (DPYINFO_DEFINED) [HAVE_NTGUI]: Define. (DPYINFO_DEFINED) [HAVE_NS]: Define. (Display_Info) [!DPYINFO_DEFINED]: Define here. (FRAME_X_DISPLAY_INFO) [HAVE_GPM]: Define. (FRAME_X_DISPLAY_INFO): Define to NULL if not defined. (frame_to_window_pixel_xy, note_mouse_highlight) (x_clear_window_mouse_face, cancel_mouse_face, clear_mouse_face) (show_mouse_face, cursor_in_mouse_face_p): Move prototypes out of HAVE_WINDOW_SYSTEM conditional. (draw_row_with_mouse_face): Declare prototype. msdos.h (Display_Info): Don't define here. msdos.c (show_mouse_face, clear_mouse_face) (fast_find_position, IT_note_mode_line_highlight) (IT_note_mouse_highlight): Functions deleted. (IT_frame_up_to_date, dos_rawgetc): Call note_mouse_highlight instead of IT_note_mouse_highlight. (draw_row_with_mouse_face, popup_activated): New functions.
Diffstat (limited to 'src/dispextern.h')
-rw-r--r--src/dispextern.h48
1 files changed, 35 insertions, 13 deletions
diff --git a/src/dispextern.h b/src/dispextern.h
index 20e074d2393..c9006c8e57e 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -43,12 +43,9 @@ typedef struct {
43 43
44#endif /* HAVE_X_WINDOWS */ 44#endif /* HAVE_X_WINDOWS */
45 45
46#ifdef MSDOS
47#include "msdos.h"
48#endif
49
50#ifdef HAVE_X_WINDOWS 46#ifdef HAVE_X_WINDOWS
51typedef struct x_display_info Display_Info; 47typedef struct x_display_info Display_Info;
48#define DPYINFO_DEFINED 1
52typedef XImage * XImagePtr; 49typedef XImage * XImagePtr;
53typedef XImagePtr XImagePtr_or_DC; 50typedef XImagePtr XImagePtr_or_DC;
54#define NativeRectangle XRectangle 51#define NativeRectangle XRectangle
@@ -57,6 +54,7 @@ typedef XImagePtr XImagePtr_or_DC;
57#ifdef HAVE_NTGUI 54#ifdef HAVE_NTGUI
58#include "w32gui.h" 55#include "w32gui.h"
59typedef struct w32_display_info Display_Info; 56typedef struct w32_display_info Display_Info;
57#define DPYINFO_DEFINED 1
60typedef XImage *XImagePtr; 58typedef XImage *XImagePtr;
61typedef HDC XImagePtr_or_DC; 59typedef HDC XImagePtr_or_DC;
62#endif 60#endif
@@ -65,10 +63,32 @@ typedef HDC XImagePtr_or_DC;
65#include "nsgui.h" 63#include "nsgui.h"
66/* following typedef needed to accomodate the MSDOS port, believe it or not */ 64/* following typedef needed to accomodate the MSDOS port, believe it or not */
67typedef struct ns_display_info Display_Info; 65typedef struct ns_display_info Display_Info;
66#define DPYINFO_DEFINED 1
68typedef Pixmap XImagePtr; 67typedef Pixmap XImagePtr;
69typedef XImagePtr XImagePtr_or_DC; 68typedef XImagePtr XImagePtr_or_DC;
70#endif 69#endif
71 70
71#ifndef DPYINFO_DEFINED
72typedef struct tty_display_info Display_Info;
73typedef int Cursor;
74#define No_Cursor (0)
75#endif
76
77#undef DPYINFO_DEFINED
78
79#ifdef MSDOS
80/* This defines FRAME_X_DISPLAY_INFO for MSDOS. */
81#include "msdos.h"
82#endif
83
84#ifdef HAVE_GPM
85#define FRAME_X_DISPLAY_INFO(f) gpm_tty
86#endif
87
88#ifndef FRAME_X_DISPLAY_INFO
89#define FRAME_X_DISPLAY_INFO(f) NULL
90#endif
91
72#ifndef NativeRectangle 92#ifndef NativeRectangle
73#define NativeRectangle int 93#define NativeRectangle int
74#endif 94#endif
@@ -3017,28 +3037,30 @@ extern void x_update_cursor (struct frame *, int);
3017extern void x_clear_cursor (struct window *); 3037extern void x_clear_cursor (struct window *);
3018extern void x_draw_vertical_border (struct window *w); 3038extern void x_draw_vertical_border (struct window *w);
3019 3039
3020extern void frame_to_window_pixel_xy (struct window *, int *, int *);
3021extern int get_glyph_string_clip_rects (struct glyph_string *, 3040extern int get_glyph_string_clip_rects (struct glyph_string *,
3022 NativeRectangle *, int); 3041 NativeRectangle *, int);
3023extern void get_glyph_string_clip_rect (struct glyph_string *, 3042extern void get_glyph_string_clip_rect (struct glyph_string *,
3024 NativeRectangle *nr); 3043 NativeRectangle *nr);
3025extern Lisp_Object find_hot_spot (Lisp_Object, int, int); 3044extern Lisp_Object find_hot_spot (Lisp_Object, int, int);
3026extern void note_mouse_highlight (struct frame *, int, int);
3027extern void x_clear_window_mouse_face (struct window *);
3028extern void cancel_mouse_face (struct frame *);
3029 3045
3030extern void handle_tool_bar_click (struct frame *, 3046extern void handle_tool_bar_click (struct frame *,
3031 int, int, int, unsigned int); 3047 int, int, int, unsigned int);
3032 3048
3033/* msdos.c defines its own versions of these functions. */ 3049extern void expose_frame (struct frame *, int, int, int, int);
3050extern int x_intersect_rectangles (XRectangle *, XRectangle *,
3051 XRectangle *);
3052#endif /* HAVE_WINDOW_SYSTEM */
3053
3054extern void frame_to_window_pixel_xy (struct window *, int *, int *);
3055extern void note_mouse_highlight (struct frame *, int, int);
3056extern void x_clear_window_mouse_face (struct window *);
3057extern void cancel_mouse_face (struct frame *);
3034extern int clear_mouse_face (Display_Info *); 3058extern int clear_mouse_face (Display_Info *);
3035extern void show_mouse_face (Display_Info *, enum draw_glyphs_face); 3059extern void show_mouse_face (Display_Info *, enum draw_glyphs_face);
3036extern int cursor_in_mouse_face_p (struct window *w); 3060extern int cursor_in_mouse_face_p (struct window *w);
3061extern void draw_row_with_mouse_face (struct window *, int, struct glyph_row *,
3062 int, int, enum draw_glyphs_face);
3037 3063
3038extern void expose_frame (struct frame *, int, int, int, int);
3039extern int x_intersect_rectangles (XRectangle *, XRectangle *,
3040 XRectangle *);
3041#endif
3042 3064
3043/* Flags passed to try_window. */ 3065/* Flags passed to try_window. */
3044#define TRY_WINDOW_CHECK_MARGINS (1 << 0) 3066#define TRY_WINDOW_CHECK_MARGINS (1 << 0)