]>
code.delx.au - gnu-emacs/blob - src/xwidget.h
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
) ;
16 each xwidget instance/model is described by this struct.
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
34 //for offscreen widgets, unused if not osr
35 GtkWidget
* widget_osr
;
36 GtkWidget
* widgetwindow_osr
;
37 /* Non-nil means kill silently if Emacs is exited. */
38 unsigned int kill_without_query
: 1;
43 //struct for each xwidget view
45 struct vectorlike_header header
;
49 //here ends the lisp part.
50 //"redisplayed" is the marker field
51 int redisplayed
; //if touched by redisplay
53 int hidden
;//if the "live" instance isnt drawn
56 GtkWidget
* widgetwindow
;
57 GtkWidget
* emacswindow
;
59 int clip_right
; int clip_bottom
; int clip_top
; int clip_left
;
65 /* Test for xwidget pseudovector*/
66 #define XWIDGETP(x) PSEUDOVECTORP (x, PVEC_XWIDGET)
67 #define XXWIDGET(a) (eassert (XWIDGETP(a)), \
68 (struct xwidget *) XUNTAG(a, Lisp_Vectorlike))
70 #define CHECK_XWIDGET(x) \
71 CHECK_TYPE (XWIDGETP (x), Qxwidgetp, x)
73 /* Test for xwidget_view pseudovector */
74 #define XWIDGET_VIEW_P(x) PSEUDOVECTORP (x, PVEC_XWIDGET_VIEW)
75 #define XXWIDGET_VIEW(a) (eassert (XWIDGET_VIEW_P(a)), \
76 (struct xwidget_view *) XUNTAG(a, Lisp_Vectorlike))
78 #define CHECK_XWIDGET_VIEW(x) \
79 CHECK_TYPE (XWIDGET_VIEW_P (x), Qxwidget_view_p, x)
83 /* A symbol uniquely identifying the xwidget type, */
86 /* Check that SPEC is a valid image specification for the given
87 image type. Value is non-zero if SPEC is valid. */
88 int (* valid_p
) (Lisp_Object spec
);
90 /* Next in list of all supported image types. */
91 struct xwidget_type
*next
;
94 static struct xwidget_type
*lookup_xwidget_type (Lisp_Object symbol
);
96 struct xwidget
* xwidget_from_id(int id
);
98 //extern int xwidget_owns_kbd;
100 void xwidget_start_redisplay();
101 void xwidget_end_redisplay (struct window
*w
, struct glyph_matrix
*matrix
);
103 void xwidget_touch (struct xwidget_view
*xw
);
105 //void assert_valid_xwidget_id(int id,char *str);
107 struct xwidget
* lookup_xwidget (Lisp_Object spec
);
108 #define XG_XWIDGET "emacs_xwidget"
109 #define XG_XWIDGET_VIEW "emacs_xwidget_view"
110 void xwidget_view_delete_all_in_window( struct window
*w
);
112 void kill_buffer_xwidgets (Lisp_Object buffer
);
113 #endif /* XWIDGET_H_INCLUDED */