ANY EVENT_CATCHER LOOP_ITEM LOOP_STACK NONE VISION
class interface EVENT_CATCHER
   -- EVENT_CATCHER is the JOB that handle graphic interface
   -- relative events. The event_catcher wait for such events and
   -- emit signal relative to this event. Previously registred
   -- procedure (via vision.*_connect) are executed.
   --
   -- For more information about JOB, see lib/sequencer and
   -- tutorial/sequencer directories.

creation
   make (g_c: GRAPHIC_CONNECTION)

feature(s) from JOB
   priority: INTEGER
      -- Never change priority after job inserted in loop_item.
      -- Priority should only be set at creation time.

feature(s) from JOB
   prepare (ready: READY_DESCRIPTION)
      -- use ready to descibe condition that make this job ready
      -- to continue.
      require
         ready /= Void;
         not ready.queryable

   is_ready (ready: READY_DESCRIPTION): BOOLEAN
      -- check if this job is ready to continue his work
      require
         ready /= Void;
         ready.queryable

   continue
      -- Continue to do the job
      -- The work to do has to be small work and non blocking, it
      -- will continue on next call

   done: BOOLEAN
      -- done returns True when the job is finished. Then the
      -- job may be restart(ed) if it need to run again.

   restart
      -- Configure the job like the initial state.
      -- Example: when some window dialog appears second time, all
      -- jobs from this window are restarted.
      require
         done
      ensure
         not done

   infix "<" (other: JOB): BOOLEAN

feature(s) from COLOR_LIST
   white_color: COLOR

   black_color: COLOR

   dim_grey_color: COLOR

   dark_grey_color: COLOR

   grey_color: COLOR

   light_grey_color: COLOR

   dark_blue_color: COLOR

   medium_blue_color: COLOR

   blue_color: COLOR

   royal_blue_color: COLOR

   deep_sky_blue_color: COLOR

   sky_blue_color: COLOR

   light_sky_blue_color: COLOR

   steel_blue_color: COLOR

   light_steel_blue_color: COLOR

   light_blue_color: COLOR

   pale_turquoise_color: COLOR

   dark_turquoise_color: COLOR

   medium_turquoise_color: COLOR

   turquoise_color: COLOR

   dark_cyan_color: COLOR

   cyan_color: COLOR

   light_cyan_color: COLOR

   dark_green_color: COLOR

   green_color: COLOR

   light_green_color: COLOR

   yellow_green_color: COLOR

   dark_khaki_color: COLOR

   khaki_color: COLOR

   yellow_color: COLOR

   light_yellow_color: COLOR

   gold_color: COLOR

   beige_color: COLOR

   chocolate_color: COLOR

   firebrick_color: COLOR

   brown_color: COLOR

   dark_salmon_color: COLOR

   salmon_color: COLOR

   light_salmon_color: COLOR

   dark_orange_color: COLOR

   orange_color: COLOR

   orange_red_color: COLOR

   dark_red_color: COLOR

   red_color: COLOR

   hot_pink_color: COLOR

   deep_pink_color: COLOR

   pink_color: COLOR

   light_pink_color: COLOR

   pale_violet_red_color: COLOR

   maroon_color: COLOR

   medium_violet_red_color: COLOR

   violet_red_color: COLOR

   violet_color: COLOR

   dark_magenta_color: COLOR

   magenta_color: COLOR

   dark_violet_color: COLOR

   blue_violet_color: COLOR

   medium_purple_color: COLOR

   purple_color: COLOR

feature(s) from STATE_CONSTANTS
   state_normal: INTEGER

   state_active: INTEGER

   state_prelight: INTEGER

   state_selected: INTEGER

   state_insensitive: INTEGER

feature(s) from ALIGNMENT_CONSTANTS
   center_alignment: ALIGNMENT

   left_alignment: ALIGNMENT

   right_alignment: ALIGNMENT

   top_alignment: ALIGNMENT

   down_alignment: ALIGNMENT

   top_left_alignment: ALIGNMENT

   top_right_alignment: ALIGNMENT

   down_right_alignment: ALIGNMENT

   down_left_alignment: ALIGNMENT

feature(s) from GRAPHIC
   vision: VISION

   font_manager: FONT_MANAGER

   default_font: BASIC_FONT

feature(s) from EVENT_CATCHER
   make (g_c: GRAPHIC_CONNECTION)

feature(s) from EVENT_CATCHER
   emit_event (s: SENSITIVE; next_event: INTEGER)
      -- Emit signal relative to event next_event for widget s.

feature(s) from EVENT_CATCHER
   current_event_type: INTEGER

   stop

   preprocess_left_down (p: PROCEDURE[ANY,TUPLE])

feature(s) from EVENT_CATCHER
   break

feature(s) from EVENT_CATCHER
   widget: HASHED_DICTIONARY[SENSITIVE, POINTER]

feature(s) from EVENT_CATCHER
   event: FAST_ARRAY[DICTIONARY[SIGNAL_0, SENSITIVE]]

   pointer_move_event: HASHED_DICTIONARY[SIGNAL_2[INTEGER, INTEGER], SENSITIVE]

   geometry_change_event: HASHED_DICTIONARY[SIGNAL_4[INTEGER, INTEGER, INTEGER, INTEGER], SENSITIVE]

feature(s) from EVENT_CATCHER
   preprocess_left_down_proc: PROCEDURE[ANY,TUPLE]

   graphic_connection: GRAPHIC_CONNECTION

   suspend: BOOLEAN

   event_catcher_found: EVENT_CATCHER

   search_widget (c_widget: POINTER): SENSITIVE
      -- Widget c_widget doesn't exist in current loop. This
      -- function searches in the loop_stack to find the
      -- event_catcher that manages this widget. If found, the widget
      -- is retruned and event_catcher_found is set to the relative
      -- event_catcher.
      ensure
         Result /= Void implies event_catcher_found.widget.has(c_widget);
         Result /= Void implies event_catcher_found.widget.at(c_widget) = Result

   basic_vision_next_event: INTEGER

   basic_vision_flush

   basic_vision_event_widget: POINTER

   basic_vision_pointer_x: INTEGER

   basic_vision_pointer_y: INTEGER

   basic_vision_geometry_x: INTEGER

   basic_vision_geometry_y: INTEGER

   basic_vision_geometry_width: INTEGER

   basic_vision_geometry_height: INTEGER


invariant

    priority /= Minimum_integer;

end of EVENT_CATCHER