/*
 WMHELPER.DOX

 License CC0 PUBLIC DOMAIN

 To the extent possible under law, Mark J. Olesen has waived all copyright
 and related or neighboring rights to FDOSTUI Library. This work is published
 from: United States.
*/

/*! \file wmhelper.hpp
\brief contains wmhelper class
*/

/*!
\class wmhelper wmhelper.hpp
\brief window manager helper class

This class should be a singleon. However, it is assumed that only
one instance will be instantiated, and that is in the window manager.

The class wraps up a window and takes control of specific events that can
occur. These events include the system menu, minimize or maximize buttons,
and moving or resizing the widget.

*/

/*!
\var wmhelper::MIN_WIDTH
	minimum width of a window widget
*/

/*!
\var wmhelper::MIN_HEIGHT
	minimum height of a window widget
*/

/*!
\fn wmhelper::wmhelper()
\brief constructor
\returns none
*/

/*!
\fn virtual wmhelper::~wmhelper()
\brief destructor
\returns none
*/

/*!
\fn void wmhelper::draw_decorate(
        struct box const&               i_box,
        enum window::attributes const   i_attr,
        unsigned char const*            i_title)
\brief adorns a rectangular area
\param[in] i_box rectangular region to paint
\param[in] i_attr drawing attributes
\param[in] i_title optional title
\returns none

Coordinates are relative to the screen. Clipping is not in affect.

This method will draw a frame, and depending
on the attributes, it will draw a title, system button, minimize and maximize 
buttons and a resize button.

*/

/*!
\fn void wmhelper::draw_frame(
        struct box const&               i_box,
        struct skin_frame const&        i_skin,
        enum foreground const           i_fcolor,
        enum background const           i_bcolor)
\brief draw a rectangular frame
\param[in] i_box rectangular region to paint
\param[in] i_skin how to draw the frame
\param[in] i_fcolor foreground color
\param[in] i_bcolor background color
\returns none
*/

/*!
\fn void wmhelper::draw_title(
        unsigned char const*            i_title,
        struct box const&               i_box)
\brief draw title on the window
\param[in] i_title valid title to draw 
\param[in] i_box rectangular region
\returns none
*/

/*!
\fn enum event_response wmhelper::event_key(
        struct event_key const&         i_event)
\brief handle key event
\param[in] i_event key event to handle    
\returns response how event was handled

*/

/*!
\fn enum event_response wmhelper::event_key(
        window*const                    i_window,
        struct event_key const&         i_event)
\brief handle key event
\param[in] i_window  window that will receive events
\param[in] i_event key event to handle
\returns ::RESPONSE_NONE

Currently, this method does nothing. In the future, it may be used
to activate the system menu with a key combination.

*/

/*!
\fn enum event_response wmhelper::event_mouse(
        struct event_mouse const&       i_event)
\brief handle mouse event
\param[in] i_event mouse event to handle
\returns response how event was handled
*/

/*!
\fn enum event_response wmhelper::event_mouse(
        window*const                    i_window,
        struct event_mouse const&       i_event)
\brief handle mouse event
\param[in] i_window window to receive events
\param[in] i_event mouse event to handle
\returns response
*/

/*!
\fn void wmhelper::close()
\brief closes the window
\returns none
*/

/*!
\fn void wmhelper::maximize()
\brief maximizes the window
\returns none
*/

/*!
\fn void wmhelper::minimize()
\brief minimizes the window
\returns none
*/

/*!
\fn bool wmhelper::capture() const
\brief gets whether or not the window is in capture mode
\returns true capture is on
\returns false capture is off
*/

/*!
\fn void wmhelper::capture_resize()
\brief sets capture state to ::CAPTURE_KEYBOARD and event state to ::EVENT_RESIZE
\returns none
*/


/*!
\fn void wmhelper::capture_move()
\brief sets capture state to ::CAPTURE_KEYBOARD and event state to ::EVENT_MOVE
\returns none
*/

/*!
\enum wmhelper::wm_event
\brief current event state 

\var wmhelper::wm_event wmhelper::EVENT_NONE
	clear state
	
\var wmhelper::wm_event wmhelper::EVENT_RESIZE
	resize state

\var wmhelper::wm_event wmhelper::EVENT_MOVE
	move state
*/

/*!
\enum wmhelper::wm_capture
\brief capture state

\var wmhelper::wm_capture wmhelper::CAPTURE_NONE
	clear state

\var wmhelper::wm_capture wmhelper::CAPTURE_MOUSE
	mouse capture state

\var wmhelper::wm_capture wmhelper::CAPTURE_KEYBOARD
	keyboard capture state
*/


/*!
\var wmhelper::m_window
	reference to window being manipulated
*/

/*!
\var wmhelper::m_mouse_x
	previous mouse x position
*/

/*!
\var wmhelper::m_mouse_y
	previous mouse y position
*/

/*!
\var wmhelper::m_event
	event state
*/

/*!
\var wmhelper::m_capture
	capture state
*/

/*!
\fn void wmhelper::event_system_menu()
\brief pop-up the system menu
\returns none
*/

