/*  $Id: gui_manager.cpp,v 1.28 2004/04/14 20:46:56 sphair 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 "precomp.h"
#include "API/GUI/gui_manager.h"
#include "API/Display/display.h"
#include "gui_manager_generic.h"

/////////////////////////////////////////////////////////////////////////////
// CL_GUIManager Construction:

CL_GUIManager::CL_GUIManager(CL_StyleManager *style)
:
	CL_Component(CL_Rect(0, 0, CL_Display::get_width(), CL_Display::get_height()), NULL, style)
{
	impl = new CL_GUIManager_Generic(this);
	set_focusable(false);
}

CL_GUIManager::~CL_GUIManager()
{
	delete impl;
}

/////////////////////////////////////////////////////////////////////////////
// CL_GUIManager Attributes:

CL_Component *CL_GUIManager::get_focus() const
{
	return impl->get_focus();
}

CL_Component *CL_GUIManager::get_capture() const
{
	return impl->get_capture();
}

bool CL_GUIManager::is_input_enabled() const
{
	return impl->is_input_enabled();
}

CL_EventTrigger *CL_GUIManager::get_update_trigger()
{
	return &impl->update_trigger;
}

/////////////////////////////////////////////////////////////////////////////
// CL_GUIManager Operations:

void CL_GUIManager::set_focus(CL_Component *component)
{
	impl->set_focus(component);
}

void CL_GUIManager::run(CL_Component *modal_component)
{
	impl->run(modal_component);
}

void CL_GUIManager::show()
{
	impl->show();
}

void CL_GUIManager::quit()
{
	impl->quit();
}

void CL_GUIManager::enable_input()
{
	impl->enable_input();
}

void CL_GUIManager::disable_input()
{
	impl->disable_input();
}

void CL_GUIManager::gui_capture_mouse(CL_Component *component)
{
	impl->gui_capture_mouse(component);
}

void CL_GUIManager::gui_release_mouse()
{
	impl->gui_release_mouse();
}

/////////////////////////////////////////////////////////////////////////////
// CL_GUIManager Signals:

CL_Signal_v1<CL_Component *> &CL_GUIManager::sig_focus_changed()
{
	return impl->sig_focus_changed;
}

CL_Component * CL_GUIManager::get_modal_component() const
{
	return impl->get_modal_component();
}
