ANY NONE WIDGET
class interface ROOT_WINDOW

feature(s) from STATE
   state: INTEGER
      -- use values from STATE_CONSTANTS

   is_state_normal: BOOLEAN

   is_state_active: BOOLEAN

   is_state_prelight: BOOLEAN

   is_state_selected: BOOLEAN

   is_state_insensitive: BOOLEAN

feature(s) from WIDGET
   parent: CONTAINER

   pos_x: INTEGER

   pos_y: INTEGER

   x_shrink_allowed: BOOLEAN

   x_expand_allowed: BOOLEAN

   y_shrink_allowed: BOOLEAN

   y_expand_allowed: BOOLEAN

   min_width: INTEGER

   min_height: INTEGER

   std_width: INTEGER

   std_height: INTEGER

   width: INTEGER

   height: INTEGER

   valid_width (w: INTEGER): BOOLEAN

   valid_height (h: INTEGER): BOOLEAN

   area: RECT

   root_area: RECT

   set_x_shrink (b: BOOLEAN)

   set_x_expand (b: BOOLEAN)

   set_y_shrink (b: BOOLEAN)

   set_y_expand (b: BOOLEAN)

   set_shrink (b: BOOLEAN)
      -- change both x and y shrink state

   set_expand (b: BOOLEAN)
      -- change both x and y expand state

feature(s) from DRAWABLE
   clear_without_expose
      -- clear the all the drawable area.
      -- WARNING: don't redraw the content (no expose event)

feature(s) from CONTAINER
   layout: LAYOUT

   child: FAST_ARRAY[WIDGET]
      -- feature ANY for require validity

   layout_update_paused: BOOLEAN
      --TODO: suppress. Handle this with mapped

   set_layout (l: LAYOUT)
      -- Change the layout for the container (layout choose children
      -- position and size). The layout has to be free (not used
      -- by another container).
      require
         l /= Void;
         l.container = Void
      ensure
         layout = l;
         layout.container = Current;
         not layout_update_paused implies layout_ready

   layout_pause
      --TODO: remove when mapped ready
      require
         not layout_update_paused
      ensure
         layout_update_paused

   layout_continue
      --TODO: remove when mapped ready
      require
         layout_update_paused
      ensure
         layout_ready;
         not layout_update_paused

   child_detach (w: WIDGET)
      -- Remove widget w from this container.
      require
         w /= Void;
         has_child(w)
      ensure
         child.count = old child.count - 1;
         not has_child(w);
         w.parent = Void;
         not layout_update_paused implies layout_ready

   has_child (w: WIDGET): BOOLEAN

   last_child: WIDGET
      require
         not is_empty

   is_empty: BOOLEAN

   clear_area (x, y, w, h: INTEGER)
      -- clear area and emit expose event (contents will be drawn)
      -- x and y are relative to current object
      require
         w > 0;
         h > 0;
         area.include(x,y);
         area.include(x + w - 1,y + h - 1)

   refresh
      -- clear and update entire object (sub_window(s) are not updated).

   clear
      -- clear and update entire object (sub_window(s) are not updated).

   as_x_root (x: INTEGER): INTEGER
      --TODO: add basic conversion to speed up
      require
         x >= 0;
         x < width
      require else
         x >= 0;
         x < width
      require else
         x >= pos_x;
         x < pos_x + width

   as_y_root (y: INTEGER): INTEGER
      --TODO: add basic conversion to speed up
      require
         y >= 0;
         y < height
      require else
         y >= 0;
         y < height
      require else
         y >= pos_y;
         y < pos_y + height

feature(s) from CONTAINER
   done: BOOLEAN
      --TODO: suppress. Handle this with mapped

   child_requisition_changed
      require
         layout /= Void
      ensure
         not layout_update_paused implies layout_ready or not done

feature(s) from WHEN_LEFT_DOWN
   when_left_down (p: PROCEDURE[ANY,TUPLE])

   when_left_down_signal: SIGNAL_0

feature(s) from WHEN_LEFT_UP
   when_left_up (p: PROCEDURE[ANY,TUPLE])

   when_left_up_signal: SIGNAL_0

feature(s) from WHEN_MIDDLE_DOWN
   when_middle_down (p: PROCEDURE[ANY,TUPLE])

   when_middle_down_signal: SIGNAL_0

feature(s) from WHEN_MIDDLE_UP
   when_middle_up (p: PROCEDURE[ANY,TUPLE])

   when_middle_up_signal: SIGNAL_0

feature(s) from WHEN_RIGHT_DOWN
   when_right_down (p: PROCEDURE[ANY,TUPLE])

   when_right_down_signal: SIGNAL_0

feature(s) from WHEN_RIGHT_UP
   when_right_up (p: PROCEDURE[ANY,TUPLE])

   when_right_up_signal: SIGNAL_0

feature(s) from WHEN_WHEEL_UP
   when_wheel_up (p: PROCEDURE[ANY,TUPLE])

   when_wheel_up_signal: SIGNAL_0

feature(s) from WHEN_WHEEL_DOWN
   when_wheel_down (p: PROCEDURE[ANY,TUPLE])

   when_wheel_down_signal: SIGNAL_0

feature(s) from WHEN_POINTER_MOVE
   when_pointer_move (p: PROCEDURE[ANY,TUPLE[INTEGER, INTEGER]])

   when_pointer_move_signal: SIGNAL_2[INTEGER, INTEGER]

feature(s) from WHEN_POINTER_ENTER
   when_pointer_enter (p: PROCEDURE[ANY,TUPLE])

   when_pointer_enter_signal: SIGNAL_0

feature(s) from WHEN_POINTER_LEAVE
   when_pointer_leave (p: PROCEDURE[ANY,TUPLE])

   when_pointer_leave_signal: SIGNAL_0

feature(s) from WHEN_KEY_DOWN
   when_key_down (p: PROCEDURE[ANY,TUPLE])

   when_key_down_signal: SIGNAL_0

feature(s) from WHEN_MAPPED
   when_mapped (p: PROCEDURE[ANY,TUPLE])

   when_mapped_signal: SIGNAL_0

feature(s) from WHEN_UNMAPPED
   when_unmapped (p: PROCEDURE[ANY,TUPLE])

   when_unmapped_signal: SIGNAL_0

feature(s) from WHEN_GEOMETRY_CHANGE
   when_geometry_change (p: PROCEDURE[ANY,TUPLE[INTEGER, INTEGER, INTEGER, INTEGER]])

   when_geometry_change_signal: SIGNAL_4[INTEGER, INTEGER, INTEGER, INTEGER]

feature(s) from HASHABLE
   hash_code: INTEGER
      -- The hash-code value of Current.
      ensure
         good_hash_value: Result >= 0

feature(s) from WHEN_EXPOSE
   when_expose (p: PROCEDURE[ANY,TUPLE])

   when_expose_signal: SIGNAL_0

feature(s) from WINDOW
   set_background_color (c: COLOR)
      -- The color is copied, next changes to c won't change the background.
      -- Call clear_area (or refresh) to update the background from
      -- application, not needed from renderer
      require
         c /= Void

   set_background_pixmap (p: PIXMAP)
      -- Call this function again if you modify the pixmap (copy may
      -- have been done)
      require
         p /= Void

   map

   unmap

   mapped: BOOLEAN
      -- Warning: this information is asynchronous

   expose_event


invariant

    width >= 1;

    height >= 1;

    child /= Void;

    width >= min_width or computing_size;

    height >= min_height or computing_size;

    std_width > 0;

    std_height > 0;

    (not x_shrink_allowed implies width >= std_width) or computing_size;

    (not x_expand_allowed implies width <= std_width) or computing_size;

    (not y_shrink_allowed implies height >= std_height) or computing_size;

    (not y_expand_allowed implies height <= std_height) or computing_size;

end of ROOT_WINDOW