2 define(`HTMLNAME',`terminal_interface-curses-mouse_s.html')dnl
4 ------------------------------------------------------------------------------
6 -- GNAT ncurses Binding --
8 -- Terminal_Interface.Curses.Mouse --
12 ------------------------------------------------------------------------------
13 -- Copyright (c) 1998 Free Software Foundation, Inc. --
15 -- Permission is hereby granted, free of charge, to any person obtaining a --
16 -- copy of this software and associated documentation files (the --
17 -- "Software"), to deal in the Software without restriction, including --
18 -- without limitation the rights to use, copy, modify, merge, publish, --
19 -- distribute, distribute with modifications, sublicense, and/or sell --
20 -- copies of the Software, and to permit persons to whom the Software is --
21 -- furnished to do so, subject to the following conditions: --
23 -- The above copyright notice and this permission notice shall be included --
24 -- in all copies or substantial portions of the Software. --
26 -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
27 -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
28 -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
29 -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
30 -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
31 -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
32 -- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
34 -- Except as contained in this notice, the name(s) of the above copyright --
35 -- holders shall not be used in advertising or otherwise to promote the --
36 -- sale, use or other dealings in this Software without prior written --
38 ------------------------------------------------------------------------------
39 -- Author: Juergen Pfeifer <Juergen.Pfeifer@T-Online.de> 1996
42 -- Binding Version 00.93
43 ------------------------------------------------------------------------------
44 include(`Mouse_Base_Defs')
47 package Terminal_Interface.Curses.Mouse is
48 pragma Preelaborate (Mouse);
50 -- MANPAGE(`curs_mouse.3x')
51 -- Please note, that in ncurses-1.9.9e documentation mouse support
52 -- is still marked as experimental. So also this binding will change
53 -- if the ncurses methods change.
55 type Event_Mask is private;
56 No_Events : constant Event_Mask;
57 All_Events : constant Event_Mask;
59 type Mouse_Button is (Left, -- aka: Button 1
60 Middle, -- aka: Button 2
61 Right, -- aka: Button 3
62 Button4, -- aka: Button 4
63 Control, -- Control Key
67 type Button_State is (Released,
73 type Mouse_Event is private;
75 -- MANPAGE(`curs_mouse.3x')
77 function Has_Mouse return Boolean;
78 -- Return true if a mouse device is supported, false otherwise.
80 procedure Register_Reportable_Event
83 Mask : in out Event_Mask);
84 -- Stores the event described by the button and the state in the mask.
85 -- Before you call this the first time, you should init the mask
86 -- with the Empty_Mask constant
87 pragma Inline (Register_Reportable_Event);
89 -- ANCHOR(`mousemask()',`Start_Mouse')
90 function Start_Mouse (Mask : Event_Mask := All_Events)
93 pragma Inline (Start_Mouse);
96 -- Terminates the mouse
97 pragma Inline (End_Mouse);
99 -- ANCHOR(`getmouse()',`Get_Mouse')
100 function Get_Mouse return Mouse_Event;
102 pragma Inline (Get_Mouse);
104 procedure Get_Event (Event : in Mouse_Event;
105 Y : out Line_Position;
106 X : out Column_Position;
107 Button : out Mouse_Button;
108 State : out Button_State);
109 -- !!! Warning: X and Y are screen coordinates. Due to ripped of lines they
110 -- may not be identical to window coordinates.
111 pragma Inline (Get_Event);
113 -- ANCHOR(`ungetmouse()',`Unget_Mouse')
114 procedure Unget_Mouse (Event : in Mouse_Event);
116 pragma Inline (Unget_Mouse);
118 -- ANCHOR(`wenclose()',`Enclosed_In_Window')
119 function Enclosed_In_Window (Win : Window := Standard_Window;
120 Event : Mouse_Event) return Boolean;
122 -- But : use event instead of screen coordinates.
123 pragma Inline (Enclosed_In_Window);
125 -- ANCHOR(`mouseinterval()',`Mouse_Interval')
126 function Mouse_Interval (Msec : Natural := 200) return Natural;
128 pragma Inline (Mouse_Interval);
131 type Event_Mask is new Interfaces.C.int;
132 No_Events : constant Event_Mask := 0;
133 All_Events : constant Event_Mask := -1;
137 Id : Integer range Integer (Interfaces.C.short'First) ..
138 Integer (Interfaces.C.Short'Last);
139 X, Y, Z : Integer range Integer (Interfaces.C.int'First) ..
140 Integer (Interfaces.C.int'Last);
143 pragma Convention (C, Mouse_Event);
144 pragma Pack (Mouse_Event);
146 include(`Mouse_Event_Rep')
147 Generation_Bit_Order : constant System.Bit_Order := System.M4_BIT_ORDER;
148 -- This constant may be different on your system.
150 end Terminal_Interface.Curses.Mouse;