changeset 621:734b6b0a3356

image_osd_get() now returns OsdShowFlags.
author zas_
date Sat, 10 May 2008 14:22:18 +0000
parents f335373f44e5
children 54e20abb5c6d
files src/image-overlay.c src/image-overlay.h src/img-view.c src/layout_image.c src/main.c
diffstat 5 files changed, 14 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/image-overlay.c	Sat May 10 13:54:25 2008 +0000
+++ b/src/image-overlay.c	Sat May 10 14:22:18 2008 +0000
@@ -845,19 +845,11 @@
 	image_osd_enable(imd, show);
 }
 
-gint image_osd_get(ImageWindow *imd, OsdShowFlags *show)
+OsdShowFlags image_osd_get(ImageWindow *imd)
 {
 	OverlayStateData *osd = image_get_osd_data(imd);
 
-	if (!osd)
-		{
-		if (show) *show = OSD_SHOW_NOTHING;
-		return FALSE;
-		}
-
-	if (show) *show = osd->show;
-
-	return TRUE;
+	return osd ? osd->show : OSD_SHOW_NOTHING;
 }
 
 /* duration:
--- a/src/image-overlay.h	Sat May 10 13:54:25 2008 +0000
+++ b/src/image-overlay.h	Sat May 10 14:22:18 2008 +0000
@@ -34,7 +34,7 @@
 void set_default_image_overlay_template_string(ConfOptions *options);
 
 void image_osd_set(ImageWindow *imd, OsdShowFlags show);
-gint image_osd_get(ImageWindow *imd, OsdShowFlags *show);
+OsdShowFlags image_osd_get(ImageWindow *imd);
 
 void image_osd_update(ImageWindow *imd);
 
--- a/src/img-view.c	Sat May 10 13:54:25 2008 +0000
+++ b/src/img-view.c	Sat May 10 14:22:18 2008 +0000
@@ -695,11 +695,9 @@
 
 	if (vw->fs)
 		{
-		if (image_osd_get(vw->fs->imd, NULL))
-			{
-			image_osd_set(vw->imd, OSD_SHOW_INFO | OSD_SHOW_STATUS);
-			}
-
+		if (image_osd_get(vw->imd) & OSD_SHOW_INFO)
+			image_osd_set(vw->imd, image_osd_get(vw->fs->imd));
+		
 		fullscreen_stop(vw->fs);
 		}
 	else
@@ -712,10 +710,10 @@
 
 		if (vw->ss) vw->ss->imd = vw->fs->imd;
 
-		if (image_osd_get(vw->imd, NULL))
+		if (image_osd_get(vw->imd) & OSD_SHOW_INFO)
 			{
+			image_osd_set(vw->fs->imd, image_osd_get(vw->imd));
 			image_osd_set(vw->imd, OSD_SHOW_NOTHING);
-			image_osd_set(vw->fs->imd, OSD_SHOW_INFO | OSD_SHOW_STATUS);
 			}
 		}
 }
--- a/src/layout_image.c	Sat May 10 13:54:25 2008 +0000
+++ b/src/layout_image.c	Sat May 10 14:22:18 2008 +0000
@@ -358,9 +358,9 @@
 	if (lw->tools) gtk_widget_set_sensitive(lw->tools, FALSE);
 #endif
 
-	if (image_osd_get(lw->full_screen->normal_imd, NULL))
+	if (image_osd_get(lw->full_screen->normal_imd) & OSD_SHOW_INFO)
 		{
-		image_osd_set(lw->image, OSD_SHOW_INFO | OSD_SHOW_STATUS);
+		image_osd_set(lw->image, image_osd_get(lw->full_screen->normal_imd));
 		image_osd_set(lw->full_screen->normal_imd, OSD_SHOW_NOTHING);
 		}
 }
@@ -370,10 +370,9 @@
 	if (!layout_valid(&lw)) return;
 	if (!lw->full_screen) return;
 
-	if (image_osd_get(lw->image, NULL))
-		{
-		image_osd_set(lw->full_screen->normal_imd, OSD_SHOW_STATUS);
-		}
+	if (image_osd_get(lw->full_screen->normal_imd) & OSD_SHOW_INFO)
+		image_osd_set(lw->full_screen->normal_imd, image_osd_get(lw->image));
+
 	fullscreen_stop(lw->full_screen);
 
 #if 0
--- a/src/main.c	Sat May 10 13:54:25 2008 +0000
+++ b/src/main.c	Sat May 10 14:22:18 2008 +0000
@@ -1209,7 +1209,7 @@
 					    &options->layout.main_window.w, &options->layout.main_window.h);
 			}
 
-		image_osd_get(lw->image, &options->image_overlay.common.enabled);
+		options->image_overlay.common.enabled = image_osd_get(lw->image);
 		}
 
 	layout_geometry_get_dividers(NULL, &options->layout.main_window.hdivider_pos, &options->layout.main_window.vdivider_pos);