diff src/image-overlay.c @ 1665:9a081164e6e3

improved overlay menu - indicate overlay and histogram state in toggle and radio entries in the menu - all entries have visible effect in all modes
author nadvornik
date Sat, 27 Jun 2009 15:47:50 +0000
parents 24a12aa0cb54
children 6146ec0c9ab9
line wrap: on
line diff
--- a/src/image-overlay.c	Wed Jun 24 20:31:30 2009 +0000
+++ b/src/image-overlay.c	Sat Jun 27 15:47:50 2009 +0000
@@ -125,7 +125,7 @@
  */
 
 
-void image_osd_histogram_chan_toggle(ImageWindow *imd)
+void image_osd_histogram_toggle_channel(ImageWindow *imd)
 {
 	OverlayStateData *osd = image_get_osd_data(imd);
 
@@ -135,7 +135,7 @@
 	image_osd_update(imd);
 }
 
-void image_osd_histogram_log_toggle(ImageWindow *imd)
+void image_osd_histogram_toggle_mode(ImageWindow *imd)
 {
 	OverlayStateData *osd = image_get_osd_data(imd);
 
@@ -145,6 +145,44 @@
 	image_osd_update(imd);
 }
 
+void image_osd_histogram_set_channel(ImageWindow *imd, gint chan)
+{
+	OverlayStateData *osd = image_get_osd_data(imd);
+
+	if (!osd || !osd->histogram) return;
+
+	histogram_set_channel(osd->histogram, chan);
+	image_osd_update(imd);
+}
+
+void image_osd_histogram_set_mode(ImageWindow *imd, gint mode)
+{
+	OverlayStateData *osd = image_get_osd_data(imd);
+
+	if (!osd || !osd->histogram) return;
+
+	histogram_set_mode(osd->histogram, mode);
+	image_osd_update(imd);
+}
+
+gint image_osd_histogram_get_channel(ImageWindow *imd)
+{
+	OverlayStateData *osd = image_get_osd_data(imd);
+
+	if (!osd || !osd->histogram) return HCHAN_DEFAULT;
+
+	return histogram_get_channel(osd->histogram);
+}
+
+gint image_osd_histogram_get_mode(ImageWindow *imd)
+{
+	OverlayStateData *osd = image_get_osd_data(imd);
+
+	if (!osd || !osd->histogram) return 0;
+
+	return histogram_get_mode(osd->histogram);
+}
+
 void image_osd_toggle(ImageWindow *imd)
 {
 	OsdShowFlags show;