1 ------------------------------------------------------------------------------
3 -- GNAT ncurses Binding --
5 -- Terminal_Interface.Curses.Panels --
11 -- The ncurses Ada95 binding is copyrighted 1996 by --
12 -- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de --
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. --
22 -- This binding comes AS IS with no warranty, implied or expressed. --
23 ------------------------------------------------------------------------------
26 ------------------------------------------------------------------------------
27 with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
30 package body Terminal_Interface.Curses.Panels is
32 use type Interfaces.C.int;
34 function Create (Win : Window) return Panel
36 function Newpanel (Win : Window) return Panel;
37 pragma Import (C, Newpanel, "new_panel");
41 Pan := Newpanel (Win);
42 if Pan = Null_Panel then
43 raise Panel_Exception;
48 procedure Bottom (Pan : in Panel)
50 function Bottompanel (Pan : Panel) return C_Int;
51 pragma Import (C, Bottompanel, "bottom_panel");
53 if Bottompanel (Pan) = Curses_Err then
54 raise Panel_Exception;
58 procedure Top (Pan : in Panel)
60 function Toppanel (Pan : Panel) return C_Int;
61 pragma Import (C, Toppanel, "top_panel");
63 if Toppanel (Pan) = Curses_Err then
64 raise Panel_Exception;
68 procedure Show (Pan : in Panel)
70 function Showpanel (Pan : Panel) return C_Int;
71 pragma Import (C, Showpanel, "show_panel");
73 if Showpanel (Pan) = Curses_Err then
74 raise Panel_Exception;
78 procedure Hide (Pan : in Panel)
80 function Hidepanel (Pan : Panel) return C_Int;
81 pragma Import (C, Hidepanel, "hide_panel");
83 if Hidepanel (Pan) = Curses_Err then
84 raise Panel_Exception;
88 function Get_Window (Pan : Panel) return Window
90 function Panel_Win (Pan : Panel) return Window;
91 pragma Import (C, Panel_Win, "panel_window");
93 Win : Window := Panel_Win (Pan);
95 if Win = Null_Window then
96 raise Panel_Exception;
101 procedure Replace (Pan : in Panel;
104 function Replace_Pan (Pan : Panel;
105 Win : Window) return C_Int;
106 pragma Import (C, Replace_Pan, "replace_panel");
108 if Replace_Pan (Pan, Win) = Curses_Err then
109 raise Panel_Exception;
113 procedure Move (Pan : in Panel;
114 Line : in Line_Position;
115 Column : in Column_Position)
117 function Move (Pan : Panel;
119 Column : C_Int) return C_Int;
120 pragma Import (C, Move, "move_panel");
122 if Move (Pan, C_Int (Line), C_Int (Column)) = Curses_Err then
123 raise Panel_Exception;
127 function Is_Hidden (Pan : Panel) return Boolean
129 function Panel_Hidden (Pan : Panel) return C_Int;
130 pragma Import (C, Panel_Hidden, "panel_hidden");
132 if Panel_Hidden (Pan) = Curses_False then
139 procedure Delete (Pan : in out Panel)
141 function Del_Panel (Pan : Panel) return C_Int;
142 pragma Import (C, Del_Panel, "del_panel");
144 if Del_Panel (Pan) = Curses_Err then
145 raise Panel_Exception;
150 end Terminal_Interface.Curses.Panels;