blob: f44620038d8e59ad1b3611e54f9e064f030a84ea [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{
Bram Moolenaar9bf703d2019-11-30 19:44:38 +010027 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
Bram Moolenaar071d4272004-06-13 20:20:40 +000031} BeState;
32
33typedef struct BalloonEvalStruct
34{
Bram Moolenaar4ab9d9e2017-11-18 22:49:58 +010035#ifdef FEAT_BEVAL_GUI
36# ifdef FEAT_GUI_GTK
Bram Moolenaar9bf703d2019-11-30 19:44:38 +010037 GtkWidget *target; // widget we are monitoring
Bram Moolenaar071d4272004-06-13 20:20:40 +000038 GtkWidget *balloonShell;
39 GtkWidget *balloonLabel;
Bram Moolenaar9bf703d2019-11-30 19:44:38 +010040 unsigned int timerID; // timer for run
Bram Moolenaar4b96df52020-01-26 22:00:26 +010041 BeState showState; // tells us what's currently going on
Bram Moolenaar071d4272004-06-13 20:20:40 +000042 int x;
43 int y;
Bram Moolenaar9bf703d2019-11-30 19:44:38 +010044 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 Moolenaar9bf703d2019-11-30 19:44:38 +010047 Widget target; // widget we are monitoring
Bram Moolenaar071d4272004-06-13 20:20:40 +000048 Widget balloonShell;
49 Widget balloonLabel;
Bram Moolenaar9bf703d2019-11-30 19:44:38 +010050 XtIntervalId timerID; // timer for run
Bram Moolenaar4b96df52020-01-26 22:00:26 +010051 BeState showState; // tells us what's currently going on
Bram Moolenaar9bf703d2019-11-30 19:44:38 +010052 XtAppContext appContext; // used in event handler
Bram Moolenaar071d4272004-06-13 20:20:40 +000053 Position x;
54 Position y;
55 Position x_root;
56 Position y_root;
Bram Moolenaar9bf703d2019-11-30 19:44:38 +010057 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;
Bram Moolenaar4b96df52020-01-26 22:00:26 +010063 BeState showState; // tells us what's 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 Moolenaar9bf703d2019-11-30 19:44:38 +010067 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);
Bram Moolenaar9bf703d2019-11-30 19:44:38 +010071 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
Bram Moolenaar9bf703d2019-11-30 19:44:38 +010084#define EVAL_OFFSET_X 15 // displacement of beval topleft corner from pointer
Bram Moolenaar071d4272004-06-13 20:20:40 +000085#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 Moolenaar9bf703d2019-11-30 19:44:38 +010091#endif // BEVAL__H and FEAT_BEVAL_GUI