Mercurial > emacs
comparison src/macterm.c @ 76746:d3898ad6d0d5
(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.
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
---|---|
date | Mon, 26 Mar 2007 08:13:27 +0000 |
parents | 12069a316614 |
children | a2c0f9d173e8 4ef881a120fe |
comparison
equal
deleted
inserted
replaced
76745:f6a525134188 | 76746:d3898ad6d0d5 |
---|---|
7170 Lisp_Object charset_info = XCAR (rest); | 7170 Lisp_Object charset_info = XCAR (rest); |
7171 Lisp_Object charset, coding_system, text_encoding; | 7171 Lisp_Object charset, coding_system, text_encoding; |
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); |
7183 if (NILP (existing_info)) | 7186 if (NILP (existing_info)) |
7184 result = Fcons (list3 (text_encoding, coding_system, charset), | 7187 result = Fcons (list3 (text_encoding, coding_system, charset), |
11536 #ifdef MAC_OSX | 11539 #ifdef MAC_OSX |
11537 /* HasDepth returns true if it is possible to have a 32 bit display, | 11540 /* HasDepth returns true if it is possible to have a 32 bit display, |
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(); |
11546 | 11573 |
11547 dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType); | 11574 dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType); |