~ubuntu-branches/ubuntu/precise/ncurses/precise

« back to all changes in this revision

Viewing changes to Ada95/samples/ncurses2-getch_test.adb

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant
  • Date: 2008-11-11 16:40:32 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20081111164032-dudxd0hy2im0f2bj
Tags: 5.7-2ubuntu1
* Merge from debian unstable, remaining changes:
  - On amd64, use /{,usr/}lib32 instead of /emul/ia32-linux/.
  - Link using -Bsymbolic-functions.
  - Don't install the upstream changelog in the runtime library packages.

* Install wide-character patches into /{,usr/}lib32 as well.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
--                                 B O D Y                                  --
8
8
--                                                                          --
9
9
------------------------------------------------------------------------------
 
10
-- Copyright (c) 2000-2006,2008 Free Software Foundation, Inc.              --
10
11
--                                                                          --
11
12
-- Permission is hereby granted, free of charge, to any person obtaining a  --
12
13
-- copy of this software and associated documentation files (the            --
35
35
------------------------------------------------------------------------------
36
36
--  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
37
37
--  Version Control
 
38
--  $Revision: 1.7 $
 
39
--  $Date: 2008/07/26 18:46:58 $
38
40
--  Binding Version 01.00
39
41
------------------------------------------------------------------------------
40
42
--  Character input test
121
121
         Put (tmp6, Integer (c), 8);
122
122
         Add (Str => tmp6);
123
123
         Add (Ch => ' ');
124
 
         if c = Key_Mouse then declare
125
 
            event : Mouse_Event;
126
 
         begin
127
 
            event := Get_Mouse;
128
 
            Add (Str => "KEY_MOUSE, ");
129
 
            Add (Str => mouse_decode (event));
130
 
            Add (Ch => newl);
131
 
         end;
 
124
         if c = Key_Mouse then
 
125
            declare
 
126
               event : Mouse_Event;
 
127
            begin
 
128
               event := Get_Mouse;
 
129
               Add (Str => "KEY_MOUSE, ");
 
130
               Add (Str => mouse_decode (event));
 
131
               Add (Ch => newl);
 
132
            end;
132
133
         elsif c >= Key_Min then
133
134
            Key_Name (c, tmp20);
134
135
            Add (Str => tmp20);
150
151
               Add (Str => " (high-half character)");
151
152
               Add (Ch => newl);
152
153
            end;
153
 
         else declare
154
 
            c2 : constant Character := Character'Val (c mod 16#80#);
155
 
         begin
156
 
            if Ada.Characters.Handling.Is_Graphic (c2) then
157
 
               Add (Ch => c2);
158
 
               Add (Str => " (ASCII printable character)");
159
 
               Add (Ch => newl);
160
 
            else
161
 
               Add (Str => Un_Control ((Ch => c2,
162
 
                                       Color => Color_Pair'First,
163
 
                                       Attr => Normal_Video)));
164
 
               Add (Str => " (ASCII control character)");
165
 
               Add (Ch => newl);
166
 
            end if;
167
 
         end;
 
154
         else
 
155
            declare
 
156
               c2 : constant Character := Character'Val (c mod 16#80#);
 
157
            begin
 
158
               if Ada.Characters.Handling.Is_Graphic (c2) then
 
159
                  Add (Ch => c2);
 
160
                  Add (Str => " (ASCII printable character)");
 
161
                  Add (Ch => newl);
 
162
               else
 
163
                  Add (Str => Un_Control ((Ch => c2,
 
164
                                          Color => Color_Pair'First,
 
165
                                          Attr => Normal_Video)));
 
166
                  Add (Str => " (ASCII control character)");
 
167
                  Add (Ch => newl);
 
168
               end if;
 
169
            end;
168
170
         end if;
169
171
         --  TODO I am not sure why this was in the C version
170
172
         --  the delay statement scroll anyway.