From b6788c4e5dbcd043e4ed54c9c10488f45d53bd95 Mon Sep 17 00:00:00 2001 From: bertrand Date: Sat, 4 Mar 2000 05:15:27 +0000 Subject: add bonobo to the build process. 2000-03-04 bertrand * tests/ui-tests/Makefile.am: add bonobo to the build process. * tests/ui-tests/message-browser.c (main): initialize Bonobo. Use bonobo_main. (get_gtk_html_contents_window): set signal handlers for url requests and objects requests. (on_object_requested): answer to object requests. svn path=/trunk/; revision=2037 --- ChangeLog | 11 ++++++++++ tests/ui-tests/Makefile.am | 4 ++-- tests/ui-tests/message-browser.c | 45 ++++++++++++++++++++++++++++++++++++++-- 3 files changed, 56 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a80ea9c057..908814971d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2000-03-04 bertrand + + * tests/ui-tests/Makefile.am: add bonobo to the build + process. + + * tests/ui-tests/message-browser.c (main): + initialize Bonobo. Use bonobo_main. + (get_gtk_html_contents_window): set signal handlers + for url requests and objects requests. + (on_object_requested): answer to object requests. + 2000-03-03 bertrand * tests/ui-tests/message-browser.c (main): initialize diff --git a/tests/ui-tests/Makefile.am b/tests/ui-tests/Makefile.am index af6cb085c3..9226b395ad 100644 --- a/tests/ui-tests/Makefile.am +++ b/tests/ui-tests/Makefile.am @@ -7,7 +7,7 @@ INCLUDES = \ -I$(top_srcdir)/camel/providers/MH \ -I$(top_srcdir)/widgets \ -I$(top_srcdir)/filter \ - $(EXTRA_GNOME_CFLAGS) + $(EXTRA_GNOME_CFLAGS) $(BONOBO_GNOME_CFLAGS) LDADD = \ $(top_builddir)/widgets/libevolutionwidgets.la \ @@ -22,7 +22,7 @@ message_browser_LDADD = \ $(EXTRA_GNOME_LIBS) \ $(PTHREAD_LIB) \ $(EXTRA_GNOME_LIBS) \ - -lgtkhtml -lgnomeprint ../../mail/html-stream.o + -lgtkhtml -lgnomeprint ../../mail/html-stream.o $(BONOBO_GNOME_LIBS) filter_LDADD = \ $(top_builddir)/camel/libcamel.la \ diff --git a/tests/ui-tests/message-browser.c b/tests/ui-tests/message-browser.c index 71fd1324da..ac5bc51a96 100644 --- a/tests/ui-tests/message-browser.c +++ b/tests/ui-tests/message-browser.c @@ -31,6 +31,10 @@ /* gtkhtml stuff */ #include +/* corba/bonobo stuff */ +#include +#include + static void print_usage_and_quit() { @@ -335,6 +339,28 @@ on_url_requested (GtkHTML *html, const gchar *url, GtkHTMLStreamHandle handle, g } +static void +on_object_requested (GtkHTML *html, GtkHTMLEmbedded *eb, void *data) +{ + gchar *class_id; + gchar *uid; + GtkWidget *bonobo_embedable; + + + + uid = gtk_html_embedded_get_parameter (eb, "uid"); + class_id = eb->classid; + + + printf ("object requested : %s\n", class_id); + printf ("UID = %s\n", uid); + + bonobo_embedable = bonobo_widget_new_subdoc (class_id, NULL); + gtk_widget_show (bonobo_embedable); + + gtk_container_add (GTK_CONTAINER(eb), bonobo_embedable); +} + static GtkWidget* get_gtk_html_contents_window (CamelDataWrapper* data) @@ -359,6 +385,10 @@ get_gtk_html_contents_window (CamelDataWrapper* data) "url_requested", GTK_SIGNAL_FUNC (on_url_requested), NULL); + gtk_signal_connect (GTK_OBJECT (html_widget), + "object_requested", + GTK_SIGNAL_FUNC (on_object_requested), + NULL); scroll_wnd = gtk_scrolled_window_new (NULL, NULL); gtk_container_add (GTK_CONTAINER (scroll_wnd), html_widget); @@ -589,10 +619,21 @@ main (int argc, char *argv[]) GtkWidget* hpane; GtkWidget* tree_ctrl_window; GtkWidget* html_window; - + CORBA_Environment ev; + CamelMimeMessage* message = NULL; /* initialization */ + + /* Corba and Bonobo stuff */ + CORBA_exception_init (&ev); + + gnome_CORBA_init ("Message Browser", "1.0", &argc, argv, 0, &ev); + + if (bonobo_init (gnome_CORBA_ORB (), NULL, NULL) == FALSE) + g_error ("Cannot bonobo_init"); + + gnome_init ("MessageBrowser", "1.0", argc, argv); gdk_rgb_init (); @@ -636,7 +677,7 @@ main (int argc, char *argv[]) if (!message) file_menu_open_cb (NULL, NULL); - gtk_main(); + bonobo_main(); return 1; } -- cgit