Changeset 423 for trunk


Ignore:
Timestamp:
Apr 25, 2022, 6:01:01 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Do not use explicit mode delphi directive as it is already set in project.
  • Modified: Use UNIX instead of LINUX for conditional code to work also on FreeBSD.
Location:
trunk
Files:
40 edited

Legend:

Unmodified
Added
Removed
  • trunk/Direct.pas

    r382 r423  
    77  Messg,
    88
    9   LCLIntf, LCLType, {$IFDEF Linux}LMessages, {$ENDIF}Messages, SysUtils, Classes,
     9  LCLIntf, LCLType, {$IFDEF UNIX}LMessages, {$ENDIF}Messages, SysUtils, Classes,
    1010  Graphics, Controls, Forms, DrawDlg, GameServer;
    1111
     
    153153        State := -1;
    154154        Show;
    155         {$IFDEF LINUX}
     155        {$IFDEF UNIX}
    156156        // Force shown window repaint on Gtk2 widgetset
    157157        Sleep(1);
     
    302302  Invalidate;
    303303  Update;
    304   {$IFDEF LINUX}
     304  {$IFDEF UNIX}
    305305  Application.ProcessMessages;
    306306  {$ENDIF}
  • trunk/LocalPlayer/CityScreen.pas

    r417 r423  
    55
    66uses
    7   {$IFDEF LINUX}LMessages,{$ENDIF}
     7  {$IFDEF UNIX}LMessages,{$ENDIF}
    88  Protocol, ClientTools, Term, ScreenTools, IsoEngine, BaseWin,
    99  LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls,
  • trunk/LocalPlayer/Term.pas

    r420 r423  
    55
    66uses
    7 {$IFDEF Windows}
     7{$IFDEF WINDOWS}
    88  Windows,
    99{$ENDIF}
    10 {$IFDEF Linux}
     10{$IFDEF UNIX}
    1111  LMessages, Messages,
    1212{$ENDIF}
     
    47054705end;
    47064706
    4707 {$IFDEF LINUX}
     4707{$IFDEF UNIX}
    47084708// Can't do scrolling of DC under Linux, then fallback into BitBlt.
    47094709function ScrollDC(Canvas: TCanvas; dx: longint; dy: longint; const lprcScroll:TRect; const lprcClip:TRect; hrgnUpdate:HRGN; lprcUpdate: PRect):Boolean;
     
    47634763        rec, rec, 0, nil);
    47644764{$ENDIF}
    4765 {$IFDEF LINUX}
     4765{$IFDEF UNIX}
    47664766      ScrollDC(offscreen.Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,
    47674767        rec, rec, 0, nil);
     
    47744774            rec, 0, nil);
    47754775{$ENDIF}
    4776 {$IFDEF LINUX}
     4776{$IFDEF UNIX}
    47774777          ScrollDC(Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,
    47784778            rec, rec, 0, nil);
     
    66726672      NoMap.PaintUnit(xMoving - xMin, yMoving - yMin, UnitInfo, 0);
    66736673      PaintBufferToScreen(xMin, yMin, xRange, yRange);
    6674       {$IFDEF LINUX}
    6675       // TODO: Force animation under linux
     6674      {$IFDEF UNIX}
     6675      // TODO: Force animation under UNIX
    66766676      Application.ProcessMessages;
    66776677      {$ENDIF}
  • trunk/LocalPlayer/UKeyBindings.pas

    r418 r423  
    11unit UKeyBindings;
    2 
    3 {$mode delphi}
    42
    53interface
  • trunk/Network/UNetworkClient.pas

    r382 r423  
    11unit UNetworkClient;
    2 
    3 {$mode delphi}
    42
    53interface
    64
    75uses
    8   Classes, SysUtils{$IFDEF LINUX}, fpAsync, fpsock{$ENDIF}, Protocol;
     6  Classes, SysUtils{$IFDEF UNIX}, fpAsync, fpsock{$ENDIF}, Protocol;
    97
    10 {$IFDEF LINUX}
     8{$IFDEF UNIX}
    119type
    1210  { TTCPClientThread }
     
    4846
    4947uses
    50   LocalPlayer{$IFDEF LINUX}, Global, UNetworkCommon{$ENDIF};
     48  LocalPlayer{$IFDEF UNIX}, Global, UNetworkCommon{$ENDIF};
    5149
    5250procedure Client(Command, Player: Integer; var Data);
    53 {$IFDEF LINUX}
     51{$IFDEF UNIX}
    5452var
    5553  Cmd: TCommand;
    5654{$ENDIF}
    5755begin
    58   {$IFDEF LINUX}
     56  {$IFDEF UNIX}
    5957  Cmd := TCommand(Command);
    6058  case Cmd of
     
    7371end;
    7472
    75 {$IFDEF LINUX}
     73{$IFDEF UNIX}
    7674function LocalServer(Command, Player, Subject: Integer; var Data): Integer; stdcall;
    7775begin
  • trunk/Network/UNetworkCommon.pas

    r365 r423  
    11unit UNetworkCommon;
    2 
    3 {$mode delphi}
    42
    53interface
     
    108procedure StreamAppend(Stream: TStream; SourceStream: TStream);
    119procedure StreamRemoveRead(Stream: TMemoryStream);
     10
    1211
    1312implementation
  • trunk/Network/UNetworkServer.pas

    r382 r423  
    11unit UNetworkServer;
    22
    3 {$mode delphi}
    4 
    53interface
    64
    75uses
    8   Classes, SysUtils{$IFDEF LINUX}, fgl, fpAsync, fpsock, fphttpclient{$ENDIF}, Protocol;
    9 
    10 {$IFDEF LINUX}
     6  Classes, SysUtils{$IFDEF UNIX}, fgl, fpAsync, fpsock, fphttpclient{$ENDIF}, Protocol;
     7
     8{$IFDEF UNIX}
    119type
    1210  TNetworkServer = class;
     
    8785implementation
    8886
    89 {$IFDEF LINUX}
     87{$IFDEF UNIX}
    9088uses
    9189  Global, UNetworkCommon;
     
    9492procedure Client(Command, Player: integer; var Data);
    9593begin
    96   {$IFDEF LINUX}
     94  {$IFDEF UNIX}
    9795  if not Assigned(NetworkServer) then begin
    9896    NetworkServer := TNetworkServer.Create;
     
    107105end;
    108106
    109 {$IFDEF LINUX}
     107{$IFDEF UNIX}
    110108
    111109{ TNetworkServerPlayers }
  • trunk/Packages/CevoComponents/DrawDlg.pas

    r413 r423  
    11unit DrawDlg;
    22
    3 {$mode delphi}{$H+}
    4 
    53interface
    64
    75uses
    8   Classes, SysUtils, Forms, LCLIntf, LCLType, {$IFDEF LINUX}LMessages,{$ENDIF}
     6  Classes, SysUtils, Forms, LCLIntf, LCLType, {$IFDEF UNIX}LMessages,{$ENDIF}
    97  Messages, Graphics, Controls, ButtonBase, ButtonA, ButtonB, Area, ScreenTools
    108  {$IFDEF LCLGTK2}, Gtk2Globals{$ENDIF};
     
    7674  MoveActive := False;
    7775  AddHandlerOnVisibleChanged(VisibleChangedHandler);
    78   {$IFDEF LINUX}
     76  {$IFDEF UNIX}
    7977  OnDeactivate := DoDeactivate;
    8078  {$ENDIF}
     
    131129  MousePos1: TPoint;
    132130  MousePos2: TPoint;
    133 {$IFDEF LINUX}
     131{$IFDEF UNIX}
    134132  MousePosNew: TPoint;
    135133  NewFormPos: TPoint;
     
    139137  inherited;
    140138  MousePos2 := Mouse.CursorPos;
    141   {$IFDEF LINUX}
     139  {$IFDEF UNIX}
    142140  // Only if client is not doing own mouse move handling
    143141  if not Assigned(OnMouseDown) or not Assigned(OnMouseMove) or not Assigned(OnMouseUp) then begin
  • trunk/Packages/CevoComponents/ScreenTools.pas

    r417 r423  
    16471647  I: Integer;
    16481648begin
    1649   {$IFDEF LINUX}
     1649  {$IFDEF UNIX}
    16501650  // Wait and process messages little bit to avoid crash or force repaint under Gtk2
    16511651  for I := 0 to 10 do begin
  • trunk/Packages/CevoComponents/Sound.pas

    r383 r423  
    77  StringTables, Directories, LCLType
    88  {$IFDEF WINDOWS}, MMSystem, Windows{$ENDIF}
    9   {$IFDEF LINUX}, Process, AsyncProcess2{$ENDIF};
     9  {$IFDEF UNIX}, Process, AsyncProcess2{$ENDIF};
    1010
    1111type
     
    2929  TSound = class
    3030  private
    31     {$IFDEF LINUX}
     31    {$IFDEF UNIX}
    3232    PlayCommand: string;
    3333    SoundPlayerAsyncProcess: TAsyncProcess;
     
    6363{$R *.lfm}
    6464
    65 {$IFDEF LINUX}
     65{$IFDEF UNIX}
    6666resourcestring
    6767  SUnableToPlay = 'PlayStyle=%s: Unable to play %s Message:%s';
     
    8888  end
    8989  {$ENDIF}
    90   {$IFDEF LINUX}
     90  {$IFDEF UNIX}
    9191  PlayCommand := GetNonWindowsPlayCommand;
    9292  FDeviceID := 1;
     
    100100    mciSendCommand(FDeviceID, MCI_CLOSE, MCI_WAIT, 0);
    101101  {$ENDIF}
    102   {$IFDEF LINUX}
     102  {$IFDEF UNIX}
    103103  FreeAndNil(SoundPlayerSyncProcess);
    104104  FreeAndNil(SoundPlayerAsyncProcess);
     
    162162  PlayParm: TMCI_Play_Parms;
    163163{$ENDIF}
    164 {$IFDEF LINUX}
     164{$IFDEF UNIX}
    165165var
    166166  L: TStringList;
     
    175175  end
    176176  {$ENDIF}
    177   {$IFDEF LINUX}
     177  {$IFDEF UNIX}
    178178  // How to play in Linux? Use generic Linux commands
    179179  // Use asyncprocess to play sound as SND_ASYNC
     
    232232  mciSendCommand(FDeviceID, MCI_STOP, 0, 0);
    233233  {$ENDIF}
    234   {$IFDEF LINUX}
     234  {$IFDEF UNIX}
    235235  if SoundPlayerSyncProcess <> nil then SoundPlayerSyncProcess.Terminate(1);
    236236  if SoundPlayerAsyncProcess <> nil then SoundPlayerAsyncProcess.Terminate(1);
  • trunk/Packages/Common/StopWatch.pas

    r396 r423  
    55
    66uses
    7   {$IFDEF Windows}Windows,{$ENDIF}
     7  {$IFDEF WINDOWS}Windows,{$ENDIF}
    88  SysUtils, DateUtils;
    99
     
    3232  end;
    3333
     34
    3435implementation
    3536
     
    4041  fIsRunning := False;
    4142
    42   {$IFDEF Windows}
     43  {$IFDEF WINDOWS}
    4344  fIsHighResolution := QueryPerformanceFrequency(fFrequency) ;
    4445  {$ELSE}
  • trunk/Packages/Common/UAboutDialog.pas

    r420 r423  
    11unit UAboutDialog;
    2 
    3 {$mode delphi}
    42
    53interface
  • trunk/Packages/Common/UApplicationInfo.pas

    r396 r423  
    11unit UApplicationInfo;
    2 
    3 {$mode delphi}
    42
    53interface
     
    5957procedure Register;
    6058
     59
    6160implementation
    6261
  • trunk/Packages/Common/UCommon.pas

    r420 r423  
    11unit UCommon;
    22
    3 {$mode delphi}
    4 
    53interface
    64
    75uses
    8   {$ifdef Windows}Windows,{$endif}
    9   {$ifdef Linux}baseunix,{$endif}
     6  {$IFDEF WINDOWS}Windows,{$ENDIF}
     7  {$IFDEF UNIX}baseunix,{$ENDIF}
    108  Classes, SysUtils, StrUtils, Dialogs, Process, LCLIntf,
    119  FileUtil; //, ShFolder, ShellAPI;
     
    3533  DLLHandle1: HModule;
    3634
    37 {$IFDEF Windows}
     35{$IFDEF WINDOWS}
    3836  GetUserNameEx: procedure (NameFormat: DWORD;
    3937    lpNameBuffer: LPSTR; nSize: PULONG); stdcall;
     
    302300end;
    303301
    304 {$IFDEF Windows}
     302{$IFDEF WINDOWS}
    305303function GetUserName: string;
    306304const
     
    323321  end;
    324322end;
    325 {$endif}
     323{$ENDIF}
    326324
    327325function ComputerName: string;
    328 {$ifdef mswindows}
     326{$IFDEF WINDOWS}
    329327const
    330328 INFO_BUFFER_SIZE = 32767;
     
    341339  end;
    342340end;
    343 {$endif}
    344 {$ifdef unix}
     341{$ENDIF}
     342{$IFDEF UNIX}
    345343var
    346344  Name: UtsName;
     
    349347  Result := Name.Nodename;
    350348end;
    351 {$endif}
    352 
    353 {$ifdef windows}
     349{$ENDIF}
     350
     351{$IFDEF WINDOWS}
    354352function LoggedOnUserNameEx(Format: TUserNameFormat): string;
    355353const
     
    429427procedure LoadLibraries;
    430428begin
    431   {$IFDEF Windows}
     429  {$IFDEF WINDOWS}
    432430  DLLHandle1 := LoadLibrary('secur32.dll');
    433431  if DLLHandle1 <> 0 then
     
    440438procedure FreeLibraries;
    441439begin
    442   {$IFDEF Windows}
     440  {$IFDEF WINDOWS}
    443441  if DLLHandle1 <> 0 then FreeLibrary(DLLHandle1);
    444442  {$ENDIF}
  • trunk/Packages/Common/UDebugLog.pas

    r396 r423  
    11unit UDebugLog;
    2 
    3 {$mode delphi}
    42
    53interface
     
    4442
    4543procedure Register;
     44
    4645
    4746implementation
  • trunk/Packages/Common/UDelay.pas

    r396 r423  
    11unit UDelay;
    2 
    3 {$mode delphi}
    42
    53interface
  • trunk/Packages/Common/UFindFile.pas

    r396 r423  
    5959  FilterAll = '*.*';
    6060{$ENDIF}
    61 {$IFDEF LINUX}
     61{$IFDEF UNIX}
    6262  FilterAll = '*';
    6363{$ENDIF}
  • trunk/Packages/Common/UFormAbout.pas

    r420 r423  
    11unit UFormAbout;
    2 
    3 {$mode delphi}
    42
    53interface
  • trunk/Packages/Common/UGeometric.pas

    r396 r423  
    11unit UGeometric;
    2 
    3 {$mode delphi}
    42
    53interface
     
    2624function RectEnlarge(Rect: TRect; Value: Integer): TRect;
    2725function ShiftRect(ARect: TRect; Delta: TPoint): TRect;
     26
    2827
    2928implementation
  • trunk/Packages/Common/UJobProgressView.pas

    r396 r423  
    11unit UJobProgressView;
    2 
    3 {$MODE Delphi}
    42
    53interface
  • trunk/Packages/Common/ULanguages.pas

    r416 r423  
    11unit ULanguages;
    2 
    3 {$mode delphi}{$H+}
    42
    53interface
  • trunk/Packages/Common/ULastOpenedList.pas

    r396 r423  
    11unit ULastOpenedList;
    2 
    3 {$mode delphi}
    42
    53interface
  • trunk/Packages/Common/UListViewSort.pas

    r420 r423  
    22
    33// Date: 2019-05-17
    4 
    5 {$mode delphi}
    64
    75interface
  • trunk/Packages/Common/UMemory.pas

    r396 r423  
    11unit UMemory;
    2 
    3 {$mode Delphi}{$H+}
    42
    53interface
     
    4341    property Position: Integer read FPosition write FPosition;
    4442  end;
     43
    4544
    4645implementation
  • trunk/Packages/Common/UMetaCanvas.pas

    r420 r423  
    11unit UMetaCanvas;
    2 
    3 {$mode delphi}
    42
    53interface
  • trunk/Packages/Common/UPersistentForm.pas

    r396 r423  
    11unit UPersistentForm;
    2 
    3 {$mode delphi}
    42
    53// Date: 2020-11-26
  • trunk/Packages/Common/UPool.pas

    r396 r423  
    11unit UPool;
    2 
    3 {$mode Delphi}{$H+}
    42
    53interface
  • trunk/Packages/Common/UPrefixMultiplier.pas

    r396 r423  
    22
    33// Date: 2010-06-01
    4 
    5 {$mode delphi}
    64
    75interface
  • trunk/Packages/Common/URegistry.pas

    r396 r423  
    11unit URegistry;
    2 
    3 {$MODE delphi}
    42
    53interface
     
    132130function TRegistryEx.OpenKey(const Key: string; CanCreate: Boolean): Boolean;
    133131begin
    134   {$IFDEF Linux}
     132  {$IFDEF UNIX}
    135133  //CloseKey;
    136134  {$ENDIF}
  • trunk/Packages/Common/UResetableThread.pas

    r396 r423  
    11unit UResetableThread;
    2 
    3 {$mode Delphi}{$H+}
    42
    53interface
  • trunk/Packages/Common/UScaleDPI.pas

    r420 r423  
    22
    33{ See: http://wiki.lazarus.freepascal.org/High_DPI }
    4 
    5 {$mode delphi}{$H+}
    64
    75interface
     
    227225    Temp[I] := TBitmap.Create;
    228226    Temp[I].SetSize(NewWidth, NewHeight);
    229     {$IFDEF Linux}
     227    {$IFDEF UNIX}
    230228    Temp[I].PixelFormat := pf24bit;
    231229    {$ELSE}
  • trunk/Packages/Common/USyncCounter.pas

    r396 r423  
    11unit USyncCounter;
    2 
    3 {$mode delphi}
    42
    53interface
     
    2523    procedure Assign(Source: TSyncCounter);
    2624  end;
     25
    2726
    2827implementation
  • trunk/Packages/Common/UThreading.pas

    r420 r423  
    11unit UThreading;
    2 
    3 {$mode delphi}
    42
    53interface
  • trunk/Packages/Common/UTranslator.pas

    r418 r423  
    11unit UTranslator;
    2 
    3 {$mode delphi}{$H+}
    42
    53interface
  • trunk/Packages/Common/UURI.pas

    r396 r423  
    22
    33// Date: 2011-04-04
    4 
    5 {$mode delphi}
    64
    75interface
     
    8482    property AsString: string read GetAsString write SetAsString;
    8583  end;
     84
    8685
    8786implementation
  • trunk/Packages/Common/UXMLUtils.pas

    r396 r423  
    11unit UXMLUtils;
    2 
    3 {$mode delphi}
    42
    53interface
  • trunk/Platform.pas

    r290 r423  
    11unit Platform;
    2 
    3 {$mode delphi}{$H+}
    42
    53interface
    64
    75uses
    8   {$IFDEF Windows}Windows,{$ENDIF}
    9   {$IFDEF Linux}Unix,{$ENDIF}
     6  {$IFDEF WINDOWS}Windows,{$ENDIF}
     7  {$IFDEF UNIX}Unix,{$ENDIF}
    108  Classes, SysUtils, DateUtils, SyncObjs;
    119
     
    1412implementation
    1513
    16 {$IFDEF Windows}
     14{$IFDEF WINDOWS}
    1715var
    1816  PerformanceFrequency: Int64;
     
    2422function NowPrecise: TDateTime;
    2523var
    26   {$IFDEF Linux}T: TimeVal;{$ENDIF}
    27   {$IFDEF Windows}TimerValue: Int64;{$ENDIF}
     24  {$IFDEF UNIX}T: TimeVal;{$ENDIF}
     25  {$IFDEF WINDOWS}TimerValue: Int64;{$ENDIF}
    2826begin
    2927//  Result := Now;
    3028  //try
    3129    //NowPreciseLock.Acquire;
    32     {$IFDEF Windows}
     30    {$IFDEF WINDOWS}
    3331    QueryPerformanceCounter(TimerValue);
    3432    //Result := Int64(TimeStampToMSecs(DateTimeToTimeStamp(Now)) * 1000) // an alternative Win32 timebase
     
    3634    {$ENDIF}
    3735
    38     {$IFDEF Linux}
     36    {$IFDEF UNIX}
    3937    fpgettimeofday(@t, nil);
    4038     // Build a 64 bit microsecond tick from the seconds and microsecond longints
     
    5149initialization
    5250
    53 {$IFDEF Windows}
     51{$IFDEF WINDOWS}
    5452QueryPerformanceFrequency(PerformanceFrequency);
    5553{$ENDIF}
  • trunk/Settings.pas

    r416 r423  
    11unit Settings;
    2 
    3 {$mode delphi}
    42
    53interface
  • trunk/Start.pas

    r417 r423  
    77  GameServer, Messg, ButtonBase, ButtonA, ButtonC, ButtonB, Area, Types,
    88  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms, StdCtrls,
    9   Menus, Registry,  DrawDlg, fgl, Protocol, UMiniMap, UBrain, UTranslator;
     9  Menus, Registry, DrawDlg, fgl, Protocol, UMiniMap, UBrain, UTranslator;
    1010
    1111type
  • trunk/UBrain.pas

    r417 r423  
    11unit UBrain;
    2 
    3 {$mode delphi}
    42
    53interface
     
    126124      DLLName := BasePath + DirectorySeparator + Value
    127125    {$ENDIF}{$ENDIF}
    128     {$IFDEF LINUX}{$IFDEF CPU32}
     126    {$IFDEF UNIX}{$IFDEF CPU32}
    129127    else if Key = '#PATH_LINUX32' then
    130128      DLLName := BasePath + DirectorySeparator + Value
    131129    {$ENDIF}{$ENDIF}
    132     {$IFDEF LINUX}{$IFDEF CPU64}
     130    {$IFDEF UNIX}{$IFDEF CPU64}
    133131    else if Key = '#PATH_LINUX64' then
    134132      DLLName := BasePath + DirectorySeparator + Value
Note: See TracChangeset for help on using the changeset viewer.