/******************************************************************************
 * $Id: gfx_gui_opengl.hh,v 1.41 2006/09/25 01:58:51 jimb Exp $
 * @file
 * @author	Jim E. Brooks  http://www.jimbrooks.org
 * @brief	Simple lightweight GUI inside of a viewport (OpenGL).
 *          Components are drawn blended, and include text fonts, buttons, etc.
 *			See gui_gui.hh.
 *//*
 * LEGAL:	COPYRIGHT (C) 2004 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE (GPL).
 ******************************************************************************/

#ifndef GFX_GUI_OPENGL_HH
#define GFX_GUI_OPENGL_HH

#include "gfx_gui.hh"

namespace gfx {

////////////////////////////////////////////////////////////////////////////////
/// @brief Top-level GUI class.
class Gui : public GuiBase
{
    PREVENT_COPYING(Gui)
private:
	typedef GuiBase Parent;

public:
					Gui( const Geom<int>& viewport, const Geom<int>& window );
					~Gui();
	void			Render( void ) { Parent::Render(); }
	void			MousePos2ViewportPos( const Pos2d<float>& in, Pos2d<float>& out );

private:
	void			NewFonts( void );
	void			DeleteFonts( void );

	// --------- actual fonts ---------------------
	// GL-117 font #1 with different sizes.
	Font*			mFontText;
	Font*			mFontButton;
	// GL-117 font #2 with different sizes.
	// Similar to but more narrow than font #1.
	Font*			mFontTextThin;
	// --------- actual fonts ---------------------
};

////////////////////////////////////////////////////////////////////////////////
/// @brief Button class.
///
/// Applications instead should use Gui::NewButton() and Gui::DeleteButton().
class GuiButton : public GuiButtonBase
{
	PREVENT_COPYING(GuiButton)
private: // entirely private
	typedef GuiButtonBase Parent;
					GuiButton( GuiScreen& screen, float x, float  y, eFontMode fontMode, fnMouseButtonCallback callback );
					~GuiButton() { }
	void			Render( void );
	void			ResetRGBA( void );
friend class Gui;
friend class GuiBase;
friend class GuiScreen;
};

} // namespace gfx

#endif // GFX_GUI_OPENGL_HH
