blob: 60cf1ab9dca4ddd8f1cdd1505a5b359ac44b0222 [file] [log] [blame]
Bram Moolenaaredf3f972016-08-29 22:49:24 +02001/* vi:set ts=8 sts=4 sw=4 noet:
Bram Moolenaar071d4272004-06-13 20:20:40 +00002 *
3 * VIM - Vi IMproved by Bram Moolenaar
4 * Visual Workshop integration by Gordon Prieur
5 *
6 * Do ":help uganda" in Vim to read copying and usage conditions.
7 * Do ":help credits" in Vim to see a list of people who contributed.
8 */
9
Bram Moolenaarc3719bd2017-11-18 22:13:31 +010010#if !defined(BEVAL__H) && (defined(FEAT_BEVAL) || defined(PROTO))
11#define BEVAL__H
Bram Moolenaar071d4272004-06-13 20:20:40 +000012
13#ifdef FEAT_GUI_GTK
Bram Moolenaar98921892016-02-23 17:14:37 +010014# ifdef USE_GTK3
15# include <gtk/gtk.h>
16# else
17# include <gtk/gtkwidget.h>
18# endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000019#else
20# if defined(FEAT_GUI_X11)
21# include <X11/Intrinsic.h>
22# endif
23#endif
24
25typedef enum
26{
27 ShS_NEUTRAL, /* nothing showing or pending */
28 ShS_PENDING, /* data requested from debugger */
29 ShS_UPDATE_PENDING, /* switching information displayed */
30 ShS_SHOWING /* the balloon is being displayed */
31} BeState;
32
33typedef struct BalloonEvalStruct
34{
Bram Moolenaar4ab9d9e2017-11-18 22:49:58 +010035#ifdef FEAT_BEVAL_GUI
36# ifdef FEAT_GUI_GTK
Bram Moolenaar071d4272004-06-13 20:20:40 +000037 GtkWidget *target; /* widget we are monitoring */
38 GtkWidget *balloonShell;
39 GtkWidget *balloonLabel;
40 unsigned int timerID; /* timer for run */
41 BeState showState; /* tells us whats currently going on */
42 int x;
43 int y;
44 unsigned int state; /* Button/Modifier key state */
Bram Moolenaar4ab9d9e2017-11-18 22:49:58 +010045# else
Bram Moolenaar4f974752019-02-17 17:44:42 +010046# if !defined(FEAT_GUI_MSWIN)
Bram Moolenaar071d4272004-06-13 20:20:40 +000047 Widget target; /* widget we are monitoring */
48 Widget balloonShell;
49 Widget balloonLabel;
50 XtIntervalId timerID; /* timer for run */
51 BeState showState; /* tells us whats currently going on */
52 XtAppContext appContext; /* used in event handler */
53 Position x;
54 Position y;
55 Position x_root;
56 Position y_root;
57 int state; /* Button/Modifier key state */
Bram Moolenaar4ab9d9e2017-11-18 22:49:58 +010058# else
Bram Moolenaar071d4272004-06-13 20:20:40 +000059 HWND target;
60 HWND balloon;
61 int x;
62 int y;
63 BeState showState; /* tells us whats currently going on */
Bram Moolenaar4ab9d9e2017-11-18 22:49:58 +010064# endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000065# endif
Bram Moolenaar4f974752019-02-17 17:44:42 +010066# if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MSWIN)
Bram Moolenaar071d4272004-06-13 20:20:40 +000067 Dimension screen_width; /* screen width in pixels */
68 Dimension screen_height; /* screen height in pixels */
Bram Moolenaar4ab9d9e2017-11-18 22:49:58 +010069# endif
70 void (*msgCB)(struct BalloonEvalStruct *, int);
71 void *clientData; /* For callback */
Bram Moolenaar071d4272004-06-13 20:20:40 +000072#endif
Bram Moolenaar4ab9d9e2017-11-18 22:49:58 +010073
Bram Moolenaar04958cb2018-06-23 19:23:02 +020074 int ts; // tabstop setting for this buffer
75#ifdef FEAT_VARTABS
76 int *vts; // vartabstop setting for this buffer
77#endif
Bram Moolenaarbe0a2592019-05-09 13:50:16 +020078 char_u *msg; // allocated: current text
Bram Moolenaar4f974752019-02-17 17:44:42 +010079#ifdef FEAT_GUI_MSWIN
Bram Moolenaar6d9e71a2018-12-28 19:13:34 +010080 void *tofree;
81#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000082} BalloonEval;
83
84#define EVAL_OFFSET_X 15 /* displacement of beval topleft corner from pointer */
85#define EVAL_OFFSET_Y 10
86
Bram Moolenaarc3719bd2017-11-18 22:13:31 +010087#ifdef FEAT_BEVAL_GUI
88# include "gui_beval.pro"
89#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000090
Bram Moolenaarc3719bd2017-11-18 22:13:31 +010091#endif /* BEVAL__H and FEAT_BEVAL_GUI */