X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=doc%2Fhtml%2Fada%2Fterminal_interface-curses-mouse__ads.htm;h=611d93d0d98e33684b5098700cdac16fb1cfc482;hp=bfd6fe9f880887c4676ddcb6099b2c2517381a67;hb=77afe78361875f531dc2bf8d73f2e781c8e76176;hpb=b1f61d9f3aa244512045a6b02e759825d7049d34 diff --git a/doc/html/ada/terminal_interface-curses-mouse__ads.htm b/doc/html/ada/terminal_interface-curses-mouse__ads.htm index bfd6fe9f..611d93d0 100644 --- a/doc/html/ada/terminal_interface-curses-mouse__ads.htm +++ b/doc/html/ada/terminal_interface-curses-mouse__ads.htm @@ -1,8 +1,8 @@ + terminal_interface-curses-mouse.ads

File : terminal_interface-curses-mouse.ads


-
 ------------------------------------------------------------------------------
 --                                                                          --
 --                           GNAT ncurses Binding                           --
@@ -12,7 +12,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2006,2009 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            --
@@ -38,9 +38,10 @@
 -- sale, use or other dealings in this Software without prior written       --
 -- authorization.                                                           --
 ------------------------------------------------------------------------------
---  Author: Jürgen Pfeifer <<juergen.pfeifer@gmx.net>> 1996
+--  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  @Revision: 1.19 @
+--  @Revision: 1.28 @
+--  @Date: 2009/12/26 17:38:58 @
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 --  mouse binding.
@@ -49,8 +50,8 @@
 --  |
 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
@@ -59,56 +60,62 @@
    --  is still marked as experimental. So also this binding will change
    --  if the ncurses methods change.
    --
-   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;
+   --  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;
+
+   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,
-                                           others => False);
-   All_States : constant Button_States := (others => True);
+   All_Clicks : constant Button_States := (Clicked .. Triple_Clicked => True,
+                                           others => False);
+   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 : in Mouse_Button;
-      State  : in 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 init the mask
    --  with the Empty_Mask constant
-   pragma Inline (Register_Reportable_Event);
+   pragma Inline (Register_Reportable_Event);
 
-   procedure Register_Reportable_Events
-     (Button : in Mouse_Button;
-      State  : in 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 init the mask
    --  with the Empty_Mask constant
@@ -116,110 +123,113 @@
    --  #1A NAME="AFU_1"#2|
    --  There is one difference to mousmask(): we return the value of the
    --  old mask, that means the event mask value before this call.
-   function Start_Mouse (Mask : Event_Mask := All_Events)
-                         return Event_Mask;
+   --  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: mousemask()
-   pragma Inline (Start_Mouse);
+   pragma Inline (Start_Mouse);
 
-   procedure End_Mouse (Mask : in 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);
 
    --  #1A NAME="AFU_2"#2|
-   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  : in  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.
-   pragma Inline (Get_Event);
+   --  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);
 
    --  #1A NAME="AFU_3"#2|
-   procedure Unget_Mouse (Event : in Mouse_Event);
+   procedure Unget_Mouse (Event : Mouse_Event);
    --  AKA: ungetmouse()
-   pragma Inline (Unget_Mouse);
+   pragma Inline (Unget_Mouse);
 
    --  #1A NAME="AFU_4"#2|
-   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);
 
    --  #1A NAME="AFU_5"#2|
-   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
-   type Event_Mask is new Interfaces.C.unsigned_long;
+   type Event_Mask is new Interfaces.C.unsigned_long;
 
-   type Mouse_Event is
+   type Mouse_Event is
       record
-         Id      : Integer range Integer (Interfaces.C.short'First) ..
-                                 Integer (Interfaces.C.short'Last);
-         X, Y, Z : Integer range Integer (Interfaces.C.int'First) ..
-                                 Integer (Interfaces.C.int'Last);
-         Bstate  : Event_Mask;
+         Id      : Integer range Integer (Interfaces.C.short'First) ..
+                                 Integer (Interfaces.C.short'Last);
+         X, Y, Z : Integer range Integer (Interfaces.C.int'First) ..
+                                 Integer (Interfaces.C.int'Last);
+         Bstate  : Event_Mask;
       end record;
-   pragma Convention (C, Mouse_Event);
-   pragma Pack (Mouse_Event);
+   pragma Convention (C, Mouse_Event);
 
-   for Mouse_Event use
+   for Mouse_Event use
       record
-         Id      at 0 range   0 ..  15;
-         X       at 0 range  32 ..  63;
-         Y       at 0 range  64 ..  95;
-         Z       at 0 range  96 .. 127;
-         Bstate  at 0 range 128 .. 159;
+         Id      at 0 range   0 ..  15;
+         X       at 0 range  32 ..  63;
+         Y       at 0 range  64 ..  95;
+         Z       at 0 range  96 .. 127;
+         Bstate  at 0 range 128 .. 159;
       end record;
       --  Please note: this rep. clause is generated and may be
       --               different on your system.
 
-   Generation_Bit_Order : constant System.Bit_Order := System.Low_Order_First;
+   Generation_Bit_Order : constant System.Bit_Order := System.Low_Order_First;
    --  This constant may be different on your system.
 
-   BUTTON1_RELEASED          : constant Event_Mask := 8#00000000001#;
-   BUTTON1_PRESSED           : constant Event_Mask := 8#00000000002#;
-   BUTTON1_CLICKED           : constant Event_Mask := 8#00000000004#;
-   BUTTON1_DOUBLE_CLICKED    : constant Event_Mask := 8#00000000010#;
-   BUTTON1_TRIPLE_CLICKED    : constant Event_Mask := 8#00000000020#;
-   BUTTON1_RESERVED_EVENT    : constant Event_Mask := 8#00000000040#;
-   BUTTON2_RELEASED          : constant Event_Mask := 8#00000000100#;
-   BUTTON2_PRESSED           : constant Event_Mask := 8#00000000200#;
-   BUTTON2_CLICKED           : constant Event_Mask := 8#00000000400#;
-   BUTTON2_DOUBLE_CLICKED    : constant Event_Mask := 8#00000001000#;
-   BUTTON2_TRIPLE_CLICKED    : constant Event_Mask := 8#00000002000#;
-   BUTTON2_RESERVED_EVENT    : constant Event_Mask := 8#00000004000#;
-   BUTTON3_RELEASED          : constant Event_Mask := 8#00000010000#;
-   BUTTON3_PRESSED           : constant Event_Mask := 8#00000020000#;
-   BUTTON3_CLICKED           : constant Event_Mask := 8#00000040000#;
-   BUTTON3_DOUBLE_CLICKED    : constant Event_Mask := 8#00000100000#;
-   BUTTON3_TRIPLE_CLICKED    : constant Event_Mask := 8#00000200000#;
-   BUTTON3_RESERVED_EVENT    : constant Event_Mask := 8#00000400000#;
-   BUTTON4_RELEASED          : constant Event_Mask := 8#00001000000#;
-   BUTTON4_PRESSED           : constant Event_Mask := 8#00002000000#;
-   BUTTON4_CLICKED           : constant Event_Mask := 8#00004000000#;
-   BUTTON4_DOUBLE_CLICKED    : constant Event_Mask := 8#00010000000#;
-   BUTTON4_TRIPLE_CLICKED    : constant Event_Mask := 8#00020000000#;
-   BUTTON4_RESERVED_EVENT    : constant Event_Mask := 8#00040000000#;
-   BUTTON_CTRL               : constant Event_Mask := 8#00100000000#;
-   BUTTON_SHIFT              : constant Event_Mask := 8#00200000000#;
-   BUTTON_ALT                : constant Event_Mask := 8#00400000000#;
-   ALL_MOUSE_EVENTS          : constant Event_Mask := 8#00777777777#;
-   BUTTON1_EVENTS            : constant Event_Mask := 8#00000000077#;
-   BUTTON2_EVENTS            : constant Event_Mask := 8#00000007700#;
-   BUTTON3_EVENTS            : constant Event_Mask := 8#00000770000#;
-   BUTTON4_EVENTS            : constant Event_Mask := 8#00077000000#;
-
-
-   No_Events  : constant Event_Mask := 0;
-   All_Events : constant Event_Mask := ALL_MOUSE_EVENTS;
-
-end Terminal_Interface.Curses.Mouse;
-
\ No newline at end of file + BUTTON1_RELEASED : constant Event_Mask := 8#00000000001#; + BUTTON1_PRESSED : constant Event_Mask := 8#00000000002#; + BUTTON1_CLICKED : constant Event_Mask := 8#00000000004#; + BUTTON1_DOUBLE_CLICKED : constant Event_Mask := 8#00000000010#; + BUTTON1_TRIPLE_CLICKED : constant Event_Mask := 8#00000000020#; + BUTTON1_RESERVED_EVENT : constant Event_Mask := 8#00000000040#; + BUTTON2_RELEASED : constant Event_Mask := 8#00000000100#; + BUTTON2_PRESSED : constant Event_Mask := 8#00000000200#; + BUTTON2_CLICKED : constant Event_Mask := 8#00000000400#; + BUTTON2_DOUBLE_CLICKED : constant Event_Mask := 8#00000001000#; + BUTTON2_TRIPLE_CLICKED : constant Event_Mask := 8#00000002000#; + BUTTON2_RESERVED_EVENT : constant Event_Mask := 8#00000004000#; + BUTTON3_RELEASED : constant Event_Mask := 8#00000010000#; + BUTTON3_PRESSED : constant Event_Mask := 8#00000020000#; + BUTTON3_CLICKED : constant Event_Mask := 8#00000040000#; + BUTTON3_DOUBLE_CLICKED : constant Event_Mask := 8#00000100000#; + BUTTON3_TRIPLE_CLICKED : constant Event_Mask := 8#00000200000#; + BUTTON3_RESERVED_EVENT : constant Event_Mask := 8#00000400000#; + BUTTON4_RELEASED : constant Event_Mask := 8#00001000000#; + BUTTON4_PRESSED : constant Event_Mask := 8#00002000000#; + BUTTON4_CLICKED : constant Event_Mask := 8#00004000000#; + BUTTON4_DOUBLE_CLICKED : constant Event_Mask := 8#00010000000#; + BUTTON4_TRIPLE_CLICKED : constant Event_Mask := 8#00020000000#; + BUTTON4_RESERVED_EVENT : constant Event_Mask := 8#00040000000#; + BUTTON_CTRL : constant Event_Mask := 8#00100000000#; + BUTTON_SHIFT : constant Event_Mask := 8#00200000000#; + BUTTON_ALT : constant Event_Mask := 8#00400000000#; + REPORT_MOUSE_POSITION : constant Event_Mask := 8#01000000000#; + ALL_MOUSE_EVENTS : constant Event_Mask := 8#00777777777#; + BUTTON1_EVENTS : constant Event_Mask := 8#00000000077#; + BUTTON2_EVENTS : constant Event_Mask := 8#00000007700#; + BUTTON3_EVENTS : constant Event_Mask := 8#00000770000#; + BUTTON4_EVENTS : constant Event_Mask := 8#00077000000#; + + No_Events : constant Event_Mask := 0; + All_Events : constant Event_Mask := ALL_MOUSE_EVENTS; + +end Terminal_Interface.Curses.Mouse; +