From 4f01d3d1823fd8d7b53919b03ff44cc46ad92b77 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 31 May 2010 10:24:14 -0400 Subject: Keep chipping away at direct GtkHTML usage. EMFormatHTML now holds a sealed EWebView instead of a public GtkHTML, accessible through em_format_html_get_web_view(). Rename e_mail_reader_get_html_display() to e_mail_reader_get_formatter() and have it return an EMFormatHTML instead of an EMFormatHTMLDisplay, since that's usually the type you want (or else an EMFormat, but never an EMFormatHTMLDisplay). --- plugins/audio-inline/Makefile.am | 1 + plugins/image-inline/image-inline.c | 13 +++++++------ plugins/mail-to-task/mail-to-task.c | 12 ++++++------ 3 files changed, 14 insertions(+), 12 deletions(-) (limited to 'plugins') diff --git a/plugins/audio-inline/Makefile.am b/plugins/audio-inline/Makefile.am index 8d7501a444..1696ecd101 100644 --- a/plugins/audio-inline/Makefile.am +++ b/plugins/audio-inline/Makefile.am @@ -14,6 +14,7 @@ plugin_LTLIBRARIES = liborg-gnome-audio-inline.la liborg_gnome_audio_inline_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ + -I$(top_srcdir)/widgets \ $(GNOME_PLATFORM_CFLAGS) \ $(EVOLUTION_MAIL_CFLAGS) \ $(GSTREAMER_CFLAGS) diff --git a/plugins/image-inline/image-inline.c b/plugins/image-inline/image-inline.c index 21688dbf94..5548948f1a 100644 --- a/plugins/image-inline/image-inline.c +++ b/plugins/image-inline/image-inline.c @@ -233,15 +233,15 @@ size_allocate_cb (GtkHTMLEmbedded *embedded, ImageInlinePObject *image_object) { GtkAllocation image_allocation; - GtkWidget *widget; + EWebView *web_view; gint pixbuf_width; gint pixbuf_height; gint widget_width; gint widget_height; gdouble zoom = 1.0; - widget = GTK_WIDGET (image_object->object.format->html); - gtk_widget_get_allocation (widget, &image_allocation); + web_view = em_format_html_get_web_view (image_object->object.format); + gtk_widget_get_allocation (GTK_WIDGET (web_view), &image_allocation); widget_width = image_allocation.width - 12; pixbuf_width = gdk_pixbuf_get_width (image_object->pixbuf); @@ -264,10 +264,10 @@ mouse_wheel_scroll_cb (GtkWidget *image_view, { GtkOrientation orientation; GtkScrollType scroll_type; - GtkHTML *html; + EWebView *web_view; gint steps = 2; - html = image_object->object.format->html; + web_view = em_format_html_get_web_view (image_object->object.format); switch (direction) { case GDK_SCROLL_UP: @@ -296,7 +296,8 @@ mouse_wheel_scroll_cb (GtkWidget *image_view, while (steps > 0) { g_signal_emit_by_name ( - html, "scroll", orientation, scroll_type, 2.0, NULL); + web_view, "scroll", + orientation, scroll_type, 2.0, NULL); steps--; } } diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c index f2e3f98435..e16999584e 100644 --- a/plugins/mail-to-task/mail-to-task.c +++ b/plugins/mail-to-task/mail-to-task.c @@ -893,18 +893,18 @@ text_contains_nonwhitespace (const gchar *text, gint len) static gchar * get_selected_text (EMailReader *reader) { - EMFormatHTMLDisplay *html_display; - GtkHTML *html; + EMFormatHTML *formatter; + EWebView *web_view; gchar *text = NULL; gint len; - html_display = e_mail_reader_get_html_display (reader); - html = EM_FORMAT_HTML (html_display)->html; + formatter = e_mail_reader_get_formatter (reader); + web_view = em_format_html_get_web_view (formatter); - if (!gtk_html_command (html, "is-selection-active")) + if (!e_web_view_is_selection_active (web_view)) return NULL; - text = gtk_html_get_selection_plain_text (html, &len); + text = gtk_html_get_selection_plain_text (GTK_HTML (web_view), &len); if (text == NULL || !text_contains_nonwhitespace (text, len)) { g_free (text); -- cgit v1.2.3