Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

em.widget.input

Class EM_JOYSTICK_FOCUS



Creation

Features

Invariants

indexing

description

Store and manage the joystick focus. The joystick focus has to be set manually
and thus to be cleared manually. Also it can be shared by multiple objects.

Use EM_SHARED_FOCUS to access the singleton instance.

date

$Date: 2005/10/23 11:21:01 $

revision

$Revision: 1.6 $

class

EM_JOYSTICK_FOCUS

create

make

-- Initialise default values.

feature -- Access

focus_list: DS_LINEAR [EM_JOYSTICK_SENSITIVE]

-- List of joystick foci

ensure
focus_list_not_void: Result /= Void

feature -- Status report

has_focus: BOOLEAN

-- Is any focus present?

feature -- Element change

add_focus (a_focus: EM_JOYSTICK_SENSITIVE)

-- Add a_focus to focus_list.

require
a_focus_not_void: a_focus /= Void
ensure
a_focus_added: focus_list_impl.has (a_focus)

feature -- Removal

clear_foci

-- Clear focus_list.

ensure
not has_focus
remove_focus (a_focus: EM_JOYSTICK_SENSITIVE)

-- Remove a_focus from focus_list.

require
a_focus_not_void: a_focus /= Void
ensure
a_focus_removed: not focus_list_impl.has (a_focus)

feature {EM_COMPONENT_SCENE} -- Basic operations

publish_axis_event (an_event: EM_JOYSTICK_AXIS_EVENT)

-- Publish an_event to all joystick foci.

require
an_event_not_void: an_event /= Void
publish_ball_event (an_event: EM_JOYSTICK_BALL_EVENT)

-- Publish an_event to all joystick foci.

require
an_event_not_void: an_event /= Void
publish_button_down_event (an_event: EM_JOYSTICK_BUTTON_EVENT)

-- Publish an_event to all joystick foci.

require
an_event_not_void: an_event /= Void
publish_button_up_event (an_event: EM_JOYSTICK_BUTTON_EVENT)

-- Publish an_event to all joystick foci.

require
an_event_not_void: an_event /= Void
publish_hat_event (an_event: EM_JOYSTICK_HAT_EVENT)

-- Publish an_event to all joystick foci.

require
an_event_not_void: an_event /= Void

invariant

focus_list_impl_not_void: focus_list_impl /= Void

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

end