class WORLD

Features exported to WIDGET

Direct parents

conformant parents

GL_WIDGET

non-conformant parents

SMART_GL

Summary

creation features

exported features

Details

make_with_size (p: CONTAINER, w: INTEGER, h: INTEGER)
make (p: CONTAINER)
make_layout (p: CONTAINER, lo: LAYOUT)

require

  • p /= Void
  • lo /= Void
  • lo.container = Void

ensure

  • parent = p
  • layout = lo

sub_window_create (x: INTEGER, y: INTEGER, w: INTEGER, h: INTEGER, parent_window: WINDOW)

require

  • x.in_range(0, parent_window.width - 1)
  • y.in_range(0, parent_window.height - 1)
  • w.in_range(1, parent_window.width - x)
  • h.in_range(1, parent_window.height - y)

default_create

Default creation method. It is used when no creation method is specified if allowed. Note it may be renamed.

make_with_size (p: CONTAINER, w: INTEGER, h: INTEGER)
init_gl
redraw_gl
resize_gl (w: INTEGER, h: INTEGER)
add_opaque_object (object: GL_OBJECT)
add_translucent_object (object: GL_OBJECT)
camera: CAMERA
set_camera (cam: CAMERA)

require

  • cam /= Void

ensure

  • camera = cam

add_light (light: LIGHT)
fog: FOG
set_fog (f: FOG, atmospheric: BOOLEAN)

require

  • f /= Void

ensure

  • fog = f

make (p: CONTAINER)
select_myself_gl
display_gl
quit_gl

require

    post_redisplay
    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
    clear_without_expose

    clear the all the drawable area. WARNING: don't redraw the content (no expose event)

    area: RECT
    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
    • 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
    • y >= pos_y
    • y < pos_y + height

    layout: LAYOUT
    width: INTEGER
    height: INTEGER
    min_width: INTEGER
    min_height: INTEGER
    std_width: INTEGER
    std_height: INTEGER
    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

    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

    • not layout_update_paused

    child_attach (w: WIDGET)

    Add widget w in this container.

    require

    • layout /= Void
    • w /= Void
    • w.parent = Void
    • not has_child(w)

    ensure

    • w.parent = Current
    • has_child(w)
    • last_child = w

    child_dettach (w: WIDGET)
    This feature is obsolete: Use `child_detach' instead.
    child_detach (w: WIDGET)

    Remove widget w from this container.

    require

    • w /= Void
    • has_child(w)

    ensure

    • not has_child(w)
    • w.parent = Void

    has_child (w: WIDGET): BOOLEAN
    last_child: WIDGET

    require

    • not is_empty

    is_empty: BOOLEAN
    clear_area (x: INTEGER, y: INTEGER, w: INTEGER, 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)

    done: BOOLEAN

    TODO: suppress. Handle this with mapped

    child_requisition_changed

    require

    • layout /= Void

    ensure

      parent: CONTAINER
      pos_x: INTEGER
      pos_y: INTEGER
      x_shrink_allowed: BOOLEAN
      x_expand_allowed: BOOLEAN
      y_shrink_allowed: BOOLEAN
      y_expand_allowed: BOOLEAN
      valid_width (w: INTEGER): BOOLEAN
      valid_height (h: INTEGER): BOOLEAN
      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

      state: INTEGER

      use values from STATE_CONSTANTS

      frozen is_state_normal: BOOLEAN
      frozen is_state_active: BOOLEAN
      frozen is_state_prelight: BOOLEAN
      frozen is_state_selected: BOOLEAN
      frozen is_state_insensitive: BOOLEAN
      deferred hash_code: INTEGER

      The hash-code value of Current.

      ensure

      • good_hash_value: Result >= 0

      deferred is_equal (other: WORLD): BOOLEAN

      Is other attached to an object considered equal to current object ?

      require

      • other /= Void

      ensure

      • Result implies hash_code = other.hash_code
      • commutative: generating_type = other.generating_type implies Result = other.is_equal(Current)

      when_left_down (p: PROCEDURE [O_ -> TUPLE][TUPLE])
      when_left_down_signal: SIGNAL_0
      when_left_up (p: PROCEDURE [O_ -> TUPLE][TUPLE])
      when_left_up_signal: SIGNAL_0
      when_middle_down (p: PROCEDURE [O_ -> TUPLE][TUPLE])
      when_middle_down_signal: SIGNAL_0
      when_middle_up (p: PROCEDURE [O_ -> TUPLE][TUPLE])
      when_middle_up_signal: SIGNAL_0
      when_right_down (p: PROCEDURE [O_ -> TUPLE][TUPLE])
      when_right_down_signal: SIGNAL_0
      when_right_up (p: PROCEDURE [O_ -> TUPLE][TUPLE])
      when_right_up_signal: SIGNAL_0
      when_wheel_up (p: PROCEDURE [O_ -> TUPLE][TUPLE])
      when_wheel_up_signal: SIGNAL_0
      when_wheel_down (p: PROCEDURE [O_ -> TUPLE][TUPLE])
      when_wheel_down_signal: SIGNAL_0
      when_pointer_move (p: PROCEDURE [O_ -> TUPLE][TUPLE 2 [A_, B_][INTEGERINTEGER]])
      when_pointer_move_signal: SIGNAL_2 [E, F][INTEGERINTEGER]
      when_pointer_enter (p: PROCEDURE [O_ -> TUPLE][TUPLE])
      when_pointer_enter_signal: SIGNAL_0
      when_pointer_leave (p: PROCEDURE [O_ -> TUPLE][TUPLE])
      when_pointer_leave_signal: SIGNAL_0
      when_key_down (p: PROCEDURE [O_ -> TUPLE][TUPLE])
      when_key_down_signal: SIGNAL_0
      when_mapped (p: PROCEDURE [O_ -> TUPLE][TUPLE])
      when_mapped_signal: SIGNAL_0
      when_unmapped (p: PROCEDURE [O_ -> TUPLE][TUPLE])
      when_unmapped_signal: SIGNAL_0
      when_geometry_change (p: PROCEDURE [O_ -> TUPLE][TUPLE 4 [A_, B_, C_, D_][INTEGERINTEGERINTEGERINTEGER]])
      when_geometry_change_signal: SIGNAL_4 [E, F, G, H][INTEGERINTEGERINTEGERINTEGER]
      when_expose (p: PROCEDURE [O_ -> TUPLE][TUPLE])
      when_expose_signal: SIGNAL_0
      set_clear_color (red: REAL, green: REAL, blue: REAL, alpha: REAL)
      set_clear_depth (depth: REAL)
      translate (x: REAL, y: REAL, z: REAL)
      rotate (angle: REAL, axis_x: REAL, axis_y: REAL, axis_z: REAL)
      scale (x: REAL, y: REAL, z: REAL)
      begin_rendering
      end_rendering
      begin_points

      require

        ensure

          begin_lines

          require

            ensure

              begin_line_strip

              require

                ensure

                  begin_line_loop

                  require

                    ensure

                      begin_triangles

                      require

                        ensure

                          begin_triangle_strip

                          require

                            ensure

                              begin_triangle_fan

                              require

                                ensure

                                  begin_quads

                                  require

                                    ensure

                                      begin_quad_strip

                                      require

                                        ensure

                                          begin_polygon

                                          require

                                            ensure

                                              end_primitive

                                              require

                                                ensure

                                                  vertex (x: REAL, y: REAL, z: REAL)
                                                  full_red: GL_COLOR
                                                  full_green: GL_COLOR
                                                  full_blue: GL_COLOR
                                                  full_yellow: GL_COLOR
                                                  full_magenta: GL_COLOR
                                                  full_cyan: GL_COLOR
                                                  full_white: GL_COLOR
                                                  full_black: GL_COLOR
                                                  gl: GL
                                                  glu: GLU

                                                  Class invariant