summaryrefslogtreecommitdiffstats
path: root/src/beval.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-11-18 22:13:31 +0100
committerBram Moolenaar <Bram@vim.org>2017-11-18 22:13:31 +0100
commitc3719bd87beca9f72d2e9f11e36d561c2c3b57b0 (patch)
tree2ca909ca8d4a040e48cc484b2ae7512014d3eaf0 /src/beval.h
parentc7d16dce2f180c8ebfc8105ad090b0ea2deedcdc (diff)
patch 8.0.1312: balloon_show() only works in terminal when compiled with GUIv8.0.1312
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.
Diffstat (limited to 'src/beval.h')
-rw-r--r--src/beval.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/beval.h b/src/beval.h
new file mode 100644
index 0000000000..d157a9e790
--- /dev/null
+++ b/src/beval.h
@@ -0,0 +1,83 @@
+/* vi:set ts=8 sts=4 sw=4 noet:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * Visual Workshop integration by Gordon Prieur
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+#if !defined(BEVAL__H) && (defined(FEAT_BEVAL) || defined(PROTO))
+#define BEVAL__H
+
+#ifdef FEAT_GUI_GTK
+# ifdef USE_GTK3
+# include <gtk/gtk.h>
+# else
+# include <gtk/gtkwidget.h>
+# endif
+#else
+# if defined(FEAT_GUI_X11)
+# include <X11/Intrinsic.h>
+# endif
+#endif
+
+typedef enum
+{
+ ShS_NEUTRAL, /* nothing showing or pending */
+ ShS_PENDING, /* data requested from debugger */
+ ShS_UPDATE_PENDING, /* switching information displayed */
+ ShS_SHOWING /* the balloon is being displayed */
+} BeState;
+
+typedef struct BalloonEvalStruct
+{
+#ifdef FEAT_GUI_GTK
+ GtkWidget *target; /* widget we are monitoring */
+ GtkWidget *balloonShell;
+ GtkWidget *balloonLabel;
+ unsigned int timerID; /* timer for run */
+ BeState showState; /* tells us whats currently going on */
+ int x;
+ int y;
+ unsigned int state; /* Button/Modifier key state */
+#else
+# if !defined(FEAT_GUI_W32)
+ Widget target; /* widget we are monitoring */
+ Widget balloonShell;
+ Widget balloonLabel;
+ XtIntervalId timerID; /* timer for run */
+ BeState showState; /* tells us whats currently going on */
+ XtAppContext appContext; /* used in event handler */
+ Position x;
+ Position y;
+ Position x_root;
+ Position y_root;
+ int state; /* Button/Modifier key state */
+# else
+ HWND target;
+ HWND balloon;
+ int x;
+ int y;
+ BeState showState; /* tells us whats currently going on */
+# endif
+#endif
+ int ts; /* tabstop setting for this buffer */
+ char_u *msg;
+ void (*msgCB)(struct BalloonEvalStruct *, int);
+ void *clientData; /* For callback */
+#if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_W32)
+ Dimension screen_width; /* screen width in pixels */
+ Dimension screen_height; /* screen height in pixels */
+#endif
+} BalloonEval;
+
+#define EVAL_OFFSET_X 15 /* displacement of beval topleft corner from pointer */
+#define EVAL_OFFSET_Y 10
+
+#include "beval.pro"
+#ifdef FEAT_BEVAL_GUI
+# include "gui_beval.pro"
+#endif
+
+#endif /* BEVAL__H and FEAT_BEVAL_GUI */