2 define(`HTMLNAME',`terminal_interface-curses-mouse_s.html')dnl
4 ------------------------------------------------------------------------------
6 -- GNAT ncurses Binding --
8 -- Terminal_Interface.Curses.Mouse --
14 -- The ncurses Ada95 binding is copyrighted 1996 by --
15 -- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de --
17 -- Permission is hereby granted to reproduce and distribute this --
18 -- binding by any means and for any fee, whether alone or as part --
19 -- of a larger distribution, in source or in binary form, PROVIDED --
20 -- this notice is included with any such distribution, and is not --
21 -- removed from any of its header files. Mention of ncurses and the --
22 -- author of this binding in any applications linked with it is --
23 -- highly appreciated. --
25 -- This binding comes AS IS with no warranty, implied or expressed. --
26 ------------------------------------------------------------------------------
29 ------------------------------------------------------------------------------
30 include(`Mouse_Base_Defs')
33 package Terminal_Interface.Curses.Mouse is
35 -- MANPAGE(`curs_mouse.3x')
36 -- Please note, that in ncurses-1.9.9e documentation mouse support
37 -- is still marked as experimental. So also this binding will change
38 -- if the ncurses methods change.
40 type Event_Mask is private;
41 No_Events : constant Event_Mask;
42 All_Events : constant Event_Mask;
44 type Mouse_Button is (Left, -- aka: Button 1
45 Middle, -- aka: Button 2
46 Right, -- aka: Button 3
47 Button4, -- aka: Button 4
48 Control, -- Control Key
52 type Button_State is (Released,
58 type Mouse_Event is private;
60 -- MANPAGE(`curs_mouse.3x')
62 procedure Register_Reportable_Event
65 Mask : in out Event_Mask);
66 -- Stores the event described by the button and the state in the mask.
67 -- Before you call this the first time, you should init the mask
68 -- with the Empty_Mask constant
70 -- ANCHOR(`mousemask()',`Start_Mouse')
71 function Start_Mouse (Mask : Event_Mask := All_Events)
76 pragma Import (C, End_Mouse, "_nc_ada_unregister_mouse");
77 -- Terminates the mouse
79 -- ANCHOR(`getmouse()',`Get_Mouse')
80 function Get_Mouse return Mouse_Event;
83 procedure Get_Event (Event : in Mouse_Event;
84 Y : out Line_Position;
85 X : out Column_Position;
86 Button : out Mouse_Button;
87 State : out Button_State);
88 -- !!! Warning: X and Y are screen coordinates. Due to ripped of lines they
89 -- may not be identical to window coordinates.
91 -- ANCHOR(`ungetmouse()',`Unget_Mouse')
92 procedure Unget_Mouse (Event : in Mouse_Event);
95 -- ANCHOR(`wenclose()',`Enclosed_In_Window')
96 function Enclosed_In_Window (Win : Window := Standard_Window;
97 Event : Mouse_Event) return Boolean;
99 -- But : use event instead of screen coordinates.
101 -- ANCHOR(`mouseinterval()',`Mouse_Interval')
102 function Mouse_Interval (Msec : Natural := 200) return Natural;
106 type Event_Mask is new Interfaces.C.int;
107 No_Events : constant Event_Mask := 0;
108 All_Events : constant Event_Mask := -1;
112 Id : Integer range Integer (Interfaces.C.short'First) ..
113 Integer (Interfaces.C.Short'Last);
114 X, Y, Z : Integer range Integer (Interfaces.C.int'First) ..
115 Integer (Interfaces.C.int'Last);
118 pragma Convention (C, Mouse_Event);
119 pragma Pack (Mouse_Event);
121 include(`Mouse_Event_Rep')
122 Generation_Bit_Order : constant System.Bit_Order := System.M4_BIT_ORDER;
123 -- This constant may be different on your system.
125 end Terminal_Interface.Curses.Mouse;