aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2005-03-16 03:26:37 +0000
committerYAMAMOTO Mitsuharu2005-03-16 03:26:37 +0000
commit901a6b035e69b9b8630dd4b756201a8f96cce348 (patch)
treea0db6d1a76968765b7a57db00d1297d1e730f222 /src
parentaf6e9e853c0dd5f73903fc647bdbd9d4bd1827fa (diff)
downloademacs-901a6b035e69b9b8630dd4b756201a8f96cce348.tar.gz
emacs-901a6b035e69b9b8630dd4b756201a8f96cce348.zip
(Qhyper, Qsuper, Qmeta, Qalt, Qctrl, Qcontrol, Qshift): Remove unused
variables. (syms_of_macfns): Don't initialize them. Likewise for Qface_set_after_frame_default. Defvar and initialize Vx_window_horizontal_drag_shape. (x_set_mouse_color): Change mouse pointer shape. (mac_window) [!MAC_OSX]: Create root control. (mac_window): Remove initializations of mouse pointer shapes. (hourglass_started): New function (from xfns.c). (start_hourglass, cancel_hourglass): Put function body in #ifdef MAC_OSX. (show_hourglass) [TARGET_API_MAC_CARBON]: Create progress indicator for each non-tooltip frame if needed, and show it. (hide_hourglass) [TARGET_API_MAC_CARBON]: Hide progress indicators.
Diffstat (limited to 'src')
-rw-r--r--src/macfns.c328
1 files changed, 135 insertions, 193 deletions
diff --git a/src/macfns.c b/src/macfns.c
index d90344dc1d0..dc4aa584f87 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -149,13 +149,6 @@ Lisp_Object Qnone;
149Lisp_Object Qsuppress_icon; 149Lisp_Object Qsuppress_icon;
150Lisp_Object Qundefined_color; 150Lisp_Object Qundefined_color;
151Lisp_Object Qcancel_timer; 151Lisp_Object Qcancel_timer;
152Lisp_Object Qhyper;
153Lisp_Object Qsuper;
154Lisp_Object Qmeta;
155Lisp_Object Qalt;
156Lisp_Object Qctrl;
157Lisp_Object Qcontrol;
158Lisp_Object Qshift;
159 152
160extern Lisp_Object Vwindow_system_version; 153extern Lisp_Object Vwindow_system_version;
161 154
@@ -1453,148 +1446,99 @@ x_set_mouse_color (f, arg, oldval)
1453 struct frame *f; 1446 struct frame *f;
1454 Lisp_Object arg, oldval; 1447 Lisp_Object arg, oldval;
1455{ 1448{
1449 struct x_output *x = f->output_data.x;
1450 Display *dpy = FRAME_MAC_DISPLAY (f);
1456 Cursor cursor, nontext_cursor, mode_cursor, hand_cursor; 1451 Cursor cursor, nontext_cursor, mode_cursor, hand_cursor;
1457 int count; 1452 Cursor hourglass_cursor, horizontal_drag_cursor;
1458 int mask_color; 1453 unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
1459 1454 unsigned long mask_color = x->background_pixel;
1460 if (!EQ (Qnil, arg))
1461 f->output_data.mac->mouse_pixel
1462 = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
1463 mask_color = FRAME_BACKGROUND_PIXEL (f);
1464 1455
1465 /* Don't let pointers be invisible. */ 1456 /* Don't let pointers be invisible. */
1466 if (mask_color == f->output_data.mac->mouse_pixel 1457 if (mask_color == pixel)
1467 && mask_color == FRAME_BACKGROUND_PIXEL (f)) 1458 pixel = x->foreground_pixel;
1468 f->output_data.mac->mouse_pixel = FRAME_FOREGROUND_PIXEL (f);
1469
1470#if 0 /* MAC_TODO : cursor changes */
1471 BLOCK_INPUT;
1472 1459
1473 /* It's not okay to crash if the user selects a screwy cursor. */ 1460 f->output_data.mac->mouse_pixel = pixel;
1474 count = x_catch_errors (FRAME_W32_DISPLAY (f));
1475 1461
1476 if (!EQ (Qnil, Vx_pointer_shape)) 1462 if (!NILP (Vx_pointer_shape))
1477 { 1463 {
1478 CHECK_NUMBER (Vx_pointer_shape); 1464 CHECK_NUMBER (Vx_pointer_shape);
1479 cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XINT (Vx_pointer_shape)); 1465 cursor = XINT (Vx_pointer_shape);
1480 } 1466 }
1481 else 1467 else
1482 cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_xterm); 1468 cursor = kThemeIBeamCursor;
1483 x_check_errors (FRAME_W32_DISPLAY (f), "bad text pointer cursor: %s");
1484 1469
1485 if (!EQ (Qnil, Vx_nontext_pointer_shape)) 1470 if (!NILP (Vx_nontext_pointer_shape))
1486 { 1471 {
1487 CHECK_NUMBER (Vx_nontext_pointer_shape); 1472 CHECK_NUMBER (Vx_nontext_pointer_shape);
1488 nontext_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), 1473 nontext_cursor = XINT (Vx_nontext_pointer_shape);
1489 XINT (Vx_nontext_pointer_shape));
1490 } 1474 }
1491 else 1475 else
1492 nontext_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_left_ptr); 1476 nontext_cursor = kThemeArrowCursor;
1493 x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s");
1494 1477
1495 if (!EQ (Qnil, Vx_hourglass_pointer_shape)) 1478 if (!NILP (Vx_hourglass_pointer_shape))
1496 { 1479 {
1497 CHECK_NUMBER (Vx_hourglass_pointer_shape); 1480 CHECK_NUMBER (Vx_hourglass_pointer_shape);
1498 hourglass_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), 1481 hourglass_cursor = XINT (Vx_hourglass_pointer_shape);
1499 XINT (Vx_hourglass_pointer_shape));
1500 } 1482 }
1501 else 1483 else
1502 hourglass_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_watch); 1484 hourglass_cursor = kThemeWatchCursor;
1503 x_check_errors (FRAME_W32_DISPLAY (f), "bad busy pointer cursor: %s");
1504 1485
1505 x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s"); 1486 if (!NILP (Vx_mode_pointer_shape))
1506 if (!EQ (Qnil, Vx_mode_pointer_shape))
1507 { 1487 {
1508 CHECK_NUMBER (Vx_mode_pointer_shape); 1488 CHECK_NUMBER (Vx_mode_pointer_shape);
1509 mode_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), 1489 mode_cursor = XINT (Vx_mode_pointer_shape);
1510 XINT (Vx_mode_pointer_shape));
1511 } 1490 }
1512 else 1491 else
1513 mode_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_xterm); 1492 mode_cursor = kThemeArrowCursor;
1514 x_check_errors (FRAME_W32_DISPLAY (f), "bad modeline pointer cursor: %s");
1515 1493
1516 if (!EQ (Qnil, Vx_sensitive_text_pointer_shape)) 1494 if (!NILP (Vx_sensitive_text_pointer_shape))
1517 { 1495 {
1518 CHECK_NUMBER (Vx_sensitive_text_pointer_shape); 1496 CHECK_NUMBER (Vx_sensitive_text_pointer_shape);
1519 hand_cursor 1497 hand_cursor = XINT (Vx_sensitive_text_pointer_shape);
1520 = XCreateFontCursor (FRAME_W32_DISPLAY (f),
1521 XINT (Vx_sensitive_text_pointer_shape));
1522 } 1498 }
1523 else 1499 else
1524 hand_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_crosshair); 1500 hand_cursor = kThemePointingHandCursor;
1525 1501
1526 if (!NILP (Vx_window_horizontal_drag_shape)) 1502 if (!NILP (Vx_window_horizontal_drag_shape))
1527 { 1503 {
1528 CHECK_NUMBER (Vx_window_horizontal_drag_shape); 1504 CHECK_NUMBER (Vx_window_horizontal_drag_shape);
1529 horizontal_drag_cursor 1505 horizontal_drag_cursor = XINT (Vx_window_horizontal_drag_shape);
1530 = XCreateFontCursor (FRAME_W32_DISPLAY (f),
1531 XINT (Vx_window_horizontal_drag_shape));
1532 } 1506 }
1533 else 1507 else
1534 horizontal_drag_cursor 1508 horizontal_drag_cursor = kThemeResizeLeftRightCursor;
1535 = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_sb_h_double_arrow);
1536
1537 /* Check and report errors with the above calls. */
1538 x_check_errors (FRAME_W32_DISPLAY (f), "can't set cursor shape: %s");
1539 x_uncatch_errors (FRAME_W32_DISPLAY (f), count);
1540 1509
1510#if 0 /* MAC_TODO: cursor color changes */
1541 { 1511 {
1542 XColor fore_color, back_color; 1512 XColor fore_color, back_color;
1543 1513
1544 fore_color.pixel = f->output_data.w32->mouse_pixel; 1514 fore_color.pixel = f->output_data.mac->mouse_pixel;
1515 x_query_color (f, &fore_color);
1545 back_color.pixel = mask_color; 1516 back_color.pixel = mask_color;
1546 XQueryColor (FRAME_W32_DISPLAY (f), 1517 x_query_color (f, &back_color);
1547 DefaultColormap (FRAME_W32_DISPLAY (f), 1518
1548 DefaultScreen (FRAME_W32_DISPLAY (f))), 1519 XRecolorCursor (dpy, cursor, &fore_color, &back_color);
1549 &fore_color); 1520 XRecolorCursor (dpy, nontext_cursor, &fore_color, &back_color);
1550 XQueryColor (FRAME_W32_DISPLAY (f), 1521 XRecolorCursor (dpy, mode_cursor, &fore_color, &back_color);
1551 DefaultColormap (FRAME_W32_DISPLAY (f), 1522 XRecolorCursor (dpy, hand_cursor, &fore_color, &back_color);
1552 DefaultScreen (FRAME_W32_DISPLAY (f))), 1523 XRecolorCursor (dpy, hourglass_cursor, &fore_color, &back_color);
1553 &back_color); 1524 XRecolorCursor (dpy, horizontal_drag_cursor, &fore_color, &back_color);
1554 XRecolorCursor (FRAME_W32_DISPLAY (f), cursor,
1555 &fore_color, &back_color);
1556 XRecolorCursor (FRAME_W32_DISPLAY (f), nontext_cursor,
1557 &fore_color, &back_color);
1558 XRecolorCursor (FRAME_W32_DISPLAY (f), mode_cursor,
1559 &fore_color, &back_color);
1560 XRecolorCursor (FRAME_W32_DISPLAY (f), hand_cursor,
1561 &fore_color, &back_color);
1562 XRecolorCursor (FRAME_W32_DISPLAY (f), hourglass_cursor,
1563 &fore_color, &back_color);
1564 } 1525 }
1526#endif
1565 1527
1566 if (FRAME_W32_WINDOW (f) != 0) 1528 BLOCK_INPUT;
1567 XDefineCursor (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), cursor);
1568
1569 if (cursor != f->output_data.w32->text_cursor && f->output_data.w32->text_cursor != 0)
1570 XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->text_cursor);
1571 f->output_data.w32->text_cursor = cursor;
1572
1573 if (nontext_cursor != f->output_data.w32->nontext_cursor
1574 && f->output_data.w32->nontext_cursor != 0)
1575 XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->nontext_cursor);
1576 f->output_data.w32->nontext_cursor = nontext_cursor;
1577
1578 if (hourglass_cursor != f->output_data.w32->hourglass_cursor
1579 && f->output_data.w32->hourglass_cursor != 0)
1580 XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->hourglass_cursor);
1581 f->output_data.w32->hourglass_cursor = hourglass_cursor;
1582 1529
1583 if (mode_cursor != f->output_data.w32->modeline_cursor 1530 rif->define_frame_cursor (f, cursor);
1584 && f->output_data.w32->modeline_cursor != 0)
1585 XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->modeline_cursor);
1586 f->output_data.w32->modeline_cursor = mode_cursor;
1587 1531
1588 if (hand_cursor != f->output_data.w32->hand_cursor 1532 f->output_data.mac->text_cursor = cursor;
1589 && f->output_data.w32->hand_cursor != 0) 1533 f->output_data.mac->nontext_cursor = nontext_cursor;
1590 XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->hand_cursor); 1534 f->output_data.mac->hourglass_cursor = hourglass_cursor;
1591 f->output_data.w32->hand_cursor = hand_cursor; 1535 f->output_data.mac->modeline_cursor = mode_cursor;
1536 f->output_data.mac->hand_cursor = hand_cursor;
1537 f->output_data.mac->horizontal_drag_cursor = horizontal_drag_cursor;
1592 1538
1593 XFlush (FRAME_W32_DISPLAY (f));
1594 UNBLOCK_INPUT; 1539 UNBLOCK_INPUT;
1595 1540
1596 update_face_from_frame_parameter (f, Qmouse_color, arg); 1541 update_face_from_frame_parameter (f, Qmouse_color, arg);
1597#endif /* MAC_TODO */
1598} 1542}
1599 1543
1600void 1544void
@@ -2327,6 +2271,18 @@ mac_window (f)
2327 /* so that update events can find this mac_output struct */ 2271 /* so that update events can find this mac_output struct */
2328 f->output_data.mac->mFP = f; /* point back to emacs frame */ 2272 f->output_data.mac->mFP = f; /* point back to emacs frame */
2329 2273
2274#ifndef MAC_OSX
2275 if (FRAME_MAC_WINDOW (f))
2276 {
2277 ControlRef root_control;
2278
2279 if (CreateRootControl (FRAME_MAC_WINDOW (f), &root_control) != noErr)
2280 {
2281 DisposeWindow (FRAME_MAC_WINDOW (f));
2282 FRAME_MAC_WINDOW (f) = NULL;
2283 }
2284 }
2285#endif
2330 if (FRAME_MAC_WINDOW (f)) 2286 if (FRAME_MAC_WINDOW (f))
2331 XSetWindowBackground (FRAME_MAC_DISPLAY(f), FRAME_MAC_WINDOW (f), 2287 XSetWindowBackground (FRAME_MAC_DISPLAY(f), FRAME_MAC_WINDOW (f),
2332 FRAME_BACKGROUND_PIXEL (f)); 2288 FRAME_BACKGROUND_PIXEL (f));
@@ -2775,22 +2731,6 @@ This function is an internal primitive--use `make-frame' instead. */)
2775 2731
2776 f->output_data.mac->parent_desc = FRAME_MAC_DISPLAY_INFO (f)->root_window; 2732 f->output_data.mac->parent_desc = FRAME_MAC_DISPLAY_INFO (f)->root_window;
2777 2733
2778#if TARGET_API_MAC_CARBON
2779 f->output_data.mac->text_cursor = kThemeIBeamCursor;
2780 f->output_data.mac->nontext_cursor = kThemeArrowCursor;
2781 f->output_data.mac->modeline_cursor = kThemeArrowCursor;
2782 f->output_data.mac->hand_cursor = kThemePointingHandCursor;
2783 f->output_data.mac->hourglass_cursor = kThemeWatchCursor;
2784 f->output_data.mac->horizontal_drag_cursor = kThemeResizeLeftRightCursor;
2785#else
2786 f->output_data.mac->text_cursor = GetCursor (iBeamCursor);
2787 f->output_data.mac->nontext_cursor = &arrow_cursor;
2788 f->output_data.mac->modeline_cursor = &arrow_cursor;
2789 f->output_data.mac->hand_cursor = &arrow_cursor;
2790 f->output_data.mac->hourglass_cursor = GetCursor (watchCursor);
2791 f->output_data.mac->horizontal_drag_cursor = &arrow_cursor;
2792#endif
2793
2794 /* Compute the size of the window. */ 2734 /* Compute the size of the window. */
2795 window_prompting = x_figure_window_size (f, parms, 1); 2735 window_prompting = x_figure_window_size (f, parms, 1);
2796 2736
@@ -3475,7 +3415,7 @@ value. */)
3475 3415
3476 3416
3477/*********************************************************************** 3417/***********************************************************************
3478 Hourglass cursor 3418 Busy cursor
3479 ***********************************************************************/ 3419 ***********************************************************************/
3480 3420
3481/* If non-null, an asynchronous timer that, when it expires, displays 3421/* If non-null, an asynchronous timer that, when it expires, displays
@@ -3501,13 +3441,21 @@ static Lisp_Object Vhourglass_delay;
3501static void show_hourglass P_ ((struct atimer *)); 3441static void show_hourglass P_ ((struct atimer *));
3502static void hide_hourglass P_ ((void)); 3442static void hide_hourglass P_ ((void));
3503 3443
3444/* Return non-zero if houglass timer has been started or hourglass is shown. */
3445
3446int
3447hourglass_started ()
3448{
3449 return hourglass_shown_p || hourglass_atimer != NULL;
3450}
3451
3504 3452
3505/* Cancel a currently active hourglass timer, and start a new one. */ 3453/* Cancel a currently active hourglass timer, and start a new one. */
3506 3454
3507void 3455void
3508start_hourglass () 3456start_hourglass ()
3509{ 3457{
3510#if 0 /* MAC_TODO: cursor shape changes. */ 3458#ifdef MAC_OSX
3511 EMACS_TIME delay; 3459 EMACS_TIME delay;
3512 int secs, usecs = 0; 3460 int secs, usecs = 0;
3513 3461
@@ -3530,16 +3478,17 @@ start_hourglass ()
3530 EMACS_SET_SECS_USECS (delay, secs, usecs); 3478 EMACS_SET_SECS_USECS (delay, secs, usecs);
3531 hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay, 3479 hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay,
3532 show_hourglass, NULL); 3480 show_hourglass, NULL);
3533#endif /* MAC_TODO */ 3481#endif /* MAC_OSX */
3534} 3482}
3535 3483
3536 3484
3537/* Cancel the hourglass cursor timer if active, hide an hourglass 3485/* Cancel the hourglass cursor timer if active, hide a busy cursor if
3538 cursor if shown. */ 3486 shown. */
3539 3487
3540void 3488void
3541cancel_hourglass () 3489cancel_hourglass ()
3542{ 3490{
3491#ifdef MAC_OSX
3543 if (hourglass_atimer) 3492 if (hourglass_atimer)
3544 { 3493 {
3545 cancel_atimer (hourglass_atimer); 3494 cancel_atimer (hourglass_atimer);
@@ -3548,22 +3497,22 @@ cancel_hourglass ()
3548 3497
3549 if (hourglass_shown_p) 3498 if (hourglass_shown_p)
3550 hide_hourglass (); 3499 hide_hourglass ();
3500#endif /* MAC_OSX */
3551} 3501}
3552 3502
3553 3503
3554/* Timer function of hourglass_atimer. TIMER is equal to 3504/* Timer function of hourglass_atimer. TIMER is equal to
3555 hourglass_atimer. 3505 hourglass_atimer.
3556 3506
3557 Display an hourglass cursor on all frames by mapping the frames' 3507 On Mac, busy status is shown by the progress indicator (chasing
3558 hourglass_window. Set the hourglass_p flag in the frames' 3508 arrows) at the upper-right corner of each frame instead of the
3559 output_data.x structure to indicate that an hourglass cursor is 3509 hourglass pointer. */
3560 shown on the frames. */
3561 3510
3562static void 3511static void
3563show_hourglass (timer) 3512show_hourglass (timer)
3564 struct atimer *timer; 3513 struct atimer *timer;
3565{ 3514{
3566#if 0 /* MAC_TODO: cursor shape changes. */ 3515#if TARGET_API_MAC_CARBON
3567 /* The timer implementation will cancel this timer automatically 3516 /* The timer implementation will cancel this timer automatically
3568 after this function has run. Set hourglass_atimer to null 3517 after this function has run. Set hourglass_atimer to null
3569 so that we know the timer doesn't have to be canceled. */ 3518 so that we know the timer doesn't have to be canceled. */
@@ -3576,46 +3525,44 @@ show_hourglass (timer)
3576 BLOCK_INPUT; 3525 BLOCK_INPUT;
3577 3526
3578 FOR_EACH_FRAME (rest, frame) 3527 FOR_EACH_FRAME (rest, frame)
3579 if (FRAME_W32_P (XFRAME (frame))) 3528 {
3580 { 3529 struct frame *f = XFRAME (frame);
3581 struct frame *f = XFRAME (frame);
3582
3583 f->output_data.w32->hourglass_p = 1;
3584 3530
3585 if (!f->output_data.w32->hourglass_window) 3531 if (FRAME_LIVE_P (f) && FRAME_MAC_P (f)
3586 { 3532 && FRAME_MAC_WINDOW (f) != tip_window)
3587 unsigned long mask = CWCursor; 3533 {
3588 XSetWindowAttributes attrs; 3534 if (!f->output_data.mac->hourglass_control)
3589 3535 {
3590 attrs.cursor = f->output_data.w32->hourglass_cursor; 3536 Window w = FRAME_MAC_WINDOW (f);
3591 3537 Rect r;
3592 f->output_data.w32->hourglass_window 3538 ControlRef c;
3593 = XCreateWindow (FRAME_X_DISPLAY (f), 3539
3594 FRAME_OUTER_WINDOW (f), 3540 GetWindowPortBounds (w, &r);
3595 0, 0, 32000, 32000, 0, 0, 3541 r.left = r.right - HOURGLASS_WIDTH;
3596 InputOnly, 3542 r.bottom = r.top + HOURGLASS_HEIGHT;
3597 CopyFromParent, 3543 if (CreateChasingArrowsControl (w, &r, &c) == noErr)
3598 mask, &attrs); 3544 f->output_data.mac->hourglass_control = c;
3599 } 3545 }
3600 3546
3601 XMapRaised (FRAME_X_DISPLAY (f), 3547 if (f->output_data.mac->hourglass_control)
3602 f->output_data.w32->hourglass_window); 3548 ShowControl (f->output_data.mac->hourglass_control);
3603 XFlush (FRAME_X_DISPLAY (f)); 3549 }
3604 } 3550 }
3605 3551
3606 hourglass_shown_p = 1; 3552 hourglass_shown_p = 1;
3607 UNBLOCK_INPUT; 3553 UNBLOCK_INPUT;
3608 } 3554 }
3609#endif /* MAC_TODO */ 3555#endif /* TARGET_API_MAC_CARBON */
3610} 3556}
3611 3557
3612 3558
3613/* Hide the hourglass cursor on all frames, if it is currently shown. */ 3559/* Hide the progress indicators on all frames, if it is currently
3560 shown. */
3614 3561
3615static void 3562static void
3616hide_hourglass () 3563hide_hourglass ()
3617{ 3564{
3618#if 0 /* MAC_TODO: cursor shape changes. */ 3565#if TARGET_API_MAC_CARBON
3619 if (hourglass_shown_p) 3566 if (hourglass_shown_p)
3620 { 3567 {
3621 Lisp_Object rest, frame; 3568 Lisp_Object rest, frame;
@@ -3625,23 +3572,16 @@ hide_hourglass ()
3625 { 3572 {
3626 struct frame *f = XFRAME (frame); 3573 struct frame *f = XFRAME (frame);
3627 3574
3628 if (FRAME_W32_P (f) 3575 if (FRAME_MAC_P (f)
3629 /* Watch out for newly created frames. */ 3576 /* Watch out for newly created frames. */
3630 && f->output_data.x->hourglass_window) 3577 && f->output_data.mac->hourglass_control)
3631 { 3578 HideControl (f->output_data.mac->hourglass_control);
3632 XUnmapWindow (FRAME_X_DISPLAY (f),
3633 f->output_data.x->hourglass_window);
3634 /* Sync here because XTread_socket looks at the
3635 hourglass_p flag that is reset to zero below. */
3636 XSync (FRAME_X_DISPLAY (f), False);
3637 f->output_data.x->hourglass_p = 0;
3638 }
3639 } 3579 }
3640 3580
3641 hourglass_shown_p = 0; 3581 hourglass_shown_p = 0;
3642 UNBLOCK_INPUT; 3582 UNBLOCK_INPUT;
3643 } 3583 }
3644#endif /* MAC_TODO */ 3584#endif /* TARGET_API_MAC_CARBON */
3645} 3585}
3646 3586
3647 3587
@@ -4487,7 +4427,7 @@ mac_nav_event_callback (selector, parms, data)
4487 Initialization 4427 Initialization
4488 ***********************************************************************/ 4428 ***********************************************************************/
4489 4429
4490/* Keep this list in the same order as frame_parms in frame.c. 4430/* Keep this list in the same order as frame_parms in frame.c.
4491 Use 0 for unsupported frame parameters. */ 4431 Use 0 for unsupported frame parameters. */
4492 4432
4493frame_parm_handler mac_frame_parm_handlers[] = 4433frame_parm_handler mac_frame_parm_handlers[] =
@@ -4545,29 +4485,12 @@ syms_of_macfns ()
4545 staticpro (&Qundefined_color); 4485 staticpro (&Qundefined_color);
4546 Qcancel_timer = intern ("cancel-timer"); 4486 Qcancel_timer = intern ("cancel-timer");
4547 staticpro (&Qcancel_timer); 4487 staticpro (&Qcancel_timer);
4548
4549 Qhyper = intern ("hyper");
4550 staticpro (&Qhyper);
4551 Qsuper = intern ("super");
4552 staticpro (&Qsuper);
4553 Qmeta = intern ("meta");
4554 staticpro (&Qmeta);
4555 Qalt = intern ("alt");
4556 staticpro (&Qalt);
4557 Qctrl = intern ("ctrl");
4558 staticpro (&Qctrl);
4559 Qcontrol = intern ("control");
4560 staticpro (&Qcontrol);
4561 Qshift = intern ("shift");
4562 staticpro (&Qshift);
4563 /* This is the end of symbol initialization. */ 4488 /* This is the end of symbol initialization. */
4564 4489
4565 /* Text property `display' should be nonsticky by default. */ 4490 /* Text property `display' should be nonsticky by default. */
4566 Vtext_property_default_nonsticky 4491 Vtext_property_default_nonsticky
4567 = Fcons (Fcons (Qdisplay, Qt), Vtext_property_default_nonsticky); 4492 = Fcons (Fcons (Qdisplay, Qt), Vtext_property_default_nonsticky);
4568 4493
4569 Qface_set_after_frame_default = intern ("face-set-after-frame-default");
4570 staticpro (&Qface_set_after_frame_default);
4571 4494
4572 Fput (Qundefined_color, Qerror_conditions, 4495 Fput (Qundefined_color, Qerror_conditions,
4573 Fcons (Qundefined_color, Fcons (Qerror, Qnil))); 4496 Fcons (Qundefined_color, Fcons (Qerror, Qnil)));
@@ -4575,39 +4498,58 @@ syms_of_macfns ()
4575 build_string ("Undefined color")); 4498 build_string ("Undefined color"));
4576 4499
4577 DEFVAR_LISP ("x-pointer-shape", &Vx_pointer_shape, 4500 DEFVAR_LISP ("x-pointer-shape", &Vx_pointer_shape,
4578 doc: /* The shape of the pointer when over text. 4501 doc: /* The shape of the pointer when over text.
4579Changing the value does not affect existing frames 4502Changing the value does not affect existing frames
4580unless you set the mouse color. */); 4503unless you set the mouse color. */);
4581 Vx_pointer_shape = Qnil; 4504 Vx_pointer_shape = Qnil;
4582 4505
4506#if 0 /* This doesn't really do anything. */
4507 DEFVAR_LISP ("x-nontext-pointer-shape", &Vx_nontext_pointer_shape,
4508 doc: /* The shape of the pointer when not over text.
4509This variable takes effect when you create a new frame
4510or when you set the mouse color. */);
4511#endif
4583 Vx_nontext_pointer_shape = Qnil; 4512 Vx_nontext_pointer_shape = Qnil;
4584 4513
4585 Vx_mode_pointer_shape = Qnil;
4586
4587 DEFVAR_LISP ("x-hourglass-pointer-shape", &Vx_hourglass_pointer_shape, 4514 DEFVAR_LISP ("x-hourglass-pointer-shape", &Vx_hourglass_pointer_shape,
4588 doc: /* The shape of the pointer when Emacs is hourglass. 4515 doc: /* The shape of the pointer when Emacs is busy.
4589This variable takes effect when you create a new frame 4516This variable takes effect when you create a new frame
4590or when you set the mouse color. */); 4517or when you set the mouse color. */);
4591 Vx_hourglass_pointer_shape = Qnil; 4518 Vx_hourglass_pointer_shape = Qnil;
4592 4519
4593 DEFVAR_BOOL ("display-hourglass", &display_hourglass_p, 4520 DEFVAR_BOOL ("display-hourglass", &display_hourglass_p,
4594 doc: /* Non-zero means Emacs displays an hourglass pointer on window systems. */); 4521 doc: /* Non-zero means Emacs displays an hourglass pointer on window systems. */);
4595 display_hourglass_p = 1; 4522 display_hourglass_p = 1;
4596 4523
4597 DEFVAR_LISP ("hourglass-delay", &Vhourglass_delay, 4524 DEFVAR_LISP ("hourglass-delay", &Vhourglass_delay,
4598 doc: /* *Seconds to wait before displaying an hourglass pointer. 4525 doc: /* *Seconds to wait before displaying an hourglass pointer.
4599Value must be an integer or float. */); 4526Value must be an integer or float. */);
4600 Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY); 4527 Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY);
4601 4528
4529#if 0 /* This doesn't really do anything. */
4530 DEFVAR_LISP ("x-mode-pointer-shape", &Vx_mode_pointer_shape,
4531 doc: /* The shape of the pointer when over the mode line.
4532This variable takes effect when you create a new frame
4533or when you set the mouse color. */);
4534#endif
4535 Vx_mode_pointer_shape = Qnil;
4536
4602 DEFVAR_LISP ("x-sensitive-text-pointer-shape", 4537 DEFVAR_LISP ("x-sensitive-text-pointer-shape",
4603 &Vx_sensitive_text_pointer_shape, 4538 &Vx_sensitive_text_pointer_shape,
4604 doc: /* The shape of the pointer when over mouse-sensitive text. 4539 doc: /* The shape of the pointer when over mouse-sensitive text.
4605This variable takes effect when you create a new frame 4540This variable takes effect when you create a new frame
4606or when you set the mouse color. */); 4541or when you set the mouse color. */);
4607 Vx_sensitive_text_pointer_shape = Qnil; 4542 Vx_sensitive_text_pointer_shape = Qnil;
4608 4543
4544 DEFVAR_LISP ("x-window-horizontal-drag-cursor",
4545 &Vx_window_horizontal_drag_shape,
4546 doc: /* Pointer shape to use for indicating a window can be dragged horizontally.
4547This variable takes effect when you create a new frame
4548or when you set the mouse color. */);
4549 Vx_window_horizontal_drag_shape = Qnil;
4550
4609 DEFVAR_LISP ("x-cursor-fore-pixel", &Vx_cursor_fore_pixel, 4551 DEFVAR_LISP ("x-cursor-fore-pixel", &Vx_cursor_fore_pixel,
4610 doc: /* A string indicating the foreground color of the cursor box. */); 4552 doc: /* A string indicating the foreground color of the cursor box. */);
4611 Vx_cursor_fore_pixel = Qnil; 4553 Vx_cursor_fore_pixel = Qnil;
4612 4554
4613 DEFVAR_LISP ("x-max-tooltip-size", &Vx_max_tooltip_size, 4555 DEFVAR_LISP ("x-max-tooltip-size", &Vx_max_tooltip_size,
@@ -4616,7 +4558,7 @@ Text larger than this is clipped. */);
4616 Vx_max_tooltip_size = Fcons (make_number (80), make_number (40)); 4558 Vx_max_tooltip_size = Fcons (make_number (80), make_number (40));
4617 4559
4618 DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager, 4560 DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager,
4619 doc: /* Non-nil if no window manager is in use. 4561 doc: /* Non-nil if no window manager is in use.
4620Emacs doesn't try to figure this out; this is always nil 4562Emacs doesn't try to figure this out; this is always nil
4621unless you set it to something else. */); 4563unless you set it to something else. */);
4622 /* We don't have any way to find this out, so set it to nil 4564 /* We don't have any way to find this out, so set it to nil
@@ -4625,7 +4567,7 @@ unless you set it to something else. */);
4625 4567
4626 DEFVAR_LISP ("x-pixel-size-width-font-regexp", 4568 DEFVAR_LISP ("x-pixel-size-width-font-regexp",
4627 &Vx_pixel_size_width_font_regexp, 4569 &Vx_pixel_size_width_font_regexp,
4628 doc: /* Regexp matching a font name whose width is the same as `PIXEL_SIZE'. 4570 doc: /* Regexp matching a font name whose width is the same as `PIXEL_SIZE'.
4629 4571
4630Since Emacs gets width of a font matching with this regexp from 4572Since Emacs gets width of a font matching with this regexp from
4631PIXEL_SIZE field of the name, font finding mechanism gets faster for 4573PIXEL_SIZE field of the name, font finding mechanism gets faster for