[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r114017: * lisp.h (Mouse_HLInfo): Move from here...
From: |
Dmitry Antipov |
Subject: |
[Emacs-diffs] trunk r114017: * lisp.h (Mouse_HLInfo): Move from here... |
Date: |
Tue, 27 Aug 2013 03:54:03 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 114017
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Tue 2013-08-27 07:52:21 +0400
message:
* lisp.h (Mouse_HLInfo): Move from here...
* dispextern.h (Mouse_HLInfo): ...to here and offload lisp.h.
(reset_mouse_highlight): New function.
* msdos.c (dos_set_window_size, IT_update_begin)
(internal_terminal_init):
* nsterm.m (ns_update_window_end, x_free_frame_resources)
(ns_initialize_display_info):
* w32console.c (initialize_w32_display):
* w32term.c (x_update_window_end, x_free_frame_resources)
(w32_initialize_display_info):
* xterm.c (x_update_window_end, x_free_frame_resources, x_term_init):
* window.c (Fdelete_other_windows_internal):
* xdisp.c (clear_mouse_face, cancel_mouse_face): Use it.
* termchar.h (toplevel):
* xterm.h (toplevel): Include dispextern.h.
modified:
src/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1438
src/dispextern.h
dispextern.h-20091113204419-o5vbwnq5f7feedwu-218
src/lisp.h lisp.h-20091113204419-o5vbwnq5f7feedwu-253
src/msdos.c msdos.c-20091113204419-o5vbwnq5f7feedwu-656
src/nsterm.m nsterm.m-20091113204419-o5vbwnq5f7feedwu-8747
src/termchar.h termchar.h-20091113204419-o5vbwnq5f7feedwu-440
src/w32console.c
w32console.c-20091113204419-o5vbwnq5f7feedwu-812
src/w32term.c w32term.c-20091113204419-o5vbwnq5f7feedwu-950
src/window.c window.c-20091113204419-o5vbwnq5f7feedwu-231
src/xdisp.c xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
src/xterm.c xterm.c-20091113204419-o5vbwnq5f7feedwu-244
src/xterm.h xterm.h-20091113204419-o5vbwnq5f7feedwu-228
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2013-08-26 21:31:50 +0000
+++ b/src/ChangeLog 2013-08-27 03:52:21 +0000
@@ -1,3 +1,21 @@
+2013-08-27 Dmitry Antipov <address@hidden>
+
+ * lisp.h (Mouse_HLInfo): Move from here...
+ * dispextern.h (Mouse_HLInfo): ...to here and offload lisp.h.
+ (reset_mouse_highlight): New function.
+ * msdos.c (dos_set_window_size, IT_update_begin)
+ (internal_terminal_init):
+ * nsterm.m (ns_update_window_end, x_free_frame_resources)
+ (ns_initialize_display_info):
+ * w32console.c (initialize_w32_display):
+ * w32term.c (x_update_window_end, x_free_frame_resources)
+ (w32_initialize_display_info):
+ * xterm.c (x_update_window_end, x_free_frame_resources, x_term_init):
+ * window.c (Fdelete_other_windows_internal):
+ * xdisp.c (clear_mouse_face, cancel_mouse_face): Use it.
+ * termchar.h (toplevel):
+ * xterm.h (toplevel): Include dispextern.h.
+
2013-08-26 Paul Eggert <address@hidden>
Fix minor problems found by static checking.
=== modified file 'src/dispextern.h'
--- a/src/dispextern.h 2013-08-23 04:03:25 +0000
+++ b/src/dispextern.h 2013-08-27 03:52:21 +0000
@@ -2667,8 +2667,57 @@
MOVE_TO_POS = 0x08
};
-
-
+/***********************************************************************
+ Mouse Highlight
+ ***********************************************************************/
+
+/* Structure to hold mouse highlight data. */
+
+typedef struct {
+ /* These variables describe the range of text currently shown in its
+ mouse-face, together with the window they apply to. As long as
+ the mouse stays within this range, we need not redraw anything on
+ its account. Rows and columns are glyph matrix positions in
+ MOUSE_FACE_WINDOW. */
+ int mouse_face_beg_row, mouse_face_beg_col, mouse_face_beg_x;
+ int mouse_face_end_row, mouse_face_end_col, mouse_face_end_x;
+ Lisp_Object mouse_face_window;
+ int mouse_face_face_id;
+ Lisp_Object mouse_face_overlay;
+
+ /* FRAME and X, Y position of mouse when last checked for
+ highlighting. X and Y can be negative or out of range for the frame. */
+ struct frame *mouse_face_mouse_frame;
+ int mouse_face_mouse_x, mouse_face_mouse_y;
+
+ /* Nonzero if part of the text currently shown in
+ its mouse-face is beyond the window end. */
+ unsigned mouse_face_past_end : 1;
+
+ /* Nonzero means defer mouse-motion highlighting. */
+ unsigned mouse_face_defer : 1;
+
+ /* Nonzero means that the mouse highlight should not be shown. */
+ unsigned mouse_face_hidden : 1;
+} Mouse_HLInfo;
+
+DISPEXTERN_INLINE void
+reset_mouse_highlight (Mouse_HLInfo *hlinfo)
+{
+
+ hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
+ hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
+ hlinfo->mouse_face_mouse_x = hlinfo->mouse_face_mouse_y = 0;
+ hlinfo->mouse_face_beg_x = hlinfo->mouse_face_end_x = 0;
+ hlinfo->mouse_face_face_id = DEFAULT_FACE_ID;
+ hlinfo->mouse_face_mouse_frame = NULL;
+ hlinfo->mouse_face_window = Qnil;
+ hlinfo->mouse_face_overlay = Qnil;
+ hlinfo->mouse_face_past_end = 0;
+ hlinfo->mouse_face_hidden = 0;
+ hlinfo->mouse_face_defer = 0;
+}
+
/***********************************************************************
Window-based redisplay interface
***********************************************************************/
=== modified file 'src/lisp.h'
--- a/src/lisp.h 2013-08-26 14:00:55 +0000
+++ b/src/lisp.h 2013-08-27 03:52:21 +0000
@@ -2164,36 +2164,6 @@
CHARACTERBITS = 22
};
-/* Structure to hold mouse highlight data. This is here because other
- header files need it for defining struct x_output etc. */
-typedef struct {
- /* These variables describe the range of text currently shown in its
- mouse-face, together with the window they apply to. As long as
- the mouse stays within this range, we need not redraw anything on
- its account. Rows and columns are glyph matrix positions in
- MOUSE_FACE_WINDOW. */
- int mouse_face_beg_row, mouse_face_beg_col, mouse_face_beg_x;
- int mouse_face_end_row, mouse_face_end_col, mouse_face_end_x;
- Lisp_Object mouse_face_window;
- int mouse_face_face_id;
- Lisp_Object mouse_face_overlay;
-
- /* FRAME and X, Y position of mouse when last checked for
- highlighting. X and Y can be negative or out of range for the frame. */
- struct frame *mouse_face_mouse_frame;
- int mouse_face_mouse_x, mouse_face_mouse_y;
-
- /* Nonzero if part of the text currently shown in
- its mouse-face is beyond the window end. */
- unsigned mouse_face_past_end : 1;
-
- /* Nonzero means defer mouse-motion highlighting. */
- unsigned mouse_face_defer : 1;
-
- /* Nonzero means that the mouse highlight should not be shown. */
- unsigned mouse_face_hidden : 1;
-} Mouse_HLInfo;
-
/* Data type checking. */
LISP_MACRO_DEFUN (NILP, bool, (Lisp_Object x), (x))
=== modified file 'src/msdos.c'
--- a/src/msdos.c 2013-08-03 03:29:03 +0000
+++ b/src/msdos.c 2013-08-27 03:52:21 +0000
@@ -602,11 +602,7 @@
Lisp_Object window = hlinfo->mouse_face_window;
if (! NILP (window) && XFRAME (XWINDOW (window)->frame) == f)
- {
- hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
- hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
- hlinfo->mouse_face_window = Qnil;
- }
+ reset_mouse_highlight (hlinfo);
}
/* Enable bright background colors. */
@@ -1276,14 +1272,9 @@
}
}
else if (mouse_face_frame && !FRAME_LIVE_P (mouse_face_frame))
- {
- /* If the frame with mouse highlight was deleted, invalidate the
- highlight info. */
- hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
- hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
- hlinfo->mouse_face_window = Qnil;
- hlinfo->mouse_face_mouse_frame = NULL;
- }
+ /* If the frame with mouse highlight was deleted, invalidate the
+ highlight info. */
+ reset_mouse_highlight (hlinfo);
unblock_input ();
}
@@ -1843,17 +1834,8 @@
if (colors[1] >= 0 && colors[1] < 16)
FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()) = colors[1];
}
- the_only_display_info.mouse_highlight.mouse_face_mouse_frame = NULL;
- the_only_display_info.mouse_highlight.mouse_face_beg_row =
- the_only_display_info.mouse_highlight.mouse_face_beg_col = -1;
- the_only_display_info.mouse_highlight.mouse_face_end_row =
- the_only_display_info.mouse_highlight.mouse_face_end_col = -1;
- the_only_display_info.mouse_highlight.mouse_face_face_id =
DEFAULT_FACE_ID;
- the_only_display_info.mouse_highlight.mouse_face_window = Qnil;
- the_only_display_info.mouse_highlight.mouse_face_mouse_x =
- the_only_display_info.mouse_highlight.mouse_face_mouse_y = 0;
- the_only_display_info.mouse_highlight.mouse_face_defer = 0;
- the_only_display_info.mouse_highlight.mouse_face_hidden = 0;
+
+ reset_mouse_highlight (&the_only_display_info.mouse_highlight);
if (have_mouse) /* detected in dos_ttraw, which see */
{
=== modified file 'src/nsterm.m'
--- a/src/nsterm.m 2013-08-26 21:31:50 +0000
+++ b/src/nsterm.m 2013-08-27 03:52:21 +0000
@@ -749,8 +749,6 @@
external (RIF) call; for one window called before update_end
--------------------------------------------------------------------------
*/
{
- Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
-
/* note: this fn is nearly identical in all terms */
if (!w->pseudo_window_p)
{
@@ -770,11 +768,7 @@
/* If a row with mouse-face was overwritten, arrange for
frame_up_to_date to redisplay the mouse highlight. */
if (mouse_face_overwritten_p)
- {
- hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
- hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
- hlinfo->mouse_face_window = Qnil;
- }
+ reset_mouse_highlight (MOUSE_HL_INFO (XFRAME (w->frame)));
NSTRACE (update_window_end);
}
@@ -1183,12 +1177,7 @@
if (f == dpyinfo->x_highlight_frame)
dpyinfo->x_highlight_frame = 0;
if (f == hlinfo->mouse_face_mouse_frame)
- {
- hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
- hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
- hlinfo->mouse_face_window = Qnil;
- hlinfo->mouse_face_mouse_frame = 0;
- }
+ reset_mouse_highlight (hlinfo);
if (f->output_data.ns->miniimage != nil)
[f->output_data.ns->miniimage release];
@@ -3951,7 +3940,6 @@
{
NSScreen *screen = [NSScreen mainScreen];
NSWindowDepth depth = [screen depth];
- Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight;
dpyinfo->resx = 72.27; /* used 75.0, but this makes pt == pixel, expected
*/
dpyinfo->resy = 72.27;
@@ -3964,22 +3952,12 @@
dpyinfo->color_table = xmalloc (sizeof *dpyinfo->color_table);
dpyinfo->color_table->colors = NULL;
dpyinfo->root_window = 42; /* a placeholder.. */
-
- hlinfo->mouse_face_mouse_frame = NULL;
- hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
- hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
- hlinfo->mouse_face_face_id = DEFAULT_FACE_ID;
- hlinfo->mouse_face_window = hlinfo->mouse_face_overlay = Qnil;
- hlinfo->mouse_face_hidden = 0;
-
- hlinfo->mouse_face_mouse_x = hlinfo->mouse_face_mouse_y = 0;
- hlinfo->mouse_face_defer = 0;
-
dpyinfo->x_highlight_frame = dpyinfo->x_focus_frame = NULL;
-
dpyinfo->n_fonts = 0;
dpyinfo->smallest_font_height = 1;
dpyinfo->smallest_char_width = 1;
+
+ reset_mouse_highlight (&dpyinfo->mouse_highlight);
}
=== modified file 'src/termchar.h'
--- a/src/termchar.h 2013-08-26 18:10:30 +0000
+++ b/src/termchar.h 2013-08-27 03:52:21 +0000
@@ -16,6 +16,8 @@
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
+#include "dispextern.h"
+
/* Each termcap frame points to its own struct tty_output object in
the output_data.tty field. The tty_output structure contains the
information that is specific to termcap frames. */
=== modified file 'src/w32console.c'
--- a/src/w32console.c 2013-06-03 19:28:13 +0000
+++ b/src/w32console.c 2013-08-27 03:52:21 +0000
@@ -636,13 +636,7 @@
term->frame_up_to_date_hook = 0;
/* Initialize the mouse-highlight data. */
- hlinfo = &term->display_info.tty->mouse_highlight;
- hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
- hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
- hlinfo->mouse_face_face_id = DEFAULT_FACE_ID;
- hlinfo->mouse_face_mouse_frame = NULL;
- hlinfo->mouse_face_window = Qnil;
- hlinfo->mouse_face_hidden = 0;
+ reset_mouse_highlight (&term->display_info.tty->mouse_highlight);
/* Initialize interrupt_handle. */
init_crit ();
=== modified file 'src/w32term.c'
--- a/src/w32term.c 2013-08-23 04:03:25 +0000
+++ b/src/w32term.c 2013-08-27 03:52:21 +0000
@@ -678,8 +678,6 @@
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));
-
if (!w->pseudo_window_p)
{
block_input ();
@@ -698,11 +696,7 @@
/* If a row with mouse-face was overwritten, arrange for
XTframe_up_to_date to redisplay the mouse highlight. */
if (mouse_face_overwritten_p)
- {
- hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
- hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
- hlinfo->mouse_face_window = Qnil;
- }
+ reset_mouse_highlight (MOUSE_HL_INFO (XFRAME (w->frame)));
/* Unhide the caret. This won't actually show the cursor, unless it
was visible before the corresponding call to HideCaret in
@@ -6156,16 +6150,8 @@
dpyinfo->w32_focus_event_frame = 0;
if (f == dpyinfo->x_highlight_frame)
dpyinfo->x_highlight_frame = 0;
-
if (f == hlinfo->mouse_face_mouse_frame)
- {
- hlinfo->mouse_face_beg_row
- = hlinfo->mouse_face_beg_col = -1;
- hlinfo->mouse_face_end_row
- = hlinfo->mouse_face_end_col = -1;
- hlinfo->mouse_face_window = Qnil;
- hlinfo->mouse_face_mouse_frame = 0;
- }
+ reset_mouse_highlight (hlinfo);
unblock_input ();
}
@@ -6235,7 +6221,6 @@
w32_initialize_display_info (Lisp_Object display_name)
{
struct w32_display_info *dpyinfo = &one_w32_display_info;
- Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight;
memset (dpyinfo, 0, sizeof (*dpyinfo));
@@ -6258,17 +6243,10 @@
dpyinfo->n_fonts = 0;
dpyinfo->smallest_font_height = 1;
dpyinfo->smallest_char_width = 1;
-
- hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
- hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
- hlinfo->mouse_face_face_id = DEFAULT_FACE_ID;
- hlinfo->mouse_face_window = Qnil;
- hlinfo->mouse_face_overlay = Qnil;
- hlinfo->mouse_face_hidden = 0;
-
dpyinfo->vertical_scroll_bar_cursor = w32_load_cursor (IDC_ARROW);
/* TODO: dpyinfo->gray */
+ reset_mouse_highlight (&dpyinfo->mouse_highlight);
}
/* Create an xrdb-style database of resources to supersede registry settings.
=== modified file 'src/window.c'
--- a/src/window.c 2013-08-26 09:33:37 +0000
+++ b/src/window.c 2013-08-27 03:52:21 +0000
@@ -2842,7 +2842,7 @@
block_input ();
if (!FRAME_INITIAL_P (f))
{
- Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
/* We are going to free the glyph matrices of WINDOW, and with
that we might lose any information about glyph rows that have
@@ -2852,11 +2852,7 @@
frame's up-to-date hook that mouse highlight was overwritten,
so that it will arrange for redisplaying the highlight. */
if (EQ (hlinfo->mouse_face_window, window))
- {
- hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
- hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
- hlinfo->mouse_face_window = Qnil;
- }
+ reset_mouse_highlight (hlinfo);
}
free_window_matrices (r);
=== modified file 'src/xdisp.c'
--- a/src/xdisp.c 2013-08-26 14:00:55 +0000
+++ b/src/xdisp.c 2013-08-27 03:52:21 +0000
@@ -26795,10 +26795,7 @@
cleared = 1;
}
- hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
- hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
- hlinfo->mouse_face_window = Qnil;
- hlinfo->mouse_face_overlay = Qnil;
+ reset_mouse_highlight (hlinfo);
return cleared;
}
@@ -28586,11 +28583,7 @@
window = hlinfo->mouse_face_window;
if (! NILP (window) && XFRAME (XWINDOW (window)->frame) == f)
- {
- hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
- hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
- hlinfo->mouse_face_window = Qnil;
- }
+ reset_mouse_highlight (hlinfo);
}
=== modified file 'src/xterm.c'
--- a/src/xterm.c 2013-08-23 04:03:25 +0000
+++ b/src/xterm.c 2013-08-27 03:52:21 +0000
@@ -613,8 +613,6 @@
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));
-
if (!w->pseudo_window_p)
{
block_input ();
@@ -633,11 +631,7 @@
/* If a row with mouse-face was overwritten, arrange for
XTframe_up_to_date to redisplay the mouse highlight. */
if (mouse_face_overwritten_p)
- {
- hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
- hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
- hlinfo->mouse_face_window = Qnil;
- }
+ reset_mouse_highlight (MOUSE_HL_INFO (XFRAME (w->frame)));
}
@@ -9445,16 +9439,8 @@
dpyinfo->x_focus_event_frame = 0;
if (f == dpyinfo->x_highlight_frame)
dpyinfo->x_highlight_frame = 0;
-
if (f == hlinfo->mouse_face_mouse_frame)
- {
- hlinfo->mouse_face_beg_row
- = hlinfo->mouse_face_beg_col = -1;
- hlinfo->mouse_face_end_row
- = hlinfo->mouse_face_end_col = -1;
- hlinfo->mouse_face_window = Qnil;
- hlinfo->mouse_face_mouse_frame = 0;
- }
+ reset_mouse_highlight (hlinfo);
unblock_input ();
}
@@ -9826,7 +9812,6 @@
struct terminal *terminal;
struct x_display_info *dpyinfo;
XrmDatabase xrdb;
- Mouse_HLInfo *hlinfo;
ptrdiff_t lim;
block_input ();
@@ -9967,8 +9952,6 @@
/* We have definitely succeeded. Record the new connection. */
dpyinfo = xzalloc (sizeof *dpyinfo);
- hlinfo = &dpyinfo->mouse_highlight;
-
terminal = x_create_terminal (dpyinfo);
{
@@ -10082,13 +10065,10 @@
dpyinfo->cmap = DefaultColormapOfScreen (dpyinfo->screen);
dpyinfo->root_window = RootWindowOfScreen (dpyinfo->screen);
dpyinfo->icon_bitmap_id = -1;
- hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
- hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
- hlinfo->mouse_face_face_id = DEFAULT_FACE_ID;
- hlinfo->mouse_face_window = Qnil;
- hlinfo->mouse_face_overlay = Qnil;
dpyinfo->wm_type = X_WMTYPE_UNKNOWN;
+ reset_mouse_highlight (&dpyinfo->mouse_highlight);
+
/* See if we can construct pixel values from RGB values. */
if (dpyinfo->visual->class == TrueColor)
{
=== modified file 'src/xterm.h'
--- a/src/xterm.h 2013-08-13 15:29:25 +0000
+++ b/src/xterm.h 2013-08-27 03:52:21 +0000
@@ -20,6 +20,8 @@
#ifndef XTERM_H
#define XTERM_H
+#include "dispextern.h"
+
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r114017: * lisp.h (Mouse_HLInfo): Move from here...,
Dmitry Antipov <=