mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 21:30:04 +02:00
IDE: clean up
git-svn-id: trunk@42199 -
This commit is contained in:
parent
3e9f8d11d5
commit
9f276db94e
@ -9,6 +9,8 @@
|
||||
|
||||
Abstract:
|
||||
Change the resource type (e.g. .lfm) of forms.
|
||||
Every unit can have one resource file. Default is .lfm.
|
||||
This unit allows to define other formats, like .xib.
|
||||
}
|
||||
unit UnitResources;
|
||||
|
||||
@ -65,118 +67,3 @@ end;
|
||||
|
||||
end.
|
||||
|
||||
unit UnitResources;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LCLMemManager, Forms;
|
||||
|
||||
type
|
||||
|
||||
{ TUnitResourcefileFormat }
|
||||
|
||||
TUnitResourcefileFormat = class
|
||||
public
|
||||
class function FindResourceDirective(Source: TObject): boolean; virtual; abstract;
|
||||
class function ResourceDirectiveFilename: string; virtual; abstract;
|
||||
class function GetUnitResourceFilename(AUnitFilenae: string): string; virtual; abstract;
|
||||
class procedure TextStreamToBinStream(ATxtStream, ABinStream: TExtMemoryStream); virtual; abstract;
|
||||
class procedure BinStreamToTextStream(ABinStream, ATextStream: TExtMemoryStream); virtual; abstract;
|
||||
class function GetClassNameFromStream(s: TStream; out IsInherited: Boolean): shortstring; virtual; abstract;
|
||||
class function CreateReader(s: TStream; var DestroyDriver: boolean): TReader; virtual; abstract;
|
||||
class function CreateWriter(s: TStream; var DestroyDriver: boolean): TWriter; virtual; abstract;
|
||||
class function QuickCheckResourceBuffer(PascalBuffer, LFMBuffer: TObject; // TCodeBuffer
|
||||
out LFMType, LFMComponentName, LFMClassName: string;
|
||||
out LCLVersion: string;
|
||||
out MissingClasses: TStrings// e.g. MyFrame2:TMyFrame
|
||||
): TModalResult; virtual; abstract;
|
||||
|
||||
|
||||
end;
|
||||
TUnitResourcefileFormatClass = class of TUnitResourcefileFormat;
|
||||
TUnitResourcefileFormatArr = array of TUnitResourcefileFormatClass;
|
||||
|
||||
procedure RegisterUnitResourcefileFormat(AResourceFileFormat: TUnitResourcefileFormatClass);
|
||||
function GetUnitResourcefileFormats: TUnitResourcefileFormatArr;
|
||||
|
||||
implementation
|
||||
|
||||
var
|
||||
GUnitResourcefileFormats: TUnitResourcefileFormatArr;
|
||||
|
||||
procedure RegisterUnitResourcefileFormat(AResourceFileFormat: TUnitResourcefileFormatClass);
|
||||
begin
|
||||
SetLength(GUnitResourcefileFormats, length(GUnitResourcefileFormats)+1);
|
||||
GUnitResourcefileFormats[high(GUnitResourcefileFormats)] := AResourceFileFormat;
|
||||
end;
|
||||
|
||||
function GetUnitResourcefileFormats: TUnitResourcefileFormatArr;
|
||||
begin
|
||||
result := GUnitResourcefileFormats;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
{
|
||||
Abstract:
|
||||
Every unit can have one resource file. Default is .lfm.
|
||||
This unit allows to define other formats, like .xib.
|
||||
}
|
||||
unit UnitResources;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LCLMemManager, Forms;
|
||||
|
||||
type
|
||||
|
||||
{ TUnitResourcefileFormat }
|
||||
|
||||
TUnitResourcefileFormat = class
|
||||
public
|
||||
class function FindResourceDirective(Source: TObject): boolean; virtual; abstract;
|
||||
class function ResourceDirectiveFilename: string; virtual; abstract;
|
||||
class function GetUnitResourceFilename(AUnitFilenae: string): string; virtual; abstract;
|
||||
class procedure TextStreamToBinStream(ATxtStream, ABinStream: TExtMemoryStream); virtual; abstract;
|
||||
class procedure BinStreamToTextStream(ABinStream, ATextStream: TExtMemoryStream); virtual; abstract;
|
||||
class function GetClassNameFromStream(s: TStream; out IsInherited: Boolean): shortstring; virtual; abstract;
|
||||
class function CreateReader(s: TStream; var DestroyDriver: boolean): TReader; virtual; abstract;
|
||||
class function CreateWriter(s: TStream; var DestroyDriver: boolean): TWriter; virtual; abstract;
|
||||
class function QuickCheckResourceBuffer(PascalBuffer, LFMBuffer: TObject; // TCodeBuffer
|
||||
out LFMType, LFMComponentName, LFMClassName: string;
|
||||
out LCLVersion: string;
|
||||
out MissingClasses: TStrings// e.g. MyFrame2:TMyFrame
|
||||
): TModalResult; virtual; abstract;
|
||||
|
||||
|
||||
end;
|
||||
TUnitResourcefileFormatClass = class of TUnitResourcefileFormat;
|
||||
TUnitResourcefileFormatArr = array of TUnitResourcefileFormatClass;
|
||||
|
||||
procedure RegisterUnitResourcefileFormat(AResourceFileFormat: TUnitResourcefileFormatClass);
|
||||
function GetUnitResourcefileFormats: TUnitResourcefileFormatArr;
|
||||
|
||||
implementation
|
||||
|
||||
var
|
||||
GUnitResourcefileFormats: TUnitResourcefileFormatArr;
|
||||
|
||||
procedure RegisterUnitResourcefileFormat(AResourceFileFormat: TUnitResourcefileFormatClass);
|
||||
begin
|
||||
SetLength(GUnitResourcefileFormats, length(GUnitResourcefileFormats)+1);
|
||||
GUnitResourcefileFormats[high(GUnitResourcefileFormats)] := AResourceFileFormat;
|
||||
end;
|
||||
|
||||
function GetUnitResourcefileFormats: TUnitResourcefileFormatArr;
|
||||
begin
|
||||
result := GUnitResourcefileFormats;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user