1
0
Fork 0

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.
This commit is contained in:
curt 1999-03-11 23:09:26 +00:00
parent 2aa7ec8fd5
commit 16d135954c
7 changed files with 127 additions and 22 deletions

View file

@ -1,3 +1,7 @@
if ENABLE_XMESA_FX
DEFS += -DXMESA -DFX
endif
noinst_LIBRARIES = libGUI.a noinst_LIBRARIES = libGUI.a
libGUI_a_SOURCES = gui.cxx gui.h libGUI_a_SOURCES = gui.cxx gui.h

View file

@ -23,6 +23,25 @@
**************************************************************************/ **************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_WINDOWS_H
# include <windows.h>
#endif
#include <Include/compiler.h>
#include <GL/glut.h>
#include <XGL/xgl.h>
#if defined(FX) && defined(XMESA)
# include <GL/xmesa.h>
#endif
#include STL_STRING
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -31,6 +50,8 @@
#include "gui.h" #include "gui.h"
FG_USING_STD(string);
puMenuBar *mainMenuBar; puMenuBar *mainMenuBar;
puButton *hideMenuButton; puButton *hideMenuButton;
@ -103,6 +124,36 @@ void notCb (puObject *)
mkDialog ("This function isn't implemented yet"); 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 The menu stuff
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
@ -120,7 +171,7 @@ puCallback viewSubmenuCb [] = { notCb, notCb, NULL, notCb, NULL };
puCallback aircraftSubmenuCb [] = { notCb, notCb, notCb,notCb, NULL }; puCallback aircraftSubmenuCb [] = { notCb, notCb, notCb,notCb, NULL };
puCallback environmentSubmenuCb [] = { notCb, notCb, notCb, NULL }; puCallback environmentSubmenuCb [] = { notCb, notCb, notCb, NULL };
puCallback optionsSubmenuCb [] = { notCb, notCb, NULL}; puCallback optionsSubmenuCb [] = { notCb, notCb, NULL};
puCallback helpSubmenuCb [] = { notCb, notCb, NULL }; puCallback helpSubmenuCb [] = { notCb, helpCb, NULL };

View file

@ -32,6 +32,11 @@
#include <GL/glut.h> #include <GL/glut.h>
#include <XGL/xgl.h> #include <XGL/xgl.h>
#if defined(FX) && defined(XMESA)
#include <GL/xmesa.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -52,11 +57,6 @@
#include "options.hxx" #include "options.hxx"
#include "views.hxx" #include "views.hxx"
#if defined(FX) && defined(XMESA)
# include <GL/xmesa.h>
static int fullscreen = 1;
#endif
// Force an update of the sky and lighting parameters // Force an update of the sky and lighting parameters
static void local_update_sky_and_lighting_params( void ) { static void local_update_sky_and_lighting_params( void ) {
@ -151,10 +151,11 @@ void GLUTkey(unsigned char k, int x, int y) {
return; return;
case 87: // W key case 87: // W key
#if defined(FX) && !defined(WIN32) #if defined(FX) && !defined(WIN32)
fullscreen = ( !fullscreen ); global_fullscreen = ( !global_fullscreen );
#if defined(XMESA_FX_FULLSCREEN) && defined(XMESA_FX_WINDOW) # if defined(XMESA_FX_FULLSCREEN) && defined(XMESA_FX_WINDOW)
XMesaSetFXmode(fullscreen ? XMESA_FX_FULLSCREEN : XMESA_FX_WINDOW); XMesaSetFXmode( global_fullscreen ?
#endif XMESA_FX_FULLSCREEN : XMESA_FX_WINDOW );
# endif
#endif #endif
return; return;
case 88: // X key case 88: // X key
@ -434,6 +435,11 @@ void GLUTspecialkey(int k, int x, int y) {
// $Log$ // $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 // Revision 1.42 1999/02/26 22:09:46 curt
// Added initial support for native SGI compilers. // Added initial support for native SGI compilers.
// //

View file

@ -44,7 +44,6 @@
#include <GL/glut.h> #include <GL/glut.h>
#include <XGL/xgl.h> #include <XGL/xgl.h>
/* Handle keyboard events */ /* Handle keyboard events */
void GLUTkey(unsigned char k, int x, int y); void GLUTkey(unsigned char k, int x, int y);
void GLUTspecialkey(int 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$ /* $Log$
/* Revision 1.2 1998/04/24 00:49:18 curt /* Revision 1.3 1999/03/11 23:09:47 curt
/* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H" /* When "Help" is selected from the menu check to see if netscape is running.
/* Trying out some different option parsing code. /* If so, command it to go to the flight gear user guide url. Otherwise
/* Some code reorganization. /* start a new version of netscape with this url.
/* /*
* Revision 1.2 1998/04/24 00:49:18 curt
* Wrapped "#include <config.h>" 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 * Revision 1.1 1998/04/22 13:25:41 curt
* C++ - ifing the code. * C++ - ifing the code.
* Starting a bit of reorganization of lighting code. * Starting a bit of reorganization of lighting code.

View file

@ -28,6 +28,9 @@
# include <config.h> # include <config.h>
#endif #endif
#include <GL/glut.h>
#include <XGL/xgl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -41,8 +44,6 @@
#include STL_STRING #include STL_STRING
#include <Include/fg_constants.h>
#include <Debug/logstream.hxx> #include <Debug/logstream.hxx>
#include <Aircraft/aircraft.hxx> #include <Aircraft/aircraft.hxx>
#include <Airports/simple.hxx> #include <Airports/simple.hxx>
@ -51,6 +52,8 @@
#include <Astro/solarsystem.hxx> #include <Astro/solarsystem.hxx>
#include <Autopilot/autopilot.hxx> #include <Autopilot/autopilot.hxx>
#include <Cockpit/cockpit.hxx> #include <Cockpit/cockpit.hxx>
#include <Include/fg_constants.h>
#include <Include/general.hxx>
#include <Joystick/joystick.hxx> #include <Joystick/joystick.hxx>
#include <Math/fg_geodesy.hxx> #include <Math/fg_geodesy.hxx>
#include <Math/point3d.hxx> #include <Math/point3d.hxx>
@ -68,6 +71,10 @@
#include "views.hxx" #include "views.hxx"
#include "fg_serial.hxx" #include "fg_serial.hxx"
#if defined(FX) && defined(XMESA)
#include <GL/xmesa.h>
#endif
FG_USING_STD(string); FG_USING_STD(string);
extern const char *default_root; extern const char *default_root;
@ -126,7 +133,7 @@ int fgInitPosition( void ) {
// General house keeping initializations // General house keeping initializations
int fgInitGeneral( void ) { int fgInitGeneral( void ) {
string root; string root;
// int i; char *mesa_win_state;
FG_LOG( FG_GENERAL, FG_INFO, "General Initialization" ); FG_LOG( FG_GENERAL, FG_INFO, "General Initialization" );
FG_LOG( FG_GENERAL, FG_INFO, "======= ==============" ); FG_LOG( FG_GENERAL, FG_INFO, "======= ==============" );
@ -141,10 +148,20 @@ int fgInitGeneral( void ) {
} }
FG_LOG( FG_GENERAL, FG_INFO, "FG_ROOT = " << root << endl ); FG_LOG( FG_GENERAL, FG_INFO, "FG_ROOT = " << root << endl );
// prime the frame rate counter pump #if defined(FX) && defined(XMESA)
// for ( i = 0; i < FG_FRAME_RATE_HISTORY; i++ ) { // initialize full screen flag
// general.frames[i] = 0.0; 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 ); return ( 1 );
} }
@ -391,6 +408,11 @@ int fgInitSubsystems( void )
// $Log$ // $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 // Revision 1.69 1999/03/08 21:56:39 curt
// Added panel changes sent in by Friedemann. // Added panel changes sent in by Friedemann.
// Added a splash screen randomization since we have several nice splash screens. // Added a splash screen randomization since we have several nice splash screens.

View file

@ -26,6 +26,10 @@
# include <config.h> # include <config.h>
#endif #endif
#if defined(FX) && defined(XMESA)
bool global_fullscreen = true;
#endif
#include <Include/compiler.h> #include <Include/compiler.h>
#include <math.h> // rint() #include <math.h> // rint()
@ -637,6 +641,11 @@ fgOPTIONS::~fgOPTIONS( void ) {
// $Log$ // $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 // Revision 1.41 1999/03/02 01:03:17 curt
// Tweaks for building with native SGI compilers. // Tweaks for building with native SGI compilers.
// //

View file

@ -43,6 +43,10 @@
#include <GL/glut.h> #include <GL/glut.h>
#include <XGL/xgl.h> #include <XGL/xgl.h>
#if defined(FX) && defined(XMESA)
extern bool global_fullscreen;
#endif
#include STL_STRING #include STL_STRING
#include <vector> #include <vector>
@ -241,6 +245,11 @@ extern fgOPTIONS current_options;
// $Log$ // $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 // Revision 1.29 1999/03/02 01:03:19 curt
// Tweaks for building with native SGI compilers. // Tweaks for building with native SGI compilers.
// //