[maemo-commits] [maemo-commits] r8346 - in projects/haf/trunk/gtkhtml: . debian upstream/patches

From: www-data at stage.maemo.org www-data at stage.maemo.org
Date: Mon Nov 27 14:58:37 EET 2006
Author: pavelek
Date: 2006-11-27 14:58:35 +0200 (Mon, 27 Nov 2006)
New Revision: 8346

Added:
   projects/haf/trunk/gtkhtml/upstream/patches/gtkhtml_image_magnification.diff
Modified:
   projects/haf/trunk/gtkhtml/ChangeLog
   projects/haf/trunk/gtkhtml/debian/changelog
   projects/haf/trunk/gtkhtml/debian/rules
   projects/haf/trunk/gtkhtml/upstream/patches/gtkhtml_unrealize_fix.diff
Log:
        * added gtkhtml_image_magnification.diff to scale images with text
        * Fixes: NB#47404



Modified: projects/haf/trunk/gtkhtml/ChangeLog
===================================================================
--- projects/haf/trunk/gtkhtml/ChangeLog	2006-11-27 12:58:34 UTC (rev 8345)
+++ projects/haf/trunk/gtkhtml/ChangeLog	2006-11-27 12:58:35 UTC (rev 8346)
@@ -1,6 +1,12 @@
 2006-11-27  Jakub Pavelek <jakub.pavelek at nokia.com>
 
+	* added gtkhtml_image_magnification.diff to scale images with text
+	* Fixes: NB#47404
+
+2006-11-27  Jakub Pavelek <jakub.pavelek at nokia.com>
+
 	* added gtkhtml_unrealize_fix.diff to get rid of glib critical
+	* Fixes: NB#46236
 
 2006-11-20  Jakub Pavelek <jakub.pavelek at nokia.com>
 

Modified: projects/haf/trunk/gtkhtml/debian/changelog
===================================================================
--- projects/haf/trunk/gtkhtml/debian/changelog	2006-11-27 12:58:34 UTC (rev 8345)
+++ projects/haf/trunk/gtkhtml/debian/changelog	2006-11-27 12:58:35 UTC (rev 8346)
@@ -1,7 +1,8 @@
 gtkhtml (3.9.1-2osso11) unstable; urgency=low
 
   * Unrealize fix - added gtkhtml_unrealize_fix.diff
-  * Fixes: NB#46236
+  * Scale images with text - added gtkhtml_image_magnification.diff
+  * Fixes: NB#46236, NB#47404
 
  -- Jakub Pavelek <jakub.pavelek at nokia.com>  Mon, 27 Nov 2006 12:30:44 +0200
 

Modified: projects/haf/trunk/gtkhtml/debian/rules
===================================================================
--- projects/haf/trunk/gtkhtml/debian/rules	2006-11-27 12:58:34 UTC (rev 8345)
+++ projects/haf/trunk/gtkhtml/debian/rules	2006-11-27 12:58:35 UTC (rev 8346)
@@ -58,6 +58,7 @@
 	patch -p0 < upstream/patches/gtkhtml_imcontext_leak.diff
 	patch -p0 < upstream/patches/gtkhtml_const_patch.diff
 	patch -p0 < upstream/patches/gtkhtml_unrealize_fix.diff
+	patch -p0 < upstream/patches/gtkhtml_image_magnification.diff
 	cd $(SOURCE_DIR) && ./autogen.sh
 
 

Added: projects/haf/trunk/gtkhtml/upstream/patches/gtkhtml_image_magnification.diff
===================================================================
--- projects/haf/trunk/gtkhtml/upstream/patches/gtkhtml_image_magnification.diff	2006-11-27 12:58:34 UTC (rev 8345)
+++ projects/haf/trunk/gtkhtml/upstream/patches/gtkhtml_image_magnification.diff	2006-11-27 12:58:35 UTC (rev 8346)
@@ -0,0 +1,104 @@
+# Scale images together with the text
+#
+# Copyright (C) 2006 Nokia Corporation.
+# This file is distributed under the terms of GNU LGPL license, either version 2
+# of the License, or (at your option) any later version.
+#
+diff -ru gtkhtml-3.9.1/src/gtkhtml.c gtkhtml-3.9.1.mod/src/gtkhtml.c
+--- gtkhtml-3.9.1/src/gtkhtml.c	2006-11-17 16:30:20.000000000 +0200
++++ gtkhtml-3.9.1.mod/src/gtkhtml.c	2006-11-17 16:45:00.000000000 +0200
+@@ -5756,8 +5756,10 @@
+ 	} else if (HTML_IS_IFRAME (o)) {
+ 		html_font_manager_set_magnification (&GTK_HTML (HTML_IFRAME (o)->html)->engine->painter->font_manager,
+ 						     *(gdouble *) data);
+-	} else if (HTML_IS_TEXT (o))
+-		html_text_calc_font_size (HTML_TEXT (o), e);
++	} else if (HTML_IS_TEXT (o)) {
++		html_text_calc_font_size (HTML_TEXT (o), e); 
++	} else if (HTML_IS_IMAGE (o))
++		html_image_set_magnification (HTML_IMAGE (o), (*((gdouble *)data))) ;
+ }
+ 
+ void
+diff -ru gtkhtml-3.9.1/src/htmlimage.c gtkhtml-3.9.1.mod/src/htmlimage.c
+--- gtkhtml-3.9.1/src/htmlimage.c	2006-11-17 16:30:20.000000000 +0200
++++ gtkhtml-3.9.1.mod/src/htmlimage.c	2006-11-17 16:43:02.000000000 +0200
+@@ -78,6 +78,13 @@
+ 
+ static GdkPixbuf *         html_image_factory_get_missing       (HTMLImageFactory *factory);
+ 
++void
++html_image_set_magnification (HTMLImage *image, gdouble new_magnification)
++{
++	if (NULL == image) return ;
++	image->magnification = new_magnification ;
++}
++
+ guint
+ html_image_get_actual_width (HTMLImage *image, HTMLPainter *painter)
+ {
+@@ -89,13 +96,13 @@
+ 		/* The cast to `gdouble' is to avoid overflow (eg. when
+                    printing).  */
+ 		width = ((gdouble) HTML_OBJECT (image)->max_width
+-			 * image->specified_width) / 100;
++			 * image->specified_width) / 100 * image->magnification;
+ 	} else if (image->specified_width > 0) {
+-		width = image->specified_width * pixel_size;
++		width = image->specified_width * pixel_size * image->magnification;
+ 	} else if (image->image_ptr == NULL || anim == NULL) {
+-		width = DEFAULT_SIZE * pixel_size;
++		width = DEFAULT_SIZE * pixel_size * image->magnification;
+ 	} else {
+-		width = gdk_pixbuf_animation_get_width (anim) * pixel_size;
++		width = gdk_pixbuf_animation_get_width (anim) * pixel_size * image->magnification;
+ 
+ 		if (image->specified_height > 0 || image->percent_height) {
+ 			double scale;
+@@ -122,13 +129,13 @@
+ 		/* The cast to `gdouble' is to avoid overflow (eg. when
+                    printing).  */
+ 		height = ((gdouble) html_engine_get_view_height (image->image_ptr->factory->engine)
+-			  * image->specified_height) / 100;
++			  * image->specified_height) / 100 * image->magnification;
+ 	} else if (image->specified_height > 0) {
+-		height = image->specified_height * pixel_size;
++		height = image->specified_height * pixel_size * image->magnification;
+ 	} else if (image->image_ptr == NULL || anim == NULL) {
+-		height = DEFAULT_SIZE * pixel_size;
++		height = DEFAULT_SIZE * pixel_size * image->magnification;
+ 	} else {
+-		height = gdk_pixbuf_animation_get_height (anim) * pixel_size;
++		height = gdk_pixbuf_animation_get_height (anim) * pixel_size * image->magnification;
+ 
+ 		if (image->specified_width > 0 || image->percent_width) {
+ 			double scale;
+@@ -863,7 +870,7 @@
+ 	if (valign == HTML_VALIGN_NONE)
+ 		valign = HTML_VALIGN_BOTTOM;
+ 	image->valign = valign;
+-
++	image->magnification = 1.0 ;
+ 	image->image_ptr = html_image_factory_register (imf, image, filename, reload);
+ }
+ 
+diff -ru gtkhtml-3.9.1/src/htmlimage.h gtkhtml-3.9.1.mod/src/htmlimage.h
+--- gtkhtml-3.9.1/src/htmlimage.h	2003-05-20 18:17:13.000000000 +0300
++++ gtkhtml-3.9.1.mod/src/htmlimage.h	2006-11-17 16:41:59.000000000 +0200
+@@ -74,6 +74,7 @@
+ 	gchar *alt;
+ 	gchar *usemap;
+ 	gchar *final_url;	
++	gdouble magnification ;
+ };
+ 
+ struct _HTMLImageClass {
+@@ -142,6 +143,8 @@
+ 					    HTMLPainter     *painter);
+ guint       html_image_get_actual_height   (HTMLImage       *image,
+ 					    HTMLPainter     *painter);
++void        html_image_set_magnification   (HTMLImage       *image,
++					    gdouble new_magnification) ;
+ /* FIXME move to htmlimagefactory.c */
+ HTMLImageFactory *html_image_factory_new                    (HTMLEngine       *e);
+ void              html_image_factory_free                   (HTMLImageFactory *factory);

Modified: projects/haf/trunk/gtkhtml/upstream/patches/gtkhtml_unrealize_fix.diff
===================================================================
--- projects/haf/trunk/gtkhtml/upstream/patches/gtkhtml_unrealize_fix.diff	2006-11-27 12:58:34 UTC (rev 8345)
+++ projects/haf/trunk/gtkhtml/upstream/patches/gtkhtml_unrealize_fix.diff	2006-11-27 12:58:35 UTC (rev 8346)
@@ -1,3 +1,10 @@
+# Do not give me window that is going to be destroyed the next moment!
+#
+# Copyright (C) 2006 Nokia Corporation.
+# This file is distributed under the terms of GNU LGPL license, either version 2
+# of the License, or (at your option) any later version.
+#
+
 diff -ru gtkhtml-3.9.1/src/gtkhtml.c gtkhtml-3.9.1-unref-fix/src/gtkhtml.c
 --- gtkhtml-3.9.1/src/gtkhtml.c	2006-11-22 19:57:01.000000000 +0200
 +++ gtkhtml-3.9.1-unref-fix/src/gtkhtml.c	2006-11-22 19:59:42.000000000 +0200


More information about the maemo-commits mailing list