1998-04-25 15:11:10 +00:00
|
|
|
//
|
|
|
|
// fg_init.hxx -- Flight Gear top level initialization routines
|
|
|
|
//
|
|
|
|
// Written by Curtis Olson, started August 1997.
|
|
|
|
//
|
2004-11-19 22:10:41 +00:00
|
|
|
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
|
1998-04-25 15:11:10 +00:00
|
|
|
//
|
|
|
|
// 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
|
2006-02-21 01:16:04 +00:00
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
1998-04-25 15:11:10 +00:00
|
|
|
//
|
|
|
|
// $Id$
|
1997-08-23 01:46:20 +00:00
|
|
|
|
|
|
|
|
1998-04-25 15:11:10 +00:00
|
|
|
#ifndef _FG_INIT_HXX
|
|
|
|
#define _FG_INIT_HXX
|
1997-08-23 01:46:20 +00:00
|
|
|
|
2008-07-25 18:38:29 +00:00
|
|
|
#include <string>
|
2013-05-04 09:58:22 +00:00
|
|
|
#include <simgear/misc/sg_path.hxx>
|
2001-07-16 19:17:58 +00:00
|
|
|
|
2010-07-01 21:43:28 +00:00
|
|
|
// forward decls
|
|
|
|
class SGPropertyNode;
|
2015-03-06 18:52:06 +00:00
|
|
|
class SGPath;
|
2000-10-12 01:08:09 +00:00
|
|
|
|
2001-07-16 19:17:58 +00:00
|
|
|
// Return the current base package version
|
2015-03-06 18:52:06 +00:00
|
|
|
std::string fgBasePackageVersion(const SGPath& path);
|
2001-07-16 19:17:58 +00:00
|
|
|
|
2020-04-07 08:38:54 +00:00
|
|
|
SGPath fgHomePath();
|
|
|
|
|
2020-05-03 17:02:20 +00:00
|
|
|
enum InitHomeResult
|
|
|
|
{
|
|
|
|
InitHomeOkay,
|
|
|
|
InitHomeReadOnly,
|
|
|
|
InitHomeExplicitReadOnly,
|
|
|
|
InitHomeAbort
|
|
|
|
};
|
|
|
|
|
|
|
|
InitHomeResult fgInitHome();
|
2018-07-02 22:13:36 +00:00
|
|
|
void fgShutdownHome();
|
2020-05-03 17:02:20 +00:00
|
|
|
void fgDeleteLockFile();
|
2001-07-16 19:17:58 +00:00
|
|
|
|
1999-06-18 03:42:54 +00:00
|
|
|
// Read in configuration (file and command line)
|
2013-11-16 12:10:32 +00:00
|
|
|
int fgInitConfig ( int argc, char **argv, bool reinit );
|
1999-06-18 03:42:54 +00:00
|
|
|
|
2014-12-26 12:20:51 +00:00
|
|
|
void fgInitAircraftPaths(bool reinit);
|
|
|
|
|
2021-08-04 08:53:13 +00:00
|
|
|
/**
|
|
|
|
* @brief
|
|
|
|
*
|
|
|
|
* @param reinit : is this a second(+) call of the function, i.e after reset
|
|
|
|
* @param didUseLauncher : allow adjusting UI feedback if we used the launcher or not
|
|
|
|
* @return int : an Options result to indicate if we should continue, quit, etc
|
|
|
|
*/
|
|
|
|
int fgInitAircraft(bool reinit, bool didUseLauncher);
|
1999-06-18 03:42:54 +00:00
|
|
|
|
2013-02-08 13:15:20 +00:00
|
|
|
// log various settings / configuration state
|
|
|
|
void fgOutputSettings();
|
|
|
|
|
2002-10-07 15:45:00 +00:00
|
|
|
// Initialize the localization
|
|
|
|
SGPropertyNode *fgInitLocale(const char *language);
|
|
|
|
|
2003-02-21 02:42:45 +00:00
|
|
|
// Init navaids and waypoints
|
|
|
|
bool fgInitNav ();
|
|
|
|
|
|
|
|
|
1998-02-12 21:58:27 +00:00
|
|
|
// General house keeping initializations
|
2002-11-18 21:31:33 +00:00
|
|
|
bool fgInitGeneral ();
|
1997-08-23 01:46:20 +00:00
|
|
|
|
1998-04-25 15:11:10 +00:00
|
|
|
|
2012-09-18 19:29:36 +00:00
|
|
|
// Create all the subsystems needed by the sim
|
2013-11-16 12:10:32 +00:00
|
|
|
void fgCreateSubsystems(bool duringReset);
|
1997-08-23 01:46:20 +00:00
|
|
|
|
2012-09-18 19:29:36 +00:00
|
|
|
// called after the subsystems have been bound and initialised,
|
|
|
|
// to peform final init
|
|
|
|
void fgPostInitSubsystems();
|
1999-04-27 15:52:32 +00:00
|
|
|
|
2014-02-24 06:10:29 +00:00
|
|
|
// Re-position: when only location is changing, we can do considerably
|
|
|
|
// less work than a full re-init.
|
|
|
|
void fgStartReposition();
|
2013-11-16 12:10:32 +00:00
|
|
|
|
|
|
|
void fgStartNewReset();
|
|
|
|
|
2015-03-10 08:30:55 +00:00
|
|
|
// setup the package system including the global root
|
|
|
|
void fgInitPackageRoot();
|
|
|
|
|
2017-06-14 17:26:38 +00:00
|
|
|
// wipe FG_HOME. (The removing of the program data is assumed to be done
|
|
|
|
// by the real installer).
|
|
|
|
int fgUninstall();
|
|
|
|
|
2000-10-19 21:24:43 +00:00
|
|
|
#endif // _FG_INIT_HXX
|
1997-08-23 01:46:20 +00:00
|
|
|
|
|
|
|
|
2002-04-06 17:23:18 +00:00
|
|
|
|