Mercurial > emacs
comparison src/macfns.c @ 70561:083b25be83bd
(x_to_mac_color): Fix shift amount change.
[USE_MAC_FONT_PANEL] (mac_set_font): Use x_get_focus_frame.
[USE_MAC_FONT_PANEL] (Fmac_set_font_panel_visibility): Doc fix.
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
---|---|
date | Wed, 10 May 2006 08:23:45 +0000 |
parents | 6c25fb5679a7 |
children | 625adc75815b b6689e223e2f 146cd8369025 |
comparison
equal
deleted
inserted
replaced
70560:de135c2adb2f | 70561:083b25be83bd |
---|---|
1089 else if (strnicmp(colorname, "rgb:", 4) == 0) | 1089 else if (strnicmp(colorname, "rgb:", 4) == 0) |
1090 { | 1090 { |
1091 char *color; | 1091 char *color; |
1092 unsigned long colorval; | 1092 unsigned long colorval; |
1093 int i, pos; | 1093 int i, pos; |
1094 pos = 0; | 1094 pos = 16; |
1095 | 1095 |
1096 colorval = 0; | 1096 colorval = 0; |
1097 color = colorname + 4; | 1097 color = colorname + 4; |
1098 for (i = 0; i < 3; i++) | 1098 for (i = 0; i < 3; i++) |
1099 { | 1099 { |
1125 value = ULONG_MAX; | 1125 value = ULONG_MAX; |
1126 } | 1126 } |
1127 if (value == ULONG_MAX) | 1127 if (value == ULONG_MAX) |
1128 break; | 1128 break; |
1129 colorval |= (value << pos); | 1129 colorval |= (value << pos); |
1130 pos += 0x8; | 1130 pos -= 0x8; |
1131 if (i == 2) | 1131 if (i == 2) |
1132 { | 1132 { |
1133 if (*end != '\0') | 1133 if (*end != '\0') |
1134 break; | 1134 break; |
1135 UNBLOCK_INPUT; | 1135 UNBLOCK_INPUT; |
1144 { | 1144 { |
1145 /* This is an RGB Intensity specification. */ | 1145 /* This is an RGB Intensity specification. */ |
1146 char *color; | 1146 char *color; |
1147 unsigned long colorval; | 1147 unsigned long colorval; |
1148 int i, pos; | 1148 int i, pos; |
1149 pos = 0; | 1149 pos = 16; |
1150 | 1150 |
1151 colorval = 0; | 1151 colorval = 0; |
1152 color = colorname + 5; | 1152 color = colorname + 5; |
1153 for (i = 0; i < 3; i++) | 1153 for (i = 0; i < 3; i++) |
1154 { | 1154 { |
1166 range between 0.0 and 1.0 inclusive. The next statement | 1166 range between 0.0 and 1.0 inclusive. The next statement |
1167 fixes the 1.0 case. */ | 1167 fixes the 1.0 case. */ |
1168 if (val == 0x100) | 1168 if (val == 0x100) |
1169 val = 0xFF; | 1169 val = 0xFF; |
1170 colorval |= (val << pos); | 1170 colorval |= (val << pos); |
1171 pos += 0x8; | 1171 pos -= 0x8; |
1172 if (i == 2) | 1172 if (i == 2) |
1173 { | 1173 { |
1174 if (*end != '\0') | 1174 if (*end != '\0') |
1175 break; | 1175 break; |
1176 UNBLOCK_INPUT; | 1176 UNBLOCK_INPUT; |
1915 else | 1915 else |
1916 XSETINT (arg, MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH); | 1916 XSETINT (arg, MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH); |
1917 } | 1917 } |
1918 #endif | 1918 #endif |
1919 x_set_scroll_bar_width (f, arg, oldval); | 1919 x_set_scroll_bar_width (f, arg, oldval); |
1920 } | |
1921 | |
1922 static void | |
1923 mac_set_font (f, arg, oldval) | |
1924 struct frame *f; | |
1925 Lisp_Object arg, oldval; | |
1926 { | |
1927 x_set_font (f, arg, oldval); | |
1928 #if USE_MAC_FONT_PANEL | |
1929 { | |
1930 Lisp_Object focus_frame = x_get_focus_frame (f); | |
1931 | |
1932 if ((NILP (focus_frame) && f == SELECTED_FRAME ()) | |
1933 || XFRAME (focus_frame) == f) | |
1934 { | |
1935 BLOCK_INPUT; | |
1936 mac_set_font_info_for_selection (f, DEFAULT_FACE_ID, 0); | |
1937 UNBLOCK_INPUT; | |
1938 } | |
1939 } | |
1940 #endif | |
1920 } | 1941 } |
1921 | 1942 |
1922 #if TARGET_API_MAC_CARBON | 1943 #if TARGET_API_MAC_CARBON |
1923 static void | 1944 static void |
1924 mac_update_proxy_icon (f) | 1945 mac_update_proxy_icon (f) |
2008 SetWindowModified (FRAME_MAC_WINDOW (f), | 2029 SetWindowModified (FRAME_MAC_WINDOW (f), |
2009 !MINI_WINDOW_P (w) && modified_p); | 2030 !MINI_WINDOW_P (w) && modified_p); |
2010 | 2031 |
2011 if (windows_or_buffers_changed) | 2032 if (windows_or_buffers_changed) |
2012 mac_update_proxy_icon (f); | 2033 mac_update_proxy_icon (f); |
2013 #endif | |
2014 } | |
2015 | |
2016 static void | |
2017 mac_set_font (f, arg, oldval) | |
2018 struct frame *f; | |
2019 Lisp_Object arg, oldval; | |
2020 { | |
2021 x_set_font (f, arg, oldval); | |
2022 #if USE_MAC_FONT_PANEL | |
2023 if (FRAME_MAC_DISPLAY_INFO (f)->x_focus_frame == f) | |
2024 { | |
2025 BLOCK_INPUT; | |
2026 mac_set_font_info_for_selection (f); | |
2027 UNBLOCK_INPUT; | |
2028 } | |
2029 #endif | 2034 #endif |
2030 } | 2035 } |
2031 | 2036 |
2032 | 2037 |
2033 /* Subroutines of creating a frame. */ | 2038 /* Subroutines of creating a frame. */ |
4501 } | 4506 } |
4502 | 4507 |
4503 #if USE_MAC_FONT_PANEL | 4508 #if USE_MAC_FONT_PANEL |
4504 DEFUN ("mac-set-font-panel-visibility", Fmac_set_font_panel_visibility, | 4509 DEFUN ("mac-set-font-panel-visibility", Fmac_set_font_panel_visibility, |
4505 Smac_set_font_panel_visibility, 1, 1, 0, | 4510 Smac_set_font_panel_visibility, 1, 1, 0, |
4506 doc: /* Set the font panel visibile if and only if VISIBLE is non-nil. | 4511 doc: /* Make the font panel visible if and only if VISIBLE is non-nil. |
4507 This is for internal use only. Use `mac-font-panel-mode' instead. */) | 4512 This is for internal use only. Use `mac-font-panel-mode' instead. */) |
4508 (visible) | 4513 (visible) |
4509 Lisp_Object visible; | 4514 Lisp_Object visible; |
4510 { | 4515 { |
4511 OSStatus err = noErr; | 4516 OSStatus err = noErr; |