Commits

Anonymous committed eff3887

updated for version 7.0028

Comments (0)

Files changed (5)

 #	  GETTEXT=[yes or no]  (default is yes)
 #	See http://sourceforge.net/projects/gettext/
 #       PostScript printing: POSTSCRIPT=yes (default is no)
-#       Feature Set: FEATURES=[TINY, SMALL, NORMAL, BIG, or HUGE] (default is BIG)
+#       Feature Set: FEATURES=[TINY, SMALL, NORMAL, BIG, HUGE] (default is BIG)
 #       Version Support: WINVER=[0x0400, 0x0500] (default is 0x0400)
-#       Processor Version: CPUNR=[i386, i486, i586, i686] (default is i386)
+#       Processor Version: CPUNR=[i386, i486, i586, i686, P4] (default is i386)
 #       Optimization: OPTIMIZE=[SPACE, SPEED, MAXSPEED] (default is MAXSPEED)
 #       Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes)
 #       Netbeans Debugging Support: NBDEBUG=[yes or no] (default is no)
 CPUARG = /G5
 !elseif "$(CPUNR)" == "i686"
 CPUARG = /G6
+!elseif "$(CPUNR)" == "P4"
+CPUARG = /G7 /arch:SSE2
 !else
 CPUARG =
 !endif
 !else # MAXSPEED
 OPTFLAG = /Ox
 !endif
-CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG /Zi $(CPUARG)
+CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
 RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
-PDB = /Fd$(OUTDIR)/
-LINK_PDB = /PDB:$(OUTDIR)/
+PDB =
+LINK_PDB =
 ! ifdef USE_MSVCRT
 CFLAGS = $(CFLAGS) -MD
 LIBC = msvcrt.lib
 	$(MAKE) /NOLOGO -f Make_dos.mak win32
 	cd ..
 
+testclean:
+	cd testdir
+	$(MAKE) /NOLOGO -f Make_dos.mak clean
+	cd ..
+
 ###########################################################################
 
 # Create a default rule for transforming .c files to .obj files in $(OUTDIR)
 }
 
 #if defined(FEAT_TOOLBAR) || defined(PROTO)
+# include "gui_x11_pm.h"
+# ifdef HAVE_X11_XPM_H
+#  include <X11/xpm.h>
+# endif
+
+static void createXpmImages __ARGS((char_u *path, char **xpm, Pixmap *sen));
+static void get_toolbar_pixmap __ARGS((vimmenu_T *menu, Pixmap *sen));
+
+/*
+ * Allocated a pixmap for toolbar menu "menu".
+ * Return in "sen".
+ */
+    static void
+get_toolbar_pixmap(menu, sen)
+    vimmenu_T	*menu;
+    Pixmap	*sen;
+{
+    char_u	buf[MAXPATHL];		/* buffer storing expanded pathname */
+    char	**xpm = NULL;		/* xpm array */
+
+    buf[0] = NUL;			/* start with NULL path */
+
+    if (menu->iconfile != NULL)
+    {
+	/* Use the "icon="  argument. */
+	gui_find_iconfile(menu->iconfile, buf, "xpm");
+	createXpmImages(buf, NULL, sen);
+
+	/* If it failed, try using the menu name. */
+	if (*sen == (Pixmap)0 && gui_find_bitmap(menu->name, buf, "xpm") == OK)
+	    createXpmImages(buf, NULL, sen);
+	if (*sen != (Pixmap)0)
+	    return;
+    }
+
+    if (menu->icon_builtin || gui_find_bitmap(menu->name, buf, "xpm") == FAIL)
+    {
+	if (menu->iconidx >= 0 && menu->iconidx
+		   < (sizeof(built_in_pixmaps) / sizeof(built_in_pixmaps[0])))
+	    xpm = built_in_pixmaps[menu->iconidx];
+	else
+	    xpm = tb_blank_xpm;
+    }
+
+    if (xpm != NULL || buf[0] != NUL)
+	createXpmImages(buf, xpm, sen);
+}
+
+/*
+ * Read an Xpm file, doing color substitutions for the foreground and
+ * background colors. If there is an error reading a color xpm file,
+ * drop back and read the monochrome file. If successful, create the
+ * insensitive Pixmap too.
+ */
+    static void
+createXpmImages(path, xpm, sen)
+    char_u	*path;
+    char	**xpm;
+    Pixmap	*sen;
+{
+    Window	rootWindow;
+    XpmAttributes attrs;
+    XpmColorSymbol color[5] =
+    {
+	{"none", "none", 0},
+	{"iconColor1", NULL, 0},
+	{"bottomShadowColor", NULL, 0},
+	{"topShadowColor", NULL, 0},
+	{"selectColor", NULL, 0}
+    };
+    int		screenNum;
+    int		status;
+    Pixmap	mask;
+    Pixmap	map;
+
+    gui_mch_get_toolbar_colors(
+	    &color[BACKGROUND].pixel,
+	    &color[FOREGROUND].pixel,
+	    &color[BOTTOM_SHADOW].pixel,
+	    &color[TOP_SHADOW].pixel,
+	    &color[HIGHLIGHT].pixel);
+
+    /* Setup the color subsititution table */
+    attrs.valuemask = XpmColorSymbols;
+    attrs.colorsymbols = color;
+    attrs.numsymbols = 5;
+
+    screenNum = DefaultScreen(gui.dpy);
+    rootWindow = RootWindow(gui.dpy, screenNum);
+
+    /* Create the "sensitive" pixmap */
+    if (xpm != NULL)
+	status = XpmCreatePixmapFromData(gui.dpy, rootWindow, xpm,
+							 &map, &mask, &attrs);
+    else
+	status = XpmReadFileToPixmap(gui.dpy, rootWindow, (char *)path,
+							 &map, &mask, &attrs);
+    if (status == XpmSuccess && map != 0)
+    {
+	XGCValues   gcvalues;
+	GC	    back_gc;
+	GC	    mask_gc;
+
+	/* Need to create new Pixmaps with the mask applied. */
+	gcvalues.foreground = color[BACKGROUND].pixel;
+	back_gc = XCreateGC(gui.dpy, map, GCForeground, &gcvalues);
+	mask_gc = XCreateGC(gui.dpy, map, GCForeground, &gcvalues);
+	XSetClipMask(gui.dpy, mask_gc, mask);
+
+	/* Create the "sensitive" pixmap. */
+	*sen = XCreatePixmap(gui.dpy, rootWindow,
+		 attrs.width, attrs.height,
+		 DefaultDepth(gui.dpy, screenNum));
+	XFillRectangle(gui.dpy, *sen, back_gc, 0, 0,
+		attrs.width, attrs.height);
+	XCopyArea(gui.dpy, map, *sen, mask_gc, 0, 0,
+		attrs.width, attrs.height, 0, 0);
+
+	XFreeGC(gui.dpy, back_gc);
+	XFreeGC(gui.dpy, mask_gc);
+	XFreePixmap(gui.dpy, map);
+    }
+    else
+	*sen = 0;
+
+    XpmFreeAttributes(&attrs);
+}
+
     void
 gui_mch_set_toolbar_pos(x, y, w, h)
     int	    x;
 		if (mp->image != (Pixmap)0)
 		{
 		    XFreePixmap(gui.dpy, mp->image);
-		    get_toolbar_pixmap(mp, &mp->image, NULL);
+		    get_toolbar_pixmap(mp, &mp->image);
 		    if (mp->image != (Pixmap)0)
 			XtVaSetValues(mp->id, XtNbitmap, mp->image, NULL);
 		}
 	}
 	else
 	{
-	    get_toolbar_pixmap(menu, &menu->image, NULL);
+	    get_toolbar_pixmap(menu, &menu->image);
 	    XtSetArg(args[n], XtNlabel, menu->dname); n++;
 	    XtSetArg(args[n], XtNinternalHeight, 1); n++;
 	    XtSetArg(args[n], XtNinternalWidth, 1); n++;
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved		by Bram Moolenaar
+ *				GUI/Motif support by Robert Webb
+ *
+ * Do ":help uganda"  in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * Icons used by the toolbar code.
+ */
+#include "../pixmaps/tb_new.xpm"
+#include "../pixmaps/tb_open.xpm"
+#include "../pixmaps/tb_close.xpm"
+#include "../pixmaps/tb_save.xpm"
+#include "../pixmaps/tb_print.xpm"
+#include "../pixmaps/tb_cut.xpm"
+#include "../pixmaps/tb_copy.xpm"
+#include "../pixmaps/tb_paste.xpm"
+#include "../pixmaps/tb_find.xpm"
+#include "../pixmaps/tb_find_next.xpm"
+#include "../pixmaps/tb_find_prev.xpm"
+#include "../pixmaps/tb_find_help.xpm"
+#include "../pixmaps/tb_exit.xpm"
+#include "../pixmaps/tb_undo.xpm"
+#include "../pixmaps/tb_redo.xpm"
+#include "../pixmaps/tb_help.xpm"
+#include "../pixmaps/tb_macro.xpm"
+#include "../pixmaps/tb_make.xpm"
+#include "../pixmaps/tb_save_all.xpm"
+#include "../pixmaps/tb_jump.xpm"
+#include "../pixmaps/tb_ctags.xpm"
+#include "../pixmaps/tb_load_session.xpm"
+#include "../pixmaps/tb_save_session.xpm"
+#include "../pixmaps/tb_new_session.xpm"
+#include "../pixmaps/tb_blank.xpm"
+#include "../pixmaps/tb_maximize.xpm"
+#include "../pixmaps/tb_split.xpm"
+#include "../pixmaps/tb_minimize.xpm"
+#include "../pixmaps/tb_shell.xpm"
+#include "../pixmaps/tb_replace.xpm"
+#include "../pixmaps/tb_vsplit.xpm"
+#include "../pixmaps/tb_maxwidth.xpm"
+#include "../pixmaps/tb_minwidth.xpm"
+
+/*
+ * Those are the pixmaps used for the default buttons.
+ */
+static char **(built_in_pixmaps[]) =
+{
+    tb_new_xpm,
+    tb_open_xpm,
+    tb_save_xpm,
+    tb_undo_xpm,
+    tb_redo_xpm,
+    tb_cut_xpm,
+    tb_copy_xpm,
+    tb_paste_xpm,
+    tb_print_xpm,
+    tb_help_xpm,
+    tb_find_xpm,
+    tb_save_all_xpm,
+    tb_save_session_xpm,
+    tb_new_session_xpm,
+    tb_load_session_xpm,
+    tb_macro_xpm,
+    tb_replace_xpm,
+    tb_close_xpm,
+    tb_maximize_xpm,
+    tb_minimize_xpm,
+    tb_split_xpm,
+    tb_shell_xpm,
+    tb_find_prev_xpm,
+    tb_find_next_xpm,
+    tb_find_help_xpm,
+    tb_make_xpm,
+    tb_jump_xpm,
+    tb_ctags_xpm,
+    tb_vsplit_xpm,
+    tb_maxwidth_xpm,
+    tb_minwidth_xpm,
+    tb_exit_xpm
+};
+
+/* Indices for named colors */
+#define BACKGROUND	0
+#define FOREGROUND	1
+#define BOTTOM_SHADOW	2
+#define TOP_SHADOW	3
+#define HIGHLIGHT	4
 		&& oap->end.col == 0
 #ifdef FEAT_VISUAL
 		&& (!oap->is_VIsual || *p_sel == 'o')
+		&& !oap->block_mode
 #endif
 		&& oap->line_count > 1)
 	{
     int		height;
 {
     linenr_T	lnum;
+    linenr_T	bot;
     int		sline, line_size;
+    int		space;
+    int		did_below = FALSE;
 #define FRACTION_MULT	16384L
 
     /* Don't want a negative height.  Happens when splitting a tiny window.
 #endif
        )
     {
+	/*
+	 * Find a value for w_topline that shows the cursor at the same
+	 * relative position in the window as before (more or less).
+	 */
 	lnum = wp->w_cursor.lnum;
 	if (lnum < 1)		/* can happen when starting up */
 	    lnum = 1;
 	}
 	else
 	{
-	    while (sline > 0 && lnum > 1)
+	    space = height;
+	    while (lnum > 1)
 	    {
+		space -= line_size;
+		if (space > 0 && sline <= 0 && !did_below)
+		{
+		    /* Try to use "~" lines below the text to avoid that text
+		     * is above the window while there are empty lines.
+		     * Subtract the rows below the cursor from "space" and
+		     * give the rest to "sline". */
+		    did_below = TRUE;
+		    bot = wp->w_cursor.lnum;
+		    while (space > 0)
+		    {
+			if (wp->w_buffer->b_ml.ml_line_count - bot >= space)
+			    space = 0;
+			else
+			{
+#ifdef FEAT_FOLDING
+			    hasFoldingWin(wp, bot, NULL, &bot, TRUE, NULL);
+#endif
+			    if (bot >= wp->w_buffer->b_ml.ml_line_count)
+				break;
+			    ++bot;
+			    space -= plines_win(wp, bot, TRUE);
+			}
+		    }
+		    if (bot == wp->w_buffer->b_ml.ml_line_count && space > 0)
+			sline += space;
+		}
+		if (sline <= 0)
+		    break;
+
 #ifdef FEAT_FOLDING
 		hasFoldingWin(wp, lnum, &lnum, NULL, TRUE, NULL);
 		if (lnum == 1)
 		    line_size = plines_win(wp, lnum, TRUE);
 		sline -= line_size;
 	    }
+
 	    if (sline < 0)
 	    {
 		/*