comparison src/bar_histogram.c @ 1439:2441a90c4bcf

compute histogram in idle time
author nadvornik
date Sun, 15 Mar 2009 11:34:09 +0000
parents c520cfd40aef
children e015b6573d36
comparison
equal deleted inserted replaced
1438:9141908e0609 1439:2441a90c4bcf
81 81
82 gtk_widget_queue_draw_area(GTK_WIDGET(phd->drawing_area), 0, 0, phd->histogram_width, phd->histogram_height); 82 gtk_widget_queue_draw_area(GTK_WIDGET(phd->drawing_area), 0, 0, phd->histogram_width, phd->histogram_height);
83 83
84 histmap = histmap_get(phd->fd); 84 histmap = histmap_get(phd->fd);
85 85
86 if (!histmap) return FALSE; 86 if (!histmap)
87 {
88 histmap_start_idle(phd->fd);
89 return FALSE;
90 }
87 91
88 phd->pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, phd->histogram_width, phd->histogram_height); 92 phd->pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, phd->histogram_width, phd->histogram_height);
89 gdk_pixbuf_fill(phd->pixbuf, 0xffffffff); 93 gdk_pixbuf_fill(phd->pixbuf, 0xffffffff);
90 histogram_draw(phd->histogram, histmap, phd->pixbuf, 0, 0, phd->histogram_width, phd->histogram_height); 94 histogram_draw(phd->histogram, histmap, phd->pixbuf, 0, 0, phd->histogram_width, phd->histogram_height);
91 95
124 } 128 }
125 129
126 static void bar_pane_histogram_notify_cb(FileData *fd, NotifyType type, gpointer data) 130 static void bar_pane_histogram_notify_cb(FileData *fd, NotifyType type, gpointer data)
127 { 131 {
128 PaneHistogramData *phd = data; 132 PaneHistogramData *phd = data;
129 if (fd == phd->fd) bar_pane_histogram_update(phd); 133 if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_HISTMAP | NOTIFY_PIXBUF)) && fd == phd->fd) bar_pane_histogram_update(phd);
130 } 134 }
131 135
132 static gboolean bar_pane_histogram_expose_event_cb(GtkWidget *widget, GdkEventExpose *event, gpointer data) 136 static gboolean bar_pane_histogram_expose_event_cb(GtkWidget *widget, GdkEventExpose *event, gpointer data)
133 { 137 {
134 PaneHistogramData *phd = data; 138 PaneHistogramData *phd = data;