diff options
| author | Richard M. Stallman | 1993-12-31 13:28:05 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-12-31 13:28:05 +0000 |
| commit | bc1ed4864c867d164db72bc962cd31b278bba021 (patch) | |
| tree | cd06be78c73908a85e1f3c09ebc2fde8661c57fe /src/frame.c | |
| parent | b41f6027fd38ed76289692984f9e43bee8b80be2 (diff) | |
| download | emacs-bc1ed4864c867d164db72bc962cd31b278bba021.tar.gz emacs-bc1ed4864c867d164db72bc962cd31b278bba021.zip | |
Always include termhooks.h.
[! MULTI_FRAME] (Fmouse_position): New definition.
[! MULTI_FRAME] (syms_of_frame): Add mouse-position.
Diffstat (limited to 'src/frame.c')
| -rw-r--r-- | src/frame.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/frame.c b/src/frame.c index f5a24a41f2f..a400fa4eadf 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -22,12 +22,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 22 | #include <config.h> | 22 | #include <config.h> |
| 23 | #include "lisp.h" | 23 | #include "lisp.h" |
| 24 | #include "frame.h" | 24 | #include "frame.h" |
| 25 | #include "termhooks.h" | ||
| 25 | 26 | ||
| 26 | #ifdef MULTI_FRAME | 27 | #ifdef MULTI_FRAME |
| 27 | 28 | ||
| 28 | #include "buffer.h" | 29 | #include "buffer.h" |
| 29 | #include "window.h" | 30 | #include "window.h" |
| 30 | #include "termhooks.h" | ||
| 31 | 31 | ||
| 32 | /* These help us bind and responding to switch-frame events. */ | 32 | /* These help us bind and responding to switch-frame events. */ |
| 33 | #include "commands.h" | 33 | #include "commands.h" |
| @@ -1715,6 +1715,35 @@ but that the idea of the actual width of the screen should not be changed.") | |||
| 1715 | return Qnil; | 1715 | return Qnil; |
| 1716 | } | 1716 | } |
| 1717 | 1717 | ||
| 1718 | DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0, | ||
| 1719 | "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\ | ||
| 1720 | The position is given in character cells, where (0, 0) is the\n\ | ||
| 1721 | upper-left corner.\n\ | ||
| 1722 | If Emacs is running on a mouseless terminal or hasn't been programmed\n\ | ||
| 1723 | to read the mouse position, it returns the selected frame for FRAME\n\ | ||
| 1724 | and nil for X and Y.") | ||
| 1725 | () | ||
| 1726 | { | ||
| 1727 | FRAME_PTR f; | ||
| 1728 | Lisp_Object lispy_dummy; | ||
| 1729 | enum scroll_bar_part party_dummy; | ||
| 1730 | Lisp_Object x, y; | ||
| 1731 | unsigned long long_dummy; | ||
| 1732 | |||
| 1733 | f = selected_frame; | ||
| 1734 | x = y = Qnil; | ||
| 1735 | |||
| 1736 | /* It's okay for the hook to refrain from storing anything. */ | ||
| 1737 | if (mouse_position_hook) | ||
| 1738 | (*mouse_position_hook) (&f, | ||
| 1739 | &lispy_dummy, &party_dummy, | ||
| 1740 | &x, &y, | ||
| 1741 | &long_dummy); | ||
| 1742 | |||
| 1743 | /* Always return nil for frame. */ | ||
| 1744 | return Fcons (Qnil, Fcons (x, y)); | ||
| 1745 | } | ||
| 1746 | |||
| 1718 | syms_of_frame () | 1747 | syms_of_frame () |
| 1719 | { | 1748 | { |
| 1720 | defsubr (&Sselected_frame); | 1749 | defsubr (&Sselected_frame); |
| @@ -1732,6 +1761,7 @@ syms_of_frame () | |||
| 1732 | Ffset (intern ("screen-height"), intern ("frame-height")); | 1761 | Ffset (intern ("screen-height"), intern ("frame-height")); |
| 1733 | defsubr (&Sframe_width); | 1762 | defsubr (&Sframe_width); |
| 1734 | Ffset (intern ("screen-width"), intern ("frame-width")); | 1763 | Ffset (intern ("screen-width"), intern ("frame-width")); |
| 1764 | defsubr (&Smouse_position); | ||
| 1735 | } | 1765 | } |
| 1736 | 1766 | ||
| 1737 | keys_of_frame () | 1767 | keys_of_frame () |