mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 01:49:11 +02:00
* synchronized with trunk
git-svn-id: branches/z80@44671 -
This commit is contained in:
commit
611ac9076b
@ -314,21 +314,9 @@ unit cpubase;
|
|||||||
R_INTREGISTER :
|
R_INTREGISTER :
|
||||||
reg_cgsize:=OS_32;
|
reg_cgsize:=OS_32;
|
||||||
R_FPUREGISTER :
|
R_FPUREGISTER :
|
||||||
reg_cgsize:=OS_F80;
|
reg_cgsize:=OS_F32;
|
||||||
R_MMREGISTER :
|
|
||||||
begin
|
|
||||||
case getsubreg(reg) of
|
|
||||||
R_SUBFD,
|
|
||||||
R_SUBWHOLE:
|
|
||||||
result:=OS_F64;
|
|
||||||
R_SUBFS:
|
|
||||||
result:=OS_F32;
|
|
||||||
else
|
|
||||||
internalerror(2009112903);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
else
|
else
|
||||||
internalerror(200303181);
|
internalerror(2020040501);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -92,6 +92,7 @@ unit cpupi;
|
|||||||
localsize : aint;
|
localsize : aint;
|
||||||
i : longint;
|
i : longint;
|
||||||
begin
|
begin
|
||||||
|
maxpushedparasize:=Align(maxpushedparasize,4);
|
||||||
tg.setfirsttemp(maxpushedparasize);
|
tg.setfirsttemp(maxpushedparasize);
|
||||||
|
|
||||||
if po_nostackframe in procdef.procoptions then
|
if po_nostackframe in procdef.procoptions then
|
||||||
|
@ -199,6 +199,15 @@ type
|
|||||||
class function Command: string;
|
class function Command: string;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TPDFClipPath }
|
||||||
|
|
||||||
|
TPDFClipPath = class(TPDFDocumentObject)
|
||||||
|
protected
|
||||||
|
procedure Write(const AStream: TStream); override;
|
||||||
|
public
|
||||||
|
class function Command: string;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
TPDFPushGraphicsStack = class(TPDFDocumentObject)
|
TPDFPushGraphicsStack = class(TPDFDocumentObject)
|
||||||
protected
|
protected
|
||||||
@ -668,6 +677,9 @@ type
|
|||||||
|
|
||||||
{ When the WriteXXX() and DrawXXX() methods specify coordinates, they do it as
|
{ When the WriteXXX() and DrawXXX() methods specify coordinates, they do it as
|
||||||
per the PDF specification, from the bottom-left. }
|
per the PDF specification, from the bottom-left. }
|
||||||
|
|
||||||
|
{ TPDFPage }
|
||||||
|
|
||||||
TPDFPage = Class(TPDFDocumentObject)
|
TPDFPage = Class(TPDFDocumentObject)
|
||||||
private
|
private
|
||||||
FObjects : TObjectList;
|
FObjects : TObjectList;
|
||||||
@ -731,6 +743,7 @@ type
|
|||||||
procedure DrawPolyLine(const APoints: array of TPDFCoord; const ALineWidth: TPDFFloat);
|
procedure DrawPolyLine(const APoints: array of TPDFCoord; const ALineWidth: TPDFFloat);
|
||||||
{ start a new subpath }
|
{ start a new subpath }
|
||||||
procedure ResetPath;
|
procedure ResetPath;
|
||||||
|
procedure ClipPath;
|
||||||
{ Close the current subpath by appending a straight line segment from the current point to the starting point of the subpath. }
|
{ Close the current subpath by appending a straight line segment from the current point to the starting point of the subpath. }
|
||||||
procedure ClosePath;
|
procedure ClosePath;
|
||||||
procedure ClosePathStroke;
|
procedure ClosePathStroke;
|
||||||
@ -740,6 +753,9 @@ type
|
|||||||
procedure FillStrokePath;
|
procedure FillStrokePath;
|
||||||
{ Fill using the Even-Odd rule. }
|
{ Fill using the Even-Odd rule. }
|
||||||
procedure FillEvenOddStrokePath;
|
procedure FillEvenOddStrokePath;
|
||||||
|
{ Graphic stack management }
|
||||||
|
procedure PushGraphicsStack;
|
||||||
|
procedure PopGraphicsStack;
|
||||||
{ Move the current drawing position to (x, y) }
|
{ Move the current drawing position to (x, y) }
|
||||||
procedure MoveTo(x, y: TPDFFloat); overload;
|
procedure MoveTo(x, y: TPDFFloat); overload;
|
||||||
procedure MoveTo(APos: TPDFCoord); overload;
|
procedure MoveTo(APos: TPDFCoord); overload;
|
||||||
@ -849,10 +865,13 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{ TPDFFontDefs }
|
||||||
|
|
||||||
TPDFFontDefs = Class(TCollection)
|
TPDFFontDefs = Class(TCollection)
|
||||||
private
|
private
|
||||||
function GetF(AIndex : Integer): TPDFFont;
|
function GetF(AIndex : Integer): TPDFFont;
|
||||||
Public
|
Public
|
||||||
|
Function FindFont(const AName:string):integer;
|
||||||
Function AddFontDef : TPDFFont;
|
Function AddFontDef : TPDFFont;
|
||||||
Property FontDefs[AIndex : Integer] : TPDFFont Read GetF; Default;
|
Property FontDefs[AIndex : Integer] : TPDFFont Read GetF; Default;
|
||||||
end;
|
end;
|
||||||
@ -1457,7 +1476,6 @@ begin
|
|||||||
SetLength(result, iPos - 1);
|
SetLength(result, iPos - 1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ TPDFMemoryStream }
|
{ TPDFMemoryStream }
|
||||||
|
|
||||||
procedure TPDFMemoryStream.Write(const AStream: TStream);
|
procedure TPDFMemoryStream.Write(const AStream: TStream);
|
||||||
@ -1814,6 +1832,19 @@ begin
|
|||||||
Result := 'S' + CRLF;
|
Result := 'S' + CRLF;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TPDFClipPath }
|
||||||
|
|
||||||
|
procedure TPDFClipPath.Write(const AStream: TStream);
|
||||||
|
begin
|
||||||
|
WriteString(Command, AStream);
|
||||||
|
end;
|
||||||
|
|
||||||
|
class function TPDFClipPath.Command: string;
|
||||||
|
begin
|
||||||
|
Result := 'W n' + CRLF;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ TPDFPushGraphicsStack }
|
{ TPDFPushGraphicsStack }
|
||||||
|
|
||||||
procedure TPDFPushGraphicsStack.Write(const AStream: TStream);
|
procedure TPDFPushGraphicsStack.Write(const AStream: TStream);
|
||||||
@ -1831,6 +1862,9 @@ end;
|
|||||||
procedure TPDFPopGraphicsStack.Write(const AStream: TStream);
|
procedure TPDFPopGraphicsStack.Write(const AStream: TStream);
|
||||||
begin
|
begin
|
||||||
WriteString(Command, AStream);
|
WriteString(Command, AStream);
|
||||||
|
// disable cache
|
||||||
|
Self.Document.CurrentWidth:='';
|
||||||
|
Self.Document.CurrentColor:='';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TPDFPopGraphicsStack.Command: string;
|
class function TPDFPopGraphicsStack.Command: string;
|
||||||
@ -2616,6 +2650,12 @@ begin
|
|||||||
AddObject(TPDFResetPath.Create(Document));
|
AddObject(TPDFResetPath.Create(Document));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TPDFPage.ClipPath;
|
||||||
|
begin
|
||||||
|
AddObject(TPDFClipPath.Create(Document));
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TPDFPage.ClosePath;
|
procedure TPDFPage.ClosePath;
|
||||||
begin
|
begin
|
||||||
AddObject(TPDFClosePath.Create(Document));
|
AddObject(TPDFClosePath.Create(Document));
|
||||||
@ -2641,6 +2681,16 @@ begin
|
|||||||
AddObject(TPDFFreeFormString.Create(Document, 'B*'+CRLF));
|
AddObject(TPDFFreeFormString.Create(Document, 'B*'+CRLF));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TPDFPage.PushGraphicsStack;
|
||||||
|
begin
|
||||||
|
AddObject(TPDFPushGraphicsStack.Create(Document));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPDFPage.PopGraphicsStack;
|
||||||
|
begin
|
||||||
|
AddObject(TPDFPopGraphicsStack.Create(Document));
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TPDFPage.MoveTo(x, y: TPDFFloat);
|
procedure TPDFPage.MoveTo(x, y: TPDFFloat);
|
||||||
var
|
var
|
||||||
p1: TPDFCoord;
|
p1: TPDFCoord;
|
||||||
@ -2764,6 +2814,21 @@ begin
|
|||||||
Result:=Items[AIndex] as TPDFFont;
|
Result:=Items[AIndex] as TPDFFont;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TPDFFontDefs.FindFont(const AName: string): integer;
|
||||||
|
var
|
||||||
|
i:integer;
|
||||||
|
begin
|
||||||
|
Result:=-1;
|
||||||
|
for i := 0 to Count-1 do
|
||||||
|
begin
|
||||||
|
if GetF(i).Name = AName then
|
||||||
|
begin
|
||||||
|
Result := i;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TPDFFontDefs.AddFontDef: TPDFFont;
|
function TPDFFontDefs.AddFontDef: TPDFFont;
|
||||||
begin
|
begin
|
||||||
Result:=Add as TPDFFont;
|
Result:=Add as TPDFFont;
|
||||||
@ -6046,14 +6111,8 @@ var
|
|||||||
i: integer;
|
i: integer;
|
||||||
begin
|
begin
|
||||||
{ reuse existing font definition if it exists }
|
{ reuse existing font definition if it exists }
|
||||||
for i := 0 to Fonts.Count-1 do
|
Result:=Fonts.FindFont(AName);
|
||||||
begin
|
if Result>=0 then exit;
|
||||||
if Fonts[i].Name = AName then
|
|
||||||
begin
|
|
||||||
Result := i;
|
|
||||||
Exit;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
F := Fonts.AddFontDef;
|
F := Fonts.AddFontDef;
|
||||||
F.Name := AName;
|
F.Name := AName;
|
||||||
F.IsStdFont := True;
|
F.IsStdFont := True;
|
||||||
@ -6067,14 +6126,8 @@ var
|
|||||||
lFName: string;
|
lFName: string;
|
||||||
begin
|
begin
|
||||||
{ reuse existing font definition if it exists }
|
{ reuse existing font definition if it exists }
|
||||||
for i := 0 to Fonts.Count-1 do
|
Result:=Fonts.FindFont(AName);
|
||||||
begin
|
if Result>=0 then exit;
|
||||||
if Fonts[i].Name = AName then
|
|
||||||
begin
|
|
||||||
Result := i;
|
|
||||||
Exit;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
F := Fonts.AddFontDef;
|
F := Fonts.AddFontDef;
|
||||||
if ExtractFilePath(AFontFile) <> '' then
|
if ExtractFilePath(AFontFile) <> '' then
|
||||||
// assume AFontFile is the full path to the TTF file
|
// assume AFontFile is the full path to the TTF file
|
||||||
|
@ -14,9 +14,13 @@
|
|||||||
|
|
||||||
**********************************************************************}
|
**********************************************************************}
|
||||||
unit getopts;
|
unit getopts;
|
||||||
Interface
|
|
||||||
{$modeswitch advancedrecords}
|
{$modeswitch advancedrecords}
|
||||||
{$modeswitch defaultparameters}
|
{$modeswitch defaultparameters}
|
||||||
|
{$h+}
|
||||||
|
|
||||||
|
Interface
|
||||||
|
|
||||||
Const
|
Const
|
||||||
No_Argument = 0;
|
No_Argument = 0;
|
||||||
Required_Argument = 1;
|
Required_Argument = 1;
|
||||||
@ -51,11 +55,6 @@ Function GetLongOpts (ShortOpts : String;LongOpts : POption;var Longind : Longin
|
|||||||
Implementation
|
Implementation
|
||||||
|
|
||||||
|
|
||||||
Procedure TOption.SetOption(const aName:String;AHas_Arg:integer=0;AFlag:PChar=nil;AValue:Char=#0);
|
|
||||||
begin
|
|
||||||
Name:=aName; Has_Arg:=AHas_Arg; Flag:=AFlag; Value:=Avalue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{$IFNDEF FPC}
|
{$IFNDEF FPC}
|
||||||
{***************************************************************************
|
{***************************************************************************
|
||||||
@ -147,6 +146,20 @@ end;
|
|||||||
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
function strpas(p : pchar) : ansistring;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if p=nil then
|
||||||
|
strpas:=''
|
||||||
|
else
|
||||||
|
strpas:=p;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Procedure TOption.SetOption(const aName:String;AHas_Arg:integer=0;AFlag:PChar=nil;AValue:Char=#0);
|
||||||
|
begin
|
||||||
|
Name:=aName; Has_Arg:=AHas_Arg; Flag:=AFlag; Value:=Avalue;
|
||||||
|
end;
|
||||||
|
|
||||||
{***************************************************************************
|
{***************************************************************************
|
||||||
Real Getopts
|
Real Getopts
|
||||||
***************************************************************************}
|
***************************************************************************}
|
||||||
|
@ -291,10 +291,14 @@ type
|
|||||||
|
|
||||||
{ open an epoll file descriptor }
|
{ open an epoll file descriptor }
|
||||||
function epoll_create(size: cint): cint; {$ifdef FPC_USE_LIBC} cdecl; external name 'epoll_create'; {$endif}
|
function epoll_create(size: cint): cint; {$ifdef FPC_USE_LIBC} cdecl; external name 'epoll_create'; {$endif}
|
||||||
|
function epoll_create1(flags: cint): cint; {$ifdef FPC_USE_LIBC} cdecl; external name 'epoll_create1'; {$endif}
|
||||||
|
|
||||||
{ control interface for an epoll descriptor }
|
{ control interface for an epoll descriptor }
|
||||||
function epoll_ctl(epfd, op, fd: cint; event: pepoll_event): cint; {$ifdef FPC_USE_LIBC} cdecl; external name 'epoll_ctl'; {$endif}
|
function epoll_ctl(epfd, op, fd: cint; event: pepoll_event): cint; {$ifdef FPC_USE_LIBC} cdecl; external name 'epoll_ctl'; {$endif}
|
||||||
|
|
||||||
{ wait for an I/O event on an epoll file descriptor }
|
{ wait for an I/O event on an epoll file descriptor }
|
||||||
function epoll_wait(epfd: cint; events: pepoll_event; maxevents, timeout: cint): cint; {$ifdef FPC_USE_LIBC} cdecl; external name 'epoll_wait'; {$endif}
|
function epoll_wait(epfd: cint; events: pepoll_event; maxevents, timeout: cint): cint; {$ifdef FPC_USE_LIBC} cdecl; external name 'epoll_wait'; {$endif}
|
||||||
|
function epoll_pwait(epfd: cint; events: pepoll_event; maxevents, timeout: cint; sigmask: PSigSet): cint; {$ifdef FPC_USE_LIBC} cdecl; external name 'epoll_pwait'; {$endif}
|
||||||
|
|
||||||
type Puser_cap_header=^user_cap_header;
|
type Puser_cap_header=^user_cap_header;
|
||||||
user_cap_header=record
|
user_cap_header=record
|
||||||
@ -630,6 +634,17 @@ begin
|
|||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function epoll_create1(flags: cint): cint;
|
||||||
|
begin
|
||||||
|
epoll_create1 := do_syscall(syscall_nr_epoll_create1, tsysparam(flags));
|
||||||
|
end;
|
||||||
|
|
||||||
|
function epoll_pwait(epfd: cint; events: pepoll_event; maxevents, timeout: cint; sigmask: PSigSet): cint;
|
||||||
|
begin
|
||||||
|
epoll_pwait := do_syscall(syscall_nr_epoll_pwait, tsysparam(epfd),
|
||||||
|
tsysparam(events), tsysparam(maxevents), tsysparam(timeout), tsysparam(sigmask));
|
||||||
|
end;
|
||||||
|
|
||||||
function capget(header:Puser_cap_header;data:Puser_cap_data):cint;
|
function capget(header:Puser_cap_header;data:Puser_cap_data):cint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user