]> git.mxchange.org Git - flightgear.git/commitdiff
When "Help" is selected from the menu check to see if netscape is running.
authorcurt <curt>
Thu, 11 Mar 1999 23:09:26 +0000 (23:09 +0000)
committercurt <curt>
Thu, 11 Mar 1999 23:09:26 +0000 (23:09 +0000)
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
GUI/gui.cxx
Main/GLUTkey.cxx
Main/GLUTkey.hxx
Main/fg_init.cxx
Main/options.cxx
Main/options.hxx

index 890aea000f53cad30753489421c6759695a08115..57617ace44697917c3176d78d266065ae19e349b 100644 (file)
@@ -1,3 +1,7 @@
+if ENABLE_XMESA_FX                                                              
+DEFS += -DXMESA -DFX
+endif                                                                           
+                                                                                
 noinst_LIBRARIES = libGUI.a
 
 libGUI_a_SOURCES = gui.cxx gui.h
index 3a1441fad3646493d0ac3654c8ee60a1be7ae058..756da284b097deaa3436943d77e8e4748cc670e1 100644 (file)
  **************************************************************************/
 
 
+#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 <string.h>
 
@@ -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 };
 
  
 
index ab092198d9f944f679594021b4ebd285434198d6..30787ea99fcdd227dcbe341912a758906c97df54 100644 (file)
 
 #include <GL/glut.h>
 #include <XGL/xgl.h>
+
+#if defined(FX) && defined(XMESA)
+#include <GL/xmesa.h>
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 
 #include "options.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
 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.
 //
index 58e0842dfa01c091c497cba0eb36a6df5db093e9..97f2ec0576963a1139c19710a177b4b74602f292 100644 (file)
@@ -44,7 +44,6 @@
 #include <GL/glut.h>
 #include <XGL/xgl.h>
 
-
 /* 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 <config.h>" 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 <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
  * C++ - ifing the code.
  * Starting a bit of reorganization of lighting code.
index bef0375d3218581693bc3a5d88a60f55b5b2e657..260f6687273e42c85535bfd0b97383da3714f685 100644 (file)
@@ -28,6 +28,9 @@
 #  include <config.h>
 #endif
 
+#include <GL/glut.h>
+#include <XGL/xgl.h>
+
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -41,8 +44,6 @@
 
 #include STL_STRING
 
-#include <Include/fg_constants.h>
-
 #include <Debug/logstream.hxx>
 #include <Aircraft/aircraft.hxx>
 #include <Airports/simple.hxx>
@@ -51,6 +52,8 @@
 #include <Astro/solarsystem.hxx>
 #include <Autopilot/autopilot.hxx>
 #include <Cockpit/cockpit.hxx>
+#include <Include/fg_constants.h>
+#include <Include/general.hxx>
 #include <Joystick/joystick.hxx>
 #include <Math/fg_geodesy.hxx>
 #include <Math/point3d.hxx>
 #include "views.hxx"
 #include "fg_serial.hxx"
 
+#if defined(FX) && defined(XMESA)
+#include <GL/xmesa.h>
+#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.
index b4e0e7aff713d73ddf0c240b91a9d491e1aed6cc..97a034beed09bd1b2cb37405c8008d58ae373fc2 100644 (file)
 #  include <config.h>
 #endif
 
+#if defined(FX) && defined(XMESA)
+bool global_fullscreen = true;
+#endif
+
 #include <Include/compiler.h>
 
 #include <math.h>            // 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.
 //
index 4830d2dfea22dbae041ccb906973bfe07a1040a6..ece66675750e68d773c1257c45d85c8202157c74 100644 (file)
 #include <GL/glut.h>
 #include <XGL/xgl.h>
 
+#if defined(FX) && defined(XMESA)
+extern bool global_fullscreen;
+#endif
+
 #include STL_STRING
 #include <vector>
 
@@ -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.
 //