Last change
on this file was 53, checked in by chronos, 6 months ago |
- Added: Experimental textos computer.
|
File size:
925 bytes
|
Line | |
---|
1 | unit UApi;
|
---|
2 |
|
---|
3 | {$mode delphi}
|
---|
4 |
|
---|
5 | interface
|
---|
6 |
|
---|
7 | uses
|
---|
8 | Classes, SysUtils;
|
---|
9 |
|
---|
10 | type
|
---|
11 | TApiMessage = (amNone, amTerminate, amInputText);
|
---|
12 |
|
---|
13 | { TApi }
|
---|
14 |
|
---|
15 | TApi = class
|
---|
16 | Parent: TApi;
|
---|
17 | procedure Sleep(Time: TDateTime); virtual;
|
---|
18 | function GetMessage: TApiMessage; virtual;
|
---|
19 | function InputText: string; virtual;
|
---|
20 | procedure OutputText(Text: string); virtual;
|
---|
21 | procedure Terminate; virtual;
|
---|
22 | procedure ExecuteApp(Name: string); virtual;
|
---|
23 | end;
|
---|
24 |
|
---|
25 |
|
---|
26 | implementation
|
---|
27 |
|
---|
28 | { TApi }
|
---|
29 |
|
---|
30 | procedure TApi.Sleep(Time: TDateTime);
|
---|
31 | begin
|
---|
32 | Parent.Sleep(Time);
|
---|
33 | end;
|
---|
34 |
|
---|
35 | function TApi.GetMessage: TApiMessage;
|
---|
36 | begin
|
---|
37 | Result := Parent.GetMessage;
|
---|
38 | end;
|
---|
39 |
|
---|
40 | function TApi.InputText: string;
|
---|
41 | begin
|
---|
42 | Result := Parent.InputText;
|
---|
43 | end;
|
---|
44 |
|
---|
45 | procedure TApi.OutputText(Text: string);
|
---|
46 | begin
|
---|
47 | Parent.OutputText(Text);
|
---|
48 | end;
|
---|
49 |
|
---|
50 | procedure TApi.Terminate;
|
---|
51 | begin
|
---|
52 | Parent.Terminate;
|
---|
53 | end;
|
---|
54 |
|
---|
55 | procedure TApi.ExecuteApp(Name: string);
|
---|
56 | begin
|
---|
57 | Parent.ExecuteApp(Name);
|
---|
58 | end;
|
---|
59 |
|
---|
60 | end.
|
---|
61 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.