view src/beval.h @ 33583:123acdc8e64c v9.0.2036

patch 9.0.2036: if_python: rework python3.12 build dependency Commit: https://github.com/vim/vim/commit/396058acd0cc66e5071d052e03d2067b134952af Author: Yee Cheng Chin <ychin.git@gmail.com> Date: Tue Oct 17 10:38:11 2023 +0200 patch 9.0.2036: if_python: rework python3.12 build dependency Problem: if_python: rework python3.12 build dependency (after 9.0.1996) Solution: use PyTuple_Size instead of inlining the Py_SIZE into the Vim code base Use a simpler fix for Python 3.12 build issues Python 3.12 introduced link dependencies to their `Py_SIZE()` inline function, which #13290 fixed by copying the inline function to Vim's Python binding code. This works but it's fragile, as a future update may change the implementation of `Py_SIZE` and there is no way for us to know. The reason we need `Py_SIZE` to begin with is that we use `PyTuple_GET_SIZE()` which calls that. Just fix it by mapping that to (confusingly similarly named) `PyTuple_Size()`, which we already do in the stable ABI implementation. There's a minor performance cost in that it's not inlined and it does error checking but that's fine as we only call this function rarely (in an error handler). related: #13290 closes: #13359 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
author Christian Brabandt <cb@256bit.org>
date Tue, 17 Oct 2023 10:45:04 +0200
parents 352701a626ed
children
line wrap: on
line source

/* 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_BEVAL_GUI
# ifdef FEAT_GUI_GTK
    GtkWidget		*target;	// widget we are monitoring
    GtkWidget		*balloonShell;
    GtkWidget		*balloonLabel;
    unsigned int	timerID;	// timer for run
    BeState		showState;	// tells us what's currently going on
    int			x;
    int			y;
    unsigned int	state;		// Button/Modifier key state
# else
#  if !defined(FEAT_GUI_MSWIN)
    Widget		target;		// widget we are monitoring
    Widget		balloonShell;
    Widget		balloonLabel;
    XtIntervalId	timerID;	// timer for run
    BeState		showState;	// tells us what's 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 what's currently going on
#  endif
# endif
# if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MSWIN)
    Dimension		screen_width;	// screen width in pixels
    Dimension		screen_height;	// screen height in pixels
# endif
    void		(*msgCB)(struct BalloonEvalStruct *, int);
    void		*clientData;	// For callback
#endif

    int			ts;		// tabstop setting for this buffer
#ifdef FEAT_VARTABS
    int			*vts;		// vartabstop setting for this buffer
#endif
    char_u		*msg;		// allocated: current text
#ifdef FEAT_GUI_MSWIN
    void		*tofree;
#endif
#ifdef FEAT_GUI_HAIKU
    int			x;
    int			y;
#endif
} BalloonEval;

#define EVAL_OFFSET_X 15 // displacement of beval topleft corner from pointer
#define EVAL_OFFSET_Y 10

#ifdef FEAT_BEVAL_GUI
# include "gui_beval.pro"
#endif

#endif // BEVAL__H and FEAT_BEVAL_GUI