xref: /vim-8.2.3635/src/beval.h (revision 12ee7ff0)
1 /* vi:set ts=8 sts=4 sw=4 noet:
2  *
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 
10 #if !defined(BEVAL__H) && (defined(FEAT_BEVAL) || defined(PROTO))
11 #define BEVAL__H
12 
13 #ifdef FEAT_GUI_GTK
14 # ifdef USE_GTK3
15 #  include <gtk/gtk.h>
16 # else
17 #  include <gtk/gtkwidget.h>
18 # endif
19 #else
20 # if defined(FEAT_GUI_X11)
21 #  include <X11/Intrinsic.h>
22 # endif
23 #endif
24 
25 typedef 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 
33 typedef struct BalloonEvalStruct
34 {
35 #ifdef FEAT_BEVAL_GUI
36 # ifdef FEAT_GUI_GTK
37     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 */
45 # else
46 #  if !defined(FEAT_GUI_MSWIN)
47     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 */
58 #  else
59     HWND		target;
60     HWND		balloon;
61     int			x;
62     int			y;
63     BeState		showState;	/* tells us whats currently going on */
64 #  endif
65 # endif
66 # if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MSWIN)
67     Dimension		screen_width;	/* screen width in pixels */
68     Dimension		screen_height;	/* screen height in pixels */
69 # endif
70     void		(*msgCB)(struct BalloonEvalStruct *, int);
71     void		*clientData;	/* For callback */
72 #endif
73 
74     int			ts;		// tabstop setting for this buffer
75 #ifdef FEAT_VARTABS
76     int			*vts;		// vartabstop setting for this buffer
77 #endif
78     char_u		*msg;		// allocated: current text
79 #ifdef FEAT_GUI_MSWIN
80     void		*tofree;
81 #endif
82 } BalloonEval;
83 
84 #define EVAL_OFFSET_X 15 /* displacement of beval topleft corner from pointer */
85 #define EVAL_OFFSET_Y 10
86 
87 #ifdef FEAT_BEVAL_GUI
88 # include "gui_beval.pro"
89 #endif
90 
91 #endif /* BEVAL__H and FEAT_BEVAL_GUI */
92