class VISION

Features exported to WINDOW

VISION object is singleton, accessible via vision from GRAPHIC This object is responsible of "graphic mode" initialisation and graphic events management. This class give access to the events' loop (see also start) and to the display size.

Direct parents

non-conformant parents

ANY

Summary

creation features

exported features

All *_connect functions, used only in WHEN_* classes.

All *_signal functions, used only in WHEN_* classes.

Details

graphic_init

Initialize graphic using default values.

display_width: INTEGER
display_height: INTEGER
loop_stack: LOOP_STACK

The loop_stack gives possibility to add some JOB, break current events loop...

start

Start to run current events loop. This call returns only when you break this loop.

new_loop

You need new loop if you want modal window. When you create this new loop, existing windows will be insensitive and jobs will be suspended. Then you create your new window and all it's widgets and finally call start. The state is "restored" when you break this loop. NOTE: loops may be reused (restared) when you need to reuse the same modal window.

default_draw_kit: DRAW_KIT
font_manager: FONT_MANAGER
last_character: INTEGER

return unicode character. NOTE: only access this information if last event is key event.

require

  • current_event_type.in_range(2, 3)

pointer_x: INTEGER

retrun pointer x coordinate relative to the window who received the event. NOTE: only access this information if last event is button or wheel event.

require

  • current_event_type.in_range(40, 59)

pointer_y: INTEGER

retrun pointer y coordinate relative to the window who received the event. NOTE: only access this information if last event is button or wheel event.

require

  • current_event_type.in_range(40, 59)

pointer_x_root: INTEGER

retrun pointer x coordinate relative to the screen. NOTE: only access this information if last event is mouse event (button/wheel/move).

require

  • current_event_type = 100 or else current_event_type.in_range(40, 59)

pointer_y_root: INTEGER

retrun pointer y coordinate relative to the screen. NOTE: only access this information if last event is mouse event (button/wheel/move).

require

  • current_event_type = 100 or else current_event_type.in_range(40, 59)

event_time: INTEGER

return the date the event occured. Origin is undefined, unit is millisecond. Difference give delay. NOTE: only access this information if last event is button or wheel event.

require

  • current_event_type.in_range(40, 59)

expose_area: RECT

return the rectangular area the expose event is relative to. Coordinates are relative to the window who received the event. NOTE: only access this information if last event is expose_event.

require

  • current_event_type = 12

border_width: INTEGER

TODO: suppress ?

require

  • current_event_type = 101

is_left_down: BOOLEAN

Is mouse left button down ? NOTE: only access this information if last event is pointer_enter or pointer_leave.

require

  • current_event_type = 7 or else current_event_type = 8

is_middle_down: BOOLEAN

Is mouse middle button down ? NOTE: only access this information if last event is pointer_enter or pointer_leave.

require

  • current_event_type = 7 or else current_event_type = 8

is_right_down: BOOLEAN

Is mouse right button down ? NOTE: only access this information if last event is pointer_enter or pointer_leave.

require

  • current_event_type = 7 or else current_event_type = 8

current_event_type: INTEGER

Needed for some assertion. This is the number associated with the last event.

when_focus_in (p: PROCEDURE [O_ -> TUPLE][TUPLE])
when_focus_in_signal: SIGNAL_0
when_focus_out (p: PROCEDURE [O_ -> TUPLE][TUPLE])
when_focus_out_signal: SIGNAL_0
preprocess_left_down (p: PROCEDURE [O_ -> TUPLE][TUPLE])
root_window: ROOT_WINDOW
register (s: SENSITIVE)

Each widget who need to receive events has to be registred. NOTE: Register only once. Only widows need this, so don't care because precursor register your window for you when it is created.

require

    ensure

      unregister (s: SENSITIVE)

      TODO: how to manage destroy ?

      require

        ensure

          key_down_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE])
          key_up_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE])
          pointer_enter_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE])
          pointer_leave_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE])
          expose_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE])
          unmapped_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE])
          mapped_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE])
          left_down_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE])
          left_up_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE])
          middle_down_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE])
          middle_up_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE])
          right_down_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE])
          right_up_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE])
          wheel_up_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE])
          wheel_down_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE])
          fully_visible_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE])
          partially_visible_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE])
          not_visible_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE])
          close_requested_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE])
          pointer_move_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE 2 [A_, B_][INTEGERINTEGER]])
          geometry_change_event_connect (s: SENSITIVE, p: PROCEDURE [O_ -> TUPLE][TUPLE 4 [A_, B_, C_, D_][INTEGERINTEGERINTEGERINTEGER]])
          key_down_signal (s: SENSITIVE): SIGNAL_0
          key_up_signal (s: SENSITIVE): SIGNAL_0
          pointer_enter_signal (s: SENSITIVE): SIGNAL_0
          pointer_leave_signal (s: SENSITIVE): SIGNAL_0
          expose_signal (s: SENSITIVE): SIGNAL_0
          unmapped_signal (s: SENSITIVE): SIGNAL_0
          mapped_signal (s: SENSITIVE): SIGNAL_0
          left_down_signal (s: SENSITIVE): SIGNAL_0
          left_up_signal (s: SENSITIVE): SIGNAL_0
          middle_down_signal (s: SENSITIVE): SIGNAL_0
          middle_up_signal (s: SENSITIVE): SIGNAL_0
          right_down_signal (s: SENSITIVE): SIGNAL_0
          right_up_signal (s: SENSITIVE): SIGNAL_0
          wheel_up_signal (s: SENSITIVE): SIGNAL_0
          wheel_down_signal (s: SENSITIVE): SIGNAL_0
          fully_visible_signal (s: SENSITIVE): SIGNAL_0
          partially_visible_signal (s: SENSITIVE): SIGNAL_0
          not_visible_signal (s: SENSITIVE): SIGNAL_0
          close_requested_signal (s: SENSITIVE): SIGNAL_0
          pointer_move_signal (s: SENSITIVE): SIGNAL_2 [E, F][INTEGERINTEGER]
          geometry_change_signal (s: SENSITIVE): SIGNAL_4 [E, F, G, H][INTEGERINTEGERINTEGERINTEGER]