//*****************************************************************************************
// Truevision - a 3d modeler for gnome and povray
//
// interface.h
//
// Vincent LE PRINCE <vincentleprince@users.sourceforge.net>
// Copyright (C) 2000-2001 Vincent LE PRINCE
// This file is part of the TRUEVISION Package

//   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.  */ 
//*******************************************************************************************
#ifndef INTERFACE_H
#define INTERFACE_H
using namespace std;
#include "main.h"
#include "viewmanager.h"
#include "proppanel.h"
#include "toolbar.h"

#define INTERF_DEF Interface *interf = (Interface*)(app_ref->interf);

class Interface : private app_object {
	friend void dummycbk( GtkWidget *wid, gpointer data ) { app_warning( "This is a warning : ", "Phléa !" ); }

	private:
		app_objs * app_ref;
		GtkWidget *win, *vbox;
		GtkWidget *status_bar;
		ViewManager *vmanager;
		PropPanel *panel;
		ToolBar *toolbar;
		GtkWidget *appbar;
		GtkAccelGroup *accels;

	public:
		Interface( app_objs *app_ref );
		void flush_pref();
		void pref_changed() {}
		GdkWindow *get_gdkwin() { return win->window; }
		GtkWidget *get_gtkwin() { return win; }
		GtkAccelGroup *get_accels() { return accels; }
		
		void save( ofstream & file );
		void clear();
		
		bool load( ifstream & file, char * tag );
		
		void set_status( char *mesg ) { gnome_appbar_set_status( GNOME_APPBAR(appbar), mesg ); update_appbar(); }
		void clear_status() { gnome_appbar_clear_stack( GNOME_APPBAR(appbar) ); }
		void set_progress( float val ) {  gnome_appbar_set_progress_percentage( GNOME_APPBAR(appbar), val ); update_appbar(); }
		void update_appbar() { while ( gtk_events_pending() ) gtk_main_iteration(); }
}; 

#endif
