1 ------------------------------------------------------------------------------
3 -- GNAT ncurses Binding --
5 -- Terminal_Interface.Curses.Panels --
9 ------------------------------------------------------------------------------
10 -- Copyright (c) 1998 Free Software Foundation, Inc. --
12 -- Permission is hereby granted, free of charge, to any person obtaining a --
13 -- copy of this software and associated documentation files (the --
14 -- "Software"), to deal in the Software without restriction, including --
15 -- without limitation the rights to use, copy, modify, merge, publish, --
16 -- distribute, distribute with modifications, sublicense, and/or sell --
17 -- copies of the Software, and to permit persons to whom the Software is --
18 -- furnished to do so, subject to the following conditions: --
20 -- The above copyright notice and this permission notice shall be included --
21 -- in all copies or substantial portions of the Software. --
23 -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
24 -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
25 -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
26 -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
27 -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
28 -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
29 -- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
31 -- Except as contained in this notice, the name(s) of the above copyright --
32 -- holders shall not be used in advertising or otherwise to promote the --
33 -- sale, use or other dealings in this Software without prior written --
35 ------------------------------------------------------------------------------
36 -- Author: Juergen Pfeifer, 1996
39 -- Binding Version 01.00
40 ------------------------------------------------------------------------------
41 with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
44 package body Terminal_Interface.Curses.Panels is
46 use type Interfaces.C.int;
48 function Create (Win : Window) return Panel
50 function Newpanel (Win : Window) return Panel;
51 pragma Import (C, Newpanel, "new_panel");
55 Pan := Newpanel (Win);
56 if Pan = Null_Panel then
57 raise Panel_Exception;
62 procedure Bottom (Pan : in Panel)
64 function Bottompanel (Pan : Panel) return C_Int;
65 pragma Import (C, Bottompanel, "bottom_panel");
67 if Bottompanel (Pan) = Curses_Err then
68 raise Panel_Exception;
72 procedure Top (Pan : in Panel)
74 function Toppanel (Pan : Panel) return C_Int;
75 pragma Import (C, Toppanel, "top_panel");
77 if Toppanel (Pan) = Curses_Err then
78 raise Panel_Exception;
82 procedure Show (Pan : in Panel)
84 function Showpanel (Pan : Panel) return C_Int;
85 pragma Import (C, Showpanel, "show_panel");
87 if Showpanel (Pan) = Curses_Err then
88 raise Panel_Exception;
92 procedure Hide (Pan : in Panel)
94 function Hidepanel (Pan : Panel) return C_Int;
95 pragma Import (C, Hidepanel, "hide_panel");
97 if Hidepanel (Pan) = Curses_Err then
98 raise Panel_Exception;
102 function Get_Window (Pan : Panel) return Window
104 function Panel_Win (Pan : Panel) return Window;
105 pragma Import (C, Panel_Win, "panel_window");
107 Win : Window := Panel_Win (Pan);
109 if Win = Null_Window then
110 raise Panel_Exception;
115 procedure Replace (Pan : in Panel;
118 function Replace_Pan (Pan : Panel;
119 Win : Window) return C_Int;
120 pragma Import (C, Replace_Pan, "replace_panel");
122 if Replace_Pan (Pan, Win) = Curses_Err then
123 raise Panel_Exception;
127 procedure Move (Pan : in Panel;
128 Line : in Line_Position;
129 Column : in Column_Position)
131 function Move (Pan : Panel;
133 Column : C_Int) return C_Int;
134 pragma Import (C, Move, "move_panel");
136 if Move (Pan, C_Int (Line), C_Int (Column)) = Curses_Err then
137 raise Panel_Exception;
141 function Is_Hidden (Pan : Panel) return Boolean
143 function Panel_Hidden (Pan : Panel) return C_Int;
144 pragma Import (C, Panel_Hidden, "panel_hidden");
146 if Panel_Hidden (Pan) = Curses_False then
153 procedure Delete (Pan : in out Panel)
155 function Del_Panel (Pan : Panel) return C_Int;
156 pragma Import (C, Del_Panel, "del_panel");
158 if Del_Panel (Pan) = Curses_Err then
159 raise Panel_Exception;
164 end Terminal_Interface.Curses.Panels;