/*****************************************************************************
 * $LastChangedDate: 2011-04-09 21:58:06 -0400 (Sat, 09 Apr 2011) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Base class for HUD objects.
 *//*
 * LEGAL:   COPYRIGHT (C) 2008 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
 *****************************************************************************/

#ifndef HUD_HUD_OBJECT_HH
#define HUD_HUD_OBJECT_HH 1

#include "base/event.hh"
namespace view { class View; }
using namespace view;

namespace hud {

////////////////////////////////////////////////////////////////////////////
/// @brief Base class for HUD objects.
///
/// This base class registers a "frame update" callback which
/// derivatives can hook by override the virtual HudObject::Update().
///
class HudObject : public Shared
{
PREVENT_COPYING(HudObject)

private:
    /// @brief Called every frame.  Reflects to HudObject::Update().
    ///
    CLASS_EVENT_LISTENER( WindowPostDrawListener, Void, HudObject, mHudObject )

protected:
                    HudObject( void );
    virtual         ~HudObject();
    virtual void    Update( View& view ) = 0;

// Data:
private:    shptr<WindowPostDrawListener>   mWindowPostDrawListener;    ///< post-draw callback
public:     DECLARE_TYPESIG(TYPESIG_HUD_OBJECT)
};

} // namespace hud

#endif // HUD_HUD_OBJECT_HH
