From 16d135954c3a7978cad774946f28e6a9d80aaa5e Mon Sep 17 00:00:00 2001 From: curt Date: Thu, 11 Mar 1999 23:09:26 +0000 Subject: [PATCH] When "Help" is selected from the menu check to see if netscape is running. If so, command it to go to the flight gear user guide url. Otherwise start a new version of netscape with this url. --- GUI/Makefile.am | 4 ++++ GUI/gui.cxx | 53 +++++++++++++++++++++++++++++++++++++++++++++++- Main/GLUTkey.cxx | 24 ++++++++++++++-------- Main/GLUTkey.hxx | 14 ++++++++----- Main/fg_init.cxx | 36 +++++++++++++++++++++++++------- Main/options.cxx | 9 ++++++++ Main/options.hxx | 9 ++++++++ 7 files changed, 127 insertions(+), 22 deletions(-) diff --git a/GUI/Makefile.am b/GUI/Makefile.am index 890aea000..57617ace4 100644 --- a/GUI/Makefile.am +++ b/GUI/Makefile.am @@ -1,3 +1,7 @@ +if ENABLE_XMESA_FX +DEFS += -DXMESA -DFX +endif + noinst_LIBRARIES = libGUI.a libGUI_a_SOURCES = gui.cxx gui.h diff --git a/GUI/gui.cxx b/GUI/gui.cxx index 3a1441fad..756da284b 100644 --- a/GUI/gui.cxx +++ b/GUI/gui.cxx @@ -23,6 +23,25 @@ **************************************************************************/ +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifdef HAVE_WINDOWS_H +# include +#endif + +#include + +#include +#include + +#if defined(FX) && defined(XMESA) +# include +#endif + +#include STL_STRING + #include #include @@ -31,6 +50,8 @@ #include "gui.h" +FG_USING_STD(string); + puMenuBar *mainMenuBar; puButton *hideMenuButton; @@ -103,6 +124,36 @@ void notCb (puObject *) mkDialog ("This function isn't implemented yet"); } +void helpCb (puObject *) +{ +#if defined(FX) && !defined(WIN32) +# if defined(XMESA_FX_FULLSCREEN) && defined(XMESA_FX_WINDOW) + if ( global_fullscreen ) { + global_fullscreen = false; + XMesaSetFXmode( XMESA_FX_WINDOW ); + } +# endif +#endif + +#if !defined(WIN32) + string url = "http://www.flightgear.org/Docs/InstallGuide/getstart.html"; + string command; + + if ( system("xwininfo -name Netscape > /dev/null 2>&1") == 0 ) { + command = "netscape -remote \"openURL(" + url + ")\" &"; + } else { + command = "netscape " + url + " &"; + } + + system( command.c_str() ); + string text = "Help started in netscape window."; +#else + string text = "Help not yet implimented for Win32."; +#endif + + mkDialog (text.c_str()); +} + /* ----------------------------------------------------------------------- The menu stuff ---------------------------------------------------------------------*/ @@ -120,7 +171,7 @@ puCallback viewSubmenuCb [] = { notCb, notCb, NULL, notCb, NULL }; puCallback aircraftSubmenuCb [] = { notCb, notCb, notCb,notCb, NULL }; puCallback environmentSubmenuCb [] = { notCb, notCb, notCb, NULL }; puCallback optionsSubmenuCb [] = { notCb, notCb, NULL}; -puCallback helpSubmenuCb [] = { notCb, notCb, NULL }; +puCallback helpSubmenuCb [] = { notCb, helpCb, NULL }; diff --git a/Main/GLUTkey.cxx b/Main/GLUTkey.cxx index ab092198d..30787ea99 100644 --- a/Main/GLUTkey.cxx +++ b/Main/GLUTkey.cxx @@ -32,6 +32,11 @@ #include #include + +#if defined(FX) && defined(XMESA) +#include +#endif + #include #include @@ -52,11 +57,6 @@ #include "options.hxx" #include "views.hxx" -#if defined(FX) && defined(XMESA) -# include -static int fullscreen = 1; -#endif - // Force an update of the sky and lighting parameters static void local_update_sky_and_lighting_params( void ) { @@ -151,10 +151,11 @@ void GLUTkey(unsigned char k, int x, int y) { return; case 87: // W key #if defined(FX) && !defined(WIN32) - fullscreen = ( !fullscreen ); -#if defined(XMESA_FX_FULLSCREEN) && defined(XMESA_FX_WINDOW) - XMesaSetFXmode(fullscreen ? XMESA_FX_FULLSCREEN : XMESA_FX_WINDOW); -#endif + global_fullscreen = ( !global_fullscreen ); +# if defined(XMESA_FX_FULLSCREEN) && defined(XMESA_FX_WINDOW) + XMesaSetFXmode( global_fullscreen ? + XMESA_FX_FULLSCREEN : XMESA_FX_WINDOW ); +# endif #endif return; case 88: // X key @@ -434,6 +435,11 @@ void GLUTspecialkey(int k, int x, int y) { // $Log$ +// Revision 1.43 1999/03/11 23:09:46 curt +// When "Help" is selected from the menu check to see if netscape is running. +// If so, command it to go to the flight gear user guide url. Otherwise +// start a new version of netscape with this url. +// // Revision 1.42 1999/02/26 22:09:46 curt // Added initial support for native SGI compilers. // diff --git a/Main/GLUTkey.hxx b/Main/GLUTkey.hxx index 58e0842df..97f2ec057 100644 --- a/Main/GLUTkey.hxx +++ b/Main/GLUTkey.hxx @@ -44,7 +44,6 @@ #include #include - /* Handle keyboard events */ void GLUTkey(unsigned char k, int x, int y); void GLUTspecialkey(int k, int x, int y); @@ -54,11 +53,16 @@ void GLUTspecialkey(int k, int x, int y); /* $Log$ -/* Revision 1.2 1998/04/24 00:49:18 curt -/* Wrapped "#include " in "#ifdef HAVE_CONFIG_H" -/* Trying out some different option parsing code. -/* Some code reorganization. +/* Revision 1.3 1999/03/11 23:09:47 curt +/* When "Help" is selected from the menu check to see if netscape is running. +/* If so, command it to go to the flight gear user guide url. Otherwise +/* start a new version of netscape with this url. /* + * Revision 1.2 1998/04/24 00:49:18 curt + * Wrapped "#include " in "#ifdef HAVE_CONFIG_H" + * Trying out some different option parsing code. + * Some code reorganization. + * * Revision 1.1 1998/04/22 13:25:41 curt * C++ - ifing the code. * Starting a bit of reorganization of lighting code. diff --git a/Main/fg_init.cxx b/Main/fg_init.cxx index bef0375d3..260f66872 100644 --- a/Main/fg_init.cxx +++ b/Main/fg_init.cxx @@ -28,6 +28,9 @@ # include #endif +#include +#include + #include #include @@ -41,8 +44,6 @@ #include STL_STRING -#include - #include #include #include @@ -51,6 +52,8 @@ #include #include #include +#include +#include #include #include #include @@ -68,6 +71,10 @@ #include "views.hxx" #include "fg_serial.hxx" +#if defined(FX) && defined(XMESA) +#include +#endif + FG_USING_STD(string); extern const char *default_root; @@ -126,7 +133,7 @@ int fgInitPosition( void ) { // General house keeping initializations int fgInitGeneral( void ) { string root; - // int i; + char *mesa_win_state; FG_LOG( FG_GENERAL, FG_INFO, "General Initialization" ); FG_LOG( FG_GENERAL, FG_INFO, "======= ==============" ); @@ -141,10 +148,20 @@ int fgInitGeneral( void ) { } FG_LOG( FG_GENERAL, FG_INFO, "FG_ROOT = " << root << endl ); - // prime the frame rate counter pump - // for ( i = 0; i < FG_FRAME_RATE_HISTORY; i++ ) { - // general.frames[i] = 0.0; - // } +#if defined(FX) && defined(XMESA) + // initialize full screen flag + global_fullscreen = false; + if ( strstr ( general.get_glRenderer(), "Glide" ) ) { + // Test for the MESA_GLX_FX env variable + if ( (mesa_win_state = getenv( "MESA_GLX_FX" )) != NULL) { + // test if we are fullscreen mesa/glide + if ( (mesa_win_state[0] == 'f') || + (mesa_win_state[0] == 'F') ) { + global_fullscreen = true; + } + } + } +#endif return ( 1 ); } @@ -391,6 +408,11 @@ int fgInitSubsystems( void ) // $Log$ +// Revision 1.70 1999/03/11 23:09:49 curt +// When "Help" is selected from the menu check to see if netscape is running. +// If so, command it to go to the flight gear user guide url. Otherwise +// start a new version of netscape with this url. +// // Revision 1.69 1999/03/08 21:56:39 curt // Added panel changes sent in by Friedemann. // Added a splash screen randomization since we have several nice splash screens. diff --git a/Main/options.cxx b/Main/options.cxx index b4e0e7aff..97a034bee 100644 --- a/Main/options.cxx +++ b/Main/options.cxx @@ -26,6 +26,10 @@ # include #endif +#if defined(FX) && defined(XMESA) +bool global_fullscreen = true; +#endif + #include #include // rint() @@ -637,6 +641,11 @@ fgOPTIONS::~fgOPTIONS( void ) { // $Log$ +// Revision 1.42 1999/03/11 23:09:50 curt +// When "Help" is selected from the menu check to see if netscape is running. +// If so, command it to go to the flight gear user guide url. Otherwise +// start a new version of netscape with this url. +// // Revision 1.41 1999/03/02 01:03:17 curt // Tweaks for building with native SGI compilers. // diff --git a/Main/options.hxx b/Main/options.hxx index 4830d2dfe..ece666757 100644 --- a/Main/options.hxx +++ b/Main/options.hxx @@ -43,6 +43,10 @@ #include #include +#if defined(FX) && defined(XMESA) +extern bool global_fullscreen; +#endif + #include STL_STRING #include @@ -241,6 +245,11 @@ extern fgOPTIONS current_options; // $Log$ +// Revision 1.30 1999/03/11 23:09:51 curt +// When "Help" is selected from the menu check to see if netscape is running. +// If so, command it to go to the flight gear user guide url. Otherwise +// start a new version of netscape with this url. +// // Revision 1.29 1999/03/02 01:03:19 curt // Tweaks for building with native SGI compilers. // -- 2.39.5