diff options
| author | Michael R. Mauger | 2017-07-24 22:15:04 -0400 |
|---|---|---|
| committer | Michael R. Mauger | 2017-07-24 22:15:04 -0400 |
| commit | df1a71272e5cdd10b511e2ffd702ca50ddd8a773 (patch) | |
| tree | 9b9ac725394ee80891e2bff57b6407d0e491e71a /src/nsfns.m | |
| parent | eb27fc4d49e8c914cd0e6a8a2d02159601542141 (diff) | |
| parent | 32daa3cb54523006c88717cbeac87964cd687a1b (diff) | |
| download | emacs-df1a71272e5cdd10b511e2ffd702ca50ddd8a773.tar.gz emacs-df1a71272e5cdd10b511e2ffd702ca50ddd8a773.zip | |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'src/nsfns.m')
| -rw-r--r-- | src/nsfns.m | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nsfns.m b/src/nsfns.m index 68eba8b6a2e..36748cebb8b 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -3080,6 +3080,25 @@ The coordinates X and Y are interpreted in pixels relative to a position | |||
| 3080 | return Qnil; | 3080 | return Qnil; |
| 3081 | } | 3081 | } |
| 3082 | 3082 | ||
| 3083 | DEFUN ("ns-mouse-absolute-pixel-position", | ||
| 3084 | Fns_mouse_absolute_pixel_position, | ||
| 3085 | Sns_mouse_absolute_pixel_position, 0, 0, 0, | ||
| 3086 | doc: /* Return absolute position of mouse cursor in pixels. | ||
| 3087 | The position is returned as a cons cell (X . Y) of the | ||
| 3088 | coordinates of the mouse cursor position in pixels relative to a | ||
| 3089 | position (0, 0) of the selected frame's terminal. */) | ||
| 3090 | (void) | ||
| 3091 | { | ||
| 3092 | struct frame *f = SELECTED_FRAME (); | ||
| 3093 | EmacsView *view = FRAME_NS_VIEW (f); | ||
| 3094 | NSScreen *screen = [[view window] screen]; | ||
| 3095 | NSPoint pt = [NSEvent mouseLocation]; | ||
| 3096 | |||
| 3097 | return Fcons(make_number(pt.x - screen.frame.origin.x), | ||
| 3098 | make_number(screen.frame.size.height - | ||
| 3099 | (pt.y - screen.frame.origin.y))); | ||
| 3100 | } | ||
| 3101 | |||
| 3083 | /* ========================================================================== | 3102 | /* ========================================================================== |
| 3084 | 3103 | ||
| 3085 | Class implementations | 3104 | Class implementations |
| @@ -3269,6 +3288,7 @@ be used as the image of the icon representing the frame. */); | |||
| 3269 | defsubr (&Sns_frame_list_z_order); | 3288 | defsubr (&Sns_frame_list_z_order); |
| 3270 | defsubr (&Sns_frame_restack); | 3289 | defsubr (&Sns_frame_restack); |
| 3271 | defsubr (&Sns_set_mouse_absolute_pixel_position); | 3290 | defsubr (&Sns_set_mouse_absolute_pixel_position); |
| 3291 | defsubr (&Sns_mouse_absolute_pixel_position); | ||
| 3272 | defsubr (&Sx_display_mm_width); | 3292 | defsubr (&Sx_display_mm_width); |
| 3273 | defsubr (&Sx_display_mm_height); | 3293 | defsubr (&Sx_display_mm_height); |
| 3274 | defsubr (&Sx_display_screens); | 3294 | defsubr (&Sx_display_screens); |