/*  $Id: display_iostream.cpp,v 1.2 2003/11/02 12:21:04 mbn 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 <iostream>
#include "API/Display/display_window.h"
#include "API/Display/input_event.h"
#include "API/Display/input_device.h"
#include "API/Display/display_iostream.h"

std::ostream& operator<<(std::ostream& s, const CL_DisplayWindow& window)
{
	s << "#<CL_DisplayWindow: " << window.get_width() << "x" << window.get_height() << ">";
	return s;
}

std::ostream& operator<<(std::ostream& s, const CL_InputDevice& device)
{
	s << "#<CL_InputDevice: '" << device.get_name() << "'>";
	return s;
}

std::ostream& operator<<(std::ostream& s, const CL_InputEvent& event)
{
	s << "#<CL_InputEvent: ";

	switch (event.type)
	{
	case CL_InputEvent::no_key:
      s << "no_key";
      break;
	case CL_InputEvent::pressed:
      s << "pressed";
      break;
	case CL_InputEvent::released:
      s << "released";
      break;
	case CL_InputEvent::double_clicked:
      s << "double_clicked";
      break;
	case CL_InputEvent::pointer_moved:
      s << "pointer_moved";
      break;
	case CL_InputEvent::axis_moved:
      s << "axis_moved";
      break;
	case CL_InputEvent::ball_moved:
      s << "ball_moved";
      break;
	default:
      s << "unknown";
	}

	s << " '" << event.device.get_key_name(event.id) << "'";
	s << " " << event.device;
	s << ">";

	return s;
}

// EOF //
