X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=Ada95%2Fgen%2Fterminal_interface-curses-mouse.ads.m4;h=84eeacb2962c886e9eebf1357326bf4480ced7cd;hp=21f88e44e9f976614a23d57488250d3cf90a6caa;hb=46722468f47c2b77b3987729b4bcf2321cccfd01;hpb=661078ddbde3ce0f3b06e95642fbb9b5fef7dca1 diff --git a/Ada95/gen/terminal_interface-curses-mouse.ads.m4 b/Ada95/gen/terminal_interface-curses-mouse.ads.m4 index 21f88e44..84eeacb2 100644 --- a/Ada95/gen/terminal_interface-curses-mouse.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-mouse.ads.m4 @@ -1,5 +1,5 @@ -- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-mouse_s.html')dnl +define(`HTMLNAME',`terminal_interface-curses-mouse__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- @@ -36,22 +36,29 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.12 $ --- Binding Version 00.93 +-- $Revision: 1.21 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ include(`Mouse_Base_Defs') with System; package Terminal_Interface.Curses.Mouse is - pragma Preelaborate (Mouse); + pragma Preelaborate (Terminal_Interface.Curses.Mouse); -- MANPAGE(`curs_mouse.3x') -- Please note, that in ncurses-1.9.9e documentation mouse support -- is still marked as experimental. So also this binding will change -- if the ncurses methods change. -- + -- mouse_trafo, wmouse_trafo are implemented as Transform_Coordinates + -- in the parent package. + -- + -- 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; @@ -64,12 +71,22 @@ package Terminal_Interface.Curses.Mouse is 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, + others => False); + All_States : constant Button_States := (others => True); + type Mouse_Event is private; -- MANPAGE(`curs_mouse.3x') @@ -78,22 +95,34 @@ package Terminal_Interface.Curses.Mouse is -- Return true if a mouse device is supported, false otherwise. procedure Register_Reportable_Event - (B : in Mouse_Button; - S : in Button_State; - Mask : in out Event_Mask); + (Button : in Mouse_Button; + State : in 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 init the mask -- with the Empty_Mask constant pragma Inline (Register_Reportable_Event); + procedure Register_Reportable_Events + (Button : in Mouse_Button; + State : in 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 init the mask + -- with the Empty_Mask constant + -- ANCHOR(`mousemask()',`Start_Mouse') + -- There is one difference to mousmask(): we return the value of the + -- 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; -- AKA pragma Inline (Start_Mouse); - procedure End_Mouse; - -- Terminates the mouse + procedure End_Mouse (Mask : in Event_Mask := No_Events); + -- Terminates the mouse, restores the specified event mask pragma Inline (End_Mouse); -- ANCHOR(`getmouse()',`Get_Mouse') @@ -108,6 +137,8 @@ package Terminal_Interface.Curses.Mouse is 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); -- ANCHOR(`ungetmouse()',`Unget_Mouse') @@ -128,14 +159,12 @@ package Terminal_Interface.Curses.Mouse is pragma Inline (Mouse_Interval); private - type Event_Mask is new Interfaces.C.int; - No_Events : constant Event_Mask := 0; - All_Events : constant Event_Mask := -1; + type Event_Mask is new Interfaces.C.unsigned_long; type Mouse_Event is record Id : Integer range Integer (Interfaces.C.short'First) .. - Integer (Interfaces.C.Short'Last); + Integer (Interfaces.C.short'Last); X, Y, Z : Integer range Integer (Interfaces.C.int'First) .. Integer (Interfaces.C.int'Last); Bstate : Event_Mask; @@ -147,4 +176,9 @@ include(`Mouse_Event_Rep') Generation_Bit_Order : constant System.Bit_Order := System.M4_BIT_ORDER; -- This constant may be different on your system. +include(`Mouse_Events') + + No_Events : constant Event_Mask := 0; + All_Events : constant Event_Mask := ALL_MOUSE_EVENTS; + end Terminal_Interface.Curses.Mouse;