1 /* Support for embedding graphical components in a buffer.
3 Copyright (C) 2011-2017 Free Software Foundation, Inc.
5 This file is part of GNU Emacs.
7 GNU Emacs is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or (at
10 your option) any later version.
12 GNU Emacs is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
20 #ifndef XWIDGET_H_INCLUDED
21 #define XWIDGET_H_INCLUDED
36 union vectorlike_header header
;
41 /* The widget type. */
44 /* The buffer where the xwidget lives. */
47 /* A title used for button labels, for instance. */
50 /* Here ends the Lisp part. "height" is the marker field. */
55 /* For offscreen widgets, unused if not osr. */
56 GtkWidget
*widget_osr
;
57 GtkWidget
*widgetwindow_osr
;
59 /* Kill silently if Emacs is exited. */
60 bool_bf kill_without_query
: 1;
65 union vectorlike_header header
;
69 /* Here ends the lisp part. "redisplayed" is the marker field. */
71 /* If touched by redisplay. */
74 /* The "live" instance isn't drawn. */
78 GtkWidget
*widgetwindow
;
79 GtkWidget
*emacswindow
;
91 /* Test for xwidget pseudovector. */
92 #define XWIDGETP(x) PSEUDOVECTORP (x, PVEC_XWIDGET)
93 #define XXWIDGET(a) (eassert (XWIDGETP (a)), \
94 (struct xwidget *) XUNTAG (a, Lisp_Vectorlike))
96 #define CHECK_XWIDGET(x) \
97 CHECK_TYPE (XWIDGETP (x), Qxwidgetp, x)
99 /* Test for xwidget_view pseudovector. */
100 #define XWIDGET_VIEW_P(x) PSEUDOVECTORP (x, PVEC_XWIDGET_VIEW)
101 #define XXWIDGET_VIEW(a) (eassert (XWIDGET_VIEW_P (a)), \
102 (struct xwidget_view *) XUNTAG (a, Lisp_Vectorlike))
104 #define CHECK_XWIDGET_VIEW(x) \
105 CHECK_TYPE (XWIDGET_VIEW_P (x), Qxwidget_view_p, x)
107 #define XG_XWIDGET "emacs_xwidget"
108 #define XG_XWIDGET_VIEW "emacs_xwidget_view"
111 void syms_of_xwidget (void);
112 bool valid_xwidget_spec_p (Lisp_Object
);
113 void xwidget_view_delete_all_in_window (struct window
*);
114 void x_draw_xwidget_glyph_string (struct glyph_string
*);
115 struct xwidget
*lookup_xwidget (Lisp_Object spec
);
116 void xwidget_end_redisplay (struct window
*, struct glyph_matrix
*);
117 void kill_buffer_xwidgets (Lisp_Object
);
120 INLINE
void syms_of_xwidget (void) {}
121 INLINE
bool valid_xwidget_spec_p (Lisp_Object obj
) { return false; }
122 INLINE
void xwidget_view_delete_all_in_window (struct window
*w
) {}
123 INLINE
void x_draw_xwidget_glyph_string (struct glyph_string
*s
) { eassume (0); }
124 INLINE
struct xwidget
*lookup_xwidget (Lisp_Object obj
) { eassume (0); }
125 INLINE
void xwidget_end_redisplay (struct window
*w
, struct glyph_matrix
*m
) {}
126 INLINE
void kill_buffer_xwidgets (Lisp_Object buf
) {}
130 #endif /* XWIDGET_H_INCLUDED */