--- Merging r29403 into '.':

U    packages/amunits/src/coreunits/iffparse.pas
U    packages/morphunits/src/iffparse.pas
--- Merging r29404 into '.':
A    packages/ami-extra
A    packages/ami-extra/README.txt
A    packages/ami-extra/Makefile
A    packages/ami-extra/fpmake.pp
A    packages/ami-extra/Makefile.fpc
A    packages/ami-extra/src
A    packages/ami-extra/src/cliputils.pas
A    packages/ami-extra/Makefile.fpc.fpcmake
--- Merging r29405 into '.':
U    packages/Makefile.fpc.fpcmake
U    packages/fpmake_proc.inc
U    packages/fpmake_add.inc
--- Merging r29406 into '.':
U    ide/winclip.pas
U    ide/fphelp.pas
U    ide/fpide.pas
U    ide/globdir.inc

# revisions: 29403,29404,29405,29406

git-svn-id: branches/fixes_3_0@29413 -
This commit is contained in:
marco 2015-01-05 13:35:29 +00:00
parent e1bbaa8bf5
commit dcbe6952c3
16 changed files with 2734 additions and 17 deletions

6
.gitattributes vendored
View File

@ -970,6 +970,12 @@ packages/a52/Makefile.fpc svneol=native#text/plain
packages/a52/Makefile.fpc.fpcmake svneol=native#text/plain
packages/a52/fpmake.pp svneol=native#text/plain
packages/a52/src/a52.pas svneol=native#text/plain
packages/ami-extra/Makefile svneol=native#text/plain
packages/ami-extra/Makefile.fpc svneol=native#text/plain
packages/ami-extra/Makefile.fpc.fpcmake svneol=native#text/plain
packages/ami-extra/README.txt svneol=native#text/plain
packages/ami-extra/fpmake.pp svneol=native#text/plain
packages/ami-extra/src/cliputils.pas svneol=native#text/plain
packages/amunits/Makefile svneol=native#text/plain
packages/amunits/Makefile.fpc svneol=native#text/plain
packages/amunits/Makefile.fpc.fpcmake svneol=native#text/plain

View File

@ -115,10 +115,15 @@ const
hint_editcut = 'Remove the selected text and put it in the clipboard';
hint_editcopy = 'Copy the selected text in the clipboard';
hint_editpaste = 'Insert selected text from the clipboard at the cursor position';
{$ifdef HASAMIGA}
{$ifdef AROS}
hint_editcopywin = 'Copy the selected text in AROS clipboard';
hint_editpastewin = 'Insert selected text from AROS clipboard at the cursor position';
{$else}
hint_editcopywin = 'Copy the selected text to the system clipboard';
hint_editpastewin = 'Insert selected text from the system clipboard at the cursor position';
{$endif}
{$else}
hint_editcopywin = 'Copy the selected text in windows clipboard';
hint_editpastewin = 'Insert selected text from windows clipboard at the cursor position';
{$endif}

View File

@ -235,10 +235,15 @@ resourcestring menu_local_gotosource = '~G~oto source';
menu_file_exit = 'E~x~it';
menu_edit = '~E~dit';
{$ifdef HASAMIGA}
{$ifdef AROS}
menu_edit_copywin = 'Cop~y~ to AROS';
menu_edit_pastewin = 'Paste from A~R~OS';
{$else}
menu_edit_copywin = 'Cop~y~ to System';
menu_edit_pastewin = 'Paste from Syste~m~';
{$endif}
{$else}
menu_edit_copywin = 'Cop~y~ to Windows';
menu_edit_pastewin = 'Paste from ~W~indows';
{$endif}

View File

@ -100,10 +100,12 @@
{$ifdef Amiga}
{$define FSCaseInsensitive}
{$define WinClipSupported}
{$endif}
{$ifdef MorphOS}
{$define FSCaseInsensitive}
{$define WinClipSupported}
{$endif}
{$ifdef AROS}

View File

@ -46,11 +46,12 @@ implementation
strings,windows;
{$endif Windows}
{$ifdef aros}
{$ifdef HASAMIGA}
uses
clipboard;
clipboard,cliputils;
{$endif}
{$ifdef DOS}
function WinClipboardSupported : boolean;
var
@ -134,7 +135,7 @@ begin
end;
{$endif Windows}
{$ifdef Aros}
{$ifdef HASAMIGA}
function WinClipboardSupported: Boolean;
begin
WinClipboardSupported := True;
@ -162,7 +163,7 @@ begin
Text := GetTextFromClip(PRIMARY_CLIP);
InternGetDataSize := Length(Text);
end;
{$endif Aros}
{$endif HASAMIGA}
function GetTextWinClipboardSize : longint;
@ -182,10 +183,10 @@ var
h : HGlobal;
pp : pchar;
{$endif Windows}
{$ifdef aros}
{$ifdef HASAMIGA}
Text: AnsiString;
pp: PChar;
{$endif aros}
{$endif HASAMIGA}
begin
p:=nil;
GetTextWinClipBoardData:=False;
@ -220,14 +221,14 @@ begin
end;
GetTextWinClipBoardData:=h<>0;
{$endif Windows}
{$ifdef aros}
{$ifdef HASAMIGA}
Text := GetTextFromClip(0) + #0;
PP := @Text[1];
l := Length(Text);
GetMem(p,l);
Move(pp^,p^,l);
GetTextWinClipBoardData := True;
{$endif aros}
{$endif HASAMIGA}
CloseWinClipBoard;
{$ifdef DOS}
M.MoveDataFrom(l,P^);
@ -246,10 +247,10 @@ var
pp : pchar;
res : boolean;
{$endif Windows}
{$ifdef aros}
{$ifdef HASAMIGA}
pp: PChar;
Test: AnsiString;
{$endif aros}
{$endif HASAMIGA}
begin
SetTextWinClipBoardData:=False;
if (l=0) or (l>65520) then
@ -290,9 +291,9 @@ begin
GlobalUnlock(h);
SetTextWinClipBoardData:=res;
{$endif Windows}
{$ifdef Aros}
{$ifdef HASAMIGA}
PutTextToClip(0, AnsiString(p));
{$endif Aros}
{$endif HASAMIGA}
CloseWinClipBoard;
end;

View File

@ -66,9 +66,9 @@ dirs_netware=rtl-console rtl-unicode fv zlib unzip
dirs_netwlibc=rtl-console rtl-unicode fv zlib unzip
dirs_palmos=palmunits
dirs_go32v2=rtl-console rtl-unicode fv graph unzip gdbint
dirs_amiga=amunits rtl-console rtl-unicode fv
dirs_morphos=morphunits rtl-console rtl-unicode fv opengl sdl
dirs_aros=arosunits rtl-console rtl-unicode fv
dirs_amiga=amunits ami-extra rtl-console rtl-unicode fv
dirs_morphos=morphunits ami-extra rtl-console rtl-unicode fv opengl sdl
dirs_aros=arosunits ami-extra rtl-console rtl-unicode fv
dirs_wii=libogcfpc
dirs_arm_nds=libndsfpc

2401
packages/ami-extra/Makefile Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,91 @@
#
# Makefile.fpc for running fpmake
#
[package]
name=ami-extra
version=3.1.1
[require]
packages=rtl fpmkunit
[install]
fpcpackage=y
[default]
fpcdir=../..
[prerules]
FPMAKE_BIN_CLEAN=$(wildcard ./fpmake$(SRCEXEEXT))
ifdef OS_TARGET
FPC_TARGETOPT+=--os=$(OS_TARGET)
endif
ifdef CPU_TARGET
FPC_TARGETOPT+=--cpu=$(CPU_TARGET)
endif
LOCALFPMAKE=./fpmake$(SRCEXEEXT)
[rules]
# Do not pass the Makefile's unit and binary target locations. fpmake uses it's own.
override FPCOPT:=$(filter-out -FU%,$(FPCOPT))
override FPCOPT:=$(filter-out -FE%,$(FPCOPT))
# Compose general fpmake-parameters
ifdef FPMAKEOPT
FPMAKE_OPT+=$(FPMAKEOPT)
endif
FPMAKE_OPT+=--localunitdir=../..
FPMAKE_OPT+=--globalunitdir=..
FPMAKE_OPT+=$(FPC_TARGETOPT)
FPMAKE_OPT+=$(addprefix -o ,$(FPCOPT))
FPMAKE_OPT+=--compiler=$(FPC)
FPMAKE_OPT+=-bu
.NOTPARALLEL:
fpmake: fpmake.pp
$(FPCFPMAKE) fpmake.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(COMPILER_FPMAKE_UNITDIR)) $(FPCMAKEOPT) $(OPT)
all: fpmake
$(LOCALFPMAKE) compile $(FPMAKE_OPT)
smart: fpmake
$(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -XX -o -CX
release: fpmake
$(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dRELEASE
debug: fpmake
$(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dDEBUG
# If no fpmake exists and (dist)clean is called, do not try to build fpmake, it will
# most often fail because the dependencies are cleared.
# In case of a clean, simply do nothing
ifeq ($(FPMAKE_BIN_CLEAN),)
clean:
else
clean:
$(FPMAKE_BIN_CLEAN) clean $(FPMAKE_OPT)
endif
# In case of a distclean, perform an 'old'-style distclean. This to avoid problems
# when the package is compiled using fpcmake prior to running this clean using fpmake
ifeq ($(FPMAKE_BIN_CLEAN),)
distclean: $(addsuffix _distclean,$(TARGET_DIRS)) fpc_cleanall
else
distclean:
ifdef inUnix
{ $(FPMAKE_BIN_CLEAN) distclean $(FPMAKE_OPT); if [ $$? != "0" ]; then { echo Something wrong with fpmake exectable. Remove the executable and call make recursively to recover.; $(DEL) $(FPMAKE_BIN_CLEAN); $(MAKE) fpc_cleanall; }; fi; }
else
$(FPMAKE_BIN_CLEAN) distclean $(FPMAKE_OPT)
endif
-$(DEL) $(LOCALFPMAKE)
endif
cleanall: distclean
install: fpmake
ifdef UNIXHier
$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR)
else
$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR)
endif
# distinstall also installs the example-sources
distinstall: fpmake
ifdef UNIXHier
$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR) -ie
else
$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR) -ie
endif
zipinstall: fpmake
$(LOCALFPMAKE) zipinstall $(FPMAKE_OPT)

View File

@ -0,0 +1,23 @@
#
# Makefile.fpc for Free Pascal Amiga-like Extra Units
#
[package]
name=ami-extra
version=3.1.1
[target]
units=cliputils
[compiler]
includedir=src
sourcedir=src
[install]
fpcpackage=y
[default]
fpcdir=../..
[rules]
.NOTPARALLEL:

View File

@ -0,0 +1,9 @@
This package contains additional utility and helper units
which are common to Amiga-like systems. Most utility units
(which are not deprecated) from amunits package should be
moved in here, and get compiled also for AROS and MorphOS.
This package is not for interface units for 3rd party
libraries, because those are mostly system specific, or
contain system specific information (aligment, ABI dependent
function call declarations, etc).

View File

@ -0,0 +1,40 @@
{$ifndef ALLPACKAGES}
{$mode objfpc}{$H+}
program fpmake;
uses fpmkunit;
Var
P : TPackage;
T : TTarget;
begin
With Installer do
begin
{$endif ALLPACKAGES}
P:=AddPackage('ami-extra');
P.Author := 'FPC core team';
P.License := 'LGPL with modification';
P.HomepageURL := 'www.freepascal.org';
P.Description := 'ami-extra, additional units for Amiga-like systems';
P.Dependencies.Add('morphunits',[morphos]);
P.Dependencies.Add('arosunits',[aros]);
P.Dependencies.Add('amunits',[amiga]);
{$ifdef ALLPACKAGES}
P.Directory:=ADirectory;
{$endif ALLPACKAGES}
P.Version:='3.1.1';
P.SourcePath.Add('src');
P.OSes:=AllAmigaLikeOSes;
T:=P.Targets.AddUnit('cliputils.pas');
{$ifndef ALLPACKAGES}
Run;
end;
end.
{$endif ALLPACKAGES}

View File

@ -0,0 +1,127 @@
{
This file is part of the Free Pascal run time library.
Copyright (c) 2014 by Free Pascal development team
Clipboard helper functions for Amiga-likes
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
{$MODE OBJFPC}
{$H+}
unit cliputils;
interface
function GetTextFromClip(ClipUnit: Byte): string;
function PutTextToClip(ClipUnit: Byte; Text: string): Boolean;
implementation
uses
exec, clipboard, iffparse;
const
ID_FTXT = 1179932756;
ID_CHRS = 1128813139;
function GetTextFromClip(ClipUnit: Byte): string;
var
Iff: PIffHandle;
Error: LongInt;
Cn: PContextNode;
Buf: PChar;
Len: Integer;
Cu: LongInt;
begin
Result := '';
Cu := ClipUnit;
Iff := AllocIff;
if Assigned(Iff) then
begin
InitIffAsClip(iff);
Iff^.iff_Stream := LongWord(OpenClipboard(Cu));
if Iff^.iff_Stream<>0 then
begin
if OpenIff(Iff, IFFF_READ) = 0 then
begin
if StopChunk(iff, ID_FTXT, ID_CHRS) = 0 then
begin
while True do
begin
Error := ParseIff(iff, IFFPARSE_SCAN);
if (Error <> 0) and (Error <> IFFERR_EOC) then
Break;
Cn := CurrentChunk(Iff);
if not Assigned(Cn) then
begin
Continue;
end;
Len := Cn^.cn_Size;
if (Cn^.cn_Type = ID_FTXT) and (Cn^.cn_ID = ID_CHRS) and (Len > 0) then
begin
GetMem(Buf, Len + 1);
FillChar(Buf^, Len + 1, #0);
try
ReadChunkBytes(Iff, Buf, Len);
Result := Result + string(Buf);
finally
FreeMem(Buf);
end;
end;
end;
end;
CloseIff(Iff);
end;
CloseClipboard(PClipBoardHandle(iff^.iff_Stream));
end;
FreeIFF(Iff);
end;
end;
function PutTextToClip(ClipUnit: Byte; Text: string): Boolean;
var
Iff: PIffHandle;
TText: string;
Len: Integer;
begin
Result := False;
Iff := AllocIff;
if Assigned(Iff) then
begin
InitIffAsClip(iff);
Iff^.iff_Stream := LongWord(OpenClipboard(ClipUnit));
if Iff^.iff_Stream <> 0 then
begin
if OpenIff(Iff, IFFF_WRITE) = 0 then
begin
if PushChunk(iff, ID_FTXT, ID_FORM, IFFSIZE_UNKNOWN) = 0 then
begin
if PushChunk(iff, 0, ID_CHRS, IFFSIZE_UNKNOWN) = 0 then
begin
Len := Length(Text);
TText := Text + #0;
Result := WriteChunkBytes(iff, @(TText[1]), Len) = len;
PopChunk(iff);
end;
PopChunk(iff);
end;
CloseIff(iff);
end;
CloseClipboard(PClipBoardHandle(iff^.iff_Stream));
end;
FreeIFF(Iff);
end;
end;
begin
{$IF DEFINED(MORPHOS) OR DEFINED(AMIGA)}
InitIFFParseLibrary;
{$ENDIF}
end.

View File

@ -237,7 +237,7 @@ VAR IFFParseBase : pLibrary;
FUNCTION AllocIFF : pIFFHandle; syscall IFFParseBase 030;
FUNCTION AllocLocalItem(typ : LONGINT location 'd0'; id : LONGINT location 'd1'; ident : LONGINT location 'd2'; dataSize : LONGINT location 'd3') : pLocalContextItem; syscall IFFParseBase 186;
PROCEDURE CloseClipboard(clipHandle : pClipboardHandle location 'd0'); syscall IFFParseBase 252;
PROCEDURE CloseClipboard(clipHandle : pClipboardHandle location 'a0'); syscall IFFParseBase 252;
PROCEDURE CloseIFF(iff : pIFFHandle location 'a0'); syscall IFFParseBase 048;
FUNCTION CollectionChunk(iff : pIFFHandle location 'a0'; typ : LONGINT location 'd0'; id : LONGINT location 'd1') : LONGINT; syscall IFFParseBase 138;
FUNCTION CollectionChunks(iff : pIFFHandle location 'a0'; const propArray : pLONGINT location 'a1'; numPairs : LONGINT location 'd0') : LONGINT; syscall IFFParseBase 144;

View File

@ -1,4 +1,5 @@
add_a52(ADirectory+IncludeTrailingPathDelimiter('a52'));
add_ami_extra(ADirectory+IncludeTrailingPathDelimiter('ami-extra'));
add_amunits(ADirectory+IncludeTrailingPathDelimiter('amunits'));
add_arosunits(ADirectory+IncludeTrailingPathDelimiter('arosunits'));
add_aspell(ADirectory+IncludeTrailingPathDelimiter('aspell'));

View File

@ -4,6 +4,12 @@ begin
{$include a52/fpmake.pp}
end;
procedure add_ami_extra(const ADirectory: string);
begin
with Installer do
{$include ami-extra/fpmake.pp}
end;
procedure add_amunits(const ADirectory: string);
begin
with Installer do

View File

@ -227,7 +227,7 @@ VAR IFFParseBase : pLibrary;
FUNCTION AllocIFF : pIFFHandle; syscall IFFParseBase 030;
FUNCTION AllocLocalItem(typ : LONGINT location 'd0'; id : LONGINT location 'd1'; ident : LONGINT location 'd2'; dataSize : LONGINT location 'd3') : pLocalContextItem; syscall IFFParseBase 186;
PROCEDURE CloseClipboard(clipHandle : pClipboardHandle location 'd0'); syscall IFFParseBase 252;
PROCEDURE CloseClipboard(clipHandle : pClipboardHandle location 'a0'); syscall IFFParseBase 252;
PROCEDURE CloseIFF(iff : pIFFHandle location 'a0'); syscall IFFParseBase 048;
FUNCTION CollectionChunk(iff : pIFFHandle location 'a0'; typ : LONGINT location 'd0'; id : LONGINT location 'd1') : LONGINT; syscall IFFParseBase 138;
FUNCTION CollectionChunks(iff : pIFFHandle location 'a0'; const propArray : pLONGINT location 'a1'; numPairs : LONGINT location 'd0') : LONGINT; syscall IFFParseBase 144;