Mercurial > vim
comparison src/gui_x11.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 | 2a8890b80923 |
children | f4c3a7f410f4 |
comparison
equal
deleted
inserted
replaced
12870:0469872186f5 | 12871:1a450ce6980c |
---|---|
46 # include <X11/Sunkeysym.h> | 46 # include <X11/Sunkeysym.h> |
47 #endif | 47 #endif |
48 | 48 |
49 #ifdef HAVE_X11_XMU_EDITRES_H | 49 #ifdef HAVE_X11_XMU_EDITRES_H |
50 # include <X11/Xmu/Editres.h> | 50 # include <X11/Xmu/Editres.h> |
51 #endif | |
52 | |
53 #ifdef FEAT_BEVAL_TIP | |
54 # include "gui_beval.h" | |
55 #endif | 51 #endif |
56 | 52 |
57 #define VIM_NAME "vim" | 53 #define VIM_NAME "vim" |
58 #define VIM_CLASS "Vim" | 54 #define VIM_CLASS "Vim" |
59 | 55 |
444 sizeof(char *), | 440 sizeof(char *), |
445 XtOffsetOf(gui_T, rsrc_scroll_bg_name), | 441 XtOffsetOf(gui_T, rsrc_scroll_bg_name), |
446 XtRString, | 442 XtRString, |
447 DFLT_SCROLL_BG_COLOR | 443 DFLT_SCROLL_BG_COLOR |
448 }, | 444 }, |
449 #ifdef FEAT_BEVAL | 445 #ifdef FEAT_BEVAL_GUI |
450 { | 446 { |
451 XtNtooltipForeground, | 447 XtNtooltipForeground, |
452 XtCTooltipForeground, | 448 XtCTooltipForeground, |
453 XtRString, | 449 XtRString, |
454 sizeof(char *), | 450 sizeof(char *), |
482 sizeof(XFontSet), | 478 sizeof(XFontSet), |
483 XtOffsetOf(gui_T, tooltip_fontset), | 479 XtOffsetOf(gui_T, tooltip_fontset), |
484 XtRImmediate, | 480 XtRImmediate, |
485 (XtPointer)NOFONTSET | 481 (XtPointer)NOFONTSET |
486 }, | 482 }, |
487 #endif /* FEAT_BEVAL */ | 483 #endif /* FEAT_BEVAL_GUI */ |
488 #ifdef FEAT_XIM | 484 #ifdef FEAT_XIM |
489 { | 485 { |
490 "preeditType", | 486 "preeditType", |
491 "PreeditType", | 487 "PreeditType", |
492 XtRString, | 488 XtRString, |
1353 */ | 1349 */ |
1354 gui.menu_fg_pixel = gui_get_color((char_u *)gui.rsrc_menu_fg_name); | 1350 gui.menu_fg_pixel = gui_get_color((char_u *)gui.rsrc_menu_fg_name); |
1355 gui.menu_bg_pixel = gui_get_color((char_u *)gui.rsrc_menu_bg_name); | 1351 gui.menu_bg_pixel = gui_get_color((char_u *)gui.rsrc_menu_bg_name); |
1356 gui.scroll_fg_pixel = gui_get_color((char_u *)gui.rsrc_scroll_fg_name); | 1352 gui.scroll_fg_pixel = gui_get_color((char_u *)gui.rsrc_scroll_fg_name); |
1357 gui.scroll_bg_pixel = gui_get_color((char_u *)gui.rsrc_scroll_bg_name); | 1353 gui.scroll_bg_pixel = gui_get_color((char_u *)gui.rsrc_scroll_bg_name); |
1358 #ifdef FEAT_BEVAL | 1354 #ifdef FEAT_BEVAL_GUI |
1359 gui.tooltip_fg_pixel = gui_get_color((char_u *)gui.rsrc_tooltip_fg_name); | 1355 gui.tooltip_fg_pixel = gui_get_color((char_u *)gui.rsrc_tooltip_fg_name); |
1360 gui.tooltip_bg_pixel = gui_get_color((char_u *)gui.rsrc_tooltip_bg_name); | 1356 gui.tooltip_bg_pixel = gui_get_color((char_u *)gui.rsrc_tooltip_bg_name); |
1361 #endif | 1357 #endif |
1362 | 1358 |
1363 #if defined(FEAT_MENU) && defined(FEAT_GUI_ATHENA) | 1359 #if defined(FEAT_MENU) && defined(FEAT_GUI_ATHENA) |
1542 #ifdef FEAT_SUN_WORKSHOP | 1538 #ifdef FEAT_SUN_WORKSHOP |
1543 if (usingSunWorkShop) | 1539 if (usingSunWorkShop) |
1544 workshop_connect(app_context); | 1540 workshop_connect(app_context); |
1545 #endif | 1541 #endif |
1546 | 1542 |
1547 #ifdef FEAT_BEVAL | 1543 #ifdef FEAT_BEVAL_GUI |
1548 gui_init_tooltip_font(); | 1544 gui_init_tooltip_font(); |
1549 #endif | 1545 #endif |
1550 #ifdef FEAT_MENU | 1546 #ifdef FEAT_MENU |
1551 gui_init_menu_font(); | 1547 gui_init_menu_font(); |
1552 #endif | 1548 #endif |
1683 #endif | 1679 #endif |
1684 | 1680 |
1685 return OK; | 1681 return OK; |
1686 } | 1682 } |
1687 | 1683 |
1688 #if defined(FEAT_BEVAL) || defined(PROTO) | 1684 #if defined(FEAT_BEVAL_GUI) || defined(PROTO) |
1689 /* | 1685 /* |
1690 * Convert the tooltip fontset name to an XFontSet. | 1686 * Convert the tooltip fontset name to an XFontSet. |
1691 */ | 1687 */ |
1692 void | 1688 void |
1693 gui_init_tooltip_font(void) | 1689 gui_init_tooltip_font(void) |
3409 if (shape != MSHAPE_HIDE) | 3405 if (shape != MSHAPE_HIDE) |
3410 last_shape = shape; | 3406 last_shape = shape; |
3411 } | 3407 } |
3412 #endif | 3408 #endif |
3413 | 3409 |
3414 #if (defined(FEAT_TOOLBAR) && defined(FEAT_BEVAL)) || defined(PROTO) | 3410 #if (defined(FEAT_TOOLBAR) && defined(FEAT_BEVAL_GUI)) || defined(PROTO) |
3415 /* | 3411 /* |
3416 * Set the balloon-eval used for the tooltip of a toolbar menu item. | 3412 * Set the balloon-eval used for the tooltip of a toolbar menu item. |
3417 * The check for a non-toolbar item was added, because there is a crash when | 3413 * The check for a non-toolbar item was added, because there is a crash when |
3418 * passing a normal menu item here. Can't explain that, but better avoid it. | 3414 * passing a normal menu item here. Can't explain that, but better avoid it. |
3419 */ | 3415 */ |