/* ***********************IMPORTANT *********************************************
 *  Copyright (C) 2004-2007 Thierry Lagarde <tlagarde@users.sourceforge.net>
 *  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.
 *
 *
 *                      ********************
 *
 *
 *  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 Library General Public License for more details.
 *
 *
 *                      ********************
 *
 *
 * You are highly encouraged to send your changes to <tlagarde@users.sourceforge.net>
 * for possible incorporation into the main distribution.
 * By sending these changes to <tlagarde@users.sourceforge.net>,
 * it is assumed that you are offering <tlagarde@users.sourceforge.net>
 * the unlimited, non-exclusive right to reuse, modify, and relicense the code.
 *
 *
 *                      ********************
 *
 *  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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **************************************************************************************/
#ifdef    __VCN_ENABLE

#include <gtk/gtk.h>

#include "Vnc_Callbacks.h"
#include "Vnc_Interface.h"
#include "../Declaration_Constante.h"
#include "Root_Interface.h"

GtkWidget *create_win_Vnc_Connect (void)
{
	scrolledwindow_Vnc_Connect = gtk_scrolled_window_new (NULL, NULL);
	gtk_widget_show (scrolledwindow_Vnc_Connect);
	gtk_container_add (GTK_CONTAINER (viewport_Modules), scrolledwindow_Vnc_Connect);
	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow_Vnc_Connect), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

	viewport_Vnc_Connect = gtk_viewport_new (NULL, NULL);
	gtk_widget_show (viewport_Vnc_Connect);
	gtk_container_add (GTK_CONTAINER (scrolledwindow_Vnc_Connect), viewport_Vnc_Connect);
	gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport_Vnc_Connect), GTK_SHADOW_NONE);

	hbox_Vnc_Connect = gtk_hbox_new (FALSE, 0);
	gtk_widget_show (hbox_Vnc_Connect);
	gtk_container_add (GTK_CONTAINER (viewport_Vnc_Connect), hbox_Vnc_Connect);

	fixed_Vnc_Connect_Gauche = gtk_fixed_new ();
	gtk_widget_show (fixed_Vnc_Connect_Gauche);
	gtk_box_pack_start (GTK_BOX (hbox_Vnc_Connect), fixed_Vnc_Connect_Gauche, TRUE, TRUE, 0);

	vbox_Vnc_Connect = gtk_vbox_new (FALSE, 0);
	gtk_widget_show (vbox_Vnc_Connect);
	gtk_box_pack_start (GTK_BOX (hbox_Vnc_Connect), vbox_Vnc_Connect, TRUE, TRUE, 0);

	fixed_Vnc_Connect_Haut = gtk_fixed_new ();
	gtk_widget_show (fixed_Vnc_Connect_Haut);
	gtk_box_pack_start (GTK_BOX (vbox_Vnc_Connect), fixed_Vnc_Connect_Haut, TRUE, TRUE, 0);

	fixed_Vnc_Connect_Milieu = gtk_fixed_new ();
	gtk_widget_show (fixed_Vnc_Connect_Milieu);
	gtk_box_pack_start (GTK_BOX (vbox_Vnc_Connect), fixed_Vnc_Connect_Milieu, TRUE, TRUE, 0);

	entry_Vnc_Connect_User = gtk_entry_new ();
	gtk_widget_show (entry_Vnc_Connect_User);
	gtk_fixed_put (GTK_FIXED (fixed_Vnc_Connect_Milieu), entry_Vnc_Connect_User, 184, 16);
	gtk_widget_set_size_request (entry_Vnc_Connect_User, 159, 21);

	entry_Vnc_Connect_Password = gtk_entry_new ();
	gtk_widget_show (entry_Vnc_Connect_Password);
	gtk_fixed_put (GTK_FIXED (fixed_Vnc_Connect_Milieu), entry_Vnc_Connect_Password, 184, 48);
	gtk_widget_set_size_request (entry_Vnc_Connect_Password, 159, 21);
	gtk_entry_set_visibility (GTK_ENTRY (entry_Vnc_Connect_Password), FALSE);

/*	entry_Vnc_Connect_Domaine = gtk_entry_new ();
	gtk_widget_show (entry_Vnc_Connect_Domaine);
	gtk_fixed_put (GTK_FIXED (fixed_Vnc_Connect_Milieu), entry_Vnc_Connect_Domaine, 184, 80);
	gtk_widget_set_size_request (entry_Vnc_Connect_Domaine, 159, 21);
	gtk_entry_set_text (GTK_ENTRY (entry_Vnc_Connect_Domaine), "localhost");*/

	label_Vnc_Connect_User = gtk_label_new ("User : ");
	gtk_widget_show (label_Vnc_Connect_User);
	gtk_fixed_put (GTK_FIXED (fixed_Vnc_Connect_Milieu), label_Vnc_Connect_User, 136, 16);
	gtk_widget_set_size_request (label_Vnc_Connect_User, 40, 16);

	/*label_Vnc_Connect_IP = gtk_label_new ("IP server:");
	gtk_widget_show (label_Vnc_Connect_IP);
	gtk_fixed_put (GTK_FIXED (fixed_Vnc_Connect_Milieu), label_Vnc_Connect_IP, 128, 83);
	gtk_widget_set_size_request (label_Vnc_Connect_IP, 54, 16);*/

	button_Vnc_Connect = gtk_button_new ();
	gtk_widget_show (button_Vnc_Connect);
	gtk_fixed_put (GTK_FIXED (fixed_Vnc_Connect_Milieu), button_Vnc_Connect, 216, 110);
	gtk_widget_set_size_request (button_Vnc_Connect, 96, 32);
	GTK_WIDGET_SET_FLAGS (button_Vnc_Connect, GTK_CAN_DEFAULT);

	alignment_button_Vnc_Connect = gtk_alignment_new (0.5, 0.5, 0, 0);
	gtk_widget_show (alignment_button_Vnc_Connect);
	gtk_container_add (GTK_CONTAINER (button_Vnc_Connect), alignment_button_Vnc_Connect);

	hbox_button_Vnc_Connect = gtk_hbox_new (FALSE, 2);
	gtk_widget_show (hbox_button_Vnc_Connect);
	gtk_container_add (GTK_CONTAINER (alignment_button_Vnc_Connect), hbox_button_Vnc_Connect);

	image_button_Vnc_Connect = gtk_image_new_from_file (PATH_ICONE "Start.png");
	gtk_widget_show (image_button_Vnc_Connect);
	gtk_box_pack_start (GTK_BOX (hbox_button_Vnc_Connect), image_button_Vnc_Connect, FALSE, FALSE, 0);

	label_button_Vnc_Connect = gtk_label_new_with_mnemonic ("Start");
	gtk_widget_show (label_button_Vnc_Connect);
	gtk_box_pack_start (GTK_BOX (hbox_button_Vnc_Connect), label_button_Vnc_Connect, FALSE, FALSE, 0);

	label_Vnc_Connect_Password = gtk_label_new ("Password :");
	gtk_widget_show (label_Vnc_Connect_Password);
	gtk_fixed_put (GTK_FIXED (fixed_Vnc_Connect_Milieu), label_Vnc_Connect_Password, 128, 51);
	gtk_widget_set_size_request (label_Vnc_Connect_Password, 51, 16);

	image_Vnc_Connect = gtk_image_new_from_file (PATH_ICONE "VNC.png");
	gtk_widget_show (image_Vnc_Connect);
	gtk_fixed_put (GTK_FIXED (fixed_Vnc_Connect_Milieu), image_Vnc_Connect, 0, 0);
	gtk_widget_set_size_request (image_Vnc_Connect, 128, 128);

	fixed_Vnc_Connect_Bas = gtk_fixed_new ();
	gtk_widget_show (fixed_Vnc_Connect_Bas);
	gtk_box_pack_start (GTK_BOX (vbox_Vnc_Connect), fixed_Vnc_Connect_Bas, TRUE, TRUE, 0);

	fixed_Vnc_Connect_Droit = gtk_fixed_new ();
	gtk_widget_show (fixed_Vnc_Connect_Droit);
	gtk_box_pack_start (GTK_BOX (hbox_Vnc_Connect), fixed_Vnc_Connect_Droit, TRUE, TRUE, 0);

	g_signal_connect ((gpointer) button_Vnc_Connect, "clicked", G_CALLBACK (on_button_Vnc_Connect_clicked), NULL);

	return scrolledwindow_Vnc_Connect;
}


#endif
