Subversion Repositories Kolibri OS

Rev

Rev 643 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 643 Rev 666
Line 1... Line 1...
1
{}
1
{-$codepage cp866}
Line 2... Line 2...
2
 
2
 
3
type
3
type
4
  TKosPoint = packed record
4
  TKosPoint = packed record
5
    X: Longint;
5
    X: Longint;
Line 44... Line 44...
44
function kos_getthreadslot(tid: TThreadID): TThreadSlot;
44
function kos_getthreadslot(tid: TThreadID): TThreadSlot;
Line 45... Line 45...
45
 
45
 
46
{ Work with system - Set system parameters }
46
{ Work with system - Set system parameters }
Line -... Line 47...
-
 
47
procedure kos_enablepci();
-
 
48
 
-
 
49
{ Work with system - Get system parameters }
47
procedure kos_enablepci();
50
function kos_timecounter(): DWord;
48
 
51
 
49
{ Work with system - Internal system services }
52
{ Work with system - Internal system services }
50
procedure kos_switchthread();
53
procedure kos_switchthread();
51
function kos_initheap(): DWord;
54
function kos_initheap(): DWord;
Line 65... Line 68...
65
    Reserved2: Byte;
68
    Reserved2: Byte;
66
    ProcessBase: Pointer;
69
    ProcessBase: Pointer;
67
    MemoryUsage: DWord;
70
    MemoryUsage: DWord;
68
    ThreadID: TThreadID;
71
    ThreadID: TThreadID;
69
    WindowRect: TKosRect;
72
    WindowRect: TKosRect;
-
 
73
    Reserved3: DWord;
-
 
74
    ClientRect: TKosRect;
70
    Unknown0: array[1..1066] of Byte;
75
    Reserved4: array[1..1046] of Byte;
71
  end;
76
  end;
Line 72... Line 77...
72
 
77
 
73
  {ãä¥à IPC}
78
  {ãä¥à IPC}
74
  PKosIPC = ^TKosIPC;
79
  PKosIPC = ^TKosIPC;
Line 177... Line 182...
177
type
182
type
178
  PKonsole = ^TKonsole;
183
  PKonsole = ^TKonsole;
179
  TKonsole = object
184
  TKonsole = object
180
  private
185
  private
181
    FCaption: String;
186
    FCaption: String;
182
    FLines: array of String;
187
    FLines: array of ShortString;
183
    FCursor: TKosPoint;
188
    FCursor: TKosPoint;
184
    FMaxLines: Word;
189
    FMaxLines: Word;
185
    FThreadID: TThreadID;
190
    FThreadID: TThreadID;
186
    FThreadSlot: TThreadSlot;
191
    FThreadSlot: TThreadSlot;
187
    FIPCBuffer: PKosIPC;
192
    FIPCBuffer: PKosIPC;
188
    FIPCBufferSize: DWord;
193
    FIPCBufferSize: DWord;
189
    FTerminate: Boolean;
194
    FTerminate: Boolean;
190
    FOpened: Boolean;
195
    FOpened: Boolean;
-
 
196
    FOnAir : Boolean;
191
    FKeyPressed: Word;
197
    FKeyPressed: Word;
192
    function ReceiveMessage(var Message: ShortString): Boolean;
198
    function ReceiveMessage(var Message: ShortString): Boolean;
193
    procedure ProcessMessage(Message: ShortString);
199
    procedure ProcessMessage(Message: ShortString);
194
    procedure ProcessKeyboard(Key: Word);
200
    procedure ProcessKeyboard(Key: Word);
195
    function GetRect(): TKosRect;
201
    function GetRect(): TKosRect;
196
    function GetKeyPressed(): Word;
202
    function GetKeyPressed(): Word;
197
    procedure Paint(BottomRow: Boolean = False);
203
    procedure Paint(BottomRow: Boolean = False);
-
 
204
    procedure Flush();
198
  public
205
  public
199
    constructor Init(ACaption: String = '');
206
    constructor Init(ACaption: String = '');
200
    destructor Done();
207
    destructor Done();
201
    procedure Write(Message: ShortString);
208
    procedure Write(Message: ShortString);
202
    property KeyPressed: Word read GetKeyPressed;
209
    property KeyPressed: Word read GetKeyPressed;
203
    property Opened: Boolean read FOpened;
210
    property Opened: Boolean read FOpened;
204
    property ThreadID: TThreadID read FThreadID;       {JustForFun, must be hidden, do not use}
211
    property ThreadID: TThreadID read FThreadID;       {JustForFun, must be hidden, do not use}
205
    property ThreadSlot: TThreadSlot read FThreadSlot; {JustForFun, must be hidden, do not use}
212
    property ThreadSlot: TThreadSlot read FThreadSlot; {JustForFun, must be hidden, do not use}
206
  end;
213
  end;
Line -... Line 214...
-
 
214
 
-
 
215
(* §à ¡®âª  â¥à¬¨­ «  ¢ à ¬ª å RTL ¯à¥ªà é¥­ . ’¥à¬¨­ « ¡ã¤¥â ¢ë¤¥«¥­ ¨§ ª®¤ 
-
 
216
  ª®­á®«ì­®£® ¯à¨«®¦¥­¨ï ¨ ¤®«¦¥­ ¡ëâì ॠ«¨§®¢ ­ ª ª ®â¤¥«ì­ë© á¥à¢¨á á
-
 
217
  ¤¨­ ¬¨ç¥áª¨¬ ¯®¤ª«î祭¨¥¬, «¨¡® ª ª ®â¤¥«ì­ë© ¬®¤ã«ì FreePascal á® áâ â¨ç¥áª¨¬
-
 
218
  ¨«¨ ¤¨­ ¬¨ç¥áª¨¬ ¯®¤ª«î祭¨¥¬ â¥à¬¨­ «ì­®£® ä㭪樮­ « .
-
 
219
 
207
 
220
  PTermKursor = ^TTermKursor;
-
 
221
  TTermKursor = object
-
 
222
  private
208
  IStreamIO = interface
223
    FVisible: Boolean;
-
 
224
    procedure SetVisbile(Value: Boolean);
-
 
225
  public
-
 
226
    constructor Init;
209
    function Read(Size: DWord = 0): AnsiString;
227
    procedure Repaint;
210
    procedure Write(Str: AnsiString; Error: Boolean = False);
228
    property Visible: Boolean read FVisible write SetVisbile;
-
 
229
  end;
-
 
230
 
-
 
231
  PTermKIO = ^TTermKIO;
-
 
232
  TTermKIO = object
-
 
233
  private
-
 
234
    FBuffer: Pointer;
-
 
235
    FBufferScreen: Pointer;
-
 
236
    FBufferSize : Longword;
-
 
237
    FBufferWidth: Longword;
-
 
238
    FBufferLines: Longword;
-
 
239
    FIPCBuffer: PKosIPC;
-
 
240
    FIPCBufferSize: Longword;
-
 
241
    FCursor: TTermKursor;
-
 
242
    FCaption: String;
-
 
243
    FThreadID: TThreadID;
-
 
244
    FThreadSlot: TThreadSlot;
-
 
245
    FTerminate: Boolean;
-
 
246
    FOpened: Boolean;
-
 
247
    FWindowBounds: TKosRect;
-
 
248
    FWindowStyle : Longword;
-
 
249
    FClientBounds: TKosRect;
-
 
250
    FMaxWidth : Longword;
-
 
251
    FFirstLine: Longword;
-
 
252
    FDefaultChar: Word;
-
 
253
    FPalette: array[0..15] of Longword;
-
 
254
    procedure MainLoop;
-
 
255
    procedure ReallocBuffer(Size: Longword);
-
 
256
    procedure ResizeBuffer(NewWidth, NewLines: Longword);
-
 
257
    procedure FillDefaultChar(var X; Count: Longword);
-
 
258
    function GetLine(Index: Longint): Pointer;
-
 
259
    function PrevLine(Line: Pointer): Pointer;
-
 
260
    {function ReceiveMessage(var Message: ShortString): Boolean;
-
 
261
    procedure ProcessMessage(Message: ShortString);}
-
 
262
    procedure ProcessKeyboard(Key: Word);
-
 
263
    procedure DoPaint(const Bounds: TKosRect);
-
 
264
    procedure DoResize;
-
 
265
  public
-
 
266
    constructor Init(ACaption: String = '');
-
 
267
    destructor Done;
-
 
268
    procedure Write(Message: ShortString);
-
 
269
    property Cursor: TTermKursor read FCursor;