* move fcl-db/src/*.{inc,pp,pas} to fcl-db/base to be able to specify

dependendies of other subdirectories (such as export and datadict) on it
  * added .NOTPARALLEL to the export and datadict directories

git-svn-id: trunk@9228 -
This commit is contained in:
Jonas Maebe 2007-11-13 08:57:23 +00:00
parent 5a57434f33
commit 44e7fffed5
19 changed files with 485 additions and 6709 deletions

24
.gitattributes vendored
View File

@ -4090,9 +4090,18 @@ packages/fcl-db/Makefile svneol=native#text/plain
packages/fcl-db/Makefile.fpc svneol=native#text/plain
packages/fcl-db/src/Dataset.txt svneol=native#text/plain
packages/fcl-db/src/README -text
packages/fcl-db/src/bufdataset.pas svneol=native#text/plain
packages/fcl-db/src/bufdataset_parser.pp svneol=native#text/plain
packages/fcl-db/src/database.inc svneol=native#text/plain
packages/fcl-db/src/base/bufdataset.pas svneol=native#text/plain
packages/fcl-db/src/base/bufdataset_parser.pp svneol=native#text/plain
packages/fcl-db/src/base/database.inc svneol=native#text/plain
packages/fcl-db/src/base/dataset.inc svneol=native#text/plain
packages/fcl-db/src/base/datasource.inc svneol=native#text/plain
packages/fcl-db/src/base/db.pas svneol=native#text/plain
packages/fcl-db/src/base/dbconst.pas svneol=native#text/plain
packages/fcl-db/src/base/dbwhtml.pp svneol=native#text/plain
packages/fcl-db/src/base/dsparams.inc svneol=native#text/plain
packages/fcl-db/src/base/fields.inc svneol=native#text/plain
packages/fcl-db/src/base/fpmake.inc svneol=native#text/plain
packages/fcl-db/src/base/fpmake.pp svneol=native#text/plain
packages/fcl-db/src/datadict/Makefile svneol=native#text/plain
packages/fcl-db/src/datadict/Makefile.fpc svneol=native#text/plain
packages/fcl-db/src/datadict/buildd.lpi svneol=native#text/plain
@ -4109,9 +4118,6 @@ packages/fcl-db/src/datadict/fpddpq.pp svneol=native#text/plain
packages/fcl-db/src/datadict/fpddregstd.pp svneol=native#text/plain
packages/fcl-db/src/datadict/fpddsqldb.pp svneol=native#text/plain
packages/fcl-db/src/datadict/fpddsqlite3.pp svneol=native#text/plain
packages/fcl-db/src/dataset.inc svneol=native#text/plain
packages/fcl-db/src/datasource.inc svneol=native#text/plain
packages/fcl-db/src/db.pas svneol=native#text/plain
packages/fcl-db/src/dbase/Makefile svneol=native#text/plain
packages/fcl-db/src/dbase/Makefile.fpc svneol=native#text/plain
packages/fcl-db/src/dbase/dbf.pas svneol=native#text/plain
@ -4152,9 +4158,6 @@ packages/fcl-db/src/dbase/package.txt svneol=native#text/plain
packages/fcl-db/src/dbase/readme.txt svneol=native#text/plain
packages/fcl-db/src/dbase/tdbf_l.pas svneol=native#text/plain
packages/fcl-db/src/dbase/testdbf.pp svneol=native#text/plain
packages/fcl-db/src/dbconst.pas svneol=native#text/plain
packages/fcl-db/src/dbwhtml.pp svneol=native#text/plain
packages/fcl-db/src/dsparams.inc svneol=native#text/plain
packages/fcl-db/src/export/Makefile svneol=native#text/plain
packages/fcl-db/src/export/Makefile.fpc svneol=native#text/plain
packages/fcl-db/src/export/fpcsvexport.pp svneol=native#text/plain
@ -4167,9 +4170,6 @@ packages/fcl-db/src/export/fpsimplexmlexport.pp svneol=native#text/plain
packages/fcl-db/src/export/fpsqlexport.pp svneol=native#text/plain
packages/fcl-db/src/export/fpstdexports.pp svneol=native#text/plain
packages/fcl-db/src/export/fptexexport.pp svneol=native#text/plain
packages/fcl-db/src/fields.inc svneol=native#text/plain
packages/fcl-db/src/fpmake.inc svneol=native#text/plain
packages/fcl-db/src/fpmake.pp svneol=native#text/plain
packages/fcl-db/src/memds/Makefile svneol=native#text/plain
packages/fcl-db/src/memds/Makefile.fpc svneol=native#text/plain
packages/fcl-db/src/memds/README -text

File diff suppressed because it is too large Load Diff

View File

@ -7,26 +7,22 @@ name=fcl-db
version=2.0.0
[target]
dirs=src/sdf src/memds src/sqldb
dirs_linux=src/dbase src/sqlite src/export src/datadict
dirs_freebsd=src/dbase src/sqlite src/export src/datadict
dirs_darwin=src/sqlite src/export src/datadict
dirs_solaris=src/sqlite src/export src/datadict
dirs_netbsd=src/sqlite src/export src/datadict
dirs_openbsd=src/sqlite src/export src/datadict
dirs=src/sdf src/memds src/sqldb src/base
dirs_linux=src/sqlite src/export src/datadict
dirs_freebsd=src/sqlite
dirs_darwin=src/sqlite
dirs_solaris=src/sqlite
dirs_netbsd=src/sqlite
dirs_openbsd=src/sqlite
dirs_win32=src/dbase src/sqlite src/export src/datadict
dirs_win64=src/dbase src/export src/datadict
dirs_wince=src/dbase src/sqlite src/export src/datadict
units=dbconst db dbwhtml bufdataset_parser bufdataset
rsts=dbwhtml dbconst
[require]
packages=fcl-base
[compiler]
options=-S2h
unitdir=src/dbase
sourcedir=src
[install]
fpcpackage=y
@ -37,3 +33,21 @@ fpcdir=../..
[rules]
.NOTPARALLEL:
src/export_all: src/base_all src/dbase_all
src/export_debug: src/base_debug src/dbase_debug
src/export_smart: src/base_smart src/dbase_smart
src/export_release: src/base_release src/dbase_release
src/export_shared: src/base_shared src/dbase_shared
src/sdf_all: src/base_all
src/sdf_debug: src/base_debug
src/sdf_smart: src/base_smart
src/sdf_release: src/base_release
src/sdf_shared: src/base_shared
src/dbase_all: src/base_all
src/dbase_debug: src/base_debug
src/dbase_smart: src/base_smart
src/dbase_release: src/base_release
src/dbase_shared: src/base_shared

View File

@ -1,5 +1,5 @@
#
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/10]
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
#
default: all
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
@ -1467,165 +1467,220 @@ else
TAROPT=vz
TAREXT=.tar.gz
endif
override REQUIRE_PACKAGES=rtl
override REQUIRE_PACKAGES=rtl fcl-base
ifeq ($(FULL_TARGET),i386-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-go32v2)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-win32)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_WINUNITS=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-os2)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-freebsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-beos)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-netbsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-solaris)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-qnx)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-netware)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-openbsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-wdosx)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-darwin)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-emx)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-watcom)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-netwlibc)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-wince)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-symbian)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),m68k-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),m68k-freebsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),m68k-netbsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),m68k-amiga)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),m68k-atari)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),m68k-openbsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),m68k-palmos)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),m68k-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc-netbsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc-amiga)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc-macos)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc-darwin)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc-morphos)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),sparc-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),sparc-netbsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),sparc-solaris)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),sparc-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),x86_64-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),x86_64-freebsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),x86_64-darwin)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),x86_64-win64)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_WINUNITS=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),x86_64-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),arm-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),arm-palmos)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),arm-wince)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),arm-gba)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),arm-nds)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),arm-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),arm-symbian)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc64-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc64-darwin)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc64-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifdef REQUIRE_PACKAGES_RTL
PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
@ -1653,6 +1708,58 @@ ifdef UNITDIR_RTL
override COMPILER_UNITDIR+=$(UNITDIR_RTL)
endif
endif
ifdef REQUIRE_PACKAGES_FCL-BASE
PACKAGEDIR_FCL-BASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl-base/Makefile.fpc,$(PACKAGESDIR))))))
ifneq ($(PACKAGEDIR_FCL-BASE),)
ifneq ($(wildcard $(PACKAGEDIR_FCL-BASE)/units/$(TARGETSUFFIX)),)
UNITDIR_FCL-BASE=$(PACKAGEDIR_FCL-BASE)/units/$(TARGETSUFFIX)
else
UNITDIR_FCL-BASE=$(PACKAGEDIR_FCL-BASE)
endif
ifdef CHECKDEPEND
$(PACKAGEDIR_FCL-BASE)/$(FPCMADE):
$(MAKE) -C $(PACKAGEDIR_FCL-BASE) $(FPCMADE)
override ALLDEPENDENCIES+=$(PACKAGEDIR_FCL-BASE)/$(FPCMADE)
endif
else
PACKAGEDIR_FCL-BASE=
UNITDIR_FCL-BASE:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /fcl-base/Package.fpc,$(UNITSDIR)))))
ifneq ($(UNITDIR_FCL-BASE),)
UNITDIR_FCL-BASE:=$(firstword $(UNITDIR_FCL-BASE))
else
UNITDIR_FCL-BASE=
endif
endif
ifdef UNITDIR_FCL-BASE
override COMPILER_UNITDIR+=$(UNITDIR_FCL-BASE)
endif
endif
ifdef REQUIRE_PACKAGES_WINUNITS
PACKAGEDIR_WINUNITS:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /winunits/Makefile.fpc,$(PACKAGESDIR))))))
ifneq ($(PACKAGEDIR_WINUNITS),)
ifneq ($(wildcard $(PACKAGEDIR_WINUNITS)/units/$(TARGETSUFFIX)),)
UNITDIR_WINUNITS=$(PACKAGEDIR_WINUNITS)/units/$(TARGETSUFFIX)
else
UNITDIR_WINUNITS=$(PACKAGEDIR_WINUNITS)
endif
ifdef CHECKDEPEND
$(PACKAGEDIR_WINUNITS)/$(FPCMADE):
$(MAKE) -C $(PACKAGEDIR_WINUNITS) $(FPCMADE)
override ALLDEPENDENCIES+=$(PACKAGEDIR_WINUNITS)/$(FPCMADE)
endif
else
PACKAGEDIR_WINUNITS=
UNITDIR_WINUNITS:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /winunits/Package.fpc,$(UNITSDIR)))))
ifneq ($(UNITDIR_WINUNITS),)
UNITDIR_WINUNITS:=$(firstword $(UNITDIR_WINUNITS))
else
UNITDIR_WINUNITS=
endif
endif
ifdef UNITDIR_WINUNITS
override COMPILER_UNITDIR+=$(UNITDIR_WINUNITS)
endif
endif
ifndef NOCPUDEF
override FPCOPTDEF=$(CPU_TARGET)
endif
@ -2160,3 +2267,4 @@ makefiles: fpc_makefiles
ifneq ($(wildcard fpcmake.loc),)
include fpcmake.loc
endif
.NOTPARALLEL:

View File

@ -5,6 +5,9 @@
[package]
main=fcl-db
[require]
packages=fcl-base
[target]
units=fpdatadict fpdddbf fpddsqldb
units_linux=fpddfb fpddmysql40 fpddmysql41 fpddmysql50 fpddodbc fpddpq fpddoracle fpddsqlite3 fpddregstd
@ -35,3 +38,4 @@ fpcpackage=y
fpcdir=../../../..
[rules]
.NOTPARALLEL:

File diff suppressed because it is too large Load Diff

View File

@ -1,676 +0,0 @@
{ ---------------------------------------------------------------------
TDatalink
---------------------------------------------------------------------}
Constructor TDataLink.Create;
begin
Inherited Create;
FBufferCount:=1;
FFirstRecord := 0;
FDataSource := nil;
FDatasourceFixed:=False;
end;
Destructor TDataLink.Destroy;
begin
Factive:=False;
FEditing:=False;
FDataSourceFixed:=False;
DataSource:=Nil;
Inherited Destroy;
end;
Procedure TDataLink.ActiveChanged;
begin
FFirstRecord := 0;
end;
Procedure TDataLink.CheckActiveAndEditing;
Var
B : Boolean;
begin
B:=Assigned(DataSource) and (DataSource.State<>dsInactive);
If B<>FActive then
begin
FActive:=B;
ActiveChanged;
end;
B:=Assigned(DataSource) and (DataSource.State in dsEditModes) and Not FReadOnly;
If B<>FEditing Then
begin
FEditing:=B;
EditingChanged;
end;
end;
Procedure TDataLink.CheckBrowseMode;
begin
end;
Function TDataLink.CalcFirstRecord(Index : Integer) : Integer;
{ recalculates index of first record in buffer,
and returns number of record scrolled.}
Var
A, // Index of active record in buffer
F, // Index of current first record in buffer
L : Integer; // index of Last (for us) record in buffer;
begin
Result:=0;
A:=DataSource.DataSet.FActiveRecord;
F:=FFirstRecord+Index;
L:=F+FBufferCount-1;
If A>L Then
Result:=A-L
else If A<F Then
Result:=A-F;
FFirstRecord:=F+Result;
{$IfDef dsDebug}
WriteLn('CalcFirstRecord: FFirstRecord=',FFirstRecord,' Scrolled=',Result);
{$Endif}
end;
Procedure TDataLink.CalcRange;
var
aMax, aMin: integer;
begin
aMin:= DataSet.FActiveRecord - FBufferCount + 1;
If aMin < 0 Then aMin:= 0;
aMax:= Dataset.FBufferCount - FBufferCount;
If aMax < 0 then aMax:= 0;
If aMax>DataSet.FActiveRecord Then aMax:=DataSet.FActiveRecord;
If FFirstRecord < aMin Then FFirstRecord:= aMin;
If FFirstrecord > aMax Then FFirstRecord:= aMax;
If (FfirstRecord<>0) And
(DataSet.FActiveRecord - FFirstRecord < FBufferCount -1) Then
Dec(FFirstRecord, 1);
end;
Procedure TDataLink.DataEvent(Event: TDataEvent; Info: Ptrint);
begin
Case Event of
deFieldChange, deRecordChange:
If Not FUpdatingRecord then
RecordChanged(TField(Info));
deDataSetChange: begin
SetActive(DataSource.DataSet.Active);
CalcRange;
CalcFirstRecord(Info);
DatasetChanged;
end;
deDataSetScroll: DatasetScrolled(CalcFirstRecord(Info));
deLayoutChange: begin
CalcFirstRecord(Info);
LayoutChanged;
end;
deUpdateRecord: UpdateRecord;
deUpdateState: CheckActiveAndEditing;
deCheckBrowseMode: CheckBrowseMode;
deFocusControl: FocusControl(TFieldRef(Info));
end;
end;
Procedure TDataLink.DataSetChanged;
begin
RecordChanged(Nil);
end;
Procedure TDataLink.DataSetScrolled(Distance: Integer);
begin
DataSetChanged;
end;
Procedure TDataLink.EditingChanged;
begin
end;
Procedure TDataLink.FocusControl(Field: TFieldRef);
begin
end;
Function TDataLink.GetActiveRecord: Integer;
begin
Result:=Dataset.FActiveRecord - FFirstRecord;
end;
Function TDatalink.GetDataSet : TDataset;
begin
If Assigned(Datasource) then
Result:=DataSource.DataSet
else
Result:=Nil;
end;
Function TDataLink.GetBOF: Boolean;
begin
Result:=DataSet.BOF
end;
Function TDataLink.GetBufferCount: Integer;
begin
Result:=FBufferCount;
end;
Function TDataLink.GetEOF: Boolean;
begin
Result:=DataSet.EOF
end;
Function TDataLink.GetRecordCount: Integer;
begin
Result:=Dataset.FRecordCount;
If Result>BufferCount then
Result:=BufferCount;
end;
Procedure TDataLink.LayoutChanged;
begin
DataSetChanged;
end;
Function TDataLink.MoveBy(Distance: Integer): Integer;
begin
Result:=DataSet.MoveBy(Distance);
end;
Procedure TDataLink.RecordChanged(Field: TField);
begin
end;
Procedure TDataLink.SetActiveRecord(Value: Integer);
begin
{$ifdef dsdebug}
Writeln('Datalink. Setting active record to ',Value,' with firstrecord ',ffirstrecord);
{$endif}
Dataset.FActiveRecord:=Value + FFirstRecord;
end;
Procedure TDataLink.SetBufferCount(Value: Integer);
begin
If FBufferCount<>Value then
begin
FBufferCount:=Value;
if Active then begin
DataSet.RecalcBufListSize;
CalcRange;
end;
end;
end;
procedure TDataLink.SetActive(AActive: Boolean);
begin
if Active <> AActive then
begin
FActive := AActive;
// !!!: Set internal state
ActiveChanged;
end;
end;
Procedure TDataLink.SetDataSource(Value : TDatasource);
begin
if not FDataSourceFixed then
begin
if Assigned(DataSource) then
Begin
DataSource.UnregisterDatalink(Self);
FDataSource := nil;
CheckActiveAndEditing;
End;
FDataSource := Value;
if Assigned(DataSource) then
begin
DataSource.RegisterDatalink(Self);
CheckActiveAndEditing;
End;
end;
end;
Procedure TDatalink.SetReadOnly(Value : Boolean);
begin
If FReadOnly<>Value then
begin
FReadOnly:=Value;
CheckActiveAndEditing;
end;
end;
Procedure TDataLink.UpdateData;
begin
end;
Function TDataLink.Edit: Boolean;
begin
If Not FReadOnly then
DataSource.Edit;
// Triggered event will set FEditing
Result:=FEditing;
end;
Procedure TDataLink.UpdateRecord;
begin
FUpdatingRecord:=True;
Try
UpdateData;
finally
FUpdatingRecord:=False;
end;
end;
{ ---------------------------------------------------------------------
TDetailDataLink
---------------------------------------------------------------------}
Function TDetailDataLink.GetDetailDataSet: TDataSet;
begin
Result := nil;
end;
{ ---------------------------------------------------------------------
TMasterDataLink
---------------------------------------------------------------------}
constructor TMasterDataLink.Create(ADataSet: TDataSet);
begin
inherited Create;
FDetailDataSet:=ADataSet;
FFields:=TList.Create;
end;
destructor TMasterDataLink.Destroy;
begin
FFields.Free;
inherited Destroy;
end;
Procedure TMasterDataLink.ActiveChanged;
begin
FFields.Clear;
if Active then
try
DataSet.GetFieldList(FFields, FFieldNames);
except
FFields.Clear;
raise;
end;
if FDetailDataSet.Active and not (csDestroying in FDetailDataSet.ComponentState) then
if Active and (FFields.Count > 0) then
DoMasterChange
else
DoMasterDisable;
end;
Procedure TMasterDataLink.CheckBrowseMode;
begin
if FDetailDataSet.Active then FDetailDataSet.CheckBrowseMode;
end;
Function TMasterDataLink.GetDetailDataSet: TDataSet;
begin
Result := FDetailDataSet;
end;
Procedure TMasterDataLink.LayoutChanged;
begin
ActiveChanged;
end;
Procedure TMasterDataLink.RecordChanged(Field: TField);
begin
if (DataSource.State <> dsSetKey) and FDetailDataSet.Active and
(FFields.Count > 0) and ((Field = nil) or
(FFields.IndexOf(Field) >= 0)) then
DoMasterChange;
end;
procedure TMasterDatalink.SetFieldNames(const Value: string);
begin
if FFieldNames <> Value then
begin
FFieldNames := Value;
ActiveChanged;
end;
end;
Procedure TMasterDataLink.DoMasterDisable;
begin
if Assigned(FOnMasterDisable) then
FOnMasterDisable(Self);
end;
Procedure TMasterDataLink.DoMasterChange;
begin
If Assigned(FOnMasterChange) then
FOnMasterChange(Self);
end;
{ ---------------------------------------------------------------------
TMasterDataLink
---------------------------------------------------------------------}
constructor TMasterParamsDataLink.Create(ADataSet: TDataSet);
Var
P : TParams;
begin
inherited Create(ADataset);
If (ADataset<>Nil) then
begin
P:=TParams(GetObjectProp(ADataset,'Params',TParams));
if (P<>Nil) then
Params:=P;
end;
end;
Procedure TMasterParamsDataLink.SetParams(AVAlue : TParams);
begin
FParams:=AValue;
If (AValue<>Nil) then
RefreshParamNames;
end;
Procedure TMasterParamsDataLink.RefreshParamNames;
Var
FN : String;
DS : TDataset;
F : TField;
I : Integer;
begin
FN:='';
DS:=Dataset;
If Assigned(FParams) then
begin
F:=Nil;
For I:=0 to FParams.Count-1 do
begin
If Assigned(DS) then
F:=DS.FindField(FParams[i].Name);
If (Not Assigned(DS)) or (F<>Nil) then
begin
If (FN<>'') then
FN:=FN+';';
FN:=FN+FParams[i].Name;
end;
end;
end;
FieldNames:=FN;
end;
Procedure TMasterParamsDataLink.CopyParamsFromMaster(CopyBound : Boolean);
begin
if Assigned(FParams) then
FParams.CopyParamValuesFromDataset(Dataset,CopyBound);
end;
Procedure TMasterParamsDataLink.DoMasterDisable;
begin
Inherited;
If Assigned(DetailDataset) and DetailDataset.Active then
DetailDataset.Close;
end;
Procedure TMasterParamsDataLink.DoMasterChange;
begin
Inherited;
if Assigned(Params) and Assigned(DetailDataset) and DetailDataset.Active then
begin
DetailDataSet.CheckBrowseMode;
DetailDataset.Close;
DetailDataset.Open;
end;
end;
{ ---------------------------------------------------------------------
TDatasource
---------------------------------------------------------------------}
Constructor TDataSource.Create(AOwner: TComponent);
begin
Inherited Create(AOwner);
FDatalinks := TList.Create;
FEnabled := True;
FAutoEdit := True;
end;
Destructor TDataSource.Destroy;
begin
FOnStateCHange:=Nil;
Dataset:=Nil;
With FDataLinks do
While Count>0 do
TDatalink(Items[Count - 1]).DataSource:=Nil;
FDatalinks.Free;
inherited Destroy;
end;
Procedure TDatasource.Edit;
begin
If (State=dsBrowse) and AutoEdit Then
Dataset.Edit;
end;
Function TDataSource.IsLinkedTo(ADataSet: TDataSet): Boolean;
begin
Result:=False;
end;
procedure TDatasource.DistributeEvent(Event: TDataEvent; Info: Ptrint);
Var
i : Longint;
begin
With FDatalinks do
begin
For I:=0 to Count-1 do
With TDatalink(Items[i]) do
If Not VisualControl Then
DataEvent(Event,Info);
For I:=0 to Count-1 do
With TDatalink(Items[i]) do
If VisualControl Then
DataEvent(Event,Info);
end;
end;
procedure TDatasource.RegisterDataLink(DataLink: TDataLink);
begin
FDatalinks.Add(DataLink);
if Assigned(DataSet) then
DataSet.RecalcBufListSize;
end;
procedure TDatasource.SetDataSet(ADataSet: TDataSet);
begin
If FDataset<>Nil Then
Begin
FDataset.UnRegisterDataSource(Self);
FDataSet:=nil;
ProcessEvent(deUpdateState,0);
End;
If ADataset<>Nil Then
begin
ADataset.RegisterDatasource(Self);
FDataSet:=ADataset;
ProcessEvent(deUpdateState,0);
End;
end;
procedure TDatasource.SetEnabled(Value: Boolean);
begin
FEnabled:=Value;
end;
Procedure TDatasource.DoDataChange (Info : Pointer);
begin
If Assigned(OnDataChange) Then
OnDataChange(Self,TField(Info));
end;
Procedure TDatasource.DoStateChange;
begin
If Assigned(OnStateChange) Then
OnStateChange(Self);
end;
Procedure TDatasource.DoUpdateData;
begin
If Assigned(OnUpdateData) Then
OnUpdateData(Self);
end;
procedure TDatasource.UnregisterDataLink(DataLink: TDataLink);
begin
FDatalinks.Remove(Datalink);
If Dataset<>Nil then
DataSet.RecalcBufListSize;
//Dataset.SetBufListSize(DataLink.BufferCount);
end;
procedure TDataSource.ProcessEvent(Event : TDataEvent; Info : Ptrint);
Const
OnDataChangeEvents = [deRecordChange, deDataSetChange, deDataSetScroll,
deLayoutChange,deUpdateState];
Var
NeedDataChange : Boolean;
FLastState : TdataSetState;
begin
// Special UpdateState handling.
If Event=deUpdateState then
begin
NeedDataChange:=(FState=dsInactive);
FLastState:=FState;
If Assigned(Dataset) then
FState:=Dataset.State
else
FState:=dsInactive;
// Don't do events if nothing changed.
If FState=FlastState then
exit;
end
else
NeedDataChange:=True;
DistributeEvent(Event,Info);
// Extra handlers
If Not (csDestroying in ComponentState) then
begin
If (Event=deUpdateState) then
DoStateChange;
If (Event in OnDataChangeEvents) and
NeedDataChange Then
DoDataChange(Nil);
If (Event = deFieldChange) Then
DoDataCHange(Pointer(Info));
If (Event=deUpdateRecord) then
DoUpdateData;
end;
end;

View File

@ -1467,165 +1467,220 @@ else
TAROPT=vz
TAREXT=.tar.gz
endif
override REQUIRE_PACKAGES=rtl
override REQUIRE_PACKAGES=rtl fcl-base
ifeq ($(FULL_TARGET),i386-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-go32v2)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-win32)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_WINUNITS=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-os2)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-freebsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-beos)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-netbsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-solaris)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-qnx)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-netware)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-openbsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-wdosx)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-darwin)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-emx)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-watcom)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-netwlibc)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-wince)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),i386-symbian)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),m68k-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),m68k-freebsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),m68k-netbsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),m68k-amiga)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),m68k-atari)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),m68k-openbsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),m68k-palmos)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),m68k-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc-netbsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc-amiga)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc-macos)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc-darwin)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc-morphos)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),sparc-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),sparc-netbsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),sparc-solaris)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),sparc-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),x86_64-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),x86_64-freebsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),x86_64-darwin)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),x86_64-win64)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_WINUNITS=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),x86_64-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),arm-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),arm-palmos)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),arm-wince)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),arm-gba)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),arm-nds)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),arm-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),arm-symbian)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc64-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc64-darwin)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifeq ($(FULL_TARGET),powerpc64-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_FCL-BASE=1
endif
ifdef REQUIRE_PACKAGES_RTL
PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
@ -1653,6 +1708,58 @@ ifdef UNITDIR_RTL
override COMPILER_UNITDIR+=$(UNITDIR_RTL)
endif
endif
ifdef REQUIRE_PACKAGES_FCL-BASE
PACKAGEDIR_FCL-BASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl-base/Makefile.fpc,$(PACKAGESDIR))))))
ifneq ($(PACKAGEDIR_FCL-BASE),)
ifneq ($(wildcard $(PACKAGEDIR_FCL-BASE)/units/$(TARGETSUFFIX)),)
UNITDIR_FCL-BASE=$(PACKAGEDIR_FCL-BASE)/units/$(TARGETSUFFIX)
else
UNITDIR_FCL-BASE=$(PACKAGEDIR_FCL-BASE)
endif
ifdef CHECKDEPEND
$(PACKAGEDIR_FCL-BASE)/$(FPCMADE):
$(MAKE) -C $(PACKAGEDIR_FCL-BASE) $(FPCMADE)
override ALLDEPENDENCIES+=$(PACKAGEDIR_FCL-BASE)/$(FPCMADE)
endif
else
PACKAGEDIR_FCL-BASE=
UNITDIR_FCL-BASE:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /fcl-base/Package.fpc,$(UNITSDIR)))))
ifneq ($(UNITDIR_FCL-BASE),)
UNITDIR_FCL-BASE:=$(firstword $(UNITDIR_FCL-BASE))
else
UNITDIR_FCL-BASE=
endif
endif
ifdef UNITDIR_FCL-BASE
override COMPILER_UNITDIR+=$(UNITDIR_FCL-BASE)
endif
endif
ifdef REQUIRE_PACKAGES_WINUNITS
PACKAGEDIR_WINUNITS:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /winunits/Makefile.fpc,$(PACKAGESDIR))))))
ifneq ($(PACKAGEDIR_WINUNITS),)
ifneq ($(wildcard $(PACKAGEDIR_WINUNITS)/units/$(TARGETSUFFIX)),)
UNITDIR_WINUNITS=$(PACKAGEDIR_WINUNITS)/units/$(TARGETSUFFIX)
else
UNITDIR_WINUNITS=$(PACKAGEDIR_WINUNITS)
endif
ifdef CHECKDEPEND
$(PACKAGEDIR_WINUNITS)/$(FPCMADE):
$(MAKE) -C $(PACKAGEDIR_WINUNITS) $(FPCMADE)
override ALLDEPENDENCIES+=$(PACKAGEDIR_WINUNITS)/$(FPCMADE)
endif
else
PACKAGEDIR_WINUNITS=
UNITDIR_WINUNITS:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /winunits/Package.fpc,$(UNITSDIR)))))
ifneq ($(UNITDIR_WINUNITS),)
UNITDIR_WINUNITS:=$(firstword $(UNITDIR_WINUNITS))
else
UNITDIR_WINUNITS=
endif
endif
ifdef UNITDIR_WINUNITS
override COMPILER_UNITDIR+=$(UNITDIR_WINUNITS)
endif
endif
ifndef NOCPUDEF
override FPCOPTDEF=$(CPU_TARGET)
endif
@ -2160,3 +2267,4 @@ makefiles: fpc_makefiles
ifneq ($(wildcard fpcmake.loc),)
include fpcmake.loc
endif
.NOTPARALLEL:

View File

@ -9,6 +9,9 @@ main=fcl-db
units=fpdbexport fpcsvexport fpfixedexport fpsqlexport fpsimplexmlexport fpsimplejsonexport fpdbfexport fptexexport fpstdexports
rsts=fpdbexport fpcsvexport fpfixedexport fpsqlexport fpsimplexmlexport fpsimplejsonexport fpdbfexport fptexexport fpstdexports
[require]
packages=fcl-base
[compiler]
options=-S2h
@ -19,6 +22,7 @@ fpcpackage=y
fpcdir=../../../..
[rules]
.NOTPARALLEL:
#fpdbexport$(PPUEXT): fpdbexport$(PPEXT)
#fpcsvexport$(PPUEXT): fpdbexport$(PPEXT)

File diff suppressed because it is too large Load Diff