]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/ada_include/terminal_interface-curses-panels-user_data.adb
5d1c7e94a5ffc212c7f9e910b45fc7049f3eebbf
[ncurses.git] / Ada95 / ada_include / terminal_interface-curses-panels-user_data.adb
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                           GNAT ncurses Binding                           --
4 --                                                                          --
5 --                 Terminal_Interface.Curses.Panels.User_Data               --
6 --                                                                          --
7 --                                 B O D Y                                  --
8 --                                                                          --
9 --  Version 00.92                                                           --
10 --                                                                          --
11 --  The ncurses Ada95 binding is copyrighted 1996 by                        --
12 --  Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                     --
13 --                                                                          --
14 --  Permission is hereby granted to reproduce and distribute this           --
15 --  binding by any means and for any fee, whether alone or as part          --
16 --  of a larger distribution, in source or in binary form, PROVIDED         --
17 --  this notice is included with any such distribution, and is not          --
18 --  removed from any of its header files. Mention of ncurses and the        --
19 --  author of this binding in any applications linked with it is            --
20 --  highly appreciated.                                                     --
21 --                                                                          --
22 --  This binding comes AS IS with no warranty, implied or expressed.        --
23 ------------------------------------------------------------------------------
24 --  Version Control:
25 --  $Revision: 1.3 $
26 ------------------------------------------------------------------------------
27 with Interfaces.C;
28 with Terminal_Interface.Curses.Aux;
29 use  Terminal_Interface.Curses.Aux;
30 with Terminal_Interface.Curses.Panels;
31 use  Terminal_Interface.Curses.Panels;
32
33 package body Terminal_Interface.Curses.Panels.User_Data is
34
35    use type Interfaces.C.int;
36
37    procedure Set_User_Data (Pan  : in Panel;
38                             Data : in User_Access)
39    is
40       function Set_Panel_Userptr (Pan  : Panel;
41                                   Addr : User_Access) return C_Int;
42       pragma Import (C, Set_Panel_Userptr, "set_panel_userptr");
43    begin
44       if Set_Panel_Userptr (Pan, Data) = Curses_Err then
45          raise Panel_Exception;
46       end if;
47    end Set_User_Data;
48
49    procedure Get_User_Data (Pan  : in  Panel;
50                             Data : out User_Access)
51    is
52       function Panel_Userptr (Pan : Panel) return User_Access;
53       pragma Import (C, Panel_Userptr, "panel_userptr");
54    begin
55       Data := Panel_Userptr (Pan);
56    end Get_User_Data;
57
58 end Terminal_Interface.Curses.Panels.User_Data;