summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-04-25 22:13:59 +0000
committerBram Moolenaar <Bram@vim.org>2006-04-25 22:13:59 +0000
commit551dbcc9b604c2992f908fb475e797fcc116315b (patch)
treed48db26e4f3470df23fdd8e8593bcf067fab4142 /src
parentf9393ef5efde2f425fbd9e19363186f8c9103376 (diff)
downloadvim-git-551dbcc9b604c2992f908fb475e797fcc116315b.tar.gz
updated for version 7.0f01v7.0f01
Diffstat (limited to 'src')
-rw-r--r--src/Make_mvc.mak12
-rw-r--r--src/gui.c6
-rw-r--r--src/gui.h5
-rw-r--r--src/gui_motif.c2
-rw-r--r--src/gui_w32.c115
-rw-r--r--src/gui_w48.c10
-rw-r--r--src/hardcopy.c4
-rw-r--r--src/os_mswin.c10
-rw-r--r--src/proto/os_mswin.pro4
-rw-r--r--src/version.h6
10 files changed, 116 insertions, 58 deletions
diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
index 9c11aa0e8..afc05d527 100644
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -1046,8 +1046,16 @@ proto.h: \
proto/window.pro \
$(NETBEANS_PRO)
-.cod.c:
- $(CC) $(CFLAGS) /FAc $<
+.SUFFIXES: .cod
+
+# Generate foo.cod (mixed source and assembly listing) from foo.c via "nmake
+# foo.cod"
+.c.cod:
+ $(CC) $(CFLAGS) /FAcs $<
+
+# Generate foo.i (preprocessor listing) from foo.c via "nmake foo.i"
+.c.i:
+ $(CC) $(CFLAGS) /P /C $<
# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0:
diff --git a/src/gui.c b/src/gui.c
index 0fdcabe5a..400689178 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -1160,7 +1160,7 @@ gui_position_components(total_width)
# if defined(FEAT_GUI_TABLINE) && (defined(FEAT_GUI_MSWIN) \
|| defined(FEAT_GUI_MOTIF))
if (gui_has_tabline())
- text_area_y += TABLINE_HEIGHT;
+ text_area_y += gui.tabline_height;
#endif
#if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA))
@@ -1247,7 +1247,7 @@ gui_get_base_height()
# if defined(FEAT_GUI_TABLINE) && (defined(FEAT_GUI_MSWIN) \
|| defined(FEAT_GUI_MOTIF))
if (gui_has_tabline())
- base_height += TABLINE_HEIGHT;
+ base_height += gui.tabline_height;
# endif
# ifdef FEAT_FOOTER
if (vim_strchr(p_go, GO_FOOTER) != NULL)
@@ -3992,7 +3992,7 @@ gui_update_scrollbars(force)
#if defined(FEAT_GUI_TABLINE) && defined(FEAT_GUI_MSWIN)
if (gui_has_tabline())
- y += TABLINE_HEIGHT;
+ y += gui.tabline_height;
#endif
#ifdef FEAT_WINDOWS
diff --git a/src/gui.h b/src/gui.h
index 36156f9dd..e654a21b6 100644
--- a/src/gui.h
+++ b/src/gui.h
@@ -412,6 +412,11 @@ typedef struct Gui
char_u *browse_fname; /* file name from filedlg */
#endif /* FEAT_GUI_GTK */
+#if defined(FEAT_GUI_TABLINE) \
+ && (defined(FEAT_GUI_W32) || defined(FEAT_GUI_MOTIF))
+ int tabline_height;
+#endif
+
#ifdef FEAT_FOOTER
int footer_height; /* height of the message footer */
#endif
diff --git a/src/gui_motif.c b/src/gui_motif.c
index ccc97782d..69399b0da 100644
--- a/src/gui_motif.c
+++ b/src/gui_motif.c
@@ -493,6 +493,8 @@ gui_x11_create_widgets()
XtAddEventHandler(tabLine, ButtonPressMask, False,
(XtEventHandler)tabline_menu_cb, NULL);
+ gui.tabline_height = TABLINE_HEIGHT;
+
/*
* Set the size of the minor next/prev scrollers to zero, so
* that they are not displayed. Due to a bug in OpenMotif 2.3,
diff --git a/src/gui_w32.c b/src/gui_w32.c
index d6718798b..4b4e9a9c0 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -181,7 +181,9 @@
# define ID_BEVAL_TOOLTIP 200
# define BEVAL_TEXT_LEN MAXPATHL
-#ifndef UINT_PTR
+#if _MSC_VER < 1300
+/* Work around old versions of basetsd.h which wrongly declare
+ * UINT_PTR as unsigned long */
# define UINT_PTR UINT
#endif
@@ -195,7 +197,7 @@ static DWORD LastActivity = 0;
/*
* excerpts from headers since this may not be presented
- * in the extremelly old compilers
+ * in the extremely old compilers
*/
#include <pshpack1.h>
@@ -568,6 +570,70 @@ _OnMouseWheel(
_OnScroll(hwnd, hwndCtl, zDelta >= 0 ? SB_PAGEUP : SB_PAGEDOWN, 0);
}
+#ifdef USE_SYSMENU_FONT
+/*
+ * Get Menu Font.
+ * Return OK or FAIL.
+ */
+ static int
+gui_w32_get_menu_font(LOGFONT *lf)
+{
+ NONCLIENTMETRICS nm;
+
+ nm.cbSize = sizeof(NONCLIENTMETRICS);
+ if (!SystemParametersInfo(
+ SPI_GETNONCLIENTMETRICS,
+ sizeof(NONCLIENTMETRICS),
+ &nm,
+ 0))
+ return FAIL;
+ *lf = nm.lfMenuFont;
+ return OK;
+}
+#endif
+
+
+#if defined(FEAT_GUI_TABLINE) && defined(USE_SYSMENU_FONT)
+/*
+ * Set the GUI tabline font to the system menu font
+ */
+ static void
+set_tabline_font(void)
+{
+ LOGFONT lfSysmenu;
+ HFONT font;
+ HWND hwnd;
+ HDC hdc;
+ HFONT hfntOld;
+ TEXTMETRIC tm;
+
+ if (gui_w32_get_menu_font(&lfSysmenu) != OK)
+ return;
+
+ font = CreateFontIndirect(&lfSysmenu);
+
+ SendMessage(s_tabhwnd, WM_SETFONT, (WPARAM)font, TRUE);
+
+ /*
+ * Compute the height of the font used for the tab text
+ */
+ hwnd = GetDesktopWindow();
+ hdc = GetWindowDC(hwnd);
+ hfntOld = SelectFont(hdc, font);
+
+ GetTextMetrics(hdc, &tm);
+
+ SelectFont(hdc, hfntOld);
+ ReleaseDC(hwnd, hdc);
+
+ /*
+ * The space used by the tab border and the space between the tab label
+ * and the tab border is included as 7.
+ */
+ gui.tabline_height = tm.tmHeight + tm.tmInternalLeading + 7;
+}
+#endif
+
/*
* Invoked when a setting was changed.
*/
@@ -577,6 +643,10 @@ _OnSettingChange(UINT n)
if (n == SPI_SETWHEELSCROLLLINES)
SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0,
&mouse_scroll_lines, 0);
+#if defined(FEAT_GUI_TABLINE) && defined(USE_SYSMENU_FONT)
+ if (n == SPI_SETNONCLIENTMETRICS)
+ set_tabline_font();
+#endif
return 0;
}
@@ -873,7 +943,7 @@ _WndProc(
{
int wlen;
- wlen = (wcslen(wstr) + 1)
+ wlen = ((int)wcslen(wstr) + 1)
* sizeof(WCHAR);
if (tt_text_len < wlen)
{
@@ -893,7 +963,7 @@ _WndProc(
{
int len;
- len = STRLEN(NameBuff) + 1;
+ len = (int)STRLEN(NameBuff) + 1;
if (tt_text_len < len)
{
tt_text = vim_realloc(tt_text, len);
@@ -2870,28 +2940,6 @@ static const char_u *dlg_icons[] = /* must match names in resource file */
"IDR_VIM_QUESTION"
};
-#ifdef USE_SYSMENU_FONT
-/*
- * Get Menu Font.
- * Return OK or FAIL.
- */
- static int
-gui_w32_get_menu_font(LOGFONT *lf)
-{
- NONCLIENTMETRICS nm;
-
- nm.cbSize = sizeof(NONCLIENTMETRICS);
- if (!SystemParametersInfo(
- SPI_GETNONCLIENTMETRICS,
- sizeof(NONCLIENTMETRICS),
- &nm,
- 0))
- return FAIL;
- *lf = nm.lfMenuFont;
- return OK;
-}
-#endif
-
int
gui_mch_dialog(
int type,
@@ -4070,10 +4118,6 @@ get_toolbar_bitmap(vimmenu_T *menu)
static void
initialise_tabline(void)
{
-# ifdef USE_SYSMENU_FONT
- LOGFONT lfSysmenu;
-# endif
-
InitCommonControls();
s_tabhwnd = CreateWindow(WC_TABCONTROL, "Vim tabline",
@@ -4081,12 +4125,10 @@ initialise_tabline(void)
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, s_hwnd, NULL, s_hinst, NULL);
+ gui.tabline_height = TABLINE_HEIGHT;
+
# ifdef USE_SYSMENU_FONT
- if (gui_w32_get_menu_font(&lfSysmenu) == OK)
- {
- HFONT font = CreateFontIndirect(&lfSysmenu);
- SendMessage(s_tabhwnd, WM_SETFONT, (WPARAM) font, TRUE);
- }
+ set_tabline_font();
# endif
}
#endif
@@ -4559,8 +4601,7 @@ gui_mch_enable_beval_area(beval)
if (beval == NULL)
return;
// TRACE0("gui_mch_enable_beval_area {{{");
- BevalTimerId = SetTimer(s_textArea, 0, p_bdlay / 2,
- (TIMERPROC)BevalTimerProc);
+ BevalTimerId = SetTimer(s_textArea, 0, p_bdlay / 2, BevalTimerProc);
// TRACE0("gui_mch_enable_beval_area }}}");
}
diff --git a/src/gui_w48.c b/src/gui_w48.c
index 2e43557f2..44d03d067 100644
--- a/src/gui_w48.c
+++ b/src/gui_w48.c
@@ -1122,12 +1122,12 @@ gui_mch_set_text_area_pos(int x, int y, int w, int h)
int top = 0;
RECT rect;
-#ifdef FEAT_TOOLBAR
+# ifdef FEAT_TOOLBAR
if (vim_strchr(p_go, GO_TOOLBAR) != NULL)
top = TOOLBAR_BUTTON_HEIGHT + TOOLBAR_BORDER_HEIGHT;
-#endif
+# endif
GetClientRect(s_hwnd, &rect);
- MoveWindow(s_tabhwnd, 0, top, rect.right, TABLINE_HEIGHT, TRUE);
+ MoveWindow(s_tabhwnd, 0, top, rect.right, gui.tabline_height, TRUE);
}
#endif
@@ -2379,8 +2379,8 @@ gui_mch_set_curtab(nr)
if (s_tabhwnd == NULL)
return;
- if (TabCtrl_GetCurSel(s_tabhwnd) != nr)
- TabCtrl_SetCurSel(s_tabhwnd, nr);
+ if (TabCtrl_GetCurSel(s_tabhwnd) != nr -1)
+ TabCtrl_SetCurSel(s_tabhwnd, nr -1);
}
#endif
diff --git a/src/hardcopy.c b/src/hardcopy.c
index bc5a219fc..3b4c2d12c 100644
--- a/src/hardcopy.c
+++ b/src/hardcopy.c
@@ -53,11 +53,11 @@
* void mch_print_set_font(int Bold, int Italic, int Underline);
* Called whenever the font style changes.
*
- * void mch_print_set_bg(long bgcol);
+ * void mch_print_set_bg(long_u bgcol);
* Called to set the background color for the following text. Parameter is an
* RGB value.
*
- * void mch_print_set_fg(long fgcol);
+ * void mch_print_set_fg(long_u fgcol);
* Called to set the foreground color for the following text. Parameter is an
* RGB value.
*
diff --git a/src/os_mswin.c b/src/os_mswin.c
index 9e8b64d2d..efbd01d73 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -2323,9 +2323,10 @@ mch_print_set_font(int iBold, int iItalic, int iUnderline)
}
void
-mch_print_set_bg(unsigned long bgcol)
+mch_print_set_bg(long_u bgcol)
{
- SetBkColor(prt_dlg.hDC, GetNearestColor(prt_dlg.hDC, swap_me(bgcol)));
+ SetBkColor(prt_dlg.hDC, GetNearestColor(prt_dlg.hDC,
+ swap_me((COLORREF)bgcol)));
/*
* With a white background we can draw characters transparent, which is
* good for italic characters that overlap to the next char cell.
@@ -2337,9 +2338,10 @@ mch_print_set_bg(unsigned long bgcol)
}
void
-mch_print_set_fg(unsigned long fgcol)
+mch_print_set_fg(long_u fgcol)
{
- SetTextColor(prt_dlg.hDC, GetNearestColor(prt_dlg.hDC, swap_me(fgcol)));
+ SetTextColor(prt_dlg.hDC, GetNearestColor(prt_dlg.hDC,
+ swap_me((COLORREF)fgcol)));
}
#endif /*FEAT_PRINTER && !FEAT_POSTSCRIPT*/
diff --git a/src/proto/os_mswin.pro b/src/proto/os_mswin.pro
index aaef05b1a..f46a3f852 100644
--- a/src/proto/os_mswin.pro
+++ b/src/proto/os_mswin.pro
@@ -46,8 +46,8 @@ extern int mch_print_blank_page __ARGS((void));
extern void mch_print_start_line __ARGS((int margin, int page_line));
extern int mch_print_text_out __ARGS((char_u *p, int len));
extern void mch_print_set_font __ARGS((int iBold, int iItalic, int iUnderline));
-extern void mch_print_set_bg __ARGS((unsigned long bgcol));
-extern void mch_print_set_fg __ARGS((unsigned long fgcol));
+extern void mch_print_set_bg __ARGS((long_u bgcol));
+extern void mch_print_set_fg __ARGS((long_u fgcol));
extern char_u *mch_resolve_shortcut __ARGS((char_u *fname));
extern void win32_set_foreground __ARGS((void));
extern void serverInitMessaging __ARGS((void));
diff --git a/src/version.h b/src/version.h
index faaa75598..216f60474 100644
--- a/src/version.h
+++ b/src/version.h
@@ -35,6 +35,6 @@
*/
#define VIM_VERSION_NODOT "vim70f"
#define VIM_VERSION_SHORT "7.0f"
-#define VIM_VERSION_MEDIUM "7.0f BETA"
-#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0f BETA (2006 Apr 24)"
-#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0f BETA (2006 Apr 24, compiled "
+#define VIM_VERSION_MEDIUM "7.0f01 BETA"
+#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0f01 BETA (2006 Apr 25)"
+#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0f01 BETA (2006 Apr 25, compiled "