File: uio_demo.adb

package info (click to toggle)
libtexttools 2.0.3-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,188 kB
  • ctags: 635
  • sloc: ada: 13,120; cpp: 1,679; ansic: 777; makefile: 156; sh: 2
file content (105 lines) | stat: -rw-r--r-- 2,466 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
with common, userio;
use  common, userio;

with text_io;
use text_io;

procedure uio_demo is
  ch : character;

  ir1 : anInputRecord( InputType => KeyInput );
  ir2 : anInputRecord( InputType => HeldKeyInput );
  ir3 : anInputRecord( InputType => DirectionInput );
  ir4 : anInputRecord( InputType => LocationInput );
  ir5 : anInputRecord( InputType => ButtonDownInput );
  ir6 : anInputRecord( InputType => ButtonUpInput );
  ir7 : anInputRecord( InputType => MoveInput );
  ir8 : anInputRecord( InputType => UserInput );

begin
  StartupCommon( "uio_demo", "User IO Demo" );
  StartupUserIO;
  Draw( "This is a string" );
  GetKey( ch );
  ShutdownUserIO;
  ShutdownCommon;

  put( "Input record is" );
  put( integer'image(ir1'size/8) );
  put_line( " bytes" );

  put( "Input record is" );
  put( integer'image(ir5'size/8) );
  put_line( " bytes" );

  put( "InputType is" );
  put( integer'image(ir1.InputType'size/8) );
  put_line( " bytes" );

  put( "TimeStamp is" );
  put( integer'image(ir1.TimeStamp'size/8) );
  put_line( " bytes" );

  put( "Key =" );
  put( integer'image(ir1.key'size/8) );
  put_line( " bytes" );

  put( "HeldKey =" );
  put( integer'image(ir2.heldkey'size/8) );
  put_line( " bytes" );

  put( "Direction =" );
  put( integer'image(ir3.direction'size/8) );
  put_line( " bytes" );

  put( "Velocity =" );
  put( integer'image(ir3.velocity'size/8) );
  put_line( " bytes" );

  put( "X =" );
  put( integer'image(ir4.x'size/8) );
  put_line( " bytes" );

  put( "Y =" );
  put( integer'image(ir4.y'size/8) );
  put_line( " bytes" );

  put( "DownButton =" );
  put( integer'image(ir5.downButton'size/8) );
  put_line( " bytes" );

  put( "DownLocationX =" );
  put( integer'image(ir5.downLocationX'size/8) );
  put_line( " bytes" );

  put( "DownLocationY =" );
  put( integer'image(ir5.downLocationY'size/8) );
  put_line( " bytes" );

  put( "UpButton =" );
  put( integer'image(ir6.upButton'size/8) );
  put_line( " bytes" );

  put( "UpLocationX =" );
  put( integer'image(ir6.upLocationX'size/8) );
  put_line( " bytes" );

  put( "UpLocationY =" );
  put( integer'image(ir6.upLocationY'size/8) );
  put_line( " bytes" );

  put( "MoveLocationX =" );
  put( integer'image(ir7.moveLocationX'size/8) );
  put_line( " bytes" );

  put( "MoveLocationY =" );
  put( integer'image(ir7.moveLocationY'size/8) );
  put_line( " bytes" );

  put( "ID =" );
  put( integer'image(ir8.id'size/8) );
  put_line( " bytes" );


end uio_demo;