diff options
| author | YAMAMOTO Mitsuharu | 2005-03-16 03:29:13 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2005-03-16 03:29:13 +0000 |
| commit | b69efa2333a8096506c84add62caf1d2084a20a5 (patch) | |
| tree | 685f9ecdf9069d4e98ecbdd47751626bba3224ff /src | |
| parent | 2f063626d3398bbe02ca76e11be49c2f40c1a460 (diff) | |
| download | emacs-b69efa2333a8096506c84add62caf1d2084a20a5.tar.gz emacs-b69efa2333a8096506c84add62caf1d2084a20a5.zip | |
(activate_scroll_bars, deactivate_scroll_bars): Remove functions and
declarations.
(mac_set_colors): Take argument for saving background color. All
callers changed.
(XDrawLine, XClearArea, mac_draw_bitmap, XFillRectangle)
(mac_draw_rectangle, mac_draw_string_common): Save and Restore
background color.
(x_update_end, mac_do_track_drag): Don't reset background color.
(mac_define_frame_cursor) [!TARGET_API_MAC_CARBON]: Use
SetThemeCursor.
(x_set_window_size) [TARGET_API_MAC_CARBON]: Move progress indicator
control to the upper-right corner of the window.
(arrow_cursor) [!TARGET_API_MAC_CARBON]: Remove variable.
(do_init_managers) [!TARGET_API_MAC_CARBON]: Don't initialize it.
(do_window_update): Update controls after updating content area.
(mac_handle_window_event): Remove unused extern.
(XTread_socket): Check both control handle and control part code to
determine whether a scroll bar is clicked. Activate/deactivate root
control instead of contained scroll bar controls.
(make_mac_terminal_frame): Use ThemeCursor constants.
Diffstat (limited to 'src')
| -rw-r--r-- | src/macterm.c | 155 |
1 files changed, 53 insertions, 102 deletions
diff --git a/src/macterm.c b/src/macterm.c index 0700779bded..9af39dcb1fd 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -290,9 +290,6 @@ static void x_update_begin P_ ((struct frame *)); | |||
| 290 | static void x_update_window_begin P_ ((struct window *)); | 290 | static void x_update_window_begin P_ ((struct window *)); |
| 291 | static void x_after_update_window_line P_ ((struct glyph_row *)); | 291 | static void x_after_update_window_line P_ ((struct glyph_row *)); |
| 292 | 292 | ||
| 293 | void activate_scroll_bars (FRAME_PTR); | ||
| 294 | void deactivate_scroll_bars (FRAME_PTR); | ||
| 295 | |||
| 296 | static int is_emacs_window (WindowPtr); | 293 | static int is_emacs_window (WindowPtr); |
| 297 | 294 | ||
| 298 | int x_bitmap_icon (struct frame *, Lisp_Object); | 295 | int x_bitmap_icon (struct frame *, Lisp_Object); |
| @@ -350,8 +347,12 @@ mac_set_backcolor (unsigned long color) | |||
| 350 | commands. Assume that the graphic port has already been set. */ | 347 | commands. Assume that the graphic port has already been set. */ |
| 351 | 348 | ||
| 352 | static void | 349 | static void |
| 353 | mac_set_colors (GC gc) | 350 | mac_set_colors (gc, bg_save) |
| 351 | GC gc; | ||
| 352 | RGBColor *bg_save; | ||
| 354 | { | 353 | { |
| 354 | if (bg_save) | ||
| 355 | GetBackColor (bg_save); | ||
| 355 | mac_set_forecolor (gc->foreground); | 356 | mac_set_forecolor (gc->foreground); |
| 356 | mac_set_backcolor (gc->background); | 357 | mac_set_backcolor (gc->background); |
| 357 | } | 358 | } |
| @@ -365,12 +366,16 @@ XDrawLine (display, w, gc, x1, y1, x2, y2) | |||
| 365 | GC gc; | 366 | GC gc; |
| 366 | int x1, y1, x2, y2; | 367 | int x1, y1, x2, y2; |
| 367 | { | 368 | { |
| 369 | RGBColor old_bg; | ||
| 370 | |||
| 368 | SetPortWindowPort (w); | 371 | SetPortWindowPort (w); |
| 369 | 372 | ||
| 370 | mac_set_colors (gc); | 373 | mac_set_colors (gc, &old_bg); |
| 371 | 374 | ||
| 372 | MoveTo (x1, y1); | 375 | MoveTo (x1, y1); |
| 373 | LineTo (x2, y2); | 376 | LineTo (x2, y2); |
| 377 | |||
| 378 | RGBBackColor (&old_bg); | ||
| 374 | } | 379 | } |
| 375 | 380 | ||
| 376 | void | 381 | void |
| @@ -386,7 +391,7 @@ mac_draw_line_to_pixmap (display, p, gc, x1, y1, x2, y2) | |||
| 386 | GetGWorld (&old_port, &old_gdh); | 391 | GetGWorld (&old_port, &old_gdh); |
| 387 | SetGWorld (p, NULL); | 392 | SetGWorld (p, NULL); |
| 388 | 393 | ||
| 389 | mac_set_colors (gc); | 394 | mac_set_colors (gc, NULL); |
| 390 | 395 | ||
| 391 | LockPixels (GetGWorldPixMap (p)); | 396 | LockPixels (GetGWorldPixMap (p)); |
| 392 | MoveTo (x1, y1); | 397 | MoveTo (x1, y1); |
| @@ -409,16 +414,19 @@ XClearArea (display, w, x, y, width, height, exposures) | |||
| 409 | struct mac_output *mwp = (mac_output *) GetWRefCon (w); | 414 | struct mac_output *mwp = (mac_output *) GetWRefCon (w); |
| 410 | Rect r; | 415 | Rect r; |
| 411 | XGCValues xgc; | 416 | XGCValues xgc; |
| 417 | RGBColor old_bg; | ||
| 412 | 418 | ||
| 413 | xgc.foreground = mwp->x_compatible.foreground_pixel; | 419 | xgc.foreground = mwp->x_compatible.foreground_pixel; |
| 414 | xgc.background = mwp->x_compatible.background_pixel; | 420 | xgc.background = mwp->x_compatible.background_pixel; |
| 415 | 421 | ||
| 416 | SetPortWindowPort (w); | 422 | SetPortWindowPort (w); |
| 417 | 423 | ||
| 418 | mac_set_colors (&xgc); | 424 | mac_set_colors (&xgc, &old_bg); |
| 419 | SetRect (&r, x, y, x + width, y + height); | 425 | SetRect (&r, x, y, x + width, y + height); |
| 420 | 426 | ||
| 421 | EraseRect (&r); | 427 | EraseRect (&r); |
| 428 | |||
| 429 | RGBBackColor (&old_bg); | ||
| 422 | } | 430 | } |
| 423 | 431 | ||
| 424 | /* Mac version of XClearWindow. */ | 432 | /* Mac version of XClearWindow. */ |
| @@ -436,7 +444,7 @@ XClearWindow (display, w) | |||
| 436 | 444 | ||
| 437 | SetPortWindowPort (w); | 445 | SetPortWindowPort (w); |
| 438 | 446 | ||
| 439 | mac_set_colors (&xgc); | 447 | mac_set_colors (&xgc, NULL); |
| 440 | 448 | ||
| 441 | #if TARGET_API_MAC_CARBON | 449 | #if TARGET_API_MAC_CARBON |
| 442 | { | 450 | { |
| @@ -464,6 +472,7 @@ mac_draw_bitmap (display, w, gc, x, y, width, height, bits, overlay_p) | |||
| 464 | { | 472 | { |
| 465 | BitMap bitmap; | 473 | BitMap bitmap; |
| 466 | Rect r; | 474 | Rect r; |
| 475 | RGBColor old_bg; | ||
| 467 | 476 | ||
| 468 | bitmap.rowBytes = sizeof(unsigned short); | 477 | bitmap.rowBytes = sizeof(unsigned short); |
| 469 | bitmap.baseAddr = (char *)bits; | 478 | bitmap.baseAddr = (char *)bits; |
| @@ -471,7 +480,7 @@ mac_draw_bitmap (display, w, gc, x, y, width, height, bits, overlay_p) | |||
| 471 | 480 | ||
| 472 | SetPortWindowPort (w); | 481 | SetPortWindowPort (w); |
| 473 | 482 | ||
| 474 | mac_set_colors (gc); | 483 | mac_set_colors (gc, &old_bg); |
| 475 | SetRect (&r, x, y, x + width, y + height); | 484 | SetRect (&r, x, y, x + width, y + height); |
| 476 | 485 | ||
| 477 | #if TARGET_API_MAC_CARBON | 486 | #if TARGET_API_MAC_CARBON |
| @@ -483,6 +492,8 @@ mac_draw_bitmap (display, w, gc, x, y, width, height, bits, overlay_p) | |||
| 483 | CopyBits (&bitmap, &(w->portBits), &(bitmap.bounds), &r, | 492 | CopyBits (&bitmap, &(w->portBits), &(bitmap.bounds), &r, |
| 484 | overlay_p ? srcOr : srcCopy, 0); | 493 | overlay_p ? srcOr : srcCopy, 0); |
| 485 | #endif /* not TARGET_API_MAC_CARBON */ | 494 | #endif /* not TARGET_API_MAC_CARBON */ |
| 495 | |||
| 496 | RGBBackColor (&old_bg); | ||
| 486 | } | 497 | } |
| 487 | 498 | ||
| 488 | 499 | ||
| @@ -631,13 +642,16 @@ XFillRectangle (display, w, gc, x, y, width, height) | |||
| 631 | unsigned int width, height; | 642 | unsigned int width, height; |
| 632 | { | 643 | { |
| 633 | Rect r; | 644 | Rect r; |
| 645 | RGBColor old_bg; | ||
| 634 | 646 | ||
| 635 | SetPortWindowPort (w); | 647 | SetPortWindowPort (w); |
| 636 | 648 | ||
| 637 | mac_set_colors (gc); | 649 | mac_set_colors (gc, &old_bg); |
| 638 | SetRect (&r, x, y, x + width, y + height); | 650 | SetRect (&r, x, y, x + width, y + height); |
| 639 | 651 | ||
| 640 | PaintRect (&r); /* using foreground color of gc */ | 652 | PaintRect (&r); /* using foreground color of gc */ |
| 653 | |||
| 654 | RGBBackColor (&old_bg); | ||
| 641 | } | 655 | } |
| 642 | 656 | ||
| 643 | 657 | ||
| @@ -656,7 +670,7 @@ mac_fill_rectangle_to_pixmap (display, p, gc, x, y, width, height) | |||
| 656 | 670 | ||
| 657 | GetGWorld (&old_port, &old_gdh); | 671 | GetGWorld (&old_port, &old_gdh); |
| 658 | SetGWorld (p, NULL); | 672 | SetGWorld (p, NULL); |
| 659 | mac_set_colors (gc); | 673 | mac_set_colors (gc, NULL); |
| 660 | SetRect (&r, x, y, x + width, y + height); | 674 | SetRect (&r, x, y, x + width, y + height); |
| 661 | 675 | ||
| 662 | LockPixels (GetGWorldPixMap (p)); | 676 | LockPixels (GetGWorldPixMap (p)); |
| @@ -679,13 +693,16 @@ mac_draw_rectangle (display, w, gc, x, y, width, height) | |||
| 679 | unsigned int width, height; | 693 | unsigned int width, height; |
| 680 | { | 694 | { |
| 681 | Rect r; | 695 | Rect r; |
| 696 | RGBColor old_bg; | ||
| 682 | 697 | ||
| 683 | SetPortWindowPort (w); | 698 | SetPortWindowPort (w); |
| 684 | 699 | ||
| 685 | mac_set_colors (gc); | 700 | mac_set_colors (gc, &old_bg); |
| 686 | SetRect (&r, x, y, x + width + 1, y + height + 1); | 701 | SetRect (&r, x, y, x + width + 1, y + height + 1); |
| 687 | 702 | ||
| 688 | FrameRect (&r); /* using foreground color of gc */ | 703 | FrameRect (&r); /* using foreground color of gc */ |
| 704 | |||
| 705 | RGBBackColor (&old_bg); | ||
| 689 | } | 706 | } |
| 690 | 707 | ||
| 691 | 708 | ||
| @@ -706,7 +723,7 @@ mac_draw_rectangle_to_pixmap (display, p, gc, x, y, width, height) | |||
| 706 | 723 | ||
| 707 | GetGWorld (&old_port, &old_gdh); | 724 | GetGWorld (&old_port, &old_gdh); |
| 708 | SetGWorld (p, NULL); | 725 | SetGWorld (p, NULL); |
| 709 | mac_set_colors (gc); | 726 | mac_set_colors (gc, NULL); |
| 710 | SetRect (&r, x, y, x + width + 1, y + height + 1); | 727 | SetRect (&r, x, y, x + width + 1, y + height + 1); |
| 711 | 728 | ||
| 712 | LockPixels (GetGWorldPixMap (p)); | 729 | LockPixels (GetGWorldPixMap (p)); |
| @@ -728,6 +745,8 @@ mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode, | |||
| 728 | char *buf; | 745 | char *buf; |
| 729 | int nchars, mode, bytes_per_char; | 746 | int nchars, mode, bytes_per_char; |
| 730 | { | 747 | { |
| 748 | RGBColor old_bg; | ||
| 749 | |||
| 731 | SetPortWindowPort (w); | 750 | SetPortWindowPort (w); |
| 732 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 | 751 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 |
| 733 | UInt32 textFlags, savedFlags; | 752 | UInt32 textFlags, savedFlags; |
| @@ -737,7 +756,7 @@ mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode, | |||
| 737 | } | 756 | } |
| 738 | #endif | 757 | #endif |
| 739 | 758 | ||
| 740 | mac_set_colors (gc); | 759 | mac_set_colors (gc, &old_bg); |
| 741 | 760 | ||
| 742 | TextFont (gc->font->mac_fontnum); | 761 | TextFont (gc->font->mac_fontnum); |
| 743 | TextSize (gc->font->mac_fontsize); | 762 | TextSize (gc->font->mac_fontsize); |
| @@ -746,6 +765,8 @@ mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode, | |||
| 746 | 765 | ||
| 747 | MoveTo (x, y); | 766 | MoveTo (x, y); |
| 748 | DrawText (buf, 0, nchars * bytes_per_char); | 767 | DrawText (buf, 0, nchars * bytes_per_char); |
| 768 | |||
| 769 | RGBBackColor (&old_bg); | ||
| 749 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 | 770 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 |
| 750 | if (!NILP(Vmac_use_core_graphics)) | 771 | if (!NILP(Vmac_use_core_graphics)) |
| 751 | SwapQDTextFlags(savedFlags); | 772 | SwapQDTextFlags(savedFlags); |
| @@ -933,7 +954,7 @@ mac_scroll_area (display, w, gc, src_x, src_y, width, height, dest_x, dest_y) | |||
| 933 | 954 | ||
| 934 | SetPort (w); | 955 | SetPort (w); |
| 935 | #if 0 | 956 | #if 0 |
| 936 | mac_set_colors (gc); | 957 | mac_set_colors (gc, NULL); |
| 937 | #endif | 958 | #endif |
| 938 | 959 | ||
| 939 | SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); | 960 | SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); |
| @@ -955,7 +976,7 @@ mac_scroll_area (display, w, gc, src_x, src_y, width, height, dest_x, dest_y) | |||
| 955 | BackColor (whiteColor); | 976 | BackColor (whiteColor); |
| 956 | CopyBits (&(w->portBits), &(w->portBits), &src_r, &dest_r, srcCopy, 0); | 977 | CopyBits (&(w->portBits), &(w->portBits), &src_r, &dest_r, srcCopy, 0); |
| 957 | 978 | ||
| 958 | mac_set_colors (gc); | 979 | mac_set_colors (gc, NULL); |
| 959 | #endif | 980 | #endif |
| 960 | #endif /* not TARGET_API_MAC_CARBON */ | 981 | #endif /* not TARGET_API_MAC_CARBON */ |
| 961 | } | 982 | } |
| @@ -1395,13 +1416,6 @@ x_update_end (f) | |||
| 1395 | FRAME_MAC_DISPLAY_INFO (f)->mouse_face_defer = 0; | 1416 | FRAME_MAC_DISPLAY_INFO (f)->mouse_face_defer = 0; |
| 1396 | 1417 | ||
| 1397 | BLOCK_INPUT; | 1418 | BLOCK_INPUT; |
| 1398 | /* Reset the background color of Mac OS Window to that of the frame after | ||
| 1399 | update so that it is used by Mac Toolbox to clear the update region before | ||
| 1400 | an update event is generated. */ | ||
| 1401 | SetPortWindowPort (FRAME_MAC_WINDOW (f)); | ||
| 1402 | |||
| 1403 | mac_set_backcolor (FRAME_BACKGROUND_PIXEL (f)); | ||
| 1404 | |||
| 1405 | #if TARGET_API_MAC_CARBON | 1419 | #if TARGET_API_MAC_CARBON |
| 1406 | EnableScreenUpdates (); | 1420 | EnableScreenUpdates (); |
| 1407 | #endif | 1421 | #endif |
| @@ -4471,50 +4485,6 @@ XTjudge_scroll_bars (f) | |||
| 4471 | } | 4485 | } |
| 4472 | 4486 | ||
| 4473 | 4487 | ||
| 4474 | void | ||
| 4475 | activate_scroll_bars (frame) | ||
| 4476 | FRAME_PTR frame; | ||
| 4477 | { | ||
| 4478 | Lisp_Object bar; | ||
| 4479 | ControlHandle ch; | ||
| 4480 | |||
| 4481 | bar = FRAME_SCROLL_BARS (frame); | ||
| 4482 | while (! NILP (bar)) | ||
| 4483 | { | ||
| 4484 | ch = SCROLL_BAR_CONTROL_HANDLE (XSCROLL_BAR (bar)); | ||
| 4485 | #if 1 /* TARGET_API_MAC_CARBON */ | ||
| 4486 | ActivateControl (ch); | ||
| 4487 | #else | ||
| 4488 | SetControlMaximum (ch, | ||
| 4489 | VERTICAL_SCROLL_BAR_TOP_RANGE (frame, | ||
| 4490 | XINT (XSCROLL_BAR (bar) | ||
| 4491 | ->height)) - 1); | ||
| 4492 | #endif | ||
| 4493 | bar = XSCROLL_BAR (bar)->next; | ||
| 4494 | } | ||
| 4495 | } | ||
| 4496 | |||
| 4497 | |||
| 4498 | void | ||
| 4499 | deactivate_scroll_bars (frame) | ||
| 4500 | FRAME_PTR frame; | ||
| 4501 | { | ||
| 4502 | Lisp_Object bar; | ||
| 4503 | ControlHandle ch; | ||
| 4504 | |||
| 4505 | bar = FRAME_SCROLL_BARS (frame); | ||
| 4506 | while (! NILP (bar)) | ||
| 4507 | { | ||
| 4508 | ch = SCROLL_BAR_CONTROL_HANDLE (XSCROLL_BAR (bar)); | ||
| 4509 | #if 1 /* TARGET_API_MAC_CARBON */ | ||
| 4510 | DeactivateControl (ch); | ||
| 4511 | #else | ||
| 4512 | SetControlMaximum (ch, -1); | ||
| 4513 | #endif | ||
| 4514 | bar = XSCROLL_BAR (bar)->next; | ||
| 4515 | } | ||
| 4516 | } | ||
| 4517 | |||
| 4518 | /* Handle a mouse click on the scroll bar BAR. If *EMACS_EVENT's kind | 4488 | /* Handle a mouse click on the scroll bar BAR. If *EMACS_EVENT's kind |
| 4519 | is set to something other than NO_EVENT, it is enqueued. | 4489 | is set to something other than NO_EVENT, it is enqueued. |
| 4520 | 4490 | ||
| @@ -4845,11 +4815,7 @@ mac_define_frame_cursor (f, cursor) | |||
| 4845 | struct frame *f; | 4815 | struct frame *f; |
| 4846 | Cursor cursor; | 4816 | Cursor cursor; |
| 4847 | { | 4817 | { |
| 4848 | #if TARGET_API_MAC_CARBON | ||
| 4849 | SetThemeCursor (cursor); | 4818 | SetThemeCursor (cursor); |
| 4850 | #else | ||
| 4851 | SetCursor (*cursor); | ||
| 4852 | #endif | ||
| 4853 | } | 4819 | } |
| 4854 | 4820 | ||
| 4855 | 4821 | ||
| @@ -5274,6 +5240,11 @@ x_set_window_size (f, change_gravity, cols, rows) | |||
| 5274 | x_wm_set_size_hint (f, (long) 0, 0); | 5240 | x_wm_set_size_hint (f, (long) 0, 0); |
| 5275 | 5241 | ||
| 5276 | SizeWindow (FRAME_MAC_WINDOW (f), pixelwidth, pixelheight, 0); | 5242 | SizeWindow (FRAME_MAC_WINDOW (f), pixelwidth, pixelheight, 0); |
| 5243 | #if TARGET_API_MAC_CARBON | ||
| 5244 | if (f->output_data.mac->hourglass_control) | ||
| 5245 | MoveControl (f->output_data.mac->hourglass_control, | ||
| 5246 | pixelwidth - HOURGLASS_WIDTH, 0); | ||
| 5247 | #endif | ||
| 5277 | 5248 | ||
| 5278 | /* Now, strictly speaking, we can't be sure that this is accurate, | 5249 | /* Now, strictly speaking, we can't be sure that this is accurate, |
| 5279 | but the window manager will get around to dealing with the size | 5250 | but the window manager will get around to dealing with the size |
| @@ -7185,11 +7156,6 @@ Lisp_Object drag_and_drop_file_list; | |||
| 7185 | 7156 | ||
| 7186 | Point saved_menu_event_location; | 7157 | Point saved_menu_event_location; |
| 7187 | 7158 | ||
| 7188 | #if !TARGET_API_MAC_CARBON | ||
| 7189 | /* Place holder for the default arrow cursor. */ | ||
| 7190 | CursPtr arrow_cursor; | ||
| 7191 | #endif | ||
| 7192 | |||
| 7193 | /* Apple Events */ | 7159 | /* Apple Events */ |
| 7194 | static void init_required_apple_events (void); | 7160 | static void init_required_apple_events (void); |
| 7195 | static pascal OSErr | 7161 | static pascal OSErr |
| @@ -7392,8 +7358,6 @@ do_init_managers (void) | |||
| 7392 | InitCursor (); | 7358 | InitCursor (); |
| 7393 | 7359 | ||
| 7394 | #if !TARGET_API_MAC_CARBON | 7360 | #if !TARGET_API_MAC_CARBON |
| 7395 | arrow_cursor = &qd.arrow; | ||
| 7396 | |||
| 7397 | /* set up some extra stack space for use by emacs */ | 7361 | /* set up some extra stack space for use by emacs */ |
| 7398 | SetApplLimit ((Ptr) ((long) GetApplLimit () - EXTRA_STACK_ALLOC)); | 7362 | SetApplLimit ((Ptr) ((long) GetApplLimit () - EXTRA_STACK_ALLOC)); |
| 7399 | 7363 | ||
| @@ -7454,15 +7418,16 @@ do_window_update (WindowPtr win) | |||
| 7454 | RgnHandle region = NewRgn (); | 7418 | RgnHandle region = NewRgn (); |
| 7455 | 7419 | ||
| 7456 | GetPortVisibleRegion (GetWindowPort (win), region); | 7420 | GetPortVisibleRegion (GetWindowPort (win), region); |
| 7457 | UpdateControls (win, region); | ||
| 7458 | GetRegionBounds (region, &r); | 7421 | GetRegionBounds (region, &r); |
| 7422 | expose_frame (f, r.left, r.top, r.right - r.left, r.bottom - r.top); | ||
| 7423 | UpdateControls (win, region); | ||
| 7459 | DisposeRgn (region); | 7424 | DisposeRgn (region); |
| 7460 | } | 7425 | } |
| 7461 | #else | 7426 | #else |
| 7462 | UpdateControls (win, win->visRgn); | ||
| 7463 | r = (*win->visRgn)->rgnBBox; | 7427 | r = (*win->visRgn)->rgnBBox; |
| 7464 | #endif | ||
| 7465 | expose_frame (f, r.left, r.top, r.right - r.left, r.bottom - r.top); | 7428 | expose_frame (f, r.left, r.top, r.right - r.left, r.bottom - r.top); |
| 7429 | UpdateControls (win, win->visRgn); | ||
| 7430 | #endif | ||
| 7466 | 7431 | ||
| 7467 | handling_window_update = 0; | 7432 | handling_window_update = 0; |
| 7468 | } | 7433 | } |
| @@ -7955,8 +7920,6 @@ mac_handle_window_event (next_handler, event, data) | |||
| 7955 | EventRef event; | 7920 | EventRef event; |
| 7956 | void *data; | 7921 | void *data; |
| 7957 | { | 7922 | { |
| 7958 | extern Lisp_Object Qcontrol; | ||
| 7959 | |||
| 7960 | WindowPtr wp; | 7923 | WindowPtr wp; |
| 7961 | OSStatus result; | 7924 | OSStatus result; |
| 7962 | UInt32 attributes; | 7925 | UInt32 attributes; |
| @@ -8226,7 +8189,6 @@ mac_do_track_drag (DragTrackingMessage message, WindowPtr window, | |||
| 8226 | Rect r; | 8189 | Rect r; |
| 8227 | struct frame *f = mac_window_to_frame (window); | 8190 | struct frame *f = mac_window_to_frame (window); |
| 8228 | 8191 | ||
| 8229 | mac_set_backcolor (FRAME_BACKGROUND_PIXEL (f)); | ||
| 8230 | GetWindowPortBounds (window, &r); | 8192 | GetWindowPortBounds (window, &r); |
| 8231 | OffsetRect (&r, -r.left, -r.top); | 8193 | OffsetRect (&r, -r.left, -r.top); |
| 8232 | RectRgn (hilite_rgn, &r); | 8194 | RectRgn (hilite_rgn, &r); |
| @@ -8244,7 +8206,6 @@ mac_do_track_drag (DragTrackingMessage message, WindowPtr window, | |||
| 8244 | { | 8206 | { |
| 8245 | struct frame *f = mac_window_to_frame (window); | 8207 | struct frame *f = mac_window_to_frame (window); |
| 8246 | 8208 | ||
| 8247 | mac_set_backcolor (FRAME_BACKGROUND_PIXEL (f)); | ||
| 8248 | HideDragHilite (theDrag); | 8209 | HideDragHilite (theDrag); |
| 8249 | SetThemeCursor (kThemeArrowCursor); | 8210 | SetThemeCursor (kThemeArrowCursor); |
| 8250 | } | 8211 | } |
| @@ -8736,12 +8697,9 @@ XTread_socket (sd, expected, hold_quit) | |||
| 8736 | /* ticks to milliseconds */ | 8697 | /* ticks to milliseconds */ |
| 8737 | 8698 | ||
| 8738 | if (dpyinfo->grabbed && tracked_scroll_bar | 8699 | if (dpyinfo->grabbed && tracked_scroll_bar |
| 8739 | #if TARGET_API_MAC_CARBON | 8700 | /* control_part_code becomes kControlNoPart if |
| 8740 | || ch != 0 | 8701 | a progress indicator is clicked. */ |
| 8741 | #else | 8702 | || ch != 0 && control_part_code != kControlNoPart) |
| 8742 | || control_part_code != 0 | ||
| 8743 | #endif | ||
| 8744 | ) | ||
| 8745 | { | 8703 | { |
| 8746 | struct scroll_bar *bar; | 8704 | struct scroll_bar *bar; |
| 8747 | 8705 | ||
| @@ -8910,6 +8868,7 @@ XTread_socket (sd, expected, hold_quit) | |||
| 8910 | case activateEvt: | 8868 | case activateEvt: |
| 8911 | { | 8869 | { |
| 8912 | WindowPtr window_ptr = (WindowPtr) er.message; | 8870 | WindowPtr window_ptr = (WindowPtr) er.message; |
| 8871 | ControlRef root_control; | ||
| 8913 | 8872 | ||
| 8914 | #if USE_CARBON_EVENTS | 8873 | #if USE_CARBON_EVENTS |
| 8915 | if (SendEventToEventTarget (eventRef, toolbox_dispatcher) | 8874 | if (SendEventToEventTarget (eventRef, toolbox_dispatcher) |
| @@ -8926,6 +8885,7 @@ XTread_socket (sd, expected, hold_quit) | |||
| 8926 | break; | 8885 | break; |
| 8927 | 8886 | ||
| 8928 | f = mac_window_to_frame (window_ptr); | 8887 | f = mac_window_to_frame (window_ptr); |
| 8888 | GetRootControl (window_ptr, &root_control); | ||
| 8929 | 8889 | ||
| 8930 | if ((er.modifiers & activeFlag) != 0) | 8890 | if ((er.modifiers & activeFlag) != 0) |
| 8931 | { | 8891 | { |
| @@ -8933,7 +8893,7 @@ XTread_socket (sd, expected, hold_quit) | |||
| 8933 | Point mouse_loc = er.where; | 8893 | Point mouse_loc = er.where; |
| 8934 | 8894 | ||
| 8935 | x_new_focus_frame (dpyinfo, f); | 8895 | x_new_focus_frame (dpyinfo, f); |
| 8936 | activate_scroll_bars (f); | 8896 | ActivateControl (root_control); |
| 8937 | 8897 | ||
| 8938 | SetPortWindowPort (window_ptr); | 8898 | SetPortWindowPort (window_ptr); |
| 8939 | GlobalToLocal (&mouse_loc); | 8899 | GlobalToLocal (&mouse_loc); |
| @@ -8950,7 +8910,7 @@ XTread_socket (sd, expected, hold_quit) | |||
| 8950 | if (f == dpyinfo->x_focus_frame) | 8910 | if (f == dpyinfo->x_focus_frame) |
| 8951 | { | 8911 | { |
| 8952 | x_new_focus_frame (dpyinfo, 0); | 8912 | x_new_focus_frame (dpyinfo, 0); |
| 8953 | deactivate_scroll_bars (f); | 8913 | DeactivateControl (root_control); |
| 8954 | } | 8914 | } |
| 8955 | 8915 | ||
| 8956 | 8916 | ||
| @@ -9288,21 +9248,12 @@ make_mac_terminal_frame (struct frame *f) | |||
| 9288 | f->output_data.mac->mouse_pixel = 0xff00ff; | 9248 | f->output_data.mac->mouse_pixel = 0xff00ff; |
| 9289 | f->output_data.mac->cursor_foreground_pixel = 0x0000ff; | 9249 | f->output_data.mac->cursor_foreground_pixel = 0x0000ff; |
| 9290 | 9250 | ||
| 9291 | #if TARGET_API_MAC_CARBON | ||
| 9292 | f->output_data.mac->text_cursor = kThemeIBeamCursor; | 9251 | f->output_data.mac->text_cursor = kThemeIBeamCursor; |
| 9293 | f->output_data.mac->nontext_cursor = kThemeArrowCursor; | 9252 | f->output_data.mac->nontext_cursor = kThemeArrowCursor; |
| 9294 | f->output_data.mac->modeline_cursor = kThemeArrowCursor; | 9253 | f->output_data.mac->modeline_cursor = kThemeArrowCursor; |
| 9295 | f->output_data.mac->hand_cursor = kThemePointingHandCursor; | 9254 | f->output_data.mac->hand_cursor = kThemePointingHandCursor; |
| 9296 | f->output_data.mac->hourglass_cursor = kThemeWatchCursor; | 9255 | f->output_data.mac->hourglass_cursor = kThemeWatchCursor; |
| 9297 | f->output_data.mac->horizontal_drag_cursor = kThemeResizeLeftRightCursor; | 9256 | f->output_data.mac->horizontal_drag_cursor = kThemeResizeLeftRightCursor; |
| 9298 | #else | ||
| 9299 | f->output_data.mac->text_cursor = GetCursor (iBeamCursor); | ||
| 9300 | f->output_data.mac->nontext_cursor = &arrow_cursor; | ||
| 9301 | f->output_data.mac->modeline_cursor = &arrow_cursor; | ||
| 9302 | f->output_data.mac->hand_cursor = &arrow_cursor; | ||
| 9303 | f->output_data.mac->hourglass_cursor = GetCursor (watchCursor); | ||
| 9304 | f->output_data.mac->horizontal_drag_cursor = &arrow_cursor; | ||
| 9305 | #endif | ||
| 9306 | 9257 | ||
| 9307 | FRAME_FONTSET (f) = -1; | 9258 | FRAME_FONTSET (f) = -1; |
| 9308 | f->output_data.mac->explicit_parent = 0; | 9259 | f->output_data.mac->explicit_parent = 0; |