1 /**************************************************************************
4 * Written 1998 by Durk Talsma, started Juni, 1998. For the flight gear
7 * Additional mouse supported added by David Megginson, 1999.
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 **************************************************************************/
31 #include <simgear/compiler.h>
37 #include <simgear/structure/exception.hxx>
38 #include <simgear/misc/sg_path.hxx>
39 #include <simgear/props/props.hxx>
40 #include <simgear/props/props_io.hxx>
44 #include <Include/general.hxx>
45 #include <Main/main.hxx>
46 #include <Main/globals.hxx>
47 #include <Main/fg_props.hxx>
48 #include <GUI/new_gui.hxx>
51 #include "gui_local.hxx"
58 /* -------------------------------------------------------------------------
60 _____________________________________________________________________*/
71 puSetDefaultStyle ( PUSTYLE_SMALL_SHADED ); //PUSTYLE_DEFAULT
72 puSetDefaultColourScheme (0.8, 0.8, 0.9, 1);
74 FGFontCache *fc = globals->get_fontcache();
75 puFont *GuiFont = fc->get(globals->get_locale()->getStringValue("font", "typewriter.txf"), 15);
76 puSetDefaultFonts(*GuiFont, *GuiFont);
77 guiFnt = puGetDefaultLabelFont();
79 LayoutWidget::setDefaultFont(GuiFont, 15);
81 if (!fgHasNode("/sim/startup/mouse-pointer")) {
82 // no preference specified for mouse pointer, attempt to autodetect...
83 // Determine if we need to render the cursor, or if the windowing
84 // system will do it. First test if we are rendering with glide.
85 if ( strstr ( general.get_glRenderer(), "Glide" ) ) {
86 // Test for the MESA_GLX_FX env variable
87 if ( (mesa_win_state = getenv( "MESA_GLX_FX" )) != NULL) {
88 // test if we are fullscreen mesa/glide
89 if ( (mesa_win_state[0] == 'f') ||
90 (mesa_win_state[0] == 'F') ) {
95 // mouse_active = ~mouse_active;
96 } else if ( !fgGetBool("/sim/startup/mouse-pointer") ) {
99 // force showing pointer
101 // mouse_active = ~mouse_active;
104 // MOUSE_VIEW mode stuff