1 /* === S Y N F I G ========================================================= */ 2 /*! \file synfig/main.h 3 ** \brief Template Header 4 ** 5 ** $Id$ 6 ** 7 ** \legal 8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley 9 ** 10 ** This package is free software; you can redistribute it and/or 11 ** modify it under the terms of the GNU General Public License as 12 ** published by the Free Software Foundation; either version 2 of 13 ** the License, or (at your option) any later version. 14 ** 15 ** This package is distributed in the hope that it will be useful, 16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 ** General Public License for more details. 19 ** \endlegal 20 */ 21 /* ========================================================================= */ 22 23 /* === S T A R T =========================================================== */ 24 25 #ifndef __SYNFIG_MAIN_H 26 #define __SYNFIG_MAIN_H 27 28 /* === H E A D E R S ======================================================= */ 29 30 #include <cassert> 31 32 #include <ETL/ref_count> 33 34 #include "string.h" 35 #include "progresscallback.h" 36 37 /* === M A C R O S ========================================================= */ 38 39 /* === T Y P E D E F S ===================================================== */ 40 41 /* === C L A S S E S & S T R U C T S ======================================= */ 42 43 namespace synfig { 44 45 /*! \class synfig::Main 46 ** \brief \writeme 47 ** 48 ** \writeme 49 */ 50 class Main 51 { 52 private: 53 static Main *instance; 54 etl::reference_counter ref_count_; 55 56 public: 57 synfig::String root_path; 58 synfig::String bin_path; 59 synfig::String share_path; 60 synfig::String locale_path; 61 synfig::String lib_path; 62 synfig::String lib_synfig_path; 63 64 Main(const synfig::String& basepath,ProgressCallback *cb=0); 65 ~Main(); 66 ref_count()67 const etl::reference_counter& ref_count()const { return ref_count_; } get_instance()68 static const Main& get_instance() { assert(instance); return *instance; } 69 }; // END of class Main 70 71 }; // END if namespace synfig 72 73 /* === E N D =============================================================== */ 74 75 #endif 76