- Timestamp:
- May 9, 2015, 12:00:33 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Apps/UClock.pas
r6 r7 24 24 var 25 25 Message: TIPCMessage; 26 WindowId: Integer; 26 27 begin 27 28 Message := TIPCMessage.Create; 29 WindowId := API.WindowCreate; 30 API.WindowSetAttr(300, 200, True); 28 31 while not Task.Terminated do begin 29 32 API.WriteText('test'); 33 API.DrawText(Point(10, 10), 'Text'); 34 API.DrawLine(Point(20, 20), Point(100, 100)); 30 35 API.Sleep(OneSecond); 31 36 //API.ReadMessage(Message); -
trunk/ChronOS.lpi
r6 r7 71 71 </Item1> 72 72 </RequiredPackages> 73 <Units Count="1 4">73 <Units Count="15"> 74 74 <Unit0> 75 75 <Filename Value="ChronOS.lpr"/> … … 85 85 </Unit1> 86 86 <Unit2> 87 <Filename Value=" UKernel.pas"/>87 <Filename Value="System/UKernel.pas"/> 88 88 <IsPartOfProject Value="True"/> 89 89 <UnitName Value="UKernel"/> … … 105 105 </Unit5> 106 106 <Unit6> 107 <Filename Value=" UAPI.pas"/>107 <Filename Value="System/UAPI.pas"/> 108 108 <IsPartOfProject Value="True"/> 109 109 <UnitName Value="UAPI"/> … … 120 120 </Unit8> 121 121 <Unit9> 122 <Filename Value=" UApp.pas"/>122 <Filename Value="System/UApp.pas"/> 123 123 <IsPartOfProject Value="True"/> 124 124 <UnitName Value="UApp"/> … … 138 138 <IsPartOfProject Value="True"/> 139 139 <ComponentName Value="FormTerminal"/> 140 <HasResources Value="True"/> 140 141 <ResourceBaseClass Value="Form"/> 141 142 <UnitName Value="UFormTerminal"/> … … 146 147 <UnitName Value="UClasses"/> 147 148 </Unit13> 149 <Unit14> 150 <Filename Value="System/UGraphics.pas"/> 151 <IsPartOfProject Value="True"/> 152 <UnitName Value="UGraphics"/> 153 </Unit14> 148 154 </Units> 149 155 </ProjectOptions> … … 155 161 <SearchPaths> 156 162 <IncludeFiles Value="$(ProjOutDir)"/> 157 <OtherUnitFiles Value="Apps;Platform/Base;Forms "/>163 <OtherUnitFiles Value="Apps;Platform/Base;Forms;System"/> 158 164 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 159 165 </SearchPaths> -
trunk/ChronOS.lpr
r6 r7 10 10 {$ENDIF} 11 11 Interfaces, // this includes the LCL widgetset 12 Forms, SysUtils, UFormMain, UKernel, UFileSystem, UClock, UMemoryManager, UAPI, 13 UPlatformBase, UList, UApp, UThreadEx, UMemory, UFormTerminal, UClasses; 12 Forms, SysUtils, UFormMain, UKernel, UFileSystem, UClock, UMemoryManager, 13 UAPI, UPlatformBase, UList, UApp, UThreadEx, UMemory, UFormTerminal, UClasses, 14 UGraphics; 14 15 15 16 {$R *.res} -
trunk/Forms/UFormMain.lfm
r6 r7 10 10 OnCreate = FormCreate 11 11 OnDestroy = FormDestroy 12 OnKeyDown = FormKeyDown 12 13 OnShow = FormShow 13 LCLVersion = '1. 3'14 LCLVersion = '1.5' 14 15 object PaintBox1: TPaintBox 15 16 Left = 0 … … 19 20 Align = alClient 20 21 OnClick = PaintBox1Click 22 OnResize = PaintBox1Resize 21 23 end 22 24 object MainMenu1: TMainMenu -
trunk/Forms/UFormMain.pas
r6 r7 29 29 procedure FormCreate(Sender: TObject); 30 30 procedure FormDestroy(Sender: TObject); 31 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 31 32 procedure FormShow(Sender: TObject); 32 33 procedure PaintBox1Click(Sender: TObject); 34 procedure PaintBox1Resize(Sender: TObject); 33 35 private 34 36 SerialText: string; 37 OriginalBounds: TRect; 38 OriginalWindowState: TWindowState; 39 ScreenBounds: TRect; 35 40 procedure SerialDeviceReceiveDataSync; 36 41 procedure SerialDeviceReceiveData(Data: TMemory); 42 procedure VideoDeviceRedraw(Sender: TObject); 43 procedure SwitchFullScreen; 37 44 public 38 45 Kernel: TKernel; … … 55 62 NewApp: TApp; 56 63 SerialDevice: TBaseSerialDevice; 57 NewScreen: TScreen;64 VideoDevice: TBaseVideoDevice; 58 65 begin 59 66 Kernel := TKernel.Create; … … 62 69 SerialDevice := TBaseSerialDevice.Create; 63 70 SerialDevice.Name := 'Serial0'; 71 SerialDevice.ClassName := 'Serial port'; 64 72 SerialDevice.OnReceiveData := SerialDeviceReceiveData; 65 73 Kernel.Devices.Add(SerialDevice); 74 75 VideoDevice := TBaseVideoDevice.Create; 76 VideoDevice.Name := 'Video0'; 77 VideoDevice.ClassName := 'Graphic card'; 78 VideoDevice.OnRedraw := VideoDeviceRedraw; 79 VideoDevice.DPI := Screen.PixelsPerInch; 80 VideoDevice.VideoMemorySize := Point(PaintBox1.Width, PaintBox1.Height);; 81 Kernel.Devices.Add(VideoDevice); 82 66 83 NewApp := TAppClock.Create; 67 84 Kernel.Apps.Add(NewApp); 68 NewScreen := TScreen.Create;69 NewScreen.Size := Point(PaintBox1.Width, PaintBox1.Height);70 NewScreen.DPI := Screen.PixelsPerInch;71 Kernel.Screens.Add(NewScreen);72 85 end; 73 86 … … 79 92 procedure TFormMain.AFullscreenExecute(Sender: TObject); 80 93 begin 81 94 SwitchFullScreen; 95 { AFullscreen.Checked := not AFullscreen.Checked; 96 if AFullscreen.Checked then begin 97 WindowState := wsFullScreen; 98 BorderStyle := bsNone; 99 end else begin 100 BorderStyle := bsSingle; 101 WindowState := wsNormal; 102 end; 103 } 82 104 end; 83 105 … … 87 109 end; 88 110 111 procedure TFormMain.SwitchFullScreen; 112 begin 113 if WindowState <> wsFullScreen then begin 114 // To full screen 115 OriginalWindowState := WindowState; 116 OriginalBounds := BoundsRect; 117 118 WindowState := wsFullScreen; 119 end else begin 120 // From full screen 121 WindowState := OriginalWindowState; 122 BoundsRect := OriginalBounds; 123 {$IFDEF MSWINDOWS} 124 BorderStyle := bsSizeable; 125 {$ENDIF} 126 if OriginalWindowState = wsMaximized then 127 WindowState := wsMaximized 128 else 129 with OriginalBounds do 130 SetBounds(Left, Top, Right - Left, Bottom - Top) ; 131 {$IFDEF LINUX} 132 BorderStyle := bsSizeable; 133 {$ENDIF} 134 end; 135 end; 136 89 137 procedure TFormMain.FormDestroy(Sender: TObject); 90 138 begin 91 139 Kernel.Free; 140 end; 141 142 procedure TFormMain.FormKeyDown(Sender: TObject; var Key: Word; 143 Shift: TShiftState); 144 begin 145 92 146 end; 93 147 … … 100 154 begin 101 155 156 end; 157 158 procedure TFormMain.PaintBox1Resize(Sender: TObject); 159 begin 102 160 end; 103 161 … … 114 172 end; 115 173 174 procedure TFormMain.VideoDeviceRedraw(Sender: TObject); 175 begin 176 177 end; 178 116 179 end. 117 180 -
trunk/Forms/UFormTerminal.lfm
r6 r7 1 1 object FormTerminal: TFormTerminal 2 Left = 3272 Left = 590 3 3 Height = 240 4 Top = 344 Top = 496 5 5 Width = 320 6 6 Caption = 'FormTerminal' 7 7 ClientHeight = 240 8 8 ClientWidth = 320 9 LCLVersion = '1. 3'9 LCLVersion = '1.5' 10 10 object Memo1: TMemo 11 11 Left = 0 -
trunk/Platform/Base/UPlatformBase.pas
r6 r7 57 57 end; 58 58 59 { TBaseVideoDevice } 60 61 TBaseVideoDevice = class(TDevice) 62 private 63 FOnRedraw: TNotifyEvent; 64 public 65 VideoMemory: PByte; 66 VideoMemorySize: TPoint; 67 DPI: Integer; 68 constructor Create; override; 69 destructor Destroy; override; 70 procedure Service(Index: Integer; DataIn, DataOut: TMemory); override; 71 property OnRedraw: TNotifyEvent read FOnRedraw write FOnRedraw; 72 end; 73 59 74 implementation 75 76 { TBaseVideoDevice } 77 78 constructor TBaseVideoDevice.Create; 79 begin 80 inherited Create; 81 end; 82 83 destructor TBaseVideoDevice.Destroy; 84 begin 85 inherited Destroy; 86 end; 87 88 procedure TBaseVideoDevice.Service(Index: Integer; DataIn, DataOut: TMemory); 89 begin 90 if Index = 0 then begin 91 // Redraw to screen 92 if Assigned(FOnRedraw) then 93 FOnRedraw(Self); 94 end else 95 if Index = 1 then begin 96 // Get video memory 97 VideoMemory := GetMem(VideoMemorySize.X * VideoMemorySize.Y * 4); 98 // DataOut^ := VideoMemory; 99 // DataOut^ := VideoMemory; 100 end else inherited; 101 end; 60 102 61 103 { TBaseSerialDevice } … … 76 118 procedure TBaseSerialDevice.Service(Index: Integer; DataIn, DataOut: TMemory); 77 119 begin 78 inherited Service(Index, DataIn, DataOut);79 120 if Index = 0 then begin 80 121 Lock.Acquire; … … 82 123 FOnReceiveData(DataIn); 83 124 Lock.Release; 84 end else raise Exception.Create('Unsupported service ' + IntToStr(Index) + ' for driver ''' + Name + '''');125 end else inherited; 85 126 end; 86 127
Note:
See TracChangeset
for help on using the changeset viewer.