aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2006-05-10 08:24:49 +0000
committerYAMAMOTO Mitsuharu2006-05-10 08:24:49 +0000
commit4cb62a90b30f1952972de4d57cc84a43472ae7b0 (patch)
treec3e190203738581f0bd3776922451cce1c5e87ae /src
parentc2e93c8242f6fcbe10e87a9a7da6171058e7fab0 (diff)
downloademacs-4cb62a90b30f1952972de4d57cc84a43472ae7b0.tar.gz
emacs-4cb62a90b30f1952972de4d57cc84a43472ae7b0.zip
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
[MAC_OSX] (mac_store_service_event): Rename from mac_store_services_event. All callers changed. [USE_MAC_FONT_PANEL] (mac_set_font_info_for_selection): Add args FACE_ID and C. All callers changed. (x_free_frame_resources) [USE_MAC_FONT_PANEL]: Call mac_set_font_info_for_selection when focus frame is destroyed. (XTread_socket): Revert to FrontNonFloatingWindow/FrontWindow.
Diffstat (limited to 'src')
-rw-r--r--src/macterm.c63
1 files changed, 43 insertions, 20 deletions
diff --git a/src/macterm.c b/src/macterm.c
index 5382f7f3160..5ea083894a4 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -4100,7 +4100,7 @@ x_new_focus_frame (dpyinfo, frame)
4100 4100
4101#if USE_MAC_FONT_PANEL 4101#if USE_MAC_FONT_PANEL
4102 if (frame) 4102 if (frame)
4103 mac_set_font_info_for_selection (frame); 4103 mac_set_font_info_for_selection (frame, DEFAULT_FACE_ID, 0);
4104#endif 4104#endif
4105 } 4105 }
4106 4106
@@ -6348,7 +6348,12 @@ x_free_frame_resources (f)
6348 f->output_data.mac = NULL; 6348 f->output_data.mac = NULL;
6349 6349
6350 if (f == dpyinfo->x_focus_frame) 6350 if (f == dpyinfo->x_focus_frame)
6351 dpyinfo->x_focus_frame = 0; 6351 {
6352 dpyinfo->x_focus_frame = 0;
6353#if USE_MAC_FONT_PANEL
6354 mac_set_font_info_for_selection (NULL, DEFAULT_FACE_ID, 0);
6355#endif
6356 }
6352 if (f == dpyinfo->x_focus_event_frame) 6357 if (f == dpyinfo->x_focus_event_frame)
6353 dpyinfo->x_focus_event_frame = 0; 6358 dpyinfo->x_focus_event_frame = 0;
6354 if (f == dpyinfo->x_highlight_frame) 6359 if (f == dpyinfo->x_highlight_frame)
@@ -8316,27 +8321,40 @@ x_find_ccl_program (fontp)
8316 8321
8317#if USE_MAC_FONT_PANEL 8322#if USE_MAC_FONT_PANEL
8318OSStatus 8323OSStatus
8319mac_set_font_info_for_selection (f) 8324mac_set_font_info_for_selection (f, face_id, c)
8320 struct frame *f; 8325 struct frame *f;
8326 int face_id, c;
8321{ 8327{
8322 OSStatus err; 8328 OSStatus err;
8329 EventTargetRef target = NULL;
8330 XFontStruct *font = NULL;
8323 8331
8324 if (f == NULL) 8332 if (f)
8325 err = SetFontInfoForSelection (kFontSelectionATSUIType, 0, NULL, NULL);
8326 else
8327 { 8333 {
8328 struct face *default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); 8334 target = GetWindowEventTarget (FRAME_MAC_WINDOW (f));
8329 XFontStruct *ascii_font = default_face->ascii_face->font;
8330 EventTargetRef target = GetWindowEventTarget (FRAME_MAC_WINDOW (f));
8331 8335
8332 if (ascii_font->mac_fontnum != -1) 8336 if (FRAME_FACE_CACHE (f) && CHAR_VALID_P (c, 0))
8337 {
8338 struct face *face;
8339
8340 face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c);
8341 face = FACE_FROM_ID (f, face_id);
8342 font = face->font;
8343 }
8344 }
8345
8346 if (font == NULL)
8347 err = SetFontInfoForSelection (kFontSelectionATSUIType, 0, NULL, target);
8348 else
8349 {
8350 if (font->mac_fontnum != -1)
8333 { 8351 {
8334 FontSelectionQDStyle qd_style; 8352 FontSelectionQDStyle qd_style;
8335 8353
8336 qd_style.version = kFontSelectionQDStyleVersionZero; 8354 qd_style.version = kFontSelectionQDStyleVersionZero;
8337 qd_style.instance.fontFamily = ascii_font->mac_fontnum; 8355 qd_style.instance.fontFamily = font->mac_fontnum;
8338 qd_style.instance.fontStyle = ascii_font->mac_fontface; 8356 qd_style.instance.fontStyle = font->mac_fontface;
8339 qd_style.size = ascii_font->mac_fontsize; 8357 qd_style.size = font->mac_fontsize;
8340 qd_style.hasColor = false; 8358 qd_style.hasColor = false;
8341 8359
8342 err = SetFontInfoForSelection (kFontSelectionQDType, 8360 err = SetFontInfoForSelection (kFontSelectionQDType,
@@ -8344,7 +8362,7 @@ mac_set_font_info_for_selection (f)
8344 } 8362 }
8345 else 8363 else
8346 err = SetFontInfoForSelection (kFontSelectionATSUIType, 8364 err = SetFontInfoForSelection (kFontSelectionATSUIType,
8347 1, &ascii_font->mac_style, target); 8365 1, &font->mac_style, target);
8348 } 8366 }
8349 8367
8350 return err; 8368 return err;
@@ -8461,7 +8479,7 @@ void remove_drag_handler P_ ((WindowRef));
8461#if USE_CARBON_EVENTS 8479#if USE_CARBON_EVENTS
8462#ifdef MAC_OSX 8480#ifdef MAC_OSX
8463extern void init_service_handler (); 8481extern void init_service_handler ();
8464static Lisp_Object Qservices, Qpaste, Qperform; 8482static Lisp_Object Qservice, Qpaste, Qperform;
8465#endif 8483#endif
8466/* Window Event Handler */ 8484/* Window Event Handler */
8467static pascal OSStatus mac_handle_window_event (EventHandlerCallRef, 8485static pascal OSStatus mac_handle_window_event (EventHandlerCallRef,
@@ -9379,7 +9397,7 @@ mac_handle_font_event (next_handler, event, data)
9379 9397
9380#ifdef MAC_OSX 9398#ifdef MAC_OSX
9381OSStatus 9399OSStatus
9382mac_store_services_event (event) 9400mac_store_service_event (event)
9383 EventRef event; 9401 EventRef event;
9384{ 9402{
9385 OSStatus err; 9403 OSStatus err;
@@ -9412,7 +9430,7 @@ mac_store_services_event (event)
9412 abort (); 9430 abort ();
9413 } 9431 }
9414 9432
9415 err = mac_store_event_ref_as_apple_event (0, 0, Qservices, id_key, 9433 err = mac_store_event_ref_as_apple_event (0, 0, Qservice, id_key,
9416 event, num_params, 9434 event, num_params,
9417 names, types); 9435 names, types);
9418 9436
@@ -9930,8 +9948,13 @@ XTread_socket (sd, expected, hold_quit)
9930 break; 9948 break;
9931 9949
9932 case inContent: 9950 case inContent:
9933 if (dpyinfo->x_focus_frame == NULL 9951 if (
9934 || window_ptr != FRAME_MAC_WINDOW (dpyinfo->x_focus_frame)) 9952#if TARGET_API_MAC_CARBON
9953 FrontNonFloatingWindow ()
9954#else
9955 FrontWindow ()
9956#endif
9957 != window_ptr)
9935 SelectWindow (window_ptr); 9958 SelectWindow (window_ptr);
9936 else 9959 else
9937 { 9960 {
@@ -11034,7 +11057,7 @@ syms_of_macterm ()
11034 Qselection = intern ("selection"); staticpro (&Qselection); 11057 Qselection = intern ("selection"); staticpro (&Qselection);
11035#endif 11058#endif
11036 11059
11037 Qservices = intern ("services"); staticpro (&Qservices); 11060 Qservice = intern ("service"); staticpro (&Qservice);
11038 Qpaste = intern ("paste"); staticpro (&Qpaste); 11061 Qpaste = intern ("paste"); staticpro (&Qpaste);
11039 Qperform = intern ("perform"); staticpro (&Qperform); 11062 Qperform = intern ("perform"); staticpro (&Qperform);
11040#endif 11063#endif