1 (As per andersca's request)
3 Some thoughts on the necessary signals for gtkhtml.
5 /* For things like <bgsound src="coolsong.mp3"> and <x-gnome-nifty-tag src="guaca"> */
6 void (* unhandled_tag) (GtkHTML *html, gchar *tag);
8 void (* anchor_clicked) (GtkHTML *html, gchar *url);
10 ----------------------------------------------------
11 /* For things like <img src=url> */
12 void (* url_requested) (GtkHTML *html, gchar *url, gint handle);
14 /* for use with url_requested */
15 /* if handle == 0, maybe make it the main page? */
16 gtk_html_write (GtkHTML *html, gint handle, guchar *buf, size_t size);
17 gtk_html_write_stream (GtkHTML *html, gint handle, FILE *file);
21 Have all handles be of opaque type GtkHTMLStreamHandle. Plus, change
22 the gtk_html_end function to operate only on a specific stream, and to
23 take an argument that tells whether the stream was loaded successfully
24 or not (e.g. for handling 404's etc.)
26 When GtkHTML needs to load some data object (be it the main HTML page,
27 or an image used by that page, or whatever), it emits the
28 url_requested signal. The application then writes the data for that
29 URL in its callbacks via the gtk_html_write() function, and calls
30 gtk_html_end() when all data has arrived.
32 So far, it appears that one would need to take the following steps to implement this scheme:
34 Create the stream abstraction itself (probably just a callback mechanism so that
35 when the app does write(), the right object gets its write() method invoked).
37 Overhaul HTMLImage to read from arbitrary data sources (not
38 very hard, you'd just need to add another "not loaded" state).
40 Overhaul HTMLEngine to use the stream mechanism (not very hard).
42 Add proper handling for errors as indicated by gtk_html_end() (hard).