1 ------------------------------------------------------------------------------
3 -- GNAT ncurses Binding --
5 -- Terminal_Interface.Curses.Panels --
9 ------------------------------------------------------------------------------
10 -- Copyright (c) 1998-2004,2009 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 -- $Date: 2009/12/26 17:38:58 $
40 -- Binding Version 01.00
41 ------------------------------------------------------------------------------
42 with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
45 package body Terminal_Interface.Curses.Panels is
47 use type Interfaces.C.int;
49 function Create (Win : Window) return Panel
51 function Newpanel (Win : Window) return Panel;
52 pragma Import (C, Newpanel, "new_panel");
56 Pan := Newpanel (Win);
57 if Pan = Null_Panel then
58 raise Panel_Exception;
63 procedure Bottom (Pan : Panel)
65 function Bottompanel (Pan : Panel) return C_Int;
66 pragma Import (C, Bottompanel, "bottom_panel");
68 if Bottompanel (Pan) = Curses_Err then
69 raise Panel_Exception;
73 procedure Top (Pan : Panel)
75 function Toppanel (Pan : Panel) return C_Int;
76 pragma Import (C, Toppanel, "top_panel");
78 if Toppanel (Pan) = Curses_Err then
79 raise Panel_Exception;
83 procedure Show (Pan : Panel)
85 function Showpanel (Pan : Panel) return C_Int;
86 pragma Import (C, Showpanel, "show_panel");
88 if Showpanel (Pan) = Curses_Err then
89 raise Panel_Exception;
93 procedure Hide (Pan : Panel)
95 function Hidepanel (Pan : Panel) return C_Int;
96 pragma Import (C, Hidepanel, "hide_panel");
98 if Hidepanel (Pan) = Curses_Err then
99 raise Panel_Exception;
103 function Get_Window (Pan : Panel) return Window
105 function Panel_Win (Pan : Panel) return Window;
106 pragma Import (C, Panel_Win, "panel_window");
108 Win : constant Window := Panel_Win (Pan);
110 if Win = Null_Window then
111 raise Panel_Exception;
116 procedure Replace (Pan : Panel;
119 function Replace_Pan (Pan : Panel;
120 Win : Window) return C_Int;
121 pragma Import (C, Replace_Pan, "replace_panel");
123 if Replace_Pan (Pan, Win) = Curses_Err then
124 raise Panel_Exception;
128 procedure Move (Pan : Panel;
129 Line : Line_Position;
130 Column : Column_Position)
132 function Move (Pan : Panel;
134 Column : C_Int) return C_Int;
135 pragma Import (C, Move, "move_panel");
137 if Move (Pan, C_Int (Line), C_Int (Column)) = Curses_Err then
138 raise Panel_Exception;
142 function Is_Hidden (Pan : Panel) return Boolean
144 function Panel_Hidden (Pan : Panel) return C_Int;
145 pragma Import (C, Panel_Hidden, "panel_hidden");
147 if Panel_Hidden (Pan) = Curses_False then
154 procedure Delete (Pan : in out Panel)
156 function Del_Panel (Pan : Panel) return C_Int;
157 pragma Import (C, Del_Panel, "del_panel");
159 if Del_Panel (Pan) = Curses_Err then
160 raise Panel_Exception;
165 end Terminal_Interface.Curses.Panels;