diff src/image-overlay.c @ 23:17acca639a86

##### Note: GQview CVS on sourceforge is not always up to date, please use ##### ##### an offical release when making enhancements and translation updates. ##### Fri Mar 18 19:52:38 2005 John Ellis <johne@verizon.net> * pixbuf-renderer.c: Fix broken 2pass queueing so it merges a single queue item for each tile, and now that a tile holds a queue pointer there is no need to walk the tile list to find a possible merge victim. Thu Mar 17 19:23:56 2005 John Ellis <johne@verizon.net> * image.c, pixbuf-renderer.[ch]: More progress, and 2 pass zoom now works again (mostly). Tue Mar 15 23:17:41 2005 John Ellis <johne@verizon.net> * image.[ch]: Start conversion to use of PixbufRenderer. * pixbuf-renderer.[ch]: Additions and fixes for use by ImageWindow. * fullscreen.c, image-overlay.c, img-view.c, info.c, layout.c, layout_image.c, print.c: Changes for above ImageWindow conversion. * typedefs.h: Remove unused ImageWindow variables. Mon Mar 14 20:45:50 2005 John Ellis <johne@verizon.net> * pan-view.c: Convert to using new PixbufRenderer. * pixbuf-renderer.[ch]: Clean up and fixes. Sun Mar 13 10:21:35 2005 John Ellis <johne@verizon.net> * image.c (image_scroller_start): Unref scroller pixbuf after adding it as an overlay to avoid leaking it. * pixbuf-renderer.[ch]: All functions defined in header file are now implemented. Fri Mar 11 17:05:36 2005 John Ellis <johne@verizon.net> * pixbuf-renderer.[ch]: Set up object properties and additional. Mar 10 19:22:18 2005 John Ellis <johne@verizon.net> * pixbuf-renderer.[ch]: FIx scrolling to use old method of gdk_draw and not gdk_scroll, as scroll often invalidates the entire window (!). Also merged in source tiles code from image.c. * pan-view.c: Change picked up when testing PixbufRender zoom. Tue Mar 8 23:26:00 2005 John Ellis <johne@verizon.net> * pixbuf-renderer.[ch]: Start of turning image drawing portion of ImageWindow into an actual GtkWidget. * src/Makefile.am: Add pixbuf-renderer.[ch]. * pan-view.c: Added temporary hack button and callback for testing PixbufRenderer widget.
author gqview
date Sat, 19 Mar 2005 01:15:17 +0000
parents d907d608745f
children 0c2e1f0a001b
line wrap: on
line diff
--- a/src/image-overlay.c	Sat Mar 05 21:40:46 2005 +0000
+++ b/src/image-overlay.c	Sat Mar 19 01:15:17 2005 +0000
@@ -17,6 +17,7 @@
 #include "image.h"
 #include "img-view.h"
 #include "layout.h"
+#include "pixbuf-renderer.h"
 #include "pixbuf_util.h"
 
 
@@ -126,15 +127,14 @@
 
 		if (imd->delay_flip &&
 		    imd->il && imd->il->pixbuf &&
-		    imd->pixbuf != imd->il->pixbuf)
+		    image_get_pixbuf(imd) != imd->il->pixbuf)
 			{
 			w = gdk_pixbuf_get_width(imd->il->pixbuf);
 			h = gdk_pixbuf_get_height(imd->il->pixbuf);
 			}
 		else
 			{
-			w = imd->image_width;
-			h = imd->image_height;
+			pixbuf_renderer_get_image_size(PIXBUF_RENDERER(imd->pr), &w, &h);
 			}
 
 		text = g_strdup_printf("%s(%d/%d) <b>%s</b>\n%d x %d - %s - %s", ct,
@@ -146,7 +146,7 @@
 	g_free(ct);
 	g_free(name_escaped);
 
-	layout = gtk_widget_create_pango_layout(imd->image, NULL);
+	layout = gtk_widget_create_pango_layout(imd->pr, NULL);
 	pango_layout_set_markup(layout, text, -1);
 	g_free(text);
 
@@ -165,7 +165,7 @@
 	pixbuf_pixel_set(pixbuf, 0, height - 1, 0, 0, 0, 0);
 	pixbuf_pixel_set(pixbuf, width - 1, height - 1, 0, 0, 0, 0);
 
-	pixbuf_draw_layout(pixbuf, layout, imd->image, 5, 5, 0, 0, 0, 255);
+	pixbuf_draw_layout(pixbuf, layout, imd->pr, 5, 5, 0, 0, 0, 255);
 
 	g_object_unref(G_OBJECT(layout));
 
@@ -189,8 +189,8 @@
 	image_overlay_set(ou->imd, ou->id, pixbuf, IMAGE_OVERLAY_X, IMAGE_OVERLAY_Y);
 	g_object_unref(pixbuf);
 
-	g_object_set_data(G_OBJECT(ou->imd->image), IMAGE_OVERLAY_UPDATE_KEY, NULL);
-	g_signal_handler_disconnect(ou->imd->image, ou->destroy_id);
+	g_object_set_data(G_OBJECT(ou->imd->pr), IMAGE_OVERLAY_UPDATE_KEY, NULL);
+	g_signal_handler_disconnect(ou->imd->pr, ou->destroy_id);
 	g_free(ou);
 
 	return FALSE;
@@ -200,16 +200,16 @@
 {
 	OverlayUpdate *ou;
 
-	ou = g_object_get_data(G_OBJECT(imd->image), IMAGE_OVERLAY_UPDATE_KEY);
+	ou = g_object_get_data(G_OBJECT(imd->pr), IMAGE_OVERLAY_UPDATE_KEY);
 	if (ou) return;
 
 	ou = g_new0(OverlayUpdate, 1);
 	ou->imd = imd;
 	ou->id = id;
 	ou->idle_id = g_idle_add_full(G_PRIORITY_HIGH, image_overlay_update_cb, ou, NULL);
-	ou->destroy_id = g_signal_connect(G_OBJECT(imd->image), "destroy",
+	ou->destroy_id = g_signal_connect(G_OBJECT(imd->pr), "destroy",
 					  G_CALLBACK(image_overlay_update_destroy_cb), ou);
-	g_object_set_data(G_OBJECT(imd->image), IMAGE_OVERLAY_UPDATE_KEY, ou);
+	g_object_set_data(G_OBJECT(imd->pr), IMAGE_OVERLAY_UPDATE_KEY, ou);
 }
 
 void image_overlay_update(ImageWindow *imd, gint id)