    indexing
    	description: "texts in a font displayed on point."
    	legal: "See notice at end of class."
    	status: "See notice at end of class."
    	keywords: "figure, text, string"
    	date: "$Date: 2006-03-22 23:29:03 -0800 (Wed, 22 Mar 2006) $"
    	revision: "$Revision: 57641 $"

    class interface
    	EV_FIGURE_TEXT

    create
    	default_create
    			-- Create in (0, 0)
    		require -- from  ANY
    			True

    	make_with_text (a_text: STRING_GENERAL)
    			-- Create with `a_text'.
    		require
    			a_text_not_void: a_text /= Void

    feature -- Access

    	dashed_line_style: BOOLEAN
    			-- Are lines drawn dashed?
    			-- (from EV_ATOMIC_FIGURE)

    	font: EV_FONT
    			-- Typeface text is displayed in.

    	foreground_color: EV_COLOR
    			-- Color of text, lines, etc.
    			-- (from EV_ATOMIC_FIGURE)

    	generating_type: STRING_8
    			-- Name of current object's generating type
    			-- (type of which it is a direct instance)
    			-- (from ANY)

    	generator: STRING_8
    			-- Name of current object's generating class
    			-- (base class of the type of which it is a direct instance)
    			-- (from ANY)

    	group: EV_FIGURE_GROUP
    			-- Parent of `Current'.
    			-- (from EV_FIGURE)

    	frozen id_object (an_id: INTEGER_32): 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

    	line_width: INTEGER_32
    			-- Thickness of lines.
    			-- (from EV_ATOMIC_FIGURE)

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

    	orientation: REAL_64
    			-- Angle of first point of `Current'.
    			-- (from EV_FIGURE)

    	pebble: ANY
    			-- Data to be transported by pick and drop mechanism.
    			-- (from EV_FIGURE)

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

    	point: EV_RELATIVE_POINT
    			-- First point of `Current'.
    			-- (from EV_SINGLE_POINTED_FIGURE)

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

    	point_count: INTEGER_32
    			-- `Current' has one point.
    			-- (from EV_SINGLE_POINTED_FIGURE)
    		require -- from  EV_FIGURE
    			True

    	pointer_style: EV_POINTER_STYLE
    			-- Cursor displayed when pointer is over this figure.
    			-- (from EV_FIGURE)

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

    	text: STRING_GENERAL
    			-- Text that is displayed.

    	world: EV_FIGURE_WORLD
    			-- Top-level parent of `Current'.
    			-- (from EV_FIGURE)

    feature -- Comparison

    	frozen deep_equal (some: ANY; other: like arg #1): BOOLEAN
    			-- Are `some' and `other' either both void
    			-- or attached to isomorphic object structures?
    			-- (from ANY)
    		ensure -- from ANY
    			shallow_implies_deep: standard_equal (some, other) implies Result
    			both_or_none_void: (some = Void) implies (Result = (other = Void))
    			same_type: (Result and (some /= Void)) implies some.same_type (other)
    			symmetric: Result implies deep_equal (other, some)

    	frozen equal (some: ANY; other: like arg #1): BOOLEAN
    			-- Are `some' and `other' either both void or attached
    			-- to objects considered equal?
    			-- (from ANY)
    		ensure -- from ANY
    			definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.is_equal (other))

    	is_equal (other: like Current): BOOLEAN
    			-- Is `other' attached to an object considered
    			-- equal to current object?
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    		ensure -- from ANY
    			symmetric: Result implies other.is_equal (Current)
    			consistent: standard_is_equal (other) implies Result

    	frozen standard_equal (some: ANY; other: like arg #1): BOOLEAN
    			-- Are `some' and `other' either both void or attached to
    			-- field-by-field identical objects of the same type?
    			-- Always uses default object comparison criterion.
    			-- (from ANY)
    		ensure -- from ANY
    			definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.standard_is_equal (other))

    	frozen standard_is_equal (other: like Current): BOOLEAN
    			-- Is `other' attached to an object of the same type
    			-- as current object, and field-by-field identical to it?
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    		ensure -- from ANY
    			same_type: Result implies same_type (other)
    			symmetric: Result implies other.standard_is_equal (Current)

    feature -- Status report

    	accept_cursor: EV_POINTER_STYLE
    			-- Accept cursor set by user.
    			-- To be displayed when the screen pointer is over a target that accepts
    			-- pebble during pick and drop.
    			-- (from EV_FIGURE)

    	conforms_to (other: ANY): BOOLEAN
    			-- Does type of current object conform to type
    			-- of `other' (as per Eiffel: The Language, chapter 13)?
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void

    	deny_cursor: EV_POINTER_STYLE
    			-- Deny cursor set by user.
    			-- To be displayed when the screen pointer is not over a valid target.
    			-- (from EV_FIGURE)

    	has_capture: BOOLEAN
    			-- Are all events sent to `Current'?
    			-- (from EV_FIGURE)

    	height: INTEGER_32
    			-- Vertical dimension.

    	is_default_font_used: BOOLEAN
    			-- Is `Current' using a default font?

    	is_sensitive: BOOLEAN
    			-- Is object sensitive to user input?
    			-- (from EV_FIGURE)

    	is_show_requested: BOOLEAN
    			-- Will `Current' be displayed when its parent is?
    			-- (from EV_FIGURE)

    	same_type (other: ANY): BOOLEAN
    			-- Is type of current object identical to type of `other'?
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    		ensure -- from ANY
    			definition: Result = (conforms_to (other) and other.conforms_to (Current))

    	width: INTEGER_32
    			-- Horizontal dimension.

    feature -- Status setting

    	disable_capture
    			-- Disable grab of all events on world.
    			-- (from EV_FIGURE)
    		require -- from EV_FIGURE
    			in_world: world /= Void
    		ensure -- from EV_FIGURE
    			capture_released: not has_capture

    	disable_dashed_line_style
    			-- Draw lines solid.
    			-- (from EV_ATOMIC_FIGURE)
    		ensure -- from EV_ATOMIC_FIGURE
    			dashed_line_style_disabled: not dashed_line_style

    	disable_sensitive
    			-- Make object non-sensitive to user input.
    			-- (from EV_FIGURE)
    		ensure -- from EV_FIGURE
    			insensitive_requested: not internal_is_sensitive

    	enable_capture
    			-- Grab all mouse events for world.
    			-- (from EV_FIGURE)
    		require -- from EV_FIGURE
    			in_world: world /= Void
    		ensure -- from EV_FIGURE
    			capture_set: has_capture

    	enable_dashed_line_style
    			-- Draw lines dashed.
    			-- (from EV_ATOMIC_FIGURE)
    		ensure -- from EV_ATOMIC_FIGURE
    			dashed_line_style_enabled: dashed_line_style

    	enable_sensitive
    			-- Make object sensitive to user input.
    			-- (from EV_FIGURE)
    		ensure -- from EV_FIGURE
    			sensitive_requested: internal_is_sensitive

    	hide
    			-- Request that `Current' not be displayed even when its group is.
    			-- (from EV_FIGURE)
    		ensure -- from EV_FIGURE
    			not_is_show_requested: not is_show_requested

    	intersects (r: EV_RECTANGLE): BOOLEAN
    			-- Does `r' intersect `Current's bounding_box?
    			-- (from EV_FIGURE)

    	set_font (a_font: EV_FONT)
    			-- Assign `a_font' to font.
    		require
    			a_font_not_void: a_font /= Void
    		ensure
    			font_assigned: font = a_font

    	set_foreground_color (a_color: EV_COLOR)
    			-- Assign `a_color' to foreground_color.
    			-- (from EV_ATOMIC_FIGURE)
    		require -- from EV_ATOMIC_FIGURE
    			a_color_not_void: a_color /= Void
    		ensure -- from EV_ATOMIC_FIGURE
    			foreground_color_assigned: foreground_color = a_color

    	set_line_width (a_width: INTEGER_32)
    			-- Assign `a_width' to line_width.
    			-- (from EV_ATOMIC_FIGURE)
    		require -- from EV_ATOMIC_FIGURE
    			a_width_non_negative: a_width >= 0
    		ensure -- from EV_ATOMIC_FIGURE
    			line_width_assigned: line_width = a_width

    	set_point (a_point: EV_RELATIVE_POINT)
    			-- Assign `a_point' to point.
    			-- (from EV_SINGLE_POINTED_FIGURE)
    		require -- from EV_SINGLE_POINTED_FIGURE
    			a_point_not_void: a_point /= Void
    		ensure -- from EV_SINGLE_POINTED_FIGURE
    			point_assigned: point = a_point

    	set_target_name (a_name: STRING_GENERAL)
    			-- 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)

    	set_text (a_text: STRING_GENERAL)
    			-- Assign `a_text' to text.
    		require
    			a_text_not_void: a_text /= Void
    		ensure
    			text_assigned: text = a_text

    	show
    			-- Request that `Current' be displayed when its group is.
    			-- `True' by default.
    			-- (from EV_FIGURE)
    		ensure -- from EV_FIGURE
    			is_show_requested: is_show_requested

    feature -- Element change

    	remove_pebble
    			-- Make pebble `Void' and pebble_function `Void,
    			-- Removing transport.
    			-- (from EV_FIGURE)
    		ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
    			pebble_removed: pebble = Void and pebble_function = Void

    	set_accept_cursor (a_cursor: EV_POINTER_STYLE)
    			-- Set `a_cursor' to be displayed when the screen pointer is over a
    			-- target that accepts pebble during pick and drop.
    			-- (from EV_FIGURE)
    		require -- from EV_ABSTRACT_PICK_AND_DROPABLE
    			a_cursor_not_void: a_cursor /= Void
    		ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
    			accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    	set_deny_cursor (a_cursor: EV_POINTER_STYLE)
    			-- Set `a_cursor' to be displayed when the screen pointer is not
    			-- over a valid target.
    			-- (from EV_FIGURE)
    		require -- from EV_ABSTRACT_PICK_AND_DROPABLE
    			a_cursor_not_void: a_cursor /= Void
    		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.
    			-- (from EV_FIGURE)

    	set_pebble (a_pebble: like pebble)
    			-- Assign `a_pebble' to pebble.
    			-- (from EV_FIGURE)
    		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.
    			-- (from EV_FIGURE)
    		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.
    			-- (from EV_FIGURE)
    		require -- from EV_FIGURE
    			a_cursor_not_void: a_cursor /= Void
    		ensure -- from EV_FIGURE
    			pointer_style_assigned: pointer_style = a_cursor

    feature -- Duplication

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

    	frozen deep_copy (other: like Current)
    			-- Effect equivalent to that of:
    			--		copy (`other' . deep_twin)
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    		ensure -- from ANY
    			deep_equal: deep_equal (Current, other)

    	frozen deep_twin: like Current
    			-- New object structure recursively duplicated from Current.
    			-- (from ANY)
    		ensure -- from ANY
    			deep_equal: deep_equal (Current, Result)

    	frozen standard_copy (other: like Current)
    			-- Copy every field of `other' onto corresponding field
    			-- of current object.
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    			type_identity: same_type (other)
    		ensure -- from ANY
    			is_standard_equal: standard_is_equal (other)

    	frozen standard_twin: like Current
    			-- New object field-by-field identical to `other'.
    			-- Always uses default copying semantics.
    			-- (from ANY)
    		ensure -- from ANY
    			standard_twin_not_void: Result /= Void
    			equal: standard_equal (Result, Current)

    	frozen twin: like Current
    			-- New object equal to `Current'
    			-- twin calls copy; to change copying/twining semantics, redefine copy.
    			-- (from ANY)
    		ensure -- from ANY
    			twin_not_void: Result /= Void
    			is_equal: Result.is_equal (Current)

    feature -- Basic operations

    	frozen default: like Current
    			-- Default value of object's type
    			-- (from ANY)

    	frozen default_pointer: POINTER
    			-- Default value of type `POINTER'
    			-- (Avoid the need to write `p'.default for
    			-- some `p' of type `POINTER'.)
    			-- (from ANY)

    	default_rescue
    			-- Process exception for routines with no Rescue clause.
    			-- (Default: do nothing.)
    			-- (from ANY)

    	frozen do_nothing
    			-- Execute a null action.
    			-- (from ANY)

    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))
    			-- (from EV_FIGURE)

    	drop_actions: EV_PND_ACTION_SEQUENCE
    			-- Actions to take when pick and drop transport drops on `Current'.
    			-- (from EV_FIGURE)

    	pick_actions: EV_PND_START_ACTION_SEQUENCE
    			-- Actions to be performed when pebble is picked up.
    			-- (from EV_FIGURE)

    	pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    			-- Actions to be performed when screen pointer button is pressed.
    			-- (from EV_FIGURE)

    	pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    			-- Actions to be performed when screen pointer button is released.
    			-- (from EV_FIGURE)

    	pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    			-- Actions to be performed when screen pointer is double clicked.
    			-- (from EV_FIGURE)

    	pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    			-- Actions to be performed when screen pointer enters widget.
    			-- (from EV_FIGURE)

    	pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    			-- Actions to be performed when screen pointer leaves widget.
    			-- (from EV_FIGURE)

    	pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    			-- Actions to be performed when screen pointer moves.
    			-- (from EV_FIGURE)

    feature {ANY} -- Contract support

    	valid_family (a_family: INTEGER_32): BOOLEAN
    			-- Is `a_family' a valid family value.
    			-- (from EV_FONT_CONSTANTS)

    	valid_shape (a_shape: INTEGER_32): BOOLEAN
    			-- Is `a_shape' a valid shape value.
    			-- (from EV_FONT_CONSTANTS)

    	valid_weight (a_weight: INTEGER_32): BOOLEAN
    			-- Is `a_weight' a valid weight value.
    			-- (from EV_FONT_CONSTANTS)

    feature -- Events

    	position_on_figure (x, y: INTEGER_32): BOOLEAN
    			-- Is (`x', `y') on this figure?

    feature -- Output

    	io: STD_FILES
    			-- Handle to standard file setup
    			-- (from ANY)

    	out: STRING_8
    			-- New string containing terse printable representation
    			-- of current object
    			-- Was declared in ANY as synonym of tagged_out.
    			-- (from ANY)

    	print (some: ANY)
    			-- Write terse external representation of `some'
    			-- on standard output.
    			-- (from ANY)

    	frozen tagged_out: STRING_8
    			-- New string containing terse printable representation
    			-- of current object
    			-- Was declared in ANY as synonym of out.
    			-- (from ANY)

    feature -- Platform

    	operating_environment: OPERATING_ENVIRONMENT
    			-- Objects available from the operating system
    			-- (from ANY)

    invariant
    	text_exists: text /= Void
    	font_exists: font /= Void

    		-- from EV_ATOMIC_FIGURE
    	foreground_color_exists: foreground_color /= Void
    	line_width_non_negative: line_width >= 0

    		-- from EV_FIGURE
    	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)

    indexing
    	copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
    	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
    	source: "[
    		Eiffel Software
    		356 Storke Road, Goleta, CA 93117 USA
    		Telephone 805-685-1006, Fax 805-685-6869
    		Website http://www.eiffel.com
    		Customer support http://support.eiffel.com
    	]"

    end -- class EV_FIGURE_TEXT