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.

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


invariant

    priority /= Minimum_integer;

end of EVENT_CATCHER