mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-08 13:32:41 +02:00
lazutils: comments
git-svn-id: trunk@40236 -
This commit is contained in:
parent
1070c2309f
commit
f48c70a01c
@ -17,3 +17,4 @@ msgstr "Закрыть"
|
|||||||
#: codyunitdepwnd.rsselectaunit
|
#: codyunitdepwnd.rsselectaunit
|
||||||
msgid "Select an unit"
|
msgid "Select an unit"
|
||||||
msgstr "Выберите модуль"
|
msgstr "Выберите модуль"
|
||||||
|
|
||||||
|
@ -202,7 +202,6 @@ const
|
|||||||
* Description : Init the file component
|
* Description : Init the file component
|
||||||
*
|
*
|
||||||
******************************************************************)
|
******************************************************************)
|
||||||
|
|
||||||
function TTFile_Init : TError;
|
function TTFile_Init : TError;
|
||||||
begin
|
begin
|
||||||
TTFile_Init := Success;
|
TTFile_Init := Success;
|
||||||
@ -215,7 +214,6 @@ const
|
|||||||
* Description : Finalize the file component
|
* Description : Finalize the file component
|
||||||
*
|
*
|
||||||
******************************************************************)
|
******************************************************************)
|
||||||
|
|
||||||
procedure TTFile_Done;
|
procedure TTFile_Done;
|
||||||
begin
|
begin
|
||||||
//nothing
|
//nothing
|
||||||
@ -235,7 +233,6 @@ const
|
|||||||
* Output : True on sucess.
|
* Output : True on sucess.
|
||||||
*
|
*
|
||||||
******************************************************************)
|
******************************************************************)
|
||||||
|
|
||||||
function TT_Open_Stream( name : String;
|
function TT_Open_Stream( name : String;
|
||||||
var stream : TT_Stream ) : TError;
|
var stream : TT_Stream ) : TError;
|
||||||
var
|
var
|
||||||
@ -299,7 +296,6 @@ const
|
|||||||
* Output : True ( always )
|
* Output : True ( always )
|
||||||
*
|
*
|
||||||
******************************************************************)
|
******************************************************************)
|
||||||
|
|
||||||
procedure TT_Close_Stream( var stream : TT_Stream );
|
procedure TT_Close_Stream( var stream : TT_Stream );
|
||||||
begin
|
begin
|
||||||
if stream.z = nil then exit;
|
if stream.z = nil then exit;
|
||||||
@ -321,7 +317,6 @@ const
|
|||||||
* Output : True on success. False on failure
|
* Output : True on success. False on failure
|
||||||
*
|
*
|
||||||
******************************************************************)
|
******************************************************************)
|
||||||
|
|
||||||
function TT_Use_Stream( org_stream : TT_Stream;
|
function TT_Use_Stream( org_stream : TT_Stream;
|
||||||
out ftstream: TFreeTypeStream) : TError;
|
out ftstream: TFreeTypeStream) : TError;
|
||||||
begin
|
begin
|
||||||
@ -351,11 +346,10 @@ const
|
|||||||
* Output : True on success. False on failure
|
* Output : True on success. False on failure
|
||||||
*
|
*
|
||||||
******************************************************************)
|
******************************************************************)
|
||||||
|
|
||||||
procedure TT_Flush_Stream( stream : TT_Stream );
|
procedure TT_Flush_Stream( stream : TT_Stream );
|
||||||
begin
|
begin
|
||||||
if stream.z <> nil then
|
if stream.z = nil then exit;
|
||||||
TFreeTypeStream(stream.z).Deactivate;
|
TFreeTypeStream(stream.z).Deactivate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
(*******************************************************************
|
(*******************************************************************
|
||||||
@ -369,7 +363,6 @@ const
|
|||||||
* Output : Nothing.
|
* Output : Nothing.
|
||||||
*
|
*
|
||||||
******************************************************************)
|
******************************************************************)
|
||||||
|
|
||||||
procedure TT_Done_Stream( stream : TT_Stream );
|
procedure TT_Done_Stream( stream : TT_Stream );
|
||||||
begin
|
begin
|
||||||
if stream.z = nil then exit;
|
if stream.z = nil then exit;
|
||||||
@ -400,7 +393,6 @@ const
|
|||||||
* them.
|
* them.
|
||||||
*
|
*
|
||||||
******************************************************************)
|
******************************************************************)
|
||||||
|
|
||||||
function TFreeTypeStream.AccessFrame( aSize : Int ) : TError;
|
function TFreeTypeStream.AccessFrame( aSize : Int ) : TError;
|
||||||
begin
|
begin
|
||||||
result := Failure;
|
result := Failure;
|
||||||
@ -461,7 +453,6 @@ const
|
|||||||
* truncate it..
|
* truncate it..
|
||||||
*
|
*
|
||||||
******************************************************************)
|
******************************************************************)
|
||||||
|
|
||||||
function TFreeTypeStream.CheckAndAccessFrame( aSize : Int ) : TError;
|
function TFreeTypeStream.CheckAndAccessFrame( aSize : Int ) : TError;
|
||||||
var
|
var
|
||||||
readBytes : Longint;
|
readBytes : Longint;
|
||||||
@ -482,7 +473,6 @@ const
|
|||||||
* Output : True on success. False on failure
|
* Output : True on success. False on failure
|
||||||
*
|
*
|
||||||
******************************************************************)
|
******************************************************************)
|
||||||
|
|
||||||
function TFreeTypeStream.ForgetFrame : TError;
|
function TFreeTypeStream.ForgetFrame : TError;
|
||||||
begin
|
begin
|
||||||
result := Failure;
|
result := Failure;
|
||||||
@ -513,7 +503,6 @@ const
|
|||||||
* could easily page fault using this call).
|
* could easily page fault using this call).
|
||||||
*
|
*
|
||||||
******************************************************************)
|
******************************************************************)
|
||||||
|
|
||||||
function TFreeTypeStream.GET_Byte : Byte;
|
function TFreeTypeStream.GET_Byte : Byte;
|
||||||
begin
|
begin
|
||||||
GET_Byte := FCurrentFrame^[FFrameCursor];
|
GET_Byte := FCurrentFrame^[FFrameCursor];
|
||||||
@ -536,7 +525,6 @@ const
|
|||||||
* could easily page fault using this call).
|
* could easily page fault using this call).
|
||||||
*
|
*
|
||||||
******************************************************************)
|
******************************************************************)
|
||||||
|
|
||||||
function TFreeTypeStream.GET_Char : ShortInt;
|
function TFreeTypeStream.GET_Char : ShortInt;
|
||||||
begin
|
begin
|
||||||
GET_Char := ShortInt( FCurrentFrame^[FFrameCursor] );
|
GET_Char := ShortInt( FCurrentFrame^[FFrameCursor] );
|
||||||
@ -559,7 +547,6 @@ const
|
|||||||
* could easily page fault using this call).
|
* could easily page fault using this call).
|
||||||
*
|
*
|
||||||
******************************************************************)
|
******************************************************************)
|
||||||
|
|
||||||
function TFreeTypeStream.GET_Short : Short;
|
function TFreeTypeStream.GET_Short : Short;
|
||||||
begin
|
begin
|
||||||
GET_Short := (Short(FCurrentFrame^[ FFrameCursor ]) shl 8) or
|
GET_Short := (Short(FCurrentFrame^[ FFrameCursor ]) shl 8) or
|
||||||
@ -583,7 +570,6 @@ const
|
|||||||
* could easily page fault using this call).
|
* could easily page fault using this call).
|
||||||
*
|
*
|
||||||
******************************************************************)
|
******************************************************************)
|
||||||
|
|
||||||
function TFreeTypeStream.GET_UShort : UShort;
|
function TFreeTypeStream.GET_UShort : UShort;
|
||||||
begin
|
begin
|
||||||
GET_UShort := (UShort(FCurrentFrame^[ FFrameCursor ]) shl 8) or
|
GET_UShort := (UShort(FCurrentFrame^[ FFrameCursor ]) shl 8) or
|
||||||
@ -607,7 +593,6 @@ const
|
|||||||
* could easily page fault using this call).
|
* could easily page fault using this call).
|
||||||
*
|
*
|
||||||
******************************************************************)
|
******************************************************************)
|
||||||
|
|
||||||
function TFreeTypeStream.GET_Long : Long;
|
function TFreeTypeStream.GET_Long : Long;
|
||||||
begin
|
begin
|
||||||
GET_Long := (Long(FCurrentFrame^[ FFrameCursor ]) shl 24) or
|
GET_Long := (Long(FCurrentFrame^[ FFrameCursor ]) shl 24) or
|
||||||
@ -633,7 +618,6 @@ const
|
|||||||
* could easily page fault using this call).
|
* could easily page fault using this call).
|
||||||
*
|
*
|
||||||
******************************************************************)
|
******************************************************************)
|
||||||
|
|
||||||
function TFreeTypeStream.GET_ULong : ULong;
|
function TFreeTypeStream.GET_ULong : ULong;
|
||||||
begin
|
begin
|
||||||
GET_ULong := (ULong(FCurrentFrame^[ FFrameCursor ]) shl 24) or
|
GET_ULong := (ULong(FCurrentFrame^[ FFrameCursor ]) shl 24) or
|
||||||
@ -659,7 +643,6 @@ const
|
|||||||
* could easily page fault using this call).
|
* could easily page fault using this call).
|
||||||
*
|
*
|
||||||
******************************************************************)
|
******************************************************************)
|
||||||
|
|
||||||
function TFreeTypeStream.GET_Tag4 : ULong;
|
function TFreeTypeStream.GET_Tag4 : ULong;
|
||||||
var
|
var
|
||||||
C : array[0..3] of Byte;
|
C : array[0..3] of Byte;
|
||||||
@ -668,18 +651,18 @@ const
|
|||||||
inc( FFrameCursor, 4 );
|
inc( FFrameCursor, 4 );
|
||||||
|
|
||||||
GET_Tag4 := ULong(C);
|
GET_Tag4 := ULong(C);
|
||||||
end;
|
|
||||||
|
|
||||||
{ TFreeTypeStream }
|
|
||||||
|
|
||||||
function TFreeTypeStream.GetFileSize: longint;
|
|
||||||
begin
|
|
||||||
if FStream = nil then
|
|
||||||
result := 0
|
|
||||||
else
|
|
||||||
result := FStream.Size;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TFreeTypeStream }
|
||||||
|
|
||||||
|
function TFreeTypeStream.GetFileSize: longint;
|
||||||
|
begin
|
||||||
|
if FStream = nil then
|
||||||
|
result := 0
|
||||||
|
else
|
||||||
|
result := FStream.Size;
|
||||||
|
end;
|
||||||
|
|
||||||
function TFreeTypeStream.GetPosition: longint;
|
function TFreeTypeStream.GetPosition: longint;
|
||||||
begin
|
begin
|
||||||
if Open then result := GetFilePos else result := FPosit;
|
if Open then result := GetFilePos else result := FPosit;
|
||||||
@ -702,22 +685,22 @@ begin
|
|||||||
GetMem( FFrameCache, frame_cache_size );
|
GetMem( FFrameCache, frame_cache_size );
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TFreeTypeStream.Create(APathName: string);
|
constructor TFreeTypeStream.Create(APathName: string);
|
||||||
begin
|
begin
|
||||||
if APathName = '' then
|
if APathName = '' then
|
||||||
raise exception.Create('Empty path name');
|
raise exception.Create('Empty path name');
|
||||||
Init;
|
Init;
|
||||||
FName:= APathName;
|
FName:= APathName;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TFreeTypeStream.Create(AStream: TStream; AStreamOwner: boolean);
|
constructor TFreeTypeStream.Create(AStream: TStream; AStreamOwner: boolean);
|
||||||
begin
|
begin
|
||||||
Init;
|
Init;
|
||||||
FStream:= AStream;
|
FStream:= AStream;
|
||||||
FOwnedStream := AStreamOwner;
|
FOwnedStream := AStreamOwner;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TFreeTypeStream.Destroy;
|
destructor TFreeTypeStream.Destroy;
|
||||||
begin
|
begin
|
||||||
Deactivate;
|
Deactivate;
|
||||||
if FOwnedStream then FreeAndNil(FStream);
|
if FOwnedStream then FreeAndNil(FStream);
|
||||||
@ -824,15 +807,15 @@ end;
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFreeTypeStream.ReadAtFile(APos: Long; var ABuff; ACount: Int): TError;
|
function TFreeTypeStream.ReadAtFile(APos: Long; var ABuff; ACount: Int): TError;
|
||||||
begin
|
begin
|
||||||
result := Failure;
|
result := Failure;
|
||||||
|
|
||||||
if SeekFile( APos ) or
|
if SeekFile( APos ) or
|
||||||
ReadFile( ABuff, ACount ) then exit;
|
ReadFile( ABuff, ACount ) then exit;
|
||||||
|
|
||||||
result := Success;
|
result := Success;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFreeTypeStream.GetSize: longint;
|
function TFreeTypeStream.GetSize: longint;
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user