Revert "Revert changes installed by xwidgets merge"
[emacs.git] / src / xwidget.h
blobcbaddf6cec7142608315abfd4d5a473adf106e49
1 #ifndef XWIDGET_H_INCLUDED
2 #define XWIDGET_H_INCLUDED
4 void x_draw_xwidget_glyph_string (struct glyph_string *s);
5 void syms_of_xwidget ();
7 //extern Lisp_Object Qxwidget;
10 int valid_xwidget_spec_p (Lisp_Object object) ;
12 #include <gtk/gtk.h>
16 each xwidget instance/model is described by this struct.
18 lisp pseudovector.
22 struct xwidget{
23 struct vectorlike_header header;
24 Lisp_Object plist;//auxilliary data
25 Lisp_Object type;//the widget type
26 Lisp_Object buffer; //buffer where xwidget lives
27 Lisp_Object title;//a title that is used for button labels for instance
29 //here ends the lisp part.
30 //"height" is the marker field
31 int height;
32 int width;
34 //for offscreen widgets, unused if not osr
35 GtkWidget* widget_osr;
36 GtkWidget* widgetwindow_osr;
37 //this is used if the widget (webkit) is to be wrapped in a scrolled window,
38 GtkWidget* widgetscrolledwindow_osr;
39 /* Non-nil means kill silently if Emacs is exited. */
40 unsigned int kill_without_query : 1;
45 //struct for each xwidget view
46 struct xwidget_view {
47 struct vectorlike_header header;
48 Lisp_Object model;
49 Lisp_Object w;
51 //here ends the lisp part.
52 //"redisplayed" is the marker field
53 int redisplayed; //if touched by redisplay
55 int hidden;//if the "live" instance isnt drawn
57 GtkWidget* widget;
58 GtkWidget* widgetwindow;
59 GtkWidget* emacswindow;
60 int x; int y;
61 int clip_right; int clip_bottom; int clip_top; int clip_left;
64 long handler_id;
67 /* Test for xwidget pseudovector*/
68 #define XWIDGETP(x) PSEUDOVECTORP (x, PVEC_XWIDGET)
69 #define XXWIDGET(a) (eassert (XWIDGETP(a)), \
70 (struct xwidget *) XUNTAG(a, Lisp_Vectorlike))
72 #define CHECK_XWIDGET(x) \
73 CHECK_TYPE (XWIDGETP (x), Qxwidgetp, x)
75 /* Test for xwidget_view pseudovector */
76 #define XWIDGET_VIEW_P(x) PSEUDOVECTORP (x, PVEC_XWIDGET_VIEW)
77 #define XXWIDGET_VIEW(a) (eassert (XWIDGET_VIEW_P(a)), \
78 (struct xwidget_view *) XUNTAG(a, Lisp_Vectorlike))
80 #define CHECK_XWIDGET_VIEW(x) \
81 CHECK_TYPE (XWIDGET_VIEW_P (x), Qxwidget_view_p, x)
83 struct xwidget_type
85 /* A symbol uniquely identifying the xwidget type, */
86 Lisp_Object *type;
88 /* Check that SPEC is a valid image specification for the given
89 image type. Value is non-zero if SPEC is valid. */
90 int (* valid_p) (Lisp_Object spec);
92 /* Next in list of all supported image types. */
93 struct xwidget_type *next;
96 static struct xwidget_type *lookup_xwidget_type (Lisp_Object symbol);
98 struct xwidget* xwidget_from_id(int id);
100 //extern int xwidget_owns_kbd;
102 void xwidget_start_redisplay();
103 void xwidget_end_redisplay (struct window *w, struct glyph_matrix *matrix);
105 void xwidget_touch (struct xwidget_view *xw);
107 //void assert_valid_xwidget_id(int id,char *str);
109 struct xwidget* lookup_xwidget (Lisp_Object spec);
110 #define XG_XWIDGET "emacs_xwidget"
111 #define XG_XWIDGET_VIEW "emacs_xwidget_view"
112 void xwidget_view_delete_all_in_window( struct window *w );
114 void kill_buffer_xwidgets (Lisp_Object buffer);
115 #endif /* XWIDGET_H_INCLUDED */