X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=doc%2Fhtml%2Fada%2Fterminal_interface-curses-mouse__ads.htm;fp=doc%2Fhtml%2Fada%2Fterminal_interface-curses-mouse__ads.htm;h=c7b563b017a1816c6b251420805b9bb2519b11b6;hp=4a8043b10567409b49f4f01968f4ab3aa20cf7b0;hb=47d2fb4537d9ad5bb14f4810561a327930ca4280;hpb=c55d387cebf1cee4757ca2c2ef4fbeae59ee4175 diff --git a/doc/html/ada/terminal_interface-curses-mouse__ads.htm b/doc/html/ada/terminal_interface-curses-mouse__ads.htm index 4a8043b1..c7b563b0 100644 --- a/doc/html/ada/terminal_interface-curses-mouse__ads.htm +++ b/doc/html/ada/terminal_interface-curses-mouse__ads.htm @@ -24,7 +24,8 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2014,2015 Free Software Foundation, Inc. -- +-- Copyright 2020 Thomas E. Dickey -- +-- Copyright 1998-2014,2015 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -52,14 +53,14 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- @Revision: 1.32 @ --- @Date: 2015/05/30 23:19:19 @ +-- @Revision: 1.33 @ +-- @Date: 2020/02/02 23:34:34 @ -- Binding Version 01.00 ------------------------------------------------------------------------------ with System; -package Terminal_Interface.Curses.Mouse is - pragma Preelaborate (Terminal_Interface.Curses.Mouse); +package Terminal_Interface.Curses.Mouse is + pragma Preelaborate (Terminal_Interface.Curses.Mouse); -- |===================================================================== -- | Man page curs_mouse.3x @@ -70,56 +71,56 @@ -- Not implemented: -- REPORT_MOUSE_POSITION (i.e. as a parameter to Register_Reportable_Event -- or Start_Mouse) - type Event_Mask is private; - No_Events : constant Event_Mask; - All_Events : constant Event_Mask; - - type Mouse_Button is (Left, -- aka: Button 1 - Middle, -- aka: Button 2 - Right, -- aka: Button 3 - Button4, -- aka: Button 4 - Control, -- Control Key - Shift, -- Shift Key - Alt); -- ALT Key - - subtype Real_Buttons is Mouse_Button range Left .. Button4; - subtype Modifier_Keys is Mouse_Button range Control .. Alt; - - type Button_State is (Released, - Pressed, - Clicked, - Double_Clicked, - Triple_Clicked); - - type Button_States is array (Button_State) of Boolean; + type Event_Mask is private; + No_Events : constant Event_Mask; + All_Events : constant Event_Mask; + + type Mouse_Button is (Left, -- aka: Button 1 + Middle, -- aka: Button 2 + Right, -- aka: Button 3 + Button4, -- aka: Button 4 + Control, -- Control Key + Shift, -- Shift Key + Alt); -- ALT Key + + subtype Real_Buttons is Mouse_Button range Left .. Button4; + subtype Modifier_Keys is Mouse_Button range Control .. Alt; + + type Button_State is (Released, + Pressed, + Clicked, + Double_Clicked, + Triple_Clicked); + + type Button_States is array (Button_State) of Boolean; pragma Pack (Button_States); - All_Clicks : constant Button_States := (Clicked .. Triple_Clicked => True, + All_Clicks : constant Button_States := (Clicked .. Triple_Clicked => True, others => False); - All_States : constant Button_States := (others => True); + All_States : constant Button_States := (others => True); - type Mouse_Event is private; + type Mouse_Event is private; -- |===================================================================== -- | Man page curs_mouse.3x -- |===================================================================== - function Has_Mouse return Boolean; + function Has_Mouse return Boolean; -- Return true if a mouse device is supported, false otherwise. - procedure Register_Reportable_Event - (Button : Mouse_Button; - State : Button_State; - Mask : in out Event_Mask); + procedure Register_Reportable_Event + (Button : Mouse_Button; + State : Button_State; + Mask : in out Event_Mask); -- Stores the event described by the button and the state in the mask. -- Before you call this the first time, you should initialize the mask -- with the Empty_Mask constant - pragma Inline (Register_Reportable_Event); + pragma Inline (Register_Reportable_Event); - procedure Register_Reportable_Events - (Button : Mouse_Button; - State : Button_States; - Mask : in out Event_Mask); + procedure Register_Reportable_Events + (Button : Mouse_Button; + State : Button_States; + Mask : in out Event_Mask); -- Register all events described by the Button and the State bitmap. -- Before you call this the first time, you should initialize the mask -- with the Empty_Mask constant @@ -129,94 +130,94 @@ -- old mask, that means the event mask value before this call. -- Not Implemented: The library version -- returns a Mouse_Mask that tells which events are reported. - function Start_Mouse (Mask : Event_Mask := All_Events) - return Event_Mask; + function Start_Mouse (Mask : Event_Mask := All_Events) + return Event_Mask; -- AKA: mousemask() - pragma Inline (Start_Mouse); + pragma Inline (Start_Mouse); - procedure End_Mouse (Mask : Event_Mask := No_Events); + procedure End_Mouse (Mask : Event_Mask := No_Events); -- Terminates the mouse, restores the specified event mask - pragma Inline (End_Mouse); + pragma Inline (End_Mouse); -- | - function Get_Mouse return Mouse_Event; + function Get_Mouse return Mouse_Event; -- AKA: getmouse() - pragma Inline (Get_Mouse); + pragma Inline (Get_Mouse); - procedure Get_Event (Event : Mouse_Event; - Y : out Line_Position; - X : out Column_Position; - Button : out Mouse_Button; - State : out Button_State); + procedure Get_Event (Event : Mouse_Event; + Y : out Line_Position; + X : out Column_Position; + Button : out Mouse_Button; + State : out Button_State); -- !!! Warning: X and Y are screen coordinates. Due to ripped of lines they -- may not be identical to window coordinates. -- Not Implemented: Get_Event only reports one event, the C library -- version supports multiple events, e.g. {click-1, click-3} - pragma Inline (Get_Event); + pragma Inline (Get_Event); -- | - procedure Unget_Mouse (Event : Mouse_Event); + procedure Unget_Mouse (Event : Mouse_Event); -- AKA: ungetmouse() - pragma Inline (Unget_Mouse); + pragma Inline (Unget_Mouse); -- | - function Enclosed_In_Window (Win : Window := Standard_Window; - Event : Mouse_Event) return Boolean; + function Enclosed_In_Window (Win : Window := Standard_Window; + Event : Mouse_Event) return Boolean; -- AKA: wenclose() -- But : use event instead of screen coordinates. - pragma Inline (Enclosed_In_Window); + pragma Inline (Enclosed_In_Window); -- | - function Mouse_Interval (Msec : Natural := 200) return Natural; + function Mouse_Interval (Msec : Natural := 200) return Natural; -- AKA: mouseinterval() - pragma Inline (Mouse_Interval); + pragma Inline (Mouse_Interval); private -- This can be as little as 32 bits (unsigned), or as long as the system's -- unsigned long. Declare it as the minimum size to handle all valid -- sizes. - type Event_Mask is mod 4294967296; + type Event_Mask is mod 4294967296; - type Mouse_Event is + type Mouse_Event is record - Id : Integer range Integer (Interfaces.C.short'First) .. + Id : Integer range Integer (Interfaces.C.short'First) .. Integer (Interfaces.C.short'Last); - X, Y, Z : Integer range Integer (Interfaces.C.int'First) .. + X, Y, Z : Integer range Integer (Interfaces.C.int'First) .. Integer (Interfaces.C.int'Last); - Bstate : Event_Mask; + Bstate : Event_Mask; end record; - pragma Convention (C, Mouse_Event); + pragma Convention (C, Mouse_Event); - for Mouse_Event use + for Mouse_Event use record - Id at 0 range Curses_Constants.MEVENT_id_First + Id at 0 range Curses_Constants.MEVENT_id_First .. Curses_Constants.MEVENT_id_Last; - X at 0 range Curses_Constants.MEVENT_x_First + X at 0 range Curses_Constants.MEVENT_x_First .. Curses_Constants.MEVENT_x_Last; - Y at 0 range Curses_Constants.MEVENT_y_First + Y at 0 range Curses_Constants.MEVENT_y_First .. Curses_Constants.MEVENT_y_Last; - Z at 0 range Curses_Constants.MEVENT_z_First + Z at 0 range Curses_Constants.MEVENT_z_First .. Curses_Constants.MEVENT_z_Last; - Bstate at 0 range Curses_Constants.MEVENT_bstate_First + Bstate at 0 range Curses_Constants.MEVENT_bstate_First .. Curses_Constants.MEVENT_bstate_Last; end record; - for Mouse_Event'Size use Curses_Constants.MEVENT_Size; + for Mouse_Event'Size use Curses_Constants.MEVENT_Size; Generation_Bit_Order : System.Bit_Order renames Curses_Constants.Bit_Order; - BUTTON_CTRL : constant Event_Mask := Curses_Constants.BUTTON_CTRL; - BUTTON_SHIFT : constant Event_Mask := Curses_Constants.BUTTON_SHIFT; - BUTTON_ALT : constant Event_Mask := Curses_Constants.BUTTON_ALT; - BUTTON1_EVENTS : constant Event_Mask + BUTTON_CTRL : constant Event_Mask := Curses_Constants.BUTTON_CTRL; + BUTTON_SHIFT : constant Event_Mask := Curses_Constants.BUTTON_SHIFT; + BUTTON_ALT : constant Event_Mask := Curses_Constants.BUTTON_ALT; + BUTTON1_EVENTS : constant Event_Mask := Curses_Constants.all_events_button_1; - BUTTON2_EVENTS : constant Event_Mask + BUTTON2_EVENTS : constant Event_Mask := Curses_Constants.all_events_button_2; - BUTTON3_EVENTS : constant Event_Mask + BUTTON3_EVENTS : constant Event_Mask := Curses_Constants.all_events_button_3; - BUTTON4_EVENTS : constant Event_Mask + BUTTON4_EVENTS : constant Event_Mask := Curses_Constants.all_events_button_4; - ALL_MOUSE_EVENTS : constant Event_Mask := Curses_Constants.ALL_MOUSE_EVENTS; - No_Events : constant Event_Mask := 0; - All_Events : constant Event_Mask := ALL_MOUSE_EVENTS; + ALL_MOUSE_EVENTS : constant Event_Mask := Curses_Constants.ALL_MOUSE_EVENTS; + No_Events : constant Event_Mask := 0; + All_Events : constant Event_Mask := ALL_MOUSE_EVENTS; -end Terminal_Interface.Curses.Mouse; +end Terminal_Interface.Curses.Mouse;