1998-06-12 01:07:06 +00:00
|
|
|
/**************************************************************************
|
|
|
|
* gui.h
|
|
|
|
*
|
|
|
|
* Written 1998 by Durk Talsma, started Juni, 1998. For the flight gear
|
|
|
|
* project.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _GUI_H_
|
|
|
|
#define _GUI_H_
|
|
|
|
|
2001-04-22 17:00:08 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_WINDOWS_H
|
|
|
|
# include <windows.h>
|
|
|
|
#endif
|
|
|
|
|
2000-02-15 03:30:01 +00:00
|
|
|
#include <GL/glut.h> // needed before pu.h
|
2000-02-04 22:50:04 +00:00
|
|
|
#include <plib/pu.h> // plib include
|
1998-06-12 01:07:06 +00:00
|
|
|
|
2001-07-24 23:50:44 +00:00
|
|
|
#include <simgear/misc/exception.hxx>
|
|
|
|
|
2002-08-25 22:53:38 +00:00
|
|
|
#define TR_HIRES_SNAP 1
|
|
|
|
|
|
|
|
|
2001-01-08 20:55:16 +00:00
|
|
|
// gui.cxx
|
1999-05-12 01:11:17 +00:00
|
|
|
extern void guiInit();
|
1999-05-06 21:14:06 +00:00
|
|
|
extern void guiToggleMenu(void);
|
1999-06-01 21:17:10 +00:00
|
|
|
extern void mkDialog(const char *txt);
|
2001-07-24 23:50:44 +00:00
|
|
|
extern void guiErrorMessage(const char *txt);
|
|
|
|
extern void guiErrorMessage(const char *txt, const sg_throwable &throwable);
|
1999-05-12 01:11:17 +00:00
|
|
|
extern void ConfirmExitDialog(void);
|
|
|
|
|
1999-10-26 03:45:33 +00:00
|
|
|
extern void fgDumpSnapShot();
|
|
|
|
|
1999-05-12 01:11:17 +00:00
|
|
|
extern puFont guiFnt;
|
|
|
|
extern fntTexFont *guiFntHandle;
|
2001-01-08 20:55:16 +00:00
|
|
|
extern int gui_menu_on;
|
1999-05-12 01:11:17 +00:00
|
|
|
|
2002-08-25 22:53:38 +00:00
|
|
|
// from gui_funcs.cxx
|
|
|
|
extern void saveFlight(puObject *);
|
|
|
|
extern void loadFlight(puObject *);
|
|
|
|
extern void reInit(puObject *);
|
|
|
|
extern void dumpSnapShot(puObject *);
|
|
|
|
#ifdef TR_HIRES_SNAP
|
|
|
|
extern void dumpHiResSnapShot(puObject *);
|
|
|
|
#endif
|
|
|
|
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__)
|
|
|
|
extern void printScreen(puObject *);
|
|
|
|
#endif
|
|
|
|
extern void MayBeGoodBye(puObject *);
|
|
|
|
extern void guiTogglePanel(puObject *);
|
|
|
|
extern void PilotOffsetAdjust(puObject *);
|
|
|
|
extern void fgHUDalphaAdjust(puObject *);
|
|
|
|
extern void prop_pickerView(puObject *);
|
|
|
|
extern void NewAirport(puObject *);
|
|
|
|
#ifdef FG_NETWORK_OLK
|
|
|
|
extern void net_display_toggle(puObject *);
|
|
|
|
extern void NewCallSign(puObject *);
|
|
|
|
extern void net_fgd_scan(puObject *);
|
|
|
|
extern void net_register(puObject *);
|
|
|
|
extern void net_unregister(puObject *);
|
|
|
|
#endif
|
|
|
|
extern void NewAltitude(puObject *);
|
|
|
|
extern void AddWayPoint(puObject *);
|
|
|
|
extern void PopWayPoint(puObject *);
|
|
|
|
extern void ClearRoute(puObject *);
|
|
|
|
extern void fgAPAdjust(puObject *);
|
|
|
|
extern void fgLatLonFormatToggle(puObject *);
|
|
|
|
extern void helpCb(puObject *);
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char *name;
|
|
|
|
void (*fn)(puObject *);
|
|
|
|
} __fg_gui_fn_t;
|
|
|
|
extern const __fg_gui_fn_t __fg_gui_fn[];
|
|
|
|
|
1999-06-01 21:17:10 +00:00
|
|
|
// GLOBAL COMMON DIALOG BOX TEXT STRINGS
|
|
|
|
extern char *gui_msg_OK; // "OK"
|
|
|
|
extern char *gui_msg_NO; // "NO"
|
|
|
|
extern char *gui_msg_YES; // "YES"
|
|
|
|
extern char *gui_msg_CANCEL; // "CANCEL"
|
|
|
|
extern char *gui_msg_RESET; // "RESET"
|
1999-05-12 01:11:17 +00:00
|
|
|
|
2001-01-08 20:55:16 +00:00
|
|
|
// mouse.cxx
|
2002-02-05 20:54:08 +00:00
|
|
|
extern void guiInitMouse(int width, int height);
|
2001-01-08 20:55:16 +00:00
|
|
|
extern void guiMotionFunc ( int x, int y );
|
|
|
|
extern void guiMouseFunc(int button, int updown, int x, int y);
|
|
|
|
extern void maybeToggleMouse( void );
|
|
|
|
extern void BusyCursor( int restore );
|
|
|
|
extern void CenterView( void );
|
|
|
|
extern void TurnCursorOn( void );
|
|
|
|
extern void TurnCursorOff( void );
|
|
|
|
|
1999-05-12 01:11:17 +00:00
|
|
|
// MACROS TO HELP KEEP PUI LIVE INTERFACE STACK IN SYNC
|
|
|
|
// These insure that the mouse is active when dialog is shown
|
|
|
|
// and try to the maintain the original mouse state when hidden
|
|
|
|
// These will also repair any damage done to the Panel if active
|
|
|
|
|
|
|
|
// Activate Dialog Box
|
2002-02-05 20:54:08 +00:00
|
|
|
inline void FG_PUSH_PUI_DIALOG( puObject *X ) {
|
|
|
|
maybeToggleMouse();
|
|
|
|
puPushLiveInterface( (puInterface *)X ) ;
|
|
|
|
X->reveal() ;
|
|
|
|
}
|
1999-05-12 01:11:17 +00:00
|
|
|
|
|
|
|
// Deactivate Dialog Box
|
2002-02-05 20:54:08 +00:00
|
|
|
inline void FG_POP_PUI_DIALOG( puObject *X ) {
|
|
|
|
X->hide();
|
|
|
|
puPopLiveInterface();
|
1999-05-12 01:11:17 +00:00
|
|
|
maybeToggleMouse();
|
2002-02-05 20:54:08 +00:00
|
|
|
}
|
1998-06-12 01:07:06 +00:00
|
|
|
|
1999-05-12 01:11:17 +00:00
|
|
|
// Finalize Dialog Box Construction
|
2002-02-05 20:54:08 +00:00
|
|
|
inline void FG_FINALIZE_PUI_DIALOG( puObject *X ) {
|
|
|
|
((puGroup *)X)->close();
|
|
|
|
X->hide();
|
1999-05-12 01:11:17 +00:00
|
|
|
puPopLiveInterface();
|
2002-02-05 20:54:08 +00:00
|
|
|
}
|
1999-05-12 01:11:17 +00:00
|
|
|
|
1999-05-06 21:14:06 +00:00
|
|
|
#endif // _GUI_H_
|