// objlibwin.hpp -- the object library window // // Written by Frederic Bouvier, started April 2002. // // Copyright (C) 2001 Frederic Bouvier - fredb@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, 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. // // $Id: objlibwin.hpp,v 1.12 2005/05/09 07:02:11 fredb Exp $ #ifndef _objlibwin_hpp_ #define _objlibwin_hpp_ #include #include "window.hpp" #include #include #include #include #include #include class Fl_Plib; class Flu_Tree_Browser; class FGSD_ObjectLibraryWindow { public: enum Mode { Select, Edit }; FGSD_ObjectLibraryWindow( int w, int h ); ~FGSD_ObjectLibraryWindow(); void show( /* int argc, char **argv */ ); bool exec(const Fl_Window* w, bool grab); bool visible(); bool checkModified(); static void close_cb(Fl_Widget *, void *); static void select_cb(Fl_Widget *, void *); void close_cb(Fl_Widget *, bool __ok); static void add_folder_cb( Fl_Widget *, void * ); static void ren_folder_cb( Fl_Widget *, void * ); static void cut_cb( Fl_Widget *, void * ); static void paste_cb( Fl_Widget *, void * ); static void add_model_cb( Fl_Widget *, void * ); static void ren_model_cb( Fl_Widget *, void * ); static void add_texture_cb( Fl_Widget *, void * ); static void tree_cb( Fl_Widget *, void * ); void addFolder(); void renFolder(); void cut(); void paste(); void addModel(); void renModel(); void addTexture(); void tree(); void setMode( Mode __mode ); std::string getCurrentModel() const; std::vector getTexturesForCurrentModel() const; static void copyNode( SGPropertyNode *__dst, SGPropertyNode *__src ); static void setArchiveBit( SGPropertyNode *__dst ); private: FGSD_Window *_window; Fl_Tile *_tile; Flu_Tree_Browser *_tree; Fl_Group *_viewGroup; Fl_Plib *_viewer; Fl_Group *_tools; Fl_Input *_input; Fl_Button *_addFolder; Fl_Button *_renFolder; Fl_Button *_cut; Fl_Button *_paste; Fl_Button *_addModel; Fl_Button *_renModel; Fl_Button *_addTexture; Fl_Button *_select; Fl_Button *_quit; SGPropertyNode _library; SGPropertyNode_ptr _cutNode; SGPropertyNode *_currentNode; Mode _mode; bool _modified; }; inline void FGSD_ObjectLibraryWindow::setMode( FGSD_ObjectLibraryWindow::Mode __mode ) { _mode = __mode; } #endif