diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2014-05-28 17:53:22 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2014-05-28 17:53:22 +0400 |
commit | 2b5113740643a2243e56d0878e179aef634adf38 (patch) | |
tree | 22db63baeac1dc08bb339873d96b725c5d870965 /src/w32term.c | |
parent | 8e6abb850674e59f5aba56bb28edade1a2ac0b47 (diff) | |
download | emacs-2b5113740643a2243e56d0878e179aef634adf38.tar.gz |
Refactor mouse positioning stuff to avoid code duplication.
* frame.h (frame_char_to_pixel_position): New function.
(x_set_mouse_position): Rename to...
(frame_set_mouse_position): ...new function.
(frame_set_mouse_pixel_position): Add prototype.
* nsterm.m, w32term.c, xterm.c (x_set_mouse_pixel_position):
Rename to frame_set_mouse_pixel_position.
* frame.c (Fset_mouse_pixel_position, Fset_mouse_position):
Adjust users.
* xterm.h, w32term.h ( x_set_mouse_position)
(x_set_mouse_pixel_position): Remove prototypes.
Diffstat (limited to 'src/w32term.c')
-rw-r--r-- | src/w32term.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/src/w32term.c b/src/w32term.c index 59e9b0ad8a1..5145c840c71 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -5767,27 +5767,8 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b /* Mouse warping. */ -void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y); - -void -x_set_mouse_position (struct frame *f, int x, int y) -{ - int pix_x, pix_y; - - pix_x = FRAME_COL_TO_PIXEL_X (f, x) + FRAME_COLUMN_WIDTH (f) / 2; - pix_y = FRAME_LINE_TO_PIXEL_Y (f, y) + FRAME_LINE_HEIGHT (f) / 2; - - if (pix_x < 0) pix_x = 0; - if (pix_x > FRAME_PIXEL_WIDTH (f)) pix_x = FRAME_PIXEL_WIDTH (f); - - if (pix_y < 0) pix_y = 0; - if (pix_y > FRAME_PIXEL_HEIGHT (f)) pix_y = FRAME_PIXEL_HEIGHT (f); - - x_set_mouse_pixel_position (f, pix_x, pix_y); -} - void -x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y) +frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y) { RECT rect; POINT pt; |