1 /* surfadd_dialog.c - dialog for surface addition
2  *
3  * Copyright (C) 2001 Patrice St-Gelais
4  *         patrstg@users.sourceforge.net
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19  */
20 
21 #include "hf_wrapper.h"
22 #include "dialog_utilities.h"
23 // #include "hf_filters_dialog.h"
24 
change_surfadd_seed(GtkWidget * entry,gpointer data)25 static gint change_surfadd_seed(GtkWidget *entry, gpointer data) {
26 	hf_wrapper_struct *hfw;
27 	hfw = (hf_wrapper_struct *) * (hf_wrapper_struct **) data;
28 	if ( ! strlen( gtk_entry_get_text(GTK_ENTRY(entry))) )
29 		return FALSE;
30 	if (hfw->hf_options->surfadd_options->seed ==
31 		(unsigned int) atoi((char *)gtk_entry_get_text(GTK_ENTRY(entry))))
32 		return FALSE;
33 	hfw->hf_options->surfadd_options->seed =
34 		(unsigned int) atoi((char *)gtk_entry_get_text(GTK_ENTRY(entry)));
35 // printf("hfw->hf_options->surfadd_options->seed: %d\n",hfw->hf_options->surfadd_options->seed);
36 	gener_hf(hfw);
37 	return FALSE;
38 }
39 
xy_scale_upd(GtkWidget * wdg,gpointer data)40 static void xy_scale_upd(GtkWidget *wdg,gpointer data) {
41 	hf_wrapper_struct *hfw;
42 	hfw = (hf_wrapper_struct *) * (hf_wrapper_struct **) data;
43 	hfw->hf_options->surfadd_options->xy_random_range =
44 			(gint) GTK_ADJUSTMENT(wdg)->value;
45 }
46 
h_scale_upd(GtkWidget * wdg,gpointer data)47 static void h_scale_upd(GtkWidget *wdg,gpointer data) {
48 	hf_wrapper_struct *hfw;
49 	hfw = (hf_wrapper_struct *) * (hf_wrapper_struct **) data;
50 	hfw->hf_options->surfadd_options->h_random_range =
51 			(gint) GTK_ADJUSTMENT(wdg)->value;
52 }
53 
slope_upd(GtkWidget * wdg,gpointer data)54 static void slope_upd(GtkWidget *wdg,gpointer data) {
55 	hf_wrapper_struct *hfw;
56 	hfw = (hf_wrapper_struct *) * (hf_wrapper_struct **) data;
57 	hfw->hf_options->surfadd_options->slope =
58 			(gint) GTK_ADJUSTMENT(wdg)->value;
59 }
60 
density_upd(GtkWidget * wdg,gpointer data)61 static void density_upd(GtkWidget *wdg,gpointer data) {
62 	hf_wrapper_struct *hfw;
63 	hfw = (hf_wrapper_struct *) * (hf_wrapper_struct **) data;
64 	hfw->hf_options->surfadd_options->density =
65 			(gint) GTK_ADJUSTMENT(wdg)->value;
66 }
67 
compute_hf_callb(GtkWidget * wdg,GdkEventButton * event,gpointer data)68 static gint compute_hf_callb(GtkWidget *wdg,GdkEventButton *event, gpointer data) {
69 	hf_wrapper_struct *hfw;
70 	hfw = (hf_wrapper_struct *) * (hf_wrapper_struct **) data;
71 	gener_hf(hfw);
72 	return FALSE;
73 }
74 
percent_upd(GtkWidget * wdg,gpointer data)75 static void percent_upd(GtkWidget *wdg, gpointer data) {
76 	gint *percent;
77 	percent = (gint *) data;
78 	(*percent) = (gint) GTK_ADJUSTMENT(wdg)->value;
79 }
80 
set_freq_global(GtkWidget * button,gpointer data)81 static void set_freq_global(GtkWidget *button, gpointer data) {
82 	gint i, value;
83 	gchar *txt;
84 	hf_wrapper_struct *hfw;
85 	hfw = (hf_wrapper_struct *) * (hf_wrapper_struct **) data;
86 	gtk_label_get(GTK_LABEL(GTK_BIN(button)->child), &txt);
87 	value = atoi(txt);
88 	for (i=0; i<12; i++) {
89 		hfw->hf_options->surfadd_options->frq_percent[i] = value;
90 		gtk_adjustment_set_value(
91 			GTK_ADJUSTMENT(hfw->hf_options->freq_control_adj[i]), value);
92 	}
93 	gener_hf(hfw);
94 }
95 
surfadd_frq_dialog_new(gpointer hfo_ptr)96 static GtkWidget * surfadd_frq_dialog_new (gpointer hfo_ptr) {
97 //	Fine frequency control dialog
98 	GtkWidget *table, *vbox, *hbox, *button, *scale;
99 	GtkObject *adj;
100 	hf_options_struct *hf_options = (hf_options_struct *) hfo_ptr;
101 	if (!hfo_ptr)
102 		return gtk_label_new(_("No frequency control"));
103 	gpointer data = hf_options->hfw_ptr_ptr;
104 
105 	table = gtk_table_new(6, 4, FALSE);
106 	gtk_widget_show(table);
107 
108 	define_label_in_table("4096",table, 0, 1, 0, 1, 0);
109  	define_label_in_table("2048",table, 0, 1, 1, 2, 0);
110 	define_label_in_table("1024",table, 0, 1, 2, 3, 0);
111  	define_label_in_table(" 512",table, 0, 1, 3, 4, 0);
112 	define_label_in_table(" 256",table, 0, 1, 4, 5, 0);
113  	define_label_in_table(" 128",table, 0, 1, 5, 6, 0);
114  	define_label_in_table(" 64",table, 2, 3, 0, 1, 0);
115  	define_label_in_table(" 32",table, 2, 3, 1, 2, 0);
116 	define_label_in_table(" 16",table, 2, 3, 2, 3, 0);
117  	define_label_in_table("  8",table, 2, 3, 3, 4, 0);
118 	define_label_in_table("  4",table, 2, 3, 4, 5, 0);
119  	define_label_in_table("  2",table, 2, 3, 5, 6, 0);
120 // 4096
121 	adj= gtk_adjustment_new
122 		(hf_options->surfadd_options->frq_percent[11], 0, 100, 1, 1, 0.01);
123 	scale = define_scale_in_table(adj,table,1,2,0,1,0,DEF_PAD*0);
124 	// gl_preview_optimize (scale, data);
125 	gtk_signal_connect (GTK_OBJECT (adj ), "value_changed",
126 		GTK_SIGNAL_FUNC (percent_upd),
127 			&hf_options->surfadd_options->frq_percent[11]);
128 	g_signal_connect (G_OBJECT (scale), "button_release_event", GTK_SIGNAL_FUNC (compute_hf_callb), data);
129 	hf_options->freq_control_adj[11] =adj;
130 
131 // 2048
132 	adj = gtk_adjustment_new
133 		(hf_options->surfadd_options->frq_percent[10], 0, 100, 1, 1, 0.01);
134 	scale = define_scale_in_table(adj,table,1,2,1,2,0,DEF_PAD*0);
135 	// gl_preview_optimize (scale, data);
136 	gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
137 		GTK_SIGNAL_FUNC (percent_upd),
138 			&hf_options->surfadd_options->frq_percent[10]);
139 	g_signal_connect (G_OBJECT (scale), "button_release_event", GTK_SIGNAL_FUNC (compute_hf_callb), data);
140 	hf_options->freq_control_adj[10]  = adj;
141 // 1024
142 	adj = gtk_adjustment_new
143 		(hf_options->surfadd_options->frq_percent[9], 0, 100, 1, 1, 0.01);
144 	scale = define_scale_in_table(adj,table,1,2,2,3,0,DEF_PAD*0);
145 	// gl_preview_optimize (scale, data);
146 	gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
147 		GTK_SIGNAL_FUNC (percent_upd),
148 			&hf_options->surfadd_options->frq_percent[9]);
149 	g_signal_connect (G_OBJECT (scale), "button_release_event", GTK_SIGNAL_FUNC (compute_hf_callb), data);
150 	hf_options->freq_control_adj[9]  = adj;
151 
152 // 512
153 	adj = gtk_adjustment_new
154 		(hf_options->surfadd_options->frq_percent[8], 0, 100, 1, 1, 0.01);
155 	scale = define_scale_in_table(adj,table,1,2,3,4,0,DEF_PAD*0);
156 	// gl_preview_optimize (scale, data);
157 	gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
158 		GTK_SIGNAL_FUNC (percent_upd),
159 			&hf_options->surfadd_options->frq_percent[8]);
160 	g_signal_connect (G_OBJECT (scale), "button_release_event", GTK_SIGNAL_FUNC (compute_hf_callb), data);
161 	hf_options->freq_control_adj[8] =adj;
162 // 256
163 	adj = gtk_adjustment_new
164 		(hf_options->surfadd_options->frq_percent[7], 0, 100, 1, 1, 0.01);
165 	scale = define_scale_in_table(adj,table,1,2,4,5,0,DEF_PAD*0);
166 	// gl_preview_optimize (scale, data);
167 	gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
168 		GTK_SIGNAL_FUNC (percent_upd),
169 			&hf_options->surfadd_options->frq_percent[7]);
170 	g_signal_connect (G_OBJECT (scale), "button_release_event", GTK_SIGNAL_FUNC (compute_hf_callb), data);
171 	hf_options->freq_control_adj[7] =adj;
172 // 128
173 	adj = gtk_adjustment_new
174 		(hf_options->surfadd_options->frq_percent[6], 0, 100, 1, 1, 0.01);
175 	scale = define_scale_in_table(adj,table,1,2,5,6,0,DEF_PAD*0);
176 	// gl_preview_optimize (scale, data);
177 	gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
178 		GTK_SIGNAL_FUNC (percent_upd),
179 			&hf_options->surfadd_options->frq_percent[6]);
180 	g_signal_connect (G_OBJECT (scale), "button_release_event", GTK_SIGNAL_FUNC (compute_hf_callb), data);
181 	hf_options->freq_control_adj[6]  =adj;
182 
183 // 64
184 	adj = gtk_adjustment_new
185 		(hf_options->surfadd_options->frq_percent[5], 0, 100, 1, 1, 0.01);
186 	scale = define_scale_in_table(adj,table,3,4,0,1,0,DEF_PAD*0);
187 	// gl_preview_optimize (scale, data);
188 	gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
189 		GTK_SIGNAL_FUNC (percent_upd),
190 			&hf_options->surfadd_options->frq_percent[5]);
191 	g_signal_connect (G_OBJECT (scale), "button_release_event", GTK_SIGNAL_FUNC (compute_hf_callb), data);
192 	hf_options->freq_control_adj[5] =adj;
193 // 32
194 	adj = gtk_adjustment_new
195 		(hf_options->surfadd_options->frq_percent[4], 0, 100, 1, 1, 0.01);
196 	scale = define_scale_in_table(adj,table,3,4,1,2,0,DEF_PAD*0);
197 	// gl_preview_optimize (scale, data);
198 	gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
199 		GTK_SIGNAL_FUNC (percent_upd),
200 			&hf_options->surfadd_options->frq_percent[4]);
201 	g_signal_connect (G_OBJECT (scale), "button_release_event", GTK_SIGNAL_FUNC (compute_hf_callb), data);
202 	hf_options->freq_control_adj[4] =adj;
203 // 16
204 	adj = gtk_adjustment_new
205 		(hf_options->surfadd_options->frq_percent[3], 0, 100, 1, 1, 0.01);
206 	scale = define_scale_in_table(adj,table,3,4,2,3,0,DEF_PAD*0);
207 	// gl_preview_optimize (scale, data);
208 	gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
209 		GTK_SIGNAL_FUNC (percent_upd),
210 			&hf_options->surfadd_options->frq_percent[3]);
211 	g_signal_connect (G_OBJECT (scale), "button_release_event", GTK_SIGNAL_FUNC (compute_hf_callb), data);
212 	hf_options->freq_control_adj[3] =adj;
213 
214 // 8
215 	adj = gtk_adjustment_new
216 		(hf_options->surfadd_options->frq_percent[2], 0, 100, 1, 1, 0.01);
217 	scale = define_scale_in_table(adj,table,3,4,3,4,0,DEF_PAD*0);
218 	// gl_preview_optimize (scale, data);
219 	gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
220 		GTK_SIGNAL_FUNC (percent_upd),
221 			&hf_options->surfadd_options->frq_percent[2]);
222 	g_signal_connect (G_OBJECT (scale), "button_release_event", GTK_SIGNAL_FUNC (compute_hf_callb), data);
223 	hf_options->freq_control_adj[2] = adj;
224 // 4
225 	adj = gtk_adjustment_new
226 		(hf_options->surfadd_options->frq_percent[1], 0, 100, 1, 1, 0.01);
227 	scale = define_scale_in_table(adj,table,3,4,4,5,0,DEF_PAD*0);
228 	// gl_preview_optimize (scale, data);
229 	gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
230 		GTK_SIGNAL_FUNC (percent_upd),
231 			&hf_options->surfadd_options->frq_percent[1]);
232 	g_signal_connect (G_OBJECT (scale), "button_release_event", GTK_SIGNAL_FUNC (compute_hf_callb), data);
233 	hf_options->freq_control_adj[1] =adj;
234 // 2
235 	adj = gtk_adjustment_new
236 		(hf_options->surfadd_options->frq_percent[0], 0, 100, 1, 1, 0.01);
237 	scale = define_scale_in_table(adj,table,3,4,5,6,0,DEF_PAD*0);
238 	// gl_preview_optimize (scale, data);
239 	gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
240 		GTK_SIGNAL_FUNC (percent_upd),
241 			&hf_options->surfadd_options->frq_percent[0]);
242 	g_signal_connect (G_OBJECT (scale), "button_release_event", GTK_SIGNAL_FUNC (compute_hf_callb), data);
243 	hf_options->freq_control_adj[0]  = adj;
244 
245 //	Adding fast reset buttons
246 	vbox = gtk_vbox_new(FALSE,0);
247 	gtk_widget_show(vbox);
248 
249 	button = gtk_button_new_with_label ("0");
250 	gtk_signal_connect (GTK_OBJECT (button), "clicked",
251 	       (GtkSignalFunc) set_freq_global, data);
252 	gtk_widget_show(button);
253   	gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
254 	button = gtk_button_new_with_label ("25");
255 	gtk_signal_connect (GTK_OBJECT (button), "clicked",
256 	       (GtkSignalFunc) set_freq_global, data);
257 	gtk_widget_show(button);
258   	gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
259 	button = gtk_button_new_with_label ("50");
260 	gtk_signal_connect (GTK_OBJECT (button), "clicked",
261 	       (GtkSignalFunc) set_freq_global, data);
262 	gtk_widget_show(button);
263   	gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
264 	button = gtk_button_new_with_label ("75");
265 	gtk_signal_connect (GTK_OBJECT (button), "clicked",
266 	       (GtkSignalFunc) set_freq_global, data);
267 	gtk_widget_show(button);
268   	gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
269 	button = gtk_button_new_with_label ("100");
270 	gtk_signal_connect (GTK_OBJECT (button), "clicked",
271 	       (GtkSignalFunc) set_freq_global, data);
272 	gtk_widget_show(button);
273   	gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
274 
275 	hbox = gtk_hbox_new(FALSE,0);
276 
277 //	The default is to hide this dialog at the beginning, because it takes room
278 //	gtk_widget_show(hbox);
279 
280 	gtk_box_pack_start(GTK_BOX(hbox), align_widget(vbox,0.5,0.5), FALSE,FALSE, DEF_PAD*0.5);
281 
282 	gtk_box_pack_start(GTK_BOX(hbox), table, FALSE,FALSE, 0);
283 
284 	return define_frame_with_hiding_arrows("Wave length control", hbox, hf_options->tools_window, FALSE);
285 }
286 
surfadd_dialog_new(gpointer hfo_ptr)287 GtkWidget * surfadd_dialog_new(gpointer hfo_ptr) {
288 
289 	GtkObject *adj;
290 	GtkWidget *button, *table, *hbox, *vbox, *scale, *scrolled_window;
291 	GtkWidget *frame;
292 	static gboolean dummy_flag;
293 
294 	gpointer data;
295 	hf_options_struct *hfo = (hf_options_struct *) hfo_ptr;
296 
297 	if (!hfo)
298 		return gtk_label_new(_("No surface addition dialog"));
299 
300 	data = hfo->hfw_ptr_ptr;
301 
302 //	Main dialog box
303 	vbox = gtk_vbox_new(FALSE,0);
304 	gtk_widget_show(GTK_WIDGET(vbox));
305 
306 //	2008-02 Now with scrolled window
307 	scrolled_window = gtk_scrolled_window_new (NULL, NULL);
308         gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
309 	gtk_widget_show (scrolled_window);
310 	gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW(scrolled_window), vbox);
311 
312 	gtk_widget_set_size_request (scrolled_window, -1, gdk_screen_get_height(gdk_screen_get_default())/3);
313 
314 //	Seed
315 
316 	gtk_box_pack_start_defaults(GTK_BOX(vbox),
317 		seed_dialog_new(data, hfo->surfadd_options->seed,
318 		change_surfadd_seed));
319 
320 	table = gtk_table_new(4, 2, FALSE);
321 	gtk_widget_show(table);
322 
323 //	Slope / roughness (kind of)
324 //	From 0 to 100%
325 //	100: we keep the same H for each step, even if the surfaces to add are smaller
326 //	50:  we divide the H by 2 for each step (default), because  the surfaces are divided by two
327 //	100:  we divide the H by 3 for each step.
328 
329 	define_label_in_table("Slope",table, 0, 1, 0, 1, 0);
330 
331 	adj = gtk_adjustment_new (hfo->surfadd_options->slope, 0, 100, 1, 1, 0.01);
332 
333 	scale = define_scale_in_table(adj,table,1,2,0,1,0,DEF_PAD*0.5);
334 	g_signal_connect (G_OBJECT (adj), "value_changed",
335 		GTK_SIGNAL_FUNC (slope_upd), data);
336 	g_signal_connect (G_OBJECT (scale), "button_release_event", GTK_SIGNAL_FUNC (compute_hf_callb), data);
337 
338 //	Random x-y displacement scale
339 //	From 0 to 100 % (100 % = twice the size of the current surface to add)
340 
341 	define_label_in_table("XZ Displacement ",table, 0, 1, 1, 2, 0);
342 
343 	adj = gtk_adjustment_new
344 		(hfo->surfadd_options->xy_random_range, 0, 100, 1, 1, 0.01);
345 	scale = define_scale_in_table(adj,table,1,2,1,2,0,DEF_PAD*0.5);
346 	g_signal_connect (G_OBJECT (adj), "value_changed",
347 		GTK_SIGNAL_FUNC (xy_scale_upd), data);
348 	g_signal_connect (G_OBJECT (scale), "button_release_event", GTK_SIGNAL_FUNC (compute_hf_callb), data);
349 
350 //	Random height displacement scale
351 //	From 0 to 100 % (100 % = twice the height of the current surface to add)
352 
353 	define_label_in_table("H Displacement ",table, 0, 1, 2, 3, 0);
354 	adj = gtk_adjustment_new
355 		(hfo->surfadd_options->h_random_range, 0, 100, 1, 1, 0.01);
356 	scale = define_scale_in_table(adj,table,1,2,2,3,0,DEF_PAD*0.5);
357 	g_signal_connect (G_OBJECT (adj), "value_changed",
358 		GTK_SIGNAL_FUNC (h_scale_upd), data);
359 	g_signal_connect (G_OBJECT (scale), "button_release_event", GTK_SIGNAL_FUNC (compute_hf_callb), data);
360 
361 //	Lateral density variation
362 //	From 0 to 100 % (100 % = twice the default density)
363 
364 	define_label_in_table("Density",table, 0, 1, 3, 4, 0);
365 	adj = gtk_adjustment_new
366 		(hfo->surfadd_options->density, 0, 100, 1, 1, 0.01);
367 	scale = define_scale_in_table(adj,table,1,2,3,4,0,DEF_PAD*0.5);
368 	g_signal_connect (G_OBJECT (adj), "value_changed",
369 		GTK_SIGNAL_FUNC (density_upd), data);
370 	g_signal_connect (G_OBJECT (scale), "button_release_event", GTK_SIGNAL_FUNC (compute_hf_callb), data);
371 
372 	hbox = gtk_hbox_new(FALSE,0);
373 	gtk_widget_show(hbox);
374 
375 	gtk_box_pack_start_defaults(GTK_BOX(hbox), table);
376 
377 	gtk_box_pack_start_defaults(GTK_BOX(vbox), hbox);
378 
379 //	Filters for the primitive surface and preview
380 	frame = frame_new("Primitive surface", DEF_PAD*0.5);
381 	gtk_container_add(GTK_CONTAINER(vbox), frame);
382 
383 //	HBOX will contain the shape filter dialog and the preview
384 	hbox = gtk_hbox_new(FALSE,0);
385 	gtk_widget_show(hbox);
386 
387 	gtk_container_add(GTK_CONTAINER(frame), hbox);
388 
389 //	We create the primitive surface, and the preview area at the same time
390 	hfo->primit_surf = hf_wrapper_new(NULL,NULL,hbox, hbox,
391 		hf_options_dialog_new(hfo->tools_window,
392 			hbox,
393 			hfo->tooltips,
394 			NULL,
395 			&hfo->primit_surf,
396 			hfo->stack,
397 			hfo->doc_type,
398 			hfo->all_docs,
399 			hfo->get_doc_list_from_type),
400 		&dummy_flag, &dummy_flag, NULL, NULL, NULL, NULL, HFPRIMITIVE);
401 //	Shared data:
402 	((hf_wrapper_struct *)hfo->primit_surf)->hf_options->dist_matrix =
403 			hfo->dist_matrix;
404 
405 	((hf_wrapper_struct *)hfo->primit_surf)->hf_options->current_calculation = (gpointer) uniform;
406 	((hf_wrapper_struct *)hfo->primit_surf)->hf_options->current_callb = NULL;
407 	((hf_wrapper_struct *)hfo->primit_surf)->hf_options->current_options = (gpointer) hfo->uniform_value;
408 
409 	set_filter_type (((hf_wrapper_struct *) hfo->primit_surf)->hf_options->creation_fd_struct, MEDIUM_FILTER_1);
410 
411 	set_dependent_process ((hf_wrapper_struct *) hfo->primit_surf, gener_hf_from_ptr_ptr, hfo->hfw_ptr_ptr);
412 
413 //	Set the merge operation to MULTIPLY:
414 
415 	set_filter_merge(((hf_wrapper_struct *) hfo->primit_surf)->hf_options->creation_fd_struct, 1);
416 
417 //	Frequency dialog
418 	gtk_box_pack_start(GTK_BOX(vbox),
419 		surfadd_frq_dialog_new(hfo_ptr), FALSE, FALSE,0);
420 
421 	return define_options_frame_with_hiding_arrows("sum of surfaces", scrolled_window, hfo->tools_window, TRUE);
422 }
423 
424