diff options
| author | YAMAMOTO Mitsuharu | 2007-03-26 08:13:45 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2007-03-26 08:13:45 +0000 |
| commit | b51065cf2ed0fdb80719fab58c77c74ec405fbcb (patch) | |
| tree | a30aa0c6c9a01ce5e2c8f0bbde2db051dad60f81 /src/macterm.c | |
| parent | d18bee728dd6de5793f4f656f7621eae74b00ca9 (diff) | |
| download | emacs-b51065cf2ed0fdb80719fab58c77c74ec405fbcb.tar.gz emacs-b51065cf2ed0fdb80719fab58c77c74ec405fbcb.zip | |
(create_text_encoding_info_alist): Move assignments
outside predicate macros.
(mac_initialize_display_info) [MAC_OSX]: dpyinfo->height and
dpyinfo->width are those of whole screen.
Diffstat (limited to 'src/macterm.c')
| -rw-r--r-- | src/macterm.c | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/src/macterm.c b/src/macterm.c index a5a193cb88c..e377d352476 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -7172,11 +7172,14 @@ create_text_encoding_info_alist () | |||
| 7172 | Lisp_Object existing_info; | 7172 | Lisp_Object existing_info; |
| 7173 | 7173 | ||
| 7174 | if (!(CONSP (charset_info) | 7174 | if (!(CONSP (charset_info) |
| 7175 | && STRINGP (charset = XCAR (charset_info)) | 7175 | && (charset = XCAR (charset_info), |
| 7176 | STRINGP (charset)) | ||
| 7176 | && CONSP (XCDR (charset_info)) | 7177 | && CONSP (XCDR (charset_info)) |
| 7177 | && INTEGERP (text_encoding = XCAR (XCDR (charset_info))) | 7178 | && (text_encoding = XCAR (XCDR (charset_info)), |
| 7179 | INTEGERP (text_encoding)) | ||
| 7178 | && CONSP (XCDR (XCDR (charset_info))) | 7180 | && CONSP (XCDR (XCDR (charset_info))) |
| 7179 | && SYMBOLP (coding_system = XCAR (XCDR (XCDR (charset_info)))))) | 7181 | && (coding_system = XCAR (XCDR (XCDR (charset_info))), |
| 7182 | SYMBOLP (coding_system)))) | ||
| 7180 | continue; | 7183 | continue; |
| 7181 | 7184 | ||
| 7182 | existing_info = assq_no_quit (text_encoding, result); | 7185 | existing_info = assq_no_quit (text_encoding, result); |
| @@ -11538,8 +11541,32 @@ mac_initialize_display_info () | |||
| 11538 | but this may not be what is actually used. Mac OSX can do better. */ | 11541 | but this may not be what is actually used. Mac OSX can do better. */ |
| 11539 | dpyinfo->color_p = CGDisplaySamplesPerPixel (kCGDirectMainDisplay) > 1; | 11542 | dpyinfo->color_p = CGDisplaySamplesPerPixel (kCGDirectMainDisplay) > 1; |
| 11540 | dpyinfo->n_planes = CGDisplayBitsPerPixel (kCGDirectMainDisplay); | 11543 | dpyinfo->n_planes = CGDisplayBitsPerPixel (kCGDirectMainDisplay); |
| 11541 | dpyinfo->height = CGDisplayPixelsHigh (kCGDirectMainDisplay); | 11544 | { |
| 11542 | dpyinfo->width = CGDisplayPixelsWide (kCGDirectMainDisplay); | 11545 | CGDisplayErr err; |
| 11546 | CGDisplayCount ndisps; | ||
| 11547 | CGDirectDisplayID *displays; | ||
| 11548 | |||
| 11549 | err = CGGetActiveDisplayList (0, NULL, &ndisps); | ||
| 11550 | if (err == noErr) | ||
| 11551 | { | ||
| 11552 | displays = alloca (sizeof (CGDirectDisplayID) * ndisps); | ||
| 11553 | err = CGGetActiveDisplayList (ndisps, displays, &ndisps); | ||
| 11554 | } | ||
| 11555 | if (err == noErr) | ||
| 11556 | { | ||
| 11557 | CGRect bounds = CGRectMake (0, 0, 0, 0); | ||
| 11558 | |||
| 11559 | while (ndisps-- > 0) | ||
| 11560 | bounds = CGRectUnion (bounds, CGDisplayBounds (displays[ndisps])); | ||
| 11561 | dpyinfo->height = CGRectGetHeight (bounds); | ||
| 11562 | dpyinfo->width = CGRectGetWidth (bounds); | ||
| 11563 | } | ||
| 11564 | else | ||
| 11565 | { | ||
| 11566 | dpyinfo->height = CGDisplayPixelsHigh (kCGDirectMainDisplay); | ||
| 11567 | dpyinfo->width = CGDisplayPixelsWide (kCGDirectMainDisplay); | ||
| 11568 | } | ||
| 11569 | } | ||
| 11543 | #else | 11570 | #else |
| 11544 | { | 11571 | { |
| 11545 | GDHandle main_device_handle = LMGetMainDevice(); | 11572 | GDHandle main_device_handle = LMGetMainDevice(); |