# include <windows.h>
#endif
-#include GLUT_H
+#include <GL/gl.h>
#if defined(FX) && defined(XMESA)
# include <GL/xmesa.h>
#include <Cockpit/panel.hxx>
#include <Controls/controls.hxx>
#include <FDM/flight.hxx>
+#include <Main/main.hxx>
#include <Main/fg_init.hxx>
#include <Main/fg_io.hxx>
#include <Main/globals.hxx>
#include <Main/fg_props.hxx>
#include <Main/viewmgr.hxx>
-#ifdef FG_NETWORK_OLK
-#include <NetworkOLK/network.h>
-#endif
-
#if defined( WIN32 ) && !defined( __CYGWIN__ ) && !defined(__MINGW32__)
# include <simgear/screen/win32-printer.h>
# include <simgear/screen/GlBitmaps.h>
#include "gui.h"
#include "gui_local.hxx"
-#include "net_dlg.hxx"
#include "preset_dlg.hxx"
#include "prop_picker.hxx"
#include "sgVec3Slider.hxx"
SG_USING_STD(string);
SG_USING_STD(cout);
-// main.cxx hack, should come from an include someplace
-extern void fgInitVisuals( void );
-extern void fgRenderFrame( void );
-
extern void fgHUDalphaAdjust( puObject * );
// from cockpit.cxx
extern void fgLatLonFormatToggle( puObject *);
-#ifdef FG_NETWORK_OLK
-extern void net_fgd_scan(puObject *cb);
-#endif // #ifdef FG_NETWORK_OLK
-
#if defined( TR_HIRES_SNAP)
#include <simgear/screen/tr.h>
extern void trRenderFrame( void );
GLfloat x_end, GLfloat y_end );
#endif
-#if defined(FG_OLD_MENUBAR)
-extern puMenuBar *mainMenuBar;
-#endif
-
puDialogBox *dialogBox = 0;
puFrame *dialogFrame = 0;
puText *dialogBoxMessage = 0;
{"fgPresetAirspeed", fgPresetAirspeed},
{"fgPresetCommit", fgPresetCommit},
- // Network
-#ifdef FG_NETWORK_OLK
- {"net_display_toggle", net_display_toggle},
- {"NewCallSign", NewCallSign},
- {"net_fgd_scan", net_fgd_scan},
- {"net_register", net_register},
- {"net_unregister", net_unregister},
-#endif
-
// Autopilot
{"NewAltitude", NewAltitude},
{"NewHeading", NewHeading},
mkDialog(msg.c_str());
}
-#if defined(FG_OLD_MENUBAR)
-// Toggle the Menu and Mouse display state
-void guiToggleMenu(void)
-{
- if( gui_menu_on ) {
- // printf("Hiding Menu\n");
- mainMenuBar->hide ();
-#if defined(WIN32_CURSOR_TWEAKS_OFF)
- if( mouse_mode == MOUSE_POINTER )
- TurnCursorOff();
-#endif // WIN32_CURSOR_TWEAKS_OFF
- } else {
- // printf("Showing Menu\n");
- mainMenuBar->reveal();
-#ifdef WIN32
- TurnCursorOn();
-#endif // WIN32
- }
- gui_menu_on = ~gui_menu_on;
-}
-#endif // FG_OLD_MENUBAR
-
// Intercept the Escape Key
void ConfirmExitDialog(void)
{
fgGetInt("/sim/startup/ysize"));
}
-#if defined(FG_OLD_MENUBAR)
-//void MenuHideMenuCb(puObject *cb)
-void hideMenuCb (puObject *cb)
-{
- guiToggleMenu();
-}
-#endif
-
void goodBye(puObject *)
{
// SG_LOG( SG_INPUT, SG_ALERT,
// "Program exiting normally at user request." );
cout << "Program exiting normally at user request." << endl;
-#ifdef FG_NETWORK_OLK
- if ( fgGetBool("/sim/networking/network-olk") ) {
- if ( net_is_registered == 0 ) fgd_send_com( "8", FGFS_host);
- }
-#endif
-
// close all external I/O connections
globals->get_io()->shutdown_all();
fgSetBool("/sim/freeze/master", true);
}
-#if defined(FG_OLD_MENUBAR)
- if(gui_menu_on) {
- show_menu = true;
- guiToggleMenu();
- }
-#endif
-
if ( !puCursorIsHidden() ) {
show_pu_cursor = true;
puHideCursor();
delete [] filename;
-#if defined(FG_OLD_MENUBAR)
- if( show_menu )
- guiToggleMenu();
-#endif
-
if ( show_pu_cursor ) {
puShowCursor();
}
puHideCursor();
}
// BusyCursor( 0 );
-#if defined(FG_OLD_MENUBAR)
- mainMenuBar->hide();
-#endif
CGlPrinter p( CGlPrinter::PRINT_BITMAP );
int cur_width = fgGetInt("/sim/startup/xsize");
p.Begin( "FlightGear", cur_width*3, cur_height*3 );
p.End( hiResScreenCapture(3) );
-#if defined(FG_OLD_MENUBAR)
- if( gui_menu_on ) {
- mainMenuBar->reveal();
- }
-#endif
// BusyCursor(1);
if ( show_pu_cursor ) {
puShowCursor();
fgSetBool("/sim/freeze/master", true);
}
-#if defined(FG_OLD_MENUBAR)
- mainMenuBar->hide();
-#endif
TurnCursorOff();
if ( !puCursorIsHidden() ) {
show_pu_cursor = true;
}
TurnCursorOn();
-#if defined(FG_OLD_MENUBAR)
- if( gui_menu_on ) {
- mainMenuBar->reveal();
- }
-#endif
if ( !freeze ) {
fgSetBool("/sim/freeze/master", false);
}
}
-#ifdef FG_NETWORK_OLK
-void net_display_toggle( puObject *cb)
-{
- net_hud_display = (net_hud_display) ? 0 : 1;
- printf("Toggle net_hud_display : %d\n", net_hud_display);
-}
-
-void net_register( puObject *cb)
-{
- fgd_send_com( "1", FGFS_host );
- net_is_registered = 0;
- printf("Registering to deamon\n");
-}
-
-void net_unregister( puObject *cb)
-{
- fgd_send_com( "8", FGFS_host );
- net_is_registered = -1;
- printf("Unregistering from deamon\n");
-}
-
-#endif // #ifdef FG_NETWORK_OLK