/*
 * DO NOT EDIT THIS FILE - it is generated by Glade.
 */

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>

#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>

#include "callbacks.h"
#include "interface.h"
#include "support.h"

#define GLADE_HOOKUP_OBJECT(component,widget,name) \
  g_object_set_data_full (G_OBJECT (component), name, \
    gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)

#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
  g_object_set_data (G_OBJECT (component), name, widget)

GtkWidget*
create_window1 (void)
{
  GtkWidget *window1;
  GtkWidget *notebook1;
  GtkWidget *fixed1;
  GtkWidget *textview1;
  GtkWidget *name_textbox;
  GtkWidget *team_textbox;
  GtkWidget *show_dialog_again;
  GtkWidget *button1;
  GtkWidget *button2;
  GtkWidget *name_label;
  GtkWidget *team_label;
  GtkWidget *label1;
  GtkWidget *fixed2;
  GtkObject *gamma_spin_adj;
  GtkWidget *gamma_spin;
  GtkWidget *textview2;
  GtkWidget *gamma_label;
  GtkWidget *show_statistics;
  GtkWidget *flightsim_mode;
  GtkWidget *resolution_box;
  GtkWidget *resolution_label;
  GtkWidget *label2;
  GtkWidget *fixed3;
  GtkWidget *textview3;
  GtkObject *sound_spin_adj;
  GtkWidget *sound_spin;
  GtkObject *music_spin_adj;
  GtkWidget *music_spin;
  GtkWidget *music_label;
  GtkWidget *sound_label;
  GtkWidget *label3;
  GtkWidget *fixed5;
  GtkWidget *textview4;
  GtkWidget *label4;
  GtkTooltips *tooltips;

  tooltips = gtk_tooltips_new ();

  window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_tooltips_set_tip (tooltips, window1, "This tool is intended to replace the use of a BATCH file and provide Cube with a cross-platform graphical configuration tool.  The tooltips in this program should provide all the documentation required.", NULL);
  gtk_window_set_title (GTK_WINDOW (window1), "Cube Configuration");
  gtk_window_set_position (GTK_WINDOW (window1), GTK_WIN_POS_CENTER);

  notebook1 = gtk_notebook_new ();
  gtk_widget_show (notebook1);
  gtk_container_add (GTK_CONTAINER (window1), notebook1);

  fixed1 = gtk_fixed_new ();
  gtk_widget_show (fixed1);
  gtk_container_add (GTK_CONTAINER (notebook1), fixed1);

  textview1 = gtk_text_view_new ();
  gtk_widget_show (textview1);
  gtk_fixed_put (GTK_FIXED (fixed1), textview1, 16, 8);
  gtk_widget_set_size_request (textview1, 232, 48);
  gtk_text_view_set_editable (GTK_TEXT_VIEW (textview1), FALSE);
  gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (textview1), GTK_WRAP_WORD);
  gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview1)), "These are the only settings that you really need to change. All others are optional.", -1);

  name_textbox = gtk_entry_new ();
  gtk_widget_show (name_textbox);
  gtk_fixed_put (GTK_FIXED (fixed1), name_textbox, 70, 62);
  gtk_widget_set_size_request (name_textbox, 140, 23);
  gtk_tooltips_set_tip (tooltips, name_textbox, "This is mostly for multiplayer. Other people will be able to identify you based on the name you give here in statistics or chat.", NULL);

  team_textbox = gtk_entry_new ();
  gtk_widget_show (team_textbox);
  gtk_fixed_put (GTK_FIXED (fixed1), team_textbox, 70, 94);
  gtk_widget_set_size_request (team_textbox, 140, 23);
  gtk_tooltips_set_tip (tooltips, team_textbox, "Another feature for multiplayer, this assigns you to a team for team-based multiplayer games.", NULL);

  show_dialog_again = gtk_check_button_new_with_mnemonic ("Don't show this again");
  gtk_fixed_put (GTK_FIXED (fixed1), show_dialog_again, 48, 128);
  gtk_widget_set_size_request (show_dialog_again, 150, 20);

  button1 = gtk_button_new_from_stock ("gtk-media-play");
  gtk_widget_show (button1);
  gtk_fixed_put (GTK_FIXED (fixed1), button1, 56, 152);
  gtk_widget_set_size_request (button1, 64, 24);
  gtk_tooltips_set_tip (tooltips, button1, "Begin playing Cube!", NULL);

  button2 = gtk_button_new_from_stock ("gtk-close");
  gtk_widget_show (button2);
  gtk_fixed_put (GTK_FIXED (fixed1), button2, 128, 152);
  gtk_widget_set_size_request (button2, 64, 24);
  gtk_tooltips_set_tip (tooltips, button2, "Exit without playing Cube or saving settings.", NULL);

  name_label = gtk_label_new ("Name");
  gtk_widget_show (name_label);
  gtk_fixed_put (GTK_FIXED (fixed1), name_label, 24, 64);
  gtk_widget_set_size_request (name_label, 37, 16);

  team_label = gtk_label_new ("Team");
  gtk_widget_show (team_label);
  gtk_fixed_put (GTK_FIXED (fixed1), team_label, 24, 96);
  gtk_widget_set_size_request (team_label, 37, 16);

  label1 = gtk_label_new ("Basic");
  gtk_widget_show (label1);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label1);

  fixed2 = gtk_fixed_new ();
  gtk_widget_show (fixed2);
  gtk_container_add (GTK_CONTAINER (notebook1), fixed2);

  gamma_spin_adj = gtk_adjustment_new (100, 0, 100, 1, 10, 10);
  gamma_spin = gtk_spin_button_new (GTK_ADJUSTMENT (gamma_spin_adj), 1, 0);
  gtk_widget_show (gamma_spin);
  gtk_fixed_put (GTK_FIXED (fixed2), gamma_spin, 120, 48);
  gtk_widget_set_size_request (gamma_spin, 50, 23);
  gtk_tooltips_set_tip (tooltips, gamma_spin, "Gamma can range from 0 to 100.  It's recommended that you leave it at 100.", NULL);

  textview2 = gtk_text_view_new ();
  gtk_widget_show (textview2);
  gtk_fixed_put (GTK_FIXED (fixed2), textview2, 8, 8);
  gtk_widget_set_size_request (textview2, 256, 32);
  gtk_text_view_set_editable (GTK_TEXT_VIEW (textview2), FALSE);
  gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (textview2), GTK_WRAP_WORD);
  gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview2)), "These are your video settings. Use lower screen resolutions on older hardware.", -1);

  gamma_label = gtk_label_new ("Gamma");
  gtk_widget_show (gamma_label);
  gtk_fixed_put (GTK_FIXED (fixed2), gamma_label, 64, 52);
  gtk_widget_set_size_request (gamma_label, 47, 16);

  show_statistics = gtk_check_button_new_with_mnemonic ("Show statistics?");
  gtk_widget_show (show_statistics);
  gtk_fixed_put (GTK_FIXED (fixed2), show_statistics, 56, 80);
  gtk_widget_set_size_request (show_statistics, 120, 20);
  gtk_tooltips_set_tip (tooltips, show_statistics, "This setting determines whether or not in game statistics are shown at the side of your screen.", NULL);

  flightsim_mode = gtk_check_button_new_with_mnemonic ("Flightsim mode?");
  gtk_widget_show (flightsim_mode);
  gtk_fixed_put (GTK_FIXED (fixed2), flightsim_mode, 56, 104);
  gtk_widget_set_size_request (flightsim_mode, 128, 20);
  gtk_tooltips_set_tip (tooltips, flightsim_mode, "Flight simulation mode inverts the mouse such that pushing the mouse forward causes your view to face downward and pulling the mouse backward causes your view to face upward.\nSome players who enjoy flying games prefer this setting, but most first-person shooter players prefer not to use it.", NULL);

  resolution_box = gtk_combo_box_new_text ();
  gtk_widget_show (resolution_box);
  gtk_fixed_put (GTK_FIXED (fixed2), resolution_box, 56, 160);
  gtk_widget_set_size_request (resolution_box, 128, 32);
  gtk_combo_box_append_text (GTK_COMBO_BOX (resolution_box), "800 by 600");
  gtk_combo_box_append_text (GTK_COMBO_BOX (resolution_box), "1024 by 768");
  gtk_combo_box_append_text (GTK_COMBO_BOX (resolution_box), "1152 by 864");
  gtk_combo_box_append_text (GTK_COMBO_BOX (resolution_box), "1280 by 768");
  gtk_combo_box_append_text (GTK_COMBO_BOX (resolution_box), "1280 by 960");
  gtk_combo_box_append_text (GTK_COMBO_BOX (resolution_box), "1280 by 1024");
  gtk_combo_box_append_text (GTK_COMBO_BOX (resolution_box), "1600 by 1200");
  gtk_combo_box_append_text (GTK_COMBO_BOX (resolution_box), "1792 by 1344");
  gtk_combo_box_append_text (GTK_COMBO_BOX (resolution_box), "1800 by 1440");
  gtk_combo_box_append_text (GTK_COMBO_BOX (resolution_box), "1856 by 1392");
  gtk_combo_box_append_text (GTK_COMBO_BOX (resolution_box), "1920 by 1080");
  gtk_combo_box_append_text (GTK_COMBO_BOX (resolution_box), "1920 by 1200");
  gtk_combo_box_append_text (GTK_COMBO_BOX (resolution_box), "1920 by 1440");
  gtk_combo_box_append_text (GTK_COMBO_BOX (resolution_box), "2048 by 1536");

  resolution_label = gtk_label_new ("Screen Resolution\n(Default: 1024x768)");
  gtk_widget_show (resolution_label);
  gtk_fixed_put (GTK_FIXED (fixed2), resolution_label, 56, 128);
  gtk_widget_set_size_request (resolution_label, 128, 32);
  gtk_label_set_justify (GTK_LABEL (resolution_label), GTK_JUSTIFY_CENTER);

  label2 = gtk_label_new ("Video");
  gtk_widget_show (label2);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label2);

  fixed3 = gtk_fixed_new ();
  gtk_widget_show (fixed3);
  gtk_container_add (GTK_CONTAINER (notebook1), fixed3);

  textview3 = gtk_text_view_new ();
  gtk_widget_show (textview3);
  gtk_fixed_put (GTK_FIXED (fixed3), textview3, 8, 8);
  gtk_widget_set_size_request (textview3, 232, 48);
  gtk_text_view_set_editable (GTK_TEXT_VIEW (textview3), FALSE);
  gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (textview3), GTK_WRAP_WORD);
  gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview3)), "If you prefer more music than sound effects or vice versa, change these settings.", -1);

  sound_spin_adj = gtk_adjustment_new (150, 0, 255, 1, 10, 10);
  sound_spin = gtk_spin_button_new (GTK_ADJUSTMENT (sound_spin_adj), 1, 0);
  gtk_widget_show (sound_spin);
  gtk_fixed_put (GTK_FIXED (fixed3), sound_spin, 104, 96);
  gtk_widget_set_size_request (sound_spin, 50, 23);
  gtk_tooltips_set_tip (tooltips, sound_spin, "Sound volume can range from 0 to 255.", NULL);

  music_spin_adj = gtk_adjustment_new (150, 0, 255, 1, 10, 10);
  music_spin = gtk_spin_button_new (GTK_ADJUSTMENT (music_spin_adj), 1, 0);
  gtk_widget_show (music_spin);
  gtk_fixed_put (GTK_FIXED (fixed3), music_spin, 104, 64);
  gtk_widget_set_size_request (music_spin, 50, 23);
  gtk_tooltips_set_tip (tooltips, music_spin, "Music volume can range from 0 to 255.", NULL);

  music_label = gtk_label_new ("Music");
  gtk_widget_show (music_label);
  gtk_fixed_put (GTK_FIXED (fixed3), music_label, 56, 68);
  gtk_widget_set_size_request (music_label, 44, 16);

  sound_label = gtk_label_new ("Sound");
  gtk_widget_show (sound_label);
  gtk_fixed_put (GTK_FIXED (fixed3), sound_label, 56, 100);
  gtk_widget_set_size_request (sound_label, 43, 16);

  label3 = gtk_label_new ("Audio");
  gtk_widget_show (label3);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 2), label3);

  fixed5 = gtk_fixed_new ();
  gtk_widget_show (fixed5);
  gtk_container_add (GTK_CONTAINER (notebook1), fixed5);

  textview4 = gtk_text_view_new ();
  gtk_widget_show (textview4);
  gtk_fixed_put (GTK_FIXED (fixed5), textview4, 16, 16);
  gtk_widget_set_size_request (textview4, 208, 192);
  gtk_text_view_set_editable (GTK_TEXT_VIEW (textview4), FALSE);
  gtk_text_view_set_justification (GTK_TEXT_VIEW (textview4), GTK_JUSTIFY_CENTER);
  gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (textview4), GTK_WRAP_WORD);
  gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview4)), "W. John Holden\nTutonka3000@aol.com\n\n\nVersion 0.0.3\n\n\nThank you for playing Cube Legends.\n\n\nhttp://gentoobox.rh.ncsu.edu/cl", -1);

  label4 = gtk_label_new ("About");
  gtk_widget_show (label4);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 3), label4);

  g_signal_connect ((gpointer) window1, "destroy",
                    G_CALLBACK (on_window1_destroy),
                    NULL);
  g_signal_connect ((gpointer) button1, "clicked",
                    G_CALLBACK (on_button1_clicked),
                    NULL);
  g_signal_connect ((gpointer) button2, "clicked",
                    G_CALLBACK (on_button2_clicked),
                    NULL);
  g_signal_connect ((gpointer) resolution_box, "changed",
                    G_CALLBACK (on_resolution_box_changed),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (window1, window1, "window1");
  GLADE_HOOKUP_OBJECT (window1, notebook1, "notebook1");
  GLADE_HOOKUP_OBJECT (window1, fixed1, "fixed1");
  GLADE_HOOKUP_OBJECT (window1, textview1, "textview1");
  GLADE_HOOKUP_OBJECT (window1, name_textbox, "name_textbox");
  GLADE_HOOKUP_OBJECT (window1, team_textbox, "team_textbox");
  GLADE_HOOKUP_OBJECT (window1, show_dialog_again, "show_dialog_again");
  GLADE_HOOKUP_OBJECT (window1, button1, "button1");
  GLADE_HOOKUP_OBJECT (window1, button2, "button2");
  GLADE_HOOKUP_OBJECT (window1, name_label, "name_label");
  GLADE_HOOKUP_OBJECT (window1, team_label, "team_label");
  GLADE_HOOKUP_OBJECT (window1, label1, "label1");
  GLADE_HOOKUP_OBJECT (window1, fixed2, "fixed2");
  GLADE_HOOKUP_OBJECT (window1, gamma_spin, "gamma_spin");
  GLADE_HOOKUP_OBJECT (window1, textview2, "textview2");
  GLADE_HOOKUP_OBJECT (window1, gamma_label, "gamma_label");
  GLADE_HOOKUP_OBJECT (window1, show_statistics, "show_statistics");
  GLADE_HOOKUP_OBJECT (window1, flightsim_mode, "flightsim_mode");
  GLADE_HOOKUP_OBJECT (window1, resolution_box, "resolution_box");
  GLADE_HOOKUP_OBJECT (window1, resolution_label, "resolution_label");
  GLADE_HOOKUP_OBJECT (window1, label2, "label2");
  GLADE_HOOKUP_OBJECT (window1, fixed3, "fixed3");
  GLADE_HOOKUP_OBJECT (window1, textview3, "textview3");
  GLADE_HOOKUP_OBJECT (window1, sound_spin, "sound_spin");
  GLADE_HOOKUP_OBJECT (window1, music_spin, "music_spin");
  GLADE_HOOKUP_OBJECT (window1, music_label, "music_label");
  GLADE_HOOKUP_OBJECT (window1, sound_label, "sound_label");
  GLADE_HOOKUP_OBJECT (window1, label3, "label3");
  GLADE_HOOKUP_OBJECT (window1, fixed5, "fixed5");
  GLADE_HOOKUP_OBJECT (window1, textview4, "textview4");
  GLADE_HOOKUP_OBJECT (window1, label4, "label4");
  GLADE_HOOKUP_OBJECT_NO_REF (window1, tooltips, "tooltips");

  return window1;
}

GtkWidget*
create_dialog1 (void)
{
  GtkWidget *dialog1;
  GtkWidget *dialog_vbox1;
  GtkWidget *fixed6;
  GtkWidget *textview6;
  GtkWidget *dialog_action_area1;
  GtkWidget *okbutton1;

  dialog1 = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog1), "Warning");
  gtk_window_set_position (GTK_WINDOW (dialog1), GTK_WIN_POS_CENTER);
  gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog1), TRUE);
  gtk_window_set_type_hint (GTK_WINDOW (dialog1), GDK_WINDOW_TYPE_HINT_DIALOG);

  dialog_vbox1 = GTK_DIALOG (dialog1)->vbox;
  gtk_widget_show (dialog_vbox1);

  fixed6 = gtk_fixed_new ();
  gtk_widget_show (fixed6);
  gtk_box_pack_start (GTK_BOX (dialog_vbox1), fixed6, TRUE, TRUE, 0);

  textview6 = gtk_text_view_new ();
  gtk_widget_show (textview6);
  gtk_fixed_put (GTK_FIXED (fixed6), textview6, 8, 8);
  gtk_widget_set_size_request (textview6, 176, 144);
  gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (textview6), GTK_WRAP_WORD);
  gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview6)), "Be careful not to set screen resolution beyond what your monitor can support.\nIf you find yourself staring at a black screen, use CTRL+ALT+DELETE (on Windows) or CTRL+ALT+F2 (on Linux/Unix) to close Cube through the operating system.", -1);

  dialog_action_area1 = GTK_DIALOG (dialog1)->action_area;
  gtk_widget_show (dialog_action_area1);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);

  okbutton1 = gtk_button_new_from_stock ("gtk-ok");
  gtk_widget_show (okbutton1);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog1), okbutton1, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) dialog1, "close",
                    G_CALLBACK (on_dialog1_close),
                    NULL);
  g_signal_connect ((gpointer) okbutton1, "clicked",
                    G_CALLBACK (on_okbutton1_clicked),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog1, "dialog1");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (dialog1, fixed6, "fixed6");
  GLADE_HOOKUP_OBJECT (dialog1, textview6, "textview6");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (dialog1, okbutton1, "okbutton1");

  return dialog1;
}

