/* ***********************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 <gtk/gtk.h>

#include "Bulle_Port_Callbacks.h"
#include "Bulle_Port_Interface.h"
#include "../Objet_Bulle.h"
#include "../Settings_Port.h"
#include "../Execute.h"
#include "../Debug.h"


void on_toolbutton_Bulle_Port_Hide_clicked (GtkToolButton * toolbutton, gpointer user_data)
{
	Cacher_Fenetre_Bulle ();
}


gboolean on_Bulle_Port_leave_notify_event (GtkWidget * widget, GdkEventCrossing * event, gpointer user_data)
{
	if (gdk_window_at_pointer (NULL, NULL) == NULL)
		Cacher_Fenetre_Bulle ();
	return FALSE;
}


void clicked_Bouton_Bulle (GtkToolButton * toolbutton, gpointer user_data)
{
	struct Struct_Liste_Port *Port = (struct Struct_Liste_Port *) user_data;
		
	DEBUG_ACTION_USER();	
	ERROR_if (user_data == NULL);
	debug_printf (INTERFACE, D_WARN, __FILE__, __PRETTY_FUNCTION__, __LINE__, "Click sur le bouton bulle  [%s ][%s] [%s]", Port->Name, Port->Path, Port->Param);
	Cacher_Fenetre_Bulle ();
#ifdef         __SCRIPT_ENABLE
	Execute_Programme_Externe (Port->Path, Port->Param,Equipement_Selectionner);
#endif
}

#endif
