Mercurial > vim
comparison src/gui_w32.c @ 12871:1a450ce6980c v8.0.1312
patch 8.0.1312: balloon_show() only works in terminal when compiled with GUI
commit https://github.com/vim/vim/commit/c3719bd87beca9f72d2e9f11e36d561c2c3b57b0
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Nov 18 22:13:31 2017 +0100
patch 8.0.1312: balloon_show() only works in terminal when compiled with GUI
Problem: balloon_show() only works in terminal when compiled with the GUI.
Solution: Add FEAT_BEVAL_GUI and refactor to move common code out of the GUI
specific file.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 18 Nov 2017 22:15:05 +0100 |
parents | 29a728529f92 |
children | 85a601f985ab |
comparison
equal
deleted
inserted
replaced
12870:0469872186f5 | 12871:1a450ce6980c |
---|---|
195 #ifndef PROTO | 195 #ifndef PROTO |
196 | 196 |
197 #ifndef __MINGW32__ | 197 #ifndef __MINGW32__ |
198 # include <shellapi.h> | 198 # include <shellapi.h> |
199 #endif | 199 #endif |
200 #if defined(FEAT_TOOLBAR) || defined(FEAT_BEVAL) || defined(FEAT_GUI_TABLINE) | 200 #if defined(FEAT_TOOLBAR) || defined(FEAT_BEVAL_GUI) || defined(FEAT_GUI_TABLINE) |
201 # include <commctrl.h> | 201 # include <commctrl.h> |
202 #endif | 202 #endif |
203 #include <windowsx.h> | 203 #include <windowsx.h> |
204 | 204 |
205 #ifdef GLOBAL_IME | 205 #ifdef GLOBAL_IME |
471 static UINT s_kFlags_pending; | 471 static UINT s_kFlags_pending; |
472 static UINT s_wait_timer = 0; /* Timer for get char from user */ | 472 static UINT s_wait_timer = 0; /* Timer for get char from user */ |
473 static int s_timed_out = FALSE; | 473 static int s_timed_out = FALSE; |
474 static int dead_key = 0; /* 0: no dead key, 1: dead key pressed */ | 474 static int dead_key = 0; /* 0: no dead key, 1: dead key pressed */ |
475 | 475 |
476 #ifdef FEAT_BEVAL | 476 #ifdef FEAT_BEVAL_GUI |
477 /* balloon-eval WM_NOTIFY_HANDLER */ | 477 /* balloon-eval WM_NOTIFY_HANDLER */ |
478 static void Handle_WM_Notify(HWND hwnd, LPNMHDR pnmh); | 478 static void Handle_WM_Notify(HWND hwnd, LPNMHDR pnmh); |
479 static void TrackUserActivity(UINT uMsg); | 479 static void TrackUserActivity(UINT uMsg); |
480 #endif | 480 #endif |
481 | 481 |
1214 | 1214 |
1215 s_uMsg = uMsg; | 1215 s_uMsg = uMsg; |
1216 s_wParam = wParam; | 1216 s_wParam = wParam; |
1217 s_lParam = lParam; | 1217 s_lParam = lParam; |
1218 | 1218 |
1219 #ifdef FEAT_BEVAL | 1219 #ifdef FEAT_BEVAL_GUI |
1220 TrackUserActivity(uMsg); | 1220 TrackUserActivity(uMsg); |
1221 #endif | 1221 #endif |
1222 | 1222 |
1223 switch (uMsg) | 1223 switch (uMsg) |
1224 { | 1224 { |
1235 HANDLE_MSG(hwnd, WM_RBUTTONUP, _OnMouseMoveOrRelease); | 1235 HANDLE_MSG(hwnd, WM_RBUTTONUP, _OnMouseMoveOrRelease); |
1236 HANDLE_MSG(hwnd, WM_XBUTTONDBLCLK,_OnMouseButtonDown); | 1236 HANDLE_MSG(hwnd, WM_XBUTTONDBLCLK,_OnMouseButtonDown); |
1237 HANDLE_MSG(hwnd, WM_XBUTTONDOWN,_OnMouseButtonDown); | 1237 HANDLE_MSG(hwnd, WM_XBUTTONDOWN,_OnMouseButtonDown); |
1238 HANDLE_MSG(hwnd, WM_XBUTTONUP, _OnMouseMoveOrRelease); | 1238 HANDLE_MSG(hwnd, WM_XBUTTONUP, _OnMouseMoveOrRelease); |
1239 | 1239 |
1240 #ifdef FEAT_BEVAL | 1240 #ifdef FEAT_BEVAL_GUI |
1241 case WM_NOTIFY: Handle_WM_Notify(hwnd, (LPNMHDR)lParam); | 1241 case WM_NOTIFY: Handle_WM_Notify(hwnd, (LPNMHDR)lParam); |
1242 return TRUE; | 1242 return TRUE; |
1243 #endif | 1243 #endif |
1244 default: | 1244 default: |
1245 return MyWindowProc(hwnd, uMsg, wParam, lParam); | 1245 return MyWindowProc(hwnd, uMsg, wParam, lParam); |
4229 #ifndef WM_MOUSEWHEEL | 4229 #ifndef WM_MOUSEWHEEL |
4230 #define WM_MOUSEWHEEL 0x20a | 4230 #define WM_MOUSEWHEEL 0x20a |
4231 #endif | 4231 #endif |
4232 | 4232 |
4233 | 4233 |
4234 #ifdef FEAT_BEVAL | 4234 #ifdef FEAT_BEVAL_GUI |
4235 # define ID_BEVAL_TOOLTIP 200 | 4235 # define ID_BEVAL_TOOLTIP 200 |
4236 # define BEVAL_TEXT_LEN MAXPATHL | 4236 # define BEVAL_TEXT_LEN MAXPATHL |
4237 | 4237 |
4238 #if (defined(_MSC_VER) && _MSC_VER < 1300) || !defined(MAXULONG_PTR) | 4238 #if (defined(_MSC_VER) && _MSC_VER < 1300) || !defined(MAXULONG_PTR) |
4239 /* Work around old versions of basetsd.h which wrongly declares | 4239 /* Work around old versions of basetsd.h which wrongly declares |
4308 | 4308 |
4309 #ifndef TTN_GETDISPINFO | 4309 #ifndef TTN_GETDISPINFO |
4310 # define TTN_GETDISPINFO (TTN_FIRST - 0) | 4310 # define TTN_GETDISPINFO (TTN_FIRST - 0) |
4311 #endif | 4311 #endif |
4312 | 4312 |
4313 #endif /* defined(FEAT_BEVAL) */ | 4313 #endif /* defined(FEAT_BEVAL_GUI) */ |
4314 | 4314 |
4315 #if defined(FEAT_TOOLBAR) || defined(FEAT_GUI_TABLINE) | 4315 #if defined(FEAT_TOOLBAR) || defined(FEAT_GUI_TABLINE) |
4316 /* Older MSVC compilers don't have LPNMTTDISPINFO[AW] thus we need to define | 4316 /* Older MSVC compilers don't have LPNMTTDISPINFO[AW] thus we need to define |
4317 * it here if LPNMTTDISPINFO isn't defined. | 4317 * it here if LPNMTTDISPINFO isn't defined. |
4318 * MingW doesn't define LPNMTTDISPINFO but typedefs it. Thus we need to check | 4318 * MingW doesn't define LPNMTTDISPINFO but typedefs it. Thus we need to check |
8515 vim_free(sign); | 8515 vim_free(sign); |
8516 } | 8516 } |
8517 } | 8517 } |
8518 #endif | 8518 #endif |
8519 | 8519 |
8520 #if defined(FEAT_BEVAL) || defined(PROTO) | 8520 #if defined(FEAT_BEVAL_GUI) || defined(PROTO) |
8521 | 8521 |
8522 /* BALLOON-EVAL IMPLEMENTATION FOR WINDOWS. | 8522 /* BALLOON-EVAL IMPLEMENTATION FOR WINDOWS. |
8523 * Added by Sergey Khorev <sergey.khorev@gmail.com> | 8523 * Added by Sergey Khorev <sergey.khorev@gmail.com> |
8524 * | 8524 * |
8525 * The only reused thing is gui_beval.h and get_beval_info() | 8525 * The only reused thing is beval.h and get_beval_info() |
8526 * from gui_beval.c (note it uses x and y of the BalloonEval struct | 8526 * from gui_beval.c (note it uses x and y of the BalloonEval struct |
8527 * to get current mouse position). | 8527 * to get current mouse position). |
8528 * | 8528 * |
8529 * Trying to use as more Windows services as possible, and as less | 8529 * Trying to use as more Windows services as possible, and as less |
8530 * IE version as possible :)). | 8530 * IE version as possible :)). |
8845 void | 8845 void |
8846 gui_mch_destroy_beval_area(BalloonEval *beval) | 8846 gui_mch_destroy_beval_area(BalloonEval *beval) |
8847 { | 8847 { |
8848 vim_free(beval); | 8848 vim_free(beval); |
8849 } | 8849 } |
8850 #endif /* FEAT_BEVAL */ | 8850 #endif /* FEAT_BEVAL_GUI */ |
8851 | 8851 |
8852 #if defined(FEAT_NETBEANS_INTG) || defined(PROTO) | 8852 #if defined(FEAT_NETBEANS_INTG) || defined(PROTO) |
8853 /* | 8853 /* |
8854 * We have multiple signs to draw at the same location. Draw the | 8854 * We have multiple signs to draw at the same location. Draw the |
8855 * multi-sign indicator (down-arrow) instead. This is the Win32 version. | 8855 * multi-sign indicator (down-arrow) instead. This is the Win32 version. |