aboutsummaryrefslogtreecommitdiffstats
path: root/tests/ui-tests
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
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')
-rw-r--r--tests/ui-tests/Makefile.am4
-rw-r--r--tests/ui-tests/message-browser.c45
2 files changed, 45 insertions, 4 deletions
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 <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;
}