Mercurial > geeqie.yaz
annotate src/bar_histogram.c @ 1720:f7bb7b83a6ce
fixed pan-view popup menu
- removed wrong callback
- consider sidecar files in the editor popup
author | nadvornik |
---|---|
date | Mon, 21 Sep 2009 18:48:32 +0000 |
parents | 7f91f906f9c2 |
children |
rev | line source |
---|---|
1298 | 1 /* |
2 * Geeqie | |
3 * (C) 2004 John Ellis | |
4 * Copyright (C) 2008 - 2009 The Geeqie Team | |
5 * | |
6 * Author: Vladimir Nadvornik | |
7 * | |
8 * This software is released under the GNU General Public License (GNU GPL). | |
9 * Please read the included file COPYING for more information. | |
10 * This software comes with no warranty of any kind, use at your own risk! | |
11 */ | |
12 | |
13 | |
14 #include "main.h" | |
1339 | 15 #include "bar_histogram.h" |
1298 | 16 |
17 #include "bar.h" | |
18 #include "metadata.h" | |
19 #include "filedata.h" | |
1319
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
20 #include "menu.h" |
1298 | 21 #include "ui_menu.h" |
22 #include "ui_misc.h" | |
23 #include "histogram.h" | |
1309 | 24 #include "rcfile.h" |
1298 | 25 |
26 /* | |
27 *------------------------------------------------------------------- | |
28 * keyword / comment utils | |
29 *------------------------------------------------------------------- | |
30 */ | |
31 | |
32 | |
33 | |
34 typedef struct _PaneHistogramData PaneHistogramData; | |
35 struct _PaneHistogramData | |
36 { | |
37 PaneData pane; | |
38 GtkWidget *widget; | |
39 GtkWidget *drawing_area; | |
40 Histogram *histogram; | |
41 gint histogram_width; | |
42 gint histogram_height; | |
43 GdkPixbuf *pixbuf; | |
44 FileData *fd; | |
1331
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
45 gboolean need_update; |
1523 | 46 guint idle_id; /* event source id */ |
1298 | 47 }; |
48 | |
1331
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
49 static gboolean bar_pane_histogram_update_cb(gpointer data); |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
50 |
1298 | 51 |
52 static void bar_pane_histogram_update(PaneHistogramData *phd) | |
53 { | |
54 if (phd->pixbuf) g_object_unref(phd->pixbuf); | |
55 phd->pixbuf = NULL; | |
56 | |
1344 | 57 gtk_label_set_text(GTK_LABEL(phd->pane.title), histogram_label(phd->histogram)); |
58 | |
1298 | 59 if (!phd->histogram_width || !phd->histogram_height || !phd->fd) return; |
60 | |
1331
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
61 /* histmap_get is relatively expensive, run it only when we really need it |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
62 and with lower priority than pixbuf_renderer |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
63 FIXME: this does not work for fullscreen*/ |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
64 if (GTK_WIDGET_DRAWABLE(phd->drawing_area)) |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
65 { |
1523 | 66 if (!phd->idle_id) |
67 { | |
68 phd->idle_id = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, bar_pane_histogram_update_cb, phd, NULL); | |
69 } | |
1331
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
70 } |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
71 else |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
72 { |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
73 phd->need_update = TRUE; |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
74 } |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
75 } |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
76 |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
77 static gboolean bar_pane_histogram_update_cb(gpointer data) |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
78 { |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
79 const HistMap *histmap; |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
80 PaneHistogramData *phd = data; |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
81 |
1523 | 82 phd->idle_id = 0; |
1331
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
83 phd->need_update = FALSE; |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
84 |
1298 | 85 gtk_widget_queue_draw_area(GTK_WIDGET(phd->drawing_area), 0, 0, phd->histogram_width, phd->histogram_height); |
86 | |
1474 | 87 if (phd->fd == NULL) return FALSE; |
1298 | 88 histmap = histmap_get(phd->fd); |
89 | |
1439 | 90 if (!histmap) |
91 { | |
92 histmap_start_idle(phd->fd); | |
93 return FALSE; | |
94 } | |
1298 | 95 |
96 phd->pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, phd->histogram_width, phd->histogram_height); | |
97 gdk_pixbuf_fill(phd->pixbuf, 0xffffffff); | |
98 histogram_draw(phd->histogram, histmap, phd->pixbuf, 0, 0, phd->histogram_width, phd->histogram_height); | |
1330
8b6e2a47adc7
Add a tooltip showing current histogram state on bar histogram.
zas_
parents:
1329
diff
changeset
|
99 |
1331
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
100 return FALSE; |
1298 | 101 } |
102 | |
103 | |
104 static void bar_pane_histogram_set_fd(GtkWidget *pane, FileData *fd) | |
105 { | |
106 PaneHistogramData *phd; | |
107 | |
108 phd = g_object_get_data(G_OBJECT(pane), "pane_data"); | |
109 if (!phd) return; | |
110 | |
111 file_data_unref(phd->fd); | |
112 phd->fd = file_data_ref(fd); | |
113 | |
114 bar_pane_histogram_update(phd); | |
115 } | |
116 | |
1309 | 117 static void bar_pane_histogram_write_config(GtkWidget *pane, GString *outstr, gint indent) |
118 { | |
119 PaneHistogramData *phd; | |
120 | |
121 phd = g_object_get_data(G_OBJECT(pane), "pane_data"); | |
122 if (!phd) return; | |
123 | |
1461 | 124 WRITE_NL(); WRITE_STRING("<pane_histogram "); |
1469
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
125 write_char_option(outstr, indent, "id", phd->pane.id); |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
126 write_char_option(outstr, indent, "title", gtk_label_get_text(GTK_LABEL(phd->pane.title))); |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
127 WRITE_BOOL(phd->pane, expanded); |
1329
1fc356f629fe
Clean up histogram stuff: options saving/restoring, osd histogram separation, tidy up.
zas_
parents:
1324
diff
changeset
|
128 WRITE_INT(*phd->histogram, histogram_channel); |
1fc356f629fe
Clean up histogram stuff: options saving/restoring, osd histogram separation, tidy up.
zas_
parents:
1324
diff
changeset
|
129 WRITE_INT(*phd->histogram, histogram_mode); |
1461 | 130 WRITE_STRING("/>"); |
1309 | 131 } |
132 | |
1298 | 133 static void bar_pane_histogram_notify_cb(FileData *fd, NotifyType type, gpointer data) |
134 { | |
135 PaneHistogramData *phd = data; | |
1498 | 136 if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_HISTMAP | NOTIFY_PIXBUF)) && fd == phd->fd) |
137 { | |
138 DEBUG_1("Notify pane_histogram: %s %04x", fd->path, type); | |
139 bar_pane_histogram_update(phd); | |
140 } | |
1298 | 141 } |
142 | |
1346
c9949c19a6d0
No space between function name and first parenthesis, it eases greping (see CODING).
zas_
parents:
1344
diff
changeset
|
143 static gboolean bar_pane_histogram_expose_event_cb(GtkWidget *widget, GdkEventExpose *event, gpointer data) |
1298 | 144 { |
145 PaneHistogramData *phd = data; | |
1331
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
146 if (!phd) return TRUE; |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
147 |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
148 if (phd->need_update) |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
149 { |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
150 bar_pane_histogram_update(phd); |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
151 } |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
152 |
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
153 if (!phd->pixbuf) return TRUE; |
1298 | 154 |
155 gdk_draw_pixbuf(widget->window, | |
156 widget->style->fg_gc[GTK_WIDGET_STATE (widget)], | |
157 phd->pixbuf, | |
158 0, 0, | |
159 0, 0, | |
160 -1, -1, | |
161 GDK_RGB_DITHER_NORMAL, 0, 0); | |
162 return TRUE; | |
163 } | |
164 | |
165 static void bar_pane_histogram_size_cb(GtkWidget *widget, GtkAllocation *allocation, gpointer data) | |
166 { | |
167 PaneHistogramData *phd = data; | |
168 | |
169 phd->histogram_width = allocation->width; | |
170 phd->histogram_height = allocation->height; | |
171 bar_pane_histogram_update(phd); | |
172 } | |
173 | |
1712
7f91f906f9c2
Comment out unused functions, silenting related compilation warnings.
zas_
parents:
1523
diff
changeset
|
174 #if 0 |
1298 | 175 static void bar_pane_histogram_close(GtkWidget *pane) |
176 { | |
177 PaneHistogramData *phd; | |
178 | |
179 phd = g_object_get_data(G_OBJECT(pane), "pane_data"); | |
180 if (!phd) return; | |
181 | |
182 gtk_widget_destroy(phd->widget); | |
183 } | |
1712
7f91f906f9c2
Comment out unused functions, silenting related compilation warnings.
zas_
parents:
1523
diff
changeset
|
184 #endif |
1298 | 185 |
186 static void bar_pane_histogram_destroy(GtkWidget *widget, gpointer data) | |
187 { | |
188 PaneHistogramData *phd = data; | |
1331
a5c15bf32cdb
compute histmap in idle callback and only if the histogram is expanded
nadvornik
parents:
1330
diff
changeset
|
189 |
1523 | 190 if (phd->idle_id) g_source_remove(phd->idle_id); |
1298 | 191 file_data_unregister_notify_func(bar_pane_histogram_notify_cb, phd); |
192 | |
193 file_data_unref(phd->fd); | |
194 histogram_free(phd->histogram); | |
195 if (phd->pixbuf) g_object_unref(phd->pixbuf); | |
1469
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
196 g_free(phd->pane.id); |
1298 | 197 |
198 g_free(phd); | |
199 } | |
200 | |
1319
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
201 static void bar_pane_histogram_popup_channels_cb(GtkWidget *widget, gpointer data) |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
202 { |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
203 PaneHistogramData *phd; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
204 gint channel; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
205 |
1323
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
206 if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) return; |
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
207 |
1319
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
208 phd = submenu_item_get_data(widget); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
209 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
210 if (!phd) return; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
211 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
212 channel = GPOINTER_TO_INT(data); |
1323
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
213 if (channel == histogram_get_channel(phd->histogram)) return; |
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
214 |
1319
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
215 histogram_set_channel(phd->histogram, channel); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
216 bar_pane_histogram_update(phd); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
217 } |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
218 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
219 static void bar_pane_histogram_popup_logmode_cb(GtkWidget *widget, gpointer data) |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
220 { |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
221 PaneHistogramData *phd; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
222 gint logmode; |
1323
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
223 |
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
224 if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) return; |
1319
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
225 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
226 phd = submenu_item_get_data(widget); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
227 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
228 if (!phd) return; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
229 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
230 logmode = GPOINTER_TO_INT(data); |
1323
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
231 if (logmode == histogram_get_mode(phd->histogram)) return; |
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
232 |
1319
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
233 histogram_set_mode(phd->histogram, logmode); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
234 bar_pane_histogram_update(phd); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
235 } |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
236 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
237 static GtkWidget *bar_pane_histogram_add_radio(GtkWidget *menu, GtkWidget *parent, |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
238 const gchar *label, |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
239 GCallback func, gint value, |
1323
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
240 gboolean show_current, gint current_value) |
1319
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
241 { |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
242 GtkWidget *item; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
243 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
244 if (show_current) |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
245 { |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
246 item = menu_item_add_radio(menu, parent, |
1323
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
247 label, (value == current_value), |
1319
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
248 func, GINT_TO_POINTER((gint)value)); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
249 } |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
250 else |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
251 { |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
252 item = menu_item_add(menu, label, |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
253 func, GINT_TO_POINTER((gint)value)); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
254 } |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
255 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
256 return item; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
257 } |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
258 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
259 GtkWidget *bar_pane_histogram_add_channels(GtkWidget *menu, GCallback func, gpointer data, |
1323
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
260 gboolean show_current, gint current_value) |
1319
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
261 { |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
262 GtkWidget *submenu; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
263 GtkWidget *parent; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
264 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
265 submenu = gtk_menu_new(); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
266 g_object_set_data(G_OBJECT(submenu), "submenu_data", data); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
267 |
1323
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
268 parent = bar_pane_histogram_add_radio(submenu, NULL, _("_Red"), func, HCHAN_R, show_current, current_value); |
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
269 bar_pane_histogram_add_radio(submenu, parent, _("_Green"), func, HCHAN_G, show_current, current_value); |
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
270 bar_pane_histogram_add_radio(submenu, parent, _("_Blue"),func, HCHAN_B, show_current, current_value); |
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
271 bar_pane_histogram_add_radio(submenu, parent, _("_RGB"),func, HCHAN_RGB, show_current, current_value); |
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
272 bar_pane_histogram_add_radio(submenu, parent, _("_Value"),func, HCHAN_MAX, show_current, current_value); |
1319
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
273 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
274 if (menu) |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
275 { |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
276 GtkWidget *item; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
277 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
278 item = menu_item_add(menu, _("Channels"), NULL, NULL); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
279 gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
280 return item; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
281 } |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
282 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
283 return submenu; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
284 } |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
285 GtkWidget *bar_pane_histogram_add_logmode(GtkWidget *menu, GCallback func, gpointer data, |
1323
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
286 gboolean show_current, gint current_value) |
1319
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
287 { |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
288 GtkWidget *submenu; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
289 GtkWidget *parent; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
290 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
291 submenu = gtk_menu_new(); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
292 g_object_set_data(G_OBJECT(submenu), "submenu_data", data); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
293 |
1323
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
294 parent = bar_pane_histogram_add_radio(submenu, NULL, _("_Linear"), func, 0, show_current, current_value); |
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
295 bar_pane_histogram_add_radio(submenu, parent, _("Lo_garithmical"), func, 1, show_current, current_value); |
1319
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
296 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
297 if (menu) |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
298 { |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
299 GtkWidget *item; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
300 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
301 item = menu_item_add(menu, _("Mode"), NULL, NULL); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
302 gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
303 return item; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
304 } |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
305 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
306 return submenu; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
307 } |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
308 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
309 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
310 static GtkWidget *bar_pane_histogram_menu(PaneHistogramData *phd) |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
311 { |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
312 GtkWidget *menu; |
1323
50ab4016ae0b
Fix up bar pane histogram contextual menu: show current state for channel and log mode.
zas_
parents:
1319
diff
changeset
|
313 static gboolean show_current = TRUE; |
1319
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
314 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
315 menu = popup_menu_short_lived(); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
316 bar_pane_histogram_add_channels(menu, G_CALLBACK(bar_pane_histogram_popup_channels_cb), phd, |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
317 show_current, histogram_get_channel(phd->histogram)); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
318 bar_pane_histogram_add_logmode(menu, G_CALLBACK(bar_pane_histogram_popup_logmode_cb), phd, |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
319 show_current, histogram_get_mode(phd->histogram)); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
320 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
321 return menu; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
322 } |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
323 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
324 static gboolean bar_pane_histogram_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
325 { |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
326 PaneHistogramData *phd = data; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
327 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
328 if (bevent->button == MOUSE_BUTTON_RIGHT) |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
329 { |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
330 GtkWidget *menu; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
331 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
332 menu = bar_pane_histogram_menu(phd); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
333 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, bevent->button, bevent->time); |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
334 return TRUE; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
335 } |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
336 |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
337 return FALSE; |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
338 } |
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
339 |
1298 | 340 |
1485 | 341 static GtkWidget *bar_pane_histogram_new(const gchar *id, const gchar *title, gint height, gboolean expanded, gint histogram_channel, gint histogram_mode) |
1298 | 342 { |
343 PaneHistogramData *phd; | |
344 | |
345 phd = g_new0(PaneHistogramData, 1); | |
346 | |
347 phd->pane.pane_set_fd = bar_pane_histogram_set_fd; | |
1309 | 348 phd->pane.pane_write_config = bar_pane_histogram_write_config; |
1389
c44f21235ffe
Use a common function bar_pane_expander_title() to set expanders title widget.
zas_
parents:
1387
diff
changeset
|
349 phd->pane.title = bar_pane_expander_title(title); |
1469
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
350 phd->pane.id = g_strdup(id); |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
351 phd->pane.type = PANE_HISTOGRAM; |
1387 | 352 |
1309 | 353 phd->pane.expanded = expanded; |
1298 | 354 |
355 phd->histogram = histogram_new(); | |
1319
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
356 |
1324 | 357 histogram_set_channel(phd->histogram, histogram_channel); |
1329
1fc356f629fe
Clean up histogram stuff: options saving/restoring, osd histogram separation, tidy up.
zas_
parents:
1324
diff
changeset
|
358 histogram_set_mode(phd->histogram, histogram_mode); |
1319
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
359 |
1298 | 360 phd->widget = gtk_vbox_new(FALSE, PREF_PAD_GAP); |
361 | |
362 g_object_set_data(G_OBJECT(phd->widget), "pane_data", phd); | |
363 g_signal_connect(G_OBJECT(phd->widget), "destroy", | |
364 G_CALLBACK(bar_pane_histogram_destroy), phd); | |
365 | |
366 | |
367 gtk_widget_set_size_request(GTK_WIDGET(phd->widget), -1, height); | |
368 | |
369 phd->drawing_area = gtk_drawing_area_new(); | |
370 g_signal_connect_after(G_OBJECT(phd->drawing_area), "size_allocate", | |
371 G_CALLBACK(bar_pane_histogram_size_cb), phd); | |
372 | |
373 g_signal_connect(G_OBJECT(phd->drawing_area), "expose_event", | |
374 G_CALLBACK(bar_pane_histogram_expose_event_cb), phd); | |
375 | |
376 gtk_box_pack_start(GTK_BOX(phd->widget), phd->drawing_area, TRUE, TRUE, 0); | |
377 gtk_widget_show(phd->drawing_area); | |
1319
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
378 gtk_widget_add_events(phd->drawing_area, GDK_BUTTON_PRESS_MASK); |
1298 | 379 |
1319
358685fb9dc9
Add a contextual menu on bar pane histogram allowing to change channels and mode. More work needed.
zas_
parents:
1315
diff
changeset
|
380 g_signal_connect(G_OBJECT(phd->drawing_area), "button_press_event", G_CALLBACK(bar_pane_histogram_press_cb), phd); |
1298 | 381 |
382 gtk_widget_show(phd->widget); | |
383 | |
384 file_data_register_notify_func(bar_pane_histogram_notify_cb, phd, NOTIFY_PRIORITY_LOW); | |
385 | |
386 return phd->widget; | |
387 } | |
388 | |
1309 | 389 GtkWidget *bar_pane_histogram_new_from_config(const gchar **attribute_names, const gchar **attribute_values) |
390 { | |
1471 | 391 gchar *title = NULL; |
1469
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
392 gchar *id = g_strdup("histogram"); |
1309 | 393 gboolean expanded = TRUE; |
394 gint height = 80; | |
1324 | 395 gint histogram_channel = HCHAN_RGB; |
1329
1fc356f629fe
Clean up histogram stuff: options saving/restoring, osd histogram separation, tidy up.
zas_
parents:
1324
diff
changeset
|
396 gint histogram_mode = 0; |
1469
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
397 GtkWidget *ret; |
1309 | 398 |
399 while (*attribute_names) | |
400 { | |
401 const gchar *option = *attribute_names++; | |
402 const gchar *value = *attribute_values++; | |
403 | |
1469
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
404 if (READ_CHAR_FULL("id", id)) continue; |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
405 if (READ_CHAR_FULL("title", title)) continue; |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
406 if (READ_BOOL_FULL("expanded", expanded)) continue; |
1324 | 407 if (READ_INT_FULL("histogram_channel", histogram_channel)) continue; |
1329
1fc356f629fe
Clean up histogram stuff: options saving/restoring, osd histogram separation, tidy up.
zas_
parents:
1324
diff
changeset
|
408 if (READ_INT_FULL("histogram_mode", histogram_mode)) continue; |
1324 | 409 |
1464 | 410 log_printf("unknown attribute %s = %s\n", option, value); |
1309 | 411 } |
412 | |
1471 | 413 bar_pane_translate_title(PANE_HISTOGRAM, id, &title); |
1469
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
414 ret = bar_pane_histogram_new(id, title, height, expanded, histogram_channel, histogram_mode); |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
415 g_free(title); |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
416 g_free(id); |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
417 return ret; |
1309 | 418 } |
419 | |
1469
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
420 void bar_pane_histogram_update_from_config(GtkWidget *pane, const gchar **attribute_names, const gchar **attribute_values) |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
421 { |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
422 PaneHistogramData *phd; |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
423 |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
424 phd = g_object_get_data(G_OBJECT(pane), "pane_data"); |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
425 if (!phd) return; |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
426 |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
427 gint histogram_channel = phd->histogram->histogram_channel; |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
428 gint histogram_mode = phd->histogram->histogram_mode; |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
429 |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
430 while (*attribute_names) |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
431 { |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
432 const gchar *option = *attribute_names++; |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
433 const gchar *value = *attribute_values++; |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
434 |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
435 if (READ_CHAR_FULL("id", phd->pane.id)) continue; |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
436 // if (READ_CHAR_FULL("pane.title", title)) continue; |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
437 if (READ_BOOL_FULL("expanded", phd->pane.expanded)) continue; |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
438 if (READ_INT_FULL("histogram_channel", histogram_channel)) continue; |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
439 if (READ_INT_FULL("histogram_mode", histogram_mode)) continue; |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
440 |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
441 |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
442 log_printf("unknown attribute %s = %s\n", option, value); |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
443 } |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
444 |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
445 histogram_set_channel(phd->histogram, histogram_channel); |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
446 histogram_set_mode(phd->histogram, histogram_mode); |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
447 |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
448 bar_update_expander(pane); |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
449 bar_pane_histogram_update(phd); |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
450 } |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
451 |
607c60506863
added a possibility to update existing bars from config
nadvornik
parents:
1464
diff
changeset
|
452 |
1298 | 453 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |