diff options
| author | Karl Heuer | 1995-06-05 12:38:20 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-06-05 12:38:20 +0000 |
| commit | 80534dd61e7c456a3940daf8630fd0d8767fc5ad (patch) | |
| tree | f5dceb6dd532c4caf447177a6de5b67b6b0f31e2 /src | |
| parent | 1152a050f106f94fa7ad076b98bab760cb83c443 (diff) | |
| download | emacs-80534dd61e7c456a3940daf8630fd0d8767fc5ad.tar.gz emacs-80534dd61e7c456a3940daf8630fd0d8767fc5ad.zip | |
(Qicon_name): New variable.
(Fx_create_frame): Look for icon-name parm and set icon_label field.
(x_set_icon_type): Compute arg to x_text_icon
based on frame name and icon_name fields.
(x_set_icon_name): New function.
(x_icon): Call x_text_icon.
(x_set_name): Look at icon_name field when setting the icon name,
(x_frame_parms): Add icon-name.
(syms_of_xfns): Set up Qicon_name.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 84 |
1 files changed, 80 insertions, 4 deletions
diff --git a/src/xfns.c b/src/xfns.c index aedd45c07ca..95bbaa257e5 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -164,6 +164,7 @@ Lisp_Object Qgeometry; | |||
| 164 | Lisp_Object Qicon_left; | 164 | Lisp_Object Qicon_left; |
| 165 | Lisp_Object Qicon_top; | 165 | Lisp_Object Qicon_top; |
| 166 | Lisp_Object Qicon_type; | 166 | Lisp_Object Qicon_type; |
| 167 | Lisp_Object Qicon_name; | ||
| 167 | Lisp_Object Qinternal_border_width; | 168 | Lisp_Object Qinternal_border_width; |
| 168 | Lisp_Object Qleft; | 169 | Lisp_Object Qleft; |
| 169 | Lisp_Object Qmouse_color; | 170 | Lisp_Object Qmouse_color; |
| @@ -639,6 +640,7 @@ void x_set_cursor_color (); | |||
| 639 | void x_set_border_color (); | 640 | void x_set_border_color (); |
| 640 | void x_set_cursor_type (); | 641 | void x_set_cursor_type (); |
| 641 | void x_set_icon_type (); | 642 | void x_set_icon_type (); |
| 643 | void x_set_icon_name (); | ||
| 642 | void x_set_font (); | 644 | void x_set_font (); |
| 643 | void x_set_border_width (); | 645 | void x_set_border_width (); |
| 644 | void x_set_internal_border_width (); | 646 | void x_set_internal_border_width (); |
| @@ -660,6 +662,7 @@ static struct x_frame_parm_table x_frame_parms[] = | |||
| 660 | "border-color", x_set_border_color, | 662 | "border-color", x_set_border_color, |
| 661 | "cursor-type", x_set_cursor_type, | 663 | "cursor-type", x_set_cursor_type, |
| 662 | "icon-type", x_set_icon_type, | 664 | "icon-type", x_set_icon_type, |
| 665 | "icon-name", x_set_icon_name, | ||
| 663 | "font", x_set_font, | 666 | "font", x_set_font, |
| 664 | "border-width", x_set_border_width, | 667 | "border-width", x_set_border_width, |
| 665 | "internal-border-width", x_set_internal_border_width, | 668 | "internal-border-width", x_set_internal_border_width, |
| @@ -1010,6 +1013,7 @@ x_report_frame_params (f, alistptr) | |||
| 1010 | sprintf (buf, "%ld", (long) FRAME_X_WINDOW (f)); | 1013 | sprintf (buf, "%ld", (long) FRAME_X_WINDOW (f)); |
| 1011 | store_in_alist (alistptr, Qwindow_id, | 1014 | store_in_alist (alistptr, Qwindow_id, |
| 1012 | build_string (buf)); | 1015 | build_string (buf)); |
| 1016 | store_in_alist (alistptr, Qicon_name, f->display.x->icon_name); | ||
| 1013 | FRAME_SAMPLE_VISIBILITY (f); | 1017 | FRAME_SAMPLE_VISIBILITY (f); |
| 1014 | store_in_alist (alistptr, Qvisibility, | 1018 | store_in_alist (alistptr, Qvisibility, |
| 1015 | (FRAME_VISIBLE_P (f) ? Qt | 1019 | (FRAME_VISIBLE_P (f) ? Qt |
| @@ -1454,7 +1458,10 @@ x_set_icon_type (f, arg, oldval) | |||
| 1454 | 1458 | ||
| 1455 | BLOCK_INPUT; | 1459 | BLOCK_INPUT; |
| 1456 | if (NILP (arg)) | 1460 | if (NILP (arg)) |
| 1457 | result = x_text_icon (f, 0); | 1461 | result = x_text_icon (f, |
| 1462 | (char *) XSTRING ((!NILP (f->display.x->icon_name) | ||
| 1463 | ? f->display.x->icon_name | ||
| 1464 | : f->name))->data); | ||
| 1458 | else | 1465 | else |
| 1459 | result = x_bitmap_icon (f, arg); | 1466 | result = x_bitmap_icon (f, arg); |
| 1460 | 1467 | ||
| @@ -1493,6 +1500,54 @@ x_icon_type (f) | |||
| 1493 | return Qnil; | 1500 | return Qnil; |
| 1494 | } | 1501 | } |
| 1495 | 1502 | ||
| 1503 | void | ||
| 1504 | x_set_icon_name (f, arg, oldval) | ||
| 1505 | struct frame *f; | ||
| 1506 | Lisp_Object arg, oldval; | ||
| 1507 | { | ||
| 1508 | Lisp_Object tem; | ||
| 1509 | int result; | ||
| 1510 | |||
| 1511 | if (STRINGP (arg)) | ||
| 1512 | { | ||
| 1513 | if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt)) | ||
| 1514 | return; | ||
| 1515 | } | ||
| 1516 | else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil)) | ||
| 1517 | return; | ||
| 1518 | |||
| 1519 | f->display.x->icon_name = arg; | ||
| 1520 | |||
| 1521 | if (f->display.x->icon_bitmap != 0) | ||
| 1522 | return; | ||
| 1523 | |||
| 1524 | BLOCK_INPUT; | ||
| 1525 | |||
| 1526 | result = x_text_icon (f, | ||
| 1527 | (char *) XSTRING ((!NILP (f->display.x->icon_name) | ||
| 1528 | ? f->display.x->icon_name | ||
| 1529 | : f->name))->data); | ||
| 1530 | |||
| 1531 | if (result) | ||
| 1532 | { | ||
| 1533 | UNBLOCK_INPUT; | ||
| 1534 | error ("No icon window available"); | ||
| 1535 | } | ||
| 1536 | |||
| 1537 | /* If the window was unmapped (and its icon was mapped), | ||
| 1538 | the new icon is not mapped, so map the window in its stead. */ | ||
| 1539 | if (FRAME_VISIBLE_P (f)) | ||
| 1540 | { | ||
| 1541 | #ifdef USE_X_TOOLKIT | ||
| 1542 | XtPopup (f->display.x->widget, XtGrabNone); | ||
| 1543 | #endif | ||
| 1544 | XMapWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); | ||
| 1545 | } | ||
| 1546 | |||
| 1547 | XFlush (FRAME_X_DISPLAY (f)); | ||
| 1548 | UNBLOCK_INPUT; | ||
| 1549 | } | ||
| 1550 | |||
| 1496 | extern Lisp_Object x_new_font (); | 1551 | extern Lisp_Object x_new_font (); |
| 1497 | 1552 | ||
| 1498 | void | 1553 | void |
| @@ -1694,19 +1749,30 @@ x_set_name (f, name, explicit) | |||
| 1694 | BLOCK_INPUT; | 1749 | BLOCK_INPUT; |
| 1695 | #ifdef HAVE_X11R4 | 1750 | #ifdef HAVE_X11R4 |
| 1696 | { | 1751 | { |
| 1697 | XTextProperty text; | 1752 | XTextProperty text, icon; |
| 1753 | Lisp_Object icon_name; | ||
| 1754 | |||
| 1698 | text.value = XSTRING (name)->data; | 1755 | text.value = XSTRING (name)->data; |
| 1699 | text.encoding = XA_STRING; | 1756 | text.encoding = XA_STRING; |
| 1700 | text.format = 8; | 1757 | text.format = 8; |
| 1701 | text.nitems = XSTRING (name)->size; | 1758 | text.nitems = XSTRING (name)->size; |
| 1759 | |||
| 1760 | icon_name = (!NILP (f->display.x->icon_name) | ||
| 1761 | ? f->display.x->icon_name | ||
| 1762 | : name); | ||
| 1763 | |||
| 1764 | icon.value = XSTRING (icon_name)->data; | ||
| 1765 | icon.encoding = XA_STRING; | ||
| 1766 | icon.format = 8; | ||
| 1767 | icon.nitems = XSTRING (icon_name)->size; | ||
| 1702 | #ifdef USE_X_TOOLKIT | 1768 | #ifdef USE_X_TOOLKIT |
| 1703 | XSetWMName (FRAME_X_DISPLAY (f), | 1769 | XSetWMName (FRAME_X_DISPLAY (f), |
| 1704 | XtWindow (f->display.x->widget), &text); | 1770 | XtWindow (f->display.x->widget), &text); |
| 1705 | XSetWMIconName (FRAME_X_DISPLAY (f), XtWindow (f->display.x->widget), | 1771 | XSetWMIconName (FRAME_X_DISPLAY (f), XtWindow (f->display.x->widget), |
| 1706 | &text); | 1772 | &icon); |
| 1707 | #else /* not USE_X_TOOLKIT */ | 1773 | #else /* not USE_X_TOOLKIT */ |
| 1708 | XSetWMName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &text); | 1774 | XSetWMName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &text); |
| 1709 | XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &text); | 1775 | XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &icon); |
| 1710 | #endif /* not USE_X_TOOLKIT */ | 1776 | #endif /* not USE_X_TOOLKIT */ |
| 1711 | } | 1777 | } |
| 1712 | #else /* not HAVE_X11R4 */ | 1778 | #else /* not HAVE_X11R4 */ |
| @@ -2668,6 +2734,11 @@ x_icon (f, parms) | |||
| 2668 | ? IconicState | 2734 | ? IconicState |
| 2669 | : NormalState)); | 2735 | : NormalState)); |
| 2670 | 2736 | ||
| 2737 | x_text_icon (f, | ||
| 2738 | (char *) XSTRING ((!NILP (f->display.x->icon_name) | ||
| 2739 | ? f->display.x->icon_name | ||
| 2740 | : f->name))->data); | ||
| 2741 | |||
| 2671 | UNBLOCK_INPUT; | 2742 | UNBLOCK_INPUT; |
| 2672 | } | 2743 | } |
| 2673 | 2744 | ||
| @@ -2828,6 +2899,9 @@ This function is an internal primitive--use `make-frame' instead.") | |||
| 2828 | bzero (f->display.x, sizeof (struct x_display)); | 2899 | bzero (f->display.x, sizeof (struct x_display)); |
| 2829 | f->display.x->icon_bitmap = -1; | 2900 | f->display.x->icon_bitmap = -1; |
| 2830 | 2901 | ||
| 2902 | f->display.x->icon_name | ||
| 2903 | = x_get_arg (parms, Qicon_name, "iconName", "Title", string); | ||
| 2904 | |||
| 2831 | FRAME_X_DISPLAY_INFO (f) = dpyinfo; | 2905 | FRAME_X_DISPLAY_INFO (f) = dpyinfo; |
| 2832 | #ifdef MULTI_KBOARD | 2906 | #ifdef MULTI_KBOARD |
| 2833 | FRAME_KBOARD (f) = kb; | 2907 | FRAME_KBOARD (f) = kb; |
| @@ -4773,6 +4847,8 @@ syms_of_xfns () | |||
| 4773 | staticpro (&Qicon_top); | 4847 | staticpro (&Qicon_top); |
| 4774 | Qicon_type = intern ("icon-type"); | 4848 | Qicon_type = intern ("icon-type"); |
| 4775 | staticpro (&Qicon_type); | 4849 | staticpro (&Qicon_type); |
| 4850 | Qicon_name = intern ("icon-name"); | ||
| 4851 | staticpro (&Qicon_name); | ||
| 4776 | Qinternal_border_width = intern ("internal-border-width"); | 4852 | Qinternal_border_width = intern ("internal-border-width"); |
| 4777 | staticpro (&Qinternal_border_width); | 4853 | staticpro (&Qinternal_border_width); |
| 4778 | Qleft = intern ("left"); | 4854 | Qleft = intern ("left"); |