Index

Package: Events

Description

package Allegro.Events is
Allegro 5.0.9 - Event system and events

Types

Allegro_Event_Type

subtype Allegro_Event_Type is Unsigned_32;

Allegro_Any_Event

type Allegro_Any_Event is
        record
            typ    : Allegro_Event_Type;
            source : A_Allegro_Event_Source;
        end record;

Allegro_Display_Event

type Allegro_Display_Event is
        record
            typ         : Allegro_Event_Type;
            source      : A_Allegro_Display;
            timestamp   : double;
            x, y        : Integer;
            width,
            height      : Integer;
            orientation : Allegro_Display_Orientation;
        end record;

Allegro_Joystick_Event

type Allegro_Joystick_Event is
        record
            typ       : Allegro_Event_Type;
            source    : A_Allegro_Joystick;
            timestamp : double;
            id        : A_Allegro_Joystick;
            stick     : Integer;
            axis      : Integer;
            pos       : Float;
            button    : Integer;
        end record;

Allegro_Keyboard_Event

type Allegro_Keyboard_Event is
        record
            typ       : Allegro_Event_Type;
            source    : A_Allegro_Keyboard;
            timestamp : double;
            display   : A_Allegro_Display;
            keycode   : Integer;
            unichar   : Integer;
            modifiers : Unsigned_32;
            repeat    : Bool;
        end record;

Allegro_Mouse_Event

type Allegro_Mouse_Event is
        record
            typ            : Allegro_Event_Type;
            source         : A_Allegro_Mouse;
            timestamp      : double;
            display        : A_Allegro_Display;
            x, y, z, w     : Integer;
            dx, dy, dz, dw : Integer;
            button         : Unsigned_32;
            pressure       : Float;
        end record;

Allegro_Timer_Event

type Allegro_Timer_Event is
        record
            typ       : Allegro_Event_Type;
            source    : A_Allegro_Timer;
            timestamp : double;
            count     : Unsigned_64;
            error     : double;
        end record;

Allegro_User_Event

type Allegro_User_Event is
        record
            typ            : Allegro_Event_Type;
            source         : A_Allegro_Event_Source;
            timestamp      : double;
            internal_descr : Address;
            data1          : Address;
            data2          : Address;
            data3          : Address;
            data4          : Address;
        end record;

A_Allegro_User_Event

type A_Allegro_User_Event is access all Allegro_User_Event;

Allegro_Event

type Allegro_Event(t : Allegro_Event_Type := 0) is
        record
            case t is
                when 0 =>
                    any      : Allegro_Any_Event;
                when 1..4 =>
                    joystick : Allegro_Joystick_Event;
                when 10..12 =>
                    keyboard : Allegro_Keyboard_Event;
                when 20..25 =>
                    mouse    : Allegro_Mouse_Event;
                when 30 =>
                    timer    : Allegro_Timer_Event;
                when 40..47 =>
                    display  : Allegro_Display_Event;
                when others =>
                    user     : Allegro_User_Event;
            end case;
        end record;

Allegro_Event_Queue

type Allegro_Event_Queue is limited private;

A_Allegro_Event_Queue

type A_Allegro_Event_Queue is access all Allegro_Event_Queue;

A_User_Event_Destructor

type A_User_Event_Destructor is access
        procedure( event : A_Allegro_User_Event );

Constants & Global variables

ALLEGRO_EVENT_JOYSTICK_AXIS (Allegro_Event_Type)

ALLEGRO_EVENT_JOYSTICK_AXIS          : constant Allegro_Event_Type := 1;

ALLEGRO_EVENT_JOYSTICK_BUTTON_DOWN (Allegro_Event_Type)

ALLEGRO_EVENT_JOYSTICK_BUTTON_DOWN   : constant Allegro_Event_Type := 2;

ALLEGRO_EVENT_JOYSTICK_BUTTON_UP (Allegro_Event_Type)

ALLEGRO_EVENT_JOYSTICK_BUTTON_UP     : constant Allegro_Event_Type := 3;

ALLEGRO_EVENT_JOYSTICK_CONFIGURATION (Allegro_Event_Type)

ALLEGRO_EVENT_JOYSTICK_CONFIGURATION : constant Allegro_Event_Type := 4;

ALLEGRO_EVENT_KEY_DOWN (Allegro_Event_Type)

ALLEGRO_EVENT_KEY_DOWN               : constant Allegro_Event_Type := 10;

ALLEGRO_EVENT_KEY_CHAR (Allegro_Event_Type)

ALLEGRO_EVENT_KEY_CHAR               : constant Allegro_Event_Type := 11;

ALLEGRO_EVENT_KEY_UP (Allegro_Event_Type)

ALLEGRO_EVENT_KEY_UP                 : constant Allegro_Event_Type := 12;

ALLEGRO_EVENT_MOUSE_AXES (Allegro_Event_Type)

ALLEGRO_EVENT_MOUSE_AXES             : constant Allegro_Event_Type := 20;

ALLEGRO_EVENT_MOUSE_BUTTON_DOWN (Allegro_Event_Type)

ALLEGRO_EVENT_MOUSE_BUTTON_DOWN      : constant Allegro_Event_Type := 21;

ALLEGRO_EVENT_MOUSE_BUTTON_UP (Allegro_Event_Type)

ALLEGRO_EVENT_MOUSE_BUTTON_UP        : constant Allegro_Event_Type := 22;

ALLEGRO_EVENT_MOUSE_ENTER_DISPLAY (Allegro_Event_Type)

ALLEGRO_EVENT_MOUSE_ENTER_DISPLAY    : constant Allegro_Event_Type := 23;

ALLEGRO_EVENT_MOUSE_LEAVE_DISPLAY (Allegro_Event_Type)

ALLEGRO_EVENT_MOUSE_LEAVE_DISPLAY    : constant Allegro_Event_Type := 24;

ALLEGRO_EVENT_MOUSE_WARPED (Allegro_Event_Type)

ALLEGRO_EVENT_MOUSE_WARPED           : constant Allegro_Event_Type := 25;

ALLEGRO_EVENT_TIMER (Allegro_Event_Type)

ALLEGRO_EVENT_TIMER                  : constant Allegro_Event_Type := 30;

ALLEGRO_EVENT_DISPLAY_EXPOSE (Allegro_Event_Type)

ALLEGRO_EVENT_DISPLAY_EXPOSE         : constant Allegro_Event_Type := 40;

ALLEGRO_EVENT_DISPLAY_RESIZE (Allegro_Event_Type)

ALLEGRO_EVENT_DISPLAY_RESIZE         : constant Allegro_Event_Type := 41;

ALLEGRO_EVENT_DISPLAY_CLOSE (Allegro_Event_Type)

ALLEGRO_EVENT_DISPLAY_CLOSE          : constant Allegro_Event_Type := 42;

ALLEGRO_EVENT_DISPLAY_LOST (Allegro_Event_Type)

ALLEGRO_EVENT_DISPLAY_LOST           : constant Allegro_Event_Type := 43;

ALLEGRO_EVENT_DISPLAY_FOUND (Allegro_Event_Type)

ALLEGRO_EVENT_DISPLAY_FOUND          : constant Allegro_Event_Type := 44;

ALLEGRO_EVENT_DISPLAY_SWITCH_IN (Allegro_Event_Type)

ALLEGRO_EVENT_DISPLAY_SWITCH_IN      : constant Allegro_Event_Type := 45;

ALLEGRO_EVENT_DISPLAY_SWITCH_OUT (Allegro_Event_Type)

ALLEGRO_EVENT_DISPLAY_SWITCH_OUT     : constant Allegro_Event_Type := 46;

ALLEGRO_EVENT_DISPLAY_ORIENTATION (Allegro_Event_Type)

ALLEGRO_EVENT_DISPLAY_ORIENTATION    : constant Allegro_Event_Type := 47;

Subprograms & Entries

Allegro_Event_Type_Is_User

function Allegro_Event_Type_Is_User
( t: Allegro_Event_Type ) return Boolean;
1 <= t < 512 - builtin events 512 <= t < 1024 - reserved user events (for addons) 1024 <= t - unreserved user events

Allegro_Get_Event_Type

function Allegro_Get_Event_Type
( a, b, c, d: Character ) return AL_ID renames Allegro_Ids.To_AL_ID;

Al_Create_Event_Queue

function Al_Create_Event_Queue return A_Allegro_Event_Queue;

Al_Destroy_Event_Queue

procedure Al_Destroy_Event_Queue
( queue: in out A_Allegro_Event_Queue );

Al_Register_Event_Source

procedure Al_Register_Event_Source
( queue: A_Allegro_Event_Queue;
source: A_Allegro_Event_Source );

Al_Unregister_Event_Source

procedure Al_Unregister_Event_Source
( queue: A_Allegro_Event_Queue;
source: A_Allegro_Event_Source );

Al_Is_Event_Queue_Empty

function Al_Is_Event_Queue_Empty
( queue: A_Allegro_Event_Queue ) return Boolean;

Al_Get_Next_Event

function Al_Get_Next_Event
( queue: A_Allegro_Event_Queue;
ret_event: access Allegro_Event ) return Boolean;

Al_Peek_Next_Event

function Al_Peek_Next_Event
( queue: A_Allegro_Event_Queue;
ret_event: access Allegro_Event ) return Boolean;

Al_Drop_Next_Event

function Al_Drop_Next_Event
( queue: A_Allegro_Event_Queue ) return Boolean;

Al_Flush_Event_Queue

procedure Al_Flush_Event_Queue
( queue: A_Allegro_Event_Queue );

Al_Wait_For_Event

procedure Al_Wait_For_Event
( queue: A_Allegro_Event_Queue;
ret_event: in out Allegro_Event );

Al_Wait_For_Event_Timed

function Al_Wait_For_Event_Timed
( queue: A_Allegro_Event_Queue;
ret_event: access Allegro_Event;
secs: Float ) return Boolean;

Al_Wait_For_Event_Until

function Al_Wait_For_Event_Until
( queue: A_Allegro_Event_Queue;
ret_event: access Allegro_Event;
timeout: Allegro_Timeout ) return Boolean;

Al_Init_User_Event_Source

procedure Al_Init_User_Event_Source
( src: A_Allegro_Event_Source );

Al_Destroy_User_Event_Source

procedure Al_Destroy_User_Event_Source
( source: A_Allegro_Event_Source );

Al_Emit_User_Event

function Al_Emit_User_Event
( src: A_Allegro_Event_Source;
event: Allegro_Event;
destructor: A_User_Event_Destructor ) return Boolean;

Al_Emit_User_Event

procedure Al_Emit_User_Event
( src: A_Allegro_Event_Source;
event: Allegro_Event;
destructor: A_User_Event_Destructor );
Calls Al_Emit_User_Event, ignoring any errors.

Al_Unref_User_Event

procedure Al_Unref_User_Event
( event: A_Allegro_User_Event );

Al_Set_Event_Source_Data

procedure Al_Set_Event_Source_Data
( source: A_Allegro_Event_Source;
data: Address );

Al_Get_Event_Source_Data

function Al_Get_Event_Source_Data
( source: A_Allegro_Event_Source ) return Address;