home *** CD-ROM | disk | FTP | other *** search
- UNIT Kernel;
-
- (*****************************************************************************
- Name: KERNEL.PAS
- Version: 2.10
- Edit Datum: 1.4.92
- Autor: Frank Seidinger
- Kurzbeschreibung: deLite-Kernel (Ini-File, VDI, Maus, Timer, Events)
- *****************************************************************************)
-
- {$G- keine 286-Instruktionen }
-
- INTERFACE
-
- CONST deLiteVersion : WORD = $0210; { Die deLite Versionsnummer }
- VDIVersion : WORD = $0012; { Die benötigte VDI Versionsnummer }
-
- Debug : BOOLEAN = TRUE; { Die Debug Variable }
-
- DefaultCursor = 0;
- HairCrossCursor = 1;
- HourGlassCursor = 2;
- WhiteArrowCursor = 3;
-
- SingleShot = 1;
- ContinuousShots = 2;
-
- NormalPut = 0;
-
- TextNormal = 0;
- TextUnderline = 1;
-
- SolidLn = $ff; { Vordefinierte Pattern für Linien }
- DottedLn = $cc;
- CenterLn = $be;
- DashedLn = $f0;
-
- PutMode = 0;
- AndMode = 1;
- OrMode = 2;
- XorMode = 3;
-
- DefaultFont = 0; { Der Font im Ini-File wird genommen }
-
- HorizDir = 0; { Ausrichtungen für skalierbaren Text }
- VertDir = 1;
-
- LeftText = 0; { Justierungen für skalierbaren Text }
- CenterText = 1;
- RightText = 2;
- BottomText = 0;
- TopText = 2;
-
- Black = 0; { Die Farben }
- Blue = 1;
- Green = 2;
- Cyan = 3;
- Red = 4;
- Magenta = 5;
- Brown = 6;
- LightGray = 7;
- DarkGray = 8;
- LightBlue = 9;
- LightGreen = 10;
- LightCyan = 11;
- LightRed = 12;
- LightMagenta = 13;
- Yellow = 14;
- White = 15;
-
- MouseMoved = #01; { Die Mausattribute }
- LeftButtonPressed = #02;
- LeftButtonReleased = #04;
- RightButtonPressed = #08;
- RightButtonReleased = #16;
- MiddleButtonPressed = #32;
- MiddleButtonReleased = #64;
-
- NoMouseMove = $0001; { keine Mausbewegungen }
- NoLeftButton = $0006;
- NoRightButton = $0018;
- NoMiddleButton = $0060;
- NoMouseButtons = $007E;
- NoMouseEvents = $FFFF; { keine Mausevents }
- AllEvents = $0000; { alle Events erlaubt }
-
- CAP_HBlit = $0001;
- CAP_VBlit = $0002;
- CAP_GBlit = $0004;
- CAP_WriteMode = $0008;
- CAP_Palette = $0010;
- CAP_HardwareMouse = $0020;
- CAP_ColorDrv = $0040;
- CAP_Sprite = $0080;
- CAP_ColorIcons = $0100; { Die Fähigkeiten der Grafikkarte }
-
- Esc = #27; CR = 'm'; Tab = #105; BSP = #104;
- F1 = #59; F2 = #60; F3 = #61; F4 = #62;
- F5 = #63; F6 = #64; F7 = #65; F8 = #66;
- F9 = #67; F10 = #68; F11 = #133; F12 = #134;
- CtPgUp = #132; CtPgDn = #118;
- CrUp = #72; CrDown = #80; CrLeft = #75; CrRight = #77;
- PgUp = #73; PgDown = #81; { Vordefinierte Tasten }
- CrHome = #71; CrEnd = #79;
-
-
- TYPE BlockIDString = STRING; { Blockidentifier }
- KeyString = STRING; { Schlüsselwort }
- ValueString = STRING; { Wert des Schlüsselwortes }
-
- NameString = STRING[31]; { allgemeiner String }
- HelpString = STRING[60]; { Länge einer Hilfezeile }
-
- ViewPortType = RECORD
- x1, y1, x2, y2 : INTEGER;
- END; { Beschreibt einen ViewPort }
-
- EventTypes = (LeMouse, DoubleClick, MouseUnNormalized,
-
- NormKey, AltKey, CtrlKey, Fkey,
-
- DoRedraw, Terminate, About,
-
- Menu, DialogEvent,
-
- TimerEvent,
-
- UserEvent,
-
- Initialize,
-
- void);
-
- EventTyp = RECORD
- TimeStamp : Word;
- Case Class : EventTypes of
- TimerEvent : (
- ClientID : Integer;
- TimerChannel : Integer;
- );
-
- DialogEvent : (
- ID,MSG : integer;
- DlgAdr : Pointer;
- );
-
- Menu : (MenuitemID : Integer);
-
- LeMouse, DoubleClick, MouseUnNormalized,
- NormKey, AltKey, CtrlKey, FKey,
- DoRedraw, Terminate, About,
- UserEvent, Initialize, Void
- : (
- Attrib : CHAR;
- x,y : INTEGER;
- );
- End; { Case & Record }
-
- TextSettingsType = record
- TheFont : Word;
- TheDirection : Word;
- TheCharSizeX : Word;
- TheCharSizeY : Word;
- TheHoriz : Word;
- TheVert : Word;
- end;
-
- CursorType = Record
- AndMask : Array[0..127] of Byte;
- XorMask : Array[0..127] of Byte;
- HotSpotX : Integer;
- HotSpotY : Integer;
- End;
-
- PCursorType = ^CursorType;
-
- Const OffsetY = 3;
- FrameWidth = 2;
- ChangedColor : Word = 0;
- StackPtr : byte = 1;
-
- Var ProjektName : String[12]; { Der Name der gestarteten Applikation }
-
- FontX, FontY : Byte; { Fontgröße }
-
- APIDlgFrame : Byte; { Rahmen innerhalb von API-Dialogen }
- BackGndCol : Byte; { Bildschirmhintergrund }
- BorderCol : Byte; { Rahmenfarbe }
- DialogBkGnd : Byte; { Hintergrund API-Dialoge }
- DialogStat : Byte; { Statusmeldungen in API-Dialogen }
- DialogText : Byte; { Texte in Edit-Dialogen }
- ErrBkColor : Byte; { Hintergrund von Fehlerfenstern }
- ErrColor : Byte; { Text von Fehlerfenstern }
- FrameColor : Byte; { Rahmen von API-Dialogen }
- HighLColor : Byte; { Highlighted Item im Menü Vordergrund }
- InvColor : Byte; { Highlighted Item im Menü Hintergrund }
- InvItemBkGnd : Byte; { Hintergrund invertiertes Item Listdialog }
- InvItemCol : Byte; { Text invertiertes Item Listdialog }
- ListDlgFG : Byte; { Hintergrund Listdialog }
- ListDlgText : Byte; { Text Listdialog }
- MenueBkGnd : Byte; { Hintergrund Menues }
- MenueColor : Byte; { Vordergrund Menuetexte }
- SysColor : Byte; { Text von Systemfenstern }
- TextDlgFG : Byte; { Hintergrund von Edit-Dialogen }
- DisableText : Byte; { Inaktiver Eintrag im Menu }
- Elevator : Byte; { Der Elevator im Listdialog }
- WinFrame : Byte; { Der Rahmen des aktiven Fensters }
- DlgItemColor : Byte; { Vordergrund Dialogelemente }
- DlgItemBkColor : Byte; { Hintergrund Dialogelemente }
- DlgButtonArea : Byte; { Button-Fläche }
- DlgButtonShadow: Byte; { Button-Schattierung }
- DlgDisableColor: Byte; { inaktive Beschriftung }
- DlgCaptionBar : Byte; { Hintergrund Caption-Bar }
- DlgCaptionText : Byte; { Vordergrund Caption-Bar }
-
- { *********************************************************
- Status und Kontrolle des Kernel
- ********************************************************* }
-
- Function KernelError : Integer; { Liefert Status der letzten
- Kernel Operation }
-
- Procedure DebugOn; { Schaltet den Debug Modus an }
- Procedure DebugOff; { Schaltet den Debug Modus aus }
-
- { *********************************************************
- Allgemeine Dienste
- ********************************************************* }
-
- Procedure UpString(Var TheString: String); { Wandelt in Großbuchstaben }
- Function UpCase(InChar : Char) : Char; { Wandelt in Großbuchstaben }
- Function GetBootPath : String;
- Procedure SetProjectName(TheName : String);
-
- { *********************************************************
- Der Zugriff auf das INI-File
- ********************************************************* }
-
- Function GetParaName(Var Line,OutVal : String) : Boolean;
- Function GetParaString(Var Line,OutVal : String) : Boolean;
- Function GetParaInteger(Var Line : String; Var OutVal : LongInt) : Boolean;
-
- Function GetInitFileName( Block : BlockIDString;
- KeyWord : KeyString;
- Var OutVal : ValueString) : Boolean;
-
- Function GetInitFileString( Block : BlockIDString;
- KeyWord : KeyString;
- Var OutVal : ValueString) : Boolean;
-
- Function GetInitFileInteger( Block : BlockIDString;
- KeyWord : KeyString;
- Var OutVal : LongInt) : Boolean;
-
-
- Procedure SetInitFileName( Block : BlockIDString;
- KeyWord : KeyString;
- NewVal : ValueString);
-
- Procedure SetInitFileString( Block : BlockIDString;
- KeyWord : KeyString;
- NewVal : ValueString);
-
- Procedure SetInitFileInteger( Block : BlockIDString;
- KeyWord : KeyString;
- NewVal : LongInt);
-
-
-
-
- Function GetInitFileListFirst( Block : BlockIDString;
- KeyWord : KeyString;
- Var OutVal : ValueString) : Boolean;
-
- Function GetInitFileListNext( KeyWord : KeyString;
- Var OutVal : ValueString) : Boolean;
-
-
- { *********************************************************
- Dienste des Grafiktreibers
- ********************************************************* }
-
- FUNCTION TestSize : WORD;
-
- Function InitGraphDriver : Boolean;
- Function InitFont : Boolean;
- Function GetDriverName : String;
- Procedure CloseGraphDriver;
-
- Function GetMaxX : Integer;
- Function GetMaxY : Integer;
- Function GetFontX : Byte;
- Function GetFontY : Byte;
-
- Function PortMaxX : Integer;
- Function PortMaxY : Integer;
-
- Function GetMaxColors : Byte;
- Function BitsPerPlane : Byte;
- Function IsMono : Boolean;
-
- Procedure SetBackColor(NewColor : Word);
- Procedure SetPalette(ThePalette,R,B,G : Byte);
- Procedure GetPalette(ThePalette : Byte; Var R,B,G : Byte);
-
- Procedure SetViewPort(x1,y1,x2,y2 : Integer);
- Procedure GetViewSettings(Var TheSet : ViewPortType);
- Procedure ClearViewPort;
-
- Procedure SetLinePattern(ThePattern : Word);
- Function GetLinePattern : Word;
-
- Procedure SetWriteMode(TheMode : Byte);
- Function GetWriteMode : Byte;
-
- Function GetVDICapabilities : Word;
-
- Procedure OutTextAPI(x,y : Integer; InString : String; Color, Attrib : Byte);
- Procedure DrawText(X0,Y0 : Integer; FakX : Integer; FakY : Integer;
- Var Str : String; Color : Byte);
-
- Procedure SetPoint(x,y : Integer; Color : Byte);
- Procedure Line(x1,y1,x2,y2 : Integer; Color : Byte);
- Procedure Rectangle(x1,y1,x2,y2 : Integer; Color : Byte);
- Procedure Bar(x1,y1,x2,y2 : Integer; Color : Byte);
- Procedure Arc(Mx,My : Integer; PhiA,PhiB,Radius : Integer; Color : Byte);
- Procedure Circle(Mx,My : Integer; Radius : Integer; Color : Byte);
-
- Procedure XORLine(x1,y1,x2,y2 : Integer);
- Procedure XORRectangle(x1,y1,x2,y2 : Integer; Thickness : Byte);
- Procedure XORBar(x1,y1,x2,y2 : Integer);
- Procedure XORArc(Mx,My : Integer; PhiA,PhiB,Radius : Integer);
- Procedure XORCircle(Mx,My : Integer; Radius : Integer);
-
-
- Procedure DrawSysIcon(ScrX,ScrY : Integer; Nr,Attrib : Byte);
- Procedure DrawNormIcon(ScrX,ScrY : Integer; Dx,Dy : Integer;
- Typ,Color : Byte; Storage : Pointer);
-
- Function ImageSize(x1,y1,x2,y2 : Integer) : LongInt;
- Procedure SaveImage(x1,y1,x2,y2 : Integer; Buffer : Pointer);
- Procedure RestoreImage(x,y : Integer; Buffer : Pointer; Put : Word);
-
- Procedure BitBlit(x1,y1,x2,y2,DeltaX,DeltaY : Integer);
-
- { *********************************************************
- GRAPH.TPU Kompatibilität
- ********************************************************* }
-
- Procedure SetTextStyle(Font, Direction: Word; CharSize : Word);
- Procedure SetTextJustify(Horiz, Vert: Word);
-
- Procedure SetTextDirection(Dir: Word);
- Procedure SetTextHeight(CharSize : Word);
- Procedure SetTextUserScale(CharSizeX, CharSizeY : Word);
-
- Procedure GetTextSettings(Var Textinfo: TextSettingsType);
- Function GetTextLength(Var Str : String) : Integer;
-
- Procedure OutText(Str : String);
- Procedure OutTextXY(X, Y : Integer; Str : String);
-
- Procedure MoveTo(X,Y : Integer);
- Procedure LineTo(X,Y : Integer);
- Procedure MoveRel(X,Y : Integer);
- Procedure LineRel(X,Y : Integer);
-
- Function GetColor : Byte;
- Procedure SetColor(DieFarbe : Byte);
-
- Function GetX : Integer;
- Function GetY : Integer;
-
- { *********************************************************
- Zugriff auf den Vektor Font für eigene Anwendungen
- ********************************************************* }
-
- Procedure GetFirstFontVek(TheChar : Char; Var VekX, VekY : Integer;
- Var PenDown : Boolean;
- Var Eol : Boolean);
-
- Procedure GetNextFontVek(Var VekX, VekY : Integer;
- Var PenDown : Boolean;
- Var Eol : Boolean);
-
- Function GetFontPitch(TheChar : Char) : Integer;
-
- { *********************************************************
- Mausroutinen
- ********************************************************* }
-
- Procedure HideMouse; { Mouse für Menueaufbau verstecken }
- Procedure ShowMouse; { Danach wieder angezeigt }
- Procedure SetMousePos(x,y : Integer); { Setzt Mouse auf Pos. X,Y }
- Procedure SetMouseRange
- (x1,y1,x2,y2 : Integer); { Mausfenstergröße }
- Procedure SetCursor(TheCursor : PCursorType); { Setzt neuen Mauszeiger }
- Function GetCursor : PCursorType; { Liefert den aktuellen Mauszeiger }
- Function LoadCursor(CursorID : Integer) : PCursorType;
- { Liefert einen System Mauszeiger }
-
- { *********************************************************
- Die Event Schlange
- ********************************************************* }
-
- PROCEDURE FlushQueue; { Verwirft alle Einträge }
- PROCEDURE WaitConfirm; { Wartet auf eine Aktione }
-
- Procedure PermitEvent(PermitMask : Word); { Sperrt Mouse Events }
- Procedure UnPermitEvent; { Erlaubt Mouse Events }
- Function GetPermitMask: Word; { liefert Permit-Maske }
-
- Procedure PutEvent(Var Event : EventTyp); { Stellt ein Event in die Queue }
- PROCEDURE GetEvent(VAR Event : EventTyp); { Gibt nächstes Event }
-
- { *********************************************************
- Die System Timer
- ********************************************************* }
-
- Function GetTimerVal : Word;
- Function SetTimer(ClientId : Integer; Mode, MiliSecs : Word) : Integer;
- Procedure StopTimer(ClientID, TimerChannel : Integer);
-
- { ********************************************************* }
-
- IMPLEMENTATION
-
- END.