/*  $Id: input_button.cpp,v 1.6 2003/09/08 15:22:54 grumbel Exp $
**
**  ClanLib Game SDK
**  Copyright (C) 2003  The ClanLib Team
**  For a total list of contributers see the file CREDITS.
**
**  This library is free software; you can redistribute it and/or
**  modify it under the terms of the GNU Lesser General Public
**  License as published by the Free Software Foundation; either
**  version 2.1 of the License, or (at your option) any later version.
**
**  This library 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
**  Lesser General Public License for more details.
**
**  You should have received a copy of the GNU Lesser General Public
**  License along with this library; if not, write to the Free Software
**  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
*/

#include "Display/display_precomp.h"
#include "API/Display/input_button.h"
#include "input_button_generic.h"

/////////////////////////////////////////////////////////////////////////////
// CL_InputButton construction:

CL_InputButton::CL_InputButton()
: impl(new CL_InputButton_Generic)
{
}

CL_InputButton::CL_InputButton(const CL_InputButton &copy)
: impl(new CL_InputButton_Generic)
{
	// TODO:
}

CL_InputButton::~CL_InputButton()
{
}

/////////////////////////////////////////////////////////////////////////////
// CL_InputButton attributes:

int CL_InputButton::peek_pressed() const
{
	return impl->presses;
}

CL_InputEvent CL_InputButton::peek_key() const
{
	// TODO:
	return CL_InputEvent();
}

/////////////////////////////////////////////////////////////////////////////
// CL_InputButton operations:

CL_InputButton &CL_InputButton::operator =(const CL_InputButton &copy)
{
	// TODO:
	return *this;
}

void CL_InputButton::bind(const CL_KeyBinding &key)
{
	impl->bind(key);
}

void CL_InputButton::unbind(const CL_KeyBinding &key)
{
	impl->unbind(key);
}

void CL_InputButton::unbind_all()
{
	impl->bindings.clear();
}

const std::list<CL_KeyBinding> &CL_InputButton::get_bindings() const
{
	return impl->bindings;
}

int CL_InputButton::pop_pressed()
{
	int presses = impl->presses;
	impl->presses = 0;
	return presses;
}

CL_InputEvent CL_InputButton::pop_key()
{
	impl->presses = 0;
	return CL_InputEvent();
}

void CL_InputButton::clear()
{
	impl->presses = 0;
}

/////////////////////////////////////////////////////////////////////////////
// CL_InputButton implementation:
