diff options
| author | Po Lu | 2022-02-06 09:18:59 +0800 |
|---|---|---|
| committer | Po Lu | 2022-02-06 09:18:59 +0800 |
| commit | b38c0d6a2ff2dca89e9bf5feed49b7708ebf9942 (patch) | |
| tree | e9f1b7077a58a2f6d3d7874b96dccce87305af9b /src/pgtkfns.c | |
| parent | 9c1d6b1d6a24338517756437757cc4aaaa4da4e5 (diff) | |
| download | emacs-b38c0d6a2ff2dca89e9bf5feed49b7708ebf9942.tar.gz emacs-b38c0d6a2ff2dca89e9bf5feed49b7708ebf9942.zip | |
Clean up lots of #ifdef'd out code in PGTK files
Most of them are either relics from X or from the NS code
pgtkfns.c was copied from whole.
* src/pgtkfns.c (x_icon):
(pgtk_set_scroll_bar_foreground):
(pgtk_set_scroll_bar_background):
(Fx_create_frame):
(pgtk_window_is_ancestor):
(x_create_tip_frame):
* src/pgtkselect.c (syms_of_pgtkselect):
* src/pgtkterm.c (pgtk_iconify_frame):
(x_set_frame_alpha):
(button_event): Remove defined out code that cannot make sense.
* src/pgtkmenu.c (show_help_event): Remove ifdef'd out code and
reword comment.
Diffstat (limited to 'src/pgtkfns.c')
| -rw-r--r-- | src/pgtkfns.c | 85 |
1 files changed, 5 insertions, 80 deletions
diff --git a/src/pgtkfns.c b/src/pgtkfns.c index c7987afc7db..15e14f75e47 100644 --- a/src/pgtkfns.c +++ b/src/pgtkfns.c | |||
| @@ -682,40 +682,6 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | |||
| 682 | { | 682 | { |
| 683 | } | 683 | } |
| 684 | 684 | ||
| 685 | |||
| 686 | static void | ||
| 687 | x_icon (struct frame *f, Lisp_Object parms) | ||
| 688 | /* -------------------------------------------------------------------------- | ||
| 689 | Strangely-named function to set icon position parameters in frame. | ||
| 690 | This is irrelevant under macOS, but might be needed under GNUstep, | ||
| 691 | depending on the window manager used. Note, this is not a standard | ||
| 692 | frame parameter-setter; it is called directly from x-create-frame. | ||
| 693 | -------------------------------------------------------------------------- */ | ||
| 694 | { | ||
| 695 | #if 0 | ||
| 696 | Lisp_Object icon_x, icon_y; | ||
| 697 | struct pgtk_display_info *dpyinfo = check_pgtk_display_info (Qnil); | ||
| 698 | |||
| 699 | FRAME_X_OUTPUT (f)->icon_top = -1; | ||
| 700 | FRAME_X_OUTPUT (f)->icon_left = -1; | ||
| 701 | |||
| 702 | /* Set the position of the icon. */ | ||
| 703 | icon_x = | ||
| 704 | gui_display_get_arg (dpyinfo, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER); | ||
| 705 | icon_y = | ||
| 706 | gui_display_get_arg (dpyinfo, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER); | ||
| 707 | if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound)) | ||
| 708 | { | ||
| 709 | CHECK_NUMBER (icon_x); | ||
| 710 | CHECK_NUMBER (icon_y); | ||
| 711 | FRAME_X_OUTPUT (f)->icon_top = XFIXNUM (icon_y); | ||
| 712 | FRAME_X_OUTPUT (f)->icon_left = XFIXNUM (icon_x); | ||
| 713 | } | ||
| 714 | else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound)) | ||
| 715 | error ("Both left and top icon corners of icon must be specified"); | ||
| 716 | #endif | ||
| 717 | } | ||
| 718 | |||
| 719 | /** | 685 | /** |
| 720 | * x_set_undecorated: | 686 | * x_set_undecorated: |
| 721 | * | 687 | * |
| @@ -892,13 +858,10 @@ pgtk_set_scroll_bar_foreground (struct frame *f, Lisp_Object new_value, | |||
| 892 | if (!pgtk_parse_color (f, SSDATA (new_value), &rgb)) | 858 | if (!pgtk_parse_color (f, SSDATA (new_value), &rgb)) |
| 893 | error ("Unknown color."); | 859 | error ("Unknown color."); |
| 894 | 860 | ||
| 895 | /* On pgtk, this frame parameter should be ignored, and honor gtk theme. */ | ||
| 896 | #if 0 | ||
| 897 | char css[64]; | 861 | char css[64]; |
| 898 | sprintf (css, "scrollbar slider { background-color: #%06x; }", | 862 | sprintf (css, "scrollbar slider { background-color: #%06x; }", |
| 899 | (unsigned int) rgb.pixel & 0xffffff); | 863 | (unsigned int) rgb.pixel & 0xffffff); |
| 900 | gtk_css_provider_load_from_data (css_provider, css, -1, NULL); | 864 | gtk_css_provider_load_from_data (css_provider, css, -1, NULL); |
| 901 | #endif | ||
| 902 | update_face_from_frame_parameter (f, Qscroll_bar_foreground, new_value); | 865 | update_face_from_frame_parameter (f, Qscroll_bar_foreground, new_value); |
| 903 | 866 | ||
| 904 | } | 867 | } |
| @@ -925,13 +888,13 @@ pgtk_set_scroll_bar_background (struct frame *f, Lisp_Object new_value, | |||
| 925 | if (!pgtk_parse_color (f, SSDATA (new_value), &rgb)) | 888 | if (!pgtk_parse_color (f, SSDATA (new_value), &rgb)) |
| 926 | error ("Unknown color."); | 889 | error ("Unknown color."); |
| 927 | 890 | ||
| 928 | /* On pgtk, this frame parameter should be ignored, and honor gtk theme. */ | 891 | /* On pgtk, this frame parameter should be ignored, and honor |
| 929 | #if 0 | 892 | gtk theme. (It honors the GTK theme if not explictly set, so |
| 893 | I see no harm in letting users tinker a bit more.) */ | ||
| 930 | char css[64]; | 894 | char css[64]; |
| 931 | sprintf (css, "scrollbar trough { background-color: #%06x; }", | 895 | sprintf (css, "scrollbar trough { background-color: #%06x; }", |
| 932 | (unsigned int) rgb.pixel & 0xffffff); | 896 | (unsigned int) rgb.pixel & 0xffffff); |
| 933 | gtk_css_provider_load_from_data (css_provider, css, -1, NULL); | 897 | gtk_css_provider_load_from_data (css_provider, css, -1, NULL); |
| 934 | #endif | ||
| 935 | update_face_from_frame_parameter (f, Qscroll_bar_background, new_value); | 898 | update_face_from_frame_parameter (f, Qscroll_bar_background, new_value); |
| 936 | 899 | ||
| 937 | } | 900 | } |
| @@ -1378,9 +1341,6 @@ This function is an internal primitive--use `make-frame' instead. */ ) | |||
| 1378 | 1341 | ||
| 1379 | f->output_method = output_pgtk; | 1342 | f->output_method = output_pgtk; |
| 1380 | FRAME_X_OUTPUT (f) = xzalloc (sizeof *FRAME_X_OUTPUT (f)); | 1343 | FRAME_X_OUTPUT (f) = xzalloc (sizeof *FRAME_X_OUTPUT (f)); |
| 1381 | #if 0 | ||
| 1382 | FRAME_X_OUTPUT (f)->icon_bitmap = -1; | ||
| 1383 | #endif | ||
| 1384 | FRAME_FONTSET (f) = -1; | 1344 | FRAME_FONTSET (f) = -1; |
| 1385 | FRAME_X_OUTPUT (f)->white_relief.pixel = -1; | 1345 | FRAME_X_OUTPUT (f)->white_relief.pixel = -1; |
| 1386 | FRAME_X_OUTPUT (f)->black_relief.pixel = -1; | 1346 | FRAME_X_OUTPUT (f)->black_relief.pixel = -1; |
| @@ -1478,12 +1438,8 @@ This function is an internal primitive--use `make-frame' instead. */ ) | |||
| 1478 | error ("Invalid frame font"); | 1438 | error ("Invalid frame font"); |
| 1479 | } | 1439 | } |
| 1480 | 1440 | ||
| 1481 | /* Frame contents get displaced if an embedded X window has a border. */ | 1441 | gui_default_parameter (f, parms, Qborder_width, make_fixnum (0), |
| 1482 | #if 0 | 1442 | "borderWidth", "BorderWidth", RES_TYPE_NUMBER); |
| 1483 | if (!FRAME_X_EMBEDDED_P (f)) | ||
| 1484 | #endif | ||
| 1485 | gui_default_parameter (f, parms, Qborder_width, make_fixnum (0), | ||
| 1486 | "borderWidth", "BorderWidth", RES_TYPE_NUMBER); | ||
| 1487 | 1443 | ||
| 1488 | if (NILP (Fassq (Qinternal_border_width, parms))) | 1444 | if (NILP (Fassq (Qinternal_border_width, parms))) |
| 1489 | { | 1445 | { |
| @@ -1627,10 +1583,6 @@ This function is an internal primitive--use `make-frame' instead. */ ) | |||
| 1627 | RES_TYPE_BOOLEAN); | 1583 | RES_TYPE_BOOLEAN); |
| 1628 | f->no_split = minibuffer_only || EQ (tem, Qt); | 1584 | f->no_split = minibuffer_only || EQ (tem, Qt); |
| 1629 | 1585 | ||
| 1630 | #if 0 | ||
| 1631 | x_icon_verify (f, parms); | ||
| 1632 | #endif | ||
| 1633 | |||
| 1634 | /* Create the X widget or window. */ | 1586 | /* Create the X widget or window. */ |
| 1635 | /* x_window (f); */ | 1587 | /* x_window (f); */ |
| 1636 | xg_create_frame_widgets (f); | 1588 | xg_create_frame_widgets (f); |
| @@ -1658,11 +1610,6 @@ This function is an internal primitive--use `make-frame' instead. */ ) | |||
| 1658 | 1610 | ||
| 1659 | #undef INSTALL_CURSOR | 1611 | #undef INSTALL_CURSOR |
| 1660 | 1612 | ||
| 1661 | x_icon (f, parms); | ||
| 1662 | #if 0 | ||
| 1663 | x_make_gc (f); | ||
| 1664 | #endif | ||
| 1665 | |||
| 1666 | /* Now consider the frame official. */ | 1613 | /* Now consider the frame official. */ |
| 1667 | f->terminal->reference_count++; | 1614 | f->terminal->reference_count++; |
| 1668 | FRAME_DISPLAY_INFO (f)->reference_count++; | 1615 | FRAME_DISPLAY_INFO (f)->reference_count++; |
| @@ -1819,21 +1766,6 @@ This function is an internal primitive--use `make-frame' instead. */ ) | |||
| 1819 | return unbind_to (count, frame); | 1766 | return unbind_to (count, frame); |
| 1820 | } | 1767 | } |
| 1821 | 1768 | ||
| 1822 | |||
| 1823 | #if 0 | ||
| 1824 | static int | ||
| 1825 | pgtk_window_is_ancestor (PGTKWindow * win, PGTKWindow * candidate) | ||
| 1826 | /* Test whether CANDIDATE is an ancestor window of WIN. */ | ||
| 1827 | { | ||
| 1828 | if (candidate == NULL) | ||
| 1829 | return 0; | ||
| 1830 | else if (win == candidate) | ||
| 1831 | return 1; | ||
| 1832 | else | ||
| 1833 | return pgtk_window_is_ancestor (win,[candidate parentWindow]); | ||
| 1834 | } | ||
| 1835 | #endif | ||
| 1836 | |||
| 1837 | /** | 1769 | /** |
| 1838 | * x_frame_restack: | 1770 | * x_frame_restack: |
| 1839 | * | 1771 | * |
| @@ -2817,9 +2749,6 @@ x_create_tip_frame (struct pgtk_display_info *dpyinfo, Lisp_Object parms, struct | |||
| 2817 | counts etc. */ | 2749 | counts etc. */ |
| 2818 | f->output_method = output_pgtk; | 2750 | f->output_method = output_pgtk; |
| 2819 | f->output_data.pgtk = xzalloc (sizeof *f->output_data.pgtk); | 2751 | f->output_data.pgtk = xzalloc (sizeof *f->output_data.pgtk); |
| 2820 | #if 0 | ||
| 2821 | f->output_data.pgtk->icon_bitmap = -1; | ||
| 2822 | #endif | ||
| 2823 | FRAME_FONTSET (f) = -1; | 2752 | FRAME_FONTSET (f) = -1; |
| 2824 | f->output_data.pgtk->white_relief.pixel = -1; | 2753 | f->output_data.pgtk->white_relief.pixel = -1; |
| 2825 | f->output_data.pgtk->black_relief.pixel = -1; | 2754 | f->output_data.pgtk->black_relief.pixel = -1; |
| @@ -2945,10 +2874,6 @@ x_create_tip_frame (struct pgtk_display_info *dpyinfo, Lisp_Object parms, struct | |||
| 2945 | gtk_window_set_type_hint (GTK_WINDOW (tip_window), GDK_WINDOW_TYPE_HINT_TOOLTIP); | 2874 | gtk_window_set_type_hint (GTK_WINDOW (tip_window), GDK_WINDOW_TYPE_HINT_TOOLTIP); |
| 2946 | f->output_data.pgtk->current_cursor = f->output_data.pgtk->text_cursor; | 2875 | f->output_data.pgtk->current_cursor = f->output_data.pgtk->text_cursor; |
| 2947 | 2876 | ||
| 2948 | #if 0 | ||
| 2949 | x_make_gc (f); | ||
| 2950 | #endif | ||
| 2951 | |||
| 2952 | gui_default_parameter (f, parms, Qauto_raise, Qnil, | 2877 | gui_default_parameter (f, parms, Qauto_raise, Qnil, |
| 2953 | "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN); | 2878 | "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN); |
| 2954 | gui_default_parameter (f, parms, Qauto_lower, Qnil, | 2879 | gui_default_parameter (f, parms, Qauto_lower, Qnil, |