indexing
	description: "Contains information about the size and position of a window."
	status: "See notice at end of class."
	date: "$Date$"
	revision: "$Revision$"

class interface
	WEL_WINDOW_POS

create 

	make
			-- Allocate item
			-- (from WEL_STRUCTURE)
		ensure -- from WEL_STRUCTURE
			not_shared: not shared

	make_by_pointer (a_pointer: POINTER)
			-- Set item with a_pointer.
			-- Since item is shared, it does not need
			-- to be freed.
			-- Caution: a_pointer must be a pointer
			-- coming from Windows.
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			item_set: item = a_pointer
			shared: shared

feature -- Access

	flags: INTEGER
			-- Window position flags
			-- See class WEL_SWP_CONSTANTS for values
		ensure
			positive_result: Result >= 0

	height: INTEGER
			-- Window height
		ensure
			positive_result: Result >= 0

	hwindow_insert_after: POINTER
			-- Position of the window in Z order (front-to-back
			-- position). This window can be the window behind
			-- which this window is placed.

	item: POINTER
			-- Generic Windows handle or structure pointer.
			-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
			-- (from WEL_ANY)

	width: INTEGER
			-- Window width
		ensure
			positive_result: Result >= 0

	window: WEL_WINDOW
			-- Identifies the window

	window_insert_after: WEL_WINDOW
			-- Position of the window in Z order (front-to-back
			-- position). This window can be the window behind
			-- which this window is placed.

	x: INTEGER
			-- Position of the left edge of the window

	y: INTEGER
			-- Position of the top edge of the window
	
feature -- Measurement

	structure_size: INTEGER
			-- Size to allocate (in bytes)
		ensure -- from WEL_STRUCTURE
			positive_result: Result > 0
	
feature -- Status report

	exists: BOOLEAN
			-- Does the item exist?
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			Result = (item /= default_pointer)

	shared: BOOLEAN
			-- Is item shared by another object?
			-- If False (by default), item will
			-- be destroyed by destroy_item.
			-- If True, item will not be destroyed.
			-- (from WEL_ANY)
	
feature -- Status setting

	set_shared
			-- Set shared to True.
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			shared: shared

	set_unshared
			-- Set shared to False.
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			unshared: not shared
	
feature -- Element change

	set_bottom
			-- Place the window at the bottom of the Z order.
			-- If window identifies a topmost window, the window
			-- loses its topmost status and is placed at the bottom
			-- of all other windows.

	set_flags (a_flags: INTEGER)
			-- Set flags with a_flags.
			-- See class WEL_SWP_CONSTANTS for a_flags values.
		ensure
			flags_set: flags = a_flags

	set_height (a_height: INTEGER)
			-- Set height with a_height.
		ensure
			height_set: height = a_height

	set_hwindow_insert_after (a_window: POINTER)
			-- Set window_insert_after with a_window.

	set_item (an_item: POINTER)
			-- Set item with an_item
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			item_set: item = an_item

	set_no_topmost
			-- Places the window above all non-topmost windows
			-- (that is, behind all topmost windows). No effect
			-- if the window is already a non-topmost window.

	set_top
			-- Place the window at the top of the Z order.

	set_topmost
			-- Places the window above all non-topmost windows.
			-- The window maintains its topmost position even when
			-- it is deactivated.

	set_width (a_width: INTEGER)
			-- Set width with a_width.
		ensure
			width_set: width = a_width

	set_window (a_window: WEL_WINDOW)
			-- Set window with a_window.
		require
			a_window_not_void: a_window /= void
			a_window_exists: a_window.exists
		ensure
			window_set: window = a_window

	set_window_insert_after (a_window: WEL_WINDOW)
			-- Set window_insert_after with a_window.
		require
			a_window_not_void: a_window /= void
			a_window_exists: a_window.exists
		ensure
			window_insert_after_set: window_insert_after = a_window

	set_x (a_x: INTEGER)
			-- Set x with a_x.
		ensure
			x_set: x = a_x

	set_y (a_y: INTEGER)
			-- Set y with a_y.
		ensure
			y_set: y = a_y
	
feature -- Removal

	dispose
			-- Destroy the inner structure of Current.
			--
			-- This function should be called by the GC when the
			-- object is collected or by the user if Current is
			-- no more usefull.
			-- (from WEL_ANY)
	
feature -- Conversion

	to_integer: INTEGER
			-- Converts item to an integer.
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			Result = cwel_pointer_to_integer (item)
	
feature -- Basic operations

	initialize
			-- Fill Current with zeros.
			-- (from WEL_STRUCTURE)
		require -- from WEL_STRUCTURE
			exists: exists

	initialize_with_character (a_character: CHARACTER)
			-- Fill current with a_character.
			-- (from WEL_STRUCTURE)
		require -- from WEL_STRUCTURE
			exists: exists

	memory_copy (source_pointer: POINTER; length: INTEGER)
			-- Copy length bytes from source_pointer to item.
			-- (from WEL_STRUCTURE)
		require -- from WEL_STRUCTURE
			length_small_enough: length <= structure_size
			length_large_enough: length > 0
			exists: exists
	
invariant

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

end -- class WEL_WINDOW_POS