diff options
| author | YAMAMOTO Mitsuharu | 2006-11-14 08:21:57 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2006-11-14 08:21:57 +0000 |
| commit | 3e2d41ea6666e1eefde27c0b1edd75c13ba377d1 (patch) | |
| tree | 35460afbf07dc69111094229639e120e3915b09f | |
| parent | a34abbb04508260b10d866acc0b7f3a92d02330f (diff) | |
| download | emacs-3e2d41ea6666e1eefde27c0b1edd75c13ba377d1.tar.gz emacs-3e2d41ea6666e1eefde27c0b1edd75c13ba377d1.zip | |
(Fx_display_mm_height, Fx_display_mm_width)
[MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
&& MAC_OS_X_VERSION_MIN_REQUIRED == 1020]: Check if
CGDisplayScreenSize is available.
| -rw-r--r-- | src/macfns.c | 56 |
1 files changed, 40 insertions, 16 deletions
diff --git a/src/macfns.c b/src/macfns.c index 9cb9e3e0496..2df3b4e203e 100644 --- a/src/macfns.c +++ b/src/macfns.c | |||
| @@ -3092,18 +3092,30 @@ If omitted or nil, that stands for the selected frame's display. */) | |||
| 3092 | Lisp_Object display; | 3092 | Lisp_Object display; |
| 3093 | { | 3093 | { |
| 3094 | struct mac_display_info *dpyinfo = check_x_display_info (display); | 3094 | struct mac_display_info *dpyinfo = check_x_display_info (display); |
| 3095 | |||
| 3095 | /* Only of the main display. */ | 3096 | /* Only of the main display. */ |
| 3096 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 | 3097 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 |
| 3097 | CGSize size; | 3098 | #if MAC_OS_X_VERSION_MIN_REQUIRED == 1020 |
| 3099 | if (CGDisplayScreenSize != NULL) | ||
| 3100 | #endif | ||
| 3101 | { | ||
| 3102 | CGSize size; | ||
| 3098 | 3103 | ||
| 3099 | BLOCK_INPUT; | 3104 | BLOCK_INPUT; |
| 3100 | size = CGDisplayScreenSize (kCGDirectMainDisplay); | 3105 | size = CGDisplayScreenSize (kCGDirectMainDisplay); |
| 3101 | UNBLOCK_INPUT; | 3106 | UNBLOCK_INPUT; |
| 3102 | 3107 | ||
| 3103 | return make_number ((int) (size.height + .5f)); | 3108 | return make_number ((int) (size.height + .5f)); |
| 3104 | #else | 3109 | } |
| 3105 | /* This is an approximation. */ | 3110 | #if MAC_OS_X_VERSION_MIN_REQUIRED == 1020 |
| 3106 | return make_number ((int) (dpyinfo->height * 25.4 / dpyinfo->resy)); | 3111 | else |
| 3112 | #endif | ||
| 3113 | #endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */ | ||
| 3114 | #if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 || MAC_OS_X_VERSION_MIN_REQUIRED == 1020 | ||
| 3115 | { | ||
| 3116 | /* This is an approximation. */ | ||
| 3117 | return make_number ((int) (dpyinfo->height * 25.4 / dpyinfo->resy)); | ||
| 3118 | } | ||
| 3107 | #endif | 3119 | #endif |
| 3108 | } | 3120 | } |
| 3109 | 3121 | ||
| @@ -3116,18 +3128,30 @@ If omitted or nil, that stands for the selected frame's display. */) | |||
| 3116 | Lisp_Object display; | 3128 | Lisp_Object display; |
| 3117 | { | 3129 | { |
| 3118 | struct mac_display_info *dpyinfo = check_x_display_info (display); | 3130 | struct mac_display_info *dpyinfo = check_x_display_info (display); |
| 3131 | |||
| 3119 | /* Only of the main display. */ | 3132 | /* Only of the main display. */ |
| 3120 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 | 3133 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 |
| 3121 | CGSize size; | 3134 | #if MAC_OS_X_VERSION_MIN_REQUIRED == 1020 |
| 3135 | if (CGDisplayScreenSize != NULL) | ||
| 3136 | #endif | ||
| 3137 | { | ||
| 3138 | CGSize size; | ||
| 3122 | 3139 | ||
| 3123 | BLOCK_INPUT; | 3140 | BLOCK_INPUT; |
| 3124 | size = CGDisplayScreenSize (kCGDirectMainDisplay); | 3141 | size = CGDisplayScreenSize (kCGDirectMainDisplay); |
| 3125 | UNBLOCK_INPUT; | 3142 | UNBLOCK_INPUT; |
| 3126 | 3143 | ||
| 3127 | return make_number ((int) (size.width + .5f)); | 3144 | return make_number ((int) (size.width + .5f)); |
| 3128 | #else | 3145 | } |
| 3129 | /* This is an approximation. */ | 3146 | #if MAC_OS_X_VERSION_MIN_REQUIRED == 1020 |
| 3130 | return make_number ((int) (dpyinfo->width * 25.4 / dpyinfo->resx)); | 3147 | else |
| 3148 | #endif | ||
| 3149 | #endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */ | ||
| 3150 | #if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 || MAC_OS_X_VERSION_MIN_REQUIRED == 1020 | ||
| 3151 | { | ||
| 3152 | /* This is an approximation. */ | ||
| 3153 | return make_number ((int) (dpyinfo->width * 25.4 / dpyinfo->resx)); | ||
| 3154 | } | ||
| 3131 | #endif | 3155 | #endif |
| 3132 | } | 3156 | } |
| 3133 | 3157 | ||