diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 49 | ||||
-rw-r--r-- | src/clipboard.c | 2 | ||||
-rw-r--r-- | src/evalfunc.c | 16 | ||||
-rw-r--r-- | src/feature.h | 30 | ||||
-rw-r--r-- | src/gui.c | 52 | ||||
-rw-r--r-- | src/gui.h | 15 | ||||
-rw-r--r-- | src/gui_at_fs.c | 2753 | ||||
-rw-r--r-- | src/gui_at_sb.c | 1192 | ||||
-rw-r--r-- | src/gui_at_sb.h | 161 | ||||
-rw-r--r-- | src/gui_athena.c | 2303 | ||||
-rw-r--r-- | src/gui_beval.c | 75 | ||||
-rw-r--r-- | src/gui_motif.c | 6 | ||||
-rw-r--r-- | src/gui_x11.c | 72 | ||||
-rw-r--r-- | src/if_mzsch.c | 10 | ||||
-rw-r--r-- | src/main.c | 11 | ||||
-rw-r--r-- | src/menu.c | 10 | ||||
-rw-r--r-- | src/mouse.c | 4 | ||||
-rw-r--r-- | src/proto.h | 6 | ||||
-rw-r--r-- | src/proto/gui_athena.pro | 33 | ||||
-rw-r--r-- | src/structs.h | 3 | ||||
-rw-r--r-- | src/testdir/gui_init.vim | 2 | ||||
-rw-r--r-- | src/testdir/setup_gui.vim | 2 | ||||
-rw-r--r-- | src/testdir/test_clientserver.vim | 4 | ||||
-rw-r--r-- | src/testdir/test_edit.vim | 2 | ||||
-rw-r--r-- | src/testdir/test_gui.vim | 17 | ||||
-rw-r--r-- | src/testdir/test_highlight.vim | 2 | ||||
-rw-r--r-- | src/testdir/test_quotestar.vim | 2 | ||||
-rw-r--r-- | src/testdir/test_startup.vim | 14 | ||||
-rw-r--r-- | src/version.c | 20 | ||||
-rw-r--r-- | src/vim.h | 4 |
30 files changed, 84 insertions, 6788 deletions
diff --git a/src/Makefile b/src/Makefile index 1b143b9ff2..3a713d7a6f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -182,10 +182,7 @@ #Irix 6.5 cc ? 6.0 (S) David Harrison #Irix 64 bit 4.5 (K) Jon Wright #Linux 2.0 gcc-2.7.2 Infomagic Motif 4.3 (3) Ronald Rietman -#Linux 2.0.31 gcc +X11 +GUI Athena 5.0w (U) Darren Hiebert -#LynxOS 3.0.1 2.9-gnupro-98r2 +X11 +GUI Athena 5.7.1(O) Lorenz Hahn -#LynxOS 3.1.0 2.9-gnupro-98r2 +X11 +GUI Athena 5.7.1(O) Lorenz Hahn -#NEC UP4800 UNIX_SV 4.2MP cc +X11R6 Motif,Athena4.6b (Q) Lennart Schultz +#NEC UP4800 UNIX_SV 4.2MP cc +X11R6 Motif 4.6b (Q) Lennart Schultz #NetBSD 1.0A gcc-2.4.5 -X11 -GUI 3.21 (X) Juergen Weigert #QNX 4.2 wcc386-10.6 -X11 4.2 (D) G.F. Desrochers #QNX 4.23 Watcom -X11 4.2 (F) John Oleynick @@ -199,14 +196,12 @@ #Solaris 2.4 (Sparc) cc +X11 +GUI 3.29 (9) Glauber #Solaris 2.4/2.5 clcc +X11 -GUI openwin 3.20 (7) Robert Colon #Solaris 2.5 (sun4m) cc (SC4.0) +X11R6 +GUI (CDE) 4.6b (E) Andrew Large -#Solaris 2.5 cc +X11 +GUI Athena 4.2 (9) Sonia Heimann #Solaris 2.5 gcc 2.5.6 +X11 Motif 5.0m (R) Ant. Colombo #Solaris 2.6 gcc 2.8.1 ncurses 5.3 (G) Larry W. Virden #Solaris with -lthread 5.5 (W) K. Nagano #Solaris gcc (b) Riccardo #SunOS 4.1.x +X11 -GUI 5.1b (J) Bram Moolenaar -#SunOS 4.1.3_U1 (sun4c) gcc +X11 +GUI Athena 5.0w (J) Darren Hiebert -#SUPER-UX 6.2 (NEC SX-4) cc +X11R6 Motif,Athena4.6b (P) Lennart Schultz +#SUPER-UX 6.2 (NEC SX-4) cc +X11R6 Motif 4.6b (P) Lennart Schultz #Tandem/NSK (c) Matthew Woehlke #Unisys 6035 cc +X11 Motif 5.3 (8) Glauber Ribeiro #ESIX V4.2 cc +X11 6.0 (a) Reinhard Wobst @@ -1342,8 +1337,8 @@ HAIKUGUI_TESTTARGET = gui HAIKUGUI_BUNDLE = # All GUI files -ALL_GUI_SRC = gui.c gui_gtk.c gui_gtk_f.c gui_motif.c gui_xmdlg.c gui_xmebw.c gui_athena.c gui_gtk_x11.c gui_x11.c gui_at_sb.c gui_at_fs.c gui_haiku.cc -ALL_GUI_PRO = gui.pro gui_gtk.pro gui_motif.pro gui_xmdlg.pro gui_athena.pro gui_gtk_x11.pro gui_x11.pro gui_w32.pro gui_photon.pro gui_haiku.pro +ALL_GUI_SRC = gui.c gui_gtk.c gui_gtk_f.c gui_motif.c gui_xmdlg.c gui_xmebw.c gui_gtk_x11.c gui_x11.c gui_haiku.cc +ALL_GUI_PRO = gui.pro gui_gtk.pro gui_motif.pro gui_xmdlg.pro gui_gtk_x11.pro gui_x11.pro gui_w32.pro gui_photon.pro gui_haiku.pro # }}} @@ -3245,15 +3240,6 @@ objects/help.o: help.c objects/gui.o: gui.c $(CCC) -o $@ gui.c -objects/gui_at_fs.o: gui_at_fs.c - $(CCC) -o $@ gui_at_fs.c - -objects/gui_at_sb.o: gui_at_sb.c - $(CCC) -o $@ gui_at_sb.c - -objects/gui_athena.o: gui_athena.c - $(CCC) -o $@ gui_athena.c - objects/beval.o: beval.c $(CCC) -o $@ beval.c @@ -4182,25 +4168,6 @@ objects/gui_xmebw.o: gui_xmebw.c vim.h protodef.h auto/config.h feature.h \ os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ proto.h globals.h errors.h gui_xmebwp.h gui_xmebw.h -objects/gui_athena.o: gui_athena.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h errors.h gui_at_sb.h gui_x11_pm.h \ - ../pixmaps/tb_new.xpm ../pixmaps/tb_open.xpm ../pixmaps/tb_close.xpm \ - ../pixmaps/tb_save.xpm ../pixmaps/tb_print.xpm ../pixmaps/tb_cut.xpm \ - ../pixmaps/tb_copy.xpm ../pixmaps/tb_paste.xpm ../pixmaps/tb_find.xpm \ - ../pixmaps/tb_find_next.xpm ../pixmaps/tb_find_prev.xpm \ - ../pixmaps/tb_find_help.xpm ../pixmaps/tb_exit.xpm \ - ../pixmaps/tb_undo.xpm ../pixmaps/tb_redo.xpm ../pixmaps/tb_help.xpm \ - ../pixmaps/tb_macro.xpm ../pixmaps/tb_make.xpm \ - ../pixmaps/tb_save_all.xpm ../pixmaps/tb_jump.xpm \ - ../pixmaps/tb_ctags.xpm ../pixmaps/tb_load_session.xpm \ - ../pixmaps/tb_save_session.xpm ../pixmaps/tb_new_session.xpm \ - ../pixmaps/tb_blank.xpm ../pixmaps/tb_maximize.xpm \ - ../pixmaps/tb_split.xpm ../pixmaps/tb_minimize.xpm \ - ../pixmaps/tb_shell.xpm ../pixmaps/tb_replace.xpm \ - ../pixmaps/tb_vsplit.xpm ../pixmaps/tb_maxwidth.xpm \ - ../pixmaps/tb_minwidth.xpm objects/gui_gtk_x11.o: gui_gtk_x11.c vim.h protodef.h auto/config.h feature.h \ os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ @@ -4211,14 +4178,6 @@ objects/gui_x11.o: gui_x11.c vim.h protodef.h auto/config.h feature.h os_unix.h proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ proto.h globals.h errors.h ../runtime/vim32x32.xpm \ ../runtime/vim16x16.xpm ../runtime/vim48x48.xpm -objects/gui_at_sb.o: gui_at_sb.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h errors.h gui_at_sb.h -objects/gui_at_fs.o: gui_at_fs.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h errors.h gui_at_sb.h objects/gui_haiku.o: gui_haiku.cc vim.h protodef.h auto/config.h feature.h \ os_unix.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ diff --git a/src/clipboard.c b/src/clipboard.c index 9eace3de6d..fbeee72518 100644 --- a/src/clipboard.c +++ b/src/clipboard.c @@ -1354,7 +1354,7 @@ check_clipboard_option(void) /* * Open the application context (if it hasn't been opened yet). - * Used for Motif and Athena GUI and the xterm clipboard. + * Used for Motif GUI and the xterm clipboard. */ void open_app_context(void) diff --git a/src/evalfunc.c b/src/evalfunc.c index 768b27f927..5a0428ecff 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -5619,20 +5619,8 @@ f_has(typval_T *argvars, typval_T *rettv) 0 #endif }, - {"gui_neXtaw", -#if defined(FEAT_GUI_ATHENA) && defined(FEAT_GUI_NEXTAW) - 1 -#else - 0 -#endif - }, - {"gui_athena", -#if defined(FEAT_GUI_ATHENA) && !defined(FEAT_GUI_NEXTAW) - 1 -#else - 0 -#endif - }, + {"gui_neXtaw", 0 }, + {"gui_athena", 0 }, {"gui_gtk", #ifdef FEAT_GUI_GTK 1 diff --git a/src/feature.h b/src/feature.h index 0f5bf1e016..1a24879816 100644 --- a/src/feature.h +++ b/src/feature.h @@ -583,8 +583,7 @@ #if defined(FEAT_NORMAL) && defined(FEAT_MENU) \ && (defined(FEAT_GUI_GTK) \ || defined(FEAT_GUI_MSWIN) \ - || ((defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) \ - && defined(HAVE_XPM)) \ + || (defined(FEAT_GUI_MOTIF) && defined(HAVE_XPM)) \ || defined(FEAT_GUI_PHOTON) \ || defined(FEAT_GUI_HAIKU)) @@ -620,7 +619,7 @@ */ #if defined(FEAT_NORMAL) # define FEAT_BROWSE_CMD -# if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \ +# if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) \ || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_HAIKU) || defined(FEAT_GUI_PHOTON) # define FEAT_BROWSE # endif @@ -641,8 +640,7 @@ * When none of these defined there is no dialog support. */ #ifdef FEAT_NORMAL -# if ((defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MOTIF)) \ - && defined(HAVE_X11_XPM_H)) \ +# if (defined(FEAT_GUI_MOTIF) && defined(HAVE_X11_XPM_H)) \ || defined(FEAT_GUI_GTK) \ || defined(FEAT_GUI_PHOTON) \ || defined(FEAT_GUI_HAIKU) \ @@ -654,13 +652,13 @@ # endif #endif #if !defined(FEAT_GUI_DIALOG) && (defined(FEAT_GUI_MOTIF) \ - || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) \ + || defined(FEAT_GUI_GTK) \ || defined(FEAT_GUI_MSWIN)) // need a dialog to show error messages when starting from the desktop # define FEAT_GUI_DIALOG #endif #if defined(FEAT_GUI_DIALOG) && \ - (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \ + (defined(FEAT_GUI_MOTIF) \ || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MSWIN) \ || defined(FEAT_GUI_PHOTON) \ || defined(FEAT_GUI_HAIKU)) @@ -881,7 +879,7 @@ * +X11 Unix only. Include code for xterm title saving and X * clipboard. Only works if HAVE_X11 is also defined. */ -#if (defined(FEAT_NORMAL) || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) +#if defined(FEAT_NORMAL) || defined(FEAT_GUI_MOTIF) # define WANT_X11 #endif @@ -1047,7 +1045,7 @@ # define MCH_CURSOR_SHAPE # endif # if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) \ - || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) \ + || defined(FEAT_GUI_GTK) \ || defined(FEAT_GUI_PHOTON) # define FEAT_MOUSESHAPE # endif @@ -1064,7 +1062,7 @@ #endif #if defined(FEAT_MZSCHEME) && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) \ - || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) + || defined(FEAT_GUI_MOTIF)) # define MZSCHEME_GUI_THREADS #endif @@ -1090,7 +1088,6 @@ * +tcl TCL interface: "--enable-tclinterp" * +netbeans_intg Netbeans integration * +channel Inter process communication - * +GUI_Athena Athena GUI * +GUI_Motif Motif GUI */ @@ -1154,8 +1151,7 @@ */ #if defined(FEAT_BIG) || defined(FEAT_NETBEANS_INTG) || defined(FEAT_PROP_POPUP) # define FEAT_SIGNS -# if ((defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) \ - && defined(HAVE_X11_XPM_H)) \ +# if (defined(FEAT_GUI_MOTIF) && defined(HAVE_X11_XPM_H)) \ || defined(FEAT_GUI_GTK) \ || (defined(MSWIN) && defined(FEAT_GUI)) # define FEAT_SIGN_ICONS @@ -1167,7 +1163,7 @@ * debugger and for tooltips. * Only for GUIs where it was implemented. */ -#if (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \ +#if (defined(FEAT_GUI_MOTIF) \ || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MSWIN)) \ && ( ((defined(FEAT_TOOLBAR) || defined(FEAT_GUI_TABLINE)) \ && !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MSWIN)) \ @@ -1179,7 +1175,7 @@ # endif #endif -#if defined(FEAT_BEVAL_GUI) && (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) +#if defined(FEAT_BEVAL_GUI) && defined(FEAT_GUI_MOTIF) # define FEAT_BEVAL_TIP // balloon eval used for toolbar tooltip #endif @@ -1196,8 +1192,8 @@ # define FEAT_BEVAL #endif -// both Motif and Athena are X11 and share some code -#if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) +// Motif is X11 +#if defined(FEAT_GUI_MOTIF) # define FEAT_GUI_X11 #endif @@ -53,15 +53,6 @@ static int can_update_cursor = TRUE; // can display the cursor static int disable_flush = 0; // If > 0, gui_mch_flush() is disabled. /* - * The Athena scrollbars can move the thumb to after the end of the scrollbar, - * this makes the thumb indicate the part of the text that is shown. Motif - * can't do this. - */ -#if defined(FEAT_GUI_ATHENA) -# define SCROLL_PAST_END -#endif - -/* * gui_start -- Called when user wants to start the GUI. * * Careful: This function can be called recursively when there is a ":gui" @@ -445,8 +436,7 @@ gui_init_check(void) gui.menu_width = 0; # endif #endif -#if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \ - || defined(FEAT_GUI_HAIKU)) +#if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_HAIKU)) gui.toolbar_height = 0; #endif #if defined(FEAT_FOOTER) && defined(FEAT_GUI_MOTIF) @@ -789,7 +779,7 @@ gui_init(void) balloonEval = gui_mch_create_beval_area(gui.drawarea, NULL, &general_beval_cb, NULL); # else -# if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) +# if defined(FEAT_GUI_MOTIF) { extern Widget textArea; balloonEval = gui_mch_create_beval_area(textArea, NULL, @@ -1441,11 +1431,11 @@ gui_position_components(int total_width UNUSED) text_area_y += gui.tabline_height; #endif -#if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \ +#if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MOTIF) \ || defined(FEAT_GUI_HAIKU) || defined(FEAT_GUI_MSWIN)) if (vim_strchr(p_go, GO_TOOLBAR) != NULL) { -# if defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_HAIKU) +# if defined(FEAT_GUI_HAIKU) gui_mch_set_toolbar_pos(0, text_area_y, gui.menu_width, gui.toolbar_height); # endif @@ -2043,10 +2033,10 @@ gui_write( old_curwin = curwin; /* - * We need to make sure this is cleared since Athena doesn't tell us when - * he is done dragging. Do the same for GTK. + * We need to make sure this is cleared since GTK doesn't tell us when + * the user is done dragging. */ -#if defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) +#if defined(FEAT_GUI_GTK) gui.dragged_sb = SBAR_NONE; #endif @@ -3410,10 +3400,10 @@ button_set: prev_col = col; /* - * We need to make sure this is cleared since Athena doesn't tell us when - * he is done dragging. Neither does GTK+ 2 -- at least for now. + * We need to make sure this is cleared since GTK doesn't tell us when + * the user is done dragging. */ -#if defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) +#if defined(FEAT_GUI_GTK) gui.dragged_sb = SBAR_NONE; #endif } @@ -3952,9 +3942,6 @@ gui_create_scrollbar(scrollbar_T *sb, int type, win_T *wp) sb->wp = wp; sb->type = type; sb->value = 0; -#ifdef FEAT_GUI_ATHENA - sb->pixval = 0; -#endif sb->size = 1; sb->max = 1; sb->top = 0; @@ -4336,7 +4323,7 @@ gui_update_scrollbars( y += gui.menu_height; #endif -#if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_ATHENA) \ +#if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MSWIN) \ || defined(FEAT_GUI_HAIKU)) if (vim_strchr(p_go, GO_TOOLBAR) != NULL) y += gui.toolbar_height; @@ -4369,25 +4356,10 @@ gui_update_scrollbars( } } - // Reduce the number of calls to gui_mch_set_scrollbar_thumb() by - // checking if the thumb moved at least a pixel. Only do this for - // Athena, most other GUIs require the update anyway to make the - // arrows work. -#ifdef FEAT_GUI_ATHENA - if (max == 0) - y = 0; - else - y = (val * (sb->height + 2) * gui.char_height + max / 2) / max; - if (force || sb->pixval != y || sb->size != size || sb->max != max) -#else if (force || sb->value != val || sb->size != size || sb->max != max) -#endif { // Thumb of scrollbar has moved sb->value = val; -#ifdef FEAT_GUI_ATHENA - sb->pixval = y; -#endif sb->size = size; sb->max = max; if (gui.which_scrollbars[SBAR_LEFT] @@ -5122,7 +5094,7 @@ ex_gui(exarg_T *eap) || defined(FEAT_GUI_HAIKU)) \ && defined(FEAT_TOOLBAR)) || defined(PROTO) /* - * This is shared between Athena, Haiku, Motif, and GTK. + * This is shared between Haiku, Motif, and GTK. */ /* @@ -11,11 +11,6 @@ # include <Xm/Xm.h> #endif -#ifdef FEAT_GUI_ATHENA -# include <X11/Intrinsic.h> -# include <X11/StringDefs.h> -#endif - #ifdef FEAT_GUI_GTK # ifdef VMS // undef MIN and MAX because Intrinsic.h redefines them anyway # ifdef MAX @@ -36,7 +31,7 @@ // Needed when generating prototypes, since FEAT_GUI is always defined then. #if defined(FEAT_XCLIPBOARD) && !defined(FEAT_GUI_MOTIF) \ - && !defined(FEAT_GUI_ATHENA) && !defined(FEAT_GUI_GTK) + && !defined(FEAT_GUI_GTK) # include <X11/Intrinsic.h> #endif @@ -160,9 +155,6 @@ typedef struct GuiScrollbar win_T *wp; // Scrollbar's window, NULL for bottom int type; // one of SBAR_{LEFT,RIGHT,BOTTOM} long value; // Represents top line number visible -#ifdef FEAT_GUI_ATHENA - int pixval; // pixel count of value -#endif long size; // Size of scrollbar thumb long max; // Number of lines in buffer @@ -277,9 +269,6 @@ typedef struct Gui int menu_width; // Width of the menu bar # endif char menu_is_active; // TRUE if menu is present -# ifdef FEAT_GUI_ATHENA - char menu_height_fixed; // TRUE if menu height fixed -# endif #endif scrollbar_T bottom_sbar; // Bottom scrollbar @@ -418,7 +407,7 @@ typedef struct Gui #endif #if defined(FEAT_TOOLBAR) \ - && (defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_HAIKU) || defined(FEAT_GUI_MSWIN)) + && (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_HAIKU) || defined(FEAT_GUI_MSWIN)) int toolbar_height; // height of the toolbar #endif diff --git a/src/gui_at_fs.c b/src/gui_at_fs.c deleted file mode 100644 index 739d309b81..0000000000 --- a/src/gui_at_fs.c +++ /dev/null @@ -1,2753 +0,0 @@ -/* vi:set ts=8 sts=4 sw=4 noet: */ - -/* - * Copyright 1989 Software Research Associates, Inc., Tokyo, Japan - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Software Research Associates not be used - * in advertising or publicity pertaining to distribution of the software - * without specific, written prior permission. Software Research Associates - * makes no representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * SOFTWARE RESEARCH ASSOCIATES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS - * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, - * IN NO EVENT SHALL SOFTWARE RESEARCH ASSOCIATES BE LIABLE FOR ANY SPECIAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Author: Erik M. van der Poel - * Software Research Associates, Inc., Tokyo, Japan - * erik@sra.co.jp - */ -/* - * Author's addresses: - * erik@sra.co.jp - * erik%sra.co.jp@uunet.uu.net - * erik%sra.co.jp@mcvax.uucp - * try junet instead of co.jp - * Erik M. van der Poel - * Software Research Associates, Inc. - * 1-1-1 Hirakawa-cho, Chiyoda-ku - * Tokyo 102 Japan. TEL +81-3-234-2692 - */ - -/* - * Heavely modified for Vim by Bram Moolenaar - */ - -#include "vim.h" - -// Only include this when using the file browser - -#ifdef FEAT_BROWSE - -// Weird complication: for "make lint" Text.h doesn't combine with Xm.h -#if defined(FEAT_GUI_MOTIF) && defined(FMT8BIT) -# undef FMT8BIT -#endif - -#ifndef FEAT_GUI_NEXTAW -# include "gui_at_sb.h" -#endif - -////////////////// SFinternal.h - -#include <X11/Intrinsic.h> -#include <X11/StringDefs.h> -#include <X11/Xos.h> -#ifdef FEAT_GUI_NEXTAW -# include <X11/neXtaw/Text.h> -# include <X11/neXtaw/AsciiText.h> -# include <X11/neXtaw/Scrollbar.h> -#else -# include <X11/Xaw/Text.h> -# include <X11/Xaw/AsciiText.h> -#endif - -#define SEL_FILE_CANCEL -1 -#define SEL_FILE_OK 0 -#define SEL_FILE_NULL 1 -#define SEL_FILE_TEXT 2 - -#define SF_DO_SCROLL 1 -#define SF_DO_NOT_SCROLL 0 - -typedef struct -{ - int statDone; - char *real; - char *shown; -} SFEntry; - -typedef struct -{ - char *dir; - char *path; - SFEntry *entries; - int nEntries; - int vOrigin; - int nChars; - int hOrigin; - int changed; - int beginSelection; - int endSelection; - time_t mtime; -} SFDir; - -static char SFstartDir[MAXPATHL], - SFcurrentPath[MAXPATHL], - SFcurrentDir[MAXPATHL]; - -static Widget selFile, - selFileField, - selFileForm, - selFileHScroll, - selFileHScrolls[3], - selFileLists[3], - selFileOK, - selFileCancel, - selFilePrompt, - selFileVScrolls[3]; - -static Display *SFdisplay; - -static int SFcharWidth, SFcharAscent, SFcharHeight; - -static SFDir *SFdirs = NULL; - -static int SFdirEnd; -static int SFdirPtr; - -static Pixel SFfore, SFback; - -static Atom SFwmDeleteWindow; - -static XSegment SFsegs[2], SFcompletionSegs[2]; - -static XawTextPosition SFtextPos; - -static int SFupperX, SFlowerY, SFupperY; - -static int SFtextX, SFtextYoffset; - -static int SFentryWidth, SFentryHeight; - -static int SFlineToTextH = 3; -static int SFlineToTextV = 3; - -static int SFbesideText = 3; -static int SFaboveAndBelowText = 2; - -static int SFcharsPerEntry = 15; - -static int SFlistSize = 10; - -static int SFcurrentInvert[3] = { -1, -1, -1 }; - -static int SFworkProcAdded = 0; - -static XtAppContext SFapp; - -static int SFpathScrollWidth, SFvScrollHeight, SFhScrollWidth; - -#ifdef FEAT_XFONTSET -static char SFtextBuffer[MAXPATHL*sizeof(wchar_t)]; -#else -static char SFtextBuffer[MAXPATHL]; -#endif - -static int SFbuttonPressed = 0; - -static XtIntervalId SFdirModTimerId; - -static int (*SFfunc)(); - -static int SFstatus = SEL_FILE_NULL; - -///////////////// forward declare static functions - -static void SFsetText(char *path); -static void SFtextChanged(void); -static int SFgetDir(SFDir *dir); -static void SFdrawLists(int doScroll); -static void SFdrawList(int n, int doScroll); -static void SFclearList(int n, int doScroll); -static char SFstatChar(stat_T *statBuf); -static void SFmotionList(Widget w, XtPointer np, XMotionEvent *event, Boolean *cont); -static void SFvSliderMovedCallback(Widget w, int n, int nw); -static Boolean SFworkProc(void *); -static int SFcompareEntries(const void *p, const void *q); - -////////////////// xstat.h - -#ifndef S_IXUSR -# define S_IXUSR 0100 -#endif -#ifndef S_IXGRP -# define S_IXGRP 0010 -#endif -#ifndef S_IXOTH -# define S_IXOTH 0001 -#endif - -#define S_ISXXX(m) ((m) & (S_IXUSR | S_IXGRP | S_IXOTH)) - -////////////////// Path.c - -#include <pwd.h> - -typedef struct -{ - char *name; - char *dir; -} SFLogin; - -static int SFdoNotTouchDirPtr = 0; - -static int SFdoNotTouchVorigin = 0; - -static SFDir SFrootDir, SFhomeDir; - -static SFLogin *SFlogins; - -static int SFtwiddle = 0; - - static int -SFchdir(char *path) -{ - int result; - - result = 0; - - if (strcmp(path, SFcurrentDir)) - { - result = mch_chdir(path); - if (!result) - (void) strcpy(SFcurrentDir, path); - } - - return result; -} - - static void -SFfree(int i) -{ - SFDir *dir; - int j; - - dir = &(SFdirs[i]); - - for (j = dir->nEntries - 1; j >= 0; j--) - { - if (dir->entries[j].shown != dir->entries[j].real) - XtFree(dir->entries[j].shown); - XtFree(dir->entries[j].real); - } - - XtFree((char *)dir->entries); - XtFree(dir->dir); - - dir->dir = NULL; -} - - static void -SFstrdup(char **s1, char *s2) -{ - *s1 = strcpy(XtMalloc((unsigned)(strlen(s2) + 1)), s2); -} - - static void -SFunreadableDir(SFDir *dir) -{ - char *cannotOpen = _("<cannot open> "); - - dir->entries = (SFEntry *) XtMalloc(sizeof(SFEntry)); - dir->entries[0].statDone = 1; - SFstrdup(&dir->entries[0].real, cannotOpen); - dir->entries[0].shown = dir->entries[0].real; - dir->nEntries = 1; - dir->nChars = strlen(cannotOpen); -} - - static void -SFreplaceText(SFDir *dir, char *str) -{ - int len; - - *(dir->path) = 0; - len = strlen(str); - if (str[len - 1] == '/') - (void) strcat(SFcurrentPath, str); - else - (void) strncat(SFcurrentPath, str, len - 1); - if (strncmp(SFcurrentPath, SFstartDir, strlen(SFstartDir))) - SFsetText(SFcurrentPath); - else - SFsetText(&(SFcurrentPath[strlen(SFstartDir)])); - - SFtextChanged(); -} - - static void -SFexpand(char *str) -{ - int len; - int cmp; - char *name, *growing; - SFDir *dir; - SFEntry *entry, *max; - - len = strlen(str); - - dir = &(SFdirs[SFdirEnd - 1]); - - if (dir->beginSelection == -1) - { - SFstrdup(&str, str); - SFreplaceText(dir, str); - XtFree(str); - return; - } - else if (dir->beginSelection == dir->endSelection) - { - SFreplaceText(dir, dir->entries[dir->beginSelection].shown); - return; - } - - max = &(dir->entries[dir->endSelection + 1]); - - name = dir->entries[dir->beginSelection].shown; - SFstrdup(&growing, name); - - cmp = 0; - while (!cmp) - { - entry = &(dir->entries[dir->beginSelection]); - while (entry < max) - { - if ((cmp = strncmp(growing, entry->shown, len))) - break; - entry++; - } - len++; - } - - /* - * SFreplaceText() expects filename - */ - growing[len - 2] = ' '; - - growing[len - 1] = 0; - SFreplaceText(dir, growing); - XtFree(growing); -} - - static int -SFfindFile(SFDir *dir, char *str) -{ - int i, last, max; - char *name, save; - SFEntry *entries; - int len; - int begin, end; - int result; - - len = strlen(str); - - if (str[len - 1] == ' ') - { - SFexpand(str); - return 1; - } - else if (str[len - 1] == '/') - len--; - - max = dir->nEntries; - - entries = dir->entries; - - i = 0; - while (i < max) - { - name = entries[i].shown; - last = strlen(name) - 1; - save = name[last]; - name[last] = 0; - - result = strncmp(str, name, len); - - name[last] = save; - if (result <= 0) - break; - i++; - } - begin = i; - while (i < max) - { - name = entries[i].shown; - last = strlen(name) - 1; - save = name[last]; - name[last] = 0; - - result = strncmp(str, name, len); - - name[last] = save; - if (result) - break; - i++; - } - end = i; - - if (begin != end) - { - if ((dir->beginSelection != begin) || (dir->endSelection != end - 1)) - { - dir->changed = 1; - dir->beginSelection = begin; - if (str[strlen(str) - 1] == '/') - dir->endSelection = begin; - else - dir->endSelection = end - 1; - } - } - else if (dir->beginSelection != -1) - { - dir->changed = 1; - dir->beginSelection = -1; - dir->endSelection = -1; - } - - if (SFdoNotTouchVorigin - || ((begin > dir->vOrigin) && (end < dir->vOrigin + SFlistSize))) - { - SFdoNotTouchVorigin = 0; - return 0; - } - - i = begin - 1; - if (i > max - SFlistSize) - i = max - SFlistSize; - if (i < 0) - i = 0; - - if (dir->vOrigin != i) - { - dir->vOrigin = i; - dir->changed = 1; - } - - return 0; -} - - static void -SFunselect(void) -{ - SFDir *dir; - - dir = &(SFdirs[SFdirEnd - 1]); - if (dir->beginSelection != -1) - dir->changed = 1; - dir->beginSelection = -1; - dir->endSelection = -1; -} - - static int -SFcompareLogins(const void *p, const void *q) -{ - return strcmp(((SFLogin *)p)->name, ((SFLogin *)q)->name); -} - - static void -SFgetHomeDirs(void) -{ - struct passwd *pw; - int Alloc; |