diff options
| author | YAMAMOTO Mitsuharu | 2006-06-16 08:08:49 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2006-06-16 08:08:49 +0000 |
| commit | e2da5e42129173a6544ec29ceeaafc2b9a7946f0 (patch) | |
| tree | 371107828955c57d487734c99b395e77ba83c668 /src/macfns.c | |
| parent | f4d07c63ec0d0085c3b9d863ab30d6eea3cea31e (diff) | |
| download | emacs-e2da5e42129173a6544ec29ceeaafc2b9a7946f0.tar.gz emacs-e2da5e42129173a6544ec29ceeaafc2b9a7946f0.zip | |
(Fx_display_mm_height, Fx_display_mm_width)
[MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: Use CGDisplayScreenSize.
Diffstat (limited to 'src/macfns.c')
| -rw-r--r-- | src/macfns.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/macfns.c b/src/macfns.c index 752a6a6991c..104dcb0896b 100644 --- a/src/macfns.c +++ b/src/macfns.c | |||
| @@ -3070,11 +3070,20 @@ If omitted or nil, that stands for the selected frame's display. */) | |||
| 3070 | (display) | 3070 | (display) |
| 3071 | Lisp_Object display; | 3071 | Lisp_Object display; |
| 3072 | { | 3072 | { |
| 3073 | /* MAC_TODO: this is an approximation, and only of the main display */ | ||
| 3074 | |||
| 3075 | struct mac_display_info *dpyinfo = check_x_display_info (display); | 3073 | struct mac_display_info *dpyinfo = check_x_display_info (display); |
| 3074 | /* Only of the main display. */ | ||
| 3075 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 | ||
| 3076 | CGSize size; | ||
| 3077 | |||
| 3078 | BLOCK_INPUT; | ||
| 3079 | size = CGDisplayScreenSize (kCGDirectMainDisplay); | ||
| 3080 | UNBLOCK_INPUT; | ||
| 3076 | 3081 | ||
| 3082 | return make_number ((int) (size.height + .5f)); | ||
| 3083 | #else | ||
| 3084 | /* This is an approximation. */ | ||
| 3077 | return make_number ((int) (dpyinfo->height * 25.4 / dpyinfo->resy)); | 3085 | return make_number ((int) (dpyinfo->height * 25.4 / dpyinfo->resy)); |
| 3086 | #endif | ||
| 3078 | } | 3087 | } |
| 3079 | 3088 | ||
| 3080 | DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0, | 3089 | DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0, |
| @@ -3085,11 +3094,20 @@ If omitted or nil, that stands for the selected frame's display. */) | |||
| 3085 | (display) | 3094 | (display) |
| 3086 | Lisp_Object display; | 3095 | Lisp_Object display; |
| 3087 | { | 3096 | { |
| 3088 | /* MAC_TODO: this is an approximation, and only of the main display */ | ||
| 3089 | |||
| 3090 | struct mac_display_info *dpyinfo = check_x_display_info (display); | 3097 | struct mac_display_info *dpyinfo = check_x_display_info (display); |
| 3098 | /* Only of the main display. */ | ||
| 3099 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 | ||
| 3100 | CGSize size; | ||
| 3101 | |||
| 3102 | BLOCK_INPUT; | ||
| 3103 | size = CGDisplayScreenSize (kCGDirectMainDisplay); | ||
| 3104 | UNBLOCK_INPUT; | ||
| 3091 | 3105 | ||
| 3106 | return make_number ((int) (size.width + .5f)); | ||
| 3107 | #else | ||
| 3108 | /* This is an approximation. */ | ||
| 3092 | return make_number ((int) (dpyinfo->width * 25.4 / dpyinfo->resx)); | 3109 | return make_number ((int) (dpyinfo->width * 25.4 / dpyinfo->resx)); |
| 3110 | #endif | ||
| 3093 | } | 3111 | } |
| 3094 | 3112 | ||
| 3095 | DEFUN ("x-display-backing-store", Fx_display_backing_store, | 3113 | DEFUN ("x-display-backing-store", Fx_display_backing_store, |