xw->height = XFASTINT(height);
xw->width = XFASTINT(width);
XSETPSEUDOVECTOR (val, xw, PVEC_XWIDGET); // set the vectorlike_header of VAL with the correct value
- Vxwidget_alist = Fcons (val, Vxwidget_alist);
+ Vxwidget_list = Fcons (val, Vxwidget_list);
xw->widgetwindow_osr = NULL;
xw->widget_osr = NULL;
xw->plist = Qnil;
return val;
}
+DEFUN ("get-buffer-xwidgets", Fget_buffer_xwidgets, Sget_buffer_xwidgets, 1, 1, 0,
+ doc: /* Return the xwidgets associated with BUFFER.
+BUFFER may be a buffer or the name of one.
+ */
+ )
+ (Lisp_Object buffer)
+{
+ Lisp_Object xw, tail, xw_list;
+
+ if (NILP (buffer)) return Qnil;
+ buffer = Fget_buffer (buffer);
+ if (NILP (buffer)) return Qnil;
+
+ xw_list = Qnil;
+
+ for (tail = Vxwidget_list; CONSP (tail); tail = XCDR (tail))
+ {
+ xw = XCAR (tail);
+ if (XXWIDGETP (xw) && EQ (Fxwidget_buffer (xw), buffer))
+ xw_list = Fcons (xw, xw_list);
+ }
+ return xw_list;
+}
+
int
xwidget_hidden(struct xwidget_view *xv)
{
defsubr (&Sxwidget_info);
defsubr (&Sxwidget_view_info);
defsubr (&Sxwidget_resize);
+ defsubr (&Sget_buffer_xwidgets);
#ifdef HAVE_WEBKIT_OSR
defsubr (&Sxwidget_webkit_goto_uri);
DEFSYM (QCplist, ":plist");
- DEFVAR_LISP ("xwidget-alist", Vxwidget_alist, doc: /*xwidgets list*/);
- Vxwidget_alist = Qnil;
+ DEFVAR_LISP ("xwidget-alist", Vxwidget_list, doc: /*xwidgets list*/);
+ Vxwidget_list = Qnil;
DEFVAR_LISP ("xwidget-view-alist", Vxwidget_view_alist, doc: /*xwidget views list*/);
Vxwidget_view_alist = Qnil;
}
}
-
#endif /* HAVE_XWIDGETS */