]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - plugins/surface_heretic2/surfaceflagsdialog_heretic2.cpp
63c8378ec6a571a199bcd80b1ae606dab2bccf3d
[xonotic/netradiant.git] / plugins / surface_heretic2 / surfaceflagsdialog_heretic2.cpp
1 /*
2 Copyright (C) 1999-2007 id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
4
5 This file is part of GtkRadiant.
6
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20 */
21
22 #include <gtk/gtk.h>
23 #include <glib/gi18n.h>
24 #include <gdk/gdkkeysyms.h>
25
26 #include "surfdlg_plugin.h"
27
28 #include "surfaceflagsdialog_heretic2.h"
29
30   GtkWidget *surface_lightbutton;
31   GtkWidget *surface_slickbutton;
32   GtkWidget *surface_skybutton;
33   GtkWidget *surface_warpbutton;
34   GtkWidget *surface_trans33button;
35   GtkWidget *surface_trans66button;
36   GtkWidget *surface_flowingbutton;
37   GtkWidget *surface_nodrawbutton;
38   GtkWidget *surface_tallwallbutton;
39   GtkWidget *surface_alphatexbutton;
40   GtkWidget *surface_animspeedbutton;
41   GtkWidget *surface_undulatebutton;
42
43   GtkWidget *surf_gravel_radiobutton;
44   GSList *surf_gravel_radiobutton_group = NULL;
45   GtkWidget *surf_metal_radiobutton;
46   GtkWidget *surf_stone_radiobutton;
47   GtkWidget *surf_wood_radiobutton;
48
49   GtkWidget *surf_value_entry;
50
51   GtkWidget *notebook1;
52
53   GtkWidget *content_solidbutton;
54   GtkWidget *content_windowbutton;
55   GtkWidget *content_illusbutton;
56   GtkWidget *content_lavabutton;
57   GtkWidget *content_slimebutton;
58   GtkWidget *content_waterbutton;
59   GtkWidget *content_mistbutton;
60   GtkWidget *content_areaportalbutton;
61   GtkWidget *content_playerclipbutton;
62   GtkWidget *content_monsterclipbutton;
63   GtkWidget *content_current0button;
64   GtkWidget *content_current90button;
65   GtkWidget *content_current180button;
66   GtkWidget *content_current270button;
67   GtkWidget *content_currentUPbutton;
68   GtkWidget *content_currentDOWNbutton;
69   GtkWidget *content_originbutton;
70   GtkWidget *content_detailbutton;
71   GtkWidget *content_ladderbutton;
72   GtkWidget *content_camnoblockbutton;
73
74
75   gboolean setup_buttons = TRUE;
76
77   int working_surface_flags;
78   int surface_mask;
79   int working_content_flags;
80   int content_mask;
81   int working_value;
82   gboolean surface_material_inconsistant = FALSE;
83
84 inline void set_inconsistent(GtkWidget *toggle_button)
85 {
86   gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON (toggle_button), TRUE);
87 }
88
89 inline void clear_inconsistent(GtkWidget *toggle_button)
90 {
91   if ( gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (toggle_button)) )
92   {
93     gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON (toggle_button), FALSE);
94   }
95
96 }
97
98 void clear_all_inconsistent(void)
99 {
100   clear_inconsistent( surface_lightbutton );
101   clear_inconsistent( surface_slickbutton );
102   clear_inconsistent( surface_skybutton );
103   clear_inconsistent( surface_warpbutton );
104   clear_inconsistent( surface_trans33button );
105   clear_inconsistent( surface_trans66button );
106   clear_inconsistent( surface_flowingbutton );
107   clear_inconsistent( surface_nodrawbutton );
108   clear_inconsistent( surface_tallwallbutton );
109   clear_inconsistent( surface_alphatexbutton );
110   clear_inconsistent( surface_animspeedbutton );
111   clear_inconsistent( surface_undulatebutton );
112
113   clear_inconsistent( surf_gravel_radiobutton );
114   clear_inconsistent( surf_metal_radiobutton );
115   clear_inconsistent( surf_stone_radiobutton );
116   clear_inconsistent( surf_wood_radiobutton );
117
118   clear_inconsistent( content_solidbutton );
119   clear_inconsistent( content_windowbutton );
120   clear_inconsistent( content_illusbutton );
121   clear_inconsistent( content_lavabutton );
122   clear_inconsistent( content_slimebutton );
123   clear_inconsistent( content_waterbutton );
124   clear_inconsistent( content_mistbutton );
125   clear_inconsistent( content_areaportalbutton );
126   clear_inconsistent( content_playerclipbutton );
127   clear_inconsistent( content_monsterclipbutton );
128   clear_inconsistent( content_current0button );
129   clear_inconsistent( content_current90button );
130   clear_inconsistent( content_current180button );
131   clear_inconsistent( content_current270button );
132   clear_inconsistent( content_currentUPbutton );
133   clear_inconsistent( content_currentDOWNbutton );
134   clear_inconsistent( content_originbutton );
135   clear_inconsistent( content_detailbutton );
136   clear_inconsistent( content_ladderbutton );
137   clear_inconsistent( content_camnoblockbutton );
138 }
139
140 void clear_all_buttons_and_values()
141 {
142   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_lightbutton ), FALSE);
143   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_slickbutton ), FALSE);
144   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_skybutton ), FALSE);
145   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_warpbutton ), FALSE);
146   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_trans33button ), FALSE);
147   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_trans66button ), FALSE);
148   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_flowingbutton ), FALSE);
149   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_nodrawbutton ), FALSE);
150   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_tallwallbutton ), FALSE);
151   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_alphatexbutton ), FALSE);
152   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_animspeedbutton ), FALSE);
153   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_undulatebutton ), FALSE);
154
155 //  surface_material_inconsistant = TRUE;
156
157   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_gravel_radiobutton ), FALSE);
158   set_inconsistent(surf_gravel_radiobutton);
159
160   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_metal_radiobutton ), FALSE);
161   set_inconsistent(surf_metal_radiobutton);
162
163   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_stone_radiobutton ), FALSE);
164   set_inconsistent(surf_stone_radiobutton);
165
166   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_wood_radiobutton ), FALSE);
167   set_inconsistent(surf_wood_radiobutton);
168
169   gtk_entry_set_text( (GtkEntry *)surf_value_entry, "");
170
171   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_solidbutton ), FALSE);
172   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_windowbutton ), FALSE);
173   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_illusbutton ), FALSE);
174   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_lavabutton ), FALSE);
175   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_slimebutton ), FALSE);
176   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_waterbutton ), FALSE);
177   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_mistbutton ), FALSE);
178   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_areaportalbutton ), FALSE);
179   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_playerclipbutton ), FALSE);
180   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_monsterclipbutton ), FALSE);
181   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_current0button ), FALSE);
182   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_current90button ), FALSE);
183   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_current180button ), FALSE);
184   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_current270button ), FALSE);
185   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_currentUPbutton ), FALSE);
186   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_currentDOWNbutton ), FALSE);
187   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_originbutton ), FALSE);
188   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_detailbutton ), FALSE);
189   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_ladderbutton ), FALSE);
190   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_camnoblockbutton ), FALSE);
191
192 }
193
194 void SetFlagButtons_Heretic2(texdef_to_face_t *texdef_face_list, bool b_isListEmpty)
195 {
196   int i;
197   int contents = 0;
198   int flags = 0;
199   int value = 0;
200   int diff_contents = 0;
201   int diff_flags = 0;
202   gboolean diff_value = FALSE;
203   char tex_buff[11];
204   texdef_t* tmp_texdef;
205   texdef_to_face_t* temp_texdef_face_list;
206   gboolean surface_which_material_inconsistant[4];
207   int surface_iterator;
208
209   setup_buttons = TRUE;
210   working_surface_flags = 0;
211   surface_mask = 0;
212   working_content_flags = 0;
213   content_mask = 0;
214   working_value = 0;
215   surface_material_inconsistant = FALSE;
216   surface_which_material_inconsistant[0] = FALSE;
217   surface_which_material_inconsistant[1] = FALSE;
218   surface_which_material_inconsistant[2] = FALSE;
219   surface_which_material_inconsistant[3] = FALSE;
220
221   if(!b_isListEmpty)
222   {
223     tmp_texdef = &texdef_face_list->texdef;
224     contents = tmp_texdef->contents;
225     flags = tmp_texdef->flags;
226     value = tmp_texdef->value;
227
228     surface_iterator = (tmp_texdef->flags & ~HERETIC2_SURF_MATERIAL_MASK) >> 24;  // Inconsistant Material?
229     surface_which_material_inconsistant[surface_iterator] = TRUE;
230
231     for (temp_texdef_face_list = texdef_face_list->next; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
232     {
233       tmp_texdef = &temp_texdef_face_list->texdef;
234       diff_contents |= contents ^ tmp_texdef->contents;  // Figure out which buttons are inconsistent
235       diff_flags |= flags ^ tmp_texdef->flags;
236       if (tmp_texdef->value != value)
237         diff_value = TRUE;
238
239       surface_iterator = (tmp_texdef->flags & ~HERETIC2_SURF_MATERIAL_MASK) >> 24;  // Inconsistant Material?
240       surface_which_material_inconsistant[surface_iterator] = TRUE;
241
242       Sys_Printf("Diff_Flags: %d\t Surf_Iter: %d\n",diff_flags, surface_iterator);
243
244     }
245   }
246
247
248   clear_all_inconsistent();
249
250   // If no faces/brushes are selected, clear everything and bail
251   if(b_isListEmpty)
252   {
253     clear_all_buttons_and_values();
254     setup_buttons = FALSE;
255     return;
256   }
257
258   // Set surface buttons to reflect brush/face flags, contents, and values
259   if(diff_flags & HERETIC2_SURF_LIGHT)
260     set_inconsistent(surface_lightbutton);
261   else
262     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (surface_lightbutton), (flags & HERETIC2_SURF_LIGHT));
263
264   if(diff_flags & HERETIC2_SURF_SLICK)
265     set_inconsistent(surface_slickbutton);
266   else if(flags & HERETIC2_SURF_SLICK)
267         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), TRUE);
268   else
269         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), FALSE);
270
271   if(diff_flags & HERETIC2_SURF_SKY)
272     set_inconsistent(surface_skybutton);
273   else if(flags & HERETIC2_SURF_SKY)
274         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), TRUE);
275   else
276         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), FALSE);
277
278   if(diff_flags & HERETIC2_SURF_WARP)
279     set_inconsistent(surface_warpbutton);
280   else if(flags & HERETIC2_SURF_WARP)
281         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), TRUE);
282   else
283         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), FALSE);
284
285   if(diff_flags & HERETIC2_SURF_TRANS33)
286     set_inconsistent(surface_trans33button);
287   else if(flags & HERETIC2_SURF_TRANS33)
288         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), TRUE);
289   else
290         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), FALSE);
291
292   if(diff_flags & HERETIC2_SURF_TRANS66)
293     set_inconsistent(surface_trans66button);
294   else if(flags & HERETIC2_SURF_TRANS66)
295         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), TRUE);
296   else
297         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), FALSE);
298
299   if(diff_flags & HERETIC2_SURF_FLOWING)
300     set_inconsistent(surface_flowingbutton);
301   else if(flags & HERETIC2_SURF_FLOWING)
302         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), TRUE);
303   else
304         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), FALSE);
305
306   if(diff_flags & HERETIC2_SURF_NODRAW)
307     set_inconsistent(surface_nodrawbutton);
308   else if(flags & HERETIC2_SURF_NODRAW)
309         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), TRUE);
310   else
311         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), FALSE);
312
313   if(diff_flags & HERETIC2_SURF_TALL_WALL)
314     set_inconsistent(surface_tallwallbutton);
315   else if(flags & HERETIC2_SURF_TALL_WALL)
316         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_tallwallbutton ), TRUE);
317   else
318         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_tallwallbutton ), FALSE);
319
320   if(diff_flags & HERETIC2_SURF_ALPHA_TEXTURE)
321     set_inconsistent(surface_alphatexbutton);
322   else if(flags & HERETIC2_SURF_ALPHA_TEXTURE)
323         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_alphatexbutton ), TRUE);
324   else
325         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_alphatexbutton ), FALSE);
326
327   if(diff_flags & HERETIC2_SURF_ANIMSPEED)
328     set_inconsistent(surface_animspeedbutton);
329   else if(flags & HERETIC2_SURF_ANIMSPEED)
330         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_animspeedbutton ), TRUE);
331   else
332         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_animspeedbutton ), FALSE);
333
334   if(diff_flags & HERETIC2_SURF_UNDULATE)
335     set_inconsistent(surface_undulatebutton);
336   else if(flags & HERETIC2_SURF_UNDULATE)
337         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_undulatebutton ), TRUE);
338   else
339         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_undulatebutton ), FALSE);
340
341   if(diff_flags & ~HERETIC2_SURF_MATERIAL_MASK)
342   {
343     Sys_Printf("--> %d\n", (diff_flags & ~HERETIC2_SURF_MATERIAL_MASK) );
344     Sys_Printf("%d\t%d\t%d\t%d\n", surface_which_material_inconsistant[0], surface_which_material_inconsistant[1], surface_which_material_inconsistant[2], surface_which_material_inconsistant[3]);
345
346     if (surface_which_material_inconsistant[0])
347     {
348       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_gravel_radiobutton ), FALSE);
349       surface_material_inconsistant = TRUE;
350       set_inconsistent(surf_gravel_radiobutton);
351     }
352     if (surface_which_material_inconsistant[1])
353     {
354       //if (!surface_material_inconsistant)
355       //{
356         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_metal_radiobutton ), FALSE);
357         surface_material_inconsistant = TRUE;
358       //}
359       set_inconsistent(surf_metal_radiobutton);
360     }
361     if (surface_which_material_inconsistant[2])
362     {
363       //if (!surface_material_inconsistant)
364       //{
365         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_stone_radiobutton ), FALSE);
366         surface_material_inconsistant = TRUE;
367       //}
368       set_inconsistent(surf_stone_radiobutton);
369     }
370     if (surface_which_material_inconsistant[3])
371     {
372       //if (!surface_material_inconsistant)
373       //{
374         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_wood_radiobutton ), FALSE);
375         surface_material_inconsistant = TRUE;
376       //}
377       set_inconsistent(surf_wood_radiobutton);
378     }
379   }
380   else
381   {
382     if(flags & ~HERETIC2_SURF_MATERIAL_MASK)
383     {
384       surface_iterator = (flags & ~HERETIC2_SURF_MATERIAL_MASK) >> 24;
385       if( surface_iterator == 1)
386         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_metal_radiobutton ), TRUE);
387       else if(surface_iterator == 2)
388         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_stone_radiobutton ), TRUE);
389       else if(surface_iterator == 3)
390         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_wood_radiobutton ), TRUE);
391     }
392     else
393     {
394       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_gravel_radiobutton ), TRUE);
395     }
396   }
397
398   // Set content buttons to reflect brush values
399   if(diff_contents & HERETIC2_CONTENTS_SOLID)
400     set_inconsistent(content_solidbutton);
401   else if(contents & HERETIC2_CONTENTS_SOLID)
402         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), TRUE);
403   else
404         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), FALSE);
405
406   if(diff_contents & HERETIC2_CONTENTS_WINDOW)
407     set_inconsistent(content_windowbutton);
408   else if(contents & HERETIC2_CONTENTS_WINDOW)
409         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), TRUE);
410   else
411         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), FALSE);
412
413   if(diff_contents & HERETIC2_CONTENTS_ILLUSIONARY)
414     set_inconsistent(content_illusbutton);
415   else if(contents & HERETIC2_CONTENTS_ILLUSIONARY)
416         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_illusbutton ), TRUE);
417   else
418         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_illusbutton ), FALSE);
419
420   if(diff_contents & HERETIC2_CONTENTS_LAVA)
421     set_inconsistent(content_lavabutton);
422   else if(contents & HERETIC2_CONTENTS_LAVA)
423         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), TRUE);
424   else
425         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), FALSE);
426
427   if(diff_contents & HERETIC2_CONTENTS_SLIME)
428     set_inconsistent(content_slimebutton);
429   else if(contents & HERETIC2_CONTENTS_SLIME)
430         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), TRUE);
431   else
432         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), FALSE);
433
434   if(diff_contents & HERETIC2_CONTENTS_WATER)
435     set_inconsistent(content_waterbutton);
436   else if(contents & HERETIC2_CONTENTS_WATER)
437         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), TRUE);
438   else
439         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), FALSE);
440
441   if(diff_contents & HERETIC2_CONTENTS_MIST)
442     set_inconsistent(content_mistbutton);
443   else if(contents & HERETIC2_CONTENTS_MIST)
444         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), TRUE);
445   else
446         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), FALSE);
447
448   if(diff_contents & HERETIC2_CONTENTS_AREAPORTAL)
449     set_inconsistent(content_areaportalbutton);
450   else if(contents & HERETIC2_CONTENTS_AREAPORTAL)
451         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), TRUE);
452   else
453         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), FALSE);
454
455   if(diff_contents & HERETIC2_CONTENTS_PLAYERCLIP)
456     set_inconsistent(content_playerclipbutton);
457   else if(contents & HERETIC2_CONTENTS_PLAYERCLIP)
458         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), TRUE);
459   else
460         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), FALSE);
461
462   if(diff_contents & HERETIC2_CONTENTS_MONSTERCLIP)
463     set_inconsistent(content_monsterclipbutton);
464   else if(contents & HERETIC2_CONTENTS_MONSTERCLIP)
465         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), TRUE);
466   else
467         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), FALSE);
468
469   if(diff_contents & HERETIC2_CONTENTS_CURRENT_0)
470     set_inconsistent(content_current0button);
471   else if(contents & HERETIC2_CONTENTS_CURRENT_0)
472         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), TRUE);
473   else
474         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), FALSE);
475
476   if(diff_contents & HERETIC2_CONTENTS_CURRENT_90)
477     set_inconsistent(content_current90button);
478   else if(contents & HERETIC2_CONTENTS_CURRENT_90)
479         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), TRUE);
480   else
481         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), FALSE);
482
483   if(diff_contents & HERETIC2_CONTENTS_CURRENT_180)
484     set_inconsistent(content_current180button);
485   else if(contents & HERETIC2_CONTENTS_CURRENT_180)
486         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), TRUE);
487   else
488         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), FALSE);
489
490   if(diff_contents & HERETIC2_CONTENTS_CURRENT_270)
491     set_inconsistent(content_current270button);
492   else if(contents & HERETIC2_CONTENTS_CURRENT_270)
493         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), TRUE);
494   else
495         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), FALSE);
496
497   if(diff_contents & HERETIC2_CONTENTS_CURRENT_UP)
498     set_inconsistent(content_currentUPbutton);
499   else if(contents & HERETIC2_CONTENTS_CURRENT_UP)
500         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), TRUE);
501   else
502         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), FALSE);
503
504   if(diff_contents & HERETIC2_CONTENTS_CURRENT_DOWN)
505     set_inconsistent(content_currentDOWNbutton);
506   else if(contents & HERETIC2_CONTENTS_CURRENT_DOWN)
507         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), TRUE);
508   else
509         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), FALSE);
510
511   if(diff_contents & HERETIC2_CONTENTS_ORIGIN)
512     set_inconsistent(content_originbutton);
513   else if(contents & HERETIC2_CONTENTS_ORIGIN)
514         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), TRUE);
515   else
516         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), FALSE);
517
518   if(diff_contents & HERETIC2_CONTENTS_DETAIL)
519     set_inconsistent(content_detailbutton);
520   else if(contents & HERETIC2_CONTENTS_DETAIL)
521         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), TRUE);
522   else
523         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), FALSE);
524
525   if(diff_contents & HERETIC2_CONTENTS_LADDER)
526     set_inconsistent(content_ladderbutton);
527   else if(contents & HERETIC2_CONTENTS_LADDER)
528         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), TRUE);
529   else
530         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), FALSE);
531
532   if(diff_contents & HERETIC2_CONTENTS_CAMERANOBLOCK)
533     set_inconsistent(content_camnoblockbutton);
534   else if(contents & HERETIC2_CONTENTS_CAMERANOBLOCK)
535         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_camnoblockbutton ), TRUE);
536   else
537         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_camnoblockbutton ), FALSE);
538
539   // Set Value
540   if(diff_value)
541     gtk_entry_set_text( (GtkEntry *)surf_value_entry, "");
542   else
543   {
544     working_value = value;
545     sprintf( tex_buff, "%d", value);
546     gtk_entry_set_text( (GtkEntry *)surf_value_entry, tex_buff);
547   }
548
549   setup_buttons = FALSE;
550 }
551
552 void SetChangeInFlags_Face_Heretic2 (texdef_to_face_t *texdef_face_list)
553 {
554   texdef_to_face_t *temp_texdef_face_list;
555   texdef_t *tmp_texdef;
556
557   for (temp_texdef_face_list = texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
558   {
559     tmp_texdef = &temp_texdef_face_list->texdef;
560     tmp_texdef->flags = (tmp_texdef->flags & ~surface_mask) | working_surface_flags;
561     tmp_texdef->contents = (tmp_texdef->contents & ~content_mask) | working_content_flags;
562     tmp_texdef->value = working_value;
563     Sys_Printf("content_flag: %d     content_mask: %d\n",working_content_flags,content_mask);
564     Sys_Printf("content: %d\n",tmp_texdef->contents);
565   }
566 }
567
568 inline void change_surfaceflag (GtkWidget *togglebutton, int sur_flag) // For Material
569 {
570   if (!setup_buttons) // If we're setting up the buttons, we really don't need to
571   {                   // set flags that are already set
572     if (surface_material_inconsistant)
573     {
574       clear_inconsistent( surf_gravel_radiobutton );
575       clear_inconsistent( surf_metal_radiobutton );
576       clear_inconsistent( surf_stone_radiobutton );
577       clear_inconsistent( surf_wood_radiobutton );
578     }
579     surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
580     working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | sur_flag;
581   }
582 }
583
584 inline void change_material (GtkWidget *togglebutton)
585 {
586   if (!setup_buttons) // If we're setting up the buttons, we really don't need to
587   {                   // set flags that are already set
588     if (surface_material_inconsistant)
589     {
590       clear_inconsistent( surf_gravel_radiobutton );
591       clear_inconsistent( surf_metal_radiobutton );
592       clear_inconsistent( surf_stone_radiobutton );
593       clear_inconsistent( surf_wood_radiobutton );
594     }
595     if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_gravel_radiobutton))  )
596     {
597       surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
598       working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | HERETIC2_SURF_TYPE_GRAVEL;
599     }
600     else if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_metal_radiobutton)) )
601     {
602       surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
603       working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | HERETIC2_SURF_TYPE_METAL;
604     }
605     else if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_stone_radiobutton)) )
606     {
607       surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
608       working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | HERETIC2_SURF_TYPE_STONE;
609     }
610     else if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_wood_radiobutton)) )
611     {
612       surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK;
613       working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | HERETIC2_SURF_TYPE_WOOD;
614     }
615   }
616 }
617
618 inline void change_surfaceflag (GtkWidget *togglebutton, int sur_flag, gboolean change_flag_to)
619 {
620
621   if (!setup_buttons) // If we're setting up the buttons, we really don't need to
622   {                   // set flags that are already set
623     if (gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (togglebutton))) // Clear out inconsistent, if set
624             clear_inconsistent(GTK_WIDGET (togglebutton));
625
626     surface_mask |= sur_flag;
627
628     if (change_flag_to)
629       working_surface_flags |= sur_flag;
630     else
631       working_surface_flags &= ~sur_flag;
632   }
633 }
634
635 inline void change_contentflag (GtkWidget *togglebutton, int content_flag, gboolean change_flag_to)
636 {
637
638   if ( (!setup_buttons) )  // If we're setting up the buttons, we really don't need to
639   {                        // set flags that are already set
640
641     if (gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (togglebutton)))
642             clear_inconsistent(togglebutton);
643     //if (g_ptrSelectedFaces.GetSize() == 0)  // Only changing content flags on whole brushes, not faces.
644     //{
645       content_mask |= content_flag;
646
647     if (change_flag_to)
648       working_content_flags |= content_flag;
649     else
650       working_content_flags &= ~content_flag;
651     //}
652   }
653 }
654
655 // Surface Flags Callbacks
656 void
657 on_surface_lightbutton_toggled         (GtkToggleButton *togglebutton,
658                                         gpointer         user_data)
659 {
660   change_surfaceflag(surface_lightbutton, HERETIC2_SURF_LIGHT, (GTK_TOGGLE_BUTTON (surface_lightbutton)->active));
661 }
662
663
664 void
665 on_surface_slickbutton_toggled         (GtkToggleButton *togglebutton,
666                                         gpointer         user_data)
667 {
668   change_surfaceflag(surface_slickbutton, HERETIC2_SURF_SLICK, (GTK_TOGGLE_BUTTON (surface_slickbutton)->active));
669 }
670
671
672 void
673 on_surface_skybutton_toggled           (GtkToggleButton *togglebutton,
674                                         gpointer         user_data)
675 {
676   change_surfaceflag(surface_skybutton, HERETIC2_SURF_SKY, (GTK_TOGGLE_BUTTON (surface_skybutton)->active));
677 }
678
679
680 void
681 on_surface_warpbutton_toggled          (GtkToggleButton *togglebutton,
682                                         gpointer         user_data)
683 {
684   change_surfaceflag(surface_warpbutton, HERETIC2_SURF_WARP, (GTK_TOGGLE_BUTTON (surface_warpbutton)->active));
685 }
686
687
688 void
689 on_surface_trans33button_toggled       (GtkToggleButton *togglebutton,
690                                         gpointer         user_data)
691 {
692   change_surfaceflag(surface_trans33button, HERETIC2_SURF_TRANS33, (GTK_TOGGLE_BUTTON (surface_trans33button)->active));
693 }
694
695
696 void
697 on_surface_trans66button_toggled       (GtkToggleButton *togglebutton,
698                                         gpointer         user_data)
699 {
700   change_surfaceflag(surface_trans66button, HERETIC2_SURF_TRANS66, (GTK_TOGGLE_BUTTON (surface_trans66button)->active));
701 }
702
703
704 void
705 on_surface_flowingbutton_toggled       (GtkToggleButton *togglebutton,
706                                         gpointer         user_data)
707 {
708   change_surfaceflag(surface_flowingbutton, HERETIC2_SURF_FLOWING, (GTK_TOGGLE_BUTTON (surface_flowingbutton)->active));
709 }
710
711
712 void
713 on_surface_nodrawbutton_toggled        (GtkToggleButton *togglebutton,
714                                         gpointer         user_data)
715 {
716   change_surfaceflag(surface_nodrawbutton, HERETIC2_SURF_NODRAW, (GTK_TOGGLE_BUTTON (surface_nodrawbutton)->active));
717 }
718
719
720 void
721 on_surface_tallwallbutton_toggled      (GtkToggleButton *togglebutton,
722                                         gpointer         user_data)
723 {
724   change_surfaceflag(surface_tallwallbutton, HERETIC2_SURF_TALL_WALL, (GTK_TOGGLE_BUTTON (surface_tallwallbutton)->active));
725 }
726
727
728 void
729 on_surface_alphatexbutton_toggled      (GtkToggleButton *togglebutton,
730                                         gpointer         user_data)
731 {
732   change_surfaceflag(surface_alphatexbutton, HERETIC2_SURF_ALPHA_TEXTURE, (GTK_TOGGLE_BUTTON (surface_alphatexbutton)->active));
733 }
734
735
736 void
737 on_surface_animspeedbutton_toggled     (GtkToggleButton *togglebutton,
738                                         gpointer         user_data)
739 {
740   change_surfaceflag(surface_animspeedbutton, HERETIC2_SURF_ANIMSPEED, (GTK_TOGGLE_BUTTON (surface_animspeedbutton)->active));
741 }
742
743
744 void
745 on_surface_undulatebutton_toggled      (GtkToggleButton *togglebutton,
746                                         gpointer         user_data)
747 {
748   change_surfaceflag(surface_undulatebutton, HERETIC2_SURF_UNDULATE, (GTK_TOGGLE_BUTTON (surface_undulatebutton)->active));
749 }
750
751
752 void
753 on_surf_gravel_radiobutton_toggled     (GtkToggleButton *togglebutton,
754                                         gpointer         user_data)
755 {
756   if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_gravel_radiobutton)))
757     change_material(GTK_WIDGET(togglebutton));
758 }
759
760 void
761 on_surf_metal_radiobutton_toggled     (GtkToggleButton *togglebutton,
762                                         gpointer         user_data)
763 {
764   if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_metal_radiobutton)))
765     change_material(GTK_WIDGET(togglebutton));
766 }
767
768 void
769 on_surf_stone_radiobutton_toggled     (GtkToggleButton *togglebutton,
770                                         gpointer         user_data)
771 {
772   if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_stone_radiobutton)))
773     change_material(GTK_WIDGET(togglebutton));
774 }
775
776 void
777 on_surf_wood_radiobutton_toggled     (GtkToggleButton *togglebutton,
778                                         gpointer         user_data)
779 {
780   if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_wood_radiobutton)))
781     change_material(GTK_WIDGET(togglebutton));
782 }
783
784 // Content Flags Callbacks
785 void
786 on_content_solidbutton_toggled         (GtkToggleButton *togglebutton,
787                                         gpointer         user_data)
788 {
789   change_contentflag(content_solidbutton, HERETIC2_CONTENTS_SOLID, (GTK_TOGGLE_BUTTON (content_solidbutton)->active));
790 }
791
792
793 void
794 on_content_windowbutton_toggled        (GtkToggleButton *togglebutton,
795                                         gpointer         user_data)
796 {
797   change_contentflag(content_windowbutton, HERETIC2_CONTENTS_WINDOW, (GTK_TOGGLE_BUTTON (content_windowbutton)->active));
798 }
799
800
801 void
802 on_content_illusbutton_toggled         (GtkToggleButton *togglebutton,
803                                         gpointer         user_data)
804 {
805   change_contentflag(content_illusbutton, HERETIC2_CONTENTS_ILLUSIONARY, (GTK_TOGGLE_BUTTON (content_illusbutton)->active));
806 }
807
808
809 void
810 on_content_lavabutton_toggled          (GtkToggleButton *togglebutton,
811                                         gpointer         user_data)
812 {
813   change_contentflag(content_lavabutton, HERETIC2_CONTENTS_LAVA, (GTK_TOGGLE_BUTTON (content_lavabutton)->active));
814 }
815
816
817 void
818 on_content_slimebutton_toggled         (GtkToggleButton *togglebutton,
819                                         gpointer         user_data)
820 {
821   change_contentflag(content_slimebutton, HERETIC2_CONTENTS_SLIME, (GTK_TOGGLE_BUTTON (content_slimebutton)->active));
822 }
823
824
825 void
826 on_content_waterbutton_toggled         (GtkToggleButton *togglebutton,
827                                         gpointer         user_data)
828 {
829   change_contentflag(content_waterbutton, HERETIC2_CONTENTS_WATER, (GTK_TOGGLE_BUTTON (content_waterbutton)->active));
830 }
831
832
833 void
834 on_content_mistbutton_toggled          (GtkToggleButton *togglebutton,
835                                         gpointer         user_data)
836 {
837   change_contentflag(content_mistbutton, HERETIC2_CONTENTS_MIST, (GTK_TOGGLE_BUTTON (content_mistbutton)->active));
838 }
839
840
841 void
842 on_content_areaportalbutton_toggled    (GtkToggleButton *togglebutton,
843                                         gpointer         user_data)
844 {
845   change_contentflag(content_areaportalbutton, HERETIC2_CONTENTS_AREAPORTAL, (GTK_TOGGLE_BUTTON (content_areaportalbutton)->active));
846 }
847
848
849 void
850 on_content_playerclipbutton_toggled    (GtkToggleButton *togglebutton,
851                                         gpointer         user_data)
852 {
853   change_contentflag(content_playerclipbutton, HERETIC2_CONTENTS_PLAYERCLIP, (GTK_TOGGLE_BUTTON (content_playerclipbutton)->active));
854 }
855
856
857 void
858 on_content_monsterclipbutton_toggled   (GtkToggleButton *togglebutton,
859                                         gpointer         user_data)
860 {
861   change_contentflag(content_monsterclipbutton, HERETIC2_CONTENTS_MONSTERCLIP, (GTK_TOGGLE_BUTTON (content_monsterclipbutton)->active));
862 }
863
864
865 void
866 on_content_current0button_toggled      (GtkToggleButton *togglebutton,
867                                         gpointer         user_data)
868 {
869   change_contentflag(content_current0button, HERETIC2_CONTENTS_CURRENT_0, (GTK_TOGGLE_BUTTON (content_current0button)->active));
870 }
871
872
873 void
874 on_content_current90button_toggled     (GtkToggleButton *togglebutton,
875                                         gpointer         user_data)
876 {
877   change_contentflag(content_current90button, HERETIC2_CONTENTS_CURRENT_90, (GTK_TOGGLE_BUTTON (content_current90button)->active));
878 }
879
880
881 void
882 on_content_current180button_toggled    (GtkToggleButton *togglebutton,
883                                         gpointer         user_data)
884 {
885   change_contentflag(content_current180button, HERETIC2_CONTENTS_CURRENT_180, (GTK_TOGGLE_BUTTON (content_current180button)->active));
886 }
887
888
889 void
890 on_content_current270button_toggled    (GtkToggleButton *togglebutton,
891                                         gpointer         user_data)
892 {
893   change_contentflag(content_current270button, HERETIC2_CONTENTS_CURRENT_270, (GTK_TOGGLE_BUTTON (content_current270button)->active));
894 }
895
896
897 void
898 on_content_currentUPbutton_toggled     (GtkToggleButton *togglebutton,
899                                         gpointer         user_data)
900 {
901   change_contentflag(content_currentUPbutton, HERETIC2_CONTENTS_CURRENT_UP, (GTK_TOGGLE_BUTTON (content_currentUPbutton)->active));
902 }
903
904
905 void
906 on_content_currentDOWNbutton_toggled   (GtkToggleButton *togglebutton,
907                                         gpointer         user_data)
908 {
909   change_contentflag(content_currentDOWNbutton, HERETIC2_CONTENTS_CURRENT_DOWN, (GTK_TOGGLE_BUTTON (content_currentDOWNbutton)->active));
910 }
911
912
913 void
914 on_content_originbutton_toggled        (GtkToggleButton *togglebutton,
915                                         gpointer         user_data)
916 {
917   change_contentflag(content_originbutton, HERETIC2_CONTENTS_ORIGIN, (GTK_TOGGLE_BUTTON (content_originbutton)->active));
918 }
919
920
921 void
922 on_content_detailbutton_toggled        (GtkToggleButton *togglebutton,
923                                         gpointer         user_data)
924 {
925   change_contentflag(content_detailbutton, HERETIC2_CONTENTS_DETAIL, (GTK_TOGGLE_BUTTON (content_detailbutton)->active));
926 }
927
928
929 void
930 on_content_ladderbutton_toggled        (GtkToggleButton *togglebutton,
931                                         gpointer         user_data)
932 {
933   change_contentflag(content_ladderbutton, HERETIC2_CONTENTS_LADDER, (GTK_TOGGLE_BUTTON (content_ladderbutton)->active));
934 }
935
936
937 void
938 on_content_camnoblockbutton_toggled    (GtkToggleButton *togglebutton,
939                                         gpointer         user_data)
940 {
941   change_contentflag(content_camnoblockbutton, HERETIC2_CONTENTS_CAMERANOBLOCK, (GTK_TOGGLE_BUTTON (content_camnoblockbutton)->active));
942 }
943
944 // Value Entry Callback
945 void
946 on_surf_value_entry_changed             (GtkEditable     *editable,
947                                         gpointer         user_data)
948 {
949   if ( (!setup_buttons) )  // If we're setting up the buttons, don't change value
950     working_value = atoi( gtk_entry_get_text( (GtkEntry*)editable) );
951 }
952
953 void
954 on_surf_value_entry_insert_text         (GtkEditable     *editable,
955                                         gchar           *new_text,
956                                         gint             new_text_length,
957                                         gint            *position,
958                                         gpointer         user_data)
959 {
960   int i, count=0;
961   gchar *result;
962   int entry_value;
963   texdef_t *pt;
964   brush_t *b;
965   face_t *f;
966
967   // Limit input to digits, throwing out anything else
968   // Modified from Gtk FAQ for text filtering of GtkEntry
969   result = g_new (gchar, new_text_length);
970
971   for (i=0; i < new_text_length; i++) {
972     if (!isdigit(new_text[i]))
973       continue;
974   result[count++] = new_text[i];
975   }
976
977   if (count > 0) {
978     gtk_signal_handler_block_by_func (GTK_OBJECT (editable),
979                                       GTK_SIGNAL_FUNC (on_surf_value_entry_insert_text),
980                                       user_data);
981     gtk_editable_insert_text (editable, result, count, position);
982     gtk_signal_handler_unblock_by_func (GTK_OBJECT (editable),
983                                         GTK_SIGNAL_FUNC (on_surf_value_entry_insert_text),
984                                         user_data);
985   }
986   gtk_signal_emit_stop_by_name (GTK_OBJECT (editable), "insert_text");
987
988   g_free (result);
989 }
990
991 #define HERETIC2_FLAG_BUTTON_BORDER 3
992
993 GtkWidget* Create_Heretic2FlagsDialog (GtkWidget* surfacedialog_widget)
994 {
995   GtkWidget *frame1;
996   GtkWidget *notebook1;
997   GtkWidget *vbox3;
998   GtkWidget *table1;
999   GtkWidget *frame2;
1000   GtkWidget *hbox4;
1001   GtkWidget *label4;
1002   GtkWidget *vbox4;
1003   GtkWidget *table3;
1004   GtkWidget *label5;
1005
1006   GtkWidget *hbox1;
1007   GtkWidget *hbox2;
1008   GtkWidget *label2;
1009   GtkWidget *table2;
1010   GtkWidget *label3;
1011
1012
1013   frame1 = gtk_frame_new ("Brush/Face Flags");
1014   gtk_widget_show (frame1);
1015   gtk_container_add (GTK_CONTAINER (surfacedialog_widget), frame1);
1016
1017   notebook1 = gtk_notebook_new ();
1018   gtk_widget_show (notebook1);
1019   gtk_container_add (GTK_CONTAINER (frame1), notebook1);
1020
1021   vbox3 = gtk_vbox_new (FALSE, 0);
1022   gtk_widget_show (vbox3);
1023   gtk_container_add (GTK_CONTAINER (notebook1), vbox3);
1024
1025   table1 = gtk_table_new (3, 4, TRUE);
1026   gtk_widget_show (table1);
1027   gtk_box_pack_start (GTK_BOX (vbox3), table1, TRUE, TRUE, 0);
1028
1029   surface_lightbutton = gtk_toggle_button_new_with_mnemonic ("Light");
1030   gtk_widget_show (surface_lightbutton);
1031   gtk_table_attach (GTK_TABLE (table1), surface_lightbutton, 0, 1, 0, 1,
1032                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1033                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1034
1035   surface_slickbutton = gtk_toggle_button_new_with_mnemonic ("Slick");
1036   gtk_widget_show (surface_slickbutton);
1037   gtk_table_attach (GTK_TABLE (table1), surface_slickbutton, 1, 2, 0, 1,
1038                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1039                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1040
1041   surface_skybutton = gtk_toggle_button_new_with_mnemonic ("Sky");
1042   gtk_widget_show (surface_skybutton);
1043   gtk_table_attach (GTK_TABLE (table1), surface_skybutton, 2, 3, 0, 1,
1044                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1045                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1046
1047   surface_warpbutton = gtk_toggle_button_new_with_mnemonic ("Warp");
1048   gtk_widget_show (surface_warpbutton);
1049   gtk_table_attach (GTK_TABLE (table1), surface_warpbutton, 3, 4, 0, 1,
1050                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1051                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1052
1053   surface_trans33button = gtk_toggle_button_new_with_mnemonic ("Trans33");
1054   gtk_widget_show (surface_trans33button);
1055   gtk_table_attach (GTK_TABLE (table1), surface_trans33button, 0, 1, 1, 2,
1056                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1057                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1058
1059   surface_trans66button = gtk_toggle_button_new_with_mnemonic ("Trans66");
1060   gtk_widget_show (surface_trans66button);
1061   gtk_table_attach (GTK_TABLE (table1), surface_trans66button, 1, 2, 1, 2,
1062                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1063                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1064
1065   surface_flowingbutton = gtk_toggle_button_new_with_mnemonic ("Flowing");
1066   gtk_widget_show (surface_flowingbutton);
1067   gtk_table_attach (GTK_TABLE (table1), surface_flowingbutton, 2, 3, 1, 2,
1068                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1069                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1070
1071   surface_nodrawbutton = gtk_toggle_button_new_with_mnemonic ("NoDraw");
1072   gtk_widget_show (surface_nodrawbutton);
1073   gtk_table_attach (GTK_TABLE (table1), surface_nodrawbutton, 3, 4, 1, 2,
1074                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1075                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1076
1077   surface_tallwallbutton = gtk_toggle_button_new_with_mnemonic ("TallWall");
1078   gtk_widget_show (surface_tallwallbutton);
1079   gtk_table_attach (GTK_TABLE (table1), surface_tallwallbutton, 0, 1, 2, 3,
1080                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1081                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1082
1083   surface_alphatexbutton = gtk_toggle_button_new_with_mnemonic ("AlphaTex");
1084   gtk_widget_show (surface_alphatexbutton);
1085   gtk_table_attach (GTK_TABLE (table1), surface_alphatexbutton, 1, 2, 2, 3,
1086                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1087                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1088
1089   surface_animspeedbutton = gtk_toggle_button_new_with_mnemonic ("AnimSpeed");
1090   gtk_widget_show (surface_animspeedbutton);
1091   gtk_table_attach (GTK_TABLE (table1), surface_animspeedbutton, 2, 3, 2, 3,
1092                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1093                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1094
1095   surface_undulatebutton = gtk_toggle_button_new_with_mnemonic ("Undulate");
1096   gtk_widget_show (surface_undulatebutton);
1097   gtk_table_attach (GTK_TABLE (table1), surface_undulatebutton, 3, 4, 2, 3,
1098                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1099                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1100
1101   frame2 = gtk_frame_new (NULL);
1102   gtk_widget_show (frame2);
1103   gtk_box_pack_start (GTK_BOX (vbox3), frame2, FALSE, FALSE, 0);
1104   gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_ETCHED_OUT);
1105   gtk_container_set_border_width (GTK_CONTAINER (frame2), 4);
1106
1107   hbox4 = gtk_hbox_new (FALSE, 0);
1108   gtk_widget_show (hbox4);
1109   gtk_container_add (GTK_CONTAINER (frame2), hbox4);
1110
1111   surf_gravel_radiobutton = gtk_radio_button_new_with_mnemonic (NULL, "Gravel");
1112   gtk_widget_show (surf_gravel_radiobutton);
1113   gtk_box_pack_start (GTK_BOX (hbox4), surf_gravel_radiobutton, TRUE, FALSE, 0);
1114
1115   surf_metal_radiobutton = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON(surf_gravel_radiobutton), "Metal");
1116   gtk_widget_show (surf_metal_radiobutton);
1117   gtk_box_pack_start (GTK_BOX (hbox4), surf_metal_radiobutton, TRUE, FALSE, 0);
1118
1119   surf_stone_radiobutton = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON(surf_metal_radiobutton), "Stone");
1120   gtk_widget_show (surf_stone_radiobutton);
1121   gtk_box_pack_start (GTK_BOX (hbox4), surf_stone_radiobutton, TRUE, FALSE, 0);
1122
1123   surf_wood_radiobutton = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON(surf_stone_radiobutton), "Wood");
1124   gtk_widget_show (surf_wood_radiobutton);
1125   gtk_box_pack_start (GTK_BOX (hbox4), surf_wood_radiobutton, TRUE, FALSE, 0);
1126
1127   label4 = gtk_label_new ("Material");
1128   gtk_widget_show (label4);
1129   gtk_frame_set_label_widget (GTK_FRAME (frame2), label4);
1130   gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_LEFT);
1131
1132   table3 = gtk_table_new (1, 4, FALSE);
1133   gtk_widget_show (table3);
1134   gtk_box_pack_start (GTK_BOX (vbox3), table3, FALSE, FALSE, 0);
1135   gtk_container_set_border_width (GTK_CONTAINER (table3), 3);
1136
1137   hbox1 = gtk_hbox_new (FALSE, 0);
1138   gtk_widget_show (hbox1);
1139   gtk_table_attach (GTK_TABLE (table3), hbox1, 0, 1, 0, 1,
1140                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1141                     (GtkAttachOptions) (GTK_FILL), 0, 0);
1142
1143   label5 = gtk_label_new ("Value: ");
1144   gtk_widget_show (label5);
1145   gtk_table_attach (GTK_TABLE (table3), label5, 1, 2, 0, 1,
1146                     (GtkAttachOptions) (0),
1147                     (GtkAttachOptions) (0), 0, 0);
1148   gtk_misc_set_alignment (GTK_MISC (label5), 0, 0);
1149   gtk_label_set_justify (GTK_LABEL (label5), GTK_JUSTIFY_RIGHT);
1150
1151   surf_value_entry = gtk_entry_new ();
1152   gtk_widget_show (surf_value_entry);
1153   gtk_table_attach (GTK_TABLE (table3), surf_value_entry, 2, 3, 0, 1,
1154                     (GtkAttachOptions) (GTK_FILL),
1155                     (GtkAttachOptions) (0), 0, 0);
1156
1157   hbox2 = gtk_hbox_new (FALSE, 0);
1158   gtk_widget_show (hbox2);
1159   gtk_table_attach (GTK_TABLE (table3), hbox2, 3, 4, 0, 1,
1160                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1161                     (GtkAttachOptions) (GTK_FILL), 0, 0);
1162
1163   label2 = gtk_label_new ("Surface Flags");
1164   gtk_widget_show (label2);
1165   gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label2);
1166   gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);
1167
1168   table2 = gtk_table_new (5, 4, TRUE);
1169   gtk_widget_show (table2);
1170   gtk_container_add (GTK_CONTAINER (notebook1), table2);
1171
1172   content_solidbutton = gtk_toggle_button_new_with_mnemonic ("Solid");
1173   gtk_widget_show (content_solidbutton);
1174   gtk_table_attach (GTK_TABLE (table2), content_solidbutton, 0, 1, 0, 1,
1175                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1176                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1177
1178   content_windowbutton = gtk_toggle_button_new_with_mnemonic ("Window");
1179   gtk_widget_show (content_windowbutton);
1180   gtk_table_attach (GTK_TABLE (table2), content_windowbutton, 1, 2, 0, 1,
1181                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1182                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1183
1184   content_illusbutton = gtk_toggle_button_new_with_mnemonic ("Illusion");
1185   gtk_widget_show (content_illusbutton);
1186   gtk_table_attach (GTK_TABLE (table2), content_illusbutton, 2, 3, 0, 1,
1187                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1188                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1189
1190   content_lavabutton = gtk_toggle_button_new_with_mnemonic ("Lava");
1191   gtk_widget_show (content_lavabutton);
1192   gtk_table_attach (GTK_TABLE (table2), content_lavabutton, 3, 4, 0, 1,
1193                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1194                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1195
1196   content_slimebutton = gtk_toggle_button_new_with_mnemonic ("Slime");
1197   gtk_widget_show (content_slimebutton);
1198   gtk_table_attach (GTK_TABLE (table2), content_slimebutton, 0, 1, 1, 2,
1199                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1200                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1201
1202   content_waterbutton = gtk_toggle_button_new_with_mnemonic ("Water");
1203   gtk_widget_show (content_waterbutton);
1204   gtk_table_attach (GTK_TABLE (table2), content_waterbutton, 1, 2, 1, 2,
1205                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1206                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1207
1208   content_mistbutton = gtk_toggle_button_new_with_mnemonic ("Mist");
1209   gtk_widget_show (content_mistbutton);
1210   gtk_table_attach (GTK_TABLE (table2), content_mistbutton, 2, 3, 1, 2,
1211                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1212                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1213
1214   content_areaportalbutton = gtk_toggle_button_new_with_mnemonic ("AreaPortal");
1215   gtk_widget_show (content_areaportalbutton);
1216   gtk_table_attach (GTK_TABLE (table2), content_areaportalbutton, 3, 4, 1, 2,
1217                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1218                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1219
1220   content_playerclipbutton = gtk_toggle_button_new_with_mnemonic ("PlayerClip");
1221   gtk_widget_show (content_playerclipbutton);
1222   gtk_table_attach (GTK_TABLE (table2), content_playerclipbutton, 0, 1, 2, 3,
1223                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1224                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1225
1226   content_monsterclipbutton = gtk_toggle_button_new_with_mnemonic ("MonsterClip");
1227   gtk_widget_show (content_monsterclipbutton);
1228   gtk_table_attach (GTK_TABLE (table2), content_monsterclipbutton, 1, 2, 2, 3,
1229                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1230                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1231
1232   content_current0button = gtk_toggle_button_new_with_mnemonic ("Current 0");
1233   gtk_widget_show (content_current0button);
1234   gtk_table_attach (GTK_TABLE (table2), content_current0button, 2, 3, 2, 3,
1235                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1236                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1237
1238   content_current90button = gtk_toggle_button_new_with_mnemonic ("Current 90");
1239   gtk_widget_show (content_current90button);
1240   gtk_table_attach (GTK_TABLE (table2), content_current90button, 3, 4, 2, 3,
1241                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1242                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1243
1244   content_current180button = gtk_toggle_button_new_with_mnemonic ("Current 180");
1245   gtk_widget_show (content_current180button);
1246   gtk_table_attach (GTK_TABLE (table2), content_current180button, 0, 1, 3, 4,
1247                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1248                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1249
1250   content_current270button = gtk_toggle_button_new_with_mnemonic ("Current 270");
1251   gtk_widget_show (content_current270button);
1252   gtk_table_attach (GTK_TABLE (table2), content_current270button, 1, 2, 3, 4,
1253                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1254                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1255
1256   content_currentUPbutton = gtk_toggle_button_new_with_mnemonic ("Current UP");
1257   gtk_widget_show (content_currentUPbutton);
1258   gtk_table_attach (GTK_TABLE (table2), content_currentUPbutton, 2, 3, 3, 4,
1259                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1260                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1261
1262   content_currentDOWNbutton = gtk_toggle_button_new_with_mnemonic ("Current DOWN");
1263   gtk_widget_show (content_currentDOWNbutton);
1264   gtk_table_attach (GTK_TABLE (table2), content_currentDOWNbutton, 3, 4, 3, 4,
1265                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1266                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1267
1268   content_originbutton = gtk_toggle_button_new_with_mnemonic ("Origin");
1269   gtk_widget_show (content_originbutton);
1270   gtk_table_attach (GTK_TABLE (table2), content_originbutton, 0, 1, 4, 5,
1271                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1272                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1273
1274   content_detailbutton = gtk_toggle_button_new_with_mnemonic ("Detail");
1275   gtk_widget_show (content_detailbutton);
1276   gtk_table_attach (GTK_TABLE (table2), content_detailbutton, 1, 2, 4, 5,
1277                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1278                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1279
1280   content_ladderbutton = gtk_toggle_button_new_with_mnemonic ("Ladder");
1281   gtk_widget_show (content_ladderbutton);
1282   gtk_table_attach (GTK_TABLE (table2), content_ladderbutton, 2, 3, 4, 5,
1283                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1284                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1285
1286   content_camnoblockbutton = gtk_toggle_button_new_with_mnemonic ("Cam No Block");
1287   gtk_widget_show (content_camnoblockbutton);
1288   gtk_table_attach (GTK_TABLE (table2), content_camnoblockbutton, 3, 4, 4, 5,
1289                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1290                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
1291
1292   label3 = gtk_label_new ("Content Flags");
1293   gtk_widget_show (label3);
1294   gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label3);
1295   gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_LEFT);
1296
1297   // Signal Connects
1298   g_signal_connect ((gpointer) surface_lightbutton, "toggled",
1299                     G_CALLBACK (on_surface_lightbutton_toggled),
1300                     NULL);
1301   g_signal_connect ((gpointer) surface_slickbutton, "toggled",
1302                     G_CALLBACK (on_surface_slickbutton_toggled),
1303                     NULL);
1304   g_signal_connect ((gpointer) surface_skybutton, "toggled",
1305                     G_CALLBACK (on_surface_skybutton_toggled),
1306                     NULL);
1307   g_signal_connect ((gpointer) surface_warpbutton, "toggled",
1308                     G_CALLBACK (on_surface_warpbutton_toggled),
1309                     NULL);
1310   g_signal_connect ((gpointer) surface_trans33button, "toggled",
1311                     G_CALLBACK (on_surface_trans33button_toggled),
1312                     NULL);
1313   g_signal_connect ((gpointer) surface_trans66button, "toggled",
1314                     G_CALLBACK (on_surface_trans66button_toggled),
1315                     NULL);
1316   g_signal_connect ((gpointer) surface_flowingbutton, "toggled",
1317                     G_CALLBACK (on_surface_flowingbutton_toggled),
1318                     NULL);
1319   g_signal_connect ((gpointer) surface_nodrawbutton, "toggled",
1320                     G_CALLBACK (on_surface_nodrawbutton_toggled),
1321                     NULL);
1322   g_signal_connect ((gpointer) surface_tallwallbutton, "toggled",
1323                     G_CALLBACK (on_surface_tallwallbutton_toggled),
1324                     NULL);
1325   g_signal_connect ((gpointer) surface_alphatexbutton, "toggled",
1326                     G_CALLBACK (on_surface_alphatexbutton_toggled),
1327                     NULL);
1328   g_signal_connect ((gpointer) surface_animspeedbutton, "toggled",
1329                     G_CALLBACK (on_surface_animspeedbutton_toggled),
1330                     NULL);
1331   g_signal_connect ((gpointer) surface_undulatebutton, "toggled",
1332                     G_CALLBACK (on_surface_undulatebutton_toggled),
1333                     NULL);
1334
1335   g_signal_connect ((gpointer) surf_gravel_radiobutton, "toggled",
1336                     G_CALLBACK (on_surf_gravel_radiobutton_toggled),
1337                     NULL);
1338   g_signal_connect ((gpointer) surf_metal_radiobutton, "toggled",
1339                     G_CALLBACK (on_surf_metal_radiobutton_toggled),
1340                     NULL);
1341   g_signal_connect ((gpointer) surf_stone_radiobutton, "toggled",
1342                     G_CALLBACK (on_surf_stone_radiobutton_toggled),
1343                     NULL);
1344   g_signal_connect ((gpointer) surf_wood_radiobutton, "toggled",
1345                     G_CALLBACK (on_surf_wood_radiobutton_toggled),
1346                     NULL);
1347
1348   g_signal_connect ((gpointer) surf_value_entry, "changed",
1349                     G_CALLBACK (on_surf_value_entry_changed),
1350                     NULL);
1351   g_signal_connect ((gpointer) surf_value_entry, "insert_text",
1352                     G_CALLBACK (on_surf_value_entry_insert_text),
1353                     NULL);
1354   g_signal_connect ((gpointer) content_solidbutton, "toggled",
1355                     G_CALLBACK (on_content_solidbutton_toggled),
1356                     NULL);
1357   g_signal_connect ((gpointer) content_windowbutton, "toggled",
1358                     G_CALLBACK (on_content_windowbutton_toggled),
1359                     NULL);
1360   g_signal_connect ((gpointer) content_illusbutton, "toggled",
1361                     G_CALLBACK (on_content_illusbutton_toggled),
1362                     NULL);
1363   g_signal_connect ((gpointer) content_lavabutton, "toggled",
1364                     G_CALLBACK (on_content_lavabutton_toggled),
1365                     NULL);
1366   g_signal_connect ((gpointer) content_slimebutton, "toggled",
1367                     G_CALLBACK (on_content_slimebutton_toggled),
1368                     NULL);
1369   g_signal_connect ((gpointer) content_waterbutton, "toggled",
1370                     G_CALLBACK (on_content_waterbutton_toggled),
1371                     NULL);
1372   g_signal_connect ((gpointer) content_mistbutton, "toggled",
1373                     G_CALLBACK (on_content_mistbutton_toggled),
1374                     NULL);
1375   g_signal_connect ((gpointer) content_areaportalbutton, "toggled",
1376                     G_CALLBACK (on_content_areaportalbutton_toggled),
1377                     NULL);
1378   g_signal_connect ((gpointer) content_playerclipbutton, "toggled",
1379                     G_CALLBACK (on_content_playerclipbutton_toggled),
1380                     NULL);
1381   g_signal_connect ((gpointer) content_monsterclipbutton, "toggled",
1382                     G_CALLBACK (on_content_monsterclipbutton_toggled),
1383                     NULL);
1384   g_signal_connect ((gpointer) content_current0button, "toggled",
1385                     G_CALLBACK (on_content_current0button_toggled),
1386                     NULL);
1387   g_signal_connect ((gpointer) content_current90button, "toggled",
1388                     G_CALLBACK (on_content_current90button_toggled),
1389                     NULL);
1390   g_signal_connect ((gpointer) content_current180button, "toggled",
1391                     G_CALLBACK (on_content_current180button_toggled),
1392                     NULL);
1393   g_signal_connect ((gpointer) content_current270button, "toggled",
1394                     G_CALLBACK (on_content_current270button_toggled),
1395                     NULL);
1396   g_signal_connect ((gpointer) content_currentUPbutton, "toggled",
1397                     G_CALLBACK (on_content_currentUPbutton_toggled),
1398                     NULL);
1399   g_signal_connect ((gpointer) content_currentDOWNbutton, "toggled",
1400                     G_CALLBACK (on_content_currentDOWNbutton_toggled),
1401                     NULL);
1402   g_signal_connect ((gpointer) content_originbutton, "toggled",
1403                     G_CALLBACK (on_content_originbutton_toggled),
1404                     NULL);
1405   g_signal_connect ((gpointer) content_detailbutton, "toggled",
1406                     G_CALLBACK (on_content_detailbutton_toggled),
1407                     NULL);
1408   g_signal_connect ((gpointer) content_ladderbutton, "toggled",
1409                     G_CALLBACK (on_content_ladderbutton_toggled),
1410                     NULL);
1411   g_signal_connect ((gpointer) content_camnoblockbutton, "toggled",
1412                     G_CALLBACK (on_content_camnoblockbutton_toggled),
1413                     NULL);
1414
1415
1416   return frame1;
1417 }
1418