K.Takata's patch queue for Vim
Revision | 5077b7f9878140ca6e52410578bbf5380baa12dd (tree) |
---|---|
Zeit | 2022-01-22 22:43:28 |
Autor | K.Takata <kentkt@csc....> |
Commiter | K.Takata |
Update for 8.2.4175
Remove a merged patch.
@@ -29,5 +29,4 @@ | ||
29 | 29 | add-testing-option-7970.patch |
30 | 30 | wip-win32-vimdir-encoding.patch #+wip |
31 | 31 | win32-directwrite-ambiwidth-auto.patch |
32 | -win32-always-enable-multiline-balloon.patch | |
33 | 32 | fix-config_cache-removal.patch #+rejected |
@@ -1,235 +0,0 @@ | ||
1 | -# HG changeset patch | |
2 | -# Parent 6b740aadb2c5924e54c721142e598660406c3c21 | |
3 | - | |
4 | -diff --git a/src/evalfunc.c b/src/evalfunc.c | |
5 | ---- a/src/evalfunc.c | |
6 | -+++ b/src/evalfunc.c | |
7 | -@@ -5104,8 +5104,7 @@ f_has(typval_T *argvars, typval_T *rettv | |
8 | - #endif | |
9 | - }, | |
10 | - {"balloon_multiline", | |
11 | --#if defined(FEAT_BEVAL_GUI) && !defined(FEAT_GUI_MSWIN) | |
12 | -- // MS-Windows requires runtime check, see below | |
13 | -+#ifdef FEAT_BEVAL_GUI | |
14 | - 1 | |
15 | - #else | |
16 | - 0 | |
17 | -@@ -6079,10 +6078,6 @@ f_has(typval_T *argvars, typval_T *rettv | |
18 | - { | |
19 | - // intentionally empty | |
20 | - } | |
21 | --#if defined(FEAT_BEVAL) && defined(FEAT_GUI_MSWIN) | |
22 | -- else if (STRICMP(name, "balloon_multiline") == 0) | |
23 | -- n = multiline_balloon_available(); | |
24 | --#endif | |
25 | - #ifdef VIMDLL | |
26 | - else if (STRICMP(name, "filterpipe") == 0) | |
27 | - n = gui.in_use || gui.starting; | |
28 | -@@ -6261,9 +6256,6 @@ f_has(typval_T *argvars, typval_T *rettv | |
29 | - dynamic_feature(char_u *feature) | |
30 | - { | |
31 | - return (feature == NULL | |
32 | --#if defined(FEAT_BEVAL) && defined(FEAT_GUI_MSWIN) | |
33 | -- || STRICMP(feature, "balloon_multiline") == 0 | |
34 | --#endif | |
35 | - #if defined(FEAT_GUI) && defined(FEAT_BROWSE) | |
36 | - || (STRICMP(feature, "browse") == 0 && !gui.in_use) | |
37 | - #endif | |
38 | -diff --git a/src/gui_w32.c b/src/gui_w32.c | |
39 | ---- a/src/gui_w32.c | |
40 | -+++ b/src/gui_w32.c | |
41 | -@@ -4035,42 +4035,6 @@ static UINT_PTR BevalTimerId = 0; | |
42 | - static DWORD LastActivity = 0; | |
43 | - | |
44 | - | |
45 | --// cproto fails on missing include files | |
46 | --# ifndef PROTO | |
47 | -- | |
48 | --/* | |
49 | -- * excerpts from headers since this may not be presented | |
50 | -- * in the extremely old compilers | |
51 | -- */ | |
52 | --# include <pshpack1.h> | |
53 | -- | |
54 | --# endif | |
55 | -- | |
56 | --typedef struct _DllVersionInfo | |
57 | --{ | |
58 | -- DWORD cbSize; | |
59 | -- DWORD dwMajorVersion; | |
60 | -- DWORD dwMinorVersion; | |
61 | -- DWORD dwBuildNumber; | |
62 | -- DWORD dwPlatformID; | |
63 | --} DLLVERSIONINFO; | |
64 | -- | |
65 | --# ifndef PROTO | |
66 | --# include <poppack.h> | |
67 | --# endif | |
68 | -- | |
69 | --typedef struct tagTOOLINFOA_NEW | |
70 | --{ | |
71 | -- UINT cbSize; | |
72 | -- UINT uFlags; | |
73 | -- HWND hwnd; | |
74 | -- UINT_PTR uId; | |
75 | -- RECT rect; | |
76 | -- HINSTANCE hinst; | |
77 | -- LPSTR lpszText; | |
78 | -- LPARAM lParam; | |
79 | --} TOOLINFO_NEW; | |
80 | -- | |
81 | - typedef struct tagNMTTDISPINFO_NEW | |
82 | - { | |
83 | - NMHDR hdr; | |
84 | -@@ -4105,7 +4069,6 @@ typedef struct tagNMTTDISPINFOW_NEW | |
85 | - } NMTTDISPINFOW_NEW; | |
86 | - | |
87 | - | |
88 | --typedef HRESULT (WINAPI* DLLGETVERSIONPROC)(DLLVERSIONINFO *); | |
89 | - # ifndef TTM_SETMAXTIPWIDTH | |
90 | - # define TTM_SETMAXTIPWIDTH (WM_USER+24) | |
91 | - # endif | |
92 | -@@ -8561,89 +8524,13 @@ gui_mch_destroy_sign(void *sign) | |
93 | - * 5) WM_NOTIFY:TTN_POP destroys created tooltip | |
94 | - */ | |
95 | - | |
96 | --/* | |
97 | -- * determine whether installed Common Controls support multiline tooltips | |
98 | -- * (i.e. their version is >= 4.70 | |
99 | -- */ | |
100 | -- int | |
101 | --multiline_balloon_available(void) | |
102 | --{ | |
103 | -- HINSTANCE hDll; | |
104 | -- static char comctl_dll[] = "comctl32.dll"; | |
105 | -- static int multiline_tip = MAYBE; | |
106 | -- | |
107 | -- if (multiline_tip != MAYBE) | |
108 | -- return multiline_tip; | |
109 | -- | |
110 | -- hDll = GetModuleHandle(comctl_dll); | |
111 | -- if (hDll != NULL) | |
112 | -- { | |
113 | -- DLLGETVERSIONPROC pGetVer; | |
114 | -- pGetVer = (DLLGETVERSIONPROC)GetProcAddress(hDll, "DllGetVersion"); | |
115 | -- | |
116 | -- if (pGetVer != NULL) | |
117 | -- { | |
118 | -- DLLVERSIONINFO dvi; | |
119 | -- HRESULT hr; | |
120 | -- | |
121 | -- ZeroMemory(&dvi, sizeof(dvi)); | |
122 | -- dvi.cbSize = sizeof(dvi); | |
123 | -- | |
124 | -- hr = (*pGetVer)(&dvi); | |
125 | -- | |
126 | -- if (SUCCEEDED(hr) | |
127 | -- && (dvi.dwMajorVersion > 4 | |
128 | -- || (dvi.dwMajorVersion == 4 | |
129 | -- && dvi.dwMinorVersion >= 70))) | |
130 | -- { | |
131 | -- multiline_tip = TRUE; | |
132 | -- return multiline_tip; | |
133 | -- } | |
134 | -- } | |
135 | -- else | |
136 | -- { | |
137 | -- // there is chance we have ancient CommCtl 4.70 | |
138 | -- // which doesn't export DllGetVersion | |
139 | -- DWORD dwHandle = 0; | |
140 | -- DWORD len = GetFileVersionInfoSize(comctl_dll, &dwHandle); | |
141 | -- if (len > 0) | |
142 | -- { | |
143 | -- VS_FIXEDFILEINFO *ver; | |
144 | -- UINT vlen = 0; | |
145 | -- void *data = alloc(len); | |
146 | -- | |
147 | -- if ((data != NULL | |
148 | -- && GetFileVersionInfo(comctl_dll, 0, len, data) | |
149 | -- && VerQueryValue(data, "\\", (void **)&ver, &vlen) | |
150 | -- && vlen | |
151 | -- && HIWORD(ver->dwFileVersionMS) > 4) | |
152 | -- || ((HIWORD(ver->dwFileVersionMS) == 4 | |
153 | -- && LOWORD(ver->dwFileVersionMS) >= 70))) | |
154 | -- { | |
155 | -- vim_free(data); | |
156 | -- multiline_tip = TRUE; | |
157 | -- return multiline_tip; | |
158 | -- } | |
159 | -- vim_free(data); | |
160 | -- } | |
161 | -- } | |
162 | -- } | |
163 | -- multiline_tip = FALSE; | |
164 | -- return multiline_tip; | |
165 | --} | |
166 | -- | |
167 | - static void | |
168 | - make_tooltip(BalloonEval *beval, char *text, POINT pt) | |
169 | - { | |
170 | -- TOOLINFOW *pti; | |
171 | -- int ToolInfoSize; | |
172 | -- | |
173 | -- if (multiline_balloon_available()) | |
174 | -- ToolInfoSize = sizeof(TOOLINFOW_NEW); | |
175 | -- else | |
176 | -- ToolInfoSize = sizeof(TOOLINFOW); | |
177 | -- | |
178 | -- pti = alloc(ToolInfoSize); | |
179 | -+ TOOLINFOW_NEW *pti; | |
180 | -+ RECT rect; | |
181 | -+ | |
182 | -+ pti = alloc(sizeof(TOOLINFOW_NEW)); | |
183 | - if (pti == NULL) | |
184 | - return; | |
185 | - | |
186 | -@@ -8655,30 +8542,19 @@ make_tooltip(BalloonEval *beval, char *t | |
187 | - SetWindowPos(beval->balloon, HWND_TOPMOST, 0, 0, 0, 0, | |
188 | - SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); | |
189 | - | |
190 | -- pti->cbSize = ToolInfoSize; | |
191 | -+ pti->cbSize = sizeof(TOOLINFOW_NEW); | |
192 | - pti->uFlags = TTF_SUBCLASS; | |
193 | - pti->hwnd = beval->target; | |
194 | - pti->hinst = 0; // Don't use string resources | |
195 | - pti->uId = ID_BEVAL_TOOLTIP; | |
196 | - | |
197 | -- if (multiline_balloon_available()) | |
198 | -- { | |
199 | -- RECT rect; | |
200 | -- TOOLINFOW_NEW *ptin = (TOOLINFOW_NEW *)pti; | |
201 | -- pti->lpszText = LPSTR_TEXTCALLBACKW; | |
202 | -- beval->tofree = enc_to_utf16((char_u*)text, NULL); | |
203 | -- ptin->lParam = (LPARAM)beval->tofree; | |
204 | -- // switch multiline tooltips on | |
205 | -- if (GetClientRect(s_textArea, &rect)) | |
206 | -- SendMessageW(beval->balloon, TTM_SETMAXTIPWIDTH, 0, | |
207 | -- (LPARAM)rect.right); | |
208 | -- } | |
209 | -- else | |
210 | -- { | |
211 | -- // do this old way | |
212 | -- beval->tofree = enc_to_utf16((char_u*)text, NULL); | |
213 | -- pti->lpszText = (LPWSTR)beval->tofree; | |
214 | -- } | |
215 | -+ pti->lpszText = LPSTR_TEXTCALLBACKW; | |
216 | -+ beval->tofree = enc_to_utf16((char_u*)text, NULL); | |
217 | -+ pti->lParam = (LPARAM)beval->tofree; | |
218 | -+ // switch multiline tooltips on | |
219 | -+ if (GetClientRect(s_textArea, &rect)) | |
220 | -+ SendMessageW(beval->balloon, TTM_SETMAXTIPWIDTH, 0, | |
221 | -+ (LPARAM)rect.right); | |
222 | - | |
223 | - // Limit ballooneval bounding rect to CursorPos neighbourhood. | |
224 | - pti->rect.left = pt.x - 3; | |
225 | -diff --git a/src/proto/gui_w32.pro b/src/proto/gui_w32.pro | |
226 | ---- a/src/proto/gui_w32.pro | |
227 | -+++ b/src/proto/gui_w32.pro | |
228 | -@@ -91,7 +91,6 @@ void gui_mch_set_foreground(void); | |
229 | - void gui_mch_drawsign(int row, int col, int typenr); | |
230 | - void *gui_mch_register_sign(char_u *signfile); | |
231 | - void gui_mch_destroy_sign(void *sign); | |
232 | --int multiline_balloon_available(void); | |
233 | - void gui_mch_disable_beval_area(BalloonEval *beval); | |
234 | - void gui_mch_enable_beval_area(BalloonEval *beval); | |
235 | - void gui_mch_post_balloon(BalloonEval *beval, char_u *mesg); |