aboutsummaryrefslogtreecommitdiffstats
path: root/tests/ui-tests/message-browser.c
diff options
context:
space:
mode:
authorbertrand <bertrand@helixcode.com>2000-03-04 13:15:27 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>2000-03-04 13:15:27 +0800
commitb6788c4e5dbcd043e4ed54c9c10488f45d53bd95 (patch)
tree34611f65a6dc8aab8cce15eca7232fb186432fce /tests/ui-tests/message-browser.c
parent55f8f073e2aca35954e824eb84f62211fd9d9200 (diff)
downloadgsoc2013-evolution-b6788c4e5dbcd043e4ed54c9c10488f45d53bd95.tar.gz
gsoc2013-evolution-b6788c4e5dbcd043e4ed54c9c10488f45d53bd95.tar.zst
gsoc2013-evolution-b6788c4e5dbcd043e4ed54c9c10488f45d53bd95.zip
add bonobo to the build process.
2000-03-04 bertrand <bertrand@helixcode.com> * 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
Diffstat (limited to 'tests/ui-tests/message-browser.c')
-rw-r--r--tests/ui-tests/message-browser.c45
1 files changed, 43 insertions, 2 deletions
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 <gtkhtml/gtkhtml.h>
+/* corba/bonobo stuff */
+#include <bonobo/bonobo.h>
+#include <libgnorba/gnorba.h>
+
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;
}