changeset 36:9b01fe7e84d5

Tue Apr 12 07:59:20 2005 John Ellis <johne@verizon.net> * pan-view.c: Use mostly neutral (gray) colors in the pan view to avoid tainting user perspective of image hues. * pixbuf-renderer.c (pixbuf_renderer_move): Free tile cache of source to avoid wasteful memory allocation, this will reduce memory waste when in full screen. ##### 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 Tue, 12 Apr 2005 12:11:31 +0000
parents e46aedb70f67
children 67ba4381497e
files ChangeLog TODO src/pan-view.c src/pixbuf-renderer.c
diffstat 4 files changed, 65 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Apr 08 19:43:25 2005 +0000
+++ b/ChangeLog	Tue Apr 12 12:11:31 2005 +0000
@@ -1,3 +1,11 @@
+Tue Apr 12 07:59:20 2005  John Ellis  <johne@verizon.net>
+
+	* pan-view.c: Use mostly neutral (gray) colors in the pan view to avoid
+	tainting user perspective of image hues.
+	* pixbuf-renderer.c (pixbuf_renderer_move): Free tile cache of source
+	to avoid wasteful memory allocation, this will reduce memory waste
+	when in full screen.
+
 Fri Apr  8 15:31:38 2005  John Ellis  <johne@verizon.net>
 
 	* pan-view.c: Optimize pan_layout_intersect by dividing object list
--- a/TODO	Fri Apr 08 19:43:25 2005 +0000
+++ b/TODO	Tue Apr 12 12:11:31 2005 +0000
@@ -9,6 +9,8 @@
   d> fix image_change_from_image (to do this need a pixbuf_renderer_move_image).
   d> fix broken zoom out drawing when using source tiles.
   d> fix 2pass zoom when using source tiles and zoomed out (not always rendering second pass)
+  d> pixbuf_renderer_move should be clearing the tiles of the source image since they are no longer
+     valid and are then wasting memory (for example when full screen is active).
 
  > image.c:
   d> need to keep a list of ImageWindows and provide function to sync options to each object.
--- a/src/pan-view.c	Fri Apr 08 19:43:25 2005 +0000
+++ b/src/pan-view.c	Tue Apr 12 12:11:31 2005 +0000
@@ -66,29 +66,56 @@
 #define PAN_OUTLINE_COLOR_2 64, 64, 64
 #define PAN_OUTLINE_ALPHA 180
 
-#define PAN_BACKGROUND_COLOR 255, 255, 230
-
-#define PAN_GRID_SIZE 10
+#define PAN_BACKGROUND_COLOR 150, 150, 150
+
+#define PAN_GRID_SIZE 60
 #define PAN_GRID_COLOR 0, 0, 0
 #define PAN_GRID_ALPHA 20
 
-#define PAN_FOLDER_BOX_COLOR 0, 0, 255
-#define PAN_FOLDER_BOX_ALPHA 10
+#define PAN_FOLDER_BOX_COLOR 255, 255, 255
+#define PAN_FOLDER_BOX_ALPHA 100
 #define PAN_FOLDER_BOX_BORDER 20
 
 #define PAN_FOLDER_BOX_OUTLINE_THICKNESS 4
-#define PAN_FOLDER_BOX_OUTLINE_COLOR 0, 0, 255
-#define PAN_FOLDER_BOX_OUTLINE_ALPHA 64
+#define PAN_FOLDER_BOX_OUTLINE_COLOR 0, 0, 0
+#define PAN_FOLDER_BOX_OUTLINE_ALPHA 128
 
 #define PAN_TEXT_BORDER_SIZE 4
 #define PAN_TEXT_COLOR 0, 0, 0
 
-#define PAN_POPUP_COLOR 255, 255, 220
+#define PAN_POPUP_COLOR 255, 255, 225
 #define PAN_POPUP_ALPHA 255
 #define PAN_POPUP_BORDER 1
 #define PAN_POPUP_BORDER_COLOR 0, 0, 0
 #define PAN_POPUP_TEXT_COLOR 0, 0, 0
 
+#define PAN_CAL_POPUP_COLOR 220, 220, 220
+#define PAN_CAL_POPUP_ALPHA 255
+#define PAN_CAL_POPUP_BORDER 1
+#define PAN_CAL_POPUP_BORDER_COLOR 0, 0, 0
+#define PAN_CAL_POPUP_TEXT_COLOR 0, 0, 0
+
+#define PAN_CAL_DAY_WIDTH 100
+#define PAN_CAL_DAY_HEIGHT 80
+
+#define PAN_CAL_DAY_COLOR 255, 255, 255
+#define PAN_CAL_DAY_ALPHA 220
+#define PAN_CAL_DAY_BORDER 2
+#define PAN_CAL_DAY_BORDER_COLOR 0, 0, 0
+#define PAN_CAL_DAY_TEXT_COLOR 0, 0, 0
+
+#define PAN_CAL_MONTH_COLOR 255, 255, 255
+#define PAN_CAL_MONTH_ALPHA 200
+#define PAN_CAL_MONTH_BORDER 4
+#define PAN_CAL_MONTH_BORDER_COLOR 0, 0, 0
+#define PAN_CAL_MONTH_TEXT_COLOR 0, 0, 0
+
+#define PAN_CAL_DOT_SIZE 3
+#define PAN_CAL_DOT_GAP 2
+#define PAN_CAL_DOT_COLOR 128, 128, 128
+#define PAN_CAL_DOT_ALPHA 128
+
+
 #define PAN_GROUP_MAX 16
 
 #define ZOOM_INCREMENT 1.0
@@ -1652,13 +1679,6 @@
  *-----------------------------------------------------------------------------
  */
 
-#define PAN_CAL_DAY_WIDTH 100
-#define PAN_CAL_DAY_HEIGHT 80
-#define PAN_CAL_DOT_SIZE 3
-#define PAN_CAL_DOT_GAP 2
-#define PAN_CAL_DOT_COLOR 0, 0, 0
-#define PAN_CAL_DOT_ALPHA 32
-
 static void pan_calendar_update(PanWindow *pw, PanItem *pi_day)
 {
 	PanItem *pbox;
@@ -1711,9 +1731,9 @@
 #endif
 
 	pbox = pan_item_new_box(pw, NULL, x, y, PAN_FOLDER_BOX_BORDER, PAN_FOLDER_BOX_BORDER,
-				PAN_POPUP_BORDER,
-				PAN_POPUP_COLOR, PAN_POPUP_ALPHA,
-				PAN_POPUP_BORDER_COLOR, PAN_POPUP_ALPHA);
+				PAN_CAL_POPUP_BORDER,
+				PAN_CAL_POPUP_COLOR, PAN_CAL_POPUP_ALPHA,
+				PAN_CAL_POPUP_BORDER_COLOR, PAN_CAL_POPUP_ALPHA);
 	pan_item_set_key(pbox, "day_bubble");
 
 	if (pi_day->fd)
@@ -1723,7 +1743,7 @@
 
 		buf = date_value_string(pi_day->fd->date, DATE_LENGTH_WEEK);
 		plabel = pan_item_new_text(pw, x, y, buf, TEXT_ATTR_BOLD | TEXT_ATTR_HEADING,
-					   PAN_POPUP_TEXT_COLOR, 255);
+					   PAN_CAL_POPUP_TEXT_COLOR, 255);
 		pan_item_set_key(plabel, "day_bubble");
 		g_free(buf);
 
@@ -1782,8 +1802,8 @@
 
 	pi = pan_item_new_tri(pw, NULL, x, y, w, h,
 			      x1, y1, x2, y2, x3, y3,
-			      PAN_POPUP_COLOR, PAN_POPUP_ALPHA);
-	pan_item_tri_border(pi, BORDER_1 | BORDER_3, PAN_POPUP_BORDER_COLOR, PAN_POPUP_ALPHA);
+			      PAN_CAL_POPUP_COLOR, PAN_CAL_POPUP_ALPHA);
+	pan_item_tri_border(pi, BORDER_1 | BORDER_3, PAN_CAL_POPUP_BORDER_COLOR, PAN_CAL_POPUP_ALPHA);
 	pan_item_set_key(pi, "day_bubble");
 	pan_item_added(pw, pi);
 
@@ -1885,13 +1905,13 @@
 		x = PAN_FOLDER_BOX_BORDER;
 
 		pi_month = pan_item_new_box(pw, NULL, x, y, PAN_CAL_DAY_WIDTH * 7, PAN_CAL_DAY_HEIGHT / 4,
-					    PAN_FOLDER_BOX_OUTLINE_THICKNESS,
-					    PAN_FOLDER_BOX_COLOR, PAN_FOLDER_BOX_ALPHA,
-					    PAN_FOLDER_BOX_OUTLINE_COLOR, PAN_FOLDER_BOX_OUTLINE_ALPHA);
+					    PAN_CAL_MONTH_BORDER,
+					    PAN_CAL_MONTH_COLOR, PAN_CAL_MONTH_ALPHA,
+					    PAN_CAL_MONTH_BORDER_COLOR, PAN_CAL_MONTH_ALPHA);
 		buf = date_value_string(dt, DATE_LENGTH_MONTH);
 		pi_text = pan_item_new_text(pw, x, y, buf,
 					     TEXT_ATTR_BOLD | TEXT_ATTR_HEADING,
-					     PAN_TEXT_COLOR, 255);
+					     PAN_CAL_MONTH_TEXT_COLOR, 255);
 		g_free(buf);
 		pi_text->x = pi_month->x + (pi_month->width - pi_text->width) / 2;
 
@@ -1915,9 +1935,9 @@
 			fd->name = path;
 			fd->date = dt;
 			pi_day = pan_item_new_box(pw, fd, x, y, PAN_CAL_DAY_WIDTH, PAN_CAL_DAY_HEIGHT,
-						  PAN_FOLDER_BOX_OUTLINE_THICKNESS,
-						  PAN_FOLDER_BOX_COLOR, PAN_FOLDER_BOX_ALPHA,
-						  PAN_FOLDER_BOX_OUTLINE_COLOR, PAN_FOLDER_BOX_OUTLINE_ALPHA);
+						  PAN_CAL_DAY_BORDER,
+						  PAN_CAL_DAY_COLOR, PAN_CAL_DAY_ALPHA,
+						  PAN_CAL_DAY_BORDER_COLOR, PAN_CAL_DAY_ALPHA);
 			pan_item_set_key(pi_day, "day");
 
 			dx = x + PAN_CAL_DOT_GAP * 2;
@@ -1946,7 +1966,6 @@
 					dy = y + PAN_CAL_DOT_GAP * 2;
 					}
 
-				pi_day->color_a = MIN(PAN_FOLDER_BOX_ALPHA + 64 + n, 255);
 				n++;
 
 				work = work->next;
@@ -1957,9 +1976,12 @@
 				{
 				PanItem *pi;
 
+				pi_day->color_r = MAX(pi_day->color_r - 61 - n * 3, 80);
+				pi_day->color_g = pi_day->color_r;
+
 				buf = g_strdup_printf("( %d )", n);
 				pi = pan_item_new_text(pw, x, y, buf, TEXT_ATTR_NONE,
-						       PAN_TEXT_COLOR, 255);
+						       PAN_CAL_DAY_TEXT_COLOR, 255);
 				g_free(buf);
 
 				pi->x = pi_day->x + (pi_day->width - pi->width) / 2;
@@ -1968,7 +1990,7 @@
 
 			buf = g_strdup_printf("%d", day);
 			pan_item_new_text(pw, x + 4, y + 4, buf, TEXT_ATTR_BOLD | TEXT_ATTR_HEADING,
-					  PAN_TEXT_COLOR, 255);
+					  PAN_CAL_DAY_TEXT_COLOR, 255);
 			g_free(buf);
 
 
--- a/src/pixbuf-renderer.c	Fri Apr 08 19:43:25 2005 +0000
+++ b/src/pixbuf-renderer.c	Tue Apr 12 12:11:31 2005 +0000
@@ -3116,6 +3116,8 @@
 	pr->scroll_reset = scroll_reset;
 
 	pixbuf_renderer_set_pixbuf(source, NULL, source->zoom);
+	pr_queue_clear(pr);
+	pr_tile_free_all(source);
 }
 
 void pixbuf_renderer_area_changed(PixbufRenderer *pr, gint x, gint y, gint width, gint height)