[balsa/gtk3] GtkHtml-4 is the new GtkHtml-3



commit 435f845e2991fad35f84489b405fa3d7424c2aa2
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sat Feb 5 12:09:47 2011 -0500

    GtkHtml-4 is the new GtkHtml-3
    
    	* configure.in: GtkHtml-4 is the new GtkHtml-3.
    	* libbalsa/html.c (libbalsa_html_new), (lbh_size_request_cb):
    	ditto; do not connect to "size-request" signal.

 ChangeLog       |    6 ++++++
 configure.in    |   12 ++++++------
 libbalsa/html.c |   42 +++++++++++++++++++-----------------------
 3 files changed, 31 insertions(+), 29 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d33c8fd..5da612b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-02-05  Peter Bloomfield
+
+	* configure.in: GtkHTML-4 is the new GtkHtml-3.
+	* libbalsa/html.c (libbalsa_html_new), (lbh_size_request_cb):
+	ditto; do not connect to "size-request" signal.
+
 2011-01-30  Peter Bloomfield
 
 	Revert from GSettings to GConf for default client stuff
diff --git a/configure.in b/configure.in
index f01567a..1c0d5b7 100644
--- a/configure.in
+++ b/configure.in
@@ -124,7 +124,7 @@ AC_ARG_WITH(gss,
                   [with_gss=$withval],[with_gss=no])
 
 AC_ARG_WITH(html-widget,
-            AC_HELP_STRING([--with-html-widget=(no|gtkhtml2|gtkhtml3|webkit)],
+            AC_HELP_STRING([--with-html-widget=(no|gtkhtml2|gtkhtml4|webkit)],
                            [select the HTML renderer (default webkit)]),
             [use_html_widget=$withval],
             [use_html_widget=webkit])
@@ -390,12 +390,12 @@ case "$use_html_widget" in
         PKG_CHECK_MODULES(HTML, [ libgtkhtml-2.0 ])
         AC_DEFINE(HAVE_GTKHTML2,1,[Defined when GtkHtml-2 can be used.])
     ;;
-    gtkhtml3)
+    gtkhtml4)
         AC_MSG_RESULT([$use_html_widget])
-        PKG_CHECK_MODULES(HTML, [ libgtkhtml-3.14 ], [],
-          [PKG_CHECK_MODULES(HTML, [ libgtkhtml-3.15 ],[],
-             [AC_MSG_ERROR([*** You enabled gtkhtml3 but none of 3.14 or 3.15 libversions were found.])])])
-        AC_DEFINE(HAVE_GTKHTML3,1,[Defined when GtkHtml-3 can be used.])
+        PKG_CHECK_MODULES(HTML, [ libgtkhtml-4.0 ], [],
+          [PKG_CHECK_MODULES(HTML, [ libgtkhtml-4.0 ],[],
+             [AC_MSG_ERROR([*** You enabled gtkhtml4 but it was not found.])])])
+        AC_DEFINE(HAVE_GTKHTML4,1,[Defined when GtkHtml-4 can be used.])
     ;;
     webkit)
         AC_MSG_RESULT([$use_html_widget])
diff --git a/libbalsa/html.c b/libbalsa/html.c
index dbba62c..0da9f21 100644
--- a/libbalsa/html.c
+++ b/libbalsa/html.c
@@ -23,13 +23,13 @@
 /*
  * Support for HTML mail parts.
  *
- * Balsa supports three HTML engines: GtkHtml-2, GtkHTML-3, and WebKit.
+ * Balsa supports three HTML engines: GtkHtml-2, GtkHTML-4, and WebKit.
  * The symbol HAVE_HTML_WIDGET is defined if HTML support is requested at
  * configure time, and the requested engine is available.
  *
  * This file contains all code that depends on which widget is being
  * used. Elsewhere, HTML support code should be conditional on
- * HAVE_HTML_WIDGET, but none of HAVE_GTKHTML2, HAVE_GTKHTML3, or
+ * HAVE_HTML_WIDGET, but none of HAVE_GTKHTML2, HAVE_GTKHTML4, or
  * HAVE_WEBKIT should be referenced outside this file.
  *
  * As of this writing (2010-01), WebKit offers the most complete API,
@@ -705,23 +705,9 @@ lbh_hovering_over_link_cb(GtkWidget   * widget,
         (*info->hover_cb) (uri);
 }
 
-static void
-lbh_size_request_cb(GtkWidget      * widget,
-                    GtkRequisition * requisition,
-                    gpointer         data)
-{
-    GtkLayout *layout = GTK_LAYOUT(widget);
-    GtkAdjustment *adjustment;
+# ifdef HAVE_GTKHTML4
 
-    adjustment = gtk_layout_get_hadjustment(layout);
-    requisition->width = gtk_adjustment_get_upper(adjustment);
-    adjustment = gtk_layout_get_vadjustment(layout);
-    requisition->height = gtk_adjustment_get_upper(adjustment);
-}
-
-# ifdef HAVE_GTKHTML3
-
-/* Code for GtkHTML-3 */
+/* Code for GtkHTML-4 */
 
 #  include <gtkhtml/gtkhtml.h>
 #  include <gtkhtml/gtkhtml-stream.h>
@@ -844,9 +830,6 @@ libbalsa_html_new(LibBalsaMessageBody * body,
                      G_CALLBACK(libbalsa_html_url_requested),
                      body->message);
 
-    g_signal_connect(widget, "size-request",
-                     G_CALLBACK(lbh_size_request_cb), info);
-
     return widget;
 }
 
@@ -948,7 +931,7 @@ libbalsa_html_print(GtkWidget * widget)
     g_object_unref(operation);
 }
 
-# else				/* HAVE_GTKHTML3 */
+# else				/* HAVE_GTKHTML4 */
 
 /* Code for GtkHtml-2 */
 
@@ -967,6 +950,19 @@ libbalsa_html_write_mime_stream(HtmlStream * stream,
     html_stream_close(stream);
 }
 
+static void
+lbh_size_request_cb(GtkWidget      * widget,
+                    GtkRequisition * requisition,
+                    gpointer         data)
+{
+    GtkAdjustment *hadjustment, *vadjustment;
+
+    g_object_get(G_OBJECT(widget), "hadjustment", &hadjustment,
+                                   "vadjustment", &vadjustment, NULL);
+    requisition->width  = gtk_adjustment_get_upper(hadjustment);
+    requisition->height = gtk_adjustment_get_upper(vadjustment);
+}
+
 /* Create a new HtmlView widget:
  * text			the HTML source;
  * len			length of text;
@@ -1104,7 +1100,7 @@ libbalsa_html_print(GtkWidget * widget)
 {
 }
 
-# endif				/* HAVE_GTKHTML3 */
+# endif				/* HAVE_GTKHTML4 */
 
 /* Common code for both widgets. */
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]