indexing
	description: "Window manager which is able to retrieve an Eiffel object from a HWND."
	status: "See notice at end of class."
	date: "$Date$"
	revision: "$Revision$"

class interface
	WEL_WINDOW_MANAGER

feature -- Status report

	foreground_window: WEL_WINDOW
			-- Foreground window (window with focus)
			-- (from WEL_WINDOWS_ROUTINES)

	is_window (hwnd: POINTER): BOOLEAN
			-- Does hwnd point to a valid Window?
			-- (from WEL_WINDOWS_ROUTINES)

	key_down (virtual_key: INTEGER): BOOLEAN
			--Is 'virtual' key pressed
			-- (from WEL_WINDOWS_ROUTINES)

	key_locked (virtual_key: INTEGER): BOOLEAN
			--Is 'virtual' key locked
			-- (from WEL_WINDOWS_ROUTINES)

	key_to_string (key_data: INTEGER): STRING
			-- Give the string associated with the key given by
			-- virtual_key.
			-- (from WEL_WINDOWS_ROUTINES)

	registered (window: WEL_WINDOW): BOOLEAN
			-- Is window registered?
		require
			window_not_void: window /= void

	system_directory: STRING
			-- Path of the Windows system directory
			-- (from WEL_WINDOWS_ROUTINES)
		ensure -- from WEL_WINDOWS_ROUTINES
			result_not_void: Result /= void

	tick_count: INTEGER
			-- Number of milliseconds that have
			-- elapsed since Windows was started.
			-- (from WEL_WINDOWS_ROUTINES)
		ensure -- from WEL_WINDOWS_ROUTINES
			positive_result: Result >= 0

	window_of_item (hwnd: POINTER): WEL_WINDOW
			-- Retrieve Eiffel object associated with hwnd pointer.
			-- (from WEL_WINDOWS_ROUTINES)
		require -- from WEL_WINDOWS_ROUTINES
			hwnd_not_null: hwnd /= default_pointer
			is_window_pointer: is_window (hwnd)
		ensure -- from WEL_WINDOWS_ROUTINES
			is_wel_window: Result /= void implies (create {INTERNAL}).type_conforms_to ((create {INTERNAL}).dynamic_type (Result), (create {INTERNAL}).dynamic_type_from_string ("WEL_WINDOW"))

	windows_directory: STRING
			-- Path of the Windows directory
			-- (from WEL_WINDOWS_ROUTINES)
		ensure -- from WEL_WINDOWS_ROUTINES
			result_not_void: Result /= void
	
feature -- Basic operations

	hide_cursor
			-- Hide the cursor.
			-- (from WEL_WINDOWS_ROUTINES)

	message_beep_asterisk
			-- Play the system asterisk waveform sound.
			-- (from WEL_WINDOWS_ROUTINES)

	message_beep_exclamation
			-- Play the system exclamation waveform sound.
			-- (from WEL_WINDOWS_ROUTINES)

	message_beep_hand
			-- Play the system hand waveform sound.
			-- (from WEL_WINDOWS_ROUTINES)

	message_beep_ok
			-- Play the system ok waveform sound.
			-- (from WEL_WINDOWS_ROUTINES)

	message_beep_question
			-- Play the system question waveform sound.
			-- (from WEL_WINDOWS_ROUTINES)

	output_debug_string (s: STRING)
			-- Send a string s to the system debugger.
			-- (from WEL_WINDOWS_ROUTINES)
		require -- from WEL_WINDOWS_ROUTINES
			s_not_void: s /= void

	register_window (window: WEL_WINDOW)
			-- Register window in the window manager.
		require
			window_not_void: window /= void
			unregistered: not registered (window)
		ensure
			registered: registered (window)

	resource_string_id (an_id: INTEGER): STRING
			-- String identified by an_id in the resource file.
			-- (from WEL_WINDOWS_ROUTINES)
		ensure -- from WEL_WINDOWS_ROUTINES
			result_not_void: Result /= void

	set_cursor_position_absolute (x, y: INTEGER)
			-- Set the cursor position to x, y.
			-- (from WEL_WINDOWS_ROUTINES)

	show_cursor
			-- Show the cursor.
			-- (from WEL_WINDOWS_ROUTINES)
	
invariant

		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)

end -- class WEL_WINDOW_MANAGER