dialog.cxx dialog.hxx \
menubar.cxx menubar.hxx \
gui.cxx gui.h gui_funcs.cxx \
- gui_local.cxx gui_local.hxx \
mouse.cxx fonts.cxx \
trackball.c trackball.h \
AirportList.cxx AirportList.hxx \
dialog.[ch]xx XML-configurable dialog box.
gui.cxx, gui.h Top-level GUI functions (deprecated).
gui_funcs.cxx Implementation of internal GUI functions (deprecated).
-gui_local.[ch]xx More internal GUI functions (deprecated).
menubar.[ch]xx XML-configurable menu bar.
mouse.cxx Old GUI mouse support (deprecated).
new_gui.[ch]xx Top-level for the GUI subsystem.
#include <GUI/new_gui.hxx>
#include "gui.h"
-#include "gui_local.hxx"
#include "layout.hxx"
using namespace osg;
return false;
if (!initOp->isFinished())
return false;
- initMouseQuat();
initOp = 0;
return true;
}
#endif
#include "gui.h"
-#include "gui_local.hxx"
SG_USING_STD(string);
SG_USING_STD(cout);
+++ /dev/null
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#ifdef HAVE_WINDOWS_H
-# include <windows.h>
-#endif
-
-#include <plib/pu.h> // plib include
-
-#include <FDM/flight.hxx>
-
-#include <Main/globals.hxx>
-#include <Main/fg_init.hxx>
-#include <Main/fg_props.hxx>
-#include <Main/renderer.hxx>
-#include <Scenery/tilemgr.hxx>
-#include <Time/light.hxx>
-
-#include "gui.h"
-#include "trackball.h"
-
-// FOR MOUSE VIEW MODE
-// stashed trackball(_quat0, 0.0, 0.0, 0.0, 0.0);
-static float _quat0[4];
-
-float curGuiQuat[4];
-
-// To apply our mouse rotation quat to VIEW
-// sgPreMultMat4( VIEW, GuiQuat_mat);
-// This is here temporarily should be in views.hxx
-float GuiQuat_mat[4][4];
-
-void Quat0( void ) {
- curGuiQuat[0] = _quat0[0];
- curGuiQuat[1] = _quat0[1];
- curGuiQuat[2] = _quat0[2];
- curGuiQuat[3] = _quat0[3];
-}
-
-void initMouseQuat(void) {
- trackball(_quat0, 0.0, 0.0, 0.0, 0.0);
- Quat0();
- build_rotmatrix(GuiQuat_mat, curGuiQuat);
-}
-
-
-void reInit(void)
-{
- Quat0();
-
- static const SGPropertyNode *master_freeze
- = fgGetNode("/sim/freeze/master");
-
- bool freeze = master_freeze->getBoolValue();
- if ( !freeze ) {
- fgSetBool("/sim/freeze/master", true);
- }
-
- fgSetBool("/sim/signals/reinit", true);
- cur_fdm_state->unbind();
-
- // in case user has changed window size as
- // restoreInitialState() overwrites these
- int xsize = fgGetInt("/sim/startup/xsize");
- int ysize = fgGetInt("/sim/startup/ysize");
-
- build_rotmatrix(GuiQuat_mat, curGuiQuat);
-
- globals->restoreInitialState();
-
- // update our position based on current presets
- fgInitPosition();
-
- // We don't know how to resize the window, so keep the last values
- // for xsize and ysize, and don't use the one set initially
- fgSetInt("/sim/startup/xsize",xsize);
- fgSetInt("/sim/startup/ysize",ysize);
-
- SGTime *t = globals->get_time_params();
- delete t;
- t = fgInitTime();
- globals->set_time_params( t );
-
- fgReInitSubsystems();
-
- globals->get_tile_mgr()->update( fgGetDouble("/environment/visibility-m") );
- globals->get_renderer()->resize( xsize, ysize );
- fgSetBool("/sim/signals/reinit", false);
-
- if ( !freeze ) {
- fgSetBool("/sim/freeze/master", false);
- }
-}
-
+++ /dev/null
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <simgear/compiler.h>
-
-#include "trackball.h"
-
-#if defined(WIN32) || defined(__CYGWIN32__)
-#define WIN32_CURSOR_TWEAKS
-// uncomment this for cursor to turn off when menu is disabled
-// #define WIN32_CURSOR_TWEAKS_OFF
-#elif (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-#define X_CURSOR_TWEAKS
-#endif
-
-typedef enum {
- MOUSE_POINTER,
- MOUSE_YOKE,
- MOUSE_VIEW
-} MouseMode;
-
-extern MouseMode mouse_mode;
-extern int gui_menu_on;
-
-extern float curGuiQuat[4];
-extern float GuiQuat_mat[4][4];
-
-extern void initMouseQuat( void );
-extern void Quat0( void );
-
-extern void reInit(void);
// user-configured dialogs and new commands where necessary.
////////////////////////////////////////////////////////////////////////
-extern void reInit (void);
-static bool
-do_reinit_dialog (const SGPropertyNode * arg)
-{
- reInit();
- return true;
-}
-
#if defined(TR_HIRES_SNAP)
extern void dumpHiResSnapShot ();
static bool
const char * name;
SGCommandMgr::command_t command;
} deprecated_dialogs [] = {
- { "old-reinit-dialog", do_reinit_dialog },
#if defined(TR_HIRES_SNAP)
{ "old-hires-snapshot-dialog", do_hires_snapshot_dialog },
#endif
#include <Main/viewmgr.hxx>
#include "gui.h"
-#include "gui_local.hxx"
SG_USING_STD(string);
SG_USING_STD(cout);
Mouse stuff
---------------------------------------------------------------------*/
+#if defined(WIN32) || defined(__CYGWIN32__)
+#define WIN32_CURSOR_TWEAKS
+// uncomment this for cursor to turn off when menu is disabled
+// #define WIN32_CURSOR_TWEAKS_OFF
+#elif (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
+#define X_CURSOR_TWEAKS
+#endif
+
static int mouse_active = 0;
static int MOUSE_XSIZE = 0;
static int MOUSE_YSIZE = 0;
+typedef enum {
+ MOUSE_POINTER,
+ MOUSE_YOKE,
+ MOUSE_VIEW
+} MouseMode;
+
/* --------------------------------------------------------------------
Support for mouse as control yoke (david@megginson.com)
}
+/**
+ * Reset FlightGear (Shift-Escape or Menu->File->Reset)
+ */
+static bool
+do_reset (const SGPropertyNode * arg)
+{
+ reInit();
+ return true;
+}
+
+
/**
* Built-in command: reinitialize one or more subsystems.
*
{ "null", do_null },
{ "nasal", do_nasal },
{ "exit", do_exit },
+ { "reset", do_reset },
{ "reinit", do_reinit },
{ "suspend", do_reinit },
{ "resume", do_reinit },
#include "options.hxx"
#include "globals.hxx"
#include "logger.hxx"
+#include "renderer.hxx"
#include "viewmgr.hxx"
#include "main.hxx"
fgSetBool("/sim/sceneryloaded",false);
}
+
+void reInit(void) // from gui_local.cxx -- TODO merge with fgReInitSubsystems()
+{
+ static SGPropertyNode_ptr master_freeze = fgGetNode("/sim/freeze/master", true);
+
+ bool freeze = master_freeze->getBoolValue();
+ if (!freeze)
+ master_freeze->setBoolValue(true);
+
+ fgSetBool("/sim/signals/reinit", true);
+ cur_fdm_state->unbind();
+
+ // in case user has changed window size as
+ // restoreInitialState() overwrites these
+ int xsize = fgGetInt("/sim/startup/xsize");
+ int ysize = fgGetInt("/sim/startup/ysize");
+
+ globals->restoreInitialState();
+
+ // update our position based on current presets
+ fgInitPosition();
+
+ // We don't know how to resize the window, so keep the last values
+ // for xsize and ysize, and don't use the one set initially
+ fgSetInt("/sim/startup/xsize", xsize);
+ fgSetInt("/sim/startup/ysize", ysize);
+
+ SGTime *t = globals->get_time_params();
+ delete t;
+ t = fgInitTime();
+ globals->set_time_params(t);
+
+ fgReInitSubsystems();
+
+ globals->get_tile_mgr()->update(fgGetDouble("/environment/visibility-m"));
+ globals->get_renderer()->resize(xsize, ysize);
+ fgSetBool("/sim/signals/reinit", false);
+
+ if (!freeze)
+ master_freeze->setBoolValue(false);
+}
+