]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/ada_include/terminal_interface-curses-text_io-complex_io.adb
ncurses 4.1
[ncurses.git] / Ada95 / ada_include / terminal_interface-curses-text_io-complex_io.adb
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                           GNAT ncurses Binding                           --
4 --                                                                          --
5 --               Terminal_Interface.Curses.Text_IO.Complex_IO               --
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 Terminal_Interface.Curses.Text_IO.Float_IO;
28
29 package body Terminal_Interface.Curses.Text_IO.Complex_IO is
30
31    package FIO is new
32      Terminal_Interface.Curses.Text_IO.Float_IO (Complex_Types.Real'Base);
33
34    procedure Put
35      (Win  : in Window;
36       Item : in Complex;
37       Fore : in Field := Default_Fore;
38       Aft  : in Field := Default_Aft;
39       Exp  : in Field := Default_Exp)
40    is
41    begin
42       Put (Win, '(');
43       FIO.Put (Win, Item.Re, Fore, Aft, Exp);
44       Put (Win, ',');
45       FIO.Put (Win, Item.Im, Fore, Aft, Exp);
46       Put (Win, ')');
47    end Put;
48
49    procedure Put
50      (Item : in Complex;
51       Fore : in Field := Default_Fore;
52       Aft  : in Field := Default_Aft;
53       Exp  : in Field := Default_Exp)
54    is
55    begin
56       Put (Get_Window, Item, Fore, Aft, Exp);
57    end Put;
58
59 end Terminal_Interface.Curses.Text_IO.Complex_IO;