diff src/img-view.c @ 117:0c2e1f0a001b

Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net> * image-overlay.[ch]: Rewrite most of the information overlay code to be more flexible and easily extended. * image.[ch], typedefs.h: Remove image_new_func, and replace it with image_state_func callback which is much more informative. * img-view.c, layout.c, layout_image.c: Updates for new image overlay function names.
author gqview
date Wed, 29 Nov 2006 19:38:25 +0000
parents 50dc5a14d37b
children ac0f7f942c4d
line wrap: on
line diff
--- a/src/img-view.c	Tue Nov 28 18:20:56 2006 +0000
+++ b/src/img-view.c	Wed Nov 29 19:38:25 2006 +0000
@@ -45,8 +45,6 @@
 
 	GList *list;
 	GList *list_pointer;
-
-	gint overlay_id;
 };
 
 
@@ -689,13 +687,18 @@
 
 static void view_fullscreen_toggle(ViewWindow *vw, gint force_off)
 {
+	gint info, status;
+
 	if (force_off && !vw->fs) return;
 
 	if (vw->fs)
 		{
-		fullscreen_stop(vw->fs);
+		if (image_osd_get(vw->fs->imd, &info, &status))
+			{
+			image_osd_set(vw->imd, info, status);
+			}
 
-		if (vw->overlay_id != -1) vw->overlay_id = image_overlay_info_enable(vw->imd);
+		fullscreen_stop(vw->fs);
 		}
 	else
 		{
@@ -707,10 +710,10 @@
 
 		if (vw->ss) vw->ss->imd = vw->fs->imd;
 
-		if (vw->overlay_id != -1)
+		if (image_osd_get(vw->imd, &info, &status))
 			{
-			image_overlay_info_disable(vw->imd, vw->overlay_id);
-			vw->overlay_id = image_overlay_info_enable(vw->fs->imd);
+			image_osd_set(vw->imd, FALSE, FALSE);
+			image_osd_set(vw->fs->imd, info, status);
 			}
 		}
 }
@@ -721,14 +724,13 @@
 
 	imd = view_window_active_image(vw);
 
-	if (vw->overlay_id == -1)
+	if (!image_osd_get(imd, NULL, NULL))
 		{
-		vw->overlay_id = image_overlay_info_enable(imd);
+		image_osd_set(imd, TRUE, TRUE);
 		}
 	else
 		{
-		image_overlay_info_disable(imd, vw->overlay_id);
-		vw->overlay_id = -1;
+		image_osd_set(imd, FALSE, FALSE);
 		}
 }
 
@@ -822,8 +824,6 @@
 	vw->list = NULL;
 	vw->list_pointer = NULL;
 
-	vw->overlay_id = -1;
-
 	vw->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
 
 	geometry.min_width = 8;
@@ -1627,7 +1627,7 @@
 			}
 		}
 
-	if (vw->overlay_id != -1) image_overlay_update(imd, vw->overlay_id);
+	image_osd_update(imd);
 }
 
 static void view_real_moved(ViewWindow *vw, const gchar *source, const gchar *dest)