2021-05-23 11:43:28 +02:00
|
|
|
(*
|
2023-03-05 22:40:21 +01:00
|
|
|
Copyright 2021-2023 Anton Krotov
|
2021-05-23 11:43:28 +02:00
|
|
|
|
|
|
|
This file is part of CEdit.
|
|
|
|
|
|
|
|
CEdit is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
CEdit is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with CEdit. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*)
|
|
|
|
|
|
|
|
MODULE KolibriOS;
|
|
|
|
|
|
|
|
IMPORT
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI, SYSTEM, U := Utils;
|
2021-05-23 11:43:28 +02:00
|
|
|
|
|
|
|
CONST
|
2023-03-05 22:40:21 +01:00
|
|
|
fontWidth* = 8;
|
|
|
|
fontHeight* = 16;
|
2021-05-23 11:43:28 +02:00
|
|
|
|
2021-06-05 17:18:11 +02:00
|
|
|
VAR
|
|
|
|
|
2022-01-12 22:15:22 +01:00
|
|
|
colors*: RECORD
|
|
|
|
rsrvd,
|
|
|
|
taskbar,
|
|
|
|
dark*,
|
|
|
|
light*,
|
|
|
|
window_title*,
|
|
|
|
work*,
|
|
|
|
button*,
|
|
|
|
button_text*,
|
|
|
|
work_text*,
|
|
|
|
line*: INTEGER
|
|
|
|
END;
|
2021-05-23 11:43:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE CreateWindow* (x, y, w, h, color, style, hcolor, hstyle: INTEGER; htext: ARRAY OF CHAR);
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc6(0, x*65536 + w, y*65536 + h, color + LSL(style, 24), hcolor + LSL(hstyle, 24), SYSTEM.ADR(htext[0]))
|
2021-05-23 11:43:28 +02:00
|
|
|
END CreateWindow;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE BeginDraw*;
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc2(12, 1)
|
2021-05-23 11:43:28 +02:00
|
|
|
END BeginDraw;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE EndDraw*;
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc2(12, 2)
|
2021-05-23 11:43:28 +02:00
|
|
|
END EndDraw;
|
|
|
|
|
|
|
|
|
2021-12-20 20:09:01 +01:00
|
|
|
PROCEDURE EventTimeout* (t: INTEGER): INTEGER;
|
2023-03-05 22:40:21 +01:00
|
|
|
RETURN KOSAPI.sysfunc2(23, t)
|
2021-12-20 20:09:01 +01:00
|
|
|
END EventTimeout;
|
2021-05-23 11:43:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE ThreadInfo (offsa, offsb: INTEGER; VAR a, b: INTEGER);
|
|
|
|
VAR
|
2023-03-05 22:40:21 +01:00
|
|
|
buffer: ARRAY 1024 OF BYTE;
|
2021-05-23 11:43:28 +02:00
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc3(9, SYSTEM.ADR(buffer[0]), -1);
|
|
|
|
SYSTEM.GET32(SYSTEM.ADR(buffer[0]) + offsa, a);
|
|
|
|
SYSTEM.GET32(SYSTEM.ADR(buffer[0]) + offsb, b);
|
2021-05-23 11:43:28 +02:00
|
|
|
END ThreadInfo;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE WinSize* (VAR width, height: INTEGER);
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
ThreadInfo(42, 46, width, height)
|
2021-05-23 11:43:28 +02:00
|
|
|
END WinSize;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE WinPos* (VAR x, y: INTEGER);
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
ThreadInfo(34, 38, x, y)
|
2021-05-23 11:43:28 +02:00
|
|
|
END WinPos;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE ClientSize* (VAR width, height: INTEGER);
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
ThreadInfo(62, 66, width, height)
|
2021-05-23 11:43:28 +02:00
|
|
|
END ClientSize;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE ClientPos* (VAR x, y: INTEGER);
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
ThreadInfo(54, 58, x, y)
|
2021-05-23 11:43:28 +02:00
|
|
|
END ClientPos;
|
|
|
|
|
|
|
|
|
2021-06-06 12:04:05 +02:00
|
|
|
PROCEDURE ScreenSize* (VAR width, height: INTEGER);
|
|
|
|
VAR
|
2023-03-05 22:40:21 +01:00
|
|
|
eax, ebx: INTEGER;
|
|
|
|
right, left, top, bottom: INTEGER;
|
|
|
|
BEGIN
|
|
|
|
eax := KOSAPI.sysfunc22(48, 5, ebx);
|
|
|
|
left := LSR(eax, 16);
|
|
|
|
right := eax MOD 65536;
|
|
|
|
top := LSR(ebx, 16);
|
|
|
|
bottom := ebx MOD 65536;
|
|
|
|
width := right - left + 1;
|
|
|
|
height := bottom - top + 1
|
2021-06-06 12:04:05 +02:00
|
|
|
END ScreenSize;
|
|
|
|
|
|
|
|
|
2021-05-23 11:43:28 +02:00
|
|
|
PROCEDURE ThreadID* (): INTEGER;
|
|
|
|
VAR
|
2023-03-05 22:40:21 +01:00
|
|
|
id: INTEGER;
|
2021-05-23 11:43:28 +02:00
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
ThreadInfo(30, 30, id, id)
|
|
|
|
RETURN id
|
2021-05-23 11:43:28 +02:00
|
|
|
END ThreadID;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE RolledUp* (): BOOLEAN;
|
|
|
|
VAR
|
2023-03-05 22:40:21 +01:00
|
|
|
buffer: ARRAY 1024 OF BYTE;
|
2021-05-23 11:43:28 +02:00
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc3(9, SYSTEM.ADR(buffer[0]), -1)
|
|
|
|
RETURN ODD(LSR(buffer[70], 2))
|
2021-05-23 11:43:28 +02:00
|
|
|
END RolledUp;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE SetWinSize* (width, height: INTEGER);
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc5(67, -1, -1, width, height)
|
2021-05-23 11:43:28 +02:00
|
|
|
END SetWinSize;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE DrawText* (x, y, color: INTEGER; text: ARRAY OF WCHAR);
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc6(4, x*65536 + y, color + LSL(0A0H, 24), SYSTEM.ADR(text[0]), 0, 0)
|
2021-05-23 11:43:28 +02:00
|
|
|
END DrawText;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE DrawText69* (x, y, color: INTEGER; text: ARRAY OF CHAR);
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc6(4, x*65536 + y, color + LSL(080H, 24), SYSTEM.ADR(text[0]), 0, 0)
|
2021-05-23 11:43:28 +02:00
|
|
|
END DrawText69;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE DrawText866* (x, y, color: INTEGER; text: ARRAY OF CHAR);
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc6(4, x*65536 + y, color + LSL(0D0H, 24), SYSTEM.ADR(text[0]), 0, colors.work)
|
2021-05-23 11:43:28 +02:00
|
|
|
END DrawText866;
|
|
|
|
|
|
|
|
|
2021-07-11 01:39:41 +02:00
|
|
|
PROCEDURE DrawText866bk* (x, y, color, bkColor: INTEGER; text: ARRAY OF CHAR);
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc6(4, x*65536 + y, color + LSL(0D0H, 24), SYSTEM.ADR(text[0]), 0, bkColor)
|
2021-07-11 01:39:41 +02:00
|
|
|
END DrawText866bk;
|
|
|
|
|
|
|
|
|
2021-05-23 11:43:28 +02:00
|
|
|
PROCEDURE MousePos* (VAR x, y: INTEGER);
|
|
|
|
VAR
|
2023-03-05 22:40:21 +01:00
|
|
|
res: INTEGER;
|
2021-05-23 11:43:28 +02:00
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
res := KOSAPI.sysfunc2(37, 0);
|
|
|
|
y := res MOD 65536;
|
|
|
|
x := res DIV 65536
|
2021-05-23 11:43:28 +02:00
|
|
|
END MousePos;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE CreateButton* (id, Left, Top, Width, Height, Color: INTEGER; Caption: ARRAY OF WCHAR);
|
|
|
|
VAR
|
2023-03-05 22:40:21 +01:00
|
|
|
x, y: INTEGER;
|
2021-05-23 11:43:28 +02:00
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc5(8, LSL(Left, 16) + Width, LSL(Top, 16) + Height, id, Color);
|
|
|
|
x := Left + (Width - fontWidth * LENGTH(Caption)) DIV 2;
|
|
|
|
y := Top + (Height - fontHeight) DIV 2 + 1;
|
|
|
|
DrawText(x, y, colors.button_text, Caption)
|
2021-05-23 11:43:28 +02:00
|
|
|
END CreateButton;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE DeleteButton* (id: INTEGER);
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc5(8, 0, 0, id + 80000000H, 0)
|
2021-05-23 11:43:28 +02:00
|
|
|
END DeleteButton;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE GetTickCount* (): INTEGER;
|
2023-03-05 22:40:21 +01:00
|
|
|
RETURN KOSAPI.sysfunc2(26, 9)
|
2021-05-23 11:43:28 +02:00
|
|
|
END GetTickCount;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE Pause* (time: INTEGER);
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc2(5, time)
|
2021-05-23 11:43:28 +02:00
|
|
|
END Pause;
|
|
|
|
|
|
|
|
|
2021-07-13 12:30:43 +02:00
|
|
|
PROCEDURE ButtonCode* (VAR middle: BOOLEAN): INTEGER;
|
2021-05-23 11:43:28 +02:00
|
|
|
VAR
|
2023-03-05 22:40:21 +01:00
|
|
|
res: INTEGER;
|
|
|
|
BEGIN
|
|
|
|
middle := FALSE;
|
|
|
|
res := KOSAPI.sysfunc1(17);
|
|
|
|
IF res MOD 256 = 0 THEN
|
|
|
|
res := LSR(res, 8)
|
|
|
|
ELSIF res MOD 256 = 4 THEN
|
|
|
|
res := LSR(res, 8);
|
|
|
|
middle := TRUE
|
|
|
|
ELSE
|
|
|
|
res := 0
|
|
|
|
END
|
|
|
|
RETURN res
|
2021-05-23 11:43:28 +02:00
|
|
|
END ButtonCode;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE Exit*;
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc1(-1)
|
2021-05-23 11:43:28 +02:00
|
|
|
END Exit;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE ExitID* (tid: INTEGER);
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc3(18, 18, tid)
|
2021-05-23 11:43:28 +02:00
|
|
|
END ExitID;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE CreateThread* (proc: INTEGER; stack: ARRAY OF INTEGER): INTEGER;
|
2021-10-03 19:44:42 +02:00
|
|
|
VAR
|
|
|
|
tid: INTEGER;
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
tid := KOSAPI.sysfunc4(51, 1, proc, SYSTEM.ADR(stack[LEN(stack) - 2]));
|
|
|
|
IF tid = -1 THEN
|
|
|
|
tid := 0
|
|
|
|
END
|
|
|
|
RETURN tid
|
2021-05-23 11:43:28 +02:00
|
|
|
END CreateThread;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE Run* (program, param: ARRAY OF CHAR);
|
|
|
|
TYPE
|
|
|
|
|
2023-03-05 22:40:21 +01:00
|
|
|
info_struct = RECORD
|
|
|
|
subfunc : INTEGER;
|
|
|
|
flags : INTEGER;
|
|
|
|
param : INTEGER;
|
|
|
|
rsrvd1 : INTEGER;
|
|
|
|
rsrvd2 : INTEGER;
|
|
|
|
fname : ARRAY 1024 OF CHAR
|
|
|
|
END;
|
2021-05-23 11:43:28 +02:00
|
|
|
|
|
|
|
VAR
|
2023-03-05 22:40:21 +01:00
|
|
|
info: info_struct;
|
2021-05-23 11:43:28 +02:00
|
|
|
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
info.subfunc := 7;
|
|
|
|
info.flags := 0;
|
|
|
|
info.param := SYSTEM.ADR(param[0]);
|
|
|
|
info.rsrvd1 := 0;
|
|
|
|
info.rsrvd2 := 0;
|
|
|
|
COPY(program, info.fname);
|
|
|
|
KOSAPI.sysfunc2(70, SYSTEM.ADR(info))
|
2021-05-23 11:43:28 +02:00
|
|
|
END Run;
|
|
|
|
|
|
|
|
|
2022-01-13 16:13:47 +01:00
|
|
|
PROCEDURE SetCurFolder* (folder: ARRAY OF CHAR);
|
|
|
|
BEGIN
|
|
|
|
KOSAPI.sysfunc3(30, 1, SYSTEM.ADR(folder[0]));
|
|
|
|
END SetCurFolder;
|
|
|
|
|
|
|
|
|
2021-05-23 11:43:28 +02:00
|
|
|
PROCEDURE DrawRect* (x, y, width, height, color: INTEGER);
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc4(13, x*65536 + width, y*65536 + height, color)
|
2021-05-23 11:43:28 +02:00
|
|
|
END DrawRect;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE DrawLine* (x1, y1, x2, y2: INTEGER; color: INTEGER);
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc4(38, x1*65536 + x2, y1*65536 + y2, color)
|
2021-05-23 11:43:28 +02:00
|
|
|
END DrawLine;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE DrawImage* (data, sizeX, sizeY, x, y: INTEGER);
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc4(7, data, sizeX*65536 + sizeY, x*65536 + y)
|
2021-05-23 11:43:28 +02:00
|
|
|
END DrawImage;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE SetEventsMask* (mask: SET);
|
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc2(40, ORD(mask))
|
2021-05-23 11:43:28 +02:00
|
|
|
END SetEventsMask;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE SkinHeight* (): INTEGER;
|
2023-03-05 22:40:21 +01:00
|
|
|
RETURN KOSAPI.sysfunc2(48, 4)
|
2021-05-23 11:43:28 +02:00
|
|
|
END SkinHeight;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE GetKey* (): INTEGER;
|
2023-03-05 22:40:21 +01:00
|
|
|
RETURN KOSAPI.sysfunc1(2)
|
2021-05-23 11:43:28 +02:00
|
|
|
END GetKey;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE MouseState* (): SET;
|
2023-03-05 22:40:21 +01:00
|
|
|
RETURN BITS(KOSAPI.sysfunc2(37, 3))
|
2021-05-23 11:43:28 +02:00
|
|
|
END MouseState;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE Scroll* (): INTEGER;
|
2023-03-05 22:40:21 +01:00
|
|
|
RETURN ASR(LSL(KOSAPI.sysfunc2(37, 7), 16), 16)
|
2021-05-23 11:43:28 +02:00
|
|
|
END Scroll;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE GetControlKeys* (): SET;
|
2023-03-05 22:40:21 +01:00
|
|
|
RETURN BITS(KOSAPI.sysfunc2(66, 3))
|
2021-05-23 11:43:28 +02:00
|
|
|
END GetControlKeys;
|
|
|
|
|
|
|
|
|
2021-06-05 17:18:11 +02:00
|
|
|
PROCEDURE GetSystemColors*;
|
2022-01-12 22:15:22 +01:00
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
KOSAPI.sysfunc4(48, 3, SYSTEM.ADR(colors), 40)
|
2021-06-05 17:18:11 +02:00
|
|
|
END GetSystemColors;
|
|
|
|
|
|
|
|
|
2021-09-11 22:57:43 +02:00
|
|
|
PROCEDURE getKBState* (VAR shift, ctrl: BOOLEAN);
|
|
|
|
VAR
|
2023-03-05 22:40:21 +01:00
|
|
|
kbState: SET;
|
2021-09-11 22:57:43 +02:00
|
|
|
BEGIN
|
2023-03-05 22:40:21 +01:00
|
|
|
kbState := GetControlKeys();
|
|
|
|
shift := {0, 1} * kbState # {};
|
|
|
|
ctrl := {2, 3} * kbState # {};
|
2021-09-11 22:57:43 +02:00
|
|
|
END getKBState;
|
|
|
|
|
|
|
|
|
2021-09-28 18:15:37 +02:00
|
|
|
PROCEDURE mouse* (VAR msState: SET; VAR x, y: INTEGER);
|
|
|
|
VAR
|
2023-03-05 22:40:21 +01:00
|
|
|
mouseX, mouseY,
|
|
|
|
cliX, cliY,
|
|
|
|
winX, winY: INTEGER;
|
2021-09-28 18:15:37 +02:00
|
|
|
BEGIN
|
|
|
|
msState := MouseState();
|
2023-03-05 22:40:21 +01:00
|
|
|
MousePos(mouseX, mouseY);
|
|
|
|
WinPos(winX, winY);
|
|
|
|
ClientPos(cliX, cliY);
|
|
|
|
x := mouseX - winX - cliX;
|
|
|
|
y := mouseY - winY - cliY
|
2021-09-28 18:15:37 +02:00
|
|
|
END mouse;
|
|
|
|
|
|
|
|
|
2021-10-03 19:44:42 +02:00
|
|
|
PROCEDURE SetCaption* (text: ARRAY OF CHAR);
|
|
|
|
BEGIN
|
|
|
|
KOSAPI.sysfunc4(71, 2, SYSTEM.ADR(text[0]), 0)
|
|
|
|
END SetCaption;
|
|
|
|
|
|
|
|
|
2021-12-20 20:09:01 +01:00
|
|
|
PROCEDURE CBCount* (): INTEGER;
|
|
|
|
RETURN KOSAPI.sysfunc2(54, 0)
|
|
|
|
END CBCount;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE CBRead* (slot: INTEGER): INTEGER;
|
|
|
|
RETURN KOSAPI.sysfunc3(54, 1, slot)
|
|
|
|
END CBRead;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE CBWrite* (size, ptr: INTEGER);
|
|
|
|
BEGIN
|
|
|
|
KOSAPI.sysfunc4(54, 2, size, ptr)
|
|
|
|
END CBWrite;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE CBDelSlot*;
|
|
|
|
BEGIN
|
|
|
|
KOSAPI.sysfunc2(54, 3)
|
|
|
|
END CBDelSlot;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE GetThreadSlot* (tid: INTEGER): INTEGER;
|
|
|
|
RETURN KOSAPI.sysfunc3(18, 21, tid)
|
|
|
|
END GetThreadSlot;
|
|
|
|
|
|
|
|
|
2021-12-29 16:38:29 +01:00
|
|
|
PROCEDURE PutPixel* (x, y, color: INTEGER);
|
|
|
|
BEGIN
|
|
|
|
KOSAPI.sysfunc5(1, x, y, color, 0)
|
|
|
|
END PutPixel;
|
|
|
|
|
|
|
|
|
2022-02-25 15:34:18 +01:00
|
|
|
PROCEDURE SetIPC* (buffer: ARRAY OF INTEGER);
|
|
|
|
BEGIN
|
|
|
|
KOSAPI.sysfunc4(60, 1, SYSTEM.ADR(buffer[0]), LEN(buffer)*SYSTEM.SIZE(INTEGER))
|
|
|
|
END SetIPC;
|
|
|
|
|
|
|
|
|
|
|
|
PROCEDURE SendIPC* (pid, ptr, size: INTEGER);
|
|
|
|
BEGIN
|
|
|
|
KOSAPI.sysfunc5(60, 2, pid, ptr, size)
|
|
|
|
END SendIPC;
|
|
|
|
|
|
|
|
|
2022-02-08 22:57:18 +01:00
|
|
|
PROCEDURE docpack* (VAR param: ARRAY OF CHAR; VAR text_ptr, text_size: INTEGER);
|
|
|
|
VAR
|
|
|
|
i, size, ptr, ptr2: INTEGER;
|
|
|
|
s: ARRAY 32 OF WCHAR;
|
|
|
|
BEGIN
|
|
|
|
ptr2 := 0;
|
|
|
|
U.reverse8(param);
|
|
|
|
param[LENGTH(param) - 1] := 0X;
|
|
|
|
U.reverse8(param);
|
|
|
|
i := 0;
|
|
|
|
WHILE param[i] # 0X DO
|
|
|
|
s[i] := WCHR(ORD(param[i]));
|
|
|
|
INC(i)
|
|
|
|
END;
|
|
|
|
IF U.str2int(s, size) THEN
|
|
|
|
INC(size, 20);
|
|
|
|
ptr := KOSAPI.malloc(size);
|
|
|
|
IF ptr # 0 THEN
|
|
|
|
SYSTEM.PUT32(ptr, 0);
|
|
|
|
SYSTEM.PUT32(ptr + 4, 8);
|
|
|
|
KOSAPI.sysfunc4(60, 1, ptr, size);
|
|
|
|
SetEventsMask({6});
|
|
|
|
IF EventTimeout(200) = 7 THEN
|
|
|
|
SYSTEM.PUT32(ptr, 1);
|
|
|
|
SYSTEM.GET(ptr + 12, size);
|
|
|
|
ptr2 := KOSAPI.malloc(size);
|
|
|
|
IF ptr2 # 0 THEN
|
|
|
|
SYSTEM.MOVE(ptr + 16, ptr2, size)
|
2023-03-05 22:40:21 +01:00
|
|
|
END
|
2022-02-08 22:57:18 +01:00
|
|
|
END;
|
|
|
|
ptr := KOSAPI.free(ptr)
|
|
|
|
END
|
|
|
|
END;
|
|
|
|
text_ptr := ptr2;
|
|
|
|
text_size := size
|
|
|
|
END docpack;
|
|
|
|
|
|
|
|
|
2022-01-12 22:15:22 +01:00
|
|
|
BEGIN
|
|
|
|
GetSystemColors
|
2021-05-23 11:43:28 +02:00
|
|
|
END KolibriOS.
|