indexing
	description: "Graphically representable objects."
	status: "See notice at end of class"
	keywords: "figure, graphic"
	date: "$Date$"
	revision: "$Revision$"

deferred class interface
	EV_FIGURE

feature -- Access

	group: EV_FIGURE_GROUP
			-- Parent of Current.

	frozen id_object (an_id: INTEGER): IDENTIFIED
			-- Object associated with an_id (void if no such object)
			-- (from IDENTIFIED)
		ensure -- from IDENTIFIED
			consistent: Result = void or else Result.object_id = an_id

	frozen object_id: INTEGER
			-- Unique for current object in any given session
			-- (from IDENTIFIED)
		ensure -- from IDENTIFIED
			valid_id: id_object (Result) = Current

	orientation: DOUBLE
			-- Angle of first point of Current.

	pebble: ANY
			-- Data to be transported by pick and drop mechanism.

	pebble_function: FUNCTION [ANY, TUPLE, ANY]
			-- Returns data to be transported by pick and drop mechanism.
			-- When not Void, pebble is ignored.

	point_array: ARRAY [EV_COORDINATE]
			-- points as absolute coordinates.
		ensure
			same_length: Result.count = points.count

	point_count: INTEGER
			-- Number of points needed to describe Current.

	pointer_style: EV_CURSOR
			-- Cursor displayed when pointer is over this figure.

	target_name: STRING
			-- Optional textual name describing Current pick and drop hole.
			-- (from EV_ABSTRACT_PICK_AND_DROPABLE)

	world: EV_FIGURE_WORLD
			-- Top-level parent of Current.
	
feature -- Status report

	has_capture: BOOLEAN
			-- Are all events sent to Current?

	is_sensitive: BOOLEAN
			-- Is object sensitive to user input?

	is_show_requested: BOOLEAN
			-- Will Current be displayed when its parent is?
	
feature -- Status setting

	disable_capture
			-- Disable grab of all events on world.
		require
			in_world: world /= void
		ensure
			capture_released: not has_capture

	disable_sensitive
			-- Make object non-sensitive to user input.
		ensure
			insensitive_requested: not internal_is_sensitive

	enable_capture
			-- Grab all mouse events for world.
		require
			in_world: world /= void
		ensure
			capture_set: has_capture

	enable_sensitive
			-- Make object sensitive to user input.
		ensure
			sensitive_requested: internal_is_sensitive

	hide
			-- Request that Current not be displayed even when its group is.
		ensure
			not_is_show_requested: not is_show_requested

	intersects (r: EV_RECTANGLE): BOOLEAN
			-- Does r intersect Currents bounding_box?

	set_target_name (a_name: STRING)
			-- Assign a_name to target_name.
			-- (from EV_ABSTRACT_PICK_AND_DROPABLE)
		require -- from EV_ABSTRACT_PICK_AND_DROPABLE
			a_name_not_void: a_name /= void
		ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
			target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

	show
			-- Request that Current be displayed when its group is.
			-- True by default.
		ensure
			is_show_requested: is_show_requested
	
feature -- Element change

	remove_pebble
			-- Make pebble Void and pebble_function `Void,
			-- Removing transport.
		ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
			pebble_removed: pebble = void and pebble_function = void

	set_accept_cursor (a_cursor: EV_CURSOR)
			-- Set a_cursor to be displayed when the screen pointer is over a
			-- target that accepts pebble during pick and drop.
		ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
			accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

	set_deny_cursor (a_cursor: EV_CURSOR)
			-- Set a_cursor to be displayed when the screen pointer is not
			-- over a valid target.
		ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
			deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

	set_origin (an_origin: EV_RELATIVE_POINT)
			-- Change origin of all points to o without moving.

	set_pebble (a_pebble: like pebble)
			-- Assign a_pebble to pebble.
		require -- from EV_ABSTRACT_PICK_AND_DROPABLE
			a_pebble_not_void: a_pebble /= void
		ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
			pebble_assigned: pebble = a_pebble

	set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
			-- Set a_function to compute pebble.
		require -- from EV_ABSTRACT_PICK_AND_DROPABLE
			a_function_not_void: a_function /= void
			a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
		ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
			pebble_function_assigned: pebble_function = a_function

	set_pointer_style (a_cursor: like pointer_style)
			-- Assign a_cursor to pointer_style.
		require
			a_cursor_not_void: a_cursor /= void
		ensure
			pointer_style_assigned: pointer_style = a_cursor
	
feature -- Action sequences

	conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
			-- Actions to be performed when a pebble that fits this hole is
			-- picked up from another source.
			-- (when drop_actions.accepts_pebble (pebble))

	drop_actions: EV_PND_ACTION_SEQUENCE
			-- Actions to take when pick and drop transport drops on Current.

	pick_actions: EV_PND_START_ACTION_SEQUENCE
			-- Actions to be performed when pebble is picked up.

	pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
			-- Actions to be performed when screen pointer button is pressed.

	pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
			-- Actions to be performed when screen pointer button is released.

	pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
			-- Actions to be performed when screen pointer is double clicked.

	pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
			-- Actions to be performed when screen pointer enters widget.

	pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
			-- Actions to be performed when screen pointer leaves widget.

	pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
			-- Actions to be performed when screen pointer moves.

	proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
			-- Actions to be performed when pointing device comes into range.

	proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
			-- Actions to be performed when pointing device goes out of range.
	
feature -- Events

	bounding_box: EV_RECTANGLE
			-- Smallest orthogonal rectangular area Current fits in.
		ensure
			not_void: Result /= void

	position_on_figure (x, y: INTEGER): BOOLEAN
			-- Is the point on (x, y) on this figure?
	
invariant

	points_not_void: points /= void
	points_correct_size: points.count = point_count
	points_items_not_void: all_points_exist (points)
		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)

end -- class EV_FIGURE