Changeset 5
- Timestamp:
- Jun 2, 2013, 2:34:55 PM (12 years ago)
- Location:
- os/trunk
- Files:
-
- 2 added
- 12 edited
- 6 moved
Legend:
- Unmodified
- Added
- Removed
-
os/trunk
- Property svn:ignore
-
old new 1 1 Win32 2 2 *.~dsk 3 __history
-
- Property svn:ignore
-
os/trunk/Applications/TestApplication.pas
r3 r5 20 20 21 21 uses 22 Xvcl.Kernel;22 LDOS.Kernel; 23 23 24 24 { TTestApplication } … … 32 32 procedure TTestApplication.Run; 33 33 begin 34 Caption := 'TestApp'; 34 35 Form1 := TForm.Create; 35 36 Form1.Bounds := TRectangle.Create(50, 80, 200, 120); -
os/trunk/Drivers/Driver.KeyboardVCL.pas
r3 r5 4 4 5 5 uses 6 Vcl.Forms, Vcl.Controls, System.Classes, UFormMain, Xvcl.Classes, Xvcl.Kernel;6 Vcl.Forms, Vcl.Controls, System.Classes, UFormMain, Xvcl.Classes, LDOS.Kernel; 7 7 8 8 type -
os/trunk/Drivers/Driver.MouseVCL.pas
r3 r5 4 4 5 5 uses 6 Vcl.Forms, Vcl.Controls, System.Classes, UFormMain, Xvcl.Classes, Xvcl.Kernel;6 Vcl.Forms, Vcl.Controls, System.Classes, UFormMain, Xvcl.Classes, LDOS.Kernel; 7 7 8 8 type -
os/trunk/Drivers/Driver.SystemVCL.pas
r3 r5 4 4 5 5 uses 6 Vcl.Forms, Xvcl.Kernel;6 Vcl.Forms, LDOS.Kernel; 7 7 8 8 type -
os/trunk/Drivers/Driver.VideoVCL.pas
r3 r5 4 4 5 5 uses 6 Vcl.Forms, Vcl.Graphics, System.Types, UFormMain, Xvcl.Classes, Xvcl.Kernel,6 Vcl.Forms, Vcl.Graphics, System.Types, UFormMain, Xvcl.Classes, LDOS.Kernel, 7 7 Xvcl.Graphics, Generics.Collections; 8 8 … … 36 36 (Image1.Height <> Image1.Picture.Bitmap.Height) then begin 37 37 Image1.Picture.Bitmap.SetSize(Image1.Width, Image1.Height); 38 Kernel.Screen.VideoDevice.Size := TPoint.Create(Form.Width, Form.Height); 39 Kernel.Screen.Size := TPoint.Create(Form.Width, Form.Height); 38 Kernel.Screen.VideoDevice.Size := TPoint.Create(Image1.Picture.Bitmap.Width, Image1.Picture.Bitmap.Height); 39 Kernel.Screen.Size := TPoint.Create(Image1.Picture.Bitmap.Width, Image1.Picture.Bitmap.Height); 40 Kernel.Screen.HandleResize; 40 41 Kernel.Screen.Paint; 41 42 end; … … 111 112 procedure TVideoDeviceVCL.TextOut(Position: TPoint; Text: string); 112 113 begin 114 // CanvasVCL.Font.Color := ColorToVCL( 113 115 CanvasVCL.Brush.Style := bsClear; 114 116 CanvasVCL.TextOut(Position.X, Position.Y, Text); -
os/trunk/System
-
Property svn:ignore
set to
__history
-
Property svn:ignore
set to
-
os/trunk/System/LDOS.Kernel.pas
r3 r5 1 unit Xvcl.Kernel;1 unit LDOS.Kernel; 2 2 3 3 interface … … 17 17 Priority: Integer; 18 18 State: TProcessState; 19 TimerExpire: TDateTime; 20 Application: TApplication; 19 21 procedure Execute; virtual; 22 procedure Terminate; virtual; 23 end; 24 25 TTimer = class 26 end; 27 28 TScheduler = class 29 Kernel: TKernel; 30 procedure Reschedule; 31 constructor Create; 32 destructor Destroy; override; 20 33 end; 21 34 … … 33 46 34 47 TScreen = class(TComponent) 48 private 49 public 50 Kernel: TKernel; 35 51 Canvas: TScreenCanvas; 36 52 Size: TPoint; 37 53 Forms: TList<TForm>; 38 54 VideoDevice: TVideoDevice; 55 procedure HandleResize; 39 56 procedure Paint; 40 57 procedure FocusForm(Form: TForm); … … 57 74 end; 58 75 59 TScheduler = class60 Kernel: TKernel;61 procedure Reschedule;62 end;63 64 76 TKernel = class 65 77 private 66 78 FOnAfterDriverInit: TNotifyEvent; 67 79 FOnTick: TNotifyEvent; 80 procedure HandleTaskList; 68 81 public 82 Timers: TList<TTimer>; 69 83 Processes: TList<TProcess>; 70 84 Drivers: TList<TDriver>; … … 78 92 procedure PowerOff; 79 93 procedure Reboot; 94 function GetProcessId: Integer; 95 procedure RunApplication(App: TApplication); 80 96 constructor Create; 81 97 destructor Destroy; override; … … 99 115 100 116 for App in StartOnBoot do 101 App.Run;117 RunApplication(App); 102 118 103 119 repeat … … 113 129 begin 114 130 Processes := TList<TProcess>.Create; 131 Timers := TList<TTimer>.Create; 115 132 Drivers := TList<TDriver>.Create; 116 133 Screen := TScreen.Create; 134 Screen.Kernel := Self; 117 135 StartOnBoot := TList<TApplication>.Create; 118 136 Scheduler := TScheduler.Create; 137 Scheduler.Kernel := Self; 119 138 Keyboard := TKeyboard.Create; 120 139 Keyboard.Kernel := Self; … … 132 151 Drivers.Destroy; 133 152 Processes.Destroy; 134 inherited; 135 end; 136 153 Timers.Destroy; 154 inherited; 155 end; 156 157 158 function TKernel.GetProcessId: Integer; 159 var 160 I: Integer; 161 begin 162 Result := 1; 163 for I := 0 to Processes.Count - 1 do 164 if Processes[I].Id > Result then Result := Processes[I].Id + 1; 165 end; 137 166 138 167 procedure TKernel.PowerOff; … … 144 173 begin 145 174 175 end; 176 177 procedure TKernel.RunApplication(App: TApplication); 178 var 179 NewProcess: TProcess; 180 I: Integer; 181 begin 182 NewProcess := TProcess.Create; 183 NewProcess.Application := App; 184 NewProcess.Id := GetProcessId; 185 Processes.Add(NewProcess); 186 App.Run; 187 NewProcess.Name := App.Caption; 188 HandleTaskList; 189 end; 190 191 procedure TKernel.HandleTaskList; 192 var 193 Form: TForm; 194 NewMessage: TMessageTaskList; 195 Process: TProcess; 196 begin 197 NewMessage := TMessageTaskList.Create; 198 try 199 for Form in Screen.Forms do 200 Form.HandleMessage(NewMessage); 201 for Process in Processes do 202 Process.Application.HandleMessage(NewMessage); 203 finally 204 NewMessage.Destroy; 205 end; 146 206 end; 147 207 … … 176 236 end; 177 237 238 procedure TScreen.HandleResize; 239 var 240 Form: TForm; 241 NewMessage: TMessageResize; 242 Process: TProcess; 243 begin 244 NewMessage := TMessageResize.Create; 245 try 246 for Form in Kernel.Screen.Forms do 247 Form.HandleMessage(NewMessage); 248 for Process in Kernel.Processes do 249 Process.Application.HandleMessage(NewMessage); 250 finally 251 NewMessage.Destroy; 252 end; 253 end; 254 178 255 procedure TScreen.Paint; 179 256 var … … 199 276 { TScheduler } 200 277 278 constructor TScheduler.Create; 279 begin 280 inherited; 281 end; 282 283 destructor TScheduler.Destroy; 284 begin 285 286 inherited; 287 end; 288 201 289 procedure TScheduler.Reschedule; 202 290 begin … … 218 306 219 307 procedure TProcess.Execute; 308 begin 309 310 end; 311 312 procedure TProcess.Terminate; 220 313 begin 221 314 -
os/trunk/UFormMain.dfm
r3 r5 12 12 Font.Style = [] 13 13 OldCreateOrder = False 14 WindowState = wsMaximized15 14 PixelsPerInch = 96 16 15 TextHeight = 13 -
os/trunk/Xvcl
-
Property svn:ignore
set to
__history
-
Property svn:ignore
set to
-
os/trunk/Xvcl/Xvcl.Controls.pas
r3 r5 24 24 TMessageMouseUp = class(TMessageMouse); 25 25 TMessageMouseMove = class(TMessageMouse); 26 TMessageResize = class(TMessage); 27 TMessageTaskList = class(TMessage); 26 28 27 29 TKeyState = (ksShift, ksAlt, ksOS); … … 186 188 if FColor <> Value then begin 187 189 FColor := Value; 188 Paint;190 if Visible then Paint; 189 191 end; 190 192 end; … … 225 227 if FCaption <> Value then begin 226 228 FCaption := Value; 227 Paint;229 if Visible then Paint; 228 230 end; 229 231 end; -
os/trunk/Xvcl/Xvcl.Forms.pas
r3 r5 7 7 8 8 type 9 TBorderStyle = (bsNormal, bsNone); 10 9 11 TForm = class(TWinControl) 10 12 private 11 13 FFocused: Boolean; 14 FBorderStyle: TBorderStyle; 12 15 procedure SetFocused(const Value: Boolean); 16 procedure SetBorderStyle(const Value: TBorderStyle); 13 17 protected 14 18 function GetVideoDevice: TVideoDevice; override; … … 22 26 procedure Paint; override; 23 27 property Focused: Boolean read FFocused write SetFocused; 28 property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle; 29 end; 30 31 TPanel = class(TWinControl) 32 Caption: string; 33 procedure Paint; override; 24 34 end; 25 35 26 36 TApplication = class(TComponent) 37 protected 38 public 39 Caption: string; 27 40 Screen: TObject; // TScreen; 28 41 Forms: TList<TForm>; 29 42 MainForm: TForm; 43 function HandleMessage(Message: TMessage): Boolean; virtual; 30 44 procedure Run; virtual; 31 45 procedure Terminate; virtual; … … 36 50 37 51 uses 38 Xvcl.Kernel;52 LDOS.Kernel; 39 53 40 54 { TApplication } 55 56 function TApplication.HandleMessage(Message: TMessage): Boolean; 57 begin 58 59 end; 41 60 42 61 procedure TApplication.Run; … … 67 86 TitleBarBounds := TRectangle.Create(0, 0, Bounds.Width, TitleBarHeight); 68 87 Focused := True; 69 if TitleBarBounds.Contains(ScreenToClient(Position)) then begin88 if (BorderStyle = bsNormal) and TitleBarBounds.Contains(ScreenToClient(Position)) then begin 70 89 Move.StartControlPos := Bounds.TopLeft; 71 90 Move.StartMousePos := Position; … … 92 111 inherited; 93 112 with Canvas do begin 94 if Focused then Brush.Color := clLightBlue else 95 Brush.Color := clSilver; 96 FillRect(TRectangle.Create(0, 0, Bounds.Width - 1, TitleBarHeight)); 97 MoveTo(TPoint.Create(0, 0)); 98 LineTo(TPoint.Create(Bounds.Width - 1, 0)); 99 LineTo(TPoint.Create(Bounds.Width - 1, Bounds.Height - 1)); 100 LineTo(TPoint.Create(0, Bounds.Height - 1)); 101 LineTo(TPoint.Create(0, 0)); 102 MoveTo(TPoint.Create(0, TitleBarHeight)); 103 LineTo(TPoint.Create(Bounds.Width - 1, TitleBarHeight)); 104 TextOut(TPoint.Create((Bounds.Width - GetTextSize(Caption).X) div 2, 105 (TitleBarHeight - GetTextSize(Caption).Y) div 2), Caption); 113 if BorderStyle = bsNormal then begin 114 if Focused then Brush.Color := clLightBlue else 115 Brush.Color := clSilver; 116 FillRect(TRectangle.Create(0, 0, Bounds.Width - 1, TitleBarHeight)); 117 MoveTo(TPoint.Create(0, 0)); 118 LineTo(TPoint.Create(Bounds.Width - 1, 0)); 119 LineTo(TPoint.Create(Bounds.Width - 1, Bounds.Height - 1)); 120 LineTo(TPoint.Create(0, Bounds.Height - 1)); 121 LineTo(TPoint.Create(0, 0)); 122 MoveTo(TPoint.Create(0, TitleBarHeight)); 123 LineTo(TPoint.Create(Bounds.Width - 1, TitleBarHeight)); 124 TextOut(TPoint.Create((Bounds.Width - GetTextSize(Caption).X) div 2, 125 (TitleBarHeight - GetTextSize(Caption).Y) div 2), Caption); 126 end; 106 127 end; 128 end; 129 130 procedure TForm.SetBorderStyle(const Value: TBorderStyle); 131 begin 132 FBorderStyle := Value; 107 133 end; 108 134 … … 115 141 end; 116 142 143 { TPanel } 144 145 procedure TPanel.Paint; 146 begin 147 inherited; 148 with Canvas do begin 149 MoveTo(TPoint.Create(0, 0)); 150 LineTo(TPoint.Create(Bounds.Width - 1, 0)); 151 LineTo(TPoint.Create(Bounds.Width - 1, Bounds.Height - 1)); 152 LineTo(TPoint.Create(0, Bounds.Height - 1)); 153 LineTo(TPoint.Create(0, 0)); 154 TextOut(TPoint.Create((Bounds.Width - GetTextSize(Caption).X) div 2, 155 (Bounds.Height - GetTextSize(Caption).Y) div 2), Caption); 156 end; 157 end; 158 117 159 end. -
os/trunk/lddesktop.dpr
r3 r5 4 4 Vcl.Forms, 5 5 UFormMain in 'UFormMain.pas' {Form1}, 6 Xvcl.Controls in 'Xvcl.Controls.pas',7 TestApplication in 'Applications\TestApplication.pas',8 Xvcl.Classes in 'Xvcl.Classes.pas',9 Xvcl.Graphics in 'Xvcl.Graphics.pas',10 Xvcl.Forms in 'Xvcl.Forms.pas',11 Xvcl.Kernel in 'Xvcl.Kernel.pas',12 6 Driver.VideoVCL in 'Drivers\Driver.VideoVCL.pas', 13 7 Driver.SystemVCL in 'Drivers\Driver.SystemVCL.pas', 14 8 Driver.KeyboardVCL in 'Drivers\Driver.KeyboardVCL.pas', 15 9 Driver.MouseVCL in 'Drivers\Driver.MouseVCL.pas', 16 Xvcl.Generics in 'Xvcl.Generics.pas'; 10 Xvcl.Classes in 'Xvcl\Xvcl.Classes.pas', 11 Xvcl.Controls in 'Xvcl\Xvcl.Controls.pas', 12 Xvcl.Forms in 'Xvcl\Xvcl.Forms.pas', 13 Xvcl.Generics in 'Xvcl\Xvcl.Generics.pas', 14 Xvcl.Graphics in 'Xvcl\Xvcl.Graphics.pas', 15 LDOS.Kernel in 'System\LDOS.Kernel.pas', 16 LDOS.Task in 'System\LDOS.Task.pas', 17 TestApplication in 'Applications\TestApplication.pas', 18 UDesktop in 'Applications\UDesktop.pas'; 17 19 18 20 {$R *.res} … … 24 26 DriverKeyboard: TDriver; 25 27 DriverMouse: TDriver; 26 TestApplication: TApplication;28 DesktopApp: TDesktopApp; 27 29 begin 30 ReportMemoryLeaksOnShutdown := DebugHook <> 0; 28 31 Kernel := TKernel.Create; 29 32 DriverSystem := TDriverSystemVCL.Create; … … 39 42 DriverMouse.Kernel := Kernel; 40 43 Kernel.Drivers.Add(DriverMouse); 41 TestApplication := TTestApplication.Create;42 TestApplication.Screen := Kernel.Screen;43 Kernel.StartOnBoot.Add( TestApplication);44 DesktopApp := TDesktopApp.Create; 45 DesktopApp.Screen := Kernel.Screen; 46 Kernel.StartOnBoot.Add(DesktopApp); 44 47 Kernel.Boot; 45 48 Kernel.Destroy; -
os/trunk/lddesktop.dproj
r3 r5 87 87 <FormType>dfm</FormType> 88 88 </DCCReference> 89 <DCCReference Include="Xvcl.Controls.pas"/>90 <DCCReference Include="Applications\TestApplication.pas"/>91 <DCCReference Include="Xvcl.Classes.pas"/>92 <DCCReference Include="Xvcl.Graphics.pas"/>93 <DCCReference Include="Xvcl.Forms.pas"/>94 <DCCReference Include="Xvcl.Kernel.pas"/>95 89 <DCCReference Include="Drivers\Driver.VideoVCL.pas"/> 96 90 <DCCReference Include="Drivers\Driver.SystemVCL.pas"> … … 99 93 <DCCReference Include="Drivers\Driver.KeyboardVCL.pas"/> 100 94 <DCCReference Include="Drivers\Driver.MouseVCL.pas"/> 101 <DCCReference Include="Xvcl.Generics.pas"/> 95 <DCCReference Include="Xvcl\Xvcl.Classes.pas"/> 96 <DCCReference Include="Xvcl\Xvcl.Controls.pas"/> 97 <DCCReference Include="Xvcl\Xvcl.Forms.pas"/> 98 <DCCReference Include="Xvcl\Xvcl.Generics.pas"/> 99 <DCCReference Include="Xvcl\Xvcl.Graphics.pas"/> 100 <DCCReference Include="System\LDOS.Kernel.pas"/> 101 <DCCReference Include="System\LDOS.Task.pas"/> 102 <DCCReference Include="Applications\TestApplication.pas"/> 103 <DCCReference Include="Applications\UDesktop.pas"/> 102 104 <BuildConfiguration Include="Release"> 103 105 <Key>Cfg_2</Key> -
os/trunk/lddesktop.dproj.local
r3 r5 2 2 <BorlandProject> 3 3 <Transactions> 4 <Transaction>2013/05/05 12:48:11.000.546,C:\ Users\george\Documents\RAD Studio\Projects\Unit1.dfm=C:\Projekty\LibreDevelop\Desktop\UFormMain.dfm</Transaction>5 <Transaction>2013/05/05 12:48:16.000.408,C:\ Users\george\Documents\RAD Studio\Projects\Project1.dproj=C:\Projekty\LibreDevelop\Desktop\lddesktop.dproj</Transaction>6 <Transaction>2013/05/05 14:41:42.000.034,C:\Projekty\LibreDevelop\Desktop\ DesktopVCL.pas=C:\Projekty\LibreDevelop\Desktop\UDesktopVCL.pas</Transaction>7 <Transaction>2013/05/05 16:31:04.000.703,C:\Projekty\LibreDevelop\Desktop\ lddesktop.dproj=C:\Projekty\LibreDevelop\Desktop\Xvcl.Graphics.dproj</Transaction>8 <Transaction>2013/05/05 16:31:23.000.727,C:\Projekty\LibreDevelop\Desktop\ Xvcl.Graphics.dproj=C:\Projekty\LibreDevelop\Desktop\lddektop.dproj</Transaction>9 <Transaction>2013/05/05 16:31:30.000.009,C:\Projekty\LibreDevelop\Desktop\ UCommon.pas=C:\Projekty\LibreDevelop\Desktop\lddesktop.pas</Transaction>10 <Transaction>2013/05/05 16:32:07.000.379,C:\Projekty\LibreDevelop\Desktop\ lddesktop.pas=C:\Projekty\LibreDevelop\Desktop\Xvcl.Controls.pas</Transaction>11 <Transaction>2013/05/05 17:10:43.000.905,C:\Projekty\LibreDevelop\Desktop\Xvcl. Desktop.pas=C:\Projekty\LibreDevelop\Desktop\Xvcl.Kernel.pas</Transaction>12 <Transaction>2013/05/05 17:28:07.000.437,C:\Projekty\LibreDevelop\Desktop\ UDesktopVCL.pas=C:\Projekty\LibreDevelop\Desktop\Applications\TestApplication.pas</Transaction>13 <Transaction>2013/05/05 21:35:35.000.035,C:\Projekty\LibreDevelop\Desktop\ldde ktop.dproj=C:\Projekty\LibreDevelop\Desktop\lddesktop.dproj</Transaction>4 <Transaction>2013/05/05 12:48:11.000.546,C:\Projekty\LibreDevelop\Desktop\UFormMain.dfm=C:\Users\george\Documents\RAD Studio\Projects\Unit1.dfm</Transaction> 5 <Transaction>2013/05/05 12:48:16.000.408,C:\Projekty\LibreDevelop\Desktop\lddesktop.dproj=C:\Users\george\Documents\RAD Studio\Projects\Project1.dproj</Transaction> 6 <Transaction>2013/05/05 14:41:42.000.034,C:\Projekty\LibreDevelop\Desktop\UDesktopVCL.pas=C:\Projekty\LibreDevelop\Desktop\DesktopVCL.pas</Transaction> 7 <Transaction>2013/05/05 16:31:04.000.703,C:\Projekty\LibreDevelop\Desktop\Xvcl.Graphics.dproj=C:\Projekty\LibreDevelop\Desktop\lddesktop.dproj</Transaction> 8 <Transaction>2013/05/05 16:31:23.000.727,C:\Projekty\LibreDevelop\Desktop\lddektop.dproj=C:\Projekty\LibreDevelop\Desktop\Xvcl.Graphics.dproj</Transaction> 9 <Transaction>2013/05/05 16:31:30.000.009,C:\Projekty\LibreDevelop\Desktop\lddesktop.pas=C:\Projekty\LibreDevelop\Desktop\UCommon.pas</Transaction> 10 <Transaction>2013/05/05 16:32:07.000.379,C:\Projekty\LibreDevelop\Desktop\Xvcl.Controls.pas=C:\Projekty\LibreDevelop\Desktop\lddesktop.pas</Transaction> 11 <Transaction>2013/05/05 17:10:43.000.905,C:\Projekty\LibreDevelop\Desktop\Xvcl.Kernel.pas=C:\Projekty\LibreDevelop\Desktop\Xvcl.Desktop.pas</Transaction> 12 <Transaction>2013/05/05 17:28:07.000.437,C:\Projekty\LibreDevelop\Desktop\Applications\TestApplication.pas=C:\Projekty\LibreDevelop\Desktop\UDesktopVCL.pas</Transaction> 13 <Transaction>2013/05/05 21:35:35.000.035,C:\Projekty\LibreDevelop\Desktop\lddesktop.dproj=C:\Projekty\LibreDevelop\Desktop\lddektop.dproj</Transaction> 14 14 </Transactions> 15 15 </BorlandProject>
Note:
See TracChangeset
for help on using the changeset viewer.