comparison src/gui_motif.c @ 30075:be5b8d4616b2 v9.0.0375

patch 9.0.0375: the footer feature is unused Commit: https://github.com/vim/vim/commit/c8ac3a072f18d4b250e55e91f610fe517e218777 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 4 12:29:28 2022 +0100 patch 9.0.0375: the footer feature is unused Problem: The footer feature is unused. Solution: Remove FEAT_FOOTER and code.
author Bram Moolenaar <Bram@vim.org>
date Sun, 04 Sep 2022 13:30:03 +0200
parents 9849df834f1d
children 101f08b49ed3
comparison
equal deleted inserted replaced
30074:fe5f53afe024 30075:be5b8d4616b2
73 #ifdef FEAT_GUI_TABLINE 73 #ifdef FEAT_GUI_TABLINE
74 static Widget tabLine; 74 static Widget tabLine;
75 static Widget tabLine_menu = 0; 75 static Widget tabLine_menu = 0;
76 static int showing_tabline = 0; 76 static int showing_tabline = 0;
77 #endif 77 #endif
78 #ifdef FEAT_FOOTER
79 static Widget footer;
80 #endif
81 #ifdef FEAT_MENU 78 #ifdef FEAT_MENU
82 # if (XmVersion >= 1002) 79 # if (XmVersion >= 1002)
83 // remember the last set value for the tearoff item 80 // remember the last set value for the tearoff item
84 static int tearoff_val = (int)XmTEAR_OFF_ENABLED; 81 static int tearoff_val = (int)XmTEAR_OFF_ENABLED;
85 # endif 82 # endif
86 static Widget menuBar; 83 static Widget menuBar;
87 #endif 84 #endif
88 85
89 #ifdef FEAT_TOOLBAR 86 #ifdef FEAT_TOOLBAR
90 # ifdef FEAT_FOOTER
91 static void toolbarbutton_enter_cb(Widget, XtPointer, XEvent *, Boolean *);
92 static void toolbarbutton_leave_cb(Widget, XtPointer, XEvent *, Boolean *);
93 # endif
94 static void reset_focus(void); 87 static void reset_focus(void);
95 #endif 88 #endif
96 89
97 static void gui_motif_menu_colors(Widget id); 90 static void gui_motif_menu_colors(Widget id);
98 static void gui_motif_scroll_colors(Widget id); 91 static void gui_motif_scroll_colors(Widget id);
571 */ 564 */
572 XmNborderWidth, 0, 565 XmNborderWidth, 0,
573 XmNhighlightThickness, 0, 566 XmNhighlightThickness, 0,
574 XmNshadowThickness, 0, 567 XmNshadowThickness, 0,
575 NULL); 568 NULL);
576
577 #ifdef FEAT_FOOTER
578 /*
579 * Create the Footer.
580 */
581 footer = XtVaCreateWidget("footer",
582 xmLabelGadgetClass, vimForm,
583 XmNalignment, XmALIGNMENT_BEGINNING,
584 XmNmarginHeight, 0,
585 XmNmarginWidth, 0,
586 XmNtraversalOn, False,
587 XmNrecomputeSize, False,
588 XmNleftAttachment, XmATTACH_FORM,
589 XmNleftOffset, 5,
590 XmNrightAttachment, XmATTACH_FORM,
591 XmNbottomAttachment, XmATTACH_FORM,
592 NULL);
593 gui_mch_set_footer((char_u *) "");
594 #endif
595 569
596 /* 570 /*
597 * Install the callbacks. 571 * Install the callbacks.
598 */ 572 */
599 gui_x11_callbacks(textArea, vimForm); 573 gui_x11_callbacks(textArea, vimForm);
1313 type, toolBar, args, n); 1287 type, toolBar, args, n);
1314 if (menu->id != NULL && type == xmEnhancedButtonWidgetClass) 1288 if (menu->id != NULL && type == xmEnhancedButtonWidgetClass)
1315 { 1289 {
1316 XtAddCallback(menu->id, 1290 XtAddCallback(menu->id,
1317 XmNactivateCallback, gui_x11_menu_cb, menu); 1291 XmNactivateCallback, gui_x11_menu_cb, menu);
1318 # ifdef FEAT_FOOTER
1319 XtAddEventHandler(menu->id, EnterWindowMask, False,
1320 toolbarbutton_enter_cb, menu);
1321 XtAddEventHandler(menu->id, LeaveWindowMask, False,
1322 toolbarbutton_leave_cb, menu);
1323 # endif
1324 } 1292 }
1325 } 1293 }
1326 else 1294 else
1327 XtSetValues(menu->id, args, n); 1295 XtSetValues(menu->id, args, n);
1328 if (xms != NULL) 1296 if (xms != NULL)
2853 2821
2854 return dialogStatus; 2822 return dialogStatus;
2855 } 2823 }
2856 #endif // FEAT_GUI_DIALOG 2824 #endif // FEAT_GUI_DIALOG
2857 2825
2858 #if defined(FEAT_FOOTER) || defined(PROTO)
2859
2860 static int
2861 gui_mch_compute_footer_height(void)
2862 {
2863 Dimension height; // total Toolbar height
2864 Dimension top; // XmNmarginTop
2865 Dimension bottom; // XmNmarginBottom
2866 Dimension shadow; // XmNshadowThickness
2867
2868 XtVaGetValues(footer,
2869 XmNheight, &height,
2870 XmNmarginTop, &top,
2871 XmNmarginBottom, &bottom,
2872 XmNshadowThickness, &shadow,
2873 NULL);
2874
2875 return (int) height + top + bottom + (shadow << 1);
2876 }
2877
2878 void
2879 gui_mch_enable_footer(int showit)
2880 {
2881 if (showit)
2882 {
2883 gui.footer_height = gui_mch_compute_footer_height();
2884 XtManageChild(footer);
2885 }
2886 else
2887 {
2888 gui.footer_height = 0;
2889 XtUnmanageChild(footer);
2890 }
2891 XtVaSetValues(textAreaForm, XmNbottomOffset, gui.footer_height, NULL);
2892 }
2893
2894 void
2895 gui_mch_set_footer(char_u *s)
2896 {
2897 XmString xms;
2898
2899 xms = XmStringCreate((char *)s, STRING_TAG);
2900 if (xms != NULL)
2901 {
2902 XtVaSetValues(footer, XmNlabelString, xms, NULL);
2903 XmStringFree(xms);
2904 }
2905 }
2906
2907 #endif
2908
2909
2910 #if defined(FEAT_TOOLBAR) || defined(PROTO) 2826 #if defined(FEAT_TOOLBAR) || defined(PROTO)
2911 void 2827 void
2912 gui_mch_show_toolbar(int showit) 2828 gui_mch_show_toolbar(int showit)
2913 { 2829 {
2914 Cardinal numChildren; // how many children toolBar has 2830 Cardinal numChildren; // how many children toolBar has
3129 XmNbottomShadowColor, bsp, 3045 XmNbottomShadowColor, bsp,
3130 XmNtopShadowColor, tsp, 3046 XmNtopShadowColor, tsp,
3131 XmNhighlightColor, hsp, 3047 XmNhighlightColor, hsp,
3132 NULL); 3048 NULL);
3133 } 3049 }
3134
3135 # ifdef FEAT_FOOTER
3136 /*
3137 * The next toolbar enter/leave callbacks should really do balloon help. But
3138 * I have to use footer help for backwards compatibility. Hopefully both will
3139 * get implemented and the user will have a choice.
3140 */
3141 static void
3142 toolbarbutton_enter_cb(
3143 Widget w UNUSED,
3144 XtPointer client_data,
3145 XEvent *event UNUSED,
3146 Boolean *cont UNUSED)
3147 {
3148 vimmenu_T *menu = (vimmenu_T *) client_data;
3149
3150 if (menu->strings[MENU_INDEX_TIP] != NULL)
3151 {
3152 if (vim_strchr(p_go, GO_FOOTER) != NULL)
3153 gui_mch_set_footer(menu->strings[MENU_INDEX_TIP]);
3154 }
3155 }
3156
3157 static void
3158 toolbarbutton_leave_cb(
3159 Widget w UNUSED,
3160 XtPointer client_data UNUSED,
3161 XEvent *event UNUSED,
3162 Boolean *cont UNUSED)
3163 {
3164 gui_mch_set_footer((char_u *) "");
3165 }
3166 # endif
3167 #endif 3050 #endif
3168 3051
3169 #if defined(FEAT_GUI_TABLINE) || defined(PROTO) 3052 #if defined(FEAT_GUI_TABLINE) || defined(PROTO)
3170 /* 3053 /*
3171 * Show or hide the tabline. 3054 * Show or hide the tabline.