changeset 27:9c24765c2d3a

Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net> * image.c (image_options_set): Update PixbufRenderer parent window so that changing 'fit window to image' option works. * pan-view.c (pan_window_image_zoom_cb): Use same zoom text display as for main windows. * pixbuf-renderer.c: Fix (re-implement) check for maximized window state. Fix pr_source_tile_visible() calculation which was using the x axis where it should be y. Add redrawn return value to pr_zoom_clamp() and use that value in pr_zoom_sync() to pass pr_redraw correct args. ##### Note: GQview CVS on sourceforge is not always up to date, please use ##### ##### an offical release when making enhancements and translation updates. #####
author gqview
date Sat, 02 Apr 2005 22:44:34 +0000
parents acd9885ebd78
children ddbf419cb18d
files ChangeLog TODO src/image.c src/pan-view.c src/pixbuf-renderer.c
diffstat 5 files changed, 36 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Mar 29 01:28:17 2005 +0000
+++ b/ChangeLog	Sat Apr 02 22:44:34 2005 +0000
@@ -1,3 +1,14 @@
+Sat Apr  2 17:28:16 2005  John Ellis  <johne@verizon.net>
+
+	* image.c (image_options_set): Update PixbufRenderer parent window so
+	that changing 'fit window to image' option works.
+	* pan-view.c (pan_window_image_zoom_cb): Use same zoom text display as
+	for main windows.
+	* pixbuf-renderer.c: Fix (re-implement) check for maximized window
+	state. Fix pr_source_tile_visible() calculation which was using	the x
+	axis where it should be y. Add redrawn return value to pr_zoom_clamp()
+	and use that value in pr_zoom_sync() to pass pr_redraw correct args.
+
 Mon Mar 28 20:23:34 2005  John Ellis  <johne@verizon.net>
 
 	* image.[ch]: Add utility to sync image settings to user preferences.
--- a/TODO	Tue Mar 29 01:28:17 2005 +0000
+++ b/TODO	Sat Apr 02 22:44:34 2005 +0000
@@ -7,7 +7,8 @@
  > pixbuf-renderer.c:
   d> fix two pass render from corrupting it->qd pointer (need one pointer for each queue?).
   d> fix image_change_from_image (to do this need a pixbuf_renderer_move_image).
-   > fix broken zoom out drawing when using source tiles.
+  d> fix broken zoom out drawing when using source tiles.
+   > fix 2pass zoom when using source tiles and zoomed out (not always rendering second pass)
 
  > image.c:
   d> need to keep a list of ImageWindows and provide function to sync options to each object.
@@ -16,6 +17,8 @@
         by pre-rendering any scaled tiles that are visible before signaling 'render_complete'.
    > make this a g_object with signals for completed, changed, etc.
   d> fix region computation rounding when updating scaled image in 'area ready' signal.
+   > fix delay flip 'completed' signal (full screen busy cursor is not always turned off)
+   > fix slow loading of images when zoomed out - bug could be poor clamping to visible in PixbufRenderer.
 
 
  > work on pan view:
--- a/src/image.c	Tue Mar 29 01:28:17 2005 +0000
+++ b/src/image.c	Sat Apr 02 22:44:34 2005 +0000
@@ -1347,6 +1347,8 @@
 					"window_limit", limit_window_size,
 					"window_limit_value", max_window_size,
 					NULL);
+
+	pixbuf_renderer_set_parent((PixbufRenderer *)imd->pr, (GtkWindow *)imd->top_window);
 }
 
 void image_options_sync(void)
--- a/src/pan-view.c	Tue Mar 29 01:28:17 2005 +0000
+++ b/src/pan-view.c	Sat Apr 02 22:44:34 2005 +0000
@@ -2965,9 +2965,9 @@
 		}
 	g_list_free(list);
 
-	if (0)
+#if 0
+	if (x%512 == 0 && y%512 == 0)
 		{
-		static gint count = 0;
 		PangoLayout *layout;
 		gchar *buf;
 
@@ -2982,9 +2982,8 @@
 		pixbuf_draw_layout(pixbuf, layout, (GtkWidget *)pr, 0, 0, 0, 0, 0, 255);
 
 		g_object_unref(G_OBJECT(layout));
-
-		count++;
 		}
+#endif
 
 	return TRUE;
 }
@@ -4047,10 +4046,7 @@
 	PanWindow *pw = data;
 	gchar *text;
 
-#if 0
-	text = image_zoom_get_as_text(imd);
-#endif
-	text = g_strdup_printf("%.2f", zoom);
+	text = image_zoom_get_as_text(pw->imd);
 	gtk_label_set_text(GTK_LABEL(pw->label_zoom), text);
 	g_free(text);
 }
--- a/src/pixbuf-renderer.c	Tue Mar 29 01:28:17 2005 +0000
+++ b/src/pixbuf-renderer.c	Sat Apr 02 22:44:34 2005 +0000
@@ -676,12 +676,15 @@
 
 static gint pr_parent_window_sizable(PixbufRenderer *pr)
 {
+	GdkWindowState state;
+
 	if (!pr->parent_window) return FALSE;
 	if (!pr->window_fit) return FALSE;
 	if (!GTK_WIDGET(pr)->window) return FALSE;
-#if 0
-	if (window_maximized(pr->top_window)) return FALSE;
-#endif
+
+	if (!pr->parent_window->window) return FALSE;
+	state = gdk_window_get_state(pr->parent_window->window);
+	if (state & GDK_WINDOW_STATE_MAXIMIZED) return FALSE;
 
 	return TRUE;
 }
@@ -1249,7 +1252,7 @@
 
 	return !((double)st->x * pr->scale > (double)x2 ||
 		 (double)(st->x + pr->source_tile_width) * pr->scale < (double)x1 ||
-		 (double)st->y * pr->scale > (double)x2 ||
+		 (double)st->y * pr->scale > (double)y2 ||
 		 (double)(st->y + pr->source_tile_height) * pr->scale < (double)y1);
 }
 
@@ -2430,7 +2433,9 @@
 	return (old_vw != pr->vis_width || old_vh != pr->vis_height);
 }
 
-static gint pr_zoom_clamp(PixbufRenderer *pr, gdouble zoom, gint force, gint new, gint invalidate)
+static gint pr_zoom_clamp(PixbufRenderer *pr, gdouble zoom,
+			  gint force, gint new, gint invalidate,
+			  gint *redrawn)
 {
 	gint w, h;
 	gdouble scale;
@@ -2521,6 +2526,7 @@
 		pr_tile_invalidate_all(pr);
 		pr_redraw(pr, TRUE);
 		}
+	if (redrawn) *redrawn = (invalidate || invalid);
 
 	return TRUE;
 }
@@ -2533,6 +2539,7 @@
 	gint old_cx, old_cy;
 	gint clamped;
 	gint sized;
+	gint redrawn = FALSE;
 
 	old_scale = pr->scale;
 	if (center_point)
@@ -2549,7 +2556,7 @@
 		old_cy = pr->y_scroll + pr->vis_height / 2;
 		}
 
-	if (!pr_zoom_clamp(pr, zoom, force, new, force)) return;
+	if (!pr_zoom_clamp(pr, zoom, force, new, force, &redrawn)) return;
 
 	clamped = pr_size_clamp(pr);
 	sized = pr_parent_window_resize(pr, pr->width, pr->height);
@@ -2600,7 +2607,7 @@
 	 * so redraw the window anyway :/
 	 */
 	if (sized || clamped) pr_border_clear(pr);
-	pr_redraw(pr, FALSE);
+	pr_redraw(pr, redrawn);
 
 	pr_zoom_signal(pr);
 	pr_update_signal(pr);
@@ -2613,7 +2620,7 @@
 	pr->window_width = new_width;
 	pr->window_height = new_height;
 
-	if (pr->zoom == 0.0) pr_zoom_clamp(pr, 0.0, TRUE, FALSE, FALSE);
+	if (pr->zoom == 0.0) pr_zoom_clamp(pr, 0.0, TRUE, FALSE, FALSE, NULL);
 
 	pr_size_clamp(pr);
 	pr_scroll_clamp(pr);