indexing
	description: "Abstraction for objects whos position can be set."
	status: "See notice at end of class"
	keywords: "position, width, height"
	date: "$Date$"
	revision: "$Revision$"

deferred class interface
	EV_POSITIONABLE

feature -- Access

	data: ANY
			-- Arbitrary user data may be stored here.
			-- (from EV_ANY)
	
feature -- Measurement

	height: INTEGER
			-- Vertical size in pixels.
			-- Same as minimum_height when not displayed.
			-- (from EV_POSITIONED)
		require -- from EV_POSITIONED
			not_destroyed: not is_destroyed
		ensure -- from EV_POSITIONED
			bridge_ok: Result = implementation.height

	minimum_height: INTEGER
			-- Lower bound on height in pixels.
			-- (from EV_POSITIONED)
		require -- from EV_POSITIONED
			not_destroyed: not is_destroyed
		ensure -- from EV_POSITIONED
			bridge_ok: Result = implementation.minimum_height
			positive_or_zero: Result >= 0

	minimum_width: INTEGER
			-- Lower bound on width in pixels.
			-- (from EV_POSITIONED)
		require -- from EV_POSITIONED
			not_destroyed: not is_destroyed
		ensure -- from EV_POSITIONED
			bridge_ok: Result = implementation.minimum_width
			positive_or_zero: Result >= 0

	width: INTEGER
			-- Horizontal size in pixels.
			-- Same as minimum_width when not displayed.
			-- (from EV_POSITIONED)
		require -- from EV_POSITIONED
			not_destroyed: not is_destroyed
		ensure -- from EV_POSITIONED
			bridge_ok: Result = implementation.width

	x_position: INTEGER
			-- Horizontal offset relative to parent x_position in pixels.
			-- (from EV_POSITIONED)
		require -- from EV_POSITIONED
			not_destroyed: not is_destroyed
		ensure -- from EV_POSITIONED
			bridge_ok: Result = implementation.x_position

	y_position: INTEGER
			-- Vertical offset relative to parent y_position in pixels.
			-- (from EV_POSITIONED)
		require -- from EV_POSITIONED
			not_destroyed: not is_destroyed
		ensure -- from EV_POSITIONED
			bridge_ok: Result = implementation.y_position
	
feature -- Status setting

	set_height (a_height: INTEGER)
			-- Assign a_height to height in pixels.
		require
			a_height_positive_or_zero: a_height >= 0
		ensure
			height_assigned: height = minimum_height or else height = a_height

	set_position (a_x, a_y: INTEGER)
			-- Assign a_x to x_position and a_y to y_position in pixels.
		ensure
			x_position_assigned: x_position = a_x
			y_position_assigned: y_position = a_y

	set_size (a_width, a_height: INTEGER)
			-- Assign a_width to width and a_height to height in pixels.
		require
			a_width_positive_or_zero: a_width >= 0
			a_height_positive_or_zero: a_height >= 0
		ensure
			width_assigned: width = minimum_width or else width = a_width
			height_assigned: height = minimum_height or else height = a_height

	set_width (a_width: INTEGER)
			-- Assign a_width to width in pixels.
		require
			a_width_positive_or_zero: a_width >= 0
		ensure
			width_assigned: width = minimum_width or else width = a_width

	set_x_position (a_x: INTEGER)
			-- Assign a_x to x_position in pixels.
		ensure
			x_position_assigned: x_position = a_x

	set_y_position (a_y: INTEGER)
			-- Assign a_y to y_position in pixels.
		ensure
			y_position_assigned: y_position = a_y
	
feature -- Element change

	set_data (some_data: like data)
			-- Assign some_data to data.
			-- (from EV_ANY)
		require -- from EV_ANY
			not_destroyed: not is_destroyed
		ensure -- from EV_ANY
			data_assigned: data = some_data
	
feature -- Duplication

	copy (other: like Current)
			-- Update current object using fields of object attached
			-- to other, so as to yield equal objects.
			-- (from EV_ANY)
		require -- from ANY
			other_not_void: other /= void
			type_identity: same_type (other)
		ensure -- from ANY
			is_equal: is_equal (other)
	
feature -- Command

	destroy
			-- Destroy underlying native toolkit object.
			-- Render Current unusable.
			-- (from EV_ANY)
		ensure -- from EV_ANY
			is_destroyed: is_destroyed
	
feature -- Status Report

	is_destroyed: BOOLEAN
			-- Is Current no longer usable?
			-- (from EV_ANY)
		ensure -- from EV_ANY
			bridge_ok: Result = implementation.is_destroyed
	
invariant

		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)
		-- from EV_POSITIONED
	width_not_negative: is_usable implies width >= 0
	height_not_negative: is_usable implies height >= 0
	minimum_width_not_negative: is_usable implies minimum_width >= 0
	minimum_height_not_negative: is_usable implies minimum_height >= 0
		-- from EV_ANY
	is_initialized: is_initialized
	is_coupled: implementation /= void and then implementation.interface = Current
	default_create_called: default_create_called

end -- class EV_POSITIONABLE