diff options
author | bertrand <bertrand@helixcode.com> | 2000-03-04 03:43:49 +0800 |
---|---|---|
committer | Bertrand Guiheneuf <bertrand@src.gnome.org> | 2000-03-04 03:43:49 +0800 |
commit | c71ec9dab0ae22e0985ea12f4e1aeb0cc5811733 (patch) | |
tree | d3b5734b1aab47ff7992589bdc42d6c91f7d3e2c /tests/ui-tests | |
parent | c343245386b1aaab492357963776fe82a5c80796 (diff) | |
download | gsoc2013-evolution-c71ec9dab0ae22e0985ea12f4e1aeb0cc5811733.tar gsoc2013-evolution-c71ec9dab0ae22e0985ea12f4e1aeb0cc5811733.tar.gz gsoc2013-evolution-c71ec9dab0ae22e0985ea12f4e1aeb0cc5811733.tar.bz2 gsoc2013-evolution-c71ec9dab0ae22e0985ea12f4e1aeb0cc5811733.tar.lz gsoc2013-evolution-c71ec9dab0ae22e0985ea12f4e1aeb0cc5811733.tar.xz gsoc2013-evolution-c71ec9dab0ae22e0985ea12f4e1aeb0cc5811733.tar.zst gsoc2013-evolution-c71ec9dab0ae22e0985ea12f4e1aeb0cc5811733.zip |
initialize gdkrgb. Push visual/colormap. (on_url_requested): in the case
2000-03-03 bertrand <bertrand@helixcode.com>
* tests/ui-tests/message-browser.c (main): initialize
gdkrgb. Push visual/colormap.
(on_url_requested): in the case where a camel url is requested,
write the camel stream to gtkhtml.
* tests/ui-tests/Makefile.am (filter_LDADD): add
gnomeprint in the lib list.
Message browser shows inline images. Woohoo !
svn path=/trunk/; revision=2022
Diffstat (limited to 'tests/ui-tests')
-rw-r--r-- | tests/ui-tests/message-browser.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/ui-tests/message-browser.c b/tests/ui-tests/message-browser.c index fbd0550571..71fd1324da 100644 --- a/tests/ui-tests/message-browser.c +++ b/tests/ui-tests/message-browser.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /*--------------------------------*-C-*---------------------------------* * * Copyright 2000, Matt Loper <matt@helixcode.com>. @@ -301,6 +302,40 @@ on_link_clicked (GtkHTML *html, const gchar *url, gpointer data) } +static void +on_url_requested (GtkHTML *html, const gchar *url, GtkHTMLStreamHandle handle, gpointer data) +{ + CamelStream *stream; + gchar tmp_buffer[4096]; + gint nb_bytes_read; + + printf ("url _%s_ (%p) requested\n", url, url); + + if (sscanf (url, "camel://%p", &stream) == 1) + { + + do { + + /* read next chunk of text */ + nb_bytes_read = camel_stream_read (stream, + tmp_buffer, + 4096); + + /* If there's any text, write it to the stream */ + if (nb_bytes_read > 0) { + gtk_html_write (html, handle, tmp_buffer, nb_bytes_read); + } + + + } while (!camel_stream_eos (stream)); + + + } + +} + + + static GtkWidget* get_gtk_html_contents_window (CamelDataWrapper* data) { @@ -320,6 +355,11 @@ get_gtk_html_contents_window (CamelDataWrapper* data) GTK_SIGNAL_FUNC (on_link_clicked), NULL); + gtk_signal_connect (GTK_OBJECT (html_widget), + "url_requested", + GTK_SIGNAL_FUNC (on_url_requested), + NULL); + scroll_wnd = gtk_scrolled_window_new (NULL, NULL); gtk_container_add (GTK_CONTAINER (scroll_wnd), html_widget); } @@ -554,6 +594,12 @@ main (int argc, char *argv[]) /* initialization */ gnome_init ("MessageBrowser", "1.0", argc, argv); + + gdk_rgb_init (); + + gtk_widget_set_default_colormap (gdk_rgb_get_cmap ()); + gtk_widget_set_default_visual (gdk_rgb_get_visual ()); + app = gnome_app_new ("Message Browser Test", NULL); gnome_app_create_menus (GNOME_APP (app), main_menu); |