View Issue Details

IDProjectCategoryView StatusLast Update
0031186PatchesPatchpublic2017-01-03 20:58
ReporterMarcus Sackrow Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformAmigaOSAmiga 
Product Version1.6.3 (SVN) 
Summary0031186: Patch to make LCL compile for Amiga-systems (NoGUI)
Descriptionthe Patch adds possibility to compile nogui-LCL (registration, lazutils, codetools, LCL) for all Amiga Systems

with FPC 3.0+: Amiga 3.x m68k, AROS i386

with FPC 3.1.1: additionally AROS ARM, AROS x86_64, AmigaOS 4 PowerPC, MorphOS PowerPC

currently only NoGUI, MUI widget set could be added later
TagsNo tags attached.
Fixed in Revisionr53853
LazTarget-
Widgetset
Attached Files

Activities

Marcus Sackrow

2017-01-02 18:54

reporter  

Amiga-LCL-init.diff (19,882 bytes)   
Index: components/codetools/fileprocs.pas
===================================================================
--- components/codetools/fileprocs.pas	(Revision 53833)
+++ components/codetools/fileprocs.pas	(Arbeitskopie)
@@ -56,7 +56,7 @@
   TFPCMemStreamSeekType = integer;
   PCharZ = Pointer;
 
-{$if defined(Windows) or defined(darwin)}
+{$if defined(Windows) or defined(darwin) or defined(HASAMIGA)}
 {$define CaseInsensitiveFilenames}
 {$endif}
 {$IF defined(CaseInsensitiveFilenames) or defined(darwin)}
@@ -365,8 +365,10 @@
 
 // to get more detailed error messages consider the os
 {$IFnDEF Windows}
+{$ifndef HASAMIGA}
 uses
   Unix;
+{$endif}
 {$ENDIF}
 
 {$IFDEF EnableWrapperFunctions}
Index: components/codetools/ppugraph.pas
===================================================================
--- components/codetools/ppugraph.pas	(Revision 53833)
+++ components/codetools/ppugraph.pas	(Arbeitskopie)
@@ -30,12 +30,19 @@
 interface
 
 uses
-  Classes, SysUtils, dynlibs, PPUParser, CodeTree, AVL_Tree, FileProcs,
+  Classes, SysUtils,
+  {$ifndef HASAMIGA}
+  dynlibs,
+  {$endif}
+  PPUParser, CodeTree, AVL_Tree, FileProcs,
   LazFileUtils, BasicCodeTools, CodeGraph, CodeToolManager, CodeToolsStructs;
 
 const
   FPCPPUGroupPrefix = 'fpc_';
-  
+  {$ifdef HASAMIGA}
+  SharedSuffix = 'library';
+  {$endif}
+
 type
   TPPUGroup = class;
 
Index: components/lazutils/amigafileutil.inc
===================================================================
--- components/lazutils/amigafileutil.inc	(nicht existent)
+++ components/lazutils/amigafileutil.inc	(Arbeitskopie)
@@ -0,0 +1,8 @@
+{%MainUnit fileutil.pas}
+
+
+function ExtractShortPathNameUTF8(const FileName: String): String;
+begin
+  Result:=SysToUTF8(SysUtils.ExtractShortPathName(UTF8ToSys(FileName)));
+end;
+

Eigenschaftsänderungen: components/lazutils/amigafileutil.inc
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: components/lazutils/amigalazfileutils.inc
===================================================================
--- components/lazutils/amigalazfileutils.inc	(nicht existent)
+++ components/lazutils/amigalazfileutils.inc	(Arbeitskopie)
@@ -0,0 +1,330 @@
+{%MainUnit lazfileutils.pas}
+
+function FilenameIsAbsolute(const TheFilename: string):boolean;
+begin
+  Result := Pos(':', TheFilename) > 1;
+end;
+
+function FileOpenUTF8(const FileName: string; Mode: Integer): THandle;
+begin
+  Result := SysUtils.FileOpen(UTF8ToSys(FileName), Mode);
+end;
+
+function FileCreateUTF8(const FileName: string): THandle;
+begin
+  Result := SysUtils.FileCreate(UTF8ToSys(FileName));
+end;
+
+function FileCreateUTF8(const FileName: string; Rights: Cardinal): THandle;
+begin
+  Result := SysUtils.FileCreate(UTF8ToSys(FileName), Rights);
+end;
+
+function FileCreateUtf8(const FileName: String; ShareMode: Integer;
+  Rights: Cardinal): THandle;
+begin
+  Result := SysUtils.FileCreate(UTF8ToSys(FileName), ShareMode, Rights);
+end;
+
+function FileGetAttrUTF8(const FileName: String): Longint;
+begin
+  Result:=SysUtils.FileGetAttr(UTF8ToSys(Filename));
+end;
+
+function FileSetAttrUTF8(const Filename: String; Attr: longint): Longint;
+begin
+  Result:=SysUtils.FileSetAttr(UTF8ToSys(Filename),Attr);
+  InvalidateFileStateCache(Filename);
+end;
+
+function FileExistsUTF8(const Filename: string): boolean;
+begin
+  Result:=SysUtils.FileExists(UTF8ToSys(Filename));
+end;
+
+function DirectoryExistsUTF8(const Directory: string): Boolean;
+begin
+  Result:=SysUtils.DirectoryExists(UTF8ToSys(Directory));
+end;
+
+function FileAgeUTF8(const FileName: string): Longint;
+begin
+  Result:=SysUtils.FileAge(UTF8ToSys(Filename));
+end;
+
+function FileSetDateUTF8(const FileName: String; Age: Longint): Longint;
+begin
+  Result := SysUtils.FileSetDate(UTF8ToSys(Filename), Age);
+  InvalidateFileStateCache(Filename);
+end;
+
+function FileSizeUtf8(const Filename: string): int64;
+var
+  Info: TSearchRec;
+  Str: AnsiString;
+begin
+  Result := 0;
+  Str := Utf8ToAnsi(Filename);
+  if SysUtils.FindFirst (str, faAnyFile and faDirectory, Info) = 0 then
+  begin
+    Result := Info.Size;
+  end;
+  SysUtils.FindClose(Info);
+end;
+
+{------------------------------------------------------------------------------
+  function ReadAllLinks(const Filename: string;
+    ExceptionOnError: boolean): string;
+ ------------------------------------------------------------------------------}
+function ReadAllLinks(const Filename: string;
+  ExceptionOnError: boolean): string;
+begin
+    Result:='';
+end;
+
+function GetPhysicalFilename(const Filename: string;
+  OnError: TPhysicalFilenameOnError): string;
+begin
+  Result:=Filename;
+end;
+
+function CreateDirUTF8(const NewDir: String): Boolean;
+begin
+  Result:=SysUtils.CreateDir(UTF8ToSys(NewDir));
+end;
+
+function RemoveDirUTF8(const Dir: String): Boolean;
+begin
+  Result:=SysUtils.RemoveDir(UTF8ToSys(Dir));
+end;
+
+function DeleteFileUTF8(const FileName: String): Boolean;
+begin
+  Result:=SysUtils.DeleteFile(UTF8ToSys(Filename));
+  if Result then
+    InvalidateFileStateCache;
+end;
+
+function RenameFileUTF8(const OldName, NewName: String): Boolean;
+begin
+  Result:=SysUtils.RenameFile(UTF8ToSys(OldName),UTF8ToSys(NewName));
+  if Result then
+    InvalidateFileStateCache;
+end;
+
+function SetCurrentDirUTF8(const NewDir: String): Boolean;
+begin
+  Result:=SysUtils.SetCurrentDir(UTF8ToSys(NewDir));
+end;
+
+function FindFirstUTF8(const Path: string; Attr: Longint; out Rslt: TSearchRec
+  ): Longint;
+begin
+  Result:=SysUtils.FindFirst(UTF8ToSys(Path),Attr,Rslt);
+  Rslt.Name:=SysToUTF8(Rslt.Name);
+end;
+
+function FindNextUTF8(var Rslt: TSearchRec): Longint;
+begin
+  Rslt.Name:=UTF8ToSys(Rslt.Name);
+  Result:=SysUtils.FindNext(Rslt);
+  Rslt.Name:=SysToUTF8(Rslt.Name);
+end;
+
+
+function ExpandFileNameUTF8(const FileName: string; BaseDir: string): string;
+var
+  IsAbs: Boolean;
+  CurDir, Fn: String;
+begin
+  Fn := FileName;
+  ForcePathDelims(Fn);
+  IsAbs := FileNameIsAbsolute(Fn);
+  if (not IsAbs) then
+  begin
+    CurDir := GetCurrentDirUtf8;
+  end;
+  if IsAbs then
+  begin
+    Result := ResolveDots(Fn);
+  end
+  else
+  begin
+    if (BaseDir = '') then
+      Fn := IncludeTrailingPathDelimiter(CurDir) + Fn
+    else
+      Fn := IncludeTrailingPathDelimiter(BaseDir) + Fn;
+    Fn := ResolveDots(Fn);
+    //if BaseDir is not absolute then this needs to be expanded as well
+    if not FileNameIsAbsolute(Fn) then
+      Fn := ExpandFileNameUtf8(Fn, '');
+    Result := Fn;
+  end;
+end;
+
+function GetCurrentDirUTF8: String;
+begin
+  Result:=SysToUTF8(SysUtils.GetCurrentDir);
+end;
+
+function FileIsExecutable(const AFilename: string): boolean;
+var
+  Fn: string;
+  MyLock: BPTR;
+  Info: TFileInfoBlock;
+begin
+  Result := False;
+  Fn := Utf8ToSys(AFilename);
+  MyLock := AmigaDos.Lock(PChar(Fn), SHARED_LOCK);
+  if PtrUInt(MyLock) <> 0 then
+  begin
+    Examine(MyLock, @Info);
+    Result := (Info.fib_Protection and FIBF_EXECUTE) <> 0;
+    AmigaDos.UnLock(MyLock);
+  end;
+end;
+
+procedure CheckIfFileIsExecutable(const AFilename: string);
+begin
+  // TProcess does not report, if a program can not be executed
+  // to get good error messages consider the OS
+  if not FileExistsUTF8(AFilename) then begin
+    raise Exception.Create(SysUtils.Format(lrsFileDoesNotExist, [AFilename]));
+  end;
+  if DirPathExists(AFilename) then begin
+    raise Exception.Create(SysUtils.Format(lrsFileIsADirectoryAndNotAnExecutable, [
+      AFilename]));
+  end;
+end;
+
+function FileIsSymlink(const AFilename: string): boolean;
+begin
+  Result := False;
+end;
+
+procedure CheckIfFileIsSymlink(const AFilename: string);
+begin
+  // to get good error messages consider the OS
+  if not FileExistsUTF8(AFilename) then begin
+    raise Exception.Create(SysUtils.Format(lrsFileDoesNotExist, [AFilename]));
+  end;
+  if not FileIsSymLink(AFilename) then
+    raise Exception.Create(SysUtils.Format(lrsIsNotASymbolicLink, [AFilename]));
+end;
+
+function FileIsHardLink(const AFilename: string): boolean;
+begin
+  Result := false;
+end;
+
+function FileIsReadable(const AFilename: string): boolean;
+var
+  Fn: string;
+  MyLock: BPTR;
+  Info: TFileInfoBlock;
+begin
+  Result := False;
+  Fn := Utf8ToSys(AFilename);
+  MyLock := AmigaDos.Lock(PChar(Fn), SHARED_LOCK);
+  if PtrUInt(MyLock) <> 0 then
+  begin
+    Examine(MyLock, @Info);
+    Result := (Info.fib_Protection and FIBF_READ) <> 0;
+    AmigaDos.UnLock(MyLock);
+  end;
+end;
+
+function FileIsWritable(const AFilename: string): boolean;
+var
+  Fn: string;
+  MyLock: BPTR;
+  Info: TFileInfoBlock;
+begin
+  Result := False;
+  Fn := Utf8ToSys(AFilename);
+  MyLock := AmigaDos.Lock(PChar(Fn), SHARED_LOCK);
+  if PtrUInt(MyLock) <> 0 then
+  begin
+    Examine(MyLock, @Info);
+    Result := (Info.fib_Protection and FIBF_WRITE) <> 0;
+    AmigaDos.UnLock(MyLock);
+  end;
+end;
+
+
+function IsUNCPath(const Path: String): Boolean;
+begin
+  Result := false;
+end;
+
+function ExtractUNCVolume(const Path: String): String;
+begin
+  Result := '';
+end;
+
+function GetFileDescription(const AFilename: string): string;
+var
+  Fn: string;
+  MyLock: BPTR;
+  Info: TFileInfoBlock;
+begin
+  Result := '';
+  Fn := Utf8ToSys(AFilename);
+  MyLock := AmigaDos.Lock(PChar(Fn), SHARED_LOCK);
+  if PtrUInt(MyLock) <> 0 then
+  begin
+    Examine(MyLock, @Info);
+    if (Info.fib_Protection and FIBF_ARCHIVE) <> 0 then
+      Result := Result + 'a';
+    if (Info.fib_Protection and FIBF_SCRIPT) <> 0 then
+      Result := Result + 's';
+    if (Info.fib_Protection and FIBF_PURE) <> 0 then
+      Result := Result + 'p';
+    if (Info.fib_Protection and FIBF_EXECUTE) <> 0 then
+      Result := Result + 'e';
+    if (Info.fib_Protection and FIBF_READ) <> 0 then
+      Result := Result + 'r';
+    if (Info.fib_Protection and FIBF_WRITE) <> 0 then
+      Result := Result + 'w';
+    if (Info.fib_Protection and FIBF_DELETE) <> 0 then
+      Result := Result + 'd';
+    AmigaDos.UnLock(MyLock);
+  end;
+end;
+
+
+function GetAppConfigDirUTF8(Global: Boolean; Create: boolean = false): string;
+begin
+  Result := SysToUTF8(SysUtils.GetAppConfigDir(Global));
+  if Result = '' then exit;
+  if Create and not ForceDirectoriesUTF8(Result) then
+    raise EInOutError.Create(SysUtils.Format(lrsUnableToCreateConfigDirectoryS,[Result]));
+end;
+
+function GetAppConfigFileUTF8(Global: Boolean; SubDir: boolean;
+  CreateDir: boolean): string;
+var
+  Dir: string;
+begin
+  Result := SysToUTF8(SysUtils.GetAppConfigFile(Global,SubDir));
+  if not CreateDir then exit;
+  Dir := ExtractFilePath(Result);
+  if Dir = '' then exit;
+  if not ForceDirectoriesUTF8(Dir) then
+    raise EInOutError.Create(SysUtils.Format(lrsUnableToCreateConfigDirectoryS,[Dir]));
+end;
+
+function GetShellLinkTarget(const FileName: string): string;
+begin
+  Result := Filename;
+end;
+
+procedure InitLazFileUtils;
+begin
+  //dummy
+end;
+
+procedure FinalizeLazFileUtils;
+begin
+  //dummy
+end;

Eigenschaftsänderungen: components/lazutils/amigalazfileutils.inc
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: components/lazutils/amigalazutf8.inc
===================================================================
--- components/lazutils/amigalazutf8.inc	(nicht existent)
+++ components/lazutils/amigalazutf8.inc	(Arbeitskopie)
@@ -0,0 +1,50 @@
+{%MainUnit lazutf8.pas}
+
+function ConsoleToUTF8(const s: string): string;// converts UTF8 string to console encoding (used by Write, WriteLn)
+begin
+  Result := SysToUTF8(S);
+end;
+
+function UTF8ToConsole(const s: string): string;
+begin
+  Result := UTF8ToSys(s);
+end;
+
+function WinCPToUTF8(const s: string): string;
+begin
+  if NeedRTLAnsi and (not IsASCII(s)) then
+  begin
+    Result:=AnsiToUTF8(s);
+    {$ifdef FPC_HAS_CPSTRING}
+    // prevent UTF8 codepage appear in the strings - we don't need codepage
+    // conversion magic in LCL code
+    SetCodePage(RawByteString(Result), StringCodePage(s), False);
+    {$endif}
+  end
+  else
+    Result:=s;
+end;
+
+function UTF8ToWinCP(const s: string): string;
+begin
+  if NeedRTLAnsi and (not IsASCII(s)) then
+    Result:=UTF8ToAnsi(s)
+  else
+    Result:=s;
+end;
+
+function ParamStrUTF8(Param: Integer): string;
+begin
+  Result:=SysToUTF8(ObjPas.ParamStr(Param));
+end;
+
+procedure InitLazUtf8;
+begin
+  //dummy procedure
+end;
+
+procedure FinalizeLazUTF8;
+begin
+  //dummy procedure
+end;
+

Eigenschaftsänderungen: components/lazutils/amigalazutf8.inc
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: components/lazutils/fileutil.pas
===================================================================
--- components/lazutils/fileutil.pas	(Revision 53833)
+++ components/lazutils/fileutil.pas	(Arbeitskopie)
@@ -29,8 +29,8 @@
 uses
   Classes, SysUtils,
   Masks, LazUTF8, LazFileUtils, StrUtils;
-  
-{$if defined(Windows) or defined(darwin)}
+
+{$if defined(Windows) or defined(darwin) or defined(HASAMIGA)}
 {$define CaseInsensitiveFilenames}
 {$endif}
 {$IF defined(CaseInsensitiveFilenames) or defined(darwin)}
@@ -284,7 +284,11 @@
 {$IFDEF windows}
   Windows;
 {$ELSE}
+  {$IFDEF HASAMIGA}
+  AmigaDOS;
+  {$ELSE}
   Unix;
+  {$ENDIF}
 {$ENDIF}
 
 {$I fileutil.inc}
@@ -291,7 +295,11 @@
 {$IFDEF windows}
   {$i winfileutil.inc}
 {$ELSE}
+  {$IFDEF HASAMIGA}
+  {$i amigafileutil.inc}
+  {$ELSE}
   {$i unixfileutil.inc}
+  {$ENDIF}
 {$ENDIF}
 
 end.
Index: components/lazutils/lazfileutils.pas
===================================================================
--- components/lazutils/lazfileutils.pas	(Revision 53833)
+++ components/lazutils/lazfileutils.pas	(Arbeitskopie)
@@ -24,6 +24,9 @@
 {$IFDEF darwin}
   {$define CaseInsensitiveFilenames}
 {$ENDIF}
+{$IFDEF HASAMIGA}
+  {$define CaseInsensitiveFilenames}
+{$ENDIF}
 {$IF defined(CaseInsensitiveFilenames) or defined(darwin)}
   {$DEFINE NotLiteralFilenames} // e.g. HFS+ normalizes file names
 {$ENDIF}
@@ -168,10 +171,14 @@
 {$IFDEF Windows}
   Windows {$IFnDEF WinCE}, ShlObj, ActiveX, WinDirs{$ENDIF};
 {$ELSE}
-  {$IFDEF darwin}
-  MacOSAll,
+  {$IFDEF HASAMIGA}
+  exec, amigados;
+  {$ELSE}
+    {$IFDEF darwin}
+    MacOSAll,
+    {$ENDIF}
+    Unix, BaseUnix;
   {$ENDIF}
-  Unix, BaseUnix;
 {$ENDIF}
 
 {$I lazfileutils.inc}
@@ -178,7 +185,11 @@
 {$IFDEF windows}
   {$I winlazfileutils.inc}
 {$ELSE}
-  {$I unixlazfileutils.inc}
+  {$ifdef HASAMIGA}
+    {$I amigalazfileutils.inc}
+  {$ELSE}
+    {$I unixlazfileutils.inc}
+  {$ENDIF}
 {$ENDIF}
 
 function CompareFilenames(const Filename1, Filename2: string): integer;
@@ -1026,7 +1037,7 @@
       Start:=Start+Prefix;
     I:=0;
     repeat
-      Result:=Format('%s%.5d.tmp',[Start,I]);
+      Result:=SysUtils.Format('%s%.5d.tmp',[Start,I]);
       Inc(I);
     until not FileExistsUTF8(Result);
   end;
Index: components/lazutils/lazutf8.pas
===================================================================
--- components/lazutils/lazutf8.pas	(Revision 53833)
+++ components/lazutils/lazutf8.pas	(Arbeitskopie)
@@ -227,7 +227,11 @@
 {$ifdef windows}
   {$i winlazutf8.inc}
 {$else}
+  {$ifdef HASAMIGA}
+  {$i amigalazutf8.inc}
+  {$else}
   {$i unixlazutf8.inc}
+  {$endif}
 {$endif}
 
 var
Index: components/lazutils/lazutf8sysutils.pas
===================================================================
--- components/lazutils/lazutf8sysutils.pas	(Revision 53833)
+++ components/lazutils/lazutf8sysutils.pas	(Arbeitskopie)
@@ -24,10 +24,13 @@
   {$ifdef Windows}
     Windows,
   {$else}
-    Unix, BaseUnix,
-    {$If defined(Linux) and (FPC_FULLVERSION<30000)}
-    Linux,
-    {$EndIf}
+    {$ifdef HASAMIGA}
+    {$else}
+      Unix, BaseUnix,
+      {$If defined(Linux) and (FPC_FULLVERSION<30000)}
+      Linux,
+      {$EndIf}
+    {$endif}
   {$endif}
   Classes;
 
Index: lcl/include/sysenvapis_amiga.inc
===================================================================
--- lcl/include/sysenvapis_amiga.inc	(nicht existent)
+++ lcl/include/sysenvapis_amiga.inc	(Arbeitskopie)
@@ -0,0 +1,102 @@
+{%MainUnit ../lclintf.pas}
+
+{$I ../../components/lazutils/lazutils_defines.inc} //LCL depends on LazUtils, so this is OK
+
+
+function IsLaunchWinApp(ABrowser: WideString): Boolean;
+begin
+  Result := False;
+end;
+
+//not every AppUserModelID we retrieve using GetDefaultBrowserWideByAppID
+//accepts paramters (e.g. the URL)
+function LaunchWinAppBrowserCanHandleParams(ABrowser: WideString): Boolean;
+begin
+  Result := False;
+end;
+
+function GetDefaultBrowserWideByAppID: WideString;
+begin
+  Result := '';
+end;
+
+function GetDefaultBrowserWideByCmd: WideString;
+begin
+  Result := '';
+end;
+
+
+procedure ExtractBrowserAndParamsWide(const S: WideString; out ABrowser, AParams: WideString);
+begin
+  ABrowser := S;
+  AParams := '%s';
+end;
+
+
+function FindDefaultBrowserWide(out ABrowser, AParams: WideString): Boolean;
+begin
+  ABrowser := '';
+  AParams := '"%s"';
+end;
+
+function FindDefaultBrowserUtf8(out ABrowser, AParams: String): Boolean;
+var
+  QueryRes: String;
+  WideBrowser, WideParams: WideString;
+begin
+  Result := FindDefaultBrowserWide(WideBrowser, WideParams);
+  ABrowser := Utf16ToUtf8(WideBrowser);
+  AParams := Utf16ToUtf8(WideParams);
+end;
+
+function FindDefaultBrowser(out ABrowser, AParams: String): Boolean;
+begin
+  Result := FindDefaultBrowserUtf8(ABrowser, AParams);
+  {$IFDEF ACP_RTL}
+  ABrowser := Utf8ToWinCp(ABrowser);
+  AParams := Utf8ToWinCp(AParams);
+  {$ENDIF ACP_RTL}
+end;
+
+function IsFileUriScheme(const AURL: String): Boolean;
+const
+  FileURIScheme = 'file://';
+begin
+  Result := (CompareText(Copy(AURL,1,Length(FileURIScheme)), FileURIScheme) = 0);
+end;
+
+function IsHtmlWithAnchor(AURL: String): Boolean;
+var
+  AnchorPos, HtmlPos: SizeInt;
+begin
+  Result := False;
+  //Anchor will be defined by last '#' in AURL;
+  AnchorPos := Length(AURL);
+  while (AnchorPos < 0) and (AURL[AnchorPos] <> '#') do Dec(AnchorPos);
+  if (AnchorPos > 0) then
+  begin
+    AURL := UpperCase(AURL); //don't care about UTF8
+    HtmlPos := Pos('.HTM', AURL);
+    if (HtmlPos = 0) then HtmlPos := Pos('.HTML', AURL);
+    Result := (HtmlPos > 0) and (AnchorPos > HtmlPos);
+  end;
+end;
+
+//Currently only used to open a local html file with a specified anchor
+//but in theory should be able to handle all URL's
+function FindDefaultBrowserAndOpenUrl(AURL: String; IsFileURI: Boolean=False{; IsLocalWithAnchor: Boolean=False}): Boolean;
+begin
+  Result := False;
+end;
+
+// Open a given URL with whatever Windows thinks is appropriate
+function OpenURL(AURL: String): Boolean;
+begin
+  Result := False;
+end;
+
+// Open a document with the default application associated with it in the system
+function OpenDocument(APath: String): Boolean;
+begin
+  Result := OpenURL(APath);
+end;

Eigenschaftsänderungen: lcl/include/sysenvapis_amiga.inc
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: lcl/lclintf.pas
===================================================================
--- lcl/lclintf.pas	(Revision 53833)
+++ lcl/lclintf.pas	(Arbeitskopie)
@@ -213,6 +213,9 @@
 {$ifdef Windows}
   {$I sysenvapis_win.inc}
 {$endif}
+{$ifdef HASAMIGA}
+  {$I sysenvapis_amiga.inc}
+{$endif}
 {$ifdef UNIX}
   {$ifdef darwin}
     {$I sysenvapis_mac.inc}
Amiga-LCL-init.diff (19,882 bytes)   

Zeljan Rikalo

2017-01-02 18:57

developer   ~0097246

Why HASAMIGA define instead of AMIGAOS or something similar ?

Marcus Sackrow

2017-01-02 18:58

reporter   ~0097247

Last edited: 2017-01-02 19:03

View 2 revisions

because HASAMIGA is a general define in FPC for all Amiga systems, like AROS, MorphOS, which are not Amiga, but share the same API (compareabel to to the hasunix define in FPC)

Zeljan Rikalo

2017-01-02 19:14

developer   ~0097250

Ok, thanks for answer.

Juha Manninen

2017-01-03 12:08

developer   ~0097263

Last edited: 2017-01-03 13:05

View 3 revisions

I noticed "amigalazutf8.inc" and "unixlazutf8.inc" are identical.
Also "amigafileutil.inc" and "unixfileutil.inc" are identical.
It would make sense to reuse the code. Later a new .inc file can be added if needed.

Are you also planning LCL bindings for Amiga GUI? (Just curious.)

Marcus Sackrow

2017-01-03 12:20

reporter   ~0097264

Last edited: 2017-01-03 12:29

View 2 revisions

Whats in your mind?

just make an empty "amigalazutf8.inc" which includes the "unixlazutf8.inc"? or remove the $ifdef HASAMIGA in the main files.

I also want to sharpen your minds to not write such constructs anymore :-P

{$ifdef UNIX}
  Unix
{$else}
  Windows
{$endif}

which make it very hard to find where to include a not windows and not Unix platform.
But in principle I'm not strictly against just use the unix one for now.

as I wrote in the Mailing List already (seems you Devs do not read ;-) now I understand why nobody answered)
I'm not planning LCL Binding, I'm working on this since 2010 ;-) with success.

About my Results:
https://blog.alb42.de/
especially
https://blog.alb42.de/2016/04/20/create-programs-for-all-amiga-platforms-with-lazarus/
The actual MUI Widgetset source on Github (rather old Lazarus version):
https://github.com/alb42/lazarus/tree/lazarus-aros/lcl/interfaces/mui

Juha Manninen

2017-01-03 13:09

developer   ~0097265

I reused the UNIX include files I mentioned but I kept the Amiga IFDEF. A different include file will be easy to add if needed.
I unified some IFDEF syntax and committed in r53853.
Please test.

I read the mailing list but maybe did not pay attention to your post because I don't have an Amiga.

Marcus Sackrow

2017-01-03 15:28

reporter   ~0097268

Thanks :-D

Seems to work. I added it to my Jenkins (Amiga and AROS) to keep an eye on it and prepare the widget set. Mailing list will be ok, I guess? or as Bug again?

Juha Manninen

2017-01-03 15:59

developer   ~0097271

> Mailing list will be ok, I guess?

I try to keep an eye on the mail thread you started. Should be OK.
Resolving this one now.

Marcus Sackrow

2017-01-03 20:58

reporter   ~0097280

Close,
it works

Issue History

Date Modified Username Field Change
2017-01-02 18:54 Marcus Sackrow New Issue
2017-01-02 18:54 Marcus Sackrow File Added: Amiga-LCL-init.diff
2017-01-02 18:57 Zeljan Rikalo Note Added: 0097246
2017-01-02 18:58 Marcus Sackrow Note Added: 0097247
2017-01-02 19:03 Marcus Sackrow Note Edited: 0097247 View Revisions
2017-01-02 19:14 Zeljan Rikalo Note Added: 0097250
2017-01-03 12:02 Juha Manninen Assigned To => Juha Manninen
2017-01-03 12:02 Juha Manninen Status new => assigned
2017-01-03 12:08 Juha Manninen LazTarget => -
2017-01-03 12:08 Juha Manninen Note Added: 0097263
2017-01-03 12:08 Juha Manninen Status assigned => feedback
2017-01-03 12:20 Marcus Sackrow Note Added: 0097264
2017-01-03 12:20 Marcus Sackrow Status feedback => assigned
2017-01-03 12:29 Marcus Sackrow Note Edited: 0097264 View Revisions
2017-01-03 13:03 Juha Manninen Note Edited: 0097263 View Revisions
2017-01-03 13:05 Juha Manninen Note Edited: 0097263 View Revisions
2017-01-03 13:09 Juha Manninen Note Added: 0097265
2017-01-03 15:28 Marcus Sackrow Note Added: 0097268
2017-01-03 15:59 Juha Manninen Fixed in Revision => r53853
2017-01-03 15:59 Juha Manninen Note Added: 0097271
2017-01-03 15:59 Juha Manninen Status assigned => resolved
2017-01-03 15:59 Juha Manninen Resolution open => fixed
2017-01-03 20:58 Marcus Sackrow Note Added: 0097280
2017-01-03 20:58 Marcus Sackrow Status resolved => closed