/* ***********************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         __BULLE_PORT_ENABLE

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

#include <gtk/gtk.h>

#include "Bulle_Port_Callbacks.h"
#include "Bulle_Port_Interface.h"
#include "Root_Interface.h"
#include "../Declaration_Constante.h"
#include "Style.h"

GtkWidget *create_Bulle_Port (void)
{

	Bulle_Port = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	gtk_window_set_title (GTK_WINDOW (Bulle_Port), "Serveur Web (Port 80)");
	gtk_window_set_position (GTK_WINDOW (Bulle_Port), GTK_WIN_POS_MOUSE);
	gtk_window_set_resizable (GTK_WINDOW (Bulle_Port), FALSE);
	gtk_window_set_skip_taskbar_hint (GTK_WINDOW (Bulle_Port), TRUE);
	gtk_window_set_skip_pager_hint (GTK_WINDOW (Bulle_Port), TRUE);
	gtk_window_set_type_hint (GTK_WINDOW (Bulle_Port), GDK_WINDOW_TYPE_HINT_TOOLBAR);
	gtk_window_set_transient_for (GTK_WINDOW (Bulle_Port), GTK_WINDOW (window_root));
	

	vbox_Bulle_Port = gtk_vbox_new (FALSE, 3);
	gtk_widget_show (vbox_Bulle_Port);
	gtk_container_add (GTK_CONTAINER (Bulle_Port), vbox_Bulle_Port);

	hbox_Bulle_Bouton = gtk_hbox_new (FALSE, 0);
	gtk_widget_show (hbox_Bulle_Bouton);
	gtk_box_pack_start (GTK_BOX (vbox_Bulle_Port), hbox_Bulle_Bouton, FALSE, FALSE, 3);

	toolbar_Bulle_Port_Mini = gtk_toolbar_new ();
	gtk_widget_show (toolbar_Bulle_Port_Mini);
	gtk_box_pack_start (GTK_BOX (hbox_Bulle_Bouton), toolbar_Bulle_Port_Mini, FALSE, FALSE, 0);
	gtk_toolbar_set_style (GTK_TOOLBAR (toolbar_Bulle_Port_Mini), GTK_TOOLBAR_ICONS);
	gtk_toolbar_set_tooltips (GTK_TOOLBAR (toolbar_Bulle_Port_Mini), FALSE);
	gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar_Bulle_Port_Mini), FALSE);
	tmp_toolbar_icon_size = gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar_Bulle_Port_Mini));

	tmp_image = gtk_image_new_from_file (PATH_ICONE "close.png");
	gtk_widget_show (tmp_image);
	toolbutton_Bulle_Port_Hide = (GtkWidget *) gtk_tool_button_new (tmp_image, "hide");
	gtk_widget_show (toolbutton_Bulle_Port_Hide);
	gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (toolbutton_Bulle_Port_Hide), FALSE);
	gtk_container_add (GTK_CONTAINER (toolbar_Bulle_Port_Mini), toolbutton_Bulle_Port_Hide);

	toolbar_Bulle_Port = gtk_toolbar_new ();
	gtk_widget_show (toolbar_Bulle_Port);
	gtk_box_pack_start (GTK_BOX (hbox_Bulle_Bouton), toolbar_Bulle_Port, TRUE, TRUE, 0);
	gtk_widget_set_size_request (toolbar_Bulle_Port, 200, -1);
	gtk_toolbar_set_style (GTK_TOOLBAR (toolbar_Bulle_Port), GTK_TOOLBAR_BOTH);
	tmp_toolbar_icon_size = gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar_Bulle_Port));

	/*tmp_image = gtk_image_new_from_file (PATH_ICONE "gohome.png");
	gtk_widget_show (tmp_image);
	toolbutton22 = (GtkWidget *) gtk_tool_button_new (tmp_image, "Home"));
	gtk_widget_show (toolbutton22);
	gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (toolbutton22), FALSE);
	gtk_container_add (GTK_CONTAINER (toolbar_Bulle_Port), toolbutton22);

	tmp_image = gtk_image_new_from_file (PATH_ICONE "webmin.png");
	gtk_widget_show (tmp_image);
	toolbutton23 = (GtkWidget *) gtk_tool_button_new (tmp_image, "Webmin"));
	gtk_widget_show (toolbutton23);
	gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (toolbutton23), FALSE);
	gtk_container_add (GTK_CONTAINER (toolbar_Bulle_Port), toolbutton23);

	tmp_image = gtk_image_new_from_file (PATH_ICONE "Open-xchange.png");
	gtk_widget_show (tmp_image);
	toolbutton24 = (GtkWidget *) gtk_tool_button_new (tmp_image, "Open-xchange"));
	gtk_widget_show (toolbutton24);
	gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (toolbutton24), FALSE);
	gtk_container_add (GTK_CONTAINER (toolbar_Bulle_Port), toolbutton24);

	toolbutton25 = (GtkWidget *) gtk_tool_button_new (NULL, "dfgfdg"));
	gtk_widget_show (toolbutton25);
	gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (toolbutton25), FALSE);
	gtk_container_add (GTK_CONTAINER (toolbar_Bulle_Port), toolbutton25);

	toolbutton29 = (GtkWidget *) gtk_tool_button_new (NULL, "dfgdfgdff"));
	gtk_widget_show (toolbutton29);
	gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (toolbutton29), FALSE);
	gtk_container_add (GTK_CONTAINER (toolbar_Bulle_Port), toolbutton29);

	toolbutton28 = (GtkWidget *) gtk_tool_button_new (NULL, "dgfdgdf"));
	gtk_widget_show (toolbutton28);
	gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (toolbutton28), FALSE);
	gtk_container_add (GTK_CONTAINER (toolbar_Bulle_Port), toolbutton28);

	toolbutton27 = (GtkWidget *) gtk_tool_button_new (NULL, "dgdfg"));
	gtk_widget_show (toolbutton27);
	gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (toolbutton27), FALSE);
	gtk_container_add (GTK_CONTAINER (toolbar_Bulle_Port), toolbutton27);

	toolbutton26 = (GtkWidget *) gtk_tool_button_new (NULL, "dfgdfg"));
	gtk_widget_show (toolbutton26);
	gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (toolbutton26), FALSE);
	gtk_container_add (GTK_CONTAINER (toolbar_Bulle_Port), toolbutton26);*/

	hbox_Bulle_Port_Etat = gtk_hbox_new (FALSE, 0);
	gtk_widget_show (hbox_Bulle_Port_Etat);
	gtk_box_pack_start (GTK_BOX (vbox_Bulle_Port), hbox_Bulle_Port_Etat, TRUE, FALSE, 0);
	gtk_container_set_border_width (GTK_CONTAINER (hbox_Bulle_Port_Etat), 6);

	label_Bulle_port_Etat = gtk_label_new ("Last State change : ");
	gtk_widget_show (label_Bulle_port_Etat);
	gtk_box_pack_start (GTK_BOX (hbox_Bulle_Port_Etat), label_Bulle_port_Etat, FALSE, FALSE, 0);

	label_Bulle_Port_Info_Etat = gtk_label_new ("");
	gtk_widget_show (label_Bulle_Port_Info_Etat);
	gtk_box_pack_start (GTK_BOX (hbox_Bulle_Port_Etat), label_Bulle_Port_Info_Etat, FALSE, FALSE, 0);

	g_signal_connect ((gpointer) toolbutton_Bulle_Port_Hide, "clicked", G_CALLBACK (on_toolbutton_Bulle_Port_Hide_clicked), NULL);
	g_signal_connect ((gpointer) Bulle_Port, "leave_notify_event", G_CALLBACK (on_Bulle_Port_leave_notify_event), NULL);

	return Bulle_Port;
}



#endif
