diff options
author | Ramiro Estrugo <ramiro@src.gnome.org> | 2000-08-09 07:58:55 +0000 |
---|---|---|
committer | Ramiro Estrugo <ramiro@src.gnome.org> | 2000-08-09 07:58:55 +0000 |
commit | 9f77e8e1ac6180562ff5557c48e2dc2290629d1b (patch) | |
tree | 79345d676c992408e69788fd32080f5006ae9afc | |
parent | 7ed27c172ff960419f3205b92f030556931b7fd6 (diff) | |
download | nautilus-9f77e8e1ac6180562ff5557c48e2dc2290629d1b.tar.gz |
Add support for Mozilla m17.
* configure.in:
Add some artificial intelligence to detect whether the mozilla
we are using is m17.
* components/mozilla/Makefile.am:
Define the mozilla milestone version.
* components/mozilla/nautilus-mozilla-content-view.c:
(nautilus_mozilla_content_view_initialize),
(debug_print_state_flags), (debug_print_status_flags),
(mozilla_net_state_callback), (mozilla_net_status_callback),
(mozilla_progress_callback):
Update for changes in the mozilla embedding api. Also, simplify
the status/state flag debugging stuff a bit.
-rw-r--r-- | ChangeLog | 20 | ||||
-rw-r--r-- | components/mozilla/Makefile.am | 4 | ||||
-rw-r--r-- | components/mozilla/nautilus-mozilla-content-view.c | 152 | ||||
-rw-r--r-- | configure.in | 19 |
4 files changed, 123 insertions, 72 deletions
@@ -1,3 +1,23 @@ +2000-08-09 Ramiro Estrugo <ramiro@eazel.com> + + Add support for Mozilla m17. + + * configure.in: + Add some artificial intelligence to detect whether the mozilla + we are using is m17. + + * components/mozilla/Makefile.am: + Define the mozilla milestone version. + + * components/mozilla/nautilus-mozilla-content-view.c: + (nautilus_mozilla_content_view_initialize), + (debug_print_state_flags), (debug_print_status_flags), + (mozilla_net_state_callback), (mozilla_net_status_callback), + (mozilla_progress_callback): + + Update for changes in the mozilla embedding api. Also, simplify + the status/state flag debugging stuff a bit. + Tue Aug 08 23:23:50 2000 George Lebl <jirka@5z.com> * libnautilus-extensions/nautilus-mime-actions.c diff --git a/components/mozilla/Makefile.am b/components/mozilla/Makefile.am index c45aaeb10..ea4c684b7 100644 --- a/components/mozilla/Makefile.am +++ b/components/mozilla/Makefile.am @@ -10,6 +10,7 @@ INCLUDES = \ $(BONOBO_CFLAGS) \ $(GNOMEUI_CFLAGS) \ $(MOZILLA_COMPONENT_CFLAGS) \ + -DMOZILLA_MILESTONE=$(MOZILLA_MILESTONE) \ $(NULL) bin_PROGRAMS =\ @@ -44,3 +45,6 @@ oaf_DATA = \ $(NULL) EXTRA_DIST = $(oaf_DATA) $(NULL) + +caca: + @echo $(MOZILLA_MILESTONE) diff --git a/components/mozilla/nautilus-mozilla-content-view.c b/components/mozilla/nautilus-mozilla-content-view.c index c45ddd38c..7738ac544 100644 --- a/components/mozilla/nautilus-mozilla-content-view.c +++ b/components/mozilla/nautilus-mozilla-content-view.c @@ -28,7 +28,7 @@ * widget to display and munge html. */ -/* #define DEBUG_ramiro 1 */ +#define DEBUG_ramiro 1 #include <config.h> #include "nautilus-mozilla-content-view.h" @@ -62,10 +62,18 @@ static void mozilla_merge_bonobo_items_callback (BonoboObject static void mozilla_title_changed_callback (GtkMozEmbed *mozilla, gpointer user_data); static void mozilla_location_changed_callback (GtkMozEmbed *mozilla, + + gpointer user_data); +#if (MOZILLA_MILESTONE == 17) +static void mozilla_net_state_callback (GtkMozEmbed *mozilla, + gint state, + guint status, gpointer user_data); +#else static void mozilla_net_status_callback (GtkMozEmbed *mozilla, gint flags, gpointer user_data); +#endif static void mozilla_link_message_callback (GtkMozEmbed *mozilla, gpointer user_data); static void mozilla_progress_callback (GtkMozEmbed *mozilla, @@ -132,10 +140,17 @@ nautilus_mozilla_content_view_initialize (NautilusMozillaContentView *view) GTK_SIGNAL_FUNC (mozilla_location_changed_callback), view); +#if (MOZILLA_MILESTONE == 17) + gtk_signal_connect (GTK_OBJECT (view->details->mozilla), + "net_state", + GTK_SIGNAL_FUNC (mozilla_net_state_callback), + view); +#else gtk_signal_connect (GTK_OBJECT (view->details->mozilla), "net_status", GTK_SIGNAL_FUNC (mozilla_net_status_callback), view); +#endif gtk_signal_connect (GTK_OBJECT (view->details->mozilla), "link_message", @@ -399,8 +414,52 @@ mozilla_location_changed_callback (GtkMozEmbed *mozilla, gpointer user_data) g_free (new_location); } +#if defined(DEBUG_ramiro) && (MOZILLA_MILESTONE == 17) + +#define PRINT_FLAG(bits, mask, message) \ +G_STMT_START { \ + if ((bits) & (mask)) { \ + g_print ("%s ", (message)); \ + } \ +} G_STMT_END + +static void +debug_print_state_flags (gint state_flags) +{ + g_print ("state_flags = "); + PRINT_FLAG (state_flags, GTK_MOZ_EMBED_FLAG_START, "start"); + PRINT_FLAG (state_flags, GTK_MOZ_EMBED_FLAG_REDIRECTING, "redirecting"); + PRINT_FLAG (state_flags, GTK_MOZ_EMBED_FLAG_TRANSFERRING, "transferring"); + PRINT_FLAG (state_flags, GTK_MOZ_EMBED_FLAG_NEGOTIATING, "negotiating"); + PRINT_FLAG (state_flags, GTK_MOZ_EMBED_FLAG_STOP, "stop"); + PRINT_FLAG (state_flags, GTK_MOZ_EMBED_FLAG_IS_REQUEST, "is_request"); + PRINT_FLAG (state_flags, GTK_MOZ_EMBED_FLAG_IS_DOCUMENT, "is_document"); + PRINT_FLAG (state_flags, GTK_MOZ_EMBED_FLAG_IS_NETWORK, "is_network"); + PRINT_FLAG (state_flags, GTK_MOZ_EMBED_FLAG_IS_WINDOW, "is_window"); + g_print ("\n"); +} + static void -mozilla_net_status_callback (GtkMozEmbed *mozilla, gint flags, gpointer user_data) +debug_print_status_flags (guint status_flags) +{ + g_print ("status_flags = "); + PRINT_FLAG (status_flags, GTK_MOZ_EMBED_STATUS_FAILED_DNS, "failed_dns"); + PRINT_FLAG (status_flags, GTK_MOZ_EMBED_STATUS_FAILED_CONNECT, "failed_connect"); + PRINT_FLAG (status_flags, GTK_MOZ_EMBED_STATUS_FAILED_TIMEOUT, "failed_timeout"); + PRINT_FLAG (status_flags, GTK_MOZ_EMBED_STATUS_FAILED_USERCANCELED, "failed_usercanceled"); + g_print ("\n"); +} + + +#endif + + +#if (MOZILLA_MILESTONE == 17) +static void +mozilla_net_state_callback (GtkMozEmbed *mozilla, + gint state_flags, + guint status_flags, + gpointer user_data) { NautilusMozillaContentView *view; @@ -408,92 +467,44 @@ mozilla_net_status_callback (GtkMozEmbed *mozilla, gint flags, gpointer user_dat g_assert (GTK_MOZ_EMBED (mozilla) == GTK_MOZ_EMBED (view->details->mozilla)); +#if defined(DEBUG_ramiro) && (MOZILLA_MILESTONE == 17) + g_print ("%s\n", __FUNCTION__); + debug_print_state_flags (state_flags); + debug_print_status_flags (status_flags); + g_print ("\n\n"); +#endif + /* win_start */ - if (flags & GTK_MOZ_EMBED_FLAG_WIN_START) { + if (state_flags & GTK_MOZ_EMBED_FLAG_START) { mozilla_content_view_set_busy_cursor (view); } /* win_stop */ - if (flags & GTK_MOZ_EMBED_FLAG_WIN_STOP) { + if (state_flags & GTK_MOZ_EMBED_FLAG_STOP) { mozilla_content_view_clear_busy_cursor (view); } - -#ifdef DEBUG_ramiro - g_print ("mozilla_net_status_callback ("); - - /* net_start */ - if (flags & GTK_MOZ_EMBED_FLAG_NET_START) { - g_print ("net_start "); - } - - /* net_stop */ - if (flags & GTK_MOZ_EMBED_FLAG_NET_STOP) { - g_print ("net_stop "); - } - - /* net_dns */ - if (flags & GTK_MOZ_EMBED_FLAG_NET_DNS) { - g_print ("net_dns "); - } - - /* net_connecting */ - if (flags & GTK_MOZ_EMBED_FLAG_NET_CONNECTING) { - g_print ("net_connecting "); - } - - /* net_redirecting */ - if (flags & GTK_MOZ_EMBED_FLAG_NET_REDIRECTING) { - g_print ("net_redirecting "); - } - - /* net_negotiating */ - if (flags & GTK_MOZ_EMBED_FLAG_NET_NEGOTIATING) { - g_print ("net_negotiating "); - } - - /* net_transferring */ - if (flags & GTK_MOZ_EMBED_FLAG_NET_TRANSFERRING) { - g_print ("net_transferring "); - } - - /* net_failedDNS */ - if (flags & GTK_MOZ_EMBED_FLAG_NET_FAILEDDNS) { - g_print ("net_failedDNS "); - } - - /* net_failedConnect */ - if (flags & GTK_MOZ_EMBED_FLAG_NET_FAILEDCONNECT) { - g_print ("net_failedConnect "); - } - - /* net_failedTransfer */ - if (flags & GTK_MOZ_EMBED_FLAG_NET_FAILEDTRANSFER) { - g_print ("net_failedTransfer "); - } +} +#else +static void +mozilla_net_status_callback (GtkMozEmbed *mozilla, gint flags, gpointer user_data) +{ + NautilusMozillaContentView *view; - /* net_failedTimeout */ - if (flags & GTK_MOZ_EMBED_FLAG_NET_FAILEDTIMEOUT) { - g_print ("net_failedTimeout "); - } + view = NAUTILUS_MOZILLA_CONTENT_VIEW (user_data); - /* net_userCancelled */ - if (flags & GTK_MOZ_EMBED_FLAG_NET_USERCANCELLED) { - g_print ("net_userCancelled "); - } + g_assert (GTK_MOZ_EMBED (mozilla) == GTK_MOZ_EMBED (view->details->mozilla)); /* win_start */ if (flags & GTK_MOZ_EMBED_FLAG_WIN_START) { - g_print ("win_start "); + mozilla_content_view_set_busy_cursor (view); } /* win_stop */ if (flags & GTK_MOZ_EMBED_FLAG_WIN_STOP) { - g_print ("win_stop "); + mozilla_content_view_clear_busy_cursor (view); } - - g_print (")\n"); -#endif } +#endif static void mozilla_link_message_callback (GtkMozEmbed *mozilla, gpointer user_data) @@ -526,7 +537,6 @@ mozilla_progress_callback (GtkMozEmbed *mozilla, g_print ("mozilla_progress_callback (max = %d, current = %d)\n", max_progress, current_progress); #endif - if (max_progress == current_progress || max_progress == 0) { nautilus_view_report_load_complete (view->details->nautilus_view); } else { diff --git a/configure.in b/configure.in index 37916e6c3..22fcc442b 100644 --- a/configure.in +++ b/configure.in @@ -172,6 +172,20 @@ else fi AM_CONDITIONAL(BUILD_MOZILLA_COMPONENT, test "x$found_mozilla" = "xtrue") +if test "x$found_mozilla" = "xtrue" +then + grep -w net_state $_mozilla_include_place/gtkmozembed.h > /dev/null 2>&1 + + if test $? -eq 0 + then + MOZILLA_MILESTONE=17 + else + MOZILLA_MILESTONE=16 + fi + + AC_SUBST(MOZILLA_MILESTONE) +fi + dnl ==================================== dnl = end mozilla hacks dnl ==================================== @@ -515,7 +529,10 @@ dnl <= Mozilla component integrated? => case $found_mozilla in t*) echo " -Mozilla component : YES" +Mozilla component : YES + mozilla libraries : $_mozilla_lib_place + mozilla includes : $_mozilla_include_place + MOZILLA_MILESTONE : $MOZILLA_MILESTONE" ;; *) echo " |