1
0
Fork 0
flightgear/src/GUI/gui.h
curt 08bbb83b8e A grab bag of tweaks and patches from Norman Vine.
- Better mingwin/cygwin support
- Various gui tweaks and code clean ups
- Initialization clean ups
- Hitlist/scenery tweaks
- other misc. stuff.
2002-02-05 20:54:08 +00:00

98 lines
2.9 KiB
C

/**************************************************************************
* 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_
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_WINDOWS_H
# include <windows.h>
#endif
#include <GL/glut.h> // needed before pu.h
#include <plib/pu.h> // plib include
#include <simgear/misc/exception.hxx>
// gui.cxx
extern void guiInit();
extern void guiToggleMenu(void);
extern void mkDialog(const char *txt);
extern void guiErrorMessage(const char *txt);
extern void guiErrorMessage(const char *txt, const sg_throwable &throwable);
extern void ConfirmExitDialog(void);
extern void fgDumpSnapShot();
extern puFont guiFnt;
extern fntTexFont *guiFntHandle;
extern int gui_menu_on;
// 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"
// mouse.cxx
extern void guiInitMouse(int width, int height);
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 );
// 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
inline void FG_PUSH_PUI_DIALOG( puObject *X ) {
maybeToggleMouse();
puPushLiveInterface( (puInterface *)X ) ;
X->reveal() ;
}
// Deactivate Dialog Box
inline void FG_POP_PUI_DIALOG( puObject *X ) {
X->hide();
puPopLiveInterface();
maybeToggleMouse();
}
// Finalize Dialog Box Construction
inline void FG_FINALIZE_PUI_DIALOG( puObject *X ) {
((puGroup *)X)->close();
X->hide();
puPopLiveInterface();
}
#endif // _GUI_H_