Silent a warning.
[geeqie.git] / src / image-overlay.c
index c401c83..773d5a0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Geeqie
  * (C) 2006 John Ellis
- * Copyright (C) 2008 - 2009 The Geeqie Team
+ * Copyright (C) 2008 - 2012 The Geeqie Team
  *
  * Author: John Ellis
  *
@@ -125,7 +125,7 @@ static void image_set_osd_data(ImageWindow *imd, OverlayStateData *osd)
  */
 
 
-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 @@ void image_osd_histogram_chan_toggle(ImageWindow *imd)
        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 @@ void image_osd_histogram_log_toggle(ImageWindow *imd)
        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;
@@ -283,7 +321,6 @@ static gchar *image_osd_mkinfo(const gchar *str, ImageWindow *imd, GHashTable *v
                else
                        {
                        data = g_strdup(g_hash_table_lookup(vars, name));
-                       if (data && strcmp(name, "zoom") == 0) imd->overlay_show_zoom = TRUE;
                        if (!data)
                                data = metadata_read_string(imd->image_fd, name, METADATA_FORMATTED);
                        }
@@ -440,9 +477,8 @@ static GdkPixbuf *image_osd_info_render(OverlayStateData *osd)
        PangoLayout *layout;
        const gchar *name;
        gchar *text;
-       GdkPixbuf *imgpixbuf = NULL;
        gboolean with_hist;
-       const HistMap *histmap;
+       const HistMap *histmap = NULL;
        ImageWindow *imd = osd->imd;
        FileData *fd = image_get_fd(imd);
 
@@ -526,12 +562,10 @@ static GdkPixbuf *image_osd_info_render(OverlayStateData *osd)
                                {
                                w = gdk_pixbuf_get_width(load_pixbuf);
                                h = gdk_pixbuf_get_height(load_pixbuf);
-                               imgpixbuf = load_pixbuf;
                                }
                        else
                                {
                                image_get_image_size(imd, &w, &h);
-                               imgpixbuf = (PIXBUF_RENDERER(imd->pr))->pixbuf;
                                }
                
                        
@@ -827,8 +861,6 @@ static gboolean image_osd_update_cb(gpointer data)
 {
        OverlayStateData *osd = data;
 
-       osd->imd->overlay_show_zoom = FALSE;
-
        if (osd->show & OSD_SHOW_INFO)
                {
                /* redraw when the image was changed, 
@@ -1002,12 +1034,14 @@ static void image_osd_free(OverlayStateData *osd)
        g_free(osd);
 }
 
+#if 0
 static void image_osd_remove(ImageWindow *imd)
 {
        OverlayStateData *osd = image_get_osd_data(imd);
 
        if (osd) image_osd_free(osd);
 }
+#endif
 
 static void image_osd_destroy_cb(GtkWidget *widget, gpointer data)
 {