1 /* Support for embedding graphical components in a buffer.
3 Copyright (C) 2011-2016 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 <http://www.gnu.org/licenses/>. */
20 #ifndef XWIDGET_H_INCLUDED
21 #define XWIDGET_H_INCLUDED
36 struct 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 /* Used if the widget (webkit) is to be wrapped in a scrolled window. */
60 GtkWidget
*widgetscrolledwindow_osr
;
62 /* Kill silently if Emacs is exited. */
63 bool_bf kill_without_query
: 1;
68 struct vectorlike_header header
;
72 /* Here ends the lisp part. "redisplayed" is the marker field. */
74 /* If touched by redisplay. */
77 /* The "live" instance isn't drawn. */
81 GtkWidget
*widgetwindow
;
82 GtkWidget
*emacswindow
;
94 /* Test for xwidget pseudovector. */
95 #define XWIDGETP(x) PSEUDOVECTORP (x, PVEC_XWIDGET)
96 #define XXWIDGET(a) (eassert (XWIDGETP (a)), \
97 (struct xwidget *) XUNTAG (a, Lisp_Vectorlike))
99 #define CHECK_XWIDGET(x) \
100 CHECK_TYPE (XWIDGETP (x), Qxwidgetp, x)
102 /* Test for xwidget_view pseudovector. */
103 #define XWIDGET_VIEW_P(x) PSEUDOVECTORP (x, PVEC_XWIDGET_VIEW)
104 #define XXWIDGET_VIEW(a) (eassert (XWIDGET_VIEW_P (a)), \
105 (struct xwidget_view *) XUNTAG (a, Lisp_Vectorlike))
107 #define CHECK_XWIDGET_VIEW(x) \
108 CHECK_TYPE (XWIDGET_VIEW_P (x), Qxwidget_view_p, x)
110 #define XG_XWIDGET "emacs_xwidget"
111 #define XG_XWIDGET_VIEW "emacs_xwidget_view"
114 void syms_of_xwidget (void);
115 bool valid_xwidget_spec_p (Lisp_Object
);
116 void xwidget_view_delete_all_in_window (struct window
*);
117 void x_draw_xwidget_glyph_string (struct glyph_string
*);
118 struct xwidget
*lookup_xwidget (Lisp_Object spec
);
119 void xwidget_end_redisplay (struct window
*, struct glyph_matrix
*);
120 void kill_buffer_xwidgets (Lisp_Object
);
123 INLINE
void syms_of_xwidget (void) {}
124 INLINE
bool valid_xwidget_spec_p (Lisp_Object obj
) { return false; }
125 INLINE
void xwidget_view_delete_all_in_window (struct window
*w
) {}
126 INLINE
void x_draw_xwidget_glyph_string (struct glyph_string
*s
) { eassume (0); }
127 INLINE
struct xwidget
*lookup_xwidget (Lisp_Object obj
) { eassume (0); }
128 INLINE
void xwidget_end_redisplay (struct window
*w
, struct glyph_matrix
*m
) {}
129 INLINE
void kill_buffer_xwidgets (Lisp_Object buf
) {}
133 #endif /* XWIDGET_H_INCLUDED */