note
	description: "[
		A window.
		You need a renderer (see: GAME_WINDOW_RENDERED)
		or a window surface (see: GAME_WINDOW_SURFACED)
		to put thing on the window.
	]"
	author: "Louis Marchand"
	date: "Fri, 27 Feb 2015 14:42:17 +0000"
	revision: "1.0"
	todo: "HighDPI"

deferred class interface
	GAME_WINDOW

feature -- Access

	update
			-- Print the visual buffer modification to the screen
		require
			window_not_closed: exists

	has_clipboard_text: BOOLEAN
			-- True if the system clipboard has some text

	clipboard_text: READABLE_STRING_GENERAL assign set_clipboard_text
			-- The text contained by the system clipboard
		require
			has_text: has_clipboard_text

	set_clipboard_text (a_text: READABLE_STRING_GENERAL)
			-- Put a_text into the system clipboard

	brightness: REAL_32 assign set_brightness
			-- The Gamma correction where 0.0 is completely dark and 1.0 is normal.
		require
			window_not_closed: exists
		ensure
			window_brightness_not_changed: brightness = old brightness

	set_brightness (a_brightness: REAL_32)
			-- Set the brightness (gamma correction) to a_brightness for Current where 0.0 is completely dark and 1.0 is normal.
			-- Set has_error when an error occured.
		require
			window_not_closed: exists
			window_set_brightness_valid: a_brightness >= 0.0 and a_brightness <= 1.to_real
		ensure
			window_set_brightness_changed: brightness = a_brightness

	display_index: INTEGER_32
			-- Index of the display containing the center of the window.
		require
			window_not_closed: exists
		ensure
			window_display_index_valid: not has_error implies Result >= 0

	display: GAME_DISPLAY
			-- display containing the center of the window.
		require
			window_not_closed: exists

	close
			-- Close Current (you cannot open it again).
		require
			window_not_closed: exists

	exists: BOOLEAN
			-- Is Current has been closed

	pixel_format: GAME_PIXEL_FORMAT_READABLE
			-- The internal format of the pixel representation in memory.
		require
			window_not_closed: exists

	window_manager: GAME_WINDOW_MANAGER
			-- The window manager managing Current.
		require
			window_not_closed: exists

	id: NATURAL_32
			-- The internal identifier of the Window (For logging purpose)
		require else
			window_not_closed: exists

	hide
			-- Remove the visibility of Current
		require
			window_not_closed: exists

	show
			-- Active the visibility of Current (previously removed by hide)

	maximize
			-- Change the dimension of Current to fill the screen
		require
			window_not_closed: exists

	minimize
			-- Put Current in an iconic representation
		require
			window_not_closed: exists

	restore
			-- Get the original dimension of Current (previously change with maximize or minimize)
		require
			window_not_closed: exists

	raise
			-- Put Current to the front
		require
			window_not_closed: exists

	put_border
			-- Put border decoration to Current
		require
			window_not_closed: exists

	remove_border
			-- Remove border decoration to Current
		require
			window_not_closed: exists

	display_mode: GAME_DISPLAY_MODE assign set_display_mode
			-- The display mode of Current in fullscreen mode
		require
			window_not_closed: exists

	set_display_mode (a_display_mode: GAME_DISPLAY_MODE)
			-- Assign display_mode with the value of a_display_mode
		require
			window_not_closed: exists

	set_fullscreen
			-- Activate the "true" fullscreen mode (changing resolution if necessary)
		require
			window_not_closed: exists

	set_fake_fullscreen
			-- Activate the "fake" fullscreen mode (setting a not bordered maximized window)
		require
			window_not_closed: exists

	set_windowed
			-- Desactivate any fullscreen mode
		require
			window_not_closed: exists

	is_fullscreen: BOOLEAN assign set_is_fullscreen
			-- Is Current in fullscreen mode
		require
			window_not_closed: exists

	set_is_fullscreen (a_value: BOOLEAN)
			-- Assign to is_fullscreen the value of a_value
		ensure
			is_assign: is_fullscreen ~ a_value

	is_fake_fullscreen: BOOLEAN assign set_is_fake_fullscreen
			-- Is Current in fullscreen mode
		require
			window_not_closed: exists

	set_is_fake_fullscreen (a_value: BOOLEAN)
			-- Assign to is_fake_fullscreen the value of a_value
		ensure
			is_assign: is_fake_fullscreen ~ a_value

	is_opengl_compatible: BOOLEAN
			-- Is Current can be used in an OpenGL context
		require
			window_not_closed: exists

	is_visible: BOOLEAN
			-- Is Current in can be seen in the screen (not hidden)
		require
			window_not_closed: exists

	is_hidden: BOOLEAN assign set_is_hidden
			-- Is Current in invisible
		require
			window_not_closed: exists

	set_is_hidden (a_value: BOOLEAN)
			-- Assign to is_hidden the value of a_value
		ensure
			is_assign: is_hidden ~ a_value

	has_border: BOOLEAN
			-- Is Current has border decoration
		require
			window_not_closed: exists

	is_resizable: BOOLEAN
			-- Can Current be resized by the user
		require
			window_not_closed: exists

	is_minimized: BOOLEAN assign set_is_minimized
			-- Is Current in iconized representation
		require
			window_not_closed: exists

	set_is_minimized (a_value: BOOLEAN)
			-- Assign to is_minimized the value of a_value
		ensure
			is_assign: is_minimized ~ a_value

	is_maximized: BOOLEAN assign set_is_maximized
			-- Is Current in maximized mode (to fill the screen)
		require
			window_not_closed: exists

	set_is_maximized (a_value: BOOLEAN)
			-- Assign to is_maximized the value of a_value
		ensure
			is_assign: is_maximized ~ a_value

	has_input_focus: BOOLEAN
			-- Is Current having the focus for keyboard input
		require
			window_not_closed: exists

	has_mouse_focus: BOOLEAN
			-- Is Current having the focus of the mouse
		require
			window_not_closed: exists

	is_foreign: BOOLEAN
			-- Is Current not created by the present library
		require
			window_not_closed: exists

	gamma_correction: TUPLE [red: ARRAYED_LIST [NATURAL_16]; green: ARRAYED_LIST [NATURAL_16]; blue: ARRAYED_LIST [NATURAL_16]]
			-- The gamma encoding of Current
		require
			window_not_closed: exists

	set_gamma_correction (a_red, a_green, a_blue: ARRAYED_LIST [NATURAL_16])
			-- Assign the gamma_correction values using a_red, a_green, a_blue.
		require
			window_not_closed: exists
			red_arrays_count_valid: a_red.count = 256
			green_arrays_count_valid: a_green.count = 256
			blue_arrays_count_valid: a_blue.count = 256
		ensure
			is_assign: attached gamma_correction as la_gamma_correction and then (la_gamma_correction.red ~ a_red and la_gamma_correction.green ~ a_green and la_gamma_correction.blue ~ a_blue)

	is_input_grabbed: BOOLEAN assign set_is_input_grabbed
			-- Is Current grabbing all input
		require
			window_not_closed: exists

	set_is_input_grabbed (a_value: BOOLEAN)
			-- Assign to is_input_grabbed the value of a_value
		ensure
			is_assign: is_input_grabbed ~ a_value

	grab_input
			-- Force every input in Current
		require
			window_not_closed: exists
		ensure
			is_grabbed: is_input_grabbed

	release_input
			-- Release the input previously forced into Current
		require
			window_not_closed: exists
		ensure
			is_not_grabbed: not is_input_grabbed

	maximum_size: TUPLE [width: INTEGER_32; height: INTEGER_32]
			-- The maximum dimension that Current can take
		require
			window_not_closed: exists

	set_maximum_size (a_width, a_height: INTEGER_32)
			-- Assign the values of maximum_size with the values a_width, a_height
		require
			window_not_closed: exists

	minimum_size: TUPLE [width: INTEGER_32; height: INTEGER_32]
			-- The minimum dimension that Current can take
		require
			window_not_closed: exists

	set_minimum_size (a_width, a_height: INTEGER_32)
			-- Assign the values of minimum_size with the values a_width, a_height
		require
			window_not_closed: exists

	size: TUPLE [width: INTEGER_32; height: INTEGER_32]
			-- The present dimension of Current
		require
			window_not_closed: exists

	set_size (a_width, a_height: INTEGER_32)
			-- Assign the values of size with the values a_width, a_height
		require
			window_not_closed: exists
		ensure
			is_assign: attached size as la_size and then (la_size.width ~ a_width and la_size.height ~ a_height)

	height: INTEGER_32 assign set_height
			-- The vertical length of Current
		require
			window_not_closed: exists

	set_height (a_height: INTEGER_32)
			-- Assign height with the value of a_height
		require
			window_not_closed: exists
		ensure
			is_assign: height = a_height
			width_not_changed: width = old width

	width: INTEGER_32 assign set_width
			-- The horizontal length of Current
		require
			window_not_closed: exists

	set_width (a_width: INTEGER_32)
			-- Assign width with the value of a_width
		require
			window_not_closed: exists
		ensure
			is_assign: width = a_width
			height_not_changed: height = old height

	position: TUPLE [x: INTEGER_32; y: INTEGER_32]
			-- The coordinate (x,y) of the position of Current in the screen.
		require
			window_not_closed: exists

	set_position (a_x, a_y: INTEGER_32)
			-- Assign position with the values a_x and a_y
		require
			window_not_closed: exists

	x: INTEGER_32 assign set_x
			-- The horizontal coordinate of the position of Current
		require
			window_not_closed: exists

	set_x (a_x: INTEGER_32)
			-- assign x with the value of a_x
		require
			window_not_closed: exists
		ensure
			is_assign: x = a_x

	center_horizontally
			-- Change x so that Current became centered in the screen
		require
			window_not_closed: exists

	center_horizontally_on_display_index (a_index: INTEGER_32)
			-- Change x so that Current became centered in the screen number a_index
		require
			window_not_closed: exists
			index_valid: a_index >= 0 and a_index < Game_library.displays_count

	center_horizontally_on_display (a_display: GAME_DISPLAY)
			-- Change x so that Current became centered in the screen a_display
		require
			window_not_closed: exists

	y: INTEGER_32 assign set_y
			-- The vertical coordinate of the position of Current
		require
			window_not_closed: exists

	set_y (a_y: INTEGER_32)
			-- assign y with the value of a_y
		require
			window_not_closed: exists
		ensure
			is_assign: y = a_y

	center_vertically
			-- Change y so that Current became centered in the screen
		require
			window_not_closed: exists

	center_vertically_on_display_index (a_index: INTEGER_32)
			-- Change y so that Current became centered in the screen number a_index
		require
			window_not_closed: exists
			index_valid: a_index >= 0 and a_index < Game_library.displays_count

	center_vertically_on_display (a_display: GAME_DISPLAY)
			-- Change y so that Current became centered in the screen a_display
		require
			window_not_closed: exists

	center_position
			-- Change position so that Current became centered on the screen
		require
			window_not_closed: exists

	center_on_display_index (a_index: INTEGER_32)
			-- Change position so that Current became centered in the screen number a_index
		require
			window_not_closed: exists
			index_valid: a_index >= 0 and a_index < Game_library.displays_count

	center_on_display (a_display: GAME_DISPLAY)
			-- Change position so that Current became centered in the screen a_display
		require
			window_not_closed: exists

	title: READABLE_STRING_GENERAL assign set_title
			-- The text to write in the title bar of Current (part of the decoration)
		require
			window_not_closed: exists

	set_title (a_title: READABLE_STRING_GENERAL)
			-- Assign title using the value of a_title
		require
			window_not_closed: exists

	move_mouse_to_position (a_x, a_y: INTEGER_32)
			-- Place the mouse at position (a_x,a_y) into Current
		require
			windows_not_closed: exists

	set_icon (a_surface: GAME_SURFACE)
			-- Place the icon represented by a_surface as Current icon (in the decoration)
		require
			windows_not_closed: exists
			surface_exists: a_surface.is_open

	start_text_input
			-- Begin to read text in Current

	start_text_input_in_rectangle (a_x, a_y, a_width, a_height: INTEGER_32)
			-- Begin to read text in Current displaying updated in the
			-- rectangle starting at position (a_x, a_y) of dimention a_width X a_height.
			-- Note: The library will not automatically draw the text in the rectangle.
			-- The coordinate and dimention will be use to show the OS candidate list (if there is one).
			-- See: http://wiki.libsdl.org/Tutorials/TextInput#CandidateList

	stop_text_input
			-- Finish the reading of text in Current

	has_text_input: BOOLEAN
			-- Is Current in text input mode (see: start_text_input)

	events_controller: GAME_EVENTS_CONTROLLER
			-- The main event manager
	
feature -- Implementation

	dispose
			-- Close
	
end -- class GAME_WINDOW

Generated by ISE EiffelStudio