// ---------------------------------------------------------------------------
// 
//   Lily Engine alpha
// 
//   Copyright (c) 2010 Clifford Jolly
//     http://cliffjolly.com
//     cliff@cliffjolly.com
// 
// ---------------------------------------------------------------------------
// 
//   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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
//   USA
// -------------------------- END HEADER -------------------------------------

#ifndef ENGINEUI_H
#define ENGINEUI_H

#include <string>

// This is for UI related to the engine. For example, the game
// selection screen and options screens.

// This UI lives on top of the editor UI and the game UI.

class World;
class Widget;
union WidgetEvent;

/// Push a new screen onto the top of the engine UI stack.
void engineUIPush(Widget *w);

/// Pop the top screen off the engine UI stack.
void engineUIPop(void);

/// Pop the top screen off the engine UI stack and delete it.
void engineUIPopAndDestroy(void);

/// Push an event to the Widget at the top of the engine UI stack.
bool engineUIHandleEvent(WidgetEvent *event, World *world);

/// Draw the Widgets in the engine UI stack from back to front.
void engineUIDraw(int width, int height);

/// Returns true if there's anything on the engine UI stack.
bool engineUIOpen(void);

/// Returns true of someone quit the game through the engine UI.
bool engineUIGotQuit(void);

/// Set a name for a keybind number. Shows up in the keybind editor in
/// the options window.
void engineUISetControlActionName(int controlNumber, const std::string &name);

/// Do general update stuff. Actually just handles waiting for a
/// keybind to be set at the moment.
void engineUIUpdate(void);

/// Push the game selection screen onto the top of the stack.
void popupGameSelectScreen(World *world);

#endif

