[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r117184: * frame.c, frame.h (frame_char_to_pixel_pos
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] trunk r117184: * frame.c, frame.h (frame_char_to_pixel_position) |
Date: |
Thu, 29 May 2014 04:47:04 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 117184
revision-id: address@hidden
parent: address@hidden
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Wed 2014-05-28 21:47:01 -0700
message:
* frame.c, frame.h (frame_char_to_pixel_position)
(frame_set_mouse_position): Now static, and made private in
frame.c rather than public in frame.h.
modified:
src/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1438
src/frame.c frame.c-20091113204419-o5vbwnq5f7feedwu-243
src/frame.h frame.h-20091113204419-o5vbwnq5f7feedwu-229
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2014-05-28 13:53:22 +0000
+++ b/src/ChangeLog 2014-05-29 04:47:01 +0000
@@ -1,3 +1,9 @@
+2014-05-29 Paul Eggert <address@hidden>
+
+ * frame.c, frame.h (frame_char_to_pixel_position)
+ (frame_set_mouse_position): Now static, and made private in
+ frame.c rather than public in frame.h.
+
2014-05-28 Dmitry Antipov <address@hidden>
Refactor mouse positioning stuff to avoid code duplication.
=== modified file 'src/frame.c'
--- a/src/frame.c 2014-05-28 13:53:22 +0000
+++ b/src/frame.c 2014-05-29 04:47:01 +0000
@@ -1593,6 +1593,42 @@
return Fcons (lispy_dummy, Fcons (x, y));
}
+#ifdef HAVE_WINDOW_SYSTEM
+
+/* On frame F, convert character coordinates X and Y to pixel
+ coordinates *PIX_X and *PIX_Y. */
+
+static void
+frame_char_to_pixel_position (struct frame *f, int x, int y,
+ int *pix_x, int *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);
+}
+
+/* On frame F, reposition mouse pointer to character coordinates X and Y. */
+
+static void
+frame_set_mouse_position (struct frame *f, int x, int y)
+{
+ int pix_x, pix_y;
+
+ frame_char_to_pixel_position (f, x, y, &pix_x, &pix_y);
+ frame_set_mouse_pixel_position (f, pix_x, pix_y);
+}
+
+#endif /* HAVE_WINDOW_SYSTEM */
+
DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0,
doc: /* Move the mouse pointer to the center of character cell (X,Y) in
FRAME.
Coordinates are relative to the frame, not a window,
=== modified file 'src/frame.h'
--- a/src/frame.h 2014-05-28 15:47:13 +0000
+++ b/src/frame.h 2014-05-29 04:47:01 +0000
@@ -1353,38 +1353,6 @@
}
#endif /* !HAVE_NS */
-
-/* Convert character coordinates X and Y to pixel
- coordinates PIX_X and PIX_Y on frame F. */
-
-INLINE void
-frame_char_to_pixel_position (struct frame *f, int x, int y, int *pix_x, int
*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);
-}
-
-/* Reposition mouse pointer to character coordinates X and Y on frame F. */
-
-INLINE
-void frame_set_mouse_position (struct frame *f, int x, int y)
-{
- int pix_x, pix_y;
-
- frame_char_to_pixel_position (f, x, y, &pix_x, &pix_y);
- frame_set_mouse_pixel_position (f, pix_x, pix_y);
-}
-
#endif /* HAVE_WINDOW_SYSTEM */
INLINE void
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r117184: * frame.c, frame.h (frame_char_to_pixel_position),
Paul Eggert <=