/*****************************************************************************/

/*
 *      autocalibration.c -- REALmagic calibration application 
 *
 *      Copyright (C) 2000 Sigma Designs
 *                    written by Nicolas Vignal <nicolas_vignal@sdesigns.com>
 *                    modified by Emmanuel Michon <emmanuel_michon@sdesigns.com>
 *
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include "define.h"

#include "autocalibration.h"
#include "autocalibrationCB.h"

#include"./pixmaps/REALmagic.xpm"

GtkWidget*
create_ConfigurationInfo (void)
{
  GtkWidget *ConfigurationInfo;
  GtkWidget *vbox6;
  GtkWidget *text;
  GtkWidget *hbuttonbox2;
  GtkWidget *Ok;
  GtkWidget *Cancel;

  ConfigurationInfo = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_object_set_data (GTK_OBJECT (ConfigurationInfo), "ConfigurationInfo", ConfigurationInfo);
  gtk_widget_set_usize (ConfigurationInfo, 470, 95);
  gtk_container_set_border_width (GTK_CONTAINER (ConfigurationInfo), 10);
  gtk_window_set_title (GTK_WINDOW (ConfigurationInfo), _("Configuration Info..."));
  gtk_window_set_position (GTK_WINDOW (ConfigurationInfo), GTK_WIN_POS_CENTER);
  gtk_window_set_policy (GTK_WINDOW (ConfigurationInfo), FALSE, FALSE, FALSE);

  vbox6 = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (vbox6);
  gtk_object_set_data_full (GTK_OBJECT (ConfigurationInfo), "vbox6", vbox6,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox6);
  gtk_container_add (GTK_CONTAINER (ConfigurationInfo), vbox6);

  text = gtk_label_new (_("Starting Automatic Color Calibration. "
			  "If your monitor resolution is less than root "
			  "window resolution (using ViewPort) please join the upper left corner. "
			  "Your monitor will be blanked out for a few seconds..."));
  gtk_widget_ref (text);
  gtk_object_set_data_full (GTK_OBJECT (ConfigurationInfo), "text", text,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (text);
  gtk_box_pack_start (GTK_BOX (vbox6), text, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (text), GTK_JUSTIFY_LEFT);
  gtk_label_set_line_wrap (GTK_LABEL (text), TRUE);

  hbuttonbox2 = gtk_hbutton_box_new ();
  gtk_widget_ref (hbuttonbox2);
  gtk_object_set_data_full (GTK_OBJECT (ConfigurationInfo), "hbuttonbox2", hbuttonbox2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbuttonbox2);
  gtk_box_pack_start (GTK_BOX (vbox6), hbuttonbox2, TRUE, TRUE, 0);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox2), GTK_BUTTONBOX_SPREAD);

  Ok = gtk_button_new_with_label (_("OK"));
  gtk_widget_ref (Ok);
  gtk_object_set_data_full (GTK_OBJECT (ConfigurationInfo), "Ok", Ok,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (Ok);
  gtk_container_add (GTK_CONTAINER (hbuttonbox2), Ok);

  Cancel = gtk_button_new_with_label (_("Cancel"));
  gtk_widget_ref (Cancel);
  gtk_object_set_data_full (GTK_OBJECT (ConfigurationInfo), "Cancel", Cancel,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (Cancel);
  gtk_container_add (GTK_CONTAINER (hbuttonbox2), Cancel);

  gtk_signal_connect (GTK_OBJECT (ConfigurationInfo), "destroy",
                      GTK_SIGNAL_FUNC (gtk_widget_destroy),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (Ok), "clicked",
                      GTK_SIGNAL_FUNC (CI_Ok_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (Cancel), "clicked",
                      GTK_SIGNAL_FUNC (CI_Cancel_clicked),
                      NULL);

/* addon*/
 	/* set window icon*/
	set_window_icon(ConfigurationInfo,REALmagic_xpm);
/* end of addon*/

  return ConfigurationInfo;
}

